Przeglądaj źródła

Merge remote-tracking branch 'origin/test' into test

jiequan.bi 4 lat temu
rodzic
commit
4f3e5d618e
17 zmienionych plików z 732 dodań i 15 usunięć
  1. 1 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/CacheConstant.java
  2. 159 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TagInfoController.java
  3. 1 0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  4. 1 0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  5. 2 1
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  6. 1 0
      jeecg-boot-module-system/src/main/resources/application-test.yml
  7. 1 0
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  8. 14 11
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  9. 40 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java
  10. 14 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/TagInfoMapper.java
  11. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/TagInfoMapper.xml
  12. 56 0
      module-common/src/main/java/cn/com/ctop/common/module/model/TagIdModel.java
  13. 192 0
      module-common/src/main/java/cn/com/ctop/common/module/model/TagInfoTreeModel.java
  14. 19 0
      module-common/src/main/java/cn/com/ctop/common/module/service/ITagInfoService.java
  15. 40 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/TagInfoServiceImpl.java
  16. 118 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/FindstagInfosChildrenUtil.java
  17. 68 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

+ 1 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/CacheConstant.java

@@ -31,6 +31,7 @@ public interface CacheConstant {
 	 */
 	public static final String SYS_DEPARTS_CACHE = "sys:cache:depart:alldata";
 
+	public static final String SYS_TAGINFOS_CACHE = "sys:cache:taginfo:alldata";
 
 	/**
 	 * 全部部门ids缓存

+ 159 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TagInfoController.java

@@ -0,0 +1,159 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.model.TagInfoTreeModel;
+import cn.com.ctop.common.module.service.ITagInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.system.service.ISysDepartService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.List;
+
+ /**
+ * 标签信息
+ * @author jeecg-boot
+ * @date   2020-08-26
+ * @version V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/tagInfo")
+public class TagInfoController {
+	@Autowired
+	private ITagInfoService tagInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param tagInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<TagInfo>> queryPageList(TagInfo tagInfo,
+												@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												HttpServletRequest req) {
+		Result<IPage<TagInfo>> result = new Result<>();
+		QueryWrapper<TagInfo> queryWrapper = QueryGenerator.initQueryWrapper(tagInfo, req.getParameterMap());
+		Page<TagInfo> page = new Page<>(pageNo, pageSize);
+		IPage<TagInfo> pageList = tagInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param tagInfo
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<TagInfo> add(@RequestBody TagInfo tagInfo) {
+		Result<TagInfo> result = new Result<>();
+		try {
+			tagInfoService.save(tagInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param tagInfo
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<TagInfo> edit(@RequestBody TagInfo tagInfo) {
+		Result<TagInfo> result = new Result<TagInfo>();
+		TagInfo tagInfoEntity = tagInfoService.getById(tagInfo.getId());
+		if(tagInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = tagInfoService.updateById(tagInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			tagInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<TagInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<TagInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.tagInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<TagInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<TagInfo> result = new Result<>();
+		TagInfo tagInfo = tagInfoService.getById(id);
+		if(tagInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(tagInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+	@Autowired
+    private ISysDepartService sysDepartService;
+	@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
+    public Result<List<TagInfoTreeModel>> queryTreeList() {
+	    Result<List<TagInfoTreeModel>> result = new Result<>();
+	    try {
+            List<TagInfoTreeModel> list = tagInfoService.queryTreeList();
+	        result.setResult(list);
+	        result.setSuccess(true);
+	    } catch (Exception e) {
+	        log.error(e.getMessage(),e);
+	    }
+	    return result;
+	}
+}

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

@@ -198,6 +198,7 @@ jeecg:
     video-upload: D://upFiles//video//
     image-upload: D://upFiles//image//
     kuaishou-agent-image: D://temp.png
+    kuaishou-account-captcha-image: D://captcha.png
     chrome-driver: D://chromedriver.exe
     csv-upload: D://upFiles//csv//
     report-history: D://report//history//

+ 1 - 0
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -171,6 +171,7 @@ jeecg:
     video-upload: /data/upload/video/
     image-upload: /data/upload/image/
     kuaishou-agent-image: /data/upload/image/temp.png
+    kuaishou-account-captcha-image: /data/upload/image/captcha.png
     chrome-driver: /usr/bin/chromedriver
     csv-upload: /data/upload/csv/
     bak-database-file: /data/data/bak/

+ 2 - 1
jeecg-boot-module-system/src/main/resources/application-prod2.yml

@@ -162,7 +162,8 @@ jeecg:
     webapp: /data/webapp
     video-upload: /data/upload/video/
     image-upload: /data/upload/image/
-
+    kuaishou-agent-image: /data/upload/image/temp.png
+    kuaishou-account-captcha-image: /data/upload/image/captcha.png
     chrome-driver: /usr/bin/chromedriver
     csv-upload: /data/upload/csv/
     bak-database-file: /data/data/bak/

+ 1 - 0
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -159,6 +159,7 @@ jeecg:
     video-upload: /data/upload/video/
     image-upload: /data/upload/image/
     kuaishou-agent-image: D://temp.png
+    kuaishou-account-captcha-image: D://captcha.png
     chrome-driver: D://chromedriver.exe
     csv-upload: /data/upload/csv/
     report-history: /data/report/history/

+ 1 - 0
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -158,6 +158,7 @@ jeecg:
     video-upload: /mnt/upload/video/
     image-upload: /mnt/upload/image/
     kuaishou-agent-image: D://temp.png
+    kuaishou-account-captcha-image: D://captcha.png
     chrome-driver: D://chromedriver.exe
     csv-upload: /mnt/upload/csv/
     bak-database-file: /mnt/data/bak/

+ 14 - 11
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -2,15 +2,15 @@ package org.jeecg;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IRefreshTokenService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -35,15 +35,11 @@ public class SampleTest {
     @Autowired
     private ICtopOauthTokenService oauthTokenService;
     @Autowired
-    private IByteDanceCreativeService creativeService;
-    @Autowired
-    private IByteDanceCampaignService campaignService;
-    @Autowired
     private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
     @Autowired
     private IKuaiShouDailyAgentService kuaiShouDailyAgentService;
     @Autowired
-    private IRefreshTokenService refreshTokenService;
+    private IReportService reportService;
 
     @Test
     public void loadBytedanceCreativeData() {
@@ -97,11 +93,18 @@ public class SampleTest {
             log.info("快手删评论所用时长:{}毫秒",end-start);
         }
     }
-
+    @Autowired
+    private IUserAllocationService allocationService;
     @Test
     public void testLoadBytedanceData() {
-        CtopOauthToken token = oauthTokenService.getTokenByAccountId(1673731621920840L);
-        campaignService.getAdvertiserCampaign(token, null, null);
+        List<UserAllocation>allocations = allocationService.getByParams(435L,null,0);
+        for (UserAllocation allocation:allocations) {
+            for(int i=2;i<10;i++){
+                CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
+                Date getDate = DateUtils.addDay(new Date(),-i);
+                reportService.getAdvertiserReport(token,getDate,getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+            }
+        }
     }
 
     @Test

+ 40 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 标签信息
+ * @author jeecg-boot
+ * @date   2020-08-26
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_tag_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_tag_info对象", description="标签信息")
+public class TagInfo {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	private Long parentId;
+	private String tagName;
+	private Integer tagOrder;
+	private String description;
+	private String tagCode;
+	private Integer status;
+	private Integer delFlag;
+	private Date createTime;
+	private Date updateTime;
+}

+ 14 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/TagInfoMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 标签信息
+ * @author: jeecg-boot
+ * @date:   2020-08-26
+ * @cersion: V1.0
+ */
+public interface TagInfoMapper extends BaseMapper<TagInfo> {
+
+}

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/TagInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.module.mapper.TagInfoMapper">
+
+</mapper>

+ 56 - 0
module-common/src/main/java/cn/com/ctop/common/module/model/TagIdModel.java

@@ -0,0 +1,56 @@
+package cn.com.ctop.common.module.model;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class TagIdModel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private String key;
+
+    /**
+     * 主键ID
+     */
+    private String value;
+
+    /**
+     * 部门名称
+     */
+    private String title;
+    private String tagCode;
+
+    List<TagIdModel> children = new ArrayList<>();
+
+    /**
+     * 将SysDepartTreeModel的部分数据放在该对象当中
+     * @param treeModel 树状结构
+     * @return 部门信息
+     */
+    public TagIdModel convert(TagInfoTreeModel treeModel) {
+        this.key = treeModel.getId()+"";
+        this.value = treeModel.getId()+"";
+        this.title = treeModel.getTagName();
+        this.tagCode = treeModel.getTagCode();
+        return this;
+    }
+
+    /**
+     * 该方法为用户部门的实现类所使用
+     * @param sysDepart 系统部门信息
+     * @return 部门信息
+     */
+    public TagIdModel convertByUserDepart(TagInfo sysDepart) {
+        this.key = sysDepart.getId()+"";
+        this.value = sysDepart.getId()+"";
+        this.title = sysDepart.getTagName();
+        return this;
+    }
+}

