diff --git a/src/main/java/com/heai/modules/pms/data/QcTemplateData.java b/src/main/java/com/heai/modules/pms/data/QcTemplateData.java index a0e593c..3613b0a 100644 --- a/src/main/java/com/heai/modules/pms/data/QcTemplateData.java +++ b/src/main/java/com/heai/modules/pms/data/QcTemplateData.java @@ -12,6 +12,10 @@ import java.util.List; @Data public class QcTemplateData extends QueryPage { + /** + * qc_attribute_template 自增主键 + */ + private Integer id; // 属性编码 private String attributeNo; // 属性类别 diff --git a/src/main/java/com/heai/modules/pms/mapper/QcMapper.java b/src/main/java/com/heai/modules/pms/mapper/QcMapper.java index 31b82d1..c1166de 100644 --- a/src/main/java/com/heai/modules/pms/mapper/QcMapper.java +++ b/src/main/java/com/heai/modules/pms/mapper/QcMapper.java @@ -293,6 +293,8 @@ public interface QcMapper { */ int copyIQCRecordForMachineInspect(QcFAIRecordData data); + String selectNextIQCInspectionNoByDate(QcFAIRecordData data); + List selectMachineInspectNosBySourceInspectionNo(QcFAIRecordData data); void saveSQCRecord(QcFAIRecordData qcFAIRecordData); 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 0251934..7aa056f 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 @@ -1414,13 +1414,15 @@ public class QcServiceImpl implements QcService { public void deletePartAttributeDetails(QcTemplateData data) { if (data.getItemList() != null && !data.getItemList().isEmpty()) { // 批量删除 for (QcTemplateData partData : data.getItemList()) { - partData.setSite(data.getSite()); - partData.setBuNo(data.getBuNo()); - partData.setAttributeNo(data.getAttributeNo()); - partData.setAttributeType(data.getAttributeType()); + if (partData.getId() == null) { + throw new RuntimeException("缺少模板ID,无法删除!"); + } qcMapper.deletePartAttributeDetails(partData); } } else { // 单条删除 + if (data.getId() == null) { + throw new RuntimeException("缺少模板ID,无法删除!"); + } qcMapper.deletePartAttributeDetails(data); } } @@ -1431,6 +1433,9 @@ public class QcServiceImpl implements QcService { @Override @Transactional public void saveAttributeDetailed(QcTemplateData data) { + if (data.getId() == null) { + throw new RuntimeException("缺少模板ID,无法保存!"); + } qcMapper.saveAttributeDetailed(data); // 更新修改时间 qcMapper.updatePartAttributeTime(data); @@ -4016,7 +4021,7 @@ public class QcServiceImpl implements QcService { return false; } String type = recordData.getSubmissionType(); - return "合格".equals(recordData.getInspectionResult()) + return "合格".equals(getQmsInspectResult(recordData)) && ("刀模进货检验-外观".equals(type) || "刀模维修检验-外观".equals(type)); } @@ -4043,14 +4048,14 @@ public class QcServiceImpl implements QcService { } /** - * 外观合格审核后生成对应的上机检验任务单 + * 外观单按合格逻辑审核后生成对应的上机检验任务单(结论仍保持原值) */ private void generateIQCMachineInspectTask(QcFAIRecordData appearanceRecord) { String machineType = toMachineInspectType(appearanceRecord.getSubmissionType()); if (StringUtils.isBlank(machineType)) { return; } - String newInspectionNo = "IQC" + qcMapper.selectIQCInspectionNo(appearanceRecord); + String newInspectionNo = qcMapper.selectNextIQCInspectionNoByDate(appearanceRecord); QcFAIRecordData copyParam = new QcFAIRecordData(); copyParam.setSite(appearanceRecord.getSite()); @@ -6037,6 +6042,7 @@ public class QcServiceImpl implements QcService { SysUserEntity user = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); submitData.setUpdateBy(user != null ? user.getUsername() : data.getInspectorNo()); submitData.setSubmitList(Collections.singletonList(submitRecord)); + submitData.setTriggerMachineInspect(data.getTriggerMachineInspect()); switch (type) { case IQC: saveIQCSubmitResult(submitData); diff --git a/src/main/resources/mapper/pms/QcMapper.xml b/src/main/resources/mapper/pms/QcMapper.xml index efd5808..f89c272 100644 --- a/src/main/resources/mapper/pms/QcMapper.xml +++ b/src/main/resources/mapper/pms/QcMapper.xml @@ -1357,6 +1357,7 @@ SELECT + qat.id, qt.template_id, qt.template_name, qit.inspection_type_name, @@ -1502,24 +1504,10 @@ - + DELETE FROM qc_attribute_template - - site = #{site} and bu_no = #{buNo} and attribute_no = #{attributeNo} and template_id = #{templateId} and attribute_type = #{attributeType} - - and operation = #{operation} - - - and resource_id = #{resourceID} - - - and manufacturer_id = #{manufacturerID} - - - and customer_id = #{customerID} - - + WHERE id = #{id} @@ -1548,18 +1536,7 @@ AC = #{ac,jdbcType=DECIMAL}, ipqc_inspection_method = #{ipqcInspectionMethod}, RE = #{re,jdbcType=DECIMAL} - - site = #{site} and attribute_no = #{attributeNo} AND template_id = #{templateId} AND attribute_type = #{attributeType} and bu_no = #{buNo} - - AND operation = #{operation} - - - AND resource_id = #{resourceID} - - - AND manufacturer_id = #{manufacturerID} - - + WHERE id = #{id} @@ -2579,6 +2556,18 @@ #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId},#{refInfo1},#{refInfo2}) + + + INSERT INTO qc_iqc_record @@ -4410,7 +4399,11 @@ expiration_warning_date, expiration_date, ref_info1, - ref_info2 + ref_info2, + submission_type, + supplier_no, + inspection_type_no, + part_desc FROM qc_iqc_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo}