diff --git a/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java new file mode 100644 index 0000000..afe4198 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.controller.rightsComfort; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.RpcApplySupervise; +import com.biutag.supervision.pojo.param.RpcApplyQueryParam; +import com.biutag.supervision.pojo.param.RpcApplySupervisionQueryParam; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import com.biutag.supervision.service.RpcApplyService; +import com.biutag.supervision.service.RpcApplySuperviseService; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/rights/supervise") +@RequiredArgsConstructor +@Slf4j +public class SuperviseController { + + + private final RpcApplySuperviseService rpcApplySuperviseService; + /** + * 获取各单位的维权督办列表 + * todo 获取各单位的维权督办列表 + * */ + @GetMapping + public Result> list(RpcApplySupervisionQueryParam queryParam){ + return Result.success(rpcApplySuperviseService.page(queryParam)); + } + + @PutMapping + public Result upData(RpcApplySupervise rpcApplySupervise){ + if(rpcApplySuperviseService.updateById(rpcApplySupervise)){ + 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 f9c36c5..604cfd0 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -102,6 +102,7 @@ public class Job { private final DwdAsjZfbaWfrwfxxMapper dwdAsjZfbaWfrwfxxMapper; private final RpcInfringerResultService rpcInfringerResultService; private final DwdRyZfbaBaryxxService dwdRyZfbaBaryxxService; + private final RpcApplySuperviseService rpcApplySuperviseService; // 每天一次 23:30:00 //todo 维权信息 @Scheduled(cron = "0 30 23 * * ?") @@ -112,7 +113,7 @@ public class Job { List shrxxList = dwdAsjZfbaShrxx2Service.listAll(); log.info("数据:{}条", shrxxList.size()); shrxxList.forEach(item -> { - RpcApply rpcApply = new RpcApply(); + RpcApplySupervise rpcApply = new RpcApplySupervise(); rpcApply.setRpcId(item.getZj()); rpcApply.setCrtTime(LocalDateTime.now()); rpcApply.setUptTime(LocalDateTime.now()); @@ -186,7 +187,7 @@ public class Job { rpcApply.setRpcStatus(ComfortStatus.completed.name()); // 数据来源 rpcApply.setSource("gbase"); - rpcApplyService.save(rpcApply); + rpcApplySuperviseService.save(rpcApply); //受害人列表 RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java index 6f3d607..fa819c1 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java @@ -1,8 +1,17 @@ package com.biutag.supervision.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.pojo.entity.RpcApplyPerson; +import com.biutag.supervision.pojo.entity.RpcApplySupervise; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import org.apache.ibatis.annotations.Param; public interface RpcApplyPersonMapper extends BaseMapper { -} \ No newline at end of file + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java new file mode 100644 index 0000000..2cbba07 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.RpcApplySupervise; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface RpcApplySuperviseMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplySupervise.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplySupervise.java new file mode 100644 index 0000000..2adb36e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplySupervise.java @@ -0,0 +1,122 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Setter +@Getter +public class RpcApplySupervise { + + @TableId(value = "rpc_id") + private String rpcId; + + private String number; + + //案件类型 1、刑事案件 2、行政案件 + @TableField("case_type") + private String caseType; + + //案件类别 + @TableField("case_category") + private String caseCategory; + + // 申请时间 + @TableField("apply_date") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate applyDate; + + // 发生时间 + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 部门id + @TableField("depart_id") + private String departId; + + // 部门 + @TableField("depart_name") + private String departName; + + + private String applicantEmpName; + + private String applicantEmpNo; + + // 类型,1维权,2,抚慰,3容错 + @TableField("type") + private String type; + + // 状态 + @TableField("rpc_status") + private String rpcStatus; + + + @TableField("second_depart_id") + private String secondDepartId; + // 事实及理由 + private String factReason; + + // 案发环节 + private String incidentLink; + + private String incidentLinkName; + //录入人警号 + private String inputEmpNo; + + // 侵权形式 + private String formsOfTort; + + private String formsOfTortName; + + // 侵权人姓名 + private String infringerName; + + // 侵权人处理方式 + private String infringerHandle; + + private String isSelf; + + private String relation; + + // 代理人 + private String agentName; + + // 主办单位 + private String handleDepartId; + + private String handleDepartName; + + + private LocalDateTime crtTime; + + private LocalDateTime uptTime; + + private Integer year; + + private Integer numberIndex; + + + + private String documentFile; + + private String approver; + + private Integer step; + + // 案件编号 + private String caseNumber; + + // 数据来源 + private String source; + + //是否属实 + @TableField("verified") + private String verified; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java new file mode 100644 index 0000000..5438911 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.param; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +@Getter +@Setter +public class RpcApplySupervisionQueryParam extends Page { + /** + * 案发事件 + * */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List applyDate; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List happenTime; + + //案件名称 + private String applicantEmpName; + //案件管辖单位 + private String departId; + //侵权形式 + private String InfringerHandle; + //是否属实 + private String verified; + //案件编号 + private String caseNumber; +} 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 63b600a..f13e719 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java @@ -84,4 +84,12 @@ public class RpcApplyVo { // 联系方式 private String mobile; + // 是否属实 + private String verified; + + //侵权人处理方式 + private String infringerHandle; + //案件类别 + private String caseCategory; + } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java b/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java new file mode 100644 index 0000000..d14aa4c --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java @@ -0,0 +1,67 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.mapper.RpcApplySuperviseMapper; +import com.biutag.supervision.pojo.entity.DepartScore; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.RpcApplySupervise; +import com.biutag.supervision.pojo.entity.RpcRightPerson; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.RpcApplyQueryParam; +import com.biutag.supervision.pojo.param.RpcApplySupervisionQueryParam; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class RpcApplySuperviseService extends ServiceImpl { + + private final RpcRightPersonService rpcRightPersonService; + + private final SupDepartService departService; + + + //分页查询 + public Page page(RpcApplySupervisionQueryParam queryParam, String type) { + UserAuth user = UserContextHolder.getCurrentUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) { + List rightPeoples = rpcRightPersonService.list(user.getUserName()); + if (rightPeoples.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + // 是否是市局维权专干 + if (rightPeoples.stream().noneMatch(item -> "1".equals(item.getCouncil()))) { + Set departIds = rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet()); + List childrenIds = departService.getAllNodeIds(departIds); + queryWrapper.in("a.handle_depart_id", childrenIds); + } + } + queryWrapper.like(StrUtil.isNotBlank(queryParam.getApplicantEmpName()), "a.applicant_emp_name", queryParam.getApplicantEmpName()) + .eq(StrUtil.isNotBlank(queryParam.getDepartId()), "a.depart_id", queryParam.getDepartId()) + .eq("a.type", type) + .eq(StrUtil.isNotBlank(queryParam.getInfringerHandle()), "a.infringer_handle", queryParam.getInfringerHandle()) + .eq(StrUtil.isNotBlank(queryParam.getVerified()),"a.verified",queryParam.getVerified()) + .eq(StrUtil.isNotBlank(queryParam.getCaseNumber()),"a.case_number",queryParam.getCaseNumber()) + .orderByDesc("a.crt_time"); + if (queryParam.getApplyDate() != null && queryParam.getApplyDate().size() == 2) { + queryWrapper.between("a.apply_date", queryParam.getApplyDate().get(0), queryParam.getApplyDate().get(1)); + } + if (queryParam.getHappenTime() != null && queryParam.getHappenTime().size() == 2) { + queryWrapper.between("a.happen_time", queryParam.getHappenTime().get(0), queryParam.getHappenTime().get(1)); + } + + return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } +} diff --git a/src/main/resources/mapper/RpcApplySuperviseMapper.xml b/src/main/resources/mapper/RpcApplySuperviseMapper.xml new file mode 100644 index 0000000..a087ed2 --- /dev/null +++ b/src/main/resources/mapper/RpcApplySuperviseMapper.xml @@ -0,0 +1,17 @@ + + + + + + +