Commit fa720d7c authored by chenzhao's avatar chenzhao

修改消防装备

parent 2abbe8f1
......@@ -110,6 +110,8 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
private RedisUtils redisUtils;
@Value("${equip.enabled}")
private Boolean enabled;
@Value("${iot.code.prefix.have.used:20210003,20210004,20210005}")
......@@ -549,7 +551,13 @@ public class EquipmentDetailController extends AbstractBaseController {
// }
//
// } catch (Exception e) {
ExcelEnums excelEnums = ExcelEnums.getByKey(ExcelEnums.XFZBSINGLE.getType());
ExcelEnums excelEnums = null;
if (!enabled){
excelEnums = ExcelEnums.getByKey(ExcelEnums.XFZBSINGLE.getType());
}else {
excelEnums = ExcelEnums.getByKey(ExcelEnums.XFZB.getType());
}
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url);
......@@ -590,7 +598,12 @@ public class EquipmentDetailController extends AbstractBaseController {
try {
UUID uuid = UUID.randomUUID();
key= uuid.toString();
ExcelEnums excelEnums = ExcelEnums.getByKey(type);
ExcelEnums excelEnums = null;
if (!enabled){
excelEnums = ExcelEnums.getByKey(ExcelEnums.XFZBSINGLE.getType());
}else {
excelEnums = ExcelEnums.getByKey(ExcelEnums.XFZB.getType());
}
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
// date= excelService.commonUpload(file, excelDto, getSelectedOrgInfo(), getUserInfo());
EquipmentDetailController controllerProxy1 = SpringUtils.getBean(EquipmentDetailController.class);
......
package com.yeejoin.equipmanage.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.equipmanage.utils.ExplicitConstraint;
import com.yeejoin.equipmanage.utils.RoleNameExplicitConstraint;
import lombok.Data;
import java.util.Date;
@Data
public class EquipDataDto {
@Excel(name = "器材名称", width = 30, orderNum = "1")
private String name;
@Excel(name = "器材编码(从装备定义中获取)", width = 30, orderNum = "2")
private String code;
@Excel(name = "规格型号", width = 30, orderNum = "3")
private String standard;
@Excel(name = "品牌", width = 30, orderNum = "4")
private String brand;
@Excel(name = "生产厂家名称", width = 30, orderNum = "5")
private String manufacturerName;
@Excel(name = "设备编码", width = 30, orderNum = "6")
private String systemCode;
@Excel(name = "物联编码", width = 30, orderNum = "7")
private String iotCode;
@Excel(name = "存放位置(货位编码)", width = 30, orderNum = "8")
private String warehouseStructCode;
@Excel(name = "位置信息", width = 30, orderNum = "9")
private String description;
@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private String fightingSysCodes;
//动态下拉内容
@Excel(name = "所属单位",width = 30,orderNum = "11")
private String companyName;
// @ExcelProperty(value = "报废年限", index = 13)
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private String expiryDate;
//
// @ExcelProperty(value = "维保周期", index = 14)
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@Excel(name = "生产日期", width = 30, orderNum = "12")
private Date productionDate;
@ExcelProperty(value = "投运日期", index = 13)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate;
//动态下拉内容
// @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
// @ExcelProperty(value = "所属系统", index = 16)
// //@Excel(name = "所属单位",width = 30,orderNum = "12")
// private String systemName;
}
......@@ -49,13 +49,13 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private String fightingSysCodes;
@Excel(name = "所属队伍",width = 30,orderNum = "11")
@Excel(name = "所属队伍",width = 30,orderNum = "14")
private String fireTeam;
@Excel(name = "所属单位",width = 30,orderNum = "12")
@Excel(name = "所属单位",width = 30,orderNum = "11")
private String companyName;
@Excel(name = "生产日期",width = 30, orderNum = "13")
@Excel(name = "生产日期",width = 30, orderNum = "12")
//@Excel(name = "品牌", width = 30, orderNum = "4")
private Date productionDate;
......@@ -67,7 +67,7 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@Excel(name = "投运时间",width = 30, orderNum = "14")
@Excel(name = "投运时间",width = 30, orderNum = "13")
//@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate;
......
package com.yeejoin.equipmanage.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.equipmanage.utils.ExplicitConstraint;
import com.yeejoin.equipmanage.utils.RoleNameExplicitConstraint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import java.math.BigDecimal;
import java.util.Date;
......@@ -52,19 +55,14 @@ public class EquipmentDetailExcelSingleTemplateDto {
@ExcelProperty(value = "消防系统编码", index = 9)
//@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private String fightingSysCodes;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getEquipFireTeam") //动态下拉内容
@ExcelProperty(value = "所属队伍", index = 10)
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private String fireTeam;
//动态下拉内容
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class,method="getEquipCompany") //动态下拉内容
@ExcelProperty(value = "所属单位", index = 11)
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getEquipCompany") //动态下拉内容
@ExcelProperty(value = "所属单位", index = 10)
//@Excel(name = "所属单位",width = 30,orderNum = "12")
private String companyName;
@ExcelProperty(value = "生产日期", index = 12)
@ExcelProperty(value = "生产日期", index = 11)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private Date productionDate;
......@@ -76,10 +74,17 @@ public class EquipmentDetailExcelSingleTemplateDto {
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@ExcelProperty(value = "投运日期", index = 13)
@ExcelProperty(value = "投运日期", index = 12)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate;
//@ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getEquipFireTeam") //动态下拉内容
//@ExcelProperty(value = "所属队伍", index = 13)
@ExcelIgnore
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private String fireTeam;
//动态下拉内容
// @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
// @ExcelProperty(value = "所属系统", index = 16)
......
package com.yeejoin.equipmanage.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.equipmanage.dto.EquipDataDto;
import com.yeejoin.equipmanage.dto.EquipmentDetailExcelSingleTemplateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
......@@ -59,6 +63,13 @@ public class ExcelServiceImpl implements IExcelService {
throw new BadRequest(e.getMessage());
}
break;
case "XFZBSINGLE":
try {
date= excelImportFireEquipmentDl(multipartFile, reginParams, agencyUserModel);
} catch (Exception e) {
throw new BadRequest(e.getMessage());
}
break;
case "JKXX":
try {
excelImporVideo(multipartFile);
......@@ -85,6 +96,23 @@ public class ExcelServiceImpl implements IExcelService {
return date;
}
private Object excelImportFireEquipmentDl(MultipartFile multipartFile, ReginParams reginParams, AgencyUserModel agencyUserModel) throws Exception {
Object date="";
List<EquipDataDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
EquipDataDto.class, 1);
List<EquipmentDetailDownloadTemplateDto> objects = new ArrayList<>();
String s = JSONObject.toJSONString(excelDtoList);
List<EquipmentDetailDownloadTemplateDto> dtos = JSONObject.parseArray(s, EquipmentDetailDownloadTemplateDto.class);
if (excelDtoList != null && excelDtoList.size() > 0) {
date=iStockService.uploadListByTemplate(dtos, reginParams, agencyUserModel);
} else {
throw new BadRequest("请填写数据后再上传!");
}
return date;
}
private void excelImporVideo(MultipartFile multipartFile) throws Exception {
List<VideoDownloadVO> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
......
......@@ -87,7 +87,7 @@ dcs.client.secret=fire_system
dcs.x.hw.id=NR_REST_APP
dcs.x.hw.appKey=s+YkvQhwilx91TRJHhNDmw==
# 故障告警/消防告警/跑马灯权限标识 true 机场 / false 电力
equip.enabled =true
equip.enabled =false
management.endpoints.enabled-by-default=false
......
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