草稿功能各个页面开发
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.supervision.pojo.param.device;
|
package com.njcn.supervision.pojo.param.device;
|
||||||
|
|
||||||
import com.njcn.db.bo.BaseEntity;
|
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -29,6 +28,9 @@ public class QuitRunningDeviceParam implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
|
private String saveOrCheckflag;
|
||||||
/**
|
/**
|
||||||
* 设备编号
|
* 设备编号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.supervision.pojo.param.device;
|
package com.njcn.supervision.pojo.param.device;
|
||||||
|
|
||||||
import com.njcn.db.bo.BaseEntity;
|
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -24,7 +23,8 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class SupervisionTempLineDebugParam {
|
public class SupervisionTempLineDebugParam {
|
||||||
private String id;
|
private String id;
|
||||||
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
|
private String saveOrCheckflag;
|
||||||
/**
|
/**
|
||||||
* 调试原因
|
* 调试原因
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,6 +26,13 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class SupervisionTempLineReportParam {
|
public class SupervisionTempLineReportParam {
|
||||||
|
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
|
private String saveOrCheckflag;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "填报部门")
|
@ApiModelProperty(value = "填报部门")
|
||||||
private String orgId;
|
private String orgId;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import java.time.LocalDate;
|
|||||||
@Data
|
@Data
|
||||||
public class SurveyPlanParam implements Serializable {
|
public class SurveyPlanParam implements Serializable {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
|
private String saveOrCheckflag;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -112,6 +115,8 @@ public class SurveyPlanParam implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "计划状态")
|
@ApiModelProperty(value = "计划状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@ApiModelProperty(value = " 监督类型")
|
||||||
|
private String supvType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.supervision.pojo.param.survey;
|
package com.njcn.supervision.pojo.param.survey;
|
||||||
|
|
||||||
import com.njcn.db.bo.BaseEntity;
|
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -26,6 +25,8 @@ public class SurveyTestParam implements Serializable {
|
|||||||
@ApiModelProperty("id")
|
@ApiModelProperty("id")
|
||||||
@NotBlank(message = "索引不能为空")
|
@NotBlank(message = "索引不能为空")
|
||||||
private String Id;
|
private String Id;
|
||||||
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
|
private String saveOrCheckflag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普测计划表id
|
* 普测计划表id
|
||||||
@@ -102,11 +103,18 @@ public class SurveyTestParam implements Serializable {
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public static class SurveyTestQueryParam extends BaseParam {
|
public static class SurveyTestQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测负责单位
|
||||||
|
*/
|
||||||
|
String deptIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
* 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "测试审批状态")
|
@ApiModelProperty(value = "测试审批状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@ApiModelProperty(value = " 监督类型")
|
||||||
|
private String supvType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ public class SupervisionTempDeviceReport {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "power_company")
|
@TableField(value = "power_company")
|
||||||
private String powerCompany;
|
private String powerCompany;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0 关联系统内变电站;1用户手动输入变电站
|
* 0 关联系统内变电站;1用户手动输入变电站
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
supervision_temp_line_debug.`status` `Status`,
|
supervision_temp_line_debug.`status` `Status`,
|
||||||
supervision_temp_line_debug.create_by
|
supervision_temp_line_debug.create_by
|
||||||
FROM
|
FROM
|
||||||
supervision_temp_line_report
|
supervision_temp_line_debug
|
||||||
left JOIN supervision_temp_line_debug ON supervision_temp_line_report.id = supervision_temp_line_debug.id
|
left JOIN supervision_temp_line_report ON supervision_temp_line_report.id = supervision_temp_line_debug.id
|
||||||
where supervision_temp_line_report.`status`=2
|
where supervision_temp_line_report.`status`=2
|
||||||
and ${ew.sqlSegment}
|
and ${ew.sqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
|||||||
import com.njcn.supervision.mapper.device.QuitRunningDeviceMapper;
|
import com.njcn.supervision.mapper.device.QuitRunningDeviceMapper;
|
||||||
import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
|
import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
|
||||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||||
import com.njcn.supervision.pojo.vo.device.CheckDeviceVo;
|
|
||||||
import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO;
|
import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO;
|
||||||
import com.njcn.supervision.service.device.IQuitRunningDeviceService;
|
import com.njcn.supervision.service.device.IQuitRunningDeviceService;
|
||||||
import com.njcn.supervision.service.user.UserReportPOService;
|
import com.njcn.supervision.service.user.UserReportPOService;
|
||||||
@@ -76,9 +75,20 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
|||||||
quitRunningDevice.setDevStatus(4);
|
quitRunningDevice.setDevStatus(4);
|
||||||
}
|
}
|
||||||
quitRunningDevice.setState(DataStateEnum.ENABLE.getCode());
|
quitRunningDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
//设置状态
|
||||||
|
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"1")){
|
||||||
|
quitRunningDevice.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
this.save(quitRunningDevice);
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
this.saveOrUpdate(quitRunningDevice);
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
|
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"2")) {
|
||||||
|
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.QUIT_RUNNING_DEVICE.getKey());
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.QUIT_RUNNING_DEVICE.getKey());
|
||||||
@@ -89,6 +99,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
|||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
quitRunningDevice.setProcessInstanceId(processInstanceId);
|
quitRunningDevice.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(quitRunningDevice);
|
this.baseMapper.updateById(quitRunningDevice);
|
||||||
|
}
|
||||||
return quitRunningDevice.getId();
|
return quitRunningDevice.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
|||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.vo.device.CheckDeviceVo;
|
|
||||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||||
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
||||||
@@ -35,6 +34,7 @@ import com.njcn.user.pojo.vo.UserVO;
|
|||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
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;
|
||||||
@@ -66,20 +66,36 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
|
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
|
||||||
|
|
||||||
//设备校验ip
|
|
||||||
checkIp(supervisionDevMainReportParam, false);
|
|
||||||
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
||||||
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
||||||
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
if(StringUtils.isEmpty(supervisionDevMainReportParam.getId())){
|
||||||
|
//设备校验ip
|
||||||
|
checkIp(supervisionDevMainReportParam, false);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
//设备校验ip
|
||||||
|
checkIp(supervisionDevMainReportParam, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
//设置状态
|
||||||
|
if(Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(),"1")){
|
||||||
|
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
this.save(supervisionDevMainReportPO);
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.saveOrUpdate(supervisionDevMainReportPO);
|
||||||
String id = supervisionDevMainReportPO.getId();
|
String id = supervisionDevMainReportPO.getId();
|
||||||
//存储临时终端信息
|
//存储临时终端信息
|
||||||
SupervisionTempDeviceReportParam supervisionTempDeviceReportParam = supervisionDevMainReportParam.getSupervisionTempDeviceReportParam();
|
SupervisionTempDeviceReportParam supervisionTempDeviceReportParam = supervisionDevMainReportParam.getSupervisionTempDeviceReportParam();
|
||||||
SupervisionTempDeviceReport supervisionTempDeviceReportPO = new SupervisionTempDeviceReport();
|
SupervisionTempDeviceReport supervisionTempDeviceReportPO = new SupervisionTempDeviceReport();
|
||||||
BeanUtils.copyProperties(supervisionTempDeviceReportParam, supervisionTempDeviceReportPO);
|
BeanUtils.copyProperties(supervisionTempDeviceReportParam, supervisionTempDeviceReportPO);
|
||||||
supervisionTempDeviceReportPO.setId(id);
|
supervisionTempDeviceReportPO.setId(id);
|
||||||
supervisionTempDeviceReportService.save(supervisionTempDeviceReportPO);
|
supervisionTempDeviceReportService.saveOrUpdate(supervisionTempDeviceReportPO);
|
||||||
//存储临时监测点信息
|
//存储临时监测点信息
|
||||||
// SupervisionTempLineReportParam supervisionTempLineReportParam = supervisionDevMainReportParam.getSupervisionTempLineReportParam();
|
// SupervisionTempLineReportParam supervisionTempLineReportParam = supervisionDevMainReportParam.getSupervisionTempLineReportParam();
|
||||||
// SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
// SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
||||||
@@ -87,17 +103,19 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
// supervisionTempDeviceReportPO.setId(id);
|
// supervisionTempDeviceReportPO.setId(id);
|
||||||
// supervisionTempLineReportService.save(supervisionTempLineReport);
|
// supervisionTempLineReportService.save(supervisionTempLineReport);
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
|
// 如何未提交审则不需要发起 BPM 流程
|
||||||
|
if(Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(),"2")) {
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.DEVICE_INFO_ADD.getKey());
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.DEVICE_INFO_ADD.getKey());
|
||||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionDevMainReportParam.getStartUserSelectAssignees());
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionDevMainReportParam.getStartUserSelectAssignees());
|
||||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionDevMainReportPO.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionDevMainReportPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
supervisionDevMainReportPO.setProcessInstanceId(processInstanceId);
|
supervisionDevMainReportPO.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(supervisionDevMainReportPO);
|
this.baseMapper.updateById(supervisionDevMainReportPO);
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +261,9 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
|
|
||||||
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
|
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
|
||||||
// supervisionTempDeviceReport.setSubstation(lineFeignClient.getSubstationInfo(supervisionTempDeviceReport.getSubstation()).getData().getName());
|
// supervisionTempDeviceReport.setSubstation(lineFeignClient.getSubstationInfo(supervisionTempDeviceReport.getSubstation()).getData().getName());
|
||||||
|
if(StringUtils.isNotEmpty(supervisionTempDeviceReport.getPowerCompany())){
|
||||||
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(supervisionTempDeviceReport.getPowerCompany()).getData().getName());
|
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(supervisionTempDeviceReport.getPowerCompany()).getData().getName());
|
||||||
|
}
|
||||||
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
|
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
|
||||||
return supervisionDevMainReportVO;
|
return supervisionDevMainReportVO;
|
||||||
}
|
}
|
||||||
@@ -256,15 +276,20 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
* @Date: 2024/5/11
|
* @Date: 2024/5/11
|
||||||
*/
|
*/
|
||||||
private void checkIp(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
|
private void checkIp(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
|
||||||
|
//如果保存不填ip则不校验
|
||||||
|
if(!StringUtils.isEmpty(supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp())) {
|
||||||
|
|
||||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper
|
lambdaQueryWrapper
|
||||||
.eq(SupervisionTempDeviceReport::getSubstation,supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getSubstation())
|
.eq(SupervisionTempDeviceReport::getSubstation, supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getSubstation())
|
||||||
.eq(SupervisionTempDeviceReport::getTerminalIp, supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp());
|
.eq(SupervisionTempDeviceReport::getTerminalIp, supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp());
|
||||||
//更新的时候,需排除当前记录
|
//更新的时候,需排除当前记录
|
||||||
if (isExcludeSelf) {
|
if (isExcludeSelf) {
|
||||||
if(supervisionDevMainReportParam instanceof SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate){
|
if (supervisionDevMainReportParam instanceof SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) {
|
||||||
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
|
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
|
||||||
|
}else {
|
||||||
|
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, (supervisionDevMainReportParam).getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -284,4 +309,5 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,18 +84,26 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
|
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
|
||||||
|
|
||||||
SupervisionTempLineDebugPO byId = this.getById(supervisionTempLineReportParam.getId());
|
// SupervisionTempLineDebugPO byId = this.getById(supervisionTempLineReportParam.getId());
|
||||||
if(Objects.nonNull(byId)){
|
// if(Objects.nonNull(byId)){
|
||||||
if(byId.getState() == 1) {
|
// if(byId.getState() == 1) {
|
||||||
throw new BusinessException("该监测点已申请联调");
|
// throw new BusinessException("该监测点已申请联调");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = new SupervisionTempLineDebugPO();
|
SupervisionTempLineDebugPO supervisionTempLineDebugPO = new SupervisionTempLineDebugPO();
|
||||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
||||||
supervisionTempLineDebugPO.setState(DataStateEnum.ENABLE.getCode());
|
//设置状态
|
||||||
|
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"1")){
|
||||||
|
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
|
}
|
||||||
|
supervisionTempLineDebugPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.saveOrUpdate(supervisionTempLineDebugPO);
|
this.saveOrUpdate(supervisionTempLineDebugPO);
|
||||||
String id = supervisionTempLineDebugPO.getId();
|
String id = supervisionTempLineDebugPO.getId();
|
||||||
|
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"2")) {
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
@@ -107,6 +115,8 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
supervisionTempLineDebugPO.setProcessInstanceId(processInstanceId);
|
supervisionTempLineDebugPO.setProcessInstanceId(processInstanceId);
|
||||||
this.updateById(supervisionTempLineDebugPO);
|
this.updateById(supervisionTempLineDebugPO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
@@ -144,8 +154,8 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
public Page<SupervisionTempLineDebugVO> getTempLineDeug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
|
public Page<SupervisionTempLineDebugVO> getTempLineDeug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
|
||||||
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
queryWrapper.in("supervision_temp_line_report.create_by", colleaguesIds)
|
queryWrapper.in("supervision_temp_line_debug.create_by", colleaguesIds)
|
||||||
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode());
|
.eq("supervision_temp_line_debug.state", DataStateEnum.ENABLE.getCode());
|
||||||
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getOrgNo())) {
|
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getOrgNo())) {
|
||||||
/*获取直接下属子单位*/
|
/*获取直接下属子单位*/
|
||||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData();
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData();
|
||||||
@@ -166,10 +176,10 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
//添加上时间范围
|
//添加上时间范围
|
||||||
queryWrapper.between("supervision_temp_line_report.Create_Time",
|
queryWrapper.between("supervision_temp_line_debug.Create_Time",
|
||||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||||
queryWrapper.orderByDesc("supervision_temp_line_report.Update_Time");
|
queryWrapper.orderByDesc("supervision_temp_line_debug.Update_Time");
|
||||||
Page<SupervisionTempLineDebugVO> page =this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
Page<SupervisionTempLineDebugVO> page =this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
|||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
import com.njcn.supervision.pojo.vo.device.CheckDeviceVo;
|
|
||||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||||
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
||||||
import com.njcn.supervision.service.user.UserReportPOService;
|
import com.njcn.supervision.service.user.UserReportPOService;
|
||||||
@@ -36,6 +35,7 @@ import com.njcn.user.pojo.vo.UserVO;
|
|||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
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;
|
||||||
@@ -70,17 +70,33 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addTempLineReport(SupervisionTempLineReportParam supervisionTempLineReportParam) {
|
public String addTempLineReport(SupervisionTempLineReportParam supervisionTempLineReportParam) {
|
||||||
//判断干扰源用户是否绑定
|
|
||||||
checkLineId(supervisionTempLineReportParam, false);
|
|
||||||
|
|
||||||
SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
||||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineReport);
|
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineReport);
|
||||||
supervisionTempLineReport.setState(DataStateEnum.ENABLE.getCode());
|
|
||||||
|
if(StringUtils.isEmpty(supervisionTempLineReportParam.getId())){
|
||||||
|
//判断监测点是否重复
|
||||||
|
checkLineId(supervisionTempLineReportParam, false);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
//判断监测点是否重复
|
||||||
|
checkLineId(supervisionTempLineReportParam, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
//设置状态
|
||||||
|
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"1")){
|
||||||
|
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
this.save(supervisionTempLineReport);
|
}
|
||||||
String id = supervisionTempLineReport.getId();
|
|
||||||
|
|
||||||
|
|
||||||
|
supervisionTempLineReport.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
|
||||||
|
this.saveOrUpdate(supervisionTempLineReport);
|
||||||
|
String id = supervisionTempLineReport.getId();
|
||||||
|
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"2")) {
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
@@ -88,11 +104,11 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
|||||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionTempLineReportParam.getStartUserSelectAssignees());
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionTempLineReportParam.getStartUserSelectAssignees());
|
||||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionTempLineReport.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionTempLineReport.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
supervisionTempLineReport.setProcessInstanceId(processInstanceId);
|
supervisionTempLineReport.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(supervisionTempLineReport);
|
this.baseMapper.updateById(supervisionTempLineReport);
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,17 +236,22 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
||||||
|
//保存时不为空则不校验
|
||||||
|
if(Objects.nonNull(supervisionTempLineReportParam.getNum())||Objects.nonNull(supervisionTempLineReportParam.getLineName())) {
|
||||||
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper
|
lambdaQueryWrapper
|
||||||
.eq(SupervisionTempLineReport::getMonitoringTerminalCode,supervisionTempLineReportParam.getMonitoringTerminalCode())
|
.eq(SupervisionTempLineReport::getMonitoringTerminalCode, supervisionTempLineReportParam.getMonitoringTerminalCode())
|
||||||
.and(wrapper->wrapper.eq(SupervisionTempLineReport::getNum ,supervisionTempLineReportParam.getNum()).or()
|
.and(wrapper -> wrapper.eq(SupervisionTempLineReport::getNum, supervisionTempLineReportParam.getNum()).or()
|
||||||
.eq(SupervisionTempLineReport::getLineName ,supervisionTempLineReportParam.getLineName())
|
.eq(SupervisionTempLineReport::getLineName, supervisionTempLineReportParam.getLineName())
|
||||||
)
|
)
|
||||||
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode());
|
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode());
|
||||||
//更新的时候,需排除当前记录
|
//更新的时候,需排除当前记录
|
||||||
if (isExcludeSelf) {
|
if (isExcludeSelf) {
|
||||||
if(supervisionTempLineReportParam instanceof SupervisionTempLineReportParam.SupervisionTempLineReportUpdate){
|
if (supervisionTempLineReportParam instanceof SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) {
|
||||||
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, ((SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) supervisionTempLineReportParam).getId());
|
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, ((SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) supervisionTempLineReportParam).getId());
|
||||||
|
}else {
|
||||||
|
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, (supervisionTempLineReportParam).getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -247,4 +268,5 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
|||||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||||
import com.njcn.supervision.pojo.vo.device.CheckDeviceVo;
|
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveySubstation;
|
import com.njcn.supervision.pojo.vo.survey.SurveySubstation;
|
||||||
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
||||||
@@ -36,7 +35,7 @@ import com.njcn.user.api.DeptFeignClient;
|
|||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import org.apache.commons.lang.StringUtils;
|
||||||
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;
|
||||||
@@ -95,7 +94,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
if (Objects.nonNull(surveyPlanQueryParam.getStatus())) {
|
if (Objects.nonNull(surveyPlanQueryParam.getStatus())) {
|
||||||
surveyPlanVOQueryWrapper.in("supervision_survey_plan.status", surveyPlanQueryParam.getStatus());
|
surveyPlanVOQueryWrapper.in("supervision_survey_plan.status", surveyPlanQueryParam.getStatus());
|
||||||
}
|
}
|
||||||
|
surveyPlanVOQueryWrapper.eq(StringUtils.isNotBlank(surveyPlanQueryParam.getSupvType()),"supervision_survey_plan.supv_type",surveyPlanQueryParam.getSupvType());
|
||||||
}
|
}
|
||||||
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
@@ -134,10 +133,18 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
//排除重复计划的策略暂时未知,待后期有人提出了,再去做,todo...
|
//排除重复计划的策略暂时未知,待后期有人提出了,再去做,todo...
|
||||||
SurveyPlan surveyPlan = new SurveyPlan();
|
SurveyPlan surveyPlan = new SurveyPlan();
|
||||||
BeanUtils.copyProperties(surveyPlanParam, surveyPlan);
|
BeanUtils.copyProperties(surveyPlanParam, surveyPlan);
|
||||||
surveyPlan.setState(DataStateEnum.ENABLE.getCode());
|
//设置状态
|
||||||
|
if(Objects.equals(surveyPlanParam.getSaveOrCheckflag(),"1")){
|
||||||
|
surveyPlan.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
this.save(surveyPlan);
|
|
||||||
|
}
|
||||||
|
surveyPlan.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.saveOrUpdate(surveyPlan);
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
|
if(Objects.equals(surveyPlanParam.getSaveOrCheckflag(),"2")){
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
||||||
@@ -148,6 +155,8 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
surveyPlan.setProcessInstanceId(processInstanceId);
|
surveyPlan.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(surveyPlan);
|
this.baseMapper.updateById(surveyPlan);
|
||||||
|
}
|
||||||
|
|
||||||
return surveyPlan.getId();
|
return surveyPlan.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +222,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
surveyTest.setInitiateWarningFlag(0);
|
surveyTest.setInitiateWarningFlag(0);
|
||||||
surveyTest.setSubstation(subId);
|
surveyTest.setSubstation(subId);
|
||||||
surveyTest.setCustomSubstationFlag(0);
|
surveyTest.setCustomSubstationFlag(0);
|
||||||
surveyTest.setStatus(FlowStatusEnum.UN_TEST.getCode());
|
surveyTest.setStatus(FlowStatusEnum.NEW.getCode());
|
||||||
surveyTest.setCreateBy(surveyPlan.getCreateBy());
|
surveyTest.setCreateBy(surveyPlan.getCreateBy());
|
||||||
surveyTestService.save(surveyTest);
|
surveyTestService.save(surveyTest);
|
||||||
}
|
}
|
||||||
@@ -224,7 +233,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
surveyTest.setSubstation(surveyPlan.getSubstation());
|
surveyTest.setSubstation(surveyPlan.getSubstation());
|
||||||
surveyTest.setInitiateWarningFlag(0);
|
surveyTest.setInitiateWarningFlag(0);
|
||||||
surveyTest.setCustomSubstationFlag(1);
|
surveyTest.setCustomSubstationFlag(1);
|
||||||
surveyTest.setStatus(FlowStatusEnum.UN_TEST.getCode());
|
surveyTest.setStatus(FlowStatusEnum.NEW.getCode());
|
||||||
surveyTest.setCreateBy(surveyPlan.getCreateBy());
|
surveyTest.setCreateBy(surveyPlan.getCreateBy());
|
||||||
surveyTestService.save(surveyTest);
|
surveyTestService.save(surveyTest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,8 @@ import com.njcn.supervision.enums.ProblemTypeEnum;
|
|||||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||||
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
|
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
|
||||||
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
|
||||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
|
||||||
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||||
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
||||||
@@ -42,7 +39,7 @@ import com.njcn.user.api.DeptFeignClient;
|
|||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import org.apache.commons.lang.StringUtils;
|
||||||
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;
|
||||||
@@ -98,6 +95,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
|||||||
if (Objects.nonNull(surveyTestQueryParam.getSearchValue())) {
|
if (Objects.nonNull(surveyTestQueryParam.getSearchValue())) {
|
||||||
LambdaQueryWrapper<SurveyPlan> surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SurveyPlan> surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
surveyPlanLambdaQueryWrapper.eq(SurveyPlan::getState, DataStateEnum.ENABLE.getCode())
|
surveyPlanLambdaQueryWrapper.eq(SurveyPlan::getState, DataStateEnum.ENABLE.getCode())
|
||||||
|
.eq(StringUtils.isNotBlank(surveyTestQueryParam.getSupvType()),SurveyPlan::getSupvType,surveyTestQueryParam.getSupvType())
|
||||||
.like(SurveyPlan::getPlanName, surveyTestQueryParam.getSearchValue());
|
.like(SurveyPlan::getPlanName, surveyTestQueryParam.getSearchValue());
|
||||||
List<SurveyPlan> surveyPlans = surveyPlanService.getBaseMapper().selectList(surveyPlanLambdaQueryWrapper);
|
List<SurveyPlan> surveyPlans = surveyPlanService.getBaseMapper().selectList(surveyPlanLambdaQueryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(surveyPlans)) {
|
if (CollectionUtil.isNotEmpty(surveyPlans)) {
|
||||||
@@ -109,11 +107,14 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//筛选普测负责单位
|
||||||
|
if (StrUtil.isNotBlank(surveyTestQueryParam.getDeptIndex())) {
|
||||||
|
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData();
|
||||||
|
surveyTestVOQueryWrapper.in("supervision_survey_test.dept_id", deptIds);
|
||||||
|
}
|
||||||
if (Objects.nonNull(surveyTestQueryParam.getStatus())) {
|
if (Objects.nonNull(surveyTestQueryParam.getStatus())) {
|
||||||
surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus());
|
surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
@@ -193,15 +194,25 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
|||||||
public String addSurveyTest(SurveyTestParam surveyTestParam) {
|
public String addSurveyTest(SurveyTestParam surveyTestParam) {
|
||||||
SurveyTest surveyTest = this.getById(surveyTestParam.getId());
|
SurveyTest surveyTest = this.getById(surveyTestParam.getId());
|
||||||
//没有copy前端所有的字段,仅赋值了test表中需要的几个字段
|
//没有copy前端所有的字段,仅赋值了test表中需要的几个字段
|
||||||
|
|
||||||
surveyTest.setCompleteTime(surveyTestParam.getCompleteTime());
|
surveyTest.setCompleteTime(surveyTestParam.getCompleteTime());
|
||||||
surveyTest.setCompleteBy(surveyTestParam.getCompleteBy());
|
surveyTest.setCompleteBy(surveyTestParam.getCompleteBy());
|
||||||
surveyTest.setTestReport(surveyTestParam.getTestReport());
|
surveyTest.setTestReport(surveyTestParam.getTestReport());
|
||||||
surveyTest.setProblemFlag(surveyTestParam.getProblemFlag());
|
surveyTest.setProblemFlag(surveyTestParam.getProblemFlag());
|
||||||
surveyTest.setProblemDetail(surveyTestParam.getProblemDetail());
|
surveyTest.setProblemDetail(surveyTestParam.getProblemDetail());
|
||||||
surveyTest.setState(DataStateEnum.ENABLE.getCode());
|
//设置状态
|
||||||
|
if(Objects.equals(surveyTestParam.getSaveOrCheckflag(),"1")){
|
||||||
|
surveyTest.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
|
}else {
|
||||||
surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
|
}
|
||||||
|
surveyTest.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
// surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
this.updateById(surveyTest);
|
this.updateById(surveyTest);
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
|
if(Objects.equals(surveyTestParam.getSaveOrCheckflag(),"2")) {
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey());
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey());
|
||||||
@@ -212,6 +223,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
|||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
surveyTest.setProcessInstanceId(processInstanceId);
|
surveyTest.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(surveyTest);
|
this.baseMapper.updateById(surveyTest);
|
||||||
|
}
|
||||||
return surveyTest.getId();
|
return surveyTest.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
|
|
||||||
List<UserReportPO> list = this.lambdaQuery()
|
List<UserReportPO> list = this.lambdaQuery()
|
||||||
.eq(UserReportPO::getStatus, 2)
|
.eq(UserReportPO::getStatus, 2)
|
||||||
.eq(UserReportPO::getDataType, 0)
|
.eq(UserReportPO::getDataType,0)
|
||||||
.in(CollectionUtil.isNotEmpty(data), UserReportPO::getOrgId, data)
|
.in(CollectionUtil.isNotEmpty(data), UserReportPO::getOrgId, data)
|
||||||
.list();
|
.list();
|
||||||
List<UserReportVO> collect = list.stream().map(temp -> {
|
List<UserReportVO> collect = list.stream().map(temp -> {
|
||||||
@@ -406,12 +406,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
userReportVOQueryWrapper.eq("data_type", userReportQueryParam.getDataType());
|
userReportVOQueryWrapper.eq("data_type", userReportQueryParam.getDataType());
|
||||||
}
|
}
|
||||||
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
|
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
|
||||||
if(StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime())&&StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())){
|
|
||||||
userReportVOQueryWrapper.between("supervision_user_report.expected_production_date",
|
|
||||||
DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
|
|
||||||
DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime())));
|
|
||||||
}
|
|
||||||
userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time");
|
|
||||||
}
|
}
|
||||||
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
||||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
||||||
@@ -435,7 +430,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateUserStatus(String lineId, Integer userStatus) {
|
public void updateUserStatus(String lineId, Integer userStatus) {
|
||||||
SupervisionTempLineReport supervisionTempLineReport = supervisionTempLineReportMapper.selectById(lineId);
|
SupervisionTempLineReport supervisionTempLineReport = supervisionTempLineReportMapper.selectById(lineId);
|
||||||
if (Objects.nonNull(supervisionTempLineReport)) {
|
if(Objects.nonNull(supervisionTempLineReport)) {
|
||||||
String userId = supervisionTempLineReport.getUserId();
|
String userId = supervisionTempLineReport.getUserId();
|
||||||
UserReportPO userReportPO = this.baseMapper.selectById(userId);
|
UserReportPO userReportPO = this.baseMapper.selectById(userId);
|
||||||
//如果目前的干扰源用户状态>userStatus则不修改,如果将干扰源用户状态改为3退运,则必须其下的监测点都退运才能修改
|
//如果目前的干扰源用户状态>userStatus则不修改,如果将干扰源用户状态改为3退运,则必须其下的监测点都退运才能修改
|
||||||
@@ -495,108 +490,55 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void downloadSensitiveUserTemplate() {
|
public void downloadSensitiveUserTemplate() {
|
||||||
ExportParams exportParams = new ExportParams("敏感及重要用户数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "敏感及重要用户数据信息");
|
ExportParams exportParams = new ExportParams();
|
||||||
//所属地市
|
exportParams.setSheetName("敏感及重要用户");
|
||||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
|
||||||
//电压等级
|
|
||||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||||
//评估单位
|
|
||||||
List<DictData> evaluationDept;
|
|
||||||
evaluationDept = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_DEPT.getCode()).getData();
|
|
||||||
//评估类型
|
|
||||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
|
||||||
//指标类型
|
|
||||||
List<DictData> indicatorType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData();
|
|
||||||
//行业类型
|
|
||||||
List<DictData> industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData();
|
List<DictData> industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData();
|
||||||
//负荷级别
|
|
||||||
List<DictData> loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData();
|
List<DictData> loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData();
|
||||||
//供电电源情况
|
|
||||||
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
||||||
|
|
||||||
List<PullDown> pullDowns = new ArrayList<>();
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
PullDown pullDown;
|
PullDown pullDown;
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(1);
|
pullDown.setFirstCol(2);
|
||||||
pullDown.setLastCol(1);
|
pullDown.setLastCol(2);
|
||||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !x.getName().equals("风光储")&&!x.getName().equals("超高压")).map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(3);
|
|
||||||
pullDown.setLastCol(3);
|
|
||||||
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(6);
|
pullDown.setFirstCol(4);
|
||||||
pullDown.setLastCol(6);
|
pullDown.setLastCol(4);
|
||||||
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(7);
|
pullDown.setFirstCol(5);
|
||||||
pullDown.setLastCol(7);
|
pullDown.setLastCol(5);
|
||||||
pullDown.setStrings(evaluationDept.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(12);
|
|
||||||
pullDown.setLastCol(12);
|
|
||||||
pullDown.setStrings(evaluationType.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(13);
|
|
||||||
pullDown.setLastCol(13);
|
|
||||||
pullDown.setStrings(industryType.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(industryType.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(16);
|
pullDown.setFirstCol(8);
|
||||||
pullDown.setLastCol(16);
|
pullDown.setLastCol(8);
|
||||||
pullDown.setStrings(indicatorType.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(22);
|
|
||||||
pullDown.setLastCol(22);
|
|
||||||
pullDown.setStrings(supplyCondition.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(20);
|
|
||||||
pullDown.setLastCol(20);
|
|
||||||
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(21);
|
pullDown.setFirstCol(9);
|
||||||
pullDown.setLastCol(21);
|
pullDown.setLastCol(9);
|
||||||
pullDown.setStrings(loadLevel.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(loadLevel.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(10);
|
pullDown.setFirstCol(10);
|
||||||
pullDown.setLastCol(10);
|
pullDown.setLastCol(10);
|
||||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
pullDown.setStrings(supplyCondition.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
ExcelUtil.exportExcelPullDownOne(exportParams, "敏感及重要用户模板.xlsx", pullDowns, SensitiveUserExcel.class, new ArrayList<>());
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(11);
|
|
||||||
pullDown.setLastCol(11);
|
|
||||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(17);
|
|
||||||
pullDown.setLastCol(17);
|
|
||||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
ExcelUtil.exportExcelPullDown(exportParams, "敏感及重要用户模板.xlsx", pullDowns, SensitiveUserSExcel.class, new ArrayList<>());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,13 +547,13 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
public String importSensitiveUserData(MultipartFile file, HttpServletResponse response) {
|
public String importSensitiveUserData(MultipartFile file, HttpServletResponse response) {
|
||||||
ImportParams params = new ImportParams();
|
ImportParams params = new ImportParams();
|
||||||
params.setHeadRows(1);//表头
|
params.setHeadRows(1);//表头
|
||||||
params.setTitleRows(1);//标题
|
// params.setTitleRows(1);//标题
|
||||||
params.setNeedVerify(true);
|
params.setNeedVerify(true);
|
||||||
params.setStartSheetIndex(0);
|
params.setStartSheetIndex(0);
|
||||||
params.setSheetNum(1);
|
params.setSheetNum(1);
|
||||||
List<SensitiveUserSExcel> sensitiveUserExcels;
|
List<SensitiveUserExcel> sensitiveUserExcels;
|
||||||
try {
|
try {
|
||||||
ExcelImportResult<SensitiveUserSExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveUserSExcel.class, params);
|
ExcelImportResult<SensitiveUserExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveUserExcel.class, params);
|
||||||
//如果存在非法数据,将不合格的数据导出
|
//如果存在非法数据,将不合格的数据导出
|
||||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||||
@@ -622,51 +564,49 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_USER_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_USER_ERROR);
|
||||||
}
|
}
|
||||||
//电压等级
|
|
||||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||||
//指标类型
|
|
||||||
List<DictData> indicatorType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData();
|
|
||||||
//评估类型
|
|
||||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
|
||||||
//行业类型
|
|
||||||
List<DictData> industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData();
|
List<DictData> industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData();
|
||||||
//负荷级别
|
|
||||||
List<DictData> loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData();
|
List<DictData> loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData();
|
||||||
//供电电源情况
|
|
||||||
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
||||||
|
|
||||||
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
||||||
List<SensitiveUserSExcel.SensitiveUserExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
List<SensitiveUserExcel.SensitiveUserExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
||||||
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
|
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
|
||||||
for (SensitiveUserSExcel userExcel : sensitiveUserExcels) {
|
for (SensitiveUserExcel sensitiveUserExcel : sensitiveUserExcels) {
|
||||||
//先判断当前用户是否已经存在
|
//先判断当前用户是否已经存在
|
||||||
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
userReportPOLambdaQueryWrapper.eq(UserReportPO::getProjectName, userExcel.getProjectName())
|
userReportPOLambdaQueryWrapper.eq(UserReportPO::getProjectName, sensitiveUserExcel.getProjectName())
|
||||||
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||||
int count = this.count(userReportPOLambdaQueryWrapper);
|
int count = this.count(userReportPOLambdaQueryWrapper);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
// if(sensitiveUserExcel.getOverlay() == 1){
|
||||||
|
//
|
||||||
|
// }else{
|
||||||
//该用户已经录入
|
//该用户已经录入
|
||||||
SensitiveUserSExcel.SensitiveUserExcelMsg sensitiveUserExcelMsg = new SensitiveUserSExcel.SensitiveUserExcelMsg();
|
SensitiveUserExcel.SensitiveUserExcelMsg sensitiveUserExcelMsg = new SensitiveUserExcel.SensitiveUserExcelMsg();
|
||||||
BeanUtils.copyProperties(userExcel, sensitiveUserExcelMsg);
|
BeanUtils.copyProperties(sensitiveUserExcel, sensitiveUserExcelMsg);
|
||||||
sensitiveUserExcelMsg.setMsg("该用户已录入!");
|
sensitiveUserExcelMsg.setMsg("该用户已录入!");
|
||||||
sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg);
|
sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg);
|
||||||
}else{
|
// }
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//处理通用信息
|
//处理通用信息
|
||||||
UserReportPO userReportPO = new UserReportPO();
|
UserReportPO userReportPO = new UserReportPO();
|
||||||
userReportPO.setReporter(RequestUtil.getUserIndex());
|
userReportPO.setReporter(RequestUtil.getUserIndex());
|
||||||
userReportPO.setReportDate(LocalDate.now());
|
userReportPO.setReportDate(LocalDate.now());
|
||||||
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
||||||
userReportPO.setExpectedProductionDate(userExcel.getExpectedProductionDate());
|
userReportPO.setCity(sensitiveUserExcel.getCity());
|
||||||
userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode());
|
userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode());
|
||||||
//所属地市
|
if(Objects.nonNull(sensitiveUserExcel.getUserStatus())){
|
||||||
userReportPO.setCity(userExcel.getCity());
|
userReportPO.setUserStatus(sensitiveUserExcel.getUserStatus());
|
||||||
userReportPO.setResponsibleDepartment(userExcel.getResponsibleDepartment());
|
}else{
|
||||||
userReportPO.setUserStatus(userExcel.getUserStatus());
|
userReportPO.setUserStatus(SupervisionUserStatusEnum.PRODUCT.getCode());
|
||||||
userReportPO.setSubstation(userExcel.getSubstation());
|
}
|
||||||
userReportPO.setVoltageLevel(PubUtil.getDicById(userExcel.getVoltageLevel(), devVoltage));
|
userReportPO.setSubstation(sensitiveUserExcel.getSubstation());
|
||||||
userReportPO.setProjectName(userExcel.getProjectName());
|
//电压等级需要特殊处理下
|
||||||
userReportPO.setEvaluationDept(userExcel.getEvaluationDept());
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getVoltageLevel())) {
|
||||||
userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion());
|
userReportPO.setVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getVoltageLevel(), devVoltage));
|
||||||
|
}
|
||||||
|
userReportPO.setProjectName(sensitiveUserExcel.getProjectName());
|
||||||
userReportPO.setDataType(1);
|
userReportPO.setDataType(1);
|
||||||
userReportPO.setStatus(2);
|
userReportPO.setStatus(2);
|
||||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -674,250 +614,24 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
//处理敏感用户的信息
|
//处理敏感用户的信息
|
||||||
UserReportSensitivePO userReportSensitivePO = new UserReportSensitivePO();
|
UserReportSensitivePO userReportSensitivePO = new UserReportSensitivePO();
|
||||||
userReportSensitivePO.setId(userReportPO.getId());
|
userReportSensitivePO.setId(userReportPO.getId());
|
||||||
userReportSensitivePO.setPccPoint(userExcel.getPccPoint());
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getIndustry())) {
|
||||||
userReportSensitivePO.setDeviceName(userExcel.getDeviceName());
|
userReportSensitivePO.setIndustry(PubUtil.getDicById(sensitiveUserExcel.getIndustry(), industryType));
|
||||||
userReportSensitivePO.setPowerSupplyCount(userExcel.getPowerSupplyCount());
|
|
||||||
userReportSensitivePO.setEnergyQualityIndex(PubUtil.getDicById(userExcel.getEnergyQualityIndex(), indicatorType));
|
|
||||||
userReportSensitivePO.setEvaluationType(PubUtil.getDicById(userExcel.getEvaluationType(), evaluationType));
|
|
||||||
userReportSensitivePO.setAntiInterferenceTest(userExcel.getAntiInterferenceTest()+"");
|
|
||||||
userReportSensitivePO.setEvaluationChekDept(userExcel.getEvaluationChekDept());
|
|
||||||
userReportSensitivePO.setNeedGovernance(userExcel.getNeedGovernance());
|
|
||||||
userReportSensitivePO.setBackgroundTestPerformed(userExcel.getBackgroundTestPerformed());
|
|
||||||
// userReportSensitivePO.setSubstationMainWiringDiagram();
|
|
||||||
// userReportSensitivePO.setSensitiveDevices();
|
|
||||||
// userReportSensitivePO.setAntiInterferenceReport();
|
|
||||||
// userReportSensitivePO.setPowerQualityReport();
|
|
||||||
// userReportSensitivePO.setFeasibilityReport();
|
|
||||||
// userReportSensitivePO.setPreliminaryDesignDescription();
|
|
||||||
// userReportSensitivePO.setPredictionEvaluationReport();
|
|
||||||
// userReportSensitivePO.setPredictionEvaluationReviewOpinions();
|
|
||||||
// userReportSensitivePO.setAdditionalAttachments();
|
|
||||||
if (StrUtil.isNotBlank(userExcel.getIndustry())) {
|
|
||||||
userReportSensitivePO.setIndustry(PubUtil.getDicById(userExcel.getIndustry(), industryType));
|
|
||||||
}
|
}
|
||||||
userReportSensitivePO.setMaintenanceUnit(userExcel.getMaintenanceUnit());
|
userReportSensitivePO.setMaintenanceUnit(sensitiveUserExcel.getMaintenanceUnit());
|
||||||
userReportSensitivePO.setPowerSupply(userExcel.getPowerSupply());
|
userReportSensitivePO.setPowerSupply(sensitiveUserExcel.getPowerSupply());
|
||||||
if (StrUtil.isNotBlank(userExcel.getSupplyVoltageLevel())) {
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getSupplyVoltageLevel())) {
|
||||||
userReportSensitivePO.setSupplyVoltageLevel(PubUtil.getDicById(userExcel.getSupplyVoltageLevel(), devVoltage));
|
userReportSensitivePO.setSupplyVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getSupplyVoltageLevel(), devVoltage));
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(userExcel.getLoadLevel())) {
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getLoadLevel())) {
|
||||||
userReportSensitivePO.setLoadLevel(PubUtil.getDicById(userExcel.getLoadLevel(), loadLevel));
|
userReportSensitivePO.setLoadLevel(PubUtil.getDicById(sensitiveUserExcel.getLoadLevel(), loadLevel));
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(userExcel.getPowerSupplyInfo())) {
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getPowerSupplyInfo())) {
|
||||||
userReportSensitivePO.setPowerSupplyInfo(PubUtil.getDicById(userExcel.getPowerSupplyInfo(), supplyCondition));
|
userReportSensitivePO.setPowerSupplyInfo(PubUtil.getDicById(sensitiveUserExcel.getPowerSupplyInfo(), supplyCondition));
|
||||||
}
|
}
|
||||||
userReportSensitivePO.setState(DataStateEnum.ENABLE.getCode());
|
userReportSensitivePO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
userReportSensitivePOService.save(userReportSensitivePO);
|
userReportSensitivePOService.save(userReportSensitivePO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//判断有没有错误信息
|
|
||||||
if (CollectionUtil.isNotEmpty(sensitiveUserExcelMsgs)) {
|
|
||||||
ExcelUtil.exportExcel("失败列表.xlsx", SensitiveUserSExcel.SensitiveUserExcelMsg.class, sensitiveUserExcelMsgs);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return CommonResponseEnum.SUCCESS.getCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void downloadSensitiveReportTemplate() {
|
|
||||||
ExportParams exportParams = new ExportParams("干扰源用户数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "干扰源用户数据信息");
|
|
||||||
//所属地市
|
|
||||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
|
||||||
//主要非线性设备类型-冀北
|
|
||||||
List<SysDicTreePO> treeVOS = dictTreeFeignClient.queryByCodeList(DicDataTypeEnum.Major_Nonlinear_Device.getCode()).getData();
|
|
||||||
//电压等级
|
|
||||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
|
||||||
//评估单位
|
|
||||||
List<DictData> evaluationDept = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_DEPT.getCode()).getData();
|
|
||||||
//评估类型
|
|
||||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
|
||||||
|
|
||||||
Map<String, String> treeString = getTreeString("", treeVOS.get(0).getChildren());
|
|
||||||
|
|
||||||
List<PullDown> pullDowns = new ArrayList<>();
|
|
||||||
PullDown pullDown;
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(1);
|
|
||||||
pullDown.setLastCol(1);
|
|
||||||
pullDown.setStrings(Stream.of("新建电网工程", "扩建电网工程", "新建非线性负荷用户", "扩建非线性负荷用户", "新建新能源发电站", "扩建新能源发电站").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(2);
|
|
||||||
pullDown.setLastCol(2);
|
|
||||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !"风光储".equals(x.getName())&&!"超高压".equals(x.getName())).map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(4);
|
|
||||||
pullDown.setLastCol(4);
|
|
||||||
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(7);
|
|
||||||
pullDown.setLastCol(7);
|
|
||||||
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(8);
|
|
||||||
pullDown.setLastCol(8);
|
|
||||||
pullDown.setStrings(evaluationDept.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(15);
|
|
||||||
pullDown.setLastCol(15);
|
|
||||||
pullDown.setStrings(evaluationType.stream().map(DictData::getName).collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(16);
|
|
||||||
pullDown.setLastCol(16);
|
|
||||||
pullDown.setStrings(treeString.keySet().stream().collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(18);
|
|
||||||
pullDown.setLastCol(18);
|
|
||||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(19);
|
|
||||||
pullDown.setLastCol(19);
|
|
||||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
ExcelUtil.exportExcelPullDown(exportParams, "干扰源用户用户模板.xlsx", pullDowns, SensitiveReportExcel.class, new ArrayList<>());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public String importSensitiveReportData(MultipartFile file, HttpServletResponse response) {
|
|
||||||
ImportParams params = new ImportParams();
|
|
||||||
params.setHeadRows(1);//表头
|
|
||||||
params.setTitleRows(1);//标题
|
|
||||||
params.setNeedVerify(true);
|
|
||||||
params.setStartSheetIndex(0);
|
|
||||||
params.setSheetNum(1);
|
|
||||||
List<SensitiveReportExcel> sensitiveUserExcels;
|
|
||||||
try {
|
|
||||||
ExcelImportResult<SensitiveReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveReportExcel.class, params);
|
|
||||||
//如果存在非法数据,将不合格的数据导出
|
|
||||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
|
||||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_USER_ERROR);
|
|
||||||
}
|
|
||||||
//主要非线性设备类型-冀北
|
|
||||||
List<SysDicTreePO> treeVOS = dictTreeFeignClient.queryByCodeList(DicDataTypeEnum.Major_Nonlinear_Device.getCode()).getData();
|
|
||||||
//电压等级
|
|
||||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
|
||||||
Map<String, String> treeString = getTreeString("", treeVOS.get(0).getChildren());
|
|
||||||
//评估类型
|
|
||||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
|
||||||
|
|
||||||
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
|
||||||
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
|
|
||||||
for (SensitiveReportExcel reportExcel : sensitiveUserExcels) {
|
|
||||||
//先判断当前用户是否已经存在
|
|
||||||
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
userReportPOLambdaQueryWrapper.eq(UserReportPO::getProjectName, reportExcel.getProjectName())
|
|
||||||
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
|
||||||
int count = this.count(userReportPOLambdaQueryWrapper);
|
|
||||||
if (count > 0) {
|
|
||||||
//该用户已经录入
|
|
||||||
SensitiveReportExcel.SensitiveReportExcelMsg sensitiveUserExcelMsg = new SensitiveReportExcel.SensitiveReportExcelMsg();
|
|
||||||
BeanUtils.copyProperties(reportExcel, sensitiveUserExcelMsg);
|
|
||||||
sensitiveUserExcelMsg.setMsg("该用户已录入!");
|
|
||||||
sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg);
|
|
||||||
} else {
|
|
||||||
//处理通用信息
|
|
||||||
UserReportPO userReportPO = new UserReportPO();
|
|
||||||
userReportPO.setReporter(RequestUtil.getUserIndex());
|
|
||||||
userReportPO.setReportDate(LocalDate.now());
|
|
||||||
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
|
||||||
userReportPO.setExpectedProductionDate(reportExcel.getExpectedProductionDate());
|
|
||||||
userReportPO.setUserType(reportExcel.getUserType());
|
|
||||||
//所属地市
|
|
||||||
userReportPO.setCity(reportExcel.getCity());
|
|
||||||
userReportPO.setResponsibleDepartment(reportExcel.getResponsibleDepartment());
|
|
||||||
userReportPO.setUserStatus(reportExcel.getUserStatus());
|
|
||||||
userReportPO.setSubstation(reportExcel.getSubstation());
|
|
||||||
userReportPO.setVoltageLevel(PubUtil.getDicById(reportExcel.getVoltageLevel(), devVoltage));
|
|
||||||
userReportPO.setProjectName(reportExcel.getProjectName());
|
|
||||||
userReportPO.setEvaluationDept(reportExcel.getEvaluationDept());
|
|
||||||
userReportPO.setEvaluationConclusion(reportExcel.getEvaluationConclusion());
|
|
||||||
userReportPO.setDataType(1);
|
|
||||||
userReportPO.setStatus(2);
|
|
||||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
|
||||||
this.baseMapper.insert(userReportPO);
|
|
||||||
if (CollectionUtil.newArrayList(
|
|
||||||
UserNatureEnum.BUILD_POWER_GRID.getCode(),
|
|
||||||
UserNatureEnum.EXTEND_POWER_GRID.getCode()
|
|
||||||
).contains(userReportPO.getUserType())) {
|
|
||||||
//电网工程类用户额外数据
|
|
||||||
UserReportProjectPO userReportProjectPO = new UserReportProjectPO();
|
|
||||||
userReportProjectPO.setId(userReportPO.getId());
|
|
||||||
if(ObjectUtil.isNotEmpty(reportExcel.getNonlinearLoadType())){
|
|
||||||
userReportProjectPO.setAgreementCapacity(reportExcel.getUserAgreementCapacity().doubleValue());
|
|
||||||
}
|
|
||||||
if(StrUtil.isNotBlank(reportExcel.getNonlinearLoadType())){
|
|
||||||
userReportProjectPO.setNonlinearDeviceType(treeString.containsKey(reportExcel.getNonlinearLoadType()) ? treeString.get(reportExcel.getNonlinearLoadType()) : null);
|
|
||||||
}
|
|
||||||
|
|
||||||
userReportProjectPO.setNeedGovernance(reportExcel.getNeedGovernance());
|
|
||||||
userReportProjectPO.setBackgroundTestPerformed(reportExcel.getBackgroundTestPerformed());
|
|
||||||
// userReportProjectPO.setFeasibilityReport();
|
|
||||||
// userReportProjectPO.setPreliminaryDesignDescription();
|
|
||||||
// userReportProjectPO.setPredictionEvaluationReport();
|
|
||||||
// userReportProjectPO.setPredictionEvaluationReviewOpinions();
|
|
||||||
// userReportProjectPO.setAdditionalAttachments();
|
|
||||||
userReportProjectPO.setState(DataStateEnum.ENABLE.getCode());
|
|
||||||
userReportProjectPOService.saveOrUpdate(userReportProjectPO);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.newArrayList(
|
|
||||||
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
|
|
||||||
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
|
|
||||||
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
|
|
||||||
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
|
|
||||||
).contains(userReportPO.getUserType())) {
|
|
||||||
//非线性负荷用户 & 新能源发电站用户
|
|
||||||
UserReportSubstationPO userReportSubstationPO = new UserReportSubstationPO();
|
|
||||||
userReportSubstationPO.setId(userReportPO.getId());
|
|
||||||
userReportSubstationPO.setPccPoint(reportExcel.getPccPoint());
|
|
||||||
userReportSubstationPO.setBaseShortCircuitCapacity(reportExcel.getBaseShortCircuitCapacity());
|
|
||||||
userReportSubstationPO.setMinShortCircuitCapacity(reportExcel.getMinShortCircuitCapacity());
|
|
||||||
userReportSubstationPO.setPccEquipmentCapacity(reportExcel.getPccEquipmentCapacity());
|
|
||||||
userReportSubstationPO.setUserAgreementCapacity(reportExcel.getUserAgreementCapacity());
|
|
||||||
userReportSubstationPO.setEvaluationType(PubUtil.getDicById(reportExcel.getEvaluationType(), evaluationType));
|
|
||||||
if(StrUtil.isNotBlank(reportExcel.getNonlinearLoadType())){
|
|
||||||
userReportSubstationPO.setNonlinearLoadType(treeString.containsKey(reportExcel.getNonlinearLoadType()) ? treeString.get(reportExcel.getNonlinearLoadType()) : null);
|
|
||||||
}
|
|
||||||
userReportSubstationPO.setEvaluationChekDept(reportExcel.getEvaluationChekDept());
|
|
||||||
userReportSubstationPO.setNeedGovernance(reportExcel.getNeedGovernance());
|
|
||||||
userReportSubstationPO.setBackgroundTestPerformed(reportExcel.getBackgroundTestPerformed());
|
|
||||||
// userReportSubstationPO.setSubstationMainWiringDiagram();
|
|
||||||
// userReportSubstationPO.setFeasibilityReport();
|
|
||||||
// userReportSubstationPO.setPreliminaryDesignDescription();
|
|
||||||
// userReportSubstationPO.setPredictionEvaluationReport();
|
|
||||||
// userReportSubstationPO.setPredictionEvaluationReviewOpinions();
|
|
||||||
// userReportSubstationPO.setAdditionalAttachments();
|
|
||||||
userReportSubstationPO.setState(DataStateEnum.ENABLE.getCode());
|
|
||||||
userReportSubstationPOService.saveOrUpdate(userReportSubstationPO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//判断有没有错误信息
|
//判断有没有错误信息
|
||||||
if (CollectionUtil.isNotEmpty(sensitiveUserExcelMsgs)) {
|
if (CollectionUtil.isNotEmpty(sensitiveUserExcelMsgs)) {
|
||||||
ExcelUtil.exportExcel("失败列表.xlsx", SensitiveUserExcel.SensitiveUserExcelMsg.class, sensitiveUserExcelMsgs);
|
ExcelUtil.exportExcel("失败列表.xlsx", SensitiveUserExcel.SensitiveUserExcelMsg.class, sensitiveUserExcelMsgs);
|
||||||
@@ -926,20 +640,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
return CommonResponseEnum.SUCCESS.getCode();
|
return CommonResponseEnum.SUCCESS.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String,String> getTreeString(String name, List<SysDicTreePO> treeVOS) {
|
|
||||||
Map<String,String> info = new LinkedHashMap<>();
|
|
||||||
for (SysDicTreePO sysMenuDtoChild : treeVOS) {
|
|
||||||
if (sysMenuDtoChild.getLevel() == 3) {
|
|
||||||
name = sysMenuDtoChild.getId()+"-"+sysMenuDtoChild.getName();
|
|
||||||
}
|
|
||||||
if (CollUtil.isNotEmpty(sysMenuDtoChild.getChildren())) {
|
|
||||||
info.putAll(getTreeString(name, sysMenuDtoChild.getChildren()));
|
|
||||||
} else {
|
|
||||||
info.put(name.split("-")[1],name.split("-")[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有字段为null的属性名
|
* 获取所有字段为null的属性名
|
||||||
|
|||||||
Reference in New Issue
Block a user