Commit 0a4eb245 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.2' into MVP1.7.2

parents 472e5e1d 38489a1d
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
/**
* 工行返回的数据记录表
*
* @author hgw
* @date 2024-11-27 16:50:15
*/
@Data
@TableName("ekp_bank_icbc_log")
@Schema(description = "工行返回的数据记录表")
public class EkpBankIcbcLog {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 批次号
*/
@ExcelAttribute(name = "批次号", maxLength = 36)
@Length(max = 36, message = "批次号不能超过36个字符")
@ExcelProperty("批次号")
@Schema(description = "批次号")
private String fdWxNo;
/**
* 日志
*/
@ExcelAttribute(name = "日志")
@ExcelProperty("日志")
@Schema(description = "日志")
private String fdLog;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@ExcelProperty("创建时间")
@Schema(description = "创建时间")
private LocalDateTime fdCreateTime;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankIcbcLog;
import org.apache.ibatis.annotations.Mapper;
/**
* 工行返回的数据记录表
*
* @author hgw
* @date 2024-11-27 16:50:15
*/
@Mapper
public interface EkpBankIcbcLogMapper extends BaseMapper<EkpBankIcbcLog> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankIcbcLog;
/**
* 工行返回的数据记录表
*
* @author hgw
* @date 2024-11-27 16:50:15
*/
public interface EkpBankIcbcLogService extends IService<EkpBankIcbcLog> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankIcbcLog;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpBankIcbcLogMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankIcbcLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 工行返回的数据记录表
*
* @author hgw
* @date 2024-11-27 16:50:15
*/
@Log4j2
@Service
public class EkpBankIcbcLogServiceImpl extends ServiceImpl<EkpBankIcbcLogMapper, EkpBankIcbcLog> implements EkpBankIcbcLogService {
}
...@@ -79,6 +79,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -79,6 +79,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired @Autowired
private EkpBankGrantLogDetailService ekpBankGrantLogDetailService; private EkpBankGrantLogDetailService ekpBankGrantLogDetailService;
@Autowired @Autowired
private EkpBankIcbcLogService ekpBankIcbcLogService;
@Autowired
private OSSUtil ossUtil; private OSSUtil ossUtil;
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
...@@ -682,6 +684,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -682,6 +684,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} else { } else {
redisUtil.set(redisKey, 600L); redisUtil.set(redisKey, 600L);
} }
try {
// 1主表 // 1主表
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
EkpBankPayTask main = ekpBankPayTaskService.getById(fdId); EkpBankPayTask main = ekpBankPayTaskService.getById(fdId);
...@@ -756,9 +759,15 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -756,9 +759,15 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
return R.failed("请检查状态!"); return R.failed("请检查状态!");
} }
} }
} catch (Exception e) {
log.error("银企付款发放发放异常", e);
} finally {
redisUtil.remove(redisKey);
}
} else { } else {
return R.failed("传参错误!"); return R.failed("传参错误!");
} }
return R.failed("传参错误!!");
} }
/** /**
...@@ -796,6 +805,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -796,6 +805,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
BigDecimal moneyAll; BigDecimal moneyAll;
int numSuccess; int numSuccess;
int numFail; int numFail;
List<EkpBankIcbcLog> icbcLogList = new ArrayList<>();
for (EkpBankResultVo vo : mainList) { for (EkpBankResultVo vo : mainList) {
for (int i = 0; i < vo.getNum(); i += 49) { for (int i = 0; i < vo.getNum(); i += 49) {
startNum = i; startNum = i;
...@@ -805,6 +815,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -805,6 +815,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} }
responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), String.valueOf(startNum), String.valueOf(endNum)); responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), String.valueOf(startNum), String.valueOf(endNum));
if (Common.isNotNull(responseV1)) { if (Common.isNotNull(responseV1)) {
// 生成工行接口数据记录
setIcbcLogBaseInfo(responseV1, icbcLogList, vo.getFdWxNo() + "_" + startNum + "_" + endNum);
// 返回码,交易成功返回0,正表示业务报错,负表示系统报错 // 返回码,交易成功返回0,正表示业务报错,负表示系统报错
if ("0".equals(responseV1.getReturn_code())) { if ("0".equals(responseV1.getReturn_code())) {
// 处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败 // 处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
...@@ -904,6 +916,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -904,6 +916,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} }
} }
} }
if (!icbcLogList.isEmpty()) {
ekpBankIcbcLogService.saveBatch(icbcLogList);
}
} }
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口 // 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
...@@ -915,9 +930,12 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -915,9 +930,12 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
EkpBankGrantDetail detailData; EkpBankGrantDetail detailData;
List<String> zhongXinSalaryIdList = new ArrayList<>(); List<String> zhongXinSalaryIdList = new ArrayList<>();
JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail data; JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail data;
List<EkpBankIcbcLog> icbcLogList = new ArrayList<>();
for (EkpBankResultVo vo : detailList) { for (EkpBankResultVo vo : detailList) {
responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), "0", "1"); responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), "0", "1");
if (Common.isNotNull(responseV1)) { if (Common.isNotNull(responseV1)) {
// 生成工行接口数据记录
setIcbcLogBaseInfo(responseV1, icbcLogList, vo.getFdWxNo());
// Return_code返回码,交易成功返回0,正表示业务报错,负表示系统报错 // Return_code返回码,交易成功返回0,正表示业务报错,负表示系统报错
// Status处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败 // Status处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
if ("0".equals(responseV1.getReturn_code()) && "04".equals(responseV1.getStatus()) if ("0".equals(responseV1.getReturn_code()) && "04".equals(responseV1.getStatus())
...@@ -981,10 +999,21 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -981,10 +999,21 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
ekpBankGrantDetailService.updateZhongXinStatusAndBankInfo(zhongXinSalaryIdList); ekpBankGrantDetailService.updateZhongXinStatusAndBankInfo(zhongXinSalaryIdList);
ekpBankGrantDetailService.updateZhongXinMainStatusAndBankInfo(zhongXinSalaryIdList); ekpBankGrantDetailService.updateZhongXinMainStatusAndBankInfo(zhongXinSalaryIdList);
} }
if (!icbcLogList.isEmpty()) {
ekpBankIcbcLogService.saveBatch(icbcLogList);
}
} }
return R.ok(); return R.ok();
} }
private void setIcbcLogBaseInfo(JftApiPayrollQueryDetailResponseV1 responseV1, List<EkpBankIcbcLog> icbcLogList, String fdWxNo) {
EkpBankIcbcLog icbcLog = new EkpBankIcbcLog();
icbcLog.setFdCreateTime(LocalDateTime.now());
icbcLog.setFdWxNo(fdWxNo);
icbcLog.setFdLog(JSON.toJSONString(responseV1));
icbcLogList.add(icbcLog);
}
/** /**
* @Description: 初始化日志明细 * @Description: 初始化日志明细
* @Author: hgw * @Author: hgw
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.ekp.mapper.EkpBankIcbcLogMapper">
<resultMap id="ekpBankIcbcLogMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpBankIcbcLog">
<id property="fdId" column="fd_id"/>
<result property="fdWxNo" column="fd_wx_no"/>
<result property="fdLog" column="fd_log"/>
<result property="fdCreateTime" column="fd_create_time"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.fd_wx_no,
a.fd_log,
a.fd_create_time
</sql>
</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