Pārlūkot izejas kodu

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

 Conflicts:
	module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java
xuzuoyun 4 gadi atpakaļ
vecāks
revīzija
3a8a414a8a
100 mainītis faili ar 5051 papildinājumiem un 1793 dzēšanām
  1. 98 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 8 4
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  3. 6 1
      jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/ActZprocess.java
  4. 8 8
      jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/Impl/ActZprocessServiceImpl.java
  5. 63 34
      jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java
  6. 17 7
      jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java
  7. 7 6
      jeecg-boot-module-system/pom.xml
  8. 5 2
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  9. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/StaticConfig.java
  10. 8 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActCustomFormController.java
  11. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActFormDataController.java
  12. 0 234
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActFormFieldController.java
  13. 31 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActFormPorcessController.java
  14. 174 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  15. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  16. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  17. 1 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CreativeTitleController.java
  18. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java
  19. 236 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/JhsBakendDataController.java
  20. 45 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouChannelRegInfoController.java
  21. 20 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java
  22. 51 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  23. 165 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTagInfoController.java
  24. 0 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialUploadController.java
  25. 143 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MusicKuaishouTypeController.java
  26. 0 337
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProductController.java
  27. 20 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  28. 118 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  29. 128 31
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TagInfoController.java
  30. 168 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  31. 26 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileBindUserController.java
  32. 1 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileController.java
  33. 4 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  34. 0 126
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java
  35. 55 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/JhsBakendData.java
  36. 10 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java
  37. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AdvertiserMapper.java
  38. 21 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/JhsBakendDataMapper.java
  39. 9 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  40. 60 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/JhsBakendDataMapper.xml
  41. 62 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  42. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAdvertiserService.java
  43. 21 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IJhsBakendDataService.java
  44. 9 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  45. 8 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AdvertiserServiceImpl.java
  46. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreativeTitleServiceImpl.java
  47. 58 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/JhsBakendDataServiceImpl.java
  48. 5 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/KuaiShouUploadServiceImpl.java
  49. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/PerformanceSaleServiceImpl.java
  50. 21 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  51. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java
  52. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/UReportFileBindUserServiceImpl.java
  53. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/UReportFileServiceImpl.java
  54. 70 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java
  55. 299 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportAccountEntity.java
  56. 302 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportCreativeEntity.java
  57. 299 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportGroupEntity.java
  58. 299 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportPlanEntity.java
  59. 312 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportProjectEntity.java
  60. 132 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/JhsBakendDataEntity.java
  61. 1 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java
  62. 0 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/ISendMsgHandle.java
  63. 0 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/EmailSendMsgHandle.java
  64. 0 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SmsSendMsgHandle.java
  65. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/WxSendMsgHandle.java
  66. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/opencv/utils/CornerCheck.java
  67. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/performance/service/impl/SalePerformanceDetailServiceImpl.java
  68. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java
  69. 40 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  70. 105 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/TagInfoTree.java
  71. 214 195
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  72. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java
  73. 0 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java
  74. 361 356
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
  75. 13 12
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  76. 4 3
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  77. 4 3
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  78. 6 5
      jeecg-boot-module-system/src/main/resources/application-test.yml
  79. 1 1
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  80. 0 17
      jeecg-boot-module-system/src/main/resources/drools/rule.drl
  81. 0 17
      jeecg-boot-module-system/src/main/resources/drools/rule2.drl
  82. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  83. 113 35
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  84. 4 0
      module-check/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskExecutorCtrl.java
  85. 6 1
      module-check/src/main/java/cn/com/ctop/check/script/TestGroovyScript.java
  86. 2 0
      module-check/src/main/java/cn/com/ctop/notice/handler/SendWeChatHandle.java
  87. 16 0
      module-common/pom.xml
  88. 295 0
      module-common/src/main/java/cn/com/ctop/common/module/controller/ProductController.java
  89. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/ActCustomForm.java
  90. 3 5
      module-common/src/main/java/cn/com/ctop/common/module/entity/ActFormData.java
  91. 1 31
      module-common/src/main/java/cn/com/ctop/common/module/entity/Advertiser.java
  92. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialImageInfo.java
  93. 53 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialTagInfo.java
  94. 22 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MusicInfo.java
  95. 20 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MusicType.java
  96. 44 13
      module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java
  97. 16 15
      module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java
  98. 24 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/TagCategoryInfo.java
  99. 21 4
      module-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java
  100. 0 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/UReportSubscriber.java

