1.过程监督-谐波普测管理代码调整
2.过程监督-干扰用户管理代码调整 3.过程监督-电能质量问题管理代码调整 4.过程监督-终端监测管理代码调整
This commit is contained in:
@@ -36,6 +36,9 @@ public class LoadTypeUserSearchParam {
|
|||||||
@ApiModelProperty("是否上传实测报告(0:否 1:是)")
|
@ApiModelProperty("是否上传实测报告(0:否 1:是)")
|
||||||
private Integer aIsFileUpload;
|
private Integer aIsFileUpload;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否审核(0:否 1:是)")
|
||||||
|
private Integer checkType=0;
|
||||||
|
|
||||||
@ApiModelProperty("页码")
|
@ApiModelProperty("页码")
|
||||||
@NotNull(message = "页码不可为空")
|
@NotNull(message = "页码不可为空")
|
||||||
@Range(min = 1,message = "页码必须大于0")
|
@Range(min = 1,message = "页码必须大于0")
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -19,20 +21,25 @@ import java.util.List;
|
|||||||
public class RGeneralSurveyPlanAddParm {
|
public class RGeneralSurveyPlanAddParm {
|
||||||
|
|
||||||
@ApiModelProperty(value="单位ID")
|
@ApiModelProperty(value="单位ID")
|
||||||
|
@NotBlank(message = "单位不可为空")
|
||||||
private String orgNo;
|
private String orgNo;
|
||||||
|
|
||||||
@ApiModelProperty(value="普测计划编号")
|
@ApiModelProperty(value="普测计划编号")
|
||||||
|
@NotBlank(message = "普测计划编号不可为空")
|
||||||
private String planNo;
|
private String planNo;
|
||||||
|
|
||||||
@ApiModelProperty(value="普测计划名称")
|
@ApiModelProperty(value="普测计划名称")
|
||||||
|
@NotBlank(message = "普测计划名称不可为空")
|
||||||
private String planName;
|
private String planName;
|
||||||
|
|
||||||
@ApiModelProperty(value="计划开始时间")
|
@ApiModelProperty(value="计划开始时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||||
|
@NotNull(message = "计划开始时间不可为空")
|
||||||
private Date planStartTime;
|
private Date planStartTime;
|
||||||
|
|
||||||
@ApiModelProperty(value="计划结束时间")
|
@ApiModelProperty(value="计划结束时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||||
|
@NotNull(message = "计划结束时间不可为空")
|
||||||
private Date planEndTime;
|
private Date planEndTime;
|
||||||
|
|
||||||
@ApiModelProperty(value="计划负责人")
|
@ApiModelProperty(value="计划负责人")
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ public class RGeneralSurveyPlanPO {
|
|||||||
@TableField(value = "upload_time")
|
@TableField(value = "upload_time")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date uploadTime;
|
private Date uploadTime;
|
||||||
|
|
||||||
|
|
||||||
@TableField(value = "create_person")
|
@TableField(value = "create_person")
|
||||||
private String createPerson;
|
private String createPerson;
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ public class RLoadTypeUserManage implements Serializable {
|
|||||||
* 入网报告路径
|
* 入网报告路径
|
||||||
*/
|
*/
|
||||||
private String iFilePath;
|
private String iFilePath;
|
||||||
|
/**
|
||||||
|
* 入网报告文件名称
|
||||||
|
*/
|
||||||
|
private String iFilePathName;
|
||||||
/**
|
/**
|
||||||
* 入网报告上传时间
|
* 入网报告上传时间
|
||||||
*/
|
*/
|
||||||
@@ -117,6 +121,10 @@ public class RLoadTypeUserManage implements Serializable {
|
|||||||
* 实测报告路径
|
* 实测报告路径
|
||||||
*/
|
*/
|
||||||
private String aFilePath;
|
private String aFilePath;
|
||||||
|
/**
|
||||||
|
* 实测报告文件名称
|
||||||
|
*/
|
||||||
|
private String aFilePathName;
|
||||||
/**
|
/**
|
||||||
* 实测报告上传时间
|
* 实测报告上传时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.process.pojo.po;
|
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.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -18,7 +19,8 @@ import java.time.LocalDate;
|
|||||||
@Data
|
@Data
|
||||||
@TableName(value = "r_survey_cycle")
|
@TableName(value = "r_survey_cycle")
|
||||||
public class RSurveyCyclePO {
|
public class RSurveyCyclePO {
|
||||||
@TableField(value = "id")
|
|
||||||
|
@TableId(value = "id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@TableField(value = "start_year")
|
@TableField(value = "start_year")
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ public class ElectricityQualityIssuesController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "powerQualityProblemNo", value = "历史审核记录查询参数", required = true)
|
@ApiImplicitParam(name = "powerQualityProblemNo", value = "历史审核记录查询参数", required = true)
|
||||||
public HttpResult<List<RStatElectricQualityProblemLogVO>> queryCheckTrack(@RequestParam("powerQualityProblemNo") String powerQualityProblemNo){
|
public HttpResult<List<RStatElectricQualityProblemLogVO>> queryCheckTrack(@RequestParam("powerQualityProblemNo") String powerQualityProblemNo){
|
||||||
String methodDescribe = getMethodDescribe("checkPowerQuality");
|
String methodDescribe = getMethodDescribe("checkPowerQuality");
|
||||||
|
|
||||||
List<RStatElectricQualityProblemLogVO> rStatElectricQualityProblemLogVOS = issuesService.queryCheckTrack (powerQualityProblemNo);
|
List<RStatElectricQualityProblemLogVO> rStatElectricQualityProblemLogVOS = issuesService.queryCheckTrack (powerQualityProblemNo);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatElectricQualityProblemLogVOS, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatElectricQualityProblemLogVOS, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ public class LoadTypeUserManageController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "loadTypeUserCheckParam", value = "入网评估报告审核参数", required = true)
|
@ApiImplicitParam(name = "loadTypeUserCheckParam", value = "入网评估报告审核参数", required = true)
|
||||||
public HttpResult<Boolean> checkLoadTypeUserI(@Validated @RequestBody LoadTypeUserCheckParam loadTypeUserCheckParam){
|
public HttpResult<Boolean> checkLoadTypeUserI(@Validated @RequestBody LoadTypeUserCheckParam loadTypeUserCheckParam){
|
||||||
String methodDescribe = getMethodDescribe("checkLoadTypeUserI");
|
String methodDescribe = getMethodDescribe("checkLoadTypeUserI");
|
||||||
|
|
||||||
Boolean flag = loadTypeUserManageService.checkLoadTypeUserI (loadTypeUserCheckParam);
|
Boolean flag = loadTypeUserManageService.checkLoadTypeUserI (loadTypeUserCheckParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -121,7 +120,6 @@ public class LoadTypeUserManageController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPDATE)
|
||||||
@PostMapping("/uploadLoadTypeUserI")
|
@PostMapping("/uploadLoadTypeUserI")
|
||||||
@ApiOperation("上传干扰源用户入网报告(未建档干扰源用户管理)")
|
@ApiOperation("上传干扰源用户入网报告(未建档干扰源用户管理)")
|
||||||
// @ApiImplicitParam(name = "loadTypeUserIUploadParam", value = "实体参数", required = true)
|
|
||||||
public HttpResult<Boolean> uploadLoadTypeUserI(@Validated LoadTypeUserIUploadParam loadTypeUserIUploadParam){
|
public HttpResult<Boolean> uploadLoadTypeUserI(@Validated LoadTypeUserIUploadParam loadTypeUserIUploadParam){
|
||||||
String methodDescribe = getMethodDescribe("uploadLoadTypeUserI");
|
String methodDescribe = getMethodDescribe("uploadLoadTypeUserI");
|
||||||
boolean res = loadTypeUserManageService.uploadLoadTypeUserI(loadTypeUserIUploadParam);
|
boolean res = loadTypeUserManageService.uploadLoadTypeUserI(loadTypeUserIUploadParam);
|
||||||
@@ -201,7 +199,6 @@ public class LoadTypeUserManageController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPDATE)
|
||||||
@PostMapping("/uploadLoadTypeUserA")
|
@PostMapping("/uploadLoadTypeUserA")
|
||||||
@ApiOperation("上传干扰源用户实测报告(干扰源用户常态化管理)")
|
@ApiOperation("上传干扰源用户实测报告(干扰源用户常态化管理)")
|
||||||
// @ApiImplicitParam(name = "loadTypeUserAUploadParam", value = "实体参数", required = true)
|
|
||||||
public HttpResult<Boolean> uploadLoadTypeUserA(@Validated LoadTypeUserAUploadParam loadTypeUserAUploadParam){
|
public HttpResult<Boolean> uploadLoadTypeUserA(@Validated LoadTypeUserAUploadParam loadTypeUserAUploadParam){
|
||||||
String methodDescribe = getMethodDescribe("uploadLoadTypeUserA");
|
String methodDescribe = getMethodDescribe("uploadLoadTypeUserA");
|
||||||
boolean res = loadTypeUserManageService.uploadLoadTypeUserA(loadTypeUserAUploadParam);
|
boolean res = loadTypeUserManageService.uploadLoadTypeUserA(loadTypeUserAUploadParam);
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ package com.njcn.process.controller;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
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;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
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.exception.BusinessException;
|
||||||
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.minioss.bo.MinIoUploadResDTO;
|
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||||
@@ -15,23 +17,21 @@ import com.njcn.process.pojo.param.*;
|
|||||||
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
|
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
|
||||||
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
||||||
import com.njcn.process.pojo.vo.*;
|
import com.njcn.process.pojo.vo.*;
|
||||||
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
|
|
||||||
import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
||||||
import com.njcn.process.service.impl.RSurveyPlanConfigService;
|
import com.njcn.process.service.impl.RSurveyPlanConfigService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
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.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
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 org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -52,26 +52,24 @@ import java.util.stream.Stream;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class RGeneralSurveyPlanController extends BaseController {
|
public class RGeneralSurveyPlanController extends BaseController {
|
||||||
|
|
||||||
private final RGeneralSurveyPlanPOService rGeneralSurveyPlanPOService;
|
private final RGeneralSurveyPlanPOService rGeneralSurveyPlanPOService;
|
||||||
|
|
||||||
|
|
||||||
|
private final RSurveyPlanConfigService rSurveyPlanConfigService;
|
||||||
|
|
||||||
private final
|
|
||||||
RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService;
|
|
||||||
private final
|
|
||||||
RSurveyPlanConfigService rSurveyPlanConfigService;
|
|
||||||
/**
|
/**
|
||||||
* @Description: 新增/修改普测计划
|
* @Description: 新增/修改普测计划
|
||||||
* @Param: [rGeneralSurveyPlanAddParm]
|
* @Param: [rGeneralSurveyPlanAddParm]
|
||||||
* @return: com.njcn.common.pojo.response.HttpResult<java.lang.Boolean>
|
* @return: com.njcn.common.pojo.response.HttpResult<java.lang.Boolean>
|
||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2022/11/22
|
* @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 @Validated RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm) {
|
||||||
String methodDescribe = getMethodDescribe("addPlan");
|
String methodDescribe = getMethodDescribe("addPlan");
|
||||||
|
|
||||||
Boolean addFlag = rGeneralSurveyPlanPOService.addPlan(rGeneralSurveyPlanAddParm);
|
Boolean addFlag = rGeneralSurveyPlanPOService.addPlan(rGeneralSurveyPlanAddParm);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -80,29 +78,19 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@PostMapping("/addPlanCycle")
|
@PostMapping("/addPlanCycle")
|
||||||
@ApiOperation("设置普测周期")
|
@ApiOperation("设置普测周期")
|
||||||
@ApiImplicitParam(name = "cycleNum", value = "普测周期", required = true)
|
@ApiImplicitParam(name = "cycleNum", value = "普测周期", required = true)
|
||||||
public HttpResult<RSurveyCycleVO> addPlanCycle(@RequestParam("cycleNum") Integer cycleNum ){
|
public HttpResult<RSurveyCycleVO> addPlanCycle(@RequestParam("cycleNum") Integer cycleNum) {
|
||||||
String methodDescribe = getMethodDescribe("addPlanCycle");
|
String methodDescribe = getMethodDescribe("addPlanCycle");
|
||||||
|
|
||||||
RSurveyCycleVO rSurveyCycleVO = rGeneralSurveyPlanPOService.addPlanCycle(cycleNum);
|
RSurveyCycleVO rSurveyCycleVO = rGeneralSurveyPlanPOService.addPlanCycle(cycleNum);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rSurveyCycleVO, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rSurveyCycleVO, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
|
||||||
@ApiOperation("excel批量导入电站信息")
|
|
||||||
@PostMapping(value = "importSubStatation")
|
|
||||||
public HttpResult<String> importSubStatation(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
|
||||||
String methodDescribe = getMethodDescribe("importSubStatation");
|
|
||||||
rGeneralSurveyPlanPOService.importSubStatation(file, response);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
|
||||||
}
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/initDetpStataionTree")
|
@PostMapping("/initDetpStataionTree")
|
||||||
@ApiOperation("初始化部门")
|
@ApiOperation("初始化部门")
|
||||||
@ApiImplicitParam(name = "orgId", value = "部门号", required = true)
|
@ApiImplicitParam(name = "orgId", value = "部门号", required = true)
|
||||||
public HttpResult<List<DeptSubstationVO>> initDetpStataionTree(@RequestParam("orgId") String orgId ){
|
public HttpResult<List<DeptSubstationVO>> initDetpStataionTree(@RequestParam("orgId") String orgId) {
|
||||||
String methodDescribe = getMethodDescribe("initDetpStataionTree");
|
String methodDescribe = getMethodDescribe("initDetpStataionTree");
|
||||||
|
List<DeptSubstationVO> list = rGeneralSurveyPlanPOService.initDetpStataionTree(orgId);
|
||||||
List<DeptSubstationVO> list = rGeneralSurveyPlanPOService.initDetpStataionTree ( orgId);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,32 +98,32 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@PostMapping("/addPlanConfig")
|
@PostMapping("/addPlanConfig")
|
||||||
@ApiOperation("增加普测计划参数")
|
@ApiOperation("增加普测计划参数")
|
||||||
@ApiImplicitParam(name = "rSurveyPlanConfigVOList", value = "", required = true)
|
@ApiImplicitParam(name = "rSurveyPlanConfigVOList", value = "", required = true)
|
||||||
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigVO> rSurveyPlanConfigVOList){
|
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigVO> rSurveyPlanConfigVOList) {
|
||||||
String methodDescribe = getMethodDescribe("querySubStatation");
|
String methodDescribe = getMethodDescribe("querySubStatation");
|
||||||
double sum = rSurveyPlanConfigVOList.stream ( ).mapToDouble (RSurveyPlanConfigVO::getProportion).sum ( );
|
double sum = rSurveyPlanConfigVOList.stream().mapToDouble(RSurveyPlanConfigVO::getProportion).sum();
|
||||||
if(sum>1){
|
if (sum > 1) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.MATH_ERROR, false, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.MATH_ERROR, false, methodDescribe);
|
||||||
}
|
}
|
||||||
List<RSurveyPlanConfigPO> collect = rSurveyPlanConfigVOList.stream ( ).map (temp -> {
|
List<RSurveyPlanConfigPO> collect = rSurveyPlanConfigVOList.stream().map(temp -> {
|
||||||
RSurveyPlanConfigPO rs = new RSurveyPlanConfigPO ( );
|
RSurveyPlanConfigPO rs = new RSurveyPlanConfigPO();
|
||||||
BeanUtils.copyProperties (temp, rs);
|
BeanUtils.copyProperties(temp, rs);
|
||||||
return rs;
|
return rs;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect(Collectors.toList());
|
||||||
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId (collect, 500);
|
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryPlanConfig")
|
@PostMapping("/queryPlanConfig")
|
||||||
@ApiOperation("查询普测计划参数")
|
@ApiOperation("查询普测计划参数")
|
||||||
public HttpResult<List<RSurveyPlanConfigVO>> queryPlanConfig(){
|
public HttpResult<List<RSurveyPlanConfigVO>> queryPlanConfig() {
|
||||||
String methodDescribe = getMethodDescribe("queryPlanConfig");
|
String methodDescribe = getMethodDescribe("queryPlanConfig");
|
||||||
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.list ( );
|
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.list();
|
||||||
List<RSurveyPlanConfigVO> collect = list.stream ( ).map (temp -> {
|
List<RSurveyPlanConfigVO> collect = list.stream().map(temp -> {
|
||||||
RSurveyPlanConfigVO rs = new RSurveyPlanConfigVO ( );
|
RSurveyPlanConfigVO rs = new RSurveyPlanConfigVO();
|
||||||
BeanUtils.copyProperties (temp, rs);
|
BeanUtils.copyProperties(temp, rs);
|
||||||
return rs;
|
return rs;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect(Collectors.toList());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, collect, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, collect, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,10 +132,9 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@PostMapping("/querySubStatation")
|
@PostMapping("/querySubStatation")
|
||||||
@ApiOperation("电站勾选接口")
|
@ApiOperation("电站勾选接口")
|
||||||
@ApiImplicitParam(name = "statetionNum", value = "电站数量", required = true)
|
@ApiImplicitParam(name = "statetionNum", value = "电站数量", required = true)
|
||||||
public HttpResult<RGeneralSurveyPlanAddParm> querySubStatation(@RequestParam("statetionNum") Integer statetionNum ){
|
public HttpResult<RGeneralSurveyPlanAddParm> querySubStatation(@RequestParam("statetionNum") Integer statetionNum) {
|
||||||
String methodDescribe = getMethodDescribe("querySubStatation");
|
String methodDescribe = getMethodDescribe("querySubStatation");
|
||||||
|
RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm = rGeneralSurveyPlanPOService.querySubStatation(statetionNum);
|
||||||
RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm = rGeneralSurveyPlanPOService.querySubStatation (statetionNum);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanAddParm, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanAddParm, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,10 +142,9 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@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");
|
||||||
|
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query(rGeneralSurveyPlanQueryParm, Stream.of("0", "1", "2", "3").collect(Collectors.toList()), "1");
|
||||||
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ()),"1");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,10 +152,19 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@PostMapping("/queryPlanAudit")
|
@PostMapping("/queryPlanAudit")
|
||||||
@ApiOperation("查询普测计划-审核页面")
|
@ApiOperation("查询普测计划-审核页面")
|
||||||
@ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
|
@ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true)
|
||||||
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
|
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm) {
|
||||||
String methodDescribe = getMethodDescribe("queryPlanAudit");
|
String methodDescribe = getMethodDescribe("queryPlanAudit");
|
||||||
|
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query(rGeneralSurveyPlanQueryParm, Stream.of("1").collect(Collectors.toList()), "2");
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1","2").collect (Collectors.toList ()),"2");
|
@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, Stream.of("3", "4").collect(Collectors.toList()), "3");
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,24 +172,12 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@PostMapping("/checkPlanAudit")
|
@PostMapping("/checkPlanAudit")
|
||||||
@ApiOperation("普测计划-审核")
|
@ApiOperation("普测计划-审核")
|
||||||
@ApiImplicitParam(name = "rGeneralSurveyPlanChcekParm", value = "普测计划审核参数", required = true)
|
@ApiImplicitParam(name = "rGeneralSurveyPlanChcekParm", value = "普测计划审核参数", required = true)
|
||||||
public HttpResult<Boolean> checkPlanAudit(@Validated @RequestBody RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm){
|
public HttpResult<Boolean> checkPlanAudit(@Validated @RequestBody RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm) {
|
||||||
String methodDescribe = getMethodDescribe("checkPlanAudit");
|
String methodDescribe = getMethodDescribe("checkPlanAudit");
|
||||||
|
Boolean flag = rGeneralSurveyPlanPOService.checkPlanAudit(rGeneralSurveyPlanChcekParm);
|
||||||
Boolean flag = rGeneralSurveyPlanPOService.checkPlanAudit (rGeneralSurveyPlanChcekParm);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, 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, Stream.of ("3","4").collect (Collectors.toList ()),"3");
|
|
||||||
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查询普测计划详情")
|
||||||
@@ -207,29 +190,26 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPLOAD)
|
|
||||||
@PostMapping("/surveyResultUpload")
|
@PostMapping("/surveyResultUpload")
|
||||||
@ApiOperation("上传普测结果报告")
|
@ApiOperation("上传普测结果报告")
|
||||||
// @ApiImplicitParam(name = "surveyResultUploadParam", value = "实体参数", required = true)
|
public HttpResult<Boolean> surveyResultUpload(@Validated SurveyResultUploadParam surveyResultUploadParam) {
|
||||||
public HttpResult<Boolean> surveyResultUpload( @Validated SurveyResultUploadParam surveyResultUploadParam){
|
|
||||||
String methodDescribe = getMethodDescribe("surveyResultUpload");
|
String methodDescribe = getMethodDescribe("surveyResultUpload");
|
||||||
boolean res = rGeneralSurveyPlanPOService.surveyResultUpload(surveyResultUploadParam);
|
boolean res = rGeneralSurveyPlanPOService.surveyResultUpload(surveyResultUploadParam);
|
||||||
if(res){
|
if (res) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.DOWNLOAD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DOWNLOAD)
|
||||||
@PostMapping("/surveyResultDownload")
|
@PostMapping("/surveyResultDownload")
|
||||||
@ApiOperation("下载普测结果报告")
|
@ApiOperation("下载普测结果报告")
|
||||||
@ApiImplicitParam(name = "planNo", value = "计划号", required = true)
|
@ApiImplicitParam(name = "planNo", value = "计划号", required = true)
|
||||||
public HttpResult<List<MinIoUploadResDTO>> surveyResultDownload(@RequestParam("planNo") String planNo ){
|
public HttpResult<List<MinIoUploadResDTO>> surveyResultDownload(@RequestParam("planNo") String planNo) {
|
||||||
String methodDescribe = getMethodDescribe("surveyResultDownload");
|
String methodDescribe = getMethodDescribe("surveyResultDownload");
|
||||||
List<MinIoUploadResDTO> downloadUrls = rGeneralSurveyPlanPOService.surveyResultDownload(planNo);
|
List<MinIoUploadResDTO> downloadUrls = rGeneralSurveyPlanPOService.surveyResultDownload(planNo);
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, downloadUrls, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, downloadUrls, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -238,10 +218,10 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@ApiOperation("导出普测计划信息")
|
@ApiOperation("导出普测计划信息")
|
||||||
@PostMapping(value = "exportSurveyPlan")
|
@PostMapping(value = "exportSurveyPlan")
|
||||||
@ApiImplicitParam(name = "planIdList", value = "普测计划详情查询参数", required = true)
|
@ApiImplicitParam(name = "planIdList", value = "普测计划详情查询参数", required = true)
|
||||||
public HttpResult<String> exportSurveyPlan(HttpServletResponse response,@RequestBody List<String> planIdList) {
|
public HttpResult<String> exportSurveyPlan(HttpServletResponse response, @RequestBody List<String> planIdList) {
|
||||||
String methodDescribe = getMethodDescribe("exportSurveyPlan");
|
String methodDescribe = getMethodDescribe("exportSurveyPlan");
|
||||||
String fileName = "普测计划信息.xls";
|
String fileName = "普测计划信息.xls";
|
||||||
List<SurveyPlanExcel> baseExcelList = null;
|
List<SurveyPlanExcel> baseExcelList;
|
||||||
try {
|
try {
|
||||||
baseExcelList = rGeneralSurveyPlanPOService.exportSurveyPlan(planIdList);
|
baseExcelList = rGeneralSurveyPlanPOService.exportSurveyPlan(planIdList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -258,11 +238,9 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@ApiOperation("普测计划信息问题件新增查询")
|
@ApiOperation("普测计划信息问题件新增查询")
|
||||||
@PostMapping(value = "querySurveyPlanOnQuestion")
|
@PostMapping(value = "querySurveyPlanOnQuestion")
|
||||||
@ApiImplicitParam(name = "questionQueryParm", value = "普测计划信息问题件查询参数", required = true)
|
@ApiImplicitParam(name = "questionQueryParm", value = "普测计划信息问题件查询参数", required = true)
|
||||||
public HttpResult<List<RGeneralSurveyPlanDetailOnQuestionVO>> querySurveyPlanOnQuestion(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
|
public HttpResult<List<RGeneralSurveyPlanDetailOnQuestionVO>> querySurveyPlanOnQuestion(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
|
||||||
String methodDescribe = getMethodDescribe("querySurveyPlanOnQuestion");
|
String methodDescribe = getMethodDescribe("querySurveyPlanOnQuestion");
|
||||||
|
List<RGeneralSurveyPlanDetailOnQuestionVO> list = rGeneralSurveyPlanPOService.querySurveyPlanOnQuestion(questionQueryParm);
|
||||||
List<RGeneralSurveyPlanDetailOnQuestionVO> list= rGeneralSurveyPlanPOService.querySurveyPlanOnQuestion(questionQueryParm);
|
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -271,15 +249,32 @@ public class RGeneralSurveyPlanController extends BaseController {
|
|||||||
@ApiOperation("普测计划名称查询")
|
@ApiOperation("普测计划名称查询")
|
||||||
@PostMapping(value = "querySurveyPlanName")
|
@PostMapping(value = "querySurveyPlanName")
|
||||||
@ApiImplicitParam(name = "questionQueryParm", value = "普测计划名称查询参数", required = true)
|
@ApiImplicitParam(name = "questionQueryParm", value = "普测计划名称查询参数", required = true)
|
||||||
public HttpResult<List<RGeneralSurveyPlanPO>> querySurveyPlanName(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
|
public HttpResult<List<RGeneralSurveyPlanPO>> querySurveyPlanName(@Validated @RequestBody SurveyPlanQuestionQueryParm questionQueryParm) {
|
||||||
String methodDescribe = getMethodDescribe("querySurveyPlanName");
|
String methodDescribe = getMethodDescribe("querySurveyPlanName");
|
||||||
|
List<RGeneralSurveyPlanPO> list = rGeneralSurveyPlanPOService.querySurveyPlanName(questionQueryParm);
|
||||||
List<RGeneralSurveyPlanPO> list= rGeneralSurveyPlanPOService.querySurveyPlanName(questionQueryParm);
|
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@ApiOperation("普测计划状态更改为待审核")
|
||||||
|
@PostMapping(value = "planStatus")
|
||||||
|
public HttpResult<Boolean> planStatus(@RequestBody List<String> planNo) {
|
||||||
|
String methodDescribe = getMethodDescribe("planStatus");
|
||||||
|
int count = rGeneralSurveyPlanPOService.count(new LambdaUpdateWrapper<RGeneralSurveyPlanPO>()
|
||||||
|
.in(RGeneralSurveyPlanPO::getPlanNo, planNo)
|
||||||
|
.ne(RGeneralSurveyPlanPO::getStatus, Arrays.asList(0, 2))
|
||||||
|
);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException("请检查普测计划状态是否正确!");
|
||||||
|
}
|
||||||
|
Boolean update = rGeneralSurveyPlanPOService.update(new LambdaUpdateWrapper<RGeneralSurveyPlanPO>()
|
||||||
|
.in(RGeneralSurveyPlanPO::getPlanNo, planNo)
|
||||||
|
.set(RGeneralSurveyPlanPO::getStatus, 1)
|
||||||
|
);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.njcn.process.pojo.po.RLoadTypeUserManage;
|
|||||||
import com.njcn.process.pojo.vo.RLoadTypeUserManageVO;
|
import com.njcn.process.pojo.vo.RLoadTypeUserManageVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰源用户管理Mapper
|
* 干扰源用户管理Mapper
|
||||||
*
|
*
|
||||||
@@ -24,7 +26,10 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
|
|||||||
* @param loadTypeUserSearchParam 入参
|
* @param loadTypeUserSearchParam 入参
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Page<RLoadTypeUserManageVO> getLoadTypeUserPage(IPage<RLoadTypeUserManageVO> page, @Param("loadTypeUserSearchParam") LoadTypeUserSearchParam loadTypeUserSearchParam);
|
Page<RLoadTypeUserManageVO> getLoadTypeUserPage(IPage<RLoadTypeUserManageVO> page,
|
||||||
|
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam,
|
||||||
|
@Param("ids") List<String> ids
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰源用户分页查询
|
* 干扰源用户分页查询
|
||||||
@@ -32,5 +37,7 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
|
|||||||
* @param loadTypeUserSearchParam 入参
|
* @param loadTypeUserSearchParam 入参
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Page<RLoadTypeUserManageVO> getLoadTypeRelationPage(IPage<RLoadTypeUserManageVO> page, @Param("loadTypeUserSearchParam") LoadTypeUserSearchParam loadTypeUserSearchParam);
|
Page<RLoadTypeUserManageVO> getLoadTypeRelationPage(IPage<RLoadTypeUserManageVO> page,
|
||||||
|
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,4 @@ public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper<RGeneralSu
|
|||||||
"AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')",
|
"AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')",
|
||||||
"</script>"})
|
"</script>"})
|
||||||
List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm);
|
List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm);
|
||||||
}
|
}
|
||||||
@@ -2,27 +2,35 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.process.mapper.LoadTypeUserManageMapper">
|
<mapper namespace="com.njcn.process.mapper.LoadTypeUserManageMapper">
|
||||||
|
|
||||||
<select id="getLoadTypeUserPage" resultType="RLoadTypeUserManageVO">
|
<select id="getLoadTypeUserPage" resultType="com.njcn.process.pojo.vo.RLoadTypeUserManageVO">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
r_load_type_user_manage r
|
r_load_type_user_manage r
|
||||||
where 1=1
|
<where>
|
||||||
<if test="loadTypeUserSearchParam.orgNo != null and loadTypeUserSearchParam.orgNo != ''">
|
<if test="ids != null and ids.size > 0">
|
||||||
and r.org_no = #{loadTypeUserSearchParam.orgNo}
|
AND r.org_no IN
|
||||||
</if>
|
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||||
<if test="loadTypeUserSearchParam.loadType != null and loadTypeUserSearchParam.loadType != ''">
|
#{item}
|
||||||
and r.load_type = #{loadTypeUserSearchParam.loadType}
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.userName != null and loadTypeUserSearchParam.userName != ''">
|
<if test="param.checkType != null and param.checkType == 1">
|
||||||
and r.user_name like CONCAT('%', #{loadTypeUserSearchParam.userName}, '%')
|
and r.i_check_person is null and r.i_check_person !=""
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.fileUploadflag != null and loadTypeUserSearchParam.fileUploadflag != ''">
|
<if test="param.loadType != null and param.loadType != ''">
|
||||||
and r.i_is_file_upload = #{loadTypeUserSearchParam.fileUploadflag}
|
and r.load_type = #{param.loadType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.userName != null and param.userName != ''">
|
||||||
|
and r.user_name like CONCAT('%', #{param.userName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.fileUploadflag != null and param.fileUploadflag != ''">
|
||||||
|
and r.i_is_file_upload = #{param.fileUploadflag}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by record_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLoadTypeRelationPage" resultType="RLoadTypeUserManageVO">
|
<select id="getLoadTypeRelationPage" resultType="com.njcn.process.pojo.vo.RLoadTypeUserManageVO">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
@@ -31,21 +39,22 @@
|
|||||||
AND ISNULL( relation_user_id )= 0
|
AND ISNULL( relation_user_id )= 0
|
||||||
AND LENGTH(
|
AND LENGTH(
|
||||||
trim( relation_user_id ))> 0
|
trim( relation_user_id ))> 0
|
||||||
<if test="loadTypeUserSearchParam.orgNo != null and loadTypeUserSearchParam.orgNo != ''">
|
<if test="param.orgNo != null and param.orgNo != ''">
|
||||||
and r.org_no = #{loadTypeUserSearchParam.orgNo}
|
and r.org_no = #{param.orgNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.loadType != null and loadTypeUserSearchParam.loadType != ''">
|
<if test="param.loadType != null and param.loadType != ''">
|
||||||
and r.load_type = #{loadTypeUserSearchParam.loadType}
|
and r.load_type = #{param.loadType}
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.userName != null and loadTypeUserSearchParam.userName != ''">
|
<if test="param.userName != null and param.userName != ''">
|
||||||
and r.user_name like CONCAT('%', #{loadTypeUserSearchParam.userName}, '%')
|
and r.user_name like CONCAT('%', #{param.userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.relationUserName != null and loadTypeUserSearchParam.relationUserName != ''">
|
<if test="param.relationUserName != null and param.relationUserName != ''">
|
||||||
and r.relation_user_name like CONCAT('%', #{loadTypeUserSearchParam.relationUserName}, '%')
|
and r.relation_user_name like CONCAT('%', #{param.relationUserName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="loadTypeUserSearchParam.aIsFileUpload != null and loadTypeUserSearchParam.aIsFileUpload != ''">
|
<if test="param.aIsFileUpload != null and param.aIsFileUpload != ''">
|
||||||
and r.a_is_file_upload = #{loadTypeUserSearchParam.aIsFileUpload}
|
and r.a_is_file_upload = #{param.aIsFileUpload}
|
||||||
</if>
|
</if>
|
||||||
|
order by record_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,13 +6,10 @@ import com.njcn.minioss.bo.MinIoUploadResDTO;
|
|||||||
import com.njcn.process.pojo.param.*;
|
import com.njcn.process.pojo.param.*;
|
||||||
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
|
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
|
||||||
import com.njcn.process.pojo.vo.*;
|
import com.njcn.process.pojo.vo.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Description:
|
* Description:
|
||||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
* Date: 2022/11/11 11:24【需求编号】
|
* Date: 2022/11/11 11:24【需求编号】
|
||||||
@@ -20,84 +17,90 @@ import java.util.List;
|
|||||||
* @author clam
|
* @author clam
|
||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyPlanPO>{
|
public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyPlanPO> {
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: addPlan
|
|
||||||
* @Param: [rGeneralSurveyPlanAddParm]
|
|
||||||
* @return: java.lang.Boolean
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/11/14
|
|
||||||
*/
|
|
||||||
Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm);
|
|
||||||
/**
|
|
||||||
* @Description: query
|
|
||||||
* @Param: [rGeneralSurveyPlanQueryParm]
|
|
||||||
* @return: java.util.List<com.njcn.process.pojo.vo.RGeneralSurveyPlanVO>
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/11/15
|
|
||||||
*/
|
|
||||||
IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List<String> statusList,String type);
|
|
||||||
/**
|
/**
|
||||||
* @Description: surveyResultUpload
|
* @Description: addPlan
|
||||||
* @Param: [surveyResultUploadParam]
|
* @Param: [rGeneralSurveyPlanAddParm]
|
||||||
* @return: boolean
|
* @return: java.lang.Boolean
|
||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2022/11/18
|
* @Date: 2022/11/14
|
||||||
*/
|
*/
|
||||||
|
Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: query
|
||||||
|
* @Param: [rGeneralSurveyPlanQueryParm]
|
||||||
|
* @return: java.util.List<com.njcn.process.pojo.vo.RGeneralSurveyPlanVO>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/11/15
|
||||||
|
*/
|
||||||
|
IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: surveyResultUpload
|
||||||
|
* @Param: [surveyResultUploadParam]
|
||||||
|
* @return: boolean
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/11/18
|
||||||
|
*/
|
||||||
boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam);
|
boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam);
|
||||||
/**
|
|
||||||
* @Description: surveyResultDownload
|
|
||||||
* @Param: [planNo]
|
|
||||||
* @return: java.util.List<java.lang.String>
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/11/18
|
|
||||||
*/
|
|
||||||
List<MinIoUploadResDTO> surveyResultDownload(String planNo);
|
|
||||||
/**
|
|
||||||
* @Description: exportSurveyPlan
|
|
||||||
* @Param: []
|
|
||||||
* @return: java.util.List<com.njcn.process.pojo.vo.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);
|
|
||||||
/**
|
|
||||||
* @Description: 更具questionQueryParm查计划名称
|
|
||||||
* @Param: [questionQueryParm]
|
|
||||||
* @return: java.util.List<com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm>
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/12/1
|
|
||||||
*/
|
|
||||||
List<RGeneralSurveyPlanPO> querySurveyPlanName(SurveyPlanQuestionQueryParm questionQueryParm);
|
|
||||||
/**
|
|
||||||
* @Description: checkPlanAudit
|
|
||||||
* @Param: [rGeneralSurveyPlanChcekParm]
|
|
||||||
* @return: java.lang.Boolean
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2023/2/22
|
|
||||||
*/
|
|
||||||
Boolean checkPlanAudit(RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm);
|
|
||||||
|
|
||||||
void importSubStatation(MultipartFile file, HttpServletResponse response);
|
/**
|
||||||
|
* @Description: surveyResultDownload
|
||||||
|
* @Param: [planNo]
|
||||||
|
* @return: java.util.List<java.lang.String>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/11/18
|
||||||
|
*/
|
||||||
|
List<MinIoUploadResDTO> surveyResultDownload(String planNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: exportSurveyPlan
|
||||||
|
* @Param: []
|
||||||
|
* @return: java.util.List<com.njcn.process.pojo.vo.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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 更具questionQueryParm查计划名称
|
||||||
|
* @Param: [questionQueryParm]
|
||||||
|
* @return: java.util.List<com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/12/1
|
||||||
|
*/
|
||||||
|
List<RGeneralSurveyPlanPO> querySurveyPlanName(SurveyPlanQuestionQueryParm questionQueryParm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: checkPlanAudit
|
||||||
|
* @Param: [rGeneralSurveyPlanChcekParm]
|
||||||
|
* @return: java.lang.Boolean
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/2/22
|
||||||
|
*/
|
||||||
|
Boolean checkPlanAudit(RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm);
|
||||||
|
|
||||||
RGeneralSurveyPlanAddParm querySubStatation(Integer statetionNum);
|
RGeneralSurveyPlanAddParm querySubStatation(Integer statetionNum);
|
||||||
|
|
||||||
List<DeptSubstationVO> initDetpStataionTree(String orgid);
|
List<DeptSubstationVO> initDetpStataionTree(String orgid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 设置普测周期
|
* @Description: 设置普测周期
|
||||||
* @Param: [cycleNum]
|
* @Param: [cycleNum]
|
||||||
* @return: java.lang.Boolean
|
* @return: java.lang.Boolean
|
||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2023/3/15
|
* @Date: 2023/3/15
|
||||||
*/
|
*/
|
||||||
RSurveyCycleVO addPlanCycle(Integer cycleNum);
|
RSurveyCycleVO addPlanCycle(Integer cycleNum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.device.pms.api.DistributionMonitorClient;
|
import com.njcn.device.pms.api.DistributionMonitorClient;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
@@ -21,19 +24,21 @@ import com.njcn.system.enums.DicDataEnum;
|
|||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
|
import com.njcn.user.pojo.po.Dept;
|
||||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import com.njcn.web.utils.WebUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.jdbc.Null;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,16 +54,9 @@ import java.util.stream.Collectors;
|
|||||||
public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService {
|
public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService {
|
||||||
|
|
||||||
private final LoadTypeUserManageMapper loadTypeUserManageMapper;
|
private final LoadTypeUserManageMapper loadTypeUserManageMapper;
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
private final DistributionMonitorClient distributionMonitorClient;
|
|
||||||
|
|
||||||
private final DeptFeignClient deptFeignClient;
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private GeneralInfo generalInfo;
|
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
|
||||||
@@ -72,21 +70,23 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
@Override
|
@Override
|
||||||
public Page<RLoadTypeUserManageVO> getLoadTypeUserList(LoadTypeUserSearchParam loadTypeUserSearchParam) {
|
public Page<RLoadTypeUserManageVO> getLoadTypeUserList(LoadTypeUserSearchParam loadTypeUserSearchParam) {
|
||||||
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
|
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
|
||||||
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam);
|
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
|
||||||
|
Integer checkType = loadTypeUserSearchParam.getCheckType();
|
||||||
//部门处理:根据部门code取名称
|
//0表示不是审核信息 1标识审核信息
|
||||||
List<RLoadTypeUserManageVO> list = loadTypeUserPage.getRecords();
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
|
||||||
|
if(checkType==1){
|
||||||
|
ids=data.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//干扰源用户信息录入
|
||||||
|
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids);
|
||||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||||
Map<String, PvTerminalTreeVO> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, pvTerminalTreeVO -> pvTerminalTreeVO));
|
Map<String, PvTerminalTreeVO> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, pvTerminalTreeVO -> pvTerminalTreeVO));
|
||||||
List<RLoadTypeUserManageVO> resultList = list.stream().map(item -> {
|
//部门处理:根据部门code取名称
|
||||||
RLoadTypeUserManageVO rLoadTypeUserManageVO = new RLoadTypeUserManageVO();
|
loadTypeUserPage.getRecords().stream().forEach(item -> {
|
||||||
BeanUtils.copyProperties(item, rLoadTypeUserManageVO);
|
item.setOrgName(pvTerminalTreeVOMap.get(item.getOrgNo()).getName()); //单位名称
|
||||||
rLoadTypeUserManageVO.setOrgName(pvTerminalTreeVOMap.get(item.getOrgNo()).getName()); //单位名称
|
});
|
||||||
return rLoadTypeUserManageVO;
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
|
|
||||||
//返回新的数据组
|
//返回新的数据组
|
||||||
return loadTypeUserPage.setRecords(resultList);
|
return loadTypeUserPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,6 +127,10 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
//塞入建档时间
|
//塞入建档时间
|
||||||
Date date = DateUtil.parse(loadTypeUserParam.getRecordTime(), "yyyy-MM-dd HH:mm:ss");
|
Date date = DateUtil.parse(loadTypeUserParam.getRecordTime(), "yyyy-MM-dd HH:mm:ss");
|
||||||
rLoadTypeUserManage.setRecordTime(date);
|
rLoadTypeUserManage.setRecordTime(date);
|
||||||
|
//获取部门信息
|
||||||
|
Dept data = deptFeignClient.getDeptById (loadTypeUserParam.getOrgNo()).getData();
|
||||||
|
rLoadTypeUserManage.setICheckPerson(data.getPid());
|
||||||
|
rLoadTypeUserManage.setACheckPerson(data.getPid());
|
||||||
loadTypeUserManageMapper.insert(rLoadTypeUserManage);
|
loadTypeUserManageMapper.insert(rLoadTypeUserManage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -140,25 +144,34 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean uploadLoadTypeUserI(LoadTypeUserIUploadParam loadTypeUserIUploadParam) {
|
public boolean uploadLoadTypeUserI(LoadTypeUserIUploadParam loadTypeUserIUploadParam) {
|
||||||
|
//todo 修改用户信息,当用户信息为待审核状态。该信息不可修改
|
||||||
|
Boolean aBoolean = checkStatus(loadTypeUserIUploadParam.getId(), 0);
|
||||||
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
||||||
BeanUtils.copyProperties(loadTypeUserIUploadParam, rLoadTypeUserManage);
|
BeanUtils.copyProperties(loadTypeUserIUploadParam, rLoadTypeUserManage);
|
||||||
MultipartFile multipartFile = loadTypeUserIUploadParam.getFile();
|
MultipartFile multipartFile = loadTypeUserIUploadParam.getFile();
|
||||||
//文件上传到Minio服务器,存入文件名
|
//文件上传到Minio服务器,存入文件名
|
||||||
if (Objects.nonNull(multipartFile)) {
|
if (Objects.nonNull(multipartFile)) {
|
||||||
rLoadTypeUserManage.setIFilePath(fileStorageUtil.uploadMultipart(multipartFile,OssPath.LOAD_TYPE_USER));
|
rLoadTypeUserManage.setIFilePath(fileStorageUtil.uploadMultipart(multipartFile,OssPath.LOAD_TYPE_USER));
|
||||||
|
rLoadTypeUserManage.setIFilePathName(multipartFile.getOriginalFilename());
|
||||||
rLoadTypeUserManage.setIUploadTime(new Date());
|
rLoadTypeUserManage.setIUploadTime(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
//提交:待审核/保存:新建
|
//提交:待审核/保存:新建
|
||||||
DictData dictData;
|
String dictData;
|
||||||
if (Objects.equals(Param.LOAD_TYPE_USER_SUBMIT, loadTypeUserIUploadParam.getStatus())) {
|
if (Objects.equals(Param.LOAD_TYPE_USER_SUBMIT, loadTypeUserIUploadParam.getStatus())) {
|
||||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDIT.getCode()).getData();
|
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDIT.getCode()).getData().getId();
|
||||||
|
rLoadTypeUserManage.setICheckPerson("");
|
||||||
|
rLoadTypeUserManage.setICheckComment("");
|
||||||
} else {
|
} else {
|
||||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.NEWLY.getCode()).getData();
|
//是否是未通过,未通过则不修改状态
|
||||||
|
if(aBoolean){
|
||||||
|
dictData=null;
|
||||||
|
}else{
|
||||||
|
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.NEWLY.getCode()).getData().getId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rLoadTypeUserManage.setIStatus(dictData.getId());
|
rLoadTypeUserManage.setIStatus(dictData);
|
||||||
rLoadTypeUserManage.setIIsFileUpload(1);
|
rLoadTypeUserManage.setIIsFileUpload(rLoadTypeUserManage.getIFilePath()!=null?1:0);
|
||||||
loadTypeUserManageMapper.updateById(rLoadTypeUserManage);
|
loadTypeUserManageMapper.updateById(rLoadTypeUserManage);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -209,7 +222,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传干扰源用户入网报告
|
* 上传干扰源用户实测报告
|
||||||
*
|
*
|
||||||
* @param loadTypeUserAUploadParam
|
* @param loadTypeUserAUploadParam
|
||||||
* @return
|
* @return
|
||||||
@@ -217,13 +230,15 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean uploadLoadTypeUserA(LoadTypeUserAUploadParam loadTypeUserAUploadParam) {
|
public boolean uploadLoadTypeUserA(LoadTypeUserAUploadParam loadTypeUserAUploadParam) {
|
||||||
|
//todo 修改用户信息,当用户信息为待审核状态。该信息不可修改
|
||||||
|
Boolean aBoolean = checkStatus(loadTypeUserAUploadParam.getId(), 1);
|
||||||
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
||||||
BeanUtils.copyProperties(loadTypeUserAUploadParam, rLoadTypeUserManage);
|
BeanUtils.copyProperties(loadTypeUserAUploadParam, rLoadTypeUserManage);
|
||||||
MultipartFile multipartFile = loadTypeUserAUploadParam.getFile();
|
MultipartFile multipartFile = loadTypeUserAUploadParam.getFile();
|
||||||
//文件上传到文件服务器,存入文件名
|
//文件上传到文件服务器,存入文件名
|
||||||
if (Objects.nonNull(multipartFile)) {
|
if (Objects.nonNull(multipartFile)) {
|
||||||
rLoadTypeUserManage.setAFilePath(fileStorageUtil.uploadMultipart(multipartFile,OssPath.LOAD_TYPE_USER));
|
rLoadTypeUserManage.setAFilePath(fileStorageUtil.uploadMultipart(multipartFile,OssPath.LOAD_TYPE_USER));
|
||||||
|
rLoadTypeUserManage.setAFilePathName(multipartFile.getOriginalFilename());
|
||||||
rLoadTypeUserManage.setAUploadTime(new Date());
|
rLoadTypeUserManage.setAUploadTime(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,11 +247,18 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
if (Objects.equals(Param.LOAD_TYPE_USER_SUBMIT, loadTypeUserAUploadParam.getStatus())) {
|
if (Objects.equals(Param.LOAD_TYPE_USER_SUBMIT, loadTypeUserAUploadParam.getStatus())) {
|
||||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDIT.getCode()).getData();
|
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDIT.getCode()).getData();
|
||||||
} else {
|
} else {
|
||||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.NEWLY.getCode()).getData();
|
//是否是未通过,未通过则不修改状态
|
||||||
|
if(aBoolean){
|
||||||
|
dictData=null;
|
||||||
|
}else{
|
||||||
|
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.NEWLY.getCode()).getData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rLoadTypeUserManage.setAStatus(dictData.getId());
|
if(!aBoolean){
|
||||||
|
rLoadTypeUserManage.setAStatus(dictData.getId());
|
||||||
|
}
|
||||||
|
rLoadTypeUserManage.setAIsFileUpload(rLoadTypeUserManage.getAFilePath()!=null?1:0);
|
||||||
loadTypeUserManageMapper.updateById(rLoadTypeUserManage);
|
loadTypeUserManageMapper.updateById(rLoadTypeUserManage);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,8 +379,8 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
updateWrapper.set("i_check_comment", loadTypeUserCheckParam.getCheckComment());
|
updateWrapper.set("i_check_comment", loadTypeUserCheckParam.getCheckComment());
|
||||||
updateWrapper.set("i_check_person", loadTypeUserCheckParam.getCheckPerson());
|
updateWrapper.set("i_check_person", loadTypeUserCheckParam.getCheckPerson());
|
||||||
|
|
||||||
DictData fail = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAIL.getCode()).getData();
|
DictData fail = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAILED.getCode()).getData();
|
||||||
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.SUCCESS.getCode()).getData();
|
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData();
|
||||||
|
|
||||||
updateWrapper.set("i_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? finish.getId() : fail.getId());
|
updateWrapper.set("i_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? finish.getId() : fail.getId());
|
||||||
int i = loadTypeUserManageMapper.update(null, updateWrapper);
|
int i = loadTypeUserManageMapper.update(null, updateWrapper);
|
||||||
@@ -383,12 +405,57 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
updateWrapper.set("a_check_comment", loadTypeUserCheckParam.getCheckComment());
|
updateWrapper.set("a_check_comment", loadTypeUserCheckParam.getCheckComment());
|
||||||
updateWrapper.set("a_check_person", loadTypeUserCheckParam.getCheckPerson());
|
updateWrapper.set("a_check_person", loadTypeUserCheckParam.getCheckPerson());
|
||||||
|
|
||||||
DictData fail = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAIL.getCode()).getData();
|
DictData fail = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAILED.getCode()).getData();
|
||||||
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.SUCCESS.getCode()).getData();
|
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData();
|
||||||
|
|
||||||
updateWrapper.set("a_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? finish.getId() : fail.getId());
|
updateWrapper.set("a_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? finish.getId() : fail.getId());
|
||||||
int i = loadTypeUserManageMapper.update(null, updateWrapper);
|
int i = loadTypeUserManageMapper.update(null, updateWrapper);
|
||||||
result = i == 1;
|
result = i == 1;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 干扰源用户报告状态,待审核无法修改信息
|
||||||
|
* @param id
|
||||||
|
* @param type
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2024/1/30 10:44
|
||||||
|
*/
|
||||||
|
private Boolean checkStatus(String id,Integer type){
|
||||||
|
Boolean fly=false;
|
||||||
|
RLoadTypeUserManage rLoadTypeUserManage = loadTypeUserManageMapper.selectById(id);
|
||||||
|
if(type==0){
|
||||||
|
//入网评估
|
||||||
|
DictData audit = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDIT.getCode()).getData();
|
||||||
|
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData();
|
||||||
|
String iStatus = rLoadTypeUserManage.getIStatus();
|
||||||
|
if(audit.getId().equals(iStatus)||finish.getId().equals(iStatus)){
|
||||||
|
throw new BusinessException(CommonResponseEnum.FAIL, "只有新建和未通过状态下,可修改信息");
|
||||||
|
}
|
||||||
|
DictData failed = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAILED.getCode()).getData();
|
||||||
|
if(failed.getId().equals(iStatus)){
|
||||||
|
fly=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type==1){
|
||||||
|
//实测评估
|
||||||
|
DictData audit = dicDataFeignClient.getDicDataByCode(DicDataEnum.AUDITT.getCode()).getData();
|
||||||
|
DictData success = dicDataFeignClient.getDicDataByCode(DicDataEnum.SUCCESS.getCode()).getData();
|
||||||
|
String aStatus = rLoadTypeUserManage.getAStatus();
|
||||||
|
if(audit.getId().equals(aStatus)||success.getId().equals(aStatus)){
|
||||||
|
throw new BusinessException(CommonResponseEnum.FAIL, "只有新建和未通过状态下,可修改信息");
|
||||||
|
}
|
||||||
|
DictData failed = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAIL.getCode()).getData();
|
||||||
|
if(failed.getId().equals(aStatus)){
|
||||||
|
fly=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fly;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
|||||||
throw new BusinessException(ProcessResponseEnum.TERMINAL_ID_REPEAT);
|
throw new BusinessException(ProcessResponseEnum.TERMINAL_ID_REPEAT);
|
||||||
}
|
}
|
||||||
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
||||||
detection.setOriginalName(detection.getId() + "-原始数据报告.docx");
|
detection.setOriginalName(StrUtil.isNotBlank(param.getOriginalReport())?detection.getId() + "-原始数据报告.docx":"");
|
||||||
detection.setOrgNo(data.getCode());
|
detection.setOrgNo(data.getCode());
|
||||||
detection.setOrgName(data.getName());
|
detection.setOrgName(data.getName());
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.pms.api.StatationStatClient;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||||
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
@@ -29,7 +31,6 @@ import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
|||||||
import com.njcn.process.pojo.vo.*;
|
import com.njcn.process.pojo.vo.*;
|
||||||
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
|
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
|
||||||
import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
||||||
import com.njcn.process.service.StatationStatService;
|
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
@@ -37,16 +38,15 @@ import com.njcn.user.api.DeptFeignClient;
|
|||||||
import com.njcn.user.pojo.po.Dept;
|
import com.njcn.user.pojo.po.Dept;
|
||||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -63,33 +63,18 @@ import java.util.stream.Stream;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurveyPlanPOMapper, RGeneralSurveyPlanPO> implements RGeneralSurveyPlanPOService {
|
public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurveyPlanPOMapper, RGeneralSurveyPlanPO> implements RGeneralSurveyPlanPOService {
|
||||||
|
|
||||||
@Autowired
|
private final RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService;
|
||||||
private RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService;
|
private final RGeneralSurveyPlanPOMapper rGeneralSurveyPlanPOMapper;
|
||||||
|
private final RGeneralSurveyPlanDetailMapper rGeneralSurveyPlanDetailMapper;
|
||||||
@Resource
|
private final DeptFeignClient deptFeignClient;
|
||||||
private RGeneralSurveyPlanPOMapper rGeneralSurveyPlanPOMapper;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final StatationStatClient statationStatClient;
|
||||||
@Resource
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
private RGeneralSurveyPlanDetailMapper rGeneralSurveyPlanDetailMapper;
|
private final RSurveyCycleMapper rSurveyCycleMapper;
|
||||||
|
private final RSurveyPlanConfigService rSurveyPlanConfigService;
|
||||||
@Autowired
|
|
||||||
private DeptFeignClient deptFeignClient;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private FileStorageUtil fileStorageUtil;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StatationStatService statationStatService;
|
|
||||||
@Autowired
|
|
||||||
private DicDataFeignClient dicDataFeignClient;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RSurveyCycleMapper rSurveyCycleMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RSurveyPlanConfigService rSurveyPlanConfigService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,45 +89,57 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm) {
|
public Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm) {
|
||||||
|
|
||||||
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO ( );
|
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO();
|
||||||
BeanUtils.copyProperties (rGeneralSurveyPlanAddParm, rGeneralSurveyPlanPO);
|
BeanUtils.copyProperties(rGeneralSurveyPlanAddParm, rGeneralSurveyPlanPO);
|
||||||
/*todo 后期与工作流绑定*/
|
|
||||||
rGeneralSurveyPlanPO.setStatus (1);
|
|
||||||
/**查出周期id**/
|
/**查出周期id**/
|
||||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||||
rSurveyCyclePOQueryWrapper.le ("start_year", rGeneralSurveyPlanPO.getPlanEndTime ( ));
|
rSurveyCyclePOQueryWrapper.le("start_year", rGeneralSurveyPlanPO.getPlanEndTime());
|
||||||
rSurveyCyclePOQueryWrapper.ge ("end_year", rGeneralSurveyPlanPO.getPlanEndTime ( ));
|
rSurveyCyclePOQueryWrapper.ge("end_year", rGeneralSurveyPlanPO.getPlanEndTime());
|
||||||
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne (rSurveyCyclePOQueryWrapper);
|
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne(rSurveyCyclePOQueryWrapper);
|
||||||
|
|
||||||
rGeneralSurveyPlanPO.setCycleId (rSurveyCyclePO.getId ( ));
|
rGeneralSurveyPlanPO.setCycleId(rSurveyCyclePO.getId());
|
||||||
String deptIndex = RequestUtil.getDeptIndex ( );
|
String deptIndex = RequestUtil.getDeptIndex();
|
||||||
Dept data = deptFeignClient.getDeptById (deptIndex).getData ( );
|
Dept data = deptFeignClient.getDeptById(deptIndex).getData();
|
||||||
rGeneralSurveyPlanPO.setCheckPerson (data.getPid ());
|
rGeneralSurveyPlanPO.setCheckPerson(data.getPid());
|
||||||
rGeneralSurveyPlanPO.setCreatePerson (RequestUtil.getUserIndex ());
|
rGeneralSurveyPlanPO.setCreatePerson(RequestUtil.getUserIndex());
|
||||||
boolean b = this.saveOrUpdateByMultiId (rGeneralSurveyPlanPO);
|
int count = this.count(new LambdaQueryWrapper<RGeneralSurveyPlanPO>()
|
||||||
|
.eq(RGeneralSurveyPlanPO::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo())
|
||||||
|
);
|
||||||
|
boolean b;
|
||||||
|
if (count > 0) {
|
||||||
|
b = this.updateByMultiId(rGeneralSurveyPlanPO);
|
||||||
|
} else {
|
||||||
|
/*todo 后期与工作流绑定*/
|
||||||
|
rGeneralSurveyPlanPO.setStatus(0);
|
||||||
|
b = this.save(rGeneralSurveyPlanPO);
|
||||||
|
}
|
||||||
|
|
||||||
QueryWrapper<RGeneralSurveyPlanDetail> queryWrapper = new QueryWrapper ( );
|
QueryWrapper<RGeneralSurveyPlanDetail> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.lambda ( ).eq (RGeneralSurveyPlanDetail::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo ( ));
|
queryWrapper.lambda().eq(RGeneralSurveyPlanDetail::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo());
|
||||||
rGeneralSurveyPlanDetailService.remove (queryWrapper);
|
rGeneralSurveyPlanDetailService.remove(queryWrapper);
|
||||||
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailList = new ArrayList<> ( );
|
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailList = new ArrayList<>();
|
||||||
rGeneralSurveyPlanAddParm.getSubIds ( ).forEach (temp -> {
|
|
||||||
StatationStat byId = statationStatService.getById (temp);
|
PmsStatationStatInfoParam param =new PmsStatationStatInfoParam();
|
||||||
RGeneralSurveyPlanDetail rGeneralSurveyPlanDetail = new RGeneralSurveyPlanDetail ( );
|
param.setPowerIds(rGeneralSurveyPlanAddParm.getSubIds());
|
||||||
rGeneralSurveyPlanDetail.setPlanNo (rGeneralSurveyPlanAddParm.getPlanNo ( ));
|
List<StatationStat> stationList = statationStatClient.getPowerInfo(param).getData();
|
||||||
rGeneralSurveyPlanDetail.setOrgNo (byId.getOrgId ( ));
|
for (StatationStat stat : stationList) {
|
||||||
rGeneralSurveyPlanDetail.setOrgName (byId.getOrgName ( ));
|
RGeneralSurveyPlanDetail rGeneralSurveyPlanDetail = new RGeneralSurveyPlanDetail();
|
||||||
rGeneralSurveyPlanDetail.setSubId (byId.getPowerId ( ));
|
rGeneralSurveyPlanDetail.setPlanNo(rGeneralSurveyPlanAddParm.getPlanNo());
|
||||||
rGeneralSurveyPlanDetail.setSubName (byId.getPowerName ( ));
|
rGeneralSurveyPlanDetail.setOrgNo(stat.getOrgId());
|
||||||
|
rGeneralSurveyPlanDetail.setOrgName(stat.getOrgName());
|
||||||
|
rGeneralSurveyPlanDetail.setSubId(stat.getPowerId());
|
||||||
|
rGeneralSurveyPlanDetail.setSubName(stat.getPowerName());
|
||||||
/*目前时间与计划开始时间,结束时间一致*/
|
/*目前时间与计划开始时间,结束时间一致*/
|
||||||
rGeneralSurveyPlanDetail.setGeneralSurveyStartTime (rGeneralSurveyPlanAddParm.getPlanStartTime ( ));
|
rGeneralSurveyPlanDetail.setGeneralSurveyStartTime(rGeneralSurveyPlanAddParm.getPlanStartTime());
|
||||||
rGeneralSurveyPlanDetail.setGeneralSurveyTime (rGeneralSurveyPlanAddParm.getPlanStartTime ( ));
|
rGeneralSurveyPlanDetail.setGeneralSurveyTime(rGeneralSurveyPlanAddParm.getPlanStartTime());
|
||||||
rGeneralSurveyPlanDetail.setGeneralSurveyEndTime (rGeneralSurveyPlanAddParm.getPlanEndTime ( ));
|
rGeneralSurveyPlanDetail.setGeneralSurveyEndTime(rGeneralSurveyPlanAddParm.getPlanEndTime());
|
||||||
rGeneralSurveyPlanDetail.setPlanNo (rGeneralSurveyPlanAddParm.getPlanNo ( ));
|
rGeneralSurveyPlanDetail.setPlanNo(rGeneralSurveyPlanAddParm.getPlanNo());
|
||||||
rGeneralSurveyPlanDetail.setGeneralSurveyLeader (rGeneralSurveyPlanAddParm.getLeader ( ));
|
rGeneralSurveyPlanDetail.setGeneralSurveyLeader(rGeneralSurveyPlanAddParm.getLeader());
|
||||||
rGeneralSurveyPlanDetailList.add (rGeneralSurveyPlanDetail);
|
rGeneralSurveyPlanDetail.setVoltageLevel(stat.getVoltageLevel());
|
||||||
});
|
rGeneralSurveyPlanDetailList.add(rGeneralSurveyPlanDetail);
|
||||||
boolean b1 = rGeneralSurveyPlanDetailService.saveOrUpdateBatchByMultiId (rGeneralSurveyPlanDetailList, 500);
|
}
|
||||||
|
boolean b1 = rGeneralSurveyPlanDetailService.saveOrUpdateBatchByMultiId(rGeneralSurveyPlanDetailList, 500);
|
||||||
return b && b1;
|
return b && b1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,64 +152,64 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
* @Date: 2022/11/15
|
* @Date: 2022/11/15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList,String type) {
|
public IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList, String type) {
|
||||||
IPage<RGeneralSurveyPlanPO> page = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( ));
|
IPage<RGeneralSurveyPlanPO> page = new Page<>(rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize());
|
||||||
IPage<RGeneralSurveyPlanVO> returnpage = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( ));
|
IPage<RGeneralSurveyPlanVO> returnpage = new Page<>(rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize());
|
||||||
|
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
/*type=1:新建页面:查看自己负责的计划;type=2:审核页面:审核者==当前用户;结果页面:查看自己负责的计划*/
|
/*type=1:新建页面:查看自己负责的计划;type=2:审核页面:审核者==当前用户;结果页面:查看自己负责的计划*/
|
||||||
if(type=="1"||type=="3"){
|
if (type == "1" || type == "3") {
|
||||||
queryWrapper.eq (RGeneralSurveyPlanPO::getCreatePerson,RequestUtil.getUserIndex ());
|
queryWrapper.eq(RGeneralSurveyPlanPO::getCreatePerson, RequestUtil.getUserIndex());
|
||||||
}
|
}
|
||||||
if(type=="2"){
|
if (type == "2") {
|
||||||
queryWrapper.eq (RGeneralSurveyPlanPO::getCheckPerson,RequestUtil.getDeptIndex ());
|
queryWrapper.eq(RGeneralSurveyPlanPO::getCheckPerson, RequestUtil.getDeptIndex());
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getOrgNo ( ))) {
|
if (!StringUtils.isEmpty(rGeneralSurveyPlanQueryParm.getOrgNo())) {
|
||||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId (rGeneralSurveyPlanQueryParm.getOrgNo ( )).getData ( );
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(rGeneralSurveyPlanQueryParm.getOrgNo()).getData();
|
||||||
|
|
||||||
queryWrapper.in (RGeneralSurveyPlanPO::getOrgNo, data);
|
queryWrapper.in(RGeneralSurveyPlanPO::getOrgNo, data);
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getStatus ( ))) {
|
if (!StringUtils.isEmpty(rGeneralSurveyPlanQueryParm.getStatus())) {
|
||||||
queryWrapper.eq (RGeneralSurveyPlanPO::getStatus, rGeneralSurveyPlanQueryParm.getStatus ( ));
|
queryWrapper.eq(RGeneralSurveyPlanPO::getStatus, rGeneralSurveyPlanQueryParm.getStatus());
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getIsFileUpload ( ))) {
|
if (!StringUtils.isEmpty(rGeneralSurveyPlanQueryParm.getIsFileUpload())) {
|
||||||
queryWrapper.eq (RGeneralSurveyPlanPO::getIsFileUpload, rGeneralSurveyPlanQueryParm.getIsFileUpload ( ));
|
queryWrapper.eq(RGeneralSurveyPlanPO::getIsFileUpload, rGeneralSurveyPlanQueryParm.getIsFileUpload());
|
||||||
}
|
}
|
||||||
if (!Objects.isNull (rGeneralSurveyPlanQueryParm.getPlanStartTime ( ))) {
|
if (!Objects.isNull(rGeneralSurveyPlanQueryParm.getPlanStartTime())) {
|
||||||
queryWrapper.ge (RGeneralSurveyPlanPO::getPlanStartTime, rGeneralSurveyPlanQueryParm.getPlanStartTime ( ));
|
queryWrapper.ge(RGeneralSurveyPlanPO::getPlanStartTime, rGeneralSurveyPlanQueryParm.getPlanStartTime());
|
||||||
}
|
}
|
||||||
if (!Objects.isNull (rGeneralSurveyPlanQueryParm.getPlanEndTime ( ))) {
|
if (!Objects.isNull(rGeneralSurveyPlanQueryParm.getPlanEndTime())) {
|
||||||
queryWrapper.le (RGeneralSurveyPlanPO::getPlanStartTime, rGeneralSurveyPlanQueryParm.getPlanEndTime ( ));
|
queryWrapper.le(RGeneralSurveyPlanPO::getPlanStartTime, rGeneralSurveyPlanQueryParm.getPlanEndTime());
|
||||||
}
|
}
|
||||||
queryWrapper.in (RGeneralSurveyPlanPO::getStatus, statusList);
|
queryWrapper.in(RGeneralSurveyPlanPO::getStatus, statusList);
|
||||||
queryWrapper.orderByAsc (RGeneralSurveyPlanPO::getStatus).orderByDesc (RGeneralSurveyPlanPO::getPlanCreateTime);
|
queryWrapper.orderByAsc(RGeneralSurveyPlanPO::getStatus).orderByDesc(RGeneralSurveyPlanPO::getPlanCreateTime);
|
||||||
|
|
||||||
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectPage (page, queryWrapper).getRecords ( );
|
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectPage(page, queryWrapper).getRecords();
|
||||||
if (CollectionUtils.isEmpty (rGeneralSurveyPlanPOS)) {
|
if (CollectionUtils.isEmpty(rGeneralSurveyPlanPOS)) {
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
//部门处理:根据部门code取名称
|
//部门处理:根据部门code取名称
|
||||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList ( ).getData ( );
|
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||||
Map<String, String> pvTerminalTreeVOMap = dept.stream ( ).
|
Map<String, String> pvTerminalTreeVOMap = dept.stream().
|
||||||
collect (Collectors.
|
collect(Collectors.
|
||||||
toMap (PvTerminalTreeVO::getId,
|
toMap(PvTerminalTreeVO::getId,
|
||||||
PvTerminalTreeVO::getName));
|
PvTerminalTreeVO::getName));
|
||||||
|
|
||||||
|
|
||||||
List<String> collect = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( ));
|
List<String> collect = rGeneralSurveyPlanPOS.stream().map(RGeneralSurveyPlanPO::getPlanNo).collect(Collectors.toList());
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, collect);
|
lambdaQueryWrapper.in(RGeneralSurveyPlanDetail::getPlanNo, collect);
|
||||||
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (lambdaQueryWrapper);
|
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList(lambdaQueryWrapper);
|
||||||
List<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOList = new ArrayList<> ( );
|
List<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOList = new ArrayList<>();
|
||||||
rGeneralSurveyPlanPOS.forEach (temp -> {
|
rGeneralSurveyPlanPOS.forEach(temp -> {
|
||||||
RGeneralSurveyPlanVO rGeneralSurveyPlanVO = new RGeneralSurveyPlanVO ( );
|
RGeneralSurveyPlanVO rGeneralSurveyPlanVO = new RGeneralSurveyPlanVO();
|
||||||
BeanUtils.copyProperties (temp, rGeneralSurveyPlanVO);
|
BeanUtils.copyProperties(temp, rGeneralSurveyPlanVO);
|
||||||
List<String> collect1 = rGeneralSurveyPlanDetails.stream ( ).
|
List<String> collect1 = rGeneralSurveyPlanDetails.stream().
|
||||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
filter(surveyPlanDetail -> Objects.equals(surveyPlanDetail.getPlanNo(), temp.getPlanNo())).
|
||||||
map (RGeneralSurveyPlanDetail::getSubId).collect (Collectors.toList ( ));
|
map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList());
|
||||||
rGeneralSurveyPlanVO.setSubCount (collect1.size ( ));
|
rGeneralSurveyPlanVO.setSubCount(collect1.size());
|
||||||
rGeneralSurveyPlanVO.setSubIds (collect1);
|
rGeneralSurveyPlanVO.setSubIds(collect1);
|
||||||
/*
|
/*
|
||||||
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
||||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
||||||
@@ -225,13 +222,13 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
// BeanUtils.copyProperties (surveyPlanDetail, rGeneralSurveyPlanDetailVO);
|
// BeanUtils.copyProperties (surveyPlanDetail, rGeneralSurveyPlanDetailVO);
|
||||||
// return rGeneralSurveyPlanDetailVO;
|
// return rGeneralSurveyPlanDetailVO;
|
||||||
// }).collect (Collectors.toList ( ));
|
// }).collect (Collectors.toList ( ));
|
||||||
rGeneralSurveyPlanVO.setOrgName (pvTerminalTreeVOMap.get (temp.getOrgNo ( ))); //单位名称
|
rGeneralSurveyPlanVO.setOrgName(pvTerminalTreeVOMap.get(temp.getOrgNo())); //单位名称
|
||||||
//
|
//
|
||||||
// rGeneralSurveyPlanVO.setRGeneralSurveyPlanDetailVOList (collect1);
|
// rGeneralSurveyPlanVO.setRGeneralSurveyPlanDetailVOList (collect1);
|
||||||
|
|
||||||
rGeneralSurveyPlanVOList.add (rGeneralSurveyPlanVO);
|
rGeneralSurveyPlanVOList.add(rGeneralSurveyPlanVO);
|
||||||
});
|
});
|
||||||
returnpage.setRecords (rGeneralSurveyPlanVOList);
|
returnpage.setRecords(rGeneralSurveyPlanVOList);
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,26 +244,26 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam) {
|
public boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam) {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO ( );
|
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO();
|
||||||
rGeneralSurveyPlanPO.setPlanNo (surveyResultUploadParam.getPlanId ( ));
|
rGeneralSurveyPlanPO.setPlanNo(surveyResultUploadParam.getPlanId());
|
||||||
rGeneralSurveyPlanPO = this.selectByMultiId (rGeneralSurveyPlanPO);
|
rGeneralSurveyPlanPO = this.selectByMultiId(rGeneralSurveyPlanPO);
|
||||||
String filePath = rGeneralSurveyPlanPO.getFilePath ( );
|
String filePath = rGeneralSurveyPlanPO.getFilePath();
|
||||||
filePath = Optional.ofNullable (filePath).orElse ("");
|
filePath = Optional.ofNullable(filePath).orElse("");
|
||||||
Integer fileCount = rGeneralSurveyPlanPO.getFileCount ( );
|
Integer fileCount = rGeneralSurveyPlanPO.getFileCount();
|
||||||
fileCount = Optional.ofNullable (fileCount).orElse (0);
|
fileCount = Optional.ofNullable(fileCount).orElse(0);
|
||||||
for (int i = 0; i < surveyResultUploadParam.getFile ( ).length; i++) {
|
for (int i = 0; i < surveyResultUploadParam.getFile().length; i++) {
|
||||||
String OriginalFilename = surveyResultUploadParam.getFile ( )[i].getOriginalFilename ( );
|
String OriginalFilename = surveyResultUploadParam.getFile()[i].getOriginalFilename();
|
||||||
String fileStoragePath = fileStorageUtil.uploadMultipart (surveyResultUploadParam.getFile ( )[i], OssPath.SURVEY_RESULT);
|
String fileStoragePath = fileStorageUtil.uploadMultipart(surveyResultUploadParam.getFile()[i], OssPath.SURVEY_RESULT);
|
||||||
/*filePath格式:minIo服务文件名+##+原始文件名+;*/
|
/*filePath格式:minIo服务文件名+##+原始文件名+;*/
|
||||||
filePath = filePath + fileStoragePath + "##" + OriginalFilename + ";";
|
filePath = filePath + fileStoragePath + "##" + OriginalFilename + ";";
|
||||||
fileCount++;
|
fileCount++;
|
||||||
}
|
}
|
||||||
rGeneralSurveyPlanPO.setStatus (4);
|
rGeneralSurveyPlanPO.setStatus(4);
|
||||||
rGeneralSurveyPlanPO.setFileCount (fileCount);
|
rGeneralSurveyPlanPO.setFileCount(fileCount);
|
||||||
rGeneralSurveyPlanPO.setFilePath (filePath);
|
rGeneralSurveyPlanPO.setFilePath(filePath);
|
||||||
rGeneralSurveyPlanPO.setIsFileUpload (1);
|
rGeneralSurveyPlanPO.setIsFileUpload(1);
|
||||||
rGeneralSurveyPlanPO.setUploadTime (new Date ( ));
|
rGeneralSurveyPlanPO.setUploadTime(new Date());
|
||||||
this.saveOrUpdateByMultiId (rGeneralSurveyPlanPO);
|
this.saveOrUpdateByMultiId(rGeneralSurveyPlanPO);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,21 +277,21 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MinIoUploadResDTO> surveyResultDownload(String planNo) {
|
public List<MinIoUploadResDTO> surveyResultDownload(String planNo) {
|
||||||
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO ( );
|
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO();
|
||||||
rGeneralSurveyPlanPO.setPlanNo (planNo);
|
rGeneralSurveyPlanPO.setPlanNo(planNo);
|
||||||
rGeneralSurveyPlanPO = this.selectByMultiId (rGeneralSurveyPlanPO);
|
rGeneralSurveyPlanPO = this.selectByMultiId(rGeneralSurveyPlanPO);
|
||||||
String filePath = rGeneralSurveyPlanPO.getFilePath ( );
|
String filePath = rGeneralSurveyPlanPO.getFilePath();
|
||||||
if (StringUtils.isEmpty (filePath)) {
|
if (StringUtils.isEmpty(filePath)) {
|
||||||
throw new BusinessException (OssResponseEnum.DOWNLOAD_FILE_ERROR);
|
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_ERROR);
|
||||||
}
|
}
|
||||||
String[] split = filePath.substring (0, filePath.length ( ) - 1).split (";");
|
String[] split = filePath.substring(0, filePath.length() - 1).split(";");
|
||||||
List<MinIoUploadResDTO> collect = Stream.of (split).map (temp -> {
|
List<MinIoUploadResDTO> collect = Stream.of(split).map(temp -> {
|
||||||
String[] split1 = temp.split ("##");
|
String[] split1 = temp.split("##");
|
||||||
String OriginalFilename = split1[1];
|
String OriginalFilename = split1[1];
|
||||||
String minoFileName = split1[0];
|
String minoFileName = split1[0];
|
||||||
MinIoUploadResDTO dto = new MinIoUploadResDTO (OriginalFilename, fileStorageUtil.getFileUrl (minoFileName));
|
MinIoUploadResDTO dto = new MinIoUploadResDTO(OriginalFilename, fileStorageUtil.getFileUrl(minoFileName));
|
||||||
return dto;
|
return dto;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect(Collectors.toList());
|
||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,36 +304,36 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SurveyPlanExcel> exportSurveyPlan(List<String> planIdList) {
|
public List<SurveyPlanExcel> exportSurveyPlan(List<String> planIdList) {
|
||||||
List<SurveyPlanExcel> surveyPlanExcels = new ArrayList<> ( );
|
List<SurveyPlanExcel> surveyPlanExcels = new ArrayList<>();
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in (RGeneralSurveyPlanPO::getPlanNo, planIdList);
|
queryWrapper.in(RGeneralSurveyPlanPO::getPlanNo, planIdList);
|
||||||
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper);
|
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList(queryWrapper);
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, planIdList);
|
lambdaQueryWrapper.in(RGeneralSurveyPlanDetail::getPlanNo, planIdList);
|
||||||
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (lambdaQueryWrapper);
|
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList(lambdaQueryWrapper);
|
||||||
|
|
||||||
//部门处理:根据部门code取名称
|
//部门处理:根据部门code取名称
|
||||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList ( ).getData ( );
|
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||||
Map<String, String> pvTerminalTreeVOMap = dept.stream ( ).
|
Map<String, String> pvTerminalTreeVOMap = dept.stream().
|
||||||
collect (Collectors.
|
collect(Collectors.
|
||||||
toMap (PvTerminalTreeVO::getId,
|
toMap(PvTerminalTreeVO::getId,
|
||||||
PvTerminalTreeVO::getName));
|
PvTerminalTreeVO::getName));
|
||||||
rGeneralSurveyPlanPOS.forEach (temp -> {
|
rGeneralSurveyPlanPOS.forEach(temp -> {
|
||||||
SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel ( );
|
SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel();
|
||||||
BeanUtils.copyProperties (temp, surveyPlanExcel);
|
BeanUtils.copyProperties(temp, surveyPlanExcel);
|
||||||
|
|
||||||
// long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
|
// long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
|
||||||
// filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
// filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
||||||
// map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
|
// map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
|
||||||
|
|
||||||
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
long Subcount = rGeneralSurveyPlanDetails.stream().
|
||||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
filter(surveyPlanDetail -> Objects.equals(surveyPlanDetail.getPlanNo(), temp.getPlanNo())).
|
||||||
map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( );
|
map(RGeneralSurveyPlanDetail::getSubId).distinct().count();
|
||||||
// surveyPlanExcel.setBusCount (Busbarcount);
|
// surveyPlanExcel.setBusCount (Busbarcount);
|
||||||
surveyPlanExcel.setSubCount (Subcount);
|
surveyPlanExcel.setSubCount(Subcount);
|
||||||
surveyPlanExcel.setOrgNo (pvTerminalTreeVOMap.get (surveyPlanExcel.getOrgNo ( )));
|
surveyPlanExcel.setOrgNo(pvTerminalTreeVOMap.get(surveyPlanExcel.getOrgNo()));
|
||||||
surveyPlanExcel.setStatus (getPlanStatus(temp.getStatus ()));
|
surveyPlanExcel.setStatus(getPlanStatus(temp.getStatus()));
|
||||||
surveyPlanExcels.add (surveyPlanExcel);
|
surveyPlanExcels.add(surveyPlanExcel);
|
||||||
});
|
});
|
||||||
|
|
||||||
return surveyPlanExcels;
|
return surveyPlanExcels;
|
||||||
@@ -365,6 +362,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param questionQueryParm
|
* @param questionQueryParm
|
||||||
* @Description: querySurveyPlanOnQuestion
|
* @Description: querySurveyPlanOnQuestion
|
||||||
@@ -375,10 +373,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm) {
|
public List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm) {
|
||||||
List<RGeneralSurveyPlanDetailOnQuestionVO> rGeneralSurveyPlanDetailOnQuestionVOS = new ArrayList<> ( );
|
return rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion(questionQueryParm);
|
||||||
rGeneralSurveyPlanDetailOnQuestionVOS = rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion (questionQueryParm);
|
|
||||||
|
|
||||||
return rGeneralSurveyPlanDetailOnQuestionVOS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -392,14 +387,14 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
@Override
|
@Override
|
||||||
public List<RGeneralSurveyPlanPO> querySurveyPlanName(SurveyPlanQuestionQueryParm questionQueryParm) {
|
public List<RGeneralSurveyPlanPO> querySurveyPlanName(SurveyPlanQuestionQueryParm questionQueryParm) {
|
||||||
|
|
||||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId (questionQueryParm.getOrgNo ( )).getData ( );
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(questionQueryParm.getOrgNo()).getData();
|
||||||
|
|
||||||
QueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new QueryWrapper<> ( );
|
QueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.select ("plan_name").
|
queryWrapper.select("plan_name").
|
||||||
in ("org_no", data).
|
in("org_no", data).
|
||||||
eq ("DATE_FORMAT(upload_time, '%Y-%m')", new SimpleDateFormat ("yyyy-MM").
|
eq("DATE_FORMAT(upload_time, '%Y-%m')", new SimpleDateFormat("yyyy-MM").
|
||||||
format (questionQueryParm.getPlanStartTime ( )));
|
format(questionQueryParm.getPlanStartTime()));
|
||||||
List<RGeneralSurveyPlanPO> list = this.list (queryWrapper);
|
List<RGeneralSurveyPlanPO> list = this.list(queryWrapper);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -416,143 +411,83 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean checkPlanAudit(RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm) {
|
public Boolean checkPlanAudit(RGeneralSurveyPlanChcekParm rGeneralSurveyPlanChcekParm) {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
UpdateWrapper<RGeneralSurveyPlanPO> updateWrapper = new UpdateWrapper ( );
|
UpdateWrapper<RGeneralSurveyPlanPO> updateWrapper = new UpdateWrapper();
|
||||||
updateWrapper.eq ("plan_no", rGeneralSurveyPlanChcekParm.getPlanNo ( ));
|
updateWrapper.eq("plan_no", rGeneralSurveyPlanChcekParm.getPlanNo());
|
||||||
updateWrapper.set ("check_comment", rGeneralSurveyPlanChcekParm.getCheckComment ( ));
|
updateWrapper.set("check_comment", rGeneralSurveyPlanChcekParm.getCheckComment());
|
||||||
// updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( ));
|
// updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( ));
|
||||||
updateWrapper.set ("status", Objects.equals ("1", rGeneralSurveyPlanChcekParm.getCheckResult ( )) ? 3 : 2);
|
updateWrapper.set("status", Objects.equals("1", rGeneralSurveyPlanChcekParm.getCheckResult()) ? 3 : 2);
|
||||||
result = this.update (updateWrapper);
|
result = this.update(updateWrapper);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void importSubStatation(MultipartFile file, HttpServletResponse response) {
|
|
||||||
ImportParams params = new ImportParams ( );
|
|
||||||
params.setHeadRows (1);
|
|
||||||
params.setTitleRows (0);
|
|
||||||
//params.setNeedVerify(true);
|
|
||||||
//第一个sheet为台账信息
|
|
||||||
params.setStartSheetIndex (0);
|
|
||||||
params.setSheetNum (1);
|
|
||||||
try {
|
|
||||||
ExcelImportResult<StatationStatExcel> terminalBaseList = ExcelImportUtil.importExcelMore (file.getInputStream ( ), StatationStatExcel.class, params);
|
|
||||||
//如果存在非法数据,将不合格的数据导出
|
|
||||||
|
|
||||||
/*规则1:StatationStat的orgName要在原系统存在2:电压等级不对*/
|
|
||||||
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList ( ).getData ( );
|
|
||||||
Map<String, PvTerminalTreeVO> pvTerminalTreeVOMap = data.stream ( ).collect (Collectors.toMap (PvTerminalTreeVO::getName, pvTerminalTreeVO -> pvTerminalTreeVO));
|
|
||||||
//获取电压等级的字典
|
|
||||||
List<DictData> voltageLevelList = dicDataFeignClient.getDicDataByTypeCode (DicDataTypeEnum.DEV_VOLTAGE.getCode ( )).getData ( );
|
|
||||||
//将电压信息转成map,key:id value:name
|
|
||||||
Map<String, DictData> voltageLevelMap = voltageLevelList.stream ( ).collect (Collectors.toMap (DictData::getName, voltageLevel -> voltageLevel));
|
|
||||||
List<StatationStatExcel> trueCollect = new ArrayList<> ( );
|
|
||||||
List<StatationStatExcel> falseCollect = new ArrayList<> ( );
|
|
||||||
for (int i = 0; i < terminalBaseList.getList ( ).size ( ); i++) {
|
|
||||||
StatationStatExcel statationStatExcel = terminalBaseList.getList ( ).get (i);
|
|
||||||
if (pvTerminalTreeVOMap.containsKey (statationStatExcel.getOrgName ( ))) {
|
|
||||||
statationStatExcel.setOrgId (pvTerminalTreeVOMap.get (statationStatExcel.getOrgName ( )).getId ( ));
|
|
||||||
} else {
|
|
||||||
statationStatExcel.setExceptionMessage ("系统中不存在此电站的部门");
|
|
||||||
falseCollect.add (statationStatExcel);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (voltageLevelMap.containsKey (statationStatExcel.getVoltageLevel ( ))) {
|
|
||||||
statationStatExcel.setVoltageLevel (voltageLevelMap.get (statationStatExcel.getVoltageLevel ( )).getId ( ));
|
|
||||||
} else {
|
|
||||||
statationStatExcel.setExceptionMessage ("系统中不存在此电站的电压等级");
|
|
||||||
falseCollect.add (statationStatExcel);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
trueCollect.add (statationStatExcel);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty (trueCollect)) {
|
|
||||||
List<StatationStat> collect = trueCollect.stream ( ).map (temp -> {
|
|
||||||
StatationStat statationStat = new StatationStat ( );
|
|
||||||
BeanUtils.copyProperties (temp, statationStat);
|
|
||||||
return statationStat;
|
|
||||||
}).collect (Collectors.toList ( ));
|
|
||||||
statationStatService.saveOrUpdateBatch (collect, 500);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty (falseCollect)) {
|
|
||||||
ExportParams exportExcel = new ExportParams ("批量导入模板(请严格按照模板标准填入数据)", "非法电站信息");
|
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel (exportExcel, StatationStatExcel.class, falseCollect);
|
|
||||||
PoiUtil.exportFileByWorkbook (workbook, "非法台账信息.xlsx", response);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace ( );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RGeneralSurveyPlanAddParm querySubStatation(Integer statetionNum) {
|
public RGeneralSurveyPlanAddParm querySubStatation(Integer statetionNum) {
|
||||||
/*查询所有电站并过滤已经参加当期普测电站*/
|
/*查询所有电站并过滤已经参加当期普测电站*/
|
||||||
List<StatationStat> list = statationStatService.list ( );
|
List<StatationStat> list = statationStatClient.getPowerInfo(new PmsStatationStatInfoParam()).getData();
|
||||||
|
|
||||||
/**查出当前周期id**/
|
/**查出当前周期id**/
|
||||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||||
rSurveyCyclePOQueryWrapper.le ("start_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.le("start_year", LocalDate.now());
|
||||||
rSurveyCyclePOQueryWrapper.ge ("end_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.ge("end_year", LocalDate.now());
|
||||||
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne (rSurveyCyclePOQueryWrapper);
|
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne(rSurveyCyclePOQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq (RGeneralSurveyPlanPO::getCycleId, rSurveyCyclePO.getId ( ));
|
queryWrapper.eq(RGeneralSurveyPlanPO::getCycleId, rSurveyCyclePO.getId());
|
||||||
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper);
|
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList(queryWrapper);
|
||||||
List<String> planIds = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( ));
|
List<String> planIds = rGeneralSurveyPlanPOS.stream().map(RGeneralSurveyPlanPO::getPlanNo).collect(Collectors.toList());
|
||||||
List<String> subIds = new ArrayList<> ( );
|
List<String> subIds = new ArrayList<>();
|
||||||
if (!CollectionUtils.isEmpty (planIds)) {
|
if (!CollectionUtils.isEmpty(planIds)) {
|
||||||
QueryWrapper<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailQueryWrapper = new QueryWrapper();
|
||||||
rGeneralSurveyPlanDetailQueryWrapper.in ("plan_no", planIds);
|
rGeneralSurveyPlanDetailQueryWrapper.in("plan_no", planIds);
|
||||||
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (rGeneralSurveyPlanDetailQueryWrapper);
|
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList(rGeneralSurveyPlanDetailQueryWrapper);
|
||||||
subIds = rGeneralSurveyPlanDetails.stream ( ).map (RGeneralSurveyPlanDetail::getSubId).collect (Collectors.toList ( ));
|
subIds = rGeneralSurveyPlanDetails.stream().map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<String> finalSubIds = subIds;
|
List<String> finalSubIds = subIds;
|
||||||
List<StatationStat> filterList = list.stream ( ).filter (temp -> !finalSubIds.contains (temp.getPowerId ( ))).collect (Collectors.toList ( ));
|
List<StatationStat> filterList = list.stream().filter(temp -> !finalSubIds.contains(temp.getPowerId())).collect(Collectors.toList());
|
||||||
List<StatationStat> addList = new ArrayList<> ( );
|
List<StatationStat> addList = new ArrayList<>();
|
||||||
|
|
||||||
List<RSurveyPlanConfigPO> rSurveyPlanConfigPOList = rSurveyPlanConfigService.list ( );
|
List<RSurveyPlanConfigPO> rSurveyPlanConfigPOList = rSurveyPlanConfigService.list();
|
||||||
Map<String, RSurveyPlanConfigPO> orgIdMap = rSurveyPlanConfigPOList.stream ( ).
|
Map<String, RSurveyPlanConfigPO> orgIdMap = rSurveyPlanConfigPOList.stream().
|
||||||
collect (Collectors.toMap (RSurveyPlanConfigPO::getOrgId, temp -> temp));
|
collect(Collectors.toMap(RSurveyPlanConfigPO::getOrgId, temp -> temp));
|
||||||
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList ( ).getData ( );
|
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList().getData();
|
||||||
data.stream ( ).forEach (temp -> {
|
data.stream().forEach(temp -> {
|
||||||
DeptSubstationVO deptSubstationVO = new DeptSubstationVO ( );
|
DeptSubstationVO deptSubstationVO = new DeptSubstationVO();
|
||||||
BeanUtils.copyProperties (temp, deptSubstationVO);
|
BeanUtils.copyProperties(temp, deptSubstationVO);
|
||||||
/*如果存在电站占比配置随机抽出配置电站个数*/
|
/*如果存在电站占比配置随机抽出配置电站个数*/
|
||||||
if (orgIdMap.containsKey (temp.getId ( ))) {
|
if (orgIdMap.containsKey(temp.getId())) {
|
||||||
List<StatationStat> collect = filterList.stream ( ).filter (statationStat -> Objects.
|
List<StatationStat> collect = filterList.stream().filter(statationStat -> Objects.
|
||||||
equals (statationStat.getOrgId ( ), temp.getId ( ))).collect (Collectors.toList ( ));
|
equals(statationStat.getOrgId(), temp.getId())).collect(Collectors.toList());
|
||||||
RSurveyPlanConfigPO rSurveyPlanConfigPO = orgIdMap.get (temp.getId ( ));
|
RSurveyPlanConfigPO rSurveyPlanConfigPO = orgIdMap.get(temp.getId());
|
||||||
//向上取整
|
//向上取整
|
||||||
int v = (int) Math.ceil (rSurveyPlanConfigPO.getProportion ( ) *
|
int v = (int) Math.ceil(rSurveyPlanConfigPO.getProportion() *
|
||||||
statetionNum);
|
statetionNum);
|
||||||
if (collect.size ( ) >= v) {
|
if (collect.size() >= v) {
|
||||||
Collections.shuffle (collect);
|
Collections.shuffle(collect);
|
||||||
List<StatationStat> lastList = collect.stream ( ).limit (v).collect (Collectors.toList ( ));
|
List<StatationStat> lastList = collect.stream().limit(v).collect(Collectors.toList());
|
||||||
addList.addAll (lastList);
|
addList.addAll(lastList);
|
||||||
} else {
|
} else {
|
||||||
addList.addAll (collect);
|
addList.addAll(collect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (statetionNum > addList.size ( )) {
|
if (statetionNum > addList.size()) {
|
||||||
/*取差集,当通过比例抽取变电站不够时 重差集里取*/
|
/*取差集,当通过比例抽取变电站不够时 重差集里取*/
|
||||||
List<StatationStat> collect = filterList.stream ( ).filter (o -> !addList.contains (o)).collect (Collectors.toList ( ));
|
List<StatationStat> collect = filterList.stream().filter(o -> !addList.contains(o)).collect(Collectors.toList());
|
||||||
int differenceCount = statetionNum - addList.size ( );
|
int differenceCount = statetionNum - addList.size();
|
||||||
Collections.shuffle (collect);
|
Collections.shuffle(collect);
|
||||||
List<StatationStat> lastList = collect.stream ( ).limit (differenceCount).collect (Collectors.toList ( ));
|
List<StatationStat> lastList = collect.stream().limit(differenceCount).collect(Collectors.toList());
|
||||||
addList.addAll (lastList);
|
addList.addAll(lastList);
|
||||||
}
|
}
|
||||||
List<String> result = addList.stream ( ).map (StatationStat::getPowerId).collect (Collectors.toList ( ));
|
List<String> result = addList.stream().map(StatationStat::getPowerId).collect(Collectors.toList());
|
||||||
RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm = new RGeneralSurveyPlanAddParm ( );
|
RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm = new RGeneralSurveyPlanAddParm();
|
||||||
rGeneralSurveyPlanAddParm.setSubIds (result);
|
rGeneralSurveyPlanAddParm.setSubIds(result);
|
||||||
return rGeneralSurveyPlanAddParm;
|
return rGeneralSurveyPlanAddParm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,98 +495,99 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
public List<DeptSubstationVO> initDetpStataionTree(String orgdid) {
|
public List<DeptSubstationVO> initDetpStataionTree(String orgdid) {
|
||||||
|
|
||||||
/*查询所有电站并过滤已经参加当期普测电站*/
|
/*查询所有电站并过滤已经参加当期普测电站*/
|
||||||
List<StatationStat> list = statationStatService.list ( );
|
List<StatationStat> list = statationStatClient.getPowerInfo(new PmsStatationStatInfoParam()).getData();
|
||||||
|
|
||||||
/**查出当前周期id**/
|
/**查出当前周期id**/
|
||||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||||
rSurveyCyclePOQueryWrapper.le ("start_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.le("start_year", LocalDate.now());
|
||||||
rSurveyCyclePOQueryWrapper.ge ("end_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.ge("end_year", LocalDate.now());
|
||||||
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne (rSurveyCyclePOQueryWrapper);
|
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne(rSurveyCyclePOQueryWrapper);
|
||||||
/**
|
/**
|
||||||
* 不存则新建周期
|
* 不存则新建周期
|
||||||
*/
|
*/
|
||||||
if (Objects.equals (rSurveyCyclePO, null)) {
|
if (Objects.equals(rSurveyCyclePO, null)) {
|
||||||
List<RSurveyCyclePO> rSurveyCyclePOS = rSurveyCycleMapper.selectList (null);
|
List<RSurveyCyclePO> rSurveyCyclePOS = rSurveyCycleMapper.selectList(null);
|
||||||
int cycleNum = 0;
|
int cycleNum = 0;
|
||||||
if (CollectionUtils.isEmpty (rSurveyCyclePOS)) {
|
if (CollectionUtils.isEmpty(rSurveyCyclePOS)) {
|
||||||
|
|
||||||
cycleNum = 5;
|
cycleNum = 5;
|
||||||
} else {
|
} else {
|
||||||
rSurveyCyclePOS = rSurveyCyclePOS.stream ( )
|
rSurveyCyclePOS = rSurveyCyclePOS.stream()
|
||||||
.sorted (Comparator.comparing (RSurveyCyclePO::getEndYear).reversed ( ))
|
.sorted(Comparator.comparing(RSurveyCyclePO::getEndYear).reversed())
|
||||||
.collect (Collectors.toList ( ));
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
cycleNum = rSurveyCyclePOS.get (0).getSurveyCycle ( );
|
cycleNum = rSurveyCyclePOS.get(0).getSurveyCycle();
|
||||||
}
|
}
|
||||||
LocalDate enddate = LocalDate.now ( ).plusYears (cycleNum);
|
LocalDate enddate = LocalDate.now().plusYears(cycleNum);
|
||||||
rSurveyCyclePO = new RSurveyCyclePO ( );
|
rSurveyCyclePO = new RSurveyCyclePO();
|
||||||
rSurveyCyclePO.setStartYear (LocalDate.now ( ));
|
rSurveyCyclePO.setStartYear(LocalDate.now());
|
||||||
rSurveyCyclePO.setEndYear (enddate);
|
rSurveyCyclePO.setEndYear(enddate);
|
||||||
rSurveyCyclePO.setSurveyCycle (cycleNum);
|
rSurveyCyclePO.setSurveyCycle(cycleNum);
|
||||||
rSurveyCycleMapper.insert (rSurveyCyclePO);
|
rSurveyCycleMapper.insert(rSurveyCyclePO);
|
||||||
}
|
}
|
||||||
|
|
||||||
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper1 = new LambdaQueryWrapper<> ( );
|
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper1.eq (RGeneralSurveyPlanPO::getCycleId, rSurveyCyclePO.getId ( ));
|
queryWrapper1.eq(RGeneralSurveyPlanPO::getCycleId, rSurveyCyclePO.getId());
|
||||||
queryWrapper1.in (RGeneralSurveyPlanPO::getStatus, Stream.of (3, 4).collect (Collectors.toList ( )));
|
queryWrapper1.in(RGeneralSurveyPlanPO::getStatus, Stream.of(3, 4).collect(Collectors.toList()));
|
||||||
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper1);
|
List<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList(queryWrapper1);
|
||||||
List<String> planIds = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( ));
|
List<String> planIds = rGeneralSurveyPlanPOS.stream().map(RGeneralSurveyPlanPO::getPlanNo).collect(Collectors.toList());
|
||||||
List<String> subIds = new ArrayList<> ( );
|
List<String> subIds = new ArrayList<>();
|
||||||
if (!CollectionUtils.isEmpty (planIds)) {
|
if (!CollectionUtils.isEmpty(planIds)) {
|
||||||
QueryWrapper<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetailQueryWrapper = new QueryWrapper();
|
||||||
rGeneralSurveyPlanDetailQueryWrapper.in ("plan_no", planIds);
|
rGeneralSurveyPlanDetailQueryWrapper.in("plan_no", planIds);
|
||||||
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (rGeneralSurveyPlanDetailQueryWrapper);
|
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList(rGeneralSurveyPlanDetailQueryWrapper);
|
||||||
subIds = rGeneralSurveyPlanDetails.stream ( ).map (RGeneralSurveyPlanDetail::getSubId).collect (Collectors.toList ( ));
|
subIds = rGeneralSurveyPlanDetails.stream().map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<String> finalSubIds = subIds;
|
List<String> finalSubIds = subIds;
|
||||||
|
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList().getData();
|
||||||
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList ( ).getData ( );
|
List<DeptSubstationVO> deptSubstationVOList = data.stream().map(temp -> {
|
||||||
List<DeptSubstationVO> deptSubstationVOList = data.stream ( ).map (temp -> {
|
DeptSubstationVO deptSubstationVO = new DeptSubstationVO();
|
||||||
DeptSubstationVO deptSubstationVO = new DeptSubstationVO ( );
|
BeanUtils.copyProperties(temp, deptSubstationVO);
|
||||||
BeanUtils.copyProperties (temp, deptSubstationVO);
|
deptSubstationVO.setDisabled(true);
|
||||||
deptSubstationVO.setDisabled (true);
|
deptSubstationVO.setFlag(true);
|
||||||
deptSubstationVO.setFlag (true);
|
QueryWrapper<StatationStat> queryWrapper = new QueryWrapper<>();
|
||||||
QueryWrapper<StatationStat> queryWrapper = new QueryWrapper<> ( );
|
queryWrapper.eq("org_id", temp.getCode());
|
||||||
queryWrapper.eq ("org_id", temp.getCode ( ));
|
PmsStatationStatInfoParam param =new PmsStatationStatInfoParam();
|
||||||
List<StatationStat> list1 = statationStatService.list (queryWrapper);
|
param.setOrgIds(Arrays.asList(temp.getCode()));
|
||||||
List<DeptSubstationVO> children = deptSubstationVO.getChildren ( );
|
List<StatationStat> list1 = statationStatClient.getPowerInfo(param).getData();
|
||||||
List<DeptSubstationVO> collect = list1.stream ( ).map (statationStat -> {
|
List<DeptSubstationVO> children = deptSubstationVO.getChildren();
|
||||||
DeptSubstationVO deptSubstationVO1 = new DeptSubstationVO ( );
|
List<DeptSubstationVO> collect = list1.stream().map(statationStat -> {
|
||||||
deptSubstationVO1.setId (statationStat.getPowerId ( ));
|
DeptSubstationVO deptSubstationVO1 = new DeptSubstationVO();
|
||||||
deptSubstationVO1.setPid (temp.getId ( ));
|
deptSubstationVO1.setId(statationStat.getPowerId());
|
||||||
deptSubstationVO1.setName (statationStat.getPowerName ( ));
|
deptSubstationVO1.setPid(temp.getId());
|
||||||
if (finalSubIds.contains (statationStat.getPowerId ( ))) {
|
deptSubstationVO1.setName(statationStat.getPowerName());
|
||||||
deptSubstationVO1.setDisabled (true);
|
if (finalSubIds.contains(statationStat.getPowerId())) {
|
||||||
|
deptSubstationVO1.setDisabled(true);
|
||||||
}
|
}
|
||||||
deptSubstationVO1.setFlag (true);
|
deptSubstationVO1.setFlag(true);
|
||||||
return deptSubstationVO1;
|
return deptSubstationVO1;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect(Collectors.toList());
|
||||||
children.addAll (collect);
|
children.addAll(collect);
|
||||||
|
|
||||||
return deptSubstationVO;
|
return deptSubstationVO;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
遍历两次data来组装带有children关联性的对象,如果找到子级就删除result的数据
|
遍历两次data来组装带有children关联性的对象,如果找到子级就删除result的数据
|
||||||
|
|
||||||
*/
|
*/
|
||||||
List<DeptSubstationVO> result = new ArrayList<> (deptSubstationVOList);
|
List<DeptSubstationVO> result = new ArrayList<>(deptSubstationVOList);
|
||||||
|
|
||||||
for (DeptSubstationVO pv : deptSubstationVOList) {
|
for (DeptSubstationVO pv : deptSubstationVOList) {
|
||||||
for (DeptSubstationVO pv2 : deptSubstationVOList) {
|
for (DeptSubstationVO pv2 : deptSubstationVOList) {
|
||||||
|
|
||||||
/*如果本级id与数据的父id相同,就说明是子父级关系*/
|
/*如果本级id与数据的父id相同,就说明是子父级关系*/
|
||||||
|
|
||||||
if (pv.getId ( ).equals (pv2.getPid ( ))) {
|
if (pv.getId().equals(pv2.getPid())) {
|
||||||
pv.getChildren ( ).add (pv2);
|
pv.getChildren().add(pv2);
|
||||||
result.remove (pv2);
|
result.remove(pv2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = recursion (result.get (0), orgdid);
|
result = recursion(result.get(0), orgdid);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -661,40 +597,40 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
|||||||
public RSurveyCycleVO addPlanCycle(Integer cycleNum) {
|
public RSurveyCycleVO addPlanCycle(Integer cycleNum) {
|
||||||
|
|
||||||
/**查出当前周期id**/
|
/**查出当前周期id**/
|
||||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper ( );
|
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||||
rSurveyCyclePOQueryWrapper.le ("start_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.le("start_year", LocalDate.now());
|
||||||
rSurveyCyclePOQueryWrapper.ge ("end_year", LocalDate.now ( ));
|
rSurveyCyclePOQueryWrapper.ge("end_year", LocalDate.now());
|
||||||
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne (rSurveyCyclePOQueryWrapper);
|
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne(rSurveyCyclePOQueryWrapper);
|
||||||
|
|
||||||
int insert = 0;
|
int insert = 0;
|
||||||
Boolean flag = true;
|
Boolean flag = true;
|
||||||
if (Objects.equals (rSurveyCyclePO, null)) {
|
if (Objects.equals(rSurveyCyclePO, null)) {
|
||||||
rSurveyCyclePO = new RSurveyCyclePO ( );
|
rSurveyCyclePO = new RSurveyCyclePO();
|
||||||
LocalDate enddate = LocalDate.now ( ).plusYears (cycleNum);
|
LocalDate enddate = LocalDate.now().plusYears(cycleNum);
|
||||||
rSurveyCyclePO.setStartYear (LocalDate.now ( ));
|
rSurveyCyclePO.setStartYear(LocalDate.now());
|
||||||
rSurveyCyclePO.setEndYear (enddate);
|
rSurveyCyclePO.setEndYear(enddate);
|
||||||
rSurveyCyclePO.setSurveyCycle (cycleNum);
|
rSurveyCyclePO.setSurveyCycle(cycleNum);
|
||||||
insert = rSurveyCycleMapper.insert (rSurveyCyclePO);
|
insert = rSurveyCycleMapper.insert(rSurveyCyclePO);
|
||||||
} else {
|
} else {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
RSurveyCycleVO rSurveyCycleVO = new RSurveyCycleVO ( );
|
RSurveyCycleVO rSurveyCycleVO = new RSurveyCycleVO();
|
||||||
BeanUtils.copyProperties (rSurveyCyclePO, rSurveyCycleVO);
|
BeanUtils.copyProperties(rSurveyCyclePO, rSurveyCycleVO);
|
||||||
rSurveyCycleVO.setFlag (flag);
|
rSurveyCycleVO.setFlag(flag);
|
||||||
return rSurveyCycleVO;
|
return rSurveyCycleVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
|
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
|
||||||
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<> ( );
|
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>();
|
||||||
if (Objects.equals (result.getId ( ), orgdid)) {
|
if (Objects.equals(result.getId(), orgdid)) {
|
||||||
deptSubstationVOList.add (result);
|
deptSubstationVOList.add(result);
|
||||||
return deptSubstationVOList;
|
return deptSubstationVOList;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (DeptSubstationVO deptSubstationVO : result.getChildren ( )) {
|
for (DeptSubstationVO deptSubstationVO : result.getChildren()) {
|
||||||
|
|
||||||
List<DeptSubstationVO> recursion = recursion (deptSubstationVO, orgdid);
|
List<DeptSubstationVO> recursion = recursion(deptSubstationVO, orgdid);
|
||||||
if(recursion.size ()>0){
|
if (recursion.size() > 0) {
|
||||||
return recursion;
|
return recursion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user