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