|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.biutag.supervision.service; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
@ -18,6 +19,7 @@ import com.biutag.supervision.constants.enums.*;
|
|
|
|
|
import com.biutag.supervision.flow.FlowService; |
|
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
|
import com.biutag.supervision.pojo.domain.Blame; |
|
|
|
|
import com.biutag.supervision.pojo.domain.CountersignApply; |
|
|
|
|
import com.biutag.supervision.pojo.domain.NegativeDetail; |
|
|
|
|
import com.biutag.supervision.pojo.domain.NegativeVo; |
|
|
|
|
import com.biutag.supervision.pojo.dto.ActionDto; |
|
|
|
|
@ -37,10 +39,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -169,6 +168,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
|
|
|
|
|
} |
|
|
|
|
// 单位会签
|
|
|
|
|
detail.setCountersignApplys(countersignApplyService.list(id)); |
|
|
|
|
enrichCountersignsWithHistory(detail); |
|
|
|
|
return detail; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -383,6 +383,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 生成样本源头编号 |
|
|
|
|
* |
|
|
|
|
* @param problemSourcesCode |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -420,4 +421,45 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void enrichCountersignsWithHistory(NegativeDetail detail) { |
|
|
|
|
List<NegativeHistory> histories = detail.getActionHistory(); |
|
|
|
|
List<CountersignApply> applys = detail.getCountersignApplys(); |
|
|
|
|
if (CollUtil.isEmpty(histories) || CollUtil.isEmpty(applys)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 1. 按部门
|
|
|
|
|
Map<String, NegativeHistory> countersignHistoryMap = new HashMap<>(); |
|
|
|
|
for (NegativeHistory history : histories) { |
|
|
|
|
if ("提交会签".equals(history.getActionName()) && StrUtil.isNotBlank(history.getDepartName())) { |
|
|
|
|
countersignHistoryMap.put(history.getDepartName(), history); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (countersignHistoryMap.isEmpty()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 2. 回填会签人信息 校验部门
|
|
|
|
|
for (CountersignApply apply : applys) { |
|
|
|
|
List<NegativeCountersign> countersigns = apply.getCountersigns(); |
|
|
|
|
if (CollUtil.isEmpty(countersigns)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
for (NegativeCountersign countersign : countersigns) { |
|
|
|
|
NegativeHistory history = countersignHistoryMap.get(countersign.getDepartName()); |
|
|
|
|
if (history != null) { |
|
|
|
|
countersign.setSignUserName(history.getCrtName()); |
|
|
|
|
countersign.setSignUserAccount(history.getCrtUserName()); |
|
|
|
|
countersign.setSignTime(history.getCrtTime().toString()); |
|
|
|
|
} |
|
|
|
|
String departId = countersign.getDepartId(); |
|
|
|
|
SupDepart byId = departService.getById(departId); |
|
|
|
|
if (3==byId.getLevel()){ |
|
|
|
|
SupDepart byPid = departService.getById(byId.getPid()); |
|
|
|
|
String frontShortName = byPid.getShortName(); |
|
|
|
|
String backedShortName = byId.getShortName(); |
|
|
|
|
countersign.setDepartPName(frontShortName+"/"+backedShortName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|