'订单详情增加返回优惠券信息'

dev-discount
199901012 4 years ago
parent 4ae4ee33f6
commit 7faf660e80
  1. 10
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  2. 13
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java
  3. 6
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  4. 5
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -125,6 +125,16 @@ public class HighOrder implements Serializable {
private List<HighChildOrder> highChildOrderList;
private HighDiscount highDiscount;
public HighDiscount getHighDiscount() {
return highDiscount;
}
public void setHighDiscount(HighDiscount highDiscount) {
this.highDiscount = highDiscount;
}
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}

@ -11,6 +11,7 @@ import com.hai.dao.HighCouponCodeMapperExt;
import com.hai.entity.*;
import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponCodeService;
import com.hai.service.HighCouponService;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserCouponService;
import org.apache.commons.collections4.MapUtils;
@ -42,6 +43,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Resource
private HighOrderService highOrderService;
@Resource
private HighCouponService highCouponService;
@Resource
private HighUserCouponService highUserCouponService;
@ -87,6 +91,15 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_OVERDUE, "");
}
// 卡券信息
HighCoupon coupon = highCouponService.getCouponById(salesCode.getCouponId());
if (coupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, "");
}
// 卡券来源:1.中石化
if (coupon.getCouponSource() == 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此卡券无法消核");
}
salesCode.setStoreId(userInfoModel.getMerchantStore().getId());
salesCode.setConsumeTime(new Date());
salesCode.setStatus(3);

@ -349,6 +349,12 @@ public class HighCouponServiceImpl implements HighCouponService {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getInteger(map, "couponSource") != null) {
criteria.andCouponSourceEqualTo(MapUtils.getInteger(map, "status"));
} else {
criteria.andCouponSourceNotEqualTo(2);
}
example.setOrderByClause("create_time desc");
List<HighCoupon> coupons = highCouponMapper.selectByExample(example);
if (coupons != null && coupons.size() > 0) {

@ -264,6 +264,9 @@ public class HighOrderServiceImpl implements HighOrderService {
return null;
}
order.setHighChildOrderList(getChildOrderByOrder(order.getId()));
if (order.getMemDiscountId() != null) {
order.setHighDiscount(highDiscountUserRelService.getRelById(order.getMemDiscountId()).getHighDiscount());
}
return order;
}
@ -383,8 +386,6 @@ public class HighOrderServiceImpl implements HighOrderService {
criteria.andMemIdEqualTo(memId);
criteria.andOrderStatusEqualTo(status);
return highOrderMapper.selectByExample(example).size();
}

Loading…
Cancel
Save