Browse Source

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

# Conflicts:
#	jeecg-boot-finance/src/main/resources/application-dev.yml
#	jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml
huangxuechao 4 năm trước cách đây
mục cha
commit
f1e4aecde1
19 tập tin đã thay đổi với 506 bổ sung153 xóa
  1. 9 5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/DictAspect.java
  2. 9 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java
  3. 11 11
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportBytedanceVo.java
  4. 54 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportKuaiShouVo.java
  5. 13 2
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java
  6. 83 17
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml
  7. 2 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java
  8. 94 23
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java
  9. 59 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/utils/SettlementUtil.java
  10. 2 2
      jeecg-boot-finance/src/main/resources/application-dev.yml
  11. 22 0
      jeecg-boot-module-demo/pom.xml
  12. 29 0
      jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/test/controller/TestAlinkController.java
  13. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  14. 3 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/KuaishouAccountCleanTemplateMapper.java
  15. 21 52
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/KuaishouAccountCleanTemplateMapper.xml
  16. 63 32
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/KuaiShouAccountCleanServiceImpl.java
  17. 26 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  18. 1 1
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml
  19. 4 5
      pom.xml

+ 9 - 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/DictAspect.java

@@ -132,10 +132,6 @@ public class DictAspect {
                 }
                 ((IPage) ((Result) result).getResult()).setRecords(items);
             }else if(((Result) result).getResult() instanceof PageInfo){
-                //返回类型为 pageInfo  list
-               /* if (((Result) result).getResult() instanceof List) {
-                    return;
-                }*/
                 List<JSONObject> items = new ArrayList<>();
                 for (Object record : ((Result<PageInfo>) result).getResult().getList()){
                     ObjectMapper mapper = new ObjectMapper();
@@ -153,9 +149,17 @@ public class DictAspect {
                             String code = field.getAnnotation(Dict.class).dicCode();
                             String text = field.getAnnotation(Dict.class).dicText();
                             String table = field.getAnnotation(Dict.class).dictTable();
+                            String extendsKey = field.getAnnotation(Dict.class).extendsKey();
+                            if("".equals(extendsKey.trim())){
+                                extendsKey = null;
+                            }
+                            String extendsValue = field.getAnnotation(Dict.class).extendsValue();
+                            if("".equals(extendsValue.trim())){
+                                extendsValue = null;
+                            }
                             String key = String.valueOf(item.get(field.getName()));
                             //翻译字典值对应的txt
-                            String textValue = translateDictValue(code, text, table, key,null,null);
+                            String textValue = translateDictValue(code, text, table, key,extendsKey,extendsValue);
                             log.debug(" 字典Val : "+ textValue);
                             log.debug(" __翻译字典字段__ "+field.getName() + CommonConstant.DICT_TEXT_SUFFIX+": "+ textValue);
                             item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);

+ 9 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java

@@ -54,4 +54,13 @@ public class ExportReportController {
     }
 
 
+    @ApiOperation(value = "财务结算-利润表导出-快手", notes = "财务结算-利润表导出-快手")
+    @GetMapping(value = "/porfitReportKuaiShou")
+    public Result porfitReportKuaiShou(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
+
+        return reportSettlementService.porfitReportKuaiShou(paramsVo,response);
+
+    }
+
+
 }

+ 11 - 11
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportBytedanceVo.java

@@ -14,35 +14,35 @@ import java.io.Serializable;
 @Data
 public class ProfitReportBytedanceVo implements Serializable {
 
-    @Excel(name = "广告主公司名称")
+    @Excel(name = "广告主公司名称",width = 30)
     private String advertiserName;
 
-    @Excel(name = "产品名称")
+    @Excel(name = "产品名称",width = 25)
     private String productName;
 
-    @Excel(name = "总消耗")
+    @Excel(name = "总消耗",width = 10)
     private String cost;
 
-    @Excel(name = "现金消耗")
+    @Excel(name = "现金消耗",width = 10)
     private String cashCost;
 
-    @Excel(name = "赠款消耗")
+    @Excel(name = "赠款消耗",width = 10)
     private String rewardCost;
 
-    @Excel(name = "返点类型")
+    @Excel(name = "返点类型",width = 10)
     private String rebateType;
 
-    @Excel(name = "返点比列")
+    @Excel(name = "返点比列",width = 10)
     private String rebateRate;
 
-    @Excel(name = "销售")
+    @Excel(name = "销售",width = 12)
     private String saleName;
 
-    @Excel(name = "运营")
+    @Excel(name = "运营",width = 12)
     private String operateName;
 
-    @Excel(name = "运营所属区域")
-    private String transferIn;
+    @Excel(name = "运营所属区域",width = 12)
+    private String operateArea;
 
 
 

+ 54 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportKuaiShouVo.java

@@ -0,0 +1,54 @@
+package org.jeecg.ctop.finance.settlement.entity.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @description: 快手 利润表
+ * @return:
+ * @author: zianY
+ */
+@Data
+public class ProfitReportKuaiShouVo implements Serializable {
+
+
+    @Excel(name = "账户ID",width = 20)
+    private String accountId;
+
+    @Excel(name = "快手ID",width = 20)
+    private String ksId;
+
+    @Excel(name = "广告主公司名称",width = 30)
+    private String advertiserName;
+
+    @Excel(name = "产品名称",width = 25)
+    private String productName;
+
+    @Excel(name = "总消耗",width = 10)
+    private String cost;
+
+    @Excel(name = "充值花费",width = 10)
+    private String cashCost;
+
+    @Excel(name = "返点类型",width = 10)
+    private String rebateType;
+
+    @Excel(name = "返点比列",width = 10)
+    private String rebateRate;
+
+    @Excel(name = "销售",width = 12)
+    private String saleName;
+
+    @Excel(name = "运营",width = 12)
+    private String operateName;
+
+    @Excel(name = "运营所属区域",width = 12)
+    private String operateArea;
+
+
+
+}

+ 13 - 2
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java

@@ -54,14 +54,25 @@ public interface ReportSettlementMapper {
      * 查询 头条利润表 总花费
      * @return
      */
-    List<Map<String,String>> getProfitBytedanceCost(@Param("startTime") String startTime,@Param("endTime") String endTime);
+    List<Map<String,Object>> getProfitBytedanceCost(String uploadYears);
+
+    /**
+     * 查询 快手 利润表 总花费
+     * @param uploadYears
+     * @return
+     */
+    List<Map<String,Object>> getProfitKuaiShou(String uploadYears);
 
     /**
      * 查询 头条利润表  销售人员姓名 以及 返点类型和比列
      * @param productId
      * @return
      */
-    Map<String,String> getProfitBytedanceSale(String productId);
+    Map<String,Object> getProfitBytedanceSale(String productId);
+
+    Map<String,Object> getProfitBytedanceOperate(String accountId);
+
+    Map<String,Object> getProfitKuaiShouOperate(String accountId);
 
 
 

+ 83 - 17
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -89,11 +89,8 @@
                 LEFT JOIN ctop_product p ON cwjs.product_id = p.id
         WHERE
             cwjs.del_flag = 0
-        <if test="startTime !=null and startTime != ''">
-            AND d.date &gt;= #{startTime}
-        </if>
-        <if test="endTime !=null and endTime != ''">
-            AND d.date &lt;= #{endTime}
+        <if test="uploadYears !=null and uploadYears != ''">
+            AND DATE_FORMAT(d.date,'%Y-%m') = #{uploadYears}
         </if>
         GROUP BY
             d.advertiser_id;
@@ -105,20 +102,22 @@
     <!-- 查询 头条利润表  销售人员姓名 以及 返点类型和比列-->
     <select id="getProfitBytedanceSale" resultType="java.util.LinkedHashMap">
         SELECT
-            pp.create_user_id,
-            su.realname AS saleName,
-            cp.rebate_type AS rebateType,
-            cp.rebate_rate AS rebateRate,
-            cp.approved_status AS approvedStatus
+        pp.create_user_id,
+        su.realname AS saleName,
+        cp.rebate_type AS rebateType,
+        cp.rebate_rate AS rebateRate,
+        cp.approved_status AS approvedStatus,
+        cp.policy_start_date as policyStartDate,
+        DATE_FORMAT(cp.policy_start_date,'%Y-%m') as policyStart,
+        cp.policy_end_date as policyEndDate,
+        DATE_FORMAT(cp.policy_end_date,'%Y-%m') as policyEnd
         FROM
-            ctop_cwjs_policy_product pp,
-            sys_user su,
-            ctop_cwjs_policy_info cp
+        ctop_cwjs_policy_product pp
+        LEFT JOIN sys_user su ON pp.create_user_id = su.id
+        LEFT JOIN ctop_cwjs_policy_info cp ON cp.id = pp.policy_id
         WHERE
-            pp.del_flag = 0
-          AND cp.del_flag = 0
-          AND pp.create_user_id = su.id
-          AND cp.id = pp.policy_id
+        pp.del_flag = 0
+        AND cp.del_flag = 0
         <if test="productId !=null and productId != ''">
             AND pp.id = #{productId}
         </if>
@@ -128,6 +127,73 @@
 
 
 
+    <!-- 查询 头条利润表  广告主和运营和运营所属区域-->
+    <select id="getProfitBytedanceOperate" resultType="java.util.LinkedHashMap">
+        select
+        u.advertiser_id,
+        u.advertiser_name as advertiserName,
+        u.user_id,
+        u.user_name as operateName,
+        u.auth_name,
+        IFNULL(p.nick_name,'') as operateArea
+        from
+        ctop_user_allocation u
+        LEFT JOIN user_company p on p.user_id = u.user_id
+          <where>
+              <if test="accountId !=null and accountId != ''">
+                  AND u.account_id = #{accountId}
+              </if>
+          </where>
+    </select>
+
+
+<!-- 查询 快手 利润表 总花费-->
+    <select id="getProfitKuaiShou" resultType="java.util.LinkedHashMap">
+        SELECT
+            d.account_id AS accountId,
+            SUM( d.daily_charge ) AS cost,
+            SUM( d.real_charged ) AS cashCost,
+            cwjs.product_id as productId,
+            p.product_name AS productName
+        FROM
+            ctop_kuaishou_daily_flows d
+                LEFT JOIN ctop_cwjs_settlement_info cwjs ON d.account_id = cwjs.account_id
+                LEFT JOIN ctop_product p ON cwjs.product_id = p.id
+        WHERE
+            cwjs.del_flag = 0
+        <if test="uploadYears !=null and uploadYears != ''">
+          and DATE_FORMAT(d.date,'%Y-%m') = #{uploadYears}
+        </if>
+        GROUP BY
+            d.account_id;
+    </select>
+
+
+
+
+    <!-- 查询 快手 利润表  广告主和运营和运营所属区域-->
+    <select id="getProfitKuaiShouOperate" resultType="java.util.LinkedHashMap">
+        select
+        u.advertiser_id,
+        u.account_id,
+        b.user_id as ksId,
+        u.advertiser_name as advertiserName,
+        u.user_id,
+        u.user_name as operateName,
+        u.auth_name,
+        IFNULL(p.nick_name,'') as operateArea
+        from
+        ctop_user_allocation u
+        LEFT JOIN ctop_kuaishou_advertiser_base_info b on u.account_id = b.account_id
+        LEFT JOIN user_company p on p.user_id = u.user_id
+    <where>
+        <if test="accountId !=null and accountId != ''">
+            AND u.account_id = #{accountId}
+        </if>
+    </where>
+    </select>
+
+
 
 
 

+ 2 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java

@@ -23,4 +23,6 @@ public interface IReportSettlementService {
 
     Result porfitReportBytedance(SettlementFileParamsVo paramsVo,HttpServletResponse response);
 
+    Result porfitReportKuaiShou(SettlementFileParamsVo paramsVo,HttpServletResponse response);
+
 }

+ 94 - 23
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java

@@ -11,12 +11,10 @@ import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.ctop.finance.policy.utils.Check;
-import org.jeecg.ctop.finance.settlement.entity.vo.ProfitReportBytedanceVo;
-import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
-import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
-import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.*;
 import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
 import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
+import org.jeecg.ctop.finance.utils.SettlementUtil;
 import org.jeecg.ctop.finance.utils.createExcelByTemplate;
 import org.springframework.stereotype.Service;
 
@@ -26,6 +24,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.awt.image.BufferedImage;
 import java.io.*;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -427,44 +426,116 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
     public Result porfitReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
 
         try {
-
             //查询 头条利润表 总花费
-            List<Map<String,String>> list = reportSettlementMapper.getProfitBytedanceCost(paramsVo.getStartTime(),paramsVo.getEndTime());
-            for (Map<String, String> map : list) {
+            List<Map<String,Object>> list = reportSettlementMapper.getProfitBytedanceCost(paramsVo.getUploadYears());
+            if (Check.isNull(list)){
+                return Result.errorMsg("暂无数据。");
+            }
+            List<ProfitReportBytedanceVo> resultList = new ArrayList<>(list.size());
+            for (Map<String, Object> map : list) {
                 ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
-                vo.setCost(map.get("cost"));//总消耗
-                vo.setCashCost(map.get("cashCost"));//现金消耗
-                vo.setRewardCost(map.get("rewardCost"));//赠款消耗
-                vo.setProductName(map.get("productName"));//产品名称
+                vo.setCost(map.getOrDefault("cost","")+"");//总消耗
+                vo.setCashCost(map.getOrDefault("cashCost","")+"");//现金消耗
+                vo.setRewardCost(map.getOrDefault("rewardCost","")+"");//赠款消耗
+                vo.setProductName(map.getOrDefault("productName","")+"");//产品名称
                 //查询 头条利润表  销售人员姓名 以及 返点类型和比列
-                Map<String,String> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("productId"));
-
-                vo.setSaleName(slaeMap.get("saleName"));//销售
-
-                ////销售政策状态
-                if (StringUtils.equals(slaeMap.get("approvedStatus"),"3")){
-                    vo.setRebateType(slaeMap.get("rebateType"));//返点类型
-                    vo.setRebateRate(slaeMap.get("rebateRate"));//返点比列
-
+                Map<String,Object> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("productId")+"");
+                if (!Check.isNull(slaeMap)){
+                    vo.setSaleName(slaeMap.getOrDefault("saleName","")+"");//销售
+                    // 当前查询时间 与 销售政策 开始 截至时间 是否匹配
+                    if (SettlementUtil.isEffectiveDate(paramsVo.getUploadYears(),slaeMap.get("policyStart")+"",slaeMap.get("policyEnd")+"")){
+                        //销售政策状态 为 通过 显示 返点类型 和 返点比列
+                        if (StringUtils.equals(slaeMap.getOrDefault("approvedStatus","")+"","3")){
+                            vo.setRebateType(slaeMap.getOrDefault("rebateType","")+"");//返点类型
+                            vo.setRebateRate(slaeMap.getOrDefault("rebateRate","")+"");//返点比列
+                        }
+                    }
                 }
 
+                Map<String,Object> operateMap = reportSettlementMapper.getProfitBytedanceOperate(map.get("accountId")+"");
+                if (!Check.isNull(operateMap)){
+                    vo.setAdvertiserName(operateMap.getOrDefault("advertiserName","")+"");//广告主名称
+                    vo.setOperateName(operateMap.getOrDefault("operateName","")+"");//运营
+                    vo.setOperateArea(operateMap.getOrDefault("operateArea","")+"");//运营所属区域
+                }
+                resultList.add(vo);
+            }
 
+            Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("头条利润单", "头条利润单"), ProfitReportBytedanceVo.class, resultList);
 
-
+            try {
+                response.setCharacterEncoding("UTF-8");
+                response.setHeader("content-Type", "application/vnd.ms-excel");
+                response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("头条利润单.xls", "UTF-8"));
+                workbook.write(response.getOutputStream());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
             }
 
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("====>>>>", e.getMessage());
+            return Result.errorMsg(e.getMessage());
+        }
+        return null;
+    }
 
 
 
