diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DisposalInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DisposalInfoController.java index c82cdce..5b291db 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DisposalInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DisposalInfoController.java @@ -46,29 +46,31 @@ public class DisposalInfoController extends BaseController { queryWrapper.orderByDesc("warning_time"); List list1 = transitHuntersUserModelRecordService.list(queryWrapper); ArrayList transitHuntersUserModelRecords = new ArrayList<>(); - for (TransitHuntersUserModelRecord transitHuntersUserModelRecord :list1){ + for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1) { Long id = transitHuntersUserModelRecord.getId(); if (transitHuntersUserModelRecord.getWarningLevel() == 3) { transitHuntersUserModelRecord.setWarningLevelCn("二级"); } DisposalInfo one = disposalInfoService.lambdaQuery().eq(DisposalInfo::getHuntersModelRecordId, id).one(); - if (one != null){ - transitHuntersUserModelRecord.setDisposalResultCn("已处置"); - if (one.getSignPoliceman() != null || one.getSignPoliceStation()!=null){ - transitHuntersUserModelRecord.setSignStatusCn("已签收"); - }else { - transitHuntersUserModelRecord.setSignStatusCn("未签收"); + if (one != null) { + transitHuntersUserModelRecord.setSignStatus(one.getSignStatus()); + transitHuntersUserModelRecord.setSignStatusCn("未签收"); + if (one.getSignStatus() == 2) { + transitHuntersUserModelRecord.setSignStatusCn("已签收未反馈"); + } + if (one.getSignStatus() == 3) { + transitHuntersUserModelRecord.setSignStatusCn("已签收已反馈"); } - if (one.getRiskDesc()!=null){ - transitHuntersUserModelRecord.setRisk("有风险"); - }else { - transitHuntersUserModelRecord.setRisk("无风险"); + transitHuntersUserModelRecord.setDisposalResult(one.getDisposalResult()); + if (one.getDisposalResult() == 1){ + transitHuntersUserModelRecord.setDisposalResultCn("无风险"); + } + if (one.getDisposalResult() == 2){ + transitHuntersUserModelRecord.setDisposalResultCn("有风险"); } } else { - transitHuntersUserModelRecord.setDisposalResultCn("未处置"); transitHuntersUserModelRecord.setSignStatusCn("未签收"); transitHuntersUserModelRecord.setSignStatus(1); - transitHuntersUserModelRecord.setDisposalResult(1); } String warningTime = transitHuntersUserModelRecord.getWarningTime(); LocalDateTime localDateTime = LocalDateTime.parse(warningTime, inputFormatter); @@ -83,20 +85,29 @@ public class DisposalInfoController extends BaseController { @PostMapping @ApiOperation("修改或新增预警信息处置表") public AjaxResult insert(@RequestBody DisposalInfo disposalInfo) { - if (disposalInfo != null){ - disposalInfo.setDisposalResult(2); + if (disposalInfo != null) { + if ("无风险".equals(disposalInfo.getDisposalResultCn())) { + disposalInfo.setDisposalResult(1); + } + if ("有风险".equals(disposalInfo.getDisposalResultCn())) { + disposalInfo.setDisposalResult(2); + } disposalInfo.setSignStatus(1); - if (disposalInfo.getSignPoliceman() != null || disposalInfo.getSignPoliceStation() !=null){ + if (disposalInfo.getSignPoliceman() != null && disposalInfo.getSignPoliceStation() != null) { disposalInfo.setSignStatus(2); } + if (disposalInfo.getRiskFeedback() != null) { + disposalInfo.setSignStatus(3); + } + } DisposalInfo one = disposalInfoService.lambdaQuery().eq(DisposalInfo::getHuntersModelRecordId, disposalInfo.getHuntersModelRecordId()).one(); - if (one == null){ + if (one == null) { return toAjax(disposalInfoService.save(disposalInfo)); - }else { + } else { UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("hunters_model_record_id",disposalInfo.getHuntersModelRecordId()); - return toAjax(disposalInfoService.update(disposalInfo,updateWrapper)); + updateWrapper.eq("hunters_model_record_id", disposalInfo.getHuntersModelRecordId()); + return toAjax(disposalInfoService.update(disposalInfo, updateWrapper)); } } @@ -105,13 +116,8 @@ public class DisposalInfoController extends BaseController { @ApiOperation("查找处置状态") public AjaxResult disposalInfo(DisposalInfo disposalInfo) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("hunters_model_record_id",disposalInfo.getHuntersModelRecordId()); + queryWrapper.eq("hunters_model_record_id", disposalInfo.getHuntersModelRecordId()); DisposalInfo one = disposalInfoService.getOne(queryWrapper); - if (one.getRiskDesc() == null){ - one.setRisk("无风险"); - }else { - one.setRisk("有风险"); - } return AjaxResult.success(one); } }