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 7f94c7891..413daba31 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
@@ -8,6 +8,8 @@ import com.njcn.process.pojo.po.RStatElectricQualityProblemFlow;
import com.njcn.process.pojo.vo.IssuesVO;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
*
* 电能质量问题流程表 Mapper 接口
@@ -18,5 +20,5 @@ import org.apache.ibatis.annotations.Param;
*/
public interface RStatElectricQualityProblemFlowMapper extends BaseMapper {
- Page getIssues(IPage page, @Param("param") QueryIssuesParam param, @Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
+ List getIssues(@Param("param") QueryIssuesParam param, @Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
}
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 572079412..341da8564 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
@@ -3,8 +3,11 @@ package com.njcn.process.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.hutool.core.util.ArrayUtil;
+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.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.constant.BizParamConstant;
import com.njcn.common.pojo.exception.BusinessException;
@@ -25,6 +28,7 @@ import com.njcn.user.api.DeptFeignClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@@ -68,10 +72,11 @@ public class IssuesServiceImpl implements IssuesService {
/**
* 新增电能质量问题流程表信息
*/
- private LocalDateTime addIssues(IssuesParam issuesParam){
+ private LocalDateTime addIssues(IssuesParam issuesParam,String powerQualityProblemNo){
RStatElectricQualityProblemFlow issues = new RStatElectricQualityProblemFlow();
LocalDateTime local = LocalDateTimeUtil.now();
BeanUtil.copyProperties(issuesParam,issues);
+ issues.setPowerQualityProblemNo(powerQualityProblemNo);
issues.setDataDate(local);
issues.setStartTime(null);
issues.setUpdateTime(null);
@@ -81,6 +86,33 @@ public class IssuesServiceImpl implements IssuesService {
return local;
}
+ /**
+ * 生成问题编号
+ */
+ private String getPowerQualityProblemNo(IssuesParam issuesParam){
+ StringBuilder powerQualityProblemNo = new StringBuilder();
+ powerQualityProblemNo.append(PinyinUtil.getFirstLetter(issuesParam.getOrgName(),"").toUpperCase()).append("-");
+ if (DicDataEnum.ONLINE.getCode().equals(issuesParam.getProblemSources())){
+ powerQualityProblemNo.append("ZXJC");
+ }else if (DicDataEnum.GENERAL.getCode().equals(issuesParam.getProblemSources())){
+ powerQualityProblemNo.append("PCCB");
+ }else if (DicDataEnum.USER_COMPLAINTS.getCode().equals(issuesParam.getProblemSources())){
+ powerQualityProblemNo.append("YHTS");
+ }else if (DicDataEnum.DEV_EXCEPTION.getCode().equals(issuesParam.getProblemSources())){
+ powerQualityProblemNo.append("YWYC");
+ }
+ String nowDate = DateUtil.format(new Date(), "yyyyMMdd");
+ String processDate = DateUtil.format(new Date(), "yyyy-MM-dd");
+ powerQualityProblemNo.append(nowDate);
+ LambdaQueryWrapper issuesQuery = new LambdaQueryWrapper<>();
+ LocalDateTime local = LocalDateTimeUtil.parse(processDate + "T00:00:00");
+ LocalDateTime localEnd = LocalDateTimeUtil.parse(processDate + "T23:59:59");
+ issuesQuery.ge(RStatElectricQualityProblemFlow::getDataDate, local).le(RStatElectricQualityProblemFlow::getDataDate,localEnd);
+ Integer count = issuesMapper.selectCount(issuesQuery);
+ powerQualityProblemNo.append(StrUtil.padPre(String.valueOf(count + 1),5, '0'));
+ return powerQualityProblemNo.toString();
+ }
+
/**
* 填报在线监测超标问题
*/
@@ -88,9 +120,11 @@ public class IssuesServiceImpl implements IssuesService {
public void addExcessiveIssues(ExcessiveParam excessiveParam) {
IssuesParam issuesParam = new IssuesParam();
BeanUtil.copyProperties(excessiveParam,issuesParam);
- LocalDateTime localDateTime = addIssues(issuesParam);
+ String powerQualityProblemNo = getPowerQualityProblemNo(issuesParam);
+ LocalDateTime localDateTime = addIssues(issuesParam,powerQualityProblemNo);
RMpOnlineMonitorOverproofProblem excessive = new RMpOnlineMonitorOverproofProblem();
BeanUtil.copyProperties(excessiveParam,excessive);
+ excessive.setPowerQualityProblemNo(powerQualityProblemNo);
excessive.setDataDate(localDateTime);
excessiveMapper.insert(excessive);
}
@@ -102,9 +136,12 @@ public class IssuesServiceImpl implements IssuesService {
public void addGeneralSurveyIssues(GeneralSurveyParam generalSurveyParam) {
IssuesParam issuesParam = new IssuesParam();
BeanUtil.copyProperties(generalSurveyParam,issuesParam);
- LocalDateTime localDateTime = addIssues(issuesParam);
+ String powerQualityProblemNo = getPowerQualityProblemNo(issuesParam);
+ LocalDateTime localDateTime = addIssues(issuesParam,powerQualityProblemNo);
RMpGeneralSurveyOverproofProblem generalSurvey = new RMpGeneralSurveyOverproofProblem();
BeanUtil.copyProperties(generalSurveyParam,generalSurvey);
+ generalSurvey.setOverLimitTarget(ArrayUtil.toString(generalSurveyParam.getSteadyState())+ArrayUtil.toString(generalSurveyParam.getTransientIndicators()));
+ generalSurvey.setPowerQualityProblemNo(powerQualityProblemNo);
generalSurvey.setDataDate(localDateTime);
generalSurveyMapper.insert(generalSurvey);
}
@@ -116,9 +153,12 @@ public class IssuesServiceImpl implements IssuesService {
public void addComplaintIssues(ComplaintParam complaintParam) {
IssuesParam issuesParam = new IssuesParam();
BeanUtil.copyProperties(complaintParam,issuesParam);
- LocalDateTime localDateTime = addIssues(issuesParam);
+ String powerQualityProblemNo = getPowerQualityProblemNo(issuesParam);
+ LocalDateTime localDateTime = addIssues(issuesParam,powerQualityProblemNo);
RMpUserComplaint complaint = new RMpUserComplaint();
BeanUtil.copyProperties(complaintParam,complaint);
+ complaint.setAbnormalTarget(ArrayUtil.toString(complaintParam.getSteadyState())+ArrayUtil.toString(complaintParam.getTransientIndicators()));
+ complaint.setPowerQualityProblemNo(powerQualityProblemNo);
complaint.setDataDate(localDateTime);
complaintMapper.insert(complaint);
}
@@ -130,9 +170,12 @@ public class IssuesServiceImpl implements IssuesService {
public void addAbnormalIssues(AbnormalParam abnormalParam) {
IssuesParam issuesParam = new IssuesParam();
BeanUtil.copyProperties(abnormalParam,issuesParam);
- LocalDateTime localDateTime = addIssues(issuesParam);
+ String powerQualityProblemNo = getPowerQualityProblemNo(issuesParam);
+ LocalDateTime localDateTime = addIssues(issuesParam,powerQualityProblemNo);
RMpOperationMonitorAbnormal abnormal = new RMpOperationMonitorAbnormal();
BeanUtil.copyProperties(abnormalParam,abnormal);
+ abnormal.setAbnormalTarget(ArrayUtil.toString(abnormalParam.getSteadyState())+ArrayUtil.toString(abnormalParam.getTransientIndicators()));
+ abnormal.setPowerQualityProblemNo(powerQualityProblemNo);
abnormal.setDataDate(localDateTime);
abnormalMapper.insert(abnormal);
}
@@ -142,7 +185,7 @@ public class IssuesServiceImpl implements IssuesService {
*/
@Override
public Page getIssues(QueryIssuesParam param) {
- IPage page = new Page<>(param.getPageNum(), param.getPageSize());
+ Page page = new Page<>(param.getPageNum(), param.getPageSize());
Date dateOut = DateUtil.parse(param.getDataDate());
Date dateBegin = new Date();
Date dateEnd = new Date();
@@ -156,18 +199,20 @@ public class IssuesServiceImpl implements IssuesService {
dateBegin = DateUtil.beginOfMonth(dateOut);
dateEnd = DateUtil.endOfMonth(dateOut);
}
- Page out = issuesMapper.getIssues(page,param,DateUtil.formatDateTime(dateBegin), DateUtil.formatDateTime(dateEnd));
- out.getRecords().forEach(data -> data.setOrgName((deptFeignClient.getDeptById(data.getOrgNo()).getData().getName())));
- /*问题来源*/
- List problemSourcesDictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PROBLEM_SOURCES.getCode()).getData();
- problemSourcesDictData.forEach(dict -> out.getRecords().stream().filter(data -> dict.getCode().equals(data.getProblemSources())).forEach(data -> data.setProblemSources(dict.getName())));
- /*填报进度*/
- List fillProgressDictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.FILL_PROGRESS.getCode()).getData();
- fillProgressDictData.forEach(dict -> out.getRecords().stream().filter(data -> dict.getCode().equals(data.getReportProcess())).forEach(data -> data.setReportProcess(dict.getName())));
- /*审核状态*/
- List auditStatusDictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.AUDIT_STATUS.getCode()).getData();
- auditStatusDictData.forEach(dict -> out.getRecords().stream().filter(data -> dict.getCode().equals(data.getReportProcessStatus())).forEach(data -> data.setReportProcessStatus(dict.getName())));
- return out;
+ List out = issuesMapper.getIssues(param,DateUtil.formatDateTime(dateBegin), DateUtil.formatDateTime(dateEnd));
+ if (!CollectionUtils.isEmpty(out)) {
+ out.forEach(data -> data.setOrgName((deptFeignClient.getDeptById(data.getOrgNo()).getData().getName())));
+ /*问题来源*/
+ List problemSourcesDictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PROBLEM_SOURCES.getCode()).getData();
+ problemSourcesDictData.forEach(dict -> out.stream().filter(data -> dict.getCode().equals(data.getProblemSources())).forEach(data -> data.setProblemSources(dict.getName())));
+ page.setTotal(out.size());
+ int pages = (int)Math.ceil(out.size()*1.0/param.getPageSize());
+ page.setPages(pages);
+ List> partition = Lists.partition(out, param.getPageSize());
+ List issuesVOS = partition.get(param.getPageNum() - 1);
+ page.setRecords(issuesVOS);
+ }
+ return page;
}
/**
@@ -187,6 +232,34 @@ public class IssuesServiceImpl implements IssuesService {
flowQuery.eq(RMpElectricQualityProblemFlowDetails::getPowerQualityProblemNo,powerQualityProblemNo);
return flowDetailsMapper.selectOne(flowQuery);
}
+
+ /**
+ * 处理填报信息
+ */
+ private ProcessVO processFlowDetail(RMpElectricQualityProblemFlowDetails details){
+ ProcessVO process = new ProcessVO();
+ BeanUtil.copyProperties(details,process);
+ if (!StrUtil.isEmpty(details.getReportProcessContentYyfx())){
+ process.setReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentYyfx(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(details.getUserReportProcessContentYyfx())){
+ process.setUserReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentYyfx(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(details.getReportProcessContentJhzg())){
+ process.setReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentJhzg(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(details.getUserReportProcessContentJhzg())){
+ process.setUserReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentJhzg(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(details.getReportProcessContentSjcq())){
+ process.setReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentSjcq(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(details.getUserReportProcessContentSjcq())){
+ process.setUserReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentSjcq(),"["),"\\]").split(","));
+ }
+ return process;
+ }
+
/**
* 查询在线监测超标问题详情
*/
@@ -199,7 +272,8 @@ public class IssuesServiceImpl implements IssuesService {
excessiveQuery.eq(RMpOnlineMonitorOverproofProblem::getPowerQualityProblemNo,powerQualityProblemNo);
RMpOnlineMonitorOverproofProblem excessiveOut = excessiveMapper.selectOne(excessiveQuery);
BeanUtil.copyProperties(excessiveOut,detail);
- BeanUtil.copyProperties(flowDetailSelectOne(powerQualityProblemNo),detail);
+ RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
+ BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
return detail;
}
@@ -215,7 +289,10 @@ public class IssuesServiceImpl implements IssuesService {
generalSurveyQuery.eq(RMpGeneralSurveyOverproofProblem::getPowerQualityProblemNo,powerQualityProblemNo);
RMpGeneralSurveyOverproofProblem generalSurveyOut = generalSurveyMapper.selectOne(generalSurveyQuery);
BeanUtil.copyProperties(generalSurveyOut,detail);
- BeanUtil.copyProperties(flowDetailSelectOne(powerQualityProblemNo),detail);
+ detail.setSteadyIndicator(steadyIndicator(generalSurveyOut.getOverLimitTarget()));
+ detail.setTransientIndicators(transientIndicators(generalSurveyOut.getOverLimitTarget()));
+ RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
+ BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
return detail;
}
@@ -231,7 +308,16 @@ public class IssuesServiceImpl implements IssuesService {
complaintQuery.eq(RMpUserComplaint::getPowerQualityProblemNo,powerQualityProblemNo);
RMpUserComplaint complaintOut = complaintMapper.selectOne(complaintQuery);
BeanUtil.copyProperties(complaintOut,detail);
- BeanUtil.copyProperties(flowDetailSelectOne(powerQualityProblemNo),detail);
+ detail.setSteadyIndicator(steadyIndicator(complaintOut.getAbnormalTarget()));
+ detail.setTransientIndicators(transientIndicators(complaintOut.getAbnormalTarget()));
+ RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
+ BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
+ if (!StrUtil.isEmpty(complaintOut.getPowerGridAffectDev())){
+ detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getPowerGridAffectDev(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(complaintOut.getUserAffectDev())){
+ detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getUserAffectDev(),"["),"\\]").split(","));
+ }
return detail;
}
@@ -247,10 +333,33 @@ public class IssuesServiceImpl implements IssuesService {
abnormalQuery.eq(RMpOperationMonitorAbnormal::getPowerQualityProblemNo,powerQualityProblemNo);
RMpOperationMonitorAbnormal abnormalOut = abnormalMapper.selectOne(abnormalQuery);
BeanUtil.copyProperties(abnormalOut,detail);
- BeanUtil.copyProperties(flowDetailSelectOne(powerQualityProblemNo),detail);
+ detail.setSteadyIndicator(steadyIndicator(abnormalOut.getAbnormalTarget()));
+ detail.setTransientIndicators(transientIndicators(abnormalOut.getAbnormalTarget()));
+ RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
+ BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
+ if (!StrUtil.isEmpty(abnormalOut.getPowerGridAffectDev())){
+ detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getPowerGridAffectDev(),"["),"\\]").split(","));
+ }
+ if (!StrUtil.isEmpty(abnormalOut.getUserAffectDev())){
+ detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getUserAffectDev(),"["),"\\]").split(","));
+ }
return detail;
}
+ /**
+ * 稳态指标处理
+ */
+ private String[] steadyIndicator(String target){
+ return StrUtil.removePrefix(target.split("]\\[")[0],"\\[").split(",");
+ }
+
+ /**
+ * 暂态指标处理
+ */
+ private String[] transientIndicators(String target){
+ return StrUtil.removeSuffix(target.split("]\\[")[1],"]").split(",");
+ }
+
/**
* 原因分析
*/
@@ -260,12 +369,29 @@ public class IssuesServiceImpl implements IssuesService {
RMpElectricQualityProblemFlowDetails details = new RMpElectricQualityProblemFlowDetails();
BeanUtil.copyProperties(processParam,details);
details.setDataDateYyfx(local);
+ details.setReportProcessContentYyfx(ArrayUtil.toString(processParam.getReportProcessContentYyfx()));
+ details.setUserReportProcessContentYyfx(ArrayUtil.toString(processParam.getUserReportProcessContentYyfx()));
flowDetailsMapper.insert(details);
LambdaQueryWrapper issuesQuery = new LambdaQueryWrapper<>();
issuesQuery.eq(RStatElectricQualityProblemFlow::getPowerQualityProblemNo,processParam.getPowerQualityProblemNo());
RStatElectricQualityProblemFlow issuesOut = issuesMapper.selectOne(issuesQuery);
issuesOut.setReportProcess(DicDataEnum.CAUSE_ANALYSIS.getCode());
issuesMapper.update(issuesOut,issuesQuery);
+ if (DicDataEnum.USER_COMPLAINTS.getCode().equals(issuesOut.getProblemSources())){
+ LambdaQueryWrapper complaintQuery = new LambdaQueryWrapper<>();
+ complaintQuery.eq(RMpUserComplaint::getPowerQualityProblemNo,processParam.getPowerQualityProblemNo());
+ RMpUserComplaint complaintOut = complaintMapper.selectOne(complaintQuery);
+ complaintOut.setPowerGridAffectDev(ArrayUtil.toString(processParam.getPowerGridAffectDev()));
+ complaintOut.setUserAffectDev(ArrayUtil.toString(processParam.getUserAffectDev()));
+ complaintMapper.update(complaintOut,complaintQuery);
+ }else if (DicDataEnum.DEV_EXCEPTION.getCode().equals(issuesOut.getProblemSources())){
+ LambdaQueryWrapper abnormalQuery = new LambdaQueryWrapper<>();
+ abnormalQuery.eq(RMpOperationMonitorAbnormal::getPowerQualityProblemNo,processParam.getPowerQualityProblemNo());
+ RMpOperationMonitorAbnormal abnormalOut = abnormalMapper.selectOne(abnormalQuery);
+ abnormalOut.setPowerGridAffectDev(ArrayUtil.toString(processParam.getPowerGridAffectDev()));
+ abnormalOut.setUserAffectDev(ArrayUtil.toString(processParam.getUserAffectDev()));
+ abnormalMapper.update(abnormalOut,abnormalQuery);
+ }
}
/**
@@ -283,14 +409,14 @@ public class IssuesServiceImpl implements IssuesService {
LocalDateTime local = LocalDateTimeUtil.now();
if (DicDataEnum.PLAN_MEASURES.getCode().equals(code)){
details.setDataDateJhzg(local);
- details.setReportProcessContentJhzg(processParam.getReportProcessContentJhzg());
- details.setUserReportProcessContentJhzg(processParam.getUserReportProcessContentJhzg());
+ details.setReportProcessContentJhzg(ArrayUtil.toString(processParam.getReportProcessContentJhzg()));
+ details.setUserReportProcessContentJhzg(ArrayUtil.toString(processParam.getUserReportProcessContentJhzg()));
details.setFileNameJhzg(processParam.getFileNameJhzg());
details.setFilePathJhzg(processParam.getFilePathJhzg());
}else if (DicDataEnum.ACTUAL_MEASURES.getCode().equals(code)){
details.setDataDateSjcq(local);
- details.setReportProcessContentSjcq(processParam.getReportProcessContentSjcq());
- details.setUserReportProcessContentSjcq(processParam.getUserReportProcessContentSjcq());
+ details.setReportProcessContentSjcq(ArrayUtil.toString(processParam.getReportProcessContentSjcq()));
+ details.setUserReportProcessContentSjcq(ArrayUtil.toString(processParam.getUserReportProcessContentSjcq()));
details.setFileNameSjcq(processParam.getFileNameSjcq());
details.setFilePathSjcq(processParam.getFilePathSjcq());
}else if (DicDataEnum.INSIGHTS.getCode().equals(code)){
From 4ce81ced3d9448bb5233ac2692bfa6fe07e820cf Mon Sep 17 00:00:00 2001
From: huangzj <826100833@qq.com>
Date: Wed, 30 Nov 2022 19:13:53 +0800
Subject: [PATCH 15/21] =?UTF-8?q?=E6=99=AE=E6=B5=8B=E8=AE=A1=E5=88=92?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pojo/param/RGeneralSurveyPlanAddParm.java | 0
.../param/RGeneralSurveyPlanQueryParm.java | 0
.../RGeneralSurveyPlandetailQueryParm.java | 0
.../param/SurveyPlanQuestionQueryParm.java | 36 ++++++++
.../pojo/param/SurveyResultUploadParam.java | 0
.../pojo/po/RGeneralSurveyPlanDetail.java | 0
.../process/pojo/po/RGeneralSurveyPlanPO.java | 6 ++
.../njcn/process/pojo/po/SurveyPlanExcel.java | 48 ++++++++++
.../RGeneralSurveyPlanDetailOnQuestionVO.java | 64 ++++++++++++++
.../process/pojo/vo/RGeneralSurveyPlanVO.java | 0
.../RGeneralSurveyPlanController.java | 87 ++++++++++++++++---
.../RGeneralSurveyPlanDetailMapper.java | 20 +++++
.../mapper/RGeneralSurveyPlanPOMapper.java | 1 +
.../service/RGeneralSurveyPlanPOService.java | 19 ++++
.../impl/RGeneralSurveyPlanPOServiceImpl.java | 54 ++++++++++++
15 files changed, 324 insertions(+), 11 deletions(-)
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java (100%)
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java (100%)
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java (100%)
create mode 100644 process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java (100%)
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java (100%)
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java (91%)
create mode 100644 process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java
create mode 100644 process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanDetailOnQuestionVO.java
rename {process-boot => process-api}/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java (100%)
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
rename to process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
rename to process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
rename to process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
new file mode 100644
index 000000000..d6ae73b19
--- /dev/null
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
@@ -0,0 +1,36 @@
+package com.njcn.process.pojo.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * Description:
+ * 接口文档访问地址:http://serverIP:port/swagger-ui.html
+ * Date: 2022/11/11 15:20【需求编号】
+ *
+ * @author clam
+ * @version V1.0.0
+ */
+@Data
+public class SurveyPlanQuestionQueryParm {
+
+
+
+ @ApiModelProperty(value="单位ID")
+ @NotNull(message="单位ID不能为空!")
+ private String orgNo;
+
+ @ApiModelProperty(value="计划开始时间")
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ private Date planStartTime;
+
+ @ApiModelProperty(value="计划名称")
+ private String planName;
+
+
+
+}
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
rename to process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java b/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
rename to process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java b/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java
similarity index 91%
rename from process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java
rename to process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java
index 5f0da1f1c..32b72c376 100644
--- a/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java
@@ -3,6 +3,7 @@ package com.njcn.process.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -51,6 +52,7 @@ public class RGeneralSurveyPlanPO {
* 计划生成时间
*/
@TableField(value = "plan_create_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划生成时间")
private Date planCreateTime = new Date();
@@ -58,6 +60,7 @@ public class RGeneralSurveyPlanPO {
* 计划开始时间
*/
@TableField(value = "plan_start_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划开始时间")
private Date planStartTime;
@@ -65,6 +68,7 @@ public class RGeneralSurveyPlanPO {
* 计划结束时间
*/
@TableField(value = "plan_end_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划结束时间")
private Date planEndTime;
@@ -72,6 +76,7 @@ public class RGeneralSurveyPlanPO {
* 实际完成时间
*/
@TableField(value = "plan_complate_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="实际完成时间")
private Date planComplateTime;
@@ -121,6 +126,7 @@ public class RGeneralSurveyPlanPO {
* 上传时间
*/
@TableField(value = "upload_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="上传时间")
private Date uploadTime;
}
\ No newline at end of file
diff --git a/process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java b/process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java
new file mode 100644
index 000000000..9fde41b4e
--- /dev/null
+++ b/process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java
@@ -0,0 +1,48 @@
+package com.njcn.process.pojo.po;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Description:
+ * 接口文档访问地址:http://serverIP:port/swagger-ui.html
+ * Date: 2022/11/21 9:35【需求编号】
+ *
+ * @author clam
+ * @version V1.0.0
+ */
+@Data
+public class SurveyPlanExcel implements Serializable {
+
+ @Excel(name = "单位", width = 15)
+ private String orgNo;
+
+ @Excel(name = "普测计划编号", width = 15)
+ private String planNo;
+
+ @Excel(name = "普测计划名称", width = 15)
+ private String planName;
+
+ @Excel(name = "计划开始时间", format = "yyyy-MM-dd HH:mm:ss", width = 15)
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ private Date planStartTime;
+
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ @Excel(name = "计划结束时间",format = "yyyy-MM-dd HH:mm:ss", width = 15)
+ private Date planEndTime;
+
+ @Excel(name = "变电站数量", width = 15)
+ private Long subCount;
+
+ @Excel(name = "母线数量", width = 15)
+ private Long busCount;
+
+ @Excel(name = "计划状态", width = 15)
+ private String status;
+
+
+}
diff --git a/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanDetailOnQuestionVO.java b/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanDetailOnQuestionVO.java
new file mode 100644
index 000000000..fe5ac18bf
--- /dev/null
+++ b/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanDetailOnQuestionVO.java
@@ -0,0 +1,64 @@
+package com.njcn.process.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *
+ * Description:
+ * 接口文档访问地址:http://serverIP:port/swagger-ui.html
+ * Date: 2022/11/11 11:28【需求编号】
+ *
+ * @author clam
+ * @version V1.0.0
+ */
+
+/**
+ * 普测计划详情表(问题件页面)
+ */
+@Data
+public class RGeneralSurveyPlanDetailOnQuestionVO {
+ /**
+ * 普测计划编号
+ */
+ @ApiModelProperty(value="普测名称")
+ private String planName;
+
+ /**
+ * 变电站电压等级
+ */
+ @ApiModelProperty(value="变电站电压等级")
+ private String voltageLevel;
+ /**
+ * 变电站ID
+ */
+ @ApiModelProperty(value="变电站ID")
+ private String subId;
+
+ /**
+ * 变电站名称
+ */
+ @ApiModelProperty(value="变电站名称")
+ private String subName;
+ /**
+ * 母线ID
+ */
+
+ @ApiModelProperty(value="母线ID")
+ private String busbarId;
+
+
+ /**
+ * 母线名称
+ */
+ @ApiModelProperty(value="母线名称")
+ private String busbarName;
+
+ /**
+ * 离线监测点id
+ */
+ @ApiModelProperty(value="离线监测点id")
+ private String measurementPointId;
+
+
+}
\ No newline at end of file
diff --git a/process-boot/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java b/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
similarity index 100%
rename from process-boot/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
rename to process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
diff --git a/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
index 59b3ef577..5c999e450 100644
--- a/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
+++ b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
@@ -1,5 +1,7 @@
package com.njcn.process.controller;
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
@@ -7,10 +9,10 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
-import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
-import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm;
-import com.njcn.process.pojo.param.RGeneralSurveyPlandetailQueryParm;
-import com.njcn.process.pojo.param.SurveyResultUploadParam;
+import com.njcn.poi.util.PoiUtil;
+import com.njcn.process.pojo.param.*;
+import com.njcn.process.pojo.po.SurveyPlanExcel;
+import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO;
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService;
@@ -20,10 +22,12 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -46,14 +50,16 @@ public class RGeneralSurveyPlanController extends BaseController {
private @Autowired
RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService;
- /**
- * 查询所有数据
- * @author qijian
- * @date 2022/11/11
- */
+ /**
+ * @Description: 新增/修改普测计划
+ * @Param: [rGeneralSurveyPlanAddParm]
+ * @return: com.njcn.common.pojo.response.HttpResult
+ * @Author: clam
+ * @Date: 2022/11/22
+ */
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addPlan")
- @ApiOperation("新增普测计划")
+ @ApiOperation("新增/修改普测计划")
@ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true)
public HttpResult addPlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){
String methodDescribe = getMethodDescribe("addPlan");
@@ -75,7 +81,7 @@ public class RGeneralSurveyPlanController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlan")
- @ApiOperation("查询普测计划")
+ @ApiOperation("查询普测计划-新建页面")
@ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
public HttpResult> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlan");
@@ -84,6 +90,28 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
+ @OperateInfo(info = LogEnum.BUSINESS_COMMON)
+ @PostMapping("/queryPlanAudit")
+ @ApiOperation("查询普测计划-审核页面")
+ @ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
+ public HttpResult> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
+ String methodDescribe = getMethodDescribe("queryPlanAudit");
+
+ IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
+ }
+
+ @OperateInfo(info = LogEnum.BUSINESS_COMMON)
+ @PostMapping("/queryPlanResult")
+ @ApiOperation("查询普测计划-结果页面")
+ @ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
+ public HttpResult> queryPlanResult(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
+ String methodDescribe = getMethodDescribe("queryPlanResult");
+
+ IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
+ }
+
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlandetail")
@ApiOperation("根据planNO查询普测计划详情")
@@ -95,6 +123,8 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanDetailVOIPage, methodDescribe);
}
+
+
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPLOAD)
@PostMapping("/surveyResultUpload")
@ApiOperation("上传普测结果报告")
@@ -121,4 +151,39 @@ public class RGeneralSurveyPlanController extends BaseController {
}
+ @ResponseBody
+ @ApiOperation("导出普测计划信息")
+ @PostMapping(value = "exportSurveyPlan")
+ @ApiImplicitParam(name = "planIdList", value = "普测计划详情查询参数", required = true)
+ public HttpResult exportSurveyPlan(HttpServletResponse response,@RequestBody List planIdList) {
+ String methodDescribe = getMethodDescribe("exportSurveyPlan");
+ String fileName = "普测计划信息.xls";
+ List baseExcelList = null;
+ try {
+ baseExcelList = rGeneralSurveyPlanPOService.exportSurveyPlan(planIdList);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
+ }
+ ExportParams exportExcel = new ExportParams("普测计划信息", "普测计划信息");
+ Workbook workbook = ExcelExportUtil.exportExcel(exportExcel, SurveyPlanExcel.class, baseExcelList);
+ PoiUtil.exportFileByWorkbook(workbook, fileName, response);
+ return null;
+ }
+
+ @ResponseBody
+ @ApiOperation("普测计划信息问题件新增查询")
+ @PostMapping(value = "querySurveyPlanOnQuestion")
+ @ApiImplicitParam(name = "questionQueryParm", value = "普测计划信息问题件查询参数", required = true)
+ public HttpResult> querySurveyPlanOnQuestion(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
+ String methodDescribe = getMethodDescribe("querySurveyPlanOnQuestion");
+
+ List list= rGeneralSurveyPlanPOService.querySurveyPlanOnQuestion(questionQueryParm);
+
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, 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 2e8137184..b53db752c 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
@@ -1,7 +1,13 @@
package com.njcn.process.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
+import com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm;
import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail;
+import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
/**
*
@@ -13,4 +19,18 @@ import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail;
* @version V1.0.0
*/
public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper {
+ @Select ("SELECT\n" +
+ "\ta.plan_name as planName,\n" +
+ "\tb.voltage_level as voltageLevel,\n" +
+ "\tb.sub_id as subId,\n" +
+ "\tb.sub_name as subName,\n" +
+ "\tb.busbar_id as busbarId,\n" +
+ "\tb.busbar_name as busbarName\n" +
+ "FROM\n" +
+ "\tr_general_survey_plan a\n" +
+ "INNER JOIN r_general_survey_plan_detail b ON a.plan_no = b.plan_no\n" +
+ "WHERE\n" +
+ "\ta.org_no = #{questionQueryParm.orgNo} and a.plan_name LIKE CONCAT('%', #{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/RGeneralSurveyPlanPOMapper.java b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java
index d893f9a4f..f9dfbc9ed 100644
--- a/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java
+++ b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java
@@ -13,4 +13,5 @@ import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
* @version V1.0.0
*/
public interface RGeneralSurveyPlanPOMapper extends MppBaseMapper {
+
}
\ No newline at end of file
diff --git a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
index c3fedd05f..d655e0d09 100644
--- a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
+++ b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm;
+import com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm;
import com.njcn.process.pojo.param.SurveyResultUploadParam;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
+import com.njcn.process.pojo.po.SurveyPlanExcel;
+import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO;
import java.util.List;
@@ -53,4 +56,20 @@ public interface RGeneralSurveyPlanPOService extends IMppService surveyResultDownload(String planNo);
+ /**
+ * @Description: exportSurveyPlan
+ * @Param: []
+ * @return: java.util.List
+ * @Author: clam
+ * @Date: 2022/11/21
+ */
+ List exportSurveyPlan(List planIdList);
+ /**
+ * @Description: querySurveyPlanOnQuestion
+ * @Param: [questionQueryParm]
+ * @return: java.util.List
+ * @Author: clam
+ * @Date: 2022/11/30
+ */
+ List querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm);
}
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 99b8e7cf5..856595e8d 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
@@ -13,9 +13,12 @@ import com.njcn.process.mapper.RGeneralSurveyPlanDetailMapper;
import com.njcn.process.mapper.RGeneralSurveyPlanPOMapper;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm;
+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.po.SurveyPlanExcel;
+import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO;
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService;
@@ -214,6 +217,57 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl
+ * @Author: clam
+ * @Date: 2022/11/21
+ */
+ @Override
+ public List exportSurveyPlan(List planIdList) {
+ List surveyPlanExcels = new ArrayList<> ();
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<> ();
+ queryWrapper.in (RGeneralSurveyPlanPO::getPlanNo,planIdList);
+ List rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper);
+ LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<> ();
+ lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, planIdList);
+ List rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (lambdaQueryWrapper);
+ rGeneralSurveyPlanPOS.forEach (temp->{
+ SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel();
+ BeanUtils.copyProperties (temp, surveyPlanExcel);
+
+ long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
+ filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
+ map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
+
+ long Subcount = rGeneralSurveyPlanDetails.stream ( ).
+ filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
+ map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( );
+ surveyPlanExcel.setBusCount (Busbarcount);
+ surveyPlanExcel.setSubCount (Subcount);
+ surveyPlanExcels.add (surveyPlanExcel);
+ });
+
+ return surveyPlanExcels;
+ }
+
+ /**
+ * @param questionQueryParm
+ * @Description: querySurveyPlanOnQuestion
+ * @Param: [questionQueryParm]
+ * @return: java.util.List
+ * @Author: clam
+ * @Date: 2022/11/30
+ */
+ @Override
+ public List querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm) {
+ List rGeneralSurveyPlanDetailOnQuestionVOS = new ArrayList<> ();
+ rGeneralSurveyPlanDetailOnQuestionVOS =rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion(questionQueryParm);
+
+ return rGeneralSurveyPlanDetailOnQuestionVOS;
+ }
+
/**
* 上传文件到Minio
*
From 428703b7cbdb66ea7b447d6cf09848627bc9869e Mon Sep 17 00:00:00 2001
From: "1771838663@qq.com" <1771838663@qq.com>
Date: Thu, 1 Dec 2022 09:00:43 +0800
Subject: [PATCH 16/21] =?UTF-8?q?=E7=94=B5=E8=83=BD=E8=B4=A8=E9=87=8F?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../njcn/process/pojo/vo/FlowDetailVO.java | 116 ++++++++++++++++++
.../ElectricityQualityIssuesController.java | 5 +-
.../service/impl/IssuesServiceImpl.java | 44 ++++---
3 files changed, 148 insertions(+), 17 deletions(-)
create mode 100644 process-api/src/main/java/com/njcn/process/pojo/vo/FlowDetailVO.java
diff --git a/process-api/src/main/java/com/njcn/process/pojo/vo/FlowDetailVO.java b/process-api/src/main/java/com/njcn/process/pojo/vo/FlowDetailVO.java
new file mode 100644
index 000000000..3c7de4018
--- /dev/null
+++ b/process-api/src/main/java/com/njcn/process/pojo/vo/FlowDetailVO.java
@@ -0,0 +1,116 @@
+package com.njcn.process.pojo.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author xiaoyao
+ * @version 1.0.0
+ * @createTime 2022/11/29 9:23
+ */
+@Data
+public class FlowDetailVO implements Serializable {
+
+ private static final long serialVersionUID = 6025928276036950946L;
+
+ /**
+ * 电能质量问题编号
+ */
+ private String powerQualityProblemNo;
+
+ /**
+ * 填报进度,字典表(未填报、原因分析结果、计划整改措施、实际采取措施、治理效果评价、已归档)
+ */
+ private String reportProcess;
+
+ /**
+ * 电网侧原因
+ */
+ private String[] reportProcessContentYyfx;
+
+ /**
+ * 用户侧原因
+ */
+ private String[] userReportProcessContentYyfx;
+
+ /**
+ * 电网侧受影响设备
+ */
+ private String[] powerGridAffectDev;
+
+ /**
+ * 用户侧受影响设备
+ */
+ private String[] userAffectDev;
+
+ /**
+ * 事件描述
+ */
+ private String eventDescriptionYyfx;
+
+ /**
+ * 原因分析报告文件名称
+ */
+ private String fileNameYyfx;
+
+ /**
+ * 原因分析报告文件路径
+ */
+ private String filePathYyfx;
+
+ /**
+ * 电网侧整改治理措施
+ */
+ private String[] reportProcessContentJhzg;
+
+ /**
+ * 用户侧整改治理措施
+ */
+ private String[] userReportProcessContentJhzg;
+
+ /**
+ * 计划整改文件名称
+ */
+ private String fileNameJhzg;
+
+ /**
+ * 计划整改文件路径
+ */
+ private String filePathJhzg;
+
+ /**
+ * 电网侧实际采取措施
+ */
+ private String[] reportProcessContentSjcq;
+
+ /**
+ * 用户侧实际采取措施
+ */
+ private String[] userReportProcessContentSjcq;
+
+ /**
+ * 实际采取措施报告文件名称
+ */
+ private String fileNameSjcq;
+
+ /**
+ * 实际采取措施报告文件路径
+ */
+ private String filePathSjcq;
+
+ /**
+ * 成效分析概述
+ */
+ private String descriptionZlxg;
+
+ /**
+ * 成效分析报告文件名称
+ */
+ private String fileNameZlxg;
+
+ /**
+ * 成效分析报告文件路径
+ */
+ private String filePathZlxg;
+}
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 39d8130e4..027e5b3a1 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
@@ -182,10 +182,11 @@ public class ElectricityQualityIssuesController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
@PostMapping("/uploadFile")
@ApiOperation("上传文件")
- @ApiImplicitParam(name = "issuesFile", value = "填报进度文件", required = true)
- public HttpResult uploadFile(@RequestParam("issuesFile") MultipartFile issuesFile){
+ @ApiImplicitParam(name = "file", value = "填报进度文件", required = true)
+ public HttpResult uploadFile(@RequestParam("file") MultipartFile issuesFile){
String methodDescribe = getMethodDescribe("uploadFile");
MinIoUploadResDTO out = issuesService.uploadFile(issuesFile);
+ out.setMinFileName(issuesFile.getOriginalFilename());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
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 341da8564..3a468ced1 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
@@ -236,26 +236,32 @@ public class IssuesServiceImpl implements IssuesService {
/**
* 处理填报信息
*/
- private ProcessVO processFlowDetail(RMpElectricQualityProblemFlowDetails details){
- ProcessVO process = new ProcessVO();
+ private FlowDetailVO processFlowDetail(RMpElectricQualityProblemFlowDetails details){
+ FlowDetailVO process = new FlowDetailVO();
BeanUtil.copyProperties(details,process);
if (!StrUtil.isEmpty(details.getReportProcessContentYyfx())){
- process.setReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentYyfx(),"["),"\\]").split(","));
+ process.setReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentYyfx(),"["),"]").split(","));
+ StrUtil.trim(process.getReportProcessContentYyfx());
}
if (!StrUtil.isEmpty(details.getUserReportProcessContentYyfx())){
- process.setUserReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentYyfx(),"["),"\\]").split(","));
+ process.setUserReportProcessContentYyfx(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentYyfx(),"["),"]").split(","));
+ StrUtil.trim(process.getUserReportProcessContentYyfx());
}
if (!StrUtil.isEmpty(details.getReportProcessContentJhzg())){
- process.setReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentJhzg(),"["),"\\]").split(","));
+ process.setReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentJhzg(),"["),"]").split(","));
+ StrUtil.trim(process.getReportProcessContentJhzg());
}
if (!StrUtil.isEmpty(details.getUserReportProcessContentJhzg())){
- process.setUserReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentJhzg(),"["),"\\]").split(","));
+ process.setUserReportProcessContentJhzg(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentJhzg(),"["),"]").split(","));
+ StrUtil.trim(process.getUserReportProcessContentJhzg());
}
if (!StrUtil.isEmpty(details.getReportProcessContentSjcq())){
- process.setReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentSjcq(),"["),"\\]").split(","));
+ process.setReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getReportProcessContentSjcq(),"["),"]").split(","));
+ StrUtil.trim(process.getReportProcessContentSjcq());
}
if (!StrUtil.isEmpty(details.getUserReportProcessContentSjcq())){
- process.setUserReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentSjcq(),"["),"\\]").split(","));
+ process.setUserReportProcessContentSjcq(StrUtil.removeSuffix(StrUtil.removePrefix(details.getUserReportProcessContentSjcq(),"["),"]").split(","));
+ StrUtil.trim(process.getUserReportProcessContentSjcq());
}
return process;
}
@@ -313,10 +319,12 @@ public class IssuesServiceImpl implements IssuesService {
RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
if (!StrUtil.isEmpty(complaintOut.getPowerGridAffectDev())){
- detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getPowerGridAffectDev(),"["),"\\]").split(","));
+ detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getPowerGridAffectDev(),"["),"]").split(","));
+ StrUtil.trim(detail.getPowerGridAffectDev());
}
if (!StrUtil.isEmpty(complaintOut.getUserAffectDev())){
- detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getUserAffectDev(),"["),"\\]").split(","));
+ detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(complaintOut.getUserAffectDev(),"["),"]").split(","));
+ StrUtil.trim(detail.getUserAffectDev());
}
return detail;
}
@@ -338,10 +346,12 @@ public class IssuesServiceImpl implements IssuesService {
RMpElectricQualityProblemFlowDetails flowDetails = flowDetailSelectOne(powerQualityProblemNo);
BeanUtil.copyProperties(processFlowDetail(flowDetails),detail);
if (!StrUtil.isEmpty(abnormalOut.getPowerGridAffectDev())){
- detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getPowerGridAffectDev(),"["),"\\]").split(","));
+ detail.setPowerGridAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getPowerGridAffectDev(),"["),"]").split(","));
+ StrUtil.trim(detail.getPowerGridAffectDev());
}
if (!StrUtil.isEmpty(abnormalOut.getUserAffectDev())){
- detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getUserAffectDev(),"["),"\\]").split(","));
+ detail.setUserAffectDev(StrUtil.removeSuffix(StrUtil.removePrefix(abnormalOut.getUserAffectDev(),"["),"]").split(","));
+ StrUtil.trim(detail.getUserAffectDev());
}
return detail;
}
@@ -350,14 +360,18 @@ public class IssuesServiceImpl implements IssuesService {
* 稳态指标处理
*/
private String[] steadyIndicator(String target){
- return StrUtil.removePrefix(target.split("]\\[")[0],"\\[").split(",");
+ String[] process = StrUtil.removePrefix(target.split("]\\[")[0],"\\[").split(",");
+ StrUtil.trim(process);
+ return process;
}
/**
* 暂态指标处理
*/
private String[] transientIndicators(String target){
- return StrUtil.removeSuffix(target.split("]\\[")[1],"]").split(",");
+ String[] process = StrUtil.removeSuffix(target.split("]\\[")[1],"]").split(",");
+ StrUtil.trim(process);
+ return process;
}
/**
@@ -481,7 +495,7 @@ public class IssuesServiceImpl implements IssuesService {
}else if (DicDataEnum.INSIGHTS.getName().equals(reportProcess)){
filePath = details.getFilePathZlxg();
}
- return minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), filePath, 7 * 24 * 60 * 60);
+ return filePath;
}
/**
From f9733d0fe14483223f2ffd722e9230688e504495 Mon Sep 17 00:00:00 2001
From: huangzj <826100833@qq.com>
Date: Tue, 6 Dec 2022 15:36:15 +0800
Subject: [PATCH 17/21] =?UTF-8?q?=E6=99=AE=E6=B5=8B=E8=AE=A1=E5=88=92?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=81=94=E8=B0=83=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pojo/param/RGeneralSurveyPlanAddParm.java | 1 -
.../param/RGeneralSurveyPlanQueryParm.java | 6 +-
.../RGeneralSurveyPlandetailQueryParm.java | 2 -
.../param/SurveyPlanQuestionQueryParm.java | 1 +
.../pojo/param/SurveyResultUploadParam.java | 4 +-
.../pojo/po/RGeneralSurveyPlanDetail.java | 9 +-
.../process/pojo/vo/RGeneralSurveyPlanVO.java | 15 +++-
.../pojo/{po => vo}/SurveyPlanExcel.java | 2 +-
.../RGeneralSurveyPlanController.java | 40 +++++----
.../RGeneralSurveyPlanDetailMapper.java | 13 ++-
.../service/RGeneralSurveyPlanPOService.java | 17 +++-
.../impl/RGeneralSurveyPlanPOServiceImpl.java | 89 +++++++++++++++----
12 files changed, 146 insertions(+), 53 deletions(-)
rename process-api/src/main/java/com/njcn/process/pojo/{po => vo}/SurveyPlanExcel.java (97%)
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
index 96bba923c..dbecf23ec 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java
@@ -16,7 +16,6 @@ import java.util.List;
* @author clam
* @version V1.0.0
*/
-@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm")
@Data
public class RGeneralSurveyPlanAddParm {
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
index 629fe10bc..910f26724 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java
@@ -1,7 +1,6 @@
package com.njcn.process.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -17,7 +16,6 @@ import java.util.Date;
* @author clam
* @version V1.0.0
*/
-@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm")
@Data
public class RGeneralSurveyPlanQueryParm {
@@ -37,6 +35,10 @@ public class RGeneralSurveyPlanQueryParm {
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date planStartTime;
+ @ApiModelProperty(value="计划结束时间")
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ private Date planEndTime;
+
@ApiModelProperty(value="计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成)")
private String status;
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
index ab1a29506..d32bb6154 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java
@@ -1,6 +1,5 @@
package com.njcn.process.pojo.param;
-import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -15,7 +14,6 @@ import javax.validation.constraints.NotNull;
* @author clam
* @version V1.0.0
*/
-@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm")
@Data
public class RGeneralSurveyPlandetailQueryParm {
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
index d6ae73b19..760e7432b 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyPlanQuestionQueryParm.java
@@ -26,6 +26,7 @@ public class SurveyPlanQuestionQueryParm {
@ApiModelProperty(value="计划开始时间")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ @NotNull(message="计划开始时间不能为空!")
private Date planStartTime;
@ApiModelProperty(value="计划名称")
diff --git a/process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
index 9c2c545fb..e9b7d4439 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java
@@ -22,9 +22,9 @@ public class SurveyResultUploadParam {
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
private String planId;
- @ApiModelProperty(name = "files",value = "普测结果报告",required = true)
+ @ApiModelProperty(name = "file",value = "普测结果报告",required = true)
@NotNull(message = "普测结果报告")
- private MultipartFile[] files;
+ private MultipartFile[] file;
diff --git a/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java b/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
index 4f1004fb9..a6f7bdc91 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java
@@ -104,10 +104,17 @@ public class RGeneralSurveyPlanDetail {
@ApiModelProperty(value="离线监测点id")
private String measurementPointId;
+ /**
+ * 是否实现监测(0:否 1:是)
+ */
+ @TableField(value = "is_survey")
+ @ApiModelProperty(value="是否生成问题(0:否 1:是)")
+ private Integer isSurvey;
+
/**
* 是否生成问题(0:否 1:是)
*/
@TableField(value = "is_problem")
@ApiModelProperty(value="是否生成问题(0:否 1:是)")
- private Byte isProblem;
+ private Integer isProblem;
}
\ No newline at end of file
diff --git a/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java b/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
index 9378ee1f1..407fabdb1 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java
@@ -17,12 +17,14 @@ import java.util.List;
* @author clam
* @version V1.0.0
*/
-@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm")
@Data
public class RGeneralSurveyPlanVO {
@ApiModelProperty(value="单位ID")
private String orgNo;
+ @ApiModelProperty(value="单位名称")
+ private String orgName;
+
@ApiModelProperty(value="普测计划编号")
private String planNo;
@@ -45,11 +47,11 @@ public class RGeneralSurveyPlanVO {
private Long busCount;
@ApiModelProperty(value="计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成)")
- private int status;
+ private Integer status;
@TableField(value = "is_file_upload")
@ApiModelProperty(value="文件是否上传(0:否 1:是)")
- private Byte isFileUpload;
+ private Integer isFileUpload;
/**
* 上传文件数量
@@ -116,6 +118,13 @@ public class RGeneralSurveyPlanVO {
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date generalSurveyTime;
+ /**
+ * 是否实现监测(0:否 1:是)
+ */
+ @TableField(value = "is_survey")
+ @ApiModelProperty(value="是否生成问题(0:否 1:是)")
+ private Integer isSurvey;
+
/**
* 测试负责人
*/
diff --git a/process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java b/process-api/src/main/java/com/njcn/process/pojo/vo/SurveyPlanExcel.java
similarity index 97%
rename from process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java
rename to process-api/src/main/java/com/njcn/process/pojo/vo/SurveyPlanExcel.java
index 9fde41b4e..15e4a2a3c 100644
--- a/process-api/src/main/java/com/njcn/process/pojo/po/SurveyPlanExcel.java
+++ b/process-api/src/main/java/com/njcn/process/pojo/vo/SurveyPlanExcel.java
@@ -1,4 +1,4 @@
-package com.njcn.process.pojo.po;
+package com.njcn.process.pojo.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
diff --git a/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
index 5c999e450..db147ae3f 100644
--- a/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
+++ b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java
@@ -9,9 +9,11 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
+import com.njcn.minio.bo.MinIoUploadResDTO;
import com.njcn.poi.util.PoiUtil;
import com.njcn.process.pojo.param.*;
-import com.njcn.process.pojo.po.SurveyPlanExcel;
+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.service.RGeneralSurveyPlanDetailService;
@@ -29,6 +31,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* Description:
@@ -68,16 +72,7 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe);
}
-// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
-// @PostMapping("/updatePlan")
-// @ApiOperation("新增普测计划")
-// @ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true)
-// public HttpResult updatePlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){
-// String methodDescribe = getMethodDescribe("addPlan");
-//
-//// Boolean addFlag = rGeneralSurveyPlanPOService.updatePlan(rGeneralSurveyPlanAddParm);
-// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe);
-// }
+
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlan")
@@ -86,7 +81,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlan");
- IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
+ IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ()));
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@@ -97,7 +92,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanAudit");
- IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
+ IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1").collect (Collectors.toList ()));
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@@ -108,7 +103,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult> queryPlanResult(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanResult");
- IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
+ IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("3","4").collect (Collectors.toList ()));
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@@ -143,9 +138,9 @@ public class RGeneralSurveyPlanController extends BaseController {
@PostMapping("/surveyResultDownload")
@ApiOperation("下载普测结果报告")
@ApiImplicitParam(name = "planNo", value = "计划号", required = true)
- public HttpResult> surveyResultDownload(@RequestParam("planNo") String planNo ){
+ public HttpResult> surveyResultDownload(@RequestParam("planNo") String planNo ){
String methodDescribe = getMethodDescribe("surveyResultDownload");
- List downloadUrls = rGeneralSurveyPlanPOService.surveyResultDownload(planNo);
+ List downloadUrls = rGeneralSurveyPlanPOService.surveyResultDownload(planNo);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, downloadUrls, methodDescribe);
@@ -184,6 +179,19 @@ public class RGeneralSurveyPlanController extends BaseController {
}
+ @ResponseBody
+ @ApiOperation("普测计划名称查询")
+ @PostMapping(value = "querySurveyPlanName")
+ @ApiImplicitParam(name = "questionQueryParm", value = "普测计划名称查询参数", required = true)
+ public HttpResult> querySurveyPlanName(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
+ String methodDescribe = getMethodDescribe("querySurveyPlanName");
+
+ List list= rGeneralSurveyPlanPOService.querySurveyPlanName(questionQueryParm);
+
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, 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 b53db752c..816ad606b 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
@@ -19,18 +19,23 @@ import java.util.List;
* @version V1.0.0
*/
public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper {
- @Select ("SELECT\n" +
+ @Select ({""})
List querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm);
}
\ No newline at end of file
diff --git a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
index d655e0d09..c345a1a5a 100644
--- a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
+++ b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java
@@ -2,12 +2,13 @@ package com.njcn.process.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.jeffreyning.mybatisplus.service.IMppService;
+import com.njcn.minio.bo.MinIoUploadResDTO;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm;
import com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm;
import com.njcn.process.pojo.param.SurveyResultUploadParam;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
-import com.njcn.process.pojo.po.SurveyPlanExcel;
+import com.njcn.process.pojo.vo.SurveyPlanExcel;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO;
@@ -39,7 +40,7 @@ public interface RGeneralSurveyPlanPOService extends IMppService query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm);
+ IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List statusList);
/**
* @Description: surveyResultUpload
* @Param: [surveyResultUploadParam]
@@ -55,11 +56,11 @@ public interface RGeneralSurveyPlanPOService extends IMppService surveyResultDownload(String planNo);
+ List surveyResultDownload(String planNo);
/**
* @Description: exportSurveyPlan
* @Param: []
- * @return: java.util.List
+ * @return: java.util.List
* @Author: clam
* @Date: 2022/11/21
*/
@@ -72,4 +73,12 @@ public interface RGeneralSurveyPlanPOService extends IMppService querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm);
+ /**
+ * @Description: 更具questionQueryParm查计划名称
+ * @Param: [questionQueryParm]
+ * @return: java.util.List
+ * @Author: clam
+ * @Date: 2022/12/1
+ */
+ List querySurveyPlanName(SurveyPlanQuestionQueryParm questionQueryParm);
}
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 856595e8d..1427686ba 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
@@ -1,6 +1,7 @@
package com.njcn.process.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
@@ -17,11 +18,13 @@ 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.po.SurveyPlanExcel;
+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.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService;
+import com.njcn.user.api.DeptFeignClient;
+import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -31,6 +34,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -60,6 +64,10 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl rGeneralSurveyPlanDetailAddParm = rGeneralSurveyPlanAddParm.getRGeneralSurveyPlanDetailAddParm ( );
-
+ QueryWrapper queryWrapper = new QueryWrapper ();
+ queryWrapper.lambda ().eq (RGeneralSurveyPlanDetail::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo ());
+ boolean remove = rGeneralSurveyPlanDetailService.remove (queryWrapper);
List rGeneralSurveyPlanDetailList = new ArrayList<> ();
rGeneralSurveyPlanDetailAddParm.forEach (temp->{
RGeneralSurveyPlanDetail rGeneralSurveyPlanDetail = new RGeneralSurveyPlanDetail();
@@ -91,9 +100,9 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm) {
+ public IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List statusList ) {
IPage page = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize());
IPage returnpage = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize());
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<> ();
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getOrgNo ())) {
- queryWrapper.eq (RGeneralSurveyPlanPO::getOrgNo, rGeneralSurveyPlanQueryParm.getOrgNo ());
+ List data = deptFeignClient.getDepSonIdtByDeptId (rGeneralSurveyPlanQueryParm.getOrgNo ()).getData ( );
+
+ queryWrapper.in (RGeneralSurveyPlanPO::getOrgNo, data);
}
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm. getStatus ())) {
queryWrapper.eq (RGeneralSurveyPlanPO::getStatus, rGeneralSurveyPlanQueryParm.getStatus ());
@@ -120,14 +131,27 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectPage (page,queryWrapper).getRecords ();
if(CollectionUtils.isEmpty (rGeneralSurveyPlanPOS)){
return returnpage;
}
+
+ //部门处理:根据部门code取名称
+ List dept = deptFeignClient.allDeptList().getData();
+ Map pvTerminalTreeVOMap = dept.stream().
+ collect(Collectors.
+ toMap(PvTerminalTreeVO::getId,
+ PvTerminalTreeVO::getName));
+
+
List collect = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( ));
LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<> ();
lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, collect);
@@ -136,8 +160,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl{
RGeneralSurveyPlanVO rGeneralSurveyPlanVO = new RGeneralSurveyPlanVO();
BeanUtils.copyProperties (temp, rGeneralSurveyPlanVO);
- Stream rGeneralSurveyPlanDetailStream = rGeneralSurveyPlanDetails.stream ( ).
- filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( )));
long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
@@ -154,6 +176,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl surveyResultDownload(String planNo) {
+ public List surveyResultDownload(String planNo) {
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO();
rGeneralSurveyPlanPO.setPlanNo (planNo);
rGeneralSurveyPlanPO = this.selectByMultiId (rGeneralSurveyPlanPO);
@@ -211,8 +234,9 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl collect = Stream.of (split).map (temp -> {
- return minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), temp, 7 * 24 * 60 * 60);
+ List collect = Stream.of (split).map (temp -> {
+ MinIoUploadResDTO dto = new MinIoUploadResDTO("",minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), temp, 7 * 24 * 60 * 60));
+ return dto ;
}).collect (Collectors.toList ( ));
return collect;
}
@@ -220,7 +244,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl
+ * @return: java.util.List
* @Author: clam
* @Date: 2022/11/21
*/
@@ -233,6 +257,13 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<> ();
lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, planIdList);
List