+ 98 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -181,6 +181,7 @@ public class DateUtils extends PropertyEditorSupport {
     public static Calendar getCalendar() {
         return Calendar.getInstance();
     }
+
     /**
      * 指定毫秒数表示的日历
      *
@@ -213,15 +214,17 @@ public class DateUtils extends PropertyEditorSupport {
         }
         return null;
     }
+
     /**
      * 当前日期
      *
-     * @return 系统当前时间
      * @param l
+     * @return 系统当前时间
      */
     public static Date getDate(long l) {
         return new Date();
     }
+
     /**
      * 日期转换为字符串
      *
@@ -235,9 +238,11 @@ public class DateUtils extends PropertyEditorSupport {
         }
         return date_sdf.format(date);
     }
+
     public static Date getDate() {
         return new Date();
     }
+
     /**
      * 格式化时间
      *
@@ -592,7 +597,7 @@ public class DateUtils extends PropertyEditorSupport {
      * @return 如果转换成功则返回转换后的日期
      * @throws
      */
-    public static Calendar parseCalendar(String src, String pattern){
+    public static Calendar parseCalendar(String src, String pattern) {
 
         Date date = parseDate(src, pattern);
         Calendar cal = Calendar.getInstance();
@@ -711,6 +716,97 @@ public class DateUtils extends PropertyEditorSupport {
         return dateFormat.format(getDate);
     }
 
+    public static Date stampToTime(Long ms) throws ParseException {
+        long msl = ms * 1000;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date temp = null;
+        if (ms != null) {
+            try {
+                String str = sdf.format(msl);
+                temp = sdf.parse(str);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+        return temp;
+    }
+
+
+    private static Calendar zeroFromHour(long milliseconds) {
+        Calendar calendar = Calendar.getInstance(); // 获得一个日历
+
+        calendar.setTimeInMillis(completMilliseconds(milliseconds));
+        zeroFromHour(calendar);
+        return calendar;
+    }
+
+    private static long completMilliseconds(long milliseconds) {
+        String milStr = Long.toString(milliseconds);
+        if (milStr.length() == 10) {
+            milliseconds = milliseconds * 1000;
+        }
+        return milliseconds;
+    }
+
+    private static void zeroFromHour(Calendar calendar) {
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+    }
+
+
+    public static String getWhatDay(long timeStamp) {
+        Calendar cal = zeroFromHour(timeStamp);
+        String whatDay = "";
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
+            whatDay = "星期六";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+            whatDay = "星期日";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
+            whatDay = "星期一";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.TUESDAY) {
+            whatDay = "星期二";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY) {
+            whatDay = "星期三";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.THURSDAY) {
+            whatDay = "星期四";
+        }
+        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY) {
+            whatDay = "星期五";
+        }
+        return whatDay;
+    }
+
+    /* //日期转换为时间戳 */
+    public static long timeToStamp(String timers) {
+        Date d = new Date();
+        long timeStemp = 0;
+        try {
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            d = sf.parse(timers);// 日期转换为时间戳
+        } catch (ParseException e) {
+
+            e.printStackTrace();
+        }
+        timeStemp = d.getTime();
+        return timeStemp / 1000;
+    }
+
+
+    public static void main(String[] args) throws ParseException {
+        /*Date date = stampToTime(1599458521L);
+        String s = formatDate(date);
+        System.err.println(s);*/
+        Long s1 = timeToStamp("2020-09-23 21:30:00");
+        System.err.println(s1);
+    }
+
     /**
      * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
      * HH:mm:ss“ * @param text String类型的时间值

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 8 - 4
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java


+ 6 - 1
jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/ActZprocess.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.activiti.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -26,7 +27,7 @@ import java.util.Date;
 @Accessors(chain = true)
 @ApiModel(value="act_z_process对象", description="流程定义扩展表")
 public class ActZprocess {
-    
+
 	/**id*/
 	@TableId(type = IdType.ID_WORKER_STR)
     @ApiModelProperty(value = "id")
@@ -103,4 +104,8 @@ public class ActZprocess {
 	@Excel(name = "授权的角色", width = 15)
     @ApiModelProperty(value = "授权的角色")
 	private String roles;
+
+	private Long customTableId;
+	@TableField(exist = false)
+	private String customTableName;
 }

+ 8 - 8
jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/Impl/ActZprocessServiceImpl.java

@@ -114,10 +114,8 @@ public class ActZprocessServiceImpl extends ServiceImpl<ActZprocessMapper, ActZp
             throw new JeecgBootException("没有业务表单数据");
         }
         /*表单数据写入*/
-        Map<String, Object> busiData = actBusinessService.getBaseMapper().getBusiData(tableId, tableName);
-        for (String key : busiData.keySet()) {
-            params.put(key,busiData.get(key));
-        }
+        params.put("data",tableName);
+
         ProcessInstance pi = runtimeService.startProcessInstanceById(actBusiness.getProcDefId(), actBusiness.getId(), params);
         // 设置流程实例名称
         runtimeService.setProcessInstanceName(pi.getId(), actBusiness.getTitle());
@@ -168,10 +166,12 @@ public class ActZprocessServiceImpl extends ServiceImpl<ActZprocessMapper, ActZp
     public void sendActMessage(LoginUser fromUser, LoginUser toUser, ActBusiness act, String taskName, Boolean sendMessage, Boolean sendSms, Boolean sendEmail) {
         String title = String.format("您有一个新的审批任务");
         Map<String, String> msgMap = Maps.newHashMap();
-                        /*流程名称:  ${bpm_name}
-催办任务:  ${bpm_task}
-催办时间 :    ${datetime}
-催办内容 :    ${remark}*/
+        /**
+         * 流程名称:  ${bpm_name}
+         * 催办任务:  ${bpm_task}
+         * 催办时间:  ${datetime}
+         * 催办内容:  ${remark}
+         */
         msgMap.put("bpm_name",act.getTitle());
         msgMap.put("bpm_task",taskName);
         msgMap.put("datetime", DateUtils.now());

+ 63 - 34
jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -1,8 +1,9 @@
 package org.jeecg.modules.activiti.web;
 
-import cn.hutool.core.map.MapUtil;
-import cn.hutool.core.util.IdUtil;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.activiti.engine.RuntimeService;
@@ -19,13 +20,11 @@ import org.jeecg.modules.activiti.service.Impl.ActBusinessServiceImpl;
 import org.jeecg.modules.activiti.service.Impl.ActZprocessServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -52,27 +51,26 @@ public class ActBusinessController {
     ISysBaseApi sysBaseAPI;
     /*添加申请草稿状态*/
     @RequestMapping(value = "/add", method = RequestMethod.POST)
-    public Result add(HttpServletRequest request){
-        String procDefId = request.getParameter("procDefId");
-        String procDeTitle = request.getParameter("procDeTitle");
-        String tableName = request.getParameter("tableName");
-        /*保存业务表单数据到数据库表*/
-        String tableId = IdUtil.simpleUUID();
-        actBusinessService.saveApplyForm(tableId,request);
+    public Result add(@RequestBody JSONObject data){
+        String procDefId = data.getString("procDefId");
+        String procDeTitle = data.getString("procDeTitle");
+        Long tableId = data.getLong("tableId");
+        String formText = data.getString("formText");
+
         // 保存至我的申请业务
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String username = sysUser.getUsername();
         ActBusiness actBusiness = new ActBusiness();
         actBusiness.setUserId(username);
-        actBusiness.setTableId(tableId);
+        actBusiness.setTableId(tableId+"");
         actBusiness.setProcDefId(procDefId);
-        String title = request.getParameter(ActivitiConstant.titleKey);
+        String title = data.getString(ActivitiConstant.titleKey);
         if (StrUtil.isNotBlank(title)){
             actBusiness.setTitle(title);
         }else {
             actBusiness.setTitle(procDeTitle);
         }
-        actBusiness.setTableName(tableName);
+        actBusiness.setTableName(formText);
         actBusinessService.save(actBusiness);
         return Result.ok();
     }
@@ -99,14 +97,11 @@ public class ActBusinessController {
     /*通过id删除草稿状态申请*/
     @RequestMapping(value = "/delByIds", method = RequestMethod.POST)
     public Result delByIds(String ids){
-
         for(String id : ids.split(",")){
             ActBusiness actBusiness = actBusinessService.getById(id);
-            if(actBusiness.getStatus()!=ActivitiConstant.STATUS_TO_APPLY){
+            if(!actBusiness.getStatus().equals(ActivitiConstant.STATUS_TO_APPLY)){
                 return Result.error("删除失败, 仅能删除草稿状态的申请");
             }
-            // 删除关联业务表
-            actBusinessService.deleteBusiness(actBusiness.getTableName(), actBusiness.getTableId());
             actBusinessService.removeById(id);
         }
         return Result.ok("删除成功");
@@ -120,22 +115,13 @@ public class ActBusinessController {
             return Result.error("actBusiness表中该id不存在");
         }
         String tableId = actBusiness.getTableId();
-        String tableName = actBusiness.getTableName();
         act.setTableId(tableId);
-        Map<String, Object> busiData = actBusinessService.getBaseMapper().getBusiData(tableId, tableName);
-
-        if (MapUtil.isNotEmpty(busiData)&&busiData.get(ActivitiConstant.titleKey)!=null){
-            //如果表单里有 标题  更新一下
-            actBusiness.setTitle(busiData.get(ActivitiConstant.titleKey)+"");
-        }
         String processInstanceId = actZprocessService.startProcess(act);
         actBusiness.setProcInstId(processInstanceId);
         actBusiness.setStatus(ActivitiConstant.STATUS_DEALING);
         actBusiness.setResult(ActivitiConstant.RESULT_DEALING);
         actBusiness.setApplyTime(new Date());
         actBusinessService.updateById(actBusiness);
-        //修改业务表的流程字段
-        actBusinessService.updateBusinessStatus(actBusiness.getTableName(), actBusiness.getTableId(),"启动");
         return Result.ok("操作成功");
     }
     /*撤回申请*/
@@ -161,11 +147,22 @@ public class ActBusinessController {
     public Result listData(ActBusiness param, HttpServletRequest request){
         LambdaQueryWrapper<ActBusiness> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.orderByDesc(ActBusiness::getCreateTime);
-        if (StrUtil.isNotBlank(param.getTitle())) queryWrapper.like(ActBusiness::getTitle,param.getTitle());
-        if (param.getStatus()!=null) queryWrapper.eq(ActBusiness::getStatus,param.getStatus());
-        if (param.getResult()!=null) queryWrapper.eq(ActBusiness::getResult,param.getResult());
-        if (StrUtil.isNotBlank(request.getParameter("createTime_begin"))) queryWrapper.ge(ActBusiness::getTitle,param.getTitle());
-        if (StrUtil.isNotBlank(request.getParameter("createTime_end"))) queryWrapper.le(ActBusiness::getTitle,param.getTitle());
+        if (StrUtil.isNotBlank(param.getTitle())) {
+            queryWrapper.like(ActBusiness::getTitle,param.getTitle());
+        }
+        if (param.getStatus()!=null){
+            queryWrapper.eq(ActBusiness::getStatus,param.getStatus());
+        }
+        if (param.getResult()!=null){
+            queryWrapper.eq(ActBusiness::getResult,param.getResult());
+        }
+        if (StrUtil.isNotBlank(request.getParameter("createTime_begin"))) {
+            queryWrapper.ge(ActBusiness::getTitle,param.getTitle());
+        }
+        if (StrUtil.isNotBlank(request.getParameter("createTime_end"))) {
+            queryWrapper.le(ActBusiness::getTitle,param.getTitle());
+        }
+
 
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         queryWrapper.eq(ActBusiness::getUserId,loginUser.getUsername());
@@ -194,4 +191,36 @@ public class ActBusinessController {
         });
         return Result.ok(actBusinessList);
     }
+
+    @PostMapping("update")
+    public Map<String,Object>updateBusiness(@RequestBody JSONObject data){
+        Map<String,Object>result = new HashMap<>();
+        Long id = data.getLong("id");
+        String tableName = data.getString("tableName");
+        ActBusiness business = actBusinessService.getById(id);
+        if(null == business){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        business.setTableName(tableName);
+        actBusinessService.updateById(business);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @PostMapping("delete")
+    public Map<String,Object>delete(@RequestBody JSONObject data){
+        Map<String,Object>result = new HashMap<>();
+        Long id = data.getLong("id");
+        String tableName = data.getString("tableName");
+        ActBusiness business = actBusinessService.getById(id);
+        if(null == business){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        business.setTableName(tableName);
+        actBusinessService.updateById(business);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

+ 17 - 7
jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java

@@ -1,5 +1,7 @@
 package org.jeecg.modules.activiti.web;
 
+import cn.com.ctop.common.module.entity.ActCustomForm;
+import cn.com.ctop.common.module.service.IActCustomFormService;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -48,8 +50,6 @@ public class ActivitiProcessController {
     @Autowired
     private RepositoryService repositoryService;
     @Autowired
-    private ObjectMapper objectMapper;
-    @Autowired
     private ActZprocessServiceImpl actZprocessService;
     @Autowired
     private ActNodeServiceImpl actNodeService;
@@ -97,9 +97,22 @@ public class ActivitiProcessController {
             }).collect(Collectors.toList());
 
         }
+        if(null!=list&&!list.isEmpty()){
+            List<ActZprocess> getList = new ArrayList<>();
+            for(ActZprocess zprocess :list){
+                ActCustomForm form = customFormService.getById(zprocess.getCustomTableId());
+                if(null!=form){
+                    zprocess.setCustomTableName(form.getName());
+                }
+                getList.add(zprocess);
+            }
+            return Result.ok(getList);
+        }
         return Result.ok(list);
     }
 
+    @Autowired
+    private IActCustomFormService customFormService;
     /*激活或挂起流程定义*/
     @RequestMapping(value = "/updateStatus")
     public Result updateStatus( String id, Integer status){
@@ -107,12 +120,10 @@ public class ActivitiProcessController {
         ActZprocess actProcess = actZprocessService.getById(id);
         if(status==1){
             //启动前检查一下 路由等信息是否齐全
-            String routeName = actProcess.getRouteName();
-            String businessTable = actProcess.getBusinessTable();
-            if (StrUtil.isBlank(routeName)||StrUtil.isBlank(businessTable)){
+            Long tableId = actProcess.getCustomTableId();
+            if (null == tableId||tableId == 0){
                 return Result.error("未设置关联表单,点击编辑设置。");
             }
-
             repositoryService.activateProcessDefinitionById(id, true, new Date());
         }else {
             repositoryService.suspendProcessDefinitionById(id, true, new Date());
@@ -193,7 +204,6 @@ public class ActivitiProcessController {
     }
     @RequestMapping(value = "/updateInfo", method = RequestMethod.POST)
     public Result<Object> updateInfo(ActZprocess actProcess){
-
         ProcessDefinition pd = repositoryService.getProcessDefinition(actProcess.getId());
         if(pd==null){
             return Result.error("流程定义不存在");

+ 7 - 6
jeecg-boot-module-system/pom.xml

@@ -99,6 +99,13 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-oa</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>
@@ -139,12 +146,6 @@
         </dependency>
 
         <dependency>
-            <groupId>com.bstek.ureport</groupId>
-            <artifactId>ureport2-console</artifactId>
-            <version>2.2.9</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi</artifactId>
             <version>3.17</version>

+ 5 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -155,7 +155,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/test/getGroupData/**", "anon");
         filterChainDefinitionMap.put("/test/getVideoAndImage/**", "anon");
         filterChainDefinitionMap.put("/test/gerCreative/**", "anon");
-
+        filterChainDefinitionMap.put("/test/testdouyinmusic","anon");
+        filterChainDefinitionMap.put("/test/syncDouyinMusic","anon");
+        filterChainDefinitionMap.put("/test/parseDouyinMusic","anon");
         filterChainDefinitionMap.put("/report/kuaishouReportDailyAgent/get", "anon");
 
         filterChainDefinitionMap.put("/appium/appiumTask/run/login", "anon");
@@ -168,9 +170,10 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ureport/**", "anon");
         filterChainDefinitionMap.put("/job/test/*", "anon");
         filterChainDefinitionMap.put("/third/*", "anon");
-        //filterChainDefinitionMap.put("/kuaishou/**", "anon");
+        filterChainDefinitionMap.put("/ctop/kuaishou/dailyPage/**", "anon");
         filterChainDefinitionMap.put("/rest/script/*", "anon");
         filterChainDefinitionMap.put("/ctop/checkTaskList/*", "anon");
+        filterChainDefinitionMap.put("/ctop/report/bytedance/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

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

@@ -1,7 +1,7 @@
 package org.jeecg.config;
 
 import org.jeecg.common.util.DySmsHelper;
-import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
+import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;

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

@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -29,6 +31,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -79,6 +82,11 @@ public class ActCustomFormController {
 	public Result<ActCustomForm> add(@RequestBody ActCustomForm actCustomForm) {
 		Result<ActCustomForm> result = new Result<>();
 		try {
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			actCustomForm.setUserId(user.getId());
+			actCustomForm.setStatus(1);
+			actCustomForm.setCreateTime(new Date());
+			actCustomForm.setUpdateTime(new Date());
 			actCustomFormService.save(actCustomForm);
 			result.success("添加成功!");
 		} catch (Exception e) {

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

@@ -79,6 +79,7 @@ public class ActFormDataController {
 	public Result<ActFormData> add(@RequestBody ActFormData actFormData) {
 		Result<ActFormData> result = new Result<>();
 		try {
+			actFormData.setStatus(1);
 			actFormDataService.save(actFormData);
 			result.success("添加成功!");
 		} catch (Exception e) {

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

@@ -1,234 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.entity.ActFormField;
-import cn.com.ctop.common.module.service.IActFormFieldService;
-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;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
- /**
- * 自定义表单字段信息
- * @author jeecg-boot
- * @date   2020-08-25
- * @version V1.0
- */
-@Slf4j
-@Api(tags="自定义表单字段信息")
-@RestController
-@RequestMapping("/ctop/actFormField")
-public class ActFormFieldController {
-	@Autowired
-	private IActFormFieldService actFormFieldService;
-
-	/**
-	  * 分页列表查询
-	 * @param actFormField
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-分页列表查询", notes="自定义表单字段信息-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<ActFormField>> queryPageList(ActFormField actFormField,
-													 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-													 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-													 HttpServletRequest req) {
-		Result<IPage<ActFormField>> result = new Result<>();
-		QueryWrapper<ActFormField> queryWrapper = QueryGenerator.initQueryWrapper(actFormField, req.getParameterMap());
-		Page<ActFormField> page = new Page<>(pageNo, pageSize);
-		IPage<ActFormField> pageList = actFormFieldService.page(page, queryWrapper);
-		result.setSuccess(true);
-		result.setResult(pageList);
-		return result;
-	}
-
-	/**
-	  *   添加
-	 * @param actFormField
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-添加", notes="自定义表单字段信息-添加")
-	@PostMapping(value = "/add")
-	public Result<ActFormField> add(@RequestBody ActFormField actFormField) {
-		Result<ActFormField> result = new Result<>();
-		try {
-			actFormFieldService.save(actFormField);
-			result.success("添加成功!");
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-			result.error500("操作失败");
-		}
-		return result;
-	}
-
-	/**
-	  *  编辑
-	 * @param actFormField
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-编辑", notes="自定义表单字段信息-编辑")
-	@PutMapping(value = "/edit")
-	public Result<ActFormField> edit(@RequestBody ActFormField actFormField) {
-		Result<ActFormField> result = new Result<ActFormField>();
-		ActFormField actFormFieldEntity = actFormFieldService.getById(actFormField.getId());
-		if(actFormFieldEntity==null) {
-			result.error500("未找到对应实体");
-		}else {
-			boolean ok = actFormFieldService.updateById(actFormField);
-			if(ok) {
-				result.success("修改成功!");
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	  *   通过id删除
-	 * @param id
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-通过id删除", notes="自定义表单字段信息-通过id删除")
-	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
-		try {
-			actFormFieldService.removeById(id);
-		} catch (Exception e) {
-			log.error("删除失败",e.getMessage());
-			return Result.error("删除失败!");
-		}
-		return Result.ok("删除成功!");
-	}
-
-	/**
-	  *  批量删除
-	 * @param ids
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-批量删除", notes="自定义表单字段信息-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<ActFormField> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<ActFormField> result = new Result<>();
-		if(ids==null || "".equals(ids.trim())) {
-			result.error500("参数不识别!");
-		}else {
-			this.actFormFieldService.removeByIds(Arrays.asList(ids.split(",")));
-			result.success("删除成功!");
-		}
-		return result;
-	}
-
-	/**
-	  * 通过id查询
-	 * @param id
-	 * @return
-	 */
-	@ApiOperation(value="自定义表单字段信息-通过id查询", notes="自定义表单字段信息-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ActFormField> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<ActFormField> result = new Result<>();
-		ActFormField actFormField = actFormFieldService.getById(id);
-		if(actFormField==null) {
-			result.error500("未找到对应实体");
-		}else {
-			result.setResult(actFormField);
-			result.setSuccess(true);
-		}
-		return result;
-	}
-
-  /**
-      * 导出excel
-   *
-   * @param request
-   * @param response
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-      // Step.1 组装查询条件
-      QueryWrapper<ActFormField> queryWrapper = null;
-      try {
-          String paramsStr = request.getParameter("paramsStr");
-          if (oConvertUtils.isNotEmpty(paramsStr)) {
-              String deString = URLDecoder.decode(paramsStr, "UTF-8");
-              ActFormField actFormField = JSON.parseObject(deString, ActFormField.class);
-              queryWrapper = QueryGenerator.initQueryWrapper(actFormField, request.getParameterMap());
-          }
-      } catch (UnsupportedEncodingException e) {
-          e.printStackTrace();
-      }
-
-      //Step.2 AutoPoi 导出Excel
-      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-      List<ActFormField> pageList = actFormFieldService.list(queryWrapper);
-      //导出文件名称
-      mv.addObject(NormalExcelConstants.FILE_NAME, "自定义表单字段信息列表");
-      mv.addObject(NormalExcelConstants.CLASS, ActFormField.class);
-      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("自定义表单字段信息列表数据", "导出人:Jeecg", "导出信息"));
-      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-      return mv;
-  }
-
-  /**
-      * 通过excel导入数据
-   *
-   * @param request
-   * @param response
-   * @return
-   */
-  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-          MultipartFile file = entity.getValue();
-          ImportParams params = new ImportParams();
-          params.setTitleRows(2);
-          params.setHeadRows(1);
-          params.setNeedSave(true);
-          try {
-              List<ActFormField> listActFormFields = ExcelImportUtil.importExcel(file.getInputStream(), ActFormField.class, params);
-              actFormFieldService.saveBatch(listActFormFields);
-              return Result.ok("文件导入成功!数据行数:" + listActFormFields.size());
-          } catch (Exception e) {
-              log.error(e.getMessage(),e);
-              return Result.error("文件导入失败:"+e.getMessage());
-          } finally {
-              try {
-                  file.getInputStream().close();
-              } catch (IOException e) {
-                  e.printStackTrace();
-              }
-          }
-      }
-      return Result.ok("文件导入失败!");
-  }
-
-}

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

@@ -1,7 +1,11 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.entity.ActCustomForm;
 import cn.com.ctop.common.module.entity.ActFormPorcess;
+import cn.com.ctop.common.module.service.IActCustomFormService;
 import cn.com.ctop.common.module.service.IActFormPorcessService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -12,6 +16,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.activiti.entity.ActZprocess;
+import org.jeecg.modules.activiti.service.IActZprocessService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -29,6 +35,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -44,8 +51,32 @@ import java.util.Map;
 @RequestMapping("/ctop/actFormPorcess")
 public class ActFormPorcessController {
 	@Autowired
+	private IActZprocessService actZprocessService;
+	@Autowired
 	private IActFormPorcessService actFormPorcessService;
+	@Autowired
+	private IActCustomFormService customFormService;
+	@PostMapping("bindProcess")
+	public Map<String,Object>bindProcess(Long formId,String processId){
+		Map<String,Object>result = new HashMap<>();
+		if(null == formId||formId == 0||null == processId||processId.trim().equals("")){
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		ActZprocess actZprocess = actZprocessService.getById(processId);
+		ActCustomForm customForm = customFormService.getById(formId);
+		if(null == actZprocess||null == customForm){
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
 
+		ActFormPorcess actFormPorcess = new ActFormPorcess();
+		actFormPorcess.setFormId(formId);
+		actFormPorcess.setProcessId(processId);
+		actFormPorcess.setStatus(1);
+		actFormPorcessService.save(actFormPorcess);
+		return result;
+	}
 	/**
 	  * 分页列表查询
 	 * @param actFormPorcess

+ 174 - 50
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java

@@ -2,13 +2,19 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
-import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.IProductService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.vo.SheetInfoVo;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouInfoDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
 import com.alibaba.excel.EasyExcelFactory;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.metadata.Sheet;
@@ -16,21 +22,19 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
-import org.jeecg.modules.ctop.vo.SheetInfoVo;
-import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
-import org.jeecg.modules.system.entity.SysCategory;
+import org.jeecg.modules.excelutil.entity.*;
 import org.jeecg.modules.system.entity.UserCompany;
 import org.jeecg.modules.system.mapper.UserCompanyMapper;
-import org.jeecg.modules.system.service.ISysCategoryService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -55,8 +59,6 @@ public class AdvertiserController {
     @Autowired
     private IAdvertiserService advertiserService;
     @Autowired
-    private ISysCategoryService sysCategoryService;
-    @Autowired
     private UserCompanyMapper userCompanyMapper;
     @Autowired
     private ISysRoleExtService sysRoleService;
@@ -67,7 +69,6 @@ public class AdvertiserController {
     @Autowired
     private IUserAllocationService userAllocationService;
 
-
     /**
      * 查询 公司广告主
      *
@@ -115,15 +116,16 @@ public class AdvertiserController {
                                                    @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
                                                    HttpServletRequest req) {
         Result<IPage<Advertiser>> result = new Result<>();
-        String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
-        String userId = advertiser.getUserId();
+        // String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
+      /*  String userId = advertiser.getUserId();
         if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
             advertiser.setUserId(null);
-        }
-        String industryId = advertiser.getIndustryId();
-        advertiser.setIndustryId(null);
+        }*/
+
+        String name = advertiser.getName();
+        advertiser.setName(null);
         QueryWrapper<Advertiser> queryWrapper = QueryGenerator.initQueryWrapper(advertiser, req.getParameterMap());
-        if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+       /* if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
             QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
             userCompanyQueryWrapper.eq("user_id", userId);
             userCompanyQueryWrapper.orderByDesc("create_time");
@@ -132,12 +134,9 @@ public class AdvertiserController {
             if (!Check.isNull(userCompany)) {
                 queryWrapper.eq("company_id", userCompany.getCompanyId());
             }
-        }
-        if (null != industryId && !"".equals(industryId.trim())) {
-            SysCategory category = sysCategoryService.getById(industryId);
-            if (null != category) {
-                queryWrapper.likeRight("industry_code", category.getCode());
-            }
+        }*/
+        if (!Check.isNull(name)) {
+            queryWrapper.like("name", name);
         }
         Page<Advertiser> page = new Page<>(pageNo, pageSize);
         IPage<Advertiser> pageList = advertiserService.page(page, queryWrapper);
@@ -179,14 +178,6 @@ public class AdvertiserController {
             if (!Check.isNull(userCompany)) {
                 advertiser.setCompanyId(userCompany.getCompanyId());
             }
-            String industryId = advertiser.getIndustryId();
-            if (null != industryId && !"".equals(industryId.trim())) {
-                SysCategory category = sysCategoryService.getById(industryId);
-                if (null != category) {
-                    advertiser.setIndustryId(category.getId());
-                    advertiser.setIndustryCode(category.getCode());
-                }
-            }
             advertiserService.save(advertiser);
             result.success("添加成功!");
         } catch (Exception e) {
@@ -202,8 +193,6 @@ public class AdvertiserController {
      * @param advertiser
      * @return
      */
-    @Autowired
-    private IProjectService projectService;
 
     @AutoLog(value = "广告主信息表-编辑")
     @ApiOperation(value = "广告主信息表-编辑", notes = "广告主信息表-编辑")
@@ -214,25 +203,7 @@ public class AdvertiserController {
         if (advertiserEntity == null) {
             result.error500("未找到对应实体");
         } else {
-            String industryId = advertiser.getIndustryId();
-            if (null != industryId && !"".equals(industryId.trim())) {
-                SysCategory category = sysCategoryService.getById(industryId);
-                if (null != category) {
-                    advertiser.setIndustryId(category.getId());
-                    advertiser.setIndustryCode(category.getCode());
-                }
-            }
             boolean ok = advertiserService.updateById(advertiser);
-            QueryWrapper<Project> projectQueryWrapper = new QueryWrapper<>();
-            projectQueryWrapper.eq("advertiser_id", advertiser.getId());
-            Project updateProject = new Project();
-            updateProject.setAdvertiserName(advertiser.getName());
-            projectService.update(updateProject, projectQueryWrapper);
-            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-            userAllocationQueryWrapper.eq("advertiser_id", advertiser.getId());
-            UserAllocation updateUserAllocation = new UserAllocation();
-            updateUserAllocation.setAdvertiserName(advertiser.getName());
-            userAllocationService.update(updateUserAllocation, userAllocationQueryWrapper);
             if (ok) {
                 result.success("修改成功!");
             }
@@ -247,6 +218,9 @@ public class AdvertiserController {
      * @param id
      * @return
      */
+    @Autowired
+    private IProductService productService;
+
     @AutoLog(value = "广告主信息表-通过id删除")
     @ApiOperation(value = "广告主信息表-通过id删除", notes = "广告主信息表-通过id删除")
     @DeleteMapping(value = "/delete")
@@ -264,9 +238,14 @@ public class AdvertiserController {
                     Map<String, Object> map = new HashMap<>();
                     map.put("project_id", project.getId());
                     projectMemberMapper.deleteByMap(map);
+                    userAllocationService.removeByMap(map);
                 }
 
             }
+            Map<String, Object> productDeleteMap = new HashMap<>();
+            productDeleteMap.put("advertiser_id", id);
+            productService.removeByMap(productDeleteMap);
+
             projectMapper.delete(queryWrapper);
             boolean ok = advertiserService.removeById(id);
             if (ok) {
@@ -405,7 +384,10 @@ public class AdvertiserController {
      */
     @RequestMapping(value = "/exportXxlDailyReport")
     @ResponseBody
-    public void exportXxl(HttpServletRequest request, HttpServletResponse response, Long projectId, String systemType) throws IOException {
+    public void exportXxl(HttpServletRequest request,
+                          HttpServletResponse response,
+                          Long projectId,
+                          String systemType) throws IOException {
         List<SheetInfoVo> sheets = new ArrayList<>();
         if (null == systemType || "".equals(systemType.trim())) {
             systemType = null;
@@ -441,4 +423,146 @@ public class AdvertiserController {
         outputStream.flush();
         outputStream.close();
     }
+
+    @Autowired
+    private IKuaishouReportDailyAccountService accountService;
+
+    @RequestMapping("/exportKuaishouProjectInfo")
+    public void getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto,
+                                       HttpServletRequest request,
+                                       HttpServletResponse response) throws IOException {
+        Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if (dto.getPageSize() == 0) {
+            dto.setPageSize(100000);
+        }
+        OutputStream outputStream = response.getOutputStream();
+        String date = DateUtils.formatDate(new Date());
+        HttpUtils.setResponseHeader(response, "快手效果报表" + date + ".xlsx");
+        ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
+        String type = dto.getType();
+        if (null != type && type.trim().equals("project")) {
+            SheetInfoVo projectSheetVo = this.getProjectSheetVo(dto, "项目报表");
+            Sheet sheet = new Sheet(1, 0, EffecfReportProjectEntity.class);
+            sheet.setSheetName(projectSheetVo.getSheetName());
+            excelWriter.write(projectSheetVo.getDetails(), sheet);
+        }
+        if (null != type && type.trim().equals("account")) {
+            SheetInfoVo accountSheetVo = this.getAccountSheetVo(dto, "账户报表");
+            Sheet sheet = new Sheet(1, 0, EffecfReportAccountEntity.class);
+            sheet.setSheetName(accountSheetVo.getSheetName());
+            excelWriter.write(accountSheetVo.getDetails(), sheet);
+        }
+
+        if (null != type && type.trim().equals("campaign")) {
+            SheetInfoVo planSheetVo = this.getPlanSheetVo(dto, "广告计划报表");
+            Sheet sheet = new Sheet(1, 0, EffecfReportPlanEntity.class);
+            sheet.setSheetName(planSheetVo.getSheetName());
+            excelWriter.write(planSheetVo.getDetails(), sheet);
+        }
+
+        if (null != type && type.trim().equals("group")) {
+            SheetInfoVo campaignSheetVo = this.getGroupSheetVo(dto, "广告组报表");
+            Sheet sheet = new Sheet(1, 0, EffecfReportGroupEntity.class);
+            sheet.setSheetName(campaignSheetVo.getSheetName());
+            excelWriter.write(campaignSheetVo.getDetails(), sheet);
+        }
+
+        if (null != type && type.trim().equals("creative")) {
+            SheetInfoVo creativeSheetVo = this.getCreativeSheetVo(dto, "广告创意");
+            Sheet sheet = new Sheet(1, 0, EffecfReportCreativeEntity.class);
+            sheet.setSheetName(creativeSheetVo.getSheetName());
+            excelWriter.write(creativeSheetVo.getDetails(), sheet);
+        }
+
+        excelWriter.finish();
+        outputStream.flush();
+        outputStream.close();
+    }
+
+    private SheetInfoVo getCreativeSheetVo(KuaishouInfoDTO dto, String sheetName) {
+        SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
+        vo.setSheetName(sheetName);
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getProjectList(), dto.getUnitId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
+        List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
+        if (null != dtos && !dtos.isEmpty()) {
+            List<EffecfReportCreativeEntity> details = new ArrayList<>();
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
+                EffecfReportCreativeEntity entity = new EffecfReportCreativeEntity();
+                BeanUtils.copyProperties(dto1, entity);
+                details.add(entity);
+            }
+            vo.setDetails(details);
+        }
+        return vo;
+    }
+
+    private SheetInfoVo getGroupSheetVo(KuaishouInfoDTO dto, String sheetName) {
+        SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
+        vo.setSheetName(sheetName);
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getProjectList(), dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
+        List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
+        if (null != dtos && !dtos.isEmpty()) {
+            List<EffecfReportGroupEntity> details = new ArrayList<>();
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
+                EffecfReportGroupEntity entity = new EffecfReportGroupEntity();
+                BeanUtils.copyProperties(dto1, entity);
+                details.add(entity);
+            }
+            vo.setDetails(details);
+        }
+        return vo;
+    }
+
+    private SheetInfoVo getPlanSheetVo(KuaishouInfoDTO dto, String sheetName) {
+        SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
+        vo.setSheetName(sheetName);
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getProjectList(), dto.getAccountId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
+        List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
+        if (null != dtos && !dtos.isEmpty()) {
+            List<EffecfReportPlanEntity> details = new ArrayList<>();
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
+                EffecfReportPlanEntity entity = new EffecfReportPlanEntity();
+                BeanUtils.copyProperties(dto1, entity);
+                details.add(entity);
+            }
+            vo.setDetails(details);
+        }
+        return vo;
+    }
+
+    private SheetInfoVo getAccountSheetVo(KuaishouInfoDTO dto, String sheetName) {
+        SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
+        vo.setSheetName(sheetName);
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(), dto.getProjectList(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
+        List<KuaishouReportDailyAccountDTO> dtos = kuaishouReportDailyAccountDTOList.getList();
+        if (null != dtos && !dtos.isEmpty()) {
+            List<EffecfReportAccountEntity> details = new ArrayList<>();
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
+                EffecfReportAccountEntity entity = new EffecfReportAccountEntity();
+                BeanUtils.copyProperties(dto1, entity);
+                details.add(entity);
+            }
+            vo.setDetails(details);
+        }
+        return vo;
+    }
+
+    private SheetInfoVo getProjectSheetVo(KuaishouInfoDTO dto, String sheetName) {
+        SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
+        vo.setSheetName(sheetName);
+        PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(), dto.getPageSize(), dto.getPageNum(), "", dto.getYn());
+        List<ProjectAccountDTO> dtos = projectAccountDTOList.getList();
+        if (null != dtos && !dtos.isEmpty()) {
+            List<EffecfReportProjectEntity> details = new ArrayList<>();
+            for (ProjectAccountDTO dto1 : dtos) {
+                EffecfReportProjectEntity entity = new EffecfReportProjectEntity();
+                BeanUtils.copyProperties(dto1, entity);
+                details.add(entity);
+            }
+            vo.setDetails(details);
+        }
+        return vo;
+    }
 }

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

@@ -91,10 +91,10 @@ public class BindAccountLoginController {
             userAllocation.setUserId(userId);
             userAllocation.setAdvertiserId(advertiserId);
             userAllocation.setAccountId(accountId);
-            userAllocation.setAdvertiserName(advertiserName);
+          //  userAllocation.setAdvertiserName(advertiserName);
             userAllocation.setAccountName(accountName);
             userAllocation.setProjectId(projectId);
-            userAllocation.setProjectName(projectName);
+            // userAllocation.setProjectName(projectName);
             userAllocation.setMediaId(mediaId);
             userAllocation.setSystemType(systemType);
             int i = userAllocationMapper.insert(userAllocation);

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -184,11 +184,11 @@ public class CallbackController {
                     if ((Integer) advertiseBaseInfoMap.get("code") == 0) {
                         userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
                     }
-                    userAllocation.setAdvertiserName(advertiserName);
+               //     userAllocation.setAdvertiserName(advertiserName);
                     userAllocation.setMediaId(mediaId);
                     userAllocation.setAccountId(accountId);
                     userAllocation.setProjectId(projectId);
-                    userAllocation.setProjectName(projectName);
+                 //   userAllocation.setProjectName(projectName);
                     userAllocation.setWarningProportion(warningProportion);
                     userAllocation.setWarningAmount(warningAmount);
 
@@ -344,10 +344,10 @@ public class CallbackController {
                             userAllocation.setUserId(userId);
                             userAllocation.setUserName(userName);
                             userAllocation.setAccountId(token.getAccountId());
-                            userAllocation.setAdvertiserName(advertiserName);
+                       //     userAllocation.setAdvertiserName(advertiserName);
                             userAllocation.setMediaId(mediaId);
                             userAllocation.setProjectId(projectId);
-                            userAllocation.setProjectName(projectName);
+                         //   userAllocation.setProjectName(projectName);
                             userAllocation.setSystemType(systemType);
                             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
                             userAllocation.setAdvertiserId(advertiserId);
@@ -398,10 +398,10 @@ public class CallbackController {
                     userAllocation.setUserId(userId);
                     userAllocation.setUserName(userName);
                     userAllocation.setAccountId(token.getAccountId());
-                    userAllocation.setAdvertiserName(advertiserName);
+               //     userAllocation.setAdvertiserName(advertiserName);
                     userAllocation.setMediaId(mediaId);
                     userAllocation.setProjectId(projectId);
-                    userAllocation.setProjectName(projectName);
+                //    userAllocation.setProjectName(projectName);
                     userAllocation.setSystemType(systemType);
                     userAllocation.setAuthName((String) advertiserDataMap.get("name"));
                     userAllocation.setAdvertiserId(advertiserId);

+ 1 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CreativeTitleController.java

@@ -11,10 +11,10 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping("/ctop/creativeTitle/")
 public class CreativeTitleController {
+
     @Autowired
     private ICreativeTitleService creativeTitleService;
 
-
     @GetMapping("getTitleLabel")
     public Result<JSONArray> getTitleLabel() {
         Result<JSONArray> result = new Result<>();
@@ -24,7 +24,6 @@ public class CreativeTitleController {
         return result;
     }
 
-
     @GetMapping("titleSuggestion")
     public Result<JSONArray> titleSuggestion(String firstCategory, String secondCategory, String keyword) {
         Result<JSONArray> result = new Result<>();
@@ -34,8 +33,6 @@ public class CreativeTitleController {
         return result;
     }
 
-
-
     @GetMapping("titleSearch")
     public Result<JSONArray> titleSearch(String firstCategory, String secondCategory, String keywords) {
         Result<JSONArray> result = new Result<>();
@@ -44,6 +41,4 @@ public class CreativeTitleController {
         result.setResult(labelArr);
         return result;
     }
-
-
 }

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+@RestController
+@RequestMapping("image")
+public class ImageCostController {
+    @Autowired
+    private IBytedanceReportMaterialDailyService materialDailyService;
+    @PostMapping("bytedance/cost")
+    public Map<String,Object> bytedanceImageCost(@RequestBody JSONObject data){
+        return materialDailyService.bytedanceImageCost(data);
+    }
+}

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

@@ -0,0 +1,236 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.alibaba.excel.event.AnalysisEventListener;
+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;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.JhsBakendData;
+import org.jeecg.modules.ctop.service.IJhsBakendDataService;
+import org.jeecg.modules.excelutil.ExcelUtils;
+import org.jeecg.modules.excelutil.JhsBakendDataExcelListener;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * 聚划算后端数据
+ * @author jeecg-boot
+ * @date   2020-09-07
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="聚划算后端数据")
+@RestController
+@RequestMapping("/okr/jhsBakendData")
+public class JhsBakendDataController {
+	@Autowired
+	private IJhsBakendDataService jhsBakendDataService;
+
+	/**
+	  * 分页列表查询
+	 * @param jhsBakendData
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<JhsBakendData>> queryPageList(JhsBakendData jhsBakendData,
+													  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													  HttpServletRequest req) {
+		Result<IPage<JhsBakendData>> result = new Result<>();
+		QueryWrapper<JhsBakendData> queryWrapper = QueryGenerator.initQueryWrapper(jhsBakendData, req.getParameterMap());
+		Page<JhsBakendData> page = new Page<JhsBakendData>(pageNo, pageSize);
+		IPage<JhsBakendData> pageList = jhsBakendDataService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param jhsBakendData
+	 * @return
+	 */
+	@ApiOperation(value="聚划算后端数据-添加", notes="聚划算后端数据-添加")
+	@PostMapping(value = "/add")
+	public Result<JhsBakendData> add(@RequestBody JhsBakendData jhsBakendData) {
+		Result<JhsBakendData> result = new Result<>();
+		try {
+			jhsBakendDataService.save(jhsBakendData);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param jhsBakendData
+	 * @return
+	 */
+	@ApiOperation(value="聚划算后端数据-编辑", notes="聚划算后端数据-编辑")
+	@PutMapping(value = "/edit")
+	public Result<JhsBakendData> edit(@RequestBody JhsBakendData jhsBakendData) {
+		Result<JhsBakendData> result = new Result<JhsBakendData>();
+		JhsBakendData jhsBakendDataEntity = jhsBakendDataService.getById(jhsBakendData.getId());
+		if(jhsBakendDataEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = jhsBakendDataService.updateById(jhsBakendData);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="聚划算后端数据-通过id删除", notes="聚划算后端数据-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			jhsBakendDataService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="聚划算后端数据-批量删除", notes="聚划算后端数据-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<JhsBakendData> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<JhsBakendData> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.jhsBakendDataService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="聚划算后端数据-通过id查询", notes="聚划算后端数据-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<JhsBakendData> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<JhsBakendData> result = new Result<>();
+		JhsBakendData jhsBakendData = jhsBakendDataService.getById(id);
+		if(jhsBakendData==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(jhsBakendData);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<JhsBakendData> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              JhsBakendData jhsBakendData = JSON.parseObject(deString, JhsBakendData.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(jhsBakendData, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<JhsBakendData> pageList = jhsBakendDataService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "聚划算后端数据列表");
+      mv.addObject(NormalExcelConstants.CLASS, JhsBakendData.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("聚划算后端数据列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+	  //1.读Excel
+	  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+	  Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+	  for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+		  FileInputStream fis = null;
+		  try {
+			  MultipartFile file = entity.getValue();
+			  fis = (FileInputStream) file.getInputStream();
+			  AnalysisEventListener listener = new JhsBakendDataExcelListener();
+			  Boolean flag = ExcelUtils.readExcel(fis, JhsBakendDataEntity.class, listener);
+			  System.out.println("导入是否成功:" + flag);
+		  } catch (Exception e) {
+			  e.printStackTrace();
+		  } finally {
+			  if (fis != null) {
+				  try {
+					  fis.close();
+				  } catch (IOException e) {
+					  e.printStackTrace();
+				  }
+			  }
+		  }
+	  }
+	  return Result.ok("文件导入成功!");
+  }
+
+}

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.excel.event.AnalysisEventListener;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,11 +12,20 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.ctop.entity.KuaishouChannelRegInfo;
 import org.jeecg.modules.ctop.service.IKuaishouChannelRegInfoService;
+import org.jeecg.modules.excelutil.ExcelUtils;
+import org.jeecg.modules.excelutil.KuaishouChannelRegInfoExcelListener;
+import org.jeecg.modules.excelutil.entity.KuaishouChannelRegInfoEntity;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.Arrays;
+import java.util.Map;
 
 /**
  * 快手渠道注册信息表
@@ -161,4 +171,39 @@ public class KuaishouChannelRegInfoController {
         }
         return result;
     }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        //1.读Excel
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            FileInputStream fis = null;
+            try {
+                MultipartFile file = entity.getValue();
+                fis = (FileInputStream) file.getInputStream();
+                AnalysisEventListener listener = new KuaishouChannelRegInfoExcelListener();
+                Boolean flag = ExcelUtils.readExcel(fis, KuaishouChannelRegInfoEntity.class, listener);
+                System.out.println("导入是否成功:" + flag);
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                if (fis != null) {
+                    try {
+                        fis.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return Result.ok("文件导入成功!");
+    }
 }

+ 20 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java

@@ -22,7 +22,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.service.IProjectMemberService;
+import org.jeecg.modules.system.service.ISysRoleService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -64,7 +64,7 @@ public class MaterialImageInfoController {
     @Autowired
     private MaterialInfoMapper materialInfoMapper;
     @Autowired
-    private IProjectMemberService memberService;
+    private ISysRoleService sysRoleService;
 
 
     @ApiOperation(value = "截屏-分页列表查询", notes = "截屏-分页列表查询")
@@ -78,7 +78,7 @@ public class MaterialImageInfoController {
         Object createTime = materialImageInfo.getCreateTime();
         materialImageInfo.setCreateTime(null);
         if (!Check.isNull(materialImageInfo.getUserId())) {
-            String roleCode = materialInfoService.getRoleCodeByUserId(materialImageInfo.getUserId());
+            String roleCode = sysRoleService.getRoleCodeByUserId(materialImageInfo.getUserId());
             if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "admin".equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || "sale".equals(roleCode) || "saleDirector".equals(roleCode)) {
                 materialImageInfo.setUserId(null);
                 queryWrapper = QueryGenerator.initQueryWrapper(materialImageInfo, req.getParameterMap());
@@ -106,6 +106,22 @@ public class MaterialImageInfoController {
 
     }
 
+    @PostMapping(value = "/listByAccountIds")
+    public Result<IPage<MaterialImageInfo>> listByAccountIds(@RequestBody JSONObject requestBody) {
+        Result<IPage<MaterialImageInfo>> result = new Result<IPage<MaterialImageInfo>>();
+        QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
+        if (!Check.isNull(requestBody.getString("userId"))) {
+            queryWrapper.eq("user_id",requestBody.getString("userId"));
+            }
+        queryWrapper.orderByDesc(true,"create_time");
+        Page<MaterialImageInfo> page = new Page<>(requestBody.getInteger("pageNo"), requestBody.getInteger("pageSize"));
+        IPage<MaterialImageInfo> pageList = MaterialImageInfoService.page(page, queryWrapper);
+
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+
+    }
 
     /**
      * 分页列表查询
@@ -233,8 +249,7 @@ public class MaterialImageInfoController {
         Result<MaterialImageInfo> result = new Result<MaterialImageInfo>();
         try {
             if (!Check.isNull(updateArr)) {
-                LoginUser user = (LoginUser) SecurityUtils.getSubject()
-                        .getPrincipal();
+                LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
                 for (int i = 0; i < updateArr.size(); i++) {
                     JSONObject updateJson = updateArr.getJSONObject(i);
                     if (!Check.isNull(updateJson)) {

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

@@ -1,12 +1,12 @@
 package org.jeecg.modules.ctop.controller;
 
-
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
 import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
@@ -27,11 +27,13 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
+import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.net.URLDecoder;
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -197,15 +199,15 @@ public class MaterialInfoController {
         return result;
     }
 
-    @AutoLog(value = "素材信息-分页列表查询")
-    @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
+    @Autowired
+    private ISysRoleService roleService;
+
     @GetMapping(value = "/list")
     public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                      HttpServletRequest req) {
 
-
         Result<IPage<MaterialInfo>> result = new Result<>();
         String materialName = materialInfo.getMaterialName();
         String startDate = materialInfo.getStartDate();
@@ -218,7 +220,7 @@ public class MaterialInfoController {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         materialInfo.setCreateTime(null);
         if (!Check.isNull(materialInfo.getUserId())) {
-            String roleCode = materialInfoService.getRoleCodeByUserId(materialInfo.getUserId());
+            String roleCode = roleService.getRoleCodeByUserId(materialInfo.getUserId());
             if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")) {
                 materialInfo.setUserId(null);
                 queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
@@ -292,10 +294,6 @@ public class MaterialInfoController {
                     material.setMediaId(project.getMediaId());
                     material.setProjectName(project.getProjectName());
                 }
-                /*JSONObject generalizationJson = materialInfoService.getGeneralizationInfo(material.getCode());
-                if (!Check.isNull(generalizationJson)) {
-                    material.setGeneralization(generaliz  ationJson);
-                }*/
 
                 QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
                 imageInfoQueryWrapper.eq("video_id", material.getCode());
@@ -338,7 +336,7 @@ public class MaterialInfoController {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
 
         if (!Check.isNull(materialInfo.getUserId())) {
-            String roleCode = materialInfoService.getRoleCodeByUserId(materialInfo.getUserId());
+            String roleCode = roleService.getRoleCodeByUserId(materialInfo.getUserId());
             if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
                 materialInfo.setUserId(null);
             } else {
@@ -475,6 +473,28 @@ public class MaterialInfoController {
                 url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
             }
             materialInfo.setUrl(url);
+            MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(materialInfo.getCode());
+            if (Check.isNull(cutFrame)) {
+                String videoUrl = URLDecoder.decode(url).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
+                String loadImage = "cutFrame/" + materialInfo.getCode() + "/zero.jpg";
+                String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
+                materialInfo.setCoverUrl(coverUrl);
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        try {
+                            log.info("开始抽帧,code:{}", materialInfo.getCode());
+                            materialCutFrameService.getTencentCutFrame(videoUrl, materialInfo.getCode(), coverUrl);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                };
+                thread.start();
+            } else {
+                materialInfo.setCoverUrl(cutFrame.getUrl());
+            }
+
         }
 
         //  修改素材库 相关联code
@@ -653,5 +673,26 @@ public class MaterialInfoController {
         return result;
     }
 
+    /**
+     * adlab 新加查询素材库接口
+     */
+    @PostMapping(value = "/listByAccountIds")
+    public Result<IPage<MaterialInfo>> listByAccountIds(@RequestBody JSONObject requestBody) {
 
+        Result<IPage<MaterialInfo>> result = new Result<>();
+        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
+        if (!Check.isNull(requestBody.getString("userId"))) {
+            queryWrapper.eq("user_id", requestBody.getString("userId"));
+            List<Long> projects = memberService.getProjectByAccountIds(requestBody.getJSONArray("accountIds"));
+            if (!Check.isNull(projects)) {
+                queryWrapper.in("project_id", projects);
+            }
+        }
+        queryWrapper.orderByDesc(true, "create_time");
+        Page<MaterialInfo> page = new Page<>(requestBody.getInteger("pageNo"), requestBody.getInteger("pageSize"));
+        IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 }

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

@@ -0,0 +1,165 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.entity.MaterialTagInfo;
+import cn.com.ctop.common.module.service.IMaterialTagInfoService;
+import com.alibaba.fastjson.JSONObject;
+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;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+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.Map;
+
+/**
+ * 素材标签信息
+ * @author jeecg-boot
+ * @date   2020-08-27
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="素材标签信息")
+@RestController
+@RequestMapping("/ctop/materialTagInfo")
+public class MaterialTagInfoController {
+	@Autowired
+	private IMaterialTagInfoService materialTagInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param materialTagInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<MaterialTagInfo>> queryPageList(MaterialTagInfo materialTagInfo,
+                                                        @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                                        @RequestParam(name="pageSize", defaultValue="100") Integer pageSize,
+                                                        HttpServletRequest req) {
+		Result<IPage<MaterialTagInfo>> result = new Result<>();
+		QueryWrapper<MaterialTagInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialTagInfo, req.getParameterMap());
+		Page<MaterialTagInfo> page = new Page<>(pageNo, pageSize);
+		queryWrapper.eq("status",1);
+		IPage<MaterialTagInfo> pageList = materialTagInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	@GetMapping(value = "/detail")
+	public Map<String,Object> detailList(MaterialTagInfo materialTagInfo) {
+		return materialTagInfoService.getTagDetail(materialTagInfo);
+	}
+
+	/**
+	  *   添加
+	 * @param materialTagInfo
+	 * @return
+	 */
+	@ApiOperation(value="素材标签信息-添加", notes="素材标签信息-添加")
+	@PostMapping(value = "/add")
+	public Result<MaterialTagInfo> add(@RequestBody MaterialTagInfo materialTagInfo) {
+		Result<MaterialTagInfo> result = new Result<>();
+		try {
+			materialTagInfoService.save(materialTagInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param materialTagInfo
+	 * @return
+	 */
+	@ApiOperation(value="素材标签信息-编辑", notes="素材标签信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<MaterialTagInfo> edit(@RequestBody MaterialTagInfo materialTagInfo) {
+		Result<MaterialTagInfo> result = new Result<>();
+		MaterialTagInfo materialTagInfoEntity = materialTagInfoService.getById(materialTagInfo.getId());
+		if(materialTagInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = materialTagInfoService.updateById(materialTagInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="素材标签信息-通过id删除", notes="素材标签信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			materialTagInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="素材标签信息-批量删除", notes="素材标签信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<MaterialTagInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<MaterialTagInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			materialTagInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	@PostMapping("mark")
+	public Map<String,Object> mark(@RequestBody JSONObject data){
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		return materialTagInfoService.mark(data,user);
+	}
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="素材标签信息-通过id查询", notes="素材标签信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<MaterialTagInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<MaterialTagInfo> result = new Result<>();
+		MaterialTagInfo materialTagInfo = materialTagInfoService.getById(id);
+		if(materialTagInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(materialTagInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+}

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

@@ -48,7 +48,6 @@ public class MaterialUploadController {
             }
             LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-
             new Thread(() -> materialUploadService.uploadAccount(mediaId, materialArray, accountArray, sysUser.getId())).start();
             returnMap.put("success", true);
             returnMap.put("message", "开始上传文件");
@@ -58,11 +57,6 @@ public class MaterialUploadController {
             returnMap.put("success", false);
             returnMap.put("message", e.getMessage());
         }
-
-
         return returnMap;
-
     }
-
-
 }

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

@@ -0,0 +1,143 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.MusicKuaishouType;
+import cn.com.ctop.crawler.modules.music.service.IMusicKuaishouTypeService;
+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 lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 快手音乐类别
+ * @author jeecg-boot
+ * @date   2020-09-11
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="快手音乐类别")
+@RestController
+@RequestMapping("/ctop/musicKuaishouType")
+public class MusicKuaishouTypeController {
+	@Autowired
+	private IMusicKuaishouTypeService musicKuaishouTypeService;
+
+	/**
+	  * 分页列表查询
+	 * @param musicKuaishouType
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<MusicKuaishouType>> queryPageList(MusicKuaishouType musicKuaishouType,
+														  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														  HttpServletRequest req) {
+		Result<IPage<MusicKuaishouType>> result = new Result<>();
+		QueryWrapper<MusicKuaishouType> queryWrapper = QueryGenerator.initQueryWrapper(musicKuaishouType, req.getParameterMap());
+		Page<MusicKuaishouType> page = new Page<>(pageNo, pageSize);
+		IPage<MusicKuaishouType> pageList = musicKuaishouTypeService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param musicKuaishouType
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<MusicKuaishouType> add(@RequestBody MusicKuaishouType musicKuaishouType) {
+		Result<MusicKuaishouType> result = new Result<>();
+		try {
+			musicKuaishouTypeService.save(musicKuaishouType);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param musicKuaishouType
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<MusicKuaishouType> edit(@RequestBody MusicKuaishouType musicKuaishouType) {
+		Result<MusicKuaishouType> result = new Result<>();
+		MusicKuaishouType musicKuaishouTypeEntity = musicKuaishouTypeService.getById(musicKuaishouType.getId());
+		if(musicKuaishouTypeEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = musicKuaishouTypeService.updateById(musicKuaishouType);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			musicKuaishouTypeService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<MusicKuaishouType> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<MusicKuaishouType> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.musicKuaishouTypeService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<MusicKuaishouType> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<MusicKuaishouType> result = new Result<>();
+		MusicKuaishouType musicKuaishouType = musicKuaishouTypeService.getById(id);
+		if(musicKuaishouType==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(musicKuaishouType);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -1,337 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.entity.Advertiser;
-import cn.com.ctop.common.module.entity.Project;
-import cn.com.ctop.common.module.service.IProductService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
-
-import cn.com.ctop.common.module.vo.ProductInfoDto;
-import cn.com.ctop.common.module.vo.ProductVO;
-import cn.com.ctop.common.module.vo.ProjectVO;
-import cn.com.ctop.manage.modules.actor.entity.Actor;
-import cn.com.ctop.manage.modules.actor.entity.ActorComment;
-import cn.com.ctop.manage.modules.actor.entity.ActorPhoto;
-import cn.com.ctop.manage.modules.actor.entity.ActorVideo;
-import cn.com.ctop.manage.modules.actor.service.IActorCommentService;
-import cn.com.ctop.manage.modules.actor.service.IActorPhotoService;
-import cn.com.ctop.manage.modules.actor.service.IActorService;
-import cn.com.ctop.manage.modules.actor.service.IActorVideoService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.github.pagehelper.PageInfo;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-@RestController
-@Slf4j
-@RequestMapping("/ctop/product")
-public class ProductController {
-    @Autowired
-    private IProductService productService;
-
-    //获取广告主列表
-    @ResponseBody
-    @RequestMapping(value = "/advertiserList")
-    public Result<List<Advertiser>> advertiserList(HttpServletRequest request,HttpServletResponse response){
-        log.info("/ctop/product/advertiserList 方法开始");
-        Result<List<Advertiser>> result = new Result();
-
-        try {
-            List<Advertiser> advertiserList = productService.advertiserList();
-            result.setResult(advertiserList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/advertiserList 方法结束");
-        }
-
-        return result;
-    }
-
-    //根据广告主id获取项目列表
-    @ResponseBody
-    @RequestMapping(value = "/getProjectListByAdvertiserId")
-    public Result<List<Project>> getProjectListByAdvertiserId(@RequestBody ProductInfoDto dto,
-            HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProjectListByAdvertiserId 方法开始");
-        Result<List<Project>> result = new Result();
-        if(dto == null || dto.getAdvertiserId() ==null ){
-            result.setSuccess(false);
-            result.setMessage("advertiserId不能为空");
-            return result;
-        }
-
-        try {
-            List<Project> projectList = productService.getProjectListByAdvertiserId(dto.getAdvertiserId());
-            result.setResult(projectList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProjectListByAdvertiserId 方法结束");
-        }
-
-        return result;
-    }
-
-    //根据项目列表获取运营和销售的信息
-    @ResponseBody
-    @RequestMapping(value = "/getSaleAndYunyingListByProjectIds")
-    public Result<Map<String, Object>> getSaleAndYunyingListByProjectIds(@RequestBody ProductInfoDto dto,
-                                                              HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getSaleAndYunyingListByProjectIds 方法开始");
-        Result<Map<String, Object>> result = new Result();
-        if(dto == null || dto.getProjectIds() ==null || dto.getProjectIds().size() ==0 ){
-            result.setSuccess(false);
-            result.setMessage("projectIds不能为空");
-            return result;
-        }
-
-        try {
-            Map<String, Object> map = productService.getSaleAndYunyingListByProjectIds(dto.getProjectIds());
-            result.setResult(map);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getSaleAndYunyingListByProjectIds 方法结束");
-        }
-
-        return result;
-    }
-
-    //逻辑删除产品
-    @ResponseBody
-    @RequestMapping(value = "/deleteProduct")
-    public Result deleteProduct(@RequestBody ProductInfoDto dto,HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/deleteProduct 方法开始");
-        Result result = new Result();
-        if(dto == null || dto.getProductId() ==null ){
-            result.setSuccess(false);
-            result.setMessage("productId不能为空");
-            return result;
-        }
-
-        try {
-            productService.deleteProduct(dto.getProductId());
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/deleteProduct 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品信息入库
-    @ResponseBody
-    @RequestMapping(value = "/insertOrUpdateProduct")
-    public Result insertOrUpdateProduct(@RequestBody ProductVO vo, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/insertOrUpdateProduct 方法开始");
-        Result result = new Result();
-
-        //if(vo==null || vo.getId() == null){
-        //    if(StringUtils.isBlank(vo.getProductName())){
-        //        result.setSuccess(false);
-        //        result.setMessage("产品不能为空");
-        //        return result;
-        //    }
-        //    Integer count = productService.getProductNameCount(vo.getProductName());
-        //    if(count != 0){
-        //        result.setSuccess(false);
-        //        result.setMessage("产品名字已存在");
-        //        return result;
-        //    }
-        //}
-
-        try {
-            productService.insertOrUpdateProduct(vo);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/insertOrUpdateProduct 方法结束");
-        }
-
-        return result;
-    }
-
-    //编辑产品反显
-    @ResponseBody
-    @RequestMapping(value = "/getProductInfo")
-    public Result<Map<String, Object>> getProductInfo(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProductInfo 方法开始");
-        Result<Map<String, Object>> result = new Result();
-        if(dto==null || dto.getProductId() == null){
-            result.setSuccess(false);
-            result.setMessage("productId不能为空");
-            return result;
-        }
-
-        try {
-            Map<String, Object> productInfo = productService.getProductInfo(dto.getProductId());
-            result.setResult(productInfo);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProductInfo 方法结束");
-        }
-
-        return result;
-    }
-
-    //单独删除产品关联项目
-    @ResponseBody
-    @RequestMapping(value = "/deleteByProjectIdAndProductId")
-    public Result deleteByProjectIdAndProductId(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/deleteByProjectIdAndProductId 方法开始");
-        Result result = new Result();
-        if(dto==null || dto.getProductId() == null || dto.getProjectId() ==null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectId不能为空");
-            return result;
-        }
-
-        try {
-            productService.deleteByProjectIdAndProductId(dto.getProjectId(), dto.getProductId());
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/deleteByProjectIdAndProductId 方法结束");
-        }
-
-        return result;
-    }
-
-    //编辑产品按钮反显
-    @ResponseBody
-    @RequestMapping(value = "/getProjectListByProductId")
-    public Result<List<ProjectVO>> getProjectListByProductId(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProjectListByProductId 方法开始");
-        Result<List<ProjectVO>> result = new Result();
-        if(dto==null || dto.getProductId() == null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectId不能为空");
-            return result;
-        }
-
-        try {
-            List<ProjectVO> projectListByProductId = productService.getProjectListByProductId(dto.getProductId());
-            result.setResult(projectListByProductId);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProjectListByProductId 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品列表
-    @ResponseBody
-    @RequestMapping(value = "/getProductList")
-    public Result<PageInfo<ProductVO>> getProductList(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProductList 方法开始");
-        Result<PageInfo<ProductVO>> result = new Result();
-        if(dto==null || dto.getPageNum() == 0 || dto.getPageSize() ==0){
-            dto.setPageNum(1);
-            dto.setPageSize(10);
-        }
-
-        try {
-            PageInfo<ProductVO> productList = productService.getProductList(dto.getAdvertiserName(), dto.getProductName(), dto.getPageNum(), dto.getPageSize());
-            result.setResult(productList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProductList 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品列表
-    @ResponseBody
-    @RequestMapping(value = "/insertProductProjectMap")
-    public Result insertProductProjectMap(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/insertProductProjectMap 方法开始");
-        Result result = new Result();
-        if(dto==null || dto.getProductId() == null || dto.getProjectIds() == null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectIds不能为空");
-            return result;
-        }
-
-        List<Long> dtoProjectIds = dto.getProjectIds();
-        List<Long> projectIdsHas = productService.getProjectIdsByProductId(dto.getProductId());
-        List<Long> addProjectIds = new ArrayList<>();
-
-        for(Long dtoProjectId:dtoProjectIds){
-            int filter = 0;
-            for(Long projectIdHas:projectIdsHas){
-                if(projectIdHas.equals(dtoProjectId)){
-                    filter = -1;
-                    break;
-                }
-            }
-            if(filter == 0){
-                addProjectIds.add(dtoProjectId);
-            }
-        }
-
-        if(addProjectIds==null || addProjectIds.size()==0){
-            return result;
-        }
-
-        try {
-            productService.insertProductProjectMap(dto.getProductId(), addProjectIds);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/insertProductProjectMap 方法结束");
-        }
-
-        return result;
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-}

+ 20 - 38
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java

@@ -16,14 +16,12 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.entity.TransferAccount;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
-import org.jeecg.modules.system.entity.SysCategory;
 import org.jeecg.modules.system.service.ISysCategoryService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -195,9 +193,9 @@ public class ProjectController {
         } else if ("operator".equals(roleCode) || "operationAssistant".equals(roleCode)) {
             queryWrapper.eq("responsible_id", userId);
             pageList = projectService.page(page, queryWrapper);
-        }else{
+        } else {
             queryWrapper.eq("responsible_id", userId);
-            pageList = projectService.page(page,queryWrapper);
+            pageList = projectService.page(page, queryWrapper);
         }
         List<Project> records = pageList.getRecords();
         if (!Check.isNull(records)) {
@@ -239,33 +237,27 @@ public class ProjectController {
                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                 HttpServletRequest req) {
         Result<IPage<Project>> result = new Result<>();
-        String advertiserName = project.getAdvertiserName();
-        project.setAdvertiserName(null);
+
         String projectName = project.getProjectName();
         project.setProjectName(null);
-        String industryId = project.getIndustryId();
-        project.setIndustryId(null);
+
+
         QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
         Page<Project> page = new Page<>(pageNo, pageSize);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-        if (!(CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode))) {
-            queryWrapper.eq("user_id", sysUser.getId());
-            queryWrapper.orderByDesc("create_time");
-        }
-        if (null != industryId && !"".equals(industryId.trim())) {
-            SysCategory category = sysCategoryService.getById(industryId);
-            if (null != category) {
-                queryWrapper.likeRight("industry_code", category.getCode());
-            }
-        }
-        if (!Check.isNull(advertiserName)) {
-            queryWrapper.like("advertiser_name", advertiserName);
+        if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+            queryWrapper.eq("responsible_id", sysUser.getId());
 
+        } else if ("plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode) || "clip".equals(roleCode) || "designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode)) {
+            queryWrapper.eq("design_responsible_id", sysUser.getId());
         }
+
         if (!Check.isNull(projectName)) {
             queryWrapper.like("project_name", projectName);
         }
+        queryWrapper.orderByDesc("create_time");
+
         IPage<Project> pageList = projectService.page(page, queryWrapper);
         List<Project> records = pageList.getRecords();
         if (!Check.isNull(records)) {
@@ -310,23 +302,22 @@ public class ProjectController {
             if (!Check.isNull(advertiser)) {
                 project.setCompanyId(advertiser.getCompanyId());
             }
-            SysCategory category = sysCategoryService.getById(project.getIndustryId());
+          /*  SysCategory category = sysCategoryService.getById(project.getIndustryId());
             if (null != category) {
                 project.setIndustryCode(category.getCode());
                 project.setIndustryId(category.getId());
-            }
+            }*/
             SysUser sysUser = sysUserService.getById(project.getResponsibleId());
             if (!Check.isNull(sysUser)) {
-                project.setResponsibleName(sysUser.getRealname());
+                //  project.setResponsibleName(sysUser.getRealname());
                 memberMap.put(sysUser.getId(), sysUser.getRealname());
             }
 
             SysUser designSysUser = sysUserService.getById(project.getDesignResponsibleId());
             if (!Check.isNull(designSysUser)) {
-                project.setDesignResponsibleName(designSysUser.getRealname());
+                // project.setDesignResponsibleName(designSysUser.getRealname());
                 memberMap.put(designSysUser.getId(), designSysUser.getRealname());
             }
-
             projectService.save(project);
 
             Long id = project.getId();
@@ -339,7 +330,6 @@ public class ProjectController {
                 projectMemberService.removeByMap(map);
                 ProjectMember member = new ProjectMember();
                 member.setProjectId(id);
-                member.setProjectName(project.getProjectName());
                 member.setUserId(userId);
                 member.setUserName(userName);
                 String roleCode = sysRoleService.getRoleCodeByUserId(userId);
@@ -374,18 +364,18 @@ public class ProjectController {
         Result<Project> result = new Result<>();
         SysUser sysUser = sysUserService.getById(project.getResponsibleId());
         if (!Check.isNull(sysUser)) {
-            project.setResponsibleName(sysUser.getRealname());
+            //     project.setResponsibleName(sysUser.getRealname());
             projectMemberService.addMember(sysUser, project);
         }
 
-        SysCategory category = sysCategoryService.getById(project.getIndustryId());
+       /* SysCategory category = sysCategoryService.getById(project.getIndustryId());
         if (null != category) {
             project.setIndustryCode(category.getCode());
             project.setIndustryId(category.getId());
-        }
+        }*/
         SysUser designSysUser = sysUserService.getById(project.getDesignResponsibleId());
         if (!Check.isNull(designSysUser)) {
-            project.setDesignResponsibleName(designSysUser.getRealname());
+            //      project.setDesignResponsibleName(designSysUser.getRealname());
             projectMemberService.addMember(designSysUser, project);
         }
         Project projectEntity = projectService.getById(project.getId());
@@ -393,20 +383,12 @@ public class ProjectController {
             result.error500("未找到对应实体");
         } else {
             boolean ok = projectService.updateById(project);
-
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             memberQueryWrapper.eq("project_id", project.getId());
             ProjectMember updateMember = new ProjectMember();
             updateMember.setProjectName(project.getProjectName());
             projectMemberService.update(updateMember, memberQueryWrapper);
 
-            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-            userAllocationQueryWrapper.eq("project_id", project.getId());
-            UserAllocation updateUserAllocation = new UserAllocation();
-            updateUserAllocation.setProjectName(project.getProjectName());
-            // updateUserAllocation.setMediaId(project.getMediaId());
-            userAllocationService.update(updateUserAllocation, userAllocationQueryWrapper);
-
             if (!projectEntity.getSupplierCode().equals(project.getSupplierCode())) {
                 QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
                 materialInfoQueryWrapper.eq("project_id", project.getId());

+ 118 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -1,10 +1,16 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.entity.Advertiser;
+import cn.com.ctop.common.module.entity.Product;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.SysUser;
+import cn.com.ctop.common.module.service.IProductService;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -18,6 +24,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
+import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,6 +55,10 @@ public class ProjectMemberController {
     private ISysRoleExtService sysRoleService;
     @Autowired
     private ISysUserService sysUserService;
+    @Autowired
+    private IAdvertiserService advertiserService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
 
 
     /**
@@ -82,6 +93,8 @@ public class ProjectMemberController {
      * @param userId
      * @return
      */
+
+
     @GetMapping(value = "/participateList")
     public Map<String, Object> participateList(String userId) {
         Map<String, Object> map = new HashMap<>();
@@ -102,9 +115,20 @@ public class ProjectMemberController {
                     }
                     Project project = projectService.getById(projectMember.getProjectId());
                     if (!Check.isNull(project)) {
-                        projectMember.setResponsibleName(project.getResponsibleName());
-                        projectMember.setDesignResponsibleName(project.getDesignResponsibleName());
-                        projectMember.setAdvertiserName(project.getAdvertiserName());
+                        SysUser responsible = sysUserService.getById(project.getResponsibleId());
+
+                        projectMember.setResponsibleName(responsible.getRealname());
+                        SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
+                        projectMember.setDesignResponsibleName(designResponsible.getRealname());
+
+                        projectMember.setProjectName(project.getProjectName());
+                        Product product = productService.getById(project.getProductId());
+                        if (!Check.isNull(product)) {
+                            projectMember.setProductId(product.getId());
+                            projectMember.setProductName(product.getProductName());
+                        }
+                        Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
+                        projectMember.setAdvertiserName(advertiser.getName());
                         projectMember.setAdvertiserId(project.getAdvertiserId());
                         projectMember.setMediaId(project.getMediaId());
                         projectMember.setMaxBid(project.getMaxBid());
@@ -120,11 +144,82 @@ public class ProjectMemberController {
             map.put("success", false);
             map.put("code", -1);
         }
-
         return map;
     }
 
 
+    @PostMapping(value = "/participateListByMediaId")
+    public Result<List<JSONObject>> participateListByMediaId(@RequestBody JSONObject requestJson) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            String userId = requestJson.getString("userId");
+            if (Check.isNull(userId)) {
+                throw new Exception("请选择userId");
+            }
+            List<Integer> mediaIds = new ArrayList<>();
+            String type = requestJson.getString("type");
+            if ("kuaishou".equals(type)) {
+                mediaIds.add(2);
+                mediaIds.add(4);
+            } else if ("bytedance".equals(type)) {
+                mediaIds.add(1);
+                mediaIds.add(3);
+            }
+            if (Check.isNull(mediaIds)) {
+                throw new Exception("请选择媒体类型");
+            }
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+                userId = null;
+            }
+            List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
+            if (!Check.isNull(projectList)) {
+                for (int i = 0; i < projectList.size(); i++) {
+                    JSONObject project = projectList.get(i);
+                    List<JSONObject> accountList = userAllocationService.getAccountListByProject(project.getLong("projectId"));
+                    if (!Check.isNull(accountList)) {
+                        project.put("accountList", accountList);
+                    }
+                }
+            }
+            result.setSuccess(true);
+            result.setResult(projectList);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    @GetMapping("/projectList")
+    public Map<String, Object> projectList() {
+        Map<String, Object> result = new HashMap<>();
+        try {
+            String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+                List<Project> projects = projectService.list();
+                result.put("data", projects);
+                ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+                return result;
+            }
+            List<Project> projects = projectMemberService.selectListByUserId(userId);
+            result.put("data", projects);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+            return result;
+        } catch (Exception e) {
+            e.printStackTrace();
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+    }
+
+    @Autowired
+    private IProductService productService;
+
     @GetMapping(value = "/participateListV2")
     public Result<IPage<ProjectMember>> participateListV2(ProjectMember projectMember,
                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -137,7 +232,6 @@ public class ProjectMemberController {
             result.setSuccess(false);
             result.setMessage("未获取到用户信息");
             return result;
-
         }
         String projectName = projectMember.getProjectName();
         projectMember.setUserId(null);
@@ -166,9 +260,19 @@ public class ProjectMemberController {
                 }
                 Project project = projectService.getById(member.getProjectId());
                 if (!Check.isNull(project)) {
-                    member.setResponsibleName(project.getResponsibleName());
-                    member.setDesignResponsibleName(project.getDesignResponsibleName());
-                    member.setAdvertiserName(project.getAdvertiserName());
+                    SysUser responsible = sysUserService.getById(project.getResponsibleId());
+                    member.setResponsibleName(responsible.getRealname());
+                    SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
+                    member.setDesignResponsibleName(designResponsible.getRealname());
+                    Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
+                    member.setProjectName(project.getProjectName());
+                    Product product = productService.getById(project.getProductId());
+                    if (!Check.isNull(product)) {
+                        member.setProductId(product.getId());
+                        member.setProductName(product.getProductName());
+                    }
+                    member.setAdvertiserName(advertiser.getName());
+                    member.setAdvertiserId(project.getAdvertiserId());
                     member.setAdvertiserId(project.getAdvertiserId());
                     member.setMediaId(project.getMediaId());
                     member.setMaxBid(project.getMaxBid());
@@ -222,6 +326,9 @@ public class ProjectMemberController {
                 throw new Exception("入参不能为空");
             }
             Long projectId = jsonObject.getLong("projectId");
+            if (Check.isNull(projectId)) {
+                throw new Exception("请选择项目");
+            }
             String projectName = jsonObject.getString("projectName");
             JSONArray memberArr = jsonObject.getJSONArray("memberArr");
             if (Check.isNull(memberArr)) {
@@ -268,7 +375,7 @@ public class ProjectMemberController {
      * @param projectMember
      * @return
      */
-    @PostMapping(value = "/add")
+   /* @PostMapping(value = "/add")
     public Result<ProjectMember> add(@RequestBody ProjectMember projectMember) {
         Result<ProjectMember> result = new Result<>();
         try {
@@ -279,7 +386,7 @@ public class ProjectMemberController {
             result.error500("操作失败");
         }
         return result;
-    }
+    }*/
 
     /**
      * 编辑
@@ -389,7 +496,7 @@ public class ProjectMemberController {
         Result<List<Map<String, Object>>> resultBody = new Result<>();
         try {
             String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
-            List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId,mediaType);
+            List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId, mediaType);
             resultBody.setSuccess(true);
             resultBody.setResult(result);
         } catch (Exception e) {

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

@@ -1,20 +1,28 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.entity.TagCategoryInfo;
 import cn.com.ctop.common.module.entity.TagInfo;
 import cn.com.ctop.common.module.model.TagInfoTreeModel;
+import cn.com.ctop.common.module.service.ITagCategoryInfoService;
 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.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.system.service.ISysDepartService;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.system.model.TagInfoTree;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
  /**
@@ -30,6 +38,72 @@ public class TagInfoController {
 	@Autowired
 	private ITagInfoService tagInfoService;
 
+	 /**
+	  * 加载数据节点
+	  *
+	  * @return
+	  */
+	 @RequestMapping(value = "/treeList", method = RequestMethod.GET)
+	 public Result<IPage<TagInfo>> list(@RequestParam(defaultValue = "10")Integer pageSize,@RequestParam(defaultValue = "1")Integer pageNo) {
+		 Result<IPage<TagInfo>> result = new Result<>();
+		 try {
+			QueryWrapper<TagInfo> query = new QueryWrapper<>();
+		 	query.eq("del_flag", CommonConstant.DEL_FLAG_0);
+		 	query.eq("level",1);
+		 	query.orderByAsc("tag_order");
+		 	Page<TagInfo> page = new Page<>(pageNo, pageSize);
+		 	IPage<TagInfo> pageList = tagInfoService.page(page,query);
+		 	List<TagInfo>recordsLevel1 = pageList.getRecords();
+
+			 List<TagInfo>setRecordsLevel1 = new ArrayList<>();
+			 if(null!=recordsLevel1&&!recordsLevel1.isEmpty()){
+		 		for (TagInfo level1tag:recordsLevel1) {
+					if(!level1tag.isLeaf()){
+						//非叶子节点
+						List<TagInfo>recordsLevel2 = tagInfoService.getByParentId(level1tag.getId());
+						List<TagInfo>setRecordsLevel2 = new ArrayList<>();
+						if(null!=recordsLevel2&&!recordsLevel2.isEmpty()){
+							for(TagInfo level2Tag:recordsLevel2){
+								if(!level2Tag.isLeaf()){
+									List<TagInfo>recordsLevel3 = tagInfoService.getByParentId(level2Tag.getId());
+									level2Tag.setChildren(recordsLevel3);
+								}
+								setRecordsLevel2.add(level2Tag);
+							}
+						}
+						level1tag.setChildren(setRecordsLevel2);
+					}
+					setRecordsLevel1.add(level1tag);
+				}
+			}
+			pageList.setRecords(setRecordsLevel1);
+		 	result.setSuccess(true);
+		 	result.setResult(pageList);
+		 } catch (Exception e) {
+			 log.error(e.getMessage(), e);
+		 }
+		 return result;
+	 }
+
+	 private void getTreeList(List<TagInfoTree> treeList, List<TagInfo> metaList, TagInfoTree temp) {
+		 for (TagInfo tagInfo : metaList) {
+			 Long tempPid = tagInfo.getParentId();
+			 TagInfoTree tree = new TagInfoTree(tagInfo);
+			 if (temp == null && oConvertUtils.isEmpty(tempPid)) {
+				 treeList.add(tree);
+				 if (!tree.isLeaf()) {
+					 getTreeList(treeList, metaList, tree);
+				 }
+			 } else if (temp != null && tempPid != null && tempPid.equals(temp.getId())) {
+				 temp.getChildren().add(tree);
+				 if (!tree.isLeaf()) {
+					 getTreeList(treeList, metaList, tree);
+				 }
+			 }
+
+		 }
+	 }
+
 	/**
 	  * 分页列表查询
 	 * @param tagInfo
@@ -39,28 +113,67 @@ public class TagInfoController {
 	 * @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,
+	public Result<IPage<TagInfo>> queryPageList(TagInfo tagInfo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="100") Integer pageSize,
 												HttpServletRequest req) {
 		Result<IPage<TagInfo>> result = new Result<>();
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		QueryWrapper<TagInfo> queryWrapper = QueryGenerator.initQueryWrapper(tagInfo, req.getParameterMap());
 		Page<TagInfo> page = new Page<>(pageNo, pageSize);
+		queryWrapper.eq("del_flag",0);
 		IPage<TagInfo> pageList = tagInfoService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
 
-	/**
-	  *   添加
-	 * @param tagInfo
-	 * @return
-	 */
+	@Autowired
+	private ITagCategoryInfoService tagCategoryInfoService;
 	@PostMapping(value = "/add")
 	public Result<TagInfo> add(@RequestBody TagInfo tagInfo) {
 		Result<TagInfo> result = new Result<>();
 		try {
+			TagCategoryInfo categoryInfo = tagCategoryInfoService.getById(tagInfo.getTagCategoryId());
+			if(null!=categoryInfo){
+				tagInfo.setTagCategoryName(categoryInfo.getName());
+			}
+			TagInfo getTag = tagInfoService.getByTagCode(tagInfo.getTagCode());
+			if(null!=getTag){
+				result.error500("标签编码已存在");
+				return result;
+			}
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			tagInfo.setDelFlag(0);
+			if(null == tagInfo.getStatus()){
+				tagInfo.setStatus(1);
+			}
+			tagInfo.setUserId(user.getId());
+
+			int level = 1;
+			Long parentId = tagInfo.getParentId();
+			if(null!=parentId){
+				TagInfo parentTag = tagInfoService.getById(parentId);
+				if(null == parentTag){
+					result.error500("父级标签不存在");
+					return result;
+				}
+				String tagCode = parentTag.getTagCode()+tagInfo.getTagCode();
+				TagInfo getTag2 = tagInfoService.getByTagCode(tagCode);
+				if(null!=getTag2){
+					result.error500("标签编码已存在");
+					return result;
+				}
+				tagInfo.setTagCategoryId(parentTag.getTagCategoryId());
+				if(parentTag.getLevel() == 1){
+					tagInfo.setFirstTagId(parentTag.getId());
+				}
+				if(parentTag.getLevel() == 2){
+					tagInfo.setSecendTagId(parentTag.getId());
+					tagInfo.setFirstTagId(parentTag.getParentId());
+				}
+				level = parentTag.getLevel()+1;
+				tagInfo.setTagCode(tagCode);
+			}
+			tagInfo.setLevel(level);
 			tagInfoService.save(tagInfo);
 			result.success("添加成功!");
 		} catch (Exception e) {
@@ -75,13 +188,14 @@ public class TagInfoController {
 	 * @param tagInfo
 	 * @return
 	 */
-	@PutMapping(value = "/edit")
+	@PostMapping("/edit")
 	public Result<TagInfo> edit(@RequestBody TagInfo tagInfo) {
-		Result<TagInfo> result = new Result<TagInfo>();
+		Result<TagInfo> result = new Result<>();
 		TagInfo tagInfoEntity = tagInfoService.getById(tagInfo.getId());
 		if(tagInfoEntity==null) {
 			result.error500("未找到对应实体");
 		}else {
+			tagInfo.setUpdateTime(new Date());
 			boolean ok = tagInfoService.updateById(tagInfo);
 			if(ok) {
 				result.success("修改成功!");
@@ -92,22 +206,6 @@ public class TagInfoController {
 	}
 
 	/**
-	  *   通过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
@@ -142,13 +240,12 @@ public class TagInfoController {
 		return result;
 	}
 
-	@Autowired
-    private ISysDepartService sysDepartService;
 	@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
-    public Result<List<TagInfoTreeModel>> queryTreeList() {
+    public Result<List<TagInfoTreeModel>> queryTreeList(@RequestParam(name = "categoryId",defaultValue = "0")Long categoryId) {
 	    Result<List<TagInfoTreeModel>> result = new Result<>();
 	    try {
-            List<TagInfoTreeModel> list = tagInfoService.queryTreeList();
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            List<TagInfoTreeModel> list = tagInfoService.queryTreeList(user.getId(),categoryId);
 	        result.setResult(list);
 	        result.setSuccess(true);
 	    } catch (Exception e) {

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

@@ -5,6 +5,9 @@ import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.common.module.vo.ResFileDTO;
+import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
+import cn.com.ctop.crawler.modules.core.service.CrawlerDouyinMusicTaskService;
+import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -71,11 +74,141 @@ public class TestController {
     private IKuaishouInterfaceService2 kuaishouInterfaceService2;
     @Autowired
     private IUserAllocationService userAllocationService;
+    @Autowired
+    private DouyinMusicService douyinMusicService;
+    @Autowired
+    private CrawlerDouyinMusicTaskService crawlerDouyinMusicTaskService;
+    @Autowired
+    private MusicInfoService musicInfoService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(15);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
-    static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
+    static ExecutorService suzhaoService = Executors.newFixedThreadPool(10);
+
+
+    @GetMapping(value = "/dailyReport")
+    public void dailyReport() {
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取快手数据异常:未获取到可用的token");
+        }
+        for (CtopOauthToken token : tokens) {
+            dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), "2020-09-20");
+        }
+    }
+
+    @GetMapping(value = "/getMd5")
+    public void getMd5() {
+        kuaiShouHistoryReportTaskService.getMd5(null, null);
+
+    }
+
+    @GetMapping(value = "/getGroupReport")
+    public void getGroupReport() throws ParseException {
+        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse1 = simpleDateFormat.parse("2020-09-12");
+        Date parse2 = simpleDateFormat.parse("2020-09-17");
+        for (CtopOauthToken token : tokens) {
+
+            suzhaoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    //1: 获取广告主信息数据
+                    kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse1, parse2);
+                }
+            });
+
+
+        }
+    }
+
+
+    @GetMapping(value = "/syncDouyinMusicAsc")
+    public String syncDouyinMusicAsc() {
+        QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("status", "init").orderByAsc("id").last(" limit 20");
+
+        List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+
+        while (list != null) {
+            for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                MusicInfo musicInfo = new MusicInfo();
+                musicInfo.setExtId(crawlerDouyinMusicTask.getId());
+                musicInfo = douyinMusicService.getMusicInfo(musicInfo);
+                musicInfoService.save(musicInfo);
+                crawlerDouyinMusicTask.setStatus("done");
+                crawlerDouyinMusicTaskService.updateById(crawlerDouyinMusicTask);
+            }
+            list = crawlerDouyinMusicTaskService.list(queryWrapper);
+        }
+        return "success";
+    }
+
+    @GetMapping(value = "/syncDouyinMusic")
+    public String syncDouyinMusic() {
+        for (int i = 0; i < 10; i++) {
+            final int j = i;
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("status", "init").likeLeft("id", j).orderByDesc("id").last(" limit 20");
+                    List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    while (list != null) {
+                        log.info("【同步歌曲】第" + j + "线程正在处理:" + list.size() + "条数据");
+                        for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                            MusicInfo musicInfo = new MusicInfo();
+                            musicInfo.setExtId(crawlerDouyinMusicTask.getId());
+                            douyinMusicService.getMusicInfo(musicInfo);
+                        }
+                        list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    }
+                }
+            };
+            thread.start();
+        }
+
+        return "success";
+    }
+
+    @GetMapping(value = "/parseDouyinMusic")
+    public String parseDouyinMusic() {
+        for (int i = 0; i < 10; i++) {
+            final int j = i;
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("status", "done").likeLeft("id", j).orderByDesc("id").last(" limit 20");
+                    List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    while (list != null) {
+                        log.info("【解析分类】第" + j + "线程正在处理:" + list.size() + "条数据");
+                        for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                            QueryWrapper<MusicInfo> queryWrapper1 = new QueryWrapper<>();
+                            queryWrapper1.eq("ext_id", crawlerDouyinMusicTask.getId()).last(" limit 1");
+                            MusicInfo musicInfo = musicInfoService.getOne(queryWrapper1);
+                            if (musicInfo != null) {
+                                douyinMusicService.parseTag(musicInfo);
+                            }
+                        }
+                        list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    }
+                }
+            };
+            thread.start();
+        }
+
+        return "success";
+    }
 
+    @GetMapping(value = "/testdouyinmusic")
+    public String testDouyinMusic() {
+        douyinMusicService.getHotMusicList();
+        return "success";
+    }
 
     @GetMapping(value = "/getDailyDataByProjectId")
     public String getDailyDataByProjectId(Long projectId, String startDate, String endDate) {
@@ -84,7 +217,7 @@ public class TestController {
 
             QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
             userAllocationQueryWrapper.eq("project_id", projectId);
-            userAllocationQueryWrapper.eq("account_status", 0);
+            // userAllocationQueryWrapper.eq("account_status", 0);
             List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
             if (!Check.isNull(list)) {
                 for (UserAllocation allocation : list) {
@@ -110,6 +243,39 @@ public class TestController {
     }
 
 
+    @GetMapping(value = "/getHistoryDataByProjectId")
+    public String getHistoryDataByProjectId(Long projectId, String startDate, String endDate) {
+        Result<String> result = new Result<>();
+        try {
+
+            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+            userAllocationQueryWrapper.eq("project_id", projectId);
+            // userAllocationQueryWrapper.eq("account_status", 0);
+            List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
+            if (!Check.isNull(list)) {
+                for (UserAllocation allocation : list) {
+                    Long accountId = allocation.getAccountId();
+                    QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
+                    tokenQueryWrapper.eq("media_id", 2);
+                    tokenQueryWrapper.eq("account_id", accountId);
+                    CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
+                    if (!Check.isNull(ctopOauthTokens)) {
+                        historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+
+                    }
+                }
+
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return "success";
+    }
+
+
     @GetMapping(value = "/getDailyDataByAccountId")
     public String getDailyDataByAccountId(Long accountId) {
         Result<String> result = new Result<>();

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

@@ -15,6 +15,7 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.ctop.entity.UReportFile;
 import org.jeecg.modules.ctop.entity.UReportFileBindUser;
 import org.jeecg.modules.ctop.service.IUReportFileBindUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -207,4 +209,28 @@ public class UReportFileBindUserController {
         }
         return result;
     }
+
+
+    /**
+     *  订阅按钮
+     */
+    @PostMapping(value = "/subscribe")
+    public Result subscribe(@RequestParam(name = "fileId") String fileId) {
+        Result<UReportFile> result = new Result<>();
+        QueryWrapper<UReportFileBindUser> queryWrapper=new QueryWrapper();
+        queryWrapper.eq("file_id",fileId);
+        queryWrapper.ne("user_id","e9ca23d68d884d4ebb19d07889727dae");
+        List<UReportFileBindUser> uReportFileBindUser = uReportFileBindUserService.list(queryWrapper);
+        if (uReportFileBindUser.isEmpty()) {
+            result.error500("请绑定用户后订阅");
+        } else {
+            uReportFileBindUser.forEach(it->it.setIsSubscribe(true));
+            boolean ok = uReportFileBindUserService.updateBatchById(uReportFileBindUser);
+            if (ok) {
+                result.success("订阅成功!");
+            }
+        }
+        return result;
+    }
+
 }

+ 1 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileController.java

@@ -5,21 +5,18 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.bstek.ureport.export.ExportManager;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.ctop.entity.UReportFile;
-import org.jeecg.modules.ctop.entity.UReportFileBindUser;
 import org.jeecg.modules.ctop.service.IUReportFileService;
 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;
 import java.util.Map;
 
 /**
@@ -193,4 +190,5 @@ public class UReportFileController {
         }
         return result;
     }
+
 }

+ 4 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java

@@ -82,10 +82,8 @@ public class UserAllocationController {
             }
             userAllocations.setAccountStatus(1);
             userAllocations.setProjectId(projectId);
-            userAllocations.setProjectName(project.getProjectName());
             userAllocations.setMediaId(project.getMediaId());
             userAllocations.setAdvertiserId(project.getAdvertiserId());
-            userAllocations.setAdvertiserName(project.getAdvertiserName());
             userAllocationService.save(userAllocations);
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             memberQueryWrapper.eq("user_id", userAllocations.getUserId());
@@ -266,15 +264,15 @@ public class UserAllocationController {
             result.error500("未找到对应实体");
         } else {
             boolean ok = userAllocationService.updateById(userAllocation);
+            UserAllocation update = userAllocationService.getById(userAllocation.getId());
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
-            memberQueryWrapper.eq("user_id", userAllocation.getUserId());
-            memberQueryWrapper.eq("project_id", userAllocation.getProjectId());
+            memberQueryWrapper.eq("user_id", update.getUserId());
+            memberQueryWrapper.eq("project_id", update.getProjectId());
             memberQueryWrapper.last("limit 1");
             ProjectMember member = memberMapper.selectOne(memberQueryWrapper);
             if (Check.isNull(member)) {
                 ProjectMember addMember = new ProjectMember();
                 addMember.setProjectId(userAllocation.getProjectId());
-                addMember.setProjectName(userAllocation.getProjectName());
                 addMember.setUserId(userAllocation.getUserId());
                 addMember.setUserName(userAllocation.getUserName());
                 String roleCode = sysRoleService.getRoleCodeByUserId(userAllocation.getUserId());
@@ -284,7 +282,6 @@ public class UserAllocationController {
                 projectMemberService.save(addMember);
             }
 
-
             if (ok) {
                 result.success("修改成功!");
             }
@@ -362,7 +359,7 @@ public class UserAllocationController {
     public Result<List<UserAllocation>> selectAccountListByProjectId(Long projectId) {
         Result<List<UserAllocation>> result = new Result<>();
         try {
-            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
             result.setSuccess(true);
             result.setResult(userAllocations);
         } catch (Exception e) {

+ 0 - 126
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java

@@ -1,126 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import cn.com.ctop.common.module.annotation.Dict;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * 广告主信息表
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-06-11
- */
-@Data
-@TableName("ctop_advertiser")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_advertiser对象", description = "广告主信息表")
-public class Advertiser {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.UUID)
-    @ApiModelProperty(value = "主键ID")
-    private String id;
-    /**
-     * 广告主名称
-     */
-    @Excel(name = "广告主名称", width = 15)
-    @ApiModelProperty(value = "广告主名称")
-    private String name;
-    /**
-     * 行业ID
-     */
-    @Excel(name = "行业ID", width = 15)
-    @ApiModelProperty(value = "行业ID")
-    @Dict(dicCode = "id",dictTable="sys_category",dicText="name")
-    private String industryId;
-    private String industryCode;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "销售ID", width = 15)
-    @ApiModelProperty(value = "销售ID")
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-    private String saleId;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "广告主类别", width = 15)
-    @ApiModelProperty(value = "广告主类别")
-    private Integer advertiserType;
-
-    /**
-     * 代理商Id
-     */
-    private Long agentId;
-
-    /**
-     * 联系人姓名
-     */
-    @Excel(name = "联系人姓名", width = 15)
-    @ApiModelProperty(value = "联系人姓名")
-    private String contact;
-    /**
-     * 联系人手机
-     */
-    @Excel(name = "联系人手机", width = 15)
-    @ApiModelProperty(value = "联系人手机")
-    private String mobile;
-    /**
-     * 联系人邮箱
-     */
-    @Excel(name = "联系人邮箱", width = 15)
-    @ApiModelProperty(value = "联系人邮箱")
-    private String email;
-    /**
-     * 创建人
-     */
-    @Excel(name = "创建人", width = 15)
-    @ApiModelProperty(value = "创建人")
-    private String createBy;
-    /**
-     * 创建时间
-     */
-    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-    /**
-     * 修改人
-     */
-    @Excel(name = "修改人", width = 15)
-    @ApiModelProperty(value = "修改人")
-    private String updateBy;
-    /**
-     * 修改时间
-     */
-    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-    private String userId;
-
-    private String companyId;
-
-    @TableField(exist = false)
-    private String saleName;
-
-
-}

+ 55 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/JhsBakendData.java

@@ -0,0 +1,55 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+
+import java.util.Date;
+
+/**
+ * 聚划算后端数据
+ * @author jeecg-boot
+ * @date   2020-09-07
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_jhs_bakend_data")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class JhsBakendData {
+
+	@TableId
+	private String id;
+	private String stateDate;
+	private String productLine;
+	private String taskName;
+	private String clientName;
+	private String channelId;
+	private String channelName;
+	private String adId;
+	private Long pageView;
+	private Long dealNumber;
+	private Date createTime;
+	private Date updateTime;
+
+	public JhsBakendData(JhsBakendDataEntity dataEntity) {
+		this.adId = dataEntity.getAdId();
+		this.stateDate = dataEntity.getStateDate();
+		this.productLine = dataEntity.getProductLine();
+		this.taskName = dataEntity.getTaskName();
+		this.clientName = dataEntity.getClientName();
+		this.channelId = dataEntity.getChannelId();
+		this.channelName = dataEntity.getChannelName();
+		this.pageView = dataEntity.getPageView();
+		this.dealNumber = dataEntity.getDealNumber();
+		this.updateTime = new Date();
+		this.createTime = new Date();
+		this.id = adId+stateDate;
+	}
+
+	public JhsBakendData() {
+	}
+}

+ 10 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java

@@ -28,7 +28,7 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @ApiModel(value = "ctop_project_member对象", description = "项目成员")
-public class ProjectMember implements  Serializable{
+public class ProjectMember implements Serializable {
 
     /**
      * id
@@ -47,6 +47,8 @@ public class ProjectMember implements  Serializable{
     @Excel(name = "项目名称", width = 15)
     @ApiModelProperty(value = "项目名称")
     private String projectName;
+
+
     /**
      * 成员id
      */
@@ -73,6 +75,7 @@ public class ProjectMember implements  Serializable{
 
     @TableField(exist = false)
     private String advertiserName;
+
     @TableField(exist = false)
     private String advertiserId;
 
@@ -86,6 +89,12 @@ public class ProjectMember implements  Serializable{
     @TableField(exist = false)
     private String saleName;
 
+    @TableField(exist = false)
+    private Long productId;
+
+    @TableField(exist = false)
+    private String productName;
+
 
     /**
      * 创建时间

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AdvertiserMapper.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.mapper;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
 import org.jeecg.modules.excelutil.entity.YdPlanAggregateEntity;
 import org.jeecg.modules.excelutil.entity.YdWeekAggregateEntity;
@@ -13,7 +13,7 @@ import java.util.List;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 public interface AdvertiserMapper extends BaseMapper<Advertiser> {

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/JhsBakendDataMapper.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.ctop.entity.JhsBakendData;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+
+import java.util.List;
+
+/**
+ * 聚划算后端数据
+ * @author: jeecg-boot
+ * @date:   2020-09-07
+ * @cersion: V1.0
+ */
+public interface JhsBakendDataMapper extends BaseMapper<JhsBakendData> {
+
+    void replaceData(@Param(value = "bakendData") JhsBakendData getData);
+
+    void replaceBatch(@Param(value = "datas")List<JhsBakendDataEntity> datas);
+}

+ 9 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java

@@ -1,11 +1,13 @@
 package org.jeecg.modules.ctop.mapper;
 
+import cn.com.ctop.common.module.entity.Project;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 项目成员
@@ -36,4 +38,10 @@ public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
     List<ProjectMember> getSaleProjects(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
 
     List<Long> getProjectByMap(@Param("userId") String userId);
+
+    List<Project> getProjectByUserId(@Param("userId")String userId);
+
+    List<Long> getProjectByAccountIds(@Param("accountIds")JSONArray accountIds);
+
+    List<JSONObject> getProjectByUserIdAndMediaIds(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 }

+ 60 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/JhsBakendDataMapper.xml

@@ -0,0 +1,60 @@
+<?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="org.jeecg.modules.ctop.mapper.JhsBakendDataMapper">
+
+    <insert id="replaceData">
+        REPLACE INTO
+            ctop_jhs_bakend_data
+            (id,state_date,
+            product_line,
+            task_name,
+            client_name,
+            channel_id,
+            channel_name,
+            ad_id,
+            page_view,
+            deal_number)
+            VALUES(
+                #{bakendData.id},
+                #{bakendData.stateDate},
+                #{bakendData.productLine},
+                #{bakendData.taskName},
+                #{bakendData.clientName},
+                #{bakendData.channelId},
+                #{bakendData.channelName},
+                #{bakendData.adId},
+                #{bakendData.pageView},
+                #{bakendData.dealNumber}
+                )
+    </insert>
+    <insert id="replaceBatch">
+        REPLACE INTO
+        ctop_jhs_bakend_data
+        (id,state_date,
+        product_line,
+        task_name,
+        client_name,
+        channel_id,
+        channel_name,
+        ad_id,
+        page_view,
+        vistor,
+        deal_number)
+            values
+            <foreach collection="datas" item="bakendData" separator=",">
+                (
+                '${bakendData.adId}${bakendData.stateDate}${bakendData.clientName}${bakendData.channelId}',
+                #{bakendData.stateDate},
+                #{bakendData.productLine},
+                #{bakendData.taskName},
+                #{bakendData.clientName},
+                #{bakendData.channelId},
+                #{bakendData.channelName},
+                #{bakendData.adId},
+                #{bakendData.pageView},
+                #{bakendData.vistor},
+                #{bakendData.dealNumber}
+                )
+            </foreach>
+    </insert>
+</mapper>

+ 62 - 10
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml

@@ -12,22 +12,26 @@
     <!-- 设计师展示所有自己的角色下制作的视频 -->
     <select id="adminProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
-        id as projectId,
-        project_name as projectName,
-        advertiser_id as advertiserId,
-        advertiser_name as advertiserName,
-        media_id as mediaId,
-        max_bid as maxBid,
-        advertiser_name as advertiserName ,
-        responsible_name as responsibleName
+        t1.id as projectId,
+        t1.project_name as projectName,
+        t1.advertiser_id as advertiserId,
+        (
+        select name from ctop_advertiser where id = t1.advertiser_id
+        )
+        as advertiserName,
+        t1.media_id as mediaId,
+        t1.max_bid as maxBid,
+
+        t1.responsible_name as responsibleName
         from
-        ctop_project
+        ctop_project t1
         where
         media_id in
         <foreach collection="mediaIds" item="item" separator=","
                  open="(" close=")">
             #{item}
         </foreach>
+        order by create_time desc
     </select>
 
     <!-- 视频报表设计师leader展示自己所在公司的所有项目 -->
@@ -110,7 +114,10 @@
         distinct b.project_id as projectId,
         b.project_name as projectName,
         a.advertiser_id as advertiserId,
-        a.advertiser_name as advertiserName,
+        (
+        select name from ctop_advertiser where id = a.advertiser_id
+        )
+        as advertiserName,
         (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId
         from
         ctop_user_allocation a
@@ -121,6 +128,7 @@
                  open="(" close=")">
             #{item}
         </foreach>
+        order by b.create_time desc
     </select>
 
     <select id="getSaleProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
@@ -149,5 +157,49 @@
         where user_id = #{userId}
         group by project_id
     </select>
+    <select id="getProjectByUserId" resultType="cn.com.ctop.common.module.entity.Project">
+        select
+            project.*
+        from
+            ctop_project_member member left join ctop_project project on project.id = member.project_id
+        where
+            member.user_id = #{userId}
+    </select>
+
+    <select id="getProjectByAccountIds" resultType="java.lang.Long">
+        SELECT
+            project_id
+        FROM
+            ctop_user_allocation
+        WHERE
+            account_id IN
+        <foreach collection="accountIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+
+    <select id="getProjectByUserIdAndMediaIds" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        t2.id as 'projectId',
+        t2.project_name as 'projectName',
+        (select name from ctop_advertiser where id = t2.advertiser_id) as 'advertiserName'
+        from ctop_project_member t1
+        left join ctop_project t2
+        on t1.project_id = t2.id
+        where 1 = 1
+        <if test="userId !=null and userId!=''">
+            and t1.user_id = #{userId}
+        </if>
+        and t2.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        group by t2.id
+        order by t2.create_time desc
+    </select>
+
 
 </mapper>

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAdvertiserService.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.service;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ctop.entity.Advertiser;
-import org.jeecg.modules.ctop.vo.SheetInfoVo;
 
 import java.text.ParseException;
 import java.util.List;
@@ -11,7 +11,7 @@ import java.util.List;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 public interface IAdvertiserService extends IService<Advertiser> {

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IJhsBakendDataService.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.JhsBakendData;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+
+import java.util.List;
+
+/**
+ * @Description: 聚划算后端数据
+ * @Author: jeecg-boot
+ * @Date:   2020-09-07
+ * @Version: V1.0
+ */
+public interface IJhsBakendDataService extends IService<JhsBakendData> {
+    public void saveOrUpdateEntity(JhsBakendDataEntity dataEntity);
+
+    void replaceEntity(JhsBakendDataEntity dataEntity);
+
+    void replaceEntityList(List<JhsBakendDataEntity> datas);
+}

+ 9 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.ctop.service;
 
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.SysUser;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 
@@ -22,7 +24,7 @@ public interface IProjectMemberService extends IService<ProjectMember> {
 
     List<ProjectMember> getProjects(List<Integer> mediaIds);
 
-    List<Map<String, Object>> getProjectAccountByUserId(String userId,String mediaType);
+    List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType);
 
     ProjectMember getProjectByParams(Long targetProject, String userId);
 
@@ -31,4 +33,10 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<ProjectMember> getSaleOwnProjects(List<Integer> mediaIds);
 
     List<Long> getProjectByMap(String userId);
+
+    List<Project> selectListByUserId(String userId);
+
+    List<Long> getProjectByAccountIds(JSONArray accountIds);
+
+    List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds);
 }

+ 8 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AdvertiserServiceImpl.java

@@ -1,14 +1,14 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.mapper.AdvertiserMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
-import org.jeecg.modules.ctop.vo.SheetInfoVo;
 import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
 import org.jeecg.modules.excelutil.entity.YdPlanAggregateEntity;
 import org.jeecg.modules.excelutil.entity.YdWeekAggregateEntity;
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 @Service
@@ -34,6 +34,7 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     @Autowired
     private AdvertiserMapper advertiserMapper;
+
     @Override
     public List<Advertiser> getBySaleId(String saleId) {
         QueryWrapper<Advertiser> queryWrapper = new QueryWrapper<>();
@@ -62,10 +63,10 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     @Override
     public List<SheetInfoVo> getSystemTypeXxlStatisticInfo(Long projectId) {
-        List<SheetInfoVo>vos = new ArrayList<>();
-        SheetInfoVo android = getXxlStatisticInfo(projectId,"android",null,"android汇总表");
+        List<SheetInfoVo> vos = new ArrayList<>();
+        SheetInfoVo android = getXxlStatisticInfo(projectId, "android", null, "android汇总表");
         vos.add(android);
-        SheetInfoVo ios = getXxlStatisticInfo(projectId,"ios",null,"ios汇总表");
+        SheetInfoVo ios = getXxlStatisticInfo(projectId, "ios", null, "ios汇总表");
         vos.add(ios);
         return vos;
     }
@@ -115,7 +116,7 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     private List<YdPlanAggregateEntity> getYdPlanStatisticInfo(Long projectId, String startDate, String endDate) {
         List<YdPlanAggregateEntity> result = new ArrayList<>();
-        List<UserAllocation> allocations = userAllocationService.getByParams(projectId, null,null);
+        List<UserAllocation> allocations = userAllocationService.getByParams(projectId, null, null);
         if (null != allocations && !allocations.isEmpty()) {
             allocations.forEach(allocation -> {
                 List<YdPlanAggregateEntity> plans = statisticWeekInfoByAccount(allocation, startDate, endDate);

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreativeTitleServiceImpl.java

@@ -23,7 +23,6 @@ public class CreativeTitleServiceImpl implements ICreativeTitleService {
             if (!Check.isNull(dataJson)) {
                 return dataJson.getJSONArray("title_label");
             }
-
         }
         return null;
     }

+ 58 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/JhsBakendDataServiceImpl.java

@@ -0,0 +1,58 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.JhsBakendData;
+import org.jeecg.modules.ctop.mapper.JhsBakendDataMapper;
+import org.jeecg.modules.ctop.service.IJhsBakendDataService;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 聚划算后端数据
+ * @author jeecg-boot
+ * @date   2020-09-07
+ * @version V1.0
+ */
+@Service
+public class JhsBakendDataServiceImpl extends ServiceImpl<JhsBakendDataMapper, JhsBakendData> implements IJhsBakendDataService {
+    @Autowired
+    private JhsBakendDataMapper bakendDataMapper;
+    @Override
+    public void saveOrUpdateEntity(JhsBakendDataEntity dataEntity) {
+        QueryWrapper<JhsBakendData> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("state_date", dataEntity.getStateDate());
+        queryWrapper.eq("ad_id", dataEntity.getAdId());
+        JhsBakendData getData = this.getOne(queryWrapper);
+        if (null == getData) {
+            getData = new JhsBakendData(dataEntity);
+            this.save(getData);
+        } else {
+            getData.setStateDate(dataEntity.getStateDate());
+            getData.setProductLine(dataEntity.getProductLine());
+            getData.setTaskName(dataEntity.getTaskName());
+            getData.setClientName(dataEntity.getClientName());
+            getData.setChannelId(dataEntity.getChannelId());
+            getData.setChannelName(dataEntity.getChannelName());
+            getData.setPageView(dataEntity.getPageView());
+            getData.setDealNumber(dataEntity.getDealNumber());
+            getData.setUpdateTime(new Date());
+            this.updateById(getData);
+        }
+    }
+
+    @Override
+    public void replaceEntity(JhsBakendDataEntity dataEntity) {
+        JhsBakendData getData = new JhsBakendData(dataEntity);
+        bakendDataMapper.replaceData(getData);
+    }
+
+    @Override
+    public void replaceEntityList(List<JhsBakendDataEntity> datas) {
+        bakendDataMapper.replaceBatch(datas);
+    }
+}

+ 5 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/KuaiShouUploadServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
@@ -161,10 +162,6 @@ public class KuaiShouUploadServiceImpl implements IKuaiShouUploadService {
             e.printStackTrace();
         }
     }
-
-    @Autowired
-    private RestTemplate rest;
-
     private String exceptInfoForRestTemplate(String url, Map<String, Object> paramMap, Map<String, String> headerMap) throws ParseException {
         try {
             MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
@@ -178,6 +175,10 @@ public class KuaiShouUploadServiceImpl implements IKuaiShouUploadService {
                         headers.add(key, headerMap.get(key));
                     }
                 }
+                SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
+                requestFactory.setConnectTimeout(1000 * 500);// 设置超时
+                requestFactory.setReadTimeout(1000 * 500);
+                RestTemplate rest = new RestTemplate(requestFactory);
                 HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<MultiValueMap<String, Object>>(param, headers);
                 ResponseEntity<String> responseEntity = rest.exchange(url, HttpMethod.POST, httpEntity, String.class);
                 return responseEntity.getBody();

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/PerformanceSaleServiceImpl.java

@@ -1,12 +1,13 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.performanceappraisal.service.IPerformanceService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
+
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IPerformanceSaleService;
 import org.jeecg.modules.performance.entity.SalePerformanceDetail;
@@ -127,7 +128,7 @@ public class PerformanceSaleServiceImpl implements IPerformanceSaleService {
         detail.setQuarter(quarter);
         detail.setStartDate(startDate);
         detail.setEndDate(endDate);
-        detail.setExtensionSelf(advertiser.getAdvertiserType());
+     //   detail.setExtensionSelf(advertiser.getAdvertiserType());
         detail.setBrandNew(brandNew);
         if (user.getOrgCode().startsWith(CtopAdConstant.HB_BYTEDANCE_SALE_ORG_CODE)) {
             detail.setMediaType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);

+ 21 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -7,6 +7,8 @@ import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang.ArrayUtils;
@@ -103,13 +105,13 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
     }
 
     @Override
-    public List<Map<String, Object>> getProjectAccountByUserId(String userId,String mediaType) {
+    public List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType) {
         List<Map<String, Object>> result = new ArrayList<>();
         List<Integer> mediaList = new ArrayList<>();
-        if(mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)){
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
-        }else if(mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)){
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
         }
@@ -147,6 +149,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         temp.put("project", projectMember);
         QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("project_id", projectMember.getProjectId());
+        queryWrapper.eq("account_status", 0);
         queryWrapper.isNotNull("account_id");
         List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
         if (userAllocations.isEmpty()) {
@@ -194,6 +197,16 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.getProjectByMap(userId);
     }
 
+    @Override
+    public List<Project> selectListByUserId(String userId) {
+        return memberMapper.getProjectByUserId(userId);
+    }
+
+    public List<Long> getProjectByAccountIds(JSONArray accountIds) {
+        return memberMapper.getProjectByAccountIds(accountIds);
+    }
+
+
     //视频报表
     @Override
     public List<ProjectMember> getOwnProjects(List<Integer> mediaIds) {
@@ -217,5 +230,10 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return projectMemberList;
     }
 
+    @Override
+    public List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds) {
+        return memberMapper.getProjectByUserIdAndMediaIds(userId, mediaIds);
+    }
+
 
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java

@@ -56,7 +56,7 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
             SysUser user = sysUserService.getById(record.getUserId());
             Project project = projectService.getById(record.getTargetProject());
             userAllocation.setProjectId(project.getId());
-            userAllocation.setProjectName(project.getProjectName());
+       //     userAllocation.setProjectName(project.getProjectName());
             userAllocationService.updateById(userAllocation);
             ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(),record.getUserId());
             if(null == member){

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/UReportFileBindUserServiceImpl.java

@@ -1,13 +1,13 @@
 package org.jeecg.modules.ctop.service.impl;
 
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.ctop.entity.UReportFileBindUser;
 import org.jeecg.modules.ctop.mapper.UReportFileBindUserMapper;
 import org.jeecg.modules.ctop.service.IUReportFileBindUserService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/UReportFileServiceImpl.java

@@ -1,16 +1,16 @@
 package org.jeecg.modules.ctop.service.impl;
 
 import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.ctop.entity.UReportFile;
 import org.jeecg.modules.ctop.entity.UReportFileBindUser;
 import org.jeecg.modules.ctop.mapper.UReportFileMapper;
 import org.jeecg.modules.ctop.service.IUReportFileBindUserService;
 import org.jeecg.modules.ctop.service.IUReportFileService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 70 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java

@@ -0,0 +1,70 @@
+package org.jeecg.modules.excelutil;
+
+import cn.com.ctop.common.module.utils.SpringUtils;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.ctop.service.impl.JhsBakendDataServiceImpl;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class JhsBakendDataExcelListener extends AnalysisEventListener<JhsBakendDataEntity> {
+    //自定义用于暂时存储data。
+    //可以通过实例获取该值
+    private List<JhsBakendDataEntity> datas = new ArrayList<>();
+    private static final int BATCH_COUNT = 200;
+
+    @Override
+    public void invoke(JhsBakendDataEntity object, AnalysisContext context) {
+        //数据存储到list,供批量处理,或后续自己业务逻辑处理。
+        String date = object.getStateDate();
+        String formatDate = date.substring(0,4)+"-"+date.substring(4,6)+"-"+date.substring(6,8);
+        object.setStateDate(formatDate);
+        object.setVistor(object.getTaskName().split("-")[1]);
+        datas.add(object);
+        if(null!=datas&&datas.size()>=BATCH_COUNT){
+            saveDate();
+            datas.clear();
+        }
+    }
+
+    private void saveDate() {
+        JhsBakendDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(JhsBakendDataServiceImpl.class);
+        dataService.replaceEntityList(datas);
+    }
+
+    private void doSomething(Object object) {
+        //入库调用接口
+        JhsBakendDataEntity dataEntity = (JhsBakendDataEntity) object;
+        dataEntity.setCreateTime(new Date());
+        dataEntity.setUpdateTime(new Date());
+        String date = dataEntity.getStateDate();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        try {
+            date = DateUtils.formatDate(dateFormat.parse(date));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        dataEntity.setStateDate(date);
+        JhsBakendDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(JhsBakendDataServiceImpl.class);
+        dataService.replaceEntity(dataEntity);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+        // datas.clear();//解析结束销毁不用的资源
+    }
+
+    public List<JhsBakendDataEntity> getDatas() {
+        return datas;
+    }
+
+    public void setDatas(List<JhsBakendDataEntity> datas) {
+        this.datas = datas;
+    }
+}

+ 299 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportAccountEntity.java

@@ -0,0 +1,299 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class EffecfReportAccountEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "账户名称")
+    private String authName;
+    @ExcelProperty(index = 2, value = "账户id")
+    private String accountId;
+    @ExcelProperty(index = 3, value = "项目名称")
+    private String projectName;
+    @ExcelProperty(index = 4, value = "消耗")
+    private BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面曝光数")
+    private Long photoShow;
+    @ExcelProperty(index = 6, value = "封面点击数")
+    private Long photoClick;
+    @ExcelProperty(index = 7, value = "素材曝光数")
+    private Long aclick;
+    @ExcelProperty(index = 8, value = "行为数")
+    private Long bclick;
+    @ExcelProperty(index = 9, value = "激活数")
+    private Long activation;
+    @ExcelProperty(index = 10, value = "注册数")
+    private Long eventRegister;
+    @ExcelProperty(index = 11, value = "点击数")
+    private Long submit;
+    @ExcelProperty(index = 12, value = "次留数")
+    private Long eventNextDayStay;
+    @ExcelProperty(index = 13, value = "次留成本")
+    private BigDecimal eventNextDayStayCost;
+    @ExcelProperty(index = 14, value = "激活成本")
+    private BigDecimal activationCost;
+    @ExcelProperty(index = 15, value = "封面点击率")
+    private String photoClickRatio;
+    @ExcelProperty(index = 16, value = "行为率")
+    private String actionRate;
+    @ExcelProperty(index = 17, value = "千次曝光花费")
+    private BigDecimal impression1kCost;
+    @ExcelProperty(index = 18, value = "封面点击单价")
+    private BigDecimal photoClickCost;
+    @ExcelProperty(index = 19, value = "行为单价")
+    private BigDecimal actionCost;
+    @ExcelProperty(index = 20, value = "分享数")
+    private Long photoShare;
+    @ExcelProperty(index = 21, value = "评论数")
+    private Long photoComment;
+    @ExcelProperty(index = 22, value = "点赞数")
+    private Long photoLike;
+    @ExcelProperty(index = 23, value = "新增关注数")
+    private Long follow;
+    @ExcelProperty(index = 24, value = "举报数")
+    private Long report;
+    @ExcelProperty(index = 25, value = "取消关注数")
+    private Long cancelFollow;
+    @ExcelProperty(index = 26, value = "拉黑数")
+    private Long block;
+    @ExcelProperty(index = 27, value = "减少此类作品数")
+    private Long nagative;
+    @ExcelProperty(index = 28, value = "安卓下载开始数")
+    private Long downloadStarted;
+    @ExcelProperty(index = 29, value = "安卓下载完成数")
+    private Long downloadCompleted;
+
+    public String getAuthName() {
+        return authName;
+    }
+
+    public void setAuthName(String authName) {
+        this.authName = authName;
+    }
+
+    public String getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(String accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getAclick() {
+        return aclick;
+    }
+
+    public void setAclick(Long aclick) {
+        this.aclick = aclick;
+    }
+
+    public Long getBclick() {
+        return bclick;
+    }
+
+    public void setBclick(Long bclick) {
+        this.bclick = bclick;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getSubmit() {
+        return submit;
+    }
+
+    public void setSubmit(Long submit) {
+        this.submit = submit;
+    }
+
+    public Long getEventNextDayStay() {
+        return eventNextDayStay;
+    }
+
+    public void setEventNextDayStay(Long eventNextDayStay) {
+        this.eventNextDayStay = eventNextDayStay;
+    }
+
+    public BigDecimal getEventNextDayStayCost() {
+        return eventNextDayStayCost;
+    }
+
+    public void setEventNextDayStayCost(BigDecimal eventNextDayStayCost) {
+        this.eventNextDayStayCost = eventNextDayStayCost;
+    }
+
+    public BigDecimal getActivationCost() {
+        return activationCost;
+    }
+
+    public void setActivationCost(BigDecimal activationCost) {
+        this.activationCost = activationCost;
+    }
+
+    public String getPhotoClickRatio() {
+        return photoClickRatio;
+    }
+
+    public void setPhotoClickRatio(String photoClickRatio) {
+        this.photoClickRatio = photoClickRatio;
+    }
+
+    public String getActionRate() {
+        return actionRate;
+    }
+
+    public void setActionRate(String actionRate) {
+        this.actionRate = actionRate;
+    }
+
+    public BigDecimal getImpression1kCost() {
+        return impression1kCost;
+    }
+
+    public void setImpression1kCost(BigDecimal impression1kCost) {
+        this.impression1kCost = impression1kCost;
+    }
+
+    public BigDecimal getPhotoClickCost() {
+        return photoClickCost;
+    }
+
+    public void setPhotoClickCost(BigDecimal photoClickCost) {
+        this.photoClickCost = photoClickCost;
+    }
+
+    public BigDecimal getActionCost() {
+        return actionCost;
+    }
+
+    public void setActionCost(BigDecimal actionCost) {
+        this.actionCost = actionCost;
+    }
+
+    public Long getPhotoShare() {
+        return photoShare;
+    }
+
+    public void setPhotoShare(Long photoShare) {
+        this.photoShare = photoShare;
+    }
+
+    public Long getPhotoComment() {
+        return photoComment;
+    }
+
+    public void setPhotoComment(Long photoComment) {
+        this.photoComment = photoComment;
+    }
+
+    public Long getPhotoLike() {
+        return photoLike;
+    }
+
+    public void setPhotoLike(Long photoLike) {
+        this.photoLike = photoLike;
+    }
+
+    public Long getFollow() {
+        return follow;
+    }
+
+    public void setFollow(Long follow) {
+        this.follow = follow;
+    }
+
+    public Long getReport() {
+        return report;
+    }
+
+    public void setReport(Long report) {
+        this.report = report;
+    }
+
+    public Long getCancelFollow() {
+        return cancelFollow;
+    }
+
+    public void setCancelFollow(Long cancelFollow) {
+        this.cancelFollow = cancelFollow;
+    }
+
+    public Long getBlock() {
+        return block;
+    }
+
+    public void setBlock(Long block) {
+        this.block = block;
+    }
+
+    public Long getNagative() {
+        return nagative;
+    }
+
+    public void setNagative(Long nagative) {
+        this.nagative = nagative;
+    }
+
+    public Long getDownloadStarted() {
+        return downloadStarted;
+    }
+
+    public void setDownloadStarted(Long downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+
+    public Long getDownloadCompleted() {
+        return downloadCompleted;
+    }
+
+    public void setDownloadCompleted(Long downloadCompleted) {
+        this.downloadCompleted = downloadCompleted;
+    }
+}

+ 302 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportCreativeEntity.java

@@ -0,0 +1,302 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+/**
+ * @author 宋英豪
+ */
+public class EffecfReportCreativeEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "创意视频url")
+    private String url;
+    @ExcelProperty(index = 2, value = "创意名称")
+    private String creativeName;
+    @ExcelProperty(index = 3, value = "广告组名称")
+    private String campaignName;
+    @ExcelProperty(index = 4, value = "消耗")
+    private BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面曝光数")
+    private Long photoShow;
+    @ExcelProperty(index = 6, value = "封面点击数")
+    private Long photoClick;
+    @ExcelProperty(index = 7, value = "素材曝光数")
+    private Long aclick;
+    @ExcelProperty(index = 8, value = "行为数")
+    private Long bclick;
+    @ExcelProperty(index = 9, value = "激活数")
+    private Long activation;
+    @ExcelProperty(index = 10, value = "注册数")
+    private Long eventRegister;
+    @ExcelProperty(index = 11, value = "点击数")
+    private Long submit;
+    @ExcelProperty(index = 12, value = "次留数")
+    private Long eventNextDayStay;
+    @ExcelProperty(index = 13, value = "次留成本")
+    private BigDecimal eventNextDayStayCost;
+    @ExcelProperty(index = 14, value = "激活成本")
+    private BigDecimal activationCost;
+    @ExcelProperty(index = 15, value = "封面点击率")
+    private String photoClickRatio;
+    @ExcelProperty(index = 16, value = "行为率")
+    private String actionRate;
+    @ExcelProperty(index = 17, value = "千次曝光花费")
+    private BigDecimal impression1kCost;
+    @ExcelProperty(index = 18, value = "封面点击单价")
+    private BigDecimal photoClickCost;
+    @ExcelProperty(index = 19, value = "行为单价")
+    private BigDecimal actionCost;
+    @ExcelProperty(index = 20, value = "分享数")
+    private Long photoShare;
+    @ExcelProperty(index = 21, value = "评论数")
+    private Long photoComment;
+    @ExcelProperty(index = 22, value = "点赞数")
+    private Long photoLike;
+    @ExcelProperty(index = 23, value = "新增关注数")
+    private Long follow;
+    @ExcelProperty(index = 24, value = "举报数")
+    private Long report;
+    @ExcelProperty(index = 25, value = "取消关注数")
+    private Long cancelFollow;
+    @ExcelProperty(index = 26, value = "拉黑数")
+    private Long block;
+    @ExcelProperty(index = 27, value = "减少此类作品数")
+    private Long nagative;
+    @ExcelProperty(index = 28, value = "安卓下载开始数")
+    private Long downloadStarted;
+    @ExcelProperty(index = 29, value = "安卓下载完成数")
+    private Long downloadCompleted;
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getAclick() {
+        return aclick;
+    }
+
+    public void setAclick(Long aclick) {
+        this.aclick = aclick;
+    }
+
+    public Long getBclick() {
+        return bclick;
+    }
+
+    public void setBclick(Long bclick) {
+        this.bclick = bclick;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getSubmit() {
+        return submit;
+    }
+
+    public void setSubmit(Long submit) {
+        this.submit = submit;
+    }
+
+    public Long getEventNextDayStay() {
+        return eventNextDayStay;
+    }
+
+    public void setEventNextDayStay(Long eventNextDayStay) {
+        this.eventNextDayStay = eventNextDayStay;
+    }
+
+    public BigDecimal getEventNextDayStayCost() {
+        return eventNextDayStayCost;
+    }
+
+    public void setEventNextDayStayCost(BigDecimal eventNextDayStayCost) {
+        this.eventNextDayStayCost = eventNextDayStayCost;
+    }
+
+    public BigDecimal getActivationCost() {
+        return activationCost;
+    }
+
+    public void setActivationCost(BigDecimal activationCost) {
+        this.activationCost = activationCost;
+    }
+
+    public String getPhotoClickRatio() {
+        return photoClickRatio;
+    }
+
+    public void setPhotoClickRatio(String photoClickRatio) {
+        this.photoClickRatio = photoClickRatio;
+    }
+
+    public String getActionRate() {
+        return actionRate;
+    }
+
+    public void setActionRate(String actionRate) {
+        this.actionRate = actionRate;
+    }
+
+    public BigDecimal getImpression1kCost() {
+        return impression1kCost;
+    }
+
+    public void setImpression1kCost(BigDecimal impression1kCost) {
+        this.impression1kCost = impression1kCost;
+    }
+
+    public BigDecimal getPhotoClickCost() {
+        return photoClickCost;
+    }
+
+    public void setPhotoClickCost(BigDecimal photoClickCost) {
+        this.photoClickCost = photoClickCost;
+    }
+
+    public BigDecimal getActionCost() {
+        return actionCost;
+    }
+
+    public void setActionCost(BigDecimal actionCost) {
+        this.actionCost = actionCost;
+    }
+
+    public Long getPhotoShare() {
+        return photoShare;
+    }
+
+    public void setPhotoShare(Long photoShare) {
+        this.photoShare = photoShare;
+    }
+
+    public Long getPhotoComment() {
+        return photoComment;
+    }
+
+    public void setPhotoComment(Long photoComment) {
+        this.photoComment = photoComment;
+    }
+
+    public Long getPhotoLike() {
+        return photoLike;
+    }
+
+    public void setPhotoLike(Long photoLike) {
+        this.photoLike = photoLike;
+    }
+
+    public Long getFollow() {
+        return follow;
+    }
+
+    public void setFollow(Long follow) {
+        this.follow = follow;
+    }
+
+    public Long getReport() {
+        return report;
+    }
+
+    public void setReport(Long report) {
+        this.report = report;
+    }
+
+    public Long getCancelFollow() {
+        return cancelFollow;
+    }
+
+    public void setCancelFollow(Long cancelFollow) {
+        this.cancelFollow = cancelFollow;
+    }
+
+    public Long getBlock() {
+        return block;
+    }
+
+    public void setBlock(Long block) {
+        this.block = block;
+    }
+
+    public Long getNagative() {
+        return nagative;
+    }
+
+    public void setNagative(Long nagative) {
+        this.nagative = nagative;
+    }
+
+    public Long getDownloadStarted() {
+        return downloadStarted;
+    }
+
+    public void setDownloadStarted(Long downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+
+    public Long getDownloadCompleted() {
+        return downloadCompleted;
+    }
+
+    public void setDownloadCompleted(Long downloadCompleted) {
+        this.downloadCompleted = downloadCompleted;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getCreativeName() {
+        return creativeName;
+    }
+
+    public void setCreativeName(String creativeName) {
+        this.creativeName = creativeName;
+    }
+
+    public String getCampaignName() {
+        return campaignName;
+    }
+
+    public void setCampaignName(String campaignName) {
+        this.campaignName = campaignName;
+    }
+}

+ 299 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportGroupEntity.java

@@ -0,0 +1,299 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class EffecfReportGroupEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "广告组名称")
+    private String unitName;
+    @ExcelProperty(index = 2, value = "广告组id")
+    private Long unitId;
+    @ExcelProperty(index = 3, value = "计划名称")
+    private String campaignName;
+    @ExcelProperty(index = 4, value = "消耗")
+    private BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面曝光数")
+    private Long photoShow;
+    @ExcelProperty(index = 6, value = "封面点击数")
+    private Long photoClick;
+    @ExcelProperty(index = 7, value = "素材曝光数")
+    private Long aclick;
+    @ExcelProperty(index = 8, value = "行为数")
+    private Long bclick;
+    @ExcelProperty(index = 9, value = "激活数")
+    private Long activation;
+    @ExcelProperty(index = 10, value = "注册数")
+    private Long eventRegister;
+    @ExcelProperty(index = 11, value = "点击数")
+    private Long submit;
+    @ExcelProperty(index = 12, value = "次留数")
+    private Long eventNextDayStay;
+    @ExcelProperty(index = 13, value = "次留成本")
+    private BigDecimal eventNextDayStayCost;
+    @ExcelProperty(index = 14, value = "激活成本")
+    private BigDecimal activationCost;
+    @ExcelProperty(index = 15, value = "封面点击率")
+    private String photoClickRatio;
+    @ExcelProperty(index = 16, value = "行为率")
+    private String actionRate;
+    @ExcelProperty(index = 17, value = "千次曝光花费")
+    private BigDecimal impression1kCost;
+    @ExcelProperty(index = 18, value = "封面点击单价")
+    private BigDecimal photoClickCost;
+    @ExcelProperty(index = 19, value = "行为单价")
+    private BigDecimal actionCost;
+    @ExcelProperty(index = 20, value = "分享数")
+    private Long photoShare;
+    @ExcelProperty(index = 21, value = "评论数")
+    private Long photoComment;
+    @ExcelProperty(index = 22, value = "点赞数")
+    private Long photoLike;
+    @ExcelProperty(index = 23, value = "新增关注数")
+    private Long follow;
+    @ExcelProperty(index = 24, value = "举报数")
+    private Long report;
+    @ExcelProperty(index = 25, value = "取消关注数")
+    private Long cancelFollow;
+    @ExcelProperty(index = 26, value = "拉黑数")
+    private Long block;
+    @ExcelProperty(index = 27, value = "减少此类作品数")
+    private Long nagative;
+    @ExcelProperty(index = 28, value = "安卓下载开始数")
+    private Long downloadStarted;
+    @ExcelProperty(index = 29, value = "安卓下载完成数")
+    private Long downloadCompleted;
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getAclick() {
+        return aclick;
+    }
+
+    public void setAclick(Long aclick) {
+        this.aclick = aclick;
+    }
+
+    public Long getBclick() {
+        return bclick;
+    }
+
+    public void setBclick(Long bclick) {
+        this.bclick = bclick;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getSubmit() {
+        return submit;
+    }
+
+    public void setSubmit(Long submit) {
+        this.submit = submit;
+    }
+
+    public Long getEventNextDayStay() {
+        return eventNextDayStay;
+    }
+
+    public void setEventNextDayStay(Long eventNextDayStay) {
+        this.eventNextDayStay = eventNextDayStay;
+    }
+
+    public BigDecimal getEventNextDayStayCost() {
+        return eventNextDayStayCost;
+    }
+
+    public void setEventNextDayStayCost(BigDecimal eventNextDayStayCost) {
+        this.eventNextDayStayCost = eventNextDayStayCost;
+    }
+
+    public BigDecimal getActivationCost() {
+        return activationCost;
+    }
+
+    public void setActivationCost(BigDecimal activationCost) {
+        this.activationCost = activationCost;
+    }
+
+    public String getPhotoClickRatio() {
+        return photoClickRatio;
+    }
+
+    public void setPhotoClickRatio(String photoClickRatio) {
+        this.photoClickRatio = photoClickRatio;
+    }
+
+    public String getActionRate() {
+        return actionRate;
+    }
+
+    public void setActionRate(String actionRate) {
+        this.actionRate = actionRate;
+    }
+
+    public BigDecimal getImpression1kCost() {
+        return impression1kCost;
+    }
+
+    public void setImpression1kCost(BigDecimal impression1kCost) {
+        this.impression1kCost = impression1kCost;
+    }
+
+    public BigDecimal getPhotoClickCost() {
+        return photoClickCost;
+    }
+
+    public void setPhotoClickCost(BigDecimal photoClickCost) {
+        this.photoClickCost = photoClickCost;
+    }
+
+    public BigDecimal getActionCost() {
+        return actionCost;
+    }
+
+    public void setActionCost(BigDecimal actionCost) {
+        this.actionCost = actionCost;
+    }
+
+    public Long getPhotoShare() {
+        return photoShare;
+    }
+
+    public void setPhotoShare(Long photoShare) {
+        this.photoShare = photoShare;
+    }
+
+    public Long getPhotoComment() {
+        return photoComment;
+    }
+
+    public void setPhotoComment(Long photoComment) {
+        this.photoComment = photoComment;
+    }
+
+    public Long getPhotoLike() {
+        return photoLike;
+    }
+
+    public void setPhotoLike(Long photoLike) {
+        this.photoLike = photoLike;
+    }
+
+    public Long getFollow() {
+        return follow;
+    }
+
+    public void setFollow(Long follow) {
+        this.follow = follow;
+    }
+
+    public Long getReport() {
+        return report;
+    }
+
+    public void setReport(Long report) {
+        this.report = report;
+    }
+
+    public Long getCancelFollow() {
+        return cancelFollow;
+    }
+
+    public void setCancelFollow(Long cancelFollow) {
+        this.cancelFollow = cancelFollow;
+    }
+
+    public Long getBlock() {
+        return block;
+    }
+
+    public void setBlock(Long block) {
+        this.block = block;
+    }
+
+    public Long getNagative() {
+        return nagative;
+    }
+
+    public void setNagative(Long nagative) {
+        this.nagative = nagative;
+    }
+
+    public Long getDownloadStarted() {
+        return downloadStarted;
+    }
+
+    public void setDownloadStarted(Long downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+
+    public Long getDownloadCompleted() {
+        return downloadCompleted;
+    }
+
+    public void setDownloadCompleted(Long downloadCompleted) {
+        this.downloadCompleted = downloadCompleted;
+    }
+
+    public Long getUnitId() {
+        return unitId;
+    }
+
+    public void setUnitId(Long unitId) {
+        this.unitId = unitId;
+    }
+
+    public String getUnitName() {
+        return unitName;
+    }
+
+    public void setUnitName(String unitName) {
+        this.unitName = unitName;
+    }
+
+    public String getCampaignName() {
+        return campaignName;
+    }
+
+    public void setCampaignName(String campaignName) {
+        this.campaignName = campaignName;
+    }
+}

+ 299 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportPlanEntity.java

@@ -0,0 +1,299 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class EffecfReportPlanEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "计划名称")
+    private String campaignName;
+    @ExcelProperty(index = 2, value = "计划id")
+    private Long campaignId;
+    @ExcelProperty(index = 3, value = "账户名称")
+    private String authName;
+    @ExcelProperty(index = 4, value = "消耗")
+    private BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面曝光数")
+    private Long photoShow;
+    @ExcelProperty(index = 6, value = "封面点击数")
+    private Long photoClick;
+    @ExcelProperty(index = 7, value = "素材曝光数")
+    private Long aclick;
+    @ExcelProperty(index = 8, value = "行为数")
+    private Long bclick;
+    @ExcelProperty(index = 9, value = "激活数")
+    private Long activation;
+    @ExcelProperty(index = 10, value = "注册数")
+    private Long eventRegister;
+    @ExcelProperty(index = 11, value = "点击数")
+    private Long submit;
+    @ExcelProperty(index = 12, value = "次留数")
+    private Long eventNextDayStay;
+    @ExcelProperty(index = 13, value = "次留成本")
+    private BigDecimal eventNextDayStayCost;
+    @ExcelProperty(index = 14, value = "激活成本")
+    private BigDecimal activationCost;
+    @ExcelProperty(index = 15, value = "封面点击率")
+    private String photoClickRatio;
+    @ExcelProperty(index = 16, value = "行为率")
+    private String actionRate;
+    @ExcelProperty(index = 17, value = "千次曝光花费")
+    private BigDecimal impression1kCost;
+    @ExcelProperty(index = 18, value = "封面点击单价")
+    private BigDecimal photoClickCost;
+    @ExcelProperty(index = 19, value = "行为单价")
+    private BigDecimal actionCost;
+    @ExcelProperty(index = 20, value = "分享数")
+    private Long photoShare;
+    @ExcelProperty(index = 21, value = "评论数")
+    private Long photoComment;
+    @ExcelProperty(index = 22, value = "点赞数")
+    private Long photoLike;
+    @ExcelProperty(index = 23, value = "新增关注数")
+    private Long follow;
+    @ExcelProperty(index = 24, value = "举报数")
+    private Long report;
+    @ExcelProperty(index = 25, value = "取消关注数")
+    private Long cancelFollow;
+    @ExcelProperty(index = 26, value = "拉黑数")
+    private Long block;
+    @ExcelProperty(index = 27, value = "减少此类作品数")
+    private Long nagative;
+    @ExcelProperty(index = 28, value = "安卓下载开始数")
+    private Long downloadStarted;
+    @ExcelProperty(index = 29, value = "安卓下载完成数")
+    private Long downloadCompleted;
+
+    public String getAuthName() {
+        return authName;
+    }
+
+    public void setAuthName(String authName) {
+        this.authName = authName;
+    }
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getAclick() {
+        return aclick;
+    }
+
+    public void setAclick(Long aclick) {
+        this.aclick = aclick;
+    }
+
+    public Long getBclick() {
+        return bclick;
+    }
+
+    public void setBclick(Long bclick) {
+        this.bclick = bclick;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getSubmit() {
+        return submit;
+    }
+
+    public void setSubmit(Long submit) {
+        this.submit = submit;
+    }
+
+    public Long getEventNextDayStay() {
+        return eventNextDayStay;
+    }
+
+    public void setEventNextDayStay(Long eventNextDayStay) {
+        this.eventNextDayStay = eventNextDayStay;
+    }
+
+    public BigDecimal getEventNextDayStayCost() {
+        return eventNextDayStayCost;
+    }
+
+    public void setEventNextDayStayCost(BigDecimal eventNextDayStayCost) {
+        this.eventNextDayStayCost = eventNextDayStayCost;
+    }
+
+    public BigDecimal getActivationCost() {
+        return activationCost;
+    }
+
+    public void setActivationCost(BigDecimal activationCost) {
+        this.activationCost = activationCost;
+    }
+
+    public String getPhotoClickRatio() {
+        return photoClickRatio;
+    }
+
+    public void setPhotoClickRatio(String photoClickRatio) {
+        this.photoClickRatio = photoClickRatio;
+    }
+
+    public String getActionRate() {
+        return actionRate;
+    }
+
+    public void setActionRate(String actionRate) {
+        this.actionRate = actionRate;
+    }
+
+    public BigDecimal getImpression1kCost() {
+        return impression1kCost;
+    }
+
+    public void setImpression1kCost(BigDecimal impression1kCost) {
+        this.impression1kCost = impression1kCost;
+    }
+
+    public BigDecimal getPhotoClickCost() {
+        return photoClickCost;
+    }
+
+    public void setPhotoClickCost(BigDecimal photoClickCost) {
+        this.photoClickCost = photoClickCost;
+    }
+
+    public BigDecimal getActionCost() {
+        return actionCost;
+    }
+
+    public void setActionCost(BigDecimal actionCost) {
+        this.actionCost = actionCost;
+    }
+
+    public Long getPhotoShare() {
+        return photoShare;
+    }
+
+    public void setPhotoShare(Long photoShare) {
+        this.photoShare = photoShare;
+    }
+
+    public Long getPhotoComment() {
+        return photoComment;
+    }
+
+    public void setPhotoComment(Long photoComment) {
+        this.photoComment = photoComment;
+    }
+
+    public Long getPhotoLike() {
+        return photoLike;
+    }
+
+    public void setPhotoLike(Long photoLike) {
+        this.photoLike = photoLike;
+    }
+
+    public Long getFollow() {
+        return follow;
+    }
+
+    public void setFollow(Long follow) {
+        this.follow = follow;
+    }
+
+    public Long getReport() {
+        return report;
+    }
+
+    public void setReport(Long report) {
+        this.report = report;
+    }
+
+    public Long getCancelFollow() {
+        return cancelFollow;
+    }
+
+    public void setCancelFollow(Long cancelFollow) {
+        this.cancelFollow = cancelFollow;
+    }
+
+    public Long getBlock() {
+        return block;
+    }
+
+    public void setBlock(Long block) {
+        this.block = block;
+    }
+
+    public Long getNagative() {
+        return nagative;
+    }
+
+    public void setNagative(Long nagative) {
+        this.nagative = nagative;
+    }
+
+    public Long getDownloadStarted() {
+        return downloadStarted;
+    }
+
+    public void setDownloadStarted(Long downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+
+    public Long getDownloadCompleted() {
+        return downloadCompleted;
+    }
+
+    public void setDownloadCompleted(Long downloadCompleted) {
+        this.downloadCompleted = downloadCompleted;
+    }
+
+    public String getCampaignName() {
+        return campaignName;
+    }
+
+    public void setCampaignName(String campaignName) {
+        this.campaignName = campaignName;
+    }
+
+    public Long getCampaignId() {
+        return campaignId;
+    }
+
+    public void setCampaignId(Long campaignId) {
+        this.campaignId = campaignId;
+    }
+}

+ 312 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/EffecfReportProjectEntity.java

@@ -0,0 +1,312 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+/**
+ * @author 宋英豪
+ */
+public class EffecfReportProjectEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "项目名称")
+    private String projectName;
+    @ExcelProperty(index = 2, value = "运营负责人")
+    private String responsibleName;
+    @ExcelProperty(index = 3, value = "广告主")
+    private String advertiserName;
+    @ExcelProperty(index = 4, value = "设计负责人")
+    private String designResponsibleName;
+    @ExcelProperty(index = 5, value = "消耗")
+    private BigDecimal charge;
+    @ExcelProperty(index = 6, value = "封面曝光数")
+    private Long photoShow;
+    @ExcelProperty(index = 7, value = "封面点击数")
+    private Long photoClick;
+    @ExcelProperty(index = 8, value = "素材曝光数")
+    private Long aclick;
+    @ExcelProperty(index = 9, value = "行为数")
+    private Long bclick;
+    @ExcelProperty(index = 10, value = "激活数")
+    private Long activation;
+    @ExcelProperty(index = 11, value = "提交按钮点击数")
+    private Long submit;
+    @ExcelProperty(index = 12, value = "注册数")
+    private Long eventRegister;
+    @ExcelProperty(index = 13, value = "次日留存数")
+    private Long eventNextDayStay;
+    @ExcelProperty(index = 14, value = "次日留存成本")
+    private BigDecimal eventNextDayStayCost;
+    @ExcelProperty(index = 15, value = "激活成本")
+    private BigDecimal activationCost;
+    @ExcelProperty(index = 16, value = "封面点击率")
+    private String photoClickRate;
+    @ExcelProperty(index = 17, value = "行为率")
+    private String bclickRate;
+    @ExcelProperty(index = 18, value = "千次封面曝光花费")
+    private BigDecimal impression1kCost;
+    @ExcelProperty(index = 19, value = "封面点击单价")
+    private BigDecimal photoClickCost;
+    @ExcelProperty(index = 20, value = "行为单价")
+    private BigDecimal actionCost;
+    @ExcelProperty(index = 21, value = "分项数")
+    private Long photoShare;
+    @ExcelProperty(index = 22, value = "评论数")
+    private Long photoComment;
+    @ExcelProperty(index = 23, value = "点赞数")
+    private Long photoLike;
+    @ExcelProperty(index = 24, value = "新增关注数")
+    private Long follow;
+    @ExcelProperty(index = 25, value = "举报数")
+    private Long report;
+    @ExcelProperty(index = 26, value = "取关数")
+    private Long cancelFollow;
+    @ExcelProperty(index = 27, value = "拉黑数")
+    private Long block;
+    @ExcelProperty(index = 28, value = "减少此类作品数")
+    private Long nagative;
+    @ExcelProperty(index = 29, value = "安卓下载开始数")
+    private Long downloadStarted;
+    @ExcelProperty(index = 30, value = "安卓下载完成数")
+    private Long downloadCompleted;
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getResponsibleName() {
+        return responsibleName;
+    }
+
+    public void setResponsibleName(String responsibleName) {
+        this.responsibleName = responsibleName;
+    }
+
+    public String getAdvertiserName() {
+        return advertiserName;
+    }
+
+    public void setAdvertiserName(String advertiserName) {
+        this.advertiserName = advertiserName;
+    }
+
+    public String getDesignResponsibleName() {
+        return designResponsibleName;
+    }
+
+    public void setDesignResponsibleName(String designResponsibleName) {
+        this.designResponsibleName = designResponsibleName;
+    }
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getAclick() {
+        return aclick;
+    }
+
+    public void setAclick(Long aclick) {
+        this.aclick = aclick;
+    }
+
+    public Long getBclick() {
+        return bclick;
+    }
+
+    public void setBclick(Long bclick) {
+        this.bclick = bclick;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getSubmit() {
+        return submit;
+    }
+
+    public void setSubmit(Long submit) {
+        this.submit = submit;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getEventNextDayStay() {
+        return eventNextDayStay;
+    }
+
+    public void setEventNextDayStay(Long eventNextDayStay) {
+        this.eventNextDayStay = eventNextDayStay;
+    }
+
+    public BigDecimal getEventNextDayStayCost() {
+        return eventNextDayStayCost;
+    }
+
+    public void setEventNextDayStayCost(BigDecimal eventNextDayStayCost) {
+        this.eventNextDayStayCost = eventNextDayStayCost;
+    }
+
+    public BigDecimal getActivationCost() {
+        return activationCost;
+    }
+
+    public void setActivationCost(BigDecimal activationCost) {
+        this.activationCost = activationCost;
+    }
+
+    public String getPhotoClickRate() {
+        return photoClickRate;
+    }
+
+    public void setPhotoClickRate(String photoClickRate) {
+        this.photoClickRate = photoClickRate;
+    }
+
+    public String getBclickRate() {
+        return bclickRate;
+    }
+
+    public void setBclickRate(String bclickRate) {
+        this.bclickRate = bclickRate;
+    }
+
+    public BigDecimal getImpression1kCost() {
+        return impression1kCost;
+    }
+
+    public void setImpression1kCost(BigDecimal impression1kCost) {
+        this.impression1kCost = impression1kCost;
+    }
+
+    public BigDecimal getPhotoClickCost() {
+        return photoClickCost;
+    }
+
+    public void setPhotoClickCost(BigDecimal photoClickCost) {
+        this.photoClickCost = photoClickCost;
+    }
+
+    public BigDecimal getActionCost() {
+        return actionCost;
+    }
+
+    public void setActionCost(BigDecimal actionCost) {
+        this.actionCost = actionCost;
+    }
+
+    public Long getPhotoShare() {
+        return photoShare;
+    }
+
+    public void setPhotoShare(Long photoShare) {
+        this.photoShare = photoShare;
+    }
+
+    public Long getPhotoComment() {
+        return photoComment;
+    }
+
+    public void setPhotoComment(Long photoComment) {
+        this.photoComment = photoComment;
+    }
+
+    public Long getPhotoLike() {
+        return photoLike;
+    }
+
+    public void setPhotoLike(Long photoLike) {
+        this.photoLike = photoLike;
+    }
+
+    public Long getFollow() {
+        return follow;
+    }
+
+    public void setFollow(Long follow) {
+        this.follow = follow;
+    }
+
+    public Long getReport() {
+        return report;
+    }
+
+    public void setReport(Long report) {
+        this.report = report;
+    }
+
+    public Long getCancelFollow() {
+        return cancelFollow;
+    }
+
+    public void setCancelFollow(Long cancelFollow) {
+        this.cancelFollow = cancelFollow;
+    }
+
+    public Long getBlock() {
+        return block;
+    }
+
+    public void setBlock(Long block) {
+        this.block = block;
+    }
+
+    public Long getNagative() {
+        return nagative;
+    }
+
+    public void setNagative(Long nagative) {
+        this.nagative = nagative;
+    }
+
+    public Long getDownloadStarted() {
+        return downloadStarted;
+    }
+
+    public void setDownloadStarted(Long downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+
+    public Long getDownloadCompleted() {
+        return downloadCompleted;
+    }
+
+    public void setDownloadCompleted(Long downloadCompleted) {
+        this.downloadCompleted = downloadCompleted;
+    }
+}

+ 132 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/JhsBakendDataEntity.java

@@ -0,0 +1,132 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.util.Date;
+
+/**
+ * 聚划算后端数据
+ */
+public class JhsBakendDataEntity extends BaseRowModel {
+    @ExcelProperty(index = 0, value = "日期")
+    private String stateDate;
+    @ExcelProperty(index = 1, value = "业务线")
+    private String productLine;
+    @ExcelProperty(index = 2, value = "任务名称")
+    private String taskName;
+    @ExcelProperty(index = 3, value = "客户端")
+    private String clientName;
+    @ExcelProperty(index = 4, value = "渠道id")
+    private String channelId;
+    @ExcelProperty(index = 5, value = "渠道名称")
+    private String channelName;
+    @ExcelProperty(index = 6, value = "adid")
+    private String adId;
+    @ExcelProperty(index = 7, value = "页面访问UV x")
+    private Long pageView;
+    @ExcelProperty(index = 8, value = "成交笔数 y")
+    private Long dealNumber;
+    private String vistor;
+    private Date createTime;
+    private Date updateTime;
+
+    public JhsBakendDataEntity() {
+    }
+
+    public String getStateDate() {
+        return stateDate;
+    }
+
+    public void setStateDate(String stateDate) {
+        this.stateDate = stateDate;
+    }
+
+    public String getProductLine() {
+        return productLine;
+    }
+
+    public void setProductLine(String productLine) {
+        this.productLine = productLine;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+
+    public String getClientName() {
+        return clientName;
+    }
+
+    public void setClientName(String clientName) {
+        this.clientName = clientName;
+    }
+
+    public String getChannelId() {
+        return channelId;
+    }
+
+    public void setChannelId(String channelId) {
+        this.channelId = channelId;
+    }
+
+    public String getChannelName() {
+        return channelName;
+    }
+
+    public void setChannelName(String channelName) {
+        this.channelName = channelName;
+    }
+
+    public String getAdId() {
+        return adId;
+    }
+
+    public void setAdId(String adId) {
+        this.adId = adId;
+    }
+
+    public Long getPageView() {
+        return pageView;
+    }
+
+    public void setPageView(Long pageView) {
+        this.pageView = pageView;
+    }
+
+    public Long getDealNumber() {
+        return dealNumber;
+    }
+
+    public void setDealNumber(Long dealNumber) {
+        this.dealNumber = dealNumber;
+    }
+
+    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;
+    }
+
+    public String getVistor() {
+        return vistor;
+    }
+
+    public void setVistor(String vistor) {
+        this.vistor = vistor;
+    }
+}

+ 1 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java

@@ -45,8 +45,7 @@ public class FileController {
 
     @PostMapping("/insertV2")
     public Map<String, Object> insertV2(@RequestBody JSONObject json) {
-        LoginUser user = (LoginUser) SecurityUtils.getSubject()
-                .getPrincipal();
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         json.put("userId", user.getId());
         return materialInfoService.correlationUpload(json);
     }

+ 0 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/ISendMsgHandle.java

@@ -1,6 +0,0 @@
-package org.jeecg.modules.message.handle;
-
-public interface ISendMsgHandle {
-
-	void SendMsg(String es_receiver, String es_title, String es_content);
-}

+ 0 - 37
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/EmailSendMsgHandle.java

@@ -1,37 +0,0 @@
-package org.jeecg.modules.message.handle.impl;
-
-import org.jeecg.common.util.SpringContextUtils;
-import org.jeecg.modules.message.handle.ISendMsgHandle;
-import org.springframework.mail.SimpleMailMessage;
-import org.springframework.mail.javamail.JavaMailSender;
-import org.springframework.mail.javamail.MimeMessageHelper;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-
-public class EmailSendMsgHandle implements ISendMsgHandle {
-    static String emailFrom;
-
-    public static void setEmailFrom(String emailFrom) {
-        EmailSendMsgHandle.emailFrom = emailFrom;
-    }
-
-    @Override
-    public void SendMsg(String es_receiver, String es_title, String es_content) {
-        JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
-        MimeMessage message = mailSender.createMimeMessage();
-        MimeMessageHelper helper = null;
-        try {
-            helper = new MimeMessageHelper(message, true);
-            // 设置发送方邮箱地址
-            helper.setFrom(emailFrom);
-            helper.setTo(es_receiver);
-            helper.setSubject(es_title);
-            helper.setText(es_content, true);
-            mailSender.send(message);
-        } catch (MessagingException e) {
-            e.printStackTrace();
-        }
-
-    }
-}

+ 0 - 15
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SmsSendMsgHandle.java

@@ -1,15 +0,0 @@
-package org.jeecg.modules.message.handle.impl;
-
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.modules.message.handle.ISendMsgHandle;
-
-@Slf4j
-public class SmsSendMsgHandle implements ISendMsgHandle {
-
-	@Override
-	public void SendMsg(String es_receiver, String es_title, String es_content) {
-		// TODO Auto-generated method stub
-		log.info("发短信");
-	}
-
-}

+ 0 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/WxSendMsgHandle.java

@@ -1,16 +0,0 @@
-package org.jeecg.modules.message.handle.impl;
-
-import org.jeecg.modules.message.handle.ISendMsgHandle;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:55:14
- */
-public class WxSendMsgHandle implements ISendMsgHandle {
-
-
-	@Override
-	public void SendMsg(String es_receiver, String es_title, String es_content) {
-
-	}
-}

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/opencv/utils/CornerCheck.java

@@ -220,8 +220,6 @@ public class CornerCheck {
             List<Point> checkPoints = new ArrayList<>();
             Point rightDown = cornerPoints.get(cornerPoints.size() - 1);
             for (Point point : cornerPoints) {
-//                System.out.println("cornerPoint:" + point.toString());
-//                System.out.println(imageGR.get((int) point.y, (int) point.x)[1]);
                 if (imageGR.get((int) point.y, (int) point.x)[1] >= 120) {
                     if (point.x <= rightDown.x) {
                         checkPoints.add(point);

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/performance/service/impl/SalePerformanceDetailServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.performance.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
@@ -8,7 +9,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
+
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.performance.constants.RateConstant;
 import org.jeecg.modules.performance.entity.SalePerformanceDetail;
@@ -137,7 +138,7 @@ public class SalePerformanceDetailServiceImpl extends ServiceImpl<SalePerformanc
         detail.setQuarter(quarter);
         detail.setStartDate(startDate);
         detail.setEndDate(endDate);
-        detail.setExtensionSelf(advertiser.getAdvertiserType());
+     //   detail.setExtensionSelf(advertiser.getAdvertiserType());
         detail.setBrandNew(brandNew);
         if (null != user.getOrgCode()) {
             if (user.getOrgCode().startsWith(CtopAdConstant.HB_BYTEDANCE_SALE_ORG_CODE)) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java

@@ -16,7 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.message.websocket.WebSocket;
+import cn.com.ctop.common.module.message.websocket.WebSocket;
 import org.jeecg.modules.system.entity.SysAnnouncement;
 import org.jeecg.modules.system.entity.SysAnnouncementSend;
 import org.jeecg.modules.system.service.ISysAnnouncementSendService;

+ 40 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -18,6 +18,8 @@ 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 com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -149,7 +151,7 @@ public class SysUserController {
     }
 
     @RequestMapping(value = "/getAllUserListByCompany", method = RequestMethod.GET)
-    public Result<List<SysUserVo>> getAllUserListByCompany() {
+    public Result<List<SysUserVo>> getAllUserListByCompany(String userName) {
         Result<List<SysUserVo>> result = new Result<>();
         try {
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -161,9 +163,9 @@ public class SysUserController {
             String companyId = userCompany.getCompanyId();
             List<SysUserVo> userList;
             if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
-                userList = sysUserService.getAllUser();
+                userList = sysUserService.getAllUser(userName);
             } else {
-                userList = sysUserService.getUserListByCompany(companyId);
+                userList = sysUserService.getUserListByCompany(companyId, userName);
             }
 
 
@@ -180,7 +182,38 @@ public class SysUserController {
     }
 
     @RequestMapping(value = "/getAllUserList", method = RequestMethod.GET)
-    public Result<List<SysUserVo>> getAllList() {
+    public Result<PageInfo<SysUserVo>> getAllList(String userName, int pageNo, int pageSize) {
+        Result<PageInfo<SysUserVo>> result = new Result<>();
+        try {
+            LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
+            userCompanyQueryWrapper.eq("user_id", user.getId());
+            userCompanyQueryWrapper.orderByDesc("create_time");
+            userCompanyQueryWrapper.last("limit 1");
+            UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
+            String companyId = userCompany.getCompanyId();
+            List<SysUserVo> userList;
+
+            PageHelper.startPage(pageNo, pageSize);
+            if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
+                userList = sysUserService.getAllUser(userName);
+            } else {
+                userList = sysUserService.getUserListByCompany(companyId, userName);
+            }
+            PageInfo<SysUserVo> pageInfo = new PageInfo<>(userList);
+            result.setSuccess(true);
+            result.setResult(pageInfo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage("请求失败");
+        }
+        return result;
+    }
+
+
+    @RequestMapping(value = "/getAllUserListV1", method = RequestMethod.GET)
+    public Result<List<SysUserVo>> getAllList(String userName) {
         Result<List<SysUserVo>> result = new Result<>();
         try {
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -192,9 +225,9 @@ public class SysUserController {
             String companyId = userCompany.getCompanyId();
             List<SysUserVo> userList;
             if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
-                userList = sysUserService.getAllUser();
+                userList = sysUserService.getAllUser(userName);
             } else {
-                userList = sysUserService.getUserListByCompany(companyId);
+                userList = sysUserService.getUserListByCompany(companyId, userName);
             }
             result.setSuccess(true);
             result.setResult(userList);
@@ -206,6 +239,7 @@ public class SysUserController {
         return result;
     }
 
+
     @RequestMapping(value = "/getAllSaleList", method = RequestMethod.GET)
     public Result<List<SysUserVo>> getSaleList() {
         Result<List<SysUserVo>> result = new Result<>();

+ 105 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/TagInfoTree.java

@@ -0,0 +1,105 @@
+package org.jeecg.modules.system.model;
+
+import cn.com.ctop.common.module.entity.TagInfo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class TagInfoTree implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private String id;
+
+    private String key;
+    private String title;
+
+    /**
+     * 父id
+     */
+    private String parentId;
+
+    /**
+     * 标签名称
+     */
+    private String tagName;
+
+    /**
+     * 编码
+     */
+    private String tagCode;
+    /**
+     * 排序
+     */
+    private Integer tagOrder;
+
+    /**
+     * 所属一级标签id
+     */
+    private Long firstTagId;
+
+    /**
+     * 所属二级标签id
+     */
+    private Long secendTagId;
+
+    /**
+     * 简介
+     */
+    private String description;
+
+    private String model;
+
+    private Integer status;
+
+    private Integer delFlag;
+
+    private Integer level;
+
+    private Long tagCategoryId;
+
+    private String userId;
+    /**
+     * 是否叶子节点: 1:是 0:不是
+     */
+    private boolean isLeaf;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    private List<TagInfoTree> children;
+
+    public TagInfoTree(TagInfo tagInfo) {
+        this.key = tagInfo.getId()+"";
+        this.id = tagInfo.getId()+"";
+        this.title = tagInfo.getTagName();
+        this.parentId = tagInfo.getParentId()+"";
+        this.tagName = tagInfo.getTagName();
+        this.tagCode = tagInfo.getTagCode();
+        this.tagOrder = tagInfo.getTagOrder();
+        this.delFlag = tagInfo.getDelFlag();
+        this.description = tagInfo.getDescription();
+        this.firstTagId = tagInfo.getFirstTagId();
+        this.secendTagId = tagInfo.getSecendTagId();
+        this.description = tagInfo.getDescription();
+        this.model = tagInfo.getModel();
+        this.status = tagInfo.getStatus();
+        this.delFlag = tagInfo.getDelFlag();
+        this.level = tagInfo.getLevel();
+        this.tagCategoryId = tagInfo.getTagCategoryId();
+        this.userId = tagInfo.getUserId();
+        this.createTime = tagInfo.getCreateTime();
+        this.updateTime = tagInfo.getUpdateTime();
+        this.isLeaf = tagInfo.isLeaf();
+    }
+}

+ 214 - 195
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java

@@ -25,97 +25,107 @@ import java.util.Set;
  * @since 2018-12-20
  */
 public interface ISysUserService extends IService<SysUser> {
-	List<SysUserVo> getUserListByCompany(String companyId);
-
-	List<SysUser> getUserListByRoleId(String roleId);
-
-	List<SysUserVo> getAllSales();
-
-	List<SysUserVo> getAllSalesByCompanyId(String companyId);
-	/**
-	 * 重置密码
-	 *
-	 * @param username
-	 * @param oldpassword
-	 * @param newpassword
-	 * @param confirmpassword
-	 * @return
-	 */
-	public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword);
-
-	/**
-	 * 修改密码
-	 *
-	 * @param sysUser
-	 * @return
-	 */
-	public Result<?> changePassword(SysUser sysUser);
-
-	/**
-	 * 删除用户
-	 * @param userId
-	 * @return
-	 */
-	public boolean deleteUser(String userId);
-
-	/**
-	 * 批量删除用户
-	 * @param userIds
-	 * @return
-	 */
-	public boolean deleteBatchUsers(String userIds);
-
-	public SysUser getUserByName(String username);
-
-	/**
-	 * 添加用户和用户角色关系
-	 * @param user
-	 * @param roles
-	 */
-	public void addUserWithRole(SysUser user,String roles);
-
-
-	/**
-	 * 修改用户和用户角色关系
-	 * @param user
-	 * @param roles
-	 */
-	public void editUserWithRole(SysUser user,String roles);
-
-	/**
-	 * 获取用户的授权角色
-	 * @param username
-	 * @return
-	 */
-	public List<String> getRole(String username);
-
-	/**
-	  * 查询用户信息包括 部门信息
-	 * @param username
-	 * @return
-	 */
-	public SysUserCacheInfo getCacheUser(String username);
-
-	/**
-	 * 根据部门Id查询
-	 * @param
-	 * @return
-	 */
-	public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username);
-
-	/**
-	 * 根据部门Ids查询
-	 * @param
-	 * @return
-	 */
-	public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username);
-
-	/**
-	 * 根据 userIds查询,查询用户所属部门的名称(多个部门名逗号隔开)
-	 * @param
-	 * @return
-	 */
-	public Map<String,String> getDepNamesByUserIds(List<String> userIds);
+    List<SysUserVo> getUserListByCompany(String companyId,String userName);
+
+    List<SysUser> getUserListByRoleId(String roleId);
+
+    List<SysUserVo> getAllSales();
+
+    List<SysUserVo> getAllSalesByCompanyId(String companyId);
+
+    /**
+     * 重置密码
+     *
+     * @param username
+     * @param oldpassword
+     * @param newpassword
+     * @param confirmpassword
+     * @return
+     */
+    public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword);
+
+    /**
+     * 修改密码
+     *
+     * @param sysUser
+     * @return
+     */
+    public Result<?> changePassword(SysUser sysUser);
+
+    /**
+     * 删除用户
+     *
+     * @param userId
+     * @return
+     */
+    public boolean deleteUser(String userId);
+
+    /**
+     * 批量删除用户
+     *
+     * @param userIds
+     * @return
+     */
+    public boolean deleteBatchUsers(String userIds);
+
+    public SysUser getUserByName(String username);
+
+    /**
+     * 添加用户和用户角色关系
+     *
+     * @param user
+     * @param roles
+     */
+    public void addUserWithRole(SysUser user, String roles);
+
+
+    /**
+     * 修改用户和用户角色关系
+     *
+     * @param user
+     * @param roles
+     */
+    public void editUserWithRole(SysUser user, String roles);
+
+    /**
+     * 获取用户的授权角色
+     *
+     * @param username
+     * @return
+     */
+    public List<String> getRole(String username);
+
+    /**
+     * 查询用户信息包括 部门信息
+     *
+     * @param username
+     * @return
+     */
+    public SysUserCacheInfo getCacheUser(String username);
+
+    /**
+     * 根据部门Id查询
+     *
+     * @param
+     * @return
+     */
+    public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username);
+
+    /**
+     * 根据部门Ids查询
+     *
+     * @param
+     * @return
+     */
+    public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username);
+
+    /**
+     * 根据 userIds查询,查询用户所属部门的名称(多个部门名逗号隔开)
+     *
+     * @param
+     * @return
+     */
+    public Map<String, String> getDepNamesByUserIds(List<String> userIds);
 
     /**
      * 根据部门 Id 和 QueryWrapper 查询
@@ -127,98 +137,105 @@ public interface ISysUserService extends IService<SysUser> {
      */
     public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper);
 
-	/**
-	 * 根据 orgCode 查询用户,包括子部门下的用户
-	 *
-	 * @param orgCode
-	 * @param userParams 用户查询条件,可为空
-	 * @param page 分页参数
-	 * @return
-	 */
-	IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page);
-	Map<String, Object> queryRoleCode(String userId);
-	/**
-	 * 根据角色Id查询
-	 * @param
-	 * @return
-	 */
-	public IPage<SysUser> getUserByRoleId(Page<SysUser> page,String roleId, String username);
-
-	/**
-	 * 通过用户名获取用户角色集合
-	 *
-	 * @param username 用户名
-	 * @return 角色集合
-	 */
-	Set<String> getUserRolesSet(String username);
-
-	/**
-	 * 通过用户名获取用户权限集合
-	 *
-	 * @param username 用户名
-	 * @return 权限集合
-	 */
-	Set<String> getUserPermissionsSet(String username);
-
-	/**
-	 * 根据用户名设置部门ID
-	 * @param username
-	 * @param orgCode
-	 */
-	void updateUserDepart(String username,String orgCode);
-
-	/**
-	 * 根据手机号获取用户名和密码
-	 */
-	public SysUser getUserByPhone(String phone);
-
-
-	/**
-	 * 根据邮箱获取用户
-	 */
-	public SysUser getUserByEmail(String email);
-
-
-	/**
-	 * 添加用户和用户部门关系
-	 * @param user
-	 * @param selectedParts
-	 */
-	void addUserWithDepart(SysUser user, String selectedParts);
-
-	/**
-	 * 编辑用户和用户部门关系
-	 * @param user
-	 * @param departs
-	 */
-	void editUserWithDepart(SysUser user, String departs);
-
-	/**
-	   * 校验用户是否有效
-	 * @param sysUser
-	 * @return
-	 */
-	Result checkUserIsEffective(SysUser sysUser);
-
-	/**
-	 * 查询被逻辑删除的用户
-	 */
-	List<SysUser> queryLogicDeleted();
-
-	/**
-	 * 查询被逻辑删除的用户(可拼装查询条件)
-	 */
-	List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper);
-
-	/**
-	 * 还原被逻辑删除的用户
-	 */
-	boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity);
-
-	/**
-	 * 彻底删除被逻辑删除的用户
-	 */
-	boolean removeLogicDeleted(List<String> userIds);
+    /**
+     * 根据 orgCode 查询用户,包括子部门下的用户
+     *
+     * @param orgCode
+     * @param userParams 用户查询条件,可为空
+     * @param page       分页参数
+     * @return
+     */
+    IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page);
+
+    Map<String, Object> queryRoleCode(String userId);
+
+    /**
+     * 根据角色Id查询
+     *
+     * @param
+     * @return
+     */
+    public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username);
+
+    /**
+     * 通过用户名获取用户角色集合
+     *
+     * @param username 用户名
+     * @return 角色集合
+     */
+    Set<String> getUserRolesSet(String username);
+
+    /**
+     * 通过用户名获取用户权限集合
+     *
+     * @param username 用户名
+     * @return 权限集合
+     */
+    Set<String> getUserPermissionsSet(String username);
+
+    /**
+     * 根据用户名设置部门ID
+     *
+     * @param username
+     * @param orgCode
+     */
+    void updateUserDepart(String username, String orgCode);
+
+    /**
+     * 根据手机号获取用户名和密码
+     */
+    public SysUser getUserByPhone(String phone);
+
+
+    /**
+     * 根据邮箱获取用户
+     */
+    public SysUser getUserByEmail(String email);
+
+
+    /**
+     * 添加用户和用户部门关系
+     *
+     * @param user
+     * @param selectedParts
+     */
+    void addUserWithDepart(SysUser user, String selectedParts);
+
+    /**
+     * 编辑用户和用户部门关系
+     *
+     * @param user
+     * @param departs
+     */
+    void editUserWithDepart(SysUser user, String departs);
+
+    /**
+     * 校验用户是否有效
+     *
+     * @param sysUser
+     * @return
+     */
+    Result checkUserIsEffective(SysUser sysUser);
+
+    /**
+     * 查询被逻辑删除的用户
+     */
+    List<SysUser> queryLogicDeleted();
+
+    /**
+     * 查询被逻辑删除的用户(可拼装查询条件)
+     */
+    List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper);
+
+    /**
+     * 还原被逻辑删除的用户
+     */
+    boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity);
+
+    /**
+     * 彻底删除被逻辑删除的用户
+     */
+    boolean removeLogicDeleted(List<String> userIds);
 
     /**
      * 更新手机号、邮箱空字符串为 null
@@ -226,18 +243,20 @@ public interface ISysUserService extends IService<SysUser> {
     @Transactional(rollbackFor = Exception.class)
     boolean updateNullPhoneEmail();
 
-	/**
-	 * 保存第三方用户信息
-	 * @param sysUser
-	 */
-	void saveThirdUser(SysUser sysUser);
+    /**
+     * 保存第三方用户信息
+     *
+     * @param sysUser
+     */
+    void saveThirdUser(SysUser sysUser);
 
-	/**
-	 * 根据部门Ids查询
-	 * @param
-	 * @return
-	 */
-	List<SysUser> queryByDepIds(List<String> departIds, String username);
+    /**
+     * 根据部门Ids查询
+     *
+     * @param
+     * @return
+     */
+    List<SysUser> queryByDepIds(List<String> departIds, String username);
 
-	List<SysUserVo> getAllUser();
+    List<SysUserVo> getAllUser(String userName);
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java

@@ -23,9 +23,9 @@ import org.jeecg.common.system.api.ISysBaseApi;
 import org.jeecg.common.system.vo.*;
 import org.jeecg.common.util.*;
 import org.jeecg.common.util.oss.OssBootUtil;
-import org.jeecg.modules.message.entity.SysMessageTemplate;
-import org.jeecg.modules.message.service.ISysMessageTemplateService;
-import org.jeecg.modules.message.websocket.WebSocket;
+import cn.com.ctop.common.module.message.entity.SysMessageTemplate;
+import cn.com.ctop.common.module.message.service.ISysMessageTemplateService;
+import cn.com.ctop.common.module.message.websocket.WebSocket;
 import org.jeecg.modules.system.entity.*;
 import org.jeecg.modules.system.mapper.*;
 import org.jeecg.modules.system.service.ISysDataSourceService;

+ 0 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java

@@ -47,7 +47,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
 	 */
 	@Override
 	public List<DictModel> queryDictItemsByCode(String code) {
-		log.info("无缓存dictCache的时候调用这里!");
 		return sysDictMapper.queryDictItemsByCode(code);
 	}
 
@@ -82,7 +81,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
 
 	@Override
 	public String queryDictTextByKey(String code, String key,String extendsKey,String extendsValue) {
-		log.info("无缓存dictText的时候调用这里!");
 		return sysDictMapper.queryDictTextByKey(code, key,extendsKey,extendsValue);
 	}
 
@@ -101,7 +99,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
 
 	@Override
 	public List<DictModel> queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql) {
-		log.info("无缓存dictTableList的时候调用这里!");
 		return sysDictMapper.queryTableDictItemsByCodeAndFilter(table,text,code,filterSql);
 	}
 

+ 361 - 356
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@@ -44,51 +44,54 @@ import java.util.stream.Collectors;
 @Slf4j
 public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
 
-	@Autowired
-	private SysUserMapper userMapper;
-	@Autowired
-	private SysPermissionMapper sysPermissionMapper;
-	@Autowired
-	private SysUserRoleMapper sysUserRoleMapper;
-	@Autowired
-	private SysUserDepartMapper sysUserDepartMapper;
-	@Autowired
-	private ISysBaseApi sysBaseAPI;
-	@Autowired
-	private SysDepartMapper sysDepartMapper;
-	@Autowired
-	private SysRoleMapper sysRoleMapper;
-	@Autowired
-	private SysDepartRoleUserMapper departRoleUserMapper;
-	@Autowired
-	private SysDepartRoleMapper sysDepartRoleMapper;
-	@Override
-	public Map<String, Object> queryRoleCode(String userId) {
-		return userMapper.queryRoleCode(userId);
-	}
-	@Override
-	public List<SysUserVo> getUserListByCompany(String companyId) {
-		return userMapper.getUserListByCompany(companyId);
-	}
-
-	@Override
-	public List<SysUser> getUserListByRoleId(String roleId) {
-		Page<SysUser> page = new Page<>();
-		page.setSize(10000);
-		IPage<SysUser> userPage = this.getUserByRoleId(page, roleId, null);
-		return userPage.getRecords();
-	}
-
-	@Override
-	public List<SysUserVo> getAllSales() {
-		return userMapper.getAllSale();
-	}
-
-	@Override
-	public List<SysUserVo> getAllSalesByCompanyId(String companyId) {
-		return userMapper.getAllSalesByCompanyId(companyId);
-
-	}
+    @Autowired
+    private SysUserMapper userMapper;
+    @Autowired
+    private SysPermissionMapper sysPermissionMapper;
+    @Autowired
+    private SysUserRoleMapper sysUserRoleMapper;
+    @Autowired
+    private SysUserDepartMapper sysUserDepartMapper;
+    @Autowired
+    private ISysBaseApi sysBaseAPI;
+    @Autowired
+    private SysDepartMapper sysDepartMapper;
+    @Autowired
+    private SysRoleMapper sysRoleMapper;
+    @Autowired
+    private SysDepartRoleUserMapper departRoleUserMapper;
+    @Autowired
+    private SysDepartRoleMapper sysDepartRoleMapper;
+
+    @Override
+    public Map<String, Object> queryRoleCode(String userId) {
+        return userMapper.queryRoleCode(userId);
+    }
+
+    @Override
+    public List<SysUserVo> getUserListByCompany(String companyId, String userName) {
+        return userMapper.getUserListByCompany(companyId, userName);
+    }
+
+    @Override
+    public List<SysUser> getUserListByRoleId(String roleId) {
+        Page<SysUser> page = new Page<>();
+        page.setSize(10000);
+        IPage<SysUser> userPage = this.getUserByRoleId(page, roleId, null);
+        return userPage.getRecords();
+    }
+
+    @Override
+    public List<SysUserVo> getAllSales() {
+        return userMapper.getAllSale();
+    }
+
+    @Override
+    public List<SysUserVo> getAllSalesByCompanyId(String companyId) {
+        return userMapper.getAllSalesByCompanyId(companyId);
+
+    }
+
     @Override
     @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
     public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword) {
@@ -121,323 +124,325 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
-    @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
-	@Transactional(rollbackFor = Exception.class)
-	public boolean deleteUser(String userId) {
-		//1.删除用户
-		this.removeById(userId);
-		return false;
-	}
-
-	@Override
-    @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
-	@Transactional(rollbackFor = Exception.class)
-	public boolean deleteBatchUsers(String userIds) {
-		//1.删除用户
-		this.removeByIds(Arrays.asList(userIds.split(",")));
-		return false;
-	}
-
-	@Override
-	public SysUser getUserByName(String username) {
-		return userMapper.getUserByName(username);
-	}
-
-
-	@Override
-	@Transactional
-	public void addUserWithRole(SysUser user, String roles) {
-		this.save(user);
-		if(oConvertUtils.isNotEmpty(roles)) {
-			String[] arr = roles.split(",");
-			for (String roleId : arr) {
-				SysUserRole userRole = new SysUserRole(user.getId(), roleId);
-				sysUserRoleMapper.insert(userRole);
-			}
-		}
-	}
-
-	@Override
-	@CacheEvict(value= {CacheConstant.SYS_USERS_CACHE}, allEntries=true)
-	@Transactional
-	public void editUserWithRole(SysUser user, String roles) {
-		this.updateById(user);
-		//先删后加
-		sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId()));
-		if(oConvertUtils.isNotEmpty(roles)) {
-			String[] arr = roles.split(",");
-			for (String roleId : arr) {
-				SysUserRole userRole = new SysUserRole(user.getId(), roleId);
-				sysUserRoleMapper.insert(userRole);
-			}
-		}
-	}
-
-
-	@Override
-	public List<String> getRole(String username) {
-		return sysUserRoleMapper.getRoleByUserName(username);
-	}
-
-	/**
-	 * 通过用户名获取用户角色集合
-	 * @param username 用户名
+    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteUser(String userId) {
+        //1.删除用户
+        this.removeById(userId);
+        return false;
+    }
+
+    @Override
+    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteBatchUsers(String userIds) {
+        //1.删除用户
+        this.removeByIds(Arrays.asList(userIds.split(",")));
+        return false;
+    }
+
+    @Override
+    public SysUser getUserByName(String username) {
+        return userMapper.getUserByName(username);
+    }
+
+
+    @Override
+    @Transactional
+    public void addUserWithRole(SysUser user, String roles) {
+        this.save(user);
+        if (oConvertUtils.isNotEmpty(roles)) {
+            String[] arr = roles.split(",");
+            for (String roleId : arr) {
+                SysUserRole userRole = new SysUserRole(user.getId(), roleId);
+                sysUserRoleMapper.insert(userRole);
+            }
+        }
+    }
+
+    @Override
+    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
+    @Transactional
+    public void editUserWithRole(SysUser user, String roles) {
+        this.updateById(user);
+        //先删后加
+        sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId()));
+        if (oConvertUtils.isNotEmpty(roles)) {
+            String[] arr = roles.split(",");
+            for (String roleId : arr) {
+                SysUserRole userRole = new SysUserRole(user.getId(), roleId);
+                sysUserRoleMapper.insert(userRole);
+            }
+        }
+    }
+
+
+    @Override
+    public List<String> getRole(String username) {
+        return sysUserRoleMapper.getRoleByUserName(username);
+    }
+
+    /**
+     * 通过用户名获取用户角色集合
+     *
+     * @param username 用户名
      * @return 角色集合
-	 */
-	@Override
-	public Set<String> getUserRolesSet(String username) {
-		// 查询用户拥有的角色集合
-		List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
-		log.info("-------通过数据库读取用户拥有的角色Rules------username: " + username + ",Roles size: " + (roles == null ? 0 : roles.size()));
-		return new HashSet<>(roles);
-	}
-
-	/**
-	 * 通过用户名获取用户权限集合
-	 *
-	 * @param username 用户名
-	 * @return 权限集合
-	 */
-	@Override
-	public Set<String> getUserPermissionsSet(String username) {
-		Set<String> permissionSet = new HashSet<>();
-		List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
-		for (SysPermission po : permissionList) {
+     */
+    @Override
+    public Set<String> getUserRolesSet(String username) {
+        // 查询用户拥有的角色集合
+        List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
+        log.info("-------通过数据库读取用户拥有的角色Rules------username: " + username + ",Roles size: " + (roles == null ? 0 : roles.size()));
+        return new HashSet<>(roles);
+    }
+
+    /**
+     * 通过用户名获取用户权限集合
+     *
+     * @param username 用户名
+     * @return 权限集合
+     */
+    @Override
+    public Set<String> getUserPermissionsSet(String username) {
+        Set<String> permissionSet = new HashSet<>();
+        List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
+        for (SysPermission po : permissionList) {
 //			// TODO URL规则有问题?
 //			if (oConvertUtils.isNotEmpty(po.getUrl())) {
 //				permissionSet.add(po.getUrl());
 //			}
-			if (oConvertUtils.isNotEmpty(po.getPerms())) {
-				permissionSet.add(po.getPerms());
-			}
-		}
-		log.info("-------通过数据库读取用户拥有的权限Perms------username: "+ username+",Perms size: "+ (permissionSet==null?0:permissionSet.size()) );
-		return permissionSet;
-	}
-
-	@Override
-	public SysUserCacheInfo getCacheUser(String username) {
-		SysUserCacheInfo info = new SysUserCacheInfo();
-		info.setOneDepart(true);
+            if (oConvertUtils.isNotEmpty(po.getPerms())) {
+                permissionSet.add(po.getPerms());
+            }
+        }
+        log.info("-------通过数据库读取用户拥有的权限Perms------username: " + username + ",Perms size: " + (permissionSet == null ? 0 : permissionSet.size()));
+        return permissionSet;
+    }
+
+    @Override
+    public SysUserCacheInfo getCacheUser(String username) {
+        SysUserCacheInfo info = new SysUserCacheInfo();
+        info.setOneDepart(true);
 //		SysUser user = userMapper.getUserByName(username);
 //		info.setSysUserCode(user.getUsername());
 //		info.setSysUserName(user.getRealname());
 
 
-		LoginUser user = sysBaseAPI.getUserByName(username);
-		if(user!=null) {
-			info.setSysUserCode(user.getUsername());
-			info.setSysUserName(user.getRealname());
-			info.setSysOrgCode(user.getOrgCode());
-		}
-
-		//多部门支持in查询
-		List<SysDepart> list = sysDepartMapper.queryUserDeparts(user.getId());
-		List<String> sysMultiOrgCode = new ArrayList<String>();
-		if(list==null || list.size()==0) {
-			//当前用户无部门
-			//sysMultiOrgCode.add("0");
-		}else if(list.size()==1) {
-			sysMultiOrgCode.add(list.get(0).getOrgCode());
-		}else {
-			info.setOneDepart(false);
-			for (SysDepart dpt : list) {
-				sysMultiOrgCode.add(dpt.getOrgCode());
-			}
-		}
-		info.setSysMultiOrgCode(sysMultiOrgCode);
-
-		return info;
-	}
-
-	// 根据部门Id查询
-	@Override
-	public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId,String username) {
-		return userMapper.getUserByDepId(page, departId,username);
-	}
-
-	@Override
-	public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username) {
-		return userMapper.getUserByDepIds(page, departIds,username);
-	}
-
-	@Override
-	public List<SysUserVo> getAllUser() {
-		return userMapper.getAllUser();
-	}
-
-	@Override
-	public Map<String, String> getDepNamesByUserIds(List<String> userIds) {
-		List<SysUserDepVo> list = this.baseMapper.getDepNamesByUserIds(userIds);
-		Map<String, String> res = new HashMap<String, String>();
-		list.forEach(item -> {
-					if (res.get(item.getUserId()) == null) {
-						res.put(item.getUserId(), item.getDepartName());
-					} else {
-						res.put(item.getUserId(), res.get(item.getUserId()) + "," + item.getDepartName());
-					}
-				}
-		);
-		return res;
-	}
-
-	@Override
-	public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper) {
-		LambdaQueryWrapper<SysUser> lambdaQueryWrapper = queryWrapper.lambda();
-
-		lambdaQueryWrapper.eq(SysUser::getDelFlag, "0");
+        LoginUser user = sysBaseAPI.getUserByName(username);
+        if (user != null) {
+            info.setSysUserCode(user.getUsername());
+            info.setSysUserName(user.getRealname());
+            info.setSysOrgCode(user.getOrgCode());
+        }
+
+        //多部门支持in查询
+        List<SysDepart> list = sysDepartMapper.queryUserDeparts(user.getId());
+        List<String> sysMultiOrgCode = new ArrayList<String>();
+        if (list == null || list.size() == 0) {
+            //当前用户无部门
+            //sysMultiOrgCode.add("0");
+        } else if (list.size() == 1) {
+            sysMultiOrgCode.add(list.get(0).getOrgCode());
+        } else {
+            info.setOneDepart(false);
+            for (SysDepart dpt : list) {
+                sysMultiOrgCode.add(dpt.getOrgCode());
+            }
+        }
+        info.setSysMultiOrgCode(sysMultiOrgCode);
+
+        return info;
+    }
+
+    // 根据部门Id查询
+    @Override
+    public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username) {
+        return userMapper.getUserByDepId(page, departId, username);
+    }
+
+    @Override
+    public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username) {
+        return userMapper.getUserByDepIds(page, departIds, username);
+    }
+
+    @Override
+    public List<SysUserVo> getAllUser(String userName) {
+        return userMapper.getAllUser(userName);
+    }
+
+    @Override
+    public Map<String, String> getDepNamesByUserIds(List<String> userIds) {
+        List<SysUserDepVo> list = this.baseMapper.getDepNamesByUserIds(userIds);
+        Map<String, String> res = new HashMap<String, String>();
+        list.forEach(item -> {
+                    if (res.get(item.getUserId()) == null) {
+                        res.put(item.getUserId(), item.getDepartName());
+                    } else {
+                        res.put(item.getUserId(), res.get(item.getUserId()) + "," + item.getDepartName());
+                    }
+                }
+        );
+        return res;
+    }
+
+    @Override
+    public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper) {
+        LambdaQueryWrapper<SysUser> lambdaQueryWrapper = queryWrapper.lambda();
+
+        lambdaQueryWrapper.eq(SysUser::getDelFlag, "0");
         lambdaQueryWrapper.inSql(SysUser::getId, "SELECT user_id FROM sys_user_depart WHERE dep_id = '" + departId + "'");
 
         return userMapper.selectPage(page, lambdaQueryWrapper);
-	}
+    }
 
-	@Override
-	public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) {
-		List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams);
-		Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);
+    @Override
+    public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) {
+        List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams);
+        Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);
 
-		IPage<SysUserSysDepartModel> result = new Page<>(page.getCurrent(), page.getSize(), total);
-		result.setRecords(list);
+        IPage<SysUserSysDepartModel> result = new Page<>(page.getCurrent(), page.getSize(), total);
+        result.setRecords(list);
 
-		return result;
-	}
+        return result;
+    }
 
-	// 根据角色Id查询
-	@Override
-	public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username) {
-		return userMapper.getUserByRoleId(page,roleId,username);
-	}
+    // 根据角色Id查询
+    @Override
+    public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username) {
+        return userMapper.getUserByRoleId(page, roleId, username);
+    }
 
 
-	@Override
-	@CacheEvict(value= {CacheConstant.SYS_USERS_CACHE}, key="#username")
-	public void updateUserDepart(String username,String orgCode) {
-		baseMapper.updateUserDepart(username, orgCode);
-	}
+    @Override
+    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, key = "#username")
+    public void updateUserDepart(String username, String orgCode) {
+        baseMapper.updateUserDepart(username, orgCode);
+    }
 
 
-	@Override
-	public SysUser getUserByPhone(String phone) {
-		return userMapper.getUserByPhone(phone);
-	}
+    @Override
+    public SysUser getUserByPhone(String phone) {
+        return userMapper.getUserByPhone(phone);
+    }
 
 
-	@Override
-	public SysUser getUserByEmail(String email) {
-		return userMapper.getUserByEmail(email);
-	}
+    @Override
+    public SysUser getUserByEmail(String email) {
+        return userMapper.getUserByEmail(email);
+    }
 
-	@Override
-	@Transactional
-	public void addUserWithDepart(SysUser user, String selectedParts) {
+    @Override
+    @Transactional
+    public void addUserWithDepart(SysUser user, String selectedParts) {
 //		this.save(user);  //保存角色的时候已经添加过一次了
-		if(oConvertUtils.isNotEmpty(selectedParts)) {
-			String[] arr = selectedParts.split(",");
-			for (String deaprtId : arr) {
-				SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId);
-				sysUserDepartMapper.insert(userDeaprt);
-			}
-		}
-	}
-
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
-	public void editUserWithDepart(SysUser user, String departs) {
-		this.updateById(user);  //更新角色的时候已经更新了一次了,可以再跟新一次
-		String[] arr = {};
-		if(oConvertUtils.isNotEmpty(departs)){
-			arr = departs.split(",");
-		}
-		//查询已关联部门
-		List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
-		if(userDepartList != null && userDepartList.size()>0){
-			for(SysUserDepart depart : userDepartList ){
-				//修改已关联部门删除部门用户角色关系
-				if(!Arrays.asList(arr).contains(depart.getDepId())){
-					List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
-							new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId,depart.getDepId()));
-					List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
-					if(roleIds != null && roleIds.size()>0){
-						departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
-								.in(SysDepartRoleUser::getDroleId,roleIds));
-					}
-				}
-			}
-		}
-		//先删后加
-		sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
-		if(oConvertUtils.isNotEmpty(departs)) {
-			for (String departId : arr) {
-				SysUserDepart userDepart = new SysUserDepart(user.getId(), departId);
-				sysUserDepartMapper.insert(userDepart);
-			}
-		}
-	}
-
-
-	/**
-	   * 校验用户是否有效
-	 * @param sysUser
-	 * @return
-	 */
-	@Override
-	public Result<?> checkUserIsEffective(SysUser sysUser) {
-		Result<?> result = new Result<Object>();
-		//情况1:根据用户信息查询,该用户不存在
-		if (sysUser == null) {
-			result.error500("该用户不存在,请注册");
-			sysBaseAPI.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
-			return result;
-		}
-		//情况2:根据用户信息查询,该用户已注销
-		if (CommonConstant.DEL_FLAG_1.toString().equals(sysUser.getDelFlag())) {
-			sysBaseAPI.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null);
-			result.error500("该用户已注销");
-			return result;
-		}
-		//情况3:根据用户信息查询,该用户已冻结
-		if (CommonConstant.USER_FREEZE.equals(sysUser.getStatus())) {
-			sysBaseAPI.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null);
-			result.error500("该用户已冻结");
-			return result;
-		}
-		return result;
-	}
-
-	@Override
-	public List<SysUser> queryLogicDeleted() {
-		return this.queryLogicDeleted(null);
-	}
-
-	@Override
-	public List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper) {
-		if (wrapper == null) {
-			wrapper = new LambdaQueryWrapper<>();
-		}
-		wrapper.eq(SysUser::getDelFlag, "1");
-		return userMapper.selectLogicDeleted(wrapper);
-	}
-
-	@Override
-	public boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity) {
-		String ids = String.format("'%s'", String.join("','", userIds));
-		return userMapper.revertLogicDeleted(ids, updateEntity) > 0;
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public boolean removeLogicDeleted(List<String> userIds) {
-		String ids = String.format("'%s'", String.join("','", userIds));
-		// 1. 删除用户
-		int line = userMapper.deleteLogicDeleted(ids);
-		// 2. 删除用户部门关系
-		line += sysUserDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getUserId, userIds));
-		//3. 删除用户角色关系
-		line += sysUserRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, userIds));
-		return line != 0;
-	}
+        if (oConvertUtils.isNotEmpty(selectedParts)) {
+            String[] arr = selectedParts.split(",");
+            for (String deaprtId : arr) {
+                SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId);
+                sysUserDepartMapper.insert(userDeaprt);
+            }
+        }
+    }
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
+    public void editUserWithDepart(SysUser user, String departs) {
+        this.updateById(user);  //更新角色的时候已经更新了一次了,可以再跟新一次
+        String[] arr = {};
+        if (oConvertUtils.isNotEmpty(departs)) {
+            arr = departs.split(",");
+        }
+        //查询已关联部门
+        List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
+        if (userDepartList != null && userDepartList.size() > 0) {
+            for (SysUserDepart depart : userDepartList) {
+                //修改已关联部门删除部门用户角色关系
+                if (!Arrays.asList(arr).contains(depart.getDepId())) {
+                    List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
+                            new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId, depart.getDepId()));
+                    List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
+                    if (roleIds != null && roleIds.size() > 0) {
+                        departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
+                                .in(SysDepartRoleUser::getDroleId, roleIds));
+                    }
+                }
+            }
+        }
+        //先删后加
+        sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
+        if (oConvertUtils.isNotEmpty(departs)) {
+            for (String departId : arr) {
+                SysUserDepart userDepart = new SysUserDepart(user.getId(), departId);
+                sysUserDepartMapper.insert(userDepart);
+            }
+        }
+    }
+
+
+    /**
+     * 校验用户是否有效
+     *
+     * @param sysUser
+     * @return
+     */
+    @Override
+    public Result<?> checkUserIsEffective(SysUser sysUser) {
+        Result<?> result = new Result<Object>();
+        //情况1:根据用户信息查询,该用户不存在
+        if (sysUser == null) {
+            result.error500("该用户不存在,请注册");
+            sysBaseAPI.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
+            return result;
+        }
+        //情况2:根据用户信息查询,该用户已注销
+        if (CommonConstant.DEL_FLAG_1.toString().equals(sysUser.getDelFlag())) {
+            sysBaseAPI.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null);
+            result.error500("该用户已注销");
+            return result;
+        }
+        //情况3:根据用户信息查询,该用户已冻结
+        if (CommonConstant.USER_FREEZE.equals(sysUser.getStatus())) {
+            sysBaseAPI.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null);
+            result.error500("该用户已冻结");
+            return result;
+        }
+        return result;
+    }
+
+    @Override
+    public List<SysUser> queryLogicDeleted() {
+        return this.queryLogicDeleted(null);
+    }
+
+    @Override
+    public List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper) {
+        if (wrapper == null) {
+            wrapper = new LambdaQueryWrapper<>();
+        }
+        wrapper.eq(SysUser::getDelFlag, "1");
+        return userMapper.selectLogicDeleted(wrapper);
+    }
+
+    @Override
+    public boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity) {
+        String ids = String.format("'%s'", String.join("','", userIds));
+        return userMapper.revertLogicDeleted(ids, updateEntity) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean removeLogicDeleted(List<String> userIds) {
+        String ids = String.format("'%s'", String.join("','", userIds));
+        // 1. 删除用户
+        int line = userMapper.deleteLogicDeleted(ids);
+        // 2. 删除用户部门关系
+        line += sysUserDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getUserId, userIds));
+        //3. 删除用户角色关系
+        line += sysUserRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, userIds));
+        return line != 0;
+    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -447,24 +452,24 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return true;
     }
 
-	@Override
-	public void saveThirdUser(SysUser sysUser) {
-		//保存用户
-		String userid = UUIDGenerator.generate();
-		sysUser.setId(userid);
-		baseMapper.insert(sysUser);
-		//获取第三方角色
-		SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
-		//保存用户角色
-		SysUserRole userRole = new SysUserRole();
-		userRole.setRoleId(sysRole.getId());
-		userRole.setUserId(userid);
-		sysUserRoleMapper.insert(userRole);
-	}
-
-	@Override
-	public List<SysUser> queryByDepIds(List<String> departIds, String username) {
-		return userMapper.queryByDepIds(departIds,username);
-	}
+    @Override
+    public void saveThirdUser(SysUser sysUser) {
+        //保存用户
+        String userid = UUIDGenerator.generate();
+        sysUser.setId(userid);
+        baseMapper.insert(sysUser);
+        //获取第三方角色
+        SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
+        //保存用户角色
+        SysUserRole userRole = new SysUserRole();
+        userRole.setRoleId(sysRole.getId());
+        userRole.setUserId(userid);
+        sysUserRoleMapper.insert(userRole);
+    }
+
+    @Override
+    public List<SysUser> queryByDepIds(List<String> departIds, String username) {
+        return userMapper.queryByDepIds(departIds, username);
+    }
 
 }

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

@@ -10,26 +10,27 @@ server:
     mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 
 management:
- endpoints:
-  web:
-   exposure:
-    include: metrics,httptrace
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
 
 spring:
   devtools:
     restart:
       enabled: true
   servlet:
-     multipart:
-        max-file-size: 10MB
-        max-request-size: 10MB
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
   mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
+    host: smtp.exmail.qq.com
+    username: notice@c-top.com.cn
+    password: Hcst@2019
     properties:
       mail:
         smtp:
+          ssl.enable: enable
           auth: true
           starttls:
             enable: true
@@ -134,9 +135,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.31.213:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
           username: hcst
-          password: test@20190531
+          password: hcst2020
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:

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

@@ -17,12 +17,13 @@ spring:
       max-file-size: -1
       max-request-size: -1
   mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
+    host: smtp.exmail.qq.com
+    username: notice@c-top.com.cn
+    password: Hcst@2019
     properties:
       mail:
         smtp:
+          ssl.enable: enable
           auth: true
           starttls:
             enable: true

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

@@ -17,12 +17,13 @@ spring:
       max-file-size: -1
       max-request-size: -1
   mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
+    host: smtp.exmail.qq.com
+    username: notice@c-top.com.cn
+    password: Hcst@2019
     properties:
       mail:
         smtp:
+          ssl.enable: enable
           auth: true
           starttls:
             enable: true

+ 6 - 5
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -21,12 +21,13 @@ spring:
       max-file-size: -1
       max-request-size: -1
   mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
+    host: smtp.exmail.qq.com
+    username: notice@c-top.com.cn
+    password: Hcst@2019
     properties:
       mail:
         smtp:
+          ssl.enable: enable
           auth: true
           starttls:
             enable: true
@@ -96,9 +97,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://39.106.184.70/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.31.213:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
           username: hcst
-          password: test@20190531
+          password: hcst2020
           driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:

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

@@ -181,4 +181,4 @@ oss:
   replace:
     replace-value: oss-cn-beijing-internal
     replace-old-value: oss-cn-beijing
-    download: /mnt/file/video/
+    download: D://mnt//image//

+ 0 - 17
jeecg-boot-module-system/src/main/resources/drools/rule.drl

@@ -1,17 +0,0 @@
-import org.jeecg.modules.ctop.service.impl.RuleEngineServiceImpl
-import org.slf4j.LoggerFactory
-import org.slf4j.Logger
-import org.jeecg.modules.ctop.vo.QueryParam;
-import org.jeecg.modules.ctop.vo.RuleResult;
-dialect  "java"
-rule "paramcheck1"
-    salience 99
-    when queryParam : QueryParam(paramId != null && paramSign.equals("+"))
-        resultParam : RuleResult()
-    then
-        final Logger LOGGER = LoggerFactory.getLogger("param-check-one 规则引擎") ;
-        LOGGER.info("参数:getParamId="+queryParam.getParamId()+";getParamSign="+queryParam.getParamSign());
-        RuleEngineServiceImpl ruleEngineService = new RuleEngineServiceImpl() ;
-        ruleEngineService.executeAddRule(queryParam);
-        resultParam.setPostCodeResult(true);
-end

+ 0 - 17
jeecg-boot-module-system/src/main/resources/drools/rule2.drl

@@ -1,17 +0,0 @@
-import org.slf4j.Logger
-import org.slf4j.LoggerFactory
-import org.jeecg.modules.ctop.service.impl.RuleEngineServiceImpl
-import org.jeecg.modules.ctop.vo.QueryParam;
-import org.jeecg.modules.ctop.vo.RuleResult;
-dialect  "java"
-rule "paramcheck2"
-    salience 88
-    when queryParam : QueryParam(paramId != null && paramSign.equals("-"))
-        resultParam : RuleResult()
-    then
-        final Logger LOGGER = LoggerFactory.getLogger("param-check-two 规则引擎") ;
-        LOGGER.info("参数:getParamId="+queryParam.getParamId()+";getParamSign="+queryParam.getParamSign());
-        RuleEngineServiceImpl ruleEngineService = new RuleEngineServiceImpl() ;
-        ruleEngineService.executeRemoveRule(queryParam);
-        resultParam.setPostCodeResult(true);
-end

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,8 +1,8 @@
 #mysql
 diver_name=com.mysql.jdbc.Driver
-url=jdbc:mysql://39.106.184.70:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
-username=hcst
-password=test@20190531
+url=jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
+username=root
+password=123456
 database_name=jeecg-boot
 #oracle
 #diver_name=oracle.jdbc.driver.OracleDriver

+ 113 - 35
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,16 +1,23 @@
 package org.jeecg;
 
+import cn.com.ctop.check.component.execute.GroovyScriptExecutor;
+import cn.com.ctop.check.entity.CtopCheckTaskList;
+import cn.com.ctop.check.service.ICtopCheckTaskListService;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
 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.IMaterialImageInfoService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 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.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -37,50 +44,84 @@ public class SampleTest {
     @Autowired
     private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
     @Autowired
-    private IKuaiShouDailyAgentService kuaiShouDailyAgentService;
-    @Autowired
     private IReportService reportService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
+    @Autowired
+    private IMaterialImageInfoService imageInfoService;
+    @Autowired
+    private IWechatCheckinDataService wechatCheckinDataService;
+
+    @Test
+    public void loadBytedanceMatData() {
+        wechatCheckinDataService.getCheckinData();
+    }
+
+    @Test
+    public void initImageCode() {
+        List<MaterialImageInfo> imageInfos = imageInfoService.list();
+        for (MaterialImageInfo image : imageInfos) {
+            imageInfoService.initImageCode(image);
+        }
+    }
+
 
     @Test
     public void loadBytedanceCreativeData() {
-     //   refreshTokenService.getKuaiShouAgentRefresh();
-        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
-        kuaiShouDailyAgentService.getAgentReportByPage(nowDate, nowDate);
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("media_id", 2);
+        List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
+        for (CtopOauthToken token : list) {
+            kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-20", "2020-09-20", "daily");
+
+        }
+
+    }
+
+    @Test
+    public void getTaskList() {
+        kuaiShouHistoryReportTaskService.getTaskList();
     }
 
+
     @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
+
     @Test
-    public void loadKuaishouCookie(){
-        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY,1);
-        if(list!=null&&!list.isEmpty()){
-            for (BindAccountLogin login:list) {
-                if(null==login.getCookie()||"".equals(login.getCookie().trim())){
+    public void loadKuaishouCookie() {
+        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
+        if (list != null && !list.isEmpty()) {
+            int i = 0;
+            for (BindAccountLogin login : list) {
+                if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
+                    if (i > 5) {
+                        break;
+                    }
                     kuaishouWebInterfaceService.getkuaishouWebLoginCookie(login);
+                    i++;
                 }
             }
         }
     }
+
     static ExecutorService executorService = null;
-    //线程计数器
     static CountDownLatch countDownLatch = null;
 
     @Test
-    public void deleteKuaishouComment(){
+    public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
-        List<BindAccountLogin>loginList = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY,1);
+        List<BindAccountLogin> loginList = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
         if (loginList != null && !loginList.isEmpty()) {
             executorService = Executors.newFixedThreadPool(5);
             countDownLatch = new CountDownLatch(loginList.size());
-            loginList.forEach(login -> executorService.submit(()->{
+            loginList.forEach(login -> executorService.submit(() -> {
                 try {
-                    kuaishouWebInterfaceService.deleteAllComment(new HashMap<>(),login);
-                }catch (Exception e){
-                    log.error(e.getMessage(),e);
-                }finally {
+                    kuaishouWebInterfaceService.deleteAllComment(new HashMap<>(), login);
+                } catch (Exception e) {
+                    log.error(e.getMessage(), e);
+                } finally {
                     countDownLatch.countDown();
                 }
             }));
@@ -90,35 +131,72 @@ public class SampleTest {
                 e.printStackTrace();
             }
             Long end = System.currentTimeMillis();
-            log.info("快手删评论所用时长:{}毫秒",end-start);
+            log.info("快手删评论所用时长:{}毫秒", end - start);
         }
     }
+
     @Autowired
     private IUserAllocationService allocationService;
+
     @Test
     public void testLoadBytedanceData() {
-        List<UserAllocation>allocations = allocationService.getByParams(435L,null,0);
-        for (UserAllocation allocation:allocations) {
-            for(int i=2;i<10;i++){
+        List<UserAllocation> allocations = allocationService.getByParams(430L, null, 0);
+        for (UserAllocation allocation : allocations) {
+            for (int i = 0; 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);
+                Date getDate = DateUtils.addDay(new Date(), -i);
+                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
             }
         }
     }
 
     @Test
     public void loadKuaishouAgentData() {
-//        for(int i=0;i<20;i++){
-//            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(),-i));
-//            kuaishouReportDailyAgentService.getReport(currentDate,DateUtils.getNowDate("yyyy-MM-dd"));
-//        }
+        kuaishouReportDailyAgentService.loginAgent();
+        for (int i = 0; i < 20; i++) {
+            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+            kuaishouReportDailyAgentService.getReport(currentDate, DateUtils.getNowDate("yyyy-MM-dd"));
+        }
 //
-//        int currentPage = 1;
-//        while (kuaishouReportDailyAgentService.getAccount(currentPage)){
-//            currentPage++;
+//        try {
+//            for (int i = 1; i < 30; i++) {
+//                kuaishouReportDailyAgentService.getAccount(i);
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
 //        }
-        String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(),-1));
-        kuaishouReportDailyAgentService.getReport(currentDate,DateUtils.getNowDate("yyyy-MM-dd"));
     }
+
+    @Autowired
+    private GroovyScriptExecutor groovyScriptExecutor;
+
+    @Autowired
+    private ICtopCheckTaskListService checkTaskListService;
+
+    @Test
+    public void checkDataStateJobTest() {
+        //查询需要检查的任务列表
+        List<CtopCheckTaskList> ctopCheckTaskList = checkTaskListService.queryExecuteList("checkDataStateJob");
+        if (ctopCheckTaskList != null) {
+            ctopCheckTaskList.forEach(it -> groovyScriptExecutor.execute(it));
+        }
+    }
+
+    @Test
+    public void loadAccountData() {
+        CtopOauthToken token = oauthTokenService.getTokenByAccountId(1665922219192387L);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-09-01", "yy-MM-dd"), DateUtils.parseDate("2020-09-01", "yy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+    }
+
+    @Test
+    public void testBytedanceVideoReport() {
+        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+        for (int i = 2; i < 100; i++) {
+            String date = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+            for (CtopOauthToken token : tokens) {
+//                bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
+            }
+        }
+    }
+
 }

+ 4 - 0
module-check/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskExecutorCtrl.java

@@ -0,0 +1,4 @@
+package cn.com.ctop.check.controller;
+
+public class CtopCheckTaskExecutorCtrl {
+}

+ 6 - 1
module-check/src/main/java/cn/com/ctop/check/script/TestGroovyScript.java

@@ -5,6 +5,7 @@ import cn.com.ctop.check.service.ICtopCheckTaskListService;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.ICustomDataByAccountService;
+import cn.com.ctop.common.module.service.IUReportExportService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.service.impl.CustomDataByAccountImpl;
 import cn.com.ctop.common.module.service.impl.UserAllocationServiceImpl;
@@ -44,11 +45,15 @@ public class TestGroovyScript {
     @Autowired
     ICustomDataByAccountService customDataByAccountService;
 
+    @Autowired
+    IUReportExportService iuReportExportService;
+
     @GetMapping("/test")
     public Result testGroovy(){
         //groovyScriptExecutor.execute(2,"CheckAccountStatusScript");
         //groovyScriptExecutor.execute(13,"CheckKsDataDiffScript");
-        groovyScriptExecutor.execute(14,"CheckByDataDiffScript");
+        //groovyScriptExecutor.execute(14,"CheckByDataDiffScript");
+        iuReportExportService.exportExcel("file:2048球球大作战-日报.ureport.xml ");
         return Result.ok();
     }
 }

+ 2 - 0
module-check/src/main/java/cn/com/ctop/notice/handler/SendWeChatHandle.java

@@ -52,6 +52,8 @@ public class SendWeChatHandle {
                     messageList.add(message.substring((i+1)*1006));
                 }
             }
+        }else {
+            messageList.add(message);
         }
         return messageList;
     }

+ 16 - 0
module-common/pom.xml

@@ -84,6 +84,22 @@
             <artifactId>cos_api</artifactId>
             <version>5.6.25</version>
         </dependency>
+        <dependency>
+            <groupId>com.rabbitmq</groupId>
+            <artifactId>amqp-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tony19</groupId>
+            <artifactId>apktool-lib</artifactId>
+            <version>1.4.4-3</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.googlecode.plist</groupId>
+            <artifactId>dd-plist</artifactId>
+            <version>1.16</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 295 - 0
module-common/src/main/java/cn/com/ctop/common/module/controller/ProductController.java

@@ -0,0 +1,295 @@
+package cn.com.ctop.common.module.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.Product;
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.mapper.ProjectMapper;
+import cn.com.ctop.common.module.service.IProductService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+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;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 产品表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-08
+ */
+@Slf4j
+@Api(tags = "产品表")
+@RestController
+@RequestMapping("/ctop/product")
+public class ProductController {
+    @Autowired
+    private IProductService productService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param product
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "产品表-分页列表查询")
+    @ApiOperation(value = "产品表-分页列表查询", notes = "产品表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<Product>> queryPageList(Product product,
+                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                HttpServletRequest req) {
+        Result<IPage<Product>> result = new Result<>();
+        String productName = product.getProductName();
+        product.setProductName(null);
+        QueryWrapper<Product> queryWrapper = QueryGenerator.initQueryWrapper(product, req.getParameterMap());
+        if (!Check.isNull(productName)) {
+            queryWrapper.like("product_name", productName);
+        }
+        Page<Product> page = new Page<>(pageNo, pageSize);
+        IPage<Product> pageList = productService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    @AutoLog(value = "产品表-分页列表查询")
+    @ApiOperation(value = "产品表-分页列表查询", notes = "产品表-分页列表查询")
+    @GetMapping(value = "/productList")
+    public Result<List<Product>> productList(Product product,
+                                             HttpServletRequest req) {
+        Result<List<Product>> result = new Result<>();
+        QueryWrapper<Product> queryWrapper = QueryGenerator.initQueryWrapper(product, req.getParameterMap());
+        List<Product> list = productService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param product
+     * @return
+     */
+    @AutoLog(value = "产品表-添加")
+    @ApiOperation(value = "产品表-添加", notes = "产品表-添加")
+    @PostMapping(value = "/add")
+    public Result<Product> add(@RequestBody Product product) {
+        Result<Product> result = new Result<>();
+        try {
+            productService.save(product);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param product
+     * @return
+     */
+    @AutoLog(value = "产品表-编辑")
+    @ApiOperation(value = "产品表-编辑", notes = "产品表-编辑")
+    @PostMapping(value = "/edit")
+    public Result<Product> edit(@RequestBody Product product) {
+        Result<Product> result = new Result<Product>();
+        Product productEntity = productService.getById(product.getId());
+        if (productEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = productService.updateById(product);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @Autowired
+    private ProjectMapper projectMapper;
+    @Autowired
+    private ProjectMapper projectMemberMapper;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    @AutoLog(value = "产品表-通过id删除")
+    @ApiOperation(value = "产品表-通过id删除", notes = "产品表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            productService.removeById(id);
+            QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("product_id", id);
+            List<Project> projects = projectMapper.selectList(queryWrapper);
+            if (!Check.isNull(projects)) {
+                for (Project project : projects) {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("project_id", project.getId());
+                    projectMemberMapper.deleteByMap(map);
+                    userAllocationService.removeByMap(map);
+                }
+            }
+            Map<String, Object> deleteProjectMap = new HashMap<>();
+            deleteProjectMap.put("product_id", id);
+            projectMapper.deleteByMap(deleteProjectMap);
+
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "产品表-批量删除")
+    @ApiOperation(value = "产品表-批量删除", notes = "产品表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<Product> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<Product> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.productService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "产品表-通过id查询")
+    @ApiOperation(value = "产品表-通过id查询", notes = "产品表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<Product> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<Product> result = new Result<>();
+        Product product = productService.getById(id);
+        if (product == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(product);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<Product> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                Product product = JSON.parseObject(deString, Product.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(product, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<Product> pageList = productService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "产品表列表");
+        mv.addObject(NormalExcelConstants.CLASS, Product.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("产品表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<Product> listProducts = ExcelImportUtil.importExcel(file.getInputStream(), Product.class, params);
+                productService.saveBatch(listProducts);
+                return Result.ok("文件导入成功!数据行数:" + listProducts.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/ActCustomForm.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -27,6 +28,7 @@ public class ActCustomForm {
 	private Long id;
 	private String name;
 	private String text;
+	@Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
 	private String userId;
 	private Integer status;
 	private Date createTime;

+ 3 - 5
module-common/src/main/java/cn/com/ctop/common/module/entity/ActFormData.java

@@ -3,7 +3,6 @@ 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 lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -20,15 +19,14 @@ import java.util.Date;
 @TableName("ctop_act_form_data")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value="ctop_act_form_data对象", description="自定义表单存储数据")
 public class ActFormData {
 
 	@TableId(type = IdType.AUTO)
 	private Long id;
 	private Long formId;
-	private String processId;
-	private String key;
-	private String value;
+	private String userId;
+	private String bussinessId;
+	private String content;
 	private Integer status;
 	private Date createTime;
 	private Date updateTime;

+ 1 - 31
module-common/src/main/java/cn/com/ctop/common/module/entity/Advertiser.java

@@ -1,8 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -42,32 +40,6 @@ public class Advertiser {
     @Excel(name = "广告主名称", width = 15)
     @ApiModelProperty(value = "广告主名称")
     private String name;
-    /**
-     * 行业ID
-     */
-    @Excel(name = "行业ID", width = 15)
-    @ApiModelProperty(value = "行业ID")
-    @Dict(dicCode = "id",dictTable="sys_category",dicText="name")
-    private String industryId;
-    private String industryCode;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "销售ID", width = 15)
-    @ApiModelProperty(value = "销售ID")
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-    private String saleId;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "广告主类别", width = 15)
-    @ApiModelProperty(value = "广告主类别")
-    private Integer advertiserType;
-
-    /**
-     * 代理商Id
-     */
-    private Long agentId;
 
     /**
      * 联系人姓名
@@ -115,12 +87,10 @@ public class Advertiser {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
     private String userId;
 
     private String companyId;
 
-    @TableField(exist = false)
-    private String saleName;
-
 
 }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialImageInfo.java

@@ -44,7 +44,7 @@ public class MaterialImageInfo {
      */
     @Excel(name = "url", width = 15)
     @ApiModelProperty(value = "url")
-    private Object url;
+    private String url;
     /**
      * 素材名称
      */

+ 53 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialTagInfo.java

@@ -0,0 +1,53 @@
+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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 素材标签信息
+ * @author jeecg-boot
+ * @date   2020-08-27
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_material_tag_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_material_tag_info对象", description="素材标签信息")
+public class MaterialTagInfo {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    private Long id;
+	private String code;
+	private Integer status;
+	private String tagName;
+	private String tagCode;
+	private Long categoryId;
+	private Long tagId;
+	private String userId;
+	private Date createTime;
+	private Date updateTime;
+
+	public MaterialTagInfo(String code, TagInfo tagInfo,String userId) {
+		this.tagId = tagInfo.getId();
+		this.code = code;
+		this.status = 1;
+		this.tagCode = tagInfo.getTagCode();
+		this.tagName = tagInfo.getTagName();
+		this.userId = userId;
+		this.createTime = new Date();
+		this.updateTime = new Date();
+	}
+
+	public MaterialTagInfo() {
+
+	}
+}

+ 22 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MusicInfo.java

@@ -0,0 +1,22 @@
+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 lombok.Data;
+
+@Data
+@TableName("ctop_music_info")
+public class MusicInfo {
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+    private String name;
+    private String author;
+    private Integer usedCount;
+    private String musicUrl;
+    private String coverUrl;
+    private Integer duration;
+    private String source;
+    private Long extId;
+    private String extInfo;
+}

+ 20 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MusicType.java

@@ -0,0 +1,20 @@
+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 lombok.Data;
+
+@Data
+@TableName("ctop_music_type")
+public class MusicType {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+    private String type;
+    private String typeValue;
+    private String extType;
+    private String extTypeValue;
+    private Long musicId;
+    private String musicName;
+    private String author;
+}

+ 44 - 13
module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java

@@ -1,44 +1,75 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
+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 org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.util.Date;
 
 /**
- * 产品
+ * 产品表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-08
  */
 @Data
+@TableName("ctop_product")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_product对象", description = "产品表")
 public class Product {
+
     /**
      * id
      */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
     private Long id;
     /**
-     * 产品名
+     * 产品名
      */
+    @Excel(name = "产品名", width = 15)
+    @ApiModelProperty(value = "产品名")
     private String productName;
     /**
-     * 广告主id
+     * advertiserId
      */
+    @Excel(name = "advertiserId", width = 15)
+    @ApiModelProperty(value = "advertiserId")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
-
-    private String advertiserName;
-
     /**
      * 创建人
      */
-    private String createUserId;
+    @Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
+    private String userId;
 
+    @Dict(dicCode = "id", dictTable = "sys_category", dicText = "name")
+    private String industryId;
     /**
-     * 媒体类型
+     * 1正常0删除
      */
-    private String mediaId;
-
+    @Excel(name = "1正常0删除", width = 15)
+    @ApiModelProperty(value = "1正常0删除")
+    private Integer productStatus;
     /**
-     * 创建时间
+     * createTime
      */
+    @ApiModelProperty(value = "createTime")
     private Date createTime;
-
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
     private Date updateTime;
-
 }

+ 16 - 15
module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -47,16 +47,15 @@ public class Project {
      */
     @Excel(name = "广告主id", width = 15)
     @ApiModelProperty(value = "广告主id")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
 
-    @Excel(name = "广告主名称", width = 15)
-    @ApiModelProperty(value = "广告主名称")
-    private String advertiserName;
 
-    @Dict(dicCode = "id", dictTable = "sys_category", dicText = "name")
-    private String industryId;
-    @Dict(dicCode = "code", dictTable = "sys_category", dicText = "name")
-    private String industryCode;
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    @Dict(dicCode = "id", dictTable = "ctop_product", dicText = "product_name")
+    private Long productId;
+
     /**
      * 创建人
      */
@@ -68,21 +67,15 @@ public class Project {
      */
     @Excel(name = "负责人id", width = 15)
     @ApiModelProperty(value = "负责人id")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String responsibleId;
 
 
-    @Excel(name = "负责人名称", width = 15)
-    @ApiModelProperty(value = "负责人名称")
-    private String responsibleName;
-
     @Excel(name = "设计负责人", width = 15)
     @ApiModelProperty(value = "设计负责人")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String designResponsibleId;
 
-    @Excel(name = "设计负责人名称", width = 15)
-    @ApiModelProperty(value = "设计负责人名称")
-    private String designResponsibleName;
-
 
     @Excel(name = "公司id", width = 15)
     @ApiModelProperty(value = "公司id")
@@ -114,6 +107,7 @@ public class Project {
      * 最高深度转化出价
      */
     private BigDecimal maxDeepCpaBid;
+    private Integer checkLink;
     /**
      * 创建时间
      */
@@ -134,4 +128,11 @@ public class Project {
     @TableField(exist = false)
     private Integer needExamine;
 
+
+   /* @TableField(exist = false)
+    private String responsibleName; // 运营负责人
+
+
+    private String designResponsibleName; // 产品负责人
+*/
 }

+ 24 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/TagCategoryInfo.java

@@ -0,0 +1,24 @@
+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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+@Data
+@TableName("ctop_tag_category")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class TagCategoryInfo {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private String name;
+    private String code;
+    private Integer status;
+    private Date createTime;
+    private Date updateTime;
+}

+ 21 - 4
module-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java

@@ -1,15 +1,17 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 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;
+import java.util.List;
 
 /**
  * 标签信息
@@ -23,18 +25,33 @@ import java.util.Date;
 @Accessors(chain = true)
 @ApiModel(value="ctop_tag_info对象", description="标签信息")
 public class TagInfo {
-
-	/**id*/
 	@TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "id")
 	private Long id;
+	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
 	private Long parentId;
+	private Long tagCategoryId;
+	private String tagCategoryName;
+	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
+	private Long firstTagId;
+	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
+	private Long secendTagId;
+	@Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
+	private String userId;
 	private String tagName;
 	private Integer tagOrder;
 	private String description;
+	private String model;
 	private String tagCode;
+	private Integer level;
 	private Integer status;
 	private Integer delFlag;
+	@TableField(value="is_leaf")
+	private boolean leaf;
 	private Date createTime;
 	private Date updateTime;
+
+	@TableField(exist = false)
+	List<TagInfo> children;
+
+
 }

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


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels