提交代码

dev-discount
胡锐 3 years ago
parent 0c0e19fcb6
commit bafbfbca01
  1. 5
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 5
      hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java
  3. 6
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -285,6 +286,10 @@ public class HighOrderController {
return ResponseMsgUtil.success(highOrderService.getOrderById(highOrder.getId())); return ResponseMsgUtil.success(highOrderService.getOrderById(highOrder.getId()));
} catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) {
log.error("HighActivityController -> userLottery() error!", "服务器繁忙");
return ResponseMsgUtil.builderResponse(ErrorCode.SERVER_BUSY_ERROR.getCode(),ErrorCode.SERVER_BUSY_ERROR.getMsg(),null);
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController -> addOrder() error!",e); log.error("HighOrderController -> addOrder() error!",e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -75,6 +76,10 @@ public class HighUserDiscountController {
highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), codeId); highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), codeId);
return ResponseMsgUtil.success("领取成功"); return ResponseMsgUtil.success("领取成功");
} catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) {
log.error("HighActivityController -> userLottery() error!", "服务器繁忙");
return ResponseMsgUtil.builderResponse(ErrorCode.SERVER_BUSY_ERROR.getCode(),ErrorCode.SERVER_BUSY_ERROR.getMsg(),null);
} catch (Exception e) { } catch (Exception e) {
log.error("HighDiscountController -> receiveDiscount() error!",e); log.error("HighDiscountController -> receiveDiscount() error!",e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -20,6 +20,7 @@ import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil; import org.apache.poi.util.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -92,7 +93,9 @@ public class HighOrderServiceImpl implements HighOrderService {
private HighActivityUserLotteryNumService highActivityUserLotteryNumService; private HighActivityUserLotteryNumService highActivityUserLotteryNumService;
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(
isolation = Isolation.SERIALIZABLE,
propagation= Propagation.REQUIRES_NEW)
public void insertOrder(HighOrder highOrder) throws Exception { public void insertOrder(HighOrder highOrder) throws Exception {
highOrderMapper.insert(highOrder); highOrderMapper.insert(highOrder);
@ -129,6 +132,7 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.setExt1(list.get(0).getExt1()); childOrder.setExt1(list.get(0).getExt1());
highChildOrderMapper.updateByPrimaryKey(childOrder); highChildOrderMapper.updateByPrimaryKey(childOrder);
} }
if(!childOrder.getGiveawayType()) { if(!childOrder.getGiveawayType()) {
// 查看是否需要赠送卡卷 // 查看是否需要赠送卡卷
List<HighCouponHandselModel> handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId()); List<HighCouponHandselModel> handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId());

Loading…
Cancel
Save