diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 8d7a384..dea24b3 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -140,7 +140,6 @@ public class Job { // 警号 rpcApply.setApplicantEmpNo(police.getEmpNo()); // //警员身份 - // SupDepart depart = departService.getById(police.getOrgId()); // rpcApply.setDepartId(depart.getId()); // rpcApply.setDepartId(depart.getName()); @@ -161,11 +160,12 @@ public class Job { } //获取单位进行处理 if(StrUtil.isNotEmpty(ajjbxx.getBadwidmc())){ - + log.info("单位名称:",ajjbxx.getBadwidmc()); SupDepart supDepart=supDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupDepart::getName,ajjbxx.getBadwidmc())); - rpcApply.setDepartId(supDepart.getId()); - rpcApply.setDepartName(supDepart.getShortName()); - + if(ObjectUtil.isNotEmpty(supDepart)){ + rpcApply.setDepartId(supDepart.getId()); + rpcApply.setDepartName(supDepart.getShortName()); + } //获取二级单位的信息 String[] depts = ajjbxx.getBadwidmc().split("局"); String StatisticsGroupName = null; @@ -176,7 +176,9 @@ public class Job { } SupDepart groupDept= supDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupDepart::getName,StatisticsGroupName)); - rpcApply.setSecondDepartId(groupDept.getId()); + if(ObjectUtil.isNotEmpty(groupDept)){ + rpcApply.setSecondDepartId(groupDept.getId()); + } } // 案件信息 rpcApply.setFactReason(ajjbxx.getJyaq()); @@ -226,11 +228,8 @@ public class Job { rpcApplyPerson.setEmpType(police.getJobType()); } rpcApplyPerson.setEmpNo(rpcApply.getApplicantEmpNo()); - //存储受害人信息 rpcApplyPersonService.save(rpcApplyPerson); - - //存储犯人信息 List wfrwfxxes = dwdAsjZfbaWfrwfxxMapper.selectList(new LambdaQueryWrapper().eq(DwdAsjZfbaWfrwfxx::getAjbh,item.getAjbh())); log.info("违法人员信息数据:{}条", wfrwfxxes.size()); @@ -251,7 +250,6 @@ public class Job { rpcInfringerResultService.save(rpcInfringerResult); }); } - }); } diff --git a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java b/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java index 45b036b..5430da8 100644 --- a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java +++ b/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java @@ -1,5 +1,6 @@ package com.biutag.supervision.service; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -63,7 +64,7 @@ public class AlarmNotificationService extends ServiceImpl().setRecords(new ArrayList<>()).setTotal(0); } LambdaQueryWrapper query = new LambdaQueryWrapper() - .in(AlarmNotification::getNotificationDepartId, user.getAuthDepartIds()) + .in(CollectionUtil.isNotEmpty(user.getAuthDepartIds()), AlarmNotification::getNotificationDepartId, user.getAuthDepartIds()) .eq(AlarmNotification::getReplyState, ReplyStateEnum.UN_REPLIED.getValue()); return page(Page.of(param.getCurrent(), param.getSize()), query.orderByDesc(AlarmNotification::getAlarmTime)); }