Commit 4979954b authored by 刘林's avatar 刘林

fix(jg):使用登记暂存功能

parent 9a04427c
......@@ -187,7 +187,7 @@ public class DataDockServiceImpl {
// 压力管道保存 工程装置表信息 必须在saveUseInfo之前进行,需要提前生成工程装置id
saveProjectContraption(equ, equList);
// 保存到设备表
saveUseInfo(equ, record, dataSource, remark);
saveUseInfo(equ, record, dataSource, remark, company);
saveDesignInfo(equ, record);
saveFactoryInfo(equ, record);
saveRegisterInfo(equ, record, equList);
......@@ -311,7 +311,7 @@ public class DataDockServiceImpl {
* @param equ
* @param record
*/
private void saveUseInfo(Map<String, Object> equ, String record, String dataSource, String remark) {
private void saveUseInfo(Map<String, Object> equ, String record, String dataSource, String remark,CompanyBo company) {
log.error("数据===>{}", JSONObject.toJSONString(equ));
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(equ), IdxBizJgUseInfo.class);
if (!ValidationUtil.isEmpty(useInfo)) {
......@@ -340,6 +340,10 @@ public class DataDockServiceImpl {
useInfo.setCountyName(districtName);
useInfo.setStreetName(streetName);
useInfo.setFactoryUseSiteStreet(streetCode);
if ("使用单位".equals(company.getCompanyType())){
useInfo.setUseUnitCreditCode(company.getCompanyCode());
useInfo.setUseUnitName(company.getCompanyName());
}
equ.put("province",useInfo.getProvince());
equ.put("city",useInfo.getCity());
equ.put("county",useInfo.getCounty());
......@@ -1002,17 +1006,17 @@ public class DataDockServiceImpl {
if (isGasCylinder) { // 是气瓶
if (!isSpecialGasCylinder) { // 不是特种气瓶
data.setWhetherVehicleCylinder("");
checkNotBlank(data.getInformationSituation(), "信息化管理情况不能为空;", rowError);
//checkNotBlank(data.getInformationSituation(), "信息化管理情况不能为空;", rowError);
if (!org.apache.commons.lang3.ObjectUtils.isEmpty(data.getInformationSituation())) {
checkNotBlank(data.getInformationManageCode(), "二维码或者电子标签编号不能为空;", rowError);
//checkNotBlank(data.getInformationManageCode(), "二维码或者电子标签编号不能为空;", rowError);
}
}
if (isSpecialGasCylinder) { // 是特种气瓶
checkNotBlank(data.getWhetherVehicleCylinder(), "是否车用气瓶不能为空;", rowError);
if (!isCarGasCylinder) {// 不是车用气瓶
checkNotBlank(data.getInformationSituation(), "信息化管理情况不能为空;", rowError);
//checkNotBlank(data.getInformationSituation(), "信息化管理情况不能为空;", rowError);
if (!org.apache.commons.lang3.ObjectUtils.isEmpty(data.getInformationSituation())) {
checkNotBlank(data.getInformationManageCode(), "二维码或者电子标签编号不能为空;", rowError);
//checkNotBlank(data.getInformationManageCode(), "二维码或者电子标签编号不能为空;", rowError);
}
}
if (isCarGasCylinder) { // 是车用气瓶
......@@ -1065,14 +1069,14 @@ public class DataDockServiceImpl {
}
}
// 使用信息
checkNotBlank(data.getUseUnitCode(), "使用单位统一社会信用代码不能为空;", rowError);
Optional.ofNullable(data.getUseUnitCode()).ifPresent(v -> checkCreditCode(v, "使用单位统一社会信用代码格式不正确;", rowError));
checkNotBlank(data.getUseUnit(), "使用单位名称不能为空;", rowError);
// checkNotBlank(data.getUseUnitCode(), "使用单位统一社会信用代码不能为空;", rowError);
// Optional.ofNullable(data.getUseUnitCode()).ifPresent(v -> checkCreditCode(v, "使用单位统一社会信用代码格式不正确;", rowError));
// checkNotBlank(data.getUseUnit(), "使用单位名称不能为空;", rowError);
// 设计信息 电梯、场车、起重机械无"设计信息"
if (!isDT && !isCC && !isQZJX) {
// checkNotBlank(data.getDesignUnitCreditCode(), "设计单位统一社会信用代码不能为空;", rowError);
Optional.ofNullable(data.getDesignUnitCreditCode()).ifPresent(v -> checkCreditCode(v, "设计单位统一社会信用代码格式不正确;", rowError));
//Optional.ofNullable(data.getDesignUnitCreditCode()).ifPresent(v -> checkCreditCode(v, "设计单位统一社会信用代码格式不正确;", rowError));
// checkNotBlank(data.getDesignUnitName(), "设计单位名称不能为空;", rowError);
// checkNotBlank(data.getDesignUseDate(), "设计使用年限不能为空;", rowError);
// Optional.ofNullable(data.getDesignUseDate()).ifPresent(v -> checkDateFormatNumber(v, "设计使用年限不能为数字以外的其他类型;", rowError));
......@@ -2405,7 +2409,7 @@ public class DataDockServiceImpl {
String useRegistrationCode = Optional.ofNullable(equ.get("useOrgCode")).map(String::valueOf).orElse("").trim();
try {
if (!equList.isEmpty()) {
saveUseInfo(equ, record, dataSource, remark);
saveUseInfo(equ, record, dataSource, remark, null);
saveDesignInfo(equ, record);
saveFactoryInfo(equ, record);
saveRegisterInfo(equ, record, equList);
......
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