diff --git a/process-api/src/main/java/com/njcn/process/pojo/vo/IssueesAndOrderVO.java b/process-api/src/main/java/com/njcn/process/pojo/vo/IssueesAndOrderVO.java new file mode 100644 index 000000000..0936e57d9 --- /dev/null +++ b/process-api/src/main/java/com/njcn/process/pojo/vo/IssueesAndOrderVO.java @@ -0,0 +1,29 @@ +package com.njcn.process.pojo.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +* @Description: 问题及工单类 +* @Param: +* @return: +* @Author: clam +* @Date: 2023/1/5 +*/ +@Data +public class IssueesAndOrderVO implements Serializable { + + private static final long serialVersionUID = -8022287041427540079L; + + @ApiModelProperty("单位id") + private String id; + + @ApiModelProperty("问题个数") + private Integer issueesCount; + + @ApiModelProperty("已关联工单数量") + private Integer relatedOrderCount; + +} diff --git a/process-boot/process-boot.iml b/process-boot/process-boot.iml new file mode 100644 index 000000000..691a6e399 --- /dev/null +++ b/process-boot/process-boot.iml @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/controller/ElectricityQualityIssuesController.java b/process-boot/src/main/java/com/njcn/process/controller/ElectricityQualityIssuesController.java index 027e5b3a1..f15b6fe4a 100644 --- a/process-boot/src/main/java/com/njcn/process/controller/ElectricityQualityIssuesController.java +++ b/process-boot/src/main/java/com/njcn/process/controller/ElectricityQualityIssuesController.java @@ -212,4 +212,15 @@ public class ElectricityQualityIssuesController extends BaseController { issuesService.deleteIssues(powerQualityProblemNo); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE) + @PostMapping("/queryIssuesAndOrder") + @ApiOperation("查询问题及工单(当前部门下)") + @ApiImplicitParam(name = "orgNo", value = "部门id", required = true) + public HttpResult queryIssuesAndOrder(@RequestParam("orgNo") String orgNo){ + String methodDescribe = getMethodDescribe("queryIssuesAndOrder"); + IssueesAndOrderVO issueesAndOrderVO =issuesService.queryIssuesAndOrder(orgNo); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, issueesAndOrderVO, methodDescribe); + } + } diff --git a/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java index 816ad606b..c64d03593 100644 --- a/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java +++ b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java @@ -33,9 +33,9 @@ public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper", - "and a.plan_name = #{questionQueryParm.planName}\n" + - "", - "AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')", - ""}) - List querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm); -} \ No newline at end of file + "and a.plan_name = #{questionQueryParm.planName}\n" + + "", + "AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')", + ""}) + List querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm); + } \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/mapper/RStatElectricQualityProblemFlowMapper.java b/process-boot/src/main/java/com/njcn/process/mapper/RStatElectricQualityProblemFlowMapper.java index 413daba31..58e794067 100644 --- a/process-boot/src/main/java/com/njcn/process/mapper/RStatElectricQualityProblemFlowMapper.java +++ b/process-boot/src/main/java/com/njcn/process/mapper/RStatElectricQualityProblemFlowMapper.java @@ -1,8 +1,6 @@ package com.njcn.process.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.process.pojo.param.QueryIssuesParam; import com.njcn.process.pojo.po.RStatElectricQualityProblemFlow; import com.njcn.process.pojo.vo.IssuesVO; @@ -20,5 +18,5 @@ import java.util.List; */ public interface RStatElectricQualityProblemFlowMapper extends BaseMapper { - List getIssues(@Param("param") QueryIssuesParam param, @Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd); + List getIssues(@Param("deptIds") ListdeptIds,@Param("param") QueryIssuesParam param, @Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd); } diff --git a/process-boot/src/main/java/com/njcn/process/mapper/mapping/RStatElectricQualityProblemFlowMapper.xml b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RStatElectricQualityProblemFlowMapper.xml index afdfbc2eb..6ae830695 100644 --- a/process-boot/src/main/java/com/njcn/process/mapper/mapping/RStatElectricQualityProblemFlowMapper.xml +++ b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RStatElectricQualityProblemFlowMapper.xml @@ -9,8 +9,12 @@ r_stat_electric_quality_problem_flow WHERE data_date between #{dateBegin} AND #{dateEnd} - - AND org_no = #{param.orgNo} + + AND org_no in + + #{item} + + AND problem_sources = #{param.problemSources} diff --git a/process-boot/src/main/java/com/njcn/process/service/IssuesService.java b/process-boot/src/main/java/com/njcn/process/service/IssuesService.java index 8eb53d01f..d2ab9867f 100644 --- a/process-boot/src/main/java/com/njcn/process/service/IssuesService.java +++ b/process-boot/src/main/java/com/njcn/process/service/IssuesService.java @@ -88,4 +88,12 @@ public interface IssuesService { * 删除问题 */ void deleteIssues(String powerQualityProblemNo); + /** + * @Description: 查询问题及工单(当前部门下) + * @Param: [orgNo] + * @return: com.njcn.process.pojo.vo.IssueesAndOrderVO + * @Author: clam + * @Date: 2023/1/5 + */ + IssueesAndOrderVO queryIssuesAndOrder(String orgNo); } diff --git a/process-boot/src/main/java/com/njcn/process/service/impl/IssuesServiceImpl.java b/process-boot/src/main/java/com/njcn/process/service/impl/IssuesServiceImpl.java index 3a468ced1..dffabfd12 100644 --- a/process-boot/src/main/java/com/njcn/process/service/impl/IssuesServiceImpl.java +++ b/process-boot/src/main/java/com/njcn/process/service/impl/IssuesServiceImpl.java @@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.pinyin.PinyinUtil; import com.alibaba.nacos.shaded.com.google.common.collect.Lists; 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.njcn.common.pojo.constant.BizParamConstant; import com.njcn.common.pojo.exception.BusinessException; @@ -81,7 +82,7 @@ public class IssuesServiceImpl implements IssuesService { issues.setStartTime(null); issues.setUpdateTime(null); issues.setReportProcess(DicDataEnum.NOT_REPORTED.getCode()); - issues.setReportProcessStatus(DicDataEnum.AUDITT.getCode()); + issues.setReportProcessStatus(DicDataEnum.INIT.getCode()); issuesMapper.insert(issues); return local; } @@ -199,7 +200,9 @@ public class IssuesServiceImpl implements IssuesService { dateBegin = DateUtil.beginOfMonth(dateOut); dateEnd = DateUtil.endOfMonth(dateOut); } - List out = issuesMapper.getIssues(param,DateUtil.formatDateTime(dateBegin), DateUtil.formatDateTime(dateEnd)); + List deptIds = deptFeignClient.getDepSonIdtByDeptId(param.getOrgNo ()).getData(); + + List out = issuesMapper.getIssues(deptIds,param,DateUtil.formatDateTime(dateBegin), DateUtil.formatDateTime(dateEnd)); if (!CollectionUtils.isEmpty(out)) { out.forEach(data -> data.setOrgName((deptFeignClient.getDeptById(data.getOrgNo()).getData().getName()))); /*问题来源*/ @@ -390,6 +393,7 @@ public class IssuesServiceImpl implements IssuesService { issuesQuery.eq(RStatElectricQualityProblemFlow::getPowerQualityProblemNo,processParam.getPowerQualityProblemNo()); RStatElectricQualityProblemFlow issuesOut = issuesMapper.selectOne(issuesQuery); issuesOut.setReportProcess(DicDataEnum.CAUSE_ANALYSIS.getCode()); + issuesOut.setReportProcessStatus (DicDataEnum.AUDITT.getCode()); issuesMapper.update(issuesOut,issuesQuery); if (DicDataEnum.USER_COMPLAINTS.getCode().equals(issuesOut.getProblemSources())){ LambdaQueryWrapper complaintQuery = new LambdaQueryWrapper<>(); @@ -529,4 +533,32 @@ public class IssuesServiceImpl implements IssuesService { issuesMapper.delete(query); } + /** + * @param orgNo + * @Description: 查询问题及工单(当前部门下) + * @Param: [orgNo] + * @return: com.njcn.process.pojo.vo.IssueesAndOrderVO + * @Author: clam + * @Date: 2023/1/5 + */ + @Override + public IssueesAndOrderVO queryIssuesAndOrder(String orgNo) { + IssueesAndOrderVO issueesAndOrderVO = new IssueesAndOrderVO(); + + List deptIds = deptFeignClient.getDepSonIdtByDeptId(orgNo).getData(); + /*问题个数*/ + QueryWrapper qualityProblemFlowQueryWrapper = new QueryWrapper<> (); + qualityProblemFlowQueryWrapper.select ("1"). + in ("orgNo",deptIds); + Integer integer = issuesMapper.selectCount (qualityProblemFlowQueryWrapper); + issueesAndOrderVO.setId (orgNo); + issueesAndOrderVO.setIssueesCount (integer); + /*已关联工单数量*/ + + + + + return issueesAndOrderVO; + } + } diff --git a/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java index 65a458745..d8bf9dca5 100644 --- a/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java +++ b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java @@ -18,9 +18,9 @@ import com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm; import com.njcn.process.pojo.param.SurveyResultUploadParam; import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; -import com.njcn.process.pojo.vo.SurveyPlanExcel; import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO; import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; +import com.njcn.process.pojo.vo.SurveyPlanExcel; import com.njcn.process.service.RGeneralSurveyPlanDetailService; import com.njcn.process.service.RGeneralSurveyPlanPOService; import com.njcn.user.api.DeptFeignClient; @@ -203,12 +203,15 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl collect = Stream.of (split).map (temp -> { - MinIoUploadResDTO dto = new MinIoUploadResDTO("",minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), temp, 7 * 24 * 60 * 60)); + String[] split1 = temp.split ("##"); + String OriginalFilename = split1[1]; + String minoFileName = split1[0]; + MinIoUploadResDTO dto = new MinIoUploadResDTO(OriginalFilename,minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), minoFileName, 7 * 24 * 60 * 60)); return dto ; }).collect (Collectors.toList ( )); return collect; @@ -335,7 +341,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl