Commit 06af89e0 authored by KeYong's avatar KeYong

修改故障案例

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