|
@@ -389,14 +389,14 @@ public class OrderHandler {
|
|
int orderNum = cartService.selectOrderCount(shopSalesOrderDto);
|
|
int orderNum = cartService.selectOrderCount(shopSalesOrderDto);
|
|
|
|
|
|
int total = 0; // 需要支付的总额, 单位为分
|
|
int total = 0; // 需要支付的总额, 单位为分
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
//查询金牌会员模板id
|
|
//查询金牌会员模板id
|
|
int templateId = systemService.selectOneShopRuleById(114).getRuleNum().intValue();
|
|
int templateId = systemService.selectOneShopRuleById(114).getRuleNum().intValue();
|
|
UserGiftDto userGift = null;
|
|
UserGiftDto userGift = null;
|
|
- int giftNum = 0;
|
|
|
|
//vip会员买年套滤芯减价,此表示为减价金额
|
|
//vip会员买年套滤芯减价,此表示为减价金额
|
|
int priceReduction = 0;
|
|
int priceReduction = 0;
|
|
|
|
+
|
|
|
|
+ boolean isCludeT1ORT2 = false; //是否包含T1/T2
|
|
|
|
|
|
/** 提前准备订单项数据 */
|
|
/** 提前准备订单项数据 */
|
|
/** 准备数据 */
|
|
/** 准备数据 */
|
|
@@ -413,17 +413,16 @@ public class OrderHandler {
|
|
userGiftDto.setUserLevel(3);
|
|
userGiftDto.setUserLevel(3);
|
|
userGiftDto.setUserProductId(cartDto.getCartProductId());
|
|
userGiftDto.setUserProductId(cartDto.getCartProductId());
|
|
userGiftDto.setUserColorId(cartDto.getCartColorId());
|
|
userGiftDto.setUserColorId(cartDto.getCartColorId());
|
|
- //根据商品id和会员等级查询礼品信息
|
|
|
|
-// userGiftDto = productInfoService.selectUserGift(userGiftDto);
|
|
|
|
-// if (userGiftDto != null) {
|
|
|
|
-// cartDto.setProductPrice(userGiftDto.getUserDiscount());
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//VIP用户滤芯年套减一百
|
|
//VIP用户滤芯年套减一百
|
|
if(cartDto.getCartColorId() == 5 && member.getUserIsVip() == 2){
|
|
if(cartDto.getCartColorId() == 5 && member.getUserIsVip() == 2){
|
|
priceReduction += 10000*cartDto.getCartNum();
|
|
priceReduction += 10000*cartDto.getCartNum();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(7 == cartDto.getCartColorId() || 8 == cartDto.getCartColorId()){
|
|
|
|
+ isCludeT1ORT2 = true;
|
|
|
|
+ }
|
|
|
|
|
|
if (cartDto.getProductStatus() != null && cartDto.getProductStatus().intValue() == 1) {
|
|
if (cartDto.getProductStatus() != null && cartDto.getProductStatus().intValue() == 1) {
|
|
cartIds.add(cartDto.getCartId());
|
|
cartIds.add(cartDto.getCartId());
|
|
@@ -444,27 +443,6 @@ public class OrderHandler {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //如果模板id等于金牌会模板id,来源是3,则该用户为金牌会员直接下线,直接下线送三年滤芯
|
|
|
|
- if (member.getUserDealers() != null && member.getTemplateId() != null &&
|
|
|
|
- templateId == member.getTemplateId().intValue() && member.getUserResType().intValue() == 3) {
|
|
|
|
- //当userGift不为空时,说明该用户购买的商品有奖励礼品,奖励礼品取第一个产品的,不适用于多个产品有不同奖励礼品的情况
|
|
|
|
- if (userGift != null && userGift.getUserGiftId() != null && !"".equals(userGift.getUserGiftId())) {
|
|
|
|
- Product product = productInfoService.getProductByProductId(userGift.getUserGiftId(),userGift.getUserGiftColor());
|
|
|
|
- OrderItem orderItem = new OrderItem();
|
|
|
|
- orderItem.setItemNum(userGift.getUserGiftCount() * giftNum);
|
|
|
|
- orderItem.setItemProductDiscount(0);
|
|
|
|
- orderItem.setItemProductId(userGift.getUserGiftId());
|
|
|
|
- orderItem.setItemProductName(product.getProductName());
|
|
|
|
- orderItem.setItemProductPic(product.getProductIntroduceImg());
|
|
|
|
- orderItem.setItemSalesOrderid(order.getSalesOrderid());
|
|
|
|
- orderItem.setItemTotal(0);
|
|
|
|
- orderItem.setItemProductType(product.getProductType().getTypeId());
|
|
|
|
- orderItem.setItemProductPrice(0);
|
|
|
|
- orderItem.setItemColorId(userGift.getUserColorId());
|
|
|
|
- list.add(orderItem);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 准备订单对象
|
|
// 准备订单对象
|
|
order.setSalesOpenid(member.getUserOpenid()); // openid
|
|
order.setSalesOpenid(member.getUserOpenid()); // openid
|
|
order.setSalesAmount(total); // 订单金额
|
|
order.setSalesAmount(total); // 订单金额
|
|
@@ -504,6 +482,13 @@ public class OrderHandler {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(couponType.getCouponId() == 10001){
|
|
|
|
+ if(!isCludeT1ORT2){
|
|
|
|
+ msg.setMessage(ResultInfo.COUPON_T1_T2_NO_MSG); //未购买指定商品
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if(3 == couponType.getCouponType()){
|
|
if(3 == couponType.getCouponType()){
|
|
//判断抵扣券的是否能够使用
|
|
//判断抵扣券的是否能够使用
|
|
Exchange exchange = new Exchange();
|
|
Exchange exchange = new Exchange();
|