Browse Source

2024.7.13 产品文档收集-项目信息进一步优化

java8
yuejiayang 2 years ago
parent
commit
e456cc28a6
  1. 32
      src/main/java/com/xujie/sys/modules/pms/data/ProofDocumentData.java
  2. 20
      src/main/java/com/xujie/sys/modules/pms/data/ProofingInformationData.java
  3. 6
      src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java
  4. 26
      src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java
  5. 4
      src/main/resources/mapper/pms/ProofingInformationMapper.xml

32
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 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() { public String getDocumentTypeId() {
return documentTypeId; return documentTypeId;
@ -113,23 +128,6 @@ public class ProofDocumentData extends ProofingInformationData {
this.updateBy = updateBy; 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() { public String getcAdditionalInfo() {
return cAdditionalInfo; return cAdditionalInfo;
} }

20
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 documentId;
private String conclusion;
private List<ProofDocumentData> proofDocumentDataList; private List<ProofDocumentData> proofDocumentDataList;
private String documentGroupDesc;
public Boolean getNeedToSendSamples() { public Boolean getNeedToSendSamples() {
return isNeedToSendSamples; return isNeedToSendSamples;
} }
@ -535,4 +539,20 @@ public class ProofingInformationData extends QueryPage {
public void setProofDocumentDataList(List<ProofDocumentData> proofDocumentDataList) { public void setProofDocumentDataList(List<ProofDocumentData> proofDocumentDataList) {
this.proofDocumentDataList = 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;
}
} }

6
src/main/java/com/xujie/sys/modules/pms/mapper/ProofingInformationMapper.java

@ -21,7 +21,7 @@ import java.util.List;
public interface ProofingInformationMapper extends BaseMapper<ProofingInformationData> { public interface ProofingInformationMapper extends BaseMapper<ProofingInformationData> {
IPage<ProofingInformationData> proofingInformationSearch(Page<ProofingInformationData> proofingInformationVoPage, @Param("query") ProofingInformationData data); IPage<ProofingInformationData> proofingInformationSearch(Page<ProofingInformationData> proofingInformationVoPage, @Param("query") ProofingInformationData data);
List<ProofDocumentData> getProofDocument(String site, String projectId, String proofingNo);
List<ProofDocumentData> getProofDocument(String site, String projectId, String testPartNo, String proofingNo);
void proofingInformationSave(ProofingInformationData data); void proofingInformationSave(ProofingInformationData data);
@ -56,7 +56,7 @@ public interface ProofingInformationMapper extends BaseMapper<ProofingInformatio
void deleteProjectDocument(ProofingInformationData proofingInformationData); void deleteProjectDocument(ProofingInformationData proofingInformationData);
// 声明调用存储过程的方法 // 声明调用存储过程的方法
List<ProofingInformationData> searchProjectAllDocument(String site, String projectId, String proofingNo);
List<ProofingInformationData> searchProjectAllDocument(String site, String projectId, String testPartNo, String proofingNo);
void proofingInformationDelete(ProofingInformationData data); void proofingInformationDelete(ProofingInformationData data);
@ -68,7 +68,7 @@ public interface ProofingInformationMapper extends BaseMapper<ProofingInformatio
void updateProofingInfoById1(ProofingInformationData data); void updateProofingInfoById1(ProofingInformationData data);
ProofingInformationData selectProofingDocument(ProofingInformationData proofingInformationData);
List<ProofingInformationData> selectProofingDocument(ProofingInformationData proofingInformationData);
Boolean checkProductionConfirmationDocument(ProjectProductionValidationDocumentData data); Boolean checkProductionConfirmationDocument(ProjectProductionValidationDocumentData data);

26
src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java

@ -39,6 +39,9 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic
@Autowired @Autowired
private ProofingInformationMapper proofingInformationMapper; private ProofingInformationMapper proofingInformationMapper;
@Autowired
private SysOssServiceImpl sysOssService;
@Override @Override
public PageUtils proofingInformationSearch(ProofingInformationData data) { public PageUtils proofingInformationSearch(ProofingInformationData data) {
IPage<ProofingInformationData> resultList = proofingInformationMapper.proofingInformationSearch(new Page<ProofingInformationData>(data.getPage(), data.getLimit()), data); IPage<ProofingInformationData> resultList = proofingInformationMapper.proofingInformationSearch(new Page<ProofingInformationData>(data.getPage(), data.getLimit()), data);
@ -103,8 +106,8 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic
// 如果有旧记录且项目分类不同进行删除操作 // 如果有旧记录且项目分类不同进行删除操作
if (proofingInformationData != null && !proofingInformationData.getcProjectTypeDb().equals(data.getcProjectTypeDb())) { if (proofingInformationData != null && !proofingInformationData.getcProjectTypeDb().equals(data.getcProjectTypeDb())) {
try { try {
ProofingInformationData proofingInformationData1 = proofingInformationMapper.selectProofingDocument(proofingInformationData);
if (proofingInformationData1 == null){
List<ProofingInformationData> proofingInformationData1 = proofingInformationMapper.selectProofingDocument(proofingInformationData);
if (proofingInformationData1.isEmpty() || proofingInformationData1 == null || proofingInformationData1.size() == 0){
proofingInformationMapper.deleteProofingDocument(proofingInformationData); proofingInformationMapper.deleteProofingDocument(proofingInformationData);
} }
else { else {
@ -253,7 +256,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic
@Override @Override
public PageUtils getProofDocument(ProofDocumentData data) { public PageUtils getProofDocument(ProofDocumentData data) {
// 调用Mapper接口方法执行存储过程 // 调用Mapper接口方法执行存储过程
List<ProofDocumentData> resultList = proofingInformationMapper.getProofDocument(data.getSite(), data.getProjectId(), data.getProofingId());
List<ProofDocumentData> resultList = proofingInformationMapper.getProofDocument(data.getSite(), data.getProjectId(), data.getTestPartNo(), data.getProofingId());
// 构建结果并返回PageUtils // 构建结果并返回PageUtils
IPage<ProofDocumentData> pageList = new Page<>(data.getPage(), data.getLimit()); IPage<ProofDocumentData> pageList = new Page<>(data.getPage(), data.getLimit());
@ -285,7 +288,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic
@Override @Override
public PageUtils searchProjectAllDocument(ProofingInformationData data) { public PageUtils searchProjectAllDocument(ProofingInformationData data) {
// 调用Mapper接口方法执行存储过程 // 调用Mapper接口方法执行存储过程
List<ProofingInformationData> resultList = proofingInformationMapper.searchProjectAllDocument(data.getSite(), data.getProjectId(), data.getProofingNo());
List<ProofingInformationData> resultList = proofingInformationMapper.searchProjectAllDocument(data.getSite(), data.getProjectId(), data.getTestPartNo(), data.getProofingNo());
// 构建结果并返回PageUtils // 构建结果并返回PageUtils
IPage<ProofingInformationData> pageList = new Page<>(data.getPage(), data.getLimit()); IPage<ProofingInformationData> pageList = new Page<>(data.getPage(), data.getLimit());
@ -305,8 +308,21 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic
Boolean b = proofingInformationMapper.checkProductionConfirmationDocument(projectProductionValidationDocumentData); Boolean b = proofingInformationMapper.checkProductionConfirmationDocument(projectProductionValidationDocumentData);
try { try {
if (!b) { 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<SysOssEntity> queryWrapper = new QueryWrapper<>();
QueryWrapper<SysOssEntity> eq = queryWrapper.eq("order_ref1", sysOssEntity.getOrderRef1()).eq("order_ref2", sysOssEntity.getOrderRef2()).eq("order_ref3", sysOssEntity.getOrderRef3()).eq("order_ref4", sysOssEntity.getOrderRef4());
// 判断查到的数据的条数
List<SysOssEntity> list = sysOssService.list(eq);
if (list.size() == 1) {
data.setProofingId(data.getProofingNo());
proofingInformationMapper.updateDocumentListUploadedFlag(data);
}
proofingInformationMapper.deleteProofingDocument1(data); proofingInformationMapper.deleteProofingDocument1(data);
proofingInformationMapper.updateDocumentListUploadedFlag(data);
return R.ok(); return R.ok();
}else { }else {
throw new RuntimeException("该文档已经被用于生产确认,不允许删除!"); throw new RuntimeException("该文档已经被用于生产确认,不允许删除!");

4
src/main/resources/mapper/pms/ProofingInformationMapper.xml

@ -101,7 +101,7 @@
order by a.create_date desc order by a.create_date desc
</select> </select>
<select id="getProofDocument" parameterType="map" statementType="CALLABLE" resultType="com.xujie.sys.modules.pms.data.ProofDocumentData"> <select id="getProofDocument" parameterType="map" statementType="CALLABLE" resultType="com.xujie.sys.modules.pms.data.ProofDocumentData">
{call plm_getdocumentlist(#{site, mode=IN}, #{projectId, mode=IN}, #{proofingNo, mode=IN})}
{call plm_getdocumentlist(#{site, mode=IN}, #{projectId, mode=IN}, #{testPartNo,mode=IN}, #{proofingNo, mode=IN})}
</select> </select>
<delete id="deleteDocumentType"> <delete id="deleteDocumentType">
DELETE FROM plm_document_list_definition WHERE id = #{documentDefinitionListId} 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' WHERE a.project_id = #{projectId} and a.proofing_id = '*' and c.project_phase = 'Mass Production'
</select> </select>
<select id="searchProjectAllDocument" parameterType="map" statementType="CALLABLE" resultType="com.xujie.sys.modules.pms.data.ProofingInformationData"> <select id="searchProjectAllDocument" parameterType="map" statementType="CALLABLE" resultType="com.xujie.sys.modules.pms.data.ProofingInformationData">
{call plm_getdocumentlist(#{site, mode=IN}, #{projectId, mode=IN}, #{proofingNo, mode=IN})}
{call plm_getdocumentlist(#{site, mode=IN}, #{projectId, mode=IN}, #{testPartNo,mode=IN}, #{proofingNo, mode=IN})}
</select> </select>
<select id="queryProofingNo" resultType="com.xujie.sys.modules.pms.data.ProofingInformationData"> <select id="queryProofingNo" resultType="com.xujie.sys.modules.pms.data.ProofingInformationData">
SELECT * FROM plm_proofing_information WHERE site = #{site} and project_id = #{projectId} and proofing_no = #{proofingNo} SELECT * FROM plm_proofing_information WHERE site = #{site} and project_id = #{projectId} and proofing_no = #{proofingNo}

Loading…
Cancel
Save