Commit 82c3abea by 叶立庆

Merge branch 'v5.7.1' into 'master'

上线合并

See merge request !3
2 parents a1206e06 f4f52056
Showing 90 changed files with 1459 additions and 143 deletions
......@@ -7,7 +7,7 @@
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-financial-api</artifactId>
<version>5.5.4-SNAPSHOT</version>
<version>5.7.1-SNAPSHOT</version>
<name>rpc-dj-financial-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.remote</deploy.scanPackage>
......@@ -57,7 +57,7 @@
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-financial-api</artifactId>
<version>5.5.0-SNAPSHOT</version>
<version>5.7.1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
......
......@@ -108,10 +108,19 @@ public class NbCbBatchTransferDTO extends NbCbBatchTransfer {
private Byte wechatType;
/**
* NbCbCustEnum
*/
private Integer custType;
/**
* 操作日志
*/
private List<NbCbBatchTransferLog> logList;
private List<String> accDetailSerialNoList;
/**
* 银行摘要
*/
private String purpose;
}
package cn.com.glsx.dj.financial.dto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -69,7 +70,7 @@ public class NbCbBatchTransferParamDTO implements Serializable {
private String erpRemark4;
@NotNull
@ApiModelProperty(notes = "转账来源 0-二手车业务", required = true)
@ApiModelProperty(notes = "转账来源 0-二手车业务 1-广联企微审批自动付款", required = true)
private Byte batchTransferSource;
@NotBlank
......@@ -81,4 +82,13 @@ public class NbCbBatchTransferParamDTO implements Serializable {
@ApiModelProperty(notes = "付款方式")
private String paymentMethod;
@ApiModelProperty(notes = "主体id")
private String custId;
@ApiModelProperty(notes = "主体类型")
private Integer custType;
@ApiModelProperty(notes = "审批编号")
private String spNo;
}
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.dto;
import lombok.Data;
/**
* @Title:
* @Description:
......@@ -15,4 +16,14 @@ public class NbCbReceiptQueryTaskParamDTO {
* 回单下载编号
*/
private String downloadNo;
/**
* 付款主体id
*/
private String custId;
/**
* 主体类型
*/
private Integer custType;
}
......@@ -82,4 +82,20 @@ public class NbCbTransferDTO extends NbCbTransfer {
private List<NbCbTransferLog> logList;
private List<Integer> nbTransferStatusList;
/**
* 数据来源标识:1-待付清单表(nb_cb_transfer),2-二手车付款OA审批表(nb_cb_batch_transfer)
* 枚举值参考 NbCbTransferDataSourceEnum
*/
private Integer dataSource;
/**
* 是否自动付款:Y-只查 nb_cb_batch_transfer;N-只查 nb_cb_transfer;null-两者都查
*/
private String autoPay;
/**
* 主体类型,默认=1(广联主体),参考 NbCbCustEnum
*/
private Integer custType;
}
......@@ -71,4 +71,13 @@ public class NbCbTransferParamDTO implements Serializable {
@ApiModelProperty(notes = "付款方式 0-银行转账 1-现金 2-银行承兑汇票 3-信用证 4-冲账 5-其他, 默认为0", required = false)
private Byte payType;
@ApiModelProperty(notes = "主体id")
private String custId;
@ApiModelProperty(notes = "主体类型")
private Integer custType;
@ApiModelProperty(notes = "审批编号")
private String spNo;
}
......@@ -29,6 +29,11 @@ public class OaApplyBatchTransferDTO extends OaApplyBatchTransfer {
private List<String> spNoList;
/**
* 商户企微审批编号列表
*/
private List<String> merchantSpNoList;
/**
* 企微oa审批状态
*/
private List<Byte> oaApproveStatusList;
......
......@@ -10,7 +10,9 @@ import java.util.Objects;
*/
public enum BatchTransferSourceEnum {
SECOND_HAND_CAR((byte)0,"二手车");
SECOND_HAND_CAR((byte)0,"二手车"),
GL_QW_OA_AUTO_PAYMENT((byte)1,"广联企微OA自动付款");
private Byte value;
......
package cn.com.glsx.dj.financial.enums;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* 宁波银行主体信息枚举
* @author pansl
*/
@Getter
@AllArgsConstructor
public enum NbCbCustEnum {
/**
* 广联主体
*/
GL_CUST(1, "广联主体"),
/**
* 优加主体
*/
YJ_CUST(2, "优加");
/**
* 客户类型
*/
private final Integer custType;
/**
* 描述
*/
private final String description;
}
package cn.com.glsx.dj.financial.enums;
import java.util.Objects;
/**
* @Author: chenx
* @Description: 待付清单合并查询数据来源枚举
* 用于区分数据来自 nb_cb_transfer(待付清单)还是 nb_cb_batch_transfer(批量付款OA审批)
* @Date: 2025/6/4 10:00
* @Version: 1.0
*/
public enum NbCbTransferDataSourceEnum {
/** 待付清单表 nb_cb_transfer */
TRANSFER(1, "待付清单"),
/** 批量付款OA审批表 nb_cb_batch_transfer(batch_transfer_source=1) */
BATCH_TRANSFER(2, "批量付款OA审批");
private final Integer value;
private final String desc;
NbCbTransferDataSourceEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return value;
}
public String getDesc() {
return desc;
}
public static NbCbTransferDataSourceEnum getByValue(Integer value) {
if (Objects.isNull(value)) {
return null;
}
for (NbCbTransferDataSourceEnum e : values()) {
if (Objects.equals(e.value, value)) {
return e;
}
}
return null;
}
}
......@@ -9,6 +9,8 @@ import java.util.Map;
* 宁波银行转账异常枚举
*/
public enum TransferErrorEnum implements ErrorEnum{
PARAM_ERROR("30990001", "参数错误"),
TRANSFER_ERROR("30999999", "调用宁波银行接口失败");
......
package cn.com.glsx.dj.financial.model;
import lombok.Data;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
/**
* 审批付款渠道动态路由规则配置
*/
@Table(name = "approval_pay_channel_rule")
@Data
public class ApprovalPayChannelRule {
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 规则名称
*/
@Column(name = "rule_name")
private String ruleName;
/**
* 关联的模板ID,* 表示匹配所有模板
*/
@Column(name = "template_id")
private String templateId;
/**
* 规则开关:1-启用 0-禁用
*/
@Column(name = "enabled")
private Integer enabled;
/**
* 命中规则后覆写的付款渠道值
* 1-宁波银行单笔付款 2-宁波银行批量付款
*/
@Column(name = "target_pay_channel")
private Integer targetPayChannel;
/**
* 金额上限(含),为 null 表示不限制
*/
@Column(name = "amount_max")
private BigDecimal amountMax;
/**
* 付款主体所属公司级别:1-母公司 2-子公司,为 null 表示不限制
*/
@Column(name = "payer_entity_level")
private Integer payerEntityLevel;
/**
* 规则优先级,值越大优先级越高
*/
@Column(name = "priority")
private Integer priority;
/**
* 备注
*/
@Column(name = "remark")
private String remark;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 创建人(操作账号)
*/
@Column(name = "created_by")
private String createdBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 默认N,(已删除'D',未删除N)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
......@@ -27,6 +27,19 @@ public class ApprovalRecords {
private String spNo;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 商户号_企微审批编号(由商户号+sp_no拼接)
*/
@Column(name = "merchant_sp_no")
private String merchantSpNo;
/**
* 审批申请类型名称(审批模板名称)
*/
@Column(name = "sp_name")
......
......@@ -16,6 +16,18 @@ public class ApprovalTemplateConfig {
private Long id;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 付款主体类型(1:广联数科,2:优加智汇)
*/
@Column(name = "cust_type")
private Byte custType;
/**
* 模板 ID
*/
@Column(name = "template_id")
......
......@@ -33,6 +33,12 @@ public class NbCbAccDetail implements Serializable {
private Long id;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 账号
*/
@Column(name = "bank_acc")
......
......@@ -22,6 +22,12 @@ public class NbCbAccount implements Serializable {
private Long id;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 账号
*/
@Column(name = "bank_acc")
......
......@@ -25,6 +25,12 @@ public class NbCbBatchTransfer implements Serializable {
private String corpCode;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 付款账号
*/
@Column(name = "pay_acc")
......@@ -186,4 +192,9 @@ public class NbCbBatchTransfer implements Serializable {
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 审批编号
*/
@Column(name = "sp_no")
private String spNo;
}
\ No newline at end of file
package cn.com.glsx.dj.financial.model;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author pansl
*/
@Data
@Table(name = "nb_cb_cust_info")
public class NbCbCustInfo implements Serializable {
private static final long serialVersionUID = -7763265884512343944L;
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 付款主体类型
*/
@Column(name = "cust_type")
private Integer custType;
/**
* 账号
*/
@Column(name = "app_key")
private String appKey;
/**
* 户名
*/
@Column(name = "remark")
private String remark;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 创建人(操作账号)
*/
@Column(name = "created_by")
private String createdBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 默认N,(已删除‘D’,未删除N)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
......@@ -25,6 +25,12 @@ public class NbCbReceipt implements Serializable {
private Long id;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 本方户名
*/
@Column(name = "acc_name")
......
......@@ -28,6 +28,12 @@ public class NbCbTransfer implements Serializable {
private String corpCode;
/**
* 付款主体id
*/
@Column(name = "cust_id")
private String custId;
/**
* 付款户名
*/
@Column(name = "pay_name")
......@@ -75,6 +81,12 @@ public class NbCbTransfer implements Serializable {
private String djSerialNo;
/**
* 审批编号
*/
@Column(name = "sp_no")
private String spNo;
/**
* 转账用途
*/
private String purpose;
......
......@@ -54,6 +54,12 @@ public class OaApplyBatchTransfer implements Serializable {
private String spNo;
/**
* 商户号_企微审批编号(由商户号+sp_no拼接)
*/
@Column(name = "merchant_sp_no")
private String merchantSpNo;
/**
* oa审批模板类型 31-SaaS+商务付款(二手车业务)
*/
@Column(name = "oa_template_type")
......
......@@ -50,6 +50,12 @@ public class OaApplyTransfer implements Serializable {
private String spNo;
/**
* 商户号_企微审批编号(由商户号+sp_no拼接)
*/
@Column(name = "merchant_sp_no")
private String merchantSpNo;
/**
* oa审批模板类型 1-费用报销与借支 2-行政采购与项目付款 3-商务采购付款 4-SaaS+商务付款 5-SaaS+行政与项目付款 6-资金理财与调拨 7-SaaS+嘀加退款
*/
@Column(name = "oa_template_type")
......
......@@ -42,7 +42,7 @@ public interface NbCbAccDetailRemote {
@ApiMethod("财资数据筛选项列表")
@ApiParam(name = "nbCbAccDetailDTO", notes = "重取条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("财资数据筛选项列表")
RpcResponse<NbCbAccDetailDTO> accDetailConfig();
RpcResponse<NbCbAccDetailDTO> accDetailConfig(NbCbAccDetailDTO condition);
@ApiMethod("批量同步交易明细到金蝶")
@ApiParam(
......
......@@ -42,6 +42,11 @@ public interface NbCbTransferRemote {
@ApiResponse("待付清单分页列表数据")
RpcResponse<RpcPagination<NbCbTransferDTO>> page(@NotNull RpcPagination<NbCbTransferDTO> pagination);
@ApiMethod("待付清单合并分页列表(含批量付款OA数据)")
@ApiParam(name = "pagination", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("待付清单合并分页列表数据")
RpcResponse<RpcPagination<NbCbTransferDTO>> pageUnion(@NotNull RpcPagination<NbCbTransferDTO> pagination);
@ApiMethod("待付清单明细")
@ApiParam(name = "id", notes = "查询条件", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("待付清单明细数据")
......
......@@ -18,7 +18,7 @@
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-financial-api</artifactId>
<version>5.5.4-SNAPSHOT</version>
<version>5.7.1-SNAPSHOT</version>
</dependency>
<!-- RAR解压依赖 -->
......@@ -75,7 +75,7 @@
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.5.4-SNAPSHOT</version>
<version>5.7.1-SNAPSHOT</version>
</dependency>
<dependency>
......
package cn.com.glsx.dj.financial.config;
import com.nbcb.sdk.OpenSDK;
import com.nbcb.sdk.aes.exception.SDKException;
import com.nbcb.sdk.aes.param.ConfigParam;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
/**
* 宁波财资-优加配置
*/
@Setter
@Getter
@Configuration
@ConfigurationProperties("nbcb.yj")
public class NbCbYJConfig {
private String privateKey;
private String publicUrl;
private String appKey;
private String publicKey;
private Integer connectTimeOut;
private Integer readTimeOut;
@PostConstruct
public void init() {
ConfigParam configParam = new ConfigParam(privateKey, publicUrl, appKey, publicKey, connectTimeOut, readTimeOut);
try {
OpenSDK.dynamicInit(configParam, true);
} catch (SDKException e) {
throw new RuntimeException(e);
}
}
public NbCbYJConfig() {
}
public NbCbYJConfig(String privateKey, String publicUrl, String appKey, String publicKey, Integer connectTimeOut, Integer readTimeOut) {
this.privateKey = privateKey;
this.publicUrl = publicUrl;
this.appKey = appKey;
this.publicKey = publicKey;
this.connectTimeOut = connectTimeOut;
this.readTimeOut = readTimeOut;
}
@Override
public String toString() {
return "NbCbConfigParam{" +
"privateKey='" + privateKey + '\'' +
", publicUrl='" + publicUrl + '\'' +
", appKey='" + appKey + '\'' +
", publicKey='" + publicKey + '\'' +
", connectTimeOut=" + connectTimeOut +
", readTimeOut=" + readTimeOut +
'}';
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbBatchTransferService;
import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
......@@ -21,7 +22,7 @@ public class NbCbBatchTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------调用宁波银行批量转账接口任务开始-----------------");
try {
batchTransferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE);
batchTransferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbBatchTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class NbCbQueryBatchTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时调用宁波银行批量转账单笔查证任务开始-----------------");
try {
transferService.queryBatchTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE);
transferService.queryBatchTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class NbCbQueryTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时调用宁波银行单笔转账单笔查证任务开始-----------------");
try {
transferService.queryTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE);
transferService.queryTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -9,7 +10,7 @@ import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "NbCbTransferJob", cron = "0 0/3 9-15 * * ?", description = "调用宁波银行单笔转账接口", overwrite = false)
@ElasticJobConf(name = "NbCbTransferJob", cron = "0 0/3 9-15 * * ? 2099", description = "调用宁波银行单笔转账接口", overwrite = false)
public class NbCbTransferJob implements SimpleJob {
@Autowired
......@@ -20,7 +21,7 @@ public class NbCbTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------调用宁波银行单笔转账接口任务开始-----------------");
try {
transferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE);
transferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbBatchTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "NbCbYJBatchTransferJob", cron = "0 0/5 * * * ?", description = "优加-调用宁波银行批量转账接口", overwrite = false)
public class NbCbYJBatchTransferJob implements SimpleJob {
@Autowired
private NbCbBatchTransferService batchTransferService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-调用宁波银行批量转账接口任务开始-----------------");
try {
batchTransferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-调用宁波银行批量转账接口任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbBatchTransferService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "NbCbYJQueryBatchTransferJob", cron = "0 0/5 * * * ?", description = "优加-定时调用宁波银行批量转账单笔查证", overwrite = false)
public class NbCbYJQueryBatchTransferJob implements SimpleJob {
@Autowired
private NbCbBatchTransferService transferService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-定时调用宁波银行批量转账单笔查证任务开始-----------------");
try {
transferService.queryBatchTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-定时调用宁波银行批量转账单笔查证任务结束-----------------");
}
}
//package cn.com.glsx.dj.financial.job;
//
//import cn.com.glsx.dj.financial.constants.CommonConstants;
//import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
//import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
//import com.dangdang.ddframe.job.api.ShardingContext;
//import com.dangdang.ddframe.job.api.simple.SimpleJob;
//import lombok.extern.slf4j.Slf4j;
//import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
//import org.springframework.beans.factory.annotation.Autowired;
//
///**
// * 优加-定时调用宁波银行单笔转账单笔查证
// */
//@Slf4j
//@ElasticJobConf(name = "NbCbYJQueryTransferJob", cron = "0 0/5 * * * ?", description = "优加-定时调用宁波银行单笔转账单笔查证", overwrite = false)
//public class NbCbYJQueryTransferJob implements SimpleJob {
//
// @Autowired
// private NbCbTransferService transferService;
//
//
// @Override
// public void execute(ShardingContext shardingContext) {
// log.info("----------------优加-定时调用宁波银行单笔转账单笔查证任务开始-----------------");
// try {
// transferService.queryTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// }
// log.info("----------------优加-定时调用宁波银行单笔转账单笔查证任务结束-----------------");
//
// }
//}
//package cn.com.glsx.dj.financial.job;
//
//import cn.com.glsx.dj.financial.constants.CommonConstants;
//import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
//import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
//import com.dangdang.ddframe.job.api.ShardingContext;
//import com.dangdang.ddframe.job.api.simple.SimpleJob;
//import lombok.extern.slf4j.Slf4j;
//import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
//import org.springframework.beans.factory.annotation.Autowired;
//
///**
// * 优加-调用宁波银行单笔转账接口
// */
//@Slf4j
//@ElasticJobConf(name = "NbCbYJTransferJob", cron = "0 0/3 9-15 * * ?", description = "优加-调用宁波银行单笔转账接口", overwrite = false)
//public class NbCbYJTransferJob implements SimpleJob {
//
// @Autowired
// private NbCbTransferService transferService;
//
//
// @Override
// public void execute(ShardingContext shardingContext) {
// log.info("----------------优加-调用宁波银行单笔转账接口任务开始-----------------");
// try {
// transferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// }
// log.info("----------------优加-调用宁波银行单笔转账接口任务结束-----------------");
//
// }
//}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行交易明细定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
......@@ -29,7 +30,7 @@ public class QueryNbCbAccDetailMonthlyJob implements SimpleJob {
DateTime beginOfMonth = DateUtil.beginOfMonth(baseDateTime);
DateTime endOfMonth = DateUtil.endOfMonth(baseDateTime);
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), beginOfMonth, endOfMonth, CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), beginOfMonth, endOfMonth, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailReceiptJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行当天回单定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbAccDetailReceipt(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbAccDetailReceipt(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailTodayJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行当天交易明细定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbAccDetailByDate(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbAccDetailByDate(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbReceiptService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
......@@ -20,7 +21,7 @@ public class QueryNbCbReceiptJob implements SimpleJob {
public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行回单定时任务开始-----------------");
try {
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE);
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbReceiptService;
import cn.com.glsx.dj.financial.util.DateUtils;
import cn.hutool.core.date.DateTime;
......@@ -32,7 +33,7 @@ public class QueryNbCbReceiptMonthlyJob implements SimpleJob {
String beginDateStr = DateUtils.formatDate(beginOfMonth, DateUtils.DEFAULT_DATE_FORMAT);
String endDateStr = DateUtils.formatDate(endOfMonth, DateUtils.DEFAULT_DATE_FORMAT);
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), beginDateStr, endDateStr, CommonConstants.MIDDLE_WARE);
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), beginDateStr, endDateStr, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJAccDetailJob", cron = "0 30 10,14 * * ?", description = "优加-定时查询宁波银行交易明细定时任务", overwrite = false)
public class QueryNbCbYJAccDetailJob implements SimpleJob {
@Autowired
private NbCbAccDetailService nbcAccDetailService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-定时查询宁波银行交易明细定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-定时查询宁波银行交易明细定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJAccDetailMonthlyJob", cron = "0 30 1 1 * ?", description = "优加-每月定时查询宁波银行交易明细定时任务", overwrite = false)
public class QueryNbCbYJAccDetailMonthlyJob implements SimpleJob {
@Autowired
private NbCbAccDetailService nbcAccDetailService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-每月定时查询宁波银行交易明细定时任务开始-----------------");
try {
// 查询上月全流水
DateTime baseDateTime = DateUtil.offsetDay(DateUtil.beginOfMonth(new Date()), -1);
DateTime beginOfMonth = DateUtil.beginOfMonth(baseDateTime);
DateTime endOfMonth = DateUtil.endOfMonth(baseDateTime);
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), beginOfMonth, endOfMonth, CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-每月定时查询宁波银行交易明细定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJAccDetailReceiptJob", cron = "0 0 18 * * ?", description = "优加-定时查询宁波银行交易明细和回单定时任务", overwrite = false)
public class QueryNbCbYJAccDetailReceiptJob implements SimpleJob {
@Autowired
private NbCbAccDetailService nbcAccDetailService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-定时查询宁波银行当天回单定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbAccDetailReceipt(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-定时查询宁波银行当天回单定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJAccDetailTodayJob", cron = "0 5 18 * * ?", description = "优加-定时查询宁波银行交易明细和回单定时任务", overwrite = false)
public class QueryNbCbYJAccDetailTodayJob implements SimpleJob {
@Autowired
private NbCbAccDetailService nbcAccDetailService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-定时查询宁波银行当天交易明细定时任务开始-----------------");
try {
nbcAccDetailService.queryNbCbAccDetailByDate(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-定时查询宁波银行当天交易明细定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbReceiptService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJReceiptJob", cron = "0 15 10,14 * * ?", description = "优加-定时查询宁波银行回单定时任务", overwrite = false)
public class QueryNbCbYJReceiptJob implements SimpleJob {
@Autowired
private NbCbReceiptService nbCbReceiptService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------优加-定时查询宁波银行回单定时任务开始-----------------");
try {
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-定时查询宁波银行回单定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbReceiptService;
import cn.com.glsx.dj.financial.util.DateUtils;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@Slf4j
@ElasticJobConf(name = "QueryNbCbYJReceiptMonthlyJob", cron = "0 30 0 1 * ?", description = "每月定时查询宁波银行回单定时任务", overwrite = false)
public class QueryNbCbYJReceiptMonthlyJob implements SimpleJob {
@Autowired
private NbCbReceiptService nbCbReceiptService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------每月定时查询宁波银行回单定时任务开始-----------------");
try {
// 查询上月全流水
DateTime baseDateTime = DateUtil.offsetDay(DateUtil.beginOfMonth(new Date()), -1);
DateTime beginOfMonth = DateUtil.beginOfMonth(baseDateTime);
DateTime endOfMonth = DateUtil.endOfMonth(baseDateTime);
String beginDateStr = DateUtils.formatDate(beginOfMonth, DateUtils.DEFAULT_DATE_FORMAT);
String endDateStr = DateUtils.formatDate(endOfMonth, DateUtils.DEFAULT_DATE_FORMAT);
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), beginDateStr, endDateStr, CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------每月定时查询宁波银行回单定时任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.mapper;
import cn.com.glsx.dj.financial.model.ApprovalPayChannelRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface ApprovalPayChannelRuleMapper extends OreMapper<ApprovalPayChannelRule> {
/**
* 查询指定模板下已启用的规则,按优先级降序排列
*
* @param templateId 模板ID
* @return 规则列表
*/
List<ApprovalPayChannelRule> queryEnabledRules(@Param("templateId") String templateId);
}
......@@ -15,6 +15,8 @@ public interface ApprovalRecordsMapper extends OreMapper<ApprovalRecords> {
ApprovalRecords findByThirdNo(@Param("thirdNo") String thirdNo);
ApprovalRecords findByMerchantSpNo(@Param("merchantSpNo") String merchantSpNo);
/**
* 查询审批单详情(H5-到账伴侣 应用通知详情专用)
*
......
......@@ -30,13 +30,13 @@ public interface NbCbAccDetailMapper extends OreMapper<NbCbAccDetail> {
List<String> listDistinctBankAcc(NbCbAccDetailDTO condition);
List<String> selectAccNameList();
List<String> selectAccNameList(NbCbAccDetailDTO condition);
List<String> selectBankTypeList();
List<String> selectBankTypeList(NbCbAccDetailDTO condition);
List<String> selectBankAccList();
List<String> selectBankAccList(NbCbAccDetailDTO condition);
List<String> selectBankNameList();
List<String> selectBankNameList(NbCbAccDetailDTO condition);
List<String> selectOppAccNameList();
......
......@@ -16,8 +16,7 @@ public interface NbCbAccountMapper extends OreMapper<NbCbAccount> {
*
* @return
*/
@Select("SELECT bank_acc FROM nb_cb_account WHERE deleted_flag = 'N'")
List<String> listAccount();
List<String> listAccount(String custId);
List<NbCbAccount> selectByBankAccListByBankAcc(List<String> bankAccList);
......
......@@ -15,5 +15,5 @@ public interface NbCbBatchTransferMapper extends OreMapper<NbCbBatchTransfer> {
List<NbCbBatchTransferDTO> list(NbCbBatchTransferDTO condition);
List<NbCbBatchTransfer> listTransferLaunchedRecordByIdList(@Param("idList") List<Integer> idList, @Param("status")Byte status, @Param("allFinalStatus")List<Integer> allFinalStatus);
List<NbCbBatchTransfer> listTransferLaunchedRecordByIdList(@Param("idList") List<Integer> idList, @Param("status")Byte status, @Param("allFinalStatus")List<Integer> allFinalStatus, @Param("custId")String custId);
}
\ No newline at end of file
package cn.com.glsx.dj.financial.mapper;
import cn.com.glsx.dj.financial.model.ApprovalTemplateConfig;
import cn.com.glsx.dj.financial.model.NbCbCustInfo;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface NbCbCustInfoMapper extends OreMapper<NbCbCustInfo> {
}
\ No newline at end of file
......@@ -16,8 +16,13 @@ public interface NbCbTransferMapper extends OreMapper<NbCbTransfer> {
List<NbCbTransferDTO> list(NbCbTransferDTO nbCbTransferDTO);
/**
* 待付清单 UNION 二手车付款列表查询(用于合并分页)
*/
List<NbCbTransferDTO> pageUnionList(NbCbTransferDTO nbCbTransferDTO);
List<Integer> getDistinctNbTransferStatus();
List<NbCbTransfer> listTransferLaunchedRecordByIdList(@Param("idList") List<Integer> idList, @Param("status")Byte status, @Param("allFinalStatus")List<Integer> allFinalStatus);
List<NbCbTransfer> listTransferLaunchedRecordByIdList(@Param("idList") List<Integer> idList, @Param("status")Byte status, @Param("allFinalStatus")List<Integer> allFinalStatus,@Param("custId") String custId);
}
\ No newline at end of file
......@@ -76,9 +76,9 @@ public class NbCbAccDetailRemoteImpl implements NbCbAccDetailRemote{
}
@Override
public RpcResponse<NbCbAccDetailDTO> accDetailConfig() {
public RpcResponse<NbCbAccDetailDTO> accDetailConfig(NbCbAccDetailDTO condition) {
try {
return RpcResponse.success(nbCbAccDetailService.accDetailConfig());
return RpcResponse.success(nbCbAccDetailService.accDetailConfig(condition));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
......
......@@ -71,6 +71,16 @@ public class NbCbTransferRemoteImpl implements NbCbTransferRemote {
}
@Override
public RpcResponse<RpcPagination<NbCbTransferDTO>> pageUnion(RpcPagination<NbCbTransferDTO> pagination) {
try {
return RpcResponse.success(RpcPagination.copyPage(nbCbTransferService.pageUnion(pagination)));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<NbCbTransferDTO> getTransferDetail(Integer id) {
try {
return RpcResponse.success(nbCbTransferService.getAccDetail(id));
......
......@@ -99,10 +99,10 @@ public class ApprovalRecordService {
String receiptFilUrl = "";
Integer payChannel = tempRecord.getPayChannel();
if (Objects.equals(payChannel, ChannelType.NIBO_BANK.getBusType())) {
receiptFilUrl = nbCbReceiptMapper.getFileUrlByTransferDjSerialNo(tempRecord.getSpNo());
receiptFilUrl = nbCbReceiptMapper.getFileUrlByTransferDjSerialNo(tempRecord.getMerchantSpNo());
}
if (Objects.equals(payChannel, ChannelType.NIBO_BANK_BATCH.getBusType())) {
receiptFilUrl = nbCbReceiptMapper.getFileUrlByBatchTransferDjSerialNo(tempRecord.getSpNo());
receiptFilUrl = nbCbReceiptMapper.getFileUrlByBatchTransferDjSerialNo(tempRecord.getMerchantSpNo());
}
......
package cn.com.glsx.dj.financial.service;
import cn.com.glsx.dj.financial.mapper.ApprovalPayChannelRuleMapper;
import cn.com.glsx.dj.financial.mapper.NbCbDailyReportAccountMapper;
import cn.com.glsx.dj.financial.model.ApprovalPayChannelRule;
import cn.com.glsx.dj.financial.model.ApprovalRecords;
import cn.com.glsx.dj.financial.model.ApprovalTemplateConfig;
import cn.com.glsx.dj.financial.model.NbCbDailyReportAccount;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.List;
/**
* 审批付款渠道动态路由规则服务
* <p>
* 职责:根据 approval_pay_channel_rule 表中的规则,决定是否覆写模板默认的付款渠道。
* 全局开关:pay.channel.rule.enabled=false 可一键关闭所有规则,恢复模板默认值。
* 注意:通过 Environment 动态读取配置,
* </p>
*/
@Service
@Slf4j
public class PayChannelRuleService {
/** 全局开关配置 Key,默认启用 */
private static final String GLOBAL_ENABLED_KEY = "pay.channel.rule.enabled";
@Autowired
private Environment environment;
@Autowired
private ApprovalPayChannelRuleMapper approvalPayChannelRuleMapper;
@Autowired
private NbCbDailyReportAccountMapper nbCbDailyReportAccountMapper;
/**
* 解析并返回最终应使用的付款渠道
* <p>
* 1. 全局开关关闭 → 直接返回模板默认值
* 2. 查询该模板下已启用的规则(按优先级降序)
* 3. 依次匹配,第一条命中的规则生效
* 4. 全部未命中 → 返回模板默认值
* </p>
*
* @param templateConfig 模板配置(提供模板ID和默认付款渠道)
* @param approvalRecords 审批记录(提供金额、付款主体等信息)
* @return 最终使用的付款渠道值
*/
public Integer resolve(ApprovalTemplateConfig templateConfig, ApprovalRecords approvalRecords) {
Integer defaultPayChannel = templateConfig.getPayChannel();
// 每次调用时实时读取, 配置热更新后无需重启即可生效
boolean globalEnabled = Boolean.parseBoolean(environment.getProperty(GLOBAL_ENABLED_KEY, "true"));
if (!globalEnabled) {
log.debug("付款渠道规则全局开关已关闭,使用模板默认渠道:{}", defaultPayChannel);
return defaultPayChannel;
}
String templateId = approvalRecords.getTemplateId();
List<ApprovalPayChannelRule> rules = approvalPayChannelRuleMapper.queryEnabledRules(templateId);
if (CollectionUtils.isEmpty(rules)) {
return defaultPayChannel;
}
for (ApprovalPayChannelRule rule : rules) {
if (matchRule(rule, approvalRecords)) {
log.info("spNo:{} 命中付款渠道规则[{}],付款渠道由 {} 覆写为 {}",
approvalRecords.getSpNo(), rule.getRuleName(),
defaultPayChannel, rule.getTargetPayChannel());
return rule.getTargetPayChannel();
}
}
return defaultPayChannel;
}
/**
* 判断审批记录是否匹配指定规则
* <p>
* 所有非 null 条件均需满足,才算命中。
* 后续新增维度:只在此方法末尾追加判断即可,主流程无需修改。
* </p>
*
* @param rule 规则配置
* @param approvalRecords 审批记录
* @return true-命中
*/
private boolean matchRule(ApprovalPayChannelRule rule, ApprovalRecords approvalRecords) {
// 条件1:金额上限(含)
BigDecimal amountMax = rule.getAmountMax();
if (amountMax != null) {
BigDecimal amount = approvalRecords.getAmount();
if (amount == null || amount.compareTo(amountMax) > 0) {
log.info("spNo:{} 金额超出规则上限,规则ID:{}, 金额:{}", approvalRecords.getSpNo(), rule.getId(), amount);
return false;
}
}
// 条件2:付款主体公司级别
Integer payerEntityLevel = rule.getPayerEntityLevel();
if (payerEntityLevel != null) {
if (!isPayerEntityMatchLevel(approvalRecords.getPayerEntity(), payerEntityLevel)) {
log.info("spNo:{} 付款主体公司级别不匹配,规则ID:{}, 付款主体:{}", approvalRecords.getSpNo(), rule.getId(), approvalRecords.getPayerEntity());
return false;
}
}
return true;
}
/**
* 检查付款主体是否属于指定公司级别
*
* @param payerEntity 付款主体名称
* @param targetLevel 目标公司级别(1-母公司 2-子公司)
* @return true-匹配
*/
private boolean isPayerEntityMatchLevel(String payerEntity, Integer targetLevel) {
if (StringUtils.isBlank(payerEntity)) {
return false;
}
Example example = new Example(NbCbDailyReportAccount.class);
example.createCriteria()
.andEqualTo("companyName", payerEntity)
.andEqualTo("companyLevel", targetLevel)
.andEqualTo("status", 1);
List<NbCbDailyReportAccount> accounts = nbCbDailyReportAccountMapper.selectByExample(example);
return CollectionUtils.isNotEmpty(accounts);
}
}
......@@ -14,6 +14,7 @@ import cn.com.glsx.dj.financial.model.qw.WorkWechatOAGetApprovalDetailResponseDT
import cn.com.glsx.dj.financial.model.qw.WorkWechatOAGetApprovalDetailResponseDTO.Info.ApplyData.Content;
import cn.com.glsx.dj.financial.model.qw.WorkWechatOAGetApprovalDetailResponseDTO.Info.ApplyData.Content.ContentValue;
import cn.com.glsx.dj.financial.model.qw.WorkWechatOAGetApprovalDetailResponseDTO.Info.ApplyData.Content.ContentValue.Selector;
import cn.com.glsx.dj.financial.service.nb.NbCbCustInfoService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.wechat.dto.workwechat.department.request.GetWorkWechatDepartmentListRequestDTO;
......@@ -66,6 +67,11 @@ public class QWApprovalService {
@Autowired
private NbCbAccReceiptFileUploadService financeFileUploadService;
@Autowired
private PayChannelRuleService payChannelRuleService;
@Autowired
private NbCbCustInfoService nbCbCustInfoService;
/**
* 1.处理审批记录 2.记录审批记录
*
......@@ -91,10 +97,19 @@ public class QWApprovalService {
String spUser = getSpUsers(info);
approvalRecords.setSpUser(spUser);
String mediaUrl = getMediaUrls(info);
Example example = new Example(ApprovalTemplateConfig.class);
example.createCriteria().andEqualTo("delFlag",0)
.andEqualTo("templateId", info.getTemplateId());
List<ApprovalTemplateConfig> templateConfigs = approvalTemplateConfigMapper.selectByExample(example);
ApprovalTemplateConfig templateConfig = CollectionUtils.isNotEmpty(templateConfigs) ? templateConfigs.get(0) : null;
Integer merchantId = templateConfig != null ? templateConfig.getMerchantId() : null;
String mediaUrl = getMediaUrls(info, merchantId);
approvalRecords.setSpMediaUrl(mediaUrl);
// 获取商户信息
GetWorkWechatUserRequestDTO getWorkWechatUserRequestDTO = new GetWorkWechatUserRequestDTO();
getWorkWechatUserRequestDTO.setMerchantId(merchantId);
getWorkWechatUserRequestDTO.setUserId(applyer.getUserid());
WorkWechatUserResponseDTO workWechatUserResponseDTO = qwManager.userInfo(
getWorkWechatUserRequestDTO);
......@@ -110,6 +125,7 @@ public class QWApprovalService {
if (StringUtils.isNotBlank(partyid)) {
GetWorkWechatDepartmentListRequestDTO departmentListRequestDTO = new GetWorkWechatDepartmentListRequestDTO();
departmentListRequestDTO.setId(Integer.valueOf(partyid));
departmentListRequestDTO.setMerchantId(merchantId);
WorkWechatDepartmentListResponseDTO departmentResp = qwManager.departmentInfo(departmentListRequestDTO);
List<WorkWechatDepartmentResponseDTO> departments = departmentResp.getDepartment();
if (CollectionUtils.isNotEmpty(departments)) {
......@@ -123,14 +139,12 @@ public class QWApprovalService {
}
approvalRecords.setCreatedAt(new Date());
approvalRecords.setMerchantSpNo(merchantId + "_" + info.getSpNo());
approvalRecords.setMerchantId(merchantId);
//根据模板设置付款渠道 如果是二手车业务走批量付款,非二手车业务走单笔付款
Example example = new Example(ApprovalTemplateConfig.class);
example.createCriteria().andEqualTo("delFlag",0)
.andEqualTo("templateId", info.getTemplateId());
List<ApprovalTemplateConfig> templateConfigs = approvalTemplateConfigMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(templateConfigs)) {
approvalRecords.setPayChannel(templateConfigs.get(0).getPayChannel());
if (templateConfig != null) {
approvalRecords.setPayChannel(templateConfig.getPayChannel());
}
if (applyData != null) {
// 1.提取申请信息
......@@ -143,7 +157,11 @@ public class QWApprovalService {
if (CollectionUtils.isNotEmpty(approvalTemplateDetails)) {
buildApprovalInfo(convertJsonToMap, approvalTemplateDetails, approvalRecords);
approvalRecords.setSpNo(info.getSpNo());
// 3.必填字段值校验
// 3.动态规则覆写付款渠道(在 buildApprovalInfo 之后,amount/payerEntity 已赋值)
if (templateConfig != null) {
approvalRecords.setPayChannel(payChannelRuleService.resolve(templateConfig, approvalRecords));
}
// 4.必填字段值校验
if (checkAppParams(approvalRecords)) {
approvalRecords.setThirdRequestStatus(QWApprovalOrderStatusEnum.PENDING_INITIATE.getValue());
} else {
......@@ -171,7 +189,7 @@ public class QWApprovalService {
* @param info
* @return
*/
private String getMediaUrls(WorkWechatOAGetApprovalDetailResponseDTO.Info info) {
private String getMediaUrls(WorkWechatOAGetApprovalDetailResponseDTO.Info info, Integer merchantId) {
List<String> spMediaIds = new ArrayList<>();
// 解析审批申请提交的附件
List<Content> contents = info.getApplyData().getContents();
......@@ -206,7 +224,7 @@ public class QWApprovalService {
List<Map<String, String>> spMediaUrls = new ArrayList<>();
for (String mediaId : spMediaIds) {
Map<String, String> mediaInfo = getMediaInfo(mediaId);
Map<String, String> mediaInfo = getMediaInfo(mediaId, merchantId);
if (CollectionUtil.isNotEmpty(mediaInfo)) {
spMediaUrls.add(mediaInfo);
}
......@@ -283,7 +301,7 @@ public class QWApprovalService {
* @param mediaId
* @return
*/
private Map<String, String> getMediaInfo(String mediaId) {
private Map<String, String> getMediaInfo(String mediaId, Integer merchantId) {
String endpointPost = environment.getProperty("financial.aliyun.oss.endpoint");
String bucketName = environment.getProperty("financial.aliyun.oss.bucketName");
String accessKeyId = environment.getProperty("financial.aliyun.oss.accessKeyId");
......@@ -295,6 +313,7 @@ public class QWApprovalService {
requestDTO.setBucketName(bucketName);
requestDTO.setAccessKeyId(accessKeyId);
requestDTO.setAccessKeySecret(accessKeySecret);
requestDTO.setMerchantId(merchantId);
GetWorkWechatMediaResponseDTO media = qwManager.getMediaUrl(requestDTO);
if (Objects.isNull(media) || !media.isSuccess()) {
log.error("获取附件mediaId:{} 异常", mediaId);
......@@ -550,8 +569,19 @@ public class QWApprovalService {
return;
}
//查询模板配置的cust_type
ApprovalTemplateConfig condition = new ApprovalTemplateConfig();
condition.setDelFlag(0);
condition.setMerchantId(approvalRecord.getMerchantId());
condition.setTemplateId(approvalRecord.getTemplateId());
ApprovalTemplateConfig templateConfig = approvalTemplateConfigMapper.selectOne(condition);
if(Objects.isNull(templateConfig)){
log.info(String.format("未找到对应模板配置,approvalRecord:%s",JSONObject.toJSONString(approvalRecord)));
return;
}
String custId = nbCbCustInfoService.getCustIdByType(Integer.valueOf(templateConfig.getCustType()));
// 1. 构建请求参数
Object requestParams = strategy.buildRequestParams(approvalRecord);
Object requestParams = strategy.buildRequestParams(approvalRecord,custId, Integer.valueOf(templateConfig.getCustType()));
// 2. 发送请求
RpcResponse<String> stringRpcResponse = strategy.sendRequest(requestParams);
......@@ -598,6 +628,7 @@ public class QWApprovalService {
workWechatTextMessageDTO.setContent(stringBuffer.toString());
sendWorkWechatMessageRequestDTO.setText(workWechatTextMessageDTO);
sendWorkWechatMessageRequestDTO.setMerchantId(approvalRecord.getMerchantId());
SendWorkWechatMessageResponseDTO sendWorkWechatMessageResponseDTO = qwManager.sendMessage(
sendWorkWechatMessageRequestDTO);
......@@ -624,7 +655,7 @@ public class QWApprovalService {
// 验证回调数据完整性
validateCallbackData(callbackData);
ApprovalRecords approvalRecords=approvalRecordsMapper.findByThirdNo(callbackData.getSpNo());
ApprovalRecords approvalRecords=approvalRecordsMapper.findByMerchantSpNo(callbackData.getSpNo());
if(approvalRecords==null){
log.info("未找到对应的审批记录");
return;
......@@ -658,4 +689,13 @@ public class QWApprovalService {
public ApprovalRecords getBySpNo(String spNo) {
return approvalRecordsMapper.getBySpNo(spNo);
}
public ApprovalTemplateConfig getTemplateConfig(String templateId) {
Example example = new Example(ApprovalTemplateConfig.class);
example.createCriteria().andEqualTo("delFlag",0)
.andEqualTo("templateId", templateId);
List<ApprovalTemplateConfig> templateConfigs = approvalTemplateConfigMapper.selectByExample(example);
return templateConfigs.isEmpty() ? null : templateConfigs.get(0);
}
}
......@@ -116,6 +116,7 @@ public class QWApprovalSyncService {
for (String s : list) {
WorkWechatOAGetApprovalDetailRequestDTO workWechatOAGetApprovalDetailRequestDTO = new WorkWechatOAGetApprovalDetailRequestDTO();
workWechatOAGetApprovalDetailRequestDTO.setSpNo(s);
workWechatOAGetApprovalDetailRequestDTO.setMerchantId(approvalTemplateConfig.getMerchantId());
WorkWechatOAGetApprovalDetailResponseDTO workWechatOAGetApprovalDetailResponseDTO = qwManager.getApprovalDetail(workWechatOAGetApprovalDetailRequestDTO);
if (workWechatOAGetApprovalDetailResponseDTO != null && checkCondition(workWechatOAGetApprovalDetailResponseDTO, approvalTemplateConfig)) {
workWechatOAGetApprovalDetailResponseDTOList.add(workWechatOAGetApprovalDetailResponseDTO);
......@@ -159,11 +160,11 @@ public class QWApprovalSyncService {
finish = true;
}
List<String> processingList = getAllApprovalNo(approvalTemplateConfig.getTemplateId(), startTime, endTime, "", "1");// 审批中
List<String> processingList = getAllApprovalNo(approvalTemplateConfig, startTime, endTime, "", "1");// 审批中
if (CollectionUtils.isNotEmpty(processingList)) {
list.addAll(processingList);
}
List<String> passedList = getAllApprovalNo(approvalTemplateConfig.getTemplateId(), startTime, endTime, "", "2");// 审批通过
List<String> passedList = getAllApprovalNo(approvalTemplateConfig, startTime, endTime, "", "2");// 审批通过
if (CollectionUtils.isNotEmpty(passedList)) {
list.addAll(passedList);
}
......@@ -211,11 +212,15 @@ public class QWApprovalSyncService {
}
}
public List<String> getAllApprovalNo(String templateId, Long startTime, Long endTime,String newCursor, String spStatus) {
public List<String> getAllApprovalNo(ApprovalTemplateConfig approvalTemplateConfig, Long startTime, Long endTime, String newCursor, String spStatus) {
List<String> approvallist = new ArrayList<>();
GetWorkWechatApprovalInfoRequestDTO getWorkWechatApprovalInfoRequestDTO = new GetWorkWechatApprovalInfoRequestDTO();
getWorkWechatApprovalInfoRequestDTO.setStartTime(startTime);
getWorkWechatApprovalInfoRequestDTO.setEndTime(endTime);
//设置模板中的商户id
if (approvalTemplateConfig.getMerchantId() != null) {
getWorkWechatApprovalInfoRequestDTO.setMerchantId(approvalTemplateConfig.getMerchantId());
}
Integer queryPageSize = environment.getProperty("approval.query.page.size", Integer.class);
if (Objects.nonNull(queryPageSize)) {
......@@ -225,7 +230,7 @@ public class QWApprovalSyncService {
List<Filter> filters = new ArrayList<>();
Filter spStatusFilter = new Filter("sp_status", spStatus);
filters.add(spStatusFilter);
Filter template_id = new Filter("template_id",templateId);
Filter template_id = new Filter("template_id", approvalTemplateConfig.getTemplateId());
filters.add(template_id);
getWorkWechatApprovalInfoRequestDTO.setFilters(filters);
getWorkWechatApprovalInfoRequestDTO.setNewCursor(newCursor);
......@@ -241,7 +246,7 @@ public class QWApprovalSyncService {
return approvallist;
}
List<String> tempList = getAllApprovalNo(templateId, startTime, endTime, getapprovalinfo.getNewNextCursor(), spStatus);
List<String> tempList = getAllApprovalNo(approvalTemplateConfig, startTime, endTime, getapprovalinfo.getNewNextCursor(), spStatus);
if (CollectionUtils.isNotEmpty(tempList)) {
approvallist.addAll(tempList);
}
......
......@@ -5,7 +5,9 @@ import cn.com.glsx.dj.financial.enums.BatchTransferSourceEnum;
import cn.com.glsx.dj.financial.enums.QWApprovalOrderStatusEnum;
import cn.com.glsx.dj.financial.manager.QWManager;
import cn.com.glsx.dj.financial.mapper.ApprovalRecordsMapper;
import cn.com.glsx.dj.financial.mapper.ApprovalTemplateConfigMapper;
import cn.com.glsx.dj.financial.model.ApprovalRecords;
import cn.com.glsx.dj.financial.model.ApprovalTemplateConfig;
import cn.com.glsx.dj.financial.model.EnterpriseBankAccount;
import cn.com.glsx.dj.financial.model.qw.CallbackData;
import cn.com.glsx.dj.financial.remote.NbCbTransferRemoteImpl;
......@@ -20,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.*;
/**
* 第三方宁波银行批量转账
......@@ -50,9 +49,11 @@ public class ThirdPartyNiBoBatchStrategy implements ThirdPartyStrategy{
@Autowired
private QWApprovalService qwApprovalService;
@Autowired
private ApprovalTemplateConfigMapper approvalTemplateConfigMapper;
@Override
public Object buildRequestParams(ApprovalRecords approvalRecord) {
public Object buildRequestParams(ApprovalRecords approvalRecord,String custId, Integer custType) {
NbCbBatchTransferParamDTO batchTransferParam= new NbCbBatchTransferParamDTO();
batchTransferParam.setPayName(approvalRecord.getPayerEntity());
// 转化收款账号
......@@ -86,7 +87,9 @@ public class ThirdPartyNiBoBatchStrategy implements ThirdPartyStrategy{
purpose = bankSummary;
}
}
batchTransferParam.setSpNo(approvalRecord.getSpNo());
batchTransferParam.setCustType(custType);
batchTransferParam.setCustId(custId);
batchTransferParam.setPayAcc(payerAccount);
batchTransferParam.setPayName(payerAccountName);
batchTransferParam.setRcvAcc(approvalRecord.getBankAccount());
......@@ -95,7 +98,19 @@ public class ThirdPartyNiBoBatchStrategy implements ThirdPartyStrategy{
batchTransferParam.setAmt(approvalRecord.getAmount());
batchTransferParam.setPurpose(purpose);
batchTransferParam.setBatchTransferSource(BatchTransferSourceEnum.SECOND_HAND_CAR.getValue());
batchTransferParam.setDjSerialNo(approvalRecord.getSpNo());
String templateId = approvalRecord.getTemplateId();
ApprovalTemplateConfig templateConfig = qwApprovalService.getTemplateConfig(templateId);
if (Objects.nonNull(templateConfig)) {
String templateName = templateConfig.getTemplateName();
if (templateName.contains("二手车")) {
batchTransferParam.setBatchTransferSource(BatchTransferSourceEnum.SECOND_HAND_CAR.getValue());
} else {
batchTransferParam.setBatchTransferSource(BatchTransferSourceEnum.GL_QW_OA_AUTO_PAYMENT.getValue());
}
}
//batchTransferParam.setDjSerialNo(approvalRecord.getSpNo());
batchTransferParam.setDjSerialNo(approvalRecord.getMerchantSpNo());
batchTransferParam.setBusinessCode("nis_batch_transfer");
batchTransferParam.setPaymentMethod(approvalRecord.getPaymentMethod());
return batchTransferParam;
......@@ -173,6 +188,7 @@ public class ThirdPartyNiBoBatchStrategy implements ThirdPartyStrategy{
}
sendMessageRequestDTO.setToUser(qwUserId);
sendMessageRequestDTO.setMerchantId(approvalRecords.getMerchantId());
SendWorkWechatMessageResponseDTO sendWorkWechatMessageResponseDTO = qwManager.sendMessage(sendMessageRequestDTO);
if (sendWorkWechatMessageResponseDTO.isSuccess()) {
log.info("发送企微通知:{} 成功", qwUserId);
......
......@@ -63,7 +63,7 @@ public class ThirdPartyNiBoStrategy implements ThirdPartyStrategy{
private KafkaTopicConfig kafkaTopicConfig;
@Override
public Object buildRequestParams(ApprovalRecords approvalRecord) {
public Object buildRequestParams(ApprovalRecords approvalRecord,String custId, Integer custType) {
NbCbTransferParamDTO transferParam= new NbCbTransferParamDTO();
transferParam.setPayName(approvalRecord.getPayerEntity());
// 转化收款账号
......@@ -116,7 +116,9 @@ public class ThirdPartyNiBoStrategy implements ThirdPartyStrategy{
if (StringUtils.isNotBlank(paymentMethod) && !PaymentMethodEnum.BANK_TRANSFER.getDisplayName().equals(paymentMethod)) {
pushNb = false;
}
transferParam.setSpNo(approvalRecord.getSpNo());
transferParam.setCustType(custType);
transferParam.setCustId(custId);
transferParam.setPayAcc(payerAccount);
transferParam.setPayName(payerAccountName);
transferParam.setRcvAcc(approvalRecord.getBankAccount());
......@@ -125,7 +127,8 @@ public class ThirdPartyNiBoStrategy implements ThirdPartyStrategy{
transferParam.setAmt(approvalRecord.getAmount());
transferParam.setPurpose(purpose);
transferParam.setTransferSource(TransferSourceEnum.WE_WECHAT_OA.getValue());
transferParam.setDjSerialNo(approvalRecord.getSpNo());
//transferParam.setDjSerialNo(approvalRecord.getSpNo());
transferParam.setDjSerialNo(approvalRecord.getMerchantSpNo());
transferParam.setPushNb(pushNb);
transferParam.setPayType(PaymentMethodEnum.getByDisplayName(approvalRecord.getPaymentMethod()));
transferParam.setRemark(approvalRecord.getRemarks());
......@@ -204,6 +207,7 @@ public class ThirdPartyNiBoStrategy implements ThirdPartyStrategy{
}
sendMessageRequestDTO.setToUser(qwUserId);
sendMessageRequestDTO.setMerchantId(approvalRecords.getMerchantId());
// 推送到账伴侣应用消息
SendWorkWechatMessageResponseDTO sendWorkWechatMessageResponseDTO = qwManager.sendMessage(sendMessageRequestDTO);
if (sendWorkWechatMessageResponseDTO.isSuccess()) {
......
......@@ -3,10 +3,11 @@ package cn.com.glsx.dj.financial.service;
import cn.com.glsx.dj.financial.model.ApprovalRecords;
import cn.com.glsx.dj.financial.model.qw.CallbackData;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import io.swagger.models.auth.In;
public interface ThirdPartyStrategy {
Object buildRequestParams(ApprovalRecords approvalRecord); // 构建请求参数
Object buildRequestParams(ApprovalRecords approvalRecord, String custId, Integer custType); // 构建请求参数
RpcResponse<String> sendRequest(Object requestParams); // 发送请求
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.dj.financial.service.nb;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.dto.NbCbAccResponseDTO;
import cn.com.glsx.dj.financial.dto.NbCbAccountDTO;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.mapper.NbCbAccountMapper;
import cn.com.glsx.dj.financial.model.NbCbAccount;
import cn.com.glsx.dj.financial.util.NbCbCommonUtil;
......@@ -26,6 +27,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -54,6 +56,12 @@ public class NbCbAccountService {
@Autowired
private RedisService redisService;
@Resource
private NbCbCommonUtil nbcbCommonUtil;
@Autowired
private NbCbCustInfoService nbCbCustInfoService;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void insert(NbCbAccount nbCbAccount) {
RpcAssert.assertNotNull(nbCbAccount, DefaultErrorEnum.DATA_NULL, "nbCbReceipt is null");
......@@ -72,7 +80,7 @@ public class NbCbAccountService {
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void insertOrUpdate(List<NbCbAccount> insertList) {
public void insertOrUpdate(List<NbCbAccount> insertList,String custId) {
RpcAssert.assertNotEmpty(insertList, DefaultErrorEnum.DATA_NULL, "nbCbReceipt is null");
try {
List<String> bankAccList = insertList.stream().map(NbCbAccount::getBankAcc).collect(Collectors.toList());
......@@ -98,6 +106,7 @@ public class NbCbAccountService {
if (CollectionUtils.isNotEmpty(newDataList)) {
for (NbCbAccount nbCbAccount : newDataList) {
Date date = new Date();
nbCbAccount.setCustId(custId);
nbCbAccount.setCreatedDate(date);
nbCbAccount.setCreatedBy(CommonConstants.MIDDLE_WARE);
nbCbAccount.setUpdatedBy(CommonConstants.MIDDLE_WARE);
......@@ -113,14 +122,14 @@ public class NbCbAccountService {
}
}
public void queryNbCbAccount(String jobParameter) {
public void queryNbCbAccount(String jobParameter,String custId) {
JSONObject jsonObject;
if (StringUtils.isNotBlank(jobParameter)) {
jsonObject = JSONObject.parseObject(jobParameter);
} else {
jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); //0000112058 test env
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "9000919969"));
jsonObjectDetail.put("custId", custId);
jsonObjectDetail.put("pageSize", "1000");
jsonObjectDetail.put("currentPage", "0");
jsonObjectDetail.put("curCode", "01");
......@@ -136,8 +145,8 @@ public class NbCbAccountService {
JSONObject jsonObject = jsonParam.getJSONObject("Data");
int currentPage = Integer.parseInt((String) jsonObject.get("currentPage")) + 1;
jsonObject.put("currentPage", String.valueOf(currentPage));
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonParam.toJSONString());
String custId = jsonObject.get("custId").toString();
JSONObject nbCbResponseData = nbcbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonParam.toJSONString());
if (Objects.isNull(nbCbResponseData)) {
log.info("定时查询宁波银行账户,返回报文data为空");
return;
......@@ -148,7 +157,7 @@ public class NbCbAccountService {
return;
}
List<NbCbAccount> detailList = JSONArray.parseArray(list.toJSONString(), NbCbAccount.class);
thiz.insertOrUpdate(detailList);
thiz.insertOrUpdate(detailList,custId);
int totalPage = Integer.parseInt((String) nbCbResponseData.get("totalPage"));
if (currentPage < totalPage) {
queryAndInsertAccountPage(jsonParam);
......@@ -185,7 +194,7 @@ public class NbCbAccountService {
JSONObject nbCbResponseData = null;
try {
nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonObject.toJSONString());
nbCbResponseData = nbcbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonObject.toJSONString());
} catch (Exception e) {
log.error("queryNbCbAccount error:{}", e.getMessage(), e);
}
......@@ -201,8 +210,8 @@ public class NbCbAccountService {
return JSONArray.parseArray(list.toJSONString(), NbCbAccount.class);
}
public List<String> listAccount() {
return accountMapper.listAccount();
public List<String> listAccount(String custId) {
return accountMapper.listAccount(custId);
}
public List<NbCbAccount> list(NbCbAccountDTO param) {
......@@ -210,8 +219,8 @@ public class NbCbAccountService {
}
public JSONArray listAccountArray() {
List<String> bankAccountsList = listAccount();
public JSONArray listAccountArray(String custId) {
List<String> bankAccountsList = listAccount(custId);
JSONArray jsonArray = new JSONArray();
jsonArray.addAll(bankAccountsList);
return jsonArray;
......@@ -227,6 +236,8 @@ public class NbCbAccountService {
if (redisService.exists(redisKey)) {
return buildResponseDTO(bankAccList);
}
//默认广联主体
String custId = nbCbCustInfoService.getCustIdByType(NbCbCustEnum.GL_CUST.getCustType());
//2、 缓存过期,查宁波第三方接口传参加一个宁波银行账户,封装bankAcc到bankAccList,将bankAccList传进jobParameter
//bankAccList 转JSONObject
......@@ -234,11 +245,11 @@ public class NbCbAccountService {
dataJsonObject.put("bankAccList", bankAccList);
dataJsonObject.put("pageSize", "10");
dataJsonObject.put("currentPage", "0");
dataJsonObject.put("custId", env.getProperty("nbcb.custId", "9000919969"));
dataJsonObject.put("custId", custId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Data", dataJsonObject);
queryNbCbAccount(jsonObject.toJSONString());
queryNbCbAccount(jsonObject.toJSONString(),custId);
//3、设置缓存
redisService.set(redisKey, "1", 60);
......
package cn.com.glsx.dj.financial.service.nb;
import cn.com.glsx.dj.financial.mapper.NbCbCustInfoMapper;
import cn.com.glsx.dj.financial.model.NbCbCustInfo;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
public class NbCbCustInfoService {
@Autowired
private NbCbCustInfoMapper nbCbCustInfoMapper;
public String getCustIdByType(Integer custType) {
NbCbCustInfo nbCbCustInfo = selectOneByType(custType);
if(Objects.isNull(nbCbCustInfo)){
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "未找到对应主体配置");
}
return nbCbCustInfo.getCustId();
}
public NbCbCustInfo selectOneByType(Integer custType) {
if(Objects.isNull(custType)){
return null;
}
NbCbCustInfo custInfoCondition = new NbCbCustInfo();
custInfoCondition.setCustType(custType);
custInfoCondition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
return nbCbCustInfoMapper.selectOne(custInfoCondition);
}
public NbCbCustInfo selectOneByCustId(String custId) {
if(StringUtils.isBlank(custId)){
return null;
}
NbCbCustInfo custInfoCondition = new NbCbCustInfo();
custInfoCondition.setCustId(custId);
custInfoCondition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
return nbCbCustInfoMapper.selectOne(custInfoCondition);
}
}
......@@ -111,6 +111,8 @@ public class OaApplyBatchTransferService {
oaApplyTransfer.setWechatType(transferParam.getWechatType());
oaApplyTransfer.setSourceType(transferParam.getSourceType());
oaApplyTransfer.setSpNo(spNo);
Integer merchantId = getWorkWechatMerchantId(transferParam.getWechatType());
oaApplyTransfer.setMerchantSpNo(merchantId + "_" + spNo);
oaApplyTransfer.setOaTemplateType(transferParam.getOaTemplateType());
oaApplyTransfer.setTemplateTitle(transferParam.getTemplateTitle());
oaApplyTransfer.setDepartment(transferParam.getDepartment());
......
......@@ -108,6 +108,8 @@ public class OaApplyTransferService {
oaApplyTransfer.setBizSerialNo(transferParam.getBizSerialNo());
oaApplyTransfer.setWechatType(transferParam.getWechatType());
oaApplyTransfer.setSource(transferParam.getSource());
Integer merchantId = getWorkWechatMerchantId(transferParam.getWechatType());
oaApplyTransfer.setMerchantSpNo(merchantId + "_" + spNo);
oaApplyTransfer.setSpNo(spNo);
oaApplyTransfer.setOaTemplateType(transferParam.getOaTemplateType());
oaApplyTransfer.setTemplateTitle(transferParam.getTemplateTitle());
......
package cn.com.glsx.dj.financial.util;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.enums.TransferErrorEnum;
import cn.com.glsx.dj.financial.mapper.NbCbCustInfoMapper;
import cn.com.glsx.dj.financial.model.NbCbCustInfo;
import cn.com.glsx.dj.financial.model.NbGetGeneralDownloadInfo;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
......@@ -9,6 +13,8 @@ import com.alibaba.fastjson.JSONObject;
import com.nbcb.sdk.OpenSDK;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Objects;
......@@ -19,11 +25,17 @@ import java.util.Objects;
* @Version: 1.0
*/
@Slf4j
@Component
public class NbCbCommonUtil {
public static JSONObject getNbCbResponseData(String productId, String serviceID, String jsonString) throws Exception {
@Autowired
private NbCbCustInfoMapper nbCbCustInfoMapper;
public JSONObject getNbCbResponseData(String productId, String serviceID, String jsonString) throws Exception {
log.info("查询宁波银行接口 productId:{}, serviceID:{}, parma:{}", productId, serviceID, jsonString);
String res = OpenSDK.send(productId, serviceID, jsonString);
String appKey = getAppKey(jsonString);
String res = OpenSDK.send(appKey,productId, serviceID, jsonString);
log.info("查询宁波银行接口 response" + res);
JSONObject resonseJSON = JSONObject.parseObject(res);
JSONObject jsonData = resonseJSON.getJSONObject("Data");
......@@ -35,14 +47,41 @@ public class NbCbCommonUtil {
return null;
}
public static JSONObject getNbCbResponseData2(String productId, String serviceID, String jsonString) throws Exception {
public JSONObject getNbCbResponseData2(String productId, String serviceID, String jsonString) throws Exception {
log.info("查询宁波银行接口 productId:{}, serviceID:{}, parma:{}", productId, serviceID, jsonString);
String res = OpenSDK.send(productId, serviceID, jsonString);
String appKey = getAppKey(jsonString);
String res = OpenSDK.send(appKey,productId, serviceID, jsonString);
log.info("查询宁波银行接口 response" + res);
JSONObject resonseJSON = JSONObject.parseObject(res);
return resonseJSON.getJSONObject("Data");
}
/**
* 从jsonString中获取appKey
* @param jsonString
* @return
*/
public String getAppKey(String jsonString) throws Exception {
if(StringUtils.isBlank(jsonString)){
throw new RpcServiceException(TransferErrorEnum.PARAM_ERROR, "jsonString不能为空");
}
// 从 jsonString 中获取 custId
JSONObject requestJson = JSONObject.parseObject(jsonString);
JSONObject dataObj = requestJson.getJSONObject("Data"); // 先获取 Data 对象
String custId = dataObj.getString("custId");
if(StringUtils.isBlank(custId)){
throw new RpcServiceException(TransferErrorEnum.PARAM_ERROR, "custId不能为空");
}
// 根据 custId 获取枚举配置
NbCbCustInfo custInfoCondition = new NbCbCustInfo();
custInfoCondition.setCustId(custId);
custInfoCondition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
NbCbCustInfo nbCbCustInfo = nbCbCustInfoMapper.selectOne(custInfoCondition);
if(Objects.isNull(nbCbCustInfo)){
throw new RpcServiceException(TransferErrorEnum.PARAM_ERROR, "未找到对应主体配置");
}
return nbCbCustInfo.getAppKey();
}
/**
* 从响应数据中提取错误信息
......@@ -69,8 +108,8 @@ public class NbCbCommonUtil {
return retMsg != null ? retMsg.toString() : "未知错误";
}
public static boolean getRequestResult(JSONObject jsonParam, String productId, String serviceID) throws Exception{
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData2(productId, serviceID, jsonParam.toJSONString());
public boolean getRequestResult(JSONObject jsonParam, String productId, String serviceID) throws Exception{
JSONObject nbCbResponseData = getNbCbResponseData2(productId, serviceID, jsonParam.toJSONString());
if (Objects.isNull(nbCbResponseData)) {
log.error("查询宁波银行接口,响应接口为空 productId:{}, serviceID:{}, parma:{}", productId, serviceID, jsonParam);
throw new RpcServiceException(TransferErrorEnum.TRANSFER_ERROR, "请求宁波财资异常,响应结果为空");
......@@ -91,7 +130,7 @@ public class NbCbCommonUtil {
* @param tradeType
* @return
*/
public static NbGetGeneralDownloadInfo getGeneralDownloadUrl(String downloadNo, String tradeType, String custId) throws Exception {
public NbGetGeneralDownloadInfo getGeneralDownloadUrl(String downloadNo, String tradeType, String custId) throws Exception {
JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", custId);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.dj.financial.mapper.ApprovalPayChannelRuleMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.financial.model.ApprovalPayChannelRule">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="rule_name" jdbcType="VARCHAR" property="ruleName" />
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
<result column="enabled" jdbcType="INTEGER" property="enabled" />
<result column="target_pay_channel" jdbcType="INTEGER" property="targetPayChannel" />
<result column="amount_max" jdbcType="DECIMAL" property="amountMax" />
<result column="payer_entity_level" jdbcType="INTEGER" property="payerEntityLevel" />
<result column="priority" jdbcType="INTEGER" property="priority" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="deleted_flag" jdbcType="CHAR" property="deletedFlag" />
</resultMap>
<sql id="Base_Column_List">
id, rule_name, template_id, enabled, target_pay_channel,
amount_max, payer_entity_level, priority, remark,
created_date, created_by, updated_date, updated_by, deleted_flag
</sql>
<!-- 查询指定模板下已启用的规则,同时匹配通配符 * 规则,按优先级降序排列 -->
<select id="queryEnabledRules" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM approval_pay_channel_rule
WHERE deleted_flag = 'N'
AND enabled = 1
AND (template_id = #{templateId} OR template_id = '*')
ORDER BY priority DESC
</select>
</mapper>
......@@ -156,32 +156,44 @@
<include refid="conditionForDetailList"/>
</select>
<select id="selectAccNameList" resultType="java.lang.String">
<select id="selectAccNameList" parameterType="cn.com.glsx.dj.financial.dto.NbCbAccDetailDTO" resultType="java.lang.String">
select distinct(acc_name)
from
nb_cb_acc_detail
where deleted_flag = 'N'
<if test="custId != null and custId !=''">
and cust_id = #{custId}
</if>
</select>
<select id="selectBankTypeList" resultType="java.lang.String">
<select id="selectBankTypeList" parameterType="cn.com.glsx.dj.financial.dto.NbCbAccDetailDTO" resultType="java.lang.String">
select distinct(bank_type)
from
nb_cb_acc_detail
where deleted_flag = 'N'
<if test="custId != null and custId !=''">
and cust_id = #{custId}
</if>
</select>
<select id="selectBankAccList" resultType="java.lang.String">
<select id="selectBankAccList" parameterType="cn.com.glsx.dj.financial.dto.NbCbAccDetailDTO" resultType="java.lang.String">
select distinct(bank_acc)
from
nb_cb_acc_detail
where deleted_flag = 'N'
<if test="custId != null and custId !=''">
and cust_id = #{custId}
</if>
</select>
<select id="selectBankNameList" resultType="java.lang.String">
<select id="selectBankNameList" parameterType="cn.com.glsx.dj.financial.dto.NbCbAccDetailDTO" resultType="java.lang.String">
select distinct(bank_name)
from
nb_cb_acc_detail
where deleted_flag = 'N'
<if test="custId != null and custId !=''">
and cust_id = #{custId}
</if>
</select>
<select id="selectOppAccNameList" resultType="java.lang.String">
......@@ -245,6 +257,10 @@
and ad.cd_sign = #{cdSign}
</if>
<if test="custId != null and custId !=''">
and ad.cust_id = #{custId}
</if>
<if test="curCode != null and curCode !=''">
and ad.cur_code = #{curCode}
</if>
......@@ -290,7 +306,9 @@
<if test="id != null">
and ad.id = #{id}
</if>
<if test="custId != null and custId !=''">
and ad.cust_id = #{custId}
</if>
<if test="accNameList != null and accNameList.size() > 0">
and ad.acc_name in
<foreach collection="accNameList" open="(" close=")" separator="," item="item">
......
......@@ -65,7 +65,9 @@
<if test="bankAcc != null and bankAcc != ''">
and bank_acc = #{bankAcc}
</if>
<if test="custId != null and custId != ''">
and cust_id = #{custId}
</if>
<if test="bankAccList != null and bankAccList.size() != 0">
and bank_acc in
<foreach collection="bankAccList" item="item" index="index" open="(" separator="," close=")">
......@@ -82,8 +84,12 @@
</where>
</select>
<select id="listAccount" resultType="java.lang.String">
select bank_acc from nb_cb_account
<where>
deleted_flag = 'N' and cust_id = #{custId}
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -8,6 +8,7 @@
<id column="id" property="id" jdbcType="BIGINT" />
<result column="corp_code" property="corpCode" jdbcType="VARCHAR" />
<result column="pay_acc" property="payAcc" jdbcType="VARCHAR" />
<result column="cust_Id" property="custId" jdbcType="VARCHAR" />
<result column="pay_name" property="payName" jdbcType="VARCHAR" />
<result column="rcv_acc" property="rcvAcc" jdbcType="VARCHAR" />
<result column="rcv_name" property="rcvName" jdbcType="VARCHAR" />
......@@ -16,6 +17,7 @@
<result column="total_number" property="totalNumber" jdbcType="INTEGER" />
<result column="batch_serial_no" property="batchSerialNo" jdbcType="VARCHAR" />
<result column="dj_serial_no" property="djSerialNo" jdbcType="VARCHAR" />
<result column="sp_no" property="spNo" jdbcType="VARCHAR" />
<result column="business_code" property="businessCode" jdbcType="VARCHAR" />
<result column="batch_remark" property="batchRemark" jdbcType="VARCHAR" />
<result column="erp_remark1" property="erpRemark1" jdbcType="VARCHAR" />
......@@ -40,6 +42,7 @@
<result column="receiptStatus" property="receiptStatus" jdbcType="TINYINT" />
<result column="ncr_pdf_url" property="receiptUrl" jdbcType="VARCHAR" />
<result column="trans_time" property="transTime" jdbcType="VARCHAR" />
<result column="cust_type" property="custType" jdbcType="TINYINT" />
<association property="oaApplyBatchTransfer" javaType="cn.com.glsx.dj.financial.model.OaApplyBatchTransfer">
<id column="oa_id" property="id" jdbcType="BIGINT" />
<id column="oa_license_plate" property="licensePlate" jdbcType="VARCHAR" />
......@@ -48,6 +51,7 @@
<id column="oa_payment_reason" property="paymentReason" jdbcType="VARCHAR" />
<id column="oa_bank_summary" property="bankSummary" jdbcType="VARCHAR" />
<id column="oa_sp_no" property="spNo" jdbcType="VARCHAR" />
<id column="oa_merchant_sp_no" property="merchantSpNo" jdbcType="VARCHAR" />
<id column="oa_wechat_type" property="wechatType" jdbcType="BIT" />
</association>
<collection property="detailList" javaType="java.util.List" ofType="cn.com.glsx.dj.financial.model.NbCbBatchTransferDetail">
......@@ -80,8 +84,8 @@
<!--
WARNING - @mbg.generated
-->
id, corp_code, pay_acc, pay_name, rcv_acc, rcv_name, rcv_bank_name, total_amt, total_number,
batch_serial_no, dj_serial_no, business_code, batch_remark, erp_remark1, erp_remark2,
id, corp_code,cust_id, pay_acc, pay_name, rcv_acc, rcv_name, rcv_bank_name, total_amt, total_number,
batch_serial_no, dj_serial_no,sp_no, business_code, batch_remark, erp_remark1, erp_remark2,
erp_remark3, erp_remark4, batch_transfer_source, payment_method, push_status, fail_reason, push_nb_time,
nb_transfer_status, query_nb_transfer_count, created_date, created_by, updated_date,
updated_by, deleted_flag
......@@ -96,8 +100,8 @@
</select>
<select id="list" resultMap="DTOResultMap">
select cbt.id, cbt.corp_code, cbt.pay_acc, cbt.pay_name, cbt.rcv_acc, cbt.rcv_name, cbt.rcv_bank_name, cbt.total_amt, cbt.total_number,
cbt.batch_serial_no, cbt.dj_serial_no, cbt.business_code, cbt.batch_remark, cbt.erp_remark1, cbt.erp_remark2,
select cbt.id, cbt.corp_code, cbt.pay_acc,cbt.cust_id, cbt.pay_name, cbt.rcv_acc, cbt.rcv_name, cbt.rcv_bank_name, cbt.total_amt, cbt.total_number,
cbt.batch_serial_no, cbt.dj_serial_no, cbt.sp_no,cbt.business_code, cbt.batch_remark, cbt.erp_remark1, cbt.erp_remark2,
cbt.erp_remark3, cbt.erp_remark4, cbt.batch_transfer_source, cbt.payment_method, cbt.push_status, cbt.fail_reason, cbt.push_nb_time,
cbt.nb_transfer_status, cbt.query_nb_transfer_count, cbt.created_date,
......@@ -108,7 +112,7 @@
cbtd.status as detail_status, cbtd.trans_time as detail_trans_time, cbtd.voucher_no as detail_voucher_no,
cbtd.err_desc as detail_err_desc, cbtd.purpose as detail_purpose,
cbtd.erp_remark1 as detail_erp_remark1, cbtd.erp_remark2 as detail_erp_remark2, cbtd.erp_remark3 as detail_erp_remark3,
cbtd.erp_remark4 as detail_erp_remark4, cbtd.bill_no as detail_bill_no,
cbtd.erp_remark4 as detail_erp_remark4, cbtd.bill_no as detail_bill_no,ncci.cust_type AS cust_type,
<!--明细-->
case cbt.nb_transfer_status when 0 then ifnull(ncad.trans_time, cbt.updated_date) else null end as trans_time,
......@@ -118,14 +122,14 @@
<!--oa审批-->
oa.id as oa_id, oa.license_plate as oa_license_plate, oa.vin as oa_vin, oa.eval_order_no as oa_eval_order_no, oa.sp_no as oa_sp_no,
oa.payment_reason as oa_payment_reason, oa.bank_summary as oa_bank_summary, oa.wechat_type as oa_wechat_type
oa.payment_reason as oa_payment_reason, oa.bank_summary as oa_bank_summary, oa.wechat_type as oa_wechat_type,oa.merchant_sp_no AS oa_merchant_sp_no
from nb_cb_batch_transfer cbt
left join nb_cb_batch_transfer_detail cbtd on cbt.id = cbtd.batch_transfer_id and cbtd.deleted_flag = 'N'
left join oa_apply_batch_transfer oa on oa.sp_no = cbt.dj_serial_no and oa.deleted_flag = 'N' and oa.wechat_type = 1
left join oa_apply_batch_transfer oa on oa.merchant_sp_no = cbt.dj_serial_no and oa.deleted_flag = 'N'
left join nb_cb_acc_detail ncad on ncad.serial_no = cbtd.acc_detail_serial_no and ncad.deleted_flag = 'N' and ncad.cd_sign = 1
left join nb_cb_receipt ncr on ncad.sub_serial_no = ncr.sub_serial_no and ncad.match_code = ncr.match_code and ncr.deleted_flag = 'N'
left join nb_cb_cust_info ncci on ncci.cust_id = cbt.cust_id and ncci.deleted_flag = 'N'
<include refid="listCondition"></include>
order by cbt.id desc
</select>
......@@ -141,6 +145,7 @@
#{item}
</foreach>
</if>
and cust_id = #{custId}
and push_status = #{status}
and (nb_transfer_status is null or
......@@ -167,6 +172,13 @@
</foreach>
</if>
<if test="custId != null and custId !=''">
and cbt.cust_id =#{custId}
</if>
<if test="custType != null">
and ncci.cust_type =#{custType}
</if>
<if test="payName != null and payName !=''">
and cbt.pay_name like CONCAT('%',#{payName},'%')
</if>
......@@ -192,7 +204,7 @@
and cbt.dj_serial_no = #{djSerialNo}
</if>
<if test="batchTransferSource != null and batchTransferSource !=''">
<if test="batchTransferSource != null">
and cbt.batch_transfer_source = #{batchTransferSource}
</if>
<if test="pushStatus != null">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.dj.financial.mapper.NbCbCustInfoMapper">
<!-- 结果映射 -->
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.financial.model.NbCbCustInfo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="cust_type" jdbcType="VARCHAR" property="custType"/>
<result column="cust_id" jdbcType="VARCHAR" property="custId"/>
<result column="app_key" jdbcType="VARCHAR" property="appKey"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
<result column="deleted_flag" jdbcType="VARCHAR" property="deletedFlag"/>
</resultMap>
<!-- 基础列 -->
<sql id="Base_Column_List">
id, cust_id,cust_type, app_key, remark, created_by, updated_date, updated_by, deleted_flag
</sql>
</mapper>
......@@ -10,6 +10,7 @@
<result column="wechat_type" property="wechatType" jdbcType="BIT" />
<result column="source_type" property="sourceType" jdbcType="BIT" />
<result column="sp_no" property="spNo" jdbcType="VARCHAR" />
<result column="merchant_sp_no" property="merchantSpNo" jdbcType="VARCHAR" />
<result column="oa_template_type" property="oaTemplateType" jdbcType="INTEGER" />
<result column="template_title" property="templateTitle" jdbcType="VARCHAR" />
<result column="department" property="department" jdbcType="VARCHAR" />
......@@ -63,7 +64,7 @@
<!--
WARNING - @mbg.generated
-->
id, biz_serial_no, wechat_type, source_type, sp_no, oa_template_type, template_title,
id, biz_serial_no, wechat_type, source_type, sp_no, merchant_sp_no, oa_template_type, template_title,
department, applier_phone_number, payer_entity, license_plate, vin, seller, contract_money_change,
amt, paid_amt, payable_amt, payment_reason, payment_method, bank_summary, rcv_acc,
rcv_name, rcv_bank_name, remark, invoice_remark, oa_approve_status, oa_approve_user,
......@@ -90,6 +91,12 @@
#{item}
</foreach>
</if>
<if test="merchantSpNoList != null and merchantSpNoList.size() != 0 ">
and merchant_sp_no in
<foreach close=")" collection="merchantSpNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="bizSerialNo != null">
and biz_serial_no = #{bizSerialNo}
</if>
......@@ -121,7 +128,7 @@
select oabt.*,
bt.id as bt_id, bt.nb_transfer_status as bt_nb_transfer_status, bt.push_status as bt_push_status, bt.fail_reason as bt_fail_reason
from oa_apply_batch_transfer oabt
left join nb_cb_batch_transfer bt on oabt.sp_no = bt.dj_serial_no and bt.batch_transfer_source = 0 and bt.deleted_flag = 'N'
left join nb_cb_batch_transfer bt on oabt.merchant_sp_no = bt.dj_serial_no and bt.batch_transfer_source = 0 and bt.deleted_flag = 'N'
<where>
oabt.deleted_flag = 'N'
......
......@@ -10,6 +10,7 @@
<result column="wechat_type" property="wechatType" jdbcType="TINYINT" />
<result column="source" property="source" jdbcType="TINYINT" />
<result column="sp_no" property="spNo" jdbcType="VARCHAR" />
<result column="merchant_sp_no" property="merchantSpNo" jdbcType="VARCHAR" />
<result column="oa_template_type" property="oaTemplateType" jdbcType="INTEGER" />
<result column="template_title" property="templateTitle" jdbcType="VARCHAR" />
<result column="department" property="department" jdbcType="VARCHAR" />
......@@ -53,7 +54,7 @@
<!--
WARNING - @mbg.generated
-->
id, biz_serial_no, wechat_type, source, sp_no, oa_template_type, template_title, department, applier_phone_number, payer_entity,
id, biz_serial_no, wechat_type, source, sp_no, merchant_sp_no, oa_template_type, template_title, department, applier_phone_number, payer_entity,
apply_type, amt, paid_amt, payable_amt, payment_reason, payment_method, bank_summary,
rcv_acc, rcv_name, rcv_bank_name, remark, invoice_remark, oa_approve_status, oa_approve_user, oa_approve_time, created_date,
created_by, updated_date, updated_by, deleted_flag
......@@ -99,15 +100,36 @@
<select id="list" resultMap="DTOResultMap">
select oat.*,
nct.nb_transfer_status, nct.status,
case nct.nb_transfer_status when 0 then ifnull(ad.trans_time, nct.updated_date) else null end as trans_time
from oa_apply_transfer oat
left join nb_cb_transfer nct on oat.sp_no = nct.dj_serial_no and nct.transfer_source = 0 and nct.deleted_flag = 'N'
left join nb_cb_acc_detail ad on nct.serial_no = ad.serial_no and cd_sign = 1 and ad.deleted_flag = 'N'
select oat.*,
-- nb_transfer_status:两表取其一,batch侧需转换
COALESCE(
nct.nb_transfer_status,
CASE ncbt.nb_transfer_status WHEN 1 THEN 0 WHEN 0 THEN 2 WHEN -1 THEN -1 ELSE NULL END
) AS nb_transfer_status,
-- status:两表取其一
COALESCE(nct.status, ncbt.push_status) AS status,
-- trans_time:两表逻辑略有不同
CASE
WHEN nct.nb_transfer_status = 0 THEN IFNULL(ad_nct.trans_time, nct.updated_date)
WHEN ncbt.nb_transfer_status = 1 THEN IFNULL(ad_ncbt.trans_time, ncbt.updated_date)
ELSE NULL
END AS trans_time
from oa_apply_transfer oat
-- 原有:单笔转账
left join nb_cb_transfer nct
on oat.merchant_sp_no = nct.dj_serial_no and nct.transfer_source = 0 and nct.deleted_flag = 'N'
left join nb_cb_acc_detail ad_nct
on nct.serial_no = ad_nct.serial_no and ad_nct.cd_sign = 1 and ad_nct.deleted_flag = 'N'
-- 新增:批量转账
left join nb_cb_batch_transfer ncbt
on oat.merchant_sp_no = ncbt.dj_serial_no and ncbt.batch_transfer_source = 1 and ncbt.deleted_flag = 'N'
left join nb_cb_batch_transfer_detail cbtd2
on ncbt.id = cbtd2.batch_transfer_id and cbtd2.deleted_flag = 'N'
left join nb_cb_acc_detail ad_ncbt
on ad_ncbt.serial_no = cbtd2.acc_detail_serial_no and ad_ncbt.deleted_flag = 'N' and ad_ncbt.cd_sign = 1
<where>
oat.deleted_flag = 'N'
and sp_no in
and oat.sp_no in
<foreach close=")" collection="spNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
......
......@@ -7,6 +7,8 @@
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="sp_no" jdbcType="VARCHAR" property="spNo" />
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="merchant_sp_no" jdbcType="VARCHAR" property="merchantSpNo" />
<result column="sp_name" jdbcType="VARCHAR" property="spName" />
<result column="sp_status" jdbcType="INTEGER" property="spStatus" />
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
......@@ -54,7 +56,7 @@
<!--
WARNING - @mbg.generated
-->
id, sp_no, sp_name, sp_status, template_id, apply_time, applyer_userid, applicant_dept, applyer_name,
id, sp_no, merchant_id, merchant_sp_no, sp_name, sp_status, template_id, apply_time, applyer_userid, applicant_dept, applyer_name,
applyer_phone, apply_dept, payer_entity, dj_sub_company, payer_bank_name, payer_bank_account, bank_name, bank_account, payee_name, amount, amount_paid, amount_payable, payment_reason,
license_plate, vin, seller, contract_money_change, invoice_remark,
sync_time, created_at,remarks, bank_summary, third_request_status, third_request_excepitonmsg, third_no,
......@@ -67,6 +69,13 @@
where sp_no = #{thirdNo}
</select>
<select id="findByMerchantSpNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from approval_records
where merchant_sp_no = #{merchantSpNo}
</select>
<select id="getDetailByMapAndId" resultType="java.util.LinkedHashMap">
SELECT
concat(applyer_name, '的', sp_name) headTitle,
......@@ -99,7 +108,7 @@
END AS receiptTime,
r.created_date as created_date
from approval_records ar
inner join nb_cb_transfer ct on ct.dj_serial_no = ar.sp_no
inner join nb_cb_transfer ct on ct.dj_serial_no = ar.merchant_sp_no
inner join nb_cb_acc_detail d on d.serial_no = ct.serial_no
inner join nb_cb_receipt r on r.sub_serial_no = d.sub_serial_no and r.match_code = d.match_code
<where>and FIND_IN_SET(#{qwUserId}, ar.sp_user)
......@@ -139,7 +148,7 @@
END AS receiptTime,
r.created_date as created_date
from approval_records ar
inner join nb_cb_batch_transfer cbt on cbt.dj_serial_no = ar.sp_no
inner join nb_cb_batch_transfer cbt on cbt.dj_serial_no = ar.merchant_sp_no
inner join nb_cb_batch_transfer_detail cbtd on cbtd.deleted_flag = 'N' and cbt.id = cbtd.batch_transfer_id
inner join nb_cb_acc_detail d on d.serial_no = cbtd.acc_detail_serial_no and d.deleted_flag = 'N' and d.cd_sign = 1
inner join nb_cb_receipt r on r.sub_serial_no = d.sub_serial_no and r.match_code = d. match_code and r.deleted_flag = 'N' and r.cd_sign = '2'
......
package cn.com.glsx.dj.financial.demo;
import cn.com.glsx.dj.financial.BaseServiceTest;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import cn.com.glsx.dj.financial.service.nb.NbCbAccountService;
import cn.com.glsx.dj.financial.service.nb.NbCbReceiptService;
......@@ -35,7 +36,7 @@ public class DemoTest extends BaseServiceTest {
public void main() {
try {
//nbAccDetailService.queryNbCbJobAccDetail("");
nbCbAccountService.queryNbCbAccount("");
nbCbAccountService.queryNbCbAccount("", "9002368118");
//nbCbReceiptService.queryNbCbReceipt("{\"Data\":{\"queryFlag\":\"1\",\"custId\":\"0000112058\",\"accountSet\":[\"86041110000109337\"],\"serialNo\":\"\"}}");
//nbCbReceiptService.queryNbCbReceipt("");
//nbCbReceiptService.queryNbCbReceipt("");
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.BaseServiceTest;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import junit.framework.TestCase;
import org.junit.Test;
......@@ -21,7 +22,7 @@ public class QueryNbCbAccDetailJobTest extends BaseServiceTest {
public void testQueryNbCbAccDetailJob() {
//生产环境
String s = "{\"Data\":{\"beginDate\":\"2025-09-09\",\"bankAccList\":[\"752901688710168\"],\"endDate\":\"2025-09-09\",\"custId\":\"9000919969\",\"pageSize\":\"1000\",\"currentPage\":\"0\",\"queryType\":\"0\"}}";
nbcAccDetailService.queryNbCbJobAccDetail(s, null, null,CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbJobAccDetail(s, null, null,CommonConstants.MIDDLE_WARE,1);
}
......@@ -29,6 +30,6 @@ public class QueryNbCbAccDetailJobTest extends BaseServiceTest {
@Test
public void testQueryNbCbAccDetailJobQa() {
String s = "{\"Data\":{\"beginDate\":\"2024-03-01\",\"bankAccList\":[\"86041110000109337\"],\"endDate\":\"2024-03-30\",\"custId\":\"0000112058\",\"pageSize\":\"1000\",\"currentPage\":\"0\",\"queryType\":\"0\"}}";
nbcAccDetailService.queryNbCbJobAccDetail(s, null, null, CommonConstants.MIDDLE_WARE);
nbcAccDetailService.queryNbCbJobAccDetail(s, null, null, CommonConstants.MIDDLE_WARE,1);
}
}
\ No newline at end of file
......@@ -22,13 +22,13 @@ public class QueryNbCbReceiptJobTest extends BaseServiceTest {
public void test() throws Exception {
//String param = "{\"Data\":{\"beginDate\":\"2025-05-08\",\"queryFlag\":\"2\",\"endDate\":\"2025-05-08\",\"custId\":\"9000919969\",\"accountSet\":[\"752901617710117\",\"10886000000087152\",\"10879000000236175\",\"10879000000236175\"]}}";
String param = "{\"Data\":{\"beginDate\":\"2025-09-09\",\"queryFlag\":\"2\",\"endDate\":\"2025-09-09\",\"custId\":\"9000919969\",\"accountSet\":[\"752901688710168\"]}}";
nbCbReceiptService.queryNbCbReceipt(param, null, null, CommonConstants.MIDDLE_WARE);
// nbCbReceiptService.queryNbCbReceipt(param, null, null, CommonConstants.MIDDLE_WARE,"");
}
//测试环境数据调用
@Test
public void testQa() throws Exception {
String param = "{\"Data\":{\"beginDate\":\"2024-03-01\",\"queryFlag\":\"2\",\"endDate\":\"2024-03-30\",\"custId\":\"0000112058\",\"accountSet\":[\"86041110000109337\"]}}";
nbCbReceiptService.queryNbCbReceipt(null, CommonConstants.MIDDLE_WARE);
nbCbReceiptService.queryNbCbReceipt(null, CommonConstants.MIDDLE_WARE,"",1);
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.BaseServiceTest;
import cn.com.glsx.dj.financial.constants.CommonConstants;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -21,7 +22,7 @@ public class QueryNbCbTransferTest extends BaseServiceTest {
String s = "79";
try {
nbCbTransferService.transferSchedule(s,CommonConstants.MIDDLE_WARE);
nbCbTransferService.transferSchedule(null,CommonConstants.MIDDLE_WARE, NbCbCustEnum.YJ_CUST.getCustType());
} catch (Exception e) {
throw new RuntimeException(e);
}
......
......@@ -47,7 +47,7 @@ public class QWApprovalServiceTest extends BaseServiceTest{
@Test
public void sendThird(){
ApprovalRecords approvalRecords = approvalRecordsMapper.selectByPrimaryKey(681);
ApprovalRecords approvalRecords = approvalRecordsMapper.selectByPrimaryKey(967);
qwApprovalService.sendThird(approvalRecords);
}
......@@ -76,7 +76,7 @@ public class QWApprovalServiceTest extends BaseServiceTest{
public void testAddQWApprovalRecords() {
WorkWechatOAGetApprovalDetailRequestDTO workWechatOAGetApprovalDetailRequestDTO=new WorkWechatOAGetApprovalDetailRequestDTO();
workWechatOAGetApprovalDetailRequestDTO.setMerchantId(44210895);
workWechatOAGetApprovalDetailRequestDTO.setSpNo("202506160001"); // 202506160001
workWechatOAGetApprovalDetailRequestDTO.setSpNo("202510160003"); // 202506160001
WorkWechatOAGetApprovalDetailResponseDTO workWechatOAGetApprovalDetailResponseDTO = qwManager.getApprovalDetail(workWechatOAGetApprovalDetailRequestDTO);
qwApprovalService.addQWApprovalRecords(workWechatOAGetApprovalDetailResponseDTO);
......
......@@ -99,12 +99,12 @@ public class NbCbAccDetailServiceTest extends BaseServiceTest {
@Test
public void queryNbCbAccDetailReceipt() {
nbCbAccDetailService.queryNbCbAccDetailReceipt("2025-07-25", "chenxi");
nbCbAccDetailService.queryNbCbAccDetailReceipt("2025-07-25", "chenxi",1);
}
@Test
public void queryNbCbAccDetailByDate() {
nbCbAccDetailService.queryNbCbAccDetailByDate("2025-07-25", "chenxi");
nbCbAccDetailService.queryNbCbAccDetailByDate("2025-07-25", "chenxi",1);
}
......
......@@ -19,7 +19,7 @@ public class NbCbBatchTransferServiceTest extends BaseServiceTest {
@Test
public void testNbCbBatchTransferService() {
try {
nbCbBatchTransferService.transferSchedule(null, "chenxi");
nbCbBatchTransferService.transferSchedule(null, "chenxi",2);
} catch (Exception e) {
throw new RuntimeException(e);
}
......
......@@ -17,7 +17,7 @@ public class NbCbReceiptServiceTest extends BaseServiceTest {
@Test
public void testQueryNbCbReceipt() {
try {
nbCbReceiptService.queryNbCbReceipt("", null, null, "中间件");
nbCbReceiptService.queryNbCbReceipt("", null, null, "中间件",2);
} catch (Exception e) {
throw new RuntimeException(e);
}
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.service.nb;
import cn.com.glsx.dj.financial.dto.NbCbTransferDTO;
import cn.com.glsx.dj.financial.dto.NbCbTransferParamDTO;
import cn.com.glsx.dj.financial.enums.NbCbCustEnum;
import cn.com.glsx.dj.financial.service.BaseServiceTest;
import cn.com.glsx.dj.financial.util.DateUtils;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -117,15 +118,15 @@ public class NbCbTransferServiceTest extends BaseServiceTest {
NbCbTransferParamDTO nbCbTransferParamDTO = new NbCbTransferParamDTO();
nbCbTransferParamDTO.setDjSerialNo(DateUtils.formatDate(new Date(), "yyyyMMdd") + RandomUtils.nextInt(10000000, 100000000));
nbCbTransferParamDTO.setPayAcc("755922006010201");
nbCbTransferParamDTO.setPayName("深圳广联数科科技有限公司");
nbCbTransferParamDTO.setPayAcc("86041110001342705");
nbCbTransferParamDTO.setPayName("深圳市优加智汇科技有限公司");
//收款账号
nbCbTransferParamDTO.setRcvAcc("42515848644");
nbCbTransferParamDTO.setRcvBankName("测试银行");
nbCbTransferParamDTO.setRcvName("周");
nbCbTransferParamDTO.setRcvAcc("15000141260010");
nbCbTransferParamDTO.setRcvBankName("平安银行深圳福田支行");
nbCbTransferParamDTO.setCustId("9002368118");
nbCbTransferParamDTO.setRcvName("深圳市优加智汇科技有限公司");
nbCbTransferParamDTO.setPurpose("其他");
nbCbTransferParamDTO.setAmt(new BigDecimal("100"));
nbCbTransferParamDTO.setAmt(new BigDecimal("1"));
nbCbTransferParamDTO.setTransferSource((byte) 1);
String result = nbCbTransferService.singleTransfer(nbCbTransferParamDTO);
System.out.println(result);
......@@ -147,7 +148,7 @@ public class NbCbTransferServiceTest extends BaseServiceTest {
@Test
public void testQueryTransfer() {
for (int i = 0; i < 8; i++) {
nbCbTransferService.queryTransfer("", "中间件");
// nbCbTransferService.queryTransfer("", "中间件");
}
}
......
......@@ -41,7 +41,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
NbCbBatchTransferOaParamDTO nbCbBatchTransferOaParamDTO = new NbCbBatchTransferOaParamDTO();
// 设置必填字段
nbCbBatchTransferOaParamDTO.setBizSerialNo("TEST_EVAL_ORDER_0002"); // 业务流水号 - 必填 (评估单编号 + 付款类型)
nbCbBatchTransferOaParamDTO.setBizSerialNo("TEST_EVAL_ORDER_0008"); // 业务流水号 - 必填 (评估单编号 + 付款类型)
// 业务来源 - 必填,1-二手车
nbCbBatchTransferOaParamDTO.setSourceType((byte) 1);
......@@ -56,13 +56,13 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
nbCbBatchTransferOaParamDTO.setDepartment("智慧门店运营中心");
// 模板标题 - 动态拼接:【二手车定金/尾款/全款付款】车牌/车架号/车主:车主姓名/金额
nbCbBatchTransferOaParamDTO.setTemplateTitle("【二手车定金付款】粤A12345/ABC123456789/车主:张三/5000.00元");
nbCbBatchTransferOaParamDTO.setTemplateTitle("【二手车定金付款】粤A12345/ABC123456789/车主:张三/2.00元");
// 申请人手机号 - 必填
nbCbBatchTransferOaParamDTO.setApplierPhoneNumber("13268676851");
nbCbBatchTransferOaParamDTO.setApplierPhoneNumber("17608426680");
// 模板支付主体 - 必填,默认:惠州广联数科科技有限公司
nbCbBatchTransferOaParamDTO.setPayerEntity("惠州广联数科科技有限公司");
nbCbBatchTransferOaParamDTO.setPayerEntity("深圳市优加智汇科技有限公司");
// 车牌 - 系统带入
nbCbBatchTransferOaParamDTO.setLicensePlate("粤A12345");
......@@ -77,34 +77,34 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
nbCbBatchTransferOaParamDTO.setContractMoneyChange("否");
// 交易金额 - 必填,单位:元
nbCbBatchTransferOaParamDTO.setAmt(new BigDecimal("5000.00"));
nbCbBatchTransferOaParamDTO.setAmt(new BigDecimal("1.00"));
// 已付金额 - 系统带入,单位:元 付款定金
nbCbBatchTransferOaParamDTO.setPaidAmt(new BigDecimal("2000.00"));
nbCbBatchTransferOaParamDTO.setPaidAmt(new BigDecimal("1.00"));
// 应付总额 - 系统带入,单位:元
nbCbBatchTransferOaParamDTO.setPayableAmt(new BigDecimal("7000.00"));
nbCbBatchTransferOaParamDTO.setPayableAmt(new BigDecimal("2.00"));
// 付款事由 - 系统带入,系统判断定金/尾款/全款
nbCbBatchTransferOaParamDTO.setPaymentReason("定金");
// 付款方式 - 银行转账/冲账
nbCbBatchTransferOaParamDTO.setPaymentMethod("冲账");
nbCbBatchTransferOaParamDTO.setPaymentMethod("银行转账");
// 银行摘要 - 默认:采购款
nbCbBatchTransferOaParamDTO.setBankSummary("采购款");
// 收款人账号 - 必填
nbCbBatchTransferOaParamDTO.setRcvAcc("6222021234567890123");
nbCbBatchTransferOaParamDTO.setRcvAcc("15000141260010");
// 收款人户名 - 必填
nbCbBatchTransferOaParamDTO.setRcvName("张三");
nbCbBatchTransferOaParamDTO.setRcvName("深圳市优加智汇科技有限公司");
// 收款人开户行名 - 必填
nbCbBatchTransferOaParamDTO.setRcvBankName("中国工商银行广州分行");
nbCbBatchTransferOaParamDTO.setRcvBankName("平安银行深圳福田支行");
// 备注
nbCbBatchTransferOaParamDTO.setRemark("");
nbCbBatchTransferOaParamDTO.setRemark("test");
// 附件url,多个以逗号分隔
nbCbBatchTransferOaParamDTO.setAttachmentUrl("https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/template/1f9d78ba-23ee-461d-a2d8-36ee6f356934/%E6%8A%A5%E5%91%8A%E7%AE%A1%E7%90%86%E5%AF%BC%E5%87%BA20260113173853.xlsx");
......@@ -225,7 +225,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
jsonObject.put("Data", jsonObjectDetail);
try {
nbCbBatchTransferService.batchTransfer(jsonObject.toJSONString());
nbCbBatchTransferService.queryBatchTransfer(null, null);
nbCbBatchTransferService.queryBatchTransfer(null, null,1);
} catch (Exception e) {
throw new RuntimeException(e);
}
......@@ -235,7 +235,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
@Test
public void queryBatchTransferResult() {
try {
nbCbBatchTransferService.queryBatchTransfer(null, null);
nbCbBatchTransferService.queryBatchTransfer(null, null,1);
} catch (Exception e) {
throw new RuntimeException(e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!