Commit 9303bc97 authored by hongguangwu's avatar hongguangwu

MVP1.7.2 工行5次提交_定时任务

parent a669482a
......@@ -163,6 +163,6 @@ public class EkpBankGrantLog {
@ExcelAttribute(name = "失败总笔数")
@ExcelProperty("失败总笔数")
@Schema(description = "失败总笔数")
private Integer fdTransactionFailToal;
private Integer fdTransactionFailTotal;
}
......@@ -28,6 +28,7 @@ public class EkpBankResultVo implements Serializable {
@Schema(description = "收款人名称")
private String fdPayeeName;
private Integer fdGrantNum;
private Integer fdFailNum;
private Integer num;
}
......@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.icbc.api.DefaultIcbcClient;
......@@ -699,10 +701,6 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
int count = ekpBankGrantDetailService.getCountByIdAndMain(fdId);
String totalAmt = String.valueOf(BigDecimalUtils.safeMultiply(main.getFdMoney(), new BigDecimal("100"), 0));
if (!"1".equals(totalAmt)) {
redisUtil.remove(redisKey);
return R.failed("测试阶段,金额不是1分钱,请联系hgw解除禁止!");
}
String totalCount = String.valueOf(count);
String wxNo = main.getFdWxNo();
String url = main.getFdAttaName();
......@@ -740,10 +738,6 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
return R.failed("数据错误,无金额!");
}
String totalAmt = String.valueOf(BigDecimalUtils.safeMultiply(detail.getFdMoney(), new BigDecimal("100"), 0));
if (!"1".equals(totalAmt)) {
redisUtil.remove(redisKey);
return R.failed("测试阶段,金额不是1分钱,请联系hgw解除禁止!");
}
String totalCount = "1";
String wxNo = detail.getFdWxNo();
String url = detail.getFdAttaName();
......@@ -782,7 +776,6 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
JftApiPayrollQueryDetailResponseV1 responseV1;
// 发放日志
List<EkpBankGrantLog> logList = new ArrayList<>();
List<EkpBankGrantLogDetail> logDetailList = new ArrayList<>();
EkpBankGrantLog logs;
EkpBankGrantLogDetail logDetail;
......@@ -804,9 +797,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
int numSuccess;
int numFail;
for (EkpBankResultVo vo : mainList) {
for (int i = 0; i < vo.getNum(); i += 50) {
startNum = i + 1;
endNum = i + 50;
for (int i = 0; i < vo.getNum(); i += 49) {
startNum = i;
endNum = i + 49;
if (endNum > vo.getNum()) {
endNum = vo.getNum();
}
......@@ -873,6 +866,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
main = new EkpBankPayTask();
main.setFdId(vo.getFdId());
main.setFdGrantStatus("已发放");
main.setFdGrantNum(vo.getFdGrantNum()+1);
ekpBankPayTaskService.updateById(main);
// 更新明细状态为成功或失败
ekpBankGrantDetailService.updateBatchById(detailDataList);
......@@ -883,6 +877,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
if (numSuccess > 0) {
moneyFail = BigDecimalUtils.safeSubtract(moneyAll, moneySuccess);
numFail = vo.getNum() - numSuccess;
}
// 失败总金额
logs.setFdFailFee(moneyFail);
// 成功总金额
......@@ -890,7 +888,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 总金额
logs.setFdSumFee(moneyAll);
// 失败总笔数
logs.setFdTransactionFailToal(numFail);
logs.setFdTransactionFailTotal(numFail);
// 成功总笔数
logs.setFdTransactionSuccessTotal(numSuccess);
ekpBankGrantLogService.updateById(logs);
......@@ -919,7 +917,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
List<String> zhongXinSalaryIdList = new ArrayList<>();
JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail data;
for (EkpBankResultVo vo : detailList) {
responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), "1", "2");
responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), "0", "1");
if (Common.isNotNull(responseV1)) {
// Return_code返回码,交易成功返回0,正表示业务报错,负表示系统报错
// Status处理状态: 00-待提交,01-已提交 02-待授权 03-待银行处理, 04-处理成功,05-处理失败
......@@ -940,7 +938,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 总金额
logs.setFdSumFee(money);
// 失败总笔数
logs.setFdTransactionFailToal(0);
logs.setFdTransactionFailTotal(0);
// 成功总笔数
logs.setFdTransactionSuccessTotal(0);
......@@ -959,9 +957,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
logs.setFdSuccessFee(money);
detailData.setFdGrantStatus("发放成功");
detailData.setFdHandleStatus("已处理");
detailData.setFdGrantNum(vo.getFdGrantNum() + 1);
} else {
// 失败总笔数
logs.setFdTransactionFailToal(1);
logs.setFdTransactionFailTotal(1);
// 失败总金额
logs.setFdFailFee(money);
detailData.setFdGrantStatus("发放失败");
......
......@@ -119,7 +119,7 @@
<select id="getListByParentId" resultMap="ekpBankGrantDetailMap">
select
a.fd_id,a.fd_salary_id,fd_serial_number
a.fd_id,a.fd_salary_id,a.fd_serial_number,a.fd_payee_name
from ekp_bank_grant_detail a where a.fd_parent_id = #{fdParentId}
</select>
......
......@@ -38,24 +38,24 @@
<result property="fdSumFee" column="fd_sum_fee"/>
<result property="fdTransactionTotal" column="fd_transaction_total"/>
<result property="fdTransactionSuccessTotal" column="fd_transaction_success_total"/>
<result property="fdTransactionFailToal" column="fd_transaction_fail_toal"/>
<result property="fdTransactionFailTotal" column="fd_transaction_fail_total"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.fd_batch_number,
a.fd_batch_package,
a.fd_payment_account,
a.fd_drawee,
a.fd_currency,
a.fd_business_type,
a.fd_submit_time,
a.fd_transaction_time,
a.fd_success_fee,
a.fd_fail_fee,
a.fd_sum_fee,
a.fd_transaction_total,
a.fd_transaction_success_total,
a.fd_transaction_fail_toal
a.fd_id,
a.fd_batch_number,
a.fd_batch_package,
a.fd_payment_account,
a.fd_drawee,
a.fd_currency,
a.fd_business_type,
a.fd_submit_time,
a.fd_transaction_time,
a.fd_success_fee,
a.fd_fail_fee,
a.fd_sum_fee,
a.fd_transaction_total,
a.fd_transaction_success_total,
a.fd_transaction_fail_total
</sql>
</mapper>
......@@ -88,7 +88,8 @@
<!-- 获取发放中的主表,查询结果 -->
<select id="getEkpBankMainByNeedResultMain" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo">
select a.fd_id fdId,a.fd_wx_no fdWxNo
,count(d.fd_id) num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount,d.fd_payee_name fdPayeeName
,count(d.fd_id) num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount
,a.fd_grant_num fdGrantNum
from ekp_bank_pay_task a left join ekp_bank_grant_detail d on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '发放中'
GROUP BY a.fd_id
......@@ -98,6 +99,7 @@
<select id="getEkpBankMainByNeedResultDetail" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo">
select d.fd_id fdId,d.fd_wx_no fdWxNo,d.fd_parent_id fdParentId,d.fd_fail_num fdFailNum,d.fd_salary_id fdSalaryId
,'1' num,a.fd_bank_name fdBankName,a.fd_bank_no fdBankNo,a.fd_bank_account fdBankAccount,d.fd_payee_name fdPayeeName
,d.fd_grant_num fdGrantNum
from ekp_bank_grant_detail d left join ekp_bank_pay_task a on a.fd_id = d.fd_parent_id
where a.fd_grant_status = '已发放' and d.fd_grant_status = '发放失败' and d.fd_handle_status = '发放中'
</select>
......
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