pms国网上送代码提交
This commit is contained in:
@@ -171,6 +171,12 @@ public class MonitorParam {
|
||||
private String monitorTag;
|
||||
|
||||
|
||||
/**
|
||||
* 三级级监测对象类型
|
||||
*/
|
||||
private String objType;
|
||||
|
||||
|
||||
/**
|
||||
* 监测对象编号
|
||||
*/
|
||||
|
||||
@@ -141,6 +141,13 @@ public class Monitor extends BaseEntity {
|
||||
private String monitorTag;
|
||||
|
||||
|
||||
/**
|
||||
* 三级级监测对象类型
|
||||
*/
|
||||
private String objType;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 监测对象编号
|
||||
*/
|
||||
@@ -215,6 +222,11 @@ public class Monitor extends BaseEntity {
|
||||
* 场站属性
|
||||
*/
|
||||
private String fieldStation;
|
||||
|
||||
/**
|
||||
* 行业类型
|
||||
*/
|
||||
private String tradeCode;
|
||||
/**
|
||||
* 0.未上送 1.已上送 2.取消上送 3.待重新上送
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,9 @@ public class StatationStatVO implements Serializable {
|
||||
@ApiModelProperty(value = "关联中台的电站")
|
||||
private String midStationId;
|
||||
|
||||
@ApiModelProperty(value = "关联中台的电站名称")
|
||||
private String midStationName;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
|
||||
@@ -44,9 +44,10 @@
|
||||
|
||||
|
||||
<select id="getStatationStatPageList" resultType="com.njcn.device.pms.pojo.vo.StatationStatVO">
|
||||
select a.*, b.name orgName
|
||||
select a.*, b.name orgName,c.Name as midStationName
|
||||
from pms_statation_stat a
|
||||
inner join sys_dept b on a.org_id = b.code and b.state = 1
|
||||
left join sys_dept b on a.org_id = b.code and b.state = 1
|
||||
left join pms_mid_ledger c on a.Mid_Station_Id = c.id
|
||||
where a.status = 1
|
||||
<if test="baseParam.searchValue!=null and baseParam.searchValue!=''">
|
||||
and
|
||||
|
||||
@@ -39,8 +39,11 @@ import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||
import com.njcn.device.pq.pojo.po.LineBak;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
@@ -98,6 +101,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
private final DeviceBakMapper deviceBakMapper;
|
||||
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public List<PmsMonitorBaseDTO> getMonitorByCondition(List<String> deptIdList, PmsDeviceInfoParam pmsDeviceInfoParam) {
|
||||
@@ -686,6 +691,15 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
||||
|
||||
|
||||
List<DictData> businessType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
|
||||
Map<String, DictData> businessDicMap = businessType.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
|
||||
//TODO 零时处理
|
||||
List<SysDicTreePO> dicTree = dictTreeFeignClient.queryAll().getData();
|
||||
dicTree = dicTree.stream().filter(item->item.getCode()!="Device_Unit" && !item.getCode().contains("@")).collect(Collectors.toList());
|
||||
Map<String,SysDicTreePO> objTypeMap = dicTree.stream().collect(Collectors.toMap(SysDicTreePO::getName,Function.identity()));
|
||||
|
||||
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
||||
//单位
|
||||
if (!mapDept.containsKey(oracleTerminalExcel.getGdName())) {
|
||||
@@ -796,6 +810,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
pmsTerminalPO.setStatus(DataStateEnum.ENABLE.getCode());
|
||||
pmsTerminalPO.setPort(oracleTerminalExcel.getPort().toString());
|
||||
pmsTerminalPO.setIsUpToGrid(0);
|
||||
//pmsTerminalPO.setId(or);
|
||||
|
||||
if (manDicMap.containsKey(oracleTerminalExcel.getManufacturer())) {
|
||||
pmsTerminalPO.setManufacture(manDicMap.get(oracleTerminalExcel.getManufacturer()).getId());
|
||||
@@ -931,15 +946,38 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setTerminalId(devId);
|
||||
monitorPO.setIsSpecialSupplyElectricity(0);
|
||||
|
||||
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
||||
|
||||
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测对象类型不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
//监测点对象类型
|
||||
|
||||
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType()+"字典监测点对象类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
//行业类型
|
||||
if (businessDicMap.containsKey(oracleTerminalExcel.getBusinessType())) {
|
||||
String busTypeId = businessDicMap.get(oracleTerminalExcel.getBusinessType()).getId();
|
||||
monitorPO.setTradeCode(busTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getBusinessType()+"字典行业类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
//TODO 监测点对象名称
|
||||
|
||||
|
||||
String wireMethod = "";
|
||||
switch (oracleTerminalExcel.getPtType()) {
|
||||
@@ -971,6 +1009,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setCt2(oracleTerminalExcel.getCt2());
|
||||
|
||||
|
||||
|
||||
|
||||
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
||||
monitorMapper.insert(monitorPO);
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(Float.parseFloat(scale.getValue()), oracleTerminalExcel.getDealCapacity(), oracleTerminalExcel.getDevCapacity(), oracleTerminalExcel.getShortCapacity(), 0, 0);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -26,4 +27,13 @@ public interface DictTreeFeignClient {
|
||||
|
||||
@PostMapping("/query")
|
||||
HttpResult<List<DictTreeVO>> query(@RequestParam("pid") String pid) ;
|
||||
|
||||
@GetMapping("/queryAll")
|
||||
HttpResult<List<SysDicTreePO>> queryAll() ;
|
||||
|
||||
|
||||
@GetMapping("/queryTree")
|
||||
HttpResult<List<SysDicTreePO>> queryTree() ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,18 @@ public class DictTreeFeignClientFallbackFactory implements FallbackFactory<DictT
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典pid获取字典树数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<SysDicTreePO>> queryAll() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取所有字典树数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<SysDicTreePO>> queryTree() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取树形数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/6/9 14:00【需求编号】
|
||||
*
|
||||
@@ -66,7 +67,13 @@ public class SysDicTreePO extends BaseEntity {
|
||||
* 状态(字典 0正常 1停用 2删除)
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 子类
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<SysDicTreePO> children;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user