|
|
@@ -49,7 +49,7 @@ public class WxCouponSendController extends BaseController { |
|
|
public ResultData list(WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { |
|
|
public ResultData list(WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { |
|
|
logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); |
|
|
logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); |
|
|
if (Objects.isNull(wxCouponSend.getSendType())) { |
|
|
if (Objects.isNull(wxCouponSend.getSendType())) { |
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
} |
|
|
} |
|
|
wxCouponSend.setTenantId(getTenantId()); |
|
|
wxCouponSend.setTenantId(getTenantId()); |
|
|
wxCouponSend.setMerchantId(getUser().getMerchantId()); |
|
|
wxCouponSend.setMerchantId(getUser().getMerchantId()); |
|
|
@@ -78,20 +78,20 @@ public class WxCouponSendController extends BaseController { |
|
|
public ResultData handSel(@RequestBody Map<String, Object> params) { |
|
|
public ResultData handSel(@RequestBody Map<String, Object> params) { |
|
|
logger.debug("[" + getIpAddr() + "] WxCouponSendController::handSel"); |
|
|
logger.debug("[" + getIpAddr() + "] WxCouponSendController::handSel"); |
|
|
if (CollectionUtils.isEmpty(params)) { |
|
|
if (CollectionUtils.isEmpty(params)) { |
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
} |
|
|
} |
|
|
WxCUser cu = wxCUserMapper.selectByPrimaryKey(params.get("cUserId")); |
|
|
WxCUser cu = wxCUserMapper.selectByPrimaryKey(params.get("cUserId")); |
|
|
if (Objects.isNull(cu)) { |
|
|
if (Objects.isNull(cu)) { |
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!params.containsKey("wxCouponSendIds")) { |
|
|
if (!params.containsKey("wxCouponSendIds")) { |
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); |
|
|
|
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_IS_EMPTY); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<String> wxCouponSendIds = (List<String>) params.get("wxCouponSendIds"); |
|
|
List<String> wxCouponSendIds = (List<String>) params.get("wxCouponSendIds"); |
|
|
if (CollectionUtils.isEmpty(wxCouponSendIds)) { |
|
|
if (CollectionUtils.isEmpty(wxCouponSendIds)) { |
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); |
|
|
|
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_IS_EMPTY); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
WxCouponSend wxCouponSend = new WxCouponSend(); |
|
|
WxCouponSend wxCouponSend = new WxCouponSend(); |
|
|
@@ -99,7 +99,15 @@ public class WxCouponSendController extends BaseController { |
|
|
wxCouponSend.setTenantId(getTenantId()); |
|
|
wxCouponSend.setTenantId(getTenantId()); |
|
|
wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); |
|
|
wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); |
|
|
wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); |
|
|
wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); |
|
|
wxCouponSendService.handSel(wxCouponSend, cu); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
wxCouponSendService.handSel(wxCouponSend, cu); |
|
|
|
|
|
} catch (MallinkException e) { |
|
|
|
|
|
logger.error("注异常: " + e.getMessage()); |
|
|
|
|
|
return new ResultData(e.getErrorCode(), e.getMessage()); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
logger.error("注异常: " + e.getMessage()); |
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_HANDSEL_VERIFY, e.getMessage()); |
|
|
|
|
|
} |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|