| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.cwgl.domain.FundFlow; |
| | | import com.ruoyi.cwgl.service.IFundFlowService; |
| | | import com.ruoyi.cwgl.service.ICmbsBankSyncService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | |
| | | @Autowired |
| | | private IFundFlowService fundFlowService; |
| | | |
| | | @Autowired |
| | | private ICmbsBankSyncService cmbsBankSyncService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 从CMBS同步银行流水到资金流水表 |
| | | * |
| | | * @param acctNum 账号 |
| | | * @param startDate 开始日期 yyyy-MM-dd |
| | | * @param endDate 结束日期 yyyy-MM-dd |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:fundFlow:sync')") |
| | | @Log(title = "CMBS银行流水同步", businessType = BusinessType.OTHER) |
| | | @PostMapping("/syncFromCmbs") |
| | | public AjaxResult syncFromCmbs(String acctNum, String startDate, String endDate) |
| | | { |
| | | try { |
| | | String result = cmbsBankSyncService.syncFromCmbs(acctNum, startDate, endDate); |
| | | return AjaxResult.success(result); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("同步失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 查询资金流水列表 |
| | | */ |
| | |
| | | |
| | | |
| | | /** 本方账号 */ |
| | | @Excel(name = "本方账号") |
| | | @Excel(name = "本方账户") |
| | | |
| | | @TableField("our_account") |
| | | private String ourAccount; |
| | |
| | | |
| | | |
| | | /** 收支标识借贷标志 0-收 1-支 */ |
| | | @Excel(name = "收支标识", readConverterExp = "0=应收,1=应付") |
| | | // @Excel(name = "收支标识", readConverterExp = "0=应收,1=应付") |
| | | |
| | | @TableField("income_expense_flag") |
| | | private Integer incomeExpenseFlag; |
| | |
| | | @TableField("bill_type") |
| | | private Integer billType; |
| | | |
| | | |
| | | /** 交易账户子账户序号 */ |
| | | @Excel(name = "交易账户子账户序号") |
| | | |
| | | @TableField("sub_account_no") |
| | | private String subAccountNo; |
| | | |
| | | |
| | | /** 交易对手行 */ |
| | | @Excel(name = "交易对手行") |
| | | |
| | | @TableField("counterparty_bank") |
| | | private String counterpartyBank; |
| | | |
| | | |
| | | /** 账户余额 */ |
| | | @Excel(name = "账户余额") |
| | | |
| | | @TableField("account_balance") |
| | | private BigDecimal accountBalance; |
| | | |
| | | |
| | | /** 交易渠道 */ |
| | | @Excel(name = "交易渠道") |
| | | |
| | | @TableField("transaction_channel") |
| | | private String transactionChannel; |
| | | |
| | | |
| | | /** 银行主键URID */ |
| | | @Excel(name = "银行主键") |
| | | |
| | | @TableField("urid") |
| | | private String urid; |
| | | |
| | | |
| | | /** 企业编号 */ |
| | | @Excel(name = "企业编号") |
| | | |
| | | @TableField("org_no") |
| | | private String orgNo; |
| | | |
| | | |
| | | /** 本方户名 */ |
| | | @Excel(name = "本方户名") |
| | | |
| | | @TableField("payer_acct_name") |
| | | private String payerAcctName; |
| | | |
| | | |
| | | /** 起息日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "起息日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | | |
| | | @TableField("value_date") |
| | | private Date valueDate; |
| | | |
| | | |
| | | /** 款项性质 */ |
| | | @Excel(name = "款项性质") |
| | | |
| | | @TableField("nature_names") |
| | | private String natureNames; |
| | | |
| | | |
| | | /** 记账日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "记账日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | | |
| | | @TableField("postdate") |
| | | private Date postdate; |
| | | |
| | | |
| | | /** 是否退汇:1-是 0-否 */ |
| | | @Excel(name = "是否退汇") |
| | | |
| | | @TableField("is_return") |
| | | private String isReturn; |
| | | |
| | | |
| | | /** 第三方流水号 */ |
| | | @Excel(name = "第三方流水号") |
| | | |
| | | @TableField("customized_serial_num") |
| | | private String customizedSerialNum; |
| | | |
| | | |
| | | /** 单据唯一标识号 */ |
| | | @Excel(name = "单据唯一标识号") |
| | | |
| | | @TableField("src_note_code") |
| | | private String srcNoteCode; |
| | | |
| | | |
| | | /** 币种编号 */ |
| | | @Excel(name = "币种编号") |
| | | |
| | | @TableField("curr_no") |
| | | private String currNo; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.domain; |
| | | |
| | | /** |
| | | * CMBS_Q7517 银行账户交易明细查询 - 请求参数 |
| | | */ |
| | | public class Q7517Request { |
| | | |
| | | /** 企业编号(可选) */ |
| | | private String orgNo; |
| | | |
| | | /** 账号(必填) */ |
| | | private String acctNum; |
| | | |
| | | /** 交易方向(可选):1-支出 2-收入,不传默认查所有 */ |
| | | private String moneyWay; |
| | | |
| | | /** 交易日期开始(必填),格式:yyyy-MM-dd */ |
| | | private String tradeStartDate; |
| | | |
| | | /** 交易日期结束(必填),格式:yyyy-MM-dd */ |
| | | private String tradeEndDate; |
| | | |
| | | /** 查询页码(可选),默认值 1 */ |
| | | private Integer currentPage; |
| | | |
| | | /** 每页条数(可选),默认值 15,最大值 100 */ |
| | | private Integer pageSize; |
| | | |
| | | public String getOrgNo() { |
| | | return orgNo; |
| | | } |
| | | |
| | | public void setOrgNo(String orgNo) { |
| | | this.orgNo = orgNo; |
| | | } |
| | | |
| | | public String getAcctNum() { |
| | | return acctNum; |
| | | } |
| | | |
| | | public void setAcctNum(String acctNum) { |
| | | this.acctNum = acctNum; |
| | | } |
| | | |
| | | public String getMoneyWay() { |
| | | return moneyWay; |
| | | } |
| | | |
| | | public void setMoneyWay(String moneyWay) { |
| | | this.moneyWay = moneyWay; |
| | | } |
| | | |
| | | public String getTradeStartDate() { |
| | | return tradeStartDate; |
| | | } |
| | | |
| | | public void setTradeStartDate(String tradeStartDate) { |
| | | this.tradeStartDate = tradeStartDate; |
| | | } |
| | | |
| | | public String getTradeEndDate() { |
| | | return tradeEndDate; |
| | | } |
| | | |
| | | public void setTradeEndDate(String tradeEndDate) { |
| | | this.tradeEndDate = tradeEndDate; |
| | | } |
| | | |
| | | public Integer getCurrentPage() { |
| | | return currentPage; |
| | | } |
| | | |
| | | public void setCurrentPage(Integer currentPage) { |
| | | this.currentPage = currentPage; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.domain; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * CMBS_Q7517 银行账户交易明细查询 - 响应数据 |
| | | */ |
| | | public class Q7517Response { |
| | | |
| | | /** 汇总金额 */ |
| | | private Number totalAmount; |
| | | |
| | | /** 当前页查询笔数 */ |
| | | private Number pageSize; |
| | | |
| | | /** 查询页码 */ |
| | | private Number currentPage; |
| | | |
| | | /** 查询总笔数 */ |
| | | private Number totalNum; |
| | | |
| | | /** 明细列表 */ |
| | | private List<BatchInfo> batchInfo; |
| | | |
| | | public Number getTotalAmount() { |
| | | return totalAmount; |
| | | } |
| | | |
| | | public void setTotalAmount(Number totalAmount) { |
| | | this.totalAmount = totalAmount; |
| | | } |
| | | |
| | | public Number getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Number pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public Number getCurrentPage() { |
| | | return currentPage; |
| | | } |
| | | |
| | | public void setCurrentPage(Number currentPage) { |
| | | this.currentPage = currentPage; |
| | | } |
| | | |
| | | public Number getTotalNum() { |
| | | return totalNum; |
| | | } |
| | | |
| | | public void setTotalNum(Number totalNum) { |
| | | this.totalNum = totalNum; |
| | | } |
| | | |
| | | public List<BatchInfo> getBatchInfo() { |
| | | return batchInfo; |
| | | } |
| | | |
| | | public void setBatchInfo(List<BatchInfo> batchInfo) { |
| | | this.batchInfo = batchInfo; |
| | | } |
| | | |
| | | public static class BatchInfo { |
| | | |
| | | /** 主键(可作为银行流水唯一校验参数) */ |
| | | private String urid; |
| | | |
| | | /** 企业编号 */ |
| | | private String orgNo; |
| | | |
| | | /** 我方账号 */ |
| | | private String payerAcctNo; |
| | | |
| | | /** 户名 */ |
| | | private String payerAcctName; |
| | | |
| | | /** 交易日期,格式:yyyy-MM-dd */ |
| | | private String tradeDate; |
| | | |
| | | /** 交易时间,格式:yyyy-MM-dd HH:mm:ss */ |
| | | private String tradeTime; |
| | | |
| | | /** 起息日期 */ |
| | | private String valueDate; |
| | | |
| | | /** 交易方向:1-支出 2-收入 */ |
| | | private String moneyWay; |
| | | |
| | | /** 金额 */ |
| | | private Number transAmount; |
| | | |
| | | /** 交易后余额 */ |
| | | private Number currentBalance; |
| | | |
| | | /** 用途 */ |
| | | private String purpose; |
| | | |
| | | /** 摘要 */ |
| | | private String memo; |
| | | |
| | | /** 对方账号 */ |
| | | private String payeeAcctNo; |
| | | |
| | | /** 对方户名 */ |
| | | private String payeeAcctName; |
| | | |
| | | /** 对方银行 */ |
| | | private String payeeBankNo; |
| | | |
| | | /** 银行流水号 */ |
| | | private String bankSerialNumber; |
| | | |
| | | /** 单据唯一标识号 */ |
| | | private String srcNoteCode; |
| | | |
| | | /** 款项性质 */ |
| | | private String natureNames; |
| | | |
| | | /** 币种编号 */ |
| | | private String currNo; |
| | | |
| | | /** 币种 */ |
| | | private String currName; |
| | | |
| | | /** 记账日期 */ |
| | | private String postdate; |
| | | |
| | | /** 是否退汇:1-是 0-否 */ |
| | | private String isReturn; |
| | | |
| | | /** 第三方流水号 */ |
| | | private String customizedSerialNum; |
| | | |
| | | public String getUrid() { |
| | | return urid; |
| | | } |
| | | |
| | | public void setUrid(String urid) { |
| | | this.urid = urid; |
| | | } |
| | | |
| | | public String getOrgNo() { |
| | | return orgNo; |
| | | } |
| | | |
| | | public void setOrgNo(String orgNo) { |
| | | this.orgNo = orgNo; |
| | | } |
| | | |
| | | public String getPayerAcctNo() { |
| | | return payerAcctNo; |
| | | } |
| | | |
| | | public void setPayerAcctNo(String payerAcctNo) { |
| | | this.payerAcctNo = payerAcctNo; |
| | | } |
| | | |
| | | public String getPayerAcctName() { |
| | | return payerAcctName; |
| | | } |
| | | |
| | | public void setPayerAcctName(String payerAcctName) { |
| | | this.payerAcctName = payerAcctName; |
| | | } |
| | | |
| | | public String getTradeDate() { |
| | | return tradeDate; |
| | | } |
| | | |
| | | public void setTradeDate(String tradeDate) { |
| | | this.tradeDate = tradeDate; |
| | | } |
| | | |
| | | public String getTradeTime() { |
| | | return tradeTime; |
| | | } |
| | | |
| | | public void setTradeTime(String tradeTime) { |
| | | this.tradeTime = tradeTime; |
| | | } |
| | | |
| | | public String getValueDate() { |
| | | return valueDate; |
| | | } |
| | | |
| | | public void setValueDate(String valueDate) { |
| | | this.valueDate = valueDate; |
| | | } |
| | | |
| | | public String getMoneyWay() { |
| | | return moneyWay; |
| | | } |
| | | |
| | | public void setMoneyWay(String moneyWay) { |
| | | this.moneyWay = moneyWay; |
| | | } |
| | | |
| | | public Number getTransAmount() { |
| | | return transAmount; |
| | | } |
| | | |
| | | public void setTransAmount(Number transAmount) { |
| | | this.transAmount = transAmount; |
| | | } |
| | | |
| | | public Number getCurrentBalance() { |
| | | return currentBalance; |
| | | } |
| | | |
| | | public void setCurrentBalance(Number currentBalance) { |
| | | this.currentBalance = currentBalance; |
| | | } |
| | | |
| | | public String getPurpose() { |
| | | return purpose; |
| | | } |
| | | |
| | | public void setPurpose(String purpose) { |
| | | this.purpose = purpose; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public String getPayeeAcctNo() { |
| | | return payeeAcctNo; |
| | | } |
| | | |
| | | public void setPayeeAcctNo(String payeeAcctNo) { |
| | | this.payeeAcctNo = payeeAcctNo; |
| | | } |
| | | |
| | | public String getPayeeAcctName() { |
| | | return payeeAcctName; |
| | | } |
| | | |
| | | public void setPayeeAcctName(String payeeAcctName) { |
| | | this.payeeAcctName = payeeAcctName; |
| | | } |
| | | |
| | | public String getPayeeBankNo() { |
| | | return payeeBankNo; |
| | | } |
| | | |
| | | public void setPayeeBankNo(String payeeBankNo) { |
| | | this.payeeBankNo = payeeBankNo; |
| | | } |
| | | |
| | | public String getBankSerialNumber() { |
| | | return bankSerialNumber; |
| | | } |
| | | |
| | | public void setBankSerialNumber(String bankSerialNumber) { |
| | | this.bankSerialNumber = bankSerialNumber; |
| | | } |
| | | |
| | | public String getSrcNoteCode() { |
| | | return srcNoteCode; |
| | | } |
| | | |
| | | public void setSrcNoteCode(String srcNoteCode) { |
| | | this.srcNoteCode = srcNoteCode; |
| | | } |
| | | |
| | | public String getNatureNames() { |
| | | return natureNames; |
| | | } |
| | | |
| | | public void setNatureNames(String natureNames) { |
| | | this.natureNames = natureNames; |
| | | } |
| | | |
| | | public String getCurrNo() { |
| | | return currNo; |
| | | } |
| | | |
| | | public void setCurrNo(String currNo) { |
| | | this.currNo = currNo; |
| | | } |
| | | |
| | | public String getCurrName() { |
| | | return currName; |
| | | } |
| | | |
| | | public void setCurrName(String currName) { |
| | | this.currName = currName; |
| | | } |
| | | |
| | | public String getPostdate() { |
| | | return postdate; |
| | | } |
| | | |
| | | public void setPostdate(String postdate) { |
| | | this.postdate = postdate; |
| | | } |
| | | |
| | | public String getIsReturn() { |
| | | return isReturn; |
| | | } |
| | | |
| | | public void setIsReturn(String isReturn) { |
| | | this.isReturn = isReturn; |
| | | } |
| | | |
| | | public String getCustomizedSerialNum() { |
| | | return customizedSerialNum; |
| | | } |
| | | |
| | | public void setCustomizedSerialNum(String customizedSerialNum) { |
| | | this.customizedSerialNum = customizedSerialNum; |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return 资金流水 |
| | | */ |
| | | public FundFlow selectFundFlowByBankFlowNo(String bankFlowNo); |
| | | |
| | | /** |
| | | * 根据银行主键URID查询资金流水 |
| | | * |
| | | * @param urid 银行主键URID |
| | | * @return 资金流水 |
| | | */ |
| | | public FundFlow selectFundFlowByUrid(String urid); |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.service; |
| | | |
| | | /** |
| | | * CMBS银行流水同步Service接口 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2026-04-15 |
| | | */ |
| | | public interface ICmbsBankSyncService { |
| | | |
| | | /** |
| | | * 从CMBS同步指定账号的交易明细到资金流水表 |
| | | * |
| | | * @param acctNum 账号 |
| | | * @param startDate 开始日期 yyyy-MM-dd |
| | | * @param endDate 结束日期 yyyy-MM-dd |
| | | * @return 同步结果信息 |
| | | */ |
| | | String syncFromCmbs(String acctNum, String startDate, String endDate); |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.service.impl; |
| | | |
| | | import com.cmbs.client.header.ClientConfig; |
| | | import com.cmbs.client.util.OutBoundServiceUtils; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.cwgl.domain.FundFlow; |
| | | import com.ruoyi.cwgl.mapper.FundFlowMapper; |
| | | import com.ruoyi.cwgl.service.ICmbsBankSyncService; |
| | | import com.ruoyi.cwgl.test.GatewayConfigUtils; |
| | | import com.ruoyi.cwgl.domain.Q7517Request; |
| | | import com.ruoyi.cwgl.domain.Q7517Response; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * CMBS银行流水同步Service业务层处理 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2026-04-15 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class CmbsBankSyncServiceImpl implements ICmbsBankSyncService { |
| | | |
| | | protected final Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | @Resource |
| | | private FundFlowMapper fundFlowMapper; |
| | | |
| | | @Override |
| | | public String syncFromCmbs(String acctNum, String startDate, String endDate) { |
| | | if (acctNum == null || acctNum.trim().isEmpty()) { |
| | | throw new RuntimeException("账号不能为空"); |
| | | } |
| | | if (startDate == null || endDate == null) { |
| | | throw new RuntimeException("日期范围不能为空"); |
| | | } |
| | | |
| | | ClientConfig clientConfig = GatewayConfigUtils.getClientConfig(); |
| | | Gson gson = new Gson(); |
| | | int totalSynced = 0; |
| | | int totalSkipped = 0; |
| | | int currentPage = 1; |
| | | int pageSize = 100; |
| | | |
| | | try { |
| | | while (true) { |
| | | // 构建请求参数 |
| | | Q7517Request request = new Q7517Request(); |
| | | request.setAcctNum(acctNum); |
| | | request.setTradeStartDate(startDate); |
| | | request.setTradeEndDate(endDate); |
| | | request.setCurrentPage(currentPage); |
| | | request.setPageSize(pageSize); |
| | | |
| | | String queryBody = gson.toJson(request); |
| | | String reqSeq = generateReqSeq(); |
| | | |
| | | String response = OutBoundServiceUtils.execute(clientConfig, queryBody, |
| | | "", "CMBS_Q7517", reqSeq); |
| | | logger.info("CMBS Q7517 响应 [页{}]: {}", currentPage, response); |
| | | |
| | | Q7517Response resp = gson.fromJson(response, Q7517Response.class); |
| | | if (resp == null || resp.getBatchInfo() == null || resp.getBatchInfo().isEmpty()) { |
| | | break; |
| | | } |
| | | |
| | | List<Q7517Response.BatchInfo> batchInfoList = resp.getBatchInfo(); |
| | | List<FundFlow> toInsert = new ArrayList<>(); |
| | | |
| | | for (Q7517Response.BatchInfo info : batchInfoList) { |
| | | // 按URID去重 |
| | | if (info.getUrid() != null && !info.getUrid().isEmpty()) { |
| | | FundFlow existing = fundFlowMapper.selectFundFlowByUrid(info.getUrid()); |
| | | if (existing != null) { |
| | | totalSkipped++; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | FundFlow fundFlow = convertToFundFlow(info, acctNum); |
| | | toInsert.add(fundFlow); |
| | | } |
| | | |
| | | if (!toInsert.isEmpty()) { |
| | | fundFlowMapper.insertFundFlowBatch(toInsert); |
| | | totalSynced += toInsert.size(); |
| | | } |
| | | |
| | | // 判断是否还有下一页 |
| | | Number totalNum = resp.getTotalNum(); |
| | | if (totalNum != null && currentPage * pageSize >= totalNum.intValue()) { |
| | | break; |
| | | } |
| | | currentPage++; |
| | | } |
| | | |
| | | return String.format("同步完成:新增 %d 条,跳过(已存在) %d 条", totalSynced, totalSkipped); |
| | | } catch (Exception e) { |
| | | logger.error("CMBS银行流水同步失败", e); |
| | | throw new RuntimeException("CMBS银行流水同步失败: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将 Q7517 响应数据转换为 FundFlow 实体 |
| | | */ |
| | | private FundFlow convertToFundFlow(Q7517Response.BatchInfo info, String acctNum) { |
| | | FundFlow fundFlow = new FundFlow(); |
| | | |
| | | // 银行主键 |
| | | fundFlow.setUrid(info.getUrid()); |
| | | // 企业编号 |
| | | fundFlow.setOrgNo(info.getOrgNo()); |
| | | // 银行流水号 |
| | | fundFlow.setBankFlowNo(info.getBankSerialNumber()); |
| | | // 本方账号 |
| | | fundFlow.setOurAccount(info.getPayerAcctNo()); |
| | | // 本方户名 |
| | | fundFlow.setPayerAcctName(info.getPayerAcctName()); |
| | | // 对方账号 |
| | | fundFlow.setCounterpartyAccount(info.getPayeeAcctNo()); |
| | | // 对方户名 |
| | | fundFlow.setCounterpartyName(info.getPayeeAcctName()); |
| | | // 对方银行 |
| | | fundFlow.setCounterpartyBank(info.getPayeeBankNo()); |
| | | // 交易金额 |
| | | if (info.getTransAmount() != null) { |
| | | fundFlow.setTransactionAmount(new BigDecimal(info.getTransAmount().toString())); |
| | | } |
| | | // 账户余额 |
| | | if (info.getCurrentBalance() != null) { |
| | | fundFlow.setAccountBalance(new BigDecimal(info.getCurrentBalance().toString())); |
| | | } |
| | | // 交易币种 |
| | | fundFlow.setCurrency(info.getCurrName()); |
| | | // 币种编号 |
| | | fundFlow.setCurrNo(info.getCurrNo()); |
| | | // 用途 |
| | | fundFlow.setPurpose(info.getPurpose()); |
| | | // 摘要 |
| | | fundFlow.setSummary(info.getMemo()); |
| | | // 款项性质 |
| | | fundFlow.setNatureNames(info.getNatureNames()); |
| | | // 单据唯一标识号 |
| | | fundFlow.setSrcNoteCode(info.getSrcNoteCode()); |
| | | // 是否退汇 |
| | | fundFlow.setIsReturn(info.getIsReturn()); |
| | | // 第三方流水号 |
| | | fundFlow.setCustomizedSerialNum(info.getCustomizedSerialNum()); |
| | | |
| | | // 交易方向转换:Q7517(1-支出 2-收入) → FundFlow(1-支 0-收) |
| | | if ("1".equals(info.getMoneyWay())) { |
| | | fundFlow.setIncomeExpenseFlag(1); |
| | | } else if ("2".equals(info.getMoneyWay())) { |
| | | fundFlow.setIncomeExpenseFlag(0); |
| | | } |
| | | |
| | | // 交易日期:合并 tradeDate + tradeTime |
| | | try { |
| | | if (info.getTradeTime() != null && !info.getTradeTime().isEmpty()) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | fundFlow.setTransactionDate(sdf.parse(info.getTradeTime())); |
| | | } else if (info.getTradeDate() != null && !info.getTradeDate().isEmpty()) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | fundFlow.setTransactionDate(sdf.parse(info.getTradeDate())); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.warn("解析交易日期失败: tradeDate={}, tradeTime={}", info.getTradeDate(), info.getTradeTime()); |
| | | } |
| | | |
| | | // 起息日期 |
| | | try { |
| | | if (info.getValueDate() != null && !info.getValueDate().isEmpty()) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | fundFlow.setValueDate(sdf.parse(info.getValueDate())); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.warn("解析起息日期失败: {}", info.getValueDate()); |
| | | } |
| | | |
| | | // 记账日期 |
| | | try { |
| | | if (info.getPostdate() != null && !info.getPostdate().isEmpty()) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | fundFlow.setPostdate(sdf.parse(info.getPostdate())); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.warn("解析记账日期失败: {}", info.getPostdate()); |
| | | } |
| | | |
| | | // 状态:默认设置为"0"正常(草稿) |
| | | fundFlow.setStatus("0"); |
| | | // 删除标志 |
| | | fundFlow.setDelFlag("0"); |
| | | |
| | | return fundFlow; |
| | | } |
| | | |
| | | /** |
| | | * 生成请求流水号:10位商户号 + 14位时间 + 8位序号 |
| | | */ |
| | | private String generateReqSeq() { |
| | | String merchantNum = "zjjr"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String dateTime = sdf.format(new Date()); |
| | | String seq = String.format("%08d", (int) (Math.random() * 100000000)); |
| | | return merchantNum + dateTime + seq; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.test; |
| | | |
| | | |
| | | import com.cmbs.client.header.ClientConfig; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Properties; |
| | | |
| | | public class GatewayConfigUtils { |
| | | |
| | | static Properties gatewayProperties; |
| | | |
| | | static { |
| | | InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("gateway.properties"); |
| | | gatewayProperties = loadProperties(is); |
| | | } |
| | | |
| | | public static ClientConfig getClientConfig() { |
| | | |
| | | ClientConfig clientConfig = new ClientConfig(); |
| | | |
| | | // 商户号 |
| | | clientConfig.setMerchantNum(gatewayProperties.getProperty("merchantNum")); |
| | | |
| | | // 系统编码 |
| | | clientConfig.setSystemCode(gatewayProperties.getProperty("plantFormCode")); |
| | | |
| | | //互联网https请求SSL双向认证 |
| | | clientConfig.setPostUrl(gatewayProperties.getProperty("url")); |
| | | |
| | | //https双向认证证书 |
| | | clientConfig.setSslClientCertPath(getCertFilePath("sslPath", "minsheng.pfx")); |
| | | |
| | | //https双向认证证书密码 |
| | | clientConfig.setSslClientPassword(gatewayProperties.getProperty("sslPassword")); |
| | | |
| | | //民生科技的公钥 |
| | | clientConfig.setBankCertPath(getCertFilePath("publicCertPath", "cmbs.cer")); |
| | | |
| | | // 测试环境商户私钥,生产环境需要替换(去民生网站下载商户自己的私钥) |
| | | clientConfig.setOwnSm2Path(getCertFilePath("sm2Path", "private.sm2")); |
| | | |
| | | //商户私钥密码 |
| | | clientConfig.setOwnSm2Pwd(gatewayProperties.getProperty("sm2Password")); |
| | | return clientConfig; |
| | | } |
| | | |
| | | public static ClientConfig getClientConfig2() { |
| | | |
| | | ClientConfig clientConfig = new ClientConfig(); |
| | | |
| | | // 商户号 |
| | | clientConfig.setMerchantNum("zjjr"); |
| | | |
| | | // 系统编码 |
| | | clientConfig.setSystemCode("620"); |
| | | |
| | | //互联网https请求SSL双向认证 |
| | | clientConfig.setPostUrl("https://tmc-demo.cmbc.com.cn/mop/ecp/httpMhtInVtFwd"); |
| | | |
| | | //https双向认证证书 |
| | | clientConfig.setSslClientCertPath("C:\\Users\\w\\minsheng.pfx"); |
| | | |
| | | //https双向认证证书密码 |
| | | clientConfig.setSslClientPassword("cfca1234"); |
| | | |
| | | //民生科技的公钥 |
| | | clientConfig.setBankCertPath("C:\\Users\\w\\cmbs.cer"); |
| | | |
| | | // 测试环境商户私钥,生产环境需要替换(去民生网站下载商户自己的私钥) |
| | | clientConfig.setOwnSm2Path("C:\\Users\\w\\private.sm2"); |
| | | |
| | | //商户私钥密码 |
| | | clientConfig.setOwnSm2Pwd("11111111"); |
| | | return clientConfig; |
| | | } |
| | | |
| | | private static Properties loadProperties(InputStream is){ |
| | | Properties properties = new Properties(); |
| | | try { |
| | | properties.load(is); |
| | | } catch (IOException e) { |
| | | System.out.println("properties配置文件失败"); |
| | | } finally { |
| | | if (is != null) { |
| | | try { |
| | | is.close(); |
| | | } catch (Exception e) { |
| | | System.out.println("数据处理异常"); |
| | | } |
| | | } |
| | | } |
| | | return properties; |
| | | } |
| | | |
| | | private static String getCertFilePath(String key, String fileName){ |
| | | String filePath = gatewayProperties.getProperty(key, ""); |
| | | if (filePath.equals("")){ |
| | | String gatewayPath = Thread.currentThread().getContextClassLoader().getResource("gateway.properties").getPath(); |
| | | return gatewayPath.replace("gateway.properties", "") + fileName; |
| | | } |
| | | return filePath; |
| | | } |
| | | } |
| New file |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIICuzCCAmCgAwIBAgIFEDhkeFcwDAYIKoEcz1UBg3UFADBcMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRswGQYDVQQDDBJDRkNBIFRFU1QgU00yIE9DQTEwHhcNMTkxMTE5MDMzNDIzWhcNMjExMTE5MDMzNDIzWjB1MQswCQYDVQQGEwJDTjEXMBUGA1UECgwOQ0ZDQSBURVNUIE9DQTExDTALBgNVBAsMBExDQUUxGTAXBgNVBAsMEE9yZ2FuaXphdGlvbmFsLTExIzAhBgNVBAMMGjA1MUDmsJHnlJ/np5HmioBAWjY2NjY2NkAxMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEZ/vFc/oE1nUyouIhfQaiupQ/6/RVTCyS7li7oTbimabAu+gB2BMSylfpgVSLCw83HTB6qgwvKf5CRVIUZITtjqOB8zCB8DAfBgNVHSMEGDAWgBRr/hjaj0I6prhtsy6Igzo0osEw4TBIBgNVHSAEQTA/MD0GCGCBHIbvKgEBMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2ZjYS5jb20uY24vdXMvdXMtMTQuaHRtMDgGA1UdHwQxMC8wLaAroCmGJ2h0dHA6Ly91Y3JsLmNmY2EuY29tLmNuL1NNMi9jcmw3MzU1LmNybDALBgNVHQ8EBAMCA+gwHQYDVR0OBBYEFNzhEITNVnufiCi+fGPHbwP/g0F6MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAMBggqgRzPVQGDdQUAA0cAMEQCIAH5fWLQY+qJKQxhZ0zIyY5vTHIB8acrZvhEvRyIBeSkAiAIVylkjzMJOZjPUC0iMsDqE35TEc20vl0DSH08J3ohlw== |
| | | -----END CERTIFICATE----- |
| New file |
| | |
| | | #\u5546\u6237\u53F7 \u4E0A\u7EBF\u65F6\u66FF\u6362\u4E3A \u5546\u6237\u53F7(\u95EE\u8D22\u8D44\u7684\u8FD0\u8425\u4EBA\u5458\u7D22\u8981\u5373\u53EF)\uFF0C\u6D4B\u8BD5\u65F6\u4E3Azjjr |
| | | merchantNum=zjjr |
| | | |
| | | #\u5546\u6237\u79C1\u94A5\u5BC6\u7801 \u8BC1\u4E66\u4E0B\u8F7D\u65F6\u4F1A\u8BBE\u7F6E\u4E00\u4E2A\u5BC6\u7801\uFF0C\u5C31\u7528\u90A3\u4E2A |
| | | sm2Password=11111111 |
| | | |
| | | #\u6D4B\u8BD5\u73AF\u5883\u5199620 \u751F\u4EA7\u73AF\u5883\u5199107 |
| | | plantFormCode=620 |
| | | |
| | | #\u8BF7\u6C42\u5730\u5740 \u6309\u9700\u8981\u4FEE\u6539 |
| | | url=https://tmc-demo.cmbc.com.cn/mop/ecp/httpMhtInVtFwd |
| | | #\u6B63\u5F0F\u73AF\u5883\u4E3A https://mop.cmbc.com.cn:9443/mop/ecp/httpMhtInVtFwd |
| | | #\u6D4B\u8BD5\u73AF\u5883\u4E3A https://tmc-demo.cmbc.com.cn/mop/ecp/httpMhtInVtFwd |
| | | |
| | | ##https\u53CC\u5411\u8BA4\u8BC1\u8BC1\u4E66 \u8BF7\u6B63\u786E\u586B\u5199\u8DEF\u5F84\u548C\u6587\u4EF6\u540D\u79F0 |
| | | sslPath=C:\\Users\\w\\minsheng.pfx |
| | | |
| | | ##\u6C11\u751F\u79D1\u6280\u7684\u516C\u94A5 \u8BF7\u6B63\u786E\u586B\u5199\u8DEF\u5F84\u548C\u6587\u4EF6\u540D\u79F0 |
| | | publicCertPath=C:\\Users\\w\\cmbs.cer |
| | | |
| | | ##\u4F01\u4E1A\u7684\u79C1\u94A5 \u8BF7\u6B63\u786E\u586B\u5199\u8DEF\u5F84\u548C\u6587\u4EF6\u540D\u79F0 |
| | | sm2Path=C:\\Users\\w\\private.sm2 |
| | | |
| | | |
| | | ####################### \u65E0\u9700\u6539\u53D8 ############################ |
| | | sslPassword=cfca1234 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="billType" column="bill_type" /> |
| | | <result property="subAccountNo" column="sub_account_no" /> |
| | | <result property="counterpartyBank" column="counterparty_bank" /> |
| | | <result property="accountBalance" column="account_balance" /> |
| | | <result property="transactionChannel" column="transaction_channel" /> |
| | | <result property="urid" column="urid" /> |
| | | <result property="orgNo" column="org_no" /> |
| | | <result property="payerAcctName" column="payer_acct_name" /> |
| | | <result property="valueDate" column="value_date" /> |
| | | <result property="natureNames" column="nature_names" /> |
| | | <result property="postdate" column="postdate" /> |
| | | <result property="isReturn" column="is_return" /> |
| | | <result property="customizedSerialNum" column="customized_serial_num" /> |
| | | <result property="srcNoteCode" column="src_note_code" /> |
| | | <result property="currNo" column="curr_no" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectFundFlowVo"> |
| | | select thisTab.id, thisTab.bank_flow_no, thisTab.company, thisTab.our_account, thisTab.our_bank_name, thisTab.income_expense_flag, thisTab.transaction_amount, thisTab.currency, thisTab.counterparty_account, thisTab.counterparty_name, thisTab.transaction_date, thisTab.purpose, thisTab.summary, thisTab.remarks, thisTab.status, thisTab.claimed_amount, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.del_flag , thisTab.bill_type from fund_flow AS thisTab |
| | | select thisTab.id, thisTab.bank_flow_no, thisTab.company, thisTab.our_account, thisTab.our_bank_name, thisTab.income_expense_flag, thisTab.transaction_amount, thisTab.currency, thisTab.counterparty_account, thisTab.counterparty_name, thisTab.transaction_date, thisTab.purpose, thisTab.summary, thisTab.remarks, thisTab.status, thisTab.claimed_amount, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.del_flag , thisTab.bill_type, thisTab.sub_account_no, thisTab.counterparty_bank, thisTab.account_balance, thisTab.transaction_channel, thisTab.urid, thisTab.org_no, thisTab.payer_acct_name, thisTab.value_date, thisTab.nature_names, thisTab.postdate, thisTab.is_return, thisTab.customized_serial_num, thisTab.src_note_code, thisTab.curr_no from fund_flow AS thisTab |
| | | </sql> |
| | | <sql id="selectFundFlowVoCount"> |
| | | select count(0) from fund_flow as thisTab |
| | |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | | <if test="billType != null">bill_type,</if> |
| | | <if test="subAccountNo != null">sub_account_no,</if> |
| | | <if test="counterpartyBank != null">counterparty_bank,</if> |
| | | <if test="accountBalance != null">account_balance,</if> |
| | | <if test="transactionChannel != null">transaction_channel,</if> |
| | | <if test="urid != null">urid,</if> |
| | | <if test="orgNo != null">org_no,</if> |
| | | <if test="payerAcctName != null">payer_acct_name,</if> |
| | | <if test="valueDate != null">value_date,</if> |
| | | <if test="natureNames != null">nature_names,</if> |
| | | <if test="postdate != null">postdate,</if> |
| | | <if test="isReturn != null">is_return,</if> |
| | | <if test="customizedSerialNum != null">customized_serial_num,</if> |
| | | <if test="srcNoteCode != null">src_note_code,</if> |
| | | <if test="currNo != null">curr_no,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="bankFlowNo != null and bankFlowNo != ''">#{bankFlowNo},</if> |
| | |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | | <if test="billType != null">#{billType},</if> |
| | | <if test="subAccountNo != null">#{subAccountNo},</if> |
| | | <if test="counterpartyBank != null">#{counterpartyBank},</if> |
| | | <if test="accountBalance != null">#{accountBalance},</if> |
| | | <if test="transactionChannel != null">#{transactionChannel},</if> |
| | | <if test="urid != null">#{urid},</if> |
| | | <if test="orgNo != null">#{orgNo},</if> |
| | | <if test="payerAcctName != null">#{payerAcctName},</if> |
| | | <if test="valueDate != null">#{valueDate},</if> |
| | | <if test="natureNames != null">#{natureNames},</if> |
| | | <if test="postdate != null">#{postdate},</if> |
| | | <if test="isReturn != null">#{isReturn},</if> |
| | | <if test="customizedSerialNum != null">#{customizedSerialNum},</if> |
| | | <if test="srcNoteCode != null">#{srcNoteCode},</if> |
| | | <if test="currNo != null">#{currNo},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertFundFlowBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into fund_flow |
| | | <trim prefix="(" suffix=") values" suffixOverrides=","> |
| | | id,bank_flow_no,company,our_account,our_bank_name,income_expense_flag,transaction_amount,currency,counterparty_account,counterparty_name,transaction_date,purpose,summary,remarks,status,claimed_amount,create_by,create_time,update_by,update_time,del_flag, |
| | | id,bank_flow_no,company,our_account,our_bank_name,income_expense_flag,transaction_amount,currency,counterparty_account,counterparty_name,transaction_date,purpose,summary,remarks,status,claimed_amount,create_by,create_time,update_by,update_time,del_flag,sub_account_no,counterparty_bank,account_balance,transaction_channel,urid,org_no,payer_acct_name,value_date,nature_names,postdate,is_return,customized_serial_num,src_note_code,curr_no, |
| | | </trim> |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | #{item.id},#{item.bankFlowNo},#{item.company},#{item.ourAccount},#{item.ourBankName},#{item.incomeExpenseFlag},#{item.transactionAmount},#{item.currency},#{item.counterpartyAccount},#{item.counterpartyName},#{item.transactionDate},#{item.purpose},#{item.summary},#{item.remarks},#{item.status},#{item.claimedAmount},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.delFlag}, |
| | | #{item.id},#{item.bankFlowNo},#{item.company},#{item.ourAccount},#{item.ourBankName},#{item.incomeExpenseFlag},#{item.transactionAmount},#{item.currency},#{item.counterpartyAccount},#{item.counterpartyName},#{item.transactionDate},#{item.purpose},#{item.summary},#{item.remarks},#{item.status},#{item.claimedAmount},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.delFlag},#{item.subAccountNo},#{item.counterpartyBank},#{item.accountBalance},#{item.transactionChannel},#{item.urid},#{item.orgNo},#{item.payerAcctName},#{item.valueDate},#{item.natureNames},#{item.postdate},#{item.isReturn},#{item.customizedSerialNum},#{item.srcNoteCode},#{item.currNo}, |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
| | | <if test="billType != null">bill_type = #{billType},</if> |
| | | <if test="subAccountNo != null">sub_account_no = #{subAccountNo},</if> |
| | | <if test="counterpartyBank != null">counterparty_bank = #{counterpartyBank},</if> |
| | | <if test="accountBalance != null">account_balance = #{accountBalance},</if> |
| | | <if test="transactionChannel != null">transaction_channel = #{transactionChannel},</if> |
| | | <if test="urid != null">urid = #{urid},</if> |
| | | <if test="orgNo != null">org_no = #{orgNo},</if> |
| | | <if test="payerAcctName != null">payer_acct_name = #{payerAcctName},</if> |
| | | <if test="valueDate != null">value_date = #{valueDate},</if> |
| | | <if test="natureNames != null">nature_names = #{natureNames},</if> |
| | | <if test="postdate != null">postdate = #{postdate},</if> |
| | | <if test="isReturn != null">is_return = #{isReturn},</if> |
| | | <if test="customizedSerialNum != null">customized_serial_num = #{customizedSerialNum},</if> |
| | | <if test="srcNoteCode != null">src_note_code = #{srcNoteCode},</if> |
| | | <if test="currNo != null">curr_no = #{currNo},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="item.updateBy != null">update_by = #{item.updateBy},</if> |
| | | <if test="item.updateTime != null">update_time = #{item.updateTime},</if> |
| | | <if test="item.delFlag != null">del_flag = #{item.delFlag},</if> |
| | | <if test="item.subAccountNo != null">sub_account_no = #{item.subAccountNo},</if> |
| | | <if test="item.counterpartyBank != null">counterparty_bank = #{item.counterpartyBank},</if> |
| | | <if test="item.accountBalance != null">account_balance = #{item.accountBalance},</if> |
| | | <if test="item.transactionChannel != null">transaction_channel = #{item.transactionChannel},</if> |
| | | <if test="item.urid != null">urid = #{item.urid},</if> |
| | | <if test="item.orgNo != null">org_no = #{item.orgNo},</if> |
| | | <if test="item.payerAcctName != null">payer_acct_name = #{item.payerAcctName},</if> |
| | | <if test="item.valueDate != null">value_date = #{item.valueDate},</if> |
| | | <if test="item.natureNames != null">nature_names = #{item.natureNames},</if> |
| | | <if test="item.postdate != null">postdate = #{item.postdate},</if> |
| | | <if test="item.isReturn != null">is_return = #{item.isReturn},</if> |
| | | <if test="item.customizedSerialNum != null">customized_serial_num = #{item.customizedSerialNum},</if> |
| | | <if test="item.srcNoteCode != null">src_note_code = #{item.srcNoteCode},</if> |
| | | <if test="item.currNo != null">curr_no = #{item.currNo},</if> |
| | | </trim> |
| | | where id = #{item.id} |
| | | </foreach> |
| | |
| | | where thisTab.bank_flow_no = #{bankFlowNo} |
| | | </select> |
| | | |
| | | <select id="selectFundFlowByUrid" parameterType="String" resultMap="FundFlowResult"> |
| | | <include refid="selectFundFlowVo"/> |
| | | where thisTab.urid = #{urid} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | MIIDIgIBATBHBgoqgRzPVQYBBAIBBgcqgRzPVQFoBDDrjRiluqzadTP8f5YyCXAKVzrEu++VsvnA |
| | | f3XX0ib0JAWxdJ0BBxMp49qee1AnOkowggLSBgoqgRzPVQYBBAIBBIICwjCCAr4wggJioAMCAQIC |
| | | BRA4ZHhIMAwGCCqBHM9VAYN1BQAwXDELMAkGA1UEBhMCQ04xMDAuBgNVBAoMJ0NoaW5hIEZpbmFu |
| | | Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEbMBkGA1UEAwwSQ0ZDQSBURVNUIFNNMiBPQ0Ex |
| | | MB4XDTE5MTExOTAzMjk1OFoXDTIxMTExOTAzMjk1OFowdzELMAkGA1UEBhMCQ04xFzAVBgNVBAoM |
| | | DkNGQ0EgVEVTVCBPQ0ExMQ0wCwYDVQQLDARMQ0FFMRkwFwYDVQQLDBBPcmdhbml6YXRpb25hbC0x |
| | | MSUwIwYDVQQDDBwwNTFA5rWL6K+V5LyB5LiaQFo4ODg4ODg4OEAxMFkwEwYHKoZIzj0CAQYIKoEc |
| | | z1UBgi0DQgAEp3Cy3Xs5ntOajXwZQLP4Dtpp2czZIVS3OyxAkfKw/bhXe1oIzV9OPh9ydIQeAmAt |
| | | nPrm4WnNHP1Y3/XlWK/zi6OB8zCB8DAfBgNVHSMEGDAWgBRr/hjaj0I6prhtsy6Igzo0osEw4TBI |
| | | BgNVHSAEQTA/MD0GCGCBHIbvKgEBMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2ZjYS5jb20u |
| | | Y24vdXMvdXMtMTQuaHRtMDgGA1UdHwQxMC8wLaAroCmGJ2h0dHA6Ly91Y3JsLmNmY2EuY29tLmNu |
| | | L1NNMi9jcmw3MzU1LmNybDALBgNVHQ8EBAMCA+gwHQYDVR0OBBYEFOgpYvNN0aU6Y/EehqXsy4jc |
| | | kuzMMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAMBggqgRzPVQGDdQUAA0gAMEUCIQCY |
| | | kwgmmtamo2IHSv6IlAWFnJJuJWJTrsHJ2Qa4ctwtIwIgbednqMQtQNDyVVxDFEH9uabA7N1KzRDS |
| | | TDmAVnPOqWs= |
| | |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 从CMBS同步银行流水 |
| | | */ |
| | | export const syncFromCmbs:requestType = (data) => { |
| | | return request({ |
| | | url: '/cwgl/fundFlow/syncFromCmbs', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | <el-button type="warning" plain icon="Upload" @click="handleImport" |
| | | v-hasPermi="['cwgl:fundFlow:import']">导入 |
| | | </el-button> |
| | | <el-button type="primary" plain icon="Refresh" @click="handleSync" |
| | | v-hasPermi="['cwgl:fundFlow:sync']">同步银行流水 |
| | | </el-button> |
| | | </template> |
| | | <template #menu="{ size, row, index }"> |
| | | <el-link v-if="row.status == '0'" class="link-btn" type="primary" icon="Edit" :underline="false" :size="size" |
| | |
| | | :open="pageF.importOpen" @submit="importSubmit" @cancel="pageF.importOpen = false" /> |
| | | |
| | | <ClaimBillDialog ref="claimDialogRef" @submit="handleClaimSubmit" /> |
| | | |
| | | <!-- 同步银行流水对话框 --> |
| | | <el-dialog title="同步银行流水" v-model="syncDialogVisible" width="500px" append-to-body> |
| | | <el-form ref="syncFormRef" :model="syncForm" :rules="syncRules" label-width="100px"> |
| | | <el-form-item label="账号" prop="acctNum"> |
| | | <el-input v-model="syncForm.acctNum" placeholder="请输入银行账号" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="开始日期" prop="startDate"> |
| | | <el-date-picker v-model="syncForm.startDate" type="date" value-format="YYYY-MM-DD" |
| | | placeholder="请选择开始日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="结束日期" prop="endDate"> |
| | | <el-date-picker v-model="syncForm.endDate" type="date" value-format="YYYY-MM-DD" |
| | | placeholder="请选择结束日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="syncDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="handleSyncSubmit" :loading="syncLoading">确 定</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup name="fundFlow" lang="ts"> |
| | | import { FundFlowI, addFundFlow, delFundFlow, addFundFlowClaimDetailClaim, exportFundFlow, confirmFundFlow, getFundFlow, listFundFlow, updateFundFlow } from "@/api/cwgl/fundFlow"; |
| | | import { FundFlowI, addFundFlow, delFundFlow, addFundFlowClaimDetailClaim, exportFundFlow, confirmFundFlow, getFundFlow, listFundFlow, updateFundFlow, syncFromCmbs } from "@/api/cwgl/fundFlow"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import { listFundFlowLog} from "@/api/cwgl/fundFlowLog"; |
| | | |
| | |
| | | pageF.importOpen = false; |
| | | onLoad(page.value); |
| | | }; |
| | | |
| | | // 同步银行流水 |
| | | const syncDialogVisible = ref(false); |
| | | const syncLoading = ref(false); |
| | | const syncFormRef = ref(); |
| | | const syncForm = reactive({ |
| | | acctNum: '', |
| | | startDate: '', |
| | | endDate: '' |
| | | }); |
| | | const syncRules = { |
| | | acctNum: [{ required: true, message: '请输入银行账号', trigger: 'blur' }], |
| | | startDate: [{ required: true, message: '请选择开始日期', trigger: 'change' }], |
| | | endDate: [{ required: true, message: '请选择结束日期', trigger: 'change' }] |
| | | }; |
| | | |
| | | const handleSync = () => { |
| | | syncForm.acctNum = ''; |
| | | syncForm.startDate = ''; |
| | | syncForm.endDate = ''; |
| | | syncDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleSyncSubmit = () => { |
| | | syncFormRef.value?.validate((valid: boolean) => { |
| | | if (!valid) return; |
| | | syncLoading.value = true; |
| | | syncFromCmbs(syncForm).then((response: any) => { |
| | | syncLoading.value = false; |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess(response.msg || '同步成功'); |
| | | syncDialogVisible.value = false; |
| | | onLoad(page.value); |
| | | } else { |
| | | proxy.$modal.msgError(response.msg || '同步失败'); |
| | | } |
| | | }).catch((err) => { |
| | | syncLoading.value = false; |
| | | proxy.$modal.msgError('同步失败: ' + (err.msg || err.message || '')); |
| | | }); |
| | | }); |
| | | }; |
| | | /* listFundFlowClaimDetail */ |
| | | </script> |