Authored by chenchao

support multiple promotion at same time

@@ -201,10 +201,11 @@ public class PromotionServiceImpl implements IPromotionService { @@ -201,10 +201,11 @@ public class PromotionServiceImpl implements IPromotionService {
201 log.warn("updateStatusById fail: activity not set businessClient. id is {}, status is {}", id, status); 201 log.warn("updateStatusById fail: activity not set businessClient. id is {}, status is {}", id, status);
202 return new ApiResponse.ApiResponseBuilder().code(201).message("该活动未设置购买渠道,请先设置购买渠道!").build(); 202 return new ApiResponse.ApiResponseBuilder().code(201).message("该活动未设置购买渠道,请先设置购买渠道!").build();
203 } 203 }
  204 + /*
204 if (isExistRunningActivity(id, activity.getStartTime(), activity.getEndTime(), activity.getBusinessClient())) { 205 if (isExistRunningActivity(id, activity.getStartTime(), activity.getEndTime(), activity.getBusinessClient())) {
205 log.warn("updateStatusById fail: exist same promotionType activity. id is {}, status is {}", id, status); 206 log.warn("updateStatusById fail: exist same promotionType activity. id is {}, status is {}", id, status);
206 return new ApiResponse.ApiResponseBuilder().code(201).message("该时段已经存在相同类型的活动,请修改活动时间").build(); 207 return new ApiResponse.ApiResponseBuilder().code(201).message("该时段已经存在相同类型的活动,请修改活动时间").build();
207 - } 208 + }*/
208 } 209 }
209 PromotionActivity activity = new PromotionActivity(); 210 PromotionActivity activity = new PromotionActivity();
210 activity.setId(id); 211 activity.setId(id);
@@ -290,11 +291,12 @@ public class PromotionServiceImpl implements IPromotionService { @@ -290,11 +291,12 @@ public class PromotionServiceImpl implements IPromotionService {
290 log.warn("checkParams fail: endTime less than startTime. req is {}", req); 291 log.warn("checkParams fail: endTime less than startTime. req is {}", req);
291 return new ApiResponse.ApiResponseBuilder().code(201).message("结束时间必须大于开始时间").build(); 292 return new ApiResponse.ApiResponseBuilder().code(201).message("结束时间必须大于开始时间").build();
292 } 293 }
  294 + /*
293 if(req.getInitStatus().equals(PromotionStatusEnum.OPEN.getCode()) 295 if(req.getInitStatus().equals(PromotionStatusEnum.OPEN.getCode())
294 &&(isExistRunningActivity(req.getId(), startTime, endTime, req.getBusinessClient()))){ 296 &&(isExistRunningActivity(req.getId(), startTime, endTime, req.getBusinessClient()))){
295 log.warn("checkParams fail: exist same promotionType activity. req is {}", req); 297 log.warn("checkParams fail: exist same promotionType activity. req is {}", req);
296 return new ApiResponse.ApiResponseBuilder().code(201).message("该时段已经存在相同类型的活动,请修改活动时间").build(); 298 return new ApiResponse.ApiResponseBuilder().code(201).message("该时段已经存在相同类型的活动,请修改活动时间").build();
297 - } 299 + }*/
298 for(String params : req.getPromotionProductScopes().split("-")){ 300 for(String params : req.getPromotionProductScopes().split("-")){
299 PromotionProductScopeBo scopeBo = JSON.parseObject(params, PromotionProductScopeBo.class); 301 PromotionProductScopeBo scopeBo = JSON.parseObject(params, PromotionProductScopeBo.class);
300 if(scopeBo.getProductScopeType().equals(PromotionProductLimitEnum.ALL.getCode())) continue; 302 if(scopeBo.getProductScopeType().equals(PromotionProductLimitEnum.ALL.getCode())) continue;