Commit b954a16c authored by hongguangwu's avatar hongguangwu

MVP1.7.4-银企付款任务-行号

parent eb1e1cd4
package com.yifu.cloud.plus.v1.ekp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Date 2024-11-18 10:23:18
* @Description EKP银企付款配置表
* @Version 1.0
*/
@Data
public class EkpBankCodeConfiglVo implements Serializable {
@ExcelProperty("开户行MVP")
private String bankNameMvp;
// 收款银行
@ExcelProperty("收款账号开户行")
private String fdRecipientBank;
@ExcelProperty("收款银行人行行号")
private String fdRecipientBankCode;
}
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail; import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -64,4 +65,12 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail> ...@@ -64,4 +65,12 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
// 获取明细表ID来更新状态 // 获取明细表ID来更新状态
List<EkpBankGrantDetail> getListByParentId(@Param("fdParentId") String fdParentId); List<EkpBankGrantDetail> getListByParentId(@Param("fdParentId") String fdParentId);
/**
* @Description: 获取工行开户行配置表
* @Author: hgw
* @Date: 2024/12/25 16:05
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo>
**/
List<EkpBankCodeConfiglVo> getEkpBankCodeConfiglVo();
} }
...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail; import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 发放结果明细(银企付款任务) * 发放结果明细(银企付款任务)
...@@ -61,4 +63,7 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail> ...@@ -61,4 +63,7 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
// 获取明细表ID来更新状态 // 获取明细表ID来更新状态
List<EkpBankGrantDetail> getListByParentId(String fdParentId); List<EkpBankGrantDetail> getListByParentId(String fdParentId);
// 获取工行开户行配置表
Map<String, EkpBankCodeConfiglVo> getEkpBankCodeConfiglVo();
} }
...@@ -20,11 +20,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -20,11 +20,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail; import com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantDetail;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpBankGrantDetailMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpBankGrantDetailMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankGrantDetailService; import com.yifu.cloud.plus.v1.ekp.service.EkpBankGrantDetailService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 发放结果明细(银企付款任务) * 发放结果明细(银企付款任务)
...@@ -96,4 +99,23 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai ...@@ -96,4 +99,23 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
return baseMapper.getListByParentId(fdParentId); return baseMapper.getListByParentId(fdParentId);
} }
/**
* @Description: 获取工行开户行配置表
* @Author: hgw
* @Date: 2024/12/25 16:10
* @return: java.util.Map<java.lang.String, com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo>
**/
@Override
public Map<String, EkpBankCodeConfiglVo> getEkpBankCodeConfiglVo() {
Map<String, EkpBankCodeConfiglVo> returnMap = new HashMap<>();
// getBankNameMvp 是非空切唯一的,可以做key
List<EkpBankCodeConfiglVo> list = baseMapper.getEkpBankCodeConfiglVo();
if (list != null && !list.isEmpty()) {
for (EkpBankCodeConfiglVo vo : list) {
returnMap.put(vo.getBankNameMvp(), vo);
}
}
return returnMap;
}
} }
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.ekp.service.impl; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.icbc.api.DefaultIcbcClient; import com.icbc.api.DefaultIcbcClient;
...@@ -22,6 +21,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.*; ...@@ -22,6 +21,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.*;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.*; import com.yifu.cloud.plus.v1.ekp.service.*;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -407,7 +407,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -407,7 +407,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
EkpBankAttaReturnVo vo = new EkpBankAttaReturnVo(); EkpBankAttaReturnVo vo = new EkpBankAttaReturnVo();
List<EkpBankExcelVo> list; List<EkpBankExcelVo> list;
Map<String, EkpBankCodeConfiglVo> bankMap = ekpBankGrantDetailService.getEkpBankCodeConfiglVo();
// 1主表整体下载 // 1主表整体下载
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
EkpBankPayTask main = ekpBankPayTaskService.getById(fdId); EkpBankPayTask main = ekpBankPayTaskService.getById(fdId);
...@@ -422,7 +422,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -422,7 +422,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} }
// 新下载 // 新下载
list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMain(fdId); list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMain(fdId);
R<EkpBankAttaReturnVo> returnVoR = getNewFileByMain(fdId, type, vo, list, main); R<EkpBankAttaReturnVo> returnVoR = getNewFileByMain(fdId, type, vo, list, main, bankMap);
redisUtil.remove(redisKey); redisUtil.remove(redisKey);
return returnVoR; return returnVoR;
} else if (Common.isNotNull(main.getFdAttaSrc())) { } else if (Common.isNotNull(main.getFdAttaSrc())) {
...@@ -443,7 +443,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -443,7 +443,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} }
// 新下载 // 新下载
list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetail(fdId); list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetail(fdId);
R<EkpBankAttaReturnVo> returnVoR = getNewFileByDetail(fdId, type, vo, list, detail); R<EkpBankAttaReturnVo> returnVoR = getNewFileByDetail(fdId, type, vo, list, detail, bankMap);
redisUtil.remove(redisKey); redisUtil.remove(redisKey);
return returnVoR; return returnVoR;
} else if (Common.isNotNull(detail.getFdAttaSrc())) { } else if (Common.isNotNull(detail.getFdAttaSrc())) {
...@@ -482,9 +482,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -482,9 +482,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2024/11/20 17:08 * @Date: 2024/11/20 17:08
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo>
**/ **/
private R<EkpBankAttaReturnVo> getNewFileByMain(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list, EkpBankPayTask main) { private R<EkpBankAttaReturnVo> getNewFileByMain(String fdId, String type, EkpBankAttaReturnVo vo
, List<EkpBankExcelVo> list, EkpBankPayTask main, Map<String, EkpBankCodeConfiglVo> bankMap) {
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
EkpBankAtta atta = getNewFileCore(fdId, type, vo, list); EkpBankAtta atta = getNewFileCore(fdId, type, vo, list, bankMap);
if (atta != null) { if (atta != null) {
main.setFdAttaName(atta.getFdAttaName()); main.setFdAttaName(atta.getFdAttaName());
main.setFdAttaSrc(atta.getFdAttaSrc()); main.setFdAttaSrc(atta.getFdAttaSrc());
...@@ -510,9 +511,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -510,9 +511,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2024/11/20 17:08 * @Date: 2024/11/20 17:08
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo>
**/ **/
private R<EkpBankAttaReturnVo> getNewFileByDetail(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list, EkpBankGrantDetail main) { private R<EkpBankAttaReturnVo> getNewFileByDetail(String fdId, String type, EkpBankAttaReturnVo vo
, List<EkpBankExcelVo> list, EkpBankGrantDetail main, Map<String, EkpBankCodeConfiglVo> bankMap) {
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
EkpBankAtta atta = getNewFileCore(fdId, type, vo, list); EkpBankAtta atta = getNewFileCore(fdId, type, vo, list, bankMap);
if (atta != null) { if (atta != null) {
main.setFdAttaName(atta.getFdAttaName()); main.setFdAttaName(atta.getFdAttaName());
main.setFdAttaSrc(atta.getFdAttaSrc()); main.setFdAttaSrc(atta.getFdAttaSrc());
...@@ -527,18 +529,26 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -527,18 +529,26 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
return R.failed("未找到待发放的明细数据,下载失败!!"); return R.failed("未找到待发放的明细数据,下载失败!!");
} }
private EkpBankAtta getNewFileCore(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list) { private EkpBankAtta getNewFileCore(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list
, Map<String, EkpBankCodeConfiglVo> bankMap) {
EkpBankCodeSet codeSet; EkpBankCodeSet codeSet;
R<EkpBankCodeSet> bankInfoQuery; R<EkpBankCodeSet> bankInfoQuery;
EkpBankCodeConfiglVo bankVo;
// 组装 // 组装
for (EkpBankExcelVo excelVo : list) { for (EkpBankExcelVo excelVo : list) {
if (Common.isEmpty(excelVo.getFdRecipientBankCode())) { if (Common.isEmpty(excelVo.getFdRecipientBankCode())) {
// 查询行号 // 查询行号
bankInfoQuery = icbcTransactionFlowQueryService.querybankinfo(excelVo.getFdPayeeAccount()); bankInfoQuery = icbcTransactionFlowQueryService.querybankinfo(excelVo.getFdPayeeAccount());
if (bankInfoQuery != null && bankInfoQuery.getCode() == CommonConstants.SUCCESS) { if (bankInfoQuery != null && bankInfoQuery.getCode() == CommonConstants.SUCCESS && bankInfoQuery.getData() != null) {
codeSet = bankInfoQuery.getData(); codeSet = bankInfoQuery.getData();
excelVo.setFdRecipientBankCode(codeSet.getFdRecipientBankCode()); excelVo.setFdRecipientBankCode(codeSet.getFdRecipientBankCode());
excelVo.setFdRecipientBank(codeSet.getFdRecipientBank()); excelVo.setFdRecipientBank(codeSet.getFdRecipientBank());
} else if (Common.isNotNull(excelVo.getFdRecipientBank())) {
bankVo = bankMap.get(excelVo.getFdRecipientBank());
if (bankVo != null) {
excelVo.setFdRecipientBankCode(bankVo.getFdRecipientBankCode());
excelVo.setFdRecipientBank(bankVo.getFdRecipientBank());
}
} }
} }
} }
......
...@@ -179,4 +179,12 @@ ...@@ -179,4 +179,12 @@
</if> </if>
</update> </update>
<!-- 查询工行开户行配置表 -->
<select id="getEkpBankCodeConfiglVo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo">
SELECT
bank_name_mvp bankNameMvp,bank_name fdRecipientBank,bank_code fdRecipientBankCode
FROM ekp_bank_code_config a
where a.bank_name_mvp is not null
</select>
</mapper> </mapper>
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