|
|
|
@@ -67,9 +67,12 @@ public class WxCouponController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); |
|
|
|
} |
|
|
|
Long couponChannelIdL = 0L, couponIdL = 0L; |
|
|
|
|
|
|
|
try { |
|
|
|
couponChannelIdL = Long.valueOf(couponChannelId); |
|
|
|
if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
couponChannelIdL = Long.valueOf(couponChannelId); |
|
|
|
} |
|
|
|
if (!StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
couponIdL = Long.valueOf(couponId); |
|
|
|
} |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
@@ -144,9 +147,12 @@ public class WxCouponController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); |
|
|
|
} |
|
|
|
Long couponChannelIdL = 0L, couponIdL = 0L; |
|
|
|
|
|
|
|
try { |
|
|
|
couponChannelIdL = Long.valueOf(couponChannelId); |
|
|
|
if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
couponChannelIdL = Long.valueOf(couponChannelId); |
|
|
|
} |
|
|
|
if (!StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
couponIdL = Long.valueOf(couponId); |
|
|
|
} |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
@@ -201,7 +207,7 @@ public class WxCouponController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) { |
|
|
|
if(couponChannelIdL != null){ |
|
|
|
if(couponChannelIdL > 0l){ |
|
|
|
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); |
|
|
|
if(cc == null){ |
|
|
|
return null; |
|
|
|
@@ -215,7 +221,7 @@ public class WxCouponController extends BaseController { |
|
|
|
couponCVo.setCouponId(cc.getCouponId()); |
|
|
|
couponCVo.setHtml(c.getHtml()); |
|
|
|
return couponCVo; |
|
|
|
}else if(couponIdL != null){ |
|
|
|
}else if(couponIdL > 0l){ |
|
|
|
WxCoupon c = couponService.getHtmlById(couponIdL,tenantId); |
|
|
|
if (c == null) { |
|
|
|
return null; |
|
|
|
@@ -231,7 +237,7 @@ public class WxCouponController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { |
|
|
|
if(couponChannelIdL != null){ |
|
|
|
if(couponChannelIdL > 0l){ |
|
|
|
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); |
|
|
|
if(cc == null){ |
|
|
|
return null; |
|
|
|
@@ -247,7 +253,7 @@ public class WxCouponController extends BaseController { |
|
|
|
wxcv.setEndTime(cc.getEndTime()); |
|
|
|
wxcv.setQrCode(cc.getQrCode()); |
|
|
|
return wxcv; |
|
|
|
}else if(couponIdL != null){ |
|
|
|
}else if(couponIdL > 0l){ |
|
|
|
WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); |
|
|
|
return wxcv; |
|
|
|
} |
|
|
|
|