普测计划模块代码提交

This commit is contained in:
huangzj
2022-11-30 19:13:53 +08:00
parent cee90270e9
commit 4ce81ced3d
15 changed files with 324 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -3,6 +3,7 @@ package com.njcn.process.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId; import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -51,6 +52,7 @@ public class RGeneralSurveyPlanPO {
* 计划生成时间 * 计划生成时间
*/ */
@TableField(value = "plan_create_time") @TableField(value = "plan_create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划生成时间") @ApiModelProperty(value="计划生成时间")
private Date planCreateTime = new Date(); private Date planCreateTime = new Date();
@@ -58,6 +60,7 @@ public class RGeneralSurveyPlanPO {
* 计划开始时间 * 计划开始时间
*/ */
@TableField(value = "plan_start_time") @TableField(value = "plan_start_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划开始时间") @ApiModelProperty(value="计划开始时间")
private Date planStartTime; private Date planStartTime;
@@ -65,6 +68,7 @@ public class RGeneralSurveyPlanPO {
* 计划结束时间 * 计划结束时间
*/ */
@TableField(value = "plan_end_time") @TableField(value = "plan_end_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="计划结束时间") @ApiModelProperty(value="计划结束时间")
private Date planEndTime; private Date planEndTime;
@@ -72,6 +76,7 @@ public class RGeneralSurveyPlanPO {
* 实际完成时间 * 实际完成时间
*/ */
@TableField(value = "plan_complate_time") @TableField(value = "plan_complate_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="实际完成时间") @ApiModelProperty(value="实际完成时间")
private Date planComplateTime; private Date planComplateTime;
@@ -121,6 +126,7 @@ public class RGeneralSurveyPlanPO {
* 上传时间 * 上传时间
*/ */
@TableField(value = "upload_time") @TableField(value = "upload_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="上传时间") @ApiModelProperty(value="上传时间")
private Date uploadTime; private Date uploadTime;
} }

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -1,5 +1,7 @@
package com.njcn.process.controller; 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.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType; 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.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; import com.njcn.poi.util.PoiUtil;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; import com.njcn.process.pojo.param.*;
import com.njcn.process.pojo.param.RGeneralSurveyPlandetailQueryParm; import com.njcn.process.pojo.po.SurveyPlanExcel;
import com.njcn.process.pojo.param.SurveyResultUploadParam; import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO;
import com.njcn.process.service.RGeneralSurveyPlanDetailService; import com.njcn.process.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService; import com.njcn.process.service.RGeneralSurveyPlanPOService;
@@ -20,10 +22,12 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@@ -47,13 +51,15 @@ public class RGeneralSurveyPlanController extends BaseController {
private @Autowired private @Autowired
RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService; RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService;
/** /**
* 查询所有数据 * @Description: 新增/修改普测计划
* @author qijian * @Param: [rGeneralSurveyPlanAddParm]
* @date 2022/11/11 * @return: com.njcn.common.pojo.response.HttpResult<java.lang.Boolean>
*/ * @Author: clam
* @Date: 2022/11/22
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addPlan") @PostMapping("/addPlan")
@ApiOperation("新增普测计划") @ApiOperation("新增/修改普测计划")
@ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true) @ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true)
public HttpResult<Boolean> addPlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){ public HttpResult<Boolean> addPlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){
String methodDescribe = getMethodDescribe("addPlan"); String methodDescribe = getMethodDescribe("addPlan");
@@ -75,7 +81,7 @@ public class RGeneralSurveyPlanController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlan") @PostMapping("/queryPlan")
@ApiOperation("查询普测计划") @ApiOperation("查询普测计划-新建页面")
@ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true) @ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){ public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlan"); String methodDescribe = getMethodDescribe("queryPlan");
@@ -84,6 +90,28 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlanAudit")
@ApiOperation("查询普测计划-审核页面")
@ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanAudit");
IPage<RGeneralSurveyPlanVO> 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<IPage<RGeneralSurveyPlanVO>> queryPlanResult(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanResult");
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlandetail") @PostMapping("/queryPlandetail")
@ApiOperation("根据planNO查询普测计划详情") @ApiOperation("根据planNO查询普测计划详情")
@@ -95,6 +123,8 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanDetailVOIPage, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanDetailVOIPage, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPLOAD) @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPLOAD)
@PostMapping("/surveyResultUpload") @PostMapping("/surveyResultUpload")
@ApiOperation("上传普测结果报告") @ApiOperation("上传普测结果报告")
@@ -121,4 +151,39 @@ public class RGeneralSurveyPlanController extends BaseController {
} }
@ResponseBody
@ApiOperation("导出普测计划信息")
@PostMapping(value = "exportSurveyPlan")
@ApiImplicitParam(name = "planIdList", value = "普测计划详情查询参数", required = true)
public HttpResult<String> exportSurveyPlan(HttpServletResponse response,@RequestBody List<String> planIdList) {
String methodDescribe = getMethodDescribe("exportSurveyPlan");
String fileName = "普测计划信息.xls";
List<SurveyPlanExcel> 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<List<RGeneralSurveyPlanDetailOnQuestionVO>> querySurveyPlanOnQuestion(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
String methodDescribe = getMethodDescribe("querySurveyPlanOnQuestion");
List<RGeneralSurveyPlanDetailOnQuestionVO> list= rGeneralSurveyPlanPOService.querySurveyPlanOnQuestion(questionQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
} }

View File

@@ -1,7 +1,13 @@
package com.njcn.process.mapper; package com.njcn.process.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; 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.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 * @version V1.0.0
*/ */
public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper<RGeneralSurveyPlanDetail> { public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper<RGeneralSurveyPlanDetail> {
@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<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm);
} }

View File

@@ -13,4 +13,5 @@ import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
* @version V1.0.0 * @version V1.0.0
*/ */
public interface RGeneralSurveyPlanPOMapper extends MppBaseMapper<RGeneralSurveyPlanPO> { public interface RGeneralSurveyPlanPOMapper extends MppBaseMapper<RGeneralSurveyPlanPO> {
} }

View File

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.jeffreyning.mybatisplus.service.IMppService; import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; 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.param.SurveyResultUploadParam;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; 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.pojo.vo.RGeneralSurveyPlanVO;
import java.util.List; import java.util.List;
@@ -53,4 +56,20 @@ public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyP
* @Date: 2022/11/18 * @Date: 2022/11/18
*/ */
List<String> surveyResultDownload(String planNo); List<String> surveyResultDownload(String planNo);
/**
* @Description: exportSurveyPlan
* @Param: []
* @return: java.util.List<com.njcn.process.pojo.po.SurveyPlanExcel>
* @Author: clam
* @Date: 2022/11/21
*/
List<SurveyPlanExcel> exportSurveyPlan(List<String> planIdList);
/**
* @Description: querySurveyPlanOnQuestion
* @Param: [questionQueryParm]
* @return: java.util.List<com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO>
* @Author: clam
* @Date: 2022/11/30
*/
List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm);
} }

