Commit 31218fa9 authored by 刘林's avatar 刘林

fix:(jg):修改气瓶参数后,更新证管理表参数

parent 456e3801
......@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.edit.event.listener;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.converter.CommonCustomConverter;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.module.common.api.converter.CommonCustomConverter;
import com.yeejoin.amos.boot.module.jg.api.converter.EquDefineConverter;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
......@@ -31,6 +31,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionalEventListener;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
......@@ -137,6 +138,7 @@ public class ChangeEquipImpactCertListener {
private void updateUseCertField(JgUseRegistrationManage manage, FieldChangeMeta meta) {
String columnKey = meta.getColumnKey();
String afterValue = Objects.toString(meta.getColumnNewValue(), null);
String beforeValue = Objects.toString(meta.getColumnOldValue(), null);
if (StringUtils.isBlank(afterValue)) {
return;
}
......@@ -166,13 +168,16 @@ public class ChangeEquipImpactCertListener {
manage.setReceiveOrgName(CommonCustomConverter.CompanyCodeConverter.getNameByCode(afterValue));
break;
case "fillingMedium":
manage.setFillingMedium(afterValue);
break;
case "gasNum":
manage.setGasNum(Integer.valueOf(afterValue));
manage.setFillingMedium(
Arrays.stream(manage.getFillingMedium().split(","))
.map(String::trim)
.map(v -> v.equals(beforeValue) ? afterValue : v)
.collect(Collectors.joining(","))
);
break;
case "volume":
manage.setVolume(afterValue);
manage.setVolume(new BigDecimal(manage.getVolume())
.add(new BigDecimal(afterValue).subtract(new BigDecimal(beforeValue))).toPlainString());
break;
default:
log.warn("未处理的USE_CERT字段:[{}]", columnKey);
......
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