Commit b79e61b6 authored by hongguangwu's avatar hongguangwu

1.7.20-非扣税银企

parent a5281688
......@@ -175,7 +175,7 @@ public class EkpBankGrantDetail {
@Schema(description = "附件名称")
private String fdAttaName;
/**
* 附件资源路径
* 附件资源路径(非扣税存储serialNo(f_seq_no),用来查询结果等)
*/
@ExcelAttribute(name = "附件资源路径", maxLength = 200)
@Length(max = 200, message = "附件资源路径不能超过200个字符")
......
......@@ -64,7 +64,7 @@ public class EkpBankIcbcLog {
@Schema(description = "关联ID")
private String fdParentId;
/**
* 类型
* 类型3非扣税提交,4非扣税提交反馈 6非扣税获取结果
*/
@ExcelAttribute(name = "类型", maxLength = 1)
@Length(max = 36, message = "类型不能超过1个字符")
......
......@@ -218,7 +218,7 @@ public class EkpBankPayTask {
@Schema(description = "附件名称")
private String fdAttaName;
/**
* 附件资源路径
* 附件资源路径(非扣税存储serialNo(f_seq_no),用来查询结果等)
*/
@ExcelAttribute(name = "附件资源路径", maxLength = 200)
@Length(max = 200, message = "附件资源路径不能超过200个字符")
......
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银企付款下载文件Vo
* @Version 1.0
*/
@Data
public class EkpBankExcelNoTaxVo extends EkpBankExcelVo {
// 日期 明细标志 顺序号 报销号 单据张数 付款账号开户行 付款账号/卡号 付款账号名称/卡名称 收款账号开户行
// 收款地区 收款银行人行行号 汇款方式 收款账号 收款账号名称 金额 汇款用途 备注信息 收款账户短信通知手机号码
private String fdId;
}
......@@ -33,4 +33,9 @@ public class EkpBankResultVo implements Serializable {
private Integer fdGrantNum;
private Integer fdFailNum;
private Integer num;
// 非扣税存储serialNo(f_seq_no),用来查询结果等
private String fdAttaSrc;
// 非扣税使用的金额,授权失败记录金额
private String fdMoney;
}
......@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;
/**
* 聚富通代发工资相关
......@@ -150,7 +149,11 @@ public class IcbcTransactionFlowIssueController {
@Inner
@PostMapping("/inner/doGetEkpBankStatus")
public R<String> doGetEkpBankStatus() {
return icbcTransactionFlowIssueService.doGetEkpBankStatus();
// 工资
icbcTransactionFlowIssueService.doGetEkpBankStatus();
// 非扣税
icbcTransactionFlowIssueService.doGetEkpBankNoTaxStatus();
return R.ok();
}
@Operation(summary = "定时任务获取回单文件", description = "定时任务获取回单文件")
......
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.EkpBankExcelNoTaxVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -40,8 +41,11 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
// 查询主表下的全部数据
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndMain(@Param("fdParentId") String fdParentId);
List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndMainNoTax(@Param("fdParentId") String fdParentId);
// 查询详情里的1条数据
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(@Param("fdId") String fdId);
List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndDetailNoTax(@Param("fdId") String fdId);
// 编号查重
String getWxNoByWxNo(@Param("wxNo") String wxNo);
......
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankPayTask;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -34,9 +35,9 @@ import java.util.List;
public interface EkpBankPayTaskMapper extends BaseMapper<EkpBankPayTask> {
// 获取发放中的主表,查询结果
List<EkpBankResultVo> getEkpBankMainByNeedResultMain();
List<EkpBankResultVo> getEkpBankMainByNeedResultMain(@Param("typeName") String typeName);
// 获取发放中的明细表,查询结果
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail();
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(@Param("typeName") String typeName);
}
......@@ -20,8 +20,8 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
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.EkpBankExcelNoTaxVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -39,9 +39,12 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
// 查询下载的待发 明细数据
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndMain(String fdParentId);
// 查询非扣税的待发 明细数据
List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndMainNoTax(String fdParentId);
// 查询下载的待发 明细数据
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(String fdId);
List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndDetailNoTax(String fdId);
// 查询编码是否重复
String getWxNoByWxNo(String wxNo);
......
......@@ -37,7 +37,7 @@ public interface EkpBankPayTaskService extends IService<EkpBankPayTask> {
* @Date: 2024-11-25 10:25:58
* @return: com.yifu.cloud.plus.v1.ekp.entity.EkpBankPayTask
**/
List<EkpBankResultVo> getEkpBankMainByNeedResultMain();
List<EkpBankResultVo> getEkpBankMainByNeedResultMain(String typeName);
/**
* @Description: 获取发放中的明细表,查询结果
......@@ -45,6 +45,6 @@ public interface EkpBankPayTaskService extends IService<EkpBankPayTask> {
* @Date: 2024/11/25 10:38
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo>
**/
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail();
List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(String typeName);
}
......@@ -79,13 +79,21 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
void exportAll(HttpServletResponse response);
/**
* @Description: 每小时获取银企付款结果
* @Description: 每小时获取银企付款结果——工资
* @Author: hgw
* @Date: 2024/11/22 16:56
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> doGetEkpBankStatus();
/**
* @Description: 每小时获取非扣税银企付款结果——非扣税
* @Author: hgw
* @Date: 2026/2/26 16:56
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> doGetEkpBankNoTaxStatus();
R getPdfFile() throws IOException;
}
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.response.MybankEnterprisePayQpayentResponseV1;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankCodeSet;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelNoTaxVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
......@@ -54,8 +58,11 @@ public interface IcbcTransactionFlowQueryService extends IService<EkpSocialInfo>
// 工行非税支付
// type 0 对公; 1 对私.
R<String> submitIcbcToNoTax(String totalAmt, String totalCount, String wxNo
, List<EkpBankExcelVo> detailList, int type, String fdId);
, List<EkpBankExcelNoTaxVo> detailList, int type, String fdId);
R submitSearch();
// 查询非扣税结果
MybankEnterprisePayQpayentResponseV1 getResultNoTax(EkpBankResultVo task, String tranDate, String tranTime, String seqNo, DefaultIcbcClient client);
}
......@@ -21,6 +21,7 @@ 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.service.EkpBankGrantDetailService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankCodeConfiglVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelNoTaxVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -50,10 +51,19 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
return baseMapper.getEkpBankExcelVoByIdAndMain(fdParentId);
}
@Override
public List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndMainNoTax(String fdParentId) {
return baseMapper.getEkpBankExcelVoByIdAndMainNoTax(fdParentId);
}
@Override
public List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(String fdId) {
return baseMapper.getEkpBankExcelVoByIdAndDetail(fdId);
}
@Override
public List<EkpBankExcelNoTaxVo> getEkpBankExcelVoByIdAndDetailNoTax(String fdId) {
return baseMapper.getEkpBankExcelVoByIdAndDetailNoTax(fdId);
}
@Override
public String getWxNoByWxNo(String wxNo) {
......
......@@ -43,8 +43,8 @@ public class EkpBankPayTaskServiceImpl extends ServiceImpl<EkpBankPayTaskMapper,
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.entity.EkpBankPayTask>
**/
@Override
public List<EkpBankResultVo> getEkpBankMainByNeedResultMain() {
return baseMapper.getEkpBankMainByNeedResultMain();
public List<EkpBankResultVo> getEkpBankMainByNeedResultMain(String typeName) {
return baseMapper.getEkpBankMainByNeedResultMain(typeName);
}
/**
......@@ -54,7 +54,7 @@ public class EkpBankPayTaskServiceImpl extends ServiceImpl<EkpBankPayTaskMapper,
* @return: java.util.List<com.yifu.cloud.plus.v1.ekp.vo.EkpBankResultVo>
**/
@Override
public List<EkpBankResultVo> getEkpBankMainByNeedResultDetail() {
return baseMapper.getEkpBankMainByNeedResultDetail();
public List<EkpBankResultVo> getEkpBankMainByNeedResultDetail(String typeName) {
return baseMapper.getEkpBankMainByNeedResultDetail(typeName);
}
}
......@@ -15,6 +15,7 @@ import com.icbc.api.request.JftUiPayrollComfirmSubmitRequestV1;
import com.icbc.api.request.MybankEnterpriseAccountQuerybankinfoRequestV1;
import com.icbc.api.response.JftApiPayrollQueryDetailResponseV1;
import com.icbc.api.response.MybankEnterpriseAccountQuerybankinfoResponseV1;
import com.icbc.api.response.MybankEnterprisePayQpayentResponseV1;
import com.icbc.api.utils.IcbcSignature;
import com.icbc.api.utils.WebUtils;
import com.jcraft.jsch.*;
......@@ -22,10 +23,7 @@ import com.yifu.cloud.plus.v1.ekp.config.IcbcIssueConfigProperties;
import com.yifu.cloud.plus.v1.ekp.entity.*;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
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.EkpBankCodeConfiglVo;
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.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import lombok.RequiredArgsConstructor;
......@@ -51,7 +49,10 @@ import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -92,7 +93,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired
private RedisUtil redisUtil;
// 处理状态:00-提交成功,01-待银行处理 02-处理成功 03-处理失败,4-收方行处理中 5-收方行处理成功 6-收方行处理失败 7-收方行无法反馈
protected final static Map<String, String> STATUS_MAP;
protected static final Map<String, String> STATUS_MAP;
static {
STATUS_MAP = new HashMap<>();
......@@ -106,6 +107,31 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
STATUS_MAP.put("7", "收方行无法反馈");
}
// 非扣税的指令状态:0:提交成功,等待银行处理 1:授权成功,等待银行处理 2:等待授权 3:等待二次授权 4:等待银行答复 5:主机返回待处理 6:被银行拒绝 7:处理成功 8:指令被拒绝授权 9:银行正在处理 10:预约指令 11:预约取消 12:等待监管审批 13:监管审批成功,等待银行处理 14:指令被监管审批拒绝 40:待确认 41:客户取消 42:等待华商审批 43:华商审批成功 | 9 |
protected static final Map<String, String> NO_TAX_STATUS_MAP;
static {
NO_TAX_STATUS_MAP = new HashMap<>();
NO_TAX_STATUS_MAP.put("0", "提交成功,等待银行处理");
NO_TAX_STATUS_MAP.put("1", "授权成功,等待银行处理");
NO_TAX_STATUS_MAP.put("2", "等待授权");
NO_TAX_STATUS_MAP.put("3", "等待二次授权");
NO_TAX_STATUS_MAP.put("4", "等待银行答复");
NO_TAX_STATUS_MAP.put("5", "主机返回待处理");
NO_TAX_STATUS_MAP.put("6", "被银行拒绝");
NO_TAX_STATUS_MAP.put("7", "处理成功");
NO_TAX_STATUS_MAP.put("8", "指令被拒绝授权");
NO_TAX_STATUS_MAP.put("9", "银行正在处理");
NO_TAX_STATUS_MAP.put("10", "预约指令");
NO_TAX_STATUS_MAP.put("11", "预约取消");
NO_TAX_STATUS_MAP.put("12", "等待监管审批");
NO_TAX_STATUS_MAP.put("13", "监管审批成功,等待银行处理");
NO_TAX_STATUS_MAP.put("14", "指令被监管审批拒绝");
NO_TAX_STATUS_MAP.put("40", "待确认");
NO_TAX_STATUS_MAP.put("41", "客户取消");
NO_TAX_STATUS_MAP.put("42", "等待华商审批");
NO_TAX_STATUS_MAP.put("43", "华商审批成功");
}
//1、网关公钥
//private static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+G1DVAmQnIpiPEFAEDqRfNGAVvvH35yDetqewKi0l7OEceTMN1C6NPym3zStvSoQayjYV+eIcZERkx31KhtFu9clZKgRTyPjdKMIth/wBtPKjL/5+PYalLdomM4ONthrPgnkN4x4R0+D4+EBpXo8gNiAFsNwIDAQAB";
//2、appid
......@@ -595,6 +621,48 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
}
// 初始化收款银行行号和行名
private void initNoTaxFdRecipientBankCodeAndName(List<EkpBankExcelNoTaxVo> list, Map<String, EkpBankCodeConfiglVo> bankMap) {
//工行的卡号bin list
List<String> binList = baseMapper.getAllIcbcCardBinInfo();
EkpBankCodeSet codeSet;
EkpBankCodeConfiglVo bankVo;
R<EkpBankCodeSet> bankInfoQuery;
for (EkpBankExcelNoTaxVo excelVo : list) {
if (Common.isEmpty(excelVo.getFdRecipientBankCode())) {
//工行的卡号通过bin来判断,如果是工行的卡号,则不需要行名行号
// 检查长度是否足够
boolean flag = false;
if (Common.isNotNull(binList) && !binList.isEmpty() && excelVo.getFdPayeeAccount().length() >= 5) {
for (String bin : binList) {
if ((bin.length() == 5 && excelVo.getFdPayeeAccount().substring(0, 5).equals(bin)) ||
(bin.length() == 6 && excelVo.getFdPayeeAccount().length() >= 6 &&
excelVo.getFdPayeeAccount().substring(0, 6).equals(bin))) {
excelVo.setFdRecipientBankCode(null);
excelVo.setFdRecipientBank(null);
flag = true;
break;
}
}
}
if (!flag) {
// 查询行号
bankInfoQuery = icbcTransactionFlowQueryService.querybankinfo(excelVo.getFdPayeeAccount());
if (bankInfoQuery != null && bankInfoQuery.getCode() == CommonConstants.SUCCESS && bankInfoQuery.getData() != null) {
codeSet = bankInfoQuery.getData();
excelVo.setFdRecipientBankCode(codeSet.getFdRecipientBankCode());
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());
}
}
}
}
}
}
/**
......@@ -877,9 +945,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 更新wxno
ekpBankPayTaskService.updateById(main);
}
List<EkpBankExcelVo> detailList = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMain(fdId);
List<EkpBankExcelNoTaxVo> detailList = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMainNoTax(fdId);
// 初始化收款银行行号和行名
initFdRecipientBankCodeAndName(detailList, bankMap);
initNoTaxFdRecipientBankCodeAndName(detailList, bankMap);
// 0对公1对私
int noTaxPayType = CommonConstants.ZERO_INT;
if (Common.isNotNull(main.getFdDownloadNum()) && 11 == main.getFdDownloadNum()) {
......@@ -887,10 +955,12 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
R<String> returnR = icbcTransactionFlowQueryService.submitIcbcToNoTax(totalAmt, totalCount, wxNo, detailList, noTaxPayType, fdId);
if (returnR.getCode() == CommonConstants.SUCCESS) {
String serialNo = returnR.getData();
// 存储日志
saveIcbcLogBaseInfoBySumbit(returnR.getData(), wxNo + "_main", fdId);
saveIcbcLogBaseInfoBySumbit(serialNo, wxNo + "_main", fdId);
// 发放次数+1,改主表或明细表“发放状态”为“发放中”
main.setFdGrantStatus("发放中");
main.setFdAttaSrc(serialNo);
main.setFdGrantNum(main.getFdGrantNum() + 1);
main.setFdSubmitCashier(submitUser);
ekpBankPayTaskService.updateById(main);
......@@ -937,13 +1007,15 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
if (Common.isNotNull(detail.getFdDownloadNum()) && 11 == detail.getFdDownloadNum()) {
noTaxPayType = CommonConstants.ONE_INT;
}
List<EkpBankExcelVo> detailList = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetail(fdId);
List<EkpBankExcelNoTaxVo> detailList = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetailNoTax(fdId);
R<String> returnR = icbcTransactionFlowQueryService.submitIcbcToNoTax(totalAmt, totalCount, wxNo, detailList, noTaxPayType, fdId);
if (returnR.getCode() == CommonConstants.SUCCESS) {
String serialNo = returnR.getData();
// 存储日志
saveIcbcLogBaseInfoBySumbit(returnR.getData(), wxNo, fdId);
saveIcbcLogBaseInfoBySumbit(serialNo, wxNo, fdId);
// 发放次数+1,改主表或明细表“发放状态”为“发放中”
detail.setFdHandleStatus("发放中");
detail.setFdAttaSrc(serialNo);
detail.setFdCreateTime(LocalDateTime.now());
detail.setFdGrantNum(detail.getFdGrantNum() + 1);
ekpBankGrantDetailService.updateById(detail);
......@@ -963,19 +1035,20 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
/**
* @Description: 每小时获取银企付款结果
* @Description: 每小时获取银企付款结果——工资
* @Author: hgw
* @Date: 2024/11/22 17:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> doGetEkpBankStatus() {
String typeName = "工资";
// 1:获取发放中的主表数据,查询工行接口
List<EkpBankResultVo> mainList = ekpBankPayTaskService.getEkpBankMainByNeedResultMain();
List<EkpBankResultVo> mainList = ekpBankPayTaskService.getEkpBankMainByNeedResultMain(typeName);
JftApiPayrollQueryDetailResponseV1 responseV1;
String title = "代发工资";
// 发放日志
List<EkpBankGrantLogDetail> logDetailList;
EkpBankGrantLog logs;
......@@ -1015,7 +1088,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 生成日志主表
logs = new EkpBankGrantLog();
saveNewEkpBankGrantLog(responseV1, vo, vo.getFdId(), logs);
saveNewEkpBankGrantLog(responseV1.getRemark(), vo, vo.getFdId(), logs, title);
dataList = responseV1.getDatalist();
oldDetailList = ekpBankGrantDetailService.getListByParentId(vo.getFdId());
......@@ -1121,7 +1194,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List<EkpBankResultVo> detailList = ekpBankPayTaskService.getEkpBankMainByNeedResultDetail();
List<EkpBankResultVo> detailList = ekpBankPayTaskService.getEkpBankMainByNeedResultDetail(typeName);
// 明细表
if (detailList != null && !detailList.isEmpty()) {
List<JftApiPayrollQueryDetailResponseV1.JftApiPayrollDetail> dataList;
......@@ -1183,7 +1256,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
if (Common.isNotNull(data.getCompanyHandleTime())) {
logs.setFdTransactionTime(DateUtil.stringToDateByFormat(data.getCompanyHandleTime(), DateUtil.DATETIME_PATTERN_SECOND));
}
saveNewEkpBankGrantLog(responseV1, vo, vo.getFdParentId(), logs);
saveNewEkpBankGrantLog(responseV1.getRemark(), vo, vo.getFdParentId(), logs, title);
// 初始化日志明细
logDetail = new EkpBankGrantLogDetail();
setLogDetailBaseInfo(logs, money, logDetail, data);
......@@ -1204,6 +1277,291 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
return R.ok();
}
/**
* hgw 2026-02-26
* 获取非扣税支付指令结果
*/
@Override
public R<String> doGetEkpBankNoTaxStatus() {
// 工行接口日志列表
List<EkpBankIcbcLog> icbcLogList = new ArrayList<>();
// 获取当前时间
LocalTime currentTime = LocalTime.now();
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HHmmssSSS");
String tranTime = currentTime.format(timeFormatter);
String tranDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 初始化工行客户端
DefaultIcbcClient client = new DefaultIcbcClient(icbcConfigProperties.getAppId(),
IcbcConstants.SIGN_TYPE_CA_SM_ICBC,
icbcConfigProperties.getAppPrivateKey(),
IcbcConstants.CHARSET_UTF8,
IcbcConstants.FORMAT_JSON,
null,
null,
null,
icbcConfigProperties.getCaSm(),
null);
client.setIcbc_ca(icbcConfigProperties.getCaSmIcbc());
MybankEnterprisePayQpayentResponseV1 responseV1;
String title = "转账";
String typeName = "非扣税";
String seqNoPre = "AHWX";
String seqNo;
List<MybankEnterprisePayQpayentResponseV1.MybankEnterprisePayQpayentResponseRdV1> dataList;
List<EkpBankGrantDetail> oldDetailList;
Map<String, EkpBankGrantDetail> oldMap;
BigDecimal moneySuccess;
BigDecimal moneyFail;
BigDecimal moneyAll;
int numSuccess;
int numFail;
// 发放日志
List<EkpBankGrantLogDetail> logDetailList;
EkpBankGrantLog logs;
EkpBankGrantLogDetail logDetail;
BigDecimal money;
List<EkpBankGrantDetail> detailDataList;
EkpBankGrantDetail detailData;
// 1:获取需要查询结果的非扣税支付任务(发放中的任务)——主表
List<EkpBankResultVo> mainList = ekpBankPayTaskService.getEkpBankMainByNeedResultMain(typeName);
String statusRemark;
int i = 0;
if (mainList != null && !mainList.isEmpty()) {
EkpBankPayTask main;
for (EkpBankResultVo vo : mainList) {
seqNo = seqNoPre + System.currentTimeMillis() + (i++);
responseV1 = icbcTransactionFlowQueryService.getResultNoTax(vo, tranDate, tranTime, seqNo, client);
if (Common.isNotNull(responseV1)) {
// 生成工行接口数据记录
setIcbcLogBaseInfoNoTax(responseV1, icbcLogList, vo.getFdWxNo(), vo.getFdId());
// 返回码,交易成功返回0,正表示业务报错,负表示系统报错
if (responseV1.isSuccess()) {
// 生成日志主表
logs = new EkpBankGrantLog();
saveNewEkpBankGrantLog(responseV1.getPackageName(), vo, vo.getFdId(), logs, title);
dataList = responseV1.getRd();
oldDetailList = ekpBankGrantDetailService.getListByParentId(vo.getFdId());
oldMap = new HashMap<>();
if (oldDetailList != null && !oldDetailList.isEmpty()) {
for (EkpBankGrantDetail temp : oldDetailList) {
// oldMap.put temp.getFdSerialNumber(), temp)
oldMap.put(temp.getFdId(), temp);
}
}
moneyAll = BigDecimal.ZERO;
moneySuccess = BigDecimal.ZERO;
moneyFail = BigDecimal.ZERO;
numSuccess = 0;
numFail = 0;
if (dataList != null && !dataList.isEmpty()) {
logDetailList = new ArrayList<>();
detailDataList = new ArrayList<>();
for (MybankEnterprisePayQpayentResponseV1.MybankEnterprisePayQpayentResponseRdV1 data : dataList) {
// 交易时间
if (Common.isNotNull(data.getStartDate())) {
logs.setFdTransactionTime(DateUtil.stringToDateByFormat(data.getStartDate(), null));
}
money = BigDecimalUtils.safeDivide(new BigDecimal(data.getPayAmt()), new BigDecimal("100"), 2);
moneyAll = BigDecimalUtils.safeAdd(moneyAll, money);
// 初始化日志明细
logDetail = new EkpBankGrantLogDetail();
setLogDetailBaseInfoNoTax(logs, money, logDetail, data);
detailData = oldMap.get(data.getErpSqn());
if (detailData != null) {
// 收款人名称
logDetail.setFdPayee(detailData.getFdPayeeName());
// 收款银行
logDetail.setFdRecipientBank(detailData.getFdRecipientBank());
if ("7".equals(data.getResult())) {
moneySuccess = BigDecimalUtils.safeAdd(moneySuccess, money);
numSuccess++;
detailData.setFdGrantStatus("发放成功");
} else {
moneyFail = BigDecimalUtils.safeAdd(moneyFail, money);
numFail++;
detailData.setFdGrantStatus("发放失败");
detailData.setFdHandleStatus("");
statusRemark = STATUS_MAP.get(data.getResult());
detailData.setFdFailureFeedback(statusRemark);
// 批量更新中信银行表数据,使发放失败处理有数据出现
ekpBankGrantDetailService.updateZhongXinStatus(detailData.getFdSalaryId(), detailData.getFdId(), statusRemark);
ekpBankGrantDetailService.updateZhongXinMainStatus(detailData.getFdSalaryId(), detailData.getFdId(), statusRemark);
}
detailDataList.add(detailData);
}
logDetailList.add(logDetail);
}
ekpBankGrantLogDetailService.saveBatch(logDetailList);
main = new EkpBankPayTask();
main.setFdId(vo.getFdId());
main.setFdGrantStatus("已发放");
ekpBankPayTaskService.updateById(main);
// 更新明细状态为成功或失败
ekpBankGrantDetailService.updateBatchById(detailDataList);
}
if (numSuccess > 0) {
moneyFail = BigDecimalUtils.safeSubtract(moneyAll, moneySuccess);
numFail = vo.getNum() - numSuccess;
}
// 失败总金额
logs.setFdFailFee(moneyFail);
// 成功总金额
logs.setFdSuccessFee(moneySuccess);
// 总金额
logs.setFdSumFee(moneyAll);
// 失败总笔数
logs.setFdTransactionFailTotal(numFail);
// 成功总笔数
logs.setFdTransactionSuccessTotal(numSuccess);
ekpBankGrantLogService.updateById(logs);
} else if (400019 == responseV1.getReturnCode()) {
main = new EkpBankPayTask();
main.setFdErrorMsg("授权验证失败");
main.setFdId(vo.getFdId());
// 2024-11-29 16:55:32 经 项目经理王鹏 与 产品经理 孙兆松 沟通,将 “银企付款任务”列表的“发放状态”的值,由“拒绝授权”改为“处理失败”。
main.setFdGrantStatus("处理失败");
ekpBankPayTaskService.updateById(main);
// 更新明细状态为 发放失败,原因为处理失败
//ekpBankGrantDetailService.updateStatusByGrantFail(vo.getFdId())
}
}
}
}
// 2:获取主表已发放且明细表发放中的明细表数据,查询工行接口
List<EkpBankResultVo> detailList = ekpBankPayTaskService.getEkpBankMainByNeedResultDetail(typeName);
// 明细表
if (detailList != null && !detailList.isEmpty()) {
detailDataList = new ArrayList<>();
MybankEnterprisePayQpayentResponseV1.MybankEnterprisePayQpayentResponseRdV1 data;
icbcLogList = new ArrayList<>();
// 初始化
i = 0;
for (EkpBankResultVo vo : detailList) {
seqNo = seqNoPre + System.currentTimeMillis() + (i++);
responseV1 = icbcTransactionFlowQueryService.getResultNoTax(vo, tranDate, tranTime, seqNo, client);
if (Common.isNotNull(responseV1)) {
// 生成工行接口数据记录
setIcbcLogBaseInfoNoTax(responseV1, icbcLogList, vo.getFdWxNo(), vo.getFdId());
// 返回码,交易成功返回0,正表示业务报错,负表示系统报错
if (responseV1.isSuccess() && responseV1.getRd() != null && !responseV1.getRd().isEmpty()) {
// 生成日志主表
logs = new EkpBankGrantLog();
saveNewEkpBankGrantLog(responseV1.getPackageName(), vo, vo.getFdId(), logs, title);
dataList = responseV1.getRd();
data = dataList.get(0);
if (data != null) {
money = BigDecimalUtils.safeDivide(new BigDecimal(data.getPayAmt()), new BigDecimal("100"), 2);
detailData = new EkpBankGrantDetail();
detailData.setFdId(vo.getFdId());
detailData.setFdSerialNumber(data.getErpSqn());
// 生成日志主表
logs = new EkpBankGrantLog();
// 失败总金额
logs.setFdFailFee(BigDecimal.ZERO);
// 成功总金额
logs.setFdSuccessFee(BigDecimal.ZERO);
// 总金额
logs.setFdSumFee(money);
// 失败总笔数
logs.setFdTransactionFailTotal(0);
// 成功总笔数
logs.setFdTransactionSuccessTotal(0);
if ("7".equals(data.getResult())) {
// 失败总笔数
logs.setFdTransactionSuccessTotal(1);
logs.setFdSuccessFee(money);
detailData.setFdGrantStatus("发放成功");
detailData.setFdHandleStatus("已处理");
} else {
// 失败总笔数
logs.setFdTransactionFailTotal(1);
// 失败总金额
logs.setFdFailFee(money);
detailData.setFdGrantStatus("发放失败");
detailData.setFdHandleStatus("");
statusRemark = STATUS_MAP.get(data.getResult());
detailData.setFdFailureFeedback(statusRemark);
detailData.setFdFailNum(vo.getFdFailNum() + 1);
// 批量更新中信银行表数据,使发放失败处理有数据出现
ekpBankGrantDetailService.updateZhongXinStatus(vo.getFdSalaryId(), vo.getFdId(), statusRemark);
ekpBankGrantDetailService.updateZhongXinMainStatus(vo.getFdSalaryId(), vo.getFdId(), statusRemark);
}
// 交易时间
if (Common.isNotNull(data.getStartDate())) {
logs.setFdTransactionTime(DateUtil.stringToDateByFormat(data.getStartDate(), null));
}
saveNewEkpBankGrantLog(responseV1.getPackageName(), vo, vo.getFdParentId(), logs, title);
// 初始化日志明细
logDetail = new EkpBankGrantLogDetail();
setLogDetailBaseInfoNoTax(logs, money, logDetail, data);
// 收款人名称
logDetail.setFdPayee(vo.getFdPayeeName());
logDetail.setFdRecipientBank(vo.getFdRecipientBank());
ekpBankGrantLogDetailService.save(logDetail);
detailDataList.add(detailData);
}
} else if (400019 == responseV1.getReturnCode()) {
money = new BigDecimal(vo.getFdMoney());
detailData = new EkpBankGrantDetail();
detailData.setFdId(vo.getFdId());
detailData.setFdSerialNumber("");
// 生成日志主表
logs = new EkpBankGrantLog();
// 失败总金额
logs.setFdFailFee(money);
// 成功总金额
logs.setFdSuccessFee(BigDecimal.ZERO);
// 总金额
logs.setFdSumFee(money);
// 失败总笔数
logs.setFdTransactionFailTotal(1);
// 成功总笔数
logs.setFdTransactionSuccessTotal(0);
detailData.setFdGrantStatus("发放失败");
detailData.setFdHandleStatus("");
statusRemark = "授权验证失败";
detailData.setFdFailureFeedback(statusRemark);
detailData.setFdFailNum(1);
// 批量更新中信银行表数据,使发放失败处理有数据出现
ekpBankGrantDetailService.updateZhongXinStatus(vo.getFdSalaryId(), vo.getFdId(), statusRemark);
ekpBankGrantDetailService.updateZhongXinMainStatus(vo.getFdSalaryId(), vo.getFdId(), statusRemark);
// 交易时间
logs.setFdTransactionTime(new Date());
saveNewEkpBankGrantLog(responseV1.getPackageName(), vo, vo.getFdParentId(), logs, title);
// 初始化日志明细
logDetail = new EkpBankGrantLogDetail();
setLogDetailBaseInfoNoTax(logs, money, logDetail, null);
// 收款人名称
logDetail.setFdPayee(vo.getFdPayeeName());
logDetail.setFdRecipientBank(vo.getFdRecipientBank());
ekpBankGrantLogDetailService.save(logDetail);
detailDataList.add(detailData);
}
}
}
// 更新明细状态为成功或失败
ekpBankGrantDetailService.updateBatchById(detailDataList);
if (!icbcLogList.isEmpty()) {
ekpBankIcbcLogService.saveBatch(icbcLogList);
}
}
// 获取需要查询结果的非扣税支付任务(发放中的任务)
return R.ok();
}
/**
* 重写获取PDF文件的方法
* 该方法通过SFTP协议从工商银行的服务器下载PDF文件
......@@ -1481,7 +1839,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
/**
* @Description: 获取结果记录入职
* @Description: 获取结果记录日志——工资
* @Author: hgw
* @Date: 2024/11/27 17:36
* @return: void
......@@ -1492,7 +1850,23 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
icbcLog.setFdCreateTime(LocalDateTime.now());
icbcLog.setFdWxNo(fdWxNo);
icbcLog.setFdParentId(fdId);
icbcLog.setFdType(2);
icbcLog.setFdType(CommonConstants.TWO_INT);
icbcLog.setFdLog(JSON.toJSONString(responseV1));
icbcLogList.add(icbcLog);
}
/**
* @Description: 获取结果记录日志——非扣税
* @Author: hgw
* @Date: 2026/2/27 17:36
* @return: void
**/
private void setIcbcLogBaseInfoNoTax(MybankEnterprisePayQpayentResponseV1 responseV1, List<EkpBankIcbcLog> icbcLogList
, String fdWxNo, String fdId) {
EkpBankIcbcLog icbcLog = new EkpBankIcbcLog();
icbcLog.setFdCreateTime(LocalDateTime.now());
icbcLog.setFdWxNo(fdWxNo);
icbcLog.setFdParentId(fdId);
icbcLog.setFdType(CommonConstants.SIX_INT);
icbcLog.setFdLog(JSON.toJSONString(responseV1));
icbcLogList.add(icbcLog);
}
......@@ -1516,18 +1890,34 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
logDetail.setFdRemittancePurpose("工资");
}
private void setLogDetailBaseInfoNoTax(EkpBankGrantLog logs, BigDecimal money, EkpBankGrantLogDetail logDetail
, MybankEnterprisePayQpayentResponseV1.MybankEnterprisePayQpayentResponseRdV1 data) {
logDetail.setFdParentId(logs.getFdId());
logDetail.setFdMoney(money);
if (data != null) {
// 指令状态
logDetail.setFdCommandStatus(NO_TAX_STATUS_MAP.get(data.getResult()));
// 收款账号
logDetail.setFdPayeeAccount(data.getRecAccNo());
logDetail.setFdRemark(data.getSummary());
}
// 汇款用途
logDetail.setFdRemittancePurpose("转账");
}
/**
* @Description: 初始化生成日志主表
* @Author: hgw
* @Date: 2024/11/26 20:09
* @return: com.yifu.cloud.plus.v1.ekp.entity.EkpBankGrantLog
**/
private void saveNewEkpBankGrantLog(JftApiPayrollQueryDetailResponseV1 responseV1, EkpBankResultVo vo
, String parentId, EkpBankGrantLog logs) {
private void saveNewEkpBankGrantLog(String remark, EkpBankResultVo vo
, String parentId, EkpBankGrantLog logs, String title) {
logs.setFdBatchNumber(vo.getFdWxNo());
logs.setFdParentId(parentId);
logs.setFdBatchPackage(responseV1.getRemark());
logs.setFdBusinessType("代发工资");
logs.setFdBatchPackage(remark);
logs.setFdBusinessType(title);
logs.setFdCurrency("人民币");
logs.setFdDrawee(vo.getFdBankName());
logs.setFdPaymentAccount(vo.getFdBankAccount());
......
......@@ -19,7 +19,9 @@ import com.yifu.cloud.plus.v1.ekp.service.EkpBankCodeSetService;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankIcbcLogService;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.ekp.vo.EKPEntryPushParam;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelNoTaxVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo;
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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
......@@ -680,7 +682,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
// 改造自上面的demo接口:executePayment
// type 0 对公; 1 对私.
public R<String> submitIcbcToNoTax(String totalAmt, String totalCount, String wxNo
, List<EkpBankExcelVo> detailList, int type, String fdId) {
, List<EkpBankExcelNoTaxVo> detailList, int type, String fdId) {
// 获取当前时间
LocalTime currentTime = LocalTime.now();
// 使用DateTimeFormatter格式化
......@@ -719,7 +721,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
List<MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2> rd = new ArrayList<>();
MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 rdDetail;
for (EkpBankExcelVo detail : detailList) {
for (EkpBankExcelNoTaxVo detail : detailList) {
// 0 对公
if (CommonConstants.ZERO_INT == type) {
rdDetail = buildPayRecordDuiGong(detail);
......@@ -809,6 +811,29 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
@Override
public MybankEnterprisePayQpayentResponseV1 getResultNoTax(EkpBankResultVo task, String tranDate, String tranTime, String seqNo, DefaultIcbcClient client) {
try {
MybankEnterprisePayQpayentRequestV1.MybankEnterprisePayQpayentRequestBizV1 bizContent =
new MybankEnterprisePayQpayentRequestV1.MybankEnterprisePayQpayentRequestBizV1();
MybankEnterprisePayQpayentRequestV1 request = new MybankEnterprisePayQpayentRequestV1();
bizContent.setTransCode("QHISD");
bizContent.setTranDate(tranDate);
bizContent.setTranTime(tranTime);
bizContent.setLanguage("zh_CN");
bizContent.setfSeqNo(seqNo);
bizContent.setQryfSeqno("null");
//待查平台交易序列号
bizContent.setQrySerialNo(task.getFdAttaSrc());
request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/enterprise/pay/qpayent/V1");
request.setBizContent(bizContent);
return client.execute(request);
} catch (Exception e) {
log.error("工行【非扣税】支付指令查询失败", e);
throw new RuntimeException("【非扣税】支付指令查询失败", e);
}
}
// 对公
private MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 buildPayRecord() {
MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 payRecord =
......@@ -924,7 +949,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
// 对公
private MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 buildPayRecordDuiGong(EkpBankExcelVo detail) {
private MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 buildPayRecordDuiGong(EkpBankExcelNoTaxVo detail) {
MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 payRecord =
new MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2();
......@@ -975,11 +1000,12 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
//用途代码
// payRecord.setPurposeCode(record.getPurposeCode());
//用途中文描述:用途代码和用途中文描述二选一上送
if (Common.isNotNull(detail.getFdRemittancePurpose())) {
if (detail.getFdRemittancePurpose().length()>20) {
detail.setFdRemittancePurpose(detail.getFdRemittancePurpose().substring(0,20));
// 2026-02-27 李连琴要转款备注,若空,要二级分类
if (Common.isNotNull(detail.getFdCoverRemark())) {
if (detail.getFdCoverRemark().length()>20) {
detail.setFdCoverRemark(detail.getFdCoverRemark().substring(0,20));
}
payRecord.setPurpose(detail.getFdRemittancePurpose());
payRecord.setPurpose(detail.getFdCoverRemark());
} else {
payRecord.setPurpose("转账");
}
......@@ -994,7 +1020,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
//相关业务编号
// payRecord.setRelatedRefNo(record.getRelatedRefNo());
//ERP流水号
// payRecord.setErpSerialNo(record.getErpSerialNo());
payRecord.setErpSerialNo(detail.getFdId());
//ERP支票号
// payRecord.setErpCheckNo(record.getErpCheckNo());
//业务代码
......@@ -1012,7 +1038,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return payRecord;
}
private MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 buildPayRecordDuiSi(EkpBankExcelVo detail) {
private MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 buildPayRecordDuiSi(EkpBankExcelNoTaxVo detail) {
MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2 payRecord =
new MybankEnterprisePayPayentRequestV2.MybankEnterprisePayPayentRequestRdV2();
//业务唯一编号:相同指令不重复
......@@ -1055,14 +1081,16 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
//同城异地标志:1:同城;2:异地 非必填
payRecord.setSameCityFlag("");
payRecord.setAmount(Long.valueOf(detail.getFdMoney()));
if (Common.isNotNull(detail.getFdRemittancePurpose())) {
if (detail.getFdRemittancePurpose().length()>20) {
detail.setFdRemittancePurpose(detail.getFdRemittancePurpose().substring(0,20));
// 2026-02-27 李连琴要转款备注,若空,要二级分类
if (Common.isNotNull(detail.getFdCoverRemark())) {
if (detail.getFdCoverRemark().length()>20) {
detail.setFdCoverRemark(detail.getFdCoverRemark().substring(0,20));
}
payRecord.setPurpose(detail.getFdRemittancePurpose());
payRecord.setPurpose(detail.getFdCoverRemark());
} else {
payRecord.setPurpose("转账");
}
payRecord.setErpSerialNo(detail.getFdId());
//摘要
//payRecord.setSummary("12");
return payRecord;
......
......@@ -77,6 +77,32 @@
left join ekp_bank_code_set c on c.fd_payee_account=a.fd_payee_account
where
</sql>
<sql id="Base_No_Tax_Sql">
select
DATE_FORMAT(now(),'%Y%m%d') nowDate,
'2' detailTag,
a.fd_serial_number fdSerialNumber,
'' baoXiaoNumber,
'0' danJuNumber,
m.fd_bank_name fdBankName,
m.fd_bank_no fdBankNo,
m.fd_bank_account fdBankAccount,
ifnull(c.fd_recipient_bank,a.fd_recipient_bank) fdRecipientBank,
'' fdRecipientAdress,
c.fd_recipient_bank_code fdRecipientBankCode,
'2' payType,
a.fd_payee_account fdPayeeAccount,
a.fd_payee_name fdPayeeName,
concat('',round(a.fd_money * 100,0)) fdMoney,
a.fd_remittance_purpose fdRemittancePurpose,
ifnull(a.fd_remark,'转账') fdCoverRemark,
a.fd_emp_phone fdEmpPhone,
a.fd_id fdId
from ekp_bank_grant_detail a
left join ekp_bank_pay_task m on a.fd_parent_id=m.fd_id
left join ekp_bank_code_set c on c.fd_payee_account=a.fd_payee_account
where
</sql>
<!-- 查询待发放条数 -->
<select id="getCountByIdAndMain" resultType="java.lang.Integer">
......@@ -93,6 +119,13 @@
GROUP BY a.fd_id
ORDER BY (a.fd_serial_number-0) asc
</select>
<!-- 查询主表下的所有待发放数据 -->
<select id="getEkpBankExcelVoByIdAndMainNoTax" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelNoTaxVo">
<include refid="Base_No_Tax_Sql"/>
(a.fd_handle_status is null or a.fd_handle_status = '待发放') and a.fd_parent_id = #{fdParentId}
GROUP BY a.fd_id
ORDER BY (a.fd_serial_number-0) asc
</select>
<!-- 查询主表下的所有待发放数据 -->
<select id="getEkpBankExcelVoByIdAndDetail" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelVo">
......@@ -101,6 +134,13 @@
GROUP BY a.fd_id
ORDER BY (a.fd_serial_number-0) asc
</select>
<!-- 查询主表下的所有待发放数据 -->
<select id="getEkpBankExcelVoByIdAndDetailNoTax" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpBankExcelNoTaxVo">
<include refid="Base_No_Tax_Sql"/>
a.fd_handle_status = '待发放' and a.fd_id = #{fdId}
GROUP BY a.fd_id
ORDER BY (a.fd_serial_number-0) asc
</select>
<!-- 查询编号是否重复 -->
<select id="getWxNoByWxNo" resultType="java.lang.String">
......
......@@ -91,9 +91,9 @@
<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
,a.fd_grant_num fdGrantNum
,a.fd_grant_num fdGrantNum,a.fd_atta_src fdAttaSrc
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 = '发放中'
where a.fd_grant_status = '发放中' and a.fd_pay_type = #{typeName}
GROUP BY a.fd_id
</select>
......@@ -101,9 +101,11 @@
<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,d.fd_recipient_bank fdRecipientBank
,d.fd_grant_num fdGrantNum,d.fd_recipient_bank fdRecipientBank,a.fd_atta_src fdAttaSrc,d.fd_money fdMoney
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 = '发放中'
where a.fd_grant_status = '已发放' and d.fd_grant_status = '发放失败' and d.fd_handle_status = '发放中' and a.fd_pay_type = #{typeName}
</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