Commit f30ed85c authored by hcing's avatar hcing

feat(amos-boot-module-jg): 添加下次检验日期字段

parent 45407948
......@@ -108,6 +108,7 @@ import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
......@@ -139,6 +140,7 @@ import static java.util.stream.Collectors.toSet;
public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationDto, JgUseRegistration, JgUseRegistrationMapper> implements IJgUseRegistrationService, ICompensateFlowDataOfRedis<JgUseRegistration>, ApplicationContextAware {
private static final String DEFINITION_KEY = "useRegistration";
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");;
private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "一级受理已驳回", "使用单位已撤回", "已作废");
private final List<String> NOT_FLOWING_STATE_FINISH = new ArrayList<String>(NOT_FLOWING_STATE) {{
add("已完成");
......@@ -2968,7 +2970,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
Map<String, Object> exportParamsMap = new HashMap<>();
exportParamsMap.put("page", page);
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
exportParamsMap.put("printDate", formattedDate);
//获取分类名称
......@@ -2979,8 +2980,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String useUnitCreditCode = String.valueOf(jsonObject.get("useUnitCreditCode"));
TzBaseEnterpriseInfo enterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, useUnitCreditCode));
exportParamsMap.put("fullAddress", enterpriseInfo.getAddress());
// 下次检验日期
exportParamsMap.put("nextInspectDate", !ValidationUtil.isEmpty(jsonObject.get("nextInspectDate")) ? LocalDate.parse(jsonObject.getString("nextInspectDate")).format(formatter) : "");
if (equipmentLists.isEmpty()) {
exportParamsMap.put("nameOfProjectDevice", "");
} else {
......@@ -3101,7 +3100,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
case "medium":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workMedium"));
default:
return ValidationUtil.isEmpty(equip.get(fieldName)) ? "" : equip.get(fieldName);
if (!ValidationUtil.isEmpty(equip.get(fieldName))) {
if (equip.get(fieldName) instanceof Timestamp) {
return LocalDate.parse(equip.getString(fieldName).substring(0, 10)).format(formatter);
}
return equip.get(fieldName);
}
return "";
}
}
......
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