Commit 0a42447c authored by hongguangwu's avatar hongguangwu

MVP1.7.2 工行3次提交_下载

parent 70f40dba
......@@ -541,6 +541,7 @@ public interface CommonConstants {
public static final String PARAM_INFO_ERROR = "传参有误!";
public static final String XLS = ".xls";
public static final String XLSX = ".xlsx";
public static final String ERROR_IMPORT = "执行异常";
// 权限使用的
......
......@@ -1624,6 +1624,18 @@ public class DateUtil {
return sf.format(new Date());
}
/**
* @Description: 返回当前年月日时分秒字符串(一般用在导出文件名)
* @Description: 不含-
* @Author: hgw
* @Date: 2024-11-20 16:21:45
* @return: java.lang.String
**/
public static String getThisTimeNoLine(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATE_PATTERN);
return sf.format(new Date());
}
/**
* @param
......
......@@ -108,4 +108,21 @@ public class EkpBankAtta {
@ExcelProperty("创建时间")
private LocalDateTime fdCreateTime;
/**
* @Description: 生成mdCode码
* @Author: hgw
* @Date: 2024/11/20 16:07
* @return:
**/
@TableField(exist = false)
private String mdCode;
/**
* @Description: 批次号
* @Author: hgw
* @Date: 2024/11/20 16:07
* @return:
**/
@TableField(exist = false)
private String wxNo;
}
......@@ -209,4 +209,16 @@ public class EkpBankGrantDetail {
@Schema(description = "收款账户短信通知手机号码")
private String fdEmpPhone;
@ExcelAttribute(name = "批次号", maxLength = 36)
@Length(max = 36, message = "批次号不能超过36个字符")
@ExcelProperty("批次号")
@Schema(description = "批次号")
private String fdWxNo;
@ExcelAttribute(name = "MD码", maxLength = 100)
@Length(max = 100, message = "MD码不能超过100个字符")
@ExcelProperty("MD码")
@Schema(description = "MD码")
private String fdMdCode;
}
......@@ -251,4 +251,16 @@ public class EkpBankPayTask {
@Schema(description = "备注信息")
private String fdCoverRemark;
@ExcelAttribute(name = "批次号", maxLength = 36)
@Length(max = 36, message = "批次号不能超过36个字符")
@ExcelProperty("批次号")
@Schema(description = "批次号")
private String fdWxNo;
@ExcelAttribute(name = "MD码", maxLength = 100)
@Length(max = 100, message = "MD码不能超过100个字符")
@ExcelProperty("MD码")
@Schema(description = "MD码")
private String fdMdCode;
}
......@@ -99,6 +99,7 @@
<artifactId>yifu-common-ekp</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
......@@ -107,6 +108,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
......
......@@ -3,14 +3,21 @@ package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankAtta;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowIssueService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo;
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.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 聚富通代发工资相关
......@@ -93,4 +100,11 @@ public class IcbcTransactionFlowIssueController {
return icbcTransactionFlowIssueService.getIssueFileByFdId(fdId, type);
}
@Operation(description = "下载文件测试")
@PostMapping("/exportAll")
@SysLog("下载文件测试")
public void exportAll(HttpServletResponse response) {
icbcTransactionFlowIssueService.exportAll(response);
}
}
......@@ -39,4 +39,6 @@ public interface EkpBankGrantDetailMapper extends BaseMapper<EkpBankGrantDetail>
// 查询详情里的1条数据
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(@Param("fdId") String fdId);
String getWxNoByWxNo(@Param("wxNo") String wxNo);
}
......@@ -35,4 +35,6 @@ public interface EkpBankGrantDetailService extends IService<EkpBankGrantDetail>
List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(String fdId);
String getWxNoByWxNo(String wxNo);
}
......@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 聚富通代发工资相关
......@@ -52,4 +53,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/
R<EkpBankAttaReturnVo> getIssueFileByFdId(String fdId, String type);
void exportAll(HttpServletResponse response);
}
......@@ -46,4 +46,9 @@ public class EkpBankGrantDetailServiceImpl extends ServiceImpl<EkpBankGrantDetai
public List<EkpBankExcelVo> getEkpBankExcelVoByIdAndDetail(String fdId) {
return baseMapper.getEkpBankExcelVoByIdAndDetail(fdId);
}
@Override
public String getWxNoByWxNo(String wxNo) {
return baseMapper.getWxNoByWxNo(wxNo);
}
}
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.icbc.api.DefaultIcbcClient;
......@@ -17,10 +18,7 @@ import com.icbc.api.utils.WebUtils;
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.EkpBankGrantDetailService;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankPayTaskService;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowIssueService;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
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.EkpBankExcelVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -35,15 +33,21 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
/**
......@@ -68,6 +72,8 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired
private EkpBankGrantDetailService ekpBankGrantDetailService;
@Autowired
private EkpBankAttaService ekpBankAttaService;
@Autowired
private OSSUtil ossUtil;
//1、网关公钥
......@@ -111,7 +117,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
//{平台编号}_{企业编号}_{批次号}_{代发方式}_yyyyMMdd .zip 压缩文件中,包含代发工资指令文件信息,为xls格式,xls文件名称同zip包文件名称
bizContent.setLocalFilepath("D:/icbcFile/020101190_WX203_0_20241112.xls");
//文件md码
// TODO-直接取值mdCode
bizContent.setFileMdcode(getMdCode("D:/icbcFile/020101190_WX203_0_20241112.xls"));
//文件类型:1-代发工资 2-报销
bizContent.setFileType("1");
bizContent.setNotifyUrl(null);
......@@ -197,7 +205,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
bizContent.setTranDate(nowDate);
bizContent.setTranTime("103231001");
bizContent.setLanguage("zh_CN");
bizContent.setfSeqNo("AHWX"+ System.currentTimeMillis());
bizContent.setfSeqNo("AHWX" + System.currentTimeMillis());
//银行卡号
bizContent.setCardNo("1302015209250019444");
request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/enterprise/account/querybankinfo/V1");
......@@ -265,7 +273,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
try {
in.close();
} catch (IOException exc) {
;
exc.printStackTrace();
}
}
}
......@@ -318,7 +326,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @throws IOException
*/
private String dencrypt(HttpServletRequest request) throws IOException {
String bizContent = URLDecoder.decode(request.getParameter("biz_content"),"utf-8");
String bizContent = URLDecoder.decode(request.getParameter("biz_content"), "utf-8");
// 解析请求数据map
ObjectMapper mapper = new ObjectMapper();
Map<String, String> transMap = mapper.readValue(bizContent, Map.class);
......@@ -356,7 +364,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
/**
* @param fdId
* @param type 类型 1:主表附件;2:明细表附件
* @Description:
* @Description: 下载文件主入口
* @Author: hgw
* @Date: 2024/11/18 9:27
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.entity.EkpBankAtta>
......@@ -369,19 +377,114 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
EkpBankAttaReturnVo vo = new EkpBankAttaReturnVo();
List<EkpBankExcelVo> list;
// 主表整体下载
// 1主表整体下载
if (CommonConstants.ONE_STRING.equals(type)) {
EkpBankPayTask main = ekpBankPayTaskService.getById(fdId);
URL url;
R<EkpBankCodeSet> bankInfoQuery;
EkpBankCodeSet codeSet;
if (main == null) {
return R.failed("未找到表数据!");
} else if (Common.isNotNull(main.getFdDownloadNum()) && Common.isNotNull(main.getFdFailNum())
&& (CommonConstants.ZERO_INT == main.getFdDownloadNum() || main.getFdDownloadNum().equals(main.getFdFailNum()))) {
// 新下载
list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMain(fdId);
return getNewFileByMain(fdId, type, vo, list, main);
} else if (Common.isNotNull(main.getFdAttaSrc())) {
// 取URL数据返回
return getOldAttaUrl(vo, main.getFdAttaSrc(), main.getFdAttaName());
}
} else if (CommonConstants.TWO_STRING.equals(type)) {
// 2明细表
EkpBankGrantDetail detail = ekpBankGrantDetailService.getById(fdId);
if (detail == null) {
return R.failed("未找到表数据!");
} else if (Common.isNotNull(detail.getFdDownloadNum()) && Common.isNotNull(detail.getFdFailNum())
&& (CommonConstants.ZERO_INT == detail.getFdDownloadNum() || detail.getFdDownloadNum().equals(detail.getFdFailNum()))) {
// 新下载
list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetail(fdId);
return getNewFileByDetail(fdId, type, vo, list, detail);
} else if (Common.isNotNull(detail.getFdAttaSrc())) {
// 取URL数据返回
return getOldAttaUrl(vo, detail.getFdAttaSrc(), detail.getFdAttaName());
}
}
return R.failed("请处理表数据的下载次数与失败次数,fdId=" + fdId + ";type=" + type);
} else {
return R.failed("ID、类型不可为空");
}
}
/**
* @Description: 直接下载
* @Author: hgw
* @Date: 2024/11/20 17:17
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.ekp.vo.EkpBankAttaReturnVo>
**/
private R<EkpBankAttaReturnVo> getOldAttaUrl(EkpBankAttaReturnVo vo, String srcStr, String attaName) {
URL url = ossUtil.getObjectUrl(null, srcStr);
vo.setFdAttaUrl(url.toString());
vo.setFdAttaName(attaName);
return R.ok(vo);
}
/**
* @param fdId 主键
* @param type 类型,1主表2明细表
* @param vo 返回EKP的Vo
* @param list 数据主体
* @param main 主表
* @Description: 保存主表
* @Author: hgw
* @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>
**/
private R<EkpBankAttaReturnVo> getNewFileByMain(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list, EkpBankPayTask main) {
if (list != null && !list.isEmpty()) {
EkpBankAtta atta = getNewFileCore(fdId, type, vo, list);
if (atta != null) {
main.setFdAttaName(atta.getFdAttaName());
main.setFdAttaSrc(atta.getFdAttaSrc());
main.setFdAttaId(atta.getFdId());
main.setFdDownloadNum(main.getFdDownloadNum() + 1);
main.setFdWxNo(atta.getWxNo());
main.setFdMdCode(atta.getMdCode());
ekpBankPayTaskService.updateById(main);
return R.ok(vo);
}
}
return R.failed("下载失败!");
}
/**
* @param fdId 主键
* @param type 类型,1主表2明细表
* @param vo 返回EKP的Vo
* @param list 数据主体
* @param main 主表
* @Description: 保存明细表
* @Author: hgw
* @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>
**/
private R<EkpBankAttaReturnVo> getNewFileByDetail(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list, EkpBankGrantDetail main) {
if (list != null && !list.isEmpty()) {
EkpBankAtta atta = getNewFileCore(fdId, type, vo, list);
if (atta != null) {
main.setFdAttaName(atta.getFdAttaName());
main.setFdAttaSrc(atta.getFdAttaSrc());
main.setFdAttaId(atta.getFdId());
main.setFdDownloadNum(main.getFdDownloadNum() + 1);
main.setFdWxNo(atta.getWxNo());
main.setFdMdCode(atta.getMdCode());
ekpBankGrantDetailService.updateById(main);
return R.ok(vo);
}
}
return R.failed("下载失败!");
}
private EkpBankAtta getNewFileCore(String fdId, String type, EkpBankAttaReturnVo vo, List<EkpBankExcelVo> list) {
EkpBankCodeSet codeSet;
R<EkpBankCodeSet> bankInfoQuery;
// 组装
for (EkpBankExcelVo excelVo : list) {
if (Common.isEmpty(excelVo.getFdRecipientBankCode())) {
......@@ -394,40 +497,121 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
}
String batchNo = "WX" + DateUtil.getThisTimeNoLine() + "000" + new Date().getTime();
String cur = ekpBankGrantDetailService.getWxNoByWxNo(batchNo);
if (Common.isNotNull(cur)) {
batchNo = "WXCUR" + DateUtil.getThisTimeNoLine() + "000" + new Date().getTime();
}
// 组装、上传文件
return getEkpBankAttaVo(batchNo, vo, fdId, Integer.parseInt(type), list);
}
url = ossUtil.getObjectUrl(null, main.getFdAttaSrc());
vo.setFdAttaUrl(url.toString());
vo.setFdAttaName(main.getFdAttaName());
main.setFdDownloadNum(main.getFdDownloadNum() + 1);
return R.ok(vo);
} else if (Common.isNotNull(main.getFdAttaSrc())) {
// 取URL数据返回
url = ossUtil.getObjectUrl(null, main.getFdAttaSrc());
vo.setFdAttaUrl(url.toString());
vo.setFdAttaName(main.getFdAttaName());
return R.ok(vo);
}
} else if (CommonConstants.TWO_STRING.equals(type)) {
list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndDetail(fdId);
/**
* @param batchNo 批次号
* @param returnVo 返回EKP的Vo
* @param linkId 附件关联的id
* @param linkType 类型,1银企付款主表,2银企付款详情表
* @param accountList 数据list
* @Description: 生成文件,保存附件等
* @Author: hgw
* @Date: 2024/11/20 17:05
* @return: com.yifu.cloud.plus.v1.ekp.entity.EkpBankAtta
**/
private <T> EkpBankAtta getEkpBankAttaVo(String batchNo, EkpBankAttaReturnVo returnVo, String linkId, Integer linkType, List<T> accountList) {
// TODO -明细表下载
/*list = ekpBankGrantDetailService.list(Wrappers.<EkpBankGrantDetail>query().lambda()
.eq(EkpBankGrantDetail::getFdId, fdId));*/
//客户本地文件路径 {企业编号}_{批次号}_{代发方式}_yyyyMMdd.xls 拼接起来总长不能超过36位
//bizContent.setLocalFilepath("D:/icbcFile/020101190_WX203_0_20241112.xls")
InputStream templateIs = this.getClass().getResourceAsStream("/template/ekpBankTemplat.xls");
String filePath = "ekpBankDownFile";
String fileName = "020101190_" + batchNo + "_0_" + DateUtil.getThisDay() + CommonConstants.XLS;
String key = filePath + "/" + fileName;
EasyExcelFactory.write(filePath).withTemplate(templateIs).excelType(ExcelTypeEnum.XLS)
.sheet("模板") // 根据需要选择或指定sheet名称
.doWrite(accountList);
//EasyExcelFactory.write(filePath, tClass).sheet(preFileName + "报表生成").doWrite(accountList)
File file = new File(filePath);
try (InputStream inputStream = new FileInputStream(file)) {
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key, null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
EkpBankAtta atta = new EkpBankAtta();
atta.setFdAttaName(fileName);
atta.setFdAttaSrc(key);
atta.setFdAttaSize(file.length());
atta.setFdCreateTime(LocalDateTime.now());
atta.setFdLinkId(linkId);
atta.setFdLinkType(linkType);
atta.setMdCode(getMdCode(filePath));
atta.setWxNo(batchNo);
ekpBankAttaService.save(atta);
URL url = ossUtil.getObjectUrl(null, key);
returnVo.setFdAttaUrl(url.toString());
returnVo.setFdAttaName(fileName);
return atta;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
try {
if (Common.isNotNull(file)) {
org.apache.commons.io.FileUtils.forceDelete(file);
}
if (null != templateIs) {
templateIs.close();
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
return R.failed("ID、类型不可为空");
}
// 最后去掉这个保证程序正确返回
return null;
}
@Override
public void exportAll(HttpServletResponse response) {
List<EkpBankExcelVo> list = ekpBankGrantDetailService.getEkpBankExcelVoByIdAndMain("1");
ServletOutputStream out = null;
InputStream templateIs = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
String batchNo = "WX203";
String fileName = "020101190_" + batchNo + "_0_" + DateUtil.getThisDay() + CommonConstants.XLS;
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
templateIs = this.getClass().getResourceAsStream("/template/ekpBankTemplat.xls");
EasyExcelFactory.write(out).withTemplate(templateIs).excelType(ExcelTypeEnum.XLS)
.sheet("Sheet1") // 根据需要选择或指定sheet名称
//.doFill(accountList, fillConfig)
.doWrite(list);
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
if (null != templateIs) {
templateIs.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
......@@ -340,17 +340,12 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
**/
@Override
public R<EkpBankCodeSet> querybankinfo(String cardNo) {
// 先查询记录表
EkpBankCodeSet codeSet = ekpBankCodeSetService.getCodeSetByCardNo(cardNo);
if (codeSet != null && Common.isNotNull(codeSet.getFdRecipientBankCode())) {
return R.ok(codeSet);
}
String privateKey = "4d931f6ad4331158fcc4dea23f0d71393328146e40b5f63f197b9f6ad3732f44";
String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+G1DVAmQnIpiPEFAEDqRfNGAVvvH35yDetqewKi0l7OEceTMN1C6NPym3zStvSoQayjYV+eIcZERkx31KhtFu9clZKgRTyPjdKMIth/wBtPKjL/5+PYalLdomM4ONthrPgnkN4x4R0+D4+EBpXo8gNiAFsNwIDAQAB";
// DefaultIcbcClient client = new DefaultIcbcClient("11000000000000019038", IcbcConstants.SIGN_TYPE_CA_SM_ICBC,privateKey, APIGW_PUBLIC_KEY);
// DefaultIcbcClient client = new DefaultIcbcClient("11000000000000019038", IcbcConstants.SIGN_TYPE_CA_SM_ICBC,privateKey, APIGW_PUBLIC_KEY)
DefaultIcbcClient client = new DefaultIcbcClient("11000000000000019038", IcbcConstants.SIGN_TYPE_CA_SM_ICBC, privateKey,
IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, null,
null, null, icbcConfigProperties.getCaSm(), null);
......@@ -376,7 +371,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
response = client.execute(request);
if (response.isSuccess()) {
// 业务成功处理-存储起来
codeSet = new EkpBankCodeSet();
EkpBankCodeSet codeSet = new EkpBankCodeSet();
codeSet.setFdCreateTime(LocalDateTime.now());
codeSet.setFdRecipientBankCode(response.getBankCode());
codeSet.setFdPayeeAccount(cardNo);
......
......@@ -44,6 +44,11 @@
<result property="fdDownloadNum" column="fd_download_num"/>
<result property="fdFailNum" column="fd_fail_num"/>
<result property="fdGrantNum" column="fd_grant_num"/>
<result property="fdParentId" column="fd_parent_id"/>
<result property="fdEmpPhone" column="fd_emp_phone"/>
<result property="fdWxNo" column="fd_wx_no"/>
<result property="fdMdCode" column="fd_md_dcode"/>
</resultMap>
<sql id="Base_Excel_Sql">
......@@ -56,18 +61,19 @@
m.fd_bank_name fdBankName,
m.fd_bank_no fdBankNo,
m.fd_bank_account fdBankAccount,
a.fd_recipient_bank fdRecipientBank,
ifnull(c.fd_recipient_bank,a.fd_recipient_bank) fdRecipientBank,
'' fdRecipientAdress,
'' fdRecipientBankCode,
c.fd_recipient_bank_code fdRecipientBankCode,
'1' payType,
a.fd_payee_account fdPayeeAccount,
a.fd_payee_name fdPayeeName,
a.fd_money fdMoney,
concat('',round(a.fd_money * 100,0)) fdMoney,
a.fd_remittance_purpose fdRemittancePurpose,
m.fd_cover_remark fdCoverRemark,
a.fd_emp_phone fdEmpPhone
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 a.fd_handle_status = '待发放'
</sql>
......@@ -83,4 +89,13 @@
and a.fd_id = #{fdId}
</select>
<!-- 查询编号是否重复 -->
<select id="getWxNoByWxNo" resultType="java.lang.String">
select a.fd_wx_no from (
select a.fd_wx_no from ekp_bank_grant_detail a where a.fd_wx_no = #{wxNo}
union all
select a.fd_wx_no from ekp_bank_pay_task a where a.fd_wx_no = #{wxNo}
) a limit 1
</select>
</mapper>
......@@ -50,6 +50,10 @@
<result property="fdDownloadNum" column="fd_download_num"/>
<result property="fdFailNum" column="fd_fail_num"/>
<result property="fdGrantNum" column="fd_grant_num"/>
<result property="fdCoverRemark" column="fd_cover_remark"/>
<result property="fdWxNo" column="fd_wx_no"/>
<result property="fdMdCode" column="fd_md_dcode"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
......@@ -77,7 +81,10 @@
a.fd_atta_src,
a.fd_download_num,
a.fd_fail_num,
a.fd_grant_num
a.fd_grant_num,
a.fd_cover_remark,
a.fd_wx_no,
a.fd_md_dcode
</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