Commit 80d4f91c authored by zhangsen's avatar zhangsen

装备模板导出和装备导入需求修改

parent bb3fccae
...@@ -59,19 +59,19 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable { ...@@ -59,19 +59,19 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date productionDate; private Date productionDate;
@Excel(name = "报废年限",width = 30, orderNum = "14") // @Excel(name = "报废年限",width = 30, orderNum = "14")
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private String expiryDate; // private String expiryDate;
//
@Excel(name = "维保周期",width = 30, orderNum = "15") // @Excel(name = "维保周期",width = 30, orderNum = "15")
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private BigDecimal maintenanceCycle ; // private BigDecimal maintenanceCycle ;
@Excel(name = "投运时间",width = 30, orderNum = "16") @Excel(name = "投运时间",width = 30, orderNum = "14")
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate; private Date deliveryDate;
@Excel(name = "所属系统",width = 30, orderNum = "17") // @Excel(name = "所属系统",width = 30, orderNum = "17")
//@Excel(name = "所属单位",width = 30,orderNum = "12") // //@Excel(name = "所属单位",width = 30,orderNum = "12")
private String systemName; // private String systemName;
} }
...@@ -68,21 +68,21 @@ public class EquipmentDetailExcelSingleTemplateDto { ...@@ -68,21 +68,21 @@ public class EquipmentDetailExcelSingleTemplateDto {
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date productionDate; private Date productionDate;
@ExcelProperty(value = "报废年限", index = 13) // @ExcelProperty(value = "报废年限", index = 13)
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private String expiryDate; // private String expiryDate;
//
@ExcelProperty(value = "维保周期", index = 14) // @ExcelProperty(value = "维保周期", index = 14)
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private BigDecimal maintenanceCycle ; // private BigDecimal maintenanceCycle ;
@ExcelProperty(value = "投运时间", index = 15) @ExcelProperty(value = "投运时间", index = 13)
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate; private Date deliveryDate;
//动态下拉内容 //动态下拉内容
@ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容 // @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
@ExcelProperty(value = "所属系统", index = 16) // @ExcelProperty(value = "所属系统", index = 16)
//@Excel(name = "所属单位",width = 30,orderNum = "12") // //@Excel(name = "所属单位",width = 30,orderNum = "12")
private String systemName; // private String systemName;
} }
...@@ -69,21 +69,21 @@ public class EquipmentDetailExcelTemplateDto implements Serializable { ...@@ -69,21 +69,21 @@ public class EquipmentDetailExcelTemplateDto implements Serializable {
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date productionDate; private Date productionDate;
@ExcelProperty(value = "报废年限", index = 13) // @ExcelProperty(value = "报废年限", index = 13)
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private String expiryDate; // private String expiryDate;
//
@ExcelProperty(value = "维保周期", index = 14) // @ExcelProperty(value = "维保周期", index = 14)
//@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
private BigDecimal maintenanceCycle ; // private BigDecimal maintenanceCycle ;
@ExcelProperty(value = "投运时间", index = 15) @ExcelProperty(value = "投运时间", index = 13)
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate; private Date deliveryDate;
//动态下拉内容 //动态下拉内容
@ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容 // @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
@ExcelProperty(value = "所属系统", index = 16) // @ExcelProperty(value = "所属系统", index = 16)
//@Excel(name = "所属单位",width = 30,orderNum = "12") // //@Excel(name = "所属单位",width = 30,orderNum = "12")
private String systemName; // private String systemName;
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
...@@ -8,6 +9,7 @@ import java.util.stream.Collectors; ...@@ -8,6 +9,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -609,8 +611,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -609,8 +611,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
AtomicReference<String> fightSysIds = new AtomicReference<>(""); AtomicReference<String> fightSysIds = new AtomicReference<>("");
String fightingSysCodes = equipmentDetailDownloadVOS.getFightingSysCodes(); String fightingSysCodes = equipmentDetailDownloadVOS.getFightingSysCodes();
if (StringUtils.isNotBlank(fightingSysCodes)) { if (StringUtils.isNotBlank(fightingSysCodes)) {
String[] idsArr = fightingSysCodes.split("-"); String[] codes = new String[]{};
List<FireFightingSystemEntity> fightingSystemList = fireFightingSystemService.getFightingSysByCodes(idsArr); String[] idsArr1 = fightingSysCodes.split("-");
String[] idsArr2 = fightingSysCodes.split(",");
codes = idsArr1.length >= idsArr2.length ? idsArr1 : idsArr2;
List<FireFightingSystemEntity> fightingSystemList = fireFightingSystemService.getFightingSysByCodes(codes);
if (!fightingSystemList.isEmpty()) { if (!fightingSystemList.isEmpty()) {
fightingSystemList.stream().forEach(x -> { fightingSystemList.stream().forEach(x -> {
String sysCodes = fightSysIds.get(); String sysCodes = fightSysIds.get();
...@@ -640,9 +645,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -640,9 +645,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentDetail.setName(equipmentDetailDownloadVOS.getName()); equipmentDetail.setName(equipmentDetailDownloadVOS.getName());
equipmentDetail.setArea(equipmentDetailDownloadVOS.getDescription()); equipmentDetail.setArea(equipmentDetailDownloadVOS.getDescription());
equipmentDetail.setProductionDate(equipmentDetailDownloadVOS.getProductionDate()); equipmentDetail.setProductionDate(equipmentDetailDownloadVOS.getProductionDate());
equipmentDetail.setExpiryDate(equipmentDetailDownloadVOS.getExpiryDate()); equipmentDetail.setExpiryDate(ObjectUtils.isEmpty(equipment.getExpiryDate()) ? "" : String.valueOf(equipment.getExpiryDate()));
equipmentDetail.setDeliveryDate(equipmentDetailDownloadVOS.getDeliveryDate()); equipmentDetail.setDeliveryDate(equipmentDetailDownloadVOS.getDeliveryDate());
equipmentDetail.setMaintenanceCycle(equipmentDetailDownloadVOS.getMaintenanceCycle()); equipmentDetail.setMaintenanceCycle(ObjectUtils.isEmpty(equipment.getMaintenanceCycle()) ? null : BigDecimal.valueOf(equipment.getMaintenanceCycle()));
// 导入新增所属单位 // 导入新增所属单位
...@@ -685,10 +690,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -685,10 +690,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
} }
if (StringUtils.isNotBlank(equipmentDetailDownloadVOS.getSystemName())) { // if (StringUtils.isNotBlank(equipmentDetailDownloadVOS.getSystemName())) {
String[] SystemName = equipmentDetailDownloadVOS.getSystemName().split("@"); // String[] SystemName = equipmentDetailDownloadVOS.getSystemName().split("@");
equipmentSpecific.setSystemId(SystemName[1]); // equipmentSpecific.setSystemId(SystemName[1]);
} // }
equipmentSpecificMapper.insert(equipmentSpecific); equipmentSpecificMapper.insert(equipmentSpecific);
StockServiceImpl controllerProxy = SpringUtils.getBean(StockServiceImpl.class); StockServiceImpl controllerProxy = SpringUtils.getBean(StockServiceImpl.class);
//添加对于装备类型统计数据的刷新 //添加对于装备类型统计数据的刷新
......
...@@ -4878,8 +4878,8 @@ ...@@ -4878,8 +4878,8 @@
max( CASE WHEN ei.equipment_index_key = 'FHS_PipePressureDetector_PipePressure' THEN DATE_FORMAT( ei.`update_date`, '%m-%d %H:%i:%S' ) END ), max( CASE WHEN ei.equipment_index_key = 'FHS_PipePressureDetector_PipePressure' THEN DATE_FORMAT( ei.`update_date`, '%m-%d %H:%i:%S' ) END ),
'--' '--'
) AS nowPressureDate, ) AS nowPressureDate,
max( CASE WHEN fi.field_name = 'lowLevel' THEN fi.field_value END ) AS minLevel, max( CASE WHEN fi.field_name = 'minPressure' THEN fi.field_value END ) AS minLevel,
max( CASE WHEN fi.field_name = 'highLevel' THEN fi.field_value END ) AS maxLevel max( CASE WHEN fi.field_name = 'maxPressure' THEN fi.field_value END ) AS maxLevel
FROM FROM
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment