|
|
|
|
@ -3,14 +3,18 @@ package com.biutag.supervision.controller.books;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.biutag.supervision.constants.enums.DepartLevelEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.SpecialSupervisionEnum; |
|
|
|
|
import com.biutag.supervision.mapper.DataPetitionComplaintMapper; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
|
import com.biutag.supervision.pojo.param.NegativeQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintNegativeVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.DepartTree; |
|
|
|
|
import com.biutag.supervision.pojo.vo.NegativeHdjq; |
|
|
|
|
import com.biutag.supervision.service.NegativeBlameService; |
|
|
|
|
@ -19,6 +23,7 @@ import com.biutag.supervision.service.SupDepartService;
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
@ -43,6 +48,8 @@ public class NegativeBookController {
|
|
|
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
|
|
|
|
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
|
|
|
|
|
|
|
|
|
@GetMapping("hdjq") |
|
|
|
|
public Result<Page<NegativeHdjq>> page(NegativeQueryParam param) { |
|
|
|
|
LambdaQueryWrapper<Negative> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
@ -50,6 +57,7 @@ public class NegativeBookController {
|
|
|
|
|
.eq(Negative::getSpecialSupervision, SpecialSupervisionEnum.HDJQ.getValue()) |
|
|
|
|
.in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getCheckStatusDesc()), Negative::getCheckStatusDesc, param.getCheckStatusDesc()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber()) |
|
|
|
|
.eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()) |
|
|
|
|
.orderByDesc(Negative::getDiscoveryTime) |
|
|
|
|
@ -100,4 +108,110 @@ public class NegativeBookController {
|
|
|
|
|
return Result.success(new Page<NegativeHdjq>().setTotal(page.getTotal()).setRecords(list)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("xcdc") |
|
|
|
|
public Result<Page<NegativeHdjq>> pageByXcdc(NegativeQueryParam param) { |
|
|
|
|
LambdaQueryWrapper<Negative> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.XCDC.getValue()) |
|
|
|
|
.in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getCheckStatusDesc()), Negative::getCheckStatusDesc, param.getCheckStatusDesc()) |
|
|
|
|
.eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()) |
|
|
|
|
.orderByDesc(Negative::getDiscoveryTime); |
|
|
|
|
if (param.getDiscoveryTime().size() == 2) { |
|
|
|
|
queryWrapper.between(Negative::getDiscoveryTime, param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); |
|
|
|
|
} |
|
|
|
|
// 涉及单位
|
|
|
|
|
if (StrUtil.isNotBlank(param.getInvolveDepartId())) { |
|
|
|
|
List<String> departIds = departService.getAllNodeIds(param.getInvolveDepartId()); |
|
|
|
|
queryWrapper.in(Negative::getInvolveDepartId, departIds); |
|
|
|
|
} |
|
|
|
|
// 办理单位
|
|
|
|
|
if (StrUtil.isNotBlank(param.getHandleDepartId())) { |
|
|
|
|
List<DepartTree> nodes = departService.getAllNode(List.of(param.getHandleDepartId())); |
|
|
|
|
List<String> secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); |
|
|
|
|
if (!secondIds.isEmpty()) { |
|
|
|
|
queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { |
|
|
|
|
LambdaQueryWrapper<NegativeBlame> qw = new LambdaQueryWrapper<>(); |
|
|
|
|
switch (param.getResponderKey()) { |
|
|
|
|
case "name": |
|
|
|
|
qw.like(NegativeBlame::getBlameName, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
case "empNo": |
|
|
|
|
qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
case "idCode": |
|
|
|
|
qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
List<NegativeBlame> blames = blameService.list(qw); |
|
|
|
|
if (blames.isEmpty()) { |
|
|
|
|
return Result.success(new Page<NegativeHdjq>().setTotal(0).setRecords(new ArrayList<>())); |
|
|
|
|
} |
|
|
|
|
queryWrapper.in(Negative::getId, blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); |
|
|
|
|
} |
|
|
|
|
Page<Negative> page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); |
|
|
|
|
List<NegativeHdjq> list = page.getRecords().stream().map(item -> { |
|
|
|
|
NegativeHdjq negativeHdjq = new NegativeHdjq(); |
|
|
|
|
BeanUtil.copyProperties(item, negativeHdjq); |
|
|
|
|
return negativeHdjq; |
|
|
|
|
}).toList(); |
|
|
|
|
return Result.success(new Page<NegativeHdjq>().setTotal(page.getTotal()).setRecords(list)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("ajhc") |
|
|
|
|
public Result<Page<NegativeHdjq>> pageByAjhc(NegativeQueryParam param) { |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("xf/{problemSourcesCode}") |
|
|
|
|
public Result<Page<DataPetitionComplaintNegativeVo>> pageByGabxf(@PathVariable String problemSourcesCode, NegativeQueryParam param) { |
|
|
|
|
QueryWrapper<DataPetitionComplaint> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("pc.problem_sources_code", problemSourcesCode) |
|
|
|
|
.in(!param.getProcessingStatus().isEmpty(), "n.Processing_Status", param.getProcessingStatus()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getThingDesc()), "pc.Thing_Desc", param.getThingDesc()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getCheckStatusDesc()), "n.checkStatusDesc", param.getCheckStatusDesc()) |
|
|
|
|
.like(StrUtil.isNotBlank(param.getInitialPetition()), "pc.Initial_Petition", param.getInitialPetition()); |
|
|
|
|
// 涉及单位
|
|
|
|
|
if (StrUtil.isNotBlank(param.getInvolveDepartId())) { |
|
|
|
|
List<String> departIds = departService.getAllNodeIds(param.getInvolveDepartId()); |
|
|
|
|
queryWrapper.in("n.involveDepartId", departIds); |
|
|
|
|
} |
|
|
|
|
// 办理单位
|
|
|
|
|
if (StrUtil.isNotBlank(param.getHandleDepartId())) { |
|
|
|
|
List<DepartTree> nodes = departService.getAllNode(List.of(param.getHandleDepartId())); |
|
|
|
|
List<String> secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); |
|
|
|
|
if (!secondIds.isEmpty()) { |
|
|
|
|
queryWrapper.in("n.Handle_second_depart_id", secondIds); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.in("n.Handle_three_depart_Id", nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { |
|
|
|
|
LambdaQueryWrapper<NegativeBlame> qw = new LambdaQueryWrapper<>(); |
|
|
|
|
switch (param.getResponderKey()) { |
|
|
|
|
case "name": |
|
|
|
|
qw.like(NegativeBlame::getBlameName, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
case "empNo": |
|
|
|
|
qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
case "idCode": |
|
|
|
|
qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
List<NegativeBlame> blames = blameService.list(qw); |
|
|
|
|
if (blames.isEmpty()) { |
|
|
|
|
return Result.success(new Page<DataPetitionComplaintNegativeVo>().setTotal(0).setRecords(new ArrayList<>())); |
|
|
|
|
} |
|
|
|
|
queryWrapper.in("n.id", blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); |
|
|
|
|
} |
|
|
|
|
Page<DataPetitionComplaintNegativeVo> page = dataPetitionComplaintMapper.queryBooks(Page.of(param.getCurrent(), param.getSize()), queryWrapper); |
|
|
|
|
return Result.success(page); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|