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] =?UTF-8?q?=E6=99=AE=E6=B5=8B=E8=AE=A1=E5=88=92=E6=A8=A1?= =?UTF-8?q?=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 *