View File

@@ -13,9 +13,12 @@ import com.njcn.process.mapper.RGeneralSurveyPlanDetailMapper;
import com.njcn.process.mapper.RGeneralSurveyPlanPOMapper; import com.njcn.process.mapper.RGeneralSurveyPlanPOMapper;
import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm;
import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; 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.param.SurveyResultUploadParam;
import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; 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.pojo.vo.RGeneralSurveyPlanVO;
import com.njcn.process.service.RGeneralSurveyPlanDetailService; import com.njcn.process.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService; import com.njcn.process.service.RGeneralSurveyPlanPOService;
@@ -214,6 +217,57 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
return collect; return collect;
} }
/**
* @Description: exportSurveyPlan
* @Param: []
* @return: java.util.List<com.njcn.process.pojo.po.SurveyPlanExcel>
* @Author: clam
* @Date: 2022/11/21
*/
@Override
public List<SurveyPlanExcel> exportSurveyPlan(List<String> planIdList) {
List<SurveyPlanExcel> surveyPlanExcels = new ArrayList<> ();
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<> ();
queryWrapper.in (RGeneralSurveyPlanPO::getPlanNo,planIdList);
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper);
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<> ();
lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, planIdList);
List<RGeneralSurveyPlanDetail> 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<com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO>
* @Author: clam
* @Date: 2022/11/30
*/
@Override
public List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm) {
List<RGeneralSurveyPlanDetailOnQuestionVO> rGeneralSurveyPlanDetailOnQuestionVOS = new ArrayList<> ();
rGeneralSurveyPlanDetailOnQuestionVOS =rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion(questionQueryParm);
return rGeneralSurveyPlanDetailOnQuestionVOS;
}
/** /**
* 上传文件到Minio * 上传文件到Minio
* *