提交代码'

dev-discount
199901012 4 years ago
parent 7c5b7ed744
commit da19bc056e
  1. 18
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 2
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  3. 2
      hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java
  4. 2
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  5. 2
      hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java

@ -98,8 +98,12 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", "未找到卡卷信息"); log.error("HighOrderController --> addOrder() error!", "未找到卡卷信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
} }
// 是否达到限购数量
// 校验优惠券是否可用 if (highCouponService.userBuyLimitNumber(userInfoModel.getHighUser().getId(), coupon.getId()) == true) {
log.error("HighOrderController --> addOrder() error!", "已达到限购数量");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",已达到限购数量");
}
// 校验优惠券是否可用 如果使用优惠券就只能使用卡券的原价
if (highOrder.getMemDiscountId() != null) { if (highOrder.getMemDiscountId() != null) {
List<HighDiscountCouponRel> discountCouponRelList = highDiscountCouponRelService.getRelByCoupon(coupon.getId()); List<HighDiscountCouponRel> discountCouponRelList = highDiscountCouponRelService.getRelByCoupon(coupon.getId());
if (discountCouponRelList.size() > 0) { if (discountCouponRelList.size() > 0) {
@ -109,14 +113,11 @@ public class HighOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用优惠券"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用优惠券");
} }
} }
childOrder.setGoodsPrice(coupon.getSalesPrice());
} else {
childOrder.setGoodsPrice(coupon.getDiscountPrice());
} }
// 是否到底限购数量
if (highCouponService.userBuyLimitNumber(userInfoModel.getHighUser().getId(), coupon.getId()) == true) {
log.error("HighOrderController --> addOrder() error!", "已达到限购数量");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",已达到限购数量");
}
if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) { if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) {
log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, "");
@ -124,7 +125,6 @@ public class HighOrderController {
childOrder.setGoodsName(coupon.getCouponName()); childOrder.setGoodsName(coupon.getCouponName());
childOrder.setGoodsImg(coupon.getCouponImg()); childOrder.setGoodsImg(coupon.getCouponImg());
childOrder.setGoodsSpecName("默认"); childOrder.setGoodsSpecName("默认");
childOrder.setGoodsPrice(coupon.getDiscountPrice());
} }
if (childOrder.getGoodsType() == 2) { if (childOrder.getGoodsType() == 2) {

@ -30,7 +30,7 @@ public class HighCouponSchedule {
* @Date 2021/4/4 22:44 * @Date 2021/4/4 22:44
**/ **/
// @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 // @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
//@Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行 @Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行
public void expiredCoupon() { public void expiredCoupon() {
// 查询过期的卡券 // 查询过期的卡券
List<HighUserCoupon> userCoupons = highUserCouponService.getOverdueCoupon(); List<HighUserCoupon> userCoupons = highUserCouponService.getOverdueCoupon();

@ -29,7 +29,7 @@ public class HighDiscountSchedule {
* @Description 处理过期的优惠券 * @Description 处理过期的优惠券
* @Date 2021/4/4 22:44 * @Date 2021/4/4 22:44
**/ **/
//@Scheduled(cron = "0 0 0 * * ?") //每1分钟执行一次 @Scheduled(cron = "0 0 0 * * ?") //每1分钟执行一次
public void expiredDiscount() { public void expiredDiscount() {
List<HighDiscountUserRel> expiredDiscount = highDiscountUserRelService.getExpiredDiscount(); List<HighDiscountUserRel> expiredDiscount = highDiscountUserRelService.getExpiredDiscount();
for (HighDiscountUserRel rel : expiredDiscount) { for (HighDiscountUserRel rel : expiredDiscount) {

@ -33,7 +33,7 @@ public class HighOrderSchedule {
* @Description 取消订单 15分钟 * @Description 取消订单 15分钟
* @Date 2021/4/4 22:45 * @Date 2021/4/4 22:45
**/ **/
//@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void cancelOrder() { public void cancelOrder() {
List<HighOrder> orderList = highOrderService.getCloseOrder(); List<HighOrder> orderList = highOrderService.getCloseOrder();
if (orderList != null && orderList.size() > 0) { if (orderList != null && orderList.size() > 0) {

@ -29,7 +29,7 @@ public class SynchronizeCNPC {
private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 //@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void certification() { public void certification() {
Map<String, Object> tokenMap = new HashMap<>(); Map<String, Object> tokenMap = new HashMap<>();
tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA");

Loading…
Cancel
Save