Commit 94d2ebb2 authored by huyuchen's avatar huyuchen

huych-到账明细查询

parent 18ecb91b
......@@ -62,6 +62,19 @@ public class IcbcTransactionFlowQueryController {
return icbcTransactionFlowQueryService.getIcbcTransactionFlowNew();
}
/**
* 查询昨日交易流水
*
* @param
* @return
*/
@Operation(summary = "查询昨日交易流水", description = "查询昨日交易流水")
@Inner
@PostMapping("/inner/newPageYesterday")
public R getIcbcTransactionFlowYesterdayInner() throws IcbcApiException {
return icbcTransactionFlowQueryService.getIcbcTransactionFlowYesterdayInner();
}
/**
* 预订单接口
*
......
......@@ -17,6 +17,8 @@ public interface IcbcTransactionFlowQueryService extends IService<EkpSocialInfo>
R getIcbcTransactionFlowNew() throws IcbcApiException;
R getIcbcTransactionFlowYesterdayInner() throws IcbcApiException;
R saveIcbcManagerCard();
R querybankinfo();
......
......@@ -175,6 +175,65 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return R.ok();
}
public R getIcbcTransactionFlowYesterdayInner() throws IcbcApiException {
DefaultIcbcClient client = new DefaultIcbcClient(icbcConfigProperties.getAppId(), IcbcConstants.SIGN_TYPE_CA_SM_ICBC,
icbcConfigProperties.getAppPrivateKey(), IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, null,
null, null, icbcConfigProperties.getCaSm(), null);
client.setIcbc_ca(icbcConfigProperties.getCaSmIcbc());
MybankEnterpriseTradeQhisdRequestV1.MybankEnterpriseTradeQhisdRequestBizV1 bizContent =
new MybankEnterpriseTradeQhisdRequestV1.MybankEnterpriseTradeQhisdRequestBizV1();
MybankEnterpriseTradeQhisdRequestV1 request = new MybankEnterpriseTradeQhisdRequestV1();
// 获取当前时间
LocalTime currentTime = LocalTime.now();
// 使用DateTimeFormatter格式化
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HHmmssSSS");
String formattedTime = currentTime.format(formatter);
bizContent.setTranDate(DateUtil.addDay(-1).replace("-",""));
bizContent.setTranTime(formattedTime);
bizContent.setTransCode("QHISD");
bizContent.setLanguage("zh_CN");
String fSeqNo = "AHWX" + System.currentTimeMillis();
bizContent.setfSeqno(fSeqNo);
bizContent.setAccountNo("1302010109024596014");
bizContent.setBeginDate(DateUtil.getThisDay());
bizContent.setDrcrf("2");
request.setServiceUrl(icbcConfigProperties.getServerUrl());
request.setBizContent(bizContent);
MybankEnterpriseTradeQhisdResponseV1 response = client.execute(request);
if(response.isSuccess()) {
//查询当天的所有入账记录数据
List<String> serioList = baseMapper.getAllserioNo();
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> list = response.getRd();
String bankName = response.getAccountName();
String bankNo = response.getAccountNo();
//获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if (!list.isEmpty()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> insertList =
list.stream().filter(e-> e.getDrcrf().equals("2") && !serioList.contains(e.getOnlySequence())).collect(Collectors.toList());
//封装数据
if (!insertList.isEmpty()) {
log.error("昨日新增到账明细条数:" + insertList.size());
try {
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry : insertList) {
EKPEntryPushParam pushParam = new EKPEntryPushParam();
initValue(entry, pushParam, bankName, bankNo);
String body = sendToEkp(pushParam);
//重试
if (StringUtils.isBlank(body)) {
sendToEkp(pushParam);
}
}
}catch (Exception e) {
log.error("昨日新增到账明细推送失败",e);
}
}
}
}
return R.ok();
}
//推送数据
public String sendToEkp(EKPEntryPushParam pushParam){
RestTemplate yourRestTemplate = new RestTemplate();
......
......@@ -36,5 +36,18 @@ public class EkpTask {
log.info("------------定时生成入账明细数据-定时任务结束------------");
}
/**
* @Author huyc
* @Description 昨日未生成的到账明细生成
* @Date 2024-8-28 16:31:32
* @Param
* @return
**/
public void doCreateYesterdayEntryInfoEkp() {
log.info("------------定时生成昨日未生成的入账明细数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpProperties.getAppUrl(),daprEkpProperties.getAppId(),"/icbcQuery/inner/newPageYesterday","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成昨日未生成的入账明细数据-定时任务结束------------");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment