Browse Source

fiex:维权督办优化 & 定时任务优化

master
pengwei 3 months ago
parent
commit
01a220ad3a
  1. 19
      src/main/java/com/biutag/supervision/controller/rightsComfort/RightsController.java
  2. 2
      src/main/java/com/biutag/supervision/job/Job.java
  3. 7
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  4. 2
      src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java
  5. 34
      src/main/java/com/biutag/supervision/service/RpcApplyService.java
  6. 15
      src/main/resources/mapper/RpcApplyMapper.xml

19
src/main/java/com/biutag/supervision/controller/rightsComfort/RightsController.java

@ -3,13 +3,13 @@ package com.biutag.supervision.controller.rightsComfort;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; import com.biutag.supervision.constants.enums.RpcApplyTypeEnum;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.RpcApplyPerson;
import com.biutag.supervision.pojo.param.RpcApplyQueryParam; import com.biutag.supervision.pojo.param.RpcApplyQueryParam;
import com.biutag.supervision.pojo.vo.RpcApplyVo; import com.biutag.supervision.pojo.vo.RpcApplyVo;
import com.biutag.supervision.service.RpcApplyPersonService;
import com.biutag.supervision.service.RpcApplyService; import com.biutag.supervision.service.RpcApplyService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author wxc * @author wxc
@ -22,8 +22,19 @@ public class RightsController {
private final RpcApplyService rpcApplyService; private final RpcApplyService rpcApplyService;
private final RpcApplyPersonService rpcApplyPersonService;
@GetMapping @GetMapping
public Result<Page<RpcApplyVo>> list(RpcApplyQueryParam queryParam) { public Result<Page<RpcApplyVo>> list(RpcApplyQueryParam queryParam) {
return Result.success(rpcApplyService.page(queryParam, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); // return Result.success(rpcApplyService.page(queryParam, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()));
return Result.success(rpcApplyService.pageData(queryParam,RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()));
}
@DeleteMapping("{id}")
public Result<Void> del(@PathVariable String id) {
rpcApplyPersonService.removeById(id);
return Result.success();
} }
} }

2
src/main/java/com/biutag/supervision/job/Job.java

