| @@ -646,12 +646,28 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("券商户是否自动分账") | |||||
| @ApiOperation("自己券商户是否自动分账") | |||||
| @PostMapping("/couponMerchantAutoShare") | @PostMapping("/couponMerchantAutoShare") | ||||
| public ResultData couponMerchantAutoShare(@RequestBody WxCoupon wxCoupon) { | public ResultData couponMerchantAutoShare(@RequestBody WxCoupon wxCoupon) { | ||||
| wxCoupon.updateTenantInfo(getTenantInfo()); | wxCoupon.updateTenantInfo(getTenantInfo()); | ||||
| try { | try { | ||||
| Map<Long, Boolean> map = wxCouponService.couponMerchantAutoShare(wxCoupon); | |||||
| Map<Long, Boolean> map = wxCouponService.couponMerchantAutoShare(wxCoupon,wxCoupon); | |||||
| return new ResultData(map); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | |||||
| @TenantIgnore | |||||
| @ApiOperation("父券商户是否自动分账") | |||||
| @PostMapping("/parentCouponMerchantAutoShare") | |||||
| public ResultData parentCouponMerchantAutoShare(@RequestBody WxCoupon wxCoupon) { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| wxCoupon.setTenantId(tenantEntity.getParentTenantId()); | |||||
| wxCoupon.setParentTenantId(null); | |||||
| try { | |||||
| Map<Long, Boolean> map = wxCouponService.couponMerchantAutoShare(tenantEntity,wxCoupon); | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,e.getMessage()); | return new ResultData(Result.ERROR,e.getMessage()); | ||||
| @@ -290,5 +290,5 @@ public interface WxCouponService { | |||||
| void setCouponMerchants(WxCoupon wxCoupon) throws Exception; | void setCouponMerchants(WxCoupon wxCoupon) throws Exception; | ||||
| Map<Long,Boolean> couponMerchantAutoShare(WxCoupon wxCoupon) throws Exception; | |||||
| Map<Long,Boolean> couponMerchantAutoShare(TenantEntity tenantEntity,WxCoupon wxCoupon) throws Exception; | |||||
| } | } | ||||
| @@ -1475,7 +1475,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Map<Long, Boolean> couponMerchantAutoShare(WxCoupon wxCoupon) throws Exception { | |||||
| public Map<Long, Boolean> couponMerchantAutoShare(TenantEntity tenantEntity,WxCoupon wxCoupon) throws Exception { | |||||
| if (null == wxCoupon.getMerchantIds()) { | if (null == wxCoupon.getMerchantIds()) { | ||||
| throw new MallinkException(Result.ERROR,"缺少参数"); | throw new MallinkException(Result.ERROR,"缺少参数"); | ||||
| } | } | ||||
| @@ -1498,7 +1498,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| EnumAppPlat plat = EnumCouponType.getAppPlat(couponType); | EnumAppPlat plat = EnumCouponType.getAppPlat(couponType); | ||||
| EnumPayWay payWay = EnumAppPlat.getPayWay(plat); | EnumPayWay payWay = EnumAppPlat.getPayWay(plat); | ||||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(wxCoupon,plat); | |||||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(tenantEntity,plat); | |||||
| if (cAppInfo == null) { | if (cAppInfo == null) { | ||||
| throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND); | throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND); | ||||
| } | } | ||||