Commit 052017ed by 潘诗林

宁波财资接入优加:添加优加主体

1 parent da4fa819
Showing 44 changed files with 552 additions and 84 deletions
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.dto; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.financial.dto;
import lombok.Data; import lombok.Data;
/** /**
* @Title: * @Title:
* @Description: * @Description:
...@@ -15,4 +16,9 @@ public class NbCbReceiptQueryTaskParamDTO { ...@@ -15,4 +16,9 @@ public class NbCbReceiptQueryTaskParamDTO {
* 回单下载编号 * 回单下载编号
*/ */
private String downloadNo; private String downloadNo;
/**
* 付款主体id
*/
private String custId;
} }
...@@ -19,7 +19,7 @@ public enum NbCbCustEnum { ...@@ -19,7 +19,7 @@ public enum NbCbCustEnum {
/** /**
* 广联主体 * 广联主体
*/ */
GL_CUST(1, "9000919969", "9865fe2c-1ba3-4e9c-af8a-24d2a8e0eafc", "嘀加主账户"), GL_CUST(1, "9000919969", "9865fe2c-1ba3-4e9c-af8a-24d2a8e0eafc", "广联主体"),
/** /**
* 优加主体 * 优加主体
......
...@@ -9,6 +9,8 @@ import java.util.Map; ...@@ -9,6 +9,8 @@ import java.util.Map;
* 宁波银行转账异常枚举 * 宁波银行转账异常枚举
*/ */
public enum TransferErrorEnum implements ErrorEnum{ public enum TransferErrorEnum implements ErrorEnum{
PARAM_ERROR("30990001", "参数错误"),
TRANSFER_ERROR("30999999", "调用宁波银行接口失败"); TRANSFER_ERROR("30999999", "调用宁波银行接口失败");
......
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; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.NbCbBatchTransferService;
import cn.com.glsx.dj.financial.service.nb.NbCbTransferService; import cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
...@@ -21,7 +22,7 @@ public class NbCbBatchTransferJob implements SimpleJob { ...@@ -21,7 +22,7 @@ public class NbCbBatchTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------调用宁波银行批量转账接口任务开始-----------------"); log.info("----------------调用宁波银行批量转账接口任务开始-----------------");
try { try {
batchTransferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE); batchTransferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.NbCbBatchTransferService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class NbCbQueryBatchTransferJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class NbCbQueryBatchTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时调用宁波银行批量转账单笔查证任务开始-----------------"); log.info("----------------定时调用宁波银行批量转账单笔查证任务开始-----------------");
try { try {
transferService.queryBatchTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE); transferService.queryBatchTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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 cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class NbCbQueryTransferJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class NbCbQueryTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时调用宁波银行单笔转账单笔查证任务开始-----------------"); log.info("----------------定时调用宁波银行单笔转账单笔查证任务开始-----------------");
try { try {
transferService.queryTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE); transferService.queryTransfer(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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 cn.com.glsx.dj.financial.service.nb.NbCbTransferService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class NbCbTransferJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class NbCbTransferJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------调用宁波银行单笔转账接口任务开始-----------------"); log.info("----------------调用宁波银行单笔转账接口任务开始-----------------");
try { try {
transferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE); transferService.transferSchedule(shardingContext.getJobParameter(), CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), 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 = "NbCbBatchTransferJob", 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.getCustId());
} 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 = "NbCbQueryBatchTransferJob", 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.getCustId());
} 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 = "NbCbQueryTransferJob", 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.getCustId());
} 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 = "NbCbTransferJob", 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.getCustId());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------优加-调用宁波银行单笔转账接口任务结束-----------------");
}
}
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行交易明细定时任务开始-----------------"); log.info("----------------定时查询宁波银行交易明细定时任务开始-----------------");
try { try {
nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE); nbcAccDetailService.queryNbCbJobAccDetail(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
...@@ -29,7 +30,7 @@ public class QueryNbCbAccDetailMonthlyJob implements SimpleJob { ...@@ -29,7 +30,7 @@ public class QueryNbCbAccDetailMonthlyJob implements SimpleJob {
DateTime beginOfMonth = DateUtil.beginOfMonth(baseDateTime); DateTime beginOfMonth = DateUtil.beginOfMonth(baseDateTime);
DateTime endOfMonth = DateUtil.endOfMonth(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.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailReceiptJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailReceiptJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行当天回单定时任务开始-----------------"); log.info("----------------定时查询宁波银行当天回单定时任务开始-----------------");
try { try {
nbcAccDetailService.queryNbCbAccDetailReceipt(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE); nbcAccDetailService.queryNbCbAccDetailReceipt(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.com.glsx.dj.financial.service.nb.NbCbAccDetailService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailTodayJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class QueryNbCbAccDetailTodayJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行当天交易明细定时任务开始-----------------"); log.info("----------------定时查询宁波银行当天交易明细定时任务开始-----------------");
try { try {
nbcAccDetailService.queryNbCbAccDetailByDate(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE); nbcAccDetailService.queryNbCbAccDetailByDate(shardingContext.getJobParameter(),CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.service.nb.NbCbReceiptService;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -20,7 +21,7 @@ public class QueryNbCbReceiptJob implements SimpleJob { ...@@ -20,7 +21,7 @@ public class QueryNbCbReceiptJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
log.info("----------------定时查询宁波银行回单定时任务开始-----------------"); log.info("----------------定时查询宁波银行回单定时任务开始-----------------");
try { try {
nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE); nbCbReceiptService.queryNbCbReceipt(shardingContext.getJobParameter(), null, null, CommonConstants.MIDDLE_WARE, NbCbCustEnum.GL_CUST.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.financial.job; package cn.com.glsx.dj.financial.job;
import cn.com.glsx.dj.financial.constants.CommonConstants; 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.service.nb.NbCbReceiptService;
import cn.com.glsx.dj.financial.util.DateUtils; import cn.com.glsx.dj.financial.util.DateUtils;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
...@@ -32,7 +33,7 @@ public class QueryNbCbReceiptMonthlyJob implements SimpleJob { ...@@ -32,7 +33,7 @@ public class QueryNbCbReceiptMonthlyJob implements SimpleJob {
String beginDateStr = DateUtils.formatDate(beginOfMonth, DateUtils.DEFAULT_DATE_FORMAT); String beginDateStr = DateUtils.formatDate(beginOfMonth, DateUtils.DEFAULT_DATE_FORMAT);
String endDateStr = DateUtils.formatDate(endOfMonth, 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.getCustId());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), 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 = "QueryNbCbAccDetailJob", 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.getCustId());
} 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 = "QueryNbCbAccDetailMonthlyJob", 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.getCustId());
} 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 = "QueryNbCbAccDetailReceiptJob", 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.getCustId());
} 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 = "QueryNbCbAccDetailTodayJob", 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.getCustId());
} 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 = "QueryNbCbReceiptJob", 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.getCustId());
} 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 = "QueryNbCbReceiptMonthlyJob", 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.getCustId());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------每月定时查询宁波银行回单定时任务结束-----------------");
}
}
...@@ -16,8 +16,7 @@ public interface NbCbAccountMapper extends OreMapper<NbCbAccount> { ...@@ -16,8 +16,7 @@ public interface NbCbAccountMapper extends OreMapper<NbCbAccount> {
* *
* @return * @return
*/ */
@Select("SELECT bank_acc FROM nb_cb_account WHERE deleted_flag = 'N'") List<String> listAccount(String custId);
List<String> listAccount();
List<NbCbAccount> selectByBankAccListByBankAcc(List<String> bankAccList); List<NbCbAccount> selectByBankAccListByBankAcc(List<String> bankAccList);
......
...@@ -15,5 +15,5 @@ public interface NbCbBatchTransferMapper extends OreMapper<NbCbBatchTransfer> { ...@@ -15,5 +15,5 @@ public interface NbCbBatchTransferMapper extends OreMapper<NbCbBatchTransfer> {
List<NbCbBatchTransferDTO> list(NbCbBatchTransferDTO condition); 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 \ No newline at end of file
...@@ -24,5 +24,5 @@ public interface NbCbTransferMapper extends OreMapper<NbCbTransfer> { ...@@ -24,5 +24,5 @@ public interface NbCbTransferMapper extends OreMapper<NbCbTransfer> {
List<Integer> getDistinctNbTransferStatus(); 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 \ No newline at end of file
...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.financial.service.nb; ...@@ -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.constants.CommonConstants;
import cn.com.glsx.dj.financial.dto.NbCbAccResponseDTO; import cn.com.glsx.dj.financial.dto.NbCbAccResponseDTO;
import cn.com.glsx.dj.financial.dto.NbCbAccountDTO; 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.mapper.NbCbAccountMapper;
import cn.com.glsx.dj.financial.model.NbCbAccount; import cn.com.glsx.dj.financial.model.NbCbAccount;
import cn.com.glsx.dj.financial.util.NbCbCommonUtil; import cn.com.glsx.dj.financial.util.NbCbCommonUtil;
...@@ -72,7 +73,7 @@ public class NbCbAccountService { ...@@ -72,7 +73,7 @@ public class NbCbAccountService {
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class) @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"); RpcAssert.assertNotEmpty(insertList, DefaultErrorEnum.DATA_NULL, "nbCbReceipt is null");
try { try {
List<String> bankAccList = insertList.stream().map(NbCbAccount::getBankAcc).collect(Collectors.toList()); List<String> bankAccList = insertList.stream().map(NbCbAccount::getBankAcc).collect(Collectors.toList());
...@@ -98,6 +99,7 @@ public class NbCbAccountService { ...@@ -98,6 +99,7 @@ public class NbCbAccountService {
if (CollectionUtils.isNotEmpty(newDataList)) { if (CollectionUtils.isNotEmpty(newDataList)) {
for (NbCbAccount nbCbAccount : newDataList) { for (NbCbAccount nbCbAccount : newDataList) {
Date date = new Date(); Date date = new Date();
nbCbAccount.setCustId(custId);
nbCbAccount.setCreatedDate(date); nbCbAccount.setCreatedDate(date);
nbCbAccount.setCreatedBy(CommonConstants.MIDDLE_WARE); nbCbAccount.setCreatedBy(CommonConstants.MIDDLE_WARE);
nbCbAccount.setUpdatedBy(CommonConstants.MIDDLE_WARE); nbCbAccount.setUpdatedBy(CommonConstants.MIDDLE_WARE);
...@@ -113,14 +115,14 @@ public class NbCbAccountService { ...@@ -113,14 +115,14 @@ public class NbCbAccountService {
} }
} }
public void queryNbCbAccount(String jobParameter) { public void queryNbCbAccount(String jobParameter,String custId) {
JSONObject jsonObject; JSONObject jsonObject;
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
jsonObject = JSONObject.parseObject(jobParameter); jsonObject = JSONObject.parseObject(jobParameter);
} else { } else {
jsonObject = new JSONObject(); jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); //0000112058 test env 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("pageSize", "1000");
jsonObjectDetail.put("currentPage", "0"); jsonObjectDetail.put("currentPage", "0");
jsonObjectDetail.put("curCode", "01"); jsonObjectDetail.put("curCode", "01");
...@@ -136,7 +138,7 @@ public class NbCbAccountService { ...@@ -136,7 +138,7 @@ public class NbCbAccountService {
JSONObject jsonObject = jsonParam.getJSONObject("Data"); JSONObject jsonObject = jsonParam.getJSONObject("Data");
int currentPage = Integer.parseInt((String) jsonObject.get("currentPage")) + 1; int currentPage = Integer.parseInt((String) jsonObject.get("currentPage")) + 1;
jsonObject.put("currentPage", String.valueOf(currentPage)); jsonObject.put("currentPage", String.valueOf(currentPage));
String custId = jsonObject.get("custId").toString();
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonParam.toJSONString()); JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryAccount", jsonParam.toJSONString());
if (Objects.isNull(nbCbResponseData)) { if (Objects.isNull(nbCbResponseData)) {
log.info("定时查询宁波银行账户,返回报文data为空"); log.info("定时查询宁波银行账户,返回报文data为空");
...@@ -148,7 +150,7 @@ public class NbCbAccountService { ...@@ -148,7 +150,7 @@ public class NbCbAccountService {
return; return;
} }
List<NbCbAccount> detailList = JSONArray.parseArray(list.toJSONString(), NbCbAccount.class); List<NbCbAccount> detailList = JSONArray.parseArray(list.toJSONString(), NbCbAccount.class);
thiz.insertOrUpdate(detailList); thiz.insertOrUpdate(detailList,custId);
int totalPage = Integer.parseInt((String) nbCbResponseData.get("totalPage")); int totalPage = Integer.parseInt((String) nbCbResponseData.get("totalPage"));
if (currentPage < totalPage) { if (currentPage < totalPage) {
queryAndInsertAccountPage(jsonParam); queryAndInsertAccountPage(jsonParam);
...@@ -201,8 +203,8 @@ public class NbCbAccountService { ...@@ -201,8 +203,8 @@ public class NbCbAccountService {
return JSONArray.parseArray(list.toJSONString(), NbCbAccount.class); return JSONArray.parseArray(list.toJSONString(), NbCbAccount.class);
} }
public List<String> listAccount() { public List<String> listAccount(String custId) {
return accountMapper.listAccount(); return accountMapper.listAccount(custId);
} }
public List<NbCbAccount> list(NbCbAccountDTO param) { public List<NbCbAccount> list(NbCbAccountDTO param) {
...@@ -210,8 +212,8 @@ public class NbCbAccountService { ...@@ -210,8 +212,8 @@ public class NbCbAccountService {
} }
public JSONArray listAccountArray() { public JSONArray listAccountArray(String custId) {
List<String> bankAccountsList = listAccount(); List<String> bankAccountsList = listAccount(custId);
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
jsonArray.addAll(bankAccountsList); jsonArray.addAll(bankAccountsList);
return jsonArray; return jsonArray;
...@@ -234,11 +236,11 @@ public class NbCbAccountService { ...@@ -234,11 +236,11 @@ public class NbCbAccountService {
dataJsonObject.put("bankAccList", bankAccList); dataJsonObject.put("bankAccList", bankAccList);
dataJsonObject.put("pageSize", "10"); dataJsonObject.put("pageSize", "10");
dataJsonObject.put("currentPage", "0"); dataJsonObject.put("currentPage", "0");
dataJsonObject.put("custId", env.getProperty("nbcb.custId", "9000919969")); dataJsonObject.put("custId", NbCbCustEnum.GL_CUST.getCustId());
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("Data", dataJsonObject); jsonObject.put("Data", dataJsonObject);
queryNbCbAccount(jsonObject.toJSONString()); queryNbCbAccount(jsonObject.toJSONString(),NbCbCustEnum.GL_CUST.getCustId());
//3、设置缓存 //3、设置缓存
redisService.set(redisKey, "1", 60); redisService.set(redisKey, "1", 60);
......
...@@ -122,7 +122,7 @@ public class NbCbBatchTransferService { ...@@ -122,7 +122,7 @@ public class NbCbBatchTransferService {
public boolean nbcbBatchTransfer(NbCbBatchTransferDTO transferInfo) throws Exception{ public boolean nbcbBatchTransfer(NbCbBatchTransferDTO transferInfo) throws Exception{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "9000919969")); jsonObjectDetail.put("custId", transferInfo.getCustId());
jsonObjectDetail.put("batchSerialNo",transferInfo.getBatchSerialNo()); jsonObjectDetail.put("batchSerialNo",transferInfo.getBatchSerialNo());
//默认将流水号作为epr备注1来传参 //默认将流水号作为epr备注1来传参
if (StringUtils.isBlank(transferInfo.getErpRemark1())) { if (StringUtils.isBlank(transferInfo.getErpRemark1())) {
...@@ -558,7 +558,7 @@ public class NbCbBatchTransferService { ...@@ -558,7 +558,7 @@ public class NbCbBatchTransferService {
} }
@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class)
public void transferSchedule(String jobParameter, String updatedBy) throws Exception { public void transferSchedule(String jobParameter, String updatedBy,String custId) throws Exception {
log.info("调用宁波银行批量转账接口任务,jobParameter:{}", jobParameter); log.info("调用宁波银行批量转账接口任务,jobParameter:{}", jobParameter);
List<Long> idList = Lists.newArrayList(); List<Long> idList = Lists.newArrayList();
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
...@@ -568,6 +568,7 @@ public class NbCbBatchTransferService { ...@@ -568,6 +568,7 @@ public class NbCbBatchTransferService {
nbCbBatchTransferDTO.setIdList(idList); nbCbBatchTransferDTO.setIdList(idList);
nbCbBatchTransferDTO.setPushStatus(TransferStatusEnum.NOT_TRANSFER.getValue()); nbCbBatchTransferDTO.setPushStatus(TransferStatusEnum.NOT_TRANSFER.getValue());
nbCbBatchTransferDTO.setPaymentMethod("银行转账"); nbCbBatchTransferDTO.setPaymentMethod("银行转账");
nbCbBatchTransferDTO.setCustId(custId);
List<NbCbBatchTransferDTO> list = thiz.list(nbCbBatchTransferDTO); List<NbCbBatchTransferDTO> list = thiz.list(nbCbBatchTransferDTO);
manualTransfer(list, updatedBy, TransferStatusLogEnum.TRANSFER_LAUNCHED.getValue(), false); manualTransfer(list, updatedBy, TransferStatusLogEnum.TRANSFER_LAUNCHED.getValue(), false);
} }
...@@ -642,14 +643,14 @@ public class NbCbBatchTransferService { ...@@ -642,14 +643,14 @@ public class NbCbBatchTransferService {
@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class)
public void queryBatchTransfer(String jobParameter, String middleWare) { public void queryBatchTransfer(String jobParameter, String middleWare,String custId) {
log.info("定时调用宁波银行批量转账单笔查证,jobParameter:{}", jobParameter); log.info("定时调用宁波银行批量转账单笔查证,jobParameter:{}", jobParameter);
List<Integer> idList = Lists.newArrayList(); List<Integer> idList = Lists.newArrayList();
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
idList = Arrays.stream(jobParameter.split(",")).map(Integer::parseInt).collect(Collectors.toList()); idList = Arrays.stream(jobParameter.split(",")).map(Integer::parseInt).collect(Collectors.toList());
} }
//获取调用宁波转账接口成功且 财资付款状态为空,或者为中间态的记录 //获取调用宁波转账接口成功且 财资付款状态为空,或者为中间态的记录
List<NbCbBatchTransfer> list = listTransferLaunchedRecordByIdList(idList); List<NbCbBatchTransfer> list = listTransferLaunchedRecordByIdList(idList,custId);
for (NbCbBatchTransfer nbCbBatchTransfer : list) { for (NbCbBatchTransfer nbCbBatchTransfer : list) {
nbCbBatchTransfer.setUpdatedBy(middleWare); nbCbBatchTransfer.setUpdatedBy(middleWare);
nbCbBatchTransfer.setUpdatedDate(new Date()); nbCbBatchTransfer.setUpdatedDate(new Date());
...@@ -667,7 +668,7 @@ public class NbCbBatchTransferService { ...@@ -667,7 +668,7 @@ public class NbCbBatchTransferService {
log.error("查询批量转账接口异常状态次数超过上限,batchSerialNo:{}", nbCbBatchTransfer.getBatchSerialNo()); log.error("查询批量转账接口异常状态次数超过上限,batchSerialNo:{}", nbCbBatchTransfer.getBatchSerialNo());
} else { } else {
try { try {
Integer status = getNbcbQueryBatchTransferStatus(nbCbBatchTransfer.getBatchSerialNo(), nbCbBatchTransfer.getTotalNumber()); Integer status = getNbcbQueryBatchTransferStatus(nbCbBatchTransfer.getBatchSerialNo(), nbCbBatchTransfer.getTotalNumber(),nbCbBatchTransfer.getCustId());
if (Objects.equals(nbCbBatchTransfer.getNbTransferStatus(), status)) { if (Objects.equals(nbCbBatchTransfer.getNbTransferStatus(), status)) {
//查询状态跟当前状态相同,不再更新 //查询状态跟当前状态相同,不再更新
continue; continue;
...@@ -756,15 +757,15 @@ public class NbCbBatchTransferService { ...@@ -756,15 +757,15 @@ public class NbCbBatchTransferService {
* @param idList * @param idList
* @return * @return
*/ */
public List<NbCbBatchTransfer> listTransferLaunchedRecordByIdList(List<Integer> idList) { public List<NbCbBatchTransfer> listTransferLaunchedRecordByIdList(List<Integer> idList,String custId) {
return nbCbBatchTransferMapper.listTransferLaunchedRecordByIdList(idList, TransferStatusEnum.TRANSFER_LAUNCHED.getValue(), NbBatchTransferStatusEnum.getAllFinalStatus()); return nbCbBatchTransferMapper.listTransferLaunchedRecordByIdList(idList, TransferStatusEnum.TRANSFER_LAUNCHED.getValue(), NbBatchTransferStatusEnum.getAllFinalStatus(), custId);
} }
public Integer getNbcbQueryBatchTransferStatus(String serialNo, Integer totalNumber) throws Exception { public Integer getNbcbQueryBatchTransferStatus(String serialNo, Integer totalNumber,String custId) throws Exception {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "9000919969")); jsonObjectDetail.put("custId", custId);
jsonObjectDetail.put("batchSerialNo", serialNo); jsonObjectDetail.put("batchSerialNo", serialNo);
jsonObject.put("Data", jsonObjectDetail); jsonObject.put("Data", jsonObjectDetail);
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData2("tmsReport", "queryBatchTransferResult", jsonObject.toJSONString()); JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData2("tmsReport", "queryBatchTransferResult", jsonObject.toJSONString());
......
...@@ -142,7 +142,7 @@ public class NbCbReceiptService { ...@@ -142,7 +142,7 @@ public class NbCbReceiptService {
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public List<NbCbReceipt> insertList(List<NbCbReceipt> insertList, String operator) { public List<NbCbReceipt> insertList(List<NbCbReceipt> insertList, String operator,String custId) {
RpcAssert.assertNotEmpty(insertList, DefaultErrorEnum.DATA_NULL, "nbCbReceipt is null"); RpcAssert.assertNotEmpty(insertList, DefaultErrorEnum.DATA_NULL, "nbCbReceipt is null");
List<String> matchCodeList = insertList.stream().map(NbCbReceipt::getMatchCode).collect(Collectors.toList()); List<String> matchCodeList = insertList.stream().map(NbCbReceipt::getMatchCode).collect(Collectors.toList());
...@@ -168,6 +168,7 @@ public class NbCbReceiptService { ...@@ -168,6 +168,7 @@ public class NbCbReceiptService {
nbCbReceipt.setUpdatedBy(operator); nbCbReceipt.setUpdatedBy(operator);
nbCbReceipt.setUpdatedDate(date); nbCbReceipt.setUpdatedDate(date);
nbCbReceipt.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name()); nbCbReceipt.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
nbCbReceipt.setCustId(custId);
successList.add(nbCbReceipt); successList.add(nbCbReceipt);
} }
} }
...@@ -186,17 +187,17 @@ public class NbCbReceiptService { ...@@ -186,17 +187,17 @@ public class NbCbReceiptService {
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void queryNbCbReceipt(String jobParameter, String transTimeStart, String transTimeEnd, String operator) throws Exception { public void queryNbCbReceipt(String jobParameter, String transTimeStart, String transTimeEnd, String operator,String custId) throws Exception {
JSONObject jsonObject; JSONObject jsonObject;
List<NbCbReceipt> successList = Lists.newArrayList(); List<NbCbReceipt> successList = Lists.newArrayList();
try { try {
//查询回单前先同步账户数据 //查询回单前先同步账户数据
nbCbAccountService.queryNbCbAccount(null); nbCbAccountService.queryNbCbAccount(null,custId);
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
jsonObject = JSONObject.parseObject(jobParameter); jsonObject = JSONObject.parseObject(jobParameter);
} else { } else {
jsonObject = buildQueryReceiptParam(null, transTimeStart, transTimeEnd); jsonObject = buildQueryReceiptParam(null, transTimeStart, transTimeEnd,custId);
} }
//每次最多只能查询100个账号的回单,循环查询 //每次最多只能查询100个账号的回单,循环查询
JSONObject jsonObjectParams = jsonObject.getJSONObject("Data"); JSONObject jsonObjectParams = jsonObject.getJSONObject("Data");
...@@ -216,7 +217,7 @@ public class NbCbReceiptService { ...@@ -216,7 +217,7 @@ public class NbCbReceiptService {
successList = Lists.newArrayList(); successList = Lists.newArrayList();
while (end <= size) { while (end <= size) {
jsonObjectParams.put("accountSet", list.subList(start, end)); jsonObjectParams.put("accountSet", list.subList(start, end));
List<NbCbReceipt> insertedList = thiz.queryNbCbReceipt(jsonObject, operator); List<NbCbReceipt> insertedList = thiz.queryNbCbReceipt(jsonObject, operator,custId);
if (CollectionUtils.isNotEmpty(insertedList)) { if (CollectionUtils.isNotEmpty(insertedList)) {
successList.addAll(insertedList); successList.addAll(insertedList);
} }
...@@ -240,7 +241,7 @@ public class NbCbReceiptService { ...@@ -240,7 +241,7 @@ public class NbCbReceiptService {
taskExecutor.execute(() -> nbCbTransferService.relateReceiptTransfer(finalSuccessList)); taskExecutor.execute(() -> nbCbTransferService.relateReceiptTransfer(finalSuccessList));
List<Long> recepitIdList = finalSuccessList.stream().map(NbCbReceipt::getId).collect(Collectors.toList()); List<Long> recepitIdList = finalSuccessList.stream().map(NbCbReceipt::getId).collect(Collectors.toList());
nbCbAccDetailService.callbackJd(recepitIdList, 2); nbCbAccDetailService.callbackJd(recepitIdList, 2,custId);
} }
} }
}); });
...@@ -255,7 +256,7 @@ public class NbCbReceiptService { ...@@ -255,7 +256,7 @@ public class NbCbReceiptService {
*/ */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public List<NbCbReceipt> queryNbCbReceipt(JSONObject jsonObject, String operator) throws Exception { public List<NbCbReceipt> queryNbCbReceipt(JSONObject jsonObject, String operator,String custId) throws Exception {
//查询下单编号 //查询下单编号
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryReceipt", jsonObject.toJSONString()); JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData("tmsReport", "queryReceipt", jsonObject.toJSONString());
if (Objects.isNull(nbCbResponseData)) { if (Objects.isNull(nbCbResponseData)) {
...@@ -271,7 +272,7 @@ public class NbCbReceiptService { ...@@ -271,7 +272,7 @@ public class NbCbReceiptService {
Thread.sleep(interval * 1000L); Thread.sleep(interval * 1000L);
//查询文件url //查询文件url
NbGetGeneralDownloadInfo downloadInfo = NbCbCommonUtil.getGeneralDownloadUrl(downloadNo, "RECEIPT", env.getProperty("nbcb.custId", "0000112058")); NbGetGeneralDownloadInfo downloadInfo = NbCbCommonUtil.getGeneralDownloadUrl(downloadNo, "RECEIPT",custId );
if (Objects.isNull(downloadInfo) || "1".equals(downloadInfo.getTransState())) { if (Objects.isNull(downloadInfo) || "1".equals(downloadInfo.getTransState())) {
log.info("定时查询宁波银行回单 失败"); log.info("定时查询宁波银行回单 失败");
return null; return null;
...@@ -280,7 +281,7 @@ public class NbCbReceiptService { ...@@ -280,7 +281,7 @@ public class NbCbReceiptService {
if (retrySwitch) { if (retrySwitch) {
NbCbReceiptQueryTaskParamDTO param = new NbCbReceiptQueryTaskParamDTO(); NbCbReceiptQueryTaskParamDTO param = new NbCbReceiptQueryTaskParamDTO();
param.setDownloadNo(downloadNo); param.setDownloadNo(downloadNo);
param.setCustId(custId);
NbCbReceiptQueryTask task = new NbCbReceiptQueryTask(); NbCbReceiptQueryTask task = new NbCbReceiptQueryTask();
task.setParam(JSON.toJSONString(param)); task.setParam(JSON.toJSONString(param));
task.setLastExecTime(new Date()); task.setLastExecTime(new Date());
...@@ -312,28 +313,27 @@ public class NbCbReceiptService { ...@@ -312,28 +313,27 @@ public class NbCbReceiptService {
List<NbCbReceipt> nbCbReceipts = parseZipFile(localFilePath); List<NbCbReceipt> nbCbReceipts = parseZipFile(localFilePath);
log.info("定时查询宁波银行回单 解析完成list:" + nbCbReceipts); log.info("定时查询宁波银行回单 解析完成list:" + nbCbReceipts);
if (CollectionUtils.isNotEmpty(nbCbReceipts)) { if (CollectionUtils.isNotEmpty(nbCbReceipts)) {
List<NbCbReceipt> nbCbReceiptsTemp = thiz.insertList(nbCbReceipts, operator); List<NbCbReceipt> nbCbReceiptsTemp = thiz.insertList(nbCbReceipts, operator, custId);
nbCbReceiptResultList.addAll(nbCbReceiptsTemp); nbCbReceiptResultList.addAll(nbCbReceiptsTemp);
} }
} }
if (CollectionUtils.isNotEmpty(nbCbReceiptResultList)) { if (CollectionUtils.isNotEmpty(nbCbReceiptResultList)) {
return nbCbReceiptResultList; return nbCbReceiptResultList;
} }
return null; return null;
} }
public JSONObject buildQueryReceiptParam(List<String> bankAccList, String transTimeStart, String transTimeEnd) { public JSONObject buildQueryReceiptParam(List<String> bankAccList, String transTimeStart, String transTimeEnd,String custId) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "0000112058")); jsonObjectDetail.put("custId", custId);
JSONArray bankAccListArray = new JSONArray(); JSONArray bankAccListArray = new JSONArray();
if (CollectionUtils.isNotEmpty(bankAccList)) { if (CollectionUtils.isNotEmpty(bankAccList)) {
bankAccListArray.addAll(bankAccList); bankAccListArray.addAll(bankAccList);
} else { } else {
bankAccListArray = nbCbAccountService.listAccountArray(); bankAccListArray = nbCbAccountService.listAccountArray(custId);
} }
if (bankAccListArray.size() == 1) { if (bankAccListArray.size() == 1) {
jsonObjectDetail.put("queryFlag", "1"); jsonObjectDetail.put("queryFlag", "1");
...@@ -356,9 +356,9 @@ public class NbCbReceiptService { ...@@ -356,9 +356,9 @@ public class NbCbReceiptService {
return jsonObject; return jsonObject;
} }
public void reFetchReceipt(List<String> bankAccList, String transTimeStart, String transTimeEnd, String operator) throws Exception { public void reFetchReceipt(List<String> bankAccList, String transTimeStart, String transTimeEnd, String operator,String custId) throws Exception {
JSONObject jsonObject = buildQueryReceiptParam(bankAccList, transTimeStart, transTimeEnd); JSONObject jsonObject = buildQueryReceiptParam(bankAccList, transTimeStart, transTimeEnd,custId);
queryNbCbReceipt(jsonObject.toJSONString(), null, null, operator); queryNbCbReceipt(jsonObject.toJSONString(), null, null, operator,custId);
} }
...@@ -1015,10 +1015,11 @@ public class NbCbReceiptService { ...@@ -1015,10 +1015,11 @@ public class NbCbReceiptService {
return nbCbReceiptMapper.selectByExample(receiptQueryExample); return nbCbReceiptMapper.selectByExample(receiptQueryExample);
} }
public List<NbCbReceipt> queryByMatchCode(List<String> matchCodeList) { public List<NbCbReceipt> queryByMatchCode(List<String> matchCodeList,String custId) {
Example receiptQueryExample = Example.builder(NbCbReceipt.class).where(Sqls.custom() Example receiptQueryExample = Example.builder(NbCbReceipt.class).where(Sqls.custom()
.andIn("matchCode", matchCodeList) .andIn("matchCode", matchCodeList)
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name()) .andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name())
.andEqualTo("custId",custId)
).build(); ).build();
return nbCbReceiptMapper.selectByExample(receiptQueryExample); return nbCbReceiptMapper.selectByExample(receiptQueryExample);
} }
...@@ -1051,6 +1052,11 @@ public class NbCbReceiptService { ...@@ -1051,6 +1052,11 @@ public class NbCbReceiptService {
NbCbReceiptQueryTask task = taskMapper.selectByPrimaryKey(taskId); NbCbReceiptQueryTask task = taskMapper.selectByPrimaryKey(taskId);
NbCbReceiptQueryTaskParamDTO paramDTO = JSON.parseObject(task.getParam(), NbCbReceiptQueryTaskParamDTO.class); NbCbReceiptQueryTaskParamDTO paramDTO = JSON.parseObject(task.getParam(), NbCbReceiptQueryTaskParamDTO.class);
String downloadNo = paramDTO.getDownloadNo(); String downloadNo = paramDTO.getDownloadNo();
String custId = paramDTO.getCustId();
//如果为空 默认广联主体
if(StringUtils.isBlank(custId)){
custId = NbCbCustEnum.GL_CUST.getCustId();
}
NbGetGeneralDownloadInfo downloadInfo; NbGetGeneralDownloadInfo downloadInfo;
Integer retryCount = env.getProperty("nbcb.receipt.retry.count", Integer.class, 1); Integer retryCount = env.getProperty("nbcb.receipt.retry.count", Integer.class, 1);
...@@ -1059,7 +1065,7 @@ public class NbCbReceiptService { ...@@ -1059,7 +1065,7 @@ public class NbCbReceiptService {
try { try {
// 查询任务 // 查询任务
downloadInfo = NbCbCommonUtil.getGeneralDownloadUrl(downloadNo, "RECEIPT", env.getProperty("nbcb.custId", "0000112058")); downloadInfo = NbCbCommonUtil.getGeneralDownloadUrl(downloadNo, "RECEIPT", custId);
} catch (Exception e) { } catch (Exception e) {
log.error("重试查询宁波银行回单 失败 taskId:{}", taskId, e); log.error("重试查询宁波银行回单 失败 taskId:{}", taskId, e);
...@@ -1110,11 +1116,11 @@ public class NbCbReceiptService { ...@@ -1110,11 +1116,11 @@ public class NbCbReceiptService {
return; return;
} }
nbCbReceiptResultList = insertList(nbCbReceiptResultList, "Job"); nbCbReceiptResultList = insertList(nbCbReceiptResultList, "Job", custId);
taskMapper.finishJobById(taskId, ReceiptTaskStatus.NORMAL_END, null, "Job"); taskMapper.finishJobById(taskId, ReceiptTaskStatus.NORMAL_END, null, "Job");
// 推送回单拉取成功 kafka消息 // 推送回单拉取成功 kafka消息 && 广联主体进行发送消息
if (CollectionUtils.isNotEmpty(nbCbReceiptResultList)) { if (CollectionUtils.isNotEmpty(nbCbReceiptResultList) && custId.equals(NbCbCustEnum.GL_CUST.getCustId())) {
String ids = nbCbReceiptResultList.stream().map(NbCbReceipt::getId).map(String::valueOf).collect(Collectors.joining(",")); String ids = nbCbReceiptResultList.stream().map(NbCbReceipt::getId).map(String::valueOf).collect(Collectors.joining(","));
kafkaProducer.send(kafkaTopicConfig.getTradeReceiptFetchSuccess(), ids.getBytes()); kafkaProducer.send(kafkaTopicConfig.getTradeReceiptFetchSuccess(), ids.getBytes());
log.info("重试查询回单成功,发送kafka消息,message:{}", ids); log.info("重试查询回单成功,发送kafka消息,message:{}", ids);
......
...@@ -137,7 +137,7 @@ public class NbCbTransferService { ...@@ -137,7 +137,7 @@ public class NbCbTransferService {
public boolean nbcbSingleTransfer(NbCbTransfer transferInfo) throws Exception{ public boolean nbcbSingleTransfer(NbCbTransfer transferInfo) throws Exception{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "9000919969")); jsonObjectDetail.put("custId", transferInfo.getCustId());
jsonObjectDetail.put("serialNo",transferInfo.getSerialNo()); jsonObjectDetail.put("serialNo",transferInfo.getSerialNo());
//单位代码 //单位代码
jsonObjectDetail.put("corpCode", transferInfo.getCorpCode()); jsonObjectDetail.put("corpCode", transferInfo.getCorpCode());
...@@ -377,13 +377,13 @@ public class NbCbTransferService { ...@@ -377,13 +377,13 @@ public class NbCbTransferService {
} }
@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class)
public void transferSchedule(String jobParameter, String updatedBy) throws Exception { public void transferSchedule(String jobParameter, String updatedBy,String custId) throws Exception {
log.info("调用宁波银行单笔转账接口任务,jobParameter:{}", jobParameter); log.info("调用宁波银行单笔转账接口任务,jobParameter:{}", jobParameter);
List<Integer> idList = Lists.newArrayList(); List<Integer> idList = Lists.newArrayList();
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
idList = Arrays.asList(jobParameter.split(",")).stream().map(Integer::parseInt).collect(Collectors.toList()); idList = Arrays.asList(jobParameter.split(",")).stream().map(Integer::parseInt).collect(Collectors.toList());
} }
List<NbCbTransfer> list = listTransferRecordByIdList(idList); List<NbCbTransfer> list = listTransferRecordByIdList(idList,custId);
manualTransfer(list, updatedBy, TransferStatusLogEnum.TRANSFER_LAUNCHED.getValue(), false); manualTransfer(list, updatedBy, TransferStatusLogEnum.TRANSFER_LAUNCHED.getValue(), false);
} }
...@@ -426,7 +426,7 @@ public class NbCbTransferService { ...@@ -426,7 +426,7 @@ public class NbCbTransferService {
* @param idList * @param idList
* @return * @return
*/ */
public List<NbCbTransfer> listTransferRecordByIdList(List<Integer> idList) { public List<NbCbTransfer> listTransferRecordByIdList(List<Integer> idList,String custId) {
Example example = new Example(NbCbTransfer.class); Example example = new Example(NbCbTransfer.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
if (CollectionUtils.isNotEmpty(idList)) { if (CollectionUtils.isNotEmpty(idList)) {
...@@ -434,6 +434,7 @@ public class NbCbTransferService { ...@@ -434,6 +434,7 @@ public class NbCbTransferService {
} }
criteria.andEqualTo("status", TransferStatusEnum.NOT_TRANSFER.getValue()); criteria.andEqualTo("status", TransferStatusEnum.NOT_TRANSFER.getValue());
criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name()); criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
criteria.andEqualTo("custId",custId);
return nbCbTransferMapper.selectByExample(example); return nbCbTransferMapper.selectByExample(example);
} }
...@@ -819,14 +820,14 @@ public class NbCbTransferService { ...@@ -819,14 +820,14 @@ public class NbCbTransferService {
} }
@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = RpcServiceException.class)
public void queryTransfer(String jobParameter, String middleWare) { public void queryTransfer(String jobParameter, String middleWare,String custId) {
log.info("定时调用宁波银行单笔转账单笔查证,jobParameter:{}", jobParameter); log.info("定时调用宁波银行单笔转账单笔查证,jobParameter:{}", jobParameter);
List<Integer> idList = Lists.newArrayList(); List<Integer> idList = Lists.newArrayList();
if (StringUtils.isNotBlank(jobParameter)) { if (StringUtils.isNotBlank(jobParameter)) {
idList = Arrays.stream(jobParameter.split(",")).map(Integer::parseInt).collect(Collectors.toList()); idList = Arrays.stream(jobParameter.split(",")).map(Integer::parseInt).collect(Collectors.toList());
} }
//获取调用宁波转账接口成功且 财资付款状态为空,或者为中间态的记录 //获取调用宁波转账接口成功且 财资付款状态为空,或者为中间态的记录
List<NbCbTransfer> list = listTransferLaunchedRecordByIdList(idList); List<NbCbTransfer> list = listTransferLaunchedRecordByIdList(idList,custId);
for (NbCbTransfer nbCbTransfer : list) { for (NbCbTransfer nbCbTransfer : list) {
nbCbTransfer.setUpdatedBy(middleWare); nbCbTransfer.setUpdatedBy(middleWare);
nbCbTransfer.setUpdatedDate(new Date()); nbCbTransfer.setUpdatedDate(new Date());
...@@ -844,7 +845,7 @@ public class NbCbTransferService { ...@@ -844,7 +845,7 @@ public class NbCbTransferService {
log.error("查询转账接口异常状态次数超过上限,serialNo:{}", nbCbTransfer.getSerialNo()); log.error("查询转账接口异常状态次数超过上限,serialNo:{}", nbCbTransfer.getSerialNo());
} else { } else {
try { try {
Integer status = getNbcbQueryTransferStatus(nbCbTransfer.getSerialNo()); Integer status = getNbcbQueryTransferStatus(nbCbTransfer.getSerialNo(), nbCbTransfer.getCustId());
if (Objects.equals(nbCbTransfer.getNbTransferStatus(), status)) { if (Objects.equals(nbCbTransfer.getNbTransferStatus(), status)) {
//查询状态跟当前状态相同,不再更新 //查询状态跟当前状态相同,不再更新
continue; continue;
...@@ -893,15 +894,15 @@ public class NbCbTransferService { ...@@ -893,15 +894,15 @@ public class NbCbTransferService {
* @param idList * @param idList
* @return * @return
*/ */
public List<NbCbTransfer> listTransferLaunchedRecordByIdList(List<Integer> idList) { public List<NbCbTransfer> listTransferLaunchedRecordByIdList(List<Integer> idList,String custId) {
return nbCbTransferMapper.listTransferLaunchedRecordByIdList(idList, TransferStatusEnum.TRANSFER_LAUNCHED.getValue(), NbTransferStatusEnum.getAllFinalStatus()); return nbCbTransferMapper.listTransferLaunchedRecordByIdList(idList, TransferStatusEnum.TRANSFER_LAUNCHED.getValue(), NbTransferStatusEnum.getAllFinalStatus(), custId);
} }
public Integer getNbcbQueryTransferStatus(String serialNo) throws Exception { public Integer getNbcbQueryTransferStatus(String serialNo,String custId) throws Exception {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
JSONObject jsonObjectDetail = new JSONObject(); JSONObject jsonObjectDetail = new JSONObject();
jsonObjectDetail.put("custId", env.getProperty("nbcb.custId", "9000919969")); jsonObjectDetail.put("custId", custId);
jsonObjectDetail.put("serialNo", serialNo); jsonObjectDetail.put("serialNo", serialNo);
jsonObject.put("Data", jsonObjectDetail); jsonObject.put("Data", jsonObjectDetail);
JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData2("tmsReport", "querySingleTransferResult", jsonObject.toJSONString()); JSONObject nbCbResponseData = NbCbCommonUtil.getNbCbResponseData2("tmsReport", "querySingleTransferResult", jsonObject.toJSONString());
......
package cn.com.glsx.dj.financial.util; 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.enums.TransferErrorEnum;
import cn.com.glsx.dj.financial.model.NbGetGeneralDownloadInfo; import cn.com.glsx.dj.financial.model.NbGetGeneralDownloadInfo;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
...@@ -23,7 +24,8 @@ public class NbCbCommonUtil { ...@@ -23,7 +24,8 @@ public class NbCbCommonUtil {
public static JSONObject getNbCbResponseData(String productId, String serviceID, String jsonString) throws Exception { public static JSONObject getNbCbResponseData(String productId, String serviceID, String jsonString) throws Exception {
log.info("查询宁波银行接口 productId:{}, serviceID:{}, parma:{}", productId, serviceID, jsonString); 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); log.info("查询宁波银行接口 response" + res);
JSONObject resonseJSON = JSONObject.parseObject(res); JSONObject resonseJSON = JSONObject.parseObject(res);
JSONObject jsonData = resonseJSON.getJSONObject("Data"); JSONObject jsonData = resonseJSON.getJSONObject("Data");
...@@ -37,12 +39,36 @@ public class NbCbCommonUtil { ...@@ -37,12 +39,36 @@ public class NbCbCommonUtil {
public static JSONObject getNbCbResponseData2(String productId, String serviceID, String jsonString) throws Exception { public static JSONObject getNbCbResponseData2(String productId, String serviceID, String jsonString) throws Exception {
log.info("查询宁波银行接口 productId:{}, serviceID:{}, parma:{}", productId, serviceID, jsonString); 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); log.info("查询宁波银行接口 response" + res);
JSONObject resonseJSON = JSONObject.parseObject(res); JSONObject resonseJSON = JSONObject.parseObject(res);
return resonseJSON.getJSONObject("Data"); return resonseJSON.getJSONObject("Data");
} }
/**
* 从jsonString中获取appKey
* @param jsonString
* @return
*/
public static 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 获取枚举配置
String appKey = NbCbCustEnum.getAppKeyByCustId(custId);
if(StringUtils.isBlank(appKey)){
throw new RpcServiceException(TransferErrorEnum.PARAM_ERROR, "未获取到对应的appKey,custId:"+custId);
}
return appKey;
}
/** /**
* 从响应数据中提取错误信息 * 从响应数据中提取错误信息
......
...@@ -245,6 +245,10 @@ ...@@ -245,6 +245,10 @@
and ad.cd_sign = #{cdSign} and ad.cd_sign = #{cdSign}
</if> </if>
<if test="custId != null and custId !=''">
and ad.cust_id = #{custId}
</if>
<if test="curCode != null and curCode !=''"> <if test="curCode != null and curCode !=''">
and ad.cur_code = #{curCode} and ad.cur_code = #{curCode}
</if> </if>
......
...@@ -82,8 +82,12 @@ ...@@ -82,8 +82,12 @@
</where> </where>
</select> </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> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT" />
<result column="corp_code" property="corpCode" jdbcType="VARCHAR" /> <result column="corp_code" property="corpCode" jdbcType="VARCHAR" />
<result column="pay_acc" property="payAcc" 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="pay_name" property="payName" jdbcType="VARCHAR" />
<result column="rcv_acc" property="rcvAcc" jdbcType="VARCHAR" /> <result column="rcv_acc" property="rcvAcc" jdbcType="VARCHAR" />
<result column="rcv_name" property="rcvName" jdbcType="VARCHAR" /> <result column="rcv_name" property="rcvName" jdbcType="VARCHAR" />
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, corp_code, pay_acc, pay_name, rcv_acc, rcv_name, rcv_bank_name, total_amt, total_number, 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, business_code, batch_remark, erp_remark1, erp_remark2, batch_serial_no, dj_serial_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, 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, nb_transfer_status, query_nb_transfer_count, created_date, created_by, updated_date,
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
</select> </select>
<select id="list" resultMap="DTOResultMap"> <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, 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.business_code, cbt.batch_remark, cbt.erp_remark1, cbt.erp_remark2, cbt.batch_serial_no, cbt.dj_serial_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.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, cbt.nb_transfer_status, cbt.query_nb_transfer_count, cbt.created_date,
...@@ -141,6 +142,7 @@ ...@@ -141,6 +142,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
and cust_id = #{custId}
and push_status = #{status} and push_status = #{status}
and (nb_transfer_status is null or and (nb_transfer_status is null or
...@@ -167,6 +169,10 @@ ...@@ -167,6 +169,10 @@
</foreach> </foreach>
</if> </if>
<if test="custId != null and custId !=''">
and cbt.cust_id =#{custId}
</if>
<if test="payName != null and payName !=''"> <if test="payName != null and payName !=''">
and cbt.pay_name like CONCAT('%',#{payName},'%') and cbt.pay_name like CONCAT('%',#{payName},'%')
</if> </if>
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
</foreach> </foreach>
</if> </if>
and status = #{status} and status = #{status}
and cust_id = #{custId}
and (nb_transfer_status is null or and (nb_transfer_status is null or
nb_transfer_status not in nb_transfer_status not in
......
...@@ -35,7 +35,7 @@ public class DemoTest extends BaseServiceTest { ...@@ -35,7 +35,7 @@ public class DemoTest extends BaseServiceTest {
public void main() { public void main() {
try { try {
//nbAccDetailService.queryNbCbJobAccDetail(""); //nbAccDetailService.queryNbCbJobAccDetail("");
nbCbAccountService.queryNbCbAccount(""); nbCbAccountService.queryNbCbAccount("","");
//nbCbReceiptService.queryNbCbReceipt("{\"Data\":{\"queryFlag\":\"1\",\"custId\":\"0000112058\",\"accountSet\":[\"86041110000109337\"],\"serialNo\":\"\"}}"); //nbCbReceiptService.queryNbCbReceipt("{\"Data\":{\"queryFlag\":\"1\",\"custId\":\"0000112058\",\"accountSet\":[\"86041110000109337\"],\"serialNo\":\"\"}}");
//nbCbReceiptService.queryNbCbReceipt(""); //nbCbReceiptService.queryNbCbReceipt("");
//nbCbReceiptService.queryNbCbReceipt(""); //nbCbReceiptService.queryNbCbReceipt("");
......
...@@ -22,13 +22,13 @@ public class QueryNbCbReceiptJobTest extends BaseServiceTest { ...@@ -22,13 +22,13 @@ public class QueryNbCbReceiptJobTest extends BaseServiceTest {
public void test() throws Exception { 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-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\"]}}"; 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 @Test
public void testQa() throws Exception { public void testQa() throws Exception {
String param = "{\"Data\":{\"beginDate\":\"2024-03-01\",\"queryFlag\":\"2\",\"endDate\":\"2024-03-30\",\"custId\":\"0000112058\",\"accountSet\":[\"86041110000109337\"]}}"; 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,"");
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ public class QueryNbCbTransferTest extends BaseServiceTest { ...@@ -21,7 +21,7 @@ public class QueryNbCbTransferTest extends BaseServiceTest {
String s = "79"; String s = "79";
try { try {
nbCbTransferService.transferSchedule(s,CommonConstants.MIDDLE_WARE); nbCbTransferService.transferSchedule(s,CommonConstants.MIDDLE_WARE,"9000919969");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -99,12 +99,12 @@ public class NbCbAccDetailServiceTest extends BaseServiceTest { ...@@ -99,12 +99,12 @@ public class NbCbAccDetailServiceTest extends BaseServiceTest {
@Test @Test
public void queryNbCbAccDetailReceipt() { public void queryNbCbAccDetailReceipt() {
nbCbAccDetailService.queryNbCbAccDetailReceipt("2025-07-25", "chenxi"); nbCbAccDetailService.queryNbCbAccDetailReceipt("2025-07-25", "chenxi","");
} }
@Test @Test
public void queryNbCbAccDetailByDate() { public void queryNbCbAccDetailByDate() {
nbCbAccDetailService.queryNbCbAccDetailByDate("2025-07-25", "chenxi"); nbCbAccDetailService.queryNbCbAccDetailByDate("2025-07-25", "chenxi","");
} }
......
...@@ -17,7 +17,7 @@ public class NbCbReceiptServiceTest extends BaseServiceTest { ...@@ -17,7 +17,7 @@ public class NbCbReceiptServiceTest extends BaseServiceTest {
@Test @Test
public void testQueryNbCbReceipt() { public void testQueryNbCbReceipt() {
try { try {
nbCbReceiptService.queryNbCbReceipt("", null, null, "中间件"); nbCbReceiptService.queryNbCbReceipt("", null, null, "中间件","");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -147,7 +147,7 @@ public class NbCbTransferServiceTest extends BaseServiceTest { ...@@ -147,7 +147,7 @@ public class NbCbTransferServiceTest extends BaseServiceTest {
@Test @Test
public void testQueryTransfer() { public void testQueryTransfer() {
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
nbCbTransferService.queryTransfer("", "中间件"); // nbCbTransferService.queryTransfer("", "中间件");
} }
} }
......
...@@ -225,7 +225,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest { ...@@ -225,7 +225,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
jsonObject.put("Data", jsonObjectDetail); jsonObject.put("Data", jsonObjectDetail);
try { try {
nbCbBatchTransferService.batchTransfer(jsonObject.toJSONString()); nbCbBatchTransferService.batchTransfer(jsonObject.toJSONString());
nbCbBatchTransferService.queryBatchTransfer(null, null); nbCbBatchTransferService.queryBatchTransfer(null, null,"");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
...@@ -235,7 +235,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest { ...@@ -235,7 +235,7 @@ public class OaApplyBatchTransferServiceTest extends BaseServiceTest {
@Test @Test
public void queryBatchTransferResult() { public void queryBatchTransferResult() {
try { try {
nbCbBatchTransferService.queryBatchTransfer(null, null); nbCbBatchTransferService.queryBatchTransfer(null, null,"");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(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!