f53654f10cd256eecaa91f44030d1983448ac677..25e115da7815430fdc5d078d4a01d76edacb4e6f
2025-05-06 zhuo
质量监督添加被监督人签名
25e115 对比 | 目录
2025-05-06 zhuo
装备lims设备提前5天到期需要提醒设备管理员
c0062e 对比 | 目录
2025-05-06 zhuo
修改检验项问题修复
883d4f 对比 | 目录
已修改7个文件
86 ■■■■ 文件已修改
cnas-device/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-device/src/main/java/com/ruoyi/device/task/DeviceRecordSchedule.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-device/src/main/resources/mapper/DeviceMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-personnel/src/main/java/com/ruoyi/personnel/task/PersonTrainingSchedule.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-process/src/main/java/com/ruoyi/process/service/impl/QualitySuperviseServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-process/src/main/resources/static/supervision-detail-record.docx 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-device/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java
@@ -36,5 +36,11 @@
    List<Map<String, Object>> treeDevice(@Param("deviceName") String deviceName);
    DeviceDto selectDeviceByCode(Integer id);
    /**
     * 查询到达校准有效期的设备-提前5天
     * @return
     */
    List<Device> selectOverdueDevice();
}
cnas-device/src/main/java/com/ruoyi/device/task/DeviceRecordSchedule.java
@@ -3,7 +3,9 @@
import com.ruoyi.common.core.domain.entity.User;
import com.ruoyi.common.utils.WxCpUtils;
import com.ruoyi.device.dto.DeviceRecordDto;
import com.ruoyi.device.mapper.DeviceMapper;
import com.ruoyi.device.mapper.DeviceRecordMapper;
import com.ruoyi.device.pojo.Device;
import com.ruoyi.device.pojo.DeviceRecord;
import com.ruoyi.system.mapper.UserMapper;
import org.springframework.scheduling.annotation.Scheduled;
@@ -20,6 +22,9 @@
 */
@Component
public class DeviceRecordSchedule {
    @Resource
    private DeviceMapper deviceMapper;
    @Resource
    private DeviceRecordMapper deviceRecordMapper;
    @Resource
@@ -58,8 +63,41 @@
            });
        });
    }
    /**
     * 每天9点执行一次 除了星期天
     * 判断是否有设备到达校准有效期
     */
//    @Scheduled(cron = "0/5 * * * * *")
    @Scheduled(cron = "0 0 9 * * 1-6") // 每天9点执行一次 除了星期天
    public void task2() {
        // 查询到达校准有效期的设备-提前5天
        List<Device> deviceList = deviceMapper.selectOverdueDevice();
        Map<Integer, List<Device>> userPersonIdMap = deviceList.stream().collect(Collectors.groupingBy(Device::getEquipmentManager));
        userPersonIdMap.forEach((userId, recordList) -> {
            threadPoolTaskExecutor.execute(() -> {
                // 企业微信通知填写设备使用记录
                User user = userMapper.selectById(userId);
                String message = "";
                message += "设备使用记录未填写提醒通知";
                for (Device deviceRecord : recordList) {
                    message += "\n设备名称编号: " + deviceRecord.getDeviceName() + "-" + deviceRecord.getManagementNumber();
                    message += "\n委托编号: " + deviceRecord.getSampleCode();
                    message += "\n";
                }
                message += "\n请去填写设备使用记录";
                //发送企业微信消息通知
                try {
                    WxCpUtils.inform(user.getAccount(), message, null);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            });
        });
    }
}
cnas-device/src/main/resources/mapper/DeviceMapper.xml
@@ -142,6 +142,7 @@
    <resultMap id="deviceNameMap" type="map">
        <result property="value" column="id"/>
        <result property="label" column="device_name"/>
        <result property="activationDate" column="activation_date"/>
        <result property="managementNumber" column="management_number"/>
    </resultMap>
@@ -152,7 +153,8 @@
        case when d.storage_point is null || d.storage_point ='' then '其他' else d.storage_point end as storage_point,
        d.device_name,
        d.management_number,
        null as value
        null as value,
        d.activation_date
        from device d
        LEFT JOIN laboratory l ON l.id = d.subordinate_departments_id
        <where>
