Browse Source

com.biutag.supervision.controller.work.NegativeController#update

feature/tsjb-1.0
wxc 4 weeks ago
parent
commit
d420f9d8a3
  1. 49
      src/main/java/com/biutag/supervision/service/NegativeService.java

49
src/main/java/com/biutag/supervision/service/NegativeService.java

@ -112,7 +112,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.stream().map(leaderIdCode -> { .stream().map(leaderIdCode -> {
VerifyData.BlameLeader blameLeader = new VerifyData.BlameLeader(); VerifyData.BlameLeader blameLeader = new VerifyData.BlameLeader();
List<Blame> blames = blameList.stream().filter(blameObj -> leaderIdCode.equals(blameObj.getLeadIdCode())).toList(); List<Blame> blames = blameList.stream().filter(blameObj -> leaderIdCode.equals(blameObj.getLeadIdCode())).toList();
// å<EFBFBD>–第一ï¿? // 取第一<EFBFBD>?
Blame blame = blames.get(0); Blame blame = blames.get(0);
BeanUtil.copyProperties(blame, blameLeader); BeanUtil.copyProperties(blame, blameLeader);
blameLeader.setBlameIdCodes(blames.stream().map(Blame::getBlameIdCode).toList()); blameLeader.setBlameIdCodes(blames.stream().map(Blame::getBlameIdCode).toList());
@ -133,7 +133,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setFlowActions(flowActions) .setFlowActions(flowActions)
.setApproves(approveService.list(id)) .setApproves(approveService.list(id))
.setIsFav(favService.existsByCurrentUser(id)); .setIsFav(favService.existsByCurrentUser(id));
// 签收退ï¿? // 签收退<EFBFBD>?
if (!flows.isEmpty() && AppConstants.SIGN_RETURN_ACTION_NAME.equals(flows.get(flows.size() - 1).getActionName())) { if (!flows.isEmpty() && AppConstants.SIGN_RETURN_ACTION_NAME.equals(flows.get(flows.size() - 1).getActionName())) {
detail.setSignReturns(signReturnService.list(id)); detail.setSignReturns(signReturnService.list(id));
} }
@ -146,11 +146,11 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (FlowNodeEnum.isSignFlow(negative.getFlowKey())) { if (FlowNodeEnum.isSignFlow(negative.getFlowKey())) {
detail.setMaxDuration(NumberUtil.mul(negative.getMaxSignDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue()); detail.setMaxDuration(NumberUtil.mul(negative.getMaxSignDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue());
} }
// 未延ï¿? // 未延<EFBFBD>?
else if (Objects.isNull(negative.getExtensionDays())) { else if (Objects.isNull(negative.getExtensionDays())) {
detail.setMaxDuration(NumberUtil.mul(negative.getMaxHandleDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue()); detail.setMaxDuration(NumberUtil.mul(negative.getMaxHandleDuration(), TimeUtil.SECONDS_OF_A_DAY).longValue());
} else { } else {
// 已延ï¿? // 已延<EFBFBD>?
Integer maxDuration = negative.getMaxHandleDuration() + negative.getExtensionDays(); Integer maxDuration = negative.getMaxHandleDuration() + negative.getExtensionDays();
detail.setMaxDuration(NumberUtil.mul(maxDuration, TimeUtil.SECONDS_OF_A_DAY).longValue()); detail.setMaxDuration(NumberUtil.mul(maxDuration, TimeUtil.SECONDS_OF_A_DAY).longValue());
} }
@ -160,7 +160,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
negative.getExtensionDays(), negative.getExtensionDays(),
negative.getFlowKey())); negative.getFlowKey()));
} }
// 判断当å‰<EFBFBD>是å<EFBFBD>¦ 是认定办结环ï¿? // 判断当前是否 是认定办结环<EFBFBD>?
if (Objects.nonNull(workId)) { if (Objects.nonNull(workId)) {
Boolean confirmationCompletionFlag = (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow()) && FlowNodeEnum.SECOND_APPROVE.getKey().equals(negative.getFlowKey())) Boolean confirmationCompletionFlag = (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow()) && FlowNodeEnum.SECOND_APPROVE.getKey().equals(negative.getFlowKey()))
|| FlowNodeEnum.FIRST_APPROVE.getKey().equals(negative.getFlowKey()); || FlowNodeEnum.FIRST_APPROVE.getKey().equals(negative.getFlowKey());
@ -189,7 +189,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (StrUtil.isBlank(negativeDto.getOriginId())) { if (StrUtil.isBlank(negativeDto.getOriginId())) {
String originId = generateOriginId(negativeDto.getProblemSourcesCode(), negativeDto.getBusinessTypeCode()); String originId = generateOriginId(negativeDto.getProblemSourcesCode(), negativeDto.getBusinessTypeCode());
negative.setOriginId(originId); // 如果是空就生æˆ<EFBFBD>éš<EFBFBD>机的线索ï¿? negative.setOriginId(originId); // 如果是空就生成随机的线索<EFBFBD>?
} }
if (StrUtil.isNotBlank(negativeDto.getBusinessTypeCode())) { if (StrUtil.isNotBlank(negativeDto.getBusinessTypeCode())) {
@ -206,7 +206,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
negative.setThreeInvolveDepartId(depart.getId()); negative.setThreeInvolveDepartId(depart.getId());
negative.setSecondInvolveDepartId(depart.getPid()); negative.setSecondInvolveDepartId(depart.getPid());
} else { } else {
throw new RuntimeException("æå<EFBFBD>Šå<EFBFBD>ä½<EFBFBD>è¯·éæ©äºŒçº§æˆä¸çº§å<EFBFBD>ï¿?); throw new RuntimeException("涉及单位请选择二级或三级单<EFBFBD>?);
} }
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
boolean secondFlag = false; boolean secondFlag = false;
@ -240,7 +240,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
log.warn("未获取到用户上下文,问题ID:{}", negative.getId()); log.warn("未获取到用户上下文,问题ID:{}", negative.getId());
} }
} }
save(negative); // 添加一ï¿?negative æ•°æ<EFBFBD>® save(negative); // 添加一<EFBFBD>?negative 数据
negativeDto.setId(negative.getId()); negativeDto.setId(negative.getId());
if (!negativeDto.getThingFiles().isEmpty()) { if (!negativeDto.getThingFiles().isEmpty()) {
List<NegativeThingFile> files = negativeDto.getThingFiles().stream().map(item -> { List<NegativeThingFile> files = negativeDto.getThingFiles().stream().map(item -> {
@ -270,7 +270,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setProblemSourcesCode(negative.getProblemSourcesCode()) .setProblemSourcesCode(negative.getProblemSourcesCode())
.setUpdateTime(now) .setUpdateTime(now)
.setCreateTime(now); .setCreateTime(now);
workService.save(work); // 添加一ï¿?negative_work æ•°æ<EFBFBD>® 工作状�? workService.save(work); // 添加一<EFBFBD>?negative_work 数据 工作状<EFBFBD>?
FirstDistributeData firstDistributeData = new FirstDistributeData(); FirstDistributeData firstDistributeData = new FirstDistributeData();
BeanUtil.copyProperties(negativeDto, firstDistributeData); BeanUtil.copyProperties(negativeDto, firstDistributeData);
@ -282,7 +282,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setWorkId(work.getId()) .setWorkId(work.getId())
.setNextFlowKey(FlowNodeEnum.SECOND_SIGN.getKey()) .setNextFlowKey(FlowNodeEnum.SECOND_SIGN.getKey())
.setData(firstDistributeData); .setData(firstDistributeData);
SpringUtil.getBean(FlowService.class).execute(actionDto); // 创建一æ<EFBFBD>¡åކå<EFBFBD>²æ•°ï¿? SpringUtil.getBean(FlowService.class).execute(actionDto); // 创建一条历史数<EFBFBD>?
return negative; return negative;
} }
@ -301,10 +301,10 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setBusinessTypeCode(businessTypeCode) .setBusinessTypeCode(businessTypeCode)
.setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName())) .setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName()))
.setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName())) .setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName()))
// 导入的数æ<EFBFBD>®éƒ½æ˜¯è­¦åŠ¡è°ƒï¿? // 导入的数据都是警务调<EFBFBD>?
.setProblemSources(ProblemSourcesEnum.JWDC.getLabel()) .setProblemSources(ProblemSourcesEnum.JWDC.getLabel())
.setProblemSourcesCode(ProblemSourcesEnum.JWDC.getValue()) .setProblemSourcesCode(ProblemSourcesEnum.JWDC.getValue())
// 警务调查默认ï¿?37工作ï¿? // 警务调查默认<EFBFBD>?37工作<EFBFBD>?
.setTimeLimit(TimeLimitEnum.WORK_137.getValue()) .setTimeLimit(TimeLimitEnum.WORK_137.getValue())
.setMaxSignDuration(TimeLimitEnum.WORK_137.getMaxSignDuration()) .setMaxSignDuration(TimeLimitEnum.WORK_137.getMaxSignDuration())
.setMaxHandleDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration()) .setMaxHandleDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration())
@ -341,7 +341,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setCurrentProcessingObject(String.format("%s专班", dept.getShortName())); .setCurrentProcessingObject(String.format("%s专班", dept.getShortName()));
} }
} }
// jwpy直接算现场ç<EFBFBD>£å¯Ÿå¤§ï¿? // jwpy直接算现场督察大<EFBFBD>?
negative.setIssuingDepartId(JWPY_DEPARTID); negative.setIssuingDepartId(JWPY_DEPARTID);
negative.setIssuingDepartName(JWPY_DEPART_NAME); negative.setIssuingDepartName(JWPY_DEPART_NAME);
save(negative); save(negative);
@ -373,7 +373,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
.setCreateTime(now); .setCreateTime(now);
workService.save(firstWork); workService.save(firstWork);
} else { } else {
log.error("未匹é…<EFBFBD>上å<EFBFBD>•ä½<EFBFBD>:{}ï¿?code: {}", item.getDepartName(), item.getDepartCode()); log.error("未匹配上单位:{}<EFBFBD>?code: {}", item.getDepartName(), item.getDepartCode());
departId = AppConstants.ROOT_DEPART_ID; departId = AppConstants.ROOT_DEPART_ID;
departName = AppConstants.ROOT_DEPART_NAME; departName = AppConstants.ROOT_DEPART_NAME;
roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); roleCode = RoleCodeEnum.FIRST_ADMIN.getCode();
@ -417,17 +417,17 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
public boolean remove(String id) { public boolean remove(String id) {
removeById(id); removeById(id);
negativeHistoryService.removeById(id); negativeHistoryService.removeById(id);
// 工作ï¿? // 工作<EFBFBD>?
workService.remove(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, id)); workService.remove(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, id));
// æ”¶è—<EFBFBD>ï¿? // 收藏<EFBFBD>?
favService.remove(new LambdaQueryWrapper<NegativeFav>().eq(NegativeFav::getNegativeId, id)); favService.remove(new LambdaQueryWrapper<NegativeFav>().eq(NegativeFav::getNegativeId, id));
// 事件详情æ<EFBFBD><EFBFBD>è¿°ï¿? // 事件详情描述<EFBFBD>?
thingFileService.remove(new LambdaQueryWrapper<NegativeThingFile>().eq(NegativeThingFile::getNegativeId, id)); thingFileService.remove(new LambdaQueryWrapper<NegativeThingFile>().eq(NegativeThingFile::getNegativeId, id));
// 涉及人员 // 涉及人员
blameService.remove(id); blameService.remove(id);
// 核查附件 // 核查附件
fileService.remove(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getNegtiveId, id)); fileService.remove(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getNegtiveId, id));
// 签收退ï¿? // 签收退<EFBFBD>?
signReturnService.remove(new LambdaQueryWrapper<NegativeSignReturn>().eq(NegativeSignReturn::getNegativeId, id)); signReturnService.remove(new LambdaQueryWrapper<NegativeSignReturn>().eq(NegativeSignReturn::getNegativeId, id));
// 申请延期 // 申请延期
extensionApplyService.remove(new LambdaQueryWrapper<NegativeExtensionApply>().eq(NegativeExtensionApply::getNegativeId, id)); extensionApplyService.remove(new LambdaQueryWrapper<NegativeExtensionApply>().eq(NegativeExtensionApply::getNegativeId, id));
@ -442,7 +442,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (CollUtil.isEmpty(histories) || CollUtil.isEmpty(applys)) { if (CollUtil.isEmpty(histories) || CollUtil.isEmpty(applys)) {
return; return;
} }
// 1. 按部ï¿? // 1. 按部<EFBFBD>?
Map<String, NegativeHistory> countersignHistoryMap = new HashMap<>(); Map<String, NegativeHistory> countersignHistoryMap = new HashMap<>();
for (NegativeHistory history : histories) { for (NegativeHistory history : histories) {
if ("提交会签".equals(history.getActionName()) && StrUtil.isNotBlank(history.getDepartName())) { if ("提交会签".equals(history.getActionName()) && StrUtil.isNotBlank(history.getDepartName())) {
@ -452,7 +452,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (countersignHistoryMap.isEmpty()) { if (countersignHistoryMap.isEmpty()) {
return; return;
} }
// 2. 回填会签人信ï¿? 校验部门 // 2. 回填会签人信<EFBFBD>? 校验部门
for (CountersignApply apply : applys) { for (CountersignApply apply : applys) {
List<NegativeCountersign> countersigns = apply.getCountersigns(); List<NegativeCountersign> countersigns = apply.getCountersigns();
if (CollUtil.isEmpty(countersigns)) { if (CollUtil.isEmpty(countersigns)) {
@ -475,9 +475,12 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
} }
} }
} }
}\r\n @Transactional(rollbackFor = Exception.class)\r\n public void updateNegative(NegativeDto negativeDto) { }
@Transactional(rollbackFor = Exception.class)
public void updateNegative(NegativeDto negativeDto) {
if (StrUtil.isBlank(negativeDto.getId())) { if (StrUtil.isBlank(negativeDto.getId())) {
throw new RuntimeException("æ°æ<EFBFBD>®å¼å¸¸ï¼Œè¯·ç³»ç»Ÿè<EFBFBD>系管ç<EFBFBD>å˜ã<EFBFBD>é®é¢˜ID为空ï¿?); throw new RuntimeException("数据异常,请系统联系管理员【问题ID为空】");
} }
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<>();
// 涉及单位 // 涉及单位
@ -489,7 +492,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getPid()) updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getPid())
.set(Negative::getThreeInvolveDepartId, depart.getId()); .set(Negative::getThreeInvolveDepartId, depart.getId());
} else { } else {
throw new RuntimeException("æå<EFBFBD>Šå<EFBFBD>ä½<EFBFBD>è¯·éæ©äºŒçº§æˆä¸çº§å<EFBFBD>ï¿?); throw new RuntimeException("涉及单位请选择二级或三级单位");
} }
updateWrapper.eq(Negative::getId, negativeDto.getId()) updateWrapper.eq(Negative::getId, negativeDto.getId())
.set(Negative::getProblemSources, negativeDto.getProblemSources()) .set(Negative::getProblemSources, negativeDto.getProblemSources())

Loading…
Cancel
Save