Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -154,7 +154,7 @@ public class PubUtils {
|
|||||||
MAPPER.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
|
MAPPER.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
|
||||||
return MAPPER.writeValueAsString(object);
|
return MAPPER.writeValueAsString(object);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IllegalArgumentException("将将实体对象转为JSON时发生错误:" + object, e);
|
throw new IllegalArgumentException("将实体对象转为JSON时发生错误:" + object, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ public class Knife4jSwaggerConfig {
|
|||||||
"com.njcn.stat.controller",
|
"com.njcn.stat.controller",
|
||||||
"com.njcn.rt.controller",
|
"com.njcn.rt.controller",
|
||||||
"com.njcn.zlevent.controller",
|
"com.njcn.zlevent.controller",
|
||||||
"com.njcn.cloud.controller"
|
"com.njcn.cloud.controller",
|
||||||
|
"com.njcn.zlevent.controller",
|
||||||
|
"com.njcn.prepare"
|
||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<GrantType> grantTypes = new ArrayList<>();
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFac
|
|||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
*
|
||||||
@@ -22,11 +25,20 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
public interface CommLineClient {
|
public interface CommLineClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 获取监测点信息
|
|
||||||
* @param id
|
* @param id
|
||||||
|
* @Description: 获取监测点信息
|
||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2023/9/22 11:11
|
* @Date: 2023/9/22 11:11
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getLineDetail")
|
@GetMapping("/getLineDetail")
|
||||||
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 批量获取监测点信息
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/3 15:25
|
||||||
|
* @param ids 监测点索引集合
|
||||||
|
*/
|
||||||
|
@PostMapping("/getLineDetailBatch")
|
||||||
|
HttpResult<List<LineDTO>> getLineDetailBatch(@RequestParam("ids") List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
*
|
||||||
@@ -43,4 +45,13 @@ public class CommLineController extends BaseController {
|
|||||||
LineDTO result = monitorService.getLineDetail(id);
|
LineDTO result = monitorService.getLineDetail(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getLineDetailBatch")
|
||||||
|
@ApiOperation("批量获取监测点信息")
|
||||||
|
public HttpResult<List<LineDTO>> getLineDetailBatch(@RequestParam("ids") List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineDetailBatch");
|
||||||
|
List<LineDTO> result = monitorService.getLineDetailBatch(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
|||||||
*/
|
*/
|
||||||
MonitorVO getPwMonitorTerminal(@Param("id")String id);
|
MonitorVO getPwMonitorTerminal(@Param("id")String id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 根据监测点id获取监测点信息
|
* @Description: 根据监测点id获取监测点信息
|
||||||
* @param id
|
* @param id
|
||||||
@@ -88,6 +89,11 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
|||||||
*/
|
*/
|
||||||
LineDTO selectLineDetail(@Param("id")String id);
|
LineDTO selectLineDetail(@Param("id")String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 根据监测点id批量获取监测点信息
|
||||||
|
*/
|
||||||
|
List<LineDTO> selectLineDetailBatch(@Param("ids")List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
* @param param
|
* @param param
|
||||||
@@ -99,4 +105,6 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
|||||||
|
|
||||||
|
|
||||||
Map<String, String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
Map<String, String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,6 +172,23 @@
|
|||||||
WHERE
|
WHERE
|
||||||
pm.id = #{id}
|
pm.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectLineDetailBatch" resultType="com.njcn.device.biz.pojo.dto.LineDTO">
|
||||||
|
SELECT
|
||||||
|
pm.Id as lineId,
|
||||||
|
pm.Terminal_Id as devId,
|
||||||
|
pm.Statistical_Interval as timeInterval,
|
||||||
|
pm.Voltage_Level as voltageLevel,
|
||||||
|
pm.Monitor_State as runFlag,
|
||||||
|
pm.Terminal_Wiring_Method as ptType,
|
||||||
|
pm.PT_Phase_Type as ptPhaseType
|
||||||
|
FROM
|
||||||
|
pms_monitor pm
|
||||||
|
WHERE
|
||||||
|
pm.id in
|
||||||
|
<foreach collection="ids" open="(" close=")" item="id" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
<select id="selectMonitorList" resultType="com.njcn.device.pms.pojo.po.Monitor">
|
<select id="selectMonitorList" resultType="com.njcn.device.pms.pojo.po.Monitor">
|
||||||
SELECT
|
SELECT
|
||||||
pm.Id,
|
pm.Id,
|
||||||
|
|||||||
@@ -180,4 +180,9 @@ public interface IMonitorService extends IService<Monitor> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LineDTO getLineDetail(String id);
|
LineDTO getLineDetail(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量根据监测点id获取监测点信息
|
||||||
|
*/
|
||||||
|
List<LineDTO> getLineDetailBatch(List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -455,6 +455,34 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量根据监测点id获取监测点信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<LineDTO> getLineDetailBatch(List<String> ids) {
|
||||||
|
if(CollectionUtil.isEmpty(ids)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<LineDTO> lineDTOS = this.baseMapper.selectLineDetailBatch(ids);
|
||||||
|
//电压等级
|
||||||
|
Map<String, List<LineDTO>> lineVoltageMap = lineDTOS.stream().collect(Collectors.groupingBy(LineDTO::getVoltageLevel));
|
||||||
|
List<DictData> voltageList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||||
|
Map<String, String> voltageMap = voltageList.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
|
lineVoltageMap.forEach((key,lineData) -> {
|
||||||
|
String voltage= voltageMap.get(key);
|
||||||
|
lineData = lineData.stream().peek(line -> line.setVoltageLevel(voltage)).collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
//接线方式
|
||||||
|
Map<String, List<LineDTO>> linePtTypeMap = lineDTOS.stream().collect(Collectors.groupingBy(LineDTO::getPtType));
|
||||||
|
List<DictData> connect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||||
|
Map<String, String> connectMap = connect.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
|
linePtTypeMap.forEach((key,lineData)->{
|
||||||
|
String ptType= connectMap.get(key);
|
||||||
|
lineData = lineData.stream().peek(line -> line.setPtType(ptType)).collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
return lineDTOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取主配网监测点id集合
|
* 获取主配网监测点id集合
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
*
|
||||||
@@ -40,4 +42,14 @@ public class CommLineController extends BaseController {
|
|||||||
LineDTO result = lineService.getLineDetail(id);
|
LineDTO result = lineService.getLineDetail(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getLineDetailBatch")
|
||||||
|
@ApiOperation("批量获取监测点信息")
|
||||||
|
public HttpResult<List<LineDTO>> getLineDetailBatch(@RequestParam("ids") List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineDetailBatch");
|
||||||
|
List<LineDTO> result = lineService.getLineDetailBatch(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -525,5 +525,11 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
*/
|
*/
|
||||||
LineDTO selectLineDetail(@Param("id") String id);
|
LineDTO selectLineDetail(@Param("id") String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 根据监测点id批量获取监测点信息
|
||||||
|
*/
|
||||||
|
List<LineDTO> selectLineDetailBatch(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1365,6 +1365,33 @@
|
|||||||
AND line.id = #{id}
|
AND line.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLineDetailBatch" resultType="com.njcn.device.biz.pojo.dto.LineDTO">
|
||||||
|
SELECT
|
||||||
|
line.id AS lineId,
|
||||||
|
dev.id AS devId,
|
||||||
|
detail.Time_Interval AS timeInterval,
|
||||||
|
vg.Scale AS voltageLevel,
|
||||||
|
pqd.Run_Flag as runFlag,
|
||||||
|
detail.PT_Type AS ptType,
|
||||||
|
detail.PT_Phase_Type AS ptPhaseType
|
||||||
|
FROM
|
||||||
|
pq_line line,
|
||||||
|
pq_line_detail detail,
|
||||||
|
pq_line vo,
|
||||||
|
pq_voltage vg,
|
||||||
|
pq_line dev,
|
||||||
|
pq_device pqd
|
||||||
|
WHERE
|
||||||
|
line.id = detail.id
|
||||||
|
AND vo.id = line.pid
|
||||||
|
AND dev.id = vo.pid
|
||||||
|
AND vo.id = vg.id
|
||||||
|
AND pqd.id = dev.id
|
||||||
|
AND line.id in
|
||||||
|
<foreach collection="ids" open="(" close=")" item="id" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getCustomDetailByLineId" resultType="map">
|
<select id="getCustomDetailByLineId" resultType="map">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -191,4 +191,9 @@ public interface LineService {
|
|||||||
* @Date: 2023/9/22 10:46
|
* @Date: 2023/9/22 10:46
|
||||||
*/
|
*/
|
||||||
LineDTO getLineDetail(String id);
|
LineDTO getLineDetail(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点批量获取监测点信息
|
||||||
|
*/
|
||||||
|
List<LineDTO> getLineDetailBatch(List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -476,14 +476,45 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
public LineDTO getLineDetail(String id) {
|
public LineDTO getLineDetail(String id) {
|
||||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||||
Map<String, String> dicMap = data.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
Map<String, String> dicMap = data.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
|
List<DictData> connect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||||
|
Map<String, String> connectMap = connect.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(id);
|
LineDTO lineDTO = this.baseMapper.selectLineDetail(id);
|
||||||
if(dicMap.containsKey(lineDTO.getVoltageLevel())){
|
if(dicMap.containsKey(lineDTO.getVoltageLevel())&&connectMap.containsKey(lineDTO.getPtType())){
|
||||||
lineDTO.setVoltageLevel(dicMap.get(lineDTO.getVoltageLevel()));
|
lineDTO.setVoltageLevel(dicMap.get(lineDTO.getVoltageLevel()));
|
||||||
|
lineDTO.setPtType(connectMap.get(lineDTO.getPtType()));
|
||||||
return lineDTO;
|
return lineDTO;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量根据监测点id获取监测点信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<LineDTO> getLineDetailBatch(List<String> ids) {
|
||||||
|
if(CollectionUtil.isEmpty(ids)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<LineDTO> lineDTOS = this.baseMapper.selectLineDetailBatch(ids);
|
||||||
|
//电压等级
|
||||||
|
Map<String, List<LineDTO>> lineVoltageMap = lineDTOS.stream().collect(Collectors.groupingBy(LineDTO::getVoltageLevel));
|
||||||
|
List<DictData> voltageList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||||
|
Map<String, String> voltageMap = voltageList.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
|
lineVoltageMap.forEach((key,lineData) -> {
|
||||||
|
String voltage= voltageMap.get(key);
|
||||||
|
lineData = lineData.stream().peek(line -> line.setVoltageLevel(voltage)).collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
//接线方式
|
||||||
|
Map<String, List<LineDTO>> linePtTypeMap = lineDTOS.stream().collect(Collectors.groupingBy(LineDTO::getPtType));
|
||||||
|
List<DictData> connect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||||
|
Map<String, String> connectMap = connect.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||||
|
linePtTypeMap.forEach((key,lineData)->{
|
||||||
|
String ptType= connectMap.get(key);
|
||||||
|
lineData = lineData.stream().peek(line -> line.setPtType(ptType)).collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
return lineDTOS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||||
|
|||||||
@@ -68,7 +68,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-api</artifactId>
|
<artifactId>log4j-api</artifactId>
|
||||||
<version>2.13.3</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
|||||||
@@ -44,31 +44,31 @@ public class RStatLimitRateDPO {
|
|||||||
private Integer allTime;
|
private Integer allTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 闪变总计算次数
|
* 闪变越限次数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "flicker_overtime")
|
@TableField(value = "flicker_overtime")
|
||||||
private Integer flickerOvertime;
|
private Integer flickerOvertime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 频率偏差越限次数
|
* 闪变总计算次数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "flicker_all_time")
|
@TableField(value = "flicker_all_time")
|
||||||
private Integer flickerAllTime;
|
private Integer flickerAllTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压偏差越限次数
|
* 频率偏差越限次数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "freq_dev_overtime")
|
@TableField(value = "freq_dev_overtime")
|
||||||
private Integer freqDevOvertime;
|
private Integer freqDevOvertime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压不平衡度越限次数
|
* 电压偏差越限次数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "voltage_dev_overtime")
|
@TableField(value = "voltage_dev_overtime")
|
||||||
private Integer voltageDevOvertime;
|
private Integer voltageDevOvertime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 闪变越限次数
|
* 三相电压不平衡度越限次数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "ubalance_overtime")
|
@TableField(value = "ubalance_overtime")
|
||||||
private Integer ubalanceOvertime;
|
private Integer ubalanceOvertime;
|
||||||
|
|||||||
@@ -257,7 +257,8 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<User> getAdminInfo() {
|
public List<User> getAdminInfo() {
|
||||||
return this.lambdaQuery().eq(User::getLoginName,"njcnyw").eq(User::getState,1).list();
|
//这边先排除掉dev_code不存在的业务管理员
|
||||||
|
return this.lambdaQuery().eq(User::getType,1).eq(User::getState,1).ne(User::getDevCode,"").list();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user