|
@@ -1,6 +1,8 @@
|
|
package cn.com.ctop.toutiao.modules.material.controller;
|
|
package cn.com.ctop.toutiao.modules.material.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
|
|
+import cn.com.ctop.common.module.utils.ResultMapUtils;
|
|
|
|
+import cn.com.ctop.common.module.utils.StatusCode;
|
|
import cn.com.ctop.common.module.utils.StringUtils;
|
|
import cn.com.ctop.common.module.utils.StringUtils;
|
|
import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
|
|
import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
|
|
@@ -11,13 +13,13 @@ 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.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
-import org.jeecg.common.system.query.QueryGenerator;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -37,33 +39,37 @@ public class ByteDanceCreativeController {
|
|
/**
|
|
/**
|
|
* 分页列表查询
|
|
* 分页列表查询
|
|
*
|
|
*
|
|
- * @param byteDanceCreative
|
|
|
|
* @param pageNo
|
|
* @param pageNo
|
|
* @param pageSize
|
|
* @param pageSize
|
|
- * @param req
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@AutoLog(value = "今日头条创意信息-分页列表查询")
|
|
@AutoLog(value = "今日头条创意信息-分页列表查询")
|
|
@ApiOperation(value = "今日头条创意信息-分页列表查询", notes = "今日头条创意信息-分页列表查询")
|
|
@ApiOperation(value = "今日头条创意信息-分页列表查询", notes = "今日头条创意信息-分页列表查询")
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
- public Result<IPage<ByteDanceCreative>> queryPageList(ByteDanceCreative byteDanceCreative,
|
|
|
|
- @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
- @RequestParam(name="startDate",defaultValue = "")String startDate,
|
|
|
|
- @RequestParam(name="endDate",defaultValue = "")String endDate,
|
|
|
|
- HttpServletRequest req) {
|
|
|
|
|
|
+ public Result<IPage<ByteDanceCreative>> queryPageList(
|
|
|
|
+ @RequestParam(name = "accountId", defaultValue = "0") Long accountId,
|
|
|
|
+ @RequestParam(name = "status",required = false) String status,
|
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
+ @RequestParam(name="startDate",defaultValue = "",required = false)String startDate,
|
|
|
|
+ @RequestParam(name="endDate",defaultValue = "",required = false)String endDate,
|
|
|
|
+ @RequestParam(name = "name",defaultValue = "",required = false)String name) {
|
|
Result<IPage<ByteDanceCreative>> result = new Result<>();
|
|
Result<IPage<ByteDanceCreative>> result = new Result<>();
|
|
- String title = byteDanceCreative.getTitle();
|
|
|
|
- byteDanceCreative.setTitle(null);
|
|
|
|
- QueryWrapper<ByteDanceCreative> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCreative, req.getParameterMap());
|
|
|
|
|
|
+ QueryWrapper<ByteDanceCreative> queryWrapper = new QueryWrapper<>();
|
|
if(null!=startDate&&!startDate.trim().equals("")){
|
|
if(null!=startDate&&!startDate.trim().equals("")){
|
|
queryWrapper.ge("",startDate+" 00:00:00");
|
|
queryWrapper.ge("",startDate+" 00:00:00");
|
|
}
|
|
}
|
|
|
|
+ if(null!=accountId){
|
|
|
|
+ queryWrapper.eq("account_id",accountId);
|
|
|
|
+ }
|
|
if(null!=endDate&&!endDate.trim().equals("")){
|
|
if(null!=endDate&&!endDate.trim().equals("")){
|
|
queryWrapper.le("",startDate+" 23:59:59");
|
|
queryWrapper.le("",startDate+" 23:59:59");
|
|
}
|
|
}
|
|
- if(null!=title&&!"".equals(title.trim())){
|
|
|
|
- queryWrapper.like("title",title);
|
|
|
|
|
|
+ if(null!=name&&!"".equals(name.trim())){
|
|
|
|
+ queryWrapper.like("title",name);
|
|
|
|
+ }
|
|
|
|
+ if(null!=status&&!status.trim().equals("")){
|
|
|
|
+ queryWrapper.eq("status","CREATIVE_STATUS_AD_"+status);
|
|
}
|
|
}
|
|
Page<ByteDanceCreative> page = new Page<>(pageNo, pageSize);
|
|
Page<ByteDanceCreative> page = new Page<>(pageNo, pageSize);
|
|
IPage<ByteDanceCreative> pageList = byteDanceCreativeService.page(page, queryWrapper);
|
|
IPage<ByteDanceCreative> pageList = byteDanceCreativeService.page(page, queryWrapper);
|
|
@@ -99,6 +105,22 @@ public class ByteDanceCreativeController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 修改广告组状态
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/editStatus")
|
|
|
|
+ public Map<String,Object> editStatus(@RequestParam(name = "accountId",defaultValue = "0")Long accountId,
|
|
|
|
+ @RequestParam(name = "ids") String ids,
|
|
|
|
+ @RequestParam(name = "status")String status){
|
|
|
|
+ Map<String,Object>result = new HashMap();
|
|
|
|
+ if(null == accountId||accountId==0||null == ids||ids.trim().equals("")||null==status||status.trim().equals("")){
|
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+ return byteDanceCreativeService.advertiserCreativeUpdateStatus(accountId,ids,status);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 编辑
|
|
* 编辑
|
|
*
|
|
*
|
|
* @param byteDanceCreative
|
|
* @param byteDanceCreative
|