diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index f87c5a94d..d441c5fc9 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -648,8 +648,11 @@ public class WxCouponController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } - ResultData result = wxCouponService.productSave(coupon); - return result; + try { + return wxCouponService.productSave(coupon); + } catch (Exception e) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); + } } } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index e518b9f44..19beb0a0b 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -277,7 +277,7 @@ public interface WxCouponService { List getCouponMerchantList(TenantEntity tenantInfo, Long couponId); - ResultData productSave(WxCoupon coupon); + ResultData productSave(WxCoupon coupon) throws Exception; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index f17f6f7aa..cb32992b4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -1240,7 +1240,7 @@ public class WxCouponServiceImpl implements WxCouponService { @Override @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) - public ResultData productSave(WxCoupon coupon) { + public ResultData productSave(WxCoupon coupon) throws Exception { WxCoupon ttattrs = this.getAttrsById(coupon.getId(), coupon.getTenantId()); if(ttattrs.getProductType() == null || ttattrs.getCategoryId() == null || ttattrs.getProductAttrKeyValueMap().isEmpty() @@ -1295,11 +1295,13 @@ public class WxCouponServiceImpl implements WxCouponService { return new ResultData(); } catch (WxErrorException e) { - logger.error(e.getMessage()); - return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); + throw new Exception(e); +// logger.error(e.getMessage()); +// return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); } catch (Exception e){ - logger.error(e.getMessage()); - return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); + throw e; +// logger.error(e.getMessage()); +// return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); } }