|
|
@@ -26,6 +26,7 @@ import org.springblade.modules.ldt.shop.entity.Shop;
|
|
|
import org.springblade.modules.ldt.shop.service.IShopService;
|
|
|
import org.springblade.modules.ldt.shopyingshou.service.IShopYingshouService;
|
|
|
import org.springblade.modules.payment.paystrategy.loginuser.IPayStrategy;
|
|
|
+import org.springblade.modules.payment.paystrategy.loginuser.util.PayUtil;
|
|
|
import org.springblade.modules.system.service.IParamService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -125,45 +126,13 @@ public class ChannelZeroRareZeroStrategy implements IPayStrategy {
|
|
|
if (shop.getMallId() != null) {
|
|
|
mall = mallService.getById(shop.getMallId());
|
|
|
//商场带确认赠送积分
|
|
|
- PointDetail mallSendPoint = new PointDetail();
|
|
|
- mallSendPoint.setMemberId(mallMember.getId());
|
|
|
- mallSendPoint.setMallId(mall.getId());
|
|
|
- mallSendPoint.setUserId(loginUser.getId());
|
|
|
- mallSendPoint.setType(SystemConstant.PointDetailType.MALL_SEND.getValue());
|
|
|
- mallSendPoint.setName(mall.getName());
|
|
|
- mallSendPoint.setLogo(mall.getPic());
|
|
|
- mallSendPoint.setPrice(billRecord.getPrice());//总价
|
|
|
- mallSendPoint.setChannelId(mall.getId());
|
|
|
- //商场送的积分数 = 总价*商场会员中心每消费一元赠送的积分数
|
|
|
- mallSendPoint.setPoint(billRecord.getPrice().multiply(mall.getConsumeOnePoint()));
|
|
|
- //商场赠送的积分价值 = 商场送的积分数*商场会员中心的积分价值/商场会员中心的积分数
|
|
|
- mallSendPoint.setPointValue(mallSendPoint.getPoint().multiply(mall.getPointValue()).divide(mall.getPoint()));
|
|
|
- mallSendPoint.setBillRecordId(billRecord.getId());
|
|
|
- mallSendPoint.setBillRecordStatus(billRecord.getPayStatus());
|
|
|
- pointDetailService.save(mallSendPoint);
|
|
|
+ PayUtil.addMallPointValue(mall,loginUser,billRecord,mallMember,pointDetailService);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//商户赠送积分待确认
|
|
|
- PointDetail shopPointDetail = new PointDetail();
|
|
|
- shopPointDetail.setMallId(mall != null ? mall.getId() : null);
|
|
|
- shopPointDetail.setShopId(shop.getId());
|
|
|
- shopPointDetail.setMemberId(shopMember.getId());
|
|
|
- shopPointDetail.setUserId(loginUser.getId());
|
|
|
- shopPointDetail.setType(SystemConstant.PointDetailType.SHOP_SEND.getValue());
|
|
|
- shopPointDetail.setName(shop.getName());
|
|
|
-// shopPointDetail.setLogo(shop.getShopPic());
|
|
|
- shopPointDetail.setPrice(billRecord.getPrice());
|
|
|
- //商家送的积分 = 总价*商家的会议中心每消费一元赠送的积分数
|
|
|
- shopPointDetail.setPoint(billRecord.getPrice().multiply(shop.getConsumeOnePoint()));
|
|
|
- //商家赠送的积分价值 = 商家送的积分数*商家会员中心的积分价值/商家会员中心的积分数
|
|
|
- Assert.isFalse(shop.getIsOpenMember() == 0, "该商户未开启会员中心");
|
|
|
- Assert.isFalse(shop.getPoint().compareTo(BigDecimal.ZERO) == 0,"会员中心积分数不能为0");
|
|
|
- shopPointDetail.setPointValue(shopPointDetail.getPoint().multiply(shop.getPointValue()).divide(shop.getPoint()));
|
|
|
- shopPointDetail.setBillRecordStatus(billRecord.getPayStatus());
|
|
|
- shopPointDetail.setBillRecordId(billRecord.getId());
|
|
|
- pointDetailService.save(shopPointDetail);
|
|
|
+ PayUtil.addShopPointValue(mall,shop,loginUser,billRecord,pointDetailService);
|
|
|
|
|
|
|
|
|
//用户余额为0时用户需要全额支付,待支付回调成功后才会发放积分
|