From 36b4dd30df1a47db43b8454576ca5be692db791b Mon Sep 17 00:00:00 2001 From: pengwei Date: Wed, 29 Oct 2025 16:29:29 +0800 Subject: [PATCH] =?UTF-8?q?fiex:=E7=BB=B4=E6=9D=83=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rightsComfort/SuperviseController.java | 9 +- .../java/com/biutag/supervision/job/Job.java | 269 +++++++++++++++++- .../supervision/mapper/RpcApplyMapper.java | 8 +- .../mapper/RpcApplyPersonMapper.java | 2 +- .../mapper/RpcApplySuperviseMapper.java | 37 ++- .../mapper/RpcInfringerResultMapper.java | 6 +- .../pojo/entity/DwdAsjZfbaWfrwfxx.java | 2 + .../supervision/pojo/entity/RpcApply.java | 6 + .../pojo/entity/RpcApplyPerson.java | 1 + .../supervision/pojo/entity/TXsshrxxb.java | 12 + .../pojo/param/RpcApplyQueryParam.java | 2 + .../param/RpcApplySupervisionQueryParam.java | 4 +- .../supervision/pojo/vo/RpcApplyVo.java | 3 + .../supervision/service/BaseUserService.java | 1 + .../supervision/service/RpcApplyService.java | 4 + .../service/RpcApplySuperviseService.java | 26 +- .../mapper/RpcApplySuperviseMapper.xml | 18 ++ .../SupervisionApplicationTests.java | 2 +- 18 files changed, 367 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java index ca82bbc..1bbae66 100644 --- a/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java @@ -1,12 +1,15 @@ package com.biutag.supervision.controller.rightsComfort; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.pojo.entity.RpcApplySupervise; import com.biutag.supervision.pojo.param.RpcApplySupervisionQueryParam; import com.biutag.supervision.pojo.vo.RpcApplyVo; import com.biutag.supervision.pojo.vo.RpcSuperviseVo; +import com.biutag.supervision.service.RpcApplyService; import com.biutag.supervision.service.RpcApplySuperviseService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.*; @Slf4j public class SuperviseController { + private final RpcApplyService rpcApplyService; private final RpcApplySuperviseService rpcApplySuperviseService; /** @@ -53,8 +57,9 @@ public class SuperviseController { * 不属实 * */ @PutMapping - public Result upData(@RequestBody RpcApplySupervise rpcApplySupervise){ - if(rpcApplySuperviseService.updateById(rpcApplySupervise)){ + public Result upData(@RequestBody RpcApply rpcApply){ + + if(rpcApplyService.update(new LambdaUpdateWrapper().set(RpcApply::getVerified,rpcApply.getVerified()).eq(RpcApply::getRpcId,rpcApply.getRpcId()))){ return Result.success(); }else{ return Result.failed("数据更新错误"); diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index fd4f4a9..3866701 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.biutag.supervision.constants.enums.ComfortStatus; import com.biutag.supervision.constants.enums.ProcessingStatusEnum; import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; @@ -24,6 +25,8 @@ import java.time.LocalDateTime; import java.time.Month; import java.time.ZoneId; import java.util.*; +import java.util.function.Function; +import java.util.logging.Level; import java.util.stream.Collectors; import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; @@ -113,6 +116,7 @@ public class Job { private final SupDepartService departService; private final DwdAsjZfbaAjjbxxMapper dwdAsjZfbaAjjbxxMapper; private final SupDepartMapper supDepartMapper; + private final RpcApplyPersonService rpcApplyPersonService; private final DwdAsjZfbaWfrwfxxMapper dwdAsjZfbaWfrwfxxMapper; private final RpcInfringerResultService rpcInfringerResultService; @@ -124,7 +128,7 @@ public class Job { // 每天一次 23:30:00 //todo 维权信息 // @Scheduled(cron = "0 30 23 * * ?") - public void rights() throws ParseException { + public void testFun() throws ParseException { log.info("rights--------------------"); log.info("维权信息抓取中---------------------"); // 维权 @@ -372,6 +376,269 @@ public class Job { log.info("录入完成-------------"); } + //todo 维权信息 + public void rights() throws ParseException { + log.info("rights--------------------"); + log.info("维权信息抓取中---------------------"); + // 维权 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date startTime = sdf.parse("2025-01-01 00:00:00"); + Date endTime = sdf.parse("2025-12-30 00:00:00"); + List shrxxList = dwdAsjZfbaShrxxService.list(startTime,endTime); + if(CollectionUtil.isEmpty(shrxxList)){ + log.info("时间范围内无受害人信息"); + return; + } + log.info("数据:{}条", shrxxList.size()); + List zjList = shrxxList.stream().map(DwdAsjZfbaShrxx::getZj) + .filter(StrUtil::isNotBlank) + .distinct().toList(); + List tXsshrxxbs = tXsshrxxbService.getListAllByZjs(zjList); + if(CollectionUtil.isEmpty(tXsshrxxbs)){ + log.info("未找到受伤民辅警"); + return; + } + //单位数据 map + List departs = departService.list(); + //单位简称 map + Map ShortNameMap = departs.stream().collect(Collectors.toMap( + SupDepart::getShortName, // Key提取函数 + Function.identity(), // Value直接使用对象本身 + (existing, replacement) -> existing // 解决键冲突(保留已有值) + )); + //单位名称 map + Map NameMap = departs.stream().collect(Collectors.toMap( + SupDepart::getName, // Key提取函数 + Function.identity(), // Value直接使用对象本身 + (existing, replacement) -> existing // 解决键冲突(保留已有值) + )); + //单位id map + Map departIdMap = departs.stream().collect(Collectors.toMap( + SupDepart::getId, // Key提取函数 + Function.identity(), // Value直接使用对象本身 + (existing, replacement) -> existing // 解决键冲突(保留已有值) + )); + + + //受害人信息处理 + tXsshrxxbs= tXsshrxxbs.stream().filter(s->StrUtil.isNotBlank(s.getGmsfhm())).map(s->{ + SupPolice police = policeService.getByIdCode(s.getGmsfhm()); + if(ObjectUtil.isNotEmpty(police)){ + s.setEmpNo(police.getEmpNo()); + String departId = police.getOrgId(); + s.setDepartId(departId); + s.setJob(police.getJob()); + if(departIdMap.containsKey(departId)){ + s.setDepartName(departIdMap.get(departId).getShortName()); + } + } + return s; + }).toList(); + log.info("受害人信息数量数据:{}条", tXsshrxxbs.size()); + //处理为受害人map + Map> xsshrxxbMap =tXsshrxxbs.stream() + .filter(s->StrUtil.isNotBlank(s.getAjbh())) + .collect(Collectors.groupingBy(TXsshrxxb::getAjbh)); + log.info("处理后受害人数量数据:{}条", xsshrxxbMap.size()); + + List ajbhList =new ArrayList<>(xsshrxxbMap.keySet()); + + //办案人员信息List + Map zfbaBaryxxMap=new HashMap<>(); + //案件 rpc_apply + for (String ajbh : ajbhList){ + try{ +//获取案件基本信息 + DwdAsjZfbaAjjbxx ajjbxx = dwdAsjZfbaAjjbxxMapper.selectByAjbh(ajbh); + if(ObjectUtil.isEmpty(ajjbxx)){ + log.info("案件[" + ajbh + "]未找到基本信息"); + continue; + } + //获取受害人列表 + List tXsshrxxbList = xsshrxxbMap.get(ajbh); + if(CollectionUtil.isEmpty(tXsshrxxbList)){ + log.info("未找到受害人"); + continue; + } + //嫌疑人 + List wfrwfxxes = dwdAsjZfbaWfrwfxxMapper.selectList(new LambdaQueryWrapper().eq(DwdAsjZfbaWfrwfxx::getAjbh,ajbh)); + + //办案人 + DwdRyZfbaBaryxx dwdRyZfbaBaryxx =zfbaBaryxxMap.computeIfAbsent( + ajjbxx.getBar1id(), + k-> dwdRyZfbaBaryxxService.selectDataById(k) + ); + + //受害人警号查询 + TXsshrxxb oneShr = tXsshrxxbList.get(0); + + RpcApply rpcApply =new RpcApply(); + //1、案件基本信息 + rpcApply.setNumber(ajbh); + rpcApply.setCaseNumber(ajbh); + rpcApply.setCaseName(ajjbxx.getAjmc()); + rpcApply.setCrtTime(LocalDateTime.now()); + rpcApply.setUptTime(LocalDateTime.now()); + rpcApply.setDepartId(oneShr.getDepartId()); + rpcApply.setDepartName(oneShr.getDepartName()); + //申请时间 + rpcApply.setApplyDate(LocalDate.now()); + //2、申请人信息 + rpcApply.setApplicantEmpName(oneShr.getXm()); + rpcApply.setApplicantEmpNo(oneShr.getEmpNo()); + //3、案件信息 案发时间 + rpcApply.setHappenTime(oneShr.getShrq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + //简要案情 + rpcApply.setFactReason(ajjbxx.getJyaq()); + //案发基本类型 + rpcApply.setIncidentLinkName(ajjbxx.getAjlbmc()); + // 申请类型 + rpcApply.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); + // 设置案件类型和处理方式 + if ("刑事".equals(ajjbxx.getAjbzmc())) { +// rpcApply.setInfringerHandle("刑事追究"); + rpcApply.setCaseType("1"); + } + if ("行政".equals(ajjbxx.getAjbzmc())) { +// rpcApply.setInfringerHandle("行政处罚"); + rpcApply.setCaseType("2"); + } + + if(StrUtil.isNotEmpty(ajjbxx.getBadwidmc())){ + String unitName = ajjbxx.getBadwidmc(); + log.info("单位名称:",ajjbxx.getBadwidmc()); + if(!unitName.contains("长沙市公安局")){ + unitName = unitName.split("湖南省")[1]; + } + if(NameMap.containsKey(unitName)){ + //处理单位 + SupDepart supDepart=NameMap.get(unitName); + rpcApply.setHandleDepartId(supDepart.getId()); + rpcApply.setHandleDepartName(supDepart.getShortName()); + //获取二级单位的信息 + String statisticsGroupName = null; + final String CHANGSHA_POLICE = "长沙市公安局"; + // 判断是否为非长沙市公安局 + if (unitName != null && !unitName.contains(CHANGSHA_POLICE)) { + // 非长沙市公安局 + String badwidmc = ajjbxx.getBadwidmc(); + if (badwidmc != null && !badwidmc.isEmpty()) { + // 优化字符串处理,使用indexOf代替split以提高性能 + int juIndex = badwidmc.indexOf('局'); + if (juIndex > 0) { + String beforeJu = badwidmc.substring(0, juIndex); + int shengIndex = beforeJu.indexOf('省'); + if (shengIndex > 0 && shengIndex < beforeJu.length() - 1) { + String afterSheng = beforeJu.substring(shengIndex + 1); + statisticsGroupName = "湖南省长沙市公安局" + afterSheng + "局"; + } else { + log.info("无法分割'省'或'省'后没有有效内容: {}", beforeJu); + } + } else { + log.info("无法在{}中找到'局'字", badwidmc); + } + } + } + if(ShortNameMap.containsKey(statisticsGroupName)){ + SupDepart groupDept= ShortNameMap.get(statisticsGroupName); + rpcApply.setSecondDepartId(groupDept.getId()); + } + + } + + + } + + + // 已办结 + rpcApply.setRpcStatus(ComfortStatus.completed.name()); + //办案人 + if(ObjectUtil.isNotEmpty(dwdRyZfbaBaryxx) && StrUtil.isNotBlank(dwdRyZfbaBaryxx.getZjhm())){ + SupPolice policeData = policeService.getByIdCode(dwdRyZfbaBaryxx.getZjhm()); + if(ObjectUtil.isNotEmpty(policeData)){ + rpcApply.setInputEmpNo(policeData.getEmpNo()); + }else{ + log.info("未找到身份证号[" + dwdRyZfbaBaryxx.getZjhm() + "]对应的警察信息"); + } + } + //嫌疑人 + if(ArrayUtil.isNotEmpty(wfrwfxxes)){ + String suspectNames = wfrwfxxes.stream() + .filter(obj -> StrUtil.isNotBlank(obj.getXm())) + .map(DwdAsjZfbaWfrwfxx::getXm) + .collect(Collectors.joining("、")); + String disposeMethods = wfrwfxxes.stream() + .filter(obj -> StrUtil.isNotBlank(obj.getClfs())) + .map(DwdAsjZfbaWfrwfxx::getClfs) + .collect(Collectors.joining(";")); + rpcApply.setInfringerName(suspectNames); + // 只有当存在实际处理方式时才覆盖默认值 + if (StrUtil.isNotBlank(disposeMethods)) { + rpcApply.setInfringerHandle(disposeMethods); + } + } + + //去除历史数据后,需调整为rpc_id + rpcApplyService.remove(new LambdaQueryWrapper().eq(RpcApply::getNumber,ajbh).eq(RpcApply::getType,"1")); + rpcApply.setCaseCategory(ajjbxx.getAjlbmc()); + boolean saveSuccess = rpcApplyService.saveOrUpdate(rpcApply); + if (!saveSuccess || ObjectUtils.isEmpty(rpcApply.getRpcId())) { + log.info("案件[" + ajbh + "]RPC申请保存失败或未生成RPC ID"); + continue; + } + //嫌疑人 + if(CollectionUtil.isNotEmpty(wfrwfxxes)){ + for (DwdAsjZfbaWfrwfxx suspect : wfrwfxxes) { + try{ + if(StrUtil.isNotEmpty(suspect.getZjhm())){ + //去除历史数据后,需删除 + rpcInfringerResultService.remove(new LambdaQueryWrapper().eq(RpcInfringerResult::getIdCode,suspect.getZjhm())); + } + RpcInfringerResult result = new RpcInfringerResult(); + result.setId(IdUtil.fastSimpleUUID()); + result.setRpcId(rpcApply.getRpcId()); + result.setTortName(suspect.getXm()); + result.setDefendHandleWayName(suspect.getClfs()); + result.setIdCode(suspect.getZjhm()); + if (StrUtil.isNotBlank(suspect.getXbmc())) { + String gender = suspect.getXbmc().split("性")[0]; + result.setGender(gender); + } + rpcInfringerResultService.saveOrUpdate(result); + }catch (Exception e){ + log.info( "处理嫌疑人[" + suspect.getXm() + "]信息时发生异常:" + e.getMessage()); + } + } + } + + for (TXsshrxxb victim : tXsshrxxbList){ + try{ + RpcApplyPerson person = new RpcApplyPerson(); + person.setRpcId(rpcApply.getRpcId()); + person.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); + person.setEmpNo(victim.getEmpNo()); + person.setEmpName(victim.getXm()); + if(StrUtil.isNotEmpty(victim.getXbmc()) ){ + person.setGender(victim.getXbmc().split("性")[0]); + } + rpcApplyPersonService.saveOrUpdate(person); + }catch (Exception e){ + log.info("处理受害人[" + victim.getXm() + "]信息时发生异常:" + e.getMessage()); + } + } + log.info("案件[" + ajbh + "]维权信息处理完成"); + }catch (Exception e){ + log.info("处理案件[" + ajbh + "]时发生异常:" + e.getMessage()); + } + + } + + + + + } + + private final ZhkshDutyScheduleDcMapper zhkshDutyScheduleDcMapper; private final SupRotaMapper supRotaMapper; diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index a91dd15..af7a1b2 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -62,7 +62,7 @@ public interface RpcApplyMapper extends BaseMapper { * */ @Select(" SELECT COUNT(*) from rpc_apply_person a LEFT JOIN rpc_apply b " + " on a.rpc_id = b.rpc_id and b.type =1 " + - " WHERE b.rpc_id is not null " + + " WHERE b.rpc_id is not null and b.verified ='2' " + " and b.crt_time BETWEEN #{beginTime} and #{endTime} ") int selectVictimNumber(Date beginTime, Date endTime); @@ -71,7 +71,7 @@ public interface RpcApplyMapper extends BaseMapper { * */ @Select(" SELECT COUNT(*) from rpc_apply_person a LEFT JOIN rpc_apply b " + " on a.rpc_id = b.rpc_id and b.type =1 " + - " WHERE b.rpc_id is not null " + + " WHERE b.rpc_id is not null and b.verified ='2' " + " and b.crt_time BETWEEN #{beginTime} and #{endTime} " + " and b.second_depart_id = #{deptId} ") int selectVictimNumberByOrg(Date beginTime, Date endTime,String deptId); @@ -83,7 +83,7 @@ public interface RpcApplyMapper extends BaseMapper { "FROM rpc_apply_person rap " + "LEFT JOIN sup_police sp ON rap.emp_no=sp.emp_no " + "LEFT JOIN sup_dict_data sdd on sdd.dict_value = sp.person_type AND sdd.dict_type='personType' " + - "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + + "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sdd.dict_label " + "HAVING `name` IS NOT NULL ") List getPoliceHurtSituation(Date beginTime, Date endTime); @@ -104,7 +104,7 @@ public interface RpcApplyMapper extends BaseMapper { "Incident_link_name AS `name`, " + "count(*) AS `value` " + "FROM rpc_apply ra " + - "WHERE ra.crt_time BETWEEN #{beginTime} AND #{endTime} and ra.type = 1 " + + "WHERE ra.crt_time BETWEEN #{beginTime} AND #{endTime} and ra.type = 1 and ra.verified= '2' " + "GROUP BY Incident_link_name ") List getIncidentLink(Date beginTime, Date endTime); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java index f373d05..df386b1 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java @@ -18,7 +18,7 @@ public interface RpcApplyPersonMapper extends BaseMapper { Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - @Select(" SELECT distinct a.emp_no, a.id, a.rpc_id, a.provide_relief,a.injury_severity, a.injury_severity_name,a.handle_result,a.id_code, a.forms_of_tort, a.emp_type, a.gender ,sup.job_type as empType,sup.name as empName from rpc_apply_person as a " + + @Select(" SELECT distinct a.emp_no, a.id, a.rpc_id, a.provide_relief,a.injury_severity, a.injury_severity_name,a.handle_result,a.id_code, a.forms_of_tort, a.emp_type, a.gender ,a.emp_name as empName, sup.job_type as empType from rpc_apply_person as a " + " left join sup_police as sup " + " on a.emp_no = sup.emp_no where a.rpc_id = #{id} " ) List selectPerson(String id); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java index 499537d..3d0a085 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java @@ -18,27 +18,38 @@ public interface RpcApplySuperviseMapper extends BaseMapper Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - - @Select("SELECT" + - " a.*, " + - " p.*, " + - " ap.injury_severity AS injuryServerity, " + - " ap.injury_severity_name as injuryServerityName " + + Page queryPageData(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + @Select("SELECT " + + "a.rpc_id as rpcId, "+ + "a.depart_id as departId ," + + " a.happen_time as happenTime ," + + " a.case_number as caseNumber ," + + " a.case_name as caseName ," + + " a.case_type as caseType ," + + " a.fact_reason as factReason ," + + "a.case_category as caseCategory, "+ + "a.incident_link_name as incidentLinkName, "+ + "a.police_job as policeJob, "+ + "a.change_mandate as changeMandate, "+ + "a.case_submission as caseSubmission "+ " FROM " + - " rpc_apply_supervise a " + - " LEFT JOIN rpc_person p ON a.rpc_id = p.rpc_id " + - " LEFT JOIN rpc_apply_person ap ON a.rpc_id = ap.rpc_id " + - " LEFT JOIN sup_police sup ON a.input_emp_no = sup.emp_no " + + " rpc_apply a " + " WHERE a.rpc_id = #{id} " ) - List selectDataById(String id); + RpcApplyVo selectDataById(String id); + + + + - @Update(" UPDATE rpc_apply_supervise set " + + @Update(" UPDATE rpc_apply set " + " Incident_link_name = #{rpcApplyVo.incidentLinkName}, " + " police_job = #{rpcApplyVo.policeJob}, " + - " infringer_handle = #{rpcApplyVo.infringerHandle}, " + + " case_type = #{rpcApplyVo.caseType}, " + " case_submission = #{rpcApplyVo.caseSubmission}, " + " change_mandate = #{rpcApplyVo.changeMandate} , " + + " depart_id = #{rpcApplyVo.departId} ,"+ " verified = 2 "+ " where rpc_id = #{rpcApplyVo.rpcId}") int upSuperviseData(@Param("rpcApplyVo") RpcApplyVo rpcApplyVo); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java index a011dc1..82a3bb8 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java @@ -12,7 +12,7 @@ public interface RpcInfringerResultMapper extends BaseMapper @Select(" SELECT rir.tort_name from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id" + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 ") + " and rpa.type = 1 and rpa.verified ='2'") List selectNamesByTime(Date beginTime, Date endTime); @@ -24,13 +24,13 @@ public interface RpcInfringerResultMapper extends BaseMapper @Select(" SELECT rir.* from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id" + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 ") + " and rpa.type = 1 and rpa.verified= '2'") List selectDataByTime(Date beginTime, Date endTime); @Select(" SELECT rir.tort_name from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id " + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 and rpa.second_depart_id = #{orgId} ") + " and rpa.type = 1 and rpa.verified ='2' and rpa.second_depart_id = #{orgId} ") List selectNamesByOrgTime(Date beginTime, Date endTime,String orgId); } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java index 82bde87..6d4e316 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java @@ -26,4 +26,6 @@ public class DwdAsjZfbaWfrwfxx { @TableField("xbmc") private String xbmc; + + } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java index e95b9e4..d710d46 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java @@ -118,4 +118,10 @@ public class RpcApply { private String crtUser; + @TableField("verified") + private String verified; + + @TableField("case_name") + private String caseName; + } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java index b69f9cd..1dae7c9 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java @@ -54,6 +54,7 @@ public class RpcApplyPerson { @TableField("gender") private String gender; //警员姓名 + @TableField("emp_name") private String empName; // 类型,1维权,2,抚慰,3容错 private String type; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/TXsshrxxb.java b/src/main/java/com/biutag/supervision/pojo/entity/TXsshrxxb.java index b8f9124..c69bf13 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/TXsshrxxb.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/TXsshrxxb.java @@ -36,5 +36,17 @@ public class TXsshrxxb { @TableField("sfmfj") private String sfmfj; + @TableField(exist = false) + private String empNo; + //单位id + @TableField(exist = false) + private String departId; + //单位名称 + @TableField(exist = false) + private String departName; + //工作 + @TableField(exist = false) + private String job; + } diff --git a/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java index ac34745..6c8eb5b 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java @@ -26,4 +26,6 @@ public class RpcApplyQueryParam extends BasePage { private String departId; private String rpcStatus; + + private String code; } diff --git a/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java index f7cf737..1baf3c5 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java @@ -25,11 +25,13 @@ public class RpcApplySupervisionQueryParam extends Page { //案件管辖单位 private String departId; //侵权形式 - private String infringerHandle; +// private String infringerHandle; //是否属实 private String verified; //案件编号 private String caseNumber; //选择的标签页 private String activeName; + //案件性质 + private String caseType; } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java index b765ba8..f4e251a 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java @@ -20,6 +20,9 @@ public class RpcApplyVo { private String number; + //案件性质 + private String caseType; + // 申请时间 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") private LocalDate applyDate; diff --git a/src/main/java/com/biutag/supervision/service/BaseUserService.java b/src/main/java/com/biutag/supervision/service/BaseUserService.java index f8e98b4..b814244 100644 --- a/src/main/java/com/biutag/supervision/service/BaseUserService.java +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; + @RequiredArgsConstructor @Service public class BaseUserService extends ServiceImpl { diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyService.java b/src/main/java/com/biutag/supervision/service/RpcApplyService.java index 6a28206..fd2284d 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyService.java @@ -75,6 +75,10 @@ public class RpcApplyService extends ServiceImpl { if (queryParam.getHappenTime() != null && queryParam.getHappenTime().size() == 2) { queryWrapper.between("a.happen_time", queryParam.getHappenTime().get(0), queryParam.getHappenTime().get(1)); } + if(StrUtil.isNotBlank(queryParam.getCode())){ + queryWrapper.eq("a.verified","2"); + } + return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java b/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java index b2da4c5..6401eb5 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java @@ -76,7 +76,7 @@ public class RpcApplySuperviseService extends ServiceImpl rpcApplyVoList = baseMapper.selectDataById(id); - if(CollectionUtil.isEmpty(rpcApplyVoList)){ + RpcApplyVo rpcApplyVo =baseMapper.selectDataById(id); + if(ObjectUtil.isEmpty(rpcApplyVo)){ return null; } - RpcApplyVo rpcApplyVo = rpcApplyVoList.get(0); + if(ObjectUtil.isNotEmpty(rpcApplyVo)){ //获取数据 superviseVo.setRpcApplyVo(rpcApplyVo); @@ -141,21 +141,9 @@ public class RpcApplySuperviseService extends ServiceImpl{ - RpcApply rpcApply= new RpcApply(); - BeanUtil.copyProperties(supervise,rpcApply); - rpcApply.setApplicantEmpName(s.getEmpName()); - rpcApply.setApplicantEmpNo(s.getEmpNo()); - rpcApply.setRpcId(IdUtil.fastSimpleUUID()); - rpcApply.setApplyDate(LocalDate.now()); - s.setRpcId(rpcApply.getRpcId()); - rpcApplyPersonService.upRpcApplyPersonSupervise(s); - rpcApplyService.saveOrUpdate(rpcApply); - }); + } } } diff --git a/src/main/resources/mapper/RpcApplySuperviseMapper.xml b/src/main/resources/mapper/RpcApplySuperviseMapper.xml index 0075aaf..3d7c3e9 100644 --- a/src/main/resources/mapper/RpcApplySuperviseMapper.xml +++ b/src/main/resources/mapper/RpcApplySuperviseMapper.xml @@ -22,4 +22,22 @@ ${ew.getCustomSqlSegment} + + + diff --git a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java index 8b2ba39..90f9c30 100644 --- a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -61,7 +61,7 @@ class SupervisionApplicationTests { void testFun() throws ParseException { - job.rights(); + job.testFun(); } public String getPathTrace(SupDepart depart) {