Browse Source

fix:维权督办后端接口v1

master
pengwei 6 months ago
parent
commit
6958ee348a
  1. 45
      src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java
  2. 5
      src/main/java/com/biutag/supervision/job/Job.java
  3. 11
      src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java
  4. 18
      src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java
  5. 122
      src/main/java/com/biutag/supervision/pojo/entity/RpcApplySupervise.java
  6. 33
      src/main/java/com/biutag/supervision/pojo/param/RpcApplySupervisionQueryParam.java
  7. 8
      src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java
  8. 67
      src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java
  9. 17
      src/main/resources/mapper/RpcApplySuperviseMapper.xml

45
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<Page<RpcApplyVo>> list(RpcApplySupervisionQueryParam queryParam){
return Result.success(rpcApplySuperviseService.page(queryParam));
}
@PutMapping
public Result<Void> upData(RpcApplySupervise rpcApplySupervise){
if(rpcApplySuperviseService.updateById(rpcApplySupervise)){
return Result.success();
}else{
return Result.failed("数据更新错误");
}
}
}

5
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<DwdAsjZfbaShrxx2> 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();

11
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<RpcApplyPerson> {
}
Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApplySupervise> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApplySupervise> queryWrapper);
}

18
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<RpcApplySupervise> {
Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApplySupervise> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApplySupervise> queryWrapper);
}

122
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;
}

33
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<Date> applyDate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<Date> happenTime;
//案件名称
private String applicantEmpName;
//案件管辖单位
private String departId;
//侵权形式
private String InfringerHandle;
//是否属实
private String verified;
//案件编号
private String caseNumber;
}

8
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;
}

67
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<RpcApplySuperviseMapper, RpcApplySupervise> {
private final RpcRightPersonService rpcRightPersonService;
private final SupDepartService departService;
//分页查询
public Page<RpcApplyVo> page(RpcApplySupervisionQueryParam queryParam, String type) {
UserAuth user = UserContextHolder.getCurrentUser();
QueryWrapper<RpcApplySupervise> queryWrapper = new QueryWrapper<>();
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) {
List<RpcRightPerson> rightPeoples = rpcRightPersonService.list(user.getUserName());
if (rightPeoples.isEmpty()) {
return new Page<RpcApplyVo>().setTotal(0).setRecords(new ArrayList<>());
}
// 是否是市局维权专干
if (rightPeoples.stream().noneMatch(item -> "1".equals(item.getCouncil()))) {
Set<String> departIds = rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet());
List<String> 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);
}
}

17
src/main/resources/mapper/RpcApplySuperviseMapper.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.biutag.supervision.mapper.RpcApplyMapper">
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.RpcApplyVo">
SELECT
a.*, p.*, ap.injury_severity, ap.injury_severity_name
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
${ew.getCustomSqlSegment}
</select>
</mapper>
Loading…
Cancel
Save