Commit 8eb48528 authored by tianbo's avatar tianbo

fix(tcm): 优化企业信息更新逻辑

- 增加核准日期的空值校验与解析异常处理 - 完善经营状态字段的字典查询条件判断
parent af7e6e8b
......@@ -762,7 +762,6 @@ public class TzBaseEnterpriseInfoServiceImpl
}
tzBaseEnterpriseInfo.setCommunity(ObjectUtils.isEmpty(map.get("community")) ? null : String.valueOf(map.get("community")));
tzBaseEnterpriseInfo.setStreet(ObjectUtils.isEmpty(map.get("street")) ? null : String.valueOf(map.get("street")));
// tzBaseEnterpriseInfo.setAddress(ObjectUtils.isEmpty(map.get("regAddress")) ? null : String.valueOf(map.get("regAddress")));
tzBaseEnterpriseInfo.setLegalPerson(ObjectUtils.isEmpty(map.get("legalPerson")) ? null : String.valueOf(map.get("legalPerson")));
regUnitIc.setIndustryName(ObjectUtils.isEmpty(map.get("industryName")) ? null : String.valueOf(map.get("industryName")));
DataDictionary regOrganCodeDict = iDataDictionaryService.getByCode(String.valueOf(map.get("registeredOrganCode")),"DJJG");
......@@ -770,14 +769,18 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitIc.setRegisteredOrganCode(ObjectUtils.isEmpty(map.get("registeredOrganCode")) ? null : String.valueOf(map.get("registeredOrganCode")));
Date approvedDate;
try {
approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd");
if (!ValidationUtil.isEmpty(map.get("approvedDate"))) {
approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd");
regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate);
}
} catch (ParseException e) {
throw new RuntimeException(e);
throw new BadRequest("请核对核准时间");
}
regUnitIc.setBusinessStateCode(ObjectUtils.isEmpty(map.get("businessState")) ? null : String.valueOf(map.get("businessState")));
DataDictionary businessStateDict = iDataDictionaryService.getByCode(String.valueOf(map.get("businessState")),"jyzt");
regUnitIc.setBusinessState(ObjectUtils.isEmpty(businessStateDict) ? null : businessStateDict.getName());
regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate);
if (!ValidationUtil.isEmpty(map.get("businessState"))) {
DataDictionary businessStateDict = iDataDictionaryService.getByCode(String.valueOf(map.get("businessState")),"jyzt");
regUnitIc.setBusinessState(ObjectUtils.isEmpty(businessStateDict) ? null : businessStateDict.getName());
}
regUnitIcService.update(regUnitIc, new QueryWrapper<RegUnitIc>().eq("unit_code", regUnitIcDto.getUnitCode()));
}
......
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