Commit 72c5e8f5 authored by hongguangwu's avatar hongguangwu

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

parent b6e54458
......@@ -48,4 +48,10 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
// 主表发放时,更新明细表的发放时间与状态
void updateStatusByGrant(@Param("fdParentId") String fdParentId);
// 主表拒绝授权时,批量更新明细表为发放失败,原因为拒绝授权
void updateStatusByGrantFail(@Param("fdParentId") String fdParentId);
// 获取明细表ID来更新状态
List<EkpBankGrantDetail> getListByParentId(@Param("fdParentId") String fdParentId);
}
......@@ -46,4 +46,10 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
// 主表发放时,更新明细表的发放时间与状态
void updateStatusByGrant(String fdParentId);
// 主表拒绝授权时,批量更新明细表为发放失败,原因为拒绝授权
void updateStatusByGrantFail(String fdParentId);
// 获取明细表ID来更新状态
List<EkpBankGrantDetail> getListByParentId(String fdParentId);
}
......@@ -61,4 +61,15 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
public void updateStatusByGrant(String fdParentId) {
baseMapper.updateStatusByGrant(fdParentId);
}
@Override
public void updateStatusByGrantFail(String fdParentId) {
baseMapper.updateStatusByGrantFail(fdParentId);
}
@Override
public List<EkpBankGrantDetail> getListByParentId(String fdParentId) {
return baseMapper.getListByParentId(fdParentId);
}
}
......@@ -739,6 +739,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
List<EkpBankGrantDetail> detailDataList;
EkpBankGrantDetail detailData;
EkpBankPayTask main;
List<EkpBankGrantDetail> oldDetailList;
Map<String, EkpBankGrantDetail> oldMap;
for (EkpBankResultVo vo : mainList) {
for (int i = 0; i < vo.getNum(); i += 50) {
startNum = i + 1;
......@@ -754,36 +756,44 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
if ("04".equals(responseV1.getStatus())) {
//
dataList = responseV1.getDatalist();
oldDetailList = ekpBankGrantDetailService.getListByParentId(vo.getFdId());
oldMap = new HashMap<>();
if (oldDetailList != null && !oldDetailList.isEmpty()) {
for (EkpBankGrantDetail temp : oldDetailList) {
oldMap.put(temp.getFdSerialNumber(), temp);
}
}
if (dataList != null && !dataList.isEmpty()) {
detailDataList = new ArrayList<>();
for (JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail data : dataList) {
detailData = new EkpBankGrantDetail();
detailData.setFdParentId(vo.getFdId());
detailData.setFdSerialNumber(data.getPlatDetailId());
if ("02".equals(data.getResult())) {
detailData.setFdGrantStatus("发放成功");
} else {
detailData.setFdGrantStatus("发放失败");
detailData.setFdFailureFeedback(data.getCompanyHandlerResult());
// todo-生成发放失败待处理表数据-也可以 批量 生成
detailData = oldMap.get(data.getPlatDetailId());
if (detailData != null) {
if ("02".equals(data.getResult())) {
detailData.setFdGrantStatus("发放成功");
} else {
detailData.setFdGrantStatus("发放失败");
detailData.setFdFailureFeedback(data.getCompanyHandlerResult());
// todo-生成发放失败待处理表数据-也可以 批量 生成
}
detailDataList.add(detailData);
}
detailDataList.add(detailData);
}
main = new EkpBankPayTask();
main.setFdId(vo.getFdId());
main.setFdGrantStatus("已发放");
ekpBankPayTaskService.updateById(main);
// todo-更新明细状态为成功或失败
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList);
// 更新明细状态为成功或失败
ekpBankGrantDetailService.updateBatchById(detailDataList);
}
} else if ("05".equals(responseV1.getStatus())) {
main = new EkpBankPayTask();
main.setFdId(vo.getFdId());
main.setFdGrantStatus("拒绝授权");
ekpBankPayTaskService.updateById(main);
// todo-更新明细状态为 发放失败,原因为拒绝授权
//ekpBankGrantDetailService.updateStatusByGrant(detailDataList);
// 更新明细状态为 发放失败,原因为拒绝授权
ekpBankGrantDetailService.updateStatusByGrantFail(vo.getFdId());
}
}
......@@ -794,11 +804,11 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
// 明细表
if (mainList != null && !mainList.isEmpty()) {
if (detailList != null && !detailList.isEmpty()) {
List<JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail> dataList;
List<EkpBankGrantDetail> detailDataList = new ArrayList<>();
EkpBankGrantDetail detailData;
for (EkpBankResultVo vo : mainList) {
for (EkpBankResultVo vo : detailList) {
responseV1 = selectIcbcTransactionFlowInfo(vo.getFdWxNo(), "1", "10");
if (Common.isNotNull(responseV1)) {
// Return_code返回码,交易成功返回0,正表示业务报错,负表示系统报错
......
......@@ -111,4 +111,15 @@
update ekp_bank_grant_detail a set a.fd_create_time = NOW(),a.fd_grant_status='发放中' where a.fd_parent_id = #{fdParentId}
</update>
<!-- 主表拒绝授权时,批量更新明细表为发放失败,原因为拒绝授权 -->
<update id="updateStatusByGrantFail">
update ekp_bank_grant_detail a set a.fd_grant_status='发放失败',a.fd_failure_feedback = '拒绝授权' where a.fd_parent_id = #{fdParentId}
</update>
<select id="getListByParentId" resultMap="ekpBankGrantDetailMap">
select
a.fd_id,fd_serial_number
from ekp_bank_grant_detail a where a.fd_parent_id = #{fdParentId}
</select>
</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