private void checkForm(PartnerActivityProductStop form, String domain) { if (StringUtils.isBlank(form.getActId())) { throw new BizException(GlobalErrorCode.UNKNOWN, "活动Id不存在"); } if (StringUtils.isBlank(form.getProductId())) { throw new BizException(GlobalErrorCode.UNKNOWN, "商品Id不存在"); } if (form.getAuditor() == null) { throw new BizException(GlobalErrorCode.UNKNOWN, "审核人不存在"); } User user = userService.loadExtUser(StringUtils.defaultString(domain, "xiangqu"), form.getAuditor()); if (user == null) { throw new BizException(GlobalErrorCode.UNAUTHORIZED, "您没有权限审核该活动"); } }
/** 再次审核 */ @ResponseBody @RequestMapping("/partner/act/stop") public ResponseObject<Boolean> stopActivityProduct( @ModelAttribute PartnerActivityProductStop form, String domain) { checkForm(form, domain); if (StringUtils.isEmpty(form.getTicketId())) throw new BizException(GlobalErrorCode.UNKNOWN, "活动不存在, 审核失败"); ActivityTicket ticket = activityTicketMapper.selectByPrimaryKey(form.getTicketId()); if (ticket == null) { log.warn("活动没有找到, 请确认该商品是否正在活动中..."); return new ResponseObject<Boolean>(false); } ActivityTicket update = new ActivityTicket(); update.setId(ticket.getId()); update.setEndTime(new Date()); activityTicketMapper.update(update); return new ResponseObject<Boolean>(true); }