diff --git a/src/main/java/com/heai/modules/pms/controller/QcController.java b/src/main/java/com/heai/modules/pms/controller/QcController.java index 079cc64..662dbf9 100644 --- a/src/main/java/com/heai/modules/pms/controller/QcController.java +++ b/src/main/java/com/heai/modules/pms/controller/QcController.java @@ -1750,9 +1750,6 @@ public class QcController { /** * 根据实验室单号查询批次明细清单 * 用于SQC检验单的"批次明细"按钮 - * - * @param params 包含 laboratoryOrderNo 的参数对象 - * @return 批次库存清单列表 */ @PostMapping("/getBatchDetailsByLaboratoryOrder") public R getBatchDetailsByLaboratoryOrder(@RequestBody Map params) { diff --git a/src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java b/src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java index b646042..f384573 100644 --- a/src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java +++ b/src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java @@ -6143,7 +6143,7 @@ public class QcServiceImpl implements QcService { String laboratoryOrderNo = recordData.getRefInfo1(); // 查询对应的呆滞明细(只通过实验室单号查询) - List details = + List details = stagnationDetailMapper.selectByLaboratoryOrder(laboratoryOrderNo); if (details == null || details.isEmpty()) { @@ -6154,30 +6154,28 @@ public class QcServiceImpl implements QcService { // 获取标签ID列表 List labelRecordIds = new ArrayList<>(); - for (com.heai.modules.production.entity.StagnationDetail detail : details) { + for (StagnationDetail detail : details) { labelRecordIds.add(detail.getLabelRecordId()); } // 更新呆滞明细表的完成状态 - com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper updateWrapper = - new com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper<>(); + UpdateWrapper updateWrapper = + new UpdateWrapper<>(); updateWrapper.in("label_record_id", labelRecordIds) .eq("is_inspection_completed", 0); - com.heai.modules.production.entity.StagnationDetail updateDetail = - new com.heai.modules.production.entity.StagnationDetail(); + StagnationDetail updateDetail = + new StagnationDetail(); updateDetail.setIsInspectionCompleted(1); // 已完成 int updateCount = stagnationDetailMapper.update(updateDetail, updateWrapper); - log.info("更新呆滞明细完成状态 - 数量: {}, laboratoryOrderNo: {}", - updateCount, laboratoryOrderNo); // 更新print_label_record表的呆滞刷新日期 Date now = new Date(); for (Long labelRecordId : labelRecordIds) { printLabelRecordMapper.updateStagnationRefreshDate(labelRecordId, now); } - log.info("更新呆滞刷新日期 - 数量: {}, 日期: {}", labelRecordIds.size(), now); + log.debug("更新呆滞刷新日期 - 数量: {}, 日期: {}", labelRecordIds.size(), now); // 如果是临期品检验,还需要更新 InventoryStock.ExpiredDate_new boolean isExpiredInspection = details.stream() @@ -6187,7 +6185,7 @@ public class QcServiceImpl implements QcService { for (Long labelRecordId : labelRecordIds) { printLabelRecordMapper.updateInventoryStockExpiredDate(labelRecordId, newExpiredDate); } - log.info("✅ 更新临期品库存过期日期 - 数量: {}, 新日期: {}", labelRecordIds.size(), newExpiredDate); + log.debug("✅ 更新临期品库存过期日期 - 数量: {}, 新日期: {}", labelRecordIds.size(), newExpiredDate); } } catch (Exception e) { @@ -6218,7 +6216,7 @@ public class QcServiceImpl implements QcService { } // 查询对应的呆滞明细(只通过实验室单号查询) - List details = + List details = stagnationDetailMapper.selectByLaboratoryOrder(laboratoryOrderNo); if (details == null || details.isEmpty()) { @@ -6229,7 +6227,7 @@ public class QcServiceImpl implements QcService { // 获取标签ID列表 List labelRecordIds = new ArrayList<>(); - for (com.heai.modules.production.entity.StagnationDetail detail : details) { + for (StagnationDetail detail : details) { labelRecordIds.add(detail.getLabelRecordId()); } @@ -6238,11 +6236,11 @@ public class QcServiceImpl implements QcService { for (Long labelRecordId : labelRecordIds) { printLabelRecordMapper.updateStagnationRefreshDate(labelRecordId, now); } - log.info("SQC保存时更新呆滞刷新日期 - 数量: {}, 日期: {}, inspectionNo: {}", + log.debug("SQC保存时更新呆滞刷新日期 - 数量: {}, 日期: {}, inspectionNo: {}", labelRecordIds.size(), now, data.getInspectionNo()); // 打印每条明细的类型,用于调试 - for (com.heai.modules.production.entity.StagnationDetail detail : details) { + for (StagnationDetail detail : details) { log.debug("🔍 检查明细类型 - labelRecordId: {}, type: '{}', preAuditTime: {}", detail.getLabelRecordId(), detail.getType(), detail.getPreAuditTime()); } @@ -6256,7 +6254,7 @@ public class QcServiceImpl implements QcService { for (Long labelRecordId : labelRecordIds) { printLabelRecordMapper.updateInventoryStockExpiredDate(labelRecordId, newExpiredDate); } - log.info("✅ SQC保存时更新临期品库存过期日期 - 数量: {}, 新日期: {}, inspectionNo: {}", + log.debug("✅ SQC保存时更新临期品库存过期日期 - 数量: {}, 新日期: {}, inspectionNo: {}", labelRecordIds.size(), newExpiredDate, data.getInspectionNo()); } @@ -6271,7 +6269,7 @@ public class QcServiceImpl implements QcService { updateDetail.setIsInspectionCompleted(1); // 设置为已完成 int updateCount = stagnationDetailMapper.update(updateDetail, updateWrapper); - log.info("SQC保存时更新呆滞明细完成状态 - 数量: {}, laboratoryOrderNo: {}", + log.debug("SQC保存时更新呆滞明细完成状态 - 数量: {}, laboratoryOrderNo: {}", updateCount, laboratoryOrderNo); } catch (Exception e) { @@ -6304,7 +6302,7 @@ public class QcServiceImpl implements QcService { } // 查询对应的呆滞明细(包含 pre_audit_time) - List details = + List details = stagnationDetailMapper.selectByLaboratoryOrder(laboratoryOrderNo); if (details == null || details.isEmpty()) { @@ -6315,7 +6313,7 @@ public class QcServiceImpl implements QcService { // 将 pre_audit_time 回滚到 print_label_record.stagnation_refresh_date int rollbackCount = 0; - for (com.heai.modules.production.entity.StagnationDetail detail : details) { + for (StagnationDetail detail : details) { if (detail.getPreAuditTime() != null) { printLabelRecordMapper.updateStagnationRefreshDate( detail.getLabelRecordId(), @@ -6327,7 +6325,7 @@ public class QcServiceImpl implements QcService { } } - log.info("SQC取消审核时回滚呆滞刷新日期 - 数量: {}, inspectionNo: {}", + log.debug("SQC取消审核时回滚呆滞刷新日期 - 数量: {}, inspectionNo: {}", rollbackCount, data.getInspectionNo()); // 回滚 stagnation_detail.is_inspection_completed 为 0(未完成) @@ -6339,7 +6337,7 @@ public class QcServiceImpl implements QcService { rollbackDetail.setIsInspectionCompleted(0); // 设置为未完成 int rollbackUpdateCount = stagnationDetailMapper.update(rollbackDetail, rollbackWrapper); - log.info("✅ SQC取消审核时回滚完成状态 - 数量: {}, laboratoryOrderNo: {}", + log.debug("✅ SQC取消审核时回滚完成状态 - 数量: {}, laboratoryOrderNo: {}", rollbackUpdateCount, laboratoryOrderNo); // 如果是临期品检验,还需要回滚 InventoryStock.ExpiredDate_new @@ -6347,7 +6345,7 @@ public class QcServiceImpl implements QcService { .anyMatch(detail -> "临期品".equals(detail.getType())); if (isExpiredInspection) { int expiredRollbackCount = 0; - for (com.heai.modules.production.entity.StagnationDetail detail : details) { + for (StagnationDetail detail : details) { if (detail.getPreAuditTime() != null) { // 对于临期品,pre_audit_time 保存的是原来的过期日期 printLabelRecordMapper.updateInventoryStockExpiredDate( @@ -6359,13 +6357,10 @@ public class QcServiceImpl implements QcService { detail.getLabelRecordId(), detail.getPreAuditTime()); } } - log.info("✅ SQC取消审核时回滚临期品库存过期日期 - 数量: {}, inspectionNo: {}", - expiredRollbackCount, data.getInspectionNo()); } } catch (Exception e) { log.error("SQC取消审核时回滚呆滞刷新日期失败 - inspectionNo: {}", data.getInspectionNo(), e); - // 不抛出异常,避免影响正常的取消审核流程 } } diff --git a/src/main/java/com/heai/modules/pms/service/QcService.java b/src/main/java/com/heai/modules/pms/service/QcService.java index 5cb4ee7..056004a 100644 --- a/src/main/java/com/heai/modules/pms/service/QcService.java +++ b/src/main/java/com/heai/modules/pms/service/QcService.java @@ -469,11 +469,5 @@ public interface QcService { List> searchQcSopFileList(Map params); - /** - * 根据实验室单号查询批次明细清单 - * - * @param laboratoryOrderNo 实验室单号 - * @return 批次明细列表 - */ List getBatchDetailsByLaboratoryOrder(String laboratoryOrderNo); } diff --git a/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java b/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java index db6d5ea..195ea91 100644 --- a/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java +++ b/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java @@ -35,36 +35,16 @@ public interface PrintLabelRecordMapper extends BaseMapper { IPage queryBagList(@Param("page") Page page, @Param("params") PrintLabelRecord printLabelRecord); - /** - * 查询呆滞品标签(在库时长>3个月) - * - * @return 呆滞品标签列表 - */ + List selectStagnationLabels(); - /** - * 查询临期品标签 - * - * @return 临期品标签列表 - */ + List selectExpiredLabels(); - /** - * 更新呆滞刷新日期 - * - * @param id 标签ID - * @param refreshDate 刷新日期 - * @return 更新数量 - */ + int updateStagnationRefreshDate(@Param("id") Long id, @Param("refreshDate") Date refreshDate); - /** - * 更新库存过期日期(用于临期品检验完成) - * - * @param labelRecordId 标签ID - * @param newExpiredDate 新的过期日期 - * @return 更新数量 - */ + int updateInventoryStockExpiredDate(@Param("labelRecordId") Long labelRecordId, @Param("newExpiredDate") Date newExpiredDate); } diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 985d7c3..5984f08 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -64,4 +64,4 @@ scheduler: stagnation: # 是否启用定时任务(true-启用,false-禁用) enabled: false - cron: "0 35 11 * * ?" + cron: "0 33 14 * * ?"