From f1ad74ea2d35c41cb053b831a5611d7bbdf9f598 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Wed, 27 Nov 2024 16:22:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=8E=B0=E5=9C=BA=E7=9B=91=E7=9D=A3=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SupvProblemController.java | 5 +- .../process/mapper/SupvProblemMapper.java | 3 +- .../mapper/mapping/SupvProblemMapper.xml | 6 ++ .../process/service/ISupvProblemService.java | 3 +- .../service/impl/SupvProblemServiceImpl.java | 95 +++++++++++-------- 5 files changed, 70 insertions(+), 42 deletions(-) diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java index 7e3cd3c70..532c54ab3 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java @@ -10,6 +10,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; +import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvProblemParam; import com.njcn.process.pojo.po.SupvProblem; import com.njcn.process.pojo.vo.SupvProblemVO; @@ -92,8 +93,8 @@ public class SupvProblemController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @ApiOperation("所有监督问题") @ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true) - public void problemList(@RequestBody SupvProblemParam supvProblemParam){ - iSupvProblemService.problemList(supvProblemParam); + public void problemList(@RequestBody SupvPlanParam supvPlanParam){ + iSupvProblemService.problemList(supvPlanParam); } } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java index 8eac2f7ca..faa7b7883 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.njcn.process.pojo.param.SupvProblemParam; import com.njcn.process.pojo.po.SupvProblem; import com.njcn.process.pojo.vo.SupvProblemVO; +import liquibase.pro.packaged.S; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -22,5 +23,5 @@ public interface SupvProblemMapper extends BaseMapper { Boolean updateId(@Param("isUploadHead")Integer isUploadHead, @Param("id") String id); - List listDerive(@Param("param") SupvProblemParam supvProblemParam); + List listDerive(@Param("planIds")List list); } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml index 512c44e4e..be95b52b3 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml @@ -12,6 +12,12 @@ from supv_problem spm INNER JOIN supv_plan sp on sp.plan_Id=spm.plan_id + + sp.plan_id in + + #{item} + + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java index 09e57f5b8..1979cf7ee 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java @@ -3,6 +3,7 @@ package com.njcn.process.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvProblemParam; import com.njcn.process.pojo.po.SupvProblem; import com.njcn.process.pojo.vo.SupvProblemVO; @@ -55,5 +56,5 @@ public interface ISupvProblemService extends IService { * @Author: wr * @Date: 2023/9/1 9:44 */ - void problemList(SupvProblemParam supvProblemParam); + void problemList(SupvPlanParam supvPlanParam); } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java index 85456add4..05e47b288 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java @@ -3,6 +3,7 @@ package com.njcn.process.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; @@ -15,7 +16,9 @@ import com.njcn.common.utils.PubUtils; import com.njcn.oss.utils.FileStorageUtil; import com.njcn.poi.excel.ExcelUtil; import com.njcn.process.mapper.SupvFileMapper; +import com.njcn.process.mapper.SupvPlanMapper; import com.njcn.process.mapper.SupvProblemMapper; +import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvProblemParam; import com.njcn.process.pojo.po.SupvFile; import com.njcn.process.pojo.po.SupvPlan; @@ -35,6 +38,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -61,15 +65,16 @@ public class SupvProblemServiceImpl extends ServiceImpl fileLambdaQueryWrapper = new LambdaQueryWrapper<>(); fileLambdaQueryWrapper.in(SupvFile::getBusiId, problemIds); List supvFileList = supvFileMapper.selectList(fileLambdaQueryWrapper); - supvFileList.forEach(item-> fileStorageUtil.getFileStream(item.getFileUrl())); + supvFileList.forEach(item -> fileStorageUtil.getFileStream(item.getFileUrl())); supvFileMapper.delete(fileLambdaQueryWrapper); } return true; @@ -133,10 +138,10 @@ public class SupvProblemServiceImpl extends ServiceImpl supvFileList = supvFileMapper.selectList(new LambdaQueryWrapper().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1)); if (CollUtil.isNotEmpty(supvFileList)) { - for(SupvFile supvFile:supvFileList){ - if(supvFile.getAttachmentType().equals(stamped_report.getId())){ + for (SupvFile supvFile : supvFileList) { + if (supvFile.getAttachmentType().equals(stamped_report.getId())) { item.setAttachmentName(supvFile.getAttachmentName()); - }else { + } else { item.setAttachmentNameTwo(supvFile.getAttachmentName()); } @@ -148,44 +153,58 @@ public class SupvProblemServiceImpl extends ServiceImpl supvProblemVOS = this.baseMapper.listDerive(supvProblemParam); - //监测点状态 - List monitorTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITOR_TYPE.getCode()).getData(); - Map mapMonitorType = monitorTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); - //问题类型 - List problemTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_PROBLEM_TYPE.getCode()).getData(); - Map mapProblemType = problemTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); + public void problemList(SupvPlanParam supvPlanParam) { + List supvProblemVOS = new ArrayList<>(); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + List deptIds = deptFeignClient.getDepSonSelfCodetByCode(supvPlanParam.getPlanOrgId()).getData(); + lambdaQueryWrapper.select(SupvPlan::getPlanId).in(SupvPlan::getPlanOrgId, deptIds) + .between(SupvPlan::getPlanSupvDate, DateUtil.parse(supvPlanParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DateUtil.parse(supvPlanParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)) + .eq(StrUtil.isNotBlank(supvPlanParam.getSupvType()), SupvPlan::getSupvType, supvPlanParam.getSupvType()); - //问题类型 - List problemLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.problem_level_type.getCode().trim()).getData(); - Map mapProblemLeve = problemLevelList.stream().collect(Collectors.toMap(DictData::getValue, Function.identity())); + List planIds = supvPlanMapper.selectList(lambdaQueryWrapper).stream().map(SupvPlan::getPlanId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(planIds)) { + supvProblemVOS = this.baseMapper.listDerive(planIds); + if(CollUtil.isNotEmpty(supvProblemVOS)) { - for (SupvProblemVO supvProblem : supvProblemVOS) { - Dept dept = deptFeignClient.getDeptByCode(supvProblem.getDutyOrgId()).getData(); - supvProblem.setDutyOrgName(dept.getName()); + //监测点状态 + List monitorTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITOR_TYPE.getCode()).getData(); + Map mapMonitorType = monitorTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); + //问题类型 + List problemTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_PROBLEM_TYPE.getCode()).getData(); + Map mapProblemType = problemTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); - if (mapMonitorType.containsKey(supvProblem.getMonitorType())) { - supvProblem.setMonitorType(mapMonitorType.get(supvProblem.getMonitorType()).getName()); - } - if (mapProblemType.containsKey(supvProblem.getProblemType())) { - supvProblem.setProblemType(mapProblemType.get(supvProblem.getProblemType()).getName()); - } - if (mapProblemLeve.containsKey(supvProblem.getProblemLevel())) { - supvProblem.setProblemLevel(mapProblemLeve.get(supvProblem.getProblemLevel()).getName()); + //问题类型 + List problemLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.problem_level_type.getCode().trim()).getData(); + Map mapProblemLeve = problemLevelList.stream().collect(Collectors.toMap(DictData::getValue, Function.identity())); + + for (SupvProblemVO supvProblem : supvProblemVOS) { + Dept dept = deptFeignClient.getDeptByCode(supvProblem.getDutyOrgId()).getData(); + supvProblem.setDutyOrgName(dept.getName()); + + if (mapMonitorType.containsKey(supvProblem.getMonitorType())) { + supvProblem.setMonitorType(mapMonitorType.get(supvProblem.getMonitorType()).getName()); + } + if (mapProblemType.containsKey(supvProblem.getProblemType())) { + supvProblem.setProblemType(mapProblemType.get(supvProblem.getProblemType()).getName()); + } + if (mapProblemLeve.containsKey(supvProblem.getProblemLevel())) { + supvProblem.setProblemLevel(mapProblemLeve.get(supvProblem.getProblemLevel()).getName()); + } + } } } - ExcelUtil.exportExcel("实施问题信息.xlsx",SupvProblemVO.class,supvProblemVOS); + ExcelUtil.exportExcel("实施问题信息.xlsx", SupvProblemVO.class, supvProblemVOS); } + //判断是否存在时间范围内 - public void checkParam(String id,String time) { - if(StrUtil.isNotBlank(time)){ + public void checkParam(String id, String time) { + if (StrUtil.isNotBlank(time)) { SupvPlan supvPlan = iSupvPlanService.getById(id); - if(ObjectUtil.isNotNull(supvPlan)){ + if (ObjectUtil.isNotNull(supvPlan)) { //判断时间范围 - if (ObjectUtil.isAllNotEmpty(supvPlan.getEffectStartTime(), supvPlan.getEffectEndTime())|| + if (ObjectUtil.isAllNotEmpty(supvPlan.getEffectStartTime(), supvPlan.getEffectEndTime()) || ObjectUtil.isAllNotEmpty(supvPlan.getEffectStartTime(), supvPlan.getReportIssueTime()) ) { //实施开始时间 @@ -193,14 +212,14 @@ public class SupvProblemServiceImpl extends ServiceImpl