ソースを参照

Merge branch 'master' of http://39.106.184.70:3000/ctop/adsp-boot

yumeng 5 年 前
コミット
c539000115
100 ファイル変更843 行追加4595 行削除
  1. 19 17
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 14 14
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/jsonschema/JsonschemaUtil.java
  3. 13 48
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/oConvertUtils.java
  4. 0 22
      jeecg-boot-module-system/pom.xml
  5. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java
  6. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/WebMvcConfiguration.java
  7. 101 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/interceptors/BrowseLogHandelInterceptor.java
  8. 31 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java
  9. 19 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdCoverController.java
  10. 24 46
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  11. 9 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AgentInfoController.java
  12. 12 96
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountAuthController.java
  13. 6 93
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  14. 0 294
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java
  15. 3 191
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  16. 0 164
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceFundDailyController.java
  17. 29 51
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  18. 0 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CreativeTitleController.java
  19. 7 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CtopOauthTokenController.java
  20. 8 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaInfoController.java
  21. 7 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaItemInfoController.java
  22. 7 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaRoleInfoController.java
  23. 8 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/EduLessonController.java
  24. 0 250
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/EduLessonNewController.java
  25. 10 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/FileInfoController.java
  26. 7 13
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/GraphqlController.java
  27. 4 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/HotInformationCtroller.java
  28. 10 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageDownloadController.java
  29. 7 91
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaiShouDefectMaterialController.java
  30. 14 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAdvertiserController.java
  31. 8 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAppAccountController.java
  32. 35 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAppProductController.java
  33. 7 94
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouChannelRegInfoController.java
  34. 8 92
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialAscriptionController.java
  35. 1 85
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialCutFrameController.java
  36. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java
  37. 10 140
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  38. 7 91
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialParameterController.java
  39. 6 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialPartController.java
  40. 7 91
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTagController.java
  41. 1 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialUploadController.java
  42. 52 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PangolinController.java
  43. 15 109
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  44. 12 98
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  45. 9 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/SalePerformanceDetailController.java
  46. 7 91
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ScriptTagInfoController.java
  47. 0 249
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/SourceFileController.java
  48. 15 392
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  49. 0 32
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestMqController.java
  50. 13 95
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TransferAccountController.java
  51. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileBindUserController.java
  52. 8 90
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileController.java
  53. 15 100
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  54. 29 116
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoMergeTaskController.java
  55. 26 110
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoPartController.java
  56. 7 91
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoWatermarkTaskController.java
  57. 29 115
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoWatermarkTemplateController.java
  58. 16 76
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/YardController.java
  59. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaInfo.java
  60. 0 100
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/EduLessonNew.java
  61. 1 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java
  62. 6 31
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java
  63. 4 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  64. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java
  65. 3 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java
  66. 10 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java
  67. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java
  68. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  69. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java
  70. 4 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyAccountReportAsyncJob.java
  71. 4 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyCampaignReportAsyncJob.java
  72. 5 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyCreativeReportAsyncJob.java
  73. 1 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java
  74. 3 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java
  75. 3 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyPlanReportAsyncJob.java
  76. 1 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyReportAsyncTaskGetJob.java
  77. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  78. 7 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  79. 5 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  80. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  81. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java
  82. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java
  83. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java
  84. 0 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  85. 0 36
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/EffiVideoJob.java
  86. 5 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java
  87. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java
  88. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java
  89. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  90. 2 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  91. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  92. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/RefreshTokenJob.java
  93. 0 42
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TestJob.java
  94. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java
  95. 23 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  96. 0 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CleanMaterialMapper.java
  97. 0 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/EduLessonNewMapper.java
  98. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ByteDanceCleanMaterialReportMapper.xml
  99. 0 51
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CleanMaterialMapper.xml
  100. 0 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/KuaiShouCleanMaterialReportMapper.xml

