Browse Source

优化更新已收取金额

shuiqilin
zhangxin 1 year ago
parent
commit
15ed4b47d6

+ 2
- 1
src/main/java/com/qtzl/alterSales/manager/service/AflPaccountRefundCountService.java View File

@@ -1,11 +1,12 @@
package com.qtzl.alterSales.manager.service;

import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import com.qtzl.alterSales.dao.entity.primary.FssPaccountPay;
import com.qtzl.alterSales.manager.model.protocol.sales.AflPaccountRefundCountFindPageViewRequest;
import org.slf4j.Logger;

public interface AflPaccountRefundCountService {
String export(AflPaccountRefundCountFindPageViewRequest request, Logger logger) throws ServiceHandleException;

void saveFind(String payId);
void saveFind(FssPaccountPay fssPaccountPay);
}

+ 13
- 12
src/main/java/com/qtzl/alterSales/manager/service/AflPaccountRefundCountServiceImpl.java View File

@@ -1,6 +1,7 @@
package com.qtzl.alterSales.manager.service;

import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists;
import com.qtzl.alterSales.dao.entity.primary.AflAgencyMchRel;
import com.qtzl.alterSales.dao.entity.primary.FssPaccountPay;
@@ -92,34 +93,34 @@ public class AflPaccountRefundCountServiceImpl implements AflPaccountRefundCount
}

@Override
public void saveFind(String payId) {
log.info("请求查询流水信息请求参数,payId={}",payId);
if (StringUtils.isEmpty(payId)){
log.error("请求查询流水信息请求参数为空");
public void saveFind(FssPaccountPay fssPaccountPay) {
if (fssPaccountPay==null){
log.error("流水信息为空");
return;
}
FssPaccountPay fssPaccountPay = fssPaccountPayRepo.findByPayId(payId);
if (fssPaccountPay==null){
log.error("未查询到流水信息,payId ={}",payId);
log.info("请求查询流水信息请求参数,payId={}", JSON.toJSONString(fssPaccountPay));
if (StringUtils.isEmpty(fssPaccountPay.getPayId())){
log.error("请求查询流水信息请求参数payId为空");
return;
}
if (fssPaccountPay.getStatus()==null ||fssPaccountPay.getStatus().equals(1)){
log.error("查询到流水信息状态为已补缴或状态为空,payId ={},status={}",payId,fssPaccountPay.getStatus());
log.error("查询到流水信息状态为已补缴或状态为空,payId ={},status={}",fssPaccountPay.getPayId(),fssPaccountPay.getStatus());
return;
}
if (StringUtils.isEmpty(fssPaccountPay.getAgentId())||fssPaccountPay.getInserttime()==null||fssPaccountPay.getReceiptAmt()==null){
log.error("查询到流水信息渠道id不存在或者插入时间为空或金额为空,payId ={}",payId);
log.error("查询到流水信息渠道id不存在或者插入时间为空或金额为空,payId ={}",fssPaccountPay.getPayId());
return;
}
String format =null;
try {
format = DateTimeFormatter.ofPattern("yyyyMMdd").format(fssPaccountPay.getInserttime());
} catch (Exception e) {
log.error("查询到流水信息插入时间转换有误,payId ={}",payId);
log.error("查询到流水信息插入时间转换有误,payId ={}",fssPaccountPay.getPayId());
return;
}
if (StringUtils.isEmpty(format)){
log.error("查询到流水信息时间日期为空,payId ={}",payId);
log.error("查询到流水信息时间日期为空,payId ={}",fssPaccountPay.getPayId());
return;
}

@@ -136,7 +137,7 @@ public class AflPaccountRefundCountServiceImpl implements AflPaccountRefundCount
log.error("未查询到部中心原始流水统计信息,AgentId ={},accountDate={}",fssPaccountPay.getAgentId(),format);
return;
}
Long collectMoney =0l;
Long collectMoney =0L;
if (aflPaccountRefundCount.getCollectMoney()!=null){
collectMoney = aflPaccountRefundCount.getCollectMoney();
}

+ 8
- 8
src/main/java/com/qtzl/alterSales/manager/service/AflSupplementaryPayOrderServiceImpl.java View File

@@ -67,7 +67,13 @@ public class AflSupplementaryPayOrderServiceImpl implements AflSupplementaryPayO
supplementaryPayOrder.setSupplementaryTime(successTime);
supplementaryPayOrder.setSupplementaryNotifyTime(LocalDateTime.now());
supplementaryPayOrder.setState(SupplementartPayOrderStateEnum.SUCCESS);

//进行统计累加已收款金额
try {
aflPaccountRefundCountService.saveFind(fssPaccountPay);
} catch (Exception e) {
log.error("进行统计累加已收款金额失败... payId:{}", request.getPayId());
e.printStackTrace();
}
fssPaccountPay.setStatus(1);
fssPaccountPay.setMsg("请款成功");
fssPaccountPay.setWxPayStatus(1);
@@ -76,13 +82,7 @@ public class AflSupplementaryPayOrderServiceImpl implements AflSupplementaryPayO
// 进行是否需要进行返白操作
userStateHandler(fssPaccountPay, request.getPayId());
//
//进行统计累加已收款金额
try {
aflPaccountRefundCountService.saveFind(request.getPayId());
} catch (Exception e) {
log.error("进行统计累加已收款金额失败... payId:{}", request.getPayId());
e.printStackTrace();
}


supplementaryPayOrderRepo.save(supplementaryPayOrder);
accountPayRepo.save(fssPaccountPay);

+ 7
- 6
src/main/java/com/qtzl/alterSales/manager/service/ChoiceBillsOperationServiceImpl.java View File

@@ -209,6 +209,12 @@ public class ChoiceBillsOperationServiceImpl implements ChoiceBillsOperationServ
return;
}
accountPayList.forEach(pay -> {
try {
aflPaccountRefundCountService.saveFind(pay);
} catch (Exception e) {
e.printStackTrace();
log.error("进行统计累加已收款金额失败... payId:{}", pay.getPayId());
}
pay.setStatus(1);
pay.setMsg("请款成功");
pay.setWxPayStatus(1);
@@ -216,12 +222,7 @@ public class ChoiceBillsOperationServiceImpl implements ChoiceBillsOperationServ
pay.setWxOrderId(payOrder.getOrderNo());
//
//进行统计累加已收款金额
try {
aflPaccountRefundCountService.saveFind(pay.getPayId());
} catch (Exception e) {
e.printStackTrace();
log.error("进行统计累加已收款金额失败... payId:{}", pay.getPayId());
}

supplementaryPayOrderService.paySuccessNotify(pay.getPayId(), payTime, payOrder.getOrderNo());
});
accountPayRepo.saveAll(accountPayList);

Loading…
Cancel
Save