@ -127,7 +127,7 @@ public class Job {
// 每天一次 23:30:00 // 每天一次 23:30:00
//todo 维权信息 //todo 维权信息
// @Scheduled(cron = "0 30 23 * * ?") @Scheduled(cron = "0 30 23 * * ?")
public void rights() throws ParseException { public void rights() throws ParseException {
log.info("rights--------------------"); log.info("rights--------------------");
log.info("维权信息抓取中---------------------"); log.info("维权信息抓取中---------------------");

7
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -216,6 +216,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
"HAVING `name` is NOT NULL ") "HAVING `name` is NOT NULL ")
List<EchartsVo> getSubOneIncidentOrg(Date beginTime, Date endTime, Integer departId); List<EchartsVo> getSubOneIncidentOrg(Date beginTime, Date endTime, Integer departId);
Page<RpcApplyVo> queryRightsPage(@Param("page") Page<RpcApply> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApply> queryWrapper);
Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApply> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApply> queryWrapper); Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApply> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApply> queryWrapper);
@Select("select max(number_index) from rpc_apply where year = #{year}") @Select("select max(number_index) from rpc_apply where year = #{year}")
@ -244,7 +245,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
* */ * */
@Select(" select sdp.short_name as label,COUNT(*) as value from rpc_apply ra " + @Select(" select sdp.short_name as label,COUNT(*) as value from rpc_apply ra " +
" LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + " LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " +
" WHERE sdp.statistics_group_id = #{departGroupId} and ra.type =1 " + " WHERE sdp.statistics_group_id = #{departGroupId} and ra.type =1 and ra.verified= '2' " +
" and ra.crt_time BETWEEN #{beginTime} and #{endTime} " + " and ra.crt_time BETWEEN #{beginTime} and #{endTime} " +
" GROUP BY sdp.short_name order by value desc ") " GROUP BY sdp.short_name order by value desc ")
List<BarItem> selectProtectRightsBarList(Date beginTime, Date endTime, Integer departGroupId); List<BarItem> selectProtectRightsBarList(Date beginTime, Date endTime, Integer departGroupId);
@ -257,7 +258,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
@Select(" SELECT sdp.short_name as label, COUNT(*) as value from rpc_apply ra " + @Select(" SELECT sdp.short_name as label, COUNT(*) as value from rpc_apply ra " +
" left join sup_depart sdp on ra.depart_id = sdp.id " + " left join sup_depart sdp on ra.depart_id = sdp.id " +
" where sdp.pid = #{departId} " + " where sdp.pid = #{departId} " +
" and ra.type =1 and sdp.statistics_group_id = #{departGroupId} " + " and ra.type =1 and sdp.statistics_group_id = #{departGroupId} and ra.verified= '2' " +
" and ra.crt_time BETWEEN #{beginTime} AND #{endTime} " + " and ra.crt_time BETWEEN #{beginTime} AND #{endTime} " +
" GROUP BY sdp.short_name order by value desc") " GROUP BY sdp.short_name order by value desc")
List<BarItem> selectSubPcsProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId); List<BarItem> selectSubPcsProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId);
@ -269,7 +270,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
" left join sup_depart sdp on ra.depart_id = sdp.id " + " left join sup_depart sdp on ra.depart_id = sdp.id " +
" where sdp.pid = #{departId} " + " where sdp.pid = #{departId} " +
" and ra.type =1 and sdp.statistics_group_id != #{departGroupId} " + " and ra.type =1 and sdp.statistics_group_id != #{departGroupId} " +
" and ra.crt_time BETWEEN #{beginTime} AND #{endTime} " + " and ra.crt_time BETWEEN #{beginTime} AND #{endTime} and ra.verified= '2' " +
" GROUP BY sdp.short_name order by value desc") " GROUP BY sdp.short_name order by value desc")
List<BarItem> selectSubDdProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId); List<BarItem> selectSubDdProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId);

2
src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java

@ -16,6 +16,8 @@ import java.time.LocalDateTime;
@Getter @Getter
public class RpcApplyVo { public class RpcApplyVo {
private String personId;
private String rpcId; private String rpcId;
private String number; private String number;

34
src/main/java/com/biutag/supervision/service/RpcApplyService.java

@ -82,6 +82,40 @@ public class RpcApplyService extends ServiceImpl<RpcApplyMapper, RpcApply> {
return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
} }
public Page<RpcApplyVo> pageData(RpcApplyQueryParam queryParam,String type){
UserAuth user = UserContextHolder.getCurrentUser();
QueryWrapper<RpcApply> 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.getRpcStatus()), "a.rpc_status", queryParam.getRpcStatus())
.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));
}
if(StrUtil.isNotBlank(queryParam.getCode())){
queryWrapper.eq("a.verified","2");
}
return baseMapper.queryRightsPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public Integer getNewNumberIndex(Integer year) { public Integer getNewNumberIndex(Integer year) {
return NumberUtil.nullToZero(baseMapper.selectMaxNuberIndex(year)) + 1; return NumberUtil.nullToZero(baseMapper.selectMaxNuberIndex(year)) + 1;
} }

15
src/main/resources/mapper/RpcApplyMapper.xml

@ -13,4 +13,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>
<select id="queryRightsPage" resultType="com.biutag.supervision.pojo.vo.RpcApplyVo">
select
rap.emp_name as applicantEmpName,
rap.emp_no as applicantEmpNo,
a.happen_time as happentime,
a.depart_name as departName,
a.case_number as caseNumber,
a.fact_reason as factReason,
rap.id as personId,
a.rpc_status as rpcStatus,
a.rpc_id as rpcId
from rpc_apply_person rap
LEFT JOIN rpc_apply a on rap.rpc_id = a.rpc_id
${ew.getCustomSqlSegment}
</select>
</mapper> </mapper>

Loading…
Cancel
Save