|
|
|
@ -50,6 +50,7 @@ import java.text.SimpleDateFormat; |
|
|
|
import java.time.DayOfWeek; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
|
@ -295,6 +296,42 @@ public class EamProjectServiceImpl implements EamProjectService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
|
public void eamProjectPartInfoCancelEdit(EamProjectPartInfoData inData){ |
|
|
|
// 编辑物料的状态为进行中 |
|
|
|
List<EamProjectPartInfoData> checkProjectPartNo = EamProjectMapper.checkProjectPartNo(inData); |
|
|
|
if (!checkProjectPartNo.isEmpty()) { |
|
|
|
throw new RuntimeException("当前项目下已存在相同的项目料号!"); |
|
|
|
} else { |
|
|
|
EamProjectMapper.eamProjectPartInfoEdit(inData); |
|
|
|
} |
|
|
|
|
|
|
|
// 通过存储过程查询当前part下所有转量产文档 |
|
|
|
ProofDocumentData proofDocumentData = new ProofDocumentData(); |
|
|
|
proofDocumentData.setProjectPartId(inData.getProjectPartId()); |
|
|
|
proofDocumentData.setProjectId(inData.getProjectId()); |
|
|
|
proofDocumentData.setSite(inData.getSite()); |
|
|
|
proofDocumentData.setProofingId(-1); |
|
|
|
proofDocumentData.setPage(1); |
|
|
|
proofDocumentData.setLimit(-1); |
|
|
|
PageUtils proofDocument = proofingInformationService.getProofDocument(proofDocumentData); |
|
|
|
if (proofDocument == null || proofDocument.getList() == null) { |
|
|
|
// 根据业务逻辑,可以选择抛出异常或者直接返回 |
|
|
|
throw new RuntimeException("获取转量产文档失败!"); |
|
|
|
} |
|
|
|
List<ProofDocumentData> list = (List<ProofDocumentData>) proofDocument.getList(); |
|
|
|
// 遍历list,并过滤掉uploadedFlag为Y的数据 |
|
|
|
List<ProofDocumentData> collect = list.stream().filter(a -> !Objects.equals(a.getUploadedFlag(), "Y")).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 删除未上传的文档 |
|
|
|
collect.forEach(a -> { |
|
|
|
EamBuDocumentListDefinitionVo eamBuDocumentListDefinitionVo = new EamBuDocumentListDefinitionVo(); |
|
|
|
eamBuDocumentListDefinitionVo.setDocumentDefinitionListId(a.getDocumentDefinitionListId()); |
|
|
|
proofingInformationMapper.deleteDocumentType(eamBuDocumentListDefinitionVo); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
|
public void eamProjectPartInfoSave(EamProjectPartInfoData inData){ |
|
|
|
|