@@ -160,7 +162,6 @@
                and device_name like concat('%',#{deviceName},'%')
            </if>
        </where>
        order by l.laboratory_name desc, d.storage_point desc
    </select>
    <select id="selectDeviceByCode" resultType="com.ruoyi.device.dto.DeviceDto">
@@ -181,4 +182,15 @@
                 u1.name,
                 u2.name
    </select>
    <!-- 查询到达校准有效期的设备-提前5天 -->
    <select id="selectOverdueDevice" resultType="com.ruoyi.device.pojo.Device">
        SELECT *
        FROM device
        WHERE
        -- 筛选出 activation_date 在当前日期前五天内的数据
        activation_date BETWEEN now() AND now() + INTERVAL 5 DAY
        -- 筛选出 activation_date 已经超过当前日期的数据
        OR activation_date &lt; now()
    </select>
</mapper>
cnas-personnel/src/main/java/com/ruoyi/personnel/task/PersonTrainingSchedule.java
@@ -28,10 +28,10 @@
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    /**
     * 提醒填写设备使用记录
     * 提醒填写人员培训记录
     */
//    @Scheduled(cron = "0/5 * * * * *")
    @Scheduled(cron = "0 0 9 1 * *") // 每月一号执行
    @Scheduled(cron = "0 0 9 1,15 * *") // 每月一号执行
    public void task1() {
        // 查询当月培训计划
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M");
cnas-process/src/main/java/com/ruoyi/process/service/impl/QualitySuperviseServiceImpl.java
@@ -524,25 +524,25 @@
    public void exportSuperviseDetailRecord(Integer superviseDetailsId, HttpServletResponse response) {
        QualitySuperviseDetailsRecord recordDto = qualitySuperviseDetailsRecordMapper.selectSuperviseDetailRecord(superviseDetailsId);
        //获取技术负责人的签名地址
        String ratifyUrl = null;
        if (recordDto.getRatifyUserId() != null) {
            ratifyUrl = userMapper.selectById(recordDto.getRatifyUserId()).getSignatureUrl();
            if (StringUtils.isBlank(ratifyUrl)) {
                throw new ErrorException("找不到技术负责人的签名");
            }
        // 查询检测人员
        User tserUser = new User();
        if (StringUtils.isNotBlank(recordDto.getTestMember())) {
            tserUser = userMapper.selectOne(Wrappers.<User>lambdaQuery()
                    .eq(User::getName, recordDto.getTestMember())
                    .last("limit 1"));
        }
        // 获取路径
        InputStream inputStream = this.getClass().getResourceAsStream("/static/supervision-detail-record.docx");
        ConfigureBuilder builder = Configure.builder();
        builder.useSpringEL(true);
        String finalRatifyUrl = ratifyUrl;
        User finalTserUser = tserUser;
        XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render(
                new HashMap<String, Object>() {{
                    put("supervision", recordDto);
                    put("testMemberUrl", UserUtils.getFinalUserSignatureUrl(finalTserUser.getId()));
                    put("supervisoruUrl", UserUtils.getFinalUserSignatureUrl(recordDto.getSupervisor()));
                    put("technicalDirectorUrl", StringUtils.isNotBlank(finalRatifyUrl) ? Pictures.ofLocal(imgUrl + "/" + finalRatifyUrl).create() : null);
                    put("technicalDirectorUrl", UserUtils.getFinalUserSignatureUrl(recordDto.getRatifyUserId()));
                    put("technicalDirectorDateUrl", recordDto.getRatifyTime() != null ?
                            Pictures.ofStream(DateImageUtil.createDateImage(recordDto.getRatifyTime())).create() : null);
                }});
cnas-process/src/main/resources/static/supervision-detail-record.docx
Binary files differ
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -906,6 +906,10 @@
        // 修改检验项
        for (SampleProductDto sampleProductDto : insOrderUpdateDto.getSampleProduct()) {
            insSampleService.update(Wrappers.<InsSample>lambdaUpdate()
                    .eq(InsSample::getId, sampleProductDto.getId())
                    .set(InsSample::getSpecialStandardMethod, sampleProductDto.getSpecialStandardMethod()));
            insProductService.updateBatchById(sampleProductDto.getInsProduct());
        }