|
|
|
@ -39,6 +39,9 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic |
|
|
|
@Autowired |
|
|
|
private ProofingInformationMapper proofingInformationMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysOssServiceImpl sysOssService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageUtils proofingInformationSearch(ProofingInformationData 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())) { |
|
|
|
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); |
|
|
|
} |
|
|
|
else { |
|
|
|
@ -253,7 +256,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic |
|
|
|
@Override |
|
|
|
public PageUtils getProofDocument(ProofDocumentData data) { |
|
|
|
// 调用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 |
|
|
|
IPage<ProofDocumentData> pageList = new Page<>(data.getPage(), data.getLimit()); |
|
|
|
@ -285,7 +288,7 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic |
|
|
|
@Override |
|
|
|
public PageUtils searchProjectAllDocument(ProofingInformationData data) { |
|
|
|
// 调用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 |
|
|
|
IPage<ProofingInformationData> 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<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.updateDocumentListUploadedFlag(data); |
|
|
|
return R.ok(); |
|
|
|
}else { |
|
|
|
throw new RuntimeException("该文档已经被用于生产确认,不允许删除!"); |
|
|
|
|