Commit e7aa61b1 authored by 刘林's avatar 刘林

fix(jg):超设计使用年限功能开发

parent 7fd0b222
......@@ -115,7 +115,6 @@
jri.EQU_CATEGORY as EQU_CATEGORY_CODE,
jri.EQU_DEFINE as EQU_DEFINE_CODE,
jfi.PRODUCE_DATE,
(select other.SUPERVISORY_CODE from idx_biz_jg_other_info other where other.RECORD = jui.RECORD) as SUPERVISORY_CODE,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') as NEXT_INSPECT_DATE
FROM idx_biz_jg_use_info jui
LEFT JOIN idx_biz_jg_factory_info jfi on jui.RECORD = jfi.RECORD
......
......@@ -22,7 +22,6 @@ import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgOverDesignServiceLifeService;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
......@@ -31,10 +30,7 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
......@@ -645,6 +641,12 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
inspectionDetectionInfo.setSequenceNbr(String.valueOf(sequence.nextId()));
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo);
}
//更新ES
if (inspectionDetectionInfo.getNextInspectDate() != null) {
tzsServiceFeignClient.commonUpdateEsDataByIds(Collections.singletonMap(record,
Collections.singletonMap("NEXT_INSPECT_DATE", inspectionDetectionInfo.getNextInspectDate().getTime())
));
}
}
}
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -539,6 +540,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
dto.put("record", dto.get("SEQUENCE_NBR"));
dto.put("equipAddress", dto.get("USE_PLACE") + "/" + dto.get("ADDRESS"));
dto.put("EQU_STATE_NAME", !ValidationUtil.isEmpty(dto.getString("EQU_STATE")) ? EquimentEnum.getName.get(Integer.valueOf(dto.getString("EQU_STATE"))) : null);
dto.put("NEXT_INSPECT_DATE", this.castDate2TimeStr(dto.getString("NEXT_INSPECT_DATE")));
list.add(dto);
}
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
......@@ -550,6 +552,18 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
return result;
}
private Date castDate2TimeStr(String nextInspectDate) {
if (nextInspectDate != null) {
try {
long timestamp = Long.parseLong(nextInspectDate);
return DateUtil.date(timestamp);
} catch (NumberFormatException e) {
return DateUtil.parse(nextInspectDate, "yyyy-MM-dd");
}
}
return null;
}
/**
* 标志/使用登记证/汇总表 打印
*
......
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