Commit 1636d40b authored by tianbo's avatar tianbo

隐患提交

parent a200ce07
...@@ -71,7 +71,7 @@ public enum LatentDangerProcessStateEnum { ...@@ -71,7 +71,7 @@ public enum LatentDangerProcessStateEnum {
public static LatentDangerProcessStateEnum getByCode(String code) { public static LatentDangerProcessStateEnum getByCode(String code) {
for (LatentDangerProcessStateEnum l : LatentDangerProcessStateEnum.values()) { for (LatentDangerProcessStateEnum l : LatentDangerProcessStateEnum.values()) {
if (code.equals(l.getCode())) { if (l.getCode().equals(code)) {
return l; return l;
} }
} }
......
...@@ -4,16 +4,12 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,16 +4,12 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date; import java.util.Date;
/** /**
...@@ -94,6 +90,7 @@ public class LatentDanger extends BasicEntity { ...@@ -94,6 +90,7 @@ public class LatentDanger extends BasicEntity {
/** /**
* 限制时间 * 限制时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reformLimitDate; private Date reformLimitDate;
private Integer overtimeState; private Integer overtimeState;
...@@ -127,11 +124,13 @@ public class LatentDanger extends BasicEntity { ...@@ -127,11 +124,13 @@ public class LatentDanger extends BasicEntity {
/** /**
* 记录修改时间 * 记录修改时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateDate; private Date updateDate;
/** /**
* 延期治理时间 * 延期治理时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date delayLimitDate; private Date delayLimitDate;
/** /**
......
...@@ -1805,27 +1805,28 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1805,27 +1805,28 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
IPage<LatentDanger> iPage = this.baseMapper.selectPageByParam(new Page(Long.valueOf(pageParam.getCurrent()), IPage<LatentDanger> iPage = this.baseMapper.selectPageByParam(new Page(Long.valueOf(pageParam.getCurrent()),
Long.valueOf(pageParam.getSize())), (Map<String, Object>) pageParam); Long.valueOf(pageParam.getSize())), (Map<String, Object>) pageParam);
Map<Long, String> buildingAbsolutePositionMap = new HashMap<>(); Map<String, Object> buildingAbsolutePositionMap = new HashMap<>();
if (!ValidationUtil.isEmpty(iPage.getRecords())) { if (!ValidationUtil.isEmpty(iPage.getRecords())) {
try { try {
LinkedHashMap<String, Object> buildingAbsolutePosition = (LinkedHashMap<String, Object>) equipFeign.getBuildingAbsolutePosition().getResult(); buildingAbsolutePositionMap = equipFeign.getBuildingAbsolutePosition().getResult();
if (buildingAbsolutePosition == null || !"200".equals(buildingAbsolutePosition.get("status").toString())) { if (ValidationUtil.isEmpty(buildingAbsolutePositionMap)) {
throw new YeeException("获取建筑树出错"); throw new YeeException("获取建筑树出错");
} }
buildingAbsolutePositionMap = (Map<Long, String>) buildingAbsolutePosition.get("result");
} catch (Exception e) { } catch (Exception e) {
} }
Map<Long, String> finalBuildingAbsolutePositionMap = buildingAbsolutePositionMap; Map<String, Object> finalBuildingAbsolutePositionMap = buildingAbsolutePositionMap;
iPage.getRecords().forEach(danger -> { iPage.getRecords().forEach(danger -> {
danger.setStructureName(finalBuildingAbsolutePositionMap.get(danger.getStructureId())); if (!ValidationUtil.isEmpty(danger.getStructureId()) && !ValidationUtil.isEmpty(finalBuildingAbsolutePositionMap.get(danger.getStructureId().toString()))) {
danger.setStructureName(finalBuildingAbsolutePositionMap.get(danger.getStructureId().toString()).toString());
}
LatentDangerBizTypeEnum bizTypeEnum = LatentDangerBizTypeEnum.getByCode(danger.getBizType()); LatentDangerBizTypeEnum bizTypeEnum = LatentDangerBizTypeEnum.getByCode(danger.getBizType());
if (bizType.equals(danger.getBizType())) { if (bizType.equals(danger.getBizType())) {
LatentDangerState.SupervisionDangerStateEnum dangerStateEnum = LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(danger.getDangerState()); LatentDangerState.SupervisionDangerStateEnum dangerStateEnum = LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(danger.getDangerState());
danger.setProcessState(dangerStateEnum.getProcessState()); danger.setProcessState(dangerStateEnum.getProcessState());
LatentDangerProcessStateEnum processStateEnum = LatentDangerProcessStateEnum.getByCode(danger.getProcessState());
danger.setProcessStateName(processStateEnum.getName());
} }
danger.setBizTypeName(bizTypeEnum.getName()); danger.setBizTypeName(bizTypeEnum.getName());
LatentDangerProcessStateEnum processStateEnum = LatentDangerProcessStateEnum.getByCode(danger.getProcessState());
danger.setProcessStateName(processStateEnum.getName());
}); });
} }
......
...@@ -978,7 +978,7 @@ ...@@ -978,7 +978,7 @@
<if test="key == 'name' and value != null and value != ''"> <if test="key == 'name' and value != null and value != ''">
and a.danger_name like concat('%', #{value}, '%') and a.danger_name like concat('%', #{value}, '%')
</if> </if>
<if test="key == 'structureId' and value != null"> <if test="key == 'structureIdList' and value != null">
and a.structure_id in and a.structure_id in
<foreach collection="value" item="structureId" open="(" separator="," close=")"> <foreach collection="value" item="structureId" open="(" separator="," close=")">
#{structureId} #{structureId}
...@@ -992,7 +992,7 @@ ...@@ -992,7 +992,7 @@
</if> </if>
</foreach> </foreach>
</where> </where>
<if test="paramMap.order != null and paramMap.order == '1'"> <if test="paramMap.order != null and paramMap.order == 1">
order by a.create_date desc order by a.create_date desc
</if> </if>
</select> </select>
......
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