Commit ceb38c4b authored by suhuiguang's avatar suhuiguang

1.修改设备的下次检验日期类型为long ,sting无法统计

parent c256f715
......@@ -92,8 +92,8 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Text)
private String INSPECT_REPORT;
@Field(type = FieldType.Text)
private String NEXT_INSPECT_DATE;
@Field(type = FieldType.Long)
private Long NEXT_INSPECT_DATE;
@Field(type = FieldType.Text)
private String CONSTRUCTION_TYPE;
......
package com.yeejoin.amos.boot.module.jg.biz.config;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
......@@ -300,7 +301,9 @@ public class PressureVesselListener extends AnalysisEventListener<EquipInfoCylin
// 使用单位信息
dto.setDATA_SOURCE(useInfo.getDataSource());
dto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate() + "");
if(inspectionDetectionInfo.getNextInspectDate() != null){
dto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(inspectionDetectionInfo.getNextInspectDate(), DatePattern.NORM_DATE_PATTERN)).getTime());
}
dto.setREC_DATE(System.currentTimeMillis());
dto.setSEQUENCE_NBR(record);
dto.setFACTORY_NUM(factoryInfo.getFactoryNum());
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
......@@ -2217,6 +2218,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
inspectionDetectionInfo.setInspectOrgName((String) mapOrDefault.getOrDefault("useUnit", inspectionDetectionInfo.getInspectOrgName()));
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(date);
if(inspectionDetectionInfo.getNextInspectDate() != null){
inspectionDetectionInfo.setNextInspectDate(DateUtil.parse(DateUtil.format(inspectionDetectionInfo.getNextInspectDate(), DatePattern.NORM_DATE_PATTERN)));
}
inspectionDetectionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
}
......@@ -2232,6 +2236,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!"1".equals(equipmentInfoForm.get(WHETHER_VEHICLE_CYLINDER))) { // 老旧车用气瓶有些制造监督检验已过期,可放开选择定期检验
inspectionDetectionInfo.setInspectType("8300".equals(equCategory) ? "AZJDJY" : "ZZJDJY");
}
if(inspectionDetectionInfo.getNextInspectDate() != null){
inspectionDetectionInfo.setNextInspectDate(DateUtil.parse(DateUtil.format(inspectionDetectionInfo.getNextInspectDate(), DatePattern.NORM_DATE_PATTERN)));
}
inspectionDetectionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
}
......@@ -2504,6 +2511,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
dto.setUSC_UNIT_CREDIT_CODE(null);
dto.setUSC_UNIT_NAME(null);
}
if(map.get("NEXT_INSPECT_DATE") != null){
Date nextInspectDate = (Date)map.get("NEXT_INSPECT_DATE");
dto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(nextInspectDate, DatePattern.NORM_DATE_PATTERN)).getTime());
}
esEquipmentCategory.save(dto);
}
}
......@@ -2835,7 +2846,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
ESEquipmentCategoryDto esEquipmentDto = JSON.parseObject(toJSONString(data), ESEquipmentCategoryDto.class);
esEquipmentDto.setDATA_SOURCE(useInfo.getDataSource());
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate() + "");
if(inspectionDetectionInfo.getNextInspectDate() != null){
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setFACTORY_NUM(factoryInfo.getFactoryNum());
......
......@@ -1402,6 +1402,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("USE_PLACE", usePlace);
param.put("STATUS", "已认领");
param.put("EQU_STATE", 1);
// 更新es的下次检验日期
param.put("NEXT_INSPECT_DATE", this.castDate2TimeStr(dataMap.getString("nextInspectDate")));
param.put("USE_INNER_CODE", useInfo.getUseInnerCode());
param.put("IS_INTO_MANAGEMENT", true);
param.put("USE_PLACE_CODE", jsonObject.get("province") + "#" + jsonObject.get("city") + "#" + jsonObject.get("county") + "#" + jsonObject.get("factoryUseSiteStreet"));
......@@ -1414,6 +1416,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
private Long castDate2TimeStr(String nextInspectDate) {
if(nextInspectDate != null){
return DateUtil.parse(nextInspectDate).getTime();
}
return null;
}
public InstanceRuntimeData buildInstanceRuntimeData(JgUseRegistration jgUseRegistration) {
return InstanceRuntimeData.builder()
.nextExecuteUserIds(jgUseRegistration.getNextExecuteUserIds())
......
......@@ -307,7 +307,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(model.getEquipUnicode());
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setNEXT_INSPECT_DATE(String.valueOf(model.getNextInspectionDate().getTime()));
esEquipmentCategoryDto.setNEXT_INSPECT_DATE(model.getNextInspectionDate().getTime());
esEquipmentCategory.save(esEquipmentCategoryDto);
}
}
......
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