fix: 推送客商所属组织编码对应的金蝶组织编码
This commit is contained in:
+24
@@ -29,6 +29,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springblade.core.log.exception.ServiceException;
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
import org.springblade.system.cache.DictBizCache;
|
import org.springblade.system.cache.DictBizCache;
|
||||||
|
import org.springblade.system.cache.SysCache;
|
||||||
|
import org.springblade.system.pojo.entity.Dept;
|
||||||
import org.springblade.system.pojo.entity.DictBiz;
|
import org.springblade.system.pojo.entity.DictBiz;
|
||||||
import org.springblade.thirdparty.bfi.constant.BfiConstant;
|
import org.springblade.thirdparty.bfi.constant.BfiConstant;
|
||||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiCustomerBankEntryDTO;
|
import org.springblade.thirdparty.bfi.pojo.dto.BfiCustomerBankEntryDTO;
|
||||||
@@ -72,6 +74,10 @@ public class CustomerBfiConverter {
|
|||||||
param.setName(customer.getFullName());
|
param.setName(customer.getFullName());
|
||||||
// 【必填】统一社会信用代码(候选键):个人为身份证号或手机号
|
// 【必填】统一社会信用代码(候选键):个人为身份证号或手机号
|
||||||
param.setSocietycreditcode(customer.getUnifiedCreditCode());
|
param.setSocietycreditcode(customer.getUnifiedCreditCode());
|
||||||
|
|
||||||
|
// 【必填】创建组织:客商所属组织编码对应的金蝶组织编码
|
||||||
|
// param.setCreateorgNumber(this.resolveOrgNumber(customer));
|
||||||
|
|
||||||
// 纳税人识别号:与统一社会信用代码一致时推送
|
// 纳税人识别号:与统一社会信用代码一致时推送
|
||||||
param.setTxRegisterNo(customer.getUnifiedCreditCode());
|
param.setTxRegisterNo(customer.getUnifiedCreditCode());
|
||||||
// 法人代表:企业法人
|
// 法人代表:企业法人
|
||||||
@@ -106,6 +112,24 @@ public class CustomerBfiConverter {
|
|||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金蝶创建组织编码:客商所属组织部门编码,与金蝶组织编码一致;
|
||||||
|
* 所属组织不存在或未维护部门编码时抛出异常,阻断推送
|
||||||
|
*
|
||||||
|
* @param customer 客商档案
|
||||||
|
* @return 金蝶创建组织编码
|
||||||
|
*/
|
||||||
|
private String resolveOrgNumber(CustomerArchiveVO customer) {
|
||||||
|
Dept dept = customer.getDeptId() == null ? null : SysCache.getDept(customer.getDeptId());
|
||||||
|
if (dept == null) {
|
||||||
|
throw new ServiceException("推送金蝶失败,客商所属组织不存在,请检查客商所属组织配置");
|
||||||
|
}
|
||||||
|
if (Func.isBlank(dept.getDeptCode())) {
|
||||||
|
throw new ServiceException("推送金蝶失败,客商所属组织编码不能为空,请检查组织[" + dept.getDeptName() + "]是否维护部门编码");
|
||||||
|
}
|
||||||
|
return dept.getDeptCode();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析分类标准分录客户分组编码:内部组织 1101,其余(外部客商)1102
|
* 解析分类标准分录客户分组编码:内部组织 1101,其余(外部客商)1102
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user