Browse Source

取消支付加上代理加盟费缴费记录

july 4 years ago
parent
commit
842d57abde

+ 10 - 0
ldt-core/src/main/java/org/springblade/payment/handle/handler/CancelTradeHandle.java

@@ -10,6 +10,8 @@ import org.springblade.common.enums.GoodsConstant;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.ldt.agent.entity.AgentLeagueRecord;
+import org.springblade.ldt.agent.service.IAgentLeagueRecordService;
 import org.springblade.ldt.bills.entity.*;
 import org.springblade.ldt.bills.service.*;
 import org.springblade.ldt.user.entity.LoginUser;
@@ -39,6 +41,7 @@ public class CancelTradeHandle {
 	private IFrozenRecService frozenRecService;
 	private IUserChannelPointService userChannelPointService;
 	private IGoodsBillsService goodsBillsService;
+	private IAgentLeagueRecordService agentLeagueRecordService;
 
 	public void handle(SuccessParams successParams) throws ServiceException {
 		Bills bills = successParams.getBills();
@@ -83,6 +86,13 @@ public class CancelTradeHandle {
 			balanceBillsService.saveOrUpdate(balanceBills);
 		}
 
+		AgentLeagueRecord agentLeagueRecord = agentLeagueRecordService.getOne(Wrappers.<AgentLeagueRecord>lambdaQuery()
+			.eq(AgentLeagueRecord::getTradeNo, successParams.getBills().getId()));
+		if (ObjectUtils.isNotEmpty(agentLeagueRecord)) {
+			agentLeagueRecord.setPayStatus(AppConstant.BillPayStatus.取消付款.name());
+			agentLeagueRecordService.saveOrUpdate(agentLeagueRecord);
+		}
+
 		//取消商品订单
 		GoodsBills goodsBills = goodsBillsService.getOne(Condition.getQueryWrapper(new GoodsBills()).lambda().eq(GoodsBills::getBillsId, bills.getId()));
 		if (ObjectUtil.isNotEmpty(goodsBills)) {