Commit 06af89e0 authored by KeYong's avatar KeYong

修改故障案例

parent 090b428d
......@@ -23,8 +23,8 @@ public class FaultCaseImportParam {
@Excel(name = "消防系统", orderNum = "0")
private String systemInfo;
@Excel(name = "部件id", orderNum = "1")
private String equipId;
@Excel(name = "部件", orderNum = "1")
private String equipInfo;
@Excel(name = "故障类型", orderNum = "2")
private String faultType;
......
......@@ -34,12 +34,6 @@ public class FaultCase extends BaseEntity {
private String systemId;
/**
* 系统编码
*/
@TableField("system_type_code")
private String systemTypeCode;
/**
* 系统名称
*/
@TableField("system_name")
......@@ -48,8 +42,8 @@ public class FaultCase extends BaseEntity {
/**
* 部件id
*/
@TableField("equip_id")
private String equipId;
@TableField("equip_code")
private String equipCode;
/**
* 部件名称
......
......@@ -12,10 +12,8 @@ import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO;
import com.yeejoin.equipmanage.common.enums.EmergencyLevelEum;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFaultCaseService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.ISignalClassifyService;
import com.yeejoin.equipmanage.common.vo.EquipmentManageVo;
import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.FileHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -61,6 +59,9 @@ public class FaultCaseController extends AbstractBaseController {
@Autowired
IEquipmentSpecificSerivce equipmentSpecificService;
@Autowired
IEquipmentService iEquipmentService;
/**
* 新增信号分类量测枚举表
*
......@@ -157,13 +158,13 @@ public class FaultCaseController extends AbstractBaseController {
@GetMapping(value = "/export")
public ResponseModel<List<FaultCase>> exportTemplate(HttpServletResponse response) {
String fileName = "故障案例模板.xls"; //模板名称
String[] handers = {"消防系统","部件id","故障类型","故障等级","故障描述","处理建议","故障影响","预防措施"}; //列标题
String[] handers = {"消防系统","部件","故障类型","故障等级","故障描述","处理建议","故障影响","预防措施"}; //列标题
List<String[]> downData = new ArrayList();
List<FireFightingSystemEntity> systems = fireFightingSystemService.getList();
List<EquipmentManageVo> systems = fireFightingSystemService.getSystemCategory();
if(0 < systems.size()) {
List<String> sysList = new ArrayList<>();
for (FireFightingSystemEntity entity : systems) {
String str = entity.getName() + "@" + entity.getId() + "@" + entity.getSystemTypeCode();
for (EquipmentManageVo entity : systems) {
String str = entity.getName() + "@" + entity.getId();
sysList.add(str);
}
// 消防系统
......@@ -215,7 +216,6 @@ public class FaultCaseController extends AbstractBaseController {
String[] strings = dto.getSystemInfo().split("@");
faultCase.setSystemName(strings[0]);
faultCase.setSystemId(strings[1]);
faultCase.setSystemTypeCode(strings[2]);
} else {
return CommonResponseUtil.failure("请补充消防系统信息!");
}
......@@ -227,20 +227,16 @@ public class FaultCaseController extends AbstractBaseController {
return CommonResponseUtil.failure("请补充故障等级信息!");
}
if (StringUtil.isNotEmpty(dto.getEquipId())) {
EquipmentSpecific specific = equipmentSpecificService.getOne(new QueryWrapper<EquipmentSpecific>().eq("id", Long.valueOf(dto.getEquipId())));
if (ObjectUtils.isEmpty(specific)) {
return CommonResponseUtil.failure("部件信息有误!");
if (StringUtil.isNotEmpty(dto.getEquipInfo())) {
String[] strings = dto.getEquipInfo().split("@");
if(2 > strings.length) {
return CommonResponseUtil.failure("部件支持的导入格式错误,正确格式例如:部件名称@部件编码 !");
} else {
faultCase.setEquipId(dto.getEquipId());
faultCase.setEquipName(specific.getName());
}
List<EquiplistSpecificBySystemVO> equips = fireFightingSystemService.getEquiplistBySystemId(Long.valueOf(faultCase.getSystemId()));
if (0 == equips.size()) {
return CommonResponseUtil.failure("对应的消防系统下未找到导入的部件!");
faultCase.setEquipName(strings[0]);
faultCase.setEquipCode(strings[1]);
}
} else {
return CommonResponseUtil.failure("请补充部件id!");
return CommonResponseUtil.failure("请补充部件信息!");
}
cases.add(faultCase);
}
......@@ -271,9 +267,9 @@ public class FaultCaseController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "获取系统下装备列表", notes = "获取系统下装备列表")
@ApiOperation(httpMethod = "GET",value = "装备定义列表不分页", notes = "装备定义列表不分页")
@GetMapping(value = "/equip/list")
public ResponseModel<List<EquiplistSpecificBySystemVO>> getEquipListBySystemId(@RequestParam(value = "systemId") String systemId) {
return CommonResponseUtil.success(fireFightingSystemService.getEquipBySystemId(Long.valueOf(systemId)));
public ResponseModel<List<EquiplistSpecificBySystemVO>> getEquipList() {
return CommonResponseUtil.success(iEquipmentService.getAll());
}
}
......@@ -1023,11 +1023,10 @@
<sql>
CREATE TABLE `wl_fault_case` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`system_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统id',
`system_type_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统名称',
`system_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统名称',
`equip_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '部件id',
`equip_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '部件名称',
`system_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统类型id',
`system_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统类型名称',
`equip_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '装备定义id',
`equip_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '装备定义名称',
`fault_level` varchar(20) DEFAULT NULL COMMENT '故障等级',
`fault_type` varchar(20) DEFAULT NULL COMMENT '故障类型',
`fault_describe` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '故障描述',
......
......@@ -29,9 +29,11 @@
'' AS unit,
wfc.system_name AS `name`,
wfc.id AS `key`,
wfc.system_type_code AS typeCode
wfc.system_id AS systemId,
wec.remark AS typeCode
FROM
wl_fault_case wfc
GROUP BY wfc.system_type_code
LEFT JOIN wl_equipment_category wec ON wec.id = wfc.system_id
GROUP BY wfc.system_id
</select>
</mapper>
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