diff --git a/src/main/java/com/xujie/sys/modules/pms/data/ProofDocumentData.java b/src/main/java/com/xujie/sys/modules/pms/data/ProofDocumentData.java index 119bcf71..1120ffce 100644 --- a/src/main/java/com/xujie/sys/modules/pms/data/ProofDocumentData.java +++ b/src/main/java/com/xujie/sys/modules/pms/data/ProofDocumentData.java @@ -48,6 +48,21 @@ public class ProofDocumentData extends ProofingInformationData { private String orderRef1; + private String manualFlag; + + private String uploadedFlag; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createDate; + + private String createBy; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateDate; + + private String updateBy; public String getDocumentTypeId() { return documentTypeId; @@ -113,23 +128,6 @@ public class ProofDocumentData extends ProofingInformationData { this.updateBy = updateBy; } - - private String manualFlag; - - private String uploadedFlag; - - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createDate; - - private String createBy; - - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateDate; - - private String updateBy; - public String getcAdditionalInfo() { return cAdditionalInfo; } diff --git a/src/main/java/com/xujie/sys/modules/pms/data/ProofingInformationData.java b/src/main/java/com/xujie/sys/modules/pms/data/ProofingInformationData.java index ab022c25..34b3e958 100644 --- a/src/main/java/com/xujie/sys/modules/pms/data/ProofingInformationData.java +++ b/src/main/java/com/xujie/sys/modules/pms/data/ProofingInformationData.java @@ -147,8 +147,12 @@ public class ProofingInformationData extends QueryPage { private String documentId; + private String conclusion; + private List proofDocumentDataList; + private String documentGroupDesc; + public Boolean getNeedToSendSamples() { return isNeedToSendSamples; } @@ -535,4 +539,20 @@ public class ProofingInformationData extends QueryPage { public void setProofDocumentDataList(List proofDocumentDataList) { this.proofDocumentDataList = proofDocumentDataList; } + + public String getConclusion() { + return conclusion; + } + + public void setConclusion(String conclusion) { + this.conclusion = conclusion; + } + + public String getDocumentGroupDesc() { + return documentGroupDesc; + } + + public void setDocumentGroupDesc(String documentGroupDesc) { + this.documentGroupDesc = documentGroupDesc; + } } diff --git a/src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java b/src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java index d36549c3..ee1b3024 100644 --- a/src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java +++ b/src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java @@ -21,7 +21,7 @@ import java.util.List; public interface ProofingInformationMapper extends BaseMapper { IPage proofingInformationSearch(Page proofingInformationVoPage, @Param("query") ProofingInformationData data); - List getProofDocument(String site, String projectId, String proofingNo); + List getProofDocument(String site, String projectId, String testPartNo, String proofingNo); void proofingInformationSave(ProofingInformationData data); @@ -56,7 +56,7 @@ public interface ProofingInformationMapper extends BaseMapper searchProjectAllDocument(String site, String projectId, String proofingNo); + List searchProjectAllDocument(String site, String projectId, String testPartNo, String proofingNo); void proofingInformationDelete(ProofingInformationData data); @@ -68,7 +68,7 @@ public interface ProofingInformationMapper extends BaseMapper selectProofingDocument(ProofingInformationData proofingInformationData); Boolean checkProductionConfirmationDocument(ProjectProductionValidationDocumentData data); diff --git a/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java b/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java index 4c6b0c13..f443593c 100644 --- a/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java @@ -39,6 +39,9 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic @Autowired private ProofingInformationMapper proofingInformationMapper; + @Autowired + private SysOssServiceImpl sysOssService; + @Override public PageUtils proofingInformationSearch(ProofingInformationData data) { IPage resultList = proofingInformationMapper.proofingInformationSearch(new Page(data.getPage(), data.getLimit()), data); @@ -103,8 +106,8 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic // 如果有旧记录且项目分类不同,进行删除操作 if (proofingInformationData != null && !proofingInformationData.getcProjectTypeDb().equals(data.getcProjectTypeDb())) { try { - ProofingInformationData proofingInformationData1 = proofingInformationMapper.selectProofingDocument(proofingInformationData); - if (proofingInformationData1 == null){ + List proofingInformationData1 = proofingInformationMapper.selectProofingDocument(proofingInformationData); + if (proofingInformationData1.isEmpty() || proofingInformationData1 == null || proofingInformationData1.size() == 0){ proofingInformationMapper.deleteProofingDocument(proofingInformationData); } else { @@ -253,7 +256,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic @Override public PageUtils getProofDocument(ProofDocumentData data) { // 调用Mapper接口方法执行存储过程 - List resultList = proofingInformationMapper.getProofDocument(data.getSite(), data.getProjectId(), data.getProofingId()); + List resultList = proofingInformationMapper.getProofDocument(data.getSite(), data.getProjectId(), data.getTestPartNo(), data.getProofingId()); // 构建结果并返回PageUtils IPage pageList = new Page<>(data.getPage(), data.getLimit()); @@ -285,7 +288,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic @Override public PageUtils searchProjectAllDocument(ProofingInformationData data) { // 调用Mapper接口方法执行存储过程 - List resultList = proofingInformationMapper.searchProjectAllDocument(data.getSite(), data.getProjectId(), data.getProofingNo()); + List resultList = proofingInformationMapper.searchProjectAllDocument(data.getSite(), data.getProjectId(), data.getTestPartNo(), data.getProofingNo()); // 构建结果并返回PageUtils IPage pageList = new Page<>(data.getPage(), data.getLimit()); @@ -305,8 +308,21 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic Boolean b = proofingInformationMapper.checkProductionConfirmationDocument(projectProductionValidationDocumentData); try { if (!b) { + SysOssEntity sysOssEntity = new SysOssEntity(); + sysOssEntity.setOrderRef1(data.getSite()); + sysOssEntity.setOrderRef2(data.getProofingNo()); + sysOssEntity.setOrderRef3(data.getDocumentDefinitionListId()); + sysOssEntity.setOrderRef4(data.getProjectId()); + // 使用MybatisPlus的queryWrapper + QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper eq = queryWrapper.eq("order_ref1", sysOssEntity.getOrderRef1()).eq("order_ref2", sysOssEntity.getOrderRef2()).eq("order_ref3", sysOssEntity.getOrderRef3()).eq("order_ref4", sysOssEntity.getOrderRef4()); + // 判断查到的数据的条数 + List list = sysOssService.list(eq); + if (list.size() == 1) { + data.setProofingId(data.getProofingNo()); + proofingInformationMapper.updateDocumentListUploadedFlag(data); + } proofingInformationMapper.deleteProofingDocument1(data); - proofingInformationMapper.updateDocumentListUploadedFlag(data); return R.ok(); }else { throw new RuntimeException("该文档已经被用于生产确认,不允许删除!"); diff --git a/src/main/resources/mapper/pms/ProofingInformationMapper.xml b/src/main/resources/mapper/pms/ProofingInformationMapper.xml index c11a350d..bc0984c7 100644 --- a/src/main/resources/mapper/pms/ProofingInformationMapper.xml +++ b/src/main/resources/mapper/pms/ProofingInformationMapper.xml @@ -101,7 +101,7 @@ order by a.create_date desc DELETE FROM plm_document_list_definition WHERE id = #{documentDefinitionListId} @@ -213,7 +213,7 @@ WHERE a.project_id = #{projectId} and a.proofing_id = '*' and c.project_phase = 'Mass Production'