|
@@ -4,16 +4,23 @@ import com.poyee.annotation.UserLoginToken;
|
|
|
import com.poyee.base.controller.BaseController;
|
|
import com.poyee.base.controller.BaseController;
|
|
|
import com.poyee.base.dto.Page;
|
|
import com.poyee.base.dto.Page;
|
|
|
import com.poyee.base.dto.Result;
|
|
import com.poyee.base.dto.Result;
|
|
|
|
|
+import com.poyee.dto.ProductPromGroupInfoDto;
|
|
|
import com.poyee.dto.task.*;
|
|
import com.poyee.dto.task.*;
|
|
|
|
|
+import com.poyee.enums.ProductTypeEnums;
|
|
|
import com.poyee.enums.Roles;
|
|
import com.poyee.enums.Roles;
|
|
|
import com.poyee.service.IPromotionTaskService;
|
|
import com.poyee.service.IPromotionTaskService;
|
|
|
|
|
+import com.poyee.service.ProductInfoService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 推广任务
|
|
* 推广任务
|
|
@@ -23,6 +30,9 @@ import javax.validation.Valid;
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/api/promotionTask")
|
|
@RequestMapping("/api/promotionTask")
|
|
|
public class TaskApiController extends BaseController<IPromotionTaskService, PromotionTaskReq, PromotionTaskDto> {
|
|
public class TaskApiController extends BaseController<IPromotionTaskService, PromotionTaskReq, PromotionTaskDto> {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ProductInfoService productInfoService;
|
|
|
/**
|
|
/**
|
|
|
* 列表
|
|
* 列表
|
|
|
* 商家, 管理员, 运营[客服]等均可见
|
|
* 商家, 管理员, 运营[客服]等均可见
|
|
@@ -44,6 +54,7 @@ public class TaskApiController extends BaseController<IPromotionTaskService, Pro
|
|
|
req.setProductName(req.getKeyWord());
|
|
req.setProductName(req.getKeyWord());
|
|
|
}
|
|
}
|
|
|
Page<PromotionTaskPageDto> page = baseService.page(req);
|
|
Page<PromotionTaskPageDto> page = baseService.page(req);
|
|
|
|
|
+ productInfoService.getProductInfoByIds(page.getRows());
|
|
|
return Result.success(page);
|
|
return Result.success(page);
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
@@ -71,6 +82,19 @@ public class TaskApiController extends BaseController<IPromotionTaskService, Pro
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据id查询任务信息
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "根据id查询任务信息@(app-1.0)")
|
|
|
|
|
+ @RequestMapping(value = "/getById/{id}", method = {RequestMethod.POST})
|
|
|
|
|
+ @UserLoginToken(faceVerify = false, roles = {Roles.ADMIN,Roles.SHIPPING,Roles.GENERAL_USER,Roles.CUSTOMER})
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public Result<PromotionTaskDto> getById(@PathVariable("id") Long id) {
|
|
|
|
|
+ console("根据id查询任务信息->> ",id);
|
|
|
|
|
+ PromotionTaskPageDto taskDto = baseService.detailById(id);
|
|
|
|
|
+ return Result.success(taskDto);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|