|
@@ -188,27 +188,31 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
report.setUpdateTime(new Date());
|
|
|
|
|
|
List<WorkAttachmentInfo> workAttachments = reportData.getWorkAttachments();
|
|
|
- List<String> collect = workAttachments.stream().distinct().filter(item -> {
|
|
|
- if (StringUtils.isNotBlank(item.getId())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }).map(WorkAttachmentInfo::getId).collect(Collectors.toList());
|
|
|
- if (CollectionUtil.isNotEmpty(workAttachments)) {
|
|
|
- if(CollectionUtil.isNotEmpty(collect)){
|
|
|
- SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentIdNotInIds(reportData.getId(),collect);
|
|
|
- }
|
|
|
- workAttachments.stream().forEach(i -> i.setAttachmentId(reportData.getId()));
|
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
- map.put("workAttachments",JSON.toJSONString(workAttachments));
|
|
|
- map.put("currentToken", TokenProvider.getCurrentToken());
|
|
|
- SpringUtil.getBean ( IWorkAttachmentApi.class ).saveMsg2(map);
|
|
|
- } else{
|
|
|
- SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(reportData.getId());
|
|
|
+
|
|
|
+ if (!CollectionUtil.isEmpty(workAttachments)) {
|
|
|
+ List<String> collect = workAttachments.stream().distinct().filter(item -> {
|
|
|
+ if (StringUtils.isNotBlank(item.getId())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }).map(WorkAttachmentInfo::getId).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(workAttachments)) {
|
|
|
+ if(CollectionUtil.isNotEmpty(collect)){
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentIdNotInIds(reportData.getId(),collect);
|
|
|
+ }
|
|
|
+ workAttachments.stream().forEach(i -> i.setAttachmentId(reportData.getId()));
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ map.put("workAttachments",JSON.toJSONString(workAttachments));
|
|
|
+ map.put("currentToken", TokenProvider.getCurrentToken());
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).saveMsg2(map);
|
|
|
+ } else{
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(reportData.getId());
|
|
|
// ossService.remove(new QueryWrapper<WorkAttachmentInfo>().lambda().eq(WorkAttachmentInfo::getAttachmentId,workClientInfo.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
- mapper.updateById(report);
|
|
|
|
|
|
+ mapper.updateById(report);
|
|
|
+ Handover currentReportData = mapper.getById(report.getId());
|
|
|
if (report.getType().equals("5")){
|
|
|
String tenantId = "";
|
|
|
//根据名称查询隶属公司部门
|
|
@@ -233,7 +237,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
HandoverDraft draft = new HandoverDraft();
|
|
|
String uid = UUID.randomUUID().toString().replace("-", "");
|
|
|
draft.setId(uid);
|
|
|
- draft.setCreateById(report.getCreateById());
|
|
|
+ draft.setCreateById(currentReportData.getCreateById());
|
|
|
draft.setUpdateById(report.getUpdateById());
|
|
|
draft.setProcessDefinitionId(procDefId);
|
|
|
draft.setHandoverId(report.getId());
|
|
@@ -260,7 +264,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
HandoverComputer computer = new HandoverComputer();
|
|
|
String computerId = UUID.randomUUID().toString().replace("-", "");
|
|
|
computer.setId(computerId);
|
|
|
- computer.setCreateById(report.getCreateById());
|
|
|
+ computer.setCreateById(currentReportData.getCreateById());
|
|
|
computer.setUpdateById(report.getUpdateById());
|
|
|
computer.setProcessDefinitionId(computerProcDefId);
|
|
|
computer.setHandoverId(report.getId());
|
|
@@ -288,7 +292,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
HandoverAccounts accounts = new HandoverAccounts();
|
|
|
String accountsId = UUID.randomUUID().toString().replace("-", "");
|
|
|
accounts.setId(accountsId);
|
|
|
- accounts.setCreateById(report.getCreateById());
|
|
|
+ accounts.setCreateById(currentReportData.getCreateById());
|
|
|
accounts.setUpdateById(report.getUpdateById());
|
|
|
accounts.setProcessDefinitionId(accountsProcDefId);
|
|
|
accounts.setHandoverId(report.getId());
|
|
@@ -316,7 +320,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
HandoverSocialSecurity socialSecurity = new HandoverSocialSecurity();
|
|
|
String socialSecurityId = UUID.randomUUID().toString().replace("-", "");
|
|
|
socialSecurity.setId(socialSecurityId);
|
|
|
- socialSecurity.setCreateById(report.getCreateById());
|
|
|
+ socialSecurity.setCreateById(currentReportData.getCreateById());
|
|
|
socialSecurity.setUpdateById(report.getUpdateById());
|
|
|
socialSecurity.setProcessDefinitionId(socialSecurityProcDefId);
|
|
|
socialSecurity.setHandoverId(report.getId());
|
|
@@ -345,7 +349,7 @@ public class HandoverService extends ServiceImpl<HandoverMapper, Handover> {
|
|
|
HandoverImprest handoverImprest = new HandoverImprest();
|
|
|
String handoverImprestId = UUID.randomUUID().toString().replace("-", "");
|
|
|
handoverImprest.setId(handoverImprestId);
|
|
|
- handoverImprest.setCreateById(report.getCreateById());
|
|
|
+ handoverImprest.setCreateById(currentReportData.getCreateById());
|
|
|
handoverImprest.setUpdateById(report.getUpdateById());
|
|
|
handoverImprest.setProcessDefinitionId(handoverImprestProcDefId);
|
|
|
handoverImprest.setHandoverId(report.getId());
|