|
|
@ -56,14 +56,8 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void assignCouponAgent(HighCouponAgentRel highCouponAgentRel,Integer stockCount) { |
|
|
|
public void assignCouponAgent(HighCouponAgentRel highCouponAgentRel,Integer stockCount) { |
|
|
|
|
|
|
|
|
|
|
|
// 查询卡券库存数量
|
|
|
|
// 查询未销售的卡券
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
List<HighCouponCode> codeList = highCouponCodeService.getNoSaleCode(highCouponAgentRel.getCouponId()); |
|
|
|
map.put("couponId", highCouponAgentRel.getCouponId()); |
|
|
|
|
|
|
|
map.put("status", 1); |
|
|
|
|
|
|
|
map.put("salesEndTimeS", new Date().getTime()); |
|
|
|
|
|
|
|
map.put("isAssignAgent", false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<HighCouponCode> codeList = highCouponCodeService.getCouponCodeList(map); |
|
|
|
|
|
|
|
if (stockCount > codeList.size()) { |
|
|
|
if (stockCount > codeList.size()) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法分配,分配数量超过库存数量"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法分配,分配数量超过库存数量"); |
|
|
|
} |
|
|
|
} |
|
|
|