|
@@ -16,18 +16,21 @@ import com.pj.api.wx.bo.*;
|
|
|
import com.pj.api.wx.vo.PrePayVO;
|
|
|
import com.pj.current.config.MyConfig;
|
|
|
import com.pj.current.config.WxConfig;
|
|
|
+import com.pj.project.tb_account.TbAccountService;
|
|
|
import com.pj.project.tb_business.TbBusiness;
|
|
|
import com.pj.project.tb_business.TbBusinessService;
|
|
|
import com.pj.project.tb_business_car.TbBusinessCar;
|
|
|
import com.pj.project.tb_business_car.TbBusinessCarService;
|
|
|
import com.pj.project.tb_business_item.TbBusinessItem;
|
|
|
import com.pj.project.tb_business_item.TbBusinessItemService;
|
|
|
+import com.pj.project.tb_charge_record.TbChargeRecord;
|
|
|
import com.pj.project.tb_costomer.TbCostomer;
|
|
|
import com.pj.project.tb_costomer.TbCostomerService;
|
|
|
import com.pj.project.tb_fee_statistics.TbFeeStatisticsService;
|
|
|
import com.pj.project.tb_pay_record.TbPayRecord;
|
|
|
import com.pj.project.tb_pay_record.TbPayRecordService;
|
|
|
import com.pj.utils.cache.RedisUtil;
|
|
|
+import lombok.experimental.Accessors;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
@@ -66,6 +69,8 @@ public class WxService {
|
|
|
TbBusinessItemService tbBusinessItemService;
|
|
|
@Resource
|
|
|
TbFeeStatisticsService tbFeeStatisticsService;
|
|
|
+ @Resource
|
|
|
+ private TbAccountService tbAccountService;
|
|
|
|
|
|
/**
|
|
|
* 统一下单接口
|
|
@@ -151,14 +156,16 @@ public class WxService {
|
|
|
return ip;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
TimedCache<String, Integer> NotifyCache = CacheUtil.newTimedCache(360000);
|
|
|
+
|
|
|
@Async
|
|
|
public void WxNotify(NotifyBO notifyBO) throws Exception {
|
|
|
String outTradeNo = notifyBO.getOutTradeNo();
|
|
|
- if (NotifyCache.get(outTradeNo)!=null) {
|
|
|
+ if (NotifyCache.get(outTradeNo) != null) {
|
|
|
return;
|
|
|
}
|
|
|
- NotifyCache.put(outTradeNo,1);
|
|
|
+ NotifyCache.put(outTradeNo, 1);
|
|
|
String total_fee = notifyBO.getTotalFee();
|
|
|
BigDecimal money = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, BigDecimal.ROUND_UP);
|
|
|
log.info("wx pay notify;{}", JSONUtil.toJsonStr(notifyBO));
|
|
@@ -202,6 +209,11 @@ public class WxService {
|
|
|
.setCustomerId(tbCostomer.getId()).setCustomerName(tbCostomer.getName());
|
|
|
tbPayRecordService.save(payRecord);
|
|
|
}
|
|
|
+ String a = attach.getA();
|
|
|
+ if (StrUtil.isNotEmpty(a)) {
|
|
|
+ AccountChargeBO chargeBO = JSONUtil.toBean(a, AccountChargeBO.class);
|
|
|
+ tbAccountService.recharge(chargeBO.getId(), chargeBO.getC(), TbChargeRecord.Ch.WECHAT.getType(), money);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|