敏感及重要用户功能
This commit is contained in:
@@ -2,7 +2,6 @@ package com.njcn.advance.pojo.dto.govern.voltage;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
import cn.afterturn.easypoi.handler.inter.IExcelModel;
|
import cn.afterturn.easypoi.handler.inter.IExcelModel;
|
||||||
import com.njcn.device.pq.pojo.constant.DeviceValidMessage;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@@ -25,8 +24,6 @@ public class SgEventExcel implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂降起始时间
|
* 暂降起始时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
|
|||||||
categoryVOQueryWrapper.like("bpm_category.code", bpmCategoryQueryParam.getCode());
|
categoryVOQueryWrapper.like("bpm_category.code", bpmCategoryQueryParam.getCode());
|
||||||
}
|
}
|
||||||
categoryVOQueryWrapper.eq("bpm_category.state", DataStateEnum.ENABLE.getCode());
|
categoryVOQueryWrapper.eq("bpm_category.state", DataStateEnum.ENABLE.getCode());
|
||||||
categoryVOQueryWrapper.orderByDesc("bpm_category.update_time");
|
|
||||||
categoryVOQueryWrapper.orderByAsc("bpm_category.sort");
|
categoryVOQueryWrapper.orderByAsc("bpm_category.sort");
|
||||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(bpmCategoryQueryParam), PageFactory.getPageSize(bpmCategoryQueryParam)), categoryVOQueryWrapper);
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(bpmCategoryQueryParam), PageFactory.getPageSize(bpmCategoryQueryParam)), categoryVOQueryWrapper);
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
|
|||||||
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
|
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
|
||||||
}
|
}
|
||||||
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
||||||
bpmSignVOQueryWrapper.orderByDesc("bpm_sign.update_time");
|
|
||||||
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
||||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(bpmSignQueryParam), PageFactory.getPageSize(bpmSignQueryParam)), bpmSignVOQueryWrapper);
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(bpmSignQueryParam), PageFactory.getPageSize(bpmSignQueryParam)), bpmSignVOQueryWrapper);
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ public class GenerateCode {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
List<Module> modules = Stream.of(
|
List<Module> modules = Stream.of(
|
||||||
new Module("hongawen", "com.njcn.supervision", "leaflet", Stream.of(
|
new Module("hongawen", "com.njcn.supervision", "survey", Stream.of(
|
||||||
"supervision_warning_leaflet"
|
"supervision_survey_plan",
|
||||||
|
"supervision_survey_test"
|
||||||
).collect(Collectors.toList()), "supervision_")
|
).collect(Collectors.toList()), "supervision_")
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
generateJavaFile(modules);
|
generateJavaFile(modules);
|
||||||
|
|||||||
@@ -74,6 +74,24 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理好的表格直接下载
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
*/
|
||||||
|
public static void exportExcelByWorkbook(String fileName, Workbook workbook) {
|
||||||
|
HttpServletResponse response = HttpServletUtil.getResponse();
|
||||||
|
try (ServletOutputStream outputStream = response.getOutputStream()) {
|
||||||
|
fileName = URLEncoder.encode(fileName, CharsetUtil.UTF_8);
|
||||||
|
response.reset();
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
||||||
|
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(">>> 导出数据异常:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定名称、数据下载报表(带指定标题将*显示比必填信息)
|
* 指定名称、数据下载报表(带指定标题将*显示比必填信息)
|
||||||
*
|
*
|
||||||
@@ -203,7 +221,6 @@ public class ExcelUtil {
|
|||||||
* @param strings 下拉内容
|
* @param strings 下拉内容
|
||||||
*/
|
*/
|
||||||
public static void selectList(Workbook workbook, int firstCol, int lastCol, String[] strings) {
|
public static void selectList(Workbook workbook, int firstCol, int lastCol, String[] strings) {
|
||||||
|
|
||||||
Sheet sheet = workbook.getSheetAt(0);
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
// 生成下拉列表
|
// 生成下拉列表
|
||||||
// 只对(x,x)单元格有效
|
// 只对(x,x)单元格有效
|
||||||
@@ -218,5 +235,4 @@ public class ExcelUtil {
|
|||||||
sheet.addValidationData(validation);
|
sheet.addValidationData(validation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,10 +76,17 @@ public class PubUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getDicById(String name, List<DictData> dictData) {
|
public static String getDicById(String name, List<DictData> dictData) {
|
||||||
List<DictData> dictDataList = dictData.stream().filter(x -> x.getName().indexOf(name) != -1).collect(Collectors.toList());
|
//先匹配有没有完全吻合的
|
||||||
|
List<DictData> compareDictDataList = dictData.stream().filter(x -> x.getName().equalsIgnoreCase(name)).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isNotEmpty(compareDictDataList)){
|
||||||
|
return compareDictDataList.get(0).getId();
|
||||||
|
}
|
||||||
|
//如果没有匹配到,则判断是否有包含的
|
||||||
|
List<DictData> dictDataList = dictData.stream().filter(x -> x.getName().contains(name)).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(dictDataList)) {
|
if (CollUtil.isNotEmpty(dictDataList)) {
|
||||||
return dictDataList.get(0).getId();
|
return dictDataList.get(0).getId();
|
||||||
}
|
}
|
||||||
|
//实在没有匹配到则返回空
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
plan_no, general_survey_start_time, general_survey_end_time, general_survey_time,
|
plan_no, general_survey_start_time, general_survey_end_time, general_survey_time,
|
||||||
general_survey_leader, sub_id, sub_name, voltage_level, busbar_id, busbar_name, measurement_point_id,
|
general_survey_leader, sub_id, sub_name, voltage_level, busbar_id, busbar_name, measurement_point_id,
|
||||||
is_problem
|
is_problem
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
org_no, plan_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time,
|
org_no, plan_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time,
|
||||||
leader, `status`, description, is_file_upload, file_count, file_path, upload_time
|
leader, `status`, description, is_file_upload, file_count, file_path, upload_time
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -16,6 +16,7 @@ public enum SupervisionResponseEnum {
|
|||||||
* A00550 ~ A00649
|
* A00550 ~ A00649
|
||||||
*/
|
*/
|
||||||
SUPERVISION_COMMON_ERROR("A00550","监督管理模块异常"),
|
SUPERVISION_COMMON_ERROR("A00550","监督管理模块异常"),
|
||||||
|
IMPORT_SENSITIVE_USER_ERROR("A00550","导入敏感及重要用户失败"),
|
||||||
NO_POWER("A00550","不能操作非自己创建的任务!")
|
NO_POWER("A00550","不能操作非自己创建的任务!")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.njcn.supervision.pojo.dto;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SensitiveUserExcel implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属地市
|
||||||
|
*/
|
||||||
|
@Excel(name = "供电单位", width = 30)
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "*用户名称", width = 30)
|
||||||
|
@NotBlank(message = "用户名称不能为空")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 工程预期投产日期
|
||||||
|
// */
|
||||||
|
// @Excel(name="工程预期投产日期(yyyy-MM-dd)",format = "yyyy-MM-dd",width = 45)
|
||||||
|
// private String expectedProductionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态
|
||||||
|
*/
|
||||||
|
@Excel(name = "用户状态", width = 20, replace = {"可研_0", "建设_1", "运行_2", "退运_3"})
|
||||||
|
private Integer userStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站
|
||||||
|
*/
|
||||||
|
@Excel(name = "变电站", width = 30)
|
||||||
|
private String substation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
@Excel(name = "电压等级(kV)", width = 20)
|
||||||
|
private String voltageLevel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业
|
||||||
|
*/
|
||||||
|
@Excel(name = "行业", width = 30)
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位
|
||||||
|
*/
|
||||||
|
@Excel(name = "运维单位", width = 30)
|
||||||
|
private String maintenanceUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供电电源
|
||||||
|
*/
|
||||||
|
@Excel(name = "供电电源", width = 40)
|
||||||
|
private String powerSupply;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入电压等级
|
||||||
|
*/
|
||||||
|
@Excel(name = "接入电压等级(kV)", width = 20)
|
||||||
|
private String supplyVoltageLevel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负荷级别
|
||||||
|
*/
|
||||||
|
@Excel(name = "负荷级别", width = 20)
|
||||||
|
private String loadLevel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供电电源情况(单电源、双电源、多电源)
|
||||||
|
*/
|
||||||
|
@Excel(name = "供电电源情况", width = 20)
|
||||||
|
private String powerSupplyInfo;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 是否覆盖
|
||||||
|
// */
|
||||||
|
// @Excel(name = "是否覆盖", width = 20, replace = {"否_0", "是_1"})
|
||||||
|
// private Integer overlay = 0;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SensitiveUserExcelMsg extends SensitiveUserExcel implements Serializable {
|
||||||
|
@Excel(name = "错误信息描述")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.survey;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SurveyPlanParam implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "负责单位ID")
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "普测计划名称")
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划开始时间")
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划结束时间")
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 关联系统内变电站;1 用户手动输入变电站
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "0 关联系统内变电站;1 用户手动输入变电站")
|
||||||
|
private Integer customSubstationFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变电站台账ID或者用户手动输入的变电站名称")
|
||||||
|
private String substation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "流程实例id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程实例id列表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "历史流程实例id列表")
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SurveyPlanUpdateParam extends SurveyPlanParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = "索引不能为空")
|
||||||
|
private String Id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SurveyPlanQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测负责单位
|
||||||
|
*/
|
||||||
|
String deptIndex;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.survey;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SurveyTestParam extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划表id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "普测计划表id")
|
||||||
|
private String planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "负责单位id")
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计划完成时间")
|
||||||
|
private LocalDate completeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试负责人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "测试负责人")
|
||||||
|
private String completeBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试报告
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "测试报告")
|
||||||
|
private String testReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有问题 0 没有问题 1 有问题
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否有问题")
|
||||||
|
private Integer problemFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "问题描述")
|
||||||
|
private String problemDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "测试审批状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "流程实例id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程id列表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "历史流程id列表")
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SurveyTestUpdateParam extends SurveyTestParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = "索引不能为空")
|
||||||
|
private String Id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SurveyTestQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("supervision_survey_plan")
|
||||||
|
public class SurveyPlan extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划编号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位ID
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 关联系统内变电站;1 用户手动输入变电站
|
||||||
|
*/
|
||||||
|
private Integer customSubstationFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
private String substation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程实例id列表
|
||||||
|
*/
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("supervision_survey_test")
|
||||||
|
public class SurveyTest extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测测试管理表id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划表id
|
||||||
|
*/
|
||||||
|
private String planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位id
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
private LocalDate completeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试负责人
|
||||||
|
*/
|
||||||
|
private String completeBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试报告
|
||||||
|
*/
|
||||||
|
private String testReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有问题 0 没有问题 1 有问题
|
||||||
|
*/
|
||||||
|
private Integer problemFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
private String problemDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程id列表
|
||||||
|
*/
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -135,4 +135,5 @@ public class UserReportPO extends BaseEntity {
|
|||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,5 +148,36 @@ public class UserReportSensitivePO extends BaseEntity {
|
|||||||
@TableField(value = "`state`")
|
@TableField(value = "`state`")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供电电源
|
||||||
|
*/
|
||||||
|
@TableField(value = "power_supply")
|
||||||
|
private String powerSupply;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入电压等级
|
||||||
|
*/
|
||||||
|
@TableField(value = "supply_voltage_level")
|
||||||
|
private String supplyVoltageLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负荷级别
|
||||||
|
*/
|
||||||
|
@TableField(value = "load_level")
|
||||||
|
private String loadLevel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供电电源情况(单电源、双电源、多电源)
|
||||||
|
*/
|
||||||
|
@TableField(value = "power_supply_info")
|
||||||
|
private String powerSupplyInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位
|
||||||
|
*/
|
||||||
|
@TableField(value = "maintenance_unit")
|
||||||
|
private String maintenanceUnit;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package com.njcn.supervision.pojo.vo.survey;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SurveyPlanVO extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划编号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位ID
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 关联系统内变电站;1 用户手动输入变电站
|
||||||
|
*/
|
||||||
|
private Integer customSubstationFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
|
*/
|
||||||
|
private String substation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程实例id列表
|
||||||
|
*/
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.supervision.pojo.vo.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SurveyTestVO extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测测试管理表id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划表id
|
||||||
|
*/
|
||||||
|
private String planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责单位id
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
private LocalDate completeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试负责人
|
||||||
|
*/
|
||||||
|
private String completeBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试报告
|
||||||
|
*/
|
||||||
|
private String testReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有问题 0 没有问题 1 有问题
|
||||||
|
*/
|
||||||
|
private Integer problemFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
private String problemDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史流程id列表
|
||||||
|
*/
|
||||||
|
private String historyInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -61,7 +61,7 @@ public class QuitRunningDeviceController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("更新设备退运")
|
@ApiOperation("重新发起设备退运")
|
||||||
@ApiImplicitParam(name = "quitRunningDeviceUpdateParam", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "quitRunningDeviceUpdateParam", value = "实体参数", required = true)
|
||||||
public HttpResult<String> updateQuitRunningDevice(@RequestBody @Validated QuitRunningDeviceParam.QuitRunningDeviceUpdateParam quitRunningDeviceUpdateParam) {
|
public HttpResult<String> updateQuitRunningDevice(@RequestBody @Validated QuitRunningDeviceParam.QuitRunningDeviceUpdateParam quitRunningDeviceUpdateParam) {
|
||||||
String methodDescribe = getMethodDescribe("quitRunningDeviceUpdateParam");
|
String methodDescribe = getMethodDescribe("quitRunningDeviceUpdateParam");
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.njcn.supervision.controller.survey;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
|
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/surveyPlan")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "普测计划流程管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SurveyPlanController extends BaseController {
|
||||||
|
|
||||||
|
private final ISurveyPlanService surveyPlanService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/surveyPlanPage")
|
||||||
|
@ApiOperation("分页查询当前用户能看到的普测计划")
|
||||||
|
@ApiImplicitParam(name = "surveyPlanQueryParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<SurveyPlanVO>> surveyPlanPage(@RequestBody @Validated SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("surveyPlanPage");
|
||||||
|
Page<SurveyPlanVO> out = surveyPlanService.surveyPlanPage(surveyPlanQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增普测计划")
|
||||||
|
@ApiImplicitParam(name = "surveyPlanParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> addSurveyPlan(@RequestBody @Validated SurveyPlanParam surveyPlanParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("addSurveyPlan");
|
||||||
|
String planId = surveyPlanService.addSurveyPlan(surveyPlanParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, planId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("重新发起普测计划")
|
||||||
|
@ApiImplicitParam(name = "surveyPlanUpdateParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateSurveyPlan(@RequestBody @Validated SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateSurveyPlan");
|
||||||
|
String runningDeviceId = surveyPlanService.updateSurveyPlan(surveyPlanUpdateParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
@ApiOperation("取消普测计划")
|
||||||
|
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
|
||||||
|
public HttpResult<String> cancelSurveyPlan(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
String methodDescribe = getMethodDescribe("cancelSurveyPlan");
|
||||||
|
String runningDeviceId = surveyPlanService.cancelSurveyPlan(cancelReqVO);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/updateSurveyPlanStatus")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@Operation(summary = "更新普测计划流程状态")
|
||||||
|
public HttpResult<Object> updateSurveyPlanStatus(String businessKey, Integer status) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateSurveyPlanStatus");
|
||||||
|
surveyPlanService.updateSurveyPlanStatus(businessKey, status);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.njcn.supervision.controller.survey;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||||
|
import com.njcn.supervision.service.survey.ISurveyTestService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/surveyTest")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "普测计划流程管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SurveyTestController extends BaseController {
|
||||||
|
|
||||||
|
private final ISurveyTestService surveyTestService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/surveyTestPage")
|
||||||
|
@ApiOperation("分页查询当前用户能看到的普测测试")
|
||||||
|
@ApiImplicitParam(name = "surveyTestQueryParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<SurveyTestVO>> surveyTestPage(@RequestBody @Validated SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("surveyTestPage");
|
||||||
|
Page<SurveyTestVO> out = surveyTestService.surveyTestPage(surveyTestQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增普测测试")
|
||||||
|
@ApiImplicitParam(name = "surveyTestParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> addSurveyTest(@RequestBody @Validated SurveyTestParam surveyTestParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("addSurveyTest");
|
||||||
|
String planId = surveyTestService.addSurveyTest(surveyTestParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, planId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("重新发起普测测试")
|
||||||
|
@ApiImplicitParam(name = "surveyTestUpdateParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateSurveyTest(@RequestBody @Validated SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateSurveyTest");
|
||||||
|
String runningDeviceId = surveyTestService.updateSurveyTest(surveyTestUpdateParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
@ApiOperation("取消普测测试")
|
||||||
|
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
|
||||||
|
public HttpResult<String> cancelSurveyTest(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
String methodDescribe = getMethodDescribe("cancelSurveyTest");
|
||||||
|
String runningDeviceId = surveyTestService.cancelSurveyTest(cancelReqVO);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/updateSurveyTestStatus")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@Operation(summary = "更新普测测试流程状态")
|
||||||
|
public HttpResult<Object> updateSurveyTestStatus(String businessKey, Integer status) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateSurveyTestStatus");
|
||||||
|
surveyTestService.updateSurveyTestStatus(businessKey, status);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,13 +1,20 @@
|
|||||||
package com.njcn.supervision.controller.user;
|
package com.njcn.supervision.controller.user;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
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.poi.util.PoiUtil;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.pojo.dto.SensitiveUserExcel;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||||
import com.njcn.supervision.service.user.UserReportPOService;
|
import com.njcn.supervision.service.user.UserReportPOService;
|
||||||
@@ -20,8 +27,11 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰源用户管理
|
* 干扰源用户管理
|
||||||
@@ -39,21 +49,21 @@ public class UserReportManageController extends BaseController {
|
|||||||
|
|
||||||
private final UserReportPOService userReportPOService;
|
private final UserReportPOService userReportPOService;
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增干扰源用户")
|
@ApiOperation("新增干扰源用户")
|
||||||
@ApiImplicitParam(name = "userReportParam", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "userReportParam", value = "实体参数", required = true)
|
||||||
public HttpResult<String> addUserReport(@RequestBody @Validated UserReportParam userReportParam){
|
public HttpResult<String> addUserReport(@RequestBody @Validated UserReportParam userReportParam) {
|
||||||
String methodDescribe = getMethodDescribe("addUserReport");
|
String methodDescribe = getMethodDescribe("addUserReport");
|
||||||
String userReportId = userReportPOService.addUserReport(userReportParam);
|
String userReportId = userReportPOService.addUserReport(userReportParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportId, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportId, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/auditUserReport")
|
@PostMapping("/auditUserReport")
|
||||||
@ApiOperation("修改干扰源用户")
|
@ApiOperation("修改干扰源用户")
|
||||||
@ApiImplicitParam(name = "userReportUpdate", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "userReportUpdate", value = "实体参数", required = true)
|
||||||
public HttpResult<Boolean> auditUserReport(@RequestBody @Validated UserReportParam.UserReportUpdate userReportUpdate){
|
public HttpResult<Boolean> auditUserReport(@RequestBody @Validated UserReportParam.UserReportUpdate userReportUpdate) {
|
||||||
String methodDescribe = getMethodDescribe("auditUserReport");
|
String methodDescribe = getMethodDescribe("auditUserReport");
|
||||||
boolean res = userReportPOService.auditUserReport(userReportUpdate);
|
boolean res = userReportPOService.auditUserReport(userReportUpdate);
|
||||||
|
|
||||||
@@ -65,7 +75,7 @@ public class UserReportManageController extends BaseController {
|
|||||||
@PostMapping("/getUserReport")
|
@PostMapping("/getUserReport")
|
||||||
@ApiOperation("分页查询当前用户能看到的用户建档数据")
|
@ApiOperation("分页查询当前用户能看到的用户建档数据")
|
||||||
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
||||||
public HttpResult<Page<UserReportVO>> getUserReport(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam){
|
public HttpResult<Page<UserReportVO>> getUserReport(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
String methodDescribe = getMethodDescribe("getUserReport");
|
String methodDescribe = getMethodDescribe("getUserReport");
|
||||||
Page<UserReportVO> out = userReportPOService.getUserReport(userReportQueryParam);
|
Page<UserReportVO> out = userReportPOService.getUserReport(userReportQueryParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
@@ -74,7 +84,7 @@ public class UserReportManageController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/removeUserReport")
|
@PostMapping("/removeUserReport")
|
||||||
@ApiOperation("删除干扰源用户记录")
|
@ApiOperation("删除干扰源用户记录")
|
||||||
public HttpResult<Boolean> removeUserReport(@RequestParam("ids") List<String> ids){
|
public HttpResult<Boolean> removeUserReport(@RequestParam("ids") List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("removeUserReport");
|
String methodDescribe = getMethodDescribe("removeUserReport");
|
||||||
Boolean flag = userReportPOService.removeUserReport(ids);
|
Boolean flag = userReportPOService.removeUserReport(ids);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
@@ -90,29 +100,28 @@ public class UserReportManageController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/updateUserReportStatus")
|
@GetMapping("/updateUserReportStatus")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@Operation(summary = "更新用户数据流程状态")
|
@Operation(summary = "更新用户数据流程状态")
|
||||||
public HttpResult<Object> updateUserReportStatus(String businessKey,Integer status) {
|
public HttpResult<Object> updateUserReportStatus(String businessKey, Integer status) {
|
||||||
String methodDescribe = getMethodDescribe("updateUserReportStatus");
|
String methodDescribe = getMethodDescribe("updateUserReportStatus");
|
||||||
userReportPOService.updateUserReportStatus(businessKey,status);
|
userReportPOService.updateUserReportStatus(businessKey, status);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/updateUserStatus")
|
@GetMapping("/updateUserStatus")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@Operation(summary = "更新干扰源用户状态")
|
@Operation(summary = "更新干扰源用户状态")
|
||||||
public HttpResult<Object> updateUserStatus(String lineId,Integer userStatus) {
|
public HttpResult<Object> updateUserStatus(String lineId, Integer userStatus) {
|
||||||
String methodDescribe = getMethodDescribe("updateUserStatus");
|
String methodDescribe = getMethodDescribe("updateUserStatus");
|
||||||
userReportPOService.updateUserStatus(lineId,userStatus);
|
userReportPOService.updateUserStatus(lineId, userStatus);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getUserReportList")
|
@PostMapping("/getUserReportList")
|
||||||
@ApiOperation("查询干扰源下拉列表")
|
@ApiOperation("查询干扰源下拉列表")
|
||||||
public HttpResult<List<UserReportVO>> getUserReportList(){
|
public HttpResult<List<UserReportVO>> getUserReportList() {
|
||||||
String methodDescribe = getMethodDescribe("getUserReportList");
|
String methodDescribe = getMethodDescribe("getUserReportList");
|
||||||
List<UserReportVO> out = userReportPOService.getUserReportList();
|
List<UserReportVO> out = userReportPOService.getUserReportList();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
@@ -122,12 +131,22 @@ public class UserReportManageController extends BaseController {
|
|||||||
@PostMapping("/getInterferenceUserPage")
|
@PostMapping("/getInterferenceUserPage")
|
||||||
@ApiOperation("分页查询干扰源用户台账")
|
@ApiOperation("分页查询干扰源用户台账")
|
||||||
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
||||||
public HttpResult<Page<UserReportVO>> getInterferenceUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam){
|
public HttpResult<Page<UserReportVO>> getInterferenceUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
String methodDescribe = getMethodDescribe("getInterferenceUserPage");
|
String methodDescribe = getMethodDescribe("getInterferenceUserPage");
|
||||||
Page<UserReportVO> out = userReportPOService.getInterferenceUserPage(userReportQueryParam);
|
Page<UserReportVO> out = userReportPOService.getInterferenceUserPage(userReportQueryParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getSensitiveUserPage")
|
||||||
|
@ApiOperation("分页查询敏感及重要用户台账")
|
||||||
|
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<UserReportVO>> getSensitiveUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getSensitiveUserPage");
|
||||||
|
Page<UserReportVO> out = userReportPOService.getSensitiveUserPage(userReportQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/cancel")
|
@PostMapping("/cancel")
|
||||||
@ApiOperation("取消")
|
@ApiOperation("取消")
|
||||||
@@ -139,4 +158,25 @@ public class UserReportManageController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/downloadSensitiveUserTemplate")
|
||||||
|
@ApiOperation("下载敏感及重要用户模板")
|
||||||
|
public void downloadSensitiveUserTemplate() {
|
||||||
|
userReportPOService.downloadSensitiveUserTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/importSensitiveUserData")
|
||||||
|
@ApiOperation("批量导入敏感及重要用户")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
public HttpResult<String> importSensitiveUserData(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
|
||||||
|
String methodDescribe = getMethodDescribe("importSensitiveUserData");
|
||||||
|
//批量录入暂降数据
|
||||||
|
if (Objects.isNull(userReportPOService.importSensitiveUserData(file, response))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.supervision.mapper.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
public interface SurveyPlanMapper extends BaseMapper<SurveyPlan> {
|
||||||
|
|
||||||
|
Page<SurveyPlanVO> surveyPlanPage(Page<Object> objectPage, @Param("ew") QueryWrapper<SurveyPlanVO> surveyPlanVOQueryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.supervision.mapper.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
public interface SurveyTestMapper extends BaseMapper<SurveyTest> {
|
||||||
|
|
||||||
|
Page<SurveyTestVO> surveyTestPage(Page<Object> objectPage, @Param("ew")QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper);
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
plan_no, sub_id, sub_name, voltage_level, capacity, measurement_point_id, is_problem,
|
plan_no, sub_id, sub_name, voltage_level, capacity, measurement_point_id, is_problem,
|
||||||
is_survey
|
is_survey
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.supervision.mapper.survey.SurveyPlanMapper">
|
||||||
|
|
||||||
|
<select id="surveyPlanPage" resultType="SurveyPlanVO">
|
||||||
|
SELECT supervision_survey_plan.*
|
||||||
|
FROM supervision_survey_plan supervision_survey_plan
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.supervision.mapper.survey.SurveyTestMapper">
|
||||||
|
|
||||||
|
<select id="surveyTestPage" resultType="SurveyTestVO">
|
||||||
|
SELECT supervision_survey_test.*
|
||||||
|
FROM supervision_survey_test supervision_survey_test
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.supervision.service.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
public interface ISurveyPlanService extends IService<SurveyPlan> {
|
||||||
|
|
||||||
|
Page<SurveyPlanVO> surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam);
|
||||||
|
|
||||||
|
String addSurveyPlan(SurveyPlanParam surveyPlanParam);
|
||||||
|
|
||||||
|
String updateSurveyPlan(SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam);
|
||||||
|
|
||||||
|
String cancelSurveyPlan(BpmProcessInstanceCancelParam cancelReqVO);
|
||||||
|
|
||||||
|
void updateSurveyPlanStatus(String businessKey, Integer status);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.supervision.service.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
public interface ISurveyTestService extends IService<SurveyTest> {
|
||||||
|
|
||||||
|
Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam);
|
||||||
|
|
||||||
|
String addSurveyTest(SurveyTestParam surveyTestParam);
|
||||||
|
|
||||||
|
String updateSurveyTest(SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam);
|
||||||
|
|
||||||
|
String cancelSurveyTest(BpmProcessInstanceCancelParam cancelReqVO);
|
||||||
|
|
||||||
|
void updateSurveyTestStatus(String businessKey, Integer status);
|
||||||
|
}
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
package com.njcn.supervision.service.survey.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||||
|
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
|
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||||
|
import com.njcn.supervision.service.survey.ISurveyPlanService;
|
||||||
|
import com.njcn.supervision.utils.InstanceUtil;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测计划流程表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyPlan> implements ISurveyPlanService {
|
||||||
|
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预告警单的反馈单对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "survey_plan";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SurveyPlanVO> surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) {
|
||||||
|
QueryWrapper<SurveyPlanVO> surveyPlanVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
if (Objects.nonNull(surveyPlanQueryParam)) {
|
||||||
|
//添加上时间范围
|
||||||
|
surveyPlanVOQueryWrapper.between("supervision_survey_plan.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchEndTime())));
|
||||||
|
//根据工程名称模糊搜索
|
||||||
|
if (StrUtil.isNotBlank(surveyPlanQueryParam.getSearchValue())) {
|
||||||
|
surveyPlanVOQueryWrapper.like("supervision_survey_plan.plan_name", surveyPlanQueryParam.getSearchValue());
|
||||||
|
}
|
||||||
|
//筛选普测负责单位
|
||||||
|
if (StrUtil.isNotBlank(surveyPlanQueryParam.getDeptIndex())) {
|
||||||
|
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyPlanQueryParam.getDeptIndex()).getData();
|
||||||
|
surveyPlanVOQueryWrapper.in("supervision_survey_plan.dept_id", deptIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||||
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
|
surveyPlanVOQueryWrapper.in("supervision_survey_plan.Create_By", colleaguesIds)
|
||||||
|
.eq("supervision_survey_plan.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("supervision_survey_plan.Update_Time");
|
||||||
|
Page<SurveyPlanVO> surveyPlanVOPage = this.baseMapper.surveyPlanPage(new Page<>(PageFactory.getPageNum(surveyPlanQueryParam), PageFactory.getPageSize(surveyPlanQueryParam)), surveyPlanVOQueryWrapper);
|
||||||
|
List<SurveyPlanVO> records = surveyPlanVOPage.getRecords();
|
||||||
|
if (CollectionUtil.isNotEmpty(records)) {
|
||||||
|
for (SurveyPlanVO record : records) {
|
||||||
|
//回显部门名称
|
||||||
|
record.setDeptName(deptFeignClient.getDeptById(record.getDeptId()).getData().getName());
|
||||||
|
//回显变电站名称
|
||||||
|
if (record.getCustomSubstationFlag() == 0) {
|
||||||
|
//关联台账内的变电站名称
|
||||||
|
// record.setSubstationName(lineFeignClient.getSubstationInfo(record.getSubstation()).getData().getName());
|
||||||
|
String substation = record.getSubstation();
|
||||||
|
String[] subIds = substation.split(StrPool.COMMA);
|
||||||
|
String subName = "";
|
||||||
|
for (String subId : subIds) {
|
||||||
|
String name = lineFeignClient.getSubstationInfo(subId).getData().getName();
|
||||||
|
subName = subName.concat(StrPool.COMMA).concat(name);
|
||||||
|
}
|
||||||
|
subName = subName.substring(1);
|
||||||
|
record.setSubstation(subName);
|
||||||
|
} else {
|
||||||
|
record.setSubstationName(record.getSubstation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return surveyPlanVOPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String addSurveyPlan(SurveyPlanParam surveyPlanParam) {
|
||||||
|
//排除重复计划的策略暂时未知,待后期有人提出了,再去做,todo...
|
||||||
|
SurveyPlan surveyPlan = new SurveyPlan();
|
||||||
|
BeanUtils.copyProperties(surveyPlanParam, surveyPlan);
|
||||||
|
surveyPlan.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
this.save(surveyPlan);
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
surveyPlan.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(surveyPlan);
|
||||||
|
return surveyPlan.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String updateSurveyPlan(SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam) {
|
||||||
|
SurveyPlan surveyPlan = this.baseMapper.selectById(surveyPlanUpdateParam.getId());
|
||||||
|
//判断是否有权限操作
|
||||||
|
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), surveyPlan.getCreateBy());
|
||||||
|
surveyPlanUpdateParam.setStatus(surveyPlan.getStatus());
|
||||||
|
surveyPlanUpdateParam.setProcessInstanceId(surveyPlan.getProcessInstanceId());
|
||||||
|
surveyPlanUpdateParam.setHistoryInstanceId(surveyPlan.getHistoryInstanceId());
|
||||||
|
BeanUtils.copyProperties(surveyPlanUpdateParam, surveyPlan);
|
||||||
|
surveyPlan.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
//处理历史流程id列表
|
||||||
|
String historyInstanceIds = InstanceUtil.dealHistoryId(surveyPlan.getProcessInstanceId(), surveyPlan.getHistoryInstanceId());
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
surveyPlan.setProcessInstanceId(processInstanceId);
|
||||||
|
//保存历史流程id列表
|
||||||
|
surveyPlan.setHistoryInstanceId(historyInstanceIds);
|
||||||
|
this.baseMapper.updateById(surveyPlan);
|
||||||
|
return surveyPlan.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String cancelSurveyPlan(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
//准备取消该流程,需要远程调用接口
|
||||||
|
SurveyPlan surveyPlan = this.baseMapper.selectById(cancelReqVO.getId());
|
||||||
|
//判断是否有权限操作
|
||||||
|
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), surveyPlan.getCreateBy());
|
||||||
|
//取消流程
|
||||||
|
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||||
|
//更新状态
|
||||||
|
surveyPlan.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus());
|
||||||
|
this.updateById(surveyPlan);
|
||||||
|
return surveyPlan.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSurveyPlanStatus(String businessKey, Integer status) {
|
||||||
|
SurveyPlan surveyPlan = this.baseMapper.selectById(businessKey);
|
||||||
|
surveyPlan.setStatus(status);
|
||||||
|
this.updateById(surveyPlan);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package com.njcn.supervision.service.survey.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||||
|
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||||
|
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.service.survey.ISurveyTestService;
|
||||||
|
import com.njcn.supervision.utils.InstanceUtil;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 普测测试的管理表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyTest> implements ISurveyTestService {
|
||||||
|
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预告警单的反馈单对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "survey_test";
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) {
|
||||||
|
QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
if (Objects.nonNull(surveyTestQueryParam)) {
|
||||||
|
//添加上时间范围
|
||||||
|
surveyTestVOQueryWrapper.between("supervision_survey_test.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(surveyTestQueryParam.getSearchEndTime())));
|
||||||
|
//根据工程名称模糊搜索
|
||||||
|
if (StrUtil.isNotBlank(surveyTestQueryParam.getSearchValue())) {
|
||||||
|
surveyTestVOQueryWrapper.like("supervision_survey_test.plan_name", surveyTestQueryParam.getSearchValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||||
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
|
surveyTestVOQueryWrapper.in("supervision_survey_test.Create_By", colleaguesIds)
|
||||||
|
.eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("supervision_survey_test.Update_Time");
|
||||||
|
return this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String addSurveyTest(SurveyTestParam surveyTestParam) {
|
||||||
|
SurveyTest surveyTest = new SurveyTest();
|
||||||
|
BeanUtils.copyProperties(surveyTestParam, surveyTest);
|
||||||
|
surveyTest.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
this.save(surveyTest);
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
surveyTest.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(surveyTest);
|
||||||
|
return surveyTest.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String updateSurveyTest(SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam) {
|
||||||
|
SurveyTest surveyTest = this.baseMapper.selectById(surveyTestUpdateParam.getId());
|
||||||
|
//判断是否有权限操作
|
||||||
|
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),surveyTest.getCreateBy());
|
||||||
|
surveyTestUpdateParam.setStatus(surveyTest.getStatus());
|
||||||
|
surveyTestUpdateParam.setProcessInstanceId(surveyTest.getProcessInstanceId());
|
||||||
|
surveyTestUpdateParam.setHistoryInstanceId(surveyTest.getHistoryInstanceId());
|
||||||
|
BeanUtils.copyProperties(surveyTestUpdateParam, surveyTest);
|
||||||
|
surveyTest.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
//处理历史流程id列表
|
||||||
|
String historyInstanceIds = InstanceUtil.dealHistoryId(surveyTest.getProcessInstanceId(), surveyTest.getHistoryInstanceId());
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
surveyTest.setProcessInstanceId(processInstanceId);
|
||||||
|
//保存历史流程id列表
|
||||||
|
surveyTest.setHistoryInstanceId(historyInstanceIds);
|
||||||
|
this.baseMapper.updateById(surveyTest);
|
||||||
|
return surveyTest.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String cancelSurveyTest(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
//准备取消该流程,需要远程调用接口
|
||||||
|
SurveyTest surveyTest = this.baseMapper.selectById(cancelReqVO.getId());
|
||||||
|
//判断是否有权限操作
|
||||||
|
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),surveyTest.getCreateBy());
|
||||||
|
//取消流程
|
||||||
|
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||||
|
//更新状态
|
||||||
|
surveyTest.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus());
|
||||||
|
this.updateById(surveyTest);
|
||||||
|
return surveyTest.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSurveyTestStatus(String businessKey, Integer status) {
|
||||||
|
SurveyTest surveyTest = this.baseMapper.selectById(businessKey);
|
||||||
|
surveyTest.setStatus(status);
|
||||||
|
this.updateById(surveyTest);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,13 @@ package com.njcn.supervision.service.user;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.supervision.pojo.dto.SensitiveUserExcel;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,4 +42,13 @@ public interface UserReportPOService extends IService<UserReportPO> {
|
|||||||
String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO);
|
String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO);
|
||||||
|
|
||||||
void updateUserStatus(String lineId, Integer userStatus);
|
void updateUserStatus(String lineId, Integer userStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询敏感及重要用户台账
|
||||||
|
*/
|
||||||
|
Page<UserReportVO> getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam);
|
||||||
|
|
||||||
|
void downloadSensitiveUserTemplate();
|
||||||
|
|
||||||
|
String importSensitiveUserData(MultipartFile file, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.njcn.supervision.service.user.impl;
|
package com.njcn.supervision.service.user.impl;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -13,13 +17,22 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
|||||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.pms.utils.PubUtil;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
|
import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
|
import com.njcn.poi.excel.PullDown;
|
||||||
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
||||||
import com.njcn.supervision.enums.UserNatureEnum;
|
import com.njcn.supervision.enums.UserNatureEnum;
|
||||||
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
||||||
import com.njcn.supervision.mapper.user.UserReportPOMapper;
|
import com.njcn.supervision.mapper.user.UserReportPOMapper;
|
||||||
|
import com.njcn.supervision.pojo.dto.SensitiveUserExcel;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||||
@@ -32,8 +45,12 @@ import com.njcn.supervision.service.user.UserReportProjectPOService;
|
|||||||
import com.njcn.supervision.service.user.UserReportSensitivePOService;
|
import com.njcn.supervision.service.user.UserReportSensitivePOService;
|
||||||
import com.njcn.supervision.service.user.UserReportSubstationPOService;
|
import com.njcn.supervision.service.user.UserReportSubstationPOService;
|
||||||
import com.njcn.supervision.utils.InstanceUtil;
|
import com.njcn.supervision.utils.InstanceUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.enums.UserStatusEnum;
|
||||||
import com.njcn.user.pojo.vo.UserVO;
|
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;
|
||||||
@@ -44,9 +61,13 @@ import org.springframework.beans.BeanWrapper;
|
|||||||
import org.springframework.beans.BeanWrapperImpl;
|
import org.springframework.beans.BeanWrapperImpl;
|
||||||
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 javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -72,7 +93,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
private final DeptFeignClient deptFeignClient;
|
private final DeptFeignClient deptFeignClient;
|
||||||
private final SupervisionTempLineReportMapper supervisionTempLineReportMapper;
|
private final SupervisionTempLineReportMapper supervisionTempLineReportMapper;
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -122,7 +143,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
|
||||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
|
||||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(userReportPO.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(userReportPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
// 将工作流的编号,更新到流程单中
|
// 将工作流的编号,更新到流程单中
|
||||||
userReportPO.setProcessInstanceId(processInstanceId);
|
userReportPO.setProcessInstanceId(processInstanceId);
|
||||||
this.baseMapper.updateById(userReportPO);
|
this.baseMapper.updateById(userReportPO);
|
||||||
@@ -147,7 +168,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
UserReportProjectPO userReportProjectPO = userReportProjectPOService.getById(id);
|
UserReportProjectPO userReportProjectPO = userReportProjectPOService.getById(id);
|
||||||
BeanUtils.copyProperties(userReportUpdate.getUserReportProjectPO(), userReportProjectPO, getNullPropertyNames(userReportUpdate.getUserReportProjectPO()));
|
BeanUtils.copyProperties(userReportUpdate.getUserReportProjectPO(), userReportProjectPO, getNullPropertyNames(userReportUpdate.getUserReportProjectPO()));
|
||||||
userReportProjectPOService.updateById(userReportProjectPO);
|
userReportProjectPOService.updateById(userReportProjectPO);
|
||||||
} else if ( CollectionUtil.newArrayList(
|
} else if (CollectionUtil.newArrayList(
|
||||||
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
|
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
|
||||||
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
|
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
|
||||||
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
|
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
|
||||||
@@ -182,8 +203,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
//查询所有区域下的数据
|
//查询所有区域下的数据
|
||||||
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||||
}
|
}
|
||||||
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());
|
||||||
|
|
||||||
//添加上时间范围
|
//添加上时间范围
|
||||||
// userReportVOQueryWrapper.between("supervision_user_report.Create_Time",
|
// userReportVOQueryWrapper.between("supervision_user_report.Create_Time",
|
||||||
// DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
|
// DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
|
||||||
@@ -207,7 +227,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
UserReportVO userReportVO = new UserReportVO();
|
UserReportVO userReportVO = new UserReportVO();
|
||||||
UserReportPO userReportPO = this.baseMapper.selectById(id);
|
UserReportPO userReportPO = this.baseMapper.selectById(id);
|
||||||
//复制基础信息
|
//复制基础信息
|
||||||
BeanUtil.copyProperties(userReportPO,userReportVO);
|
BeanUtil.copyProperties(userReportPO, userReportVO);
|
||||||
//处理特殊字段,用户名、部门名
|
//处理特殊字段,用户名、部门名
|
||||||
UserVO userVO = userFeignClient.getUserById(userReportPO.getReporter()).getData();
|
UserVO userVO = userFeignClient.getUserById(userReportPO.getReporter()).getData();
|
||||||
userReportVO.setReporter(userVO.getName());
|
userReportVO.setReporter(userVO.getName());
|
||||||
@@ -234,7 +254,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
|
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
|
||||||
).contains(userReportPO.getUserType())) {
|
).contains(userReportPO.getUserType())) {
|
||||||
//非线性负荷用户 & 新能源发电站用户
|
//非线性负荷用户 & 新能源发电站用户
|
||||||
UserReportSubstationPO byId= userReportSubstationPOService.getById(id);
|
UserReportSubstationPO byId = userReportSubstationPOService.getById(id);
|
||||||
userReportSubstationPOService.saveOrUpdate(byId);
|
userReportSubstationPOService.saveOrUpdate(byId);
|
||||||
userReportVO.setUserReportSubstationPO(byId);
|
userReportVO.setUserReportSubstationPO(byId);
|
||||||
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(userReportPO.getUserType())) {
|
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(userReportPO.getUserType())) {
|
||||||
@@ -276,23 +296,21 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
@Override
|
@Override
|
||||||
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
|
//此处不查询敏感及重要用户
|
||||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||||
.eq("supervision_user_report.status",FlowStatusEnum.APPROVE.getCode())
|
.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||||
;
|
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||||
//TODO
|
|
||||||
if (Objects.nonNull(userReportQueryParam)) {
|
if (Objects.nonNull(userReportQueryParam)) {
|
||||||
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||||
//查询所有区域下的数据
|
//查询所有区域下的数据
|
||||||
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(userReportQueryParam.getDataType())){
|
if (Objects.nonNull(userReportQueryParam.getDataType())) {
|
||||||
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());
|
||||||
|
|
||||||
}
|
}
|
||||||
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
||||||
@@ -304,7 +322,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
//准备取消该流程,需要远程调用接口
|
//准备取消该流程,需要远程调用接口
|
||||||
UserReportPO userReportPO = this.baseMapper.selectById(cancelReqVO.getId());
|
UserReportPO userReportPO = this.baseMapper.selectById(cancelReqVO.getId());
|
||||||
//判断是否有权限操作
|
//判断是否有权限操作
|
||||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),userReportPO.getCreateBy());
|
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), userReportPO.getCreateBy());
|
||||||
//取消流程
|
//取消流程
|
||||||
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||||
//更新状态
|
//更新状态
|
||||||
@@ -320,8 +338,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
String userId = supervisionTempLineReport.getUserId();
|
String userId = supervisionTempLineReport.getUserId();
|
||||||
UserReportPO userReportPO = this.baseMapper.selectById(userId);
|
UserReportPO userReportPO = this.baseMapper.selectById(userId);
|
||||||
//如果目前的干扰源用户状态>userStatus则不修改,如果将干扰源用户状态改为3退运,则必须其下的监测点都退运才能修改
|
//如果目前的干扰源用户状态>userStatus则不修改,如果将干扰源用户状态改为3退运,则必须其下的监测点都退运才能修改
|
||||||
if(userReportPO.getUserStatus()<userStatus){
|
if (userReportPO.getUserStatus() < userStatus) {
|
||||||
if (userStatus==3){
|
if (userStatus == 3) {
|
||||||
List<SupervisionTempLineReport> supervisionTempLineReports = supervisionTempLineReportMapper.selectList(new QueryWrapper<SupervisionTempLineReport>().lambda().eq(SupervisionTempLineReport::getUserId, userId));
|
List<SupervisionTempLineReport> supervisionTempLineReports = supervisionTempLineReportMapper.selectList(new QueryWrapper<SupervisionTempLineReport>().lambda().eq(SupervisionTempLineReport::getUserId, userId));
|
||||||
List<String> lineIds = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getId).collect(Collectors.toList());
|
List<String> lineIds = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getId).collect(Collectors.toList());
|
||||||
List<LineDetail> data = lineFeignClient.getLineDetail(lineIds).getData();
|
List<LineDetail> data = lineFeignClient.getLineDetail(lineIds).getData();
|
||||||
@@ -329,10 +347,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
.map(LineDetail::getRunFlag)
|
.map(LineDetail::getRunFlag)
|
||||||
.filter(temp -> !Objects.equals(temp, 2))
|
.filter(temp -> !Objects.equals(temp, 2))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(CollectionUtil.isEmpty(data)){
|
if (CollectionUtil.isEmpty(data)) {
|
||||||
userReportPO.setUserStatus(userStatus);
|
userReportPO.setUserStatus(userStatus);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
userReportPO.setUserStatus(userStatus);
|
userReportPO.setUserStatus(userStatus);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -340,6 +358,192 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
this.updateById(userReportPO);
|
this.updateById(userReportPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<UserReportVO> getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
|
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
|
//此处仅查询敏感及重要用户
|
||||||
|
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||||
|
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||||
|
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||||
|
if (Objects.nonNull(userReportQueryParam)) {
|
||||||
|
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||||
|
//查询所有区域下的数据
|
||||||
|
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(userReportQueryParam.getDataType())) {
|
||||||
|
userReportVOQueryWrapper.eq("data_type", userReportQueryParam.getDataType());
|
||||||
|
}
|
||||||
|
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
|
||||||
|
|
||||||
|
}
|
||||||
|
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
||||||
|
Page<UserReportVO> userReportVOPage = this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
||||||
|
List<UserReportVO> records = userReportVOPage.getRecords();
|
||||||
|
if (CollectionUtil.isNotEmpty(records)) {
|
||||||
|
//将详细信息也查出
|
||||||
|
for (UserReportVO record : records) {
|
||||||
|
UserReportSensitivePO userReportSensitivePO = userReportSensitivePOService.getById(record.getId());
|
||||||
|
record.setUserReportSensitivePO(userReportSensitivePO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return userReportVOPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadSensitiveUserTemplate() {
|
||||||
|
ExportParams exportParams = new ExportParams("敏感及重要用户模板(带*字段均是必填,请严格按照模板标准填入数据)", "重要用户");
|
||||||
|
|
||||||
|
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.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> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
||||||
|
|
||||||
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
|
PullDown pullDown;
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(2);
|
||||||
|
pullDown.setLastCol(2);
|
||||||
|
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(4);
|
||||||
|
pullDown.setLastCol(4);
|
||||||
|
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(5);
|
||||||
|
pullDown.setLastCol(5);
|
||||||
|
pullDown.setStrings(industryType.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(8);
|
||||||
|
pullDown.setLastCol(8);
|
||||||
|
pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(9);
|
||||||
|
pullDown.setLastCol(9);
|
||||||
|
pullDown.setStrings(loadLevel.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(10);
|
||||||
|
pullDown.setLastCol(10);
|
||||||
|
pullDown.setStrings(supplyCondition.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
ExcelUtil.exportExcelPullDown(exportParams, "敏感及重要用户模板.xlsx", pullDowns, SensitiveUserExcel.class, new ArrayList<>());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String importSensitiveUserData(MultipartFile file, HttpServletResponse response) {
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
params.setHeadRows(1);//表头
|
||||||
|
params.setTitleRows(1);//标题
|
||||||
|
params.setNeedVerify(true);
|
||||||
|
params.setStartSheetIndex(0);
|
||||||
|
params.setSheetNum(1);
|
||||||
|
List<SensitiveUserExcel> sensitiveUserExcels;
|
||||||
|
try {
|
||||||
|
ExcelImportResult<SensitiveUserExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveUserExcel.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<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.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> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
||||||
|
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
||||||
|
List<SensitiveUserExcel.SensitiveUserExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
|
||||||
|
for (SensitiveUserExcel sensitiveUserExcel : sensitiveUserExcels) {
|
||||||
|
//先判断当前用户是否已经存在
|
||||||
|
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
userReportPOLambdaQueryWrapper.eq(UserReportPO::getProjectName, sensitiveUserExcel.getProjectName())
|
||||||
|
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
int count = this.count(userReportPOLambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
// if(sensitiveUserExcel.getOverlay() == 1){
|
||||||
|
//
|
||||||
|
// }else{
|
||||||
|
//该用户已经录入
|
||||||
|
SensitiveUserExcel.SensitiveUserExcelMsg sensitiveUserExcelMsg = new SensitiveUserExcel.SensitiveUserExcelMsg();
|
||||||
|
BeanUtils.copyProperties(sensitiveUserExcel, sensitiveUserExcelMsg);
|
||||||
|
sensitiveUserExcelMsg.setMsg("该用户已录入,请联系管理员!");
|
||||||
|
sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg);
|
||||||
|
// }
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//处理通用信息
|
||||||
|
UserReportPO userReportPO = new UserReportPO();
|
||||||
|
userReportPO.setReporter(RequestUtil.getUserIndex());
|
||||||
|
userReportPO.setReportDate(LocalDate.now());
|
||||||
|
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
||||||
|
userReportPO.setCity(sensitiveUserExcel.getCity());
|
||||||
|
userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode());
|
||||||
|
if(Objects.nonNull(sensitiveUserExcel.getUserStatus())){
|
||||||
|
userReportPO.setUserStatus(sensitiveUserExcel.getUserStatus());
|
||||||
|
}else{
|
||||||
|
userReportPO.setUserStatus(SupervisionUserStatusEnum.PRODUCT.getCode());
|
||||||
|
}
|
||||||
|
userReportPO.setSubstation(sensitiveUserExcel.getSubstation());
|
||||||
|
//电压等级需要特殊处理下
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getVoltageLevel())) {
|
||||||
|
userReportPO.setVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getVoltageLevel(), devVoltage));
|
||||||
|
}
|
||||||
|
userReportPO.setProjectName(sensitiveUserExcel.getProjectName());
|
||||||
|
userReportPO.setDataType(1);
|
||||||
|
userReportPO.setStatus(2);
|
||||||
|
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.baseMapper.insert(userReportPO);
|
||||||
|
//处理敏感用户的信息
|
||||||
|
UserReportSensitivePO userReportSensitivePO = new UserReportSensitivePO();
|
||||||
|
userReportSensitivePO.setId(userReportPO.getId());
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getIndustry())) {
|
||||||
|
userReportSensitivePO.setIndustry(PubUtil.getDicById(sensitiveUserExcel.getIndustry(), industryType));
|
||||||
|
}
|
||||||
|
userReportSensitivePO.setMaintenanceUnit(sensitiveUserExcel.getMaintenanceUnit());
|
||||||
|
userReportSensitivePO.setPowerSupply(sensitiveUserExcel.getPowerSupply());
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getSupplyVoltageLevel())) {
|
||||||
|
userReportSensitivePO.setSupplyVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getSupplyVoltageLevel(), devVoltage));
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getLoadLevel())) {
|
||||||
|
userReportSensitivePO.setLoadLevel(PubUtil.getDicById(sensitiveUserExcel.getLoadLevel(), loadLevel));
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUserExcel.getPowerSupplyInfo())) {
|
||||||
|
userReportSensitivePO.setPowerSupplyInfo(PubUtil.getDicById(sensitiveUserExcel.getPowerSupplyInfo(), supplyCondition));
|
||||||
|
}
|
||||||
|
userReportSensitivePO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
userReportSensitivePOService.save(userReportSensitivePO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断有没有错误信息
|
||||||
|
if (CollectionUtil.isNotEmpty(sensitiveUserExcelMsgs)) {
|
||||||
|
ExcelUtil.exportExcel("失败列表.xlsx", SensitiveUserExcel.SensitiveUserExcelMsg.class, sensitiveUserExcelMsgs);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return CommonResponseEnum.SUCCESS.getCode();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有字段为null的属性名
|
* 获取所有字段为null的属性名
|
||||||
@@ -373,7 +577,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
userReportPOLambdaQueryWrapper
|
userReportPOLambdaQueryWrapper
|
||||||
.eq(UserReportPO::getProjectName, userReportParam.getProjectName())
|
.eq(UserReportPO::getProjectName, userReportParam.getProjectName())
|
||||||
.in(UserReportPO::getStatus,CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.RUNNING.getStatus(),BpmProcessInstanceStatusEnum.APPROVE.getStatus()))
|
.in(UserReportPO::getStatus, CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.RUNNING.getStatus(), BpmProcessInstanceStatusEnum.APPROVE.getStatus()))
|
||||||
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||||
//更新的时候,需排除当前记录
|
//更新的时候,需排除当前记录
|
||||||
if (isExcludeSelf) {
|
if (isExcludeSelf) {
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ public enum DicDataTypeEnum {
|
|||||||
CARRY_CAPCITYUSER_MODE("用户模式","carry_capcity_user_mode"),
|
CARRY_CAPCITYUSER_MODE("用户模式","carry_capcity_user_mode"),
|
||||||
LOCAL_MUNICIPALITY("所属地市","local_municipality"),
|
LOCAL_MUNICIPALITY("所属地市","local_municipality"),
|
||||||
INDUSTRY_TYPE_JB("行业类型-冀北","industry_type_jb"),
|
INDUSTRY_TYPE_JB("行业类型-冀北","industry_type_jb"),
|
||||||
|
LOAD_LEVEL("负荷级别","load_level"),
|
||||||
|
SUPPLY_CONDITION("供电电源情况","supply_condition"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user