+ 192 - 0
module-common/src/main/java/cn/com/ctop/common/module/model/TagInfoTreeModel.java

@@ -0,0 +1,192 @@
+package cn.com.ctop.common.module.model;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class TagInfoTreeModel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *对应TagInfo中的id字段,前端数据树中的key
+     */
+    private String key;
+
+    /**
+     *对应TagInfo中的id字段,前端数据树中的value
+     */
+    private String value;
+
+    /**
+     *对应name字段,前端数据树中的title
+     */
+    private String title;
+
+    /**
+     * 以下所有字段均与TagInfo相同
+     */
+    private boolean isLeaf;
+
+    private Long id;
+    private Long parentId;
+    private String tagName;
+    private Integer tagOrder;
+    private String description;
+    private String tagCode;
+    private Integer status;
+    private Integer delFlag;
+    private Date createTime;
+    private Date updateTime;
+    private List<TagInfoTreeModel> children = new ArrayList<>();
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public boolean isLeaf() {
+        return isLeaf;
+    }
+
+    public void setIsLeaf(boolean leaf) {
+        isLeaf = leaf;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getTagName() {
+        return tagName;
+    }
+
+    public void setTagName(String tagName) {
+        this.tagName = tagName;
+    }
+
+    public Integer getTagOrder() {
+        return tagOrder;
+    }
+
+    public void setTagOrder(Integer tagOrder) {
+        this.tagOrder = tagOrder;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getTagCode() {
+        return tagCode;
+    }
+
+    public void setTagCode(String tagCode) {
+        this.tagCode = tagCode;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * 将SysDepart对象转换成SysDepartTreeModel对象
+     * @param tagInfo
+     */
+    public TagInfoTreeModel(TagInfo tagInfo) {
+        this.key = tagInfo.getId()+"";
+        this.value = tagInfo.getId()+"";
+        this.title = tagInfo.getTagName();
+        this.id = tagInfo.getId();
+        this.parentId = tagInfo.getParentId();
+        this.tagName = tagInfo.getTagName();
+        this.tagOrder = tagInfo.getTagOrder();
+        this.description = tagInfo.getDescription();
+        this.tagCode = tagInfo.getTagCode();
+        this.status = tagInfo.getStatus();
+        this.delFlag = tagInfo.getDelFlag();
+        this.createTime = tagInfo.getCreateTime();
+        this.updateTime = tagInfo.getUpdateTime();
+    }
+
+
+    public List<TagInfoTreeModel> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<TagInfoTreeModel> children) {
+        if (children==null){
+            this.isLeaf=true;
+        }
+        this.children = children;
+    }
+
+    public TagInfoTreeModel() {
+
+    }
+}

+ 19 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/ITagInfoService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.model.TagInfoTreeModel;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * @Description: 标签信息
+ * @Author: jeecg-boot
+ * @Date:   2020-08-26
+ * @Version: V1.0
+ */
+public interface ITagInfoService extends IService<TagInfo> {
+
+    List<TagInfoTreeModel> queryTreeList();
+
+}

+ 40 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/TagInfoServiceImpl.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.mapper.TagInfoMapper;
+import cn.com.ctop.common.module.model.TagInfoTreeModel;
+import cn.com.ctop.common.module.service.ITagInfoService;
+import cn.com.ctop.common.module.utils.FindstagInfosChildrenUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.constant.CacheConstant;
+import org.jeecg.common.constant.CommonConstant;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 标签信息
+ * @author jeecg-boot
+ * @date   2020-08-26
+ * @version V1.0
+ */
+@Service
+public class TagInfoServiceImpl extends ServiceImpl<TagInfoMapper, TagInfo> implements ITagInfoService {
+
+    /**
+     * queryTreeList 对应 queryTreeList 查询所有的部门数据,以树结构形式响应给前端
+     */
+    @Cacheable(value = CacheConstant.SYS_TAGINFOS_CACHE)
+    @Override
+    public List<TagInfoTreeModel> queryTreeList() {
+        LambdaQueryWrapper<TagInfo> query = new LambdaQueryWrapper<>();
+        query.eq(TagInfo::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
+        query.orderByAsc(TagInfo::getTagOrder);
+        List<TagInfo> list = this.list(query);
+        // 调用wrapTreeDataToTreeList方法生成树状数据
+        List<TagInfoTreeModel> listResult = FindstagInfosChildrenUtil.wrapTreeDataToTreeList(list);
+        return listResult;
+    }
+}

+ 118 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/FindstagInfosChildrenUtil.java

@@ -0,0 +1,118 @@
+package cn.com.ctop.common.module.utils;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.model.TagIdModel;
+import cn.com.ctop.common.module.model.TagInfoTreeModel;
+import org.jeecg.common.util.oConvertUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FindstagInfosChildrenUtil {
+    //部门树信息-树结构
+    //private static List<SysDepartTreeModel> sysDepartTreeList = new ArrayList<SysDepartTreeModel>();
+
+    //部门树id-树结构
+    //private static List<DepartIdModel> idList = new ArrayList<>();
+
+
+    /**
+     * queryTreeList的子方法 ====1=====
+     * 该方法是s将SysDepart类型的list集合转换成SysDepartTreeModel类型的集合
+     */
+    public static List<TagInfoTreeModel> wrapTreeDataToTreeList(List<TagInfo> recordList) {
+        // 在该方法每请求一次,都要对全局list集合进行一次清理
+        //idList.clear();
+        List<TagIdModel> idList = new ArrayList<>();
+        List<TagInfoTreeModel> records = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            TagInfo depart = recordList.get(i);
+            records.add(new TagInfoTreeModel(depart));
+        }
+        List<TagInfoTreeModel> tree = findChildren(records, idList);
+        setEmptyChildrenAsNull(tree);
+        return tree;
+    }
+
+    /**
+     * 获取 DepartIdModel
+     * @param recordList
+     * @return
+     */
+    public static List<TagIdModel> wrapTreeDataToDepartIdTreeList(List<TagInfo> recordList) {
+        // 在该方法每请求一次,都要对全局list集合进行一次清理
+        //idList.clear();
+        List<TagIdModel> idList = new ArrayList<TagIdModel>();
+        List<TagInfoTreeModel> records = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            TagInfo depart = recordList.get(i);
+            records.add(new TagInfoTreeModel(depart));
+        }
+        findChildren(records, idList);
+        return idList;
+    }
+
+    /**
+     * queryTreeList的子方法 ====2=====
+     * 该方法是找到并封装顶级父类的节点到TreeList集合
+     */
+    private static List<TagInfoTreeModel> findChildren(List<TagInfoTreeModel> recordList,
+                                                         List<TagIdModel> departIdList) {
+
+        List<TagInfoTreeModel> treeList = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            TagInfoTreeModel branch = recordList.get(i);
+            if (oConvertUtils.isEmpty(branch.getParentId())) {
+                treeList.add(branch);
+                TagIdModel departIdModel = new TagIdModel().convert(branch);
+                departIdList.add(departIdModel);
+            }
+        }
+        getGrandChildren(treeList,recordList,departIdList);
+
+        //idList = departIdList;
+        return treeList;
+    }
+
+    /**
+     * queryTreeList的子方法====3====
+     *该方法是找到顶级父类下的所有子节点集合并封装到TreeList集合
+     */
+    private static void getGrandChildren(List<TagInfoTreeModel> treeList,List<TagInfoTreeModel> recordList,List<TagIdModel> idList) {
+
+        for (int i = 0; i < treeList.size(); i++) {
+            TagInfoTreeModel model = treeList.get(i);
+            TagIdModel idModel = idList.get(i);
+            for (int i1 = 0; i1 < recordList.size(); i1++) {
+                TagInfoTreeModel m = recordList.get(i1);
+                if (m.getParentId()!=null && m.getParentId().equals(model.getId())) {
+                    model.getChildren().add(m);
+                    TagIdModel dim = new TagIdModel().convert(m);
+                    idModel.getChildren().add(dim);
+                }
+            }
+            getGrandChildren(treeList.get(i).getChildren(), recordList, idList.get(i).getChildren());
+        }
+
+    }
+
+
+    /**
+     * queryTreeList的子方法 ====4====
+     * 该方法是将子节点为空的List集合设置为Null值
+     */
+    private static void setEmptyChildrenAsNull(List<TagInfoTreeModel> treeList) {
+
+        for (int i = 0; i < treeList.size(); i++) {
+            TagInfoTreeModel model = treeList.get(i);
+            if (model.getChildren().size() == 0) {
+                model.setChildren(null);
+                model.setIsLeaf(true);
+            }else{
+                setEmptyChildrenAsNull(model.getChildren());
+                model.setIsLeaf(false);
+            }
+        }
+        // sysDepartTreeList = treeList;
+    }
+}

Plik diff jest za duży
+ 68 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java