+ 19 - 17
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -20,10 +20,10 @@ public class DateUtils extends PropertyEditorSupport {
     /**
      * 以毫秒表示的时间
      */
-    private static final long DAY_IN_MILLIS = 24 * 3600 * 1000;
-    private static final long HOUR_IN_MILLIS = 3600 * 1000;
-    private static final long MINUTE_IN_MILLIS = 60 * 1000;
-    private static final long SECOND_IN_MILLIS = 1000;
+    private static final long DAY_IN_MILLIS = 24 * 3600 * 1000L;
+    private static final long HOUR_IN_MILLIS = 3600 * 1000L;
+    private static final long MINUTE_IN_MILLIS = 60 * 1000L;
+    private static final long SECOND_IN_MILLIS = 1000L;
 
 
     public static boolean compare(String beginDate, String nowDate) throws ParseException {
@@ -140,11 +140,7 @@ public class DateUtils extends PropertyEditorSupport {
      */
     public static String date2Str() {
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-        Date date = getDate();
-        if (null == date) {
-            return null;
-        }
-        return format.format(date);
+        return format.format(new Date());
     }
 
     /**
@@ -173,9 +169,6 @@ public class DateUtils extends PropertyEditorSupport {
      */
     public static String getDate(String format) {
         Date date = new Date();
-        if (null == date) {
-            return null;
-        }
         SimpleDateFormat sdf = new SimpleDateFormat(format);
         return sdf.format(date);
     }
@@ -493,9 +486,13 @@ public class DateUtils extends PropertyEditorSupport {
      * @throws ParseException
      * @throws
      */
-    public static Date parseDate(String src, String pattern) throws ParseException {
-        return getDateFormat(pattern).parse(src);
-
+    public static Date parseDate(String src, String pattern) {
+        try {
+            return getDateFormat(pattern).parse(src);
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return null;
+        }
     }
 
     /**
@@ -768,9 +765,14 @@ public class DateUtils extends PropertyEditorSupport {
         return sdf.format(calendar.getTime());
     }
 
-    public static String addDay(String dateString, int day) throws ParseException {
+    public static String addDay(String dateString, int day) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        Date date = sdf.parse(dateString);
+        Date date = null;
+        try {
+            date = sdf.parse(dateString);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);
         calendar.add(Calendar.DAY_OF_YEAR, day);

+ 14 - 14
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/jsonschema/JsonschemaUtil.java

@@ -1,15 +1,13 @@
 package org.jeecg.common.util.jsonschema;
 
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+
 import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import lombok.extern.slf4j.Slf4j;
-
 @Slf4j
 public class JsonschemaUtil {
 
@@ -74,26 +72,28 @@ public class JsonschemaUtil {
      * @param fileName
      * @return
      */
-    public static String readJsonFile(String fileName) {
+	public static String readJsonFile(String fileName) throws IOException {
         String jsonStr = "";
-        try {
+		FileReader fileReader = null;
+		Reader reader = null;
+		try {
             File jsonFile = new File(fileName);
-            FileReader fileReader = new FileReader(jsonFile);
-
-            Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
+			fileReader = new FileReader(jsonFile);
+			reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
             int ch = 0;
             StringBuffer sb = new StringBuffer();
             while ((ch = reader.read()) != -1) {
                 sb.append((char) ch);
             }
-            fileReader.close();
-            reader.close();
             jsonStr = sb.toString();
             return jsonStr;
-        } catch (IOException e) {
+		} catch (Exception e) {
             e.printStackTrace();
             return null;
-        }
+		} finally {
+			fileReader.close();
+			reader.close();
+		}
     }
 
 }

+ 13 - 48
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/oConvertUtils.java

@@ -3,7 +3,6 @@ package org.jeecg.common.util;
 import org.apache.commons.lang.StringEscapeUtils;
 
 import javax.servlet.http.HttpServletRequest;
-import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -47,23 +46,11 @@ public class oConvertUtils {
 		return temp;
 	}
 
-    public static String strToUtf(String strIn, String sourceCode, String targetCode) {
-		strIn = "";
-		try {
-			strIn = new String(strIn.getBytes("ISO-8859-1"), "GBK");
-		} catch (UnsupportedEncodingException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return strIn;
-
-	}
-
 	private static String code2code(String strIn, String sourceCode, String targetCode) {
-		String strOut = null;
         if (strIn == null || "".equals(strIn.trim())) {
 			return strIn;
 		}
+		String strOut = null;
 		try {
 			byte[] b = strIn.getBytes(sourceCode);
 			strOut = new String(b, targetCode);
@@ -75,7 +62,7 @@ public class oConvertUtils {
 	}
 
 	public static int getInt(String s, int defval) {
-		if (s == null || s == "") {
+		if (s == null || s.trim().equals("")) {
 			return (defval);
 		}
 		try {
@@ -86,7 +73,7 @@ public class oConvertUtils {
 	}
 
 	public static int getInt(String s) {
-		if (s == null || s == "") {
+		if (s == null || s.trim().equals("")) {
 			return 0;
 		}
 		try {
@@ -97,7 +84,7 @@ public class oConvertUtils {
 	}
 
 	public static int getInt(String s, Integer df) {
-		if (s == null || s == "") {
+		if (s == null || s.trim().equals("")) {
 			return df;
 		}
 		try {
@@ -108,10 +95,10 @@ public class oConvertUtils {
 	}
 
 	public static Integer[] getInts(String[] s) {
-		Integer[] integer = new Integer[s.length];
 		if (s == null) {
 			return null;
 		}
+		Integer[] integer = new Integer[s.length];
 		for (int i = 0; i < s.length; i++) {
 			integer[i] = Integer.parseInt(s[i]);
 		}
@@ -120,7 +107,7 @@ public class oConvertUtils {
 	}
 
 	public static double getDouble(String s, double defval) {
-		if (s == null || s == "") {
+		if (s == null || s.trim().equals("")) {
 			return (defval);
 		}
 		try {
@@ -137,14 +124,6 @@ public class oConvertUtils {
 		return s;
 	}
 
-	/*public static Short getShort(String s) {
-		if (StringUtil.isNotEmpty(s)) {
-			return (Short.parseShort(s));
-		} else {
-			return null;
-		}
-	}*/
-
 	public static int getInt(Object object, int defval) {
 		if (isEmpty(object)) {
 			return (defval);
@@ -174,7 +153,7 @@ public class oConvertUtils {
 		return s.intValue();
 	}
 
-	public static Integer[] getIntegerArry(String[] object) {
+	public static Integer[] getIntegerArray(String[] object) {
 		int len = object.length;
 		Integer[] result = new Integer[len];
 		try {
@@ -230,12 +209,7 @@ public class oConvertUtils {
 	}
 
 	public static long stringToLong(String str) {
-        Long test = 0L;
-		try {
-			test = Long.valueOf(str);
-		} catch (Exception e) {
-		}
-		return test.longValue();
+		return Long.valueOf(str);
 	}
 
 	/**
@@ -260,7 +234,7 @@ public class oConvertUtils {
 	 *            要判断的类。
 	 * @return true 表示为基本数据类型。
 	 */
-	private static boolean isBaseDataType(Class clazz) throws Exception {
+	private static boolean isBaseDataType(Class clazz) {
 		return (clazz.equals(String.class) || clazz.equals(Integer.class) || clazz.equals(Byte.class) || clazz.equals(Long.class) || clazz.equals(Double.class) || clazz.equals(Float.class) || clazz.equals(Character.class) || clazz.equals(Short.class) || clazz.equals(BigDecimal.class) || clazz.equals(BigInteger.class) || clazz.equals(Boolean.class) || clazz.equals(Date.class) || clazz.isPrimitive());
 	}
 
@@ -302,11 +276,11 @@ public class oConvertUtils {
 			Enumeration<InetAddress> address = ni.getInetAddresses();
 			while (address.hasMoreElements()) {
 				ip = address.nextElement();
-                if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
+				if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(':') == -1) {
 					netip = ip.getHostAddress();
 					finded = true;
 					break;
-                } else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
+				} else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(':') == -1) {
 					localip = ip.getHostAddress();
 				}
 			}
@@ -357,20 +331,13 @@ public class oConvertUtils {
 	}
 
 	/**
-	 * 获取Map对象
-	 */
-	public static Map<Object, Object> getHashMap() {
-		return new HashMap<Object, Object>();
-	}
-
-	/**
 	 * SET转换MAP
      *
 	 * @param setobj
 	 * @return
 	 */
     public static Map<Object, Object> setToMap(Set<Object> setobj) {
-		Map<Object, Object> map = getHashMap();
+		Map<Object, Object> map = new HashMap<>();
 		for (Iterator iterator = setobj.iterator(); iterator.hasNext();) {
 			Map.Entry<Object, Object> entry = (Map.Entry<Object, Object>) iterator.next();
 			map.put(entry.getKey().toString(), entry.getValue() == null ? "" : entry.getValue().toString().trim());
@@ -401,9 +368,7 @@ public class oConvertUtils {
 		long b = Integer.parseInt(ip[1]);
 		long c = Integer.parseInt(ip[2]);
 		long d = Integer.parseInt(ip[3]);
-
-		long ipNum = a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
-		return ipNum;
+		return a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
 	}
 
 	private static boolean isInner(long userIp, long begin, long end) {

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

@@ -41,16 +41,6 @@
     </repositories>
 
     <dependencies>
-        <!--<dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-openfeign</artifactId>
-        </dependency>-->
-
         <!-- rabbitmq 依赖jar包-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -123,18 +113,6 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>module-ctop</artifactId>
-            <version>2.0.2</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>cn.com.ctop</groupId>
-            <artifactId>module-report</artifactId>
-            <version>2.0.2</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
             <groupId>com.bstek.ureport</groupId>
             <artifactId>ureport2-console</artifactId>
             <version>2.2.9</version>

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

@@ -1,7 +1,7 @@
 package org.jeecg;
 
+import cn.com.ctop.common.module.utils.SpringUtils;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.modules.excelutil.SpringUtils;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.ConfigurableApplicationContext;

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/WebMvcConfiguration.java

@@ -1,12 +1,15 @@
 package org.jeecg.config;
 
 import cn.com.ctop.common.module.utils.StringUtils;
+import org.jeecg.config.interceptors.BrowseLogHandelInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.cors.CorsConfiguration;
 import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
 import org.springframework.web.filter.CorsFilter;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -20,6 +23,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 @Configuration
 public class WebMvcConfiguration implements WebMvcConfigurer {
 
+	@Autowired
+	BrowseLogHandelInterceptor browseLogHandelInterceptor;
+
 	@Value("${jeecg.path.upload}")
 	private String upLoadPath;
 	@Value("${jeecg.path.webapp}")
@@ -27,6 +33,11 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
 	@Value("${spring.resource.static-locations}")
 	private String staticLocations;
 
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(browseLogHandelInterceptor);
+	}
+
 	@Bean
 	public CorsFilter corsFilter() {
 		final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();

+ 101 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/interceptors/BrowseLogHandelInterceptor.java

@@ -0,0 +1,101 @@
+package org.jeecg.config.interceptors;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by JQ.bi on 2020.5.8
+ */
+@Component
+@Slf4j
+public class BrowseLogHandelInterceptor extends HandlerInterceptorAdapter {
+
+    private static final String REQUEST_METHOD = "GET_POST_PUT_DELETE_OPTIONS";
+
+    private final static ExecutorService executorServicePool;
+
+    //加载一次
+    static {
+        int threadCount = Runtime.getRuntime().availableProcessors();
+        ThreadFactoryBuilder builder = new ThreadFactoryBuilder();
+        builder.setNameFormat("BrowseLogHandlerFactory");
+        builder.setDaemon(true);
+        builder.setUncaughtExceptionHandler((t, e) -> {
+        });//忽略异常
+        builder.setPriority(Thread.MIN_PRIORITY);
+        executorServicePool = new ThreadPoolExecutor(threadCount, threadCount,
+                0L, TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<Runnable>(100000), builder.build(), new ThreadPoolExecutor.DiscardPolicy());
+    }
+
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
+
+        if (REQUEST_METHOD.contains(request.getMethod())) {
+            if (request.getRequestURI().endsWith("/getEncryptedString")||request.getRequestURI().endsWith("/login")) {
+                return;
+            }
+            boolean isSuccess = true;
+            if (response.getStatus() != 200) {
+                isSuccess = false;
+            }
+            String userName = JwtUtil.getUserNameByToken(request);
+            if (StringUtils.isEmpty(userName)) {
+                log.warn("登陆账号用户名为空");
+            }
+            String token = request.getHeader("X-Access-Token");
+            String uri = request.getRequestURI();
+            String currentDate = DateUtils.now();
+            BrowseLogRunnable runnable = new BrowseLogRunnable(userName, isSuccess,token, uri, currentDate);
+            executorServicePool.submit(runnable);
+        }
+    }
+
+
+    private static class BrowseLogRunnable implements Runnable {
+
+        String userName;
+        Boolean isSuccess;
+        String token;
+        String uri;
+        String currentDate;
+
+
+        BrowseLogRunnable(String userName, boolean isSuccess, String token, String uri, String currentDate) {
+            this.userName = userName;
+            this.isSuccess = isSuccess;
+            this.token = token;
+            this.uri = uri;
+            this.currentDate = currentDate;
+        }
+
+        @Override
+        public void run() {
+            try {
+                if (!StringUtils.isEmpty(token)) {
+                    if(isSuccess){
+                        log.info("-SUCCESS " + currentDate + " 用户:" + userName + " 访问了[" + uri + "]?token=\"" + token + "\"");
+                    }else {
+                        log.info("-FALSE " + currentDate + " 用户:" + userName + "” 访问了[" + uri + "]?token=\"" + token + "\"");
+                    }
+                }
+            } catch (Exception e) {
+                log.error(e.toString());
+            }
+        }
+    }
+}
+

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

@@ -38,7 +38,7 @@ public class ActorController {
     private IActorVideoService actorVideoService;
 
     @ResponseBody
-    @RequestMapping(value = "/detail", method = RequestMethod.GET)
+    @GetMapping("/detail")
     public Result<Actor> getDetail(@RequestParam(name = "actorId") Long actorId) {
         Result<Actor> result = new Result<>();
         Actor actor = actorService.getById(actorId);
@@ -61,9 +61,9 @@ public class ActorController {
                                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                               HttpServletRequest req) {
-        Result<IPage<Actor>> result = new Result<IPage<Actor>>();
+        Result<IPage<Actor>> result = new Result<>();
         QueryWrapper<Actor> queryWrapper = QueryGenerator.initQueryWrapper(actor, req.getParameterMap());
-        Page<Actor> page = new Page<Actor>(pageNo, pageSize);
+        Page<Actor> page = new Page<>(pageNo, pageSize);
         IPage<Actor> pageList = actorService.page(page, queryWrapper);
 
         result.setSuccess(true);
@@ -76,10 +76,10 @@ public class ActorController {
                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
-        Result<IPage<ActorPhoto>> result = new Result<IPage<ActorPhoto>>();
+        Result<IPage<ActorPhoto>> result = new Result<>();
 
         QueryWrapper<ActorPhoto> queryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, req.getParameterMap());
-        Page<ActorPhoto> page = new Page<ActorPhoto>(pageNo, pageSize);
+        Page<ActorPhoto> page = new Page<>(pageNo, pageSize);
         IPage<ActorPhoto> pageList = actorPhotoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -91,10 +91,10 @@ public class ActorController {
                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                             HttpServletRequest req) {
-        Result<IPage<ActorComment>> result = new Result<IPage<ActorComment>>();
+        Result<IPage<ActorComment>> result = new Result<>();
 
         QueryWrapper<ActorComment> queryWrapper = QueryGenerator.initQueryWrapper(actorComment, req.getParameterMap());
-        Page<ActorComment> page = new Page<ActorComment>(pageNo, pageSize);
+        Page<ActorComment> page = new Page<>(pageNo, pageSize);
         IPage<ActorComment> pageList = actorCommentService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -103,7 +103,7 @@ public class ActorController {
 
     @DeleteMapping(value = "/comment/delete")
     public Result<ActorComment> deleteComment(@RequestParam(name = "id", required = true) String id) {
-        Result<ActorComment> result = new Result<ActorComment>();
+        Result<ActorComment> result = new Result<>();
         ActorComment actorComment = actorCommentService.getById(id);
         if (actorComment == null) {
             result.error500("未找到对应实体");
@@ -118,7 +118,7 @@ public class ActorController {
 
     @DeleteMapping(value = "/video/delete")
     public Result<ActorVideo> deleteVideo(@RequestParam(name = "id", required = true) String id) {
-        Result<ActorVideo> result = new Result<ActorVideo>();
+        Result<ActorVideo> result = new Result<>();
         ActorVideo actorVideo = actorVideoService.getById(id);
         if (actorVideo == null) {
             result.error500("未找到对应实体");
@@ -133,7 +133,7 @@ public class ActorController {
 
     @DeleteMapping(value = "/photo/delete")
     public Result<ActorPhoto> deletePhoto(@RequestParam(name = "id", required = true) String id) {
-        Result<ActorPhoto> result = new Result<ActorPhoto>();
+        Result<ActorPhoto> result = new Result<>();
         ActorPhoto actorPhoto = actorPhotoService.getById(id);
         if (actorPhoto == null) {
             result.error500("未找到对应实体");
@@ -148,7 +148,7 @@ public class ActorController {
 
     @PostMapping(value = "/comment/add")
     public Result<ActorComment> addComment(ActorComment actorComment) {
-        Result<ActorComment> result = new Result<ActorComment>();
+        Result<ActorComment> result = new Result<>();
         try {
             actorCommentService.save(actorComment);
             result.success("添加成功!");
@@ -161,13 +161,11 @@ public class ActorController {
 
     @PostMapping(value = "/video/add")
     public Result<ActorVideo> addVideo(ActorVideo actorVideo) {
-        Result<ActorVideo> result = new Result<ActorVideo>();
+        Result<ActorVideo> result = new Result<>();
         try {
             String videoUrl = actorVideo.getVideoUrl();
-            if (!Check.isNull(videoUrl)) {
-                if (!videoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    actorVideo.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + videoUrl);
-                }
+            if (!Check.isNull(videoUrl) && !videoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                actorVideo.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + videoUrl);
             }
             actorVideoService.save(actorVideo);
             result.success("添加成功!");
@@ -180,15 +178,12 @@ public class ActorController {
 
     @PostMapping(value = "/photo/add")
     public Result<ActorPhoto> addPhoto(ActorPhoto actorPhoto) {
-        Result<ActorPhoto> result = new Result<ActorPhoto>();
+        Result<ActorPhoto> result = new Result<>();
         try {
             String photoUrl = actorPhoto.getPhotoUrl();
-            if (!Check.isNull(photoUrl)) {
-                if (!photoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    actorPhoto.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + photoUrl);
-                }
+            if (!Check.isNull(photoUrl) && !photoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                actorPhoto.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + photoUrl);
             }
-
             actorPhotoService.save(actorPhoto);
             result.success("添加成功!");
         } catch (Exception e) {
@@ -203,9 +198,9 @@ public class ActorController {
                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
-        Result<IPage<ActorVideo>> result = new Result<IPage<ActorVideo>>();
+        Result<IPage<ActorVideo>> result = new Result<>();
         QueryWrapper<ActorVideo> queryWrapper = QueryGenerator.initQueryWrapper(actorVideo, req.getParameterMap());
-        Page<ActorVideo> page = new Page<ActorVideo>(pageNo, pageSize);
+        Page<ActorVideo> page = new Page<>(pageNo, pageSize);
         IPage<ActorVideo> pageList = actorVideoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -221,40 +216,33 @@ public class ActorController {
      */
     @PostMapping(value = "/add")
     public Result<Actor> add(@RequestBody Actor actor) {
-        Result<Actor> result = new Result<Actor>();
+        Result<Actor> result = new Result<>();
         try {
             String coverUrl = actor.getCoverUrl();
-            if (!Check.isNull(coverUrl)) {
-                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
-                }
+            if (!Check.isNull(coverUrl) && !coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
             }
             actorService.save(actor);
-            if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
+            if (null != actor.getImageUrl() && !actor.getImageUrl().isEmpty()) {
                 for (String url : actor.getImageUrl()) {
                     ActorPhoto photo = new ActorPhoto();
                     photo.setActorId(actor.getId());
-                    if (!Check.isNull(url)) {
-                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                            photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
-                        }
+                    if (!Check.isNull(url) && !url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                        photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
                     }
                     actorPhotoService.save(photo);
                 }
             }
-            if (actor.getVideoUrl() != null && actor.getVideoUrl().size() > 0) {
+            if (actor.getVideoUrl() != null && !actor.getVideoUrl().isEmpty()) {
                 for (String url : actor.getVideoUrl()) {
                     ActorVideo video = new ActorVideo();
                     video.setActorId(actor.getId());
-                    if (!Check.isNull(url)) {
-                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                            video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
-                        }
+                    if (!Check.isNull(url) && !url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                        video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
                     }
                     actorVideoService.save(video);
                 }
             }
-
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -271,18 +259,15 @@ public class ActorController {
      */
     @PutMapping(value = "/edit")
     public Result<Actor> edit(@RequestBody Actor actor) {
-        Result<Actor> result = new Result<Actor>();
+        Result<Actor> result = new Result<>();
 
         Actor actorEntity = actorService.getById(actor.getId());
         if (actorEntity == null) {
             result.error500("未找到对应实体");
         } else {
-
             String coverUrl = actor.getCoverUrl();
-            if (!Check.isNull(coverUrl)) {
-                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
-                }
+            if (!Check.isNull(coverUrl) && !coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
             }
 
             boolean ok = actorService.updateById(actor);
@@ -290,7 +275,6 @@ public class ActorController {
                 result.success("修改成功!");
             }
         }
-
         return result;
     }
 }

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

@@ -36,13 +36,13 @@ public class AdCoverController {
     private ISysCategoryService sysCategoryService;
 
     @ResponseBody
-    @RequestMapping(value = "/summary/today", method = RequestMethod.GET)
+    @GetMapping("/summary/today")
     public Result<Map<String, Object>> getTodaySummary() {
-        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
-        QueryWrapper<AppAd> appAdWrapper = new QueryWrapper<AppAd>();
-        QueryWrapper<AppVideo> appVideoWrapper = new QueryWrapper<AppVideo>();
-        QueryWrapper<KuaishouAdAccount> advertiserWrapper = new QueryWrapper<KuaishouAdAccount>();
-        QueryWrapper<KuaishouAdAccount> productWrapper = new QueryWrapper<KuaishouAdAccount>();
+        Result<Map<String, Object>> result = new Result<>();
+        QueryWrapper<AppAd> appAdWrapper = new QueryWrapper<>();
+        QueryWrapper<AppVideo> appVideoWrapper = new QueryWrapper<>();
+        QueryWrapper<KuaishouAdAccount> advertiserWrapper = new QueryWrapper<>();
+        QueryWrapper<KuaishouAdAccount> productWrapper = new QueryWrapper<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         String now = sdf.format(new Date());
         String startDate = now + " 00:00:00";
@@ -56,7 +56,7 @@ public class AdCoverController {
         int appVideoCount = appVideoService.count(appVideoWrapper);
         int advertiserCount = kuaishouAdAccountService.count(advertiserWrapper);
         int productCount = kuaishouAdAccountService.count(productWrapper);
-        Map<String, Object> map = new HashMap<String, Object>();
+        Map<String, Object> map = new HashMap<>();
         map.put("adCount", appAdCount);
         map.put("videoCount", appVideoCount);
         map.put("advertiserCount", advertiserCount);
@@ -67,16 +67,16 @@ public class AdCoverController {
     }
 
     @ResponseBody
-    @RequestMapping(value = "/summary/all", method = RequestMethod.GET)
+    @GetMapping("/summary/all")
     public Result<Map<String, Object>> getAllSummary() {
-        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
-        QueryWrapper<KuaishouAdAccount> productWrapper = new QueryWrapper<KuaishouAdAccount>();
+        Result<Map<String, Object>> result = new Result<>();
+        QueryWrapper<KuaishouAdAccount> productWrapper = new QueryWrapper<>();
         productWrapper.groupBy("product");
         int appAdCount = appAdService.count();
         int appVideoCount = appVideoService.count();
         int advertiserCount = kuaishouAdAccountService.count();
         int productCount = kuaishouAdAccountService.count(productWrapper);
-        Map<String, Object> map = new HashMap<String, Object>();
+        Map<String, Object> map = new HashMap<>();
         map.put("adCount", appAdCount);
         map.put("videoCount", appVideoCount);
         map.put("advertiserCount", advertiserCount);
@@ -87,10 +87,9 @@ public class AdCoverController {
     }
 
     @ResponseBody
-    @RequestMapping(value="/feeds", method = RequestMethod.GET)
+    @GetMapping("/feeds")
     public Result<List<AppAd>> getVideoList(HttpServletRequest req){
-        Result<List<AppAd>> result = new Result<List<AppAd>>();
-        AppAd ad = new AppAd();
+        Result<List<AppAd>> result = new Result<>();
         Map<String,String[]> paramMap = req.getParameterMap();
         String industry = paramMap.get("industry")!=null?sysCategoryService.getById(paramMap.get("industry")[0]).getName():null;
         String company = paramMap.get("company")!=null?paramMap.get("company")[0]:null;
@@ -100,8 +99,8 @@ public class AdCoverController {
         String end = paramMap.get("end")!=null?paramMap.get("end")[0]:null;
         String orderByColumn = paramMap.get("orderByColumn")!=null?paramMap.get("orderByColumn")[0]:null;
         String orderByType = paramMap.get("orderByType")!=null?paramMap.get("orderByType")[0]:null;
-        Integer pageSize = paramMap.get("pageSize")!=null?Integer.parseInt(paramMap.get("pageSize")[0]):null;
-        Integer pageNo = paramMap.get("pageNo")!=null?Integer.parseInt(paramMap.get("pageNo")[0]):null;
+        Integer pageSize = paramMap.get("pageSize") != null ? Integer.parseInt(paramMap.get("pageSize")[0]) : 10;
+        Integer pageNo = paramMap.get("pageNo") != null ? Integer.parseInt(paramMap.get("pageNo")[0]) : 1;
         int pageStart = (pageNo-1)*pageSize;
         List<AppAd> list = appAdService.queryAdFeeds(userName, industry, company, product, start, end, orderByColumn, orderByType, pageStart, pageSize);
         result.setResult(list);
@@ -110,7 +109,7 @@ public class AdCoverController {
     }
 
     @ResponseBody
-    @RequestMapping(value="/detail", method = RequestMethod.GET)
+    @GetMapping("/detail")
     public Result<Map<String,Object>> getDetail(@RequestParam(name="photoId") Long photoId, @RequestParam(name="userId") Long userId){
         Result<Map<String, Object>> result = new Result<>();
         AppAd ad = new AppAd();
@@ -128,9 +127,9 @@ public class AdCoverController {
             video.setMvUrl(ad.getMvUrl());
         }
 
-        kuaishouAdAccount.setUrl("https://live.kuaishou.com/profile/" + ad.getShareInfo().substring(ad.getShareInfo().indexOf("=") + 1, ad.getShareInfo().indexOf("&")));
+        kuaishouAdAccount.setUrl("https://live.kuaishou.com/profile/" + ad.getShareInfo().substring(ad.getShareInfo().indexOf('=') + 1, ad.getShareInfo().indexOf('&')));
         video.setShareInfo("https://live.kuaishou.com/u/" + ad.getShareInfo().replace("userId=", "").replace("photoId=", "").replace("&", "/"));
-        Map<String,Object> map = new HashMap<String,Object>();
+        Map<String, Object> map = new HashMap<>();
         map.put("adlist",list);
         map.put("user",kuaishouAdAccount);
         map.put("video",video);
@@ -140,14 +139,13 @@ public class AdCoverController {
     }
 
     /**
-     * TODO 需要确认是否可以删除
      *
      * @param photoId
      * @param userId
      * @return
      */
     @ResponseBody
-    @RequestMapping(value="/adlist", method = RequestMethod.GET)
+    @GetMapping(value = "/adlist")
     public Result<List<AppAd>> getAdList(@RequestParam(name = "photoId") String photoId, @RequestParam(name = "userId") Long userId) {
         Result<List<AppAd>> result = new Result<>();
         AppAd ad = new AppAd();

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

@@ -1,12 +1,9 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.ISysRoleService;
 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 cn.com.ctop.common.module.utils.StringUtils;
+import cn.com.ctop.common.module.utils.*;
 import com.alibaba.excel.EasyExcelFactory;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.metadata.Sheet;
@@ -40,8 +37,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
 import java.util.*;
 
 /**
@@ -62,7 +59,7 @@ public class AdvertiserController {
     @Autowired
     private UserCompanyMapper userCompanyMapper;
     @Autowired
-    private MaterialReportMapper materialReportMapper;
+    private ISysRoleService sysRoleService;
     @Autowired
     private ProjectMapper projectMapper;
     @Autowired
@@ -81,7 +78,7 @@ public class AdvertiserController {
     public Result<List<Advertiser>> getAdvertiserByCompany(String userId) {
         Result<List<Advertiser>> result = new Result<>();
         try {
-            String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             QueryWrapper<Advertiser> queryWrapper = new QueryWrapper<>();
             if (!"admin".equals(roleCode)) {
                 QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
@@ -97,7 +94,6 @@ public class AdvertiserController {
         } catch (Exception e) {
             e.printStackTrace();
             result.setSuccess(false);
-
         }
         return result;
     }
@@ -119,8 +115,8 @@ public class AdvertiserController {
                                                    @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
                                                    HttpServletRequest req) {
 
-        Result<IPage<Advertiser>> result = new Result<IPage<Advertiser>>();
-        String roleCode = materialReportMapper.getRoleCodeByUserId(advertiser.getUserId());
+        Result<IPage<Advertiser>> result = new Result<>();
+        String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
         String userId = advertiser.getUserId();
         if ("admin".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || "sale".equals(roleCode) || "saleDirector".equals(roleCode)) {
             advertiser.setUserId(null);
@@ -136,9 +132,9 @@ public class AdvertiserController {
                 queryWrapper.eq("company_id", userCompany.getCompanyId());
             }
         }
-        Page<Advertiser> page = new Page<Advertiser>(pageNo, pageSize);
+        Page<Advertiser> page = new Page<>(pageNo, pageSize);
         IPage<Advertiser> pageList = advertiserService.page(page, queryWrapper);
-        if (pageList != null && pageList.getRecords() != null && pageList.getRecords().size() > 0) {
+        if (pageList != null && pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
             List<Advertiser> list = new ArrayList<>();
             for (int i = 0; i < pageList.getRecords().size(); i++) {
                 Advertiser advertiserRecord = pageList.getRecords().get(i);
@@ -172,7 +168,7 @@ public class AdvertiserController {
     @ApiOperation(value = "广告主信息表-添加", notes = "广告主信息表-添加")
     @PostMapping(value = "/add")
     public Result<Advertiser> add(@RequestBody Advertiser advertiser) {
-        Result<Advertiser> result = new Result<Advertiser>();
+        Result<Advertiser> result = new Result<>();
         try {
             String userId = advertiser.getUserId();
             String name = advertiser.getName().trim();
@@ -217,7 +213,7 @@ public class AdvertiserController {
     @ApiOperation(value = "广告主信息表-编辑", notes = "广告主信息表-编辑")
     @PutMapping(value = "/edit")
     public Result<Advertiser> edit(@RequestBody Advertiser advertiser) {
-        Result<Advertiser> result = new Result<Advertiser>();
+        Result<Advertiser> result = new Result<>();
         Advertiser advertiserEntity = advertiserService.getById(advertiser.getId());
         if (advertiserEntity == null) {
             result.error500("未找到对应实体");
@@ -251,7 +247,7 @@ public class AdvertiserController {
     @ApiOperation(value = "广告主信息表-通过id删除", notes = "广告主信息表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<Advertiser> delete(@RequestParam(name = "id", required = true) String id) {
-        Result<Advertiser> result = new Result<Advertiser>();
+        Result<Advertiser> result = new Result<>();
         Advertiser advertiser = advertiserService.getById(id);
         if (advertiser == null) {
             result.error500("未找到对应实体");
@@ -287,7 +283,7 @@ public class AdvertiserController {
     @ApiOperation(value = "广告主信息表-批量删除", notes = "广告主信息表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<Advertiser> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<Advertiser> result = new Result<Advertiser>();
+        Result<Advertiser> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -324,7 +320,7 @@ public class AdvertiserController {
      * @return
      */
     @RequestMapping(value = "/ydWeekReportList")
-    public Map<String, Object> ydReportList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject data) throws Exception {
+    public Map<String, Object> ydReportList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject data) {
         Map<String, Object> result = new HashMap<>();
         Long projectId = data.getLong("projectId");
         String startDate = data.getString("startDate");
@@ -343,13 +339,12 @@ public class AdvertiserController {
     @RequestMapping(value = "/exportYdDailyReport")
     @ResponseBody
     public void exportYdWeek(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject data) throws Exception {
-        Map<String, Object> result = new HashMap<>();
         Long projectId = data.getLong("projectId");
         String startDate = data.getString("startDate");
         String endDate = data.getString("endDate");
         List<SheetInfoVo> vos = advertiserService.getYdStatisticInfo(projectId, startDate, endDate);
         OutputStream outputStream = response.getOutputStream();
-        this.setResponseHeader(response, "伊对" + startDate + "至" + endDate + "周报.xls");
+        HttpUtils.setResponseHeader(response, "伊对" + startDate + "至" + endDate + "周报.xls");
         ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
         for (int i = 0; i < vos.size(); i++) {
             Sheet sheet = new Sheet(i + 1, 0, KuaishouXxlEntity.class);
@@ -368,27 +363,27 @@ public class AdvertiserController {
      */
     @RequestMapping(value = "/xxlDailyReportList")
     @ResponseBody
-    public Map<String, Object> xxlReportList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject data) throws Exception {
+    public Map<String, Object> xxlReportList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject data) {
         Map<String, Object> result = new HashMap<>();
         List<SheetInfoVo> sheets = new ArrayList<>();
         //查询总的消耗信息
         Long projectId = data.getLong("projectId");
         String systemType = data.getString("systemType");
-        if (null == systemType || systemType.trim().equals("")) {
+        if (null == systemType || "".equals(systemType.trim())) {
             systemType = null;
         }
         SheetInfoVo totalSheetVo = advertiserService.getXxlStatisticInfo(projectId, systemType, null, "汇总表");
         sheets.add(totalSheetVo);
         if (null == systemType) {
             List<SheetInfoVo> vos = advertiserService.getSystemTypeXxlStatisticInfo(projectId);
-            if (null != vos && vos.size() > 0) {
+            if (null != vos && !vos.isEmpty()) {
                 for (SheetInfoVo vo : vos) {
                     sheets.add(vo);
                 }
             }
         }
         List<UserAllocation> allocations = userAllocationService.getByProjectId(projectId, systemType);
-        if (null != allocations && allocations.size() > 0) {
+        if (null != allocations && !allocations.isEmpty()) {
             for (UserAllocation allocation : allocations) {
                 SheetInfoVo vo = advertiserService.getXxlStatisticInfo(projectId, systemType, allocation.getAccountId(), allocation.getAuthName());
                 sheets.add(vo);
@@ -406,9 +401,9 @@ public class AdvertiserController {
      */
     @RequestMapping(value = "/exportXxlDailyReport")
     @ResponseBody
-    public void exportXxl(HttpServletRequest request, HttpServletResponse response, Long projectId, String systemType) throws Exception {
+    public void exportXxl(HttpServletRequest request, HttpServletResponse response, Long projectId, String systemType) throws IOException {
         List<SheetInfoVo> sheets = new ArrayList<>();
-        if (null == systemType || systemType.trim().equals("")) {
+        if (null == systemType || "".equals(systemType.trim())) {
             systemType = null;
         }
         //查询总的消耗信息
@@ -416,14 +411,14 @@ public class AdvertiserController {
         sheets.add(totalSheetVo);
         if (null == systemType) {
             List<SheetInfoVo> vos = advertiserService.getSystemTypeXxlStatisticInfo(projectId);
-            if (null != vos && vos.size() > 0) {
+            if (null != vos && !vos.isEmpty()) {
                 for (SheetInfoVo vo : vos) {
                     sheets.add(vo);
                 }
             }
         }
         List<UserAllocation> allocations = userAllocationService.getByProjectId(projectId, systemType);
-        if (null != allocations && allocations.size() > 0) {
+        if (null != allocations && !allocations.isEmpty()) {
             for (UserAllocation allocation : allocations) {
                 SheetInfoVo vo = advertiserService.getXxlStatisticInfo(projectId, systemType, allocation.getAccountId(), allocation.getAuthName());
                 sheets.add(vo);
@@ -432,7 +427,7 @@ public class AdvertiserController {
 
         OutputStream outputStream = response.getOutputStream();
         String date = DateUtils.formatDate(new Date());
-        this.setResponseHeader(response, "爱上消消消日报" + date + ".xls");
+        HttpUtils.setResponseHeader(response, "爱上消消消日报" + date + ".xls");
         ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
         for (int i = 0; i < sheets.size(); i++) {
             Sheet sheet = new Sheet(i + 1, 0, KuaishouXxlEntity.class);
@@ -443,21 +438,4 @@ public class AdvertiserController {
         outputStream.flush();
         outputStream.close();
     }
-
-    //发送响应流方法
-    public void setResponseHeader(HttpServletResponse response, String fileName) {
-        try {
-            try {
-                fileName = new String(fileName.getBytes(), "ISO8859-1");
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-            response.setContentType("application/octet-stream;charset=ISO8859-1");
-            response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
-            response.addHeader("Pargam", "no-cache");
-            response.addHeader("Cache-Control", "no-cache");
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
 }

+ 9 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AgentInfoController.java

@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -64,7 +65,7 @@ public class AgentInfoController {
                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                   HttpServletRequest req) {
-        Result<IPage<AgentInfo>> result = new Result<IPage<AgentInfo>>();
+        Result<IPage<AgentInfo>> result = new Result<>();
         agentInfo.setEnabled(1);
         QueryWrapper<AgentInfo> queryWrapper = QueryGenerator.initQueryWrapper(agentInfo, req.getParameterMap());
         Page<AgentInfo> page = new Page<>(pageNo, pageSize);
@@ -84,7 +85,7 @@ public class AgentInfoController {
     @ApiOperation(value = "代理商信息-添加", notes = "代理商信息-添加")
     @PostMapping(value = "/add")
     public Result<AgentInfo> add(@RequestBody AgentInfo agentInfo) {
-        Result<AgentInfo> result = new Result<AgentInfo>();
+        Result<AgentInfo> result = new Result<>();
         try {
             agentInfo.setEnabled(1);
             agentInfo.setEnabled(1);
@@ -107,7 +108,7 @@ public class AgentInfoController {
     @ApiOperation(value = "代理商信息-编辑", notes = "代理商信息-编辑")
     @PutMapping(value = "/edit")
     public Result<AgentInfo> edit(@RequestBody AgentInfo agentInfo) {
-        Result<AgentInfo> result = new Result<AgentInfo>();
+        Result<AgentInfo> result = new Result<>();
         AgentInfo agentInfoEntity = agentInfoService.getById(agentInfo.getId());
         if (agentInfoEntity == null) {
             result.error500("未找到对应实体");
@@ -130,7 +131,7 @@ public class AgentInfoController {
     @AutoLog(value = "代理商信息-通过id删除")
     @ApiOperation(value = "代理商信息-通过id删除", notes = "代理商信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             agentInfoService.removeById(id);
         } catch (Exception e) {
@@ -150,7 +151,7 @@ public class AgentInfoController {
     @ApiOperation(value = "代理商信息-批量删除", notes = "代理商信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AgentInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<AgentInfo> result = new Result<AgentInfo>();
+        Result<AgentInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -170,7 +171,7 @@ public class AgentInfoController {
     @ApiOperation(value = "代理商信息-通过id查询", notes = "代理商信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AgentInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<AgentInfo> result = new Result<AgentInfo>();
+        Result<AgentInfo> result = new Result<>();
         AgentInfo agentInfo = agentInfoService.getById(id);
         if (agentInfo == null) {
             result.error500("未找到对应实体");
@@ -194,7 +195,7 @@ public class AgentInfoController {
         try {
             String paramsStr = request.getParameter("paramsStr");
             if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                String deString = URLDecoder.decode(paramsStr, StandardCharsets.UTF_8.toString());
                 AgentInfo agentInfo = JSON.parseObject(deString, AgentInfo.class);
                 queryWrapper = QueryGenerator.initQueryWrapper(agentInfo, request.getParameterMap());
             }
@@ -220,7 +221,7 @@ public class AgentInfoController {
      * @param response
      * @return
      */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    @PostMapping("/importExcel")
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
@@ -247,5 +248,4 @@ public class AgentInfoController {
         }
         return Result.ok("文件导入失败!");
     }
-
 }

+ 12 - 96
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountAuthController.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.entity.BindAccountAuth;
 import cn.com.ctop.common.module.service.IBindAccountAuthService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -15,26 +14,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
 /**
  * @Description: 账号绑定-授权
@@ -59,7 +44,7 @@ public class BindAccountAuthController {
     @PostMapping(value = "/authorization")
     public Result<IPage<BindAccountAuth>> authorization(@RequestBody JSONObject json) {
         log.info("授权入参:{}", json);
-        Result<IPage<BindAccountAuth>> result = new Result<IPage<BindAccountAuth>>();
+        Result<IPage<BindAccountAuth>> result = new Result<>();
         String codeUrl = null;
         try {
             String advertiserId = json.getString("advertiserId");
@@ -69,13 +54,13 @@ public class BindAccountAuthController {
             }
 
             String authorizationType = json.getString("authorizationType");
-            Integer agentType = json.getInteger("agentType"); // 0 三方代理商 1 本代理商
-
+            // 0 三方代理商 1 本代理商
+            Integer agentType = json.getInteger("agentType");
             if ("kuaishou".equals(authorizationType)) {
-                codeUrl = bindAccountAuthService.getKuaishouCodeUrl(JSONObject.toJSONString(json), agentType);
+                codeUrl = bindAccountAuthService.getKuaishouCodeUrl(json.toJSONString(), agentType);
             }
             if ("bytedance".equals(authorizationType)) {
-                codeUrl = bindAccountAuthService.getByteDanceCodeUrl(JSONObject.toJSONString(json));
+                codeUrl = bindAccountAuthService.getByteDanceCodeUrl(json.toJSONString());
             }
             result.setMessage(codeUrl);
             result.setSuccess(true);
@@ -106,9 +91,9 @@ public class BindAccountAuthController {
                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
-        Result<IPage<BindAccountAuth>> result = new Result<IPage<BindAccountAuth>>();
+        Result<IPage<BindAccountAuth>> result = new Result<>();
         QueryWrapper<BindAccountAuth> queryWrapper = QueryGenerator.initQueryWrapper(bindAccountAuth, req.getParameterMap());
-        Page<BindAccountAuth> page = new Page<BindAccountAuth>(pageNo, pageSize);
+        Page<BindAccountAuth> page = new Page<>(pageNo, pageSize);
         IPage<BindAccountAuth> pageList = bindAccountAuthService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -125,7 +110,7 @@ public class BindAccountAuthController {
     @ApiOperation(value = "账号绑定-授权-添加", notes = "账号绑定-授权-添加")
     @PostMapping(value = "/add")
     public Result<BindAccountAuth> add(@RequestBody BindAccountAuth bindAccountAuth) {
-        Result<BindAccountAuth> result = new Result<BindAccountAuth>();
+        Result<BindAccountAuth> result = new Result<>();
         try {
             bindAccountAuthService.save(bindAccountAuth);
             result.success("添加成功!");
@@ -146,13 +131,12 @@ public class BindAccountAuthController {
     @ApiOperation(value = "账号绑定-授权-编辑", notes = "账号绑定-授权-编辑")
     @PutMapping(value = "/edit")
     public Result<BindAccountAuth> edit(@RequestBody BindAccountAuth bindAccountAuth) {
-        Result<BindAccountAuth> result = new Result<BindAccountAuth>();
+        Result<BindAccountAuth> result = new Result<>();
         BindAccountAuth bindAccountAuthEntity = bindAccountAuthService.getById(bindAccountAuth.getId());
         if (bindAccountAuthEntity == null) {
             result.error500("未找到对应实体");
         } else {
             boolean ok = bindAccountAuthService.updateById(bindAccountAuth);
-            //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");
             }
@@ -170,7 +154,7 @@ public class BindAccountAuthController {
     @AutoLog(value = "账号绑定-授权-通过id删除")
     @ApiOperation(value = "账号绑定-授权-通过id删除", notes = "账号绑定-授权-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             bindAccountAuthService.removeById(id);
         } catch (Exception e) {
@@ -190,7 +174,7 @@ public class BindAccountAuthController {
     @ApiOperation(value = "账号绑定-授权-批量删除", notes = "账号绑定-授权-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<BindAccountAuth> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<BindAccountAuth> result = new Result<BindAccountAuth>();
+        Result<BindAccountAuth> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -210,7 +194,7 @@ public class BindAccountAuthController {
     @ApiOperation(value = "账号绑定-授权-通过id查询", notes = "账号绑定-授权-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<BindAccountAuth> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<BindAccountAuth> result = new Result<BindAccountAuth>();
+        Result<BindAccountAuth> result = new Result<>();
         BindAccountAuth bindAccountAuth = bindAccountAuthService.getById(id);
         if (bindAccountAuth == null) {
             result.error500("未找到对应实体");
@@ -220,72 +204,4 @@ public class BindAccountAuthController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<BindAccountAuth> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                BindAccountAuth bindAccountAuth = JSON.parseObject(deString, BindAccountAuth.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(bindAccountAuth, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<BindAccountAuth> pageList = bindAccountAuthService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "账号绑定-授权列表");
-        mv.addObject(NormalExcelConstants.CLASS, BindAccountAuth.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<BindAccountAuth> listBindAccountAuths = ExcelImportUtil.importExcel(file.getInputStream(), BindAccountAuth.class, params);
-                bindAccountAuthService.saveBatch(listBindAccountAuths);
-                return Result.ok("文件导入成功!数据行数:" + listBindAccountAuths.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("文件导入失败!");
-    }
-
 }

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

@@ -6,7 +6,6 @@ import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,29 +18,13 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 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;
 
 /**
@@ -55,8 +38,6 @@ import java.util.Map;
 @RestController
 @RequestMapping("/ctop/bindAccountLogin")
 public class BindAccountLoginController {
-    private static final Logger logger = LoggerFactory.getLogger(BindAccountLoginController.class);
-
     @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
@@ -88,7 +69,7 @@ public class BindAccountLoginController {
         String accountName = json.getString("accountName");
         Map<String, Object> stringObjectMap = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId, advertiserName);
         Boolean trueOrFalse = (Boolean) stringObjectMap.get("success");
-        if (trueOrFalse) {
+        if (Boolean.TRUE.equals(trueOrFalse)) {
             Map<String, Object> deleteMap = new HashMap<>();
             deleteMap.put("account_name", accountName);
             deleteMap.put("user_id", userId);
@@ -114,7 +95,7 @@ public class BindAccountLoginController {
             userAllocation.setSystemType(systemType);
             int i = userAllocationMapper.insert(userAllocation);
             if (i > 0) {
-                logger.info("用户分配入库完成,advertiserId:{}", advertiserId);
+                log.info("用户分配入库完成,advertiserId:{}", advertiserId);
             }
         }
         result.setSuccess(trueOrFalse);
@@ -184,7 +165,7 @@ public class BindAccountLoginController {
     @ApiOperation(value = "账号绑定-登陆-编辑", notes = "账号绑定-登陆-编辑")
     @PutMapping(value = "/edit")
     public Result<BindAccountLogin> edit(@RequestBody BindAccountLogin bindAccountLogin) {
-        Result<BindAccountLogin> result = new Result<BindAccountLogin>();
+        Result<BindAccountLogin> result = new Result<>();
         BindAccountLogin bindAccountLoginEntity = bindAccountLoginService.getById(bindAccountLogin.getId());
         if (bindAccountLoginEntity == null) {
             result.error500("未找到对应实体");
@@ -207,7 +188,7 @@ public class BindAccountLoginController {
     @AutoLog(value = "账号绑定-登陆-通过id删除")
     @ApiOperation(value = "账号绑定-登陆-通过id删除", notes = "账号绑定-登陆-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             bindAccountLoginService.removeById(id);
         } catch (Exception e) {
@@ -227,7 +208,7 @@ public class BindAccountLoginController {
     @ApiOperation(value = "账号绑定-登陆-批量删除", notes = "账号绑定-登陆-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<BindAccountLogin> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<BindAccountLogin> result = new Result<BindAccountLogin>();
+        Result<BindAccountLogin> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -247,7 +228,7 @@ public class BindAccountLoginController {
     @ApiOperation(value = "账号绑定-登陆-通过id查询", notes = "账号绑定-登陆-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<BindAccountLogin> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<BindAccountLogin> result = new Result<BindAccountLogin>();
+        Result<BindAccountLogin> result = new Result<>();
         BindAccountLogin bindAccountLogin = bindAccountLoginService.getById(id);
         if (bindAccountLogin == null) {
             result.error500("未找到对应实体");
@@ -257,72 +238,4 @@ public class BindAccountLoginController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<BindAccountLogin> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                BindAccountLogin bindAccountLogin = JSON.parseObject(deString, BindAccountLogin.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(bindAccountLogin, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<BindAccountLogin> pageList = bindAccountLoginService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "账号绑定-登陆列表");
-        mv.addObject(NormalExcelConstants.CLASS, BindAccountLogin.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<BindAccountLogin> listBindAccountLogins = ExcelImportUtil.importExcel(file.getInputStream(), BindAccountLogin.class, params);
-                bindAccountLoginService.saveBatch(listBindAccountLogins);
-                return Result.ok("文件导入成功!数据行数:" + listBindAccountLogins.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("文件导入失败!");
-    }
-
 }

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

@@ -1,294 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IFileInfoService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.toutiao.entity.ByteDanceCustomAudience;
-import cn.com.ctop.toutiao.entity.ByteDanceUserOrientationTemplate;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
-import cn.com.ctop.toutiao.service.IByteDanceCustomAudienceService;
-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.system.query.QueryGenerator;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.system.entity.SysDictItem;
-import org.jeecg.modules.system.service.ISysDictItemService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 头条广告主相关 2019年7月10日14:13:04
- *
- * @author 宋英豪
- */
-@Slf4j
-@RestController
-@RequestMapping("toutiao")
-public class ByteDanceAdvertiserPostController {
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-    @Autowired
-    private IFileInfoService fileInfoService;
-    @Autowired
-    private IByteDanceCustomAudienceService audienceService;
-    @Autowired
-    private ISysDictItemService sysDictItemService;
-
-    /**
-     * 1:获取广告主信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/info")
-    public Map<String, Object> advertiserInfo(String accountId) {
-        return advertiserDataService.getAdvertiserInfo(accountId);
-    }
-
-    /**
-     * 2:获取广告主广告计划信息
-     * @param accountId 本平台广告主id
-     */
-   /* @RequestMapping("/advertiser/plan/get")
-    public Map<String, Object> advertiserPlan(String accountId, String ids) {
-        return advertiserDataService.getAdvertiserPlan(accountId, ids, null);
-    }*/
-
-    /**
-     * 3:修改广告计划信息状态
-     * @param accountId 本平台广告主id
-     */
-    /*@RequestMapping("/advertiser/plan/update/status")
-    public Map<String, Object> advertiserPlanUpdateStatus(String accountId, String adIds, String optStatus) {
-        return advertiserDataService.advertiserPlanUpdateStatus(accountId, adIds, optStatus);
-    }*/
-
-    /**
-     * 3:修改广告计划信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/ad/update")
-    public Map<String, Object> advertiserAdUpdate(String accountId, Long adId, String optStatus) {
-        ByteDanceUserOrientationTemplate template = new ByteDanceUserOrientationTemplate();
-        return advertiserDataService.advertiserAdUpdate(accountId, adId, template);
-    }
-
-
-    /**
-     * 4:修改广告计划信息状态
-     * @param accountId 本平台广告主id
-     */
-   /* @RequestMapping("/advertiser/plan/update/bid")
-    public Map<String, Object> advertiserPlanUpdateBid(String accountId, String adIds, String bids) {
-        return advertiserDataService.advertiserPlanUpdateBid(accountId, adIds, bids);
-    }*/
-
-    /**
-     * 5:修改广告计划信息状态
-     * @param accountId 本平台广告主id
-     */
-    /*@RequestMapping("/advertiser/plan/update/budget")
-    public Map<String, Object> advertiserPlanUpdateBudget(String accountId, String adIds, String budgets) {
-        return advertiserDataService.advertiserPlanUpdateBudget(accountId, adIds, budgets);
-    }*/
-
-    /**
-     * 6:获取广告主广告预算信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/budget/get/")
-    public Map<String, Object> advertiserBudget(String accountId) {
-        return advertiserDataService.getAdvertiserBudget(accountId);
-    }
-
-    /**
-     * 7:获取广告主广告组信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/campaign/get")
-    public Map<String, Object> advertiserCampaign(String accountId, String ids) {
-        return advertiserDataService.getAdvertiserCampaign(accountId, ids, null);
-    }
-
-    /**
-     * 7:获取广告主广告组信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @GetMapping("/advertiser/campaign/list")
-    public Map<String, Object> advertiserCampaignList(String accountId) {
-        return advertiserDataService.getAdvertiserCampaignList(accountId);
-    }
-
-    /**
-     * 8:获取广告主广告创意信息
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/creative/get")
-    public Map<String, Object> getAdvertiserCreative(String accountId, String ids) {
-        return creativeService.getAdvertiserCreative(accountId, ids, null);
-    }
-
-    /**
-     * 9:修改广告创意信息状态
-     *
-     * @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/update/status/")
-    public Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus) {
-        return creativeService.advertiserCreativeUpdateStatus(accountId, creativeIds, optStatus);
-    }
-
-    /**
-     * 10:获取广告主广告创意素材信息
-     *
-     * @param accountId   本平台广告主id
-     * @param creativeIds 广告创意id
-     */
-    @RequestMapping("/advertiser/creative/material/read")
-    public Map<String, Object> advertiserCreativeMaterial(String accountId, String creativeIds) {
-        return advertiserDataService.getAdvertiserCreativeMaterial(accountId, creativeIds);
-    }
-
-    /**
-     * 12:广告组更新状态信息 @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/campaign/update/status")
-    public Map<String, Object> advertiserCampaignUpdateStatus(String accountId, String campaignIds, String optStatus) {
-        return advertiserDataService.advertiserCampaignUpdateStatus(accountId, campaignIds, optStatus);
-    }
-
-    /**
-     * 13:广告组更新信息 @param accountId 本平台广告主id
-     */
-    @RequestMapping("/advertiser/campaign/update")
-    public Map<String, Object> advertiserCampaignUpdate(String accountId, Long campaignId, String budgetMode, Integer budget, String campaignName) {
-        return advertiserDataService.advertiserCampaignUpdate(accountId, campaignId, budgetMode, budget, campaignName);
-    }
-
-    /**
-     * 14:获取人群包信息
-     */
-    @RequestMapping("/advertiser/custom/audience/select")
-    public Map<String, Object> customAudienceSelect(String accountId) {
-        return advertiserDataService.advertiserCustomAudienceSelect(accountId);
-    }
-
-    /**
-     * 14:获取流量包数据
-     */
-    @RequestMapping("/advertiser/custom/package/get")
-    public Map<String, Object> flowPackageGet(String accountId) {
-        return advertiserDataService.flowPackageGet(accountId);
-    }
-
-
-    /**
-     * 15:上传视频信息
-     *
-     * @param accountId 本平台广告主id
-     * @
-     */
-    @RequestMapping("/advertiser/video/add")
-    public Map<String, Object> advertiserVideoAdd(String accountId, String videoUrl) {
-        return fileInfoService.uploadVideoToBytedance(accountId, videoUrl);
-    }
-
-    /**
-     * 15:上传图片信息
-     *
-     * @param accountId 本平台广告主id
-     * @
-     */
-    @RequestMapping("/advertiser/image/add")
-    public Map<String, Object> advertiserImageAdd(String accountId, String imageUrl) {
-        return fileInfoService.uploadImageToBytedance(accountId, imageUrl);
-    }
-
-    /**
-     * @param audience
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     * @功能:查询字典数据
-     */
-    @RequestMapping(value = "/audience/list", method = RequestMethod.GET)
-    public Result<IPage<ByteDanceCustomAudience>> audiencePageList(ByteDanceCustomAudience audience, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                   @RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest req) {
-        Result<IPage<ByteDanceCustomAudience>> result = new Result<>();
-        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        audience.setAdvertiserId(user.getId());
-        QueryWrapper<ByteDanceCustomAudience> queryWrapper = QueryGenerator.initQueryWrapper(audience, req.getParameterMap());
-        queryWrapper.orderByAsc("sort_order");
-        Page<ByteDanceCustomAudience> page = new Page<>(pageNo, pageSize);
-        IPage<ByteDanceCustomAudience> pageList = audienceService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * @param sysDictItem
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     * @功能:查询字典数据
-     */
-    @RequestMapping(value = "dictitem/list", method = RequestMethod.GET)
-    public Result<IPage<SysDictItem>> dictitemPageList(SysDictItem sysDictItem, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                       @RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest req) {
-        Result<IPage<SysDictItem>> result = new Result<>();
-        QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
-        queryWrapper.orderByAsc("sort_order");
-        Page<SysDictItem> page = new Page<>(pageNo, pageSize);
-        IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-
-    @GetMapping("loadSingleData")
-    public Map<String, Object> loadSingleData(Long accountId) {
-        Map<String, Object> result = new HashMap<>();
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
-        if (null != token && token.getMediaId() == CtopAdConstant.PLATFORM_TYPE_KUAISHOU) {
-            try {
-                kuaishouInterfaceService.loadKuaishouDataSingle(token);
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-        } else {
-            log.info("token异常");
-        }
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
-        return result;
-    }
-
-
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-}

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

@@ -6,8 +6,9 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.IFileInfoService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
-import cn.com.ctop.toutiao.entity.*;
-import cn.com.ctop.toutiao.service.*;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCampaign;
+import cn.com.ctop.toutiao.modules.material.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -36,89 +37,11 @@ public class ByteDanceTemplateController {
     @Autowired
     private IUserAllocationService userAllocationService;
     @Autowired
-    private IBytedanceUrlInfoService urlInfoService;
-    @Autowired
     private IFileInfoService fileInfoService;
     @Autowired
     private IByteDanceAdvertisePlanService planService;
     @Autowired
     private IByteDanceCampaignService campaignService;
-    @Autowired
-    private IByteDanceUserOrientationTemplateService orientationTemplateService;
-    @Autowired
-    private IByteDanceCampaignTemplateService campaignTemplateService;
-    @Autowired
-    private IByteDanceBudgetTemplateService budgetTemplateService;
-    @Autowired
-    private IBytedanceDeliveryTargetTemplateService deliveryTargetTemplateService;
-    @Autowired
-    private IBytedanceAdvertisePlanTemplateService advertisePlanTemplateService;
-
-    /**
-     * 广告组模板
-     *
-     * @param template 广告组模板信息
-     * @return map
-     */
-    @PostMapping("campaign/insert")
-    public Map<String, Object> campaignTemplateInsert(@RequestBody ByteDanceCampaignTemplate template) {
-        return campaignTemplateService.insertTemplate(template);
-    }
-
-    /**
-     * 智能封面
-     *
-     * @param accountId 广告主id
-     * @param videoId 视频id
-     * @return map
-     */
-    @GetMapping("cover/suggest")
-    public Map<String, Object> suggestCover(String accountId, String videoId) {
-        return campaignTemplateService.getSuggestCover(accountId, videoId);
-    }
-
-    /**
-     * 预算与出价模板
-     *
-     * @param template 预算与出价模板信息
-     * @return map
-     */
-    @PostMapping("budget/insert")
-    public Map<String, Object> budgetTemplateInsert(@RequestBody ByteDanceBudgetTemplate template) {
-        return budgetTemplateService.insertTemplate(template);
-    }
-
-    /**
-     * 投放目标
-     *
-     * @param template 投放目标信息
-     * @return map
-     */
-    @PostMapping("deliverytarget/insert")
-    public Map<String, Object> diliverytargetTemplateInsert(@RequestBody BytedanceDeliveryTargetTemplate template) {
-        return deliveryTargetTemplateService.insertTemplate(template);
-    }
-
-    /**
-     * 获取投放目标信息
-     *
-     * @param targetId 投放目标id
-     * @return map
-     */
-    @GetMapping("deliveryTarget/get")
-    public Map<String, Object> diliverytargetTemplateGet(Long targetId) {
-        return deliveryTargetTemplateService.get(targetId);
-    }
-
-    /**
-     * 广告创意创建
-     * @param template 广告创意信息
-     * @return map
-     */
-    @PostMapping("creative/insert")
-    public Map<String, Object> creativeInsert(@RequestBody JSONObject template) {
-        return creativeService.insertBatch(template);
-    }
 
     /**
      * 获取快手授权用户信息列表
@@ -172,76 +95,6 @@ public class ByteDanceTemplateController {
         return result;
     }
 
-    /**
-     * 用户定向
-     *
-     * @param template
-     * @param req
-     * @return
-     */
-    @PostMapping("userorentation/insert")
-    public Map<String, Object> userOrentationTemplateInsert(@RequestBody JSONObject template, HttpServletRequest req) {
-        return orientationTemplateService.insertTemplate(template);
-    }
-
-    /**
-     * 链接信息
-     *
-     * @param urlInfo
-     * @param req
-     * @return
-     */
-    @PostMapping("link/insert")
-    public Map<String, Object> linkInsert(@RequestBody BytedanceUrlInfo urlInfo, HttpServletRequest req) {
-        return urlInfoService.insertLink(urlInfo);
-    }
-
-    /**
-     * 广告计划模板
-     * 方法废弃
-     *
-     * @param template
-     * @param req
-     * @return
-     */
-    @PostMapping("advertiserplan/insert")
-    public Map<String, Object> advertiserplanTemplateInsert(@RequestBody BytedanceAdvertisePlanTemplate template, String accountId, HttpServletRequest req) {
-        return advertisePlanTemplateService.insertTemplate(template, accountId);
-    }
-
-    /**
-     * 用户定向模板列表
-     *
-     * @param template
-     * @param req
-     * @return
-     */
-    @PostMapping("userorentation/list")
-    public Result<IPage<ByteDanceUserOrientationTemplate>> userOrentationTemplateList(ByteDanceUserOrientationTemplate template, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
-        return orientationTemplateService.getList(template, pageNo, pageSize, req);
-    }
-
-    /**
-     * 预算与出价模板
-     *
-     * @param template
-     * @param req
-     * @return
-     */
-    @PostMapping("budget/list")
-    public Result<IPage<ByteDanceBudgetTemplate>> budgetTemplateList(ByteDanceBudgetTemplate template, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
-        return budgetTemplateService.getList(template, pageNo, pageSize, req);
-    }
-
-    /**
-     * 广告组模板
-     *
-     * @return
-     */
-    @PostMapping("campaign/list")
-    public Result<IPage<ByteDanceCampaignTemplate>> campaignTemplateList(ByteDanceCampaignTemplate template, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
-        return campaignTemplateService.getList(template, pageNo, pageSize, req);
-    }
 
     /**
      * @param pageNo
@@ -263,35 +116,6 @@ public class ByteDanceTemplateController {
         return result;
     }
 
-    /**
-     * @param accountId
-     * @return 查询计划可用转化id
-     */
-    @GetMapping(value = "convert/list")
-    public Map<String, Object> convertPageList(Long accountId, Long targetId) {
-        return planService.getAdConvertList(accountId, targetId);
-    }
-
-    /**
-     * @param accountId
-     * @param urlId     链接id
-     * @return 查询计划可用转化id
-     */
-    @GetMapping(value = "convert/list/url")
-    public Map<String, Object> convertListByUrlId(Long accountId, Long urlId) {
-        return planService.getAdConvertListByUrlId(accountId, urlId);
-    }
-
-    /**
-     * @param bindAccountId 绑定账号id
-     * @param urlId         链接id
-     * @return 查询计划可用转化id
-     */
-    @GetMapping(value = "convert/list/url/ng")
-    public Map<String, Object> convertListByBindAccountId(Long bindAccountId, Long urlId) {
-        return planService.getAdConvertListByUrlIdAndBindId(bindAccountId, urlId);
-    }
-
     @Autowired
     private ISysCategoryService sysCategoryService;
 
@@ -324,18 +148,6 @@ public class ByteDanceTemplateController {
         return result;
     }
 
-    /**
-     * 投放目标
-     *
-     * @param template
-     * @param req
-     * @return
-     */
-    @PostMapping("deliverytarget/list")
-    public Result<IPage<BytedanceDeliveryTargetTemplate>> diliverytargetTemplateList(BytedanceDeliveryTargetTemplate template, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
-        return deliveryTargetTemplateService.getList(template, pageNo, pageSize, req);
-    }
-
     @PostMapping("video/upload")
     public Map<String, Object> videoUpload(MultipartFile file) {
         return new HashMap<>();

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

@@ -1,164 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-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.aspect.annotation.AutoLog;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.ctop.entity.BytedanceFundDaily;
-import org.jeecg.modules.ctop.service.IBytedanceFundDailyService;
-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
- * @version V1.0
- * @date 2020-04-08
- */
-@Slf4j
-@Api(tags = "账号日流水信息")
-@RestController
-@RequestMapping("/ctop/bytedanceFundDaily")
-public class BytedanceFundDailyController {
-    @Autowired
-    private IBytedanceFundDailyService bytedanceFundDailyService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param bytedanceFundDaily
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "账号日流水信息-分页列表查询")
-    @ApiOperation(value = "账号日流水信息-分页列表查询", notes = "账号日流水信息-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<BytedanceFundDaily>> queryPageList(BytedanceFundDaily bytedanceFundDaily,
-                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                           HttpServletRequest req) {
-        Result<IPage<BytedanceFundDaily>> result = new Result<IPage<BytedanceFundDaily>>();
-        QueryWrapper<BytedanceFundDaily> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceFundDaily, req.getParameterMap());
-        Page<BytedanceFundDaily> page = new Page<BytedanceFundDaily>(pageNo, pageSize);
-        IPage<BytedanceFundDaily> pageList = bytedanceFundDailyService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param bytedanceFundDaily
-     * @return
-     */
-    @AutoLog(value = "账号日流水信息-添加")
-    @ApiOperation(value = "账号日流水信息-添加", notes = "账号日流水信息-添加")
-    @PostMapping(value = "/add")
-    public Result<BytedanceFundDaily> add(@RequestBody BytedanceFundDaily bytedanceFundDaily) {
-        Result<BytedanceFundDaily> result = new Result<BytedanceFundDaily>();
-        try {
-            bytedanceFundDailyService.save(bytedanceFundDaily);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param bytedanceFundDaily
-     * @return
-     */
-    @AutoLog(value = "账号日流水信息-编辑")
-    @ApiOperation(value = "账号日流水信息-编辑", notes = "账号日流水信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<BytedanceFundDaily> edit(@RequestBody BytedanceFundDaily bytedanceFundDaily) {
-        Result<BytedanceFundDaily> result = new Result<BytedanceFundDaily>();
-        BytedanceFundDaily bytedanceFundDailyEntity = bytedanceFundDailyService.getById(bytedanceFundDaily.getId());
-        if (bytedanceFundDailyEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = bytedanceFundDailyService.updateById(bytedanceFundDaily);
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "账号日流水信息-通过id删除")
-    @ApiOperation(value = "账号日流水信息-通过id删除", notes = "账号日流水信息-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            bytedanceFundDailyService.removeById(id);
-        } 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<BytedanceFundDaily> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<BytedanceFundDaily> result = new Result<BytedanceFundDaily>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.bytedanceFundDailyService.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<BytedanceFundDaily> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<BytedanceFundDaily> result = new Result<BytedanceFundDaily>();
-        BytedanceFundDaily bytedanceFundDaily = bytedanceFundDailyService.getById(id);
-        if (bytedanceFundDaily == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(bytedanceFundDaily);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-}

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
@@ -10,9 +9,11 @@ import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
@@ -22,14 +23,8 @@ import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysDepartService;
 import org.jeecg.modules.system.service.ISysUserService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -41,30 +36,28 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-@Controller
+@Slf4j
+@RestController
 public class CallbackController {
-    private static final Logger logger = LoggerFactory.getLogger(CallbackController.class);
     @Autowired
     private ISysUserService sysUserService;
-
     @Autowired
     private RedisUtil redisUtil;
     @Autowired
     private ISysDepartService sysDepartService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
-
     @Autowired
     private IBindAccountAuthService bindAccountAuthService;
-
     @Autowired
     private UserAllocationMapper allocationMapper;
-
     @Autowired
     private ICtopOauthTokenService ctopOauthTokenService;
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+
 
     @GetMapping("/qywexin")
-    @ResponseBody
     public void qywexin(HttpServletRequest request,
                         HttpServletResponse response,
                         @RequestParam("code") String code,
@@ -92,7 +85,7 @@ public class CallbackController {
         JSONObject obj = new JSONObject();
         List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
         obj.put("departs", departs);
-        if (departs == null || departs.size() == 0) {
+        if (departs == null || departs.isEmpty()) {
             obj.put("multi_depart", 0);
         } else if (departs.size() == 1) {
             sysUserService.updateUserDepart(username, departs.get(0).getOrgCode());
@@ -108,7 +101,6 @@ public class CallbackController {
     }
 
     /**
-     * TODO 授权绑定成功/失败 需要跳转特定页面
      *
      * @param request
      * @param response
@@ -117,17 +109,13 @@ public class CallbackController {
      * @return
      */
     @GetMapping("/kuaishou")
-    @ResponseBody
-    public String kuaishou(HttpServletRequest request,
-                           HttpServletResponse response,
-                           @RequestParam("auth_code") String authCode,
-                           @RequestParam("state") String state) {
+    public String kuaishouCallback(HttpServletRequest request, HttpServletResponse response, @RequestParam("auth_code") String authCode, @RequestParam("state") String state) {
         try {
             JSONObject json = JSONObject.parseObject(state);
             if (Check.isNull(json)) {
                 throw new Exception("回调信息为空");
             }
-            logger.info("快手授权返回信息:{}", json);
+            log.info("快手授权返回信息:{}", json);
             Integer agentType = json.getInteger("agentType");
             if (StringUtils.isNotBlank(authCode)) {
                 KuaishouResultToken accessToken = kuaishouInterfaceService.getAccessToken(authCode, agentType);
@@ -151,8 +139,8 @@ public class CallbackController {
                     //创建人
                     String userId = json.getString("userId");
                     Long projectId = json.getLong("projectId");
-                    BigDecimal WarningProportion = json.getBigDecimal("WarningProportion");
-                    BigDecimal WarningAmount = json.getBigDecimal("WarningAmount");
+                    BigDecimal warningProportion = json.getBigDecimal("WarningProportion");
+                    BigDecimal warningAmount = json.getBigDecimal("WarningAmount");
                     String systemType = json.getString("systemType");
 
                     CtopOauthToken topOauthToken = new CtopOauthToken();
@@ -199,8 +187,8 @@ public class CallbackController {
                     userAllocation.setAccountId(accountId);
                     userAllocation.setProjectId(projectId);
                     userAllocation.setProjectName(projectName);
-                    userAllocation.setWarningProportion(WarningProportion);
-                    userAllocation.setWarningAmount(WarningAmount);
+                    userAllocation.setWarningProportion(warningProportion);
+                    userAllocation.setWarningAmount(warningAmount);
 
                     userAllocation.setCreateTime(new Date());
                     userAllocation.setUpdateTime(new Date());
@@ -211,7 +199,7 @@ public class CallbackController {
                     allocationMapper.deleteByMap(deleteUserMap);
                     int i = allocationMapper.insert(userAllocation);
                     if (i > 0) {
-                        logger.info("同步分配用户表完成,task_id:{},accountId:{}", state, accountId);
+                        log.info("同步分配用户表完成,task_id:{},accountId:{}", state, accountId);
                     }
 
                     //账号绑定
@@ -237,7 +225,6 @@ public class CallbackController {
     }
 
     @RequestMapping("/bytedance")
-    @ResponseBody
     public String bytedance(HttpServletRequest request,
                             HttpServletResponse response,
                             @RequestParam("auth_code") String authCode,
@@ -249,23 +236,20 @@ public class CallbackController {
             if (code == 0) {
                 return "授权绑定成功";
             }
-            logger.info("返回信息:{}", map.toString());
+            log.info("返回信息:{}", map.toString());
             return (String) map.get("desc");
         }
         return "授权绑定失败";
     }
 
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
     public Map<String, Object> getByteDanceAccessToken(String authCode, String state) {
         Map<String, Object> param = new HashMap<>();
         param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
         param.put("secret", PropertiesUtils.getValue("bytedance_config", "bytedance_secret"));
         param.put("grant_type", "auth_code");
         param.put("auth_code", authCode);
-        logger.info("authCode:{}", authCode);
-        logger.info("state:{}", state);
+        log.info("authCode:{}", authCode);
+        log.info("state:{}", state);
         Map<String, Object> returnMap = new HashMap<>();
         try {
             JSONObject json = JSONObject.parseObject(state);
@@ -274,11 +258,11 @@ public class CallbackController {
             }
             String result = HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + BytedanceInterfaceConstant.AUTH_TOKEN, param, new HashMap<>());
             JSONObject resultObject = JSONObject.parseObject(result);
-            logger.info("返回信息:{}", resultObject);
+            log.info("返回信息:{}", resultObject);
             Integer code = resultObject.getInteger("code");
             String message = resultObject.getString("message");
             if (null == code || code != 0) {
-                logger.error("获取token失败,state:{},message:{}", state, message);
+                log.error("获取token失败,state:{},message:{}", state, message);
                 throw new Exception("token返回码异常");
             }
             //广告主id
@@ -294,8 +278,8 @@ public class CallbackController {
             String userName = json.getString("userName");
             Long projectId = json.getLong("projectId");
             String projectName = json.getString("projectName");
-            BigDecimal WarningProportion = json.getBigDecimal("WarningProportion");
-            BigDecimal WarningAmount = json.getBigDecimal("WarningAmount");
+            BigDecimal warningProportion = json.getBigDecimal("WarningProportion");
+            BigDecimal warningAmount = json.getBigDecimal("WarningAmount");
 
             JSONObject data = resultObject.getJSONObject("data");
             CtopOauthToken token = new CtopOauthToken(advertiserId, data);
@@ -304,7 +288,7 @@ public class CallbackController {
             Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
             Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
             if (null == getSuccess || !getSuccess) {
-                logger.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
+                log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
                 throw new Exception("获取广告主信息失败");
             }
 
@@ -333,8 +317,8 @@ public class CallbackController {
             userAllocation.setSystemType(systemType);
             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
             userAllocation.setAdvertiserId(advertiserId);
-            userAllocation.setWarningProportion(WarningProportion);
-            userAllocation.setWarningAmount(WarningAmount);
+            userAllocation.setWarningProportion(warningProportion);
+            userAllocation.setWarningAmount(warningAmount);
             userAllocation.setCreateTime(new Date());
             userAllocation.setUpdateTime(new Date());
             allocationMapper.deleteById(userAllocation.getId());
@@ -344,17 +328,11 @@ public class CallbackController {
             allocationMapper.deleteByMap(deleteUserMap);
             int i = allocationMapper.insert(userAllocation);
             if (i > 0) {
-                logger.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+                log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
             }
             //账号绑定
             bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
-            Thread thread = new Thread() {
-                @Override
-                public void run() {
-                    reportService.loadBytedanceHistoryData(token);
-                }
-            };
-            thread.start();
+            new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
             returnMap.put("code", 0);
             returnMap.put("desc", "success");
         } catch (Exception e) {

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

@@ -22,8 +22,6 @@ public class CreativeTitleController {
         result.setSuccess(true);
         result.setResult(labelArr);
         return result;
-
-
     }
 
 
@@ -34,8 +32,6 @@ public class CreativeTitleController {
         result.setSuccess(true);
         result.setResult(labelArr);
         return result;
-
-
     }
 
 
@@ -47,8 +43,6 @@ public class CreativeTitleController {
         result.setSuccess(true);
         result.setResult(labelArr);
         return result;
-
-
     }
 
 

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

@@ -67,7 +67,7 @@ public class CtopOauthTokenController {
                                                        HttpServletRequest req) {
         Result<IPage<CtopOauthToken>> result = new Result<>();
         QueryWrapper<CtopOauthToken> queryWrapper = QueryGenerator.initQueryWrapper(cTopOauthToken, req.getParameterMap());
-        Page<CtopOauthToken> page = new Page<CtopOauthToken>(pageNo, pageSize);
+        Page<CtopOauthToken> page = new Page<>(pageNo, pageSize);
         IPage<CtopOauthToken> pageList = ctopOauthTokenService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -84,7 +84,7 @@ public class CtopOauthTokenController {
     @ApiOperation(value = "oauth授权码-添加", notes = "oauth授权码-添加")
     @PostMapping(value = "/add")
     public Result<CtopOauthToken> add(@RequestBody CtopOauthToken ctopOauthToken) {
-        Result<CtopOauthToken> result = new Result<CtopOauthToken>();
+        Result<CtopOauthToken> result = new Result<>();
         try {
             ctopOauthTokenService.save(ctopOauthToken);
             result.success("添加成功!");
@@ -105,13 +105,12 @@ public class CtopOauthTokenController {
     @ApiOperation(value = "oauth授权码-编辑", notes = "oauth授权码-编辑")
     @PutMapping(value = "/edit")
     public Result<CtopOauthToken> edit(@RequestBody CtopOauthToken cTopOauthToken) {
-        Result<CtopOauthToken> result = new Result<CtopOauthToken>();
+        Result<CtopOauthToken> result = new Result<>();
         CtopOauthToken cTopOauthTokenEntity = ctopOauthTokenService.getById(cTopOauthToken.getId());
         if (cTopOauthTokenEntity == null) {
             result.error500("未找到对应实体");
         } else {
             boolean ok = ctopOauthTokenService.updateById(cTopOauthToken);
-            //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");
             }
@@ -129,7 +128,7 @@ public class CtopOauthTokenController {
     @AutoLog(value = "oauth授权码-通过id删除")
     @ApiOperation(value = "oauth授权码-通过id删除", notes = "oauth授权码-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             ctopOauthTokenService.removeById(id);
         } catch (Exception e) {
@@ -169,7 +168,7 @@ public class CtopOauthTokenController {
     @ApiOperation(value = "oauth授权码-通过id查询", notes = "oauth授权码-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<CtopOauthToken> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<CtopOauthToken> result = new Result<CtopOauthToken>();
+        Result<CtopOauthToken> result = new Result<>();
         CtopOauthToken cTopOauthToken = ctopOauthTokenService.getById(id);
         if (cTopOauthToken == null) {
             result.error500("未找到对应实体");
@@ -219,8 +218,8 @@ public class CtopOauthTokenController {
      * @param response
      * @return
      */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+    @PostMapping("/importExcel")
+    public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
         for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {

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

@@ -80,11 +80,11 @@ public class DramaInfoController {
 												  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 												  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 												  HttpServletRequest req) {
-		Result<IPage<DramaInfo>> result = new Result<IPage<DramaInfo>>();
+        Result<IPage<DramaInfo>> result = new Result<>();
 		QueryWrapper<DramaInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaInfo, req.getParameterMap());
-		Page<DramaInfo> page = new Page<DramaInfo>(pageNo, pageSize);
+        Page<DramaInfo> page = new Page<>(pageNo, pageSize);
 		IPage<DramaInfo> pageList = dramaInfoService.page(page, queryWrapper);
-		if (pageList != null && pageList.getRecords() != null && pageList.getRecords().size() > 0) {
+        if (pageList != null && pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
 			List<DramaInfo> list = new ArrayList<>();
 			for (int i = 0; i < pageList.getRecords().size(); i++) {
 				DramaInfo getDramaInfo = pageList.getRecords().get(i);
@@ -136,7 +136,7 @@ public class DramaInfoController {
 	@ApiOperation(value="剧本信息-编辑", notes="剧本信息-编辑")
 	@PostMapping(value = "/edit")
 	public Result<DramaInfo> edit(@RequestBody DramaInfo dramaInfo) {
-		Result<DramaInfo> result = new Result<DramaInfo>();
+        Result<DramaInfo> result = new Result<>();
 		DramaInfo dramaInfoEntity = dramaInfoService.getById(dramaInfo.getId());
 		if(dramaInfoEntity==null) {
 			result.error500("未找到对应实体");
@@ -158,14 +158,8 @@ public class DramaInfoController {
 	@AutoLog(value = "剧本信息-通过id删除")
 	@ApiOperation(value="剧本信息-通过id删除", notes="剧本信息-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
-		try {
-			dramaInfoService.removeById(id);
-		} catch (Exception e) {
-			log.error("删除失败",e.getMessage());
-			return Result.error("删除失败!");
-		}
-		return Result.ok("删除成功!");
+    public Map<String, Object> delete(@RequestParam(name = "id", required = true) String id) {
+        return dramaInfoService.delete(id);
 	}
 
 	/**
@@ -177,7 +171,7 @@ public class DramaInfoController {
 	@ApiOperation(value="剧本信息-批量删除", notes="剧本信息-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<DramaInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<DramaInfo> result = new Result<DramaInfo>();
+        Result<DramaInfo> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -196,7 +190,7 @@ public class DramaInfoController {
 	@ApiOperation(value="剧本信息-通过id查询", notes="剧本信息-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<DramaInfo> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<DramaInfo> result = new Result<DramaInfo>();
+        Result<DramaInfo> result = new Result<>();
 		DramaInfo dramaInfo = dramaInfoService.getById(id);
 		if(dramaInfo==null) {
 			result.error500("未找到对应实体");

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

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.Map;
 
 /**
  * 剧本内容信息
@@ -49,9 +50,9 @@ public class DramaItemInfoController {
                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                       HttpServletRequest req) {
-        Result<IPage<DramaItemInfo>> result = new Result<IPage<DramaItemInfo>>();
+        Result<IPage<DramaItemInfo>> result = new Result<>();
         QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
-        Page<DramaItemInfo> page = new Page<DramaItemInfo>(pageNo, pageSize);
+        Page<DramaItemInfo> page = new Page<>(pageNo, pageSize);
         queryWrapper.orderByAsc("rank").orderByDesc("update_time");
         IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
         result.setSuccess(true);
@@ -114,14 +115,8 @@ public class DramaItemInfoController {
     @AutoLog(value = "剧本内容信息-通过id删除")
     @ApiOperation(value = "剧本内容信息-通过id删除", notes = "剧本内容信息-通过id删除")
     @PostMapping(value = "/delete")
-    public Result<?> delete(@RequestBody DramaItemInfo dramaItemInfo) {
-        try {
-            dramaItemInfoService.removeById(dramaItemInfo.getId());
-        } catch (Exception e) {
-            log.error("删除失败", e.getMessage());
-            return Result.error("删除失败!");
-        }
-        return Result.ok("删除成功!");
+    public Map<String, Object> delete(@RequestBody DramaItemInfo dramaItemInfo) {
+        return dramaItemInfoService.delete(dramaItemInfo.getId());
     }
 
     /**
@@ -134,7 +129,7 @@ public class DramaItemInfoController {
     @ApiOperation(value = "剧本内容信息-批量删除", notes = "剧本内容信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<DramaItemInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        Result<DramaItemInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -154,7 +149,7 @@ public class DramaItemInfoController {
     @ApiOperation(value = "剧本内容信息-通过id查询", notes = "剧本内容信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<DramaItemInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        Result<DramaItemInfo> result = new Result<>();
         DramaItemInfo dramaItemInfo = dramaItemInfoService.getById(id);
         if (dramaItemInfo == null) {
             result.error500("未找到对应实体");

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

@@ -48,9 +48,9 @@ public class DramaRoleInfoController {
                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                       HttpServletRequest req) {
-        Result<IPage<DramaRoleInfo>> result = new Result<IPage<DramaRoleInfo>>();
+        Result<IPage<DramaRoleInfo>> result = new Result<>();
         QueryWrapper<DramaRoleInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaRoleInfo, req.getParameterMap());
-        Page<DramaRoleInfo> page = new Page<DramaRoleInfo>(pageNo, pageSize);
+        Page<DramaRoleInfo> page = new Page<>(pageNo, pageSize);
         IPage<DramaRoleInfo> pageList = dramaRoleInfoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -67,7 +67,7 @@ public class DramaRoleInfoController {
     @ApiOperation(value = "剧本角色信息-添加", notes = "剧本角色信息-添加")
     @PostMapping(value = "/add")
     public Result<DramaRoleInfo> add(@RequestBody DramaRoleInfo dramaRoleInfo) {
-        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        Result<DramaRoleInfo> result = new Result<>();
         try {
             dramaRoleInfoService.save(dramaRoleInfo);
             result.success("添加成功!");
@@ -88,7 +88,7 @@ public class DramaRoleInfoController {
     @ApiOperation(value = "剧本角色信息-编辑", notes = "剧本角色信息-编辑")
     @PutMapping(value = "/edit")
     public Result<DramaRoleInfo> edit(@RequestBody DramaRoleInfo dramaRoleInfo) {
-        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        Result<DramaRoleInfo> result = new Result<>();
         DramaRoleInfo dramaRoleInfoEntity = dramaRoleInfoService.getById(dramaRoleInfo.getId());
         if (dramaRoleInfoEntity == null) {
             result.error500("未找到对应实体");
@@ -111,7 +111,7 @@ public class DramaRoleInfoController {
     @AutoLog(value = "剧本角色信息-通过id删除")
     @ApiOperation(value = "剧本角色信息-通过id删除", notes = "剧本角色信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             dramaRoleInfoService.removeById(id);
         } catch (Exception e) {
@@ -131,7 +131,7 @@ public class DramaRoleInfoController {
     @ApiOperation(value = "剧本角色信息-批量删除", notes = "剧本角色信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<DramaRoleInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        Result<DramaRoleInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -151,7 +151,7 @@ public class DramaRoleInfoController {
     @ApiOperation(value = "剧本角色信息-通过id查询", notes = "剧本角色信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<DramaRoleInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        Result<DramaRoleInfo> result = new Result<>();
         DramaRoleInfo dramaRoleInfo = dramaRoleInfoService.getById(id);
         if (dramaRoleInfo == null) {
             result.error500("未找到对应实体");

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

@@ -82,7 +82,7 @@ public class EduLessonController {
     }
 
     @GetMapping(value = "/lesson/list")
-    public Result<List<EduLesson>> lessonList(String media,String title,String topic){
+    public Result<List<EduLesson>> lessonList(String media, String title, String topic){
         Result<List<EduLesson>> result = new Result<>();
         QueryWrapper<EduLesson> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("media",media);
@@ -95,25 +95,23 @@ public class EduLessonController {
     }
 
     @PostMapping(value = "/lesson/upload")
-    public Result<Map<String,String>> updaloadLesson(@RequestBody EduLesson eduLesson){
-        Result<Map<String,String>> result = new Result();
-        Map<String,String> resultMap = new HashMap<>();
+    public Result<Map<String, String>> updaloadLesson(@RequestBody EduLesson eduLesson) {
+        Result<Map<String, String>> result = new Result();
+        Map<String, String> resultMap = new HashMap<>();
 
         if (StringUtils.isBlank(eduLesson.getMedia()) || StringUtils.isBlank(eduLesson.getTitle()) ||
-            StringUtils.isBlank(eduLesson.getTopic()) || StringUtils.isBlank(eduLesson.getName()) ||
-            StringUtils.isBlank(eduLesson.getOssFileUrl()) || StringUtils.isBlank(eduLesson.getFileType())
-        ){
+                StringUtils.isBlank(eduLesson.getTopic()) || StringUtils.isBlank(eduLesson.getName()) ||
+                StringUtils.isBlank(eduLesson.getOssFileUrl()) || StringUtils.isBlank(eduLesson.getFileType())
+        ) {
             result.error500("参数不可为空");
             return result;
         }
         String lessonId = eduLessonService.uploadLesson(eduLesson);
 
-        resultMap.put("lessonId",lessonId);
+        resultMap.put("lessonId", lessonId);
         result.setResult(resultMap);
         result.setSuccess(true);
 
         return result;
     }
-
-
 }

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

@@ -1,250 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-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.aspect.annotation.AutoLog;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.EduLessonNew;
-import org.jeecg.modules.ctop.service.IEduLessonNewService;
-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
- * @version V1.0
- * @date 2020-04-22
- */
-@Slf4j
-@Api(tags = "内部培训视频信息")
-@RestController
-@RequestMapping("/ctop/eduLessonNew")
-public class EduLessonNewController {
-    @Autowired
-    private IEduLessonNewService eduLessonNewService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param eduLessonNew
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "内部培训视频信息-分页列表查询")
-    @ApiOperation(value = "内部培训视频信息-分页列表查询", notes = "内部培训视频信息-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<EduLessonNew>> queryPageList(EduLessonNew eduLessonNew,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
-                                                     HttpServletRequest req) {
-        Result<IPage<EduLessonNew>> result = new Result<>();
-        eduLessonNew.setEnabled(CtopAdConstant.COMMON_STATUS_ENABLED);
-        QueryWrapper<EduLessonNew> queryWrapper = QueryGenerator.initQueryWrapper(eduLessonNew, req.getParameterMap());
-        Page<EduLessonNew> page = new Page<>(pageNo, pageSize);
-        IPage<EduLessonNew> pageList = eduLessonNewService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param eduLessonNew
-     * @return
-     */
-    @AutoLog(value = "内部培训视频信息-添加")
-    @ApiOperation(value = "内部培训视频信息-添加", notes = "内部培训视频信息-添加")
-    @PostMapping(value = "/add")
-    public Result<EduLessonNew> add(@RequestBody EduLessonNew eduLessonNew) {
-        Result<EduLessonNew> result = new Result<EduLessonNew>();
-        try {
-            eduLessonNewService.save(eduLessonNew);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param eduLessonNew
-     * @return
-     */
-    @AutoLog(value = "内部培训视频信息-编辑")
-    @ApiOperation(value = "内部培训视频信息-编辑", notes = "内部培训视频信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<EduLessonNew> edit(@RequestBody EduLessonNew eduLessonNew) {
-        Result<EduLessonNew> result = new Result<EduLessonNew>();
-        EduLessonNew eduLessonNewEntity = eduLessonNewService.getById(eduLessonNew.getId());
-        if (eduLessonNewEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = eduLessonNewService.updateById(eduLessonNew);
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "内部培训视频信息-通过id删除")
-    @ApiOperation(value = "内部培训视频信息-通过id删除", notes = "内部培训视频信息-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            eduLessonNewService.removeById(id);
-        } 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<EduLessonNew> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<EduLessonNew> result = new Result<EduLessonNew>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.eduLessonNewService.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<EduLessonNew> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<EduLessonNew> result = new Result<EduLessonNew>();
-        EduLessonNew eduLessonNew = eduLessonNewService.getById(id);
-        if (eduLessonNew == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(eduLessonNew);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<EduLessonNew> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                EduLessonNew eduLessonNew = JSON.parseObject(deString, EduLessonNew.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(eduLessonNew, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<EduLessonNew> pageList = eduLessonNewService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "内部培训视频信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, EduLessonNew.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<EduLessonNew> listEduLessonNews = ExcelImportUtil.importExcel(file.getInputStream(), EduLessonNew.class, params);
-                eduLessonNewService.saveBatch(listEduLessonNews);
-                return Result.ok("文件导入成功!数据行数:" + listEduLessonNews.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("文件导入失败!");
-    }
-
-}

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

@@ -3,7 +3,6 @@ package org.jeecg.modules.ctop.controller;
 import cn.com.ctop.common.module.entity.FileInfo;
 import cn.com.ctop.common.module.service.IFileInfoService;
 import cn.com.ctop.common.module.utils.StringUtils;
-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;
@@ -13,23 +12,16 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
@@ -64,9 +56,9 @@ public class FileInfoController {
                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                  HttpServletRequest req) {
-        Result<IPage<FileInfo>> result = new Result<IPage<FileInfo>>();
+        Result<IPage<FileInfo>> result = new Result<>();
         QueryWrapper<FileInfo> queryWrapper = QueryGenerator.initQueryWrapper(fileInfo, req.getParameterMap());
-        Page<FileInfo> page = new Page<FileInfo>(pageNo, pageSize);
+        Page<FileInfo> page = new Page<>(pageNo, pageSize);
         IPage<FileInfo> pageList = fileInfoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +75,7 @@ public class FileInfoController {
     @ApiOperation(value = "文件信息-添加", notes = "文件信息-添加")
     @PostMapping(value = "/add")
     public Result<FileInfo> add(@RequestBody FileInfo fileInfo) {
-        Result<FileInfo> result = new Result<FileInfo>();
+        Result<FileInfo> result = new Result<>();
         try {
             fileInfoService.save(fileInfo);
             result.success("添加成功!");
@@ -104,13 +96,12 @@ public class FileInfoController {
     @ApiOperation(value = "文件信息-编辑", notes = "文件信息-编辑")
     @PutMapping(value = "/edit")
     public Result<FileInfo> edit(@RequestBody FileInfo fileInfo) {
-        Result<FileInfo> result = new Result<FileInfo>();
+        Result<FileInfo> result = new Result<>();
         FileInfo fileInfoEntity = fileInfoService.getById(fileInfo.getId());
         if (fileInfoEntity == null) {
             result.error500("未找到对应实体");
         } else {
             boolean ok = fileInfoService.updateById(fileInfo);
-            //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");
             }
@@ -128,7 +119,7 @@ public class FileInfoController {
     @AutoLog(value = "文件信息-通过id删除")
     @ApiOperation(value = "文件信息-通过id删除", notes = "文件信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             fileInfoService.removeById(id);
         } catch (Exception e) {
@@ -148,7 +139,7 @@ public class FileInfoController {
     @ApiOperation(value = "文件信息-批量删除", notes = "文件信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<FileInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<FileInfo> result = new Result<FileInfo>();
+        Result<FileInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -168,7 +159,7 @@ public class FileInfoController {
     @ApiOperation(value = "文件信息-通过id查询", notes = "文件信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<FileInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<FileInfo> result = new Result<FileInfo>();
+        Result<FileInfo> result = new Result<>();
         FileInfo fileInfo = fileInfoService.getById(id);
         if (fileInfo == null) {
             result.error500("未找到对应实体");
@@ -180,46 +171,14 @@ public class FileInfoController {
     }
 
     /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<FileInfo> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                FileInfo fileInfo = JSON.parseObject(deString, FileInfo.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(fileInfo, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<FileInfo> pageList = fileInfoService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "文件信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, FileInfo.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) {
+    @PostMapping("/importExcel")
+    public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
         for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
@@ -240,6 +199,7 @@ public class FileInfoController {
                     file.getInputStream().close();
                 } catch (IOException e) {
                     e.printStackTrace();
+                    log.error("服务异常");
                 }
             }
         }

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

@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
@@ -20,7 +19,7 @@ import java.util.Map;
 /**
  * @author jeecg-boot
  */
-@Controller
+@RestController
 @RequestMapping("/graphql")
 public class GraphqlController {
     @Autowired
@@ -37,12 +36,11 @@ public class GraphqlController {
         }
     }
 
-    @ResponseBody
-    @RequestMapping(value="/addkuaishouuser", method = RequestMethod.POST)
+    @PostMapping("/addkuaishouuser")
     public Result<Map<String,Object>> addKuaishouUser(@RequestBody JSONObject jsonObject){
         String url = jsonObject.getString("url");
         String uid = kuaishouWebInterfaceService.checkKuaishouUser(url);
-        Map<String,Object> resultMap = new HashMap<String, Object>();
+        Map<String, Object> resultMap = new HashMap<>();
         if(uid == null){
             resultMap.put("hasUser",false);
         }else {
@@ -59,19 +57,15 @@ public class GraphqlController {
             };
             thread.start();
         }
-        Result<Map<String,Object>> result = new Result<Map<String,Object>>();
+        Result<Map<String, Object>> result = new Result<>();
         result.setSuccess(true);
         result.setResult(resultMap);
         return result;
     }
 
-    @ResponseBody
-    @RequestMapping(value="/publicfeeds", method = RequestMethod.GET)
-    public Result<IPage<KuaishouVideo>> getVideoList(@RequestParam("num") Integer num){
-        if(num==null){
-            num=99999999;
-        }
-        Result<IPage<KuaishouVideo>> result = new Result<IPage<KuaishouVideo>>();
+    @GetMapping("/publicfeeds")
+    public Result<IPage<KuaishouVideo>> getVideoList(@RequestParam(name = "num", defaultValue = "99999999") Integer num) {
+        Result<IPage<KuaishouVideo>> result = new Result<>();
         KuaishouVideo video = new KuaishouVideo();
         QueryWrapper<KuaishouVideo> queryWrapper = QueryGenerator.initQueryWrapper(video,null);
         queryWrapper.orderByDesc("num");

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

@@ -34,10 +34,9 @@ public class HotInformationCtroller {
     private IHotMaterialService hotMaterialService;
 
     @ResponseBody
-    @RequestMapping(value = "/douyin/feeds", method = RequestMethod.GET)
+    @GetMapping("/douyin/feeds")
     public Result<IPage<DouyinHot>> getVideoList(HttpServletRequest req) {
         Result<IPage<DouyinHot>> result = new Result<>();
-        DouyinHot hot = new DouyinHot();
         Map<String, String[]> paramMap = req.getParameterMap();
         String userName = paramMap.get("userName") != null ? paramMap.get("userName")[0] : null;
         String start = paramMap.get("start") != null ? paramMap.get("start")[0] : null;
@@ -53,7 +52,7 @@ public class HotInformationCtroller {
     }
 
     @ResponseBody
-    @RequestMapping(value = "/effectcase/feeds", method = RequestMethod.GET)
+    @GetMapping("/effectcase/feeds")
     public Result<IPage<EffectCase>> getEffectcaseList(HttpServletRequest req) {
         Result<IPage<EffectCase>> result = new Result<>();
         Map<String, String[]> paramMap = req.getParameterMap();
@@ -71,7 +70,7 @@ public class HotInformationCtroller {
     }
 
     @ResponseBody
-    @RequestMapping(value = "/material/feeds", method = RequestMethod.GET)
+    @GetMapping("/material/feeds")
     public Result<IPage<HotMaterial>> getMaterialList(HttpServletRequest req) {
         Result<IPage<HotMaterial>> result = new Result<>();
         Map<String, String[]> paramMap = req.getParameterMap();
@@ -89,7 +88,7 @@ public class HotInformationCtroller {
     }
 
     @ResponseBody
-    @RequestMapping(value = "/video/url", method = RequestMethod.GET)
+    @GetMapping("/video/url")
     public Map<String, Object> getVideoUrl(@RequestParam(name = "id") String id, @RequestParam(name = "type") Integer type) {
         try {
             return effectCaseService.getVideoUrl(id, type);

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

@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.zip.ZipEntry;
@@ -23,8 +24,6 @@ import java.util.zip.ZipOutputStream;
 @RestController
 @RequestMapping("/download")
 public class ImageDownloadController {
-
-
     @RequestMapping(value = "/zip")
     @ResponseBody
     public void downloadFiles(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject json) {
@@ -42,9 +41,9 @@ public class ImageDownloadController {
         String agent = request.getHeader("USER-AGENT");
         try {
             if (agent.contains("MSIE") || agent.contains("Trident")) {
-                downloadName = java.net.URLEncoder.encode(downloadName, "UTF-8");
+                downloadName = java.net.URLEncoder.encode(downloadName, StandardCharsets.UTF_8.toString());
             } else {
-                downloadName = new String(downloadName.getBytes("UTF-8"), "ISO-8859-1");
+                downloadName = new String(downloadName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -102,6 +101,7 @@ public class ImageDownloadController {
 
     }
 
+
     //url转file
     private File getFileByUrl(String fileUrl, String suffix) {
         ByteArrayOutputStream outStream = new ByteArrayOutputStream();
@@ -123,14 +123,18 @@ public class ImageDownloadController {
             stream = new BufferedOutputStream(fileOutputStream);
             stream.write(outStream.toByteArray());
         } catch (Exception e) {
+            e.printStackTrace();
         } finally {
             try {
-                if (inputStream != null)
+                if (inputStream != null){
                     inputStream.close();
-                if (stream != null)
+                }
+                if (stream != null){
                     stream.close();
+                }
                 outStream.close();
             } catch (Exception e) {
+                e.printStackTrace();
             }
         }
         return file;

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-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;
@@ -10,28 +9,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.KuaiShouDefectMaterial;
 import org.jeecg.modules.ctop.service.IKuaiShouDefectMaterialService;
-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;
 
 /**
  * 快手缺失素材
@@ -64,9 +48,9 @@ public class KuaiShouDefectMaterialController {
                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                                HttpServletRequest req) {
-        Result<IPage<KuaiShouDefectMaterial>> result = new Result<IPage<KuaiShouDefectMaterial>>();
+        Result<IPage<KuaiShouDefectMaterial>> result = new Result<>();
         QueryWrapper<KuaiShouDefectMaterial> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouDefectMaterial, req.getParameterMap());
-        Page<KuaiShouDefectMaterial> page = new Page<KuaiShouDefectMaterial>(pageNo, pageSize);
+        Page<KuaiShouDefectMaterial> page = new Page<>(pageNo, pageSize);
         IPage<KuaiShouDefectMaterial> pageList = kuaiShouDefectMaterialService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +67,7 @@ public class KuaiShouDefectMaterialController {
     @ApiOperation(value = "快手缺失素材-添加", notes = "快手缺失素材-添加")
     @PostMapping(value = "/add")
     public Result<KuaiShouDefectMaterial> add(@RequestBody KuaiShouDefectMaterial kuaiShouDefectMaterial) {
-        Result<KuaiShouDefectMaterial> result = new Result<KuaiShouDefectMaterial>();
+        Result<KuaiShouDefectMaterial> result = new Result<>();
         try {
             kuaiShouDefectMaterialService.save(kuaiShouDefectMaterial);
             result.success("添加成功!");
@@ -104,7 +88,7 @@ public class KuaiShouDefectMaterialController {
     @ApiOperation(value = "快手缺失素材-编辑", notes = "快手缺失素材-编辑")
     @PutMapping(value = "/edit")
     public Result<KuaiShouDefectMaterial> edit(@RequestBody KuaiShouDefectMaterial kuaiShouDefectMaterial) {
-        Result<KuaiShouDefectMaterial> result = new Result<KuaiShouDefectMaterial>();
+        Result<KuaiShouDefectMaterial> result = new Result<>();
         KuaiShouDefectMaterial kuaiShouDefectMaterialEntity = kuaiShouDefectMaterialService.getById(kuaiShouDefectMaterial.getId());
         if (kuaiShouDefectMaterialEntity == null) {
             result.error500("未找到对应实体");
@@ -127,7 +111,7 @@ public class KuaiShouDefectMaterialController {
     @AutoLog(value = "快手缺失素材-通过id删除")
     @ApiOperation(value = "快手缺失素材-通过id删除", notes = "快手缺失素材-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             kuaiShouDefectMaterialService.removeById(id);
         } catch (Exception e) {
@@ -147,7 +131,7 @@ public class KuaiShouDefectMaterialController {
     @ApiOperation(value = "快手缺失素材-批量删除", notes = "快手缺失素材-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<KuaiShouDefectMaterial> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<KuaiShouDefectMaterial> result = new Result<KuaiShouDefectMaterial>();
+        Result<KuaiShouDefectMaterial> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -167,7 +151,7 @@ public class KuaiShouDefectMaterialController {
     @ApiOperation(value = "快手缺失素材-通过id查询", notes = "快手缺失素材-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<KuaiShouDefectMaterial> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<KuaiShouDefectMaterial> result = new Result<KuaiShouDefectMaterial>();
+        Result<KuaiShouDefectMaterial> result = new Result<>();
         KuaiShouDefectMaterial kuaiShouDefectMaterial = kuaiShouDefectMaterialService.getById(id);
         if (kuaiShouDefectMaterial == null) {
             result.error500("未找到对应实体");
@@ -177,72 +161,4 @@ public class KuaiShouDefectMaterialController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<KuaiShouDefectMaterial> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                KuaiShouDefectMaterial kuaiShouDefectMaterial = JSON.parseObject(deString, KuaiShouDefectMaterial.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouDefectMaterial, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<KuaiShouDefectMaterial> pageList = kuaiShouDefectMaterialService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "快手缺失素材列表");
-        mv.addObject(NormalExcelConstants.CLASS, KuaiShouDefectMaterial.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<KuaiShouDefectMaterial> listKuaiShouDefectMaterials = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouDefectMaterial.class, params);
-                kuaiShouDefectMaterialService.saveBatch(listKuaiShouDefectMaterials);
-                return Result.ok("文件导入成功!数据行数:" + listKuaiShouDefectMaterials.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("文件导入失败!");
-    }
-
 }

+ 14 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAdvertiserController.java

@@ -61,7 +61,7 @@ public class KuaishouAdvertiserController {
                                                           @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                           @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                                           HttpServletRequest req) {
-        Result<IPage<KuaishouAdAccount>> result = new Result<IPage<KuaishouAdAccount>>();
+        Result<IPage<KuaishouAdAccount>> result = new Result<>();
         Map<String, String[]> paramMap = new HashMap<>(req.getParameterMap());
         paramMap.remove("dataProcess");
         paramMap.remove("industry");
@@ -74,7 +74,7 @@ public class KuaishouAdvertiserController {
         QueryWrapper<KuaishouAdAccount> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAdAccount, paramMap);
         String dataProcess = req.getParameter("dataProcess");
         if (name != null) {
-            queryWrapper.like("name", "%" + name + "%");
+            queryWrapper.like("name", name);
         }
         if (sysCategory != null) {
             queryWrapper.eq("industry_category", sysCategory.getName()).or()
@@ -102,7 +102,7 @@ public class KuaishouAdvertiserController {
             }
         }
 
-        Page<KuaishouAdAccount> page = new Page<KuaishouAdAccount>(pageNo, pageSize);
+        Page<KuaishouAdAccount> page = new Page<>(pageNo, pageSize);
         IPage<KuaishouAdAccount> pageList = kuaishouAdAccountService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -118,7 +118,7 @@ public class KuaishouAdvertiserController {
     @ApiOperation(value="快手广告主信息表-添加", notes="快手广告主信息表-添加")
     @PostMapping(value = "/add")
     public Result<KuaishouAdAccount> add(@RequestBody KuaishouAdAccount kuaishouAdAccount) {
-        Result<KuaishouAdAccount> result = new Result<KuaishouAdAccount>();
+        Result<KuaishouAdAccount> result = new Result<>();
         try {
             String industry = kuaishouAdAccount.getIndustry();
             SysCategory secondCategory = sysCategoryService.getById(industry);
@@ -145,7 +145,7 @@ public class KuaishouAdvertiserController {
     @ApiOperation(value="快手广告主信息表-编辑", notes="快手广告主信息表-编辑")
     @PutMapping(value = "/edit")
     public Result<KuaishouAdAccount> edit(@RequestBody KuaishouAdAccount kuaishouAdAccount) {
-        Result<KuaishouAdAccount> result = new Result<KuaishouAdAccount>();
+        Result<KuaishouAdAccount> result = new Result<>();
         KuaishouAdAccount kuaishouAdAccountEntity = kuaishouAdAccountService.getById(kuaishouAdAccount.getKsid());
 
         if(kuaishouAdAccountEntity==null) {
@@ -158,11 +158,9 @@ public class KuaishouAdvertiserController {
             kuaishouAdAccount.setFirstIndustry(firstCategory.getName());
             SysCategory industryCategory = sysCategoryService.getById(firstCategory.getPid());
             kuaishouAdAccount.setIndustryCategory(industryCategory.getName());
-            QueryWrapper<KuaishouAdAccount> queryWrapper = new QueryWrapper<KuaishouAdAccount>();
+            QueryWrapper<KuaishouAdAccount> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("ksid", kuaishouAdAccount.getKsid());
             boolean ok = kuaishouAdAccountService.update(kuaishouAdAccount, queryWrapper);
-//            boolean ok = kuaishouAdAccountService.updateById(kuaishouAdAccount);
-            //TODO 返回false说明什么?
             if(ok) {
                 result.success("修改成功!");
             }
@@ -179,7 +177,7 @@ public class KuaishouAdvertiserController {
     @AutoLog(value = "快手广告主信息表-通过id删除")
     @ApiOperation(value="快手广告主信息表-通过id删除", notes="快手广告主信息表-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             kuaishouAdAccountService.removeById(id);
         } catch (Exception e) {
@@ -217,7 +215,7 @@ public class KuaishouAdvertiserController {
     @ApiOperation(value="快手广告主信息表-通过id查询", notes="快手广告主信息表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<KuaishouAdAccount> queryById(@RequestParam(name="id",required=true) String id) {
-        Result<KuaishouAdAccount> result = new Result<KuaishouAdAccount>();
+        Result<KuaishouAdAccount> result = new Result<>();
         KuaishouAdAccount kuaishouAdAccount = kuaishouAdAccountService.getById(id);
         if(kuaishouAdAccount==null) {
             result.error500("未找到对应实体");
@@ -267,8 +265,8 @@ public class KuaishouAdvertiserController {
      * @param response
      * @return
      */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+    @PostMapping("/importExcel")
+    public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
         for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
@@ -295,19 +293,18 @@ public class KuaishouAdvertiserController {
         return Result.ok("文件导入失败!");
     }
     @ResponseBody
-    @RequestMapping(value="/companysugest", method = RequestMethod.GET)
+    @GetMapping("/companysugest")
     public Result<List<String>> getCompanySugest(@RequestParam("company") String company){
-        Result<List<String>> result = new Result<List<String>>();
+        Result<List<String>> result = new Result<>();
         List<String> list = kuaishouAdAccountService.companySugest(company);
         result.setResult(list);
         result.setSuccess(true);
         return result;
     }
 
-    @ResponseBody
-    @RequestMapping(value="/productsugest", method = RequestMethod.GET)
+    @GetMapping(value = "/productsugest")
     public Result<List<String>> getProductSugest(@RequestParam("product") String product){
-        Result<List<String>> result = new Result<List<String>>();
+        Result<List<String>> result = new Result<>();
         List<String> list = kuaishouAdAccountService.productSugest(product);
         result.setResult(list);
         result.setSuccess(true);

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

@@ -63,9 +63,9 @@ public class KuaishouAppAccountController {
 									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 									  HttpServletRequest req) {
-		Result<IPage<KuaishouAppAccount>> result = new Result<IPage<KuaishouAppAccount>>();
+        Result<IPage<KuaishouAppAccount>> result = new Result<>();
 		QueryWrapper<KuaishouAppAccount> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAppAccount, req.getParameterMap());
-		Page<KuaishouAppAccount> page = new Page<KuaishouAppAccount>(pageNo, pageSize);
+        Page<KuaishouAppAccount> page = new Page<>(pageNo, pageSize);
 		IPage<KuaishouAppAccount> pageList = kuaishouAppAccountService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
@@ -81,7 +81,7 @@ public class KuaishouAppAccountController {
 	@ApiOperation(value="快手APP账号表-添加", notes="快手APP账号表-添加")
 	@PostMapping(value = "/add")
 	public Result<KuaishouAppAccount> add(@RequestBody KuaishouAppAccount kuaishouAppAccount) {
-		Result<KuaishouAppAccount> result = new Result<KuaishouAppAccount>();
+        Result<KuaishouAppAccount> result = new Result<>();
 		try {
 			kuaishouAppAccountService.save(kuaishouAppAccount);
 			result.success("添加成功!");
@@ -101,13 +101,12 @@ public class KuaishouAppAccountController {
 	@ApiOperation(value="快手APP账号表-编辑", notes="快手APP账号表-编辑")
 	@PutMapping(value = "/edit")
 	public Result<KuaishouAppAccount> edit(@RequestBody KuaishouAppAccount kuaishouAppAccount) {
-		Result<KuaishouAppAccount> result = new Result<KuaishouAppAccount>();
+        Result<KuaishouAppAccount> result = new Result<>();
 		KuaishouAppAccount kuaishouAppAccountEntity = kuaishouAppAccountService.getById(kuaishouAppAccount.getId());
 		if(kuaishouAppAccountEntity==null) {
 			result.error500("未找到对应实体");
 		}else {
 			boolean ok = kuaishouAppAccountService.updateById(kuaishouAppAccount);
-			//TODO 返回false说明什么?
 			if(ok) {
 				result.success("修改成功!");
 			}
@@ -125,7 +124,7 @@ public class KuaishouAppAccountController {
 	@ApiOperation(value="快手APP账号表-通过id删除", notes="快手APP账号表-通过id删除")
 	@DeleteMapping(value = "/delete")
 	public Result<KuaishouAppAccount> delete(@RequestParam(name="id",required=true) String id) {
-		Result<KuaishouAppAccount> result = new Result<KuaishouAppAccount>();
+        Result<KuaishouAppAccount> result = new Result<>();
 		KuaishouAppAccount kuaishouAppAccount = kuaishouAppAccountService.getById(id);
 		if(kuaishouAppAccount==null) {
 			result.error500("未找到对应实体");
@@ -167,7 +166,7 @@ public class KuaishouAppAccountController {
 	@ApiOperation(value="快手APP账号表-通过id查询", notes="快手APP账号表-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<KuaishouAppAccount> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<KuaishouAppAccount> result = new Result<KuaishouAppAccount>();
+        Result<KuaishouAppAccount> result = new Result<>();
 		KuaishouAppAccount kuaishouAppAccount = kuaishouAppAccountService.getById(id);
 		if(kuaishouAppAccount==null) {
 			result.error500("未找到对应实体");
@@ -217,8 +216,8 @@ public class KuaishouAppAccountController {
    * @param response
    * @return
    */
-  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+  @PostMapping("/importExcel")
+  public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
       MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
       Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
       for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {

+ 35 - 37
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAppProductController.java

@@ -1,39 +1,37 @@
 package org.jeecg.modules.ctop.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.kuaishou.modules.app.entity.KuaishouAppProduct;
 import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAppProductService;
-import java.util.Date;
+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.aspect.annotation.AutoLog;
+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 com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+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;
 
  /**
  * 快手推广产品
@@ -48,7 +46,7 @@ import io.swagger.annotations.ApiOperation;
 public class KuaishouAppProductController {
 	@Autowired
 	private IKuaishouAppProductService kuaishouAppProductService;
-	
+
 	/**
 	  * 分页列表查询
 	 * @param kuaishouAppProduct
@@ -64,15 +62,15 @@ public class KuaishouAppProductController {
 									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 									  HttpServletRequest req) {
-		Result<IPage<KuaishouAppProduct>> result = new Result<IPage<KuaishouAppProduct>>();
+		Result<IPage<KuaishouAppProduct>> result = new Result<>();
 		QueryWrapper<KuaishouAppProduct> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAppProduct, req.getParameterMap());
-		Page<KuaishouAppProduct> page = new Page<KuaishouAppProduct>(pageNo, pageSize);
+		Page<KuaishouAppProduct> page = new Page<>(pageNo, pageSize);
 		IPage<KuaishouAppProduct> pageList = kuaishouAppProductService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
-	
+
 	/**
 	  *   添加
 	 * @param kuaishouAppProduct
@@ -82,7 +80,7 @@ public class KuaishouAppProductController {
 	@ApiOperation(value="快手推广产品-添加", notes="快手推广产品-添加")
 	@PostMapping(value = "/add")
 	public Result<KuaishouAppProduct> add(@RequestBody KuaishouAppProduct kuaishouAppProduct) {
-		Result<KuaishouAppProduct> result = new Result<KuaishouAppProduct>();
+		Result<KuaishouAppProduct> result = new Result<>();
 		try {
 			kuaishouAppProductService.save(kuaishouAppProduct);
 			result.success("添加成功!");
@@ -92,7 +90,7 @@ public class KuaishouAppProductController {
 		}
 		return result;
 	}
-	
+
 	/**
 	  *  编辑
 	 * @param kuaishouAppProduct
@@ -102,7 +100,7 @@ public class KuaishouAppProductController {
 	@ApiOperation(value="快手推广产品-编辑", notes="快手推广产品-编辑")
 	@PutMapping(value = "/edit")
 	public Result<KuaishouAppProduct> edit(@RequestBody KuaishouAppProduct kuaishouAppProduct) {
-		Result<KuaishouAppProduct> result = new Result<KuaishouAppProduct>();
+		Result<KuaishouAppProduct> result = new Result<>();
 		KuaishouAppProduct kuaishouAppProductEntity = kuaishouAppProductService.getById(kuaishouAppProduct.getId());
 		if(kuaishouAppProductEntity==null) {
 			result.error500("未找到对应实体");
@@ -112,11 +110,11 @@ public class KuaishouAppProductController {
 				result.success("修改成功!");
 			}
 		}
-		
+
 		return result;
 	}
-	
-	/**
+
+	 /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -124,7 +122,7 @@ public class KuaishouAppProductController {
 	@AutoLog(value = "快手推广产品-通过id删除")
 	@ApiOperation(value="快手推广产品-通过id删除", notes="快手推广产品-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+	public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
 		try {
 			kuaishouAppProductService.removeById(id);
 		} catch (Exception e) {
@@ -133,8 +131,8 @@ public class KuaishouAppProductController {
 		}
 		return Result.ok("删除成功!");
 	}
-	
-	/**
+
+	 /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -143,7 +141,7 @@ public class KuaishouAppProductController {
 	@ApiOperation(value="快手推广产品-批量删除", notes="快手推广产品-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<KuaishouAppProduct> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<KuaishouAppProduct> result = new Result<KuaishouAppProduct>();
+		Result<KuaishouAppProduct> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -152,8 +150,8 @@ public class KuaishouAppProductController {
 		}
 		return result;
 	}
-	
-	/**
+
+	 /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -162,7 +160,7 @@ public class KuaishouAppProductController {
 	@ApiOperation(value="快手推广产品-通过id查询", notes="快手推广产品-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<KuaishouAppProduct> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<KuaishouAppProduct> result = new Result<KuaishouAppProduct>();
+		Result<KuaishouAppProduct> result = new Result<>();
 		KuaishouAppProduct kuaishouAppProduct = kuaishouAppProductService.getById(id);
 		if(kuaishouAppProduct==null) {
 			result.error500("未找到对应实体");
@@ -212,8 +210,8 @@ public class KuaishouAppProductController {
    * @param response
    * @return
    */
-  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+  @PostMapping("/importExcel")
+  public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
       MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
       Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
       for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {

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

@@ -1,7 +1,5 @@
 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;
@@ -11,30 +9,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 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.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;
 
 /**
  * 快手渠道注册信息表
@@ -67,9 +48,9 @@ public class KuaishouChannelRegInfoController {
                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                                HttpServletRequest req) {
-        Result<IPage<KuaishouChannelRegInfo>> result = new Result<IPage<KuaishouChannelRegInfo>>();
+        Result<IPage<KuaishouChannelRegInfo>> result = new Result<>();
         QueryWrapper<KuaishouChannelRegInfo> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouChannelRegInfo, req.getParameterMap());
-        Page<KuaishouChannelRegInfo> page = new Page<KuaishouChannelRegInfo>(pageNo, pageSize);
+        Page<KuaishouChannelRegInfo> page = new Page<>(pageNo, pageSize);
         IPage<KuaishouChannelRegInfo> pageList = kuaishouChannelRegInfoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -86,7 +67,7 @@ public class KuaishouChannelRegInfoController {
     @ApiOperation(value = "快手渠道注册信息表-添加", notes = "快手渠道注册信息表-添加")
     @PostMapping(value = "/add")
     public Result<KuaishouChannelRegInfo> add(@RequestBody KuaishouChannelRegInfo kuaishouChannelRegInfo) {
-        Result<KuaishouChannelRegInfo> result = new Result<KuaishouChannelRegInfo>();
+        Result<KuaishouChannelRegInfo> result = new Result<>();
         try {
             kuaishouChannelRegInfoService.save(kuaishouChannelRegInfo);
             result.success("添加成功!");
@@ -107,7 +88,7 @@ public class KuaishouChannelRegInfoController {
     @ApiOperation(value = "快手渠道注册信息表-编辑", notes = "快手渠道注册信息表-编辑")
     @PutMapping(value = "/edit")
     public Result<KuaishouChannelRegInfo> edit(@RequestBody KuaishouChannelRegInfo kuaishouChannelRegInfo) {
-        Result<KuaishouChannelRegInfo> result = new Result<KuaishouChannelRegInfo>();
+        Result<KuaishouChannelRegInfo> result = new Result<>();
         KuaishouChannelRegInfo kuaishouChannelRegInfoEntity = kuaishouChannelRegInfoService.getById(kuaishouChannelRegInfo.getId());
         if (kuaishouChannelRegInfoEntity == null) {
             result.error500("未找到对应实体");
@@ -130,7 +111,7 @@ public class KuaishouChannelRegInfoController {
     @AutoLog(value = "快手渠道注册信息表-通过id删除")
     @ApiOperation(value = "快手渠道注册信息表-通过id删除", notes = "快手渠道注册信息表-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             kuaishouChannelRegInfoService.removeById(id);
         } catch (Exception e) {
@@ -150,7 +131,7 @@ public class KuaishouChannelRegInfoController {
     @ApiOperation(value = "快手渠道注册信息表-批量删除", notes = "快手渠道注册信息表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<KuaishouChannelRegInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<KuaishouChannelRegInfo> result = new Result<KuaishouChannelRegInfo>();
+        Result<KuaishouChannelRegInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -170,7 +151,7 @@ public class KuaishouChannelRegInfoController {
     @ApiOperation(value = "快手渠道注册信息表-通过id查询", notes = "快手渠道注册信息表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<KuaishouChannelRegInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<KuaishouChannelRegInfo> result = new Result<KuaishouChannelRegInfo>();
+        Result<KuaishouChannelRegInfo> result = new Result<>();
         KuaishouChannelRegInfo kuaishouChannelRegInfo = kuaishouChannelRegInfoService.getById(id);
         if (kuaishouChannelRegInfo == null) {
             result.error500("未找到对应实体");
@@ -180,72 +161,4 @@ public class KuaishouChannelRegInfoController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<KuaishouChannelRegInfo> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                KuaishouChannelRegInfo kuaishouChannelRegInfo = JSON.parseObject(deString, KuaishouChannelRegInfo.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouChannelRegInfo, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<KuaishouChannelRegInfo> pageList = kuaishouChannelRegInfoService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "快手渠道注册信息表列表");
-        mv.addObject(NormalExcelConstants.CLASS, KuaishouChannelRegInfo.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 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("文件导入成功!");
-    }
-
 }

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

@@ -2,7 +2,6 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.MaterialAscription;
 import cn.com.ctop.common.module.service.IMaterialAscriptionService;
-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;
@@ -12,26 +11,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
 /**
  * 素材归属标
@@ -41,7 +25,7 @@ import java.util.Map;
  * @date 2019-11-23
  */
 @Slf4j
-@Api(tags = "素材归属")
+@Api(tags = "素材归属")
 @RestController
 @RequestMapping("/ctop/materialAscription")
 public class MaterialAscriptionController {
@@ -64,9 +48,9 @@ public class MaterialAscriptionController {
                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                            HttpServletRequest req) {
-        Result<IPage<MaterialAscription>> result = new Result<IPage<MaterialAscription>>();
+        Result<IPage<MaterialAscription>> result = new Result<>();
         QueryWrapper<MaterialAscription> queryWrapper = QueryGenerator.initQueryWrapper(materialAscription, req.getParameterMap());
-        Page<MaterialAscription> page = new Page<MaterialAscription>(pageNo, pageSize);
+        Page<MaterialAscription> page = new Page<>(pageNo, pageSize);
         IPage<MaterialAscription> pageList = materialAscriptionService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +67,7 @@ public class MaterialAscriptionController {
     @ApiOperation(value = "素材归属标-添加", notes = "素材归属标-添加")
     @PostMapping(value = "/add")
     public Result<MaterialAscription> add(@RequestBody MaterialAscription materialAscription) {
-        Result<MaterialAscription> result = new Result<MaterialAscription>();
+        Result<MaterialAscription> result = new Result<>();
         try {
             materialAscriptionService.save(materialAscription);
             result.success("添加成功!");
@@ -104,7 +88,7 @@ public class MaterialAscriptionController {
     @ApiOperation(value = "素材归属标-编辑", notes = "素材归属标-编辑")
     @PutMapping(value = "/edit")
     public Result<MaterialAscription> edit(@RequestBody MaterialAscription materialAscription) {
-        Result<MaterialAscription> result = new Result<MaterialAscription>();
+        Result<MaterialAscription> result = new Result<>();
         MaterialAscription materialAscriptionEntity = materialAscriptionService.getById(materialAscription.getId());
         if (materialAscriptionEntity == null) {
             result.error500("未找到对应实体");
@@ -140,7 +124,7 @@ public class MaterialAscriptionController {
     @AutoLog(value = "素材归属标-通过id删除")
     @ApiOperation(value = "素材归属标-通过id删除", notes = "素材归属标-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             materialAscriptionService.removeById(id);
         } catch (Exception e) {
@@ -160,7 +144,7 @@ public class MaterialAscriptionController {
     @ApiOperation(value = "素材归属标-批量删除", notes = "素材归属标-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<MaterialAscription> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<MaterialAscription> result = new Result<MaterialAscription>();
+        Result<MaterialAscription> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -180,7 +164,7 @@ public class MaterialAscriptionController {
     @ApiOperation(value = "素材归属标-通过id查询", notes = "素材归属标-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<MaterialAscription> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<MaterialAscription> result = new Result<MaterialAscription>();
+        Result<MaterialAscription> result = new Result<>();
         MaterialAscription materialAscription = materialAscriptionService.getById(id);
         if (materialAscription == null) {
             result.error500("未找到对应实体");
@@ -190,72 +174,4 @@ public class MaterialAscriptionController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<MaterialAscription> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                MaterialAscription materialAscription = JSON.parseObject(deString, MaterialAscription.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(materialAscription, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<MaterialAscription> pageList = materialAscriptionService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "素材归属标列表");
-        mv.addObject(NormalExcelConstants.CLASS, MaterialAscription.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<MaterialAscription> listMaterialAscriptions = ExcelImportUtil.importExcel(file.getInputStream(), MaterialAscription.class, params);
-                materialAscriptionService.saveBatch(listMaterialAscriptions);
-                return Result.ok("文件导入成功!数据行数:" + listMaterialAscriptions.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("文件导入失败!");
-    }
-
 }

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

@@ -2,7 +2,6 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.MaterialCutFrame;
 import cn.com.ctop.common.module.service.IMaterialCutFrameService;
-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;
@@ -12,26 +11,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
 
 /**
@@ -44,7 +28,7 @@ import java.util.Map;
 @Slf4j
 @Api(tags = "截屏")
 @RestController
-@RequestMapping("/123/materialCutFrame")
+@RequestMapping("/cutFrame/material")
 public class MaterialCutFrameController {
     @Autowired
     private IMaterialCutFrameService materialCutFrameService;
@@ -178,72 +162,4 @@ public class MaterialCutFrameController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<MaterialCutFrame> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                MaterialCutFrame materialCutFrame = JSON.parseObject(deString, MaterialCutFrame.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(materialCutFrame, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<MaterialCutFrame> pageList = materialCutFrameService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "截屏列表");
-        mv.addObject(NormalExcelConstants.CLASS, MaterialCutFrame.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<MaterialCutFrame> listMaterialCutFrames = ExcelImportUtil.importExcel(file.getInputStream(), MaterialCutFrame.class, params);
-                materialCutFrameService.saveBatch(listMaterialCutFrames);
-                return Result.ok("文件导入成功!数据行数:" + listMaterialCutFrames.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("文件导入失败!");
-    }
-
 }

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

@@ -388,5 +388,4 @@ public class MaterialImageInfoController {
         }
         return Result.ok("文件导入失败!");
     }
-
 }

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

@@ -7,7 +7,10 @@ import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
-import com.alibaba.fastjson.JSON;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -22,27 +25,13 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 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.entity.ByteDanceCleanMaterialReport;
-import org.jeecg.modules.ctop.entity.KuaiShouCleanMaterialReport;
-import org.jeecg.modules.ctop.entity.Project;
-import org.jeecg.modules.ctop.service.*;
-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.jeecg.modules.ctop.service.IKuaiShouUploadService;
+import org.jeecg.modules.ctop.service.IProjectMemberService;
+import org.jeecg.modules.ctop.service.IProjectService;
 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.text.ParseException;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -141,11 +130,10 @@ public class MaterialInfoController {
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                      HttpServletRequest req) {
         Result<IPage<MaterialInfo>> result = new Result<>();
-        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         Object createTime = materialInfo.getCreateTime();
         materialInfo.setCreateTime(null);
         materialInfo.setExcellent(1);
-        queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
+        QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
         if (!Check.isNull(createTime)) {
             try {
                 String dateString = DateUtils.getDateString(String.valueOf(createTime));
@@ -319,13 +307,9 @@ public class MaterialInfoController {
         } catch (Exception e) {
             result.setSuccess(false);
         }
-
-
         return result;
-
     }
 
-
     /**
      * 编辑
      *
@@ -395,7 +379,7 @@ public class MaterialInfoController {
     @AutoLog(value = "素材信息-通过id删除")
     @ApiOperation(value = "素材信息-通过id删除", notes = "素材信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             materialInfoService.removeById(id);
             Map<String, Object> deleteMap = new HashMap<>();
@@ -444,7 +428,7 @@ public class MaterialInfoController {
     @ApiOperation(value = "素材信息-通过id查询", notes = "素材信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<MaterialInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<MaterialInfo> result = new Result<MaterialInfo>();
+        Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfo = materialInfoService.getById(id);
         if (materialInfo == null) {
             result.error500("未找到对应实体");
@@ -454,118 +438,4 @@ public class MaterialInfoController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<MaterialInfo> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                MaterialInfo materialInfo = JSON.parseObject(deString, MaterialInfo.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<MaterialInfo> pageList = materialInfoService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "素材信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, MaterialInfo.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<MaterialInfo> listMaterialInfos = ExcelImportUtil.importExcel(file.getInputStream(), MaterialInfo.class, params);
-                materialInfoService.saveBatch(listMaterialInfos);
-                return Result.ok("文件导入成功!数据行数:" + listMaterialInfos.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("文件导入失败!");
-    }
-
-    @AutoLog(value = "获取有效素材")
-    @ApiOperation(value = "获取有效素材", notes = "获取有效素材")
-    @GetMapping(value = "/effiMaterialInfo")
-    public Result<IPage<MaterialInfo>> effiMaterialInfo(MaterialInfo materialInfo,
-                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                        HttpServletRequest req) {
-        Result<IPage<MaterialInfo>> result = new Result<>();
-        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
-
-        List<String> effiList = materialInfoService.getEffiCode();
-        Object createTime = materialInfo.getCreateTime();
-        materialInfo.setCreateTime(null);
-        queryWrapper.in("code", effiList);
-        queryWrapper.groupBy("code");
-        //queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
-
-        Page<MaterialInfo> page = new Page<>(pageNo, pageSize);
-        IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
-
-        List<MaterialInfo> materialInfoList = pageList.getRecords();
-        if (materialInfoList.size() != 0) {
-            for (MaterialInfo material : materialInfoList) {
-                //判断是否已经同步到快手平台
-                Integer kuaishouMaterialUpCount = materialInfoService.getKuaishouUpVideoCount(material.getCode());
-                if (kuaishouMaterialUpCount > 0) {
-                    material.setKuaishouVideoIsUp(1);
-                } else {
-                    material.setKuaishouVideoIsUp(0);
-                }
-                //判断是否已经同步到抖音平台
-                Integer toutiaoMaterialUpCount = materialInfoService.getToutiaoUpVideoCount(material.getCode());
-                if (toutiaoMaterialUpCount > 0) {
-                    material.setToutiaoVideoIsUp(1);
-                } else {
-                    material.setToutiaoVideoIsUp(0);
-                }
-            }
-        }
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-
 }

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

@@ -2,7 +2,6 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.MaterialParameter;
 import cn.com.ctop.common.module.service.IMaterialParameterService;
-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;
@@ -12,26 +11,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
 /**
  * 素材归属标
@@ -64,9 +48,9 @@ public class MaterialParameterController {
                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                           HttpServletRequest req) {
-        Result<IPage<MaterialParameter>> result = new Result<IPage<MaterialParameter>>();
+        Result<IPage<MaterialParameter>> result = new Result<>();
         QueryWrapper<MaterialParameter> queryWrapper = QueryGenerator.initQueryWrapper(materialParameter, req.getParameterMap());
-        Page<MaterialParameter> page = new Page<MaterialParameter>(pageNo, pageSize);
+        Page<MaterialParameter> page = new Page<>(pageNo, pageSize);
         IPage<MaterialParameter> pageList = materialParameterService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +67,7 @@ public class MaterialParameterController {
     @ApiOperation(value = "素材归属标-添加", notes = "素材归属标-添加")
     @PostMapping(value = "/add")
     public Result<MaterialParameter> add(@RequestBody MaterialParameter materialParameter) {
-        Result<MaterialParameter> result = new Result<MaterialParameter>();
+        Result<MaterialParameter> result = new Result<>();
         try {
             materialParameterService.save(materialParameter);
             result.success("添加成功!");
@@ -104,7 +88,7 @@ public class MaterialParameterController {
     @ApiOperation(value = "素材归属标-编辑", notes = "素材归属标-编辑")
     @PutMapping(value = "/edit")
     public Result<MaterialParameter> edit(@RequestBody MaterialParameter materialParameter) {
-        Result<MaterialParameter> result = new Result<MaterialParameter>();
+        Result<MaterialParameter> result = new Result<>();
         MaterialParameter materialParameterEntity = materialParameterService.getById(materialParameter.getId());
         if (materialParameterEntity == null) {
             result.error500("未找到对应实体");
@@ -127,7 +111,7 @@ public class MaterialParameterController {
     @AutoLog(value = "素材归属标-通过id删除")
     @ApiOperation(value = "素材归属标-通过id删除", notes = "素材归属标-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             materialParameterService.removeById(id);
         } catch (Exception e) {
@@ -147,7 +131,7 @@ public class MaterialParameterController {
     @ApiOperation(value = "素材归属标-批量删除", notes = "素材归属标-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<MaterialParameter> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<MaterialParameter> result = new Result<MaterialParameter>();
+        Result<MaterialParameter> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -167,7 +151,7 @@ public class MaterialParameterController {
     @ApiOperation(value = "素材归属标-通过id查询", notes = "素材归属标-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<MaterialParameter> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<MaterialParameter> result = new Result<MaterialParameter>();
+        Result<MaterialParameter> result = new Result<>();
         MaterialParameter materialParameter = materialParameterService.getById(id);
         if (materialParameter == null) {
             result.error500("未找到对应实体");
@@ -177,72 +161,4 @@ public class MaterialParameterController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<MaterialParameter> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                MaterialParameter materialParameter = JSON.parseObject(deString, MaterialParameter.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(materialParameter, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<MaterialParameter> pageList = materialParameterService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "素材归属标列表");
-        mv.addObject(NormalExcelConstants.CLASS, MaterialParameter.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<MaterialParameter> listMaterialParameters = ExcelImportUtil.importExcel(file.getInputStream(), MaterialParameter.class, params);
-                materialParameterService.saveBatch(listMaterialParameters);
-                return Result.ok("文件导入成功!数据行数:" + listMaterialParameters.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("文件导入失败!");
-    }
-
 }

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

@@ -44,11 +44,10 @@ public class MaterialPartController {
     @ApiOperation(value = "片段合成", notes = "片段合成")
     @PostMapping(value = "/merge")
     public Result<Object> merge(@RequestBody JSONArray jsonArray, HttpServletRequest req) {
-        Result<Object> result = new Result<Object>();
+        Result<Object> result = new Result<>();
         List<String> jobIdList = new ArrayList<>();
         List<VideoMerge> videoMergeList = jsonArray.toJavaList(VideoMerge.class);
         try {
-            MpsUtils mpsUtils = new MpsUtils();
             for (VideoMerge videoMerge:videoMergeList){
                 MaterialInfo start = materialInfoService.getMaterialInfoByCode(videoMerge.getStartPart());
                 MaterialInfo end = materialInfoService.getMaterialInfoByCode(videoMerge.getEndPart());
@@ -57,19 +56,18 @@ public class MaterialPartController {
                 for (String part :parts){
                     MaterialInfo materialInfo = materialInfoService.getMaterialInfoByCode(part);
                     String url = materialInfo.getUrl();
-                    int i = url.indexOf("/",10);
+                    int i = url.indexOf('/', 10);
                     partUrlList.add(url.substring(i+1,url.length()));
                 }
                 String startUrl = start.getUrl();
-                String startPath = startUrl.substring(startUrl.indexOf("/",10)+1,startUrl.length());
+                String startPath = startUrl.substring(startUrl.indexOf('/', 10) + 1, startUrl.length());
                 String endUrl = end.getUrl();
-                String endPath = endUrl.substring(endUrl.indexOf("/",10)+1,endUrl.length());
-                String jobId = mpsUtils.mergeOneVideo(startPath,partUrlList,endPath);
-                QueryJobListResponse.Job job = mpsUtils.getJobStatus(jobId);
+                String endPath = endUrl.substring(endUrl.indexOf('/', 10) + 1, endUrl.length());
+                String jobId = MpsUtils.mergeOneVideo(startPath,partUrlList,endPath);
+                QueryJobListResponse.Job job = MpsUtils.getJobStatus(jobId);
                 VideoMergeTask videoMergeTask = new VideoMergeTask();
                 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
                 videoMergeTask.setUserId(sysUser.getId());
-//                videoMergeTask.setUserId("1");
                 videoMergeTask.setJobId(jobId);
                 videoMergeTask.setStatus(job.getState());
                 videoMergeTaskService.save(videoMergeTask);

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

@@ -2,7 +2,6 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.MaterialTag;
 import cn.com.ctop.common.module.service.IMaterialTagService;
-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;
@@ -12,26 +11,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
 /**
  * 素材归属标
@@ -64,9 +48,9 @@ public class MaterialTagController {
                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                     HttpServletRequest req) {
-        Result<IPage<MaterialTag>> result = new Result<IPage<MaterialTag>>();
+        Result<IPage<MaterialTag>> result = new Result<>();
         QueryWrapper<MaterialTag> queryWrapper = QueryGenerator.initQueryWrapper(materialTag, req.getParameterMap());
-        Page<MaterialTag> page = new Page<MaterialTag>(pageNo, pageSize);
+        Page<MaterialTag> page = new Page<>(pageNo, pageSize);
         IPage<MaterialTag> pageList = materialTagService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +67,7 @@ public class MaterialTagController {
     @ApiOperation(value = "素材归属标-添加", notes = "素材归属标-添加")
     @PostMapping(value = "/add")
     public Result<MaterialTag> add(@RequestBody MaterialTag materialTag) {
-        Result<MaterialTag> result = new Result<MaterialTag>();
+        Result<MaterialTag> result = new Result<>();
         try {
             materialTagService.save(materialTag);
             result.success("添加成功!");
@@ -104,7 +88,7 @@ public class MaterialTagController {
     @ApiOperation(value = "素材归属标-编辑", notes = "素材归属标-编辑")
     @PutMapping(value = "/edit")
     public Result<MaterialTag> edit(@RequestBody MaterialTag materialTag) {
-        Result<MaterialTag> result = new Result<MaterialTag>();
+        Result<MaterialTag> result = new Result<>();
         MaterialTag materialTagEntity = materialTagService.getById(materialTag.getId());
         if (materialTagEntity == null) {
             result.error500("未找到对应实体");
@@ -127,7 +111,7 @@ public class MaterialTagController {
     @AutoLog(value = "素材归属标-通过id删除")
     @ApiOperation(value = "素材归属标-通过id删除", notes = "素材归属标-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             materialTagService.removeById(id);
         } catch (Exception e) {
@@ -147,7 +131,7 @@ public class MaterialTagController {
     @ApiOperation(value = "素材归属标-批量删除", notes = "素材归属标-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<MaterialTag> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<MaterialTag> result = new Result<MaterialTag>();
+        Result<MaterialTag> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -167,7 +151,7 @@ public class MaterialTagController {
     @ApiOperation(value = "素材归属标-通过id查询", notes = "素材归属标-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<MaterialTag> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<MaterialTag> result = new Result<MaterialTag>();
+        Result<MaterialTag> result = new Result<>();
         MaterialTag materialTag = materialTagService.getById(id);
         if (materialTag == null) {
             result.error500("未找到对应实体");
@@ -177,72 +161,4 @@ public class MaterialTagController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<MaterialTag> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                MaterialTag materialTag = JSON.parseObject(deString, MaterialTag.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(materialTag, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<MaterialTag> pageList = materialTagService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "素材归属标列表");
-        mv.addObject(NormalExcelConstants.CLASS, MaterialTag.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<MaterialTag> listMaterialTags = ExcelImportUtil.importExcel(file.getInputStream(), MaterialTag.class, params);
-                materialTagService.saveBatch(listMaterialTags);
-                return Result.ok("文件导入成功!数据行数:" + listMaterialTags.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("文件导入失败!");
-    }
-
 }

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

@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -45,18 +44,8 @@ public class MaterialUploadController {
             if (Check.isNull(materialArray) || Check.isNull(accountArray)) {
                 throw new Exception("请选择账号或素材");
             }
-            Thread thread = new Thread() {
-                @Override
-                public void run() {
-                    try {
-                        materialUploadService.uploadAccount(mediaId, materialArray, accountArray);
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-            };
-            thread.start();
 
+            new Thread(() -> materialUploadService.uploadAccount(mediaId, materialArray, accountArray)).start();
             returnMap.put("success", true);
             returnMap.put("message", "开始上传文件");
             returnMap.put("code", 0);

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

@@ -0,0 +1,52 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportAppHourService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportBillMonthService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportChannelDailyService;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.vo.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.Map;
+
+@RequestMapping("pangolin")
+public class PangolinController {
+    @Autowired
+    private PangolinReportAppHourService pangolinReportAppHourService;
+    @Autowired
+    private PangolinReportChannelDailyService pangolinReportChannelDailyService;
+    @Autowired
+    private PangolinReportBillMonthService pangolinReportBillMonthService;
+
+    /**
+     * 实时数据
+     */
+    @PostMapping("api/realtime")
+    public Map<String, Object> realTime() {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return pangolinReportAppHourService.getRealTimeData(user.getId());
+    }
+
+    /**
+     * 激活统计
+     */
+    @PostMapping("api/activation/list")
+    public Map<String, Object> activationList(@RequestBody JSONObject data) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return pangolinReportChannelDailyService.getActivationList(user.getId(), data);
+    }
+
+    /**
+     * 对账单
+     */
+    @PostMapping("/api/checkApps/list")
+    public Map<String, Object> checkAppList(@RequestBody JSONObject data) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return pangolinReportBillMonthService.checkAppList(user.getId(), data);
+    }
+
+}

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

@@ -1,11 +1,9 @@
 package org.jeecg.modules.ctop.controller;
 
-
-import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.ISysRoleService;
 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;
@@ -17,7 +15,6 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.entity.Project;
 import org.jeecg.modules.ctop.entity.ProjectMember;
@@ -30,22 +27,10 @@ import org.jeecg.modules.ctop.service.IProjectService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysUserService;
-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.*;
 
 /**
@@ -71,14 +56,11 @@ public class ProjectController {
     @Autowired
     private ProjectMapper projectMapper;
     @Autowired
-    private MaterialReportMapper materialReportMapper;
-    @Autowired
     private ITransferAccountService transferAccountService;
     @Autowired
     private IUserAllocationService userAllocationService;
 
     /**
-     * 根据 项目 媒体类型 查看项目
      *
      * @param advertiserId
      * @param mediaId
@@ -98,7 +80,6 @@ public class ProjectController {
         } catch (Exception e) {
             e.printStackTrace();
             result.setSuccess(false);
-
         }
         return result;
     }
@@ -115,7 +96,7 @@ public class ProjectController {
     @GetMapping(value = "/responsibleList")
     public Map<String, Object> responsibleList(String userId) {
         Map<String, Object> map = new HashMap<>();
-        String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
         QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
         List<Project> projects = new ArrayList<>();
         if (!"admin".equals(roleCode) && !"sale".equals(roleCode) && !"saleDirector".equals(roleCode)) {
@@ -187,18 +168,12 @@ public class ProjectController {
                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                 HttpServletRequest req) {
-        Result<IPage<Project>> result = new Result<IPage<Project>>();
+        Result<IPage<Project>> result = new Result<>();
         QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
-        Page<Project> page = new Page<Project>(pageNo, pageSize);
-
+        Page<Project> page = new Page<>(pageNo, pageSize);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if (Check.isNull(sysUser)) {
-            result.setSuccess(false);
-            return result;
-        }
-
-        String roleCode = materialReportMapper.getRoleCodeByUserId(sysUser.getId());
-        if (!"admin".equals(roleCode) && "sale".equals(roleCode) && "saleDirector".equals(roleCode)) {
+        String roleCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        if (!("admin".equals(roleCode) || "sale".equals(roleCode) || "saleDirector".equals(roleCode))) {
             queryWrapper.eq("user_id", sysUser.getId());
             queryWrapper.orderByDesc("create_time");
         }
@@ -221,7 +196,7 @@ public class ProjectController {
     @ApiOperation(value = "项目-添加", notes = "项目-添加")
     @PostMapping(value = "/add")
     public Result<Project> add(@RequestBody Project project) {
-        Result<Project> result = new Result<Project>();
+        Result<Project> result = new Result<>();
         try {
             String advertiserId = project.getAdvertiserId();
             Advertiser advertiser = advertiserService.getById(advertiserId);
@@ -246,7 +221,6 @@ public class ProjectController {
 
             Long id = project.getId();
             for (Map.Entry<String, String> projectMember : memberMap.entrySet()) {
-
                 String userId = projectMember.getKey();
                 String userName = projectMember.getValue();
                 Map<String, Object> map = new HashMap<>();
@@ -258,14 +232,12 @@ public class ProjectController {
                 member.setProjectName(project.getProjectName());
                 member.setUserId(userId);
                 member.setUserName(userName);
-                String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
+                String roleCode = sysRoleService.getRoleCodeByUserId(userId);
                 if (!Check.isNull(roleCode)) {
                     member.setRoleCode(roleCode);
                 }
                 projectMemberService.save(member);
             }
-
-
             result.success("添加成功!");
         } catch (Exception e) {
             e.printStackTrace();
@@ -274,6 +246,9 @@ public class ProjectController {
         return result;
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+
     /**
      * 编辑
      *
@@ -284,8 +259,7 @@ public class ProjectController {
     @ApiOperation(value = "项目-编辑", notes = "项目-编辑")
     @PutMapping(value = "/edit")
     public Result<Project> edit(@RequestBody Project project) {
-        Result<Project> result = new Result<Project>();
-
+        Result<Project> result = new Result<>();
         SysUser sysUser = sysUserService.getById(project.getResponsibleId());
         if (!Check.isNull(sysUser)) {
             project.setResponsibleName(sysUser.getRealname());
@@ -333,7 +307,7 @@ public class ProjectController {
     @AutoLog(value = "项目-通过id删除")
     @ApiOperation(value = "项目-通过id删除", notes = "项目-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             projectService.removeById(id);
             Map<String, Object> deleteMap = new HashMap<>();
@@ -357,7 +331,7 @@ public class ProjectController {
     @ApiOperation(value = "项目-批量删除", notes = "项目-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<Project> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<Project> result = new Result<Project>();
+        Result<Project> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -377,7 +351,7 @@ public class ProjectController {
     @ApiOperation(value = "项目-通过id查询", notes = "项目-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<Project> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<Project> result = new Result<Project>();
+        Result<Project> result = new Result<>();
         Project project = projectService.getById(id);
         if (project == null) {
             result.error500("未找到对应实体");
@@ -387,72 +361,4 @@ public class ProjectController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<Project> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                Project project = JSON.parseObject(deString, Project.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(project, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<Project> pageList = projectService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "项目列表");
-        mv.addObject(NormalExcelConstants.CLASS, Project.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<Project> listProjects = ExcelImportUtil.importExcel(file.getInputStream(), Project.class, params);
-                projectService.saveBatch(listProjects);
-                return Result.ok("文件导入成功!数据行数:" + listProjects.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("文件导入失败!");
-    }
-
 }

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

@@ -1,8 +1,7 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
+import cn.com.ctop.common.module.service.ISysRoleService;
 import cn.com.ctop.common.module.utils.Check;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -14,7 +13,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.Project;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
@@ -22,22 +20,10 @@ import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.IProjectService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysUserService;
-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.*;
 
 /**
@@ -59,7 +45,7 @@ public class ProjectMemberController {
     @Autowired
     private IProjectService projectService;
     @Autowired
-    private MaterialReportMapper materialReportMapper;
+    private ISysRoleService sysRoleService;
     @Autowired
     private ISysUserService sysUserService;
 
@@ -105,7 +91,7 @@ public class ProjectMemberController {
         Map<String, Object> map = new HashMap<>();
         try {
             QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();
-            String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             if (!"admin".equals(roleCode) && !"sale".equals(roleCode) && !"saleDirector".equals(roleCode)) {
                 queryWrapper.eq("user_id", userId);
             }
@@ -120,10 +106,6 @@ public class ProjectMemberController {
                     }
                     Project project = projectService.getById(projectMember.getProjectId());
                     if (!Check.isNull(project)) {
-                        String mediaId = project.getMediaId();
-                        /*if ("1".equals(mediaId)) {
-                            continue;
-                        }*/
                         projectMember.setResponsibleName(project.getResponsibleName());
                         projectMember.setDesignResponsibleName(project.getDesignResponsibleName());
                         projectMember.setAdvertiserName(project.getAdvertiserName());
@@ -164,9 +146,9 @@ public class ProjectMemberController {
                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                       HttpServletRequest req) {
-        Result<IPage<ProjectMember>> result = new Result<IPage<ProjectMember>>();
+        Result<IPage<ProjectMember>> result = new Result<>();
         QueryWrapper<ProjectMember> queryWrapper = QueryGenerator.initQueryWrapper(projectMember, req.getParameterMap());
-        Page<ProjectMember> page = new Page<ProjectMember>(pageNo, pageSize);
+        Page<ProjectMember> page = new Page<>(pageNo, pageSize);
         IPage<ProjectMember> pageList = projectMemberService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -186,7 +168,7 @@ public class ProjectMemberController {
     @ApiOperation(value = "项目成员-添加", notes = "项目成员-添加")
     @PostMapping(value = "/batchAdd")
     public Result<ProjectMember> batchAdd(@RequestBody JSONObject jsonObject) {
-        Result<ProjectMember> result = new Result<ProjectMember>();
+        Result<ProjectMember> result = new Result<>();
         try {
             if (Check.isNull(jsonObject)) {
                 throw new Exception("入参不能为空");
@@ -208,7 +190,7 @@ public class ProjectMemberController {
                         continue;
                     }
                     ProjectMember member = new ProjectMember();
-                    String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
+                    String roleCode = sysRoleService.getRoleCodeByUserId(userId);
                     if (!Check.isNull(roleCode)) {
                         member.setRoleCode(roleCode);
                     }
@@ -242,7 +224,7 @@ public class ProjectMemberController {
     @ApiOperation(value = "项目成员-添加", notes = "项目成员-添加")
     @PostMapping(value = "/add")
     public Result<ProjectMember> add(@RequestBody ProjectMember projectMember) {
-        Result<ProjectMember> result = new Result<ProjectMember>();
+        Result<ProjectMember> result = new Result<>();
         try {
             projectMemberService.save(projectMember);
             result.success("添加成功!");
@@ -263,7 +245,7 @@ public class ProjectMemberController {
     @ApiOperation(value = "项目成员-编辑", notes = "项目成员-编辑")
     @PutMapping(value = "/edit")
     public Result<ProjectMember> edit(@RequestBody ProjectMember projectMember) {
-        Result<ProjectMember> result = new Result<ProjectMember>();
+        Result<ProjectMember> result = new Result<>();
         ProjectMember projectMemberEntity = projectMemberService.getById(projectMember.getId());
         if (projectMemberEntity == null) {
             result.error500("未找到对应实体");
@@ -286,7 +268,7 @@ public class ProjectMemberController {
     @AutoLog(value = "项目成员-通过id删除")
     @ApiOperation(value = "项目成员-通过id删除", notes = "项目成员-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             projectMemberService.removeById(id);
         } catch (Exception e) {
@@ -306,7 +288,7 @@ public class ProjectMemberController {
     @ApiOperation(value = "项目成员-批量删除", notes = "项目成员-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<ProjectMember> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<ProjectMember> result = new Result<ProjectMember>();
+        Result<ProjectMember> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -326,7 +308,7 @@ public class ProjectMemberController {
     @ApiOperation(value = "项目成员-通过id查询", notes = "项目成员-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<ProjectMember> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<ProjectMember> result = new Result<ProjectMember>();
+        Result<ProjectMember> result = new Result<>();
         ProjectMember projectMember = projectMemberService.getById(id);
         if (projectMember == null) {
             result.error500("未找到对应实体");
@@ -336,72 +318,4 @@ public class ProjectMemberController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<ProjectMember> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                ProjectMember projectMember = JSON.parseObject(deString, ProjectMember.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(projectMember, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<ProjectMember> pageList = projectMemberService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "项目成员列表");
-        mv.addObject(NormalExcelConstants.CLASS, ProjectMember.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<ProjectMember> listProjectMembers = ExcelImportUtil.importExcel(file.getInputStream(), ProjectMember.class, params);
-                projectMemberService.saveBatch(listProjectMembers);
-                return Result.ok("文件导入成功!数据行数:" + listProjectMembers.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("文件导入失败!");
-    }
-
 }

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

@@ -64,9 +64,9 @@ public class SalePerformanceDetailController {
                                                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                               HttpServletRequest req) {
-        Result<IPage<SalePerformanceDetail>> result = new Result<IPage<SalePerformanceDetail>>();
+        Result<IPage<SalePerformanceDetail>> result = new Result<>();
         QueryWrapper<SalePerformanceDetail> queryWrapper = QueryGenerator.initQueryWrapper(salePerformanceDetail, req.getParameterMap());
-        Page<SalePerformanceDetail> page = new Page<SalePerformanceDetail>(pageNo, pageSize);
+        Page<SalePerformanceDetail> page = new Page<>(pageNo, pageSize);
         IPage<SalePerformanceDetail> pageList = salePerformanceDetailService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +83,7 @@ public class SalePerformanceDetailController {
     @ApiOperation(value = "销售绩效详细信息-添加", notes = "销售绩效详细信息-添加")
     @PostMapping(value = "/add")
     public Result<SalePerformanceDetail> add(@RequestBody SalePerformanceDetail salePerformanceDetail) {
-        Result<SalePerformanceDetail> result = new Result<SalePerformanceDetail>();
+        Result<SalePerformanceDetail> result = new Result<>();
         try {
             salePerformanceDetailService.save(salePerformanceDetail);
             result.success("添加成功!");
@@ -104,7 +104,7 @@ public class SalePerformanceDetailController {
     @ApiOperation(value = "销售绩效详细信息-编辑", notes = "销售绩效详细信息-编辑")
     @PutMapping(value = "/edit")
     public Result<SalePerformanceDetail> edit(@RequestBody SalePerformanceDetail salePerformanceDetail) {
-        Result<SalePerformanceDetail> result = new Result<SalePerformanceDetail>();
+        Result<SalePerformanceDetail> result = new Result<>();
         SalePerformanceDetail salePerformanceDetailEntity = salePerformanceDetailService.getById(salePerformanceDetail.getId());
         if (salePerformanceDetailEntity == null) {
             result.error500("未找到对应实体");
@@ -127,7 +127,7 @@ public class SalePerformanceDetailController {
     @AutoLog(value = "销售绩效详细信息-通过id删除")
     @ApiOperation(value = "销售绩效详细信息-通过id删除", notes = "销售绩效详细信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             salePerformanceDetailService.removeById(id);
         } catch (Exception e) {
@@ -147,7 +147,7 @@ public class SalePerformanceDetailController {
     @ApiOperation(value = "销售绩效详细信息-批量删除", notes = "销售绩效详细信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<SalePerformanceDetail> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<SalePerformanceDetail> result = new Result<SalePerformanceDetail>();
+        Result<SalePerformanceDetail> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -167,7 +167,7 @@ public class SalePerformanceDetailController {
     @ApiOperation(value = "销售绩效详细信息-通过id查询", notes = "销售绩效详细信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<SalePerformanceDetail> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<SalePerformanceDetail> result = new Result<SalePerformanceDetail>();
+        Result<SalePerformanceDetail> result = new Result<>();
         SalePerformanceDetail salePerformanceDetail = salePerformanceDetailService.getById(id);
         if (salePerformanceDetail == null) {
             result.error500("未找到对应实体");
@@ -186,7 +186,6 @@ public class SalePerformanceDetailController {
      */
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
         QueryWrapper<SalePerformanceDetail> queryWrapper = null;
         try {
             String paramsStr = request.getParameter("paramsStr");
@@ -217,8 +216,8 @@ public class SalePerformanceDetailController {
      * @param response
      * @return
      */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+    @PostMapping("/importExcel")
+    public Result<Object> importExcel(HttpServletRequest request, HttpServletResponse response) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
         for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-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;
@@ -10,28 +9,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.ScriptTagInfo;
 import org.jeecg.modules.ctop.service.IScriptTagInfoService;
-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;
 
 /**
  * 脚本库标签信息
@@ -64,9 +48,9 @@ public class ScriptTagInfoController {
                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                       HttpServletRequest req) {
-        Result<IPage<ScriptTagInfo>> result = new Result<IPage<ScriptTagInfo>>();
+        Result<IPage<ScriptTagInfo>> result = new Result<>();
         QueryWrapper<ScriptTagInfo> queryWrapper = QueryGenerator.initQueryWrapper(scriptTagInfo, req.getParameterMap());
-        Page<ScriptTagInfo> page = new Page<ScriptTagInfo>(pageNo, pageSize);
+        Page<ScriptTagInfo> page = new Page<>(pageNo, pageSize);
         IPage<ScriptTagInfo> pageList = scriptTagInfoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +67,7 @@ public class ScriptTagInfoController {
     @ApiOperation(value = "脚本库标签信息-添加", notes = "脚本库标签信息-添加")
     @PostMapping(value = "/add")
     public Result<ScriptTagInfo> add(@RequestBody ScriptTagInfo scriptTagInfo) {
-        Result<ScriptTagInfo> result = new Result<ScriptTagInfo>();
+        Result<ScriptTagInfo> result = new Result<>();
         try {
             scriptTagInfoService.save(scriptTagInfo);
             result.success("添加成功!");
@@ -104,7 +88,7 @@ public class ScriptTagInfoController {
     @ApiOperation(value = "脚本库标签信息-编辑", notes = "脚本库标签信息-编辑")
     @PutMapping(value = "/edit")
     public Result<ScriptTagInfo> edit(@RequestBody ScriptTagInfo scriptTagInfo) {
-        Result<ScriptTagInfo> result = new Result<ScriptTagInfo>();
+        Result<ScriptTagInfo> result = new Result<>();
         ScriptTagInfo scriptTagInfoEntity = scriptTagInfoService.getById(scriptTagInfo.getId());
         if (scriptTagInfoEntity == null) {
             result.error500("未找到对应实体");
@@ -127,7 +111,7 @@ public class ScriptTagInfoController {
     @AutoLog(value = "脚本库标签信息-通过id删除")
     @ApiOperation(value = "脚本库标签信息-通过id删除", notes = "脚本库标签信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             scriptTagInfoService.removeById(id);
         } catch (Exception e) {
@@ -147,7 +131,7 @@ public class ScriptTagInfoController {
     @ApiOperation(value = "脚本库标签信息-批量删除", notes = "脚本库标签信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<ScriptTagInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<ScriptTagInfo> result = new Result<ScriptTagInfo>();
+        Result<ScriptTagInfo> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -167,7 +151,7 @@ public class ScriptTagInfoController {
     @ApiOperation(value = "脚本库标签信息-通过id查询", notes = "脚本库标签信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<ScriptTagInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<ScriptTagInfo> result = new Result<ScriptTagInfo>();
+        Result<ScriptTagInfo> result = new Result<>();
         ScriptTagInfo scriptTagInfo = scriptTagInfoService.getById(id);
         if (scriptTagInfo == null) {
             result.error500("未找到对应实体");
@@ -177,72 +161,4 @@ public class ScriptTagInfoController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<ScriptTagInfo> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                ScriptTagInfo scriptTagInfo = JSON.parseObject(deString, ScriptTagInfo.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(scriptTagInfo, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<ScriptTagInfo> pageList = scriptTagInfoService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "脚本库标签信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, ScriptTagInfo.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<ScriptTagInfo> listScriptTagInfos = ExcelImportUtil.importExcel(file.getInputStream(), ScriptTagInfo.class, params);
-                scriptTagInfoService.saveBatch(listScriptTagInfos);
-                return Result.ok("文件导入成功!数据行数:" + listScriptTagInfos.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("文件导入失败!");
-    }
-
 }

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

@@ -1,249 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.entity.SourceFile;
-import cn.com.ctop.common.module.service.ISourceFileService;
-import cn.com.ctop.common.module.utils.StringUtils;
-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.aspect.annotation.AutoLog;
-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 2019-09-02
- * @version V1.0
- */
-@Slf4j
-@Api(tags = "统一资源库文件信息")
-@RestController
-@RequestMapping("/ctop/sourceFile")
-public class SourceFileController {
-    @Autowired
-    private ISourceFileService sourceFileService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param sourceFile
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "统一资源库文件信息-分页列表查询")
-    @ApiOperation(value = "统一资源库文件信息-分页列表查询", notes = "统一资源库文件信息-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<SourceFile>> queryPageList(SourceFile sourceFile,
-                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                   HttpServletRequest req) {
-        Result<IPage<SourceFile>> result = new Result<IPage<SourceFile>>();
-        QueryWrapper<SourceFile> queryWrapper = QueryGenerator.initQueryWrapper(sourceFile, req.getParameterMap());
-        Page<SourceFile> page = new Page<SourceFile>(pageNo, pageSize);
-        IPage<SourceFile> pageList = sourceFileService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param sourceFile
-     * @return
-     */
-    @AutoLog(value = "统一资源库文件信息-添加")
-    @ApiOperation(value = "统一资源库文件信息-添加", notes = "统一资源库文件信息-添加")
-    @PostMapping(value = "/add")
-    public Result<SourceFile> add(@RequestBody SourceFile sourceFile) {
-        Result<SourceFile> result = new Result<SourceFile>();
-        try {
-            sourceFileService.save(sourceFile);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param sourceFile
-     * @return
-     */
-    @AutoLog(value = "统一资源库文件信息-编辑")
-    @ApiOperation(value = "统一资源库文件信息-编辑", notes = "统一资源库文件信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<SourceFile> edit(@RequestBody SourceFile sourceFile) {
-        Result<SourceFile> result = new Result<SourceFile>();
-        SourceFile sourceFileEntity = sourceFileService.getById(sourceFile.getId());
-        if (sourceFileEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = sourceFileService.updateById(sourceFile);
-            //TODO 返回false说明什么?
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "统一资源库文件信息-通过id删除")
-    @ApiOperation(value = "统一资源库文件信息-通过id删除", notes = "统一资源库文件信息-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            sourceFileService.removeById(id);
-        } 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<SourceFile> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<SourceFile> result = new Result<SourceFile>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.sourceFileService.removeByIds(Arrays.asList(ids.split(StringUtils.COMMA)));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "统一资源库文件信息-通过id查询")
-    @ApiOperation(value = "统一资源库文件信息-通过id查询", notes = "统一资源库文件信息-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<SourceFile> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<SourceFile> result = new Result<SourceFile>();
-        SourceFile sourceFile = sourceFileService.getById(id);
-        if (sourceFile == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(sourceFile);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<SourceFile> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                SourceFile sourceFile = JSON.parseObject(deString, SourceFile.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(sourceFile, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<SourceFile> pageList = sourceFileService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "统一资源库文件信息列表");
-        mv.addObject(NormalExcelConstants.CLASS, SourceFile.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<SourceFile> listSourceFiles = ExcelImportUtil.importExcel(file.getInputStream(), SourceFile.class, params);
-                sourceFileService.saveBatch(listSourceFiles);
-                return Result.ok("文件导入成功!数据行数:" + listSourceFiles.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("文件导入失败!");
-    }
-
-}

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

@@ -1,9 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
-import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.service.*;
@@ -16,22 +12,22 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskServic
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import com.alibaba.fastjson.JSONObject;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
+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.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.job.KuaishouDailyAccountReportLoadJob;
-import org.jeecg.modules.ctop.service.ICleanMaterialService;
-import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -45,8 +41,6 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 @Slf4j
 public class TestController {
     @Autowired
-    private ICreateInternalService createInternalService;
-    @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 
     @Autowired
@@ -64,14 +58,9 @@ public class TestController {
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
 
-    @PostMapping(value = "/create")
-    public Map<String, Object> authorization(@RequestBody JSONObject jsonObject) {
-        return createInternalService.createInternal(jsonObject);
-    }
-
     @GetMapping(value = "/t")
     public String test() {
-        Result<String> result = new Result<String>();
+        Result<String> result = new Result<>();
         try {
             String requestId = UUID.randomUUID().toString();
             String img = kuaishouWebInterfaceService.qrLogin(requestId);
@@ -108,38 +97,28 @@ public class TestController {
 
     @GetMapping(value = "/updateCode")
     public String updateCode() {
-
         List<MaterialInfo> list = materialInfoService.list();
         for (MaterialInfo info : list) {
-
-
             QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
             imageInfoQueryWrapper.eq("video_id", String.valueOf(info.getId()));
             MaterialImageInfo updateMaterialImageInfo = new MaterialImageInfo();
             updateMaterialImageInfo.setVideoId(info.getCode());
             iMaterialImageInfoService.update(updateMaterialImageInfo, imageInfoQueryWrapper);
-
-
             QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
             tagQueryWrapper.eq("material_id", String.valueOf(info.getId()));
             MaterialTag updateTag = new MaterialTag();
             updateTag.setMaterialId(info.getCode());
             tagService.update(updateTag, tagQueryWrapper);
-
             QueryWrapper<MaterialAscription> materialAscriptionQuery = new QueryWrapper<>();
             materialAscriptionQuery.eq("material_id", String.valueOf(info.getId()));
             MaterialAscription updateMaterialAscription = new MaterialAscription();
             updateMaterialAscription.setMaterialId(info.getCode());
             ascriptionService.update(updateMaterialAscription, materialAscriptionQuery);
-
-
             QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
             parameterQueryWrapper.eq("material_id", String.valueOf(info.getId()));
             MaterialParameter updateMaterialParameter = new MaterialParameter();
             updateMaterialParameter.setMaterialId(info.getCode());
             parameterService.update(updateMaterialParameter, parameterQueryWrapper);
-
-
         }
         List<MaterialImageInfo> list1 = iMaterialImageInfoService.list();
         for (MaterialImageInfo imageInfo : list1) {
@@ -170,11 +149,8 @@ public class TestController {
 
                 }
             }
-
         }
-
         return "SUCCESS";
-
     }
 
 
@@ -201,7 +177,7 @@ public class TestController {
 
     @GetMapping(value = "/getHistoryData")
     public String getHistoryData() {
-        Result<String> result = new Result<String>();
+        Result<String> result = new Result<>();
         try {
             String endDateStr = DateUtils.getDate("yyyy-MM-dd");
             String startDate = DateUtils.addMonth(endDateStr, -6);
@@ -224,14 +200,11 @@ public class TestController {
 
     @GetMapping(value = "/getTaskList")
     public String getTaskList() {
-        Result<String> result = new Result<String>();
+        Result<String> result = new Result<>();
         try {
-            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-            String startDate = DateUtils.addMonth(endDateStr, -6);
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             historyReportTaskService.getTaskList();
-
         } catch (Exception e) {
             e.printStackTrace();
             result.setSuccess(false);
@@ -249,7 +222,6 @@ public class TestController {
         List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
         for (CtopOauthToken token : ctopOauthTokens) {
 
-
             for (int i = 0; i < 7; i++) {
                 Date getStartDate = DateUtils.addDay(endDate, -i);
                 //3:获取广告组信息数据
@@ -349,13 +321,6 @@ public class TestController {
     @Autowired
     private IUserAllocationService userAllocationService;
 
-
-    public static void main(String[] args) throws ParseException {
-        String date = DateUtils.getDate("yyyy-MM-dd");
-        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
-    }
-
-
     @GetMapping(value = "/getPlanAndGroupByAccount")
     public void getPlanAndGroupByAccount(Long accountId) {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
@@ -370,8 +335,6 @@ public class TestController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-
-
     }
 
 
@@ -398,74 +361,6 @@ public class TestController {
     @Autowired
     private ICtopOauthTokenService tokenService;
 
-    @GetMapping("loadBytedanceData")
-    public Map<String, Object> formatZybData(String date) {
-        Map<String, Object> result = new HashMap<>();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date getDate = null;
-        try {
-            getDate = simpleDateFormat.parse(date);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-        //1:查询当日数据
-        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("project_id", 215);
-        List<UserAllocation> allocations = userAllocationService.list(queryWrapper);
-        if (null == allocations || allocations.size() <= 0) {
-            log.info("定时获取头条数据异常:获取用户信息失败");
-        }
-        Date finalGetDate = getDate;
-
-        allocations.forEach(allocation -> {
-            //3:获取广告计划信息数据
-            CtopOauthToken token = oauthTokenMapper.selectByAccountId(allocation.getAccountId());
-            reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        });
-
-        //清洗关于作业帮数据
-        //1:查询作业帮相关的用户数据
-        allocations.forEach(allocation -> {
-            //根据accountId和时间,查询相关的日报表信息
-            QueryWrapper<BytedancePlanDailyReport> reportQueryWrapper = new QueryWrapper<>();
-            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            String dateString = dateFormat.format(finalGetDate) + " 00:00:00";
-            queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                    .eq("stat_datetime", dateString)
-            ;
-            List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(reportQueryWrapper);
-            if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                bytedancePlanDailyReports.forEach(report -> {
-                    String adName = report.getAdName();
-                    String[] tags = adName.split("-");
-                    report.setAdsense(tags[1]);
-                    report.setPlanCode(tags[2]);
-                    String materialName = tags[3];
-                    report.setMaterialName(materialName);
-                    if (materialName.contains("其他")) {
-                        report.setMaterialType("其他");
-                    } else if (materialName.contains("图片轮播")) {
-                        report.setMaterialType("图片轮播");
-                    } else if (materialName.contains("大字报")) {
-                        report.setMaterialType("大字报");
-                    } else if (materialName.contains("文字动画")) {
-                        report.setMaterialType("文字动画");
-                    } else if (materialName.contains("采访形式")) {
-                        report.setMaterialType("采访形式");
-                    } else if (materialName.contains("剧情")) {
-                        report.setMaterialType("剧情");
-                    } else if (materialName.contains("口播")) {
-                        report.setMaterialType("口播");
-                    } else {
-                        report.setMaterialType("其他");
-                    }
-                    planDailyReportService.updateById(report);
-                });
-            }
-        });
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
 
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
@@ -475,292 +370,28 @@ public class TestController {
         Map<String, Object> result = new HashMap<>();
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
+        if (null == tokens || tokens.isEmpty()) {
             log.info("定时获取头条数据异常:为获取到可用的token");
-        }
-        tokens.forEach(token -> {
-            advertiserDataService.getMaterialList(token);
-        });
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
-    @GetMapping("formatZybData")
-    public Map<String, Object> formatZybData() {
-        //清洗关于作业帮数据
-        //1:查询作业帮相关的用户数据
-        QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
-        wrapper.eq("project_id", 215);
-        List<UserAllocation> allocations = userAllocationService.list(wrapper);
-        if (null != allocations && allocations.size() > 0) {
-            allocations.forEach(allocation -> {
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-//                String dateString = dateFormat.format(getDate)+" 00:00:00";
-                queryWrapper.eq("advertiser_id", allocation.getAccountId())
-//                        .eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                    bytedancePlanDailyReports.forEach(report -> {
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setAdsense(tags[1]);
-                        report.setPlanCode(tags[2]);
-                        String materialName = tags[3];
-                        report.setMaterialName(materialName);
-                        if (materialName.contains("其他")) {
-                            report.setMaterialType("其他");
-                        } else if (materialName.contains("图片轮播")) {
-                            report.setMaterialType("图片轮播");
-                        } else if (materialName.contains("大字报")) {
-                            report.setMaterialType("大字报");
-                        } else if (materialName.contains("文字动画")) {
-                            report.setMaterialType("文字动画");
-                        } else if (materialName.contains("采访形式")) {
-                            report.setMaterialType("采访形式");
-                        } else if (materialName.contains("剧情")) {
-                            report.setMaterialType("剧情");
-                        } else if (materialName.contains("口播")) {
-                            report.setMaterialType("口播");
-                        } else {
-                            report.setMaterialType("其他");
-                        }
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-        Map<String, Object> result = new HashMap<>();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
-    @Autowired
-    private IReportService reportService;
-
-    @GetMapping("bytedanceHourReport")
-    public Map<String, Object> bytedanceHourReport() {
-        Map<String, Object> result = new HashMap<>();
-        log.info("头条时报数据获取开始");
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        if (null != hour && "00".equals(hour)) {
-            getDate = DateUtils.addDay(getDate, -1);
-        }
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条小时数据异常:未获取到可用的token");
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
-        executorService = Executors.newFixedThreadPool(4);
-        Date finalGetDate = getDate;
         tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    reportService.getAdvertiserReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                }
-            });
-        });
-        log.info("头条时报数据获取结束");
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @GetMapping("getHourLyYddData")
-    public Map<String, Object> getData() {
-        log.info("头条时报数据获取开始");
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        if (null != hour && "00".equals(hour)) {
-            getDate = DateUtils.addDay(getDate, -1);
-        }
-        //1:查询当日计划时报数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        Date finalGetDate = getDate;
-        executorService = Executors.newFixedThreadPool(10);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            //1:获取当日广告计划数据
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
+            advertiserDataService.getMaterialList(token);
         });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        log.info("头条计划时报数据获取完成");
-        Map<String, Object> result = new HashMap<>();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
-    @GetMapping("formatYzData")
-    public Map<String, Object> formatYzData() {
-        Map<String, Object> result = new HashMap<>();
-        planDailyReportService.cleanYzData(151);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @Autowired
-    private IBytedancePlanHourlyReportService planHourlyReportService;
+    private IReportService reportService;
 
-    @GetMapping("loadCreativeData")
-    public Map<String, Object> loadCreaticeData() {
-        Map<String, Object> result = new HashMap<>();
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        log.info("头条创意素材数据开始获取");
-        //查询当日数据
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:wei获取到可用的token");
-            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
-            return result;
-        }
-        executorService = Executors.newFixedThreadPool(20);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    // 获取广告创意信息数据
-                    try {
-                        advertiserDataService.getAdvertiserCreative(token, null);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
-        });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        log.info("头条创意素材数据获取完成");
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
 
-    @GetMapping("loadCreaticeReportData")
-    public Map<String, Object> loadCreaticeReportData() {
-        Map<String, Object> result = new HashMap<>();
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        for (int i = 51; i < 180; i++) {
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            log.info(DateUtils.formatDate(getDate) + "头条创意日报数据开始获取");
-            //查询当日数据
-            if (null == tokens || tokens.size() <= 0) {
-                log.info("定时获取头条数据异常:为获取到可用的token");
-                continue;
-            }
-            executorService = Executors.newFixedThreadPool(10);
-            countDownLatch = new CountDownLatch(tokens.size());
-            tokens.forEach(token -> {
-                executorService.submit(new Runnable() {
-                    @Override
-                    public void run() {
-                        //获取广告创意日报信息数据
-                        try {
-                            reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        } finally {
-                            countDownLatch.countDown();
-                        }
-                    }
-                });
-            });
-            try {
-                countDownLatch.await();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-            log.info(DateUtils.formatDate(getDate) + "头条创意日报数据获取完成");
-        }
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
 
-    @GetMapping("loadVideoData")
-    public Map<String, Object> loadVideoData() {
-        log.info("素材数据获取开始");
-        //1:查询当日计划时报数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        executorService = Executors.newFixedThreadPool(10);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            //1:获取当日广告计划数据
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        advertiserDataService.getMaterialList(token);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
-        });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        log.info("头条素材数据获取完成");
-        Map<String, Object> result = new HashMap<>();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
 
 
     @Autowired
-    private ICleanMaterialService cleanMaterialService;
-
-    @GetMapping("testReport")
-    public void testReport() {
-        List<String> signatureList = cleanMaterialService.getSignature();
-        if (Check.isNull(signatureList)) {
-            log.error("素材数据获取为空");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(5);
-        for (int i = 0; i < signatureList.size(); i++) {
-            String signature = signatureList.get(i);
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    cleanMaterialService.calculationReport(signature);
-                }
-            });
-        }
-
+    private IBytedancePlanHourlyReportService planHourlyReportService;
 
-    }
 
     @GetMapping(value = "/AccountReportByAccount")
     public void AccountReportByAccount(Long accountId, String startDateStr, String endDateStr) {
@@ -853,7 +484,7 @@ public class TestController {
     }
 
     @GetMapping(value = "/KuaishouDailyAccountReportLoadJob")
-    public void KuaishouDailyAccountReportLoadJob(){
+    public void KuaishouDailyAccountReportLoadJob() {
         Date getDate = DateUtils.addDay(new Date(), -2);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
@@ -875,12 +506,4 @@ public class TestController {
     }
 
 
-
-
-
-
-
-
-
-
 }

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

@@ -1,32 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import org.jeecg.modules.mq.Sender;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:57:58
- */
-@RestController
-@RequestMapping("mq")
-public class TestMqController {
-    @Autowired
-    private Sender sender;
-
-
-    @GetMapping("hello")
-    public Map<String, Object> sayHello() {
-        Map<String, Object> result = new HashMap<>();
-        sender.send();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
-        return result;
-    }
-}

+ 13 - 95
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TransferAccountController.java

@@ -3,10 +3,9 @@ package org.jeecg.modules.ctop.controller;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.MailLogMapper;
 import cn.com.ctop.common.module.service.IMailLogService;
-import cn.com.ctop.common.module.service.IMaterialInfoService;
+import cn.com.ctop.common.module.service.ISysRoleService;
 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 io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -14,32 +13,18 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.Project;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.entity.TransferAccount;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.IProjectService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
-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;
 
 /**
  * 转户记录表
@@ -64,10 +49,9 @@ public class TransferAccountController {
     @Autowired
     private MailLogMapper mailLogMapper;
     @Autowired
-    private IProjectMemberService projectMemberService;
-
+    private ISysRoleService sysRoleService;
     @Autowired
-    private IMaterialInfoService materialInfoService;
+    private IProjectMemberService projectMemberService;
 
     /**
      * 添加
@@ -79,7 +63,7 @@ public class TransferAccountController {
     @ApiOperation(value = "转户记录表-添加", notes = "转户记录表-添加")
     @PostMapping(value = "/add")
     public Result<TransferAccount> add(@RequestBody TransferAccount transferAccount) {
-        Result<TransferAccount> result = new Result<TransferAccount>();
+        Result<TransferAccount> result = new Result<>();
         try {
             QueryWrapper<TransferAccount> transferAccountQueryWrapper = new QueryWrapper<>();
             transferAccountQueryWrapper.eq("account_id", transferAccount.getAccountId());
@@ -123,9 +107,11 @@ public class TransferAccountController {
         List<TransferAccount> records = transferAccountService.list(queryWrapper);
         if (!Check.isNull(records)) {
             for (TransferAccount transfer : records) {
-                String transferorName = mailLogMapper.getUserNameByUserId(transfer.getTransferor()); // 转让人姓名
+                // 转让人姓名
+                String transferorName = mailLogMapper.getUserNameByUserId(transfer.getTransferor());
                 transfer.setTransferorName(transferorName);
-                String assigneeName = mailLogMapper.getUserNameByUserId(transfer.getAssignee()); // 转让人姓名
+                // 转让人姓名
+                String assigneeName = mailLogMapper.getUserNameByUserId(transfer.getAssignee());
                 transfer.setAssigneeName(assigneeName);
             }
         }
@@ -146,7 +132,7 @@ public class TransferAccountController {
     @ApiOperation(value = "转户记录表-编辑", notes = "转户记录表-编辑")
     @PutMapping(value = "/edit")
     public Result<TransferAccount> edit(@RequestBody TransferAccount transferAccount) {
-        Result<TransferAccount> result = new Result<TransferAccount>();
+        Result<TransferAccount> result = new Result<>();
         TransferAccount transferAccountEntity = transferAccountService.getById(transferAccount.getId());
         if (transferAccountEntity == null) {
             result.error500("未找到对应实体");
@@ -172,7 +158,7 @@ public class TransferAccountController {
                 ProjectMember projectMember = projectMemberService.getOne(projectMemberQueryWrapper);
                 if (Check.isNull(projectMember)) {
                     ProjectMember addProjectMember = new ProjectMember();
-                    String roleCode = materialInfoService.getRoleCodeByUserId(transferAccountEntity.getAssignee());
+                    String roleCode = sysRoleService.getRoleCodeByUserId(transferAccountEntity.getAssignee());
                     addProjectMember.setRoleCode(roleCode);
                     addProjectMember.setUserId(transferAccountEntity.getAssignee());
                     addProjectMember.setUserName(userName);
@@ -200,7 +186,7 @@ public class TransferAccountController {
     @AutoLog(value = "转户记录表-通过id删除")
     @ApiOperation(value = "转户记录表-通过id删除", notes = "转户记录表-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             transferAccountService.removeById(id);
         } catch (Exception e) {
@@ -220,7 +206,7 @@ public class TransferAccountController {
     @ApiOperation(value = "转户记录表-批量删除", notes = "转户记录表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<TransferAccount> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<TransferAccount> result = new Result<TransferAccount>();
+        Result<TransferAccount> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -240,7 +226,7 @@ public class TransferAccountController {
     @ApiOperation(value = "转户记录表-通过id查询", notes = "转户记录表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<TransferAccount> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<TransferAccount> result = new Result<TransferAccount>();
+        Result<TransferAccount> result = new Result<>();
         TransferAccount transferAccount = transferAccountService.getById(id);
         if (transferAccount == null) {
             result.error500("未找到对应实体");
@@ -250,72 +236,4 @@ public class TransferAccountController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<TransferAccount> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                TransferAccount transferAccount = JSON.parseObject(deString, TransferAccount.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(transferAccount, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<TransferAccount> pageList = transferAccountService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "转户记录表列表");
-        mv.addObject(NormalExcelConstants.CLASS, TransferAccount.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<TransferAccount> listTransferAccounts = ExcelImportUtil.importExcel(file.getInputStream(), TransferAccount.class, params);
-                transferAccountService.saveBatch(listTransferAccounts);
-                return Result.ok("文件导入成功!数据行数:" + listTransferAccounts.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("文件导入失败!");
-    }
-
 }

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

@@ -1,8 +1,8 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -74,7 +74,7 @@ public class UReportFileBindUserController {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         uReportFileBindUser.setUserId(user.getId());
         String fileName = null;
-        if (null != uReportFileBindUser.getFileName() && !uReportFileBindUser.getFileName().trim().equals("")) {
+        if (null != uReportFileBindUser.getFileName() && !"".equals(uReportFileBindUser.getFileName().trim())) {
             fileName = uReportFileBindUser.getFileName();
             uReportFileBindUser.setFileName(null);
         }
@@ -157,7 +157,7 @@ public class UReportFileBindUserController {
     @AutoLog(value = "用户绑定报表信息-通过id删除")
     @ApiOperation(value = "用户绑定报表信息-通过id删除", notes = "用户绑定报表信息-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             uReportFileBindUserService.removeById(id);
         } catch (Exception e) {

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,27 +10,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.UReportFile;
 import org.jeecg.modules.ctop.service.IUReportFileService;
-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;
 
 /**
@@ -65,9 +50,9 @@ public class UReportFileController {
                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                     HttpServletRequest req) {
-        Result<IPage<UReportFile>> result = new Result<IPage<UReportFile>>();
+        Result<IPage<UReportFile>> result = new Result<>();
         String name = null;
-        if (null != uReportFile.getName() && !uReportFile.getName().trim().equals("")) {
+        if (null != uReportFile.getName() && !"".equals(uReportFile.getName().trim())) {
             name = uReportFile.getName();
             uReportFile.setName(null);
         }
@@ -75,7 +60,7 @@ public class UReportFileController {
         if (null != name) {
             queryWrapper.like("name", name);
         }
-        Page<UReportFile> page = new Page<UReportFile>(pageNo, pageSize);
+        Page<UReportFile> page = new Page<>(pageNo, pageSize);
         IPage<UReportFile> pageList = uReportFileService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -92,7 +77,7 @@ public class UReportFileController {
     @ApiOperation(value = "报表文件存储-添加", notes = "报表文件存储-添加")
     @PostMapping(value = "/add")
     public Result<UReportFile> add(@RequestBody UReportFile uReportFile) {
-        Result<UReportFile> result = new Result<UReportFile>();
+        Result<UReportFile> result = new Result<>();
         try {
             uReportFileService.save(uReportFile);
             result.success("添加成功!");
@@ -113,7 +98,7 @@ public class UReportFileController {
     @ApiOperation(value = "报表文件存储-编辑", notes = "报表文件存储-编辑")
     @PutMapping(value = "/edit")
     public Result<UReportFile> edit(@RequestBody UReportFile uReportFile) {
-        Result<UReportFile> result = new Result<UReportFile>();
+        Result<UReportFile> result = new Result<>();
         UReportFile uReportFileEntity = uReportFileService.getById(uReportFile.getId());
         if (uReportFileEntity == null) {
             result.error500("未找到对应实体");
@@ -155,7 +140,7 @@ public class UReportFileController {
     @AutoLog(value = "报表文件存储-通过id删除")
     @ApiOperation(value = "报表文件存储-通过id删除", notes = "报表文件存储-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             uReportFileService.removeById(id);
         } catch (Exception e) {
@@ -175,7 +160,7 @@ public class UReportFileController {
     @ApiOperation(value = "报表文件存储-批量删除", notes = "报表文件存储-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<UReportFile> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<UReportFile> result = new Result<UReportFile>();
+        Result<UReportFile> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -195,7 +180,7 @@ public class UReportFileController {
     @ApiOperation(value = "报表文件存储-通过id查询", notes = "报表文件存储-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<UReportFile> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<UReportFile> result = new Result<UReportFile>();
+        Result<UReportFile> result = new Result<>();
         UReportFile uReportFile = uReportFileService.getById(id);
         if (uReportFile == null) {
             result.error500("未找到对应实体");
@@ -205,71 +190,4 @@ public class UReportFileController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<UReportFile> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                UReportFile uReportFile = JSON.parseObject(deString, UReportFile.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(uReportFile, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<UReportFile> pageList = uReportFileService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "报表文件存储列表");
-        mv.addObject(NormalExcelConstants.CLASS, UReportFile.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<UReportFile> listUReportFiles = ExcelImportUtil.importExcel(file.getInputStream(), UReportFile.class, params);
-                uReportFileService.saveBatch(listUReportFiles);
-                return Result.ok("文件导入成功!数据行数:" + listUReportFiles.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("文件导入失败!");
-    }
 }

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

@@ -1,12 +1,11 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
+import cn.com.ctop.common.module.service.ISysRoleService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
-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;
@@ -18,31 +17,17 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.Project;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.IProjectService;
-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;
 
 /**
  * 用户分配
@@ -63,7 +48,7 @@ public class UserAllocationController {
     @Autowired
     private IProjectService projectService;
     @Autowired
-    private MaterialReportMapper materialReportMapper;
+    private ISysRoleService sysRoleService;
     @Autowired
     private ProjectMemberMapper memberMapper;
     @Autowired
@@ -71,8 +56,8 @@ public class UserAllocationController {
 
 
     @GetMapping(value = "/accountTurnProject")
-    public Result getAccountList(Long accountId, Long projectId) {
-        Result result = new Result<>();
+    public Result<Object> getAccountList(Long accountId, Long projectId) {
+        Result<Object> result = new Result<>();
         try {
             QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("account_id", accountId);
@@ -113,7 +98,7 @@ public class UserAllocationController {
                 addMember.setProjectName(project.getProjectName());
                 addMember.setUserId(userAllocations.getUserId());
                 addMember.setUserName(userAllocations.getUserName());
-                String roleCode = materialReportMapper.getRoleCodeByUserId(userAllocations.getUserId());
+                String roleCode = sysRoleService.getRoleCodeByUserId(userAllocations.getUserId());
                 if (!Check.isNull(roleCode)) {
                     addMember.setRoleCode(roleCode);
                 }
@@ -168,9 +153,8 @@ public class UserAllocationController {
                 queryWrapper.eq("media_id", project.getMediaId());
             }
 
-            String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
-            if (!"admin".equals(roleCode) && !"kuaishouOperationManager".equals(roleCode)
-                    && !"kuaishouOperationManager".equals(roleCode) && !"designTeamLeader".equals(roleCode) && !"touTiaoOperationManager".equals(roleCode)) {
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            if (!"admin".equals(roleCode) && !"kuaishouOperationManager".equals(roleCode) && !"designTeamLeader".equals(roleCode) && !"touTiaoOperationManager".equals(roleCode)) {
                 queryWrapper.eq("user_id", userId);
             }
             queryWrapper.orderByDesc("create_time");
@@ -234,15 +218,15 @@ public class UserAllocationController {
                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                        HttpServletRequest req) {
-        Result<IPage<UserAllocation>> result = new Result<IPage<UserAllocation>>();
+        Result<IPage<UserAllocation>> result = new Result<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         QueryWrapper<UserAllocation> queryWrapper = QueryGenerator.initQueryWrapper(userAllocation, req.getParameterMap());
-        String roleCode = materialReportMapper.getRoleCodeByUserId(user.getId());
+        String roleCode = sysRoleService.getRoleCodeByUserId(user.getId());
         if (!"admin".equals(roleCode)) {
             queryWrapper.eq("user_id", user.getId());
             queryWrapper.orderByDesc("id");
         }
-        Page<UserAllocation> page = new Page<UserAllocation>(pageNo, pageSize);
+        Page<UserAllocation> page = new Page<>(pageNo, pageSize);
         IPage<UserAllocation> pageList = userAllocationService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -259,7 +243,7 @@ public class UserAllocationController {
     @ApiOperation(value = "用户分配-添加", notes = "用户分配-添加")
     @PostMapping(value = "/add")
     public Result<UserAllocation> add(@RequestBody UserAllocation userAllocation) {
-        Result<UserAllocation> result = new Result<UserAllocation>();
+        Result<UserAllocation> result = new Result<>();
         try {
             userAllocationService.save(userAllocation);
             result.success("添加成功!");
@@ -280,7 +264,7 @@ public class UserAllocationController {
     @ApiOperation(value = "用户分配-编辑", notes = "用户分配-编辑")
     @PutMapping(value = "/edit")
     public Result<UserAllocation> edit(@RequestBody UserAllocation userAllocation) {
-        Result<UserAllocation> result = new Result<UserAllocation>();
+        Result<UserAllocation> result = new Result<>();
         UserAllocation userAllocationEntity = userAllocationService.getById(userAllocation.getId());
         if (userAllocationEntity == null) {
             result.error500("未找到对应实体");
@@ -297,7 +281,7 @@ public class UserAllocationController {
                 addMember.setProjectName(userAllocation.getProjectName());
                 addMember.setUserId(userAllocation.getUserId());
                 addMember.setUserName(userAllocation.getUserName());
-                String roleCode = materialReportMapper.getRoleCodeByUserId(userAllocation.getUserId());
+                String roleCode = sysRoleService.getRoleCodeByUserId(userAllocation.getUserId());
                 if (!Check.isNull(roleCode)) {
                     addMember.setRoleCode(roleCode);
                 }
@@ -321,7 +305,7 @@ public class UserAllocationController {
     @AutoLog(value = "用户分配-通过id删除")
     @ApiOperation(value = "用户分配-通过id删除", notes = "用户分配-通过id删除")
     @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
         try {
             userAllocationService.removeById(id);
         } catch (Exception e) {
@@ -341,7 +325,7 @@ public class UserAllocationController {
     @ApiOperation(value = "用户分配-批量删除", notes = "用户分配-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<UserAllocation> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<UserAllocation> result = new Result<UserAllocation>();
+        Result<UserAllocation> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
             result.error500("参数不识别!");
         } else {
@@ -371,73 +355,4 @@ public class UserAllocationController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<UserAllocation> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                UserAllocation userAllocation = JSON.parseObject(deString, UserAllocation.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(userAllocation, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<UserAllocation> pageList = userAllocationService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "用户分配列表");
-        mv.addObject(NormalExcelConstants.CLASS, UserAllocation.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<UserAllocation> listUserAllocations = ExcelImportUtil.importExcel(file.getInputStream(), UserAllocation.class, params);
-                userAllocationService.saveBatch(listUserAllocations);
-                return Result.ok("文件导入成功!数据行数:" + listUserAllocations.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("文件导入失败!");
-    }
-
 }

+ 29 - 116
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoMergeTaskController.java

@@ -1,40 +1,21 @@
 package org.jeecg.modules.ctop.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import cn.com.ctop.common.module.entity.VideoMergeTask;
 import cn.com.ctop.common.module.service.IVideoMergeTaskService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
-import java.util.Date;
 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.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.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
 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 com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
 
  /**
  * 视频合成任务
@@ -49,8 +30,8 @@ import io.swagger.annotations.ApiOperation;
 public class VideoMergeTaskController {
 	@Autowired
 	private IVideoMergeTaskService videoMergeTaskService;
-	
-	/**
+
+     /**
 	  * 分页列表查询
 	 * @param videoMergeTask
 	 * @param pageNo
@@ -65,16 +46,16 @@ public class VideoMergeTaskController {
 													   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 													   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 													   HttpServletRequest req) {
-		Result<IPage<VideoMergeTask>> result = new Result<IPage<VideoMergeTask>>();
+        Result<IPage<VideoMergeTask>> result = new Result<>();
 		QueryWrapper<VideoMergeTask> queryWrapper = QueryGenerator.initQueryWrapper(videoMergeTask, req.getParameterMap());
-		Page<VideoMergeTask> page = new Page<VideoMergeTask>(pageNo, pageSize);
+        Page<VideoMergeTask> page = new Page<>(pageNo, pageSize);
 		IPage<VideoMergeTask> pageList = videoMergeTaskService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *   添加
 	 * @param videoMergeTask
 	 * @return
@@ -83,7 +64,7 @@ public class VideoMergeTaskController {
 	@ApiOperation(value="视频合成任务-添加", notes="视频合成任务-添加")
 	@PostMapping(value = "/add")
 	public Result<VideoMergeTask> add(@RequestBody VideoMergeTask videoMergeTask) {
-		Result<VideoMergeTask> result = new Result<VideoMergeTask>();
+        Result<VideoMergeTask> result = new Result<>();
 		try {
 			videoMergeTaskService.save(videoMergeTask);
 			result.success("添加成功!");
@@ -93,8 +74,8 @@ public class VideoMergeTaskController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *  编辑
 	 * @param videoMergeTask
 	 * @return
@@ -103,7 +84,7 @@ public class VideoMergeTaskController {
 	@ApiOperation(value="视频合成任务-编辑", notes="视频合成任务-编辑")
 	@PutMapping(value = "/edit")
 	public Result<VideoMergeTask> edit(@RequestBody VideoMergeTask videoMergeTask) {
-		Result<VideoMergeTask> result = new Result<VideoMergeTask>();
+        Result<VideoMergeTask> result = new Result<>();
 		VideoMergeTask videoMergeTaskEntity = videoMergeTaskService.getById(videoMergeTask.getId());
 		if(videoMergeTaskEntity==null) {
 			result.error500("未找到对应实体");
@@ -113,11 +94,11 @@ public class VideoMergeTaskController {
 				result.success("修改成功!");
 			}
 		}
-		
-		return result;
+
+        return result;
 	}
-	
-	/**
+
+     /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -125,7 +106,7 @@ public class VideoMergeTaskController {
 	@AutoLog(value = "视频合成任务-通过id删除")
 	@ApiOperation(value="视频合成任务-通过id删除", notes="视频合成任务-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
 		try {
 			videoMergeTaskService.removeById(id);
 		} catch (Exception e) {
@@ -134,8 +115,8 @@ public class VideoMergeTaskController {
 		}
 		return Result.ok("删除成功!");
 	}
-	
-	/**
+
+     /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -144,7 +125,7 @@ public class VideoMergeTaskController {
 	@ApiOperation(value="视频合成任务-批量删除", notes="视频合成任务-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<VideoMergeTask> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<VideoMergeTask> result = new Result<VideoMergeTask>();
+        Result<VideoMergeTask> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -153,8 +134,8 @@ public class VideoMergeTaskController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -163,7 +144,7 @@ public class VideoMergeTaskController {
 	@ApiOperation(value="视频合成任务-通过id查询", notes="视频合成任务-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<VideoMergeTask> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<VideoMergeTask> result = new Result<VideoMergeTask>();
+        Result<VideoMergeTask> result = new Result<>();
 		VideoMergeTask videoMergeTask = videoMergeTaskService.getById(id);
 		if(videoMergeTask==null) {
 			result.error500("未找到对应实体");
@@ -173,72 +154,4 @@ public class VideoMergeTaskController {
 		}
 		return result;
 	}
-
-  /**
-      * 导出excel
-   *
-   * @param request
-   * @param response
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-      // Step.1 组装查询条件
-      QueryWrapper<VideoMergeTask> queryWrapper = null;
-      try {
-          String paramsStr = request.getParameter("paramsStr");
-          if (oConvertUtils.isNotEmpty(paramsStr)) {
-              String deString = URLDecoder.decode(paramsStr, "UTF-8");
-              VideoMergeTask videoMergeTask = JSON.parseObject(deString, VideoMergeTask.class);
-              queryWrapper = QueryGenerator.initQueryWrapper(videoMergeTask, request.getParameterMap());
-          }
-      } catch (UnsupportedEncodingException e) {
-          e.printStackTrace();
-      }
-
-      //Step.2 AutoPoi 导出Excel
-      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-      List<VideoMergeTask> pageList = videoMergeTaskService.list(queryWrapper);
-      //导出文件名称
-      mv.addObject(NormalExcelConstants.FILE_NAME, "视频合成任务列表");
-      mv.addObject(NormalExcelConstants.CLASS, VideoMergeTask.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<VideoMergeTask> listVideoMergeTasks = ExcelImportUtil.importExcel(file.getInputStream(), VideoMergeTask.class, params);
-              videoMergeTaskService.saveBatch(listVideoMergeTasks);
-              return Result.ok("文件导入成功!数据行数:" + listVideoMergeTasks.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("文件导入失败!");
-  }
-
 }

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

@@ -1,37 +1,21 @@
 package org.jeecg.modules.ctop.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import cn.com.ctop.common.module.entity.VideoPart;
 import cn.com.ctop.common.module.service.IVideoPartService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
-import java.util.Date;
 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.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.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
 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 com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
 
  /**
  * 视频片段
@@ -46,7 +30,7 @@ import io.swagger.annotations.ApiOperation;
 public class VideoPartController {
 	@Autowired
 	private IVideoPartService videoPartService;
-	
+
 	/**
 	  * 分页列表查询
 	 * @param videoPart
@@ -62,15 +46,15 @@ public class VideoPartController {
 												  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 												  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 												  HttpServletRequest req) {
-		Result<IPage<VideoPart>> result = new Result<IPage<VideoPart>>();
+        Result<IPage<VideoPart>> result = new Result<>();
 		QueryWrapper<VideoPart> queryWrapper = QueryGenerator.initQueryWrapper(videoPart, req.getParameterMap());
-		Page<VideoPart> page = new Page<VideoPart>(pageNo, pageSize);
+        Page<VideoPart> page = new Page<>(pageNo, pageSize);
 		IPage<VideoPart> pageList = videoPartService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
-	
+
 	/**
 	  *   添加
 	 * @param videoPart
@@ -80,7 +64,7 @@ public class VideoPartController {
 	@ApiOperation(value="视频片段-添加", notes="视频片段-添加")
 	@PostMapping(value = "/add")
 	public Result<VideoPart> add(@RequestBody VideoPart videoPart) {
-		Result<VideoPart> result = new Result<VideoPart>();
+        Result<VideoPart> result = new Result<>();
 		try {
 			videoPartService.save(videoPart);
 			result.success("添加成功!");
@@ -90,7 +74,7 @@ public class VideoPartController {
 		}
 		return result;
 	}
-	
+
 	/**
 	  *  编辑
 	 * @param videoPart
@@ -100,7 +84,7 @@ public class VideoPartController {
 	@ApiOperation(value="视频片段-编辑", notes="视频片段-编辑")
 	@PutMapping(value = "/edit")
 	public Result<VideoPart> edit(@RequestBody VideoPart videoPart) {
-		Result<VideoPart> result = new Result<VideoPart>();
+        Result<VideoPart> result = new Result<>();
 		VideoPart videoPartEntity = videoPartService.getById(videoPart.getId());
 		if(videoPartEntity==null) {
 			result.error500("未找到对应实体");
@@ -110,11 +94,11 @@ public class VideoPartController {
 				result.success("修改成功!");
 			}
 		}
-		
-		return result;
+
+        return result;
 	}
-	
-	/**
+
+     /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -122,7 +106,7 @@ public class VideoPartController {
 	@AutoLog(value = "视频片段-通过id删除")
 	@ApiOperation(value="视频片段-通过id删除", notes="视频片段-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
 		try {
 			videoPartService.removeById(id);
 		} catch (Exception e) {
@@ -131,8 +115,8 @@ public class VideoPartController {
 		}
 		return Result.ok("删除成功!");
 	}
-	
-	/**
+
+     /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -141,7 +125,7 @@ public class VideoPartController {
 	@ApiOperation(value="视频片段-批量删除", notes="视频片段-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<VideoPart> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<VideoPart> result = new Result<VideoPart>();
+        Result<VideoPart> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -150,8 +134,8 @@ public class VideoPartController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -160,7 +144,7 @@ public class VideoPartController {
 	@ApiOperation(value="视频片段-通过id查询", notes="视频片段-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<VideoPart> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<VideoPart> result = new Result<VideoPart>();
+        Result<VideoPart> result = new Result<>();
 		VideoPart videoPart = videoPartService.getById(id);
 		if(videoPart==null) {
 			result.error500("未找到对应实体");
@@ -170,72 +154,4 @@ public class VideoPartController {
 		}
 		return result;
 	}
-
-  /**
-      * 导出excel
-   *
-   * @param request
-   * @param response
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-      // Step.1 组装查询条件
-      QueryWrapper<VideoPart> queryWrapper = null;
-      try {
-          String paramsStr = request.getParameter("paramsStr");
-          if (oConvertUtils.isNotEmpty(paramsStr)) {
-              String deString = URLDecoder.decode(paramsStr, "UTF-8");
-              VideoPart videoPart = JSON.parseObject(deString, VideoPart.class);
-              queryWrapper = QueryGenerator.initQueryWrapper(videoPart, request.getParameterMap());
-          }
-      } catch (UnsupportedEncodingException e) {
-          e.printStackTrace();
-      }
-
-      //Step.2 AutoPoi 导出Excel
-      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-      List<VideoPart> pageList = videoPartService.list(queryWrapper);
-      //导出文件名称
-      mv.addObject(NormalExcelConstants.FILE_NAME, "视频片段列表");
-      mv.addObject(NormalExcelConstants.CLASS, VideoPart.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<VideoPart> listVideoParts = ExcelImportUtil.importExcel(file.getInputStream(), VideoPart.class, params);
-              videoPartService.saveBatch(listVideoParts);
-              return Result.ok("文件导入成功!数据行数:" + listVideoParts.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("文件导入失败!");
-  }
-
 }

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

@@ -2,7 +2,6 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.VideoWatermarkTask;
 import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
-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;
@@ -12,26 +11,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 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;
 
  /**
  * 水印任务表
@@ -62,9 +46,9 @@ public class VideoWatermarkTaskController {
 									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 									  HttpServletRequest req) {
-		Result<IPage<VideoWatermarkTask>> result = new Result<IPage<VideoWatermarkTask>>();
+        Result<IPage<VideoWatermarkTask>> result = new Result<>();
 		QueryWrapper<VideoWatermarkTask> queryWrapper = QueryGenerator.initQueryWrapper(videoWatermarkTask, req.getParameterMap());
-		Page<VideoWatermarkTask> page = new Page<VideoWatermarkTask>(pageNo, pageSize);
+        Page<VideoWatermarkTask> page = new Page<>(pageNo, pageSize);
 		IPage<VideoWatermarkTask> pageList = videoWatermarkTaskService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
@@ -80,7 +64,7 @@ public class VideoWatermarkTaskController {
 	@ApiOperation(value="水印任务表-添加", notes="水印任务表-添加")
 	@PostMapping(value = "/add")
 	public Result<VideoWatermarkTask> add(@RequestBody VideoWatermarkTask videoWatermarkTask) {
-		Result<VideoWatermarkTask> result = new Result<VideoWatermarkTask>();
+        Result<VideoWatermarkTask> result = new Result<>();
 		try {
 			videoWatermarkTaskService.save(videoWatermarkTask);
 			result.success("添加成功!");
@@ -100,7 +84,7 @@ public class VideoWatermarkTaskController {
 	@ApiOperation(value="水印任务表-编辑", notes="水印任务表-编辑")
 	@PutMapping(value = "/edit")
 	public Result<VideoWatermarkTask> edit(@RequestBody VideoWatermarkTask videoWatermarkTask) {
-		Result<VideoWatermarkTask> result = new Result<VideoWatermarkTask>();
+        Result<VideoWatermarkTask> result = new Result<>();
 		VideoWatermarkTask videoWatermarkTaskEntity = videoWatermarkTaskService.getById(videoWatermarkTask.getId());
 		if(videoWatermarkTaskEntity==null) {
 			result.error500("未找到对应实体");
@@ -122,7 +106,7 @@ public class VideoWatermarkTaskController {
 	@AutoLog(value = "水印任务表-通过id删除")
 	@ApiOperation(value="水印任务表-通过id删除", notes="水印任务表-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
 		try {
 			videoWatermarkTaskService.removeById(id);
 		} catch (Exception e) {
@@ -141,7 +125,7 @@ public class VideoWatermarkTaskController {
 	@ApiOperation(value="水印任务表-批量删除", notes="水印任务表-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<VideoWatermarkTask> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<VideoWatermarkTask> result = new Result<VideoWatermarkTask>();
+        Result<VideoWatermarkTask> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -160,7 +144,7 @@ public class VideoWatermarkTaskController {
 	@ApiOperation(value="水印任务表-通过id查询", notes="水印任务表-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<VideoWatermarkTask> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<VideoWatermarkTask> result = new Result<VideoWatermarkTask>();
+        Result<VideoWatermarkTask> result = new Result<>();
 		VideoWatermarkTask videoWatermarkTask = videoWatermarkTaskService.getById(id);
 		if(videoWatermarkTask==null) {
 			result.error500("未找到对应实体");
@@ -170,72 +154,4 @@ public class VideoWatermarkTaskController {
 		}
 		return result;
 	}
-
-  /**
-      * 导出excel
-   *
-   * @param request
-   * @param response
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-      // Step.1 组装查询条件
-      QueryWrapper<VideoWatermarkTask> queryWrapper = null;
-      try {
-          String paramsStr = request.getParameter("paramsStr");
-          if (oConvertUtils.isNotEmpty(paramsStr)) {
-              String deString = URLDecoder.decode(paramsStr, "UTF-8");
-              VideoWatermarkTask videoWatermarkTask = JSON.parseObject(deString, VideoWatermarkTask.class);
-              queryWrapper = QueryGenerator.initQueryWrapper(videoWatermarkTask, request.getParameterMap());
-          }
-      } catch (UnsupportedEncodingException e) {
-          e.printStackTrace();
-      }
-
-      //Step.2 AutoPoi 导出Excel
-      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-      List<VideoWatermarkTask> pageList = videoWatermarkTaskService.list(queryWrapper);
-      //导出文件名称
-      mv.addObject(NormalExcelConstants.FILE_NAME, "水印任务表列表");
-      mv.addObject(NormalExcelConstants.CLASS, VideoWatermarkTask.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<VideoWatermarkTask> listVideoWatermarkTasks = ExcelImportUtil.importExcel(file.getInputStream(), VideoWatermarkTask.class, params);
-              videoWatermarkTaskService.saveBatch(listVideoWatermarkTasks);
-              return Result.ok("文件导入成功!数据行数:" + listVideoWatermarkTasks.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("文件导入失败!");
-  }
-
 }

+ 29 - 115
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/VideoWatermarkTemplateController.java

@@ -1,39 +1,21 @@
 package org.jeecg.modules.ctop.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.common.module.entity.VideoWatermarkTemplate;
 import cn.com.ctop.common.module.service.IVideoWatermarkTemplateService;
-import java.util.Date;
 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.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.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
 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 com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
 
  /**
  * 水印模板
@@ -48,8 +30,8 @@ import io.swagger.annotations.ApiOperation;
 public class VideoWatermarkTemplateController {
 	@Autowired
 	private IVideoWatermarkTemplateService videoWatermarkTemplateService;
-	
-	/**
+
+     /**
 	  * 分页列表查询
 	 * @param videoWatermarkTemplate
 	 * @param pageNo
@@ -64,16 +46,16 @@ public class VideoWatermarkTemplateController {
 									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 									  HttpServletRequest req) {
-		Result<IPage<VideoWatermarkTemplate>> result = new Result<IPage<VideoWatermarkTemplate>>();
+        Result<IPage<VideoWatermarkTemplate>> result = new Result<>();
 		QueryWrapper<VideoWatermarkTemplate> queryWrapper = QueryGenerator.initQueryWrapper(videoWatermarkTemplate, req.getParameterMap());
-		Page<VideoWatermarkTemplate> page = new Page<VideoWatermarkTemplate>(pageNo, pageSize);
+        Page<VideoWatermarkTemplate> page = new Page<>(pageNo, pageSize);
 		IPage<VideoWatermarkTemplate> pageList = videoWatermarkTemplateService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *   添加
 	 * @param videoWatermarkTemplate
 	 * @return
@@ -82,7 +64,7 @@ public class VideoWatermarkTemplateController {
 	@ApiOperation(value="水印模板-添加", notes="水印模板-添加")
 	@PostMapping(value = "/add")
 	public Result<VideoWatermarkTemplate> add(@RequestBody VideoWatermarkTemplate videoWatermarkTemplate) {
-		Result<VideoWatermarkTemplate> result = new Result<VideoWatermarkTemplate>();
+        Result<VideoWatermarkTemplate> result = new Result<>();
 		try {
 			videoWatermarkTemplateService.save(videoWatermarkTemplate);
 			result.success("添加成功!");
@@ -92,8 +74,8 @@ public class VideoWatermarkTemplateController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *  编辑
 	 * @param videoWatermarkTemplate
 	 * @return
@@ -102,7 +84,7 @@ public class VideoWatermarkTemplateController {
 	@ApiOperation(value="水印模板-编辑", notes="水印模板-编辑")
 	@PutMapping(value = "/edit")
 	public Result<VideoWatermarkTemplate> edit(@RequestBody VideoWatermarkTemplate videoWatermarkTemplate) {
-		Result<VideoWatermarkTemplate> result = new Result<VideoWatermarkTemplate>();
+        Result<VideoWatermarkTemplate> result = new Result<>();
 		VideoWatermarkTemplate videoWatermarkTemplateEntity = videoWatermarkTemplateService.getById(videoWatermarkTemplate.getId());
 		if(videoWatermarkTemplateEntity==null) {
 			result.error500("未找到对应实体");
@@ -112,11 +94,11 @@ public class VideoWatermarkTemplateController {
 				result.success("修改成功!");
 			}
 		}
-		
-		return result;
+
+        return result;
 	}
-	
-	/**
+
+     /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -124,7 +106,7 @@ public class VideoWatermarkTemplateController {
 	@AutoLog(value = "水印模板-通过id删除")
 	@ApiOperation(value="水印模板-通过id删除", notes="水印模板-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
 		try {
 			videoWatermarkTemplateService.removeById(id);
 		} catch (Exception e) {
@@ -133,8 +115,8 @@ public class VideoWatermarkTemplateController {
 		}
 		return Result.ok("删除成功!");
 	}
-	
-	/**
+
+     /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -143,7 +125,7 @@ public class VideoWatermarkTemplateController {
 	@ApiOperation(value="水印模板-批量删除", notes="水印模板-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<VideoWatermarkTemplate> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<VideoWatermarkTemplate> result = new Result<VideoWatermarkTemplate>();
+        Result<VideoWatermarkTemplate> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
 		}else {
@@ -152,8 +134,8 @@ public class VideoWatermarkTemplateController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -162,7 +144,7 @@ public class VideoWatermarkTemplateController {
 	@ApiOperation(value="水印模板-通过id查询", notes="水印模板-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<VideoWatermarkTemplate> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<VideoWatermarkTemplate> result = new Result<VideoWatermarkTemplate>();
+        Result<VideoWatermarkTemplate> result = new Result<>();
 		VideoWatermarkTemplate videoWatermarkTemplate = videoWatermarkTemplateService.getById(id);
 		if(videoWatermarkTemplate==null) {
 			result.error500("未找到对应实体");
@@ -172,72 +154,4 @@ public class VideoWatermarkTemplateController {
 		}
 		return result;
 	}
-
-  /**
-      * 导出excel
-   *
-   * @param request
-   * @param response
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-      // Step.1 组装查询条件
-      QueryWrapper<VideoWatermarkTemplate> queryWrapper = null;
-      try {
-          String paramsStr = request.getParameter("paramsStr");
-          if (oConvertUtils.isNotEmpty(paramsStr)) {
-              String deString = URLDecoder.decode(paramsStr, "UTF-8");
-              VideoWatermarkTemplate videoWatermarkTemplate = JSON.parseObject(deString, VideoWatermarkTemplate.class);
-              queryWrapper = QueryGenerator.initQueryWrapper(videoWatermarkTemplate, request.getParameterMap());
-          }
-      } catch (UnsupportedEncodingException e) {
-          e.printStackTrace();
-      }
-
-      //Step.2 AutoPoi 导出Excel
-      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-      List<VideoWatermarkTemplate> pageList = videoWatermarkTemplateService.list(queryWrapper);
-      //导出文件名称
-      mv.addObject(NormalExcelConstants.FILE_NAME, "水印模板列表");
-      mv.addObject(NormalExcelConstants.CLASS, VideoWatermarkTemplate.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<VideoWatermarkTemplate> listVideoWatermarkTemplates = ExcelImportUtil.importExcel(file.getInputStream(), VideoWatermarkTemplate.class, params);
-              videoWatermarkTemplateService.saveBatch(listVideoWatermarkTemplates);
-              return Result.ok("文件导入成功!数据行数:" + listVideoWatermarkTemplates.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("文件导入失败!");
-  }
-
 }

+ 16 - 76
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/YardController.java

@@ -20,8 +20,8 @@ import javax.servlet.http.HttpServletRequest;
  * @author yumeng
  * 2019年11月12日10:04:00
  */
-@RestController
 @Slf4j
+@RestController
 @RequestMapping("/ctop/yard")
 public class YardController {
     @Autowired
@@ -35,28 +35,10 @@ public class YardController {
     @Autowired
     private IYardCommentService yardCommentService;
 
-    @ResponseBody
-    @RequestMapping(value = "/detail", method = RequestMethod.GET)
+    @GetMapping("/detail")
     public Result<Yard> getDetail(@RequestParam(name = "id") Long id) {
         Result<Yard> result = new Result<>();
         Yard yard = yardService.getById(id);
-//        YardPhoto yardPhoto = new YardPhoto();
-//        YardVideo yardVideo = new YardVideo();
-//        YardScheduler yardScheduler = new YardScheduler();
-//        yardPhoto.setYardId(yardId);
-//        yardVideo.setYardId(yardId);
-//        yardScheduler.setYardId(yardId);
-//        QueryWrapper<YardPhoto> yardPhotoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
-//        QueryWrapper<YardVideo> yardVideoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
-//        QueryWrapper<YardScheduler> yardSchedulerQueryWrapper = QueryGenerator.initQueryWrapper(yardScheduler, null);
-//        List<YardPhoto> yardPhotoList = yardPhotoService.list(yardPhotoQueryWrapper);
-//        List<YardVideo> yardVideoList = yardVideoService.list(yardVideoQueryWrapper);
-//        List<YardScheduler> yardSchedulerList = yardSchedulerService.list(yardSchedulerQueryWrapper);
-//        Map<String, Object> map = new HashMap<String, Object>();
-//        map.put("yard", yard);
-//        map.put("yardPhotoList", yardPhotoList);
-//        map.put("yardVideoList", yardVideoList);
-//        map.put("yardSchedulerList", yardSchedulerList);
         result.setResult(yard);
         result.setSuccess(true);
         return result;
@@ -64,25 +46,9 @@ public class YardController {
 
     @PostMapping(value = "/add")
     public Result<Yard> add(@RequestBody Yard yard) {
-        Result<Yard> result = new Result<Yard>();
+        Result<Yard> result = new Result<>();
         try {
             yardService.save(yard);
-//            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
-//                for (String url : yard.getImageUrl()) {
-//                    YardPhoto yardPhoto = new YardPhoto();
-//                    yardPhoto.setYardId(yard.getId());
-//                    yardPhoto.setPhotoUrl("http:" + url);
-//                    yardPhotoService.save(yardPhoto);
-//                }
-//            }
-//            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
-//                for (String url : yard.getVideoUrl()) {
-//                    YardVideo yardVideo = new YardVideo();
-//                    yardVideo.setYardId(yard.getId());
-//                    yardVideo.setVideoUrl("http:" + url);
-//                    yardVideoService.save(yardVideo);
-//                }
-//            }
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -93,39 +59,13 @@ public class YardController {
 
     @PutMapping(value = "/edit")
     public Result<Yard> edit(@RequestBody Yard yard) {
-        Result<Yard> result = new Result<Yard>();
+        Result<Yard> result = new Result<>();
 
         Yard yardEntity = yardService.getById(yard.getId());
         if (yardEntity == null) {
             result.error500("未找到对应实体");
         } else {
             boolean ok = yardService.updateById(yard);
-//            YardPhoto yardPhoto = new YardPhoto();
-//            yardPhoto.setYardId(yard.getId());
-//            QueryWrapper photoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
-//            yardPhotoService.remove(photoQueryWrapper);
-//
-//            YardVideo yardVideo = new YardVideo();
-//            yardVideo.setYardId(yard.getId());
-//            QueryWrapper videoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
-//            yardVideoService.remove(videoQueryWrapper);
-//            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
-//                for (String url : yard.getImageUrl()) {
-//                    YardPhoto photo = new YardPhoto();
-//                    photo.setYardId(yard.getId());
-//                    photo.setPhotoUrl("http:" + url);
-//                    yardPhotoService.save(photo);
-//                }
-//            }
-//            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
-//                for (String url : yard.getVideoUrl()) {
-//                    YardVideo video = new YardVideo();
-//                    video.setYardId(yard.getId());
-//                    video.setVideoUrl("http:" + url);
-//                    yardVideoService.save(video);
-//                }
-//            }
-            //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");
             }
@@ -153,10 +93,10 @@ public class YardController {
                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                        HttpServletRequest req) {
-        Result<IPage<YardPhoto>> result = new Result<IPage<YardPhoto>>();
+        Result<IPage<YardPhoto>> result = new Result<>();
 
         QueryWrapper<YardPhoto> queryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, req.getParameterMap());
-        Page<YardPhoto> page = new Page<YardPhoto>(pageNo, pageSize);
+        Page<YardPhoto> page = new Page<>(pageNo, pageSize);
         IPage<YardPhoto> pageList = yardPhotoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -168,10 +108,10 @@ public class YardController {
                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                            HttpServletRequest req) {
-        Result<IPage<YardComment>> result = new Result<IPage<YardComment>>();
+        Result<IPage<YardComment>> result = new Result<>();
 
         QueryWrapper<YardComment> queryWrapper = QueryGenerator.initQueryWrapper(yardComment, req.getParameterMap());
-        Page<YardComment> page = new Page<YardComment>(pageNo, pageSize);
+        Page<YardComment> page = new Page<>(pageNo, pageSize);
         IPage<YardComment> pageList = yardCommentService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -180,7 +120,7 @@ public class YardController {
 
     @DeleteMapping(value = "/comment/delete")
     public Result<YardComment> deleteComment(@RequestParam(name = "id", required = true) String id) {
-        Result<YardComment> result = new Result<YardComment>();
+        Result<YardComment> result = new Result<>();
         YardComment yardComment = yardCommentService.getById(id);
         if (yardComment == null) {
             result.error500("未找到对应实体");
@@ -195,7 +135,7 @@ public class YardController {
 
     @DeleteMapping(value = "/video/delete")
     public Result<YardVideo> deleteVideo(@RequestParam(name = "id", required = true) String id) {
-        Result<YardVideo> result = new Result<YardVideo>();
+        Result<YardVideo> result = new Result<>();
         YardVideo yardVideo = yardVideoService.getById(id);
         if (yardVideo == null) {
             result.error500("未找到对应实体");
@@ -210,7 +150,7 @@ public class YardController {
 
     @DeleteMapping(value = "/photo/delete")
     public Result<YardPhoto> deletePhoto(@RequestParam(name = "id", required = true) String id) {
-        Result<YardPhoto> result = new Result<YardPhoto>();
+        Result<YardPhoto> result = new Result<>();
         YardPhoto yardPhoto = yardPhotoService.getById(id);
         if (yardPhoto == null) {
             result.error500("未找到对应实体");
@@ -225,7 +165,7 @@ public class YardController {
 
     @PostMapping(value = "/comment/add")
     public Result<YardComment> addComment(YardComment yardComment) {
-        Result<YardComment> result = new Result<YardComment>();
+        Result<YardComment> result = new Result<>();
         try {
             yardCommentService.save(yardComment);
             result.success("添加成功!");
@@ -238,7 +178,7 @@ public class YardController {
 
     @PostMapping(value = "/video/add")
     public Result<YardVideo> addVideo(YardVideo yardVideo) {
-        Result<YardVideo> result = new Result<YardVideo>();
+        Result<YardVideo> result = new Result<>();
         try {
             yardVideoService.save(yardVideo);
             result.success("添加成功!");
@@ -251,7 +191,7 @@ public class YardController {
 
     @PostMapping(value = "/photo/add")
     public Result<YardPhoto> addPhoto(YardPhoto yardPhoto) {
-        Result<YardPhoto> result = new Result<YardPhoto>();
+        Result<YardPhoto> result = new Result<>();
         try {
             yardPhotoService.save(yardPhoto);
             result.success("添加成功!");
@@ -267,10 +207,10 @@ public class YardController {
                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                        HttpServletRequest req) {
-        Result<IPage<YardVideo>> result = new Result<IPage<YardVideo>>();
+        Result<IPage<YardVideo>> result = new Result<>();
 
         QueryWrapper<YardVideo> queryWrapper = QueryGenerator.initQueryWrapper(yardVideo, req.getParameterMap());
-        Page<YardVideo> page = new Page<YardVideo>(pageNo, pageSize);
+        Page<YardVideo> page = new Page<>(pageNo, pageSize);
         IPage<YardVideo> pageList = yardVideoService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);

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

@@ -32,6 +32,7 @@ public class DramaInfo {
 	private Integer nonpublic;
 	private String introduction;
 	private Integer status;
+    private Integer enabled;
     /**
      * 场景
      */

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

@@ -1,100 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-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-04-22
- */
-@Data
-@TableName("ctop_edu_lesson_new")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_edu_lesson_new对象", description = "内部培训视频信息")
-public class EduLessonNew {
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.UUID)
-    @ApiModelProperty(value = "id")
-    private Integer id;
-    /**
-     * name
-     */
-    @Excel(name = "name", width = 15)
-    @ApiModelProperty(value = "name")
-    private String name;
-    /**
-     * 文件类型
-     */
-    @Excel(name = "文件类型", width = 15)
-    @ApiModelProperty(value = "文件类型")
-    private Integer fileType;
-    /**
-     * 节点类型
-     */
-    @Excel(name = "节点类型", width = 15)
-    @ApiModelProperty(value = "节点类型")
-    private Integer nodeType;
-    /**
-     * 父id
-     */
-    @Excel(name = "父id", width = 15)
-    @ApiModelProperty(value = "父id")
-    private Integer parentId;
-    /**
-     * author
-     */
-    @Excel(name = "author", width = 15)
-    @ApiModelProperty(value = "author")
-    private String author;
-    /**
-     * desc
-     */
-    @Excel(name = "desc", width = 15)
-    @ApiModelProperty(value = "desc")
-    private String desc;
-    /**
-     * fileId
-     */
-    @Excel(name = "fileId", width = 15)
-    @ApiModelProperty(value = "fileId")
-    private String fileId;
-    /**
-     * enabled
-     */
-    @Excel(name = "enabled", width = 15)
-    @ApiModelProperty(value = "enabled")
-    private Integer enabled;
-    /**
-     * createTime
-     */
-    @ApiModelProperty(value = "createTime")
-    private Date createTime;
-    /**
-     * updateTime
-     */
-    @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
-
-    public EduLessonNew() {
-        this.enabled = CtopAdConstant.COMMON_STATUS_ENABLED;
-        this.createTime = new Date();
-        this.updateTime = new Date();
-    }
-}

+ 1 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java

@@ -21,13 +21,6 @@ public class AccountBidJob implements Job {
      */
     @Override
     public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                bidWarningService.BidWarning();
-            }
-        };
-        thread.start();
-
+        bidWarningService.BidWarning();
     }
 }

+ 6 - 31
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java

@@ -1,6 +1,5 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.BigDecimalUtil;
 import cn.com.ctop.common.module.utils.Check;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -23,8 +22,6 @@ import java.util.concurrent.Executors;
 public class AccountCpaBidJob implements Job {
     @Autowired
     private ICpaBidWarningService cpaBidWarningService;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
     static ExecutorService executorService = null;
     @Autowired
     private IProjectService projectService;
@@ -37,33 +34,11 @@ public class AccountCpaBidJob implements Job {
      */
     @Override
     public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-
-
-            @Override
-            public void run() {
-                executorService = Executors.newFixedThreadPool(4);
-                QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
-                List<Project> projects = projectService.list(queryWrapper);
-                if (!Check.isNull(projects)) {
-                    for (Project project : projects) {
-                        if (BigDecimalUtil.compareToDecimal(project.getMaxDeepCpaBid(), new BigDecimal(0)) <= 0) {
-                            continue;
-                        }
-                        executorService.submit(new Runnable() {
-                            @Override
-                            public void run() {
-                                cpaBidWarningService.CpaBidWarning(project);
-                            }
-
-                        });
-                    }
-                    executorService.shutdown();
-
-                }
-            }
-        };
-        thread.start();
-
+        executorService = Executors.newFixedThreadPool(4);
+        QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
+        List<Project> projects = projectService.list(queryWrapper);
+        if (!Check.isNull(projects)) {
+            projects.stream().filter(project -> BigDecimalUtil.compareToDecimal(project.getMaxDeepCpaBid(), new BigDecimal(0)) <= 0).forEach(project -> executorService.submit(() -> cpaBidWarningService.CpaBidWarning(project)));
+        }
     }
 }

+ 4 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.modules.ctop.service.ICleanMaterialService;
 import org.quartz.Job;
@@ -17,7 +18,7 @@ import java.util.concurrent.Executors;
 @Slf4j
 public class ByteDanceCleanMaterialJob implements Job {
     @Autowired
-    private ICleanMaterialService cleanMaterialService;
+    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
     static ExecutorService executorService = null;
 
     @Override
@@ -25,7 +26,7 @@ public class ByteDanceCleanMaterialJob implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                List<String> signatureList = cleanMaterialService.getByteDanceSignature();
+                List<String> signatureList = byteDanceCleanMaterialReportService.getSignature();
                 if (Check.isNull(signatureList)) {
                     log.error("头条素材数据获取为空");
                     return;
@@ -36,7 +37,7 @@ public class ByteDanceCleanMaterialJob implements Job {
                     executorService.submit(new Runnable() {
                         @Override
                         public void run() {
-                            cleanMaterialService.calculationByteDanceReport(signature);
+                            byteDanceCleanMaterialReportService.calculationMaterialReport(signature);
                         }
                     });
                 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IByteDanceHourlyAccountWarningService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IByteDanceHourlyAccountWarningService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 3 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -29,27 +29,16 @@ public class BytedanceAdvertiserDailyReportLoadJob implements Job {
     private IReportService reportService;
     static ExecutorService executorService = null;
 
-
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         Date getDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
+        if (null == tokens || tokens.isEmpty()) {
             log.info("定时获取头条数据异常:为获取到可用的token");
             return;
         }
         executorService = Executors.newFixedThreadPool(5);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    //获取广告主信息数据
-                    reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-                }
-            });
-        });
+        tokens.forEach(token -> executorService.submit(() -> reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY)));
     }
-
-
 }

+ 10 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java

@@ -3,8 +3,8 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
@@ -38,24 +38,14 @@ public class BytedanceAdvertiserDataLoadJob implements Job {
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         executorService = Executors.newFixedThreadPool(5);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        //1:获取当日广告组数据
-                        advertiserDataService.getAdvertiserCampaign(token.getAccountId() + "", "", dateString);
-                        //2:获取当日广告计划数据
-                        advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
-                        //3:获取当日创意数据
-                        creativeService.getAdvertiserCreative(token.getAccountId() + "", "", dateString);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                    }
-                }
-            });
-        });
+        tokens.forEach(token -> executorService.submit(() -> {
+            //1:获取当日广告组数据
+            advertiserDataService.getAdvertiserCampaign(token.getAccountId() + "", "", dateString);
+            //2:获取当日广告计划数据
+            advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
+            //3:获取当日创意数据
+            creativeService.getAdvertiserCreative(token.getAccountId() + "", "", dateString);
+        }));
         log.info("物料数据同步完成");
     }
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 4 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyAccountReportAsyncJob.java

@@ -1,8 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -10,11 +10,8 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 /**
  * 头条素材报表按天跑前一天的数据任务
@@ -33,19 +30,15 @@ public class BytedanceDailyAccountReportAsyncJob implements Job {
 
         Date getDate = DateUtils.addDay(new Date(), -1);
         String date = DateUtils.formatDate(getDate);
-        log.info("头条异步广告主报表执行开始。跑的是:"+ date + "的数据");
+        log.info("头条异步广告主报表执行开始。跑的是:" + date + "的数据");
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         if (null == tokens || tokens.size() <= 0) {
             log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
-            return ;
+            return;
         }
 
         for (CtopOauthToken token : tokens) {
-            try {
-                bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 2);  //1.创意 2.广告主 3.广告主 4.广告计划
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
+            bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 2);  //1.创意 2.广告主 3.广告主 4.广告计划
         }
 
     }

+ 4 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyCampaignReportAsyncJob.java

@@ -1,8 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -10,7 +10,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 
@@ -31,19 +30,15 @@ public class BytedanceDailyCampaignReportAsyncJob implements Job {
 
         Date getDate = DateUtils.addDay(new Date(), -1);
         String date = DateUtils.formatDate(getDate);
-        log.info("头条异步广告组报表数据执行开始,跑的是"+ date + "的数据");
+        log.info("头条异步广告组报表数据执行开始,跑的是" + date + "的数据");
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         if (null == tokens || tokens.size() <= 0) {
             log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
-            return ;
+            return;
         }
 
         for (CtopOauthToken token : tokens) {
-            try {
-                bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 3);  //1.创意 2.广告主 3.广告组 4.广告计划
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
+            bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 3);  //1.创意 2.广告主 3.广告组 4.广告计划
         }
 
     }

+ 5 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyCreativeReportAsyncJob.java

@@ -1,8 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -10,7 +10,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 
@@ -32,18 +31,15 @@ public class BytedanceDailyCreativeReportAsyncJob implements Job {
         Date getDate = DateUtils.addDay(new Date(), -1);
         String date = DateUtils.formatDate(getDate);
         log.info("头条创意报表异步任务执行开始.跑的是" + date + "的数据");
-     List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         if (null == tokens || tokens.size() <= 0) {
             log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
-            return ;
+            return;
         }
 
         for (CtopOauthToken token : tokens) {
-            try {
-                bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 1);  //1.创意 2.广告主 3.广告主 4.广告计划
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
+            //1.创意 2.广告主 3.广告主 4.广告计划
+            bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 1);
         }
 
     }

+ 1 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java

@@ -1,9 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 3 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java

@@ -1,17 +1,15 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.entity.BytedanceReportMaterialRetry;
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialRetry;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -42,7 +40,7 @@ public class BytedanceDailyMaterialReportRetryJob implements Job {
                     try {
                         CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(retry.getAccountId()));
                         log.info("头条素材报表重试定时任务,当前accountId为:" + token.getAccountId());
-                        bytedanceReportService.bytedanceMaterialReportRetry(token,retry.getStartDate(),retry.getEndDate());
+                        bytedanceReportService.bytedanceMaterialReportRetry(token, retry.getStartDate(), retry.getEndDate());
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {
@@ -50,7 +48,5 @@ public class BytedanceDailyMaterialReportRetryJob implements Job {
                 }
             });
         });
-        ////
-
     }
 }

+ 3 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyPlanReportAsyncJob.java

@@ -1,8 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -10,7 +10,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 
@@ -36,15 +35,11 @@ public class BytedanceDailyPlanReportAsyncJob implements Job {
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         if (null == tokens || tokens.size() <= 0) {
             log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
-            return ;
+            return;
         }
 
         for (CtopOauthToken token : tokens) {
-            try {
-                bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 4);  //1.创意 2.广告主 3.广告组 4.广告计划
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
+            bytedanceReportService.bytedanceAsyncTaskCreate(date, date, token, 4);  //1.创意 2.广告主 3.广告组 4.广告计划
         }
 
     }

+ 1 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyReportAsyncTaskGetJob.java

@@ -1,19 +1,12 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-
 /**
  * 头条素材报表按天跑前一天的数据任务
  *

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java

@@ -3,7 +3,7 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;

+ 7 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java

@@ -1,13 +1,13 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
-import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.entity.BytedancePlanDailyReport;
+import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
+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;
@@ -22,6 +22,7 @@ import java.util.List;
 
 /**
  * 头条计划日报数据任务
+ * @author 宋英豪
  */
 @Slf4j
 public class BytedancePlanDailyReportLoadJob implements Job {
@@ -31,6 +32,9 @@ public class BytedancePlanDailyReportLoadJob implements Job {
     private IReportService reportService;
     @Autowired
     private IUserAllocationService userAllocationService;
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
+
 
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
@@ -101,7 +105,4 @@ public class BytedancePlanDailyReportLoadJob implements Job {
             });
         }
     }
-
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
 }

+ 5 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java

@@ -1,10 +1,10 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -28,10 +28,13 @@ public class BytedancePlanHourlyReportLoadJob implements Job {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IReportService reportService;
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
     static ExecutorService executorService = null;
     //线程计数器
     static CountDownLatch countDownLatch = null;
 
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         log.info("头条时报数据获取开始");
@@ -75,7 +78,4 @@ public class BytedancePlanHourlyReportLoadJob implements Job {
         log.info("头条计划时报数据获取完成");
         executorService.shutdown();
     }
-
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java

@@ -3,8 +3,8 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java

@@ -3,7 +3,7 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java

@@ -3,7 +3,7 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java

@@ -31,8 +31,6 @@ public class DailyFlowsJob implements Job {
             for (CtopOauthToken ctopOauthToken : tokens) {
                 kuaishouInterfaceService.getDailyFlows(ctopOauthToken);
             }
-
         }
-
     }
 }

+ 0 - 69
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java

@@ -1,87 +1,18 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.common.module.utils.HttpUtils;
-import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeCompany;
-import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeProduct;
-import cn.com.ctop.crawler.modules.dataeye.service.DataeyeCompanyService;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeMediaService;
-import cn.com.ctop.crawler.modules.dataeye.service.DataeyeProductService;
-import cn.com.ctop.crawler.modules.dataeye.service.impl.DataeyeProductServiceImpl;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.Iterator;
-import java.util.List;
-
 @Slf4j
 public class DataeyeJob implements Job {
     @Autowired
-    private DataeyeCompanyService dataeyeCompanyService;
-    @Autowired
-    private DataeyeProductService dataeyeProductService;
-    @Autowired
     private DataeyeMediaService dataeyeMediaService;
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         dataeyeMediaService.getMediaList();
-//        List<DataeyeCompany> list = dataeyeCompanyService.list();
-//        if (list != null && list.size() > 0){
-//            for(DataeyeCompany dataeyeCompany : list){
-//                try {
-//                    String result = HttpUtils.httpPostFormRequest("https://blzs.dataeye.com/company/listProductDistribution?companyId="+dataeyeCompany.getCompanyId(),null,null);
-//                    ObjectMapper mapper = new ObjectMapper();
-//                    mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-//                    JsonNode rootNode = mapper.readTree(result);
-//                    int statusCode = rootNode.get("statusCode").asInt();
-//                    if (statusCode == 200) {
-//                        Iterator<JsonNode> nodes = rootNode.get("content").elements();
-//                        while (nodes.hasNext()){
-//                            JsonNode node = nodes.next();
-//                            Long productId = node.get("id").asLong();
-//                            dataeyeProductService.getProductInfo(dataeyeCompany.getCompanyId(),productId);
-//                        }
-//                    }
-//                }catch (Exception e){
-//                    e.printStackTrace();
-//                }
-//            }
-//        }
-//        int pageId=1;
-//        while(pageId <= 100){
-//            try {
-//                System.out.println("pageId:"+pageId);
-//                String result = HttpUtils.httpPostFormRequest("https://blzs.dataeye.com/ranking/listCompanyRanking?type=all&pageId="+pageId+"&pageSize=10&mediaId&playRuleId&themeId&searchKey&days=90&top=500",null,null);
-//                ObjectMapper mapper = new ObjectMapper();
-//                mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-//                JsonNode rootNode = mapper.readTree(result);
-//                int statusCode = rootNode.get("statusCode").asInt();
-//                if (statusCode == 200){
-//                    Iterator<JsonNode> nodes = rootNode.get("content").elements();
-//                    while (nodes.hasNext()){
-//                        JsonNode node = nodes.next();
-//                        int companyId = node.get("companyId").asInt();
-//                        System.out.println(companyId);
-//                        dataeyeCompanyService.getCompanyInfo(companyId);
-//                    }
-//
-//                }
-//            }catch (Exception e){
-//
-//            }
-//            pageId++;
-//        }
-//        for (int i = 3528; i < 1000000; i++){
-//            try {
-//                dataeyeProductService.getProductInfo(i);
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//            }
-//        }
     }
 }

+ 0 - 36
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/EffiVideoJob.java

@@ -1,36 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.system.service.IPerformanceService2;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-@Slf4j
-public class EffiVideoJob implements Job {
-    @Autowired
-    private IPerformanceService2 performanceService;
-
-    /**
-     * 获取有效视频以及对应人的定时任务
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        //有效视频定时任务,默认跑前一天的
-        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        String calcDate = sdf.format(DateUtils.addDay(new Date(), -1));
-        log.info("有效视频定时任务开始执行,有效视频所属时间为" + calcDate);
-        performanceService.efficientVideoTask(sdf.format(DateUtils.addDay(new Date(), -1)));
-        log.info("有效视频定时任务结束");
-    }
-}

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

@@ -18,26 +18,11 @@ public class KuaishouAdvertiserCrawlerJob implements Job {
 
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        try {
-
-            Thread thread = new Thread() {
-                @Override
-                public void run() {
-                    List<KuaishouAdAccount> list = kuaishouAdAccountService.querySyncAccount();
-                    if (list != null) {
-                        for (KuaishouAdAccount account : list) {
-                            kuaishouAppService.adAccountFetch(account, "");
-                        }
-                    }
-                }
-
-
-            };
-            thread.start();
-
-
-        } catch (Exception e) {
-            e.printStackTrace();
+        List<KuaishouAdAccount> list = kuaishouAdAccountService.querySyncAccount();
+        if (list != null) {
+            for (KuaishouAdAccount account : list) {
+                kuaishouAppService.adAccountFetch(account, "");
+            }
         }
     }
 }

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java

@@ -24,8 +24,6 @@ public class KuaishouCampaignJob implements Job {
 
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
         Thread thread = new Thread() {
             @Override
             public void run() {

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java

@@ -28,7 +28,7 @@ public class KuaishouCommentAutoDelete implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<BindAccountLogin>();
+                QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
                 queryWrapper.eq("login_type", "kuaishou");
                 queryWrapper.eq("status", 1);
                 List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
@@ -46,7 +46,7 @@ public class KuaishouCommentAutoDelete implements Job {
                             } else {
                                 log.info("error,删除评论调用shell脚本执行失败");
                             }
-                            Thread.sleep(5 * 1000);
+                            Thread.sleep(5 * 1000L);
                         } catch (Exception e) {
                             e.printStackTrace();
                         }

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java

@@ -53,4 +53,15 @@ public class KuaishouCrawlerJob implements Job {
             e.printStackTrace();
         }
     }
+
+    public static void main(String[] args) {
+        for (int i = 0; i < 100; i++) {
+            System.out.println(i);
+            try {
+                System.out.println(1 / 0);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
 }

+ 2 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java

@@ -30,9 +30,8 @@ public class MergeVideoJob implements Job {
         List<VideoMergeTask> list = videoMergeTaskService.list(queryWrapper);
         if (list != null && list.size() > 0) {
             for (VideoMergeTask videoMergeTask : list) {
-                MpsUtils mpsUtils = new MpsUtils();
-                QueryJobListResponse.Job job = mpsUtils.getJobStatus(videoMergeTask.getJobId());
-                if (job.getState().equals("TranscodeSuccess")) {
+                QueryJobListResponse.Job job = MpsUtils.getJobStatus(videoMergeTask.getJobId());
+                if ("TranscodeSuccess".equals(job.getState())) {
                     String url = "https://ctop-part.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
 
                     try {

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java

@@ -316,13 +316,13 @@ public class OceanengineJob implements Job {
                 FateadmUtil fateadmUtil = new FateadmUtil();
                 fateadmUtil.init();
                 if (orderId != null) {
-                    fateadmUtil.Justice(orderId);
+                    fateadmUtil.justice(orderId);
                 }
                 String captcha = jsonNode.get("captcha").asText();
                 Base64.Decoder decoder = Base64.getDecoder();
                 FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400", decoder.decode(captcha));
-                param.put("captcha", resp.pred_resl);
-                orderId = resp.req_id;
+                param.put("captcha", resp.predResl);
+                orderId = resp.reqId;
                 res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
                 jsonNode = mapper.readTree(res);
                 errorCode = jsonNode.get("error_code").asInt();

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/RefreshTokenJob.java

@@ -1,6 +1,6 @@
 package org.jeecg.modules.ctop.job;
 
-import org.jeecg.modules.ctop.service.IRefreshTokenService;
+import cn.com.ctop.common.module.service.IRefreshTokenService;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;

+ 0 - 42
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TestJob.java

@@ -1,42 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxOptions;
-import org.openqa.selenium.firefox.GeckoDriverService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-import java.io.File;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author jeecg-boot
- */
-public class TestJob implements Job {
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        System.setProperty("webdriver.gecko.driver", "/usr/lib/geckodriver");
-        GeckoDriverService service = new GeckoDriverService.Builder().usingDriverExecutable(new File("/usr/lib/geckodriver")).usingAnyFreePort().build();
-        FirefoxOptions options = new FirefoxOptions();
-        options.addArguments("--headless");
-        options.addArguments("--incognito");
-        options.addArguments("--no-sandbox");
-        options.addArguments("--disable-gpu");
-        options.addArguments("--window-size=1290,1080");
-        WebDriver driver = new FirefoxDriver(options);
-        try {
-            driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);
-            driver.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
-            driver.get("http://b.e.kuaishou.com");
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            driver.quit();
-            service.stop();
-        }
-
-
-    }
-}

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedanceReportService;
+
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 23 - 35
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java

@@ -15,7 +15,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.io.IOException;
 import java.util.List;
 
 public class WatermarkVideoJob implements Job {
@@ -26,43 +25,32 @@ public class WatermarkVideoJob implements Job {
 
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                QueryWrapper<VideoWatermarkTask> queryWrapper = new QueryWrapper<>();
-                queryWrapper.in("status", "Submitted", "Transcoding");
-                List<VideoWatermarkTask> list = videoWaterMarkService.list(queryWrapper);
-                if (list != null && list.size() > 0) {
-                    for (VideoWatermarkTask videoWatermarkTask : list) {
-                        QueryJobListResponse.Job job = MpsUtils.getJobStatus(videoWatermarkTask.getJobId());
-                        if (job.getState().equals("TranscodeSuccess")) {
-                            String url = "https://ctop-media.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
+        QueryWrapper<VideoWatermarkTask> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("status", "Submitted", "Transcoding");
+        List<VideoWatermarkTask> list = videoWaterMarkService.list(queryWrapper);
+        if (list != null && !list.isEmpty()) {
+            for (VideoWatermarkTask videoWatermarkTask : list) {
+                QueryJobListResponse.Job job = MpsUtils.getJobStatus(videoWatermarkTask.getJobId());
+                if ("TranscodeSuccess".equals(job.getState())) {
+                    String url = "https://ctop-media.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
+                    String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
+                    LoadFileUtil.delFile(localPath);
+                    QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
+                    materialInfoQueryWrapper.eq("watermark_code", job.getJobId());
+                    MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
+                    if (Check.isNull(materialInfo)) {
+                        videoWaterMarkService.removeById(videoWatermarkTask.getId());
+                        continue;
 
-                            try {
-                                String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-                                LoadFileUtil.delFile(localPath);
-                                QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
-                                materialInfoQueryWrapper.eq("watermark_code", job.getJobId());
-                                MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
-                                if (Check.isNull(materialInfo)) {
-                                    videoWaterMarkService.removeById(videoWatermarkTask.getId());
-                                    continue;
-
-                                }
-                                materialInfo.setWatermarkUrl(url);
-                                materialInfoService.saveOrUpdate(materialInfo);
-                                videoWatermarkTask.setVideoUrl(url);
-                                videoWatermarkTask.setStatus(job.getState());
-                                videoWatermarkTask.setVideoId(materialInfo.getId());
-                                videoWaterMarkService.updateById(videoWatermarkTask);
-                            } catch (IOException e) {
-                                e.printStackTrace();
-                            }
-                        }
                     }
+                    materialInfo.setWatermarkUrl(url);
+                    materialInfoService.saveOrUpdate(materialInfo);
+                    videoWatermarkTask.setVideoUrl(url);
+                    videoWatermarkTask.setStatus(job.getState());
+                    videoWatermarkTask.setVideoId(materialInfo.getId());
+                    videoWaterMarkService.updateById(videoWatermarkTask);
                 }
             }
-        };
-        thread.start();
+        }
     }
 }

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

@@ -1,17 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.ByteDanceCleanMaterialReport;
-import org.jeecg.modules.ctop.entity.KuaiShouCleanMaterialReport;
-
-import java.util.List;
-
-public interface CleanMaterialMapper {
-    List<String> getSignatureList();
-
-    KuaiShouCleanMaterialReport calculationMaterialReport(@Param("signature") String signature);
-
-    List<String> getByteDanceSignatureList();
-
-    ByteDanceCleanMaterialReport calculationByteDanceMaterialReport(String signature);
-}

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

@@ -1,15 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.EduLessonNew;
-
-/**
- * 内部培训视频信息
- *
- * @author: jeecg-boot
- * @date: 2020-04-22
- * @cersion: V1.0
- */
-public interface EduLessonNewMapper extends BaseMapper<EduLessonNew> {
-
-}

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

@@ -1,5 +0,0 @@
-<?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.ByteDanceCleanMaterialReportMapper">
-
-</mapper>

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

@@ -1,51 +0,0 @@
-<?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.CleanMaterialMapper">
-    <select id="getSignatureList" resultType="java.lang.String">
-    SELECT
-      DISTINCT(signature)
-      from ctop_kuaishou_report_daily_creative
-      WHERE signature !=''
-    </select>
-
-    <select id="calculationMaterialReport" resultType="org.jeecg.modules.ctop.entity.KuaiShouCleanMaterialReport">
-        select
-        signature id,
-        sum(charge) charge,
-        sum(photo_show) photoShow,
-        sum(photo_click) photoClick,
-        sum(aclick) aclick,
-        sum(bclick) bclick,
-        sum(activation) activation,
-        sum(form_count) formCount
-        from ctop_kuaishou_report_daily_creative
-        where
-        signature = #{signature}
-    </select>
-
-
-    <select id="getByteDanceSignatureList" resultType="java.lang.String">
-    SELECT
-      DISTINCT(signature)
-      from ctop_bytedance_report_creative_daily
-      WHERE signature !=''
-    </select>
-
-    <select id="calculationByteDanceMaterialReport" resultType="org.jeecg.modules.ctop.entity.ByteDanceCleanMaterialReport">
-        select
-        signature id,
-        sum(cost) cost,
-        sum(show_num) showNum,
-        sum(click) click,
-        sum(convert_num) convertNum,
-        sum(active) active,
-        sum(register) register,
-        sum(form) form,
-        sum(total_play) totalPlay,
-        sum(valid_play) validPlay
-        from ctop_bytedance_report_creative_daily
-        where
-        signature = #{signature}
-    </select>
-
-</mapper>

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


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません