Merge branch 'master' of http://pqmcc.com:3000/root/pqs
This commit is contained in:
@@ -82,6 +82,16 @@ public class LineDevGetDTO {
|
||||
*/
|
||||
private Integer isUpToGrid;
|
||||
|
||||
/**
|
||||
* 0.未上送 1.已上送 2.取消上送 3.待重新上送(用于典型负荷)
|
||||
*/
|
||||
private Integer isUploadHead;
|
||||
|
||||
/**
|
||||
* 0.未上送 1.已上送 2.取消上送 3.待重新上送(用于主网监测点)
|
||||
*/
|
||||
private Integer monitorUploadStatus;
|
||||
|
||||
/**
|
||||
* oracle监测点id
|
||||
*/
|
||||
|
||||
@@ -26,5 +26,7 @@ public class DeptGetLineParam {
|
||||
@ApiModelProperty(name = "systemType",value = "0.只返回主网的监测点信息; 1.只返回配网的监测点信息; null、2.返回主网配网两种监测点信息")
|
||||
private Integer systemType;
|
||||
|
||||
@ApiModelProperty(name = "monitorStateAll",value = "true.只返回在线监测点信息 false.返回全部监测点信息")
|
||||
private Boolean monitorStateRunning=true;
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ public enum PmsDeviceResponseEnum {
|
||||
|
||||
NO_ID_STATION("A00357","变电站编号为空"),
|
||||
NO_ID_ORG("A00357","部门编号为空"),
|
||||
NE_ENERGY_ID("A003560","场站编号重复"),
|
||||
MONITOR_NE_ENERGY_FIND("A00361","主网监测点存在绑定该场站信息关系,请先解除绑定关系"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/2/20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class NewEnergyQueryParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private String orgId;
|
||||
|
||||
@Data
|
||||
public static class Info {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId("Id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "对象类型不能为空")
|
||||
@TableField("Obj_Name")
|
||||
private String objName;
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
@TableField("Org_Name")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
@TableField("Org_Id")
|
||||
private String orgId;
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("voltage_Level")
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("Powerr_Name")
|
||||
private String powerrName;
|
||||
|
||||
/**
|
||||
* 检测点对象类型(字典)
|
||||
*/
|
||||
@TableField("Obj_Type")
|
||||
private String objType;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("station_status")
|
||||
private String stationStatus;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-03-26
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("pms_new_energy")
|
||||
public class PmsNewEnergy extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId("Id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("Obj_Name")
|
||||
private String objName;
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
@TableField("Org_Name")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
@TableField("Org_Id")
|
||||
private String orgId;
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("voltage_Level")
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("Powerr_Name")
|
||||
private String powerrName;
|
||||
|
||||
/**
|
||||
* 检测点对象类型(字典)
|
||||
*/
|
||||
@TableField("Obj_Type")
|
||||
private String objType;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@TableField("station_status")
|
||||
private String stationStatus;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
@TableField("State")
|
||||
private Integer state;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.device.pms.pojo.vo.gw;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/3/22 11:05
|
||||
*/
|
||||
@Data
|
||||
public class MonitorEnergy {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "监测点信息")
|
||||
List<Details> info;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Details {
|
||||
|
||||
@ApiModelProperty(value = "对象类型")
|
||||
private String objType;
|
||||
|
||||
@ApiModelProperty(value = "接入线路电压等级为110kV及以上变电站数量(座)")
|
||||
private String num;
|
||||
|
||||
@ApiModelProperty(value = "接入线路电压等级为110kV及以上变电站数量(座)")
|
||||
List<VoltageInfo> voltageInfo;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class VoltageInfo {
|
||||
|
||||
@ApiModelProperty(value = "已监测数量")
|
||||
private Integer monitorNum;
|
||||
|
||||
@ApiModelProperty(value = "新能源场站总数")
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty(value = "监测率")
|
||||
private Float monitorRate;
|
||||
|
||||
@ApiModelProperty(value = "装置数量(台)")
|
||||
private Integer deviceNum;
|
||||
|
||||
@ApiModelProperty(value = "覆盖变电站数量(座)")
|
||||
private Integer substationsNum;
|
||||
|
||||
@ApiModelProperty(value = "电站覆盖率(%)")
|
||||
private Float substationsRate;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.device.pms.controller.gwPush;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.device.pms.service.gwPush.MonitorStatisticsService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/monitorStatistics")
|
||||
@Api(tags = "台账类国网上送监测点统计")
|
||||
@RequiredArgsConstructor
|
||||
public class MonitorStatisticsController extends BaseController {
|
||||
|
||||
private final MonitorStatisticsService monitorStatisticsService;
|
||||
|
||||
@PostMapping("/objType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("国网上送接口")
|
||||
public HttpResult< List<List<String>>> objType(String deptId){
|
||||
String methodDescribe = getMethodDescribe("objType");
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.device.pms.controller.ledgerManger;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.device.pms.pojo.param.NewEnergyQueryParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsNewEnergy;
|
||||
import com.njcn.device.pms.service.gwPush.IPmsNewEnergyService;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-03-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pmsNewEnergy")
|
||||
@RequiredArgsConstructor
|
||||
public class PmsNewEnergyController extends BaseController {
|
||||
|
||||
private final IPmsNewEnergyService newEnergyService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("getNewEnergyList")
|
||||
@ApiOperation("分页场站台账所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询监测终端台账信息",required = true)
|
||||
public HttpResult<Page<PmsNewEnergy>> getNewEnergyList(@RequestBody @Validated NewEnergyQueryParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getNewEnergyList");
|
||||
Page<PmsNewEnergy> res = newEnergyService.getNewEnergyList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("getNewEnergySelectList")
|
||||
@ApiOperation("查询场站台账所有信息")
|
||||
public HttpResult<List<PmsNewEnergy>> getNewEnergySelectList(String orgId){
|
||||
String methodDescribe = getMethodDescribe("getNewEnergySelectList");
|
||||
List<PmsNewEnergy> res = newEnergyService.getNewEnergySelectList(orgId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增监测终端台账信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/addNewEnergy")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType= OperateType.ADD)
|
||||
@ApiOperation("新增监测终端台账信息")
|
||||
@ApiImplicitParam(name = "param", value = "新增实体", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated NewEnergyQueryParam.Info param){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = newEnergyService.add(param);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测终端台账信息
|
||||
* @author hany
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@PostMapping("/updateNewEnergy")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@ApiOperation("修改监测终端台账信息")
|
||||
@ApiImplicitParam(name = "updateParam", value = "更新实体", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated NewEnergyQueryParam.Info updateParam){
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
boolean result = newEnergyService.update(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测终端台账信息
|
||||
* @param ids id
|
||||
* @author hany
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@PostMapping("/deleteNewEnergy")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@ApiOperation("删除监测终端台账信息")
|
||||
@ApiImplicitParam(name = "ids", value = "ID索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
boolean result = newEnergyService.delete(ids);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pms.pojo.po.PmsNewEnergy;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-03-26
|
||||
*/
|
||||
public interface PmsNewEnergyMapper extends BaseMapper<PmsNewEnergy> {
|
||||
|
||||
}
|
||||
@@ -22,7 +22,8 @@ public interface SpecialAnalysisMapper {
|
||||
* @return
|
||||
*/
|
||||
List<SpecialAnalysisMonitorVO.SpecialAnalysisVO> selectList(@Param("deptIdList") List<String> deptIdList,
|
||||
@Param("monitorTags") String monitorTags);
|
||||
@Param("monitorTags") String monitorTags,
|
||||
@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 同比环比数据(风电场,光伏电站,冶炼负荷)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
1 as Status,
|
||||
now() as Create_Time,
|
||||
now() as Update_Time,
|
||||
Line_Id as Statistical_Interval,
|
||||
Line_Id as Line_Id,
|
||||
15 as Statistical_Interval,
|
||||
Power_Station_Id as Power_Station_Id
|
||||
from
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.device.pms.mapper.majornetwork.PmsNewEnergyMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -22,6 +22,7 @@
|
||||
<where>
|
||||
pm.`Status` = 1
|
||||
AND ps.`Status` = 1
|
||||
AND pm.`Monitor_State` = #{status}
|
||||
<if test="deptIdList != null and deptIdList.size > 0">
|
||||
AND pm.Org_Id IN
|
||||
<foreach collection='deptIdList' item='item' index="index" open='(' separator=',' close=')'>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.device.pms.service.gwPush;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.NewEnergyQueryParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsBaseParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsNewEnergy;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-03-26
|
||||
*/
|
||||
public interface IPmsNewEnergyService extends IService<PmsNewEnergy> {
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @return Page<PmsNewEnergy>
|
||||
*/
|
||||
Page<PmsNewEnergy> getNewEnergyList(NewEnergyQueryParam baseParam);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<PmsNewEnergy> getNewEnergySelectList(String orgId);
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
boolean add(NewEnergyQueryParam.Info param);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param
|
||||
*/
|
||||
boolean update(NewEnergyQueryParam.Info updateParam);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ids
|
||||
*/
|
||||
boolean delete(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pms.service.gwPush;
|
||||
|
||||
import com.njcn.device.pms.pojo.vo.gw.MonitorEnergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 国网台账类上送
|
||||
*/
|
||||
public interface MonitorStatisticsService {
|
||||
|
||||
/**
|
||||
* @Description: 国网上送统计类型数量统计
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> getGwMonitorStatistics(String deptId);
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.njcn.device.pms.service.gwPush.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pms.service.gwPush.MonitorStatisticsService;
|
||||
import com.njcn.device.pms.service.ledgerManger.CommTerminalService;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/12/11
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
|
||||
private final CommTerminalService commTerminalService;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
@Override
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
|
||||
//监测点大类
|
||||
List<SysDicTreePO> broadCategory = sysDicTreePOList.stream()
|
||||
.filter(item -> Objects.equals(item.getPid(), "0"))
|
||||
.filter(item -> !Objects.equals(item.getCode(), DicDataTypeEnum.DEVICE_UNIT.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
broadCategory.sort(Comparator.comparing(SysDicTreePO::getSort));
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("");
|
||||
List<String> collect = broadCategory.stream().map(SysDicTreePO::getName).collect(Collectors.toList());
|
||||
list.addAll(collect);
|
||||
list.add("合计");
|
||||
//获取主网监测统计
|
||||
Map<String, List<String>> metWorkMap = mapDicIds(broadCategory, sysDicTreePOList);
|
||||
|
||||
//筛选典型源荷统计
|
||||
List<SysDicTreePO> sourceLoad = sysDicTreePOList.stream().filter(item ->
|
||||
Objects.equals(DicTreeEnum.Power_Station.getCode(), item.getCode()) ||
|
||||
Objects.equals(DicTreeEnum.Ele_Railways.getCode(), item.getCode()) ||
|
||||
Objects.equals(DicTreeEnum.Wind_Farms.getCode(), item.getCode()) ||
|
||||
Objects.equals(DicTreeEnum.Imp_Users.getCode(), item.getCode())
|
||||
).collect(Collectors.toList());
|
||||
sourceLoad.sort(Comparator.comparing(SysDicTreePO::getSort));
|
||||
//获取典型源荷监测统计
|
||||
Map<String, List<String>> sourceLoadMap = mapDicIds(sourceLoad, sysDicTreePOList);
|
||||
list.addAll(sourceLoad.stream().map(SysDicTreePO::getName).collect(Collectors.toList()));
|
||||
list.add("其他");
|
||||
list.add("合计");
|
||||
info.add(list);
|
||||
//筛选出国网统计信息
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
|
||||
//部门信息循环
|
||||
List<String> line;
|
||||
for (DeptGetChildrenMoreDTO deptMonitor : deptGetChildrenMoreDTOS) {
|
||||
line = new ArrayList<>();
|
||||
line.add(deptMonitor.getUnitName());
|
||||
List<LineDevGetDTO> lineBaseList = deptMonitor.getLineBaseList();
|
||||
if(CollUtil.isEmpty(lineBaseList)){
|
||||
continue;
|
||||
}
|
||||
List<LineDevGetDTO> upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
addmetWorkList(metWorkMap, upToGridList, line);
|
||||
addSourceLoadList(sourceLoadMap, upToGridList, line);
|
||||
info.add(line);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
private List<String> addmetWorkList(Map<String, List<String>> mapSourceLoad, List<LineDevGetDTO> upToGridList, List<String> line) {
|
||||
long total = 0;
|
||||
for (String s : mapSourceLoad.keySet()) {
|
||||
List<String> value = mapSourceLoad.get(s);
|
||||
long monitorCount = upToGridList.stream().filter(item -> value.contains(item.getObjType()) &&
|
||||
Objects.equals(item.getMonitorUploadStatus(), DataStateEnum.ENABLE.getCode())
|
||||
).map(LineDevGetDTO::getPointId).count();
|
||||
total += monitorCount;
|
||||
line.add(String.valueOf(monitorCount));
|
||||
}
|
||||
line.add(String.valueOf(total));
|
||||
return line;
|
||||
}
|
||||
private List<String> addSourceLoadList(Map<String, List<String>> mapSourceLoad, List<LineDevGetDTO> upToGridList, List<String> line) {
|
||||
long total = 0;
|
||||
for (String s : mapSourceLoad.keySet()) {
|
||||
List<String> value = mapSourceLoad.get(s);
|
||||
long monitorCount = upToGridList.stream().filter(item -> value.contains(item.getObjType()) &&
|
||||
Objects.equals(item.getIsUploadHead(), DataStateEnum.ENABLE.getCode())
|
||||
).map(LineDevGetDTO::getPointId).count();
|
||||
total += monitorCount;
|
||||
line.add(String.valueOf(monitorCount));
|
||||
}
|
||||
List<String> sourceLoad = mapSourceLoad.values().stream().flatMap(list -> list.stream()).distinct().collect(Collectors.toList());
|
||||
long count = upToGridList.stream().filter(item -> !sourceLoad.contains(item.getObjType()) &&
|
||||
Objects.equals(item.getIsUploadHead(), DataStateEnum.ENABLE.getCode())
|
||||
).map(LineDevGetDTO::getPointId).count();
|
||||
line.add(String.valueOf(count));
|
||||
total += count;
|
||||
line.add(String.valueOf(total));
|
||||
return line;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param objType 监测点对象类型大类
|
||||
* @param objTypeAll 监测点所有对象类型
|
||||
* @return
|
||||
*/
|
||||
private Map<String, List<String>> mapDicIds(List<SysDicTreePO> objType, List<SysDicTreePO> objTypeAll) {
|
||||
Map<String, List<String>> mapKey = new LinkedHashMap<>();
|
||||
for(SysDicTreePO load : objType){
|
||||
List<String> ids = objTypeAll.stream().filter(item -> item.getPid().equals(load.getId()) ||
|
||||
item.getId().equals(load.getId())
|
||||
).map(SysDicTreePO::getId).collect(Collectors.toList());;
|
||||
mapKey.put(load.getCode(), ids);
|
||||
}
|
||||
return mapKey;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.njcn.device.pms.service.gwPush.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsNewEnergyMapper;
|
||||
import com.njcn.device.pms.pojo.param.NewEnergyQueryParam;
|
||||
import com.njcn.device.pms.pojo.po.*;
|
||||
import com.njcn.device.pms.service.gwPush.IPmsNewEnergyService;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PmsNewEnergyServiceImpl extends ServiceImpl<PmsNewEnergyMapper, PmsNewEnergy> implements IPmsNewEnergyService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final IMonitorService monitorService;
|
||||
@Override
|
||||
public Page<PmsNewEnergy> getNewEnergyList(NewEnergyQueryParam baseParam) {
|
||||
List<String> orgIds = new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(baseParam.getOrgId())){
|
||||
orgIds.addAll(deptFeignClient.getDepSonSelfCodetByDeptId(baseParam.getOrgId()).getData());
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<PmsNewEnergy> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PmsNewEnergy::getState,DataStateEnum.ENABLE.getCode())
|
||||
.in(CollUtil.isNotEmpty(orgIds),PmsNewEnergy::getOrgId,orgIds);
|
||||
if(StrUtil.isNotBlank(baseParam.getSearchValue())) {
|
||||
lambdaQueryWrapper.and(i -> i.like(PmsNewEnergy::getObjName, baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PmsNewEnergy::getOrgName, baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PmsNewEnergy::getPowerrName, baseParam.getSearchValue()));
|
||||
}
|
||||
lambdaQueryWrapper.orderByDesc(PmsNewEnergy::getCreateTime);
|
||||
//初始化分页数据
|
||||
return this.page(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmsNewEnergy> getNewEnergySelectList(String orgId) {
|
||||
LambdaQueryWrapper<PmsNewEnergy> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PmsNewEnergy::getState,DataStateEnum.ENABLE.getCode());
|
||||
if(StrUtil.isNotBlank(orgId)){
|
||||
List<String> deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(orgId).getData();
|
||||
lambdaQueryWrapper.in(PmsNewEnergy::getOrgId,deptCodes);
|
||||
}
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean add(NewEnergyQueryParam.Info param) {
|
||||
List<PmsNewEnergy> list = this.list(new LambdaQueryWrapper<PmsNewEnergy>()
|
||||
.eq(PmsNewEnergy::getState,DataStateEnum.ENABLE.getCode())
|
||||
.eq(PmsNewEnergy::getId, param.getId())
|
||||
.or(wrapper ->
|
||||
wrapper.eq(PmsNewEnergy::getObjName, param.getOrgName())
|
||||
)
|
||||
);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(PmsNewEnergy::getObjName).collect(Collectors.toList());
|
||||
if(collect.contains(param.getObjName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
throw new BusinessException(PmsDeviceResponseEnum.NE_ENERGY_ID);
|
||||
}
|
||||
PmsNewEnergy pmsNewEnergy = new PmsNewEnergy();
|
||||
BeanUtils.copyProperties(param, pmsNewEnergy);
|
||||
return this.save(pmsNewEnergy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测终端台账
|
||||
* @author hany
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@Override
|
||||
public boolean update(NewEnergyQueryParam.Info param) {
|
||||
List<PmsNewEnergy> list = this.list(new LambdaQueryWrapper<PmsNewEnergy>()
|
||||
.eq(PmsNewEnergy::getState,DataStateEnum.ENABLE.getCode())
|
||||
.ne(PmsNewEnergy::getId, param.getId())
|
||||
.and(wrapper ->
|
||||
wrapper.eq(PmsNewEnergy::getObjName, param.getObjName())
|
||||
)
|
||||
);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(PmsNewEnergy::getObjName).collect(Collectors.toList());
|
||||
if(collect.contains(param.getObjName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
PmsNewEnergy pmsNewEnergy = BeanUtil.copyProperties(param, PmsNewEnergy.class);
|
||||
return this.updateById(pmsNewEnergy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
*/
|
||||
@Override
|
||||
public boolean delete(List<String> ids) {
|
||||
//删除前需要判断依赖终端的监测点是否存在
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.in(Monitor::getTractionId,ids).eq(Monitor::getStatus,DataStateEnum.ENABLE.getCode());
|
||||
int mCount = monitorService.count(monitorLambdaQueryWrapper);
|
||||
if(mCount>0){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MONITOR_NE_ENERGY_FIND);
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<PmsNewEnergy>()
|
||||
.set(PmsNewEnergy::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(PmsNewEnergy::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,7 +129,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
|
||||
Map<String, List<Monitor>> map = new HashMap<>();
|
||||
if (deptGetLineParam.getSystemType() == 0 || deptGetLineParam.getSystemType() == 2) {
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus, 1).eq(Monitor::getMonitorState, dictData.getId()));
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>()
|
||||
.eq(Monitor::getStatus, 1)
|
||||
.eq(deptGetLineParam.getMonitorStateRunning(),Monitor::getMonitorState, dictData.getId()));
|
||||
map = monitorList.stream().collect(Collectors.groupingBy(Monitor::getOrgId));
|
||||
}
|
||||
//TODO 配网数据量巨大,暂时注释
|
||||
@@ -168,6 +170,8 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
//预处理模块需要的id修改value为id
|
||||
lineDevGetDTO.setVoltageLevel(it.getVoltageLevel());
|
||||
lineDevGetDTO.setIsUpToGrid(it.getIsUpToGrid());
|
||||
lineDevGetDTO.setIsUploadHead(it.getIsUploadHead());
|
||||
lineDevGetDTO.setMonitorUploadStatus(it.getMonitorUploadStatus());
|
||||
lineList.add(lineDevGetDTO);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,8 +83,11 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl<PowerDistribut
|
||||
|
||||
@Override
|
||||
public Page<PowerDistributionarea> getList(BaseParam baseParam) {
|
||||
List<Dept> deptInfo = deptFeignClient.getAllDept().getData();
|
||||
List<String> deptIds = deptInfo.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PowerDistributionarea::getStatus,DataStateEnum.ENABLE.getCode())
|
||||
.in(CollUtil.isNotEmpty(deptIds),PowerDistributionarea::getOrgId,deptIds)
|
||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()),
|
||||
i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
List<DictData> voltageLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
//将电压信息转成map,key:id value:name
|
||||
Map<String, String> voltageLevelMap = voltageLevelList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_STATE.getName(), DicDataEnum.RUN.getName()).getData();
|
||||
//专项分析-只是统计当前所在部门及下部门直接挂钩的监测点
|
||||
List<Dept> deptList = deptFeignClient.getSpecialDeptList().getData();
|
||||
List<String> deptIds = deptList.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
@@ -64,7 +64,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
break;
|
||||
}
|
||||
//1.获取原始数据(参数1,部门id。参数2,监测点标签字典id集合)
|
||||
List<SpecialAnalysisMonitorVO.SpecialAnalysisVO> infoList = specialAnalysisMapper.selectList(deptIds, data.getId());
|
||||
List<SpecialAnalysisMonitorVO.SpecialAnalysisVO> infoList = specialAnalysisMapper.selectList(deptIds, data.getId(),dictData.getId());
|
||||
|
||||
//获取部门区域
|
||||
if (CollectionUtil.isNotEmpty(infoList)) {
|
||||
|
||||
@@ -51,9 +51,9 @@ public class RmpEventDetailController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取暂态事件明细")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<RmpEventDetailVO>> getRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
|
||||
public HttpResult<Page<RmpEventDetailVO>> getRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRmpEventDetail");
|
||||
List<RmpEventDetailVO> list = rmpEventDetailService.getRmpEventDetail(param);
|
||||
Page<RmpEventDetailVO> list = rmpEventDetailService.getRmpEventDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.njcn.event.service.majornetwork.Impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -23,10 +25,7 @@ import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.AreaLineVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.pojo.vo.*;
|
||||
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -81,7 +80,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
@Override
|
||||
public List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param) {
|
||||
public Page<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
|
||||
pmsDeviceInfoParam.setDeptIndex(param.getId());
|
||||
@@ -89,7 +88,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
List<PmsGeneralDeviceDTO> data = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
|
||||
if (CollectionUtil.isEmpty(data)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
|
||||
// 查询事件类型字典表
|
||||
@@ -101,7 +100,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
// 取出所有监测点
|
||||
List<String> monitorIds = data.stream().flatMap(pmsGeneralDeviceDTO -> pmsGeneralDeviceDTO.getMonitorIdList().stream()).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(monitorIds)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 查询监测点信息
|
||||
PmsMonitorParam pmsMonitorParam = new PmsMonitorParam();
|
||||
@@ -111,14 +110,21 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
pmsMonitorParam.setMonitorIds(monitorIds);
|
||||
List<PmsMonitorDTO> monitorInfo = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData();
|
||||
if (CollectionUtil.isEmpty(monitorInfo)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 取出所有监测点
|
||||
List<String> monitorList = monitorInfo.stream().map(PmsMonitorDTO::getId).collect(Collectors.toList());
|
||||
// 获取暂态事件明细
|
||||
List<RmpEventDetailPO> detailsOfTransientEvents = rmpEventDetailMapper.getDetailsOfTransientEvents(monitorList, param.getEventType(), param.getStartTime(), param.getEndTime());
|
||||
if (CollectionUtil.isEmpty(detailsOfTransientEvents)) {
|
||||
return Collections.emptyList();
|
||||
Page<RmpEventDetailPO> rmpEventDetailPOPage = rmpEventDetailMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(CollUtil.isNotEmpty(monitorList), RmpEventDetailPO::getMeasurementPointId, monitorList)
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
.orderByDesc(RmpEventDetailPO::getStartTime)
|
||||
);
|
||||
|
||||
|
||||
if (CollectionUtil.isEmpty(rmpEventDetailPOPage.getRecords())) {
|
||||
return new Page<>();
|
||||
}
|
||||
|
||||
// 蒋监测点信息转换成map集合
|
||||
@@ -127,7 +133,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
Map<String, String> eventStatisDataMap = eventStatisData.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
// 属性赋值
|
||||
return detailsOfTransientEvents.stream().map(po -> {
|
||||
List<RmpEventDetailVO> collect = rmpEventDetailPOPage.getRecords().stream().map(po -> {
|
||||
RmpEventDetailVO vo = new RmpEventDetailVO();
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
for (PmsMonitorDTO dto : monitorInfo) {
|
||||
@@ -141,6 +147,9 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
Page<RmpEventDetailVO> page = BeanUtil.copyProperties(rmpEventDetailPOPage, Page.class);
|
||||
page.setRecords(collect);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface RmpEventDetailService extends IService<RmpEventDetailPO> {
|
||||
* @param param 条件参数
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param);
|
||||
Page<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param);
|
||||
|
||||
/**
|
||||
* 获取暂态指标类型列表
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.njcn.prepare.harmonic.controller.dim;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
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.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
@@ -32,10 +34,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -212,4 +211,58 @@ public class IRDimBusGlobalDController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增重算月数据
|
||||
* @author cdf
|
||||
* @date 2024/3/22
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/reCalMonthUploadAlgorithm")
|
||||
@ApiOperation("重新计算四个算法")
|
||||
@ApiImplicitParam(name = "statisticDate", value = "重新计算的月份", required = true)
|
||||
public HttpResult<String> reCalUploadAlgorithmAllMonth(@DateTimeStrValid(format = "yyyy-MM") @RequestParam("statisticDate") String statisticDate,@RequestParam("type") String type) {
|
||||
String methodDescribe = getMethodDescribe("reCalUploadAlgorithmAllMonth");
|
||||
Set<String> set = new HashSet<>();
|
||||
|
||||
String startDate = DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(statisticDate,DatePattern.NORM_MONTH_PATTERN)),DatePattern.NORM_DATE_PATTERN);
|
||||
String endDate = DateUtil.format(new Date(),DatePattern.NORM_DATE_PATTERN);
|
||||
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(false);
|
||||
baseParam.setRepair(true);
|
||||
baseParam.setBeginTime(startDate);
|
||||
baseParam.setEndTime(endDate);
|
||||
|
||||
if(StrUtil.isBlank(type)){
|
||||
throw new BusinessException("请选择需要重新计算的类型");
|
||||
}else if("0".equals(type)){
|
||||
//基准
|
||||
set.add("r_upload_evaluation_data_d");
|
||||
baseParam.setTagNames(set);
|
||||
liteFlowFeignClient.uploadOrgExecutor(baseParam);
|
||||
}else if("1".equals(type)){
|
||||
//主配网
|
||||
set.add("r_upload_point_statistical_data_d");
|
||||
baseParam.setTagNames(set);
|
||||
liteFlowFeignClient.uploadOrgExecutor(baseParam);
|
||||
}else if("2".equals(type)){
|
||||
//电站
|
||||
baseParam.setFullChain(false);
|
||||
baseParam.setRepair(false);
|
||||
baseParam.setDataDate(endDate);
|
||||
set.add("r_upload_substation_statistical_data_m");
|
||||
baseParam.setTagNames(set);
|
||||
liteFlowFeignClient.substationExecutor(baseParam);
|
||||
}else if("3".equals(type)){
|
||||
//典型
|
||||
set.add("pq_typical_source_create_d");
|
||||
baseParam.setDataDate(statisticDate);
|
||||
baseParam.setTagNames(set);
|
||||
liteFlowFeignClient.uploadOrgExecutor(baseParam);
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,11 @@ public class RLoadTypeUserManageVO implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty("入网报告路径")
|
||||
private String iFilePath;
|
||||
/**
|
||||
* 入网报告名称
|
||||
*/
|
||||
@ApiModelProperty("入网报告名称")
|
||||
private String iFilePathName;
|
||||
/**
|
||||
* 入网报告上传时间
|
||||
*/
|
||||
@@ -120,6 +125,11 @@ public class RLoadTypeUserManageVO implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty("实测报告路径")
|
||||
private String aFilePath;
|
||||
/**
|
||||
* 实测报告名称
|
||||
*/
|
||||
@ApiModelProperty("实测报告名称")
|
||||
private String aFilePathName;
|
||||
/**
|
||||
* 实测报告上传时间
|
||||
*/
|
||||
|
||||
@@ -125,7 +125,7 @@ public class PmsTerminalDetectionController extends BaseController {
|
||||
|
||||
@ApiOperation("检测报告下载")
|
||||
@GetMapping(value = "/reportDownload")
|
||||
public InputStreamResource reportDownload( TerminalParam.DownloadParam param) throws IOException {
|
||||
public InputStreamResource reportDownload( TerminalParam.DownloadParam param){
|
||||
InputStreamResource minIoUploadResDTO = pmsTerminalDetectionService.reportDownload(param);
|
||||
return minIoUploadResDTO;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -98,33 +97,23 @@ public class RGeneralSurveyPlanController extends BaseController {
|
||||
@PostMapping("/addPlanConfig")
|
||||
@ApiOperation("增加普测计划参数")
|
||||
@ApiImplicitParam(name = "rSurveyPlanConfigVOList", value = "", required = true)
|
||||
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigVO> rSurveyPlanConfigVOList) {
|
||||
String methodDescribe = getMethodDescribe("querySubStatation");
|
||||
double sum = rSurveyPlanConfigVOList.stream().mapToDouble(RSurveyPlanConfigVO::getProportion).sum();
|
||||
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigPO> rSurveyPlanConfigVOList) {
|
||||
String methodDescribe = getMethodDescribe("addPlanConfig");
|
||||
double sum = rSurveyPlanConfigVOList.stream().mapToDouble(RSurveyPlanConfigPO::getProportion).sum();
|
||||
if (sum > 1) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.MATH_ERROR, false, methodDescribe);
|
||||
}
|
||||
List<RSurveyPlanConfigPO> collect = rSurveyPlanConfigVOList.stream().map(temp -> {
|
||||
RSurveyPlanConfigPO rs = new RSurveyPlanConfigPO();
|
||||
BeanUtils.copyProperties(temp, rs);
|
||||
return rs;
|
||||
}).collect(Collectors.toList());
|
||||
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId(rSurveyPlanConfigVOList, 500);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryPlanConfig")
|
||||
@ApiOperation("查询普测计划参数")
|
||||
public HttpResult<List<RSurveyPlanConfigVO>> queryPlanConfig() {
|
||||
public HttpResult<List<RSurveyPlanConfigPO>> queryPlanConfig() {
|
||||
String methodDescribe = getMethodDescribe("queryPlanConfig");
|
||||
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.list();
|
||||
List<RSurveyPlanConfigVO> collect = list.stream().map(temp -> {
|
||||
RSurveyPlanConfigVO rs = new RSurveyPlanConfigVO();
|
||||
BeanUtils.copyProperties(temp, rs);
|
||||
return rs;
|
||||
}).collect(Collectors.toList());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, collect, methodDescribe);
|
||||
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.getOrgIds();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
|
||||
*/
|
||||
Page<RLoadTypeUserManageVO> getLoadTypeUserPage(IPage<RLoadTypeUserManageVO> page,
|
||||
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam,
|
||||
@Param("ids") List<String> ids
|
||||
@Param("ids") List<String> ids,
|
||||
@Param("aStatus") String aStatus
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,8 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
|
||||
* @return 结果
|
||||
*/
|
||||
Page<RLoadTypeUserManageVO> getLoadTypeRelationPage(IPage<RLoadTypeUserManageVO> page,
|
||||
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam
|
||||
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam,
|
||||
@Param("ids") List<String> ids,
|
||||
@Param("aStatus") String aStatus
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.checkType != null and param.checkType == 1">
|
||||
and r.i_check_person is null and r.i_check_person !=""
|
||||
AND ( r.i_check_person IS not NULL or r.i_check_person != "")
|
||||
</if>
|
||||
<if test="param.loadType != null and param.loadType != ''">
|
||||
and r.load_type = #{param.loadType}
|
||||
@@ -26,6 +26,9 @@
|
||||
<if test="param.fileUploadflag != null and param.fileUploadflag != ''">
|
||||
and r.i_is_file_upload = #{param.fileUploadflag}
|
||||
</if>
|
||||
<if test="aStatus!= null and aStatus != ''">
|
||||
and r.a_status != #{aStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by record_time desc
|
||||
</select>
|
||||
@@ -39,8 +42,14 @@
|
||||
AND ISNULL( relation_user_id )= 0
|
||||
AND LENGTH(
|
||||
trim( relation_user_id ))> 0
|
||||
<if test="param.orgNo != null and param.orgNo != ''">
|
||||
and r.org_no = #{param.orgNo}
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND r.org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.checkType != null and param.checkType == 1">
|
||||
AND ( r.i_check_person IS not NULL or r.i_check_person != "")
|
||||
</if>
|
||||
<if test="param.loadType != null and param.loadType != ''">
|
||||
and r.load_type = #{param.loadType}
|
||||
@@ -53,6 +62,9 @@
|
||||
</if>
|
||||
<if test="param.aIsFileUpload != null and param.aIsFileUpload != ''">
|
||||
and r.a_is_file_upload = #{param.aIsFileUpload}
|
||||
</if>
|
||||
<if test="aStatus!= null and aStatus != ''">
|
||||
and r.a_status != #{aStatus}
|
||||
</if>
|
||||
order by record_time desc
|
||||
</select>
|
||||
|
||||
@@ -92,7 +92,7 @@ public interface PmsTerminalDetectionService extends IService<PmsTerminalDetecti
|
||||
* @param param
|
||||
* @return MinIoUploadResDTO
|
||||
*/
|
||||
InputStreamResource reportDownload(TerminalParam.DownloadParam param) throws IOException;
|
||||
InputStreamResource reportDownload(TerminalParam.DownloadParam param);
|
||||
|
||||
/***
|
||||
* 终端入网检测台账统计
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.process.mapper.RSurveyPlanConfigMapper;
|
||||
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
||||
import com.njcn.process.service.impl.RSurveyPlanConfigService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -15,6 +24,14 @@ import org.springframework.stereotype.Service;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RSurveyPlanConfigServiceImpl extends MppServiceImpl<RSurveyPlanConfigMapper, RSurveyPlanConfigPO> implements RSurveyPlanConfigService{
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
@Override
|
||||
public List<RSurveyPlanConfigPO> getOrgIds() {
|
||||
List<Dept> data = deptFeignClient.getAllDept().getData();
|
||||
List<String> orgIds = data.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
return this.list(new LambdaQueryWrapper<RSurveyPlanConfigPO>().in(CollUtil.isNotEmpty(orgIds),RSurveyPlanConfigPO::getOrgId,orgIds ));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.jdbc.Null;
|
||||
@@ -72,13 +73,14 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
||||
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
|
||||
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
|
||||
Integer checkType = loadTypeUserSearchParam.getCheckType();
|
||||
String aStatus = null;
|
||||
//0表示不是审核信息 1标识审核信息
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
|
||||
if(checkType==1){
|
||||
ids=data.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
|
||||
ids=ids.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
|
||||
aStatus = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData().getId();
|
||||
}
|
||||
//干扰源用户信息录入
|
||||
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids);
|
||||
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids,aStatus);
|
||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||
Map<String, PvTerminalTreeVO> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, pvTerminalTreeVO -> pvTerminalTreeVO));
|
||||
//部门处理:根据部门code取名称
|
||||
@@ -202,8 +204,15 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
||||
@Override
|
||||
public Page<RLoadTypeUserManageVO> getLoadTypeRelationList(LoadTypeUserSearchParam loadTypeUserSearchParam) {
|
||||
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
|
||||
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeRelationPage(page, loadTypeUserSearchParam);
|
||||
|
||||
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
|
||||
Integer checkType = loadTypeUserSearchParam.getCheckType();
|
||||
String aStatus = null;
|
||||
//0表示不是审核信息 1标识审核信息
|
||||
if(checkType==1){
|
||||
ids=ids.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
|
||||
aStatus = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData().getId();
|
||||
}
|
||||
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeRelationPage(page, loadTypeUserSearchParam,ids,aStatus);
|
||||
//部门处理:根据部门code取名称
|
||||
List<RLoadTypeUserManageVO> list = loadTypeUserPage.getRecords();
|
||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||
|
||||
@@ -306,7 +306,7 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStreamResource reportDownload(TerminalParam.DownloadParam param) throws IOException {
|
||||
public InputStreamResource reportDownload(TerminalParam.DownloadParam param) {
|
||||
PmsTerminalDetection terminal = this.getById(param.getId());
|
||||
if (ObjectUtil.isNull(terminal)) {
|
||||
if (StringUtils.isEmpty(terminal)) {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
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.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -15,14 +11,10 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pms.api.StatationStatClient;
|
||||
import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.process.mapper.RGeneralSurveyPlanDetailMapper;
|
||||
import com.njcn.process.mapper.RGeneralSurveyPlanPOMapper;
|
||||
import com.njcn.process.mapper.RSurveyCycleMapper;
|
||||
@@ -34,23 +26,18 @@ import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
||||
import com.njcn.process.pojo.vo.*;
|
||||
import com.njcn.process.service.RGeneralSurveyPlanDetailService;
|
||||
import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
||||
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.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
@@ -75,7 +62,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final RSurveyCycleMapper rSurveyCycleMapper;
|
||||
private final RSurveyPlanConfigService rSurveyPlanConfigService;
|
||||
|
||||
@@ -96,6 +82,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
BeanUtils.copyProperties(rGeneralSurveyPlanAddParm, rGeneralSurveyPlanPO);
|
||||
|
||||
/**查出周期id**/
|
||||
|
||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||
rSurveyCyclePOQueryWrapper.le("start_year", rGeneralSurveyPlanPO.getPlanEndTime());
|
||||
rSurveyCyclePOQueryWrapper.ge("end_year", rGeneralSurveyPlanPO.getPlanEndTime());
|
||||
@@ -213,6 +200,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList());
|
||||
rGeneralSurveyPlanVO.setSubCount(collect1.size());
|
||||
rGeneralSurveyPlanVO.setSubIds(collect1);
|
||||
rGeneralSurveyPlanVO.setIsFileUpload(ObjectUtil.isNull(temp.getIsFileUpload()) ? 0 : temp.getIsFileUpload());
|
||||
/*
|
||||
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
|
||||
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
|
||||
@@ -427,7 +415,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
@Override
|
||||
public RGeneralSurveyPlanAddParm querySubStatation(Integer statetionNum) {
|
||||
/*查询所有电站并过滤已经参加当期普测电站*/
|
||||
List<SubGetBase> list = commTerminalGeneralClient.tagOrIdGetSub(null).getData();
|
||||
List<SubGetBase> list = commTerminalGeneralClient.tagOrIdGetSub(new SubstationParam()).getData();
|
||||
|
||||
|
||||
/**查出当前周期id**/
|
||||
@@ -499,7 +487,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
public List<DeptSubstationVO> initDetpStataionTree(String orgdid) {
|
||||
|
||||
/*查询所有电站并过滤已经参加当期普测电站*/
|
||||
// List<StatationStat> list = statationStatClient.getPowerInfo(new PmsStatationStatInfoParam()).getData();
|
||||
|
||||
/**查出当前周期id**/
|
||||
QueryWrapper<RSurveyCyclePO> rSurveyCyclePOQueryWrapper = new QueryWrapper();
|
||||
@@ -571,17 +558,12 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
return deptSubstationVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
/*
|
||||
遍历两次data来组装带有children关联性的对象,如果找到子级就删除result的数据
|
||||
|
||||
*/
|
||||
// 遍历两次data来组装带有children关联性的对象,如果找到子级就删除result的数据
|
||||
List<DeptSubstationVO> result = new ArrayList<>(deptSubstationVOList);
|
||||
|
||||
for (DeptSubstationVO pv : deptSubstationVOList) {
|
||||
for (DeptSubstationVO pv2 : deptSubstationVOList) {
|
||||
|
||||
/*如果本级id与数据的父id相同,就说明是子父级关系*/
|
||||
|
||||
if (pv.getId().equals(pv2.getPid())) {
|
||||
pv.getChildren().add(pv2);
|
||||
result.remove(pv2);
|
||||
@@ -590,7 +572,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
}
|
||||
|
||||
result = recursion(result.get(0), orgdid);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.njcn.process.service.impl;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
||||
/**
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
@@ -14,4 +17,6 @@ import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
|
||||
public interface RSurveyPlanConfigService extends IMppService<RSurveyPlanConfigPO> {
|
||||
|
||||
|
||||
List<RSurveyPlanConfigPO> getOrgIds();
|
||||
|
||||
}
|
||||
|
||||
@@ -637,42 +637,26 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
|
||||
List<ThsStrategyVo> threeLevel = thsStrategyList.stream().filter(r -> GradeEnum.THREE_LEVEL.getCode().equals(r.getGrade())).collect(Collectors.toList());//三级策略集合
|
||||
//获取排他策略集合
|
||||
assBindList(threeLevel, thsStrategyBindDTOList);
|
||||
if(CollectionUtil.isNotEmpty(threeLevel)){
|
||||
threeLevel.forEach(i->assBindList(i, thsStrategyBindDTOList));
|
||||
}
|
||||
Map<String, ThsStrategyBindDTO> deleteMap = thsStrategyBindDTOList.stream().collect(Collectors.toMap(ThsStrategyBindDTO::getKeyId, Function.identity()));
|
||||
|
||||
|
||||
List<ThsStrategyVo> oneLevel = thsStrategyList.stream().filter(r -> !GradeEnum.THREE_LEVEL.getCode().equals(r.getGrade())).collect(Collectors.toList());//一级或二级策略集合
|
||||
|
||||
Map<String, List<ThsStrategyVo>> deptMap = oneLevel.stream().collect(Collectors.groupingBy(ThsStrategyVo::getDeptId));
|
||||
for (Map.Entry<String, List<ThsStrategyVo>> entry : deptMap.entrySet()) {
|
||||
String depId = entry.getKey();
|
||||
Dept dept = deptFeignClient.getDeptById(depId).getData();
|
||||
|
||||
List<ThsOverRunLog> thsOverRunLogList = new ArrayList<>();
|
||||
|
||||
ThsSupervise thsSupervise = null;
|
||||
List<ThsStrategyVo> deptStrategyList = entry.getValue();
|
||||
if (CollectionUtil.isNotEmpty(deptStrategyList)) {
|
||||
|
||||
|
||||
//遍历当前部门下面的所有策略
|
||||
for (ThsStrategyVo oneStrategyVo : deptStrategyList) {
|
||||
List<ThsStrategyBindDTO> useBindDTOList = new ArrayList<>();
|
||||
List<ThsWarnStrategyAss> oneInterferenceSourceAsses = this.queryWarnStrategyAss(oneStrategyVo.getId(), TypeEnum.SOURCE_TYPE);//干扰源列表
|
||||
List<ThsWarnStrategyAss> oneSteadyIndicatorAsses = this.queryWarnStrategyAss(oneStrategyVo.getId(), TypeEnum.INTERFERENCE_TYPE);//指标类型列表
|
||||
List<ThsWarnStrategyAss> oneMonitorAsses = this.queryWarnStrategyAss(oneStrategyVo.getId(), TypeEnum.MONITOR_TYPE);//监测点列表
|
||||
|
||||
List<String> tagIds = oneInterferenceSourceAsses.stream().map(ThsWarnStrategyAss::getAssId).distinct().collect(Collectors.toList());
|
||||
List<String> targetIds = oneSteadyIndicatorAsses.stream().map(ThsWarnStrategyAss::getAssId).distinct().collect(Collectors.toList());
|
||||
List<String> monitorIds = oneMonitorAsses.stream().map(ThsWarnStrategyAss::getAssId).collect(Collectors.toList());
|
||||
for (String tagId : tagIds) {
|
||||
ThsStrategyBindDTO strategyBindDTO = ThsStrategyBindDTO.builder().keyId(tagId).targetIds(targetIds).operation(oneStrategyVo.getOperation()).type(0).build();
|
||||
useBindDTOList.add(strategyBindDTO);
|
||||
}
|
||||
for (String monitorId : monitorIds) {
|
||||
ThsStrategyBindDTO strategyBindDTO = ThsStrategyBindDTO.builder().keyId(monitorId).targetIds(targetIds).operation(oneStrategyVo.getOperation()).type(1).build();
|
||||
useBindDTOList.add(strategyBindDTO);
|
||||
}
|
||||
assBindList(oneStrategyVo,useBindDTOList);
|
||||
//根据排他策略过滤12级策略
|
||||
Iterator<ThsStrategyBindDTO> iterator = useBindDTOList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -694,7 +678,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
List<String> useMonitorIds = monitorObj.stream().map(ThsStrategyBindDTO::getKeyId).collect(Collectors.toList());
|
||||
Map<String, ThsStrategyBindDTO> monitorMap = monitorObj.stream().collect(Collectors.toMap(ThsStrategyBindDTO::getKeyId, Function.identity()));
|
||||
|
||||
|
||||
MonitorGetParam monitorGetParam = new MonitorGetParam();
|
||||
monitorGetParam.setTagList(useTagIds);
|
||||
monitorGetParam.setMonitorIds(useMonitorIds);
|
||||
@@ -704,11 +687,9 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
Map<String, CommMonitorInfoDTO> monitorInfoDTOMap = commMonitorInfoDTOList.stream().collect(Collectors.toMap(CommMonitorInfoDTO::getId, Function.identity()));
|
||||
|
||||
List<String> temIds = commMonitorInfoDTOList.stream().map(CommMonitorInfoDTO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<RStatLimitRateDPO> rStatLimitRateDPOList = rStatLimitRateDClient.monitorIdsGetLimitInfo(RStatLimitQueryParam.builder().ids(temIds).date(yesterday).build()).getData();
|
||||
|
||||
//TODO 数据中心和pms这边稳态指标没用一个需要考虑兼容问题
|
||||
|
||||
//判断指标是否在策略中
|
||||
if (CollectionUtil.isNotEmpty(rStatLimitRateDPOList)) {
|
||||
for (RStatLimitRateDPO rStatLimitRateDPO : rStatLimitRateDPOList) {
|
||||
@@ -728,7 +709,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
}
|
||||
|
||||
Map<String, Boolean> limitBoolMap = verifyLimit(rStatLimitRateDPO, dictDataList, descriptionList, count);
|
||||
|
||||
boolean shouldContinue;
|
||||
if (oneStrategyVo.getOperation().equals(OperationEnum.AND.getCode())) {
|
||||
//与
|
||||
@@ -772,10 +752,8 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -832,9 +810,8 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
* @author cdf
|
||||
* @date 2024/3/19
|
||||
*/
|
||||
private void assBindList(List<ThsStrategyVo> levelList, List<ThsStrategyBindDTO> thsStrategyBindDTOList) {
|
||||
if (CollectionUtil.isNotEmpty(levelList)) {
|
||||
for (ThsStrategyVo thsStrategyVo : levelList) {
|
||||
private void assBindList(ThsStrategyVo thsStrategyVo, List<ThsStrategyBindDTO> thsStrategyBindDTOList) {
|
||||
|
||||
List<ThsWarnStrategyAss> tagIdsAss = this.queryWarnStrategyAss(thsStrategyVo.getId(), TypeEnum.SOURCE_TYPE);//干扰源列表
|
||||
List<ThsWarnStrategyAss> targetIdsAss = this.queryWarnStrategyAss(thsStrategyVo.getId(), TypeEnum.INTERFERENCE_TYPE);//指标类型列表
|
||||
List<ThsWarnStrategyAss> monitorIdsAss = this.queryWarnStrategyAss(thsStrategyVo.getId(), TypeEnum.MONITOR_TYPE);//监测点列表
|
||||
@@ -853,8 +830,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.math3.random.RandomDataGenerator;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,6 +50,8 @@ import java.util.stream.Collectors;
|
||||
public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMapper, ThsWarnStrategy> implements ThsWarnStrategyService {
|
||||
|
||||
private final ThsWarnStrategyAssServiceImpl thsWarnStrategyAssService;
|
||||
|
||||
private final ThsWarnStrategyMapper thsWarnStrategyMapper;
|
||||
private final MonitorClient monitorClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final ThsDeptAlarmService thsDeptAlarmService;
|
||||
@@ -107,6 +110,8 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean bindStrategy(StrategyParam.BindParam param) {
|
||||
checkBind(param);
|
||||
|
||||
List<ThsWarnStrategyAss> assList = new ArrayList<>();
|
||||
|
||||
ThsWarnStrategy thsWarnStrategy = new ThsWarnStrategy();
|
||||
@@ -141,6 +146,38 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验
|
||||
*/
|
||||
private boolean checkBind(StrategyParam.BindParam param){
|
||||
|
||||
LambdaQueryWrapper<ThsWarnStrategy> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.select(ThsWarnStrategy::getId).eq(ThsWarnStrategy::getDeptId,param.getDeptId())
|
||||
.eq(ThsWarnStrategy::getType,param.getStrategyType()).eq(ThsWarnStrategy::getGrade,param.getGrade());
|
||||
|
||||
if (StrUtil.isNotBlank(param.getId())) {
|
||||
lambdaQueryWrapper.ne(ThsWarnStrategy::getId,param.getId());
|
||||
}
|
||||
|
||||
List<ThsWarnStrategy> thsWarnStrategyList = thsWarnStrategyMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> strategyIds = thsWarnStrategyList.stream().map(ThsWarnStrategy::getId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(strategyIds)){
|
||||
return true;
|
||||
}
|
||||
|
||||
//判断标签和监测点是否已经存在
|
||||
List<ThsWarnStrategyAss> thsWarnStrategyAssList = thsWarnStrategyAssService.lambdaQuery().select(ThsWarnStrategyAss::getAssId).in(ThsWarnStrategyAss::getWarnId,strategyIds).list();
|
||||
long tagCount = thsWarnStrategyAssList.stream().filter(item->param.getMonitorTag().contains(item.getAssId())).count();
|
||||
if(tagCount>0){
|
||||
throw new BusinessException("所选干扰源已经存在策略!");
|
||||
}
|
||||
long monitorCount = thsWarnStrategyAssList.stream().filter(item->param.getMonitorIds().contains(item.getAssId())).count();
|
||||
if(monitorCount>0){
|
||||
throw new BusinessException("所选监测点已经存在策略!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StrategyParam.StrategyUpdateParam getUpdateStrategy(String id) {
|
||||
return this.baseMapper.selectUpdateStrategy(id);
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -107,7 +108,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
simpleDTO.setSort(dictDataCache.getSort());
|
||||
simpleDTO.setValue(dictDataCache.getValue());
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}).sorted(Comparator.comparing(SimpleDTO::getSort)).collect(Collectors.toList());
|
||||
|
||||
simpleTreeDTO.setChildren(simpleDTOs);
|
||||
return simpleTreeDTO;
|
||||
|
||||
@@ -81,7 +81,7 @@ public interface DeptFeignClient {
|
||||
HttpResult<Dept> getDeptByCode(@RequestParam("deptCode") String deptCode);
|
||||
|
||||
/**
|
||||
* 根据部门id获取所有子部门ids
|
||||
* 根据部门id获取所有子部门ids包含自身
|
||||
*/
|
||||
@GetMapping("/getDepSonIdtByDeptId")
|
||||
HttpResult<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId") String deptId);
|
||||
|
||||
@@ -5,8 +5,10 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.UserFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -67,12 +69,21 @@ public interface UserFeignClient {
|
||||
HttpResult<List<User>> appuserByIdList(@RequestBody List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据部门ids查询用户信息
|
||||
* 根据部门ids查询接收短信通知的用户信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getUserByDeptIds")
|
||||
HttpResult<List<User>> getUserByDeptIds(@RequestBody List<String> deptId);
|
||||
|
||||
/**
|
||||
* 根据部门ids查询用户信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getUserInfoByDeptIds")
|
||||
HttpResult<List<User>> getUserInfoByDeptIds(@RequestBody List<String> deptId);
|
||||
|
||||
/**
|
||||
* 根据角色Code集合查询用户信息
|
||||
* @param roleCode
|
||||
@@ -80,4 +91,8 @@ public interface UserFeignClient {
|
||||
*/
|
||||
@GetMapping("/getUserListByRoleCode")
|
||||
HttpResult<List<User>> getUserListByRoleCode(@RequestParam("roleCode") String roleCode);
|
||||
|
||||
@GetMapping("/getUserById")
|
||||
HttpResult<UserVO> getUserById(@RequestParam("id") String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -75,6 +76,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
|
||||
|
||||
@Override
|
||||
public HttpResult<List<User>> getUserByDeptIds(List<String> deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据部门ids查询接收短信通知的用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<User>> getUserInfoByDeptIds(List<String> deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据部门ids查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
@@ -84,6 +91,14 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
|
||||
log.error("{}异常,降级处理,异常为:{}","根据角色Code集合查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<UserVO> getUserById(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据用户id获取用户详情",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ public class DeptController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取所有子部门ids
|
||||
* 根据部门id获取所有子部门ids包含自身
|
||||
* @author cdf
|
||||
* @date 2022/7/26
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -472,7 +473,7 @@ public class UserController extends BaseController {
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getUserByDeptIds")
|
||||
@ApiOperation("根据部门ids查询用户信息")
|
||||
@ApiOperation("根据部门ids查询接收短信通知的用户信息")
|
||||
@ApiImplicitParam(name = "deptId", value = "用户部门id", required = true)
|
||||
public HttpResult<List<User>> getUserByDeptIds(@RequestBody List<String> deptId) {
|
||||
String methodDescribe = getMethodDescribe("getUserByDeptIds");
|
||||
@@ -484,6 +485,19 @@ public class UserController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getUserInfoByDeptIds")
|
||||
@ApiOperation("根据部门ids查询用户信息")
|
||||
@ApiImplicitParam(name = "deptId", value = "用户部门id", required = true)
|
||||
public HttpResult<List<User>> getUserInfoByDeptIds(@RequestBody List<String> deptId) {
|
||||
String methodDescribe = getMethodDescribe("getUserInfoByDeptIds");
|
||||
List<User> users = userService.list(new LambdaQueryWrapper<User>()
|
||||
.in(User::getDeptId,deptId)
|
||||
.eq(User::getState, DataStateEnum.ENABLE.getCode())
|
||||
);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取同级部门用户,以及下级部门所有用户
|
||||
* @author cdf
|
||||
@@ -498,5 +512,21 @@ public class UserController extends BaseController {
|
||||
List<User> users = userService.getUserListByRoleCode(roleCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据角色类型获取用户 角色类型 type0:超级管理员;1:管理员;2:普通用户' 3:'审核角色',
|
||||
* @author cdf
|
||||
* @date 2024/3/29
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_SERIOUS)
|
||||
@GetMapping("/getUserByRoleType")
|
||||
@ApiOperation("根据角色类型获取用户")
|
||||
@ApiImplicitParam(name = "roleCode", value = "角色类型", required = true)
|
||||
public HttpResult<List<User>> getUserByRoleType(@RequestParam("roleType") Integer roleType) {
|
||||
String methodDescribe = getMethodDescribe("getUserByRoleType");
|
||||
List<User> users = userService.getUserByRoleType(roleType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,4 +41,6 @@ public interface UserRoleMapper extends BaseMapper<UserRole> {
|
||||
*/
|
||||
List<User> selectUserRoleCode(@Param("roleCode")String roleCode);
|
||||
|
||||
List<User> getUserByRoleType(@Param("roleType")Integer roleType);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,16 @@
|
||||
WHERE
|
||||
role.`Code` = #{roleCode}
|
||||
</select>
|
||||
|
||||
<select id="getUserByRoleType" resultType="com.njcn.user.pojo.po.User">
|
||||
SELECT
|
||||
DISTINCT
|
||||
usr.*
|
||||
FROM
|
||||
sys_user usr
|
||||
INNER JOIN sys_user_role usrRole ON usrRole.User_Id = usr.Id
|
||||
INNER JOIN sys_role role ON role.Id = usrRole.Role_Id
|
||||
WHERE
|
||||
role.`type` = #{roleType}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -188,4 +188,6 @@ public interface IUserService extends IService<User> {
|
||||
|
||||
List<User> getUserListByRoleCode(String roleCode);
|
||||
|
||||
List<User> getUserByRoleType(Integer roleType);
|
||||
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门详情
|
||||
* 根据部门id获取所有子部门ids包含自身
|
||||
*/
|
||||
@Override
|
||||
public List<String> getDepSonIdtByDeptId(String id) {
|
||||
|
||||
@@ -523,6 +523,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
return userRoleMapper.selectUserRoleCode(roleCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUserByRoleType(Integer roleType) {
|
||||
return userRoleMapper.getUserByRoleType(roleType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据登录名查询用户
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user