Kaynağa Gözat

优化重复累加问题

shuiqilin
zhangxin 1 yıl önce
ebeveyn
işleme
1eec31e418

+ 19
- 0
src/main/java/com/qtzl/alterSales/manager/service/AflPaccountRefundCountServiceImpl.java Dosyayı Görüntüle

package com.qtzl.alterSales.manager.service; package com.qtzl.alterSales.manager.service;


import cn.com.taiji.common.manager.net.http.ServiceHandleException; import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.qtzl.alterSales.dao.entity.primary.AflAgencyMchRel; import com.qtzl.alterSales.dao.entity.primary.AflAgencyMchRel;
import com.qtzl.alterSales.manager.service.third.ConstantConfig; import com.qtzl.alterSales.manager.service.third.ConstantConfig;
import com.qtzl.alterSales.manager.service.third.FmsService; import com.qtzl.alterSales.manager.service.third.FmsService;
import com.qtzl.alterSales.manager.tools.ExcelUtils; import com.qtzl.alterSales.manager.tools.ExcelUtils;
import com.qtzl.alterSales.manager.tools.RedisUtils;
import com.qtzl.alterSales.manager.vo.AflPaccountRefundCountVo; import com.qtzl.alterSales.manager.vo.AflPaccountRefundCountVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
FmsService fmsService; FmsService fmsService;
@Resource @Resource
ConstantConfig constantConfig; ConstantConfig constantConfig;
@Resource
RedisUtils redisUtils;

private static final String COUNT_KEY = "COUNT_";
@Override @Override
public String export(AflPaccountRefundCountFindPageViewRequest request, Logger logger) throws ServiceHandleException { public String export(AflPaccountRefundCountFindPageViewRequest request, Logger logger) throws ServiceHandleException {
String pathFile =null; String pathFile =null;
log.error("未查询到部中心原始流水统计信息,AgentId ={},accountDate={}",fssPaccountPay.getAgentId(),format); log.error("未查询到部中心原始流水统计信息,AgentId ={},accountDate={}",fssPaccountPay.getAgentId(),format);
return; return;
} }
try {
String redisKey=COUNT_KEY+fssPaccountPay.getPayId();
final Object redisData = redisUtils.get(redisKey);
if (!ObjectUtil.isEmpty(redisData)) {
log.error("该数据已存在60秒内处理中,请勿重复处理");
return;
}else {
redisUtils.set(redisKey,JSON.toJSONString(fssPaccountPay),60);
}
} catch (Exception e) {
log.error("保存redis信息错误,fssPaccountPay ={},{}",JSON.toJSONString(fssPaccountPay),e.getMessage());
return;
}
Long collectMoney =0L; Long collectMoney =0L;
if (aflPaccountRefundCount.getCollectMoney()!=null){ if (aflPaccountRefundCount.getCollectMoney()!=null){
collectMoney = aflPaccountRefundCount.getCollectMoney(); collectMoney = aflPaccountRefundCount.getCollectMoney();

Loading…
İptal
Kaydet