Sfoglia il codice sorgente

2022-9-28 14:33:00 分析系统提交代码

沈永艺 3 anni fa
parent
commit
eea8f07894

+ 76 - 183
PAS/src/main/java/cn/cslg/pas/common/utils/DateUtils.java

@@ -13,25 +13,18 @@ import java.util.regex.Pattern;
 
 public class DateUtils {
 
-    public static final String STARTTIME = " 00:00:00";
-    public static final String ENDTIME = " 23:59:59";
+    public static final String START_TIME = " 00:00:00";
+    public static final String END_TIME = " 23:59:59";
     public final static String FORMAT_STRING = "yyyy-MM-dd HH:mm:ss";
     public final static String[] REPLACE_STRING = new String[]{"GMT+0800", "GMT+08:00"};
     public final static String SPLIT_STRING = "(中国标准时间)";
     public static Logger log = LoggerFactory.getLogger(DateUtils.class);
-
     public static String YYYY = "yyyy";
-
     public static String YYYY_MM = "yyyy-MM";
-
     public static String YYYY_MM_DD = "yyyy-MM-dd";
-
     public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
-
     public static String YYYYMMDD = "yyyyMMdd";
-
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
-
     private static String[] parsePatterns = {
             "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
             "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
@@ -40,18 +33,23 @@ public class DateUtils {
     public static String getDateSourceName(Date startTime, Date endTime, Integer offset, Integer index) {
         String ret = null;
         switch (offset) {
+            //月份
             case -1:
                 ret = DateUtil.format(startTime, "yyyy-MM");
                 break;
+            //季度
             case -3:
                 ret = String.format("%s-Q%s", DateUtil.format(startTime, "yyyy"), (index % 4) + 1);
                 break;
+            //半年
             case -6:
                 ret = String.format("%s-%s", DateUtil.format(startTime, "yyyy"), index % 2 == 0 ? "H1" : "H2");
                 break;
+            //1年
             case -12:
                 ret = DateUtil.format(startTime, "yyyy");
                 break;
+            //2年,3年,5年
             case -24:
             case -36:
             case -60:
@@ -92,13 +90,11 @@ public class DateUtils {
 
     /**
      * 获取现在的时间 yyyy-MM-dd HH:mm:ss
-     *
-     * @return
      */
     public static String getNowTime() {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Date date = new Date(System.currentTimeMillis());
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
@@ -125,14 +121,13 @@ public class DateUtils {
     }
 
     /**
-     * @return
      * @author 陌溪
      * @date 2018年6月14日
      */
     public static String getNowTimeFormat(String format) {
-        SimpleDateFormat formate = new SimpleDateFormat(format);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
         Date date = new Date(System.currentTimeMillis());
-        return formate.format(date);
+        return simpleDateFormat.format(date);
     }
 
 
@@ -140,8 +135,7 @@ public class DateUtils {
         try {
             dateString = dateString.split(Pattern.quote(SPLIT_STRING))[0].replace(REPLACE_STRING[0], REPLACE_STRING[1]);
             SimpleDateFormat sf1 = new SimpleDateFormat("E MMM dd yyyy HH:mm:ss z", Locale.US);
-            Date date = sf1.parse(dateString);
-            return date;
+            return sf1.parse(dateString);
         } catch (Exception e) {
             throw new RuntimeException("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
         }
@@ -162,8 +156,7 @@ public class DateUtils {
                 sf1 = new SimpleDateFormat("yyyyMMdd");
             }
 
-            Date date = sf1.parse(dateString);
-            return date;
+            return sf1.parse(dateString);
         } catch (Exception e) {
             throw new RuntimeException("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
         }
@@ -171,111 +164,87 @@ public class DateUtils {
 
     /**
      * 获取今天开始的时间
-     *
-     * @return
      */
     public static String getToDayStartTime() {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Date date = new Date(System.currentTimeMillis());
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
      * 获取今天结束的时间
-     *
-     * @return
      */
     public static String getToDayEndTime() {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
         Date date = new Date(System.currentTimeMillis());
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
      * 获取昨天开始的时间
-     *
-     * @return
      */
-    public static String getYestodayStartTime() {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+    public static String getYesterdayStartTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Date date = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000L);
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
      * 获取昨天结束的时间
-     *
-     * @return
      */
-    public static String getYestodayEndTime() {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+    public static String getYesterdayEndTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
         Date date = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000L);
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
      * 获取某天开始的时间
-     *
-     * @return
      */
     public static String getOneDayStartTime(String oneDay) {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Date date = new Date(oneDay);
-        return formate.format(date);
+        return format.format(oneDay);
     }
 
     /**
      * 获取某天开始的日期
-     *
-     * @param oneDay
-     * @return
      */
     public static String getOneDayStartTime(Date oneDay) {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-        return formate.format(oneDay);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(oneDay);
     }
 
     /**
      * 获取某天结束的时间
-     *
-     * @return
      */
     public static String getOneDayEndTime(String oneDay) {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Date date = new Date(oneDay);
-        return formate.format(date);
+        return format.format(date);
     }
 
     /**
      * 获取某天结束的日期
-     *
-     * @param oneDay
-     * @return
      */
     public static String getOneDayEndTime(Date oneDay) {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-        return formate.format(oneDay);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(oneDay);
     }
 
-
     /**
      * 获取本周开始的时间
-     *
-     * @return
      */
     public static Date getWeekStartTime() {
-        // 获得本周一0点时间
+        //获得本周一0点时间
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
         return cal.getTime();
     }
 
     /**
-     * 将  String 转换成  date
-     *
-     * @param dateTime
-     * @return
+     * 将 String 转换成 Date
      */
     public static Date strToDateTime(String dateTime) {
         Date date = null;
@@ -288,6 +257,9 @@ public class DateUtils {
         return date;
     }
 
+    /**
+     * 将 String 转换成 Date (转换格式可传入)
+     */
     public static Date strToDateTime(String dateTime, String fmt) {
         Date date = null;
         try {
@@ -300,26 +272,18 @@ public class DateUtils {
     }
 
     /**
-     * 将  date 转换成  时间戳
-     *
-     * @return
+     * 将 Date 转换成时间戳
      */
     public static Long dateToStamp(String s) throws ParseException {
-
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Date date = simpleDateFormat.parse(s);
-        long ts = date.getTime();
-        return ts;
+        return date.getTime();
     }
 
     /**
-     * Date 转换成  String
-     *
-     * @param dateTime
-     * @return
+     * 将 Date 转换成 String
      */
     public static String dateTimeToStr(Date dateTime) {
-
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         return format.format(dateTime);
     }
@@ -332,22 +296,18 @@ public class DateUtils {
 
     /**
      * 获取本周开始的时间的字符串
-     *
-     * @return
      */
     public static String getWeekStartTimeStr() {
-        // 获得本周一0点时间
+        //获得本周一0点时间
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-        return formate.format(cal.getTime());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(cal.getTime());
     }
 
     /**
      * 获取本周结束的时间
-     *
-     * @return
      */
     public static Date getWeekEndTime() {
         Calendar cal = Calendar.getInstance();
@@ -358,21 +318,17 @@ public class DateUtils {
 
     /**
      * 获取本周结束的时间的字符串
-     *
-     * @return
      */
     public static String getWeekEndTimeStr() {
         Calendar cal = Calendar.getInstance();
         cal.setTime(getWeekStartTime());
         cal.add(Calendar.DAY_OF_WEEK, 7);
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
-        return formate.format(cal.getTime());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
     }
 
     /**
      * 获取上周开始的时间的字符串
-     *
-     * @return
      */
     public static String getLastWeekStartTimeStr() {
         int weeks = -1;
@@ -380,43 +336,37 @@ public class DateUtils {
         GregorianCalendar currentDate = new GregorianCalendar();
         currentDate.add(GregorianCalendar.DATE, mondayPlus + 7 * weeks);
         Date monday = currentDate.getTime();
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-        return formate.format(monday);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(monday);
     }
 
     /**
      * 获取本月开始的时间
-     *
-     * @return
      */
     public static Date getMonthStartTime() {
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
         return cal.getTime();
     }
 
     /**
      * 获取本月开始的时间的字符串
-     *
-     * @return
      */
     public static String getMonthStartTimeStr() {
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
-        return formate.format(cal.getTime());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
     }
 
     /**
      * 获取本月结束的时间
-     *
-     * @return
      */
     public static Date getMonthEndTime() {
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
         cal.set(Calendar.HOUR_OF_DAY, 24);
         return cal.getTime();
@@ -424,16 +374,14 @@ public class DateUtils {
 
     /**
      * 获取本月结束的时间的字符串
-     *
-     * @return
      */
     public static String getMonthEndTimeStr() {
         Calendar cal = Calendar.getInstance();
-        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
         cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
         cal.set(Calendar.HOUR_OF_DAY, 24);
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
-        return formate.format(cal.getTime());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
     }
 
     /**
@@ -443,53 +391,40 @@ public class DateUtils {
         Calendar a = Calendar.getInstance();
         a.set(Calendar.DATE, 1);
         a.roll(Calendar.DATE, -1);
-        int maxDate = a.get(Calendar.DATE);
-        return maxDate;
+        return a.get(Calendar.DATE);
     }
 
     /**
      * 得到二个日期间的间隔天数
-     *
-     * @param date1
-     * @param date2
-     * @return
      */
     public static int getDayByTwoDay(String date1, String date2) {
         SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
-        Long day = 0L;
+        long day;
         try {
             Date date = myFormatter.parse(date1);
-            Date mydate = myFormatter.parse(date2);
-            day = (date.getTime() - mydate.getTime()) / (24 * 60 * 60 * 1000);
+            Date myDate = myFormatter.parse(date2);
+            day = (date.getTime() - myDate.getTime()) / (24 * 60 * 60 * 1000);
         } catch (Exception e) {
             return 0;
         }
-        return day.intValue();
+        return (int) day;
     }
 
     /**
      * 得到两个日期相差的秒数
-     *
-     * @param lastDate
-     * @param date
-     * @return
      */
     public static int getSecondByTwoDay(Date lastDate, Date date) {
-        Long second = 0L;
+        long second;
         try {
             second = (lastDate.getTime() - date.getTime()) / 1000;
         } catch (Exception e) {
             return 0;
         }
-        return second.intValue();
+        return (int) second;
     }
 
     /**
      * 判断某个日期属于本周的第几天 (星期一代表第一天)
-     *
-     * @param dateTime
-     * @return
-     * @throws ParseException
      */
     public static int getDaysByWeek(String dateTime) throws ParseException {
         Calendar cal = Calendar.getInstance();
@@ -506,63 +441,48 @@ public class DateUtils {
 
     /**
      * 判断某个日期属于本月的第几天
-     *
-     * @param dateTime
-     * @return
-     * @throws ParseException
      */
     public static int getDaysByMonth(String dateTime) throws ParseException {
         Calendar cal = Calendar.getInstance();
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date date = dateFormat.parse(dateTime);
         cal.setTime(date);
-        int day = cal.get(Calendar.DAY_OF_MONTH);
-        return day;
+        return cal.get(Calendar.DAY_OF_MONTH);
     }
 
     /**
      * 根据年 月 获取对应的月份 天数
      */
     public static int getDaysByYearMonth(int year, int month) {
-
         Calendar a = Calendar.getInstance();
         a.set(Calendar.YEAR, year);
         a.set(Calendar.MONTH, month - 1);
         a.set(Calendar.DATE, 1);
         a.roll(Calendar.DATE, -1);
-        int maxDate = a.get(Calendar.DATE);
-        return maxDate;
+        return a.get(Calendar.DATE);
     }
 
 
     /**
      * 获取当前的年
-     *
-     * @return
      */
     public static Integer getYears() {
         Calendar calendar = new GregorianCalendar(TimeZone
                 .getDefault());
         return calendar.get(Calendar.YEAR);
-
     }
 
     /**
      * 获取当前的月
-     *
-     * @return
      */
     public static Integer getMonth() {
         Calendar calendar = new GregorianCalendar(TimeZone
                 .getDefault());
         return calendar.get(Calendar.MONTH) + 1;
-
     }
 
     /**
      * 获取当前天
-     *
-     * @return
      */
     public static Integer getDay() {
         Calendar calendar = new GregorianCalendar(TimeZone
@@ -572,24 +492,16 @@ public class DateUtils {
 
     /**
      * wx支付的过期时间
-     *
-     * @param hour
-     * @return
      */
-    @SuppressWarnings("unused")
     public static String getTime(double hour) {
-        Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
         long time = (long) (System.currentTimeMillis() + hour * 60 * 60 * 1000L);
         Date date = new Date(time);
-        SimpleDateFormat formate = new SimpleDateFormat("yyyyMMddHHmmss");
-        String format = formate.format(date);
-        return format;
+        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+        return format.format(date);
     }
 
     /**
      * 获得当前日期与本周日相差的天数
-     *
-     * @return
      */
     private static int getMondayPlus() {
         Calendar cd = Calendar.getInstance();
@@ -608,18 +520,16 @@ public class DateUtils {
      *
      * @param date yyyy-MM-dd HH:mm:ss
      * @param day  加减的天数
-     * @return
      */
     public static Date getDate(String date, int day) {
-        SimpleDateFormat formate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar cal = Calendar.getInstance();
+        Date beforeDate;
         try {
-            Date beforeDate = formate.parse(date);
+            beforeDate = format.parse(date);
             cal.setTime(beforeDate);
             cal.add(Calendar.DAY_OF_MONTH, day);
-            //cal.set(beforeDate.getYear(), beforeDate.getMonth(), beforeDate.getDay()+day, beforeDate.getHours(),beforeDate.getSeconds(), beforeDate.getMinutes());
-            Date newDate = cal.getTime();
-            return newDate;
+            return cal.getTime();
         } catch (ParseException e) {
             e.printStackTrace();
         }
@@ -631,7 +541,6 @@ public class DateUtils {
      *
      * @param beforeDate yyyy-MM-dd HH:mm:ss
      * @param timeSecond 加减的秒数
-     * @return
      */
     public static String getDateStr(Date beforeDate, Long timeSecond) {
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -647,22 +556,17 @@ public class DateUtils {
 
     /**
      * 把date转换成字符串
-     *
-     * @param date
-     * @param code 例如  yyyy-MM-dd 00:00:00
-     * @return
      */
-    public static String formateDate(Date date, String code) {
-        SimpleDateFormat formate = new SimpleDateFormat(code);
-        return formate.format(date);
-
+    public static String formatDate(Date date, String code) {
+        SimpleDateFormat format = new SimpleDateFormat(code);
+        return format.format(date);
     }
 
     public static String formatDate(Integer timestamp, String code) {
         if (timestamp == null || timestamp == 0) {
             return "";
         }
-        return formateDate(new Date(timestamp * 1000L), code);
+        return formatDate(new Date(timestamp * 1000L), code);
     }
 
     /**
@@ -682,25 +586,17 @@ public class DateUtils {
 
     /**
      * 获取过去第几天的日期
-     *
-     * @param past
-     * @return
      */
     public static String getPastDate(int past, String formatStr) {
         Calendar calendar = Calendar.getInstance();
         calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - past);
         Date today = calendar.getTime();
         SimpleDateFormat format = new SimpleDateFormat(formatStr);
-        String result = format.format(today);
-        return result;
+        return format.format(today);
     }
 
     /**
      * 获取某个时间段内所有日期
-     *
-     * @param begin
-     * @param end
-     * @return
      */
     public static List<String> getDayBetweenDates(String begin, String end) {
         Date dBegin = strToDateTime(begin);
@@ -738,7 +634,6 @@ public class DateUtils {
         long nd = 1000 * 24 * 60 * 60;
         long nh = 1000 * 60 * 60;
         long nm = 1000 * 60;
-        // long ns = 1000;
         // 获得两个时间的毫秒时间差异
         long diff = endDate.getTime() - nowDate.getTime();
         // 计算差多少天
@@ -747,8 +642,6 @@ public class DateUtils {
         long hour = diff % nd / nh;
         // 计算差多少分钟
         long min = diff % nd % nh / nm;
-        // 计算差多少秒//输出结果
-        // long sec = diff % nd % nh % nm / ns;
         return day + "天" + hour + "小时" + min + "分钟";
     }
 

+ 40 - 13
PAS/src/main/java/cn/cslg/pas/service/CustomAnalysisItemSourceService.java

@@ -1,7 +1,7 @@
 package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.core.base.Constants;
-import cn.cslg.pas.common.model.dto.*;
+import cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO;
 import cn.cslg.pas.common.model.dto.analysis.AnalysisItemResultDTO;
 import cn.cslg.pas.common.model.dto.analysis.SchemaDimensionDTO;
 import cn.cslg.pas.common.model.dto.analysis.SourceDataDTO;
@@ -10,13 +10,11 @@ import cn.cslg.pas.common.model.vo.PatentQueryFieldSourceVO;
 import cn.cslg.pas.common.model.vo.SearchSourceDataVO;
 import cn.cslg.pas.common.model.vo.SourceDataVO;
 import cn.cslg.pas.common.utils.*;
-import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.pas.domain.CustomAnalysisItem;
 import cn.cslg.pas.domain.CustomAnalysisItemSource;
 import cn.cslg.pas.domain.ProjectFieldExpand;
-import cn.cslg.pas.common.utils.CacheUtils;
-import cn.dev33.satoken.stp.StpUtil;
 import cn.cslg.pas.mapper.CustomAnalysisItemSourceMapper;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -26,7 +24,10 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -42,13 +43,9 @@ import java.util.stream.Collectors;
 public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisItemSourceMapper, CustomAnalysisItemSource> {
 
     private final PatentService patentService;
-    private final CustomAnalysisItemService customAnalysisItemService;
     private final CacheUtils cacheUtils;
-    private final RedisUtil redisUtil;
     private final ProjectFieldTreeService projectFieldTreeService;
     private final ProjectFieldService projectFieldService;
-    private final FileUtils fileUtils;
-    private final LoginUtils loginUtils;
 
     public SourceDataDTO getItemSourceData(CustomAnalysisItem customAnalysisItem) {
         SourceDataDTO sourceDataDTO = new SourceDataDTO();
@@ -141,20 +138,32 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
         return resultList.stream().sorted(Comparator.comparing(AnalysisItemResultDTO::getCount).reversed()).limit(end).collect(Collectors.toList());
     }
 
+    /**
+     * @description 图标分析模块 数据获取方法(一维数据,二位数据的下拉选项)
+     */
     public String getSourceData2(SearchSourceDataVO searchSourceDataVO) {
+        //从Redis中获取选中ID的缓存
         String id = cacheUtils.getSelectPatentIds(searchSourceDataVO.getPatentKey());
+        //为空报错
         if (StringUtils.isEmpty(id)) {
             return Response.error(ResponseEnum.QUERY_CACHE_ERROR);
         }
+        //获取前端选择的条数范围(10,20,30,40,50,全部)
         long end = searchSourceDataVO.getNum();
         List<CustomAnalysisItemSource> list = new ArrayList<>();
+        //拆分出选中的IDList
         List<Integer> patentIds = StringUtils.changeStringToInteger(id, ",");
+        //如果选中的数据类型是 树(6) 执行分支
         if (searchSourceDataVO.getType().equals(6)) {
+            // TODO: 2022/9/26 树型数据 未解析逻辑 沈永艺
             this.setTreeNodeCountDataForRedis(patentIds, searchSourceDataVO);
             return Response.success(projectFieldTreeService.getProjectFieldTreeNodeByFieldId(searchSourceDataVO.getFieldId()));
         }
+        //非树型
         switch (searchSourceDataVO.getPtype()) {
+            //(部,大类,小类,大组,小组) (当前,标准,合并后) (国家,省,市)
             case 1:
+                // TODO: 2022/9/26 处理条件 未解析逻辑 沈永艺
                 List<AnalysisItemResultDTO> resultList = this.setCommonDataCountDataForRedis(patentIds, searchSourceDataVO);
                 for (AnalysisItemResultDTO item : resultList) {
                     CustomAnalysisItemSource customAnalysisItemSource = new CustomAnalysisItemSource();
@@ -165,27 +174,45 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
                     list.add(customAnalysisItemSource);
                 }
                 break;
+            //年份(月,季度,半年,1年,2年,3年,5年)
             case 2:
+                //获取PType为2的数据
                 List<ProjectFieldExpand> expandList = projectFieldService.getProjectFieldExpand().stream().filter(item -> item.getPtype().equals(searchSourceDataVO.getPtype())).collect(Collectors.toList());
+                //获取属性的名称
                 String dateType = expandList.stream().filter(item -> item.getId().equals(searchSourceDataVO.getExpandId())).findFirst().orElse(new ProjectFieldExpand()).getName();
+                //用名称获取偏移的数字 (注:这里的偏移均是指减去多少个月 例:2022-01-01 偏移-12 为 2021-01-01)
                 Integer offset = Constants.DATE_OFFSET.get(dateType);
+                //根据FieldId的不同获取选中IDList中的对应日期 fieldId说明: 25申请日 26公开日 27公开授权日
+                //1.获取最小的日期
                 Date endDate = patentService.getDateTime(id, searchSourceDataVO.getFieldId(), "min");
+                //2.获取最大的日期
                 Date startTime = patentService.getDateTime(id, searchSourceDataVO.getFieldId(), "max");
+                //创建偏移数据
                 Date endTime = DateUtil.offsetMonth(startTime, offset);
-                Integer index = 0;
+                int index = 0;
+                /*
+                    do while的判断规则: 1.当最大日期比最小日期小 &&  2.循环次数超出所传入范围
+                 */
                 do {
+                    //装填数据
                     CustomAnalysisItemSource customAnalysisItemSource = new CustomAnalysisItemSource();
+                    //依据偏移月数的不同 获取不同的对应数据
                     customAnalysisItemSource.setName(DateUtils.getDateSourceName(startTime, endTime, offset, index++));
                     customAnalysisItemSource.setStatus(null);
                     customAnalysisItemSource.setCreateTime(null);
                     customAnalysisItemSource.setUpdateTime(null);
+                    //重设最大日期
                     startTime = DateUtil.offsetMonth(startTime, offset);
+                    //重设偏移数据
                     endTime = DateUtil.offsetMonth(endTime, offset);
+                    //向List中加入所需数据 用于返回前台展示
                     list.add(customAnalysisItemSource);
-                } while (DateUtil.compare(startTime, endDate) > 0 && index < end);
+                } while (DateUtil.compare(DateUtil.offsetMonth(startTime, offset * -1), endDate) > 0 && index < end);
                 break;
+            //自定义
             case 3:
             case 4:
+                // TODO: 2022/9/26 自定义字段 未解析逻辑 沈永艺
                 list = this.getItemSourceList(searchSourceDataVO.getUid(), searchSourceDataVO.getDimension(), searchSourceDataVO.getFieldId(), searchSourceDataVO.getExpandId());
                 break;
         }
@@ -217,7 +244,7 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
 
     @Transactional(rollbackFor = Exception.class)
     public void updateSource(SourceDataVO sourceDataVO) {
-        this.remove(Wrappers.<CustomAnalysisItemSource> lambdaQuery().eq(CustomAnalysisItemSource::getUid, sourceDataVO.getUid()).eq(CustomAnalysisItemSource::getDimension, sourceDataVO.getDimension()));
+        this.remove(Wrappers.<CustomAnalysisItemSource>lambdaQuery().eq(CustomAnalysisItemSource::getUid, sourceDataVO.getUid()).eq(CustomAnalysisItemSource::getDimension, sourceDataVO.getDimension()));
         List<CustomAnalysisItemSource> list = new ArrayList<>();
         sourceDataVO.getSource().forEach(source -> {
             if (StringUtils.isNotNull(source.getMax())) {
@@ -228,7 +255,7 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
             }
             source.setFieldId(sourceDataVO.getFieldId());
             source.setExpandId(sourceDataVO.getExpandId());
-            source.setCreateBy(loginUtils.getId());
+            source.setCreateBy(StpUtil.getLoginIdAsInt());
             source.setDimension(sourceDataVO.getDimension());
             source.setUid(sourceDataVO.getUid());
             list.add(source);

+ 45 - 473
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -2,15 +2,15 @@ package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.core.exception.CustomException;
-import cn.cslg.pas.common.model.DataSource;
 import cn.cslg.pas.common.model.PersonnelVO;
 import cn.cslg.pas.common.model.dto.UploadFileDTO;
-import cn.cslg.pas.common.model.params.*;
-import cn.cslg.pas.common.model.vo.*;
+import cn.cslg.pas.common.model.vo.ProjectExportVO;
+import cn.cslg.pas.common.model.vo.ProjectImportVO;
+import cn.cslg.pas.common.model.vo.ProjectVO;
+import cn.cslg.pas.common.model.vo.TaskParams;
 import cn.cslg.pas.common.utils.*;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
-import cn.cslg.pas.common.utils.auth.checkAuth;
 import cn.cslg.pas.domain.*;
 import cn.cslg.pas.mapper.ProjectMapper;
 import cn.hutool.core.collection.CollUtil;
@@ -34,14 +34,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
-import okhttp3.FormBody;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import org.apache.poi.ss.usermodel.PictureData;
-import org.aspectj.lang.reflect.MethodSignature;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -52,7 +45,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
-import java.lang.reflect.Method;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -85,14 +77,12 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     private final PatentInventorLinkService patentInventorLinkService;
     private final PatentSimpleFamilyService patentSimpleFamilyService;
     private final PatentSimpleFamilyLinkService patentSimpleFamilyLinkService;
-    private final PatentClassNumberService patentClassNumberService;
     private final PatentClassNumberLinkService patentClassNumberLinkService;
     private final ProjectPatentLinkService projectPatentLinkService;
     private final TaskService taskService;
     private final PatentImageService patentImageService;
     private final ProjectFieldPatentLinkService projectFieldPatentLinkService;
     private final ProjectFolderService projectFolderService;
-    private final ProjectFolderPatentLinkService projectFolderPatentLinkService;
     private final ProjectFieldService projectFieldService;
     private final ProjectFieldOptionService projectFieldOptionService;
     private final ProjectFieldTreeService projectFieldTreeService;
@@ -111,8 +101,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     private final UserService userService;
     private final ApiUtils apiUtils;
     private final LoginUtils loginUtils;
-    @Value("${authorUrl}")
-    private String url;
 
     public Project getProjectByName(String name) {
         LambdaQueryWrapper<Project> queryWrapper = new LambdaQueryWrapper<>();
@@ -262,7 +250,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         projectList = projectList.stream().filter(item -> item.getScenarioName().contains(scenario)).collect(Collectors.toList());
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.INVESTIGATION_TYPE));
         for (SystemDict systemDict : systemDictList) {
-            Map<String, Object> result = new HashMap<>();
             map.put(systemDict.getLabel(), projectList.stream().filter(item -> item.getTypeList().contains(Integer.parseInt(systemDict.getValue()))).count());
         }
         return map;
@@ -331,7 +318,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         }
         Project temp = this.getById(projectId);
         Project data = JsonUtils.jsonToPojo(json, Project.class);
-        Client client = clientService.getClientByName(data.getClientName());
+        Client client = clientService.getClientByName(Objects.requireNonNull(data).getClientName());
         if (client == null) {
             client = new Client();
             client.setName(data.getClientName());
@@ -368,7 +355,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
             return Response.error("专题库名称已存在");
         }
         if (project.getClientId() == -1) {
-            project.setClientId(this.getNewClientId(project.getClientName(),user.getTenantId()));
+            project.setClientId(this.getNewClientId(project.getClientName(), user.getTenantId()));
         }
         project.setScenario(StringUtils.join(project.getScenarioList(), ","));
         project.setType(StringUtils.join(project.getTypeList(), ","));
@@ -383,12 +370,12 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     @Transactional
     public String edit(Project project) {
         Project temp = this.getProjectByName(project.getName());
-        Project project1 =this.getProjectById(project.getId());
+        Project project1 = this.getProjectById(project.getId());
         if (temp != null && !temp.getId().equals(project.getId())) {
             return Response.error("专题库名称已存在");
         }
         if (project.getClientId() == -1) {
-            project.setClientId(this.getNewClientId(project.getClientName(),project1.getTenantId()));
+            project.setClientId(this.getNewClientId(project.getClientName(), project1.getTenantId()));
         }
         project.setScenario(StringUtils.join(project.getScenarioList(), ","));
         project.setType(StringUtils.join(project.getTypeList(), ","));
@@ -409,7 +396,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         return Response.success();
     }
 
-    private Integer getNewClientId(String name,Integer tenantId) {
+    private Integer getNewClientId(String name, Integer tenantId) {
 
         Client client = clientService.getOne(Wrappers.<Client>lambdaQuery().eq(Client::getName, name).last("limit 1"));
         if (client == null) {
@@ -439,16 +426,16 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
 
     @Transactional(rollbackFor = Exception.class)
     public String importExcel(MultipartFile file) {
-        try { PersonnelVO user = cacheUtils.getLoginUserPersonnel(loginUtils.getId());
+        try {
+            PersonnelVO user = cacheUtils.getLoginUserPersonnel(loginUtils.getId());
             ExcelReader reader = ExcelUtil.getReader(file.getInputStream());
             List<Map<String, Object>> readAll = reader.readAll();
             List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.INVESTIGATION_TYPE, Constants.ENTERPRISE_APPLICATION_SCENARIO));
-            for (int i = 0; i < readAll.size(); i++) {
-                Map<String, Object> row = readAll.get(i);
+            for (Map<String, Object> row : readAll) {
                 Project project = new Project();
                 project.setSort(1);
                 project.setName(row.get("专题库名称").toString());
-                project.setClientId(this.getNewClientId(row.get("委托方").toString(),user.getTenantId()));
+                project.setClientId(this.getNewClientId(row.get("委托方").toString(), user.getTenantId()));
                 project.setRemark(row.get("备注").toString());
                 project.setCreateBy(loginUtils.getId());
                 project.setCreateTime(DateUtils.getDateTime());
@@ -497,7 +484,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     }
 
     @Transactional
-    public String share(Integer id, List<Integer> userIds ,List<ProjectUser.User> users) {
+    public String share(Integer id, List<Integer> userIds, List<ProjectUser.User> users) {
         ProjectUser user = new ProjectUser();
         user.setType(3);
         user.setRemark("用户分享");
@@ -527,421 +514,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         return taskParams;
     }
 
-    @Async("singleThreadAsyncTaskExecutor")
-    @Transactional(rollbackFor = Exception.class)
-    public void importPatent(TaskParams params, ProjectImportPatentVO projectImportPatentVO) {
-        Integer total = params.getRowList().size();
-        try {
-            if (projectImportPatentVO != null) {
-                List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.PATENT_TYPE, Constants.PATENT_SIMPLE_STATUS));
-                Map<String, PictureData> pictureDataMap = ExcelUtils.getDataFromExcel(params.getPath());
-
-
-                for (int i = 0; i < params.getRowList().size(); i++) {
-                    Map<Object, Object> row = params.getRowList().get(i);
-                    Object patentNo = row.get("公开(公告)号");
-                    if (StringUtils.isNotNull(patentNo)) {
-                        PatentCustomFieldParams patentCustomFieldParams = new PatentCustomFieldParams();
-                        //用专利号查找专利的相关信息 并装配到 Patent 中
-                        Patent patent = patentService.getByPatentNo(patentNo.toString());
-                        //法律状态/事件|INPADOC法律状态|法律状态更新时间|简单法律状态
-                        PatentAffairParams patentAffairParams = new PatentAffairParams();
-                        //当前申请(专利权)人
-                        List<String> patentApplicantCurrentName = new ArrayList<>();
-                        //原始申请(专利权)人
-                        List<String> patentApplicantOriginalName = new ArrayList<>();
-                        //[标]当前申请(专利权)人
-                        List<String> patentApplicantStandardCurrentName = new ArrayList<>();
-                        //[标]原始申请(专利权)人
-                        List<String> patentApplicantStandardOriginalName = new ArrayList<>();
-                        //发明人|第一发明人
-                        PatentInventorParams patentInventorParams = new PatentInventorParams();
-                        //简单同族|PatSnap同族|INPADOC同族
-                        PatentSimpleFamilyParams patentSimpleFamilyParams = new PatentSimpleFamilyParams();
-                        //IPC分类号|UPC分类号|LOC分类号|CPC分类号|IPC主分类号|UPC主分类号
-                        PatentClassNumberParams patentClassNumberParams = new PatentClassNumberParams();
-                        //许可人|被许可人|许可类型
-                        PatentLicensorParams patentLicensorParams = new PatentLicensorParams();
-                        //质押人|质权人
-                        PatentPledgeParams patentPledgeParams = new PatentPledgeParams();
-                        //代理人
-                        PatentAgentParams patentAgentParams = new PatentAgentParams();
-                        //当前申请(专利权)人地址|当前申请(专利权)人国家|当前第一申请(专利权)人地址|原始申请(专利权)人地址|原始申请(专利权)人国家
-                        PatentApplicantAddressParams patentApplicantAddressParams = new PatentApplicantAddressParams();
-                        //发明人地址|第一发明人地址
-                        PatentInventorAddressParams patentInventorAddressParams = new PatentInventorAddressParams();
-                        //说明书|说明书(译)
-                        PatentInstructionTextParams patentInstructionTextParams = new PatentInstructionTextParams();
-                        //权利要求|独立权利要求|权利要求(译)
-                        PatentRightParams patentRightParams = new PatentRightParams();
-                        //标签
-                        PatentLabelParams patentLabelParams = new PatentLabelParams();
-
-                        if (patent == null) {
-                            patent = new Patent();
-                            patent.setPatentNo(patentNo.toString());
-                            patent.setPublicNo(patentNo.toString());
-                            patent.insert();
-                        }
-                        patentAffairParams.setPatentId(patent.getId());
-                        patentInventorParams.setPatentId(patent.getId());
-                        patentSimpleFamilyParams.setPatentId(patent.getId());
-                        patentSimpleFamilyParams.setPatentNo(patent.getPatentNo());
-                        patentClassNumberParams.setPatentId(patent.getId());
-                        patentCustomFieldParams.setPatentId(patent.getId());
-                        patentCustomFieldParams.setProjectId(projectImportPatentVO.getProjectId());
-                        patentCustomFieldParams.setUserId(Integer.parseInt(params.getUserId()));
-                        patentLicensorParams.setPatentId(patent.getId());
-                        patentPledgeParams.setPatentId(patent.getId());
-                        patentAgentParams.setPatentId(patent.getId());
-                        patentApplicantAddressParams.setPatentId(patent.getId());
-                        patentInventorAddressParams.setPatentId(patent.getId());
-                        patentInstructionTextParams.setPatentId(patent.getId());
-                        patentRightParams.setPatentId(patent.getId());
-                        patentRightParams.setPatentNo(patent.getPatentNo());
-                        patentLabelParams.setPatentId(patent.getId());
-                        patentLabelParams.setProjectId(projectImportPatentVO.getProjectId());
-                        for (Object object : row.keySet()) {
-                            String key = object.toString();
-                            if (key.equals("摘要附图")) {
-                                PictureData pictureData = pictureDataMap.get(String.valueOf(i + 1));
-                                if (pictureData != null) {
-                                    //1.先把Excel里的图片存到文件夹里 路径大致是 ../target/file/时间/文件.png 2.生成完文件并存完后 将文件的路径和名称存到表里 OS_PATENT_IMAGE 然后最终得到摘要图片的存储路径
-                                    String abstractPath = patentImageService.updatePatentImage(patent.getId(), pictureData);
-                                    //将路径进行装配
-                                    patent.setAbstractPath(abstractPath);
-                                }
-                            }
-                            Object value = row.get(key);
-                            if (StringUtils.isNotNull(value) && !value.equals("") && !value.equals("-") && !value.equals("\\")) {
-                                switch (key) {
-                                    case "标题":
-                                        List<String> titles = StringUtils.changeStringToString(value.toString(), " \\| ");
-                                        if (titles.size() == 2) {
-                                            patent.setName(titles.get(0));
-                                            patent.setNameOut(titles.get(1));
-                                        } else {
-                                            patent.setName(value.toString());
-                                        }
-                                        break;
-                                    case "摘要":
-                                        List<String> abstracts = StringUtils.changeStringToString(value.toString(), " \\| ");
-                                        if (abstracts.size() == 2) {
-                                            patent.setAbstractStr(abstracts.get(0));
-                                            patent.setAbstractOut(abstracts.get(1));
-                                        } else {
-                                            patent.setAbstractStr(value.toString());
-                                        }
-                                        break;
-                                    case "公开(公告)日":
-                                        patent.setPublicDate(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "当前申请(专利权)人":
-                                        patentApplicantCurrentName.addAll(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "当前申请(专利权)人地址":
-                                        //patentApplicantAddressParams.setCurrentAddress(value.toString());
-                                        break;
-                                    case "当前申请(专利权)人国家":
-                                        //patentApplicantAddressParams.setCurrentCountry(value.toString());
-                                        break;
-                                    case "[标]当前申请(专利权)人":
-                                        patentApplicantStandardCurrentName.addAll(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "法律状态/事件":
-                                        //patentAffairParams.setStatusList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "INPADOC法律状态":
-                                        patentAffairParams.setContent(value.toString());
-                                        break;
-                                    case "法律状态更新时间":
-                                        patentAffairParams.setDateTime(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "简单法律状态":
-                                        Integer simpleStatus = Integer.parseInt(systemDictList.stream().filter(systemDict -> systemDict.getType().equals(Constants.PATENT_SIMPLE_STATUS) && systemDict.getLabel().equals(value.toString())).findFirst().orElse(new SystemDict()).getValue());
-                                        patent.setSimpleStatus(simpleStatus);
-                                        patentAffairParams.setSimpleStatus(simpleStatus);
-                                        break;
-                                    case "申请号":
-                                        patent.setApplicationNo(value.toString());
-                                        break;
-                                    case "文献代码":
-                                        patent.setCode(value.toString());
-                                        break;
-                                    case "受理局":
-                                        patent.setBureau(value.toString());
-                                        break;
-                                    case "申请日":
-                                        patent.setApplicationDate(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "摘要(译)":
-                                        patent.setAbstractOut(value.toString());
-                                        break;
-                                    case "标题(译)":
-                                        patent.setNameOut(value.toString());
-                                        break;
-                                    case "专利类型":
-                                        Integer type = Integer.parseInt(systemDictList.stream().filter(systemDict -> systemDict.getType().equals(Constants.PATENT_TYPE) && systemDict.getLabel().equals(value.toString())).findFirst().orElse(new SystemDict()).getValue());
-                                        patent.setType(type);
-                                        break;
-                                    case "说明书":
-                                        patentInstructionTextParams.setManual(value.toString());
-                                        break;
-                                    case "说明书(译)":
-                                        patentInstructionTextParams.setManualOut(value.toString());
-                                        break;
-                                    case "文献页数":
-                                        patent.setDocPage(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "首次公开日":
-                                        patent.setFirstPublicDate(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "当前第一申请(专利权)人":
-                                        break;
-                                    case "当前申请(专利权)人数量":
-                                        patent.setApplicantNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "当前第一申请(专利权)人地址":
-                                        patentApplicantAddressParams.setFirstCurrentAddress(value.toString());
-                                        break;
-                                    case "发明人地址":
-                                        patentInventorAddressParams.setAddress(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "第一发明人地址":
-                                        patentInventorAddressParams.setFirstAddress(value.toString());
-                                        break;
-                                    case "原始申请(专利权)人":
-                                        patentApplicantOriginalName.addAll(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "原始申请(专利权)人地址":
-                                        //patentApplicantAddressParams.setOriginalAddress(value.toString());
-                                        break;
-                                    case "原始申请(专利权)人国家":
-                                        //patentApplicantAddressParams.setOriginalCountry(value.toString());
-                                        break;
-                                    case "[标]原始申请(专利权)人":
-                                        patentApplicantStandardOriginalName.addAll(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "发明人":
-                                        patentInventorParams.setNameList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "第一发明人":
-                                        patentInventorParams.setFirstName(value.toString());
-                                        break;
-                                    case "发明人数量":
-                                        patent.setInventorNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "权利要求":
-                                        patentRightParams.setContent(value.toString());
-                                        break;
-                                    case "独立权利要求":
-                                        patentRightParams.setSelfContent(value.toString());
-                                        break;
-                                    case "权利要求(译)":
-                                        patentRightParams.setContentOut(value.toString());
-                                        break;
-                                    case "权利要求数量":
-//                                        if ("该数据不支持导出".equals(value.toString())) {
-//                                            patent.setSelfRightContentNum(0);
-//                                        } else {
-//
-//                                        }
-                                        patent.setSelfRightContentNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "IPC分类号":
-                                        patentClassNumberParams.setIpcList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "UPC分类号":
-                                        patentClassNumberParams.setUpcList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "LOC分类号":
-                                        patentClassNumberParams.setLocList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "CPC分类号":
-                                        patentClassNumberParams.setCpcList(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "IPC主分类号":
-                                        patentClassNumberParams.setMainIpc(value.toString());
-                                        break;
-                                    case "UPC主分类号":
-                                        patentClassNumberParams.setMainUpc(value.toString());
-                                        break;
-                                    case "简单同族":
-                                        patentSimpleFamilyParams.setSimpleFamily(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "简单同族成员数量":
-                                        patent.setSimpleFamilyNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "PatSnap同族":
-                                        patentSimpleFamilyParams.setPatSnapFamily(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "PatSnap同族成员数量":
-                                        patent.setPatSnapFamilyNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "INPADOC同族":
-                                        patentSimpleFamilyParams.setInpadocFamily(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "INPADOC同族成员数量":
-                                        patent.setInpadocFamilyNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "优先权号":
-                                        patent.setPriorityNo(value.toString());
-                                        break;
-                                    case "授权日":
-                                        patent.setPublicAccreditDate(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "优先权国家":
-                                        patent.setPriorityCountry(value.toString());
-                                        break;
-                                    case "优先权日":
-                                        patent.setPriorityDate(DateUtils.getDateTime(value.toString()));
-                                        break;
-                                    case "非专利引用文献":
-                                        patent.setNotPatentQuote(value.toString());
-                                        break;
-                                    case "非专利引用文献数量":
-                                        patent.setNotPatentQuoteNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "被引用专利":
-                                        patent.setQuoted(value.toString());
-                                        break;
-                                    case "被引用专利数量":
-                                        patent.setQuotedNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "引用专利":
-                                        patent.setQuote(value.toString());
-                                        break;
-                                    case "引用专利数量":
-                                        patent.setQuoteNum(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "3年内被引用次数":
-                                        patent.setQuotedNum3(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "5年内被引用次数":
-                                        patent.setQuotedNum5(Integer.parseInt(value.toString()));
-                                        break;
-                                    case "许可人":
-                                        patentLicensorParams.setLicensor(PatentUtils.getPatentLicensor(value.toString()));
-                                        break;
-                                    case "被许可人":
-                                        patentLicensorParams.setLicensee(PatentUtils.getPatentLicensor(value.toString()));
-                                        break;
-                                    case "许可类型":
-                                        patentLicensorParams.setType(PatentUtils.getPatentLicensor(value.toString()));
-                                        break;
-                                    case "质押人":
-                                        patentPledgeParams.setPledgor(PatentUtils.getPatentLicensor(value.toString()));
-                                        break;
-                                    case "质权人":
-                                        patentPledgeParams.setPledgee(PatentUtils.getPatentLicensor(value.toString()));
-                                        break;
-                                    case "EP指定国状态":
-                                        patent.setEpStatus(value.toString());
-                                        break;
-                                    case "WO国家阶段":
-                                        patent.setWo(value.toString());
-                                        break;
-                                    case "代理机构":
-                                        patent.setAgencyId(patentAgencyService.getAgencyStringIdByName(value.toString()));
-                                        break;
-                                    case "代理人":
-                                        patentAgentParams.setAgent(PatentUtils.formatValue(value.toString()));
-                                        break;
-                                    case "审查员":
-                                        patent.setExaminer(value.toString());
-                                        break;
-                                    case "助理审查员":
-                                        patent.setAidExaminer(value.toString());
-                                        break;
-                                    case "标签":
-                                        patentLabelParams.setLabel(PatentUtils.formatValue2(value.toString()));
-                                        break;
-                                    default:
-                                        List<String> fields = StringUtils.changeStringToString(key, ":");
-                                        if (fields.size() == 2) {
-                                            patentCustomFieldParams.put(key, PatentUtils.formatValue2(value.toString()));
-                                        }
-                                        break;
-                                }
-                            } else {
-                                List<String> fields = StringUtils.changeStringToString(key, ":");
-                                if (fields.size() == 2) {
-                                    patentCustomFieldParams.put(key, null);
-                                }
-                            }
-                        }
-
-                        patent.updateById();
-                        //专利权利要求表
-                        //patentRightService.updatePatentRight(patentRightParams);
-                        //专利说明书(文本)
-                        //patentInstructionTextService.updatePatentInstructionText(patentInstructionTextParams);
-                        //代理人 (代理人关联专利)
-                        //patentAgentService.updatePatentAgent(patentAgentParams);
-                        //专利信息质押质权人
-                        //patentPledgeService.updatePatentPledge(patentPledgeParams);
-                        //专利信息许可人
-                        //patentLicensorService.updatePatentLicensor(patentLicensorParams);
-                        //专利信息事务信息
-                        //patentAffairService.updatePatientAffair(patentAffairParams);
-                        //权利人
-                        patentApplicantLinkService.updatePatentApplicantLink(patentApplicantCurrentName, patentApplicantStandardCurrentName, 1, patent.getId());
-                        //申请人
-                        patentApplicantLinkService.updatePatentApplicantLink(patentApplicantOriginalName, patentApplicantStandardOriginalName, 2, patent.getId());
-                        //申请人地址
-                        patentApplicantService.updatePatentApplicantAddress(patentApplicantAddressParams);
-                        //发明人
-                        patentInventorService.updatePatentInventor(patentInventorParams);
-                        //发明人地址
-                        patentInventorService.updatePatentInventorAddress(patentInventorAddressParams);
-                        //专利信息简单同族关联
-                        //patentSimpleFamilyService.updatePatentSimpleFamily(patentSimpleFamilyParams);
-                        //专利分类号关联
-                        //patentClassNumberLinkService.updatePatentClassNumberLink(patentClassNumberParams);
-                        //专题库关联专利信息
-                        //projectPatentLinkService.updateProjectPatent(projectImportPatentVO.getProjectId(), patent.getId());
-                        //标引内容关联专利信息
-                        //projectFieldPatentLinkService.updateProjectFieldPatentLink(projectImportPatentVO, patent.getId());
-                        //文件夹管理
-                        //projectFolderPatentLinkService.updateProjectFolderLink(projectImportPatentVO, patent.getId());
-                        //自定义字段
-                        //patentService.updatePatentCustomField(patentCustomFieldParams);
-                        //标签
-                        //patentLabelService.updatePatentLabel(patentLabelParams);
-//                        WebSocketServer.sendInfo(Response.websocket(new TaskWebSocketDTO()
-//                                .setTaskId(params.getTaskId())
-//                                .setProjectId(projectImportPatentVO.getProjectId())
-//                                .setComplete(false)
-//                                .setIndex(i)
-//                                .setTaskType(Constants.TASK_IMPORT_PATENT)
-//                                .setPercentage(total == 0 ? 0 : Math.round((total.equals(i) ? (i * 1D) : (i + 1D)) / total * 100D))
-//                                .setFileName("")
-//                                .setOldName(params.getOldName())
-//                                .setUrl("")
-//                                .setTotal(total), ResponseEnum.PATENT_IMPORT_TASK_SUCCESS), params.getUserId());
-                    }
-                }
-//                SpringUtil.getBean(ProjectService.class).setImportPatentTaskStatus(2, params.getTaskId());
-//                WebSocketServer.sendInfo(Response.websocket(new TaskWebSocketDTO()
-//                        .setTaskId(params.getTaskId())
-//                        .setProjectId(projectImportPatentVO.getProjectId())
-//                        .setComplete(true)
-//                        .setIndex(total)
-//                        .setTaskType(Constants.TASK_IMPORT_PATENT)
-//                        .setPercentage(100L)
-//                        .setFileName("")
-//                        .setOldName(params.getOldName())
-//                        .setUrl("")
-//                        .setTotal(total), ResponseEnum.PATENT_IMPORT_TASK_SUCCESS), params.getUserId());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            SpringUtil.getBean(ProjectService.class).setImportPatentTaskStatus(3, params.getTaskId());
-            WebSocketServer.sendInfo(Response.error(ResponseEnum.PATENT_IMPORT_TASK_ERROR), params.getUserId());
-        }
-    }
-
     @Transactional(propagation = Propagation.NOT_SUPPORTED)
     public void setImportPatentTaskStatus(Integer status, Integer taskId) {
         taskService.updateStatus(taskId, status, DateUtils.getDateTime());
@@ -980,27 +552,27 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
             WebSocketServer.sendInfo(Response.websocket(true, ResponseEnum.PROJECT_EXPORT_TASK_SUCCESS), String.valueOf(userId));
             if (params.getProjectInfo()) {
                 Project project = this.getProjectById(params.getProjectId());
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_INFO_FILE_NAME, JsonUtils.objectToJson(project));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_INFO_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(project)));
             }
             if (params.getProjectReport() != null && params.getProjectReport().size() != 0) {
                 List<ProjectFile> projectFileList = projectFileService.getProjectFileByIds(params.getProjectReport());
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_REPORT_FILE_NAME, JsonUtils.objectToJson(projectFileList));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_REPORT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFileList)));
                 projectFileList.forEach(item -> this.copyFileToTempDirectory(item.getUrl(), tempPath, Constants.PROJECT_REPORT_DIRECTORY_NAME, item.getFileName()));
             }
             if (params.getProjectFile() != null && params.getProjectFile().size() != 0) {
                 List<ProjectFile> projectFileList = projectFileService.getProjectFileByIds(params.getProjectFile());
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FILE_FILE_NAME, JsonUtils.objectToJson(projectFileList));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FILE_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFileList)));
                 projectFileList.forEach(item -> this.copyFileToTempDirectory(item.getUrl(), tempPath, Constants.PROJECT_FILE_DIRECTORY_NAME, item.getFileName()));
             }
             if (params.getPatentImage()) {
                 List<PatentImage> patentImageList = patentImageService.getPatentImageByPatentIds(patentIds);
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_IMAGE_FILE_NAME, JsonUtils.objectToJson(patentImageList));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_IMAGE_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentImageList)));
                 patentImageList.forEach(item -> this.copyFileToTempDirectory(item.getUrl(), tempPath, Constants.PATENT_IMAGE_DIRECTORY_NAME, item.getFileName()));
             }
             if (params.getPatentInstruction()) {
                 List<String> patentNo = patentList.stream().map(Patent::getPatentNo).collect(Collectors.toList());
                 List<PatentInstruction> patentInstructionList = patentInstructionService.getPatentInstructionByPatentNo(patentNo);
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_INSTRUCTION_FILE_NAME, JsonUtils.objectToJson(patentInstructionList));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_INSTRUCTION_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentInstructionList)));
                 patentInstructionList.forEach(item -> this.copyFileToTempDirectory(item.getUrl(), tempPath, Constants.PATENT_INSTRUCTION_DIRECTORY_NAME, item.getFileName()));
             }
             if (params.getPatentBase()) {
@@ -1033,29 +605,29 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
                 List<PatentSimpleFamilyLink> patentSimpleFamilyLinkList = patentSimpleFamilyLinkService.getPatentSimpleFamilyLinkByFamilyIds(patentFamilyIds);
                 List<PatentSimpleFamily> patentSimpleFamilyList = patentSimpleFamilyService.getPatentSimpleFamilyByIds(patentFamilyIds);
                 List<PatentClassNumberLink> patentClassNumberLinkList = patentClassNumberLinkService.getPatentClassNumberLinkByPatentIds(patentIds);
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_FILE_NAME, JsonUtils.objectToJson(patentList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_AFFAIR_FILE_NAME, JsonUtils.objectToJson(patentAffairList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENCY_FILE_NAME, JsonUtils.objectToJson(patentAgencyList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENT_LINK_FILE_NAME, JsonUtils.objectToJson(patentAgentLinkList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENT_FILE_NAME, JsonUtils.objectToJson(patentAgentList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_INSTRUCTION_TEXT_FILE_NAME, JsonUtils.objectToJson(patentInstructionTextList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_LINK_FILE_NAME, JsonUtils.objectToJson(patentInventorLinkList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_FILE_NAME, JsonUtils.objectToJson(patentInventorList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_MERGE_FILE_NAME, JsonUtils.objectToJson(patentInventorMergeList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_LICENSOR_FILE_NAME, JsonUtils.objectToJson(patentLicensorList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_PLEDGE_FILE_NAME, JsonUtils.objectToJson(patentPledgeList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_RIGHT_FILE_NAME, JsonUtils.objectToJson(patentRightList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_FAMILY_LINK_FILE_NAME, JsonUtils.objectToJson(patentSimpleFamilyLinkList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_FAMILY_FILE_NAME, JsonUtils.objectToJson(patentSimpleFamilyList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_CLASS_NUMBER_FILE_NAME, JsonUtils.objectToJson(patentClassNumberLinkList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_FILE_NAME, JsonUtils.objectToJson(patentApplicantList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_LINK_FILE_NAME, JsonUtils.objectToJson(patentApplicantLinkList));
-                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_MERGE_LINK_FILE_NAME, JsonUtils.objectToJson(patentApplicantMergeLinkList));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_AFFAIR_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentAffairList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENCY_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentAgencyList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENT_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentAgentLinkList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_AGENT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentAgentList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_INSTRUCTION_TEXT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentInstructionTextList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentInventorLinkList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentInventorList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_INVENTOR_MERGE_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentInventorMergeList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_LICENSOR_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentLicensorList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_PLEDGE_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentPledgeList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_RIGHT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentRightList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_FAMILY_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentSimpleFamilyLinkList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_FAMILY_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentSimpleFamilyList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_CLASS_NUMBER_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentClassNumberLinkList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentApplicantList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentApplicantLinkList)));
+                this.saveDataToJsonFile(tempPath, Constants.PATENT_APPLICANT_MERGE_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentApplicantMergeLinkList)));
             }
             if (params.getPatentField() != null && params.getPatentField().size() != 0) {
                 if (params.getPatentField().contains(0)) {
                     List<PatentLabel> patentLabelList = patentLabelService.getPatentLabelByPatentIdsAndProjectId(patentIds, params.getProjectId());
-                    this.saveDataToJsonFile(tempPath, Constants.PATENT_LABEL_FILE_NAME, JsonUtils.objectToJson(patentLabelList));
+                    this.saveDataToJsonFile(tempPath, Constants.PATENT_LABEL_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patentLabelList)));
                 }
                 List<ProjectField> projectFieldList = projectFieldService.getFieldListByIds(params.getPatentField());
                 List<Integer> projectFieldIds = projectFieldList.stream().map(ProjectField::getId).collect(Collectors.toList());
@@ -1066,14 +638,14 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
                 for (Integer fieldId : params.getPatentField()) {
                     projectFieldPatentLinkList.addAll(projectFieldPatentLinkService.getProjectPatentLinkByPatentIdsAndFieldId(patentIds, fieldId));
                 }
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_FILE_NAME, JsonUtils.objectToJson(projectFieldList));
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_OPTION_FILE_NAME, JsonUtils.objectToJson(projectFieldOptionList));
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_TREE_FILE_NAME, JsonUtils.objectToJson(projectFieldTreeList));
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_TEXT_FILE_NAME, JsonUtils.objectToJson(projectFieldTextList));
-                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_PATENT_LINK_FILE_NAME, JsonUtils.objectToJson(projectFieldPatentLinkList));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFieldList)));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_OPTION_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFieldOptionList)));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_TREE_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFieldTreeList)));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_TEXT_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFieldTextList)));
+                this.saveDataToJsonFile(tempPath, Constants.PROJECT_FIELD_PATENT_LINK_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(projectFieldPatentLinkList)));
             }
             List<Patent> patents = patentService.getPatentIdAndPatentNoByIds(patentIds);
-            this.saveDataToJsonFile(tempPath, Constants.PATENT_ID_PATENT_NO_FILE_NAME, JsonUtils.objectToJson(patents));
+            this.saveDataToJsonFile(tempPath, Constants.PATENT_ID_PATENT_NO_FILE_NAME, Objects.requireNonNull(JsonUtils.objectToJson(patents)));
             File file = ZipUtil.zip(tempPath, savePath);
             FileUtil.del(tempPath);
             ProjectExport projectExport = projectExportService.getById(exportId);
@@ -1183,7 +755,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         File file = new File(src);
         FileReader fileReader = new FileReader(file);
         Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
-        int ch = 0;
+        int ch;
         StringBuffer sb = new StringBuffer();
         while ((ch = reader.read()) != -1) {
             sb.append((char) ch);

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/ReportService.java

@@ -140,7 +140,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         //数据整合
         Map<String, Object> map = new HashMap<>();
         //1.系统数据
-        String date = DateUtils.formateDate(new Date(), DateUtils.YYYY_MM_DD);
+        String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
         String[] ds = date.split("-");
         map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", report.getName()));
         //2专题库信息

+ 1 - 1
PAS/src/main/resources/application.yml

@@ -44,4 +44,4 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
   mapper-locations: classpath:mapper/*.xml
-authorUrl: http://192.168.0.56:8880
+authorUrl: http://localhost:8880