| @@ -16,6 +16,7 @@ import com.iformall.service.TtGoodsCategoryService; | |||||
| import com.iformall.service.TtMerchantPoiService; | import com.iformall.service.TtMerchantPoiService; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -73,12 +74,17 @@ public class TtPoiPlanController extends BaseController { | |||||
| if(contentType.intValue() < 1 || contentType.intValue() > 3){ | if(contentType.intValue() < 1 || contentType.intValue() > 3){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"带货场景不合法"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"带货场景不合法"); | ||||
| } | } | ||||
| Long planId = (Long) param.get("planId"); | |||||
| String planIdStr = (String) param.get("planId"); | |||||
| Long planId = null; | |||||
| if(StringUtils.isNotBlank(planIdStr)){ | |||||
| planId = Long.parseLong(planIdStr); | |||||
| } | |||||
| Long couponId = (Long) param.get("couponId"); | |||||
| if(couponId == null){ | |||||
| String couponIdStr = (String) param.get("couponId"); | |||||
| if(StringUtils.isBlank(couponIdStr)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | ||||
| } | } | ||||
| Long couponId = Long.parseLong(couponIdStr); | |||||
| return ttCouponGoodsService.poiPlanSave(getTenantInfo(),couponId,planId,contentType,commissionRate); | return ttCouponGoodsService.poiPlanSave(getTenantInfo(),couponId,planId,contentType,commissionRate); | ||||
| } | } | ||||
| @@ -88,10 +94,11 @@ public class TtPoiPlanController extends BaseController { | |||||
| @SystemControllerLog(description = "更新") | @SystemControllerLog(description = "更新") | ||||
| public ResultData updateStatus(@RequestBody Map<String, Object> param) { | public ResultData updateStatus(@RequestBody Map<String, Object> param) { | ||||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateStatus"); | logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateStatus"); | ||||
| Long planId = (Long) param.get("planId"); | |||||
| if(planId == null){ | |||||
| String planIdStr = (String) param.get("planId"); | |||||
| if(StringUtils.isBlank(planIdStr)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | ||||
| } | } | ||||
| Long planId = Long.parseLong(planIdStr); | |||||
| Integer status = (Integer) param.get("status"); | Integer status = (Integer) param.get("status"); | ||||
| if(status == null){ | if(status == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态值为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态值为空"); | ||||