| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | .or().isNull(BusinessCustomer::getLegalPerson) |
| | | .or().isNull(BusinessCustomer::getBankName) |
| | | .or().isNull(BusinessCustomer::getBankAccount) |
| | | .or().isNull(BusinessCustomer::getRegisterName)) |
| | | .or().isNull(BusinessCustomer::getRegisterName) |
| | | .or().isNull(BusinessCustomer::getBipCode)) |
| | | ); |
| | | if (ArrayUtil.isNotEmpty(bcList.toArray())){ |
| | | if (CollUtil.isNotEmpty(bcList)){ |
| | | for (BusinessCustomer bc:bcList |
| | | ) { |
| | | log.info("开始同步{}信息",bc.getCompanyName()); |
| | | CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCustName(bc.getCompanyName()); |
| | | if (ObjUtil.isNull(custInfo)){ |
| | | continue; |
| | | } |
| | | if (ObjUtil.isNotNull(custInfo)){ |
| | | bc.setCreditCode(custInfo.getCertificateId()); |
| | | bc.setRegisterName(custInfo.getCustName()); |
| | | bc.setLegalPerson(custInfo.getLegalPerson()); |
| | | bc.setAddress(custInfo.getRegistrationAddress()); |
| | | bc.setBipCode(custInfo.getCustCode()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步名称、法人、地址、信用码信息成功",bc.getCompanyName()); |
| | | log.info("{}同步名称、法人、地址、信用码、bipcode信息成功",bc.getCompanyName()); |
| | | } |
| | | List<CustBankVo> bankVoList = bipViewMapper.selectBankByCustName(bc.getCompanyName()); |
| | | if (ArrayUtil.isNotEmpty(bankVoList.toArray())){ |
| | | if (CollUtil.isEmpty(bankVoList)){ |
| | | continue; |
| | | } |
| | | if (CollUtil.isNotEmpty(bankVoList)){ |
| | | if (StrUtil.isEmpty(bc.getBankAccount())){ |
| | | bc.setBankAccount(bankVoList.get(0).getBankAccount()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步银行卡号信息成功",bc.getCompanyName()); |
| | | } |
| | | List<BankNameVo> bankNameVoList = bipBanklViewMapper.selectBankByCode(bankVoList.get(0).getBankName()); |
| | | if (ArrayUtil.isNotEmpty(bankNameVoList.toArray())){ |
| | | if (CollUtil.isNotEmpty(bankNameVoList)){ |
| | | bc.setBankName(bankNameVoList.get(0).getBankNameName()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步银行名称信息成功",bc.getCompanyName()); |
| | |
| | | log.info("{}主数据查询名称、法人、地址、信用码信息成功",companyName); |
| | | } |
| | | List<CustBankVo> bankVoList = bipViewMapper.selectBankByCustName(bc.getCompanyName()); |
| | | if (ArrayUtil.isNotEmpty(bankVoList.toArray())){ |
| | | if (CollUtil.isNotEmpty(bankVoList)){ |
| | | if (StrUtil.isEmpty(bc.getBankAccount())){ |
| | | bc.setBankAccount(bankVoList.get(0).getBankAccount()); |
| | | log.info("{}主数据查询银行卡号信息成功",companyName); |
| | | } |
| | | List<BankNameVo> bankNameVoList = bipBanklViewMapper.selectBankByCode(bankVoList.get(0).getBankName()); |
| | | if (ArrayUtil.isNotEmpty(bankNameVoList.toArray())){ |
| | | if (CollUtil.isNotEmpty(bankNameVoList)){ |
| | | bc.setBankName(bankNameVoList.get(0).getBankNameName()); |
| | | log.info("{}主数据查询银行名称信息成功",companyName); |
| | | } |