mdm同步消息json

release
gongquanlin 2 years ago
parent 2b38548ff7
commit f12530a8a3
  1. 26
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/protocol/v6/sdenergy/MdmBankListBO.java
  2. 19
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java

@ -0,0 +1,26 @@
package com.dxhy.order.consumer.openapi.protocol.v6.sdenergy;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @Description MdmGmfxxtbMulticodeReqBO中的VALUELIST字段
* @Author 巩权林
* @Date 2023/2/9 09:33
**/
@Data
@NoArgsConstructor
public class MdmBankListBO {
public String address; // 地址
public String phone; // 电话
public String bankOfDeposit; // 开户行
public String bankNumber; // 银行账户
public MdmBankListBO(MdmGmfxxtbMulticodeValuelistBO bo, String address, String phone) {
this.setBankNumber(bo.getDESC4());
this.setBankOfDeposit(bo.getDESC3());
this.setPhone(phone);
this.setAddress(address);
}
}

@ -126,13 +126,26 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
buyerAddress = buyerAddress.concat(StringUtils.isEmpty(tempMdmGmfxxtbReqBO.getDESC24()) ? "" : tempMdmGmfxxtbReqBO.getDESC24()); buyerAddress = buyerAddress.concat(StringUtils.isEmpty(tempMdmGmfxxtbReqBO.getDESC24()) ? "" : tempMdmGmfxxtbReqBO.getDESC24());
entity.setAddress(buyerAddress); entity.setAddress(buyerAddress);
entity.setPhone(tempMdmGmfxxtbReqBO.getDESC27()); entity.setPhone(tempMdmGmfxxtbReqBO.getDESC27());
String bankList = "[]"; // 银行列表
entity.setMdmMulticodeJson(bankList);
if (tempMdmGmfxxtbReqBO.getMULTICODE() != null && !CollectionUtils.isEmpty(tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST())) { if (tempMdmGmfxxtbReqBO.getMULTICODE() != null && !CollectionUtils.isEmpty(tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST())) {
// 处理开户行银行 // 处理开户行银行
MdmGmfxxtbMulticodeValuelistBO firstValueList = tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST().get(0); List<MdmGmfxxtbMulticodeValuelistBO> valuelistBOS = tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST();
MdmGmfxxtbMulticodeValuelistBO firstValueList = valuelistBOS.get(0);
if (firstValueList != null) { if (firstValueList != null) {
entity.setBankOfDeposit(firstValueList.getDESC3()); entity.setBankOfDeposit(firstValueList.getDESC3());
entity.setBankNumber(firstValueList.getDESC4()); entity.setBankNumber(firstValueList.getDESC4());
} }
List<MdmBankListBO> mdmBankListBOS = new ArrayList<>();
String finalBuyerAddress = buyerAddress;
valuelistBOS.forEach(j -> {
MdmBankListBO temp = new MdmBankListBO(j, finalBuyerAddress, tempMdmGmfxxtbReqBO.getDESC27());
mdmBankListBOS.add(temp);
});
bankList = JsonUtils.getInstance().toJsonStringNullToEmpty(mdmBankListBOS);
entity.setMdmMulticodeJson(bankList);
} }
entity.setSjh(tempMdmGmfxxtbReqBO.getDESC27()); entity.setSjh(tempMdmGmfxxtbReqBO.getDESC27());
@ -159,7 +172,7 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
entity.setBuyerCode(tempMdmGmfxxtbReqBO.getCODE()); entity.setBuyerCode(tempMdmGmfxxtbReqBO.getCODE());
entity.setInvoiceName(tempMdmGmfxxtbReqBO.getDESC48()); entity.setInvoiceName(tempMdmGmfxxtbReqBO.getDESC48());
entity.setInvoiceTaxno(tempMdmGmfxxtbReqBO.getDESC49()); entity.setInvoiceTaxno(tempMdmGmfxxtbReqBO.getDESC49());
entity.setMdmMulticodeJson(JsonUtils.getInstance().toJsonStringNullToEmpty(tempMdmGmfxxtbReqBO.getMULTICODE())); // entity.setMdmMulticodeJson(JsonUtils.getInstance().toJsonStringNullToEmpty());
entity.setUUID(tempMdmGmfxxtbReqBO.getUUID()); entity.setUUID(tempMdmGmfxxtbReqBO.getUUID());
entity.setStatus("0"); entity.setStatus("0");
@ -309,7 +322,7 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
commodityCodeEntity.setSpsm(taxClassCodeEntity.getSm()); commodityCodeEntity.setSpsm(taxClassCodeEntity.getSm());
commodityCodeEntity.setSpjm(taxClassCodeEntity.getSpjc()); commodityCodeEntity.setSpjm(taxClassCodeEntity.getSpjc());
commodityCodeEntity.setSl(taxClassCodeEntity.getZzssl()); commodityCodeEntity.setSl(taxClassCodeEntity.getZzssl());
if(!StringUtils.isBlank(taxClassCodeEntity.getYhzcmc())){ if (!StringUtils.isBlank(taxClassCodeEntity.getYhzcmc())) {
commodityCodeEntity.setYhzcbs("1"); commodityCodeEntity.setYhzcbs("1");
} }
commodityCodeEntity.setSpbm(taxClassCodeEntity.getSpbm()); commodityCodeEntity.setSpbm(taxClassCodeEntity.getSpbm());

Loading…
Cancel
Save