润阳项目

新增相关字段和判断
This commit is contained in:
chenhaojie 2024-10-18 15:26:48 +08:00
parent 70ab47f82e
commit e434dd3d4c
3 changed files with 26 additions and 27 deletions

View File

@ -196,7 +196,7 @@ public class SysIotModelController {
return R.success(sysIotModelService.updateSysIotModelService(sysIotModelServiceDto));
}
/** 物模型属性删除 */
/** 物模型属性动作删除 */
@PostMapping("/service/delete")
public R<Void> deleteSysIotModelService(@RequestBody SysIotModelServiceDto sysIotModelServiceDto) {

View File

@ -142,12 +142,12 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
List<SysEquipmentExcel> sysEquipmentList = sysEquipmentMapper.queryInfoById(sysEquipmentDto);
//自定义别名 别名的key和实体类中的名称要对应上
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("tag", "标识");
map.put("objectType", "设备类型编码10001风电场10002机组");
map.put("iotModelName", "所属物模型名称");
map.put("tag", "*标识I新增U修改D删除");
map.put("objectType", "*设备类型编码10001风电场10002机组");
map.put("iotModelCode", "所属物模型编码");
map.put("code", "设备编码");
map.put("name", "设备名称");
map.put("iotModelName", "所属物模型名称");
map.put("code", "*设备编码");
map.put("name", "*设备名称");
map.put("madeinFactory", "制造商");
map.put("model", "型号规格");
map.put("location", "安装位置");
@ -155,13 +155,13 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
map.put("latitude", "纬度");
map.put("installDate", "安装时间");
map.put("remarks", "备注");
map.put("mrid", "机构编码");
map.put("orgName", "机构名称");
map.put("parentEquipmentCode", "上级设备编码");
map.put("parentEquipmentName", "上级设备名称");
map.put("belongLine", "所属线路");
map.put("standard", "是否为标杆机组(0否,1是)");
map.put("nominalCapacity", "额定容量MW");
map.put("mrid", "机构编码");
map.put("parentEquipmentCode", "上级设备编码");
ExcelWriter writer = new ExcelWriter();
writer.setHeaderAlias(map);
@ -203,14 +203,13 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
// 遍历
for (List<Object> row : list) {
SysEquipment field = new SysEquipment();
// 根据编码获取物模型id
if (StringUtils.hasText(row.get(3).toString())) {
if (StringUtils.hasText(row.get(2).toString())) {
Long iotModelId = sysIotModelMapper.queryIotModelIdByName(row.get(3).toString());
field.setIotModelId(iotModelId);
}
if (StringUtils.hasText(row.get(18).toString())) {
Long orgId = sysOrgMapper.queryOrgIdByName(row.get(18).toString());
if (StringUtils.hasText(row.get(13).toString())) {
Long orgId = sysOrgMapper.queryOrgIdByName(row.get(13).toString());
field.setOrgId(orgId);
}
// 转换成字符串
@ -231,10 +230,10 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
field.setInstallDate(sf.parse(row.get(11).toString()));
}
field.setRemarks(row.get(12).toString());
field.setBelongLine(row.get(15).toString());
field.setStandard(Integer.valueOf(row.get(16).toString()));
if (StringUtils.hasText(row.get(17).toString())) {
field.setNominalCapacity(Double.valueOf(row.get(17).toString()));
field.setBelongLine(row.get(17).toString());
field.setStandard(Integer.valueOf(row.get(18).toString()));
if (StringUtils.hasText(row.get(19).toString())) {
field.setNominalCapacity(Double.valueOf(row.get(19).toString()));
}
field.setParentEquipmentId(Long.valueOf(parentEquipmentId));

View File

@ -264,16 +264,16 @@ public class SysIotModelServiceImpl implements SysIotModelService {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
SheetInfoBean sheetDTO = new SheetInfoBean();
map.put("tag", "标识");
map.put("iotModelName", "所属物模型名称");
map.put("iotModelCode", "所属物模型编码");
map.put("attributeCode", "物模型属性编码");
map.put("attributeName", "物模型属性名称");
map.put("attributeType", "属性类型138模拟量139累积量140离散量");
map.put("porder", "测点序号");
map.put("iotModelName", "所属物模型名称");
map.put("attributeCode", "*物模型属性编码");
map.put("attributeName", "*物模型属性名称");
map.put("attributeType", "*属性类型138模拟量139累积量140离散量");
map.put("porder", "*测点序号");
map.put("subSystem", "子系統");
map.put("dataType", "数据类型");
map.put("visible", "是否可见0不可见1可见");
map.put("highSpeed", "属性频度0低频属性1高频属性");
map.put("highSpeed", "属性频度0低频属性1高频属性");
sheetDTO.setSheetName("物模型属性");
sheetDTO.setFieldAndAlias(map);
sheetDTO.setCollection(sysIotModelFieldVoList);
@ -283,12 +283,12 @@ public class SysIotModelServiceImpl implements SysIotModelService {
LinkedHashMap<String, String> map1= new LinkedHashMap<>();
SheetInfoBean sheetDTO1 = new SheetInfoBean();
map1.put("tag", "标识");
map1.put("iotModelName", "所属物模型名称");
map1.put("iotModelCode", "所属物模型编码");
map1.put("serviceCode", "物模型动作编码");
map1.put("serviceName", "物模型动作名称");
map1.put("serviceType", "动作类型146遥控147遥调");
map1.put("porder", "测点序号");
map1.put("iotModelName", "所属物模型名称");
map1.put("serviceCode", "*物模型动作编码");
map1.put("serviceName", "*物模型动作名称");
map1.put("serviceType", "*动作类型146遥控147遥调");
map1.put("porder", "*测点序号");
sheetDTO1.setSheetName("物模型动作");
sheetDTO1.setFieldAndAlias(map1);
sheetDTO1.setCollection(sysIotModelServiceVoList);