设置默认银行账户

release
gongquanlin 2 years ago
parent 811138e451
commit fb45281888
  1. 43
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/controller/BuyerController.java
  2. 8
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/model/BuyerEntity.java
  3. 23
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/BuyerEntityBankBO.java
  4. 2
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/MdmBankListBO.java
  5. 2
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/MdmGmfxxtbMulticodeValuelistBO.java
  6. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java
  7. 1
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/protocol/v6/sdenergy/MdmGmfxxtbMulticodeBO.java
  8. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java

@ -1,8 +1,10 @@
package com.dxhy.order.baseservice.module.buyer.controller; package com.dxhy.order.baseservice.module.buyer.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.dxhy.order.baseservice.module.buyer.protocol.MdmBankListBO;
import com.dxhy.order.constant.ConfigureConstant; import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoContentEnum; import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum; import com.dxhy.order.constant.OrderInfoEnum;
@ -111,20 +113,43 @@ public class BuyerController {
return R.error(OrderInfoContentEnum.TAXCODE_ISNULL); return R.error(OrderInfoContentEnum.TAXCODE_ISNULL);
} }
//购货方企业类型 默认值01 企业 // 购货方企业类型 默认值01 企业
buyerEntity.setGhfQylx(OrderInfoEnum.GHF_QYLX_01.getKey()); buyerEntity.setGhfQylx(OrderInfoEnum.GHF_QYLX_01.getKey());
//购方名称 带中文括号的转换成英文括号 // 购方名称 带中文括号的转换成英文括号
buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true)); buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true));
//获取当前登录人id // 获取当前登录人id
Long userId = userInfoService.getUser().getUserId(); Long userId = userInfoService.getUser().getUserId();
String id = buyerEntity.getId(); String id = buyerEntity.getId();
// 处理MDM默认银行账户等信息
List<MdmBankListBO> bankListBOS = new ArrayList<>();
if (CollectionUtil.isNotEmpty(buyerEntity.getBanks())) {
buyerEntity.getBanks().forEach(i -> {
MdmBankListBO temp = new MdmBankListBO();
temp.setAddress(i.getAddress());
temp.setPhone(i.getPhone());
temp.setBankNumber(i.getBankNumber());
temp.setBankOfDeposit(i.getBankOfDeposit());
bankListBOS.add(temp);
});
if (buyerEntity.getBankDefaultIndex() != null) {
buyerEntity.getBanks().get(buyerEntity.getBankDefaultIndex());
Integer index = buyerEntity.getBankDefaultIndex();
buyerEntity.setAddress(buyerEntity.getBanks().get(index).getAddress());
buyerEntity.setPhone(buyerEntity.getBanks().get(index).getPhone());
buyerEntity.setBankNumber(buyerEntity.getBanks().get(index).getBankNumber());
buyerEntity.setBankOfDeposit(buyerEntity.getBanks().get(index).getBankOfDeposit());
}
}
if (StringUtils.isNotBlank(id)) { if (StringUtils.isNotBlank(id)) {
//修改 // 修改
buyerEntity.setModifyUserId(userId.toString()); buyerEntity.setModifyUserId(userId.toString());
} else { } else {
//添加 // 添加
buyerEntity.setModifyUserId(userId.toString()); buyerEntity.setModifyUserId(userId.toString());
buyerEntity.setCreateUserId(userId.toString()); buyerEntity.setCreateUserId(userId.toString());
} }
@ -137,7 +162,7 @@ public class BuyerController {
@PostMapping("/saveBuyerInfoList") @PostMapping("/saveBuyerInfoList")
public R saveBuyerInfoList(@RequestBody List<BuyerEntity> buyerList) { public R saveBuyerInfoList(@RequestBody List<BuyerEntity> buyerList) {
//业务逻辑放到provider // 业务逻辑放到provider
return buyerService.saveBuyerInfoList(buyerList, return buyerService.saveBuyerInfoList(buyerList,
userInfoService.getUser().getUserId() == null ? "" : String.valueOf(userInfoService.getUser().getUserId())); userInfoService.getUser().getUserId() == null ? "" : String.valueOf(userInfoService.getUser().getUserId()));
} }
@ -178,12 +203,12 @@ public class BuyerController {
R r = new R(); R r = new R();
try { try {
//从excel中读取数据 // 从excel中读取数据
long t1 = System.currentTimeMillis(); long t1 = System.currentTimeMillis();
log.debug("{}excel读取开始,当前时间:{}", LOGGER_MSG, t1); log.debug("{}excel读取开始,当前时间:{}", LOGGER_MSG, t1);
Map<String, String> headToProperty = new HashMap<>(10); Map<String, String> headToProperty = new HashMap<>(10);
//转换枚举类 // 转换枚举类
for (BuyerImportExcelEnum importExcelEnum : BuyerImportExcelEnum.values()) { for (BuyerImportExcelEnum importExcelEnum : BuyerImportExcelEnum.values()) {
headToProperty.put(importExcelEnum.getKey(), importExcelEnum.getValue()); headToProperty.put(importExcelEnum.getKey(), importExcelEnum.getValue());
} }
@ -222,7 +247,7 @@ public class BuyerController {
if (StringUtils.isEmpty(buyerEntity.getTaxpayerCode())) { if (StringUtils.isEmpty(buyerEntity.getTaxpayerCode())) {
buyerEntity.setGhfQylx(OrderInfoEnum.GHF_QYLX_03.getKey()); buyerEntity.setGhfQylx(OrderInfoEnum.GHF_QYLX_03.getKey());
} }
//购方名称 带中文括号的转换成英文括号 // 购方名称 带中文括号的转换成英文括号
buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true)); buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true));
buyerEntityList.add(buyerEntity); buyerEntityList.add(buyerEntity);
} }