+    /**
+     *
+     * @description: 财务结算 利润表导出 快手
+     * @param paramsVo
+     * @param response
+     * @return: org.jeecg.common.api.vo.Result
+     * @author: zianY
+     */
+    @Override
+    public Result porfitReportKuaiShou(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
 
+        try {
+            //查询 快手利润表 总花费
+            List<Map<String,Object>> list = reportSettlementMapper.getProfitKuaiShou(paramsVo.getUploadYears());
+            if (Check.isNull(list)){
+                return Result.errorMsg("暂无数据。");
+            }
+            List<ProfitReportKuaiShouVo> resultList = new ArrayList<>(list.size());
+            for (Map<String, Object> map : list) {
+                ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
+                vo.setAccountId(map.getOrDefault("accountId","")+"");//账户id
+                vo.setCost(map.getOrDefault("cost","")+"");//总消耗
+                vo.setCashCost(map.getOrDefault("cashCost","")+"");//现金消耗
+                vo.setProductName(map.getOrDefault("productName","")+"");//产品名称
+                //查询  销售人员姓名 以及 返点类型和比列
+                Map<String,Object> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("productId")+"");
+                if (!Check.isNull(slaeMap)){
+                    vo.setSaleName(slaeMap.getOrDefault("saleName","")+"");//销售
+                    // 当前查询时间 与 销售政策 开始 截至时间 是否匹配
+                    if (SettlementUtil.isEffectiveDate(paramsVo.getUploadYears(),slaeMap.get("policyStart")+"",slaeMap.get("policyEnd")+"")){
+                        //销售政策状态 为 通过 显示 返点类型 和 返点比列
+                        if (StringUtils.equals(slaeMap.getOrDefault("approvedStatus","")+"","3")){
+                            vo.setRebateType(slaeMap.getOrDefault("rebateType","")+"");//返点类型
+                            vo.setRebateRate(slaeMap.getOrDefault("rebateRate","")+"");//返点比列
+                        }
+                    }
+                }
 
-            Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("这是表头", "这是sheet名称"), SettlementReportBytedanceVo.class, list);
+                Map<String,Object> operateMap = reportSettlementMapper.getProfitKuaiShouOperate(map.get("accountId")+"");
+                if (!Check.isNull(operateMap)){
+                    vo.setKsId(operateMap.getOrDefault("ksId","")+"");//快手id
+                    vo.setAdvertiserName(operateMap.getOrDefault("advertiserName","")+"");//广告主名称
+                    vo.setOperateName(operateMap.getOrDefault("operateName","")+"");//运营
+                    vo.setOperateArea(operateMap.getOrDefault("operateArea","")+"");//运营所属区域
+                }
+                resultList.add(vo);
+            }
 
