更新10.11
This commit is contained in:
parent
248ad2bb95
commit
70fa9bfe1e
@ -6,6 +6,7 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fuint.api.fuyou.entity.*;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigRecordService;
|
||||
@ -15,6 +16,9 @@ import com.fuint.business.commission.service.StaffCommissionService;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.integral.service.IntegralSettingsService;
|
||||
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendRecordsService;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
||||
@ -60,10 +64,12 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
private MerchantConfigRecordService merchantConfigRecordService;
|
||||
@Resource
|
||||
private IntegralSettingsService integralSettingsService;
|
||||
|
||||
|
||||
@Resource
|
||||
private CardValueOrdersService cardValueOrdersService;
|
||||
@Autowired
|
||||
private ActiveRecommendRecordsService activeRecommendRecordsService;
|
||||
@Autowired
|
||||
private CardCouponUserMapper cardCouponUserMapper;
|
||||
|
||||
/**
|
||||
* 条码支付
|
||||
@ -184,6 +190,8 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
Map<String, String> reqMap = Utils.xmlStr2Map(rspXml);
|
||||
String str = reqMap.get("sign");
|
||||
if (Utils.verifySign(reqMap, str)) {
|
||||
//查询总订单
|
||||
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
||||
//油品订单
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
|
||||
//商品订单
|
||||
@ -226,13 +234,22 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
|
||||
//修改优惠券使用状态
|
||||
if (oilOrder.getCouponId() != null) {
|
||||
CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId());
|
||||
if (!ObjectUtil.isEmpty(byId)) {
|
||||
byId.setStatus("1");
|
||||
cardFavorableRecordService.updateById(byId);
|
||||
}
|
||||
//新表
|
||||
CardCouponUser cardCouponUser = cardCouponUserMapper.selectOne(new LambdaQueryWrapper<CardCouponUser>()
|
||||
.eq(CardCouponUser::getOrderId, allOrderInfo.getId()));
|
||||
if (ObjectUtil.isNotEmpty(cardCouponUser)) {
|
||||
cardCouponUser.setStatus("1");
|
||||
cardCouponUser.setUpdateTime(date);
|
||||
cardCouponUser.setUpdateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
cardCouponUserMapper.updateById(cardCouponUser);
|
||||
}
|
||||
// if (oilOrder.getCouponId() != null) {
|
||||
// CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId());
|
||||
// if (!ObjectUtil.isEmpty(byId)) {
|
||||
// byId.setStatus("1");
|
||||
// cardFavorableRecordService.updateById(byId);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(goodsOrder)) {
|
||||
// 商品订单
|
||||
@ -418,6 +435,8 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
merchantConfigRecord.setOrderNo(orderNo);
|
||||
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
|
||||
}
|
||||
//推荐会员充值有礼
|
||||
activeRecommendRecordsService.recommendMembersRechargePolite(allOrderInfo.getStoreId(), allOrderInfo.getUserId(), allOrderInfo.getPayType());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -35,6 +35,12 @@ public interface ActiveRecommendRecordsService extends IService<ActiveRecommendR
|
||||
*/
|
||||
boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO) throws Exception;
|
||||
|
||||
/**
|
||||
* 消费后推荐充值有礼
|
||||
* @param storeId 店铺ID
|
||||
* @param inviteeUserId 被邀请人id
|
||||
* @param payType 支付方式
|
||||
*/
|
||||
void recommendMembersRechargePolite(Integer storeId,Integer inviteeUserId, String payType);
|
||||
}
|
||||
|
||||
|
@ -295,6 +295,12 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费后推荐充值有礼
|
||||
* @param storeId 店铺ID
|
||||
* @param inviteeUserId 被邀请人id
|
||||
* @param payType 支付方式
|
||||
*/
|
||||
@Override
|
||||
public void recommendMembersRechargePolite(Integer storeId, Integer inviteeUserId, String payType) {
|
||||
//查询当前用户是否有推荐人
|
||||
|
Loading…
Reference in New Issue
Block a user