| @@ -4,6 +4,7 @@ package com.iformall.controller.basic; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.controller.base.DouyinBaseController; | |||
| @@ -84,7 +85,7 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData list(Long couponId,Integer pageNum, Integer pageSize) throws Exception { | |||
| public ResultData list(Long couponId,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] TtPoiPlanController::list"); | |||
| if(couponId == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| @@ -95,14 +96,20 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| if(pageSize == null){ | |||
| pageSize = 100; | |||
| } | |||
| return ttCouponGoodsService.poiPlanList(getTenantInfo(),couponId,pageNum,pageSize,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.poiPlanList(getTenantInfo(),couponId,pageNum,pageSize,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("list error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("定向计划分页列表接口") | |||
| @GetMapping("orientedList") | |||
| @ApiImplicitParams({}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData orientedList(Long couponId,Integer pageNum, Integer pageSize) throws Exception { | |||
| public ResultData orientedList(Long couponId,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] TtPoiPlanController::orientedList"); | |||
| if(couponId == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| @@ -113,13 +120,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| if(pageSize == null){ | |||
| pageSize = 100; | |||
| } | |||
| return ttCouponGoodsService.poiOrientedPlanList(getTenantInfo(),couponId,pageNum,pageSize,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.poiOrientedPlanList(getTenantInfo(),couponId,pageNum,pageSize,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("orientedList error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("发布修改通用佣金计划") | |||
| @PostMapping("save") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData save(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData save(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::save"); | |||
| if(record.getTakeRate() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品的抽佣率为空"); | |||
| @@ -135,13 +148,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.poiPlanSave(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.poiPlanSave(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("save error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("发布修改定向佣金计划") | |||
| @PostMapping("saveOrientedPlan") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData saveOrientedPlan(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData saveOrientedPlan(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::saveOrientedPlan"); | |||
| if(StringUtils.isBlank(record.getName())){//不可修改 | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划名称为空"); | |||
| @@ -185,13 +204,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.saveOrientedPlan(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.saveOrientedPlan(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("saveOrientedPlan error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("新增定向佣金达人合作") | |||
| @PostMapping("addOrientedPlanDouyin") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData addOrientedPlanDouyin(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData addOrientedPlanDouyin(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::addOrientedPlanDouyin"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"Id为空"); | |||
| @@ -201,13 +226,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.addOrientedPlanDouyin(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.addOrientedPlanDouyin(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("addOrientedPlanDouyin error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("取消定向佣金达人合作") | |||
| @PostMapping("cancelOrientedPlanDouyin") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData cancelOrientedPlanDouyin(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData cancelOrientedPlanDouyin(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::cancelOrientedPlanDouyin"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"Id为空"); | |||
| @@ -216,13 +247,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"取消定向达人抖音号为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.cancelOrientedPlanDouyin(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.cancelOrientedPlanDouyin(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("cancelOrientedPlanDouyin error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("修改通用佣金计划状态") | |||
| @PostMapping("updateStatus") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData updateStatus(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData updateStatus(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateStatus"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | |||
| @@ -235,14 +272,19 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不合法"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.poiPlanUpdateStatus(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.poiPlanUpdateStatus(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("cancelOrientedPlanDouyin error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("修改定向佣金计划状态") | |||
| @PostMapping("updateOrientedStatus") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData updateOrientedStatus(@RequestBody TtPoiTakeRate record) throws Exception { | |||
| public ResultData updateOrientedStatus(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateOrientedStatus"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | |||
| @@ -255,8 +297,13 @@ public class TtPoiPlanController extends DouyinBaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不合法"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.poiOrientedPlanUpdateStatus(record,isGoodLifeSaas()); | |||
| try { | |||
| boolean isSaas = this.isGoodLifeSaas(); | |||
| return ttCouponGoodsService.poiOrientedPlanUpdateStatus(record,isSaas); | |||
| } catch (Exception e) { | |||
| logger.error("updateOrientedStatus error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||