|
|
|
|
@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.dto.NegativeDto;
|
|
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
|
import com.biutag.supervision.pojo.model.ModelClueModel; |
|
|
|
|
import com.biutag.supervision.pojo.param.ModelClueQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
@ -82,7 +83,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
model.setApprovalFlow(taskDistribute.getApprovalFlow()); |
|
|
|
|
model.setDistributionFlow(taskDistribute.getDistributionFlow()); |
|
|
|
|
|
|
|
|
|
return distribution(modelClues, model, taskDistribute.getTaskName()); |
|
|
|
|
return distribution(modelClues, model, taskDistribute.getTaskName(), taskDistribute.getThingFiles()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,11 +91,11 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
List<ModelClue> modelClues = listByUnDistributed(modelId); |
|
|
|
|
Model model = modelMapper.selectById(modelId); |
|
|
|
|
String taskName = "自动下发"; |
|
|
|
|
return distribution(modelClues, model, taskName); |
|
|
|
|
return distribution(modelClues, model, taskName, new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public boolean distribution(List<ModelClue> modelClues, Model model, String taskName) { |
|
|
|
|
public boolean distribution(List<ModelClue> modelClues, Model model, String taskName, List<FileVo> thingFiles) { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
modelClues.forEach(item -> { |
|
|
|
|
if (Objects.isNull(item.getInvolveDepartId())) { |
|
|
|
|
@ -102,8 +103,8 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
} |
|
|
|
|
NegativeDto negative = new NegativeDto(); |
|
|
|
|
// 问题来源
|
|
|
|
|
negative.setProblemSourcesCode(ProblemSourcesEnum.MXCS.getValue()); |
|
|
|
|
negative.setProblemSourcesCode(ProblemSourcesEnum.MXCS.getLabel()); |
|
|
|
|
negative.setProblemSources(ProblemSourcesEnum.LMGZ.getLabel()); |
|
|
|
|
negative.setProblemSourcesCode(ProblemSourcesEnum.LMGZ.getValue()); |
|
|
|
|
// TODO 业务类别 涉及问题
|
|
|
|
|
// 涉及单位
|
|
|
|
|
negative.setInvolveDepartId(item.getInvolveDepartId()); |
|
|
|
|
@ -120,16 +121,16 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
SupDepart depart = departService.getById(item.getInvolveDepartId()); |
|
|
|
|
if (depart.getLevel().equals(DepartLevelEnum.SECOND.getValue())) { |
|
|
|
|
negative.setDepartId(depart.getId()); |
|
|
|
|
negative.setDepartId(depart.getName()); |
|
|
|
|
negative.setDepartName(depart.getName()); |
|
|
|
|
} |
|
|
|
|
if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue())) { |
|
|
|
|
SupDepart parentDepart = departService.getParentDepart(item.getInvolveDepartId()); |
|
|
|
|
negative.setDepartId(parentDepart.getId()); |
|
|
|
|
negative.setDepartId(parentDepart.getName()); |
|
|
|
|
negative.setDepartName(parentDepart.getName()); |
|
|
|
|
} |
|
|
|
|
if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.THIRD.getValue())) { |
|
|
|
|
negative.setDepartId(depart.getId()); |
|
|
|
|
negative.setDepartId(depart.getName()); |
|
|
|
|
negative.setDepartName(depart.getName()); |
|
|
|
|
} |
|
|
|
|
negative.setTimeLimit(model.getTimeLimit()); |
|
|
|
|
negative.setMaxSignDuration(model.getMaxSignDuration()); |
|
|
|
|
@ -142,6 +143,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
|
|
|
|
|
item.setDistributionState(ModelDistributionStateEnum.DISTRIBUTED.getValue()); |
|
|
|
|
item.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
item.setNegativeId(negative.getId()); |
|
|
|
|
updateById(item); |
|
|
|
|
}); |
|
|
|
|
ModelClueTask modelClueTask = new ModelClueTask(); |
|
|
|
|
@ -264,4 +266,5 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
|
|
|
|
|
} |
|
|
|
|
return originalFieldName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|