|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei.module.base.entity.bo.JsonModel;
|
|
|
import com.caimei.module.base.entity.bo.Payment;
|
|
|
+import com.caimei.module.base.entity.po.CouponClubPo;
|
|
|
+import com.caimei.module.base.entity.po.CouponRedemptionCodePo;
|
|
|
import com.caimei.module.base.entity.po.SeconHandProduct;
|
|
|
import com.caimei.module.base.entity.po.UserBeansHistoryPo;
|
|
|
import com.caimei.module.base.entity.vo.*;
|
|
@@ -521,6 +523,8 @@ public class PayServiceImpl implements PayService {
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>保存付款金额到收款记录," + amount);
|
|
|
//判断是否是充值商品
|
|
|
getRechargeGoods(order, amount);
|
|
|
+ //针对商品productId:6898,做兑换券操作(couponId:15)
|
|
|
+ saveCouponClub(order);
|
|
|
//线上支付与自主下单送豆
|
|
|
UserVo user = payDao.findUser(order.getUserID());
|
|
|
if (user != null && "3".equals(order.getReceiptStatus()) && "0".equals(order.getSecondHandOrderFlag())) {
|
|
@@ -589,6 +593,38 @@ public class PayServiceImpl implements PayService {
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 针对商品productId:6898,做兑换券操作(couponId:15)
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveCouponClub(OrderVo order) {
|
|
|
+ if ("3".equals(order.getReceiptStatus())) {
|
|
|
+ List<OrderProductVo> orderProductList = payDao.fandAllOrderProduct(order.getOrderID().intValue());
|
|
|
+ if (orderProductList != null && orderProductList.size() > 0) {
|
|
|
+ for (OrderProductVo orderProduct : orderProductList) {
|
|
|
+ if (orderProduct.getProductID().equals(6898)) {
|
|
|
+ Integer num = orderProduct.getNum();
|
|
|
+ for (int i = 0; i < num; i++) {
|
|
|
+ CouponRedemptionCodePo redemptionCode = payDao.findRedemptionCode(15);
|
|
|
+ if (redemptionCode != null) {
|
|
|
+ CouponClubPo couponClub = new CouponClubPo();
|
|
|
+ couponClub.setCouponId(redemptionCode.getCouponId());
|
|
|
+ couponClub.setUserId(order.getUserID().intValue());
|
|
|
+ couponClub.setSource(5);
|
|
|
+ couponClub.setStatus("1");
|
|
|
+ couponClub.setCreateDate(new Date());
|
|
|
+ couponClub.setDelFlag("0");
|
|
|
+ payDao.insertCouponClub(couponClub);
|
|
|
+ payDao.updateRedemptionCode(redemptionCode.getId(), couponClub.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public String getShortLink(int length, int markId, String url) {
|
|
|
String shortLink = RandomCodeGenerator.generateShortLink(length);
|
|
|
Integer id = payDao.findBYShortLink(shortLink);
|