| @@ -112,7 +112,7 @@ public class WxCouponController extends BaseController { | |||
| //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | |||
| WxCouponCVo wxCouponCVo = null; | |||
| try { | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,getTenantInfo().getTenantId()); | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId()); | |||
| } catch (IllegalAccessException e) { | |||
| logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | |||
| @@ -199,52 +199,57 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) { | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if (cc == null) { | |||
| return null; | |||
| } | |||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||
| if (c == null) { | |||
| return null; | |||
| if(couponChannelIdL != null){ | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if(cc == null){ | |||
| return null; | |||
| } | |||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||
| if (c == null) { | |||
| return null; | |||
| } | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setId(cc.getId()); | |||
| couponCVo.setCouponId(cc.getCouponId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| }else if(couponIdL != null){ | |||
| WxCoupon c = couponService.getHtmlById(couponIdL,tenantId); | |||
| if (c == null) { | |||
| return null; | |||
| } | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setCouponId(c.getId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| } | |||
| return null; | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setId(cc.getId()); | |||
| couponCVo.setCouponId(cc.getCouponId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| } | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if (cc == null) { | |||
| return null; | |||
| } | |||
| // WxCoupon c = couponService.getById(cc.getCouponId(),cc.getTenantId()); | |||
| // if (c == null) { | |||
| // c = new WxCoupon(); | |||
| // } | |||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),cc.getTenantId()); | |||
| if(wxcv == null){ | |||
| return null; | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||
| if(couponChannelIdL != null){ | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if(cc == null){ | |||
| return null; | |||
| } | |||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId); | |||
| if(wxcv == null){ | |||
| return null; | |||
| } | |||
| wxcv.setId(cc.getId()); | |||
| wxcv.setCouponId(cc.getCouponId()); | |||
| wxcv.setTargetAd(cc.getTargetAd()); | |||
| wxcv.setBeginTime(cc.getBeginTime()); | |||
| wxcv.setEndTime(cc.getEndTime()); | |||
| wxcv.setQrCode(cc.getQrCode()); | |||
| return wxcv; | |||
| }else if(couponIdL != null){ | |||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); | |||
| return wxcv; | |||
| } | |||
| // WxCouponCVo wxcv = new WxCouponCVo(); | |||
| // BeanUtils.copyProperties(wxcv, c); | |||
| wxcv.setId(cc.getId()); | |||
| wxcv.setCouponId(cc.getCouponId()); | |||
| wxcv.setTargetAd(cc.getTargetAd()); | |||
| wxcv.setBeginTime(cc.getBeginTime()); | |||
| wxcv.setEndTime(cc.getEndTime()); | |||
| wxcv.setQrCode(cc.getQrCode()); | |||
| // List<WxMerchantVo> chantlist = merchantService.findMerchantVoList(cc.getCouponId(),cc.getTenantId()); | |||
| // if (null != chantlist && chantlist.size()>0) { | |||
| // wxcv.setMerchantVoList(chantlist); | |||
| // } | |||
| return wxcv; | |||
| return null; | |||
| } | |||
| private void updateActivityStatus(WxCouponCVo wxCouponCVo) { | |||