@ -1,10 +1,12 @@
package com.dxhy.order.baseservice.module.buyer.model; package com.dxhy.order.baseservice.module.buyer.model;
import com.dxhy.order.baseservice.module.buyer.protocol.BuyerEntityBankBO;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 购方信息实体类 * 购方信息实体类
@ -123,4 +125,10 @@ public class BuyerEntity implements Serializable {
* 客户状态(0:冻结;1:非冻结) * 客户状态(0:冻结;1:非冻结)
*/ */
private String status; private String status;
// 银行账户
private List<BuyerEntityBankBO> banks;
// 默认银行账户的索引7
private Integer bankDefaultIndex;
} }

@ -0,0 +1,23 @@
package com.dxhy.order.baseservice.module.buyer.protocol;
import lombok.Data;
/**
* @Description 购方银行账户
* @Author 巩权林
* @Date 2023/4/11 21:27
**/
@Data
public class BuyerEntityBankBO {
// 购方地址
private String address;
// 购方电话
private String phone;
// 开户行
private String bankOfDeposit;
// 开户账号
private String bankNumber;
}

@ -1,4 +1,4 @@
package com.dxhy.order.consumer.openapi.protocol.v6.sdenergy; package com.dxhy.order.baseservice.module.buyer.protocol;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

@ -1,7 +1,6 @@
package com.dxhy.order.consumer.openapi.api; package com.dxhy.order.consumer.openapi.api;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.baseservice.config.BaseServiceConfig; import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO; import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO;
@ -35,7 +34,7 @@ import com.dxhy.order.consumer.openapi.protocol.v5.order.DdfpcxReqV5;
import com.dxhy.order.consumer.openapi.protocol.v5.order.DdfpcxRspV5; import com.dxhy.order.consumer.openapi.protocol.v5.order.DdfpcxRspV5;
import com.dxhy.order.consumer.openapi.protocol.v5.order.DdpcxxRspV5; import com.dxhy.order.consumer.openapi.protocol.v5.order.DdpcxxRspV5;
import com.dxhy.order.consumer.openapi.protocol.v6.hzqrd.QdCommonRspV6; import com.dxhy.order.consumer.openapi.protocol.v6.hzqrd.QdCommonRspV6;
import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.MdmGmfxxtbMulticodeValuelistBO; import com.dxhy.order.baseservice.module.buyer.protocol.MdmGmfxxtbMulticodeValuelistBO;
import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.MdmGmfxxtbReqBO; import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.MdmGmfxxtbReqBO;
import com.dxhy.order.consumer.openapi.service.*; import com.dxhy.order.consumer.openapi.service.*;
import com.dxhy.order.consumer.utils.BeanTransitionUtils; import com.dxhy.order.consumer.utils.BeanTransitionUtils;

@ -1,6 +1,7 @@
package com.dxhy.order.consumer.openapi.protocol.v6.sdenergy; package com.dxhy.order.consumer.openapi.protocol.v6.sdenergy;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.dxhy.order.baseservice.module.buyer.protocol.MdmGmfxxtbMulticodeValuelistBO;
import lombok.ToString; import lombok.ToString;
import java.util.List; import java.util.List;

@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.baseservice.module.base.service.BaseService; import com.dxhy.order.baseservice.module.base.service.BaseService;
import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper; import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper;
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity;
import com.dxhy.order.baseservice.module.buyer.protocol.MdmBankListBO;
import com.dxhy.order.baseservice.module.buyer.protocol.MdmGmfxxtbMulticodeValuelistBO;
import com.dxhy.order.baseservice.module.commodity.dao.CommodityMapper; import com.dxhy.order.baseservice.module.commodity.dao.CommodityMapper;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity; import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.baseservice.module.taxclass.dao.GroupTaxClassCodeMapper; import com.dxhy.order.baseservice.module.taxclass.dao.GroupTaxClassCodeMapper;
@ -20,7 +22,6 @@ import com.dxhy.order.consumer.openapi.protocol.AjaxResult;
import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.*; import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.*;
import com.dxhy.order.model.R; import com.dxhy.order.model.R;
import com.dxhy.order.utils.DistributedKeyMaker; import com.dxhy.order.utils.DistributedKeyMaker;
import com.dxhy.order.utils.HttpUtils;
import com.dxhy.order.utils.JsonUtils; import com.dxhy.order.utils.JsonUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

Loading…
Cancel
Save