Explorar o código

V1.1.1 批量迭代 调整计划模板

yumeng %!s(int64=4) %!d(string=hai) anos
pai
achega
95b540906a

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -183,6 +183,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ruleGroup/*", "anon");
         filterChainDefinitionMap.put("/kuaishou/material/*", "anon");
         filterChainDefinitionMap.put("/kuaishou/create/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchCampaignTemplate/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 3 - 3
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -135,9 +135,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true
-          username: data
-          password: hcst@2021
+          url: jdbc:mysql://139.186.151.174:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true
+          username: hcst
+          password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:

+ 9 - 21
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouBatchCampaignTemplateController.java

@@ -5,8 +5,6 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouBatchCampaignTemplate;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouBatchCampaignTemplateService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -48,28 +46,18 @@ public class KuaiShouBatchCampaignTemplateController {
     @Autowired
     private IKuaiShouBatchCampaignTemplateService kuaiShouBatchCampaignTemplateService;
 
-    /**
-     * 分页列表查询
-     *
-     * @param kuaiShouBatchCampaignTemplate
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
     @AutoLog(value = "计划模板-分页列表查询")
     @ApiOperation(value = "计划模板-分页列表查询", notes = "计划模板-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<KuaiShouBatchCampaignTemplate>> queryPageList(KuaiShouBatchCampaignTemplate kuaiShouBatchCampaignTemplate,
-                                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                                      HttpServletRequest req) {
-        Result<IPage<KuaiShouBatchCampaignTemplate>> result = new Result<>();
-        QueryWrapper<KuaiShouBatchCampaignTemplate> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouBatchCampaignTemplate, req.getParameterMap());
-        Page<KuaiShouBatchCampaignTemplate> page = new Page<KuaiShouBatchCampaignTemplate>(pageNo, pageSize);
-        IPage<KuaiShouBatchCampaignTemplate> pageList = kuaiShouBatchCampaignTemplateService.page(page, queryWrapper);
+    @GetMapping(value = "/getCampaignTemplate")
+    public Result<KuaiShouBatchCampaignTemplate> queryPageList(Long accountId) {
+        Result<KuaiShouBatchCampaignTemplate> result = new Result<>();
+        QueryWrapper<KuaiShouBatchCampaignTemplate> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        KuaiShouBatchCampaignTemplate one = kuaiShouBatchCampaignTemplateService.getOne(queryWrapper);
         result.setSuccess(true);
-        result.setResult(pageList);
+        result.setResult(one);
         return result;
     }