Commit c0c8801d authored by tianyiming's avatar tianyiming

设备、企业详情添加问题状态及问题时间

parent e7299805
package com.yeejoin.amos.boot.module.jg.api.enums;
import java.util.HashMap;
import java.util.Map;
/**
* 问题状态
*/
public enum ProblemStatusEnum {
NORMAL("正常", "0", "已处理"),
ABNORMAL("异常", "1", "未处理");
private String name;
private String code;
private String desc;
ProblemStatusEnum(String name, String code, String desc) {
this.name = name;
this.code = code;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static Map<String, String> getNameByCode = new HashMap<>();
public static Map<String, String> getCodeByName = new HashMap<>();
public static Map<String, String> getDescByCode = new HashMap<>();
public static Map<String, String> getNameByDesc = new HashMap<>();
static {
for (ProblemStatusEnum e : ProblemStatusEnum.values()) {
getNameByCode.put(e.code, e.name);
getNameByDesc.put(e.desc, e.name);
getDescByCode.put(e.code, e.desc);
getCodeByName.put(e.name, e.code);
}
}
}
...@@ -28,10 +28,12 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentInfoDto; ...@@ -28,10 +28,12 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecord; import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecord;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecordEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecordEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.enums.*; import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper;
import com.yeejoin.amos.boot.module.jg.biz.config.PressureVesselListener; import com.yeejoin.amos.boot.module.jg.biz.config.PressureVesselListener;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext; import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
...@@ -654,7 +656,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -654,7 +656,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
return objMap; return objMap;
} }
@Autowired
private SafetyProblemTracingMapper safetyProblemTracingMapper;
/** /**
* 查询设备基本信息 * 查询设备基本信息
* *
...@@ -669,6 +672,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -669,6 +672,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String county = ""; String county = "";
String street = ""; String street = "";
String fullAddress = ""; String fullAddress = "";
// 设备问题信息(大屏二级页面使用)
LambdaQueryWrapper<SafetyProblemTracing> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SafetyProblemTracing::getSourceId, record);
lambdaQueryWrapper.orderByDesc(SafetyProblemTracing::getRecDate);
List<SafetyProblemTracing> safetyProblemTracings = safetyProblemTracingMapper.selectList(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(safetyProblemTracings)) {
objMap.put("problemStatus", ProblemStatusEnum.getNameByDesc.get(safetyProblemTracings.get(0).getProblemStatus()));
objMap.put("problemTime", safetyProblemTracings.get(0).getProblemTime());
}
// 使用信息 // 使用信息
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(record); IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(useInfo)) { if (!ValidationUtil.isEmpty(useInfo)) {
......
...@@ -289,6 +289,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto { ...@@ -289,6 +289,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty(value = "行业主管部门") @ApiModelProperty(value = "行业主管部门")
private String industrySupervisor; private String industrySupervisor;
@ApiModelProperty(value = "企业问题状态")
private String status;
private String region; private String region;
......
package com.yeejoin.amos.boot.module.tcm.api.enums;
import java.util.HashMap;
import java.util.Map;
/**
* 问题状态
*/
public enum ProblemStatusEnum {
NORMAL("正常", "0"),
ABNORMAL("异常", "1");
private String name;
private String code;
ProblemStatusEnum(String name, String code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setStatus(String code) {
this.code = code;
}
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
static {
for (ProblemStatusEnum e : ProblemStatusEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
package com.yeejoin.amos.boot.module.tcm.api.mapper; package com.yeejoin.amos.boot.module.tcm.api.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -11,6 +8,9 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto; ...@@ -11,6 +8,9 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* 企业数据信息 Mapper 接口 * 企业数据信息 Mapper 接口
* *
...@@ -54,4 +54,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -54,4 +54,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
List<TzBaseEnterpriseInfo> listNoQrCode(); List<TzBaseEnterpriseInfo> listNoQrCode();
List<Map<String, Object>> getEquipType(@Param("type")String type); List<Map<String, Object>> getEquipType(@Param("type")String type);
Map<String, Object> getProblemInfoBySourceId(@Param("sourceId")String sourceId);
} }
...@@ -172,5 +172,8 @@ ...@@ -172,5 +172,8 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getProblemInfoBySourceId" resultType="java.util.Map">
select * from tzs_safety_problem_tracing where source_id = #{sourceId} order by rec_date desc limit 1
</select>
</mapper> </mapper>
...@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto; ...@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.*; import com.yeejoin.amos.boot.module.tcm.api.entity.*;
import com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums; import com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums;
import com.yeejoin.amos.boot.module.tcm.api.enums.LicenceTypeEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.LicenceTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.ProblemStatusEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
...@@ -242,7 +243,8 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -242,7 +243,8 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override @Override
public Map<String, Object> getInfoByUseCodeMap(String useCode) { public Map<String, Object> getInfoByUseCodeMap(String useCode) {
TzBaseEnterpriseInfoDto infoByUseCode = getInfoByUseCode(useCode); TzBaseEnterpriseInfoDto infoByUseCode = getInfoByUseCode(useCode);
// 通过sourceId获取问题信息
Map<String,Object> problemInfo = baseMapper.getProblemInfoBySourceId(infoByUseCode.getSequenceNbr().toString());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
Map<String,Object> resultMap = new HashMap<>(); Map<String,Object> resultMap = new HashMap<>();
...@@ -272,6 +274,9 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -272,6 +274,9 @@ public class TzBaseEnterpriseInfoServiceImpl
resultMap.remove("regUnitIcDto"); resultMap.remove("regUnitIcDto");
resultMap.remove("regUnitInfoDto"); resultMap.remove("regUnitInfoDto");
resultMap.remove("tzsBaseInstitution"); resultMap.remove("tzsBaseInstitution");
resultMap.put("problemTime", problemInfo.get("problem_time"));
resultMap.put("problemStatus", ProblemStatusEnum.getName.get(resultMap.get("status")));
return resultMap; return resultMap;
} }
......
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