+            Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("快手利润单", "快手利润单"), ProfitReportKuaiShouVo.class, resultList);
 
             try {
                 response.setCharacterEncoding("UTF-8");
                 response.setHeader("content-Type", "application/vnd.ms-excel");
-                response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("文件名称.xlsx", "UTF-8"));
+                response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("快手利润单.xls", "UTF-8"));
                 workbook.write(response.getOutputStream());
             } catch (IOException e) {
                 throw new RuntimeException(e);

+ 59 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/utils/SettlementUtil.java

@@ -7,6 +7,9 @@ import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -84,5 +87,61 @@ public class SettlementUtil {
         return outStream.toByteArray();
     }
 
+    /**
+     * 获取日期的年月
+     * @param strDate
+     * @return
+     */
+    public static int getYearMonth(String strDate)throws Exception{
+
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = simpleDateFormat.parse(strDate);
+
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);//设置时间
+        int year = cal.get(Calendar.YEAR);//获取年份
+        int month=cal.get(Calendar.MONTH);//获取月份
+        return year*100+month;//返回年份乘以100加上月份的值,因为月份最多2位数,所以年份乘以100可以获取一个唯一的年月数值
+    }
+
+
+
+    /**
+     * 判断当前时间是否在[startTime, endTime]区间
+     * 年-月   2021-08
+     * @param nowStrTime 当前时间
+     * @param startStrTime 开始时间
+     * @param endStrTime 结束时间
+     * @return
+     * @author zian Y
+     */
+    public static boolean isEffectiveDate(String nowStrTime, String startStrTime, String endStrTime) throws Exception {
+       // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
+        Date nowTime = simpleDateFormat.parse(nowStrTime);
+        Date startTime = simpleDateFormat.parse(startStrTime);
+        Date endTime = simpleDateFormat.parse(endStrTime);
+
+        if (nowTime.getTime() == startTime.getTime()
+                || nowTime.getTime() == endTime.getTime()) {
+            return true;
+        }
+        Calendar date = Calendar.getInstance();
+        date.setTime(nowTime);
+        Calendar begin = Calendar.getInstance();
+        begin.setTime(startTime);
+        Calendar end = Calendar.getInstance();
+        end.setTime(endTime);
+        if (date.after(begin) && date.before(end)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+
+
+
+
 
 }

+ 2 - 2
jeecg-boot-finance/src/main/resources/application-dev.yml

@@ -126,7 +126,7 @@ spring:
     port: 6379
 #mybatis plus 设置
 mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
   global-config:
     # 关闭MP3.0自带的banner
     banner: false
@@ -224,7 +224,7 @@ cas:
 #Mybatis输出sql日志
 logging:
   level:
-    org.jeecg.ctop.finance.*.mapper : info
+    org.jeecg.modules.system.mapper : info
 #swagger
 knife4j:
   production: false

+ 22 - 0
jeecg-boot-module-demo/pom.xml

@@ -23,6 +23,28 @@
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>jeecg-system-local-api</artifactId>
         </dependency>
+
+        <!--alink -->
+        <dependency>
+            <groupId>com.alibaba.alink</groupId>
+            <artifactId>alink_core_flink-1.13_2.11</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-streaming-scala_2.11</artifactId>
+            <version>1.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-planner_2.11</artifactId>
+            <version>1.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-clients_2.11</artifactId>
+            <version>1.13.0</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 29 - 0
jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/test/controller/TestAlinkController.java

@@ -0,0 +1,29 @@
+package org.jeecg.modules.demo.test.controller;
+
+import com.alibaba.alink.operator.batch.BatchOperator;
+import com.alibaba.alink.operator.batch.source.CsvSourceBatchOp;
+import com.alibaba.alink.pipeline.Pipeline;
+import com.alibaba.alink.pipeline.clustering.KMeans;
+import com.alibaba.alink.pipeline.dataproc.vector.VectorAssembler;
+
+public class TestAlinkController {
+    public static void main(String[] args) throws Exception {
+        String URL = "https://alink-release.oss-cn-beijing.aliyuncs.com/data-files/iris.csv";
+        String SCHEMA_STR = "sepal_length double, sepal_width double, petal_length double, petal_width double, category string";
+
+        BatchOperator data = new CsvSourceBatchOp().setFilePath(URL).setSchemaStr(SCHEMA_STR);
+
+        VectorAssembler va = new VectorAssembler()
+                .setSelectedCols(new String[]{"sepal_length", "sepal_width", "petal_length", "petal_width"})
+                .setOutputCol("features");
+
+        KMeans kMeans = new KMeans().setVectorCol("features").setK(3)
+                .setPredictionCol("prediction_result")
+                .setPredictionDetailCol("prediction_detail")
+                .setReservedCols("category")
+                .setMaxIter(100);
+
+        Pipeline pipeline = new Pipeline().add(va).add(kMeans);
+        pipeline.fit(data).transform(data).print();
+    }
+}

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -23,6 +23,7 @@ public enum StatusCode {
     COMMON_ACCOUNT_ERROR("参数异常", -2, false),
     COMMON_INTERNET_ERROR("网络请求异常", -3, false),
     COMMON_DATA_NOT_EXIST("数据不存在或者已经被删除", -101, false),
+    COMMON_DATA_NO_PERMMISSION("数据权限不足", -101, false),
     BYTEDANCE_PLAN_DATA_NOT_EXIST("此计划不存在或者已经被删除", -101, false),
     BYTEDANCE_ACCOUNT_DATA_NOT_EXIST("此账户尚未绑定或已停投", -101, false),
     COMMON_VERSION_NOT_EXIST("版本号不存在", -102, false),

+ 3 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/KuaishouAccountCleanTemplateMapper.java

@@ -41,7 +41,9 @@ public interface KuaishouAccountCleanTemplateMapper {
     //查询所有启用的模板
     List<KuaiShouAccountCleanTemplateInfo> getTemplateListBystatus();
     //根据规则模板查询相应组信息
-    List<String> getGroupMessage(@Param("template")KuaiShouAccountCleanTemplateInfo kuaiShouAccountCleanTemplateInfo,@Param("list")List list, @Param("startDate")String startDate);
+    String getGroupMessage(@Param("template")KuaiShouAccountCleanTemplateInfo kuaiShouAccountCleanTemplateInfo,@Param("optimizationObjective")String optimizationObjective, @Param("startDate")String startDate, @Param("unitId")String unitId);
+    List<Map> getGroupByAccount( @Param("accountId")String accountId);
+
     //保存操作日志
     void saveCleamLog(KuaiShouAccountCleanLogInfo kuaiShouAccountCleanLogInfo);
 

+ 21 - 52
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/KuaishouAccountCleanTemplateMapper.xml

@@ -40,7 +40,7 @@
 
     <!--根据创建人查询模板-->
     <select id="getTemplateList" resultMap="templateResultMap">
-        select t.id,t.template_name,t.applied_media,t.create_user from ctop_kuaishou_account_clean_template t
+        select t.id,t.template_name,t.applied_media,t.create_user,t.status from ctop_kuaishou_account_clean_template t
         <where>
             <if test="templateName!=null and templateName!=''">
                 t.template_name like CONCAT(CONCAT('%', #{templateName}), '%')
@@ -114,7 +114,7 @@
             </if>
 
             <if test="userName!=null and userName!=''">
-                and t3.user_name like concat('%',#{userName},'%')
+                and t.create_user like concat('%',#{userName},'%')
             </if>
             <if test="createId!=null and createId!=''">
                 and t.create_id=#{createId}
@@ -124,84 +124,49 @@
     </select>
 
     <select id="getTemplateListBystatus" resultMap="templateResultMap">
-       select  t.id,t.template_name,t.clean_time,t.optimization_objective,t.charge,t.conversion,t.promotion_group_status,t.perform_operations,t2.account_id  from ctop_kuaishou_account_clean_template t
+       select  t.id,t.template_name,t.clean_time,t.optimization_objective,t.charge,t.conversion,t.promotion_group_status,t.perform_operations,t2.account_id,t.create_id,t.create_user  from ctop_kuaishou_account_clean_template t
        left join  ctop_kuaishou_account_clean_center t2 on t.id=t2.template_id where t.status='0'
   </select>
 
-    <select id="getGroupMessage" resultType="java.lang.String">
+    <select id="getGroupMessage" resultType="String">
 
         SELECT t.unit_id from ctop_kuaishou_group t LEFT JOIN ctop_kuaishou_report_daily_group t2
         on t.unit_id=t2.unit_id
         where t.account_id=#{template.accountId}
         and t.group_create_time &lt;= #{startDate}
         and t2.stat_date &gt;= #{startDate}
-        <if test="template.promotionGroupStatus!=null and template.promotionGroupStatus!='' and template.promotionGroupStatus!='3'">
+        and t.unit_id=#{unitId}
+        <if test='template.promotionGroupStatus!=null and template.promotionGroupStatus!="" and template.promotionGroupStatus!="3"'>
             and t.put_status=#{template.promotionGroupStatus}
         </if>
         group by t.unit_id
         having sum(t2.charge) &lt;= #{template.charge}
-        <foreach item="item" index="index" collection="list" open="and (" separator="or" close=")">
-
-            <if test='item=="activation"'>
+            <if test='optimizationObjective=="activation"'>
                 /* 激活数*/
-                sum(t2.activation) &lt; #{template.conversion}
+               and sum(t2.activation) &lt; #{template.conversion}
             </if>
 
-            <if test='item=="bclick"'>
-                /*行为数*/
-                sum(t2.bclick) &lt; #{template.conversion}
-            </if>
 
-            <if test='item=="formSize"'>
+            <if test='optimizationObjective=="formSize"'>
                 /*表单数*/
-                sum(t2.form_count) &lt; #{template.conversion}
+                and  sum(t2.form_count) &lt; #{template.conversion}
             </if>
 
-            <if test='item=="pay"'>
+            <if test='optimizationObjective=="pay"'>
                 /*付费数*/
-                sum(t2.event_pay) &lt; #{template.conversion}
+                and  sum(t2.event_pay) &lt; #{template.conversion}
             </if>
 
-            <if test='item=="roi"'>
-                /*首日roi*/
-                sum(t2.event_pay_first_day_roi) &lt; #{template.conversion}
-            </if>
 
-            <if test='item=="evocativeApplication"'>
+            <if test='optimizationObjective=="evocativeApplication"'>
                 /*唤起应用*/
-                sum(t2.event_app_invoked) &lt; #{template.conversion}
-            </if>
-
-            <if test='item=="effectiveClues"'>
-                /*落地页有效线索*/
-                sum(t2.event_valid_clues) &lt; #{template.conversion}
-            </if>
-
-            <if test='item=="creditApp"'>
-                /*授信数APP*/
-                sum(t2.event_credit_grant_app) &lt; #{template.conversion}
+                and sum(t2.event_app_invoked) &lt; #{template.conversion}
             </if>
 
-            <if test='item=="creditGrant"'>
-                /*落地页授信数*/
-                sum(t2.event_credit_grant_landing_page) &lt; #{template.conversion}
-            </if>
-
-            <if test='item=="finishedPieceApp"'>
-                /*完件数App*/
-                sum(t2.event_jin_jian_app) &lt; #{template.conversion}
-            </if>
-
-            <if test='item=="finishedPieceGrant"'>
-                /*落地页完件数*/
-                sum(t2.event_jin_jian_landing_page) &lt; #{template.conversion}
-            </if>
-
-            <if test='item=="registered"'>
+            <if test='optimizationObjective=="registered"'>
                 /*注册*/
-                sum(t2.event_register) &lt; #{template.conversion}
+                and sum(t2.event_register) &lt; #{template.conversion}
             </if>
-        </foreach>
 
     </select>
 
@@ -210,7 +175,7 @@
   </select>
 
     <insert id="saveCleamLog">
-    insert into ctop_kuaishou_account_clean_logs (account_id,user_name,operation_type,create_time,executive_information) values (#{accountId},#{userName},#{operationType},#{createTime},#{executiveInformation})
+    insert into ctop_kuaishou_account_clean_logs (template_id,account_id,create_template_id,user_name,operation_type,create_time,executive_information) values (#{templateId},#{accountId},#{createTemplateId},#{userName},#{operationType},#{createTime},#{executiveInformation})
   </insert>
 
     <select id="getUserRealName" resultType="String">
@@ -220,4 +185,8 @@
     <select id="getTemplateName" parameterType="String" resultType="int">
          select count(*) from ctop_kuaishou_account_clean_template t  where t.template_name=#{templateName}
     </select>
+
+    <select id="getGroupByAccount" resultType="Map">
+        select  t.unit_id as 'unitId',t.ocpx_action_type  as 'type' from ctop_kuaishou_group t  where t.account_id=#{accountId}
+    </select>
 </mapper>

+ 63 - 32
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/KuaiShouAccountCleanServiceImpl.java

@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
 /**
@@ -227,14 +228,14 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
     @Override
     public Result getCleanUpLog(String templateId, String userId, String pageNum, String pageSize) {
         Result result = new Result();
-        List<KuaiShouAccountCleanLogInfo> cleanUpLog=new ArrayList<>();
+        List<KuaiShouAccountCleanLogInfo> cleanUpLog = new ArrayList<>();
         try {
             //查询当前登录人角色
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             PageHelper.startPage(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
             if (roleCode != null && roleCode.equals("admin")) {
                 cleanUpLog = kuaishouAccountCleanTemplateMapper.getCleanUpLog(templateId, null);
-            }else {
+            } else {
                 cleanUpLog = kuaishouAccountCleanTemplateMapper.getCleanUpLog(templateId, userId);
             }
             PageHelper.startPage(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
@@ -291,12 +292,22 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
     public Result cleanAccount() {
         Result result = new Result();
         SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Map optimizationObjectiveMap = new HashMap();
+        //优化目标 activation:激活数 bclick:行为数  formSize :表单数 pay:付费  roi:首日roi   evocativeApplication:唤起应用
+        // effectiveClues:有效线索 creditApp:授信-APP creditGrant:授信-落地页  finishedPieceApp:完件数-APP  finishedPieceGrant:完件数-落地页  registered:注册
+        optimizationObjectiveMap.put("180", "activation");
+        optimizationObjectiveMap.put("53", "formSize");
+        optimizationObjectiveMap.put("190", "pay");
+        optimizationObjectiveMap.put("324", "evocativeApplication");
+        optimizationObjectiveMap.put("396", "registered");
         try {
             //查询需要执行的规则模板
             List<KuaiShouAccountCleanTemplateInfo> templateListBystatus = kuaishouAccountCleanTemplateMapper.getTemplateListBystatus();
             if (!templateListBystatus.isEmpty()) {
                 templateListBystatus.stream().forEach(ob -> {
-                    if(ob.getAccountId()!=null){
+                    AtomicInteger count= new AtomicInteger();
+                    if (ob.getAccountId() != null) {
+                        StringBuilder unitIds = new StringBuilder();
                         //获取各项优化目标
                         List<String> optimizationObjectiveList = Arrays.asList(ob.getOptimizationObjective().split(","));
                         //获取清理时间范围
@@ -305,26 +316,48 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
                         Calendar calendar = Calendar.getInstance();//此时打印它获取的是系统当前时间
                         calendar.add(Calendar.DATE, -Integer.parseInt(cleanTime));
                         String startDate = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
-                        //查询符合模板规则的组
-                        List<String> groupMessage = kuaishouAccountCleanTemplateMapper.getGroupMessage(ob, optimizationObjectiveList, startDate);
                         AtomicReference<Boolean> falg = new AtomicReference<>(true);
-                        if (!groupMessage.isEmpty()) {
-                            //获取Token
-                            CtopOauthToken ctopOauthToken = ctopOauthTokenMapper.selectByAccountId(Long.parseLong(ob.getAccountId()));
-                            if (ctopOauthToken != null) {
-                                groupMessage.stream().forEach(item -> {
-                                    //修改广告组状态
-                                    Map<String, Object> resultMap = iKuaiShouUpdateService.updateUnitStatus(ctopOauthToken.getAccessToken(), Long.parseLong(ob.getAccountId()), Long.parseLong(item), Integer.parseInt(ob.getPerformOperations()), null);
-                                    Boolean resultFlag = (Boolean) resultMap.get("success");
-                                    //判断有没有失败
-                                    if (!resultFlag) {
-                                        falg.set(false);
+                        //查询改账户下所有组
+                        List<Map> groupByAccount = kuaishouAccountCleanTemplateMapper.getGroupByAccount(ob.getAccountId());
+                        if (!groupByAccount.isEmpty()) {
+                            groupByAccount.stream().forEach(obj -> {
+                                if (obj.get("unitId") != null && obj.get("type") != null) {
+                                    String unitId = Long.toString((Long) obj.get("unitId")) ;
+                                    //OCPM
+                                    String type = Integer.toString((Integer) obj.get("type")) ;
+                                    if(optimizationObjectiveMap.get(type)!=null){
+                                        String optimizationObjective= (String) optimizationObjectiveMap.get(type);
+                                        //查询组是否符合清理规则
+                                        String groupMessage = kuaishouAccountCleanTemplateMapper.getGroupMessage(ob, optimizationObjective, startDate,unitId);
+                                        if(groupMessage!=null){
+                                            count.getAndIncrement();
+                                            //符合清理规则清理
+                                            //获取Token
+                                            CtopOauthToken ctopOauthToken = ctopOauthTokenMapper.selectByAccountId(Long.parseLong(ob.getAccountId()));
+                                            if (ctopOauthToken != null) {
+                                                    //修改广告组状态
+                                                    Map<String, Object> resultMap = iKuaiShouUpdateService.updateUnitStatus(ctopOauthToken.getAccessToken(), Long.parseLong(ob.getAccountId()), Long.parseLong(unitId), Integer.parseInt(ob.getPerformOperations()), null);
+                                                    Boolean resultFlag = (Boolean) resultMap.get("success");
+                                                    //判断有没有失败
+                                                    if (resultFlag) {
+                                                        //清理成功
+                                                        unitIds.append(unitId).append(",");
+                                                        log.info("组"+unitId+"已被清理");
+                                                    }else {
+                                                        //清理失败
+                                                        log.info("组"+unitId+"清理失败:{}",resultMap.get("message"));
+                                                        falg.set(false);
+                                                    }
+                                            }
+                                        }
                                     }
-                                });
 
-                            }
+                                }
+                            });
                         }
-                        if (!groupMessage.isEmpty() && falg.get()) {
+
+
+                        if (count.get()>0 && falg.get()) {
                             //修改成功插入日志记录
                             KuaiShouAccountCleanLogInfo kuaiShouAccountCleanLogInfo = new KuaiShouAccountCleanLogInfo();
                             //设置账户id
@@ -332,18 +365,14 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
                             // 1-投放、2-暂停、3-删除
                             kuaiShouAccountCleanLogInfo.setOperationType(ob.getPerformOperations());
                             //设置运营
-                            Map<String, String> map = kuaishouAccountCleanTemplateMapper.getUserNameByAccountId(ob.getAccountId());
-                            String authName = "";
-                            if (map != null) {
-                                kuaiShouAccountCleanLogInfo.setUserName(map.get("userName"));
-                                authName = map.get("authName");
-                            }
+//                            Map<String, String> map = kuaishouAccountCleanTemplateMapper.getUserNameByAccountId(ob.getAccountId());
+//                            String authName = "";
+//                            if (map != null) {
+//                                kuaiShouAccountCleanLogInfo.setUserName(map.get("userName"));
+//                                authName = map.get("authName");
+//                            }
                             //设置时间
                             kuaiShouAccountCleanLogInfo.setCreateTime(sd.format(new Date()));
-                            StringBuilder unitIds = new StringBuilder();
-                            groupMessage.stream().forEach(unid -> {
-                                unitIds.append(unid).append(",");
-                            });
                             //操作类型
                             String operationType = null;
                             if (ob.getPerformOperations().equals("2")) {
@@ -353,10 +382,11 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
                                 operationType = "删除";
                             }
                             //执行信息
-                            String textMessage = "清理规则执行:  账户:" + ob.getAccountId() + ", 授权名称: " + authName + ",推广组:" + unitIds + "已经被清理规则" + operationType;
+                            String textMessage = "清理规则执行:  账户:" + ob.getAccountId() + ", 授权名称: " + ob.getCreateUser() + ",推广组:" + unitIds + "已经被清理规则" + operationType;
                             kuaiShouAccountCleanLogInfo.setExecutiveInformation(textMessage);
                             kuaiShouAccountCleanLogInfo.setTemplateId(ob.getId());
                             kuaiShouAccountCleanLogInfo.setCreateTemplateId(ob.getCreateId());
+                            kuaiShouAccountCleanLogInfo.setUserName(ob.getCreateUser());
                             kuaishouAccountCleanTemplateMapper.saveCleamLog(kuaiShouAccountCleanLogInfo);
                         }
                     }
@@ -370,6 +400,7 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
         }
         return result;
     }
+
     /**
      * 根据模板名称查询
      *
@@ -380,9 +411,9 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
     public Result getTemplateName(String templateName) {
         Result result = new Result();
         try {
-                int number = kuaishouAccountCleanTemplateMapper.getTemplateName(templateName.trim());
+            int number = kuaishouAccountCleanTemplateMapper.getTemplateName(templateName.trim());
             result.setResult(number);
-        }catch (Exception e){
+        } catch (Exception e) {
             log.info("查询失败:{}", e.toString());
             result.error500("查询失败");
         }

+ 26 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -12,6 +12,7 @@ import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoSer
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
@@ -122,6 +123,30 @@ public class MaterialInfoController {
         return result;
     }
 
+    /**
+     * 修改名称
+     * @param id
+     * @param name
+     * @return
+     */
+    @PostMapping("/editName")
+    public Map<String, Object> editName(String id,String name) {
+        Map<String,Object>result = new HashMap<>();
+        MaterialInfo info = materialInfoService.getById(id);
+        if(null == info){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_DATA_NOT_EXIST);
+            return result;
+        }
+        if(info.getStatus() == 1){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_DATA_NO_PERMMISSION);
+            return result;
+        }
+        info.setMaterialName(name);
+        materialInfoService.updateById(info);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
     @PostMapping("/correlationUpload")
     public Map<String, Object> insertFile(@RequestBody JSONObject json) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -331,13 +356,12 @@ public class MaterialInfoController {
             }
             return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
 
-        } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
+        } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)||"clip".equals(roleCode)) {
             //查询自己所在项目下的数据
             if (!Check.isNull(projectId)) {
                 projectIds.add(projectId);
             } else if (!Check.isNull(productId)) {
                 projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
-
             } else {
                 projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
             }

+ 1 - 1
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml

@@ -76,7 +76,7 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
     username: hcst
     password: hcst@2020
     driver-class-name: com.mysql.jdbc.Driver

+ 4 - 5
pom.xml

@@ -50,11 +50,10 @@
 	<modules>
         <module>jeecg-boot-base</module>
         <module>jeecg-boot-module-demo</module>
-        <module>jeecg-boot-module-system</module>
-        <module>jeecg-boot-bytedance-ad</module>
-
-       <!-- 需要微服务,请打开注释-->
-       <module>jeecg-boot-starter</module>
+		<module>jeecg-boot-bytedance-data</module>
+		<module>jeecg-boot-module-system</module>
+		<module>jeecg-boot-bytedance-ad</module>
+       	<module>jeecg-boot-starter</module>
         <module>jeecg-cloud-module</module>
         <module>jeecg-boot-finance</module>
     </modules>