Переглянути джерело

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

zhouzeyu@c-top.com.cn 4 роки тому
батько
коміт
1013a01e15

+ 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);

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

@@ -14,34 +14,34 @@ 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 = "运营所属区域")
+    @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
 

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

@@ -1,6 +1,7 @@
 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;
@@ -15,37 +16,37 @@ import java.io.Serializable;
 public class ProfitReportKuaiShouVo implements Serializable {
 
 
-    @Excel(name = "账户ID")
+    @Excel(name = "账户ID",width = 20)
     private String accountId;
 
-    @Excel(name = "快手ID")
+    @Excel(name = "快手ID",width = 20)
     private String ksId;
 
-    @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 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 = "运营所属区域")
+    @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
 

+ 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),

+ 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);
             }

+ 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>