diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java index 091e37f..1298f7b 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java @@ -19,10 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Optional; +import java.util.*; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; @@ -122,7 +119,15 @@ public class DataVVideoSuperviseController { @GetMapping("/getVideoSuperviseMap") public Result getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + + // 优化1: 快速失败检查 + if (beginTime == null || endTime == null) { + return Result.success(new JSONObject().fluentPut("videoSuperviseMapIconVoList", Collections.emptyList())); + } + + endTime =DateUtil.endOfDay(endTime); + // 地图数据 List videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getVideoSuperviseMapIconInfo(beginTime, endTime)). orElseGet(ArrayList::new); diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 46ecc92..08ec58a 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -141,6 +141,7 @@ public class Job { log.info("未找到受伤民辅警"); return; } + log.info("受害人信息数量数据:{}条", tXsshrxxbs.size()); tXsshrxxbs.forEach(item -> { RpcApplySupervise rpcApply = new RpcApplySupervise(); rpcApply.setRpcId(item.getZj()); @@ -160,6 +161,7 @@ public class Job { // 警号 rpcApply.setApplicantEmpNo(police.getEmpNo()); } + if (StrUtil.isNotBlank(item.getAjbh())) { DwdAsjZfbaAjjbxx ajjbxx = dwdAsjZfbaAjjbxxMapper.selectByAjbh(item.getAjbh()); //获取办案人id @@ -174,6 +176,7 @@ public class Job { } } + log.info("没有相关案件基本信息"); } if(StrUtil.isNotBlank(ajjbxx.getAjmc())){ @@ -223,6 +226,7 @@ public class Job { rpcApply.setSecondDepartId(groupDept.getId()); } } + log.info("单位信息处理完毕"); // 案件信息 rpcApply.setFactReason(ajjbxx.getJyaq()); if ("刑事".equals(ajjbxx.getAjbzmc())) { @@ -241,9 +245,7 @@ public class Job { rpcApply.setRpcStatus(ComfortStatus.completed.name()); // 数据来源 rpcApply.setSource("gbase"); - rpcApplySuperviseService.saveOrUpdate(rpcApply); - //受害人列表 RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); @@ -276,7 +278,6 @@ public class Job { rpcApplyPersonService.saveOrUpdate(rpcApplyPerson); //存储犯人信息 List wfrwfxxes = dwdAsjZfbaWfrwfxxMapper.selectList(new LambdaQueryWrapper().eq(DwdAsjZfbaWfrwfxx::getAjbh,item.getAjbh())); - log.info("违法人员信息数据:{}条", wfrwfxxes.size()); if (ArrayUtil.isNotEmpty(wfrwfxxes)){ wfrwfxxes.forEach(x->{ RpcInfringerResult rpcInfringerResult =new RpcInfringerResult(); @@ -295,6 +296,9 @@ public class Job { }); } }); + //案件录入 + List ajbhList = tXsshrxxbs.stream().map(TXsshrxxb::getAjbh).toList(); + log.info("录入完成-------------"); }