|
@@ -12,14 +12,8 @@ import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.modules.pay.entity.ProfitSharingRequest;
|
|
import org.jeecg.modules.pay.entity.ProfitSharingRequest;
|
|
|
import org.jeecg.modules.pay.entity.Receiver;
|
|
import org.jeecg.modules.pay.entity.Receiver;
|
|
|
import org.jeecg.modules.pay.entity.ReceiverAddForm;
|
|
import org.jeecg.modules.pay.entity.ReceiverAddForm;
|
|
|
-import org.jeecg.modules.system.app.entity.AppOrder;
|
|
|
|
|
-import org.jeecg.modules.system.app.entity.AppOrderProInfo;
|
|
|
|
|
-import org.jeecg.modules.system.app.entity.AppProfitSharingInfo;
|
|
|
|
|
-import org.jeecg.modules.system.app.entity.AppProfitSharingRecords;
|
|
|
|
|
-import org.jeecg.modules.system.app.mapper.AppOrderMapper;
|
|
|
|
|
-import org.jeecg.modules.system.app.mapper.AppOrderProInfoMapper;
|
|
|
|
|
-import org.jeecg.modules.system.app.mapper.AppProfitSharingInfoMapper;
|
|
|
|
|
-import org.jeecg.modules.system.app.mapper.AppProfitSharingRecordsMapper;
|
|
|
|
|
|
|
+import org.jeecg.modules.system.app.entity.*;
|
|
|
|
|
+import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -61,7 +55,8 @@ public class WeChatProfitSharingService {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private AppProfitSharingInfoMapper appProfitSharingInfoMapper;
|
|
private AppProfitSharingInfoMapper appProfitSharingInfoMapper;
|
|
|
-
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ShopMoneyMapper shopMoneyMapper;
|
|
|
/**
|
|
/**
|
|
|
* 添加分账接收方
|
|
* 添加分账接收方
|
|
|
*
|
|
*
|
|
@@ -155,6 +150,20 @@ public class WeChatProfitSharingService {
|
|
|
JSONObject res = wechatPayV3Utils.profitSharingSendPost(WechatUrlConstants.PAY_V3_PROFIT_SHARING, JSONObject.from(profitSharingRequest));
|
|
JSONObject res = wechatPayV3Utils.profitSharingSendPost(WechatUrlConstants.PAY_V3_PROFIT_SHARING, JSONObject.from(profitSharingRequest));
|
|
|
log.info("微信服务商分账--------------------------------------------------wechatPay res:{}", res.toString());
|
|
log.info("微信服务商分账--------------------------------------------------wechatPay res:{}", res.toString());
|
|
|
if (ObjectUtil.isNotEmpty(res)) {
|
|
if (ObjectUtil.isNotEmpty(res)) {
|
|
|
|
|
+ ShopMoney shopMoney = shopMoneyMapper.selectOne(Wrappers.<ShopMoney>lambdaQuery()
|
|
|
|
|
+ .eq(ShopMoney::getOrgCode, appOrder.getOrgCode())
|
|
|
|
|
+ .last("limit 1")
|
|
|
|
|
+ .orderByDesc(ShopMoney::getCreateTime));
|
|
|
|
|
+ shopMoneyMapper.insert(new ShopMoney()
|
|
|
|
|
+ .setOrgCode(appOrder.getOrgCode())
|
|
|
|
|
+ .setIncomeType(2)
|
|
|
|
|
+ .setMoneyType(1)
|
|
|
|
|
+ .setOrderCode(appOrder.getOrderCode())
|
|
|
|
|
+ .setBeforeChange(shopMoney.getAfterChange())
|
|
|
|
|
+ .setAfterChange(shopMoney.getAfterChange().subtract(appOrder.getPrice()))
|
|
|
|
|
+ .setMoneyChange(appOrder.getPrice())
|
|
|
|
|
+ .setChangeInfo(3)
|
|
|
|
|
+ .setCreateTime(new Date()));
|
|
|
if ("PROCESSING".equals(res.getString("state"))) {
|
|
if ("PROCESSING".equals(res.getString("state"))) {
|
|
|
appProfitSharingRecords.setStatus(0);
|
|
appProfitSharingRecords.setStatus(0);
|
|
|
appOrder.setProfitSharingStatus(1);
|
|
appOrder.setProfitSharingStatus(1);
|