Browse Source

Changes 修改数据业务

cyan 1 month ago
parent
commit
932a5a3bce

+ 15 - 5
jeecg-boot/jeecg-boot-base-core/pom.xml

@@ -262,13 +262,18 @@
 			<artifactId>commons-fileupload</artifactId>
 		</dependency>
 		<!--加载hutool-->
+<!--		<dependency>-->
+<!--			<groupId>cn.hutool</groupId>-->
+<!--			<artifactId>hutool-core</artifactId>-->
+<!--		</dependency>-->
+<!--		<dependency>-->
+<!--			<groupId>cn.hutool</groupId>-->
+<!--			<artifactId>hutool-crypto</artifactId>-->
+<!--		</dependency>-->
 		<dependency>
 			<groupId>cn.hutool</groupId>
-			<artifactId>hutool-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>cn.hutool</groupId>
-			<artifactId>hutool-crypto</artifactId>
+			<artifactId>hutool-all</artifactId>
+			<version>5.8.26</version>
 		</dependency>
 		<dependency>
 			<groupId>com.larksuite.oapi</groupId>
@@ -289,6 +294,11 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-data-mongodb</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>com.volcengine</groupId>
+			<artifactId>volcengine-java-sdk-ark-runtime</artifactId>
+			<version>LATEST</version>
+		</dependency>
 	</dependencies>
 
 </project>

+ 2017 - 0
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtil.java

@@ -0,0 +1,2017 @@
+/**
+ *
+ */
+package org.jeecg.common.util;
+
+import com.xkcoding.http.util.StringUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public final class DateUtil {
+    //日志
+    protected static Logger log = LoggerFactory.getLogger(DateUtil.class);
+
+    /** yyyy-MM-dd. */
+    public static final String DATE_FORMAT_ONE = "yyyy-MM-dd";
+
+    /** yyyy/MM/dd. */
+    public static final String DATE_FORMAT_TWO = "yyyy/MM/dd";
+
+    /** yyyyMMdd. */
+    public static final String DATE_FORMAT_THREE = "yyyyMMdd";
+
+    /** yyyyMM. */
+    public static final String DATE_FORMAT_FOUR = "yyyyMM";
+
+    /** yyyy-MM-dd HH:mm:ss. */
+    public static final String DATE_FORMAT_FIVE = "yyyy-MM-dd HH:mm:ss";
+
+    /** yyyy-MM-dd HH:mm: */
+    public static final String DATE_FORMAT_FIVEFIVE = "yyyy-MM-dd HH:mm";
+
+    /** yyyyMMddHHmm */
+    public static final String DATE_FORMAT = "yyyyMMddHHmmss";
+
+    /** yyyy-MM-dd HH:mm:ss. */
+    public static final String DATE_FORMAT_UPDATE = "yyyy-MM-dd HH:mm:ss.SSS";
+
+    /** yyyy. */
+    public static final String DATE_FORMAT_SIX = "yyyy";
+
+    /** MM. */
+    public static final String DATE_FORMAT_SEVEN = "MM";
+
+    /** dd. */
+    public static final String DATE_FORMAT_DD = "dd";
+
+    /** yyyy/MM/dd HH:mm:ss. */
+    public static final String DATE_FORMAT_EIGHT = "yyyy/MM/dd HH:mm:ss";
+
+    /** yyyy-MM-dd HH:mm: */
+    public static final String DATE_FORMAT_TWENTY_THREE = "yyyy/MM/dd HH:mm";
+
+    /** HH:mm:ss. */
+    public static final String DATE_FORMAT_NINE = "HH:mm:ss";
+
+    /** yy/MM/dd. */
+    public static final String DATE_FORMAT_TEN = "yy/MM/dd";
+
+    /** yyyy/M/d. */
+    public static final String DATE_FORMAT_ELEVEN = "yyyy/M/d";
+
+    /** yyyy/MM. */
+    public static final String DATE_FORMAT_TWELEVE = "yyyy/MM";
+
+    /** yyyyMMddHHmmssSSS. */
+    public static final String DATE_FORMAT_THIRTEEN = "yyyyMMddHHmmssSSS";
+
+    /** yyMMdd. */
+    public static final String DATE_FORMAT_FOURTEEN = "yyMMdd";
+
+    /** yyyy.MM.dd. */
+    public static final String DATE_FORMAT_SIXTEEN = "yyyy.MM.dd";
+
+    /** yyyyMMddHHmmss. */
+    public static final String DATE_FORMAT_SEVENTEEN = "yyyyMMddHHmmss";
+
+    /** yyyy年MM月dd日 */
+    public static final String DATE_FORMAT_EIGHTEEN = "yyyy年MM月dd日";
+
+    /** HH:mm. */
+    public static final String DATE_FORMAT_NINETEEN = "HH:mm";
+
+    /** HHmm. */
+    public static final String DATE_FORMAT_TWENTY = "HHmm";
+
+    /** yyyy-MM */
+    public static final String DATE_FORMAT_TWENTY_ONE = "yyyy-MM";
+
+    /** yyyy.MM */
+    public static final String DATE_FORMAT_TWENTY_TWO = "yyyy.MM";
+
+    /** yyyy年MM月dd日HH:mm */
+    public static final String DATE_FORMAT_FIFTEEN = "yyyy年MM月dd日 HH:mm";
+
+    /** yyyy-MM-dd HH:mm */
+    public static final String DATE_FORMAT_MMDDHHMM = "MM.dd HH:mm";
+
+    /**
+     * MM-dd
+     */
+    public static final String DATE_FORMAT_MMDD = "MM-dd";
+
+    /** MMM d'th', yyyy EEE'.' */
+    public static final String DATE_FORMAT_THIRTY = "EEE', 'MMM d'th', yyyy'.'";
+
+    /** yyyy'年'MM'月'dd日, EEE */
+    public static final String DATE_FORMAT_FORTY = "yyyy'年'MM'月'dd'日 'EEE";
+
+    /** yyyy'年'MM'月'*/
+    public static final String DATE_FORMAT_ZH_YM = "yyyy'年'MM'月'";
+
+    /** yyyy-MM-dd */
+    public static final String DATE_FORMAT_SIMPLE = "yyyy-MM-dd";
+
+    /** MM月dd日 */
+    public static final String DATE_FORMAT_MD = "MM月dd日";
+
+    /** yyyy-MM-dd HH:mm */
+    public static final String DATE_FORMAT_FIFTY = "yyyy-MM-dd HH:mm";
+
+    /** dd号 HH:mm */
+    public static final String DATE_FORMAT_DD_HH_MM = "dd号 HH:mm";
+
+
+    /** INT_4. */
+    private static final int INT_4 = 4;
+
+    /** INT_6. */
+    private static final int INT_6 = 6;
+
+    /** INT_8. */
+    private static final int INT_8 = 8;
+
+    /** . */
+    public static final String YEAR_FORMAT = "[12][0-9]{3}";
+
+    /** 年. */
+    public static final int YEAR = 1;
+
+    /** 月. */
+    public static final int MONTH = 2;
+
+    /** 日. */
+    public static final int DAY = 3;
+
+    /**
+     * 一天的毫秒数
+     */
+    public static final long DAY_MILLISECONDS = 24 * 60 * 60 * 1000;
+
+    /**
+     * 取得系统当前日期
+     */
+    public static Date getDate() {
+        return new Date();
+    }
+
+    /**
+     * 取得系统当前时间
+     */
+    public static long getTime() {
+        return getDate().getTime();
+    }
+
+    /**
+     * 取得系统当前日期
+     */
+    public static String getNowDate() {
+        return dateToString(new Date(), DATE_FORMAT_ONE);
+    }
+
+    public static Date nowDate() {
+        return formatDate(new Date(), DATE_FORMAT_ONE);
+    }
+
+    /**
+     * 取得系统当前时间
+     */
+    public static String getNowDatetime() {
+        return dateToString(new Date(), DATE_FORMAT_FIVE);
+    }
+
+    /**
+     * 取得系统具体时间
+     */
+    public static String getDetailDate() {
+        return dateToString(new Date(), DATE_FORMAT_FIFTEEN);
+    }
+
+    /**
+     * 取得系统当前时间
+     */
+    public static String getNowTime() {
+        return dateToString(new Date(), DATE_FORMAT_NINETEEN);
+    }
+
+    /**
+     * 取得当前年份
+     */
+    public static String getThisYear() {
+        return dateToString(new Date(), DATE_FORMAT_SIX);
+    }
+
+    /**
+     * 获取当前的日期所在的星期
+     * @param date 日期
+     * @return 数字星期
+     */
+    public static Integer getCurrDayOfWeek(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+        if (dayOfWeek == 1) {
+            dayOfWeek = 7;
+        } else {
+            dayOfWeek = dayOfWeek - 1;
+        }
+        return dayOfWeek;
+    }
+
+    /**
+     * 按指定格式转化字符串为Date
+     *
+     * @param strDate String
+     * @param strFormat String
+     *
+     * @return FormatDate
+     *
+     * @throws ParseException ParseException
+     */
+    public static Date getFormatDate(String strDate, String strFormat) throws ParseException {
+        if (StringUtil.isEmpty(strDate) || StringUtil.isEmpty(strFormat)) {
+            return null;
+        }
+
+        SimpleDateFormat df = new SimpleDateFormat(strFormat);
+        df.setLenient(false);
+        return df.parse(strDate);
+    }
+
+    /**
+     * 按指定格式转化Date为字符串
+     *
+     * @param date Date
+     * @param toFormat String
+     *
+     * @return FormatDate String
+     */
+    public static String dateToString(Date date, String toFormat) {
+
+        if (date == null) {
+            return "";
+        }
+
+        SimpleDateFormat df = new SimpleDateFormat(toFormat);
+        df.setLenient(false);
+        return df.format(date);
+    }
+
+
+    /**
+     * 按指定格式转化Date为字符串
+     *
+     * @param date Date
+     * @param strFormat String
+     *
+     * @return FormatDate String
+     */
+    public static Date formatDate(Date date, String strFormat) {
+        if (date == null) {
+            return null;
+        }
+        Date reDate = null;
+        try {
+            reDate = getFormatDate(dateToString(date, strFormat), strFormat);
+        } catch (ParseException e) {
+            date = null;
+        }
+        return reDate;
+    }
+
+    /**
+     * <PRE>
+     *
+     * 比较两个日期
+     *
+     * </PRE>
+     *
+     * @param day1 String
+     * @param day2 String
+     * @return int day1>day2返回1,day1<day2返回-1,day1=day2返回0
+     */
+    public static int compareDate(String day1, String day2) {
+
+        int isEarly = -1;
+
+        if (day1 == null || day1.trim().equals("") || day2 == null || day2.trim
+
+                ().equals("")) {
+            isEarly = -1;
+        } else {
+
+            day1 = day1.replaceAll("-", "");
+            day2 = day2.replaceAll("-", "");
+
+            int year1 = Integer.parseInt(day1.substring(0, INT_4));
+            int month1 = Integer.parseInt(day1.substring(INT_4, INT_6)) - 1;
+            int day = Integer.parseInt(day1.substring(INT_6, INT_8));
+            Calendar cal1 = Calendar.getInstance();
+            cal1.set(year1, month1, day);
+
+            int year2 = Integer.parseInt(day2.substring(0, INT_4));
+            int month2 = Integer.parseInt(day2.substring(INT_4, INT_6)) - 1;
+            int day22 = Integer.parseInt(day2.substring(INT_6, INT_8));
+            Calendar cal2 = Calendar.getInstance();
+            cal2.set(year2, month2, day22);
+
+            if (cal1.getTime().compareTo(cal2.getTime()) > 0) {
+                isEarly = 1;
+            } else if (cal1.getTime().compareTo(cal2.getTime()) == 0) {
+                isEarly = 0;
+            }
+        }
+        return isEarly;
+    }
+
+    /**
+     * <PRE>
+     *
+     * 比较两个日期
+     *
+     * </PRE>
+     *
+     * @param day1 String
+     * @param day2 String
+     * @param strFormat String
+     * @throws ParseException 异常
+     * @return int day1>day2返回1,day1<day2返回-1,day1=day2返回0
+     */
+    public static int compareDate(String day1, String day2, String strFormat) throws ParseException {
+        Date date1 = getFormatDate(day1, DATE_FORMAT_THREE);
+        Date date2 = getFormatDate(day2, DATE_FORMAT_THREE);
+        return date1.compareTo(date2);
+    }
+
+    /**
+     * 比较两个日期的大小
+     *
+     * @param date1
+     * @param date2
+     * @return int date1>date2返回1,date1<date2返回-1,date1=date2返回0
+     */
+    public static int compareDate(Date date1, Date date2) {
+        return date1.compareTo(date2);
+    }
+
+    /**
+     * 日期追加的计算
+     *
+     * @param strDate
+     *            原日期(YYYYMMDD)
+     * @param nAddNum
+     *            追加的年月日的大小
+     * @param nType
+     *            追加的类型
+     *
+     * @return 追加后的新日期(YYYYMMDD)
+     */
+    public static String addDate(String strDate, int nAddNum, int nType) {
+        int nYear = Integer.parseInt(strDate.substring(0, 4));
+        int nMonth = Integer.parseInt(strDate.substring(4, 6)) - 1;
+        int nDay = Integer.parseInt(strDate.substring(6));
+
+        GregorianCalendar objCal = new GregorianCalendar();
+        objCal.set(nYear, nMonth, nDay);
+
+        switch (nType) {
+            case 1: {
+                objCal.add(GregorianCalendar.YEAR, nAddNum);
+                break;
+            }
+            case 2: {
+                objCal.add(GregorianCalendar.MONTH, nAddNum);
+                break;
+            }
+            case 3: {
+                objCal.add(GregorianCalendar.DATE, nAddNum);
+                break;
+            }
+            case 4: {
+                objCal.add(GregorianCalendar.HOUR, nAddNum);
+                break;
+            }
+            case 5: {
+                objCal.add(GregorianCalendar.MINUTE, nAddNum);
+                break;
+            }
+            default: {
+                break;
+            }
+        }
+
+        return dateToString(objCal.getTime(), DATE_FORMAT_THREE);
+    }
+
+    /**
+     * 日期追加的计算
+     *
+     * @param date
+     *            原日期
+     * @param nAddNum
+     *            追加的年月日的大小
+     * @param nType
+     *            追加的类型
+     *
+     * @return 追加后的新日期
+     */
+    public static Date addDate(Date date, int nAddNum, int nType) {
+
+        GregorianCalendar objCal = new GregorianCalendar();
+        objCal.setTime(date);
+
+        switch (nType) {
+            case 1: {
+                objCal.add(GregorianCalendar.YEAR, nAddNum);
+                break;
+            }
+            case 2: {
+                objCal.add(GregorianCalendar.MONTH, nAddNum);
+                break;
+            }
+            case 3: {
+                objCal.add(GregorianCalendar.DATE, nAddNum);
+                break;
+            }
+            case 4: {
+                objCal.add(GregorianCalendar.HOUR, nAddNum);
+                break;
+            }
+            case 5: {
+                objCal.add(GregorianCalendar.MINUTE, nAddNum);
+                break;
+            }
+        }
+
+        return objCal.getTime();
+    }
+
+    /**
+     * 返回日期比较的中文格式
+     *
+     * @param date1 日期一
+     * @param date2 日期二
+     * @return ××年××月××天
+     */
+    public static String toChineseDiffDate(String date1, String date2) {
+
+        int diffMonth = 0;
+
+        int diffDay = 0;
+
+        int year = Integer.parseInt(date1.substring(0, 4));
+        int year1 = Integer.parseInt(date2.substring(0, 4));
+
+        int month = Integer.parseInt(date1.substring(4, 6)) - 1;
+        int month1 = Integer.parseInt(date2.substring(4, 6)) - 1;
+
+        int day = Integer.parseInt(date1.substring(6, 8));
+        int day1 = Integer.parseInt(date2.substring(6, 8));
+
+        Calendar startCalendar = Calendar.getInstance();
+        startCalendar.set(year, month, day, 0, 0, 0);
+
+        Calendar endCalendar = Calendar.getInstance();
+        endCalendar.set(year1, month1, day1, 0, 0, 0);
+
+        Date enddate = endCalendar.getTime();
+        Date startdate = startCalendar.getTime();
+        int monthDays = startCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
+        while (startdate.before(enddate)) {
+            diffDay++;
+            startCalendar.add(Calendar.DATE, 1);
+            startdate = startCalendar.getTime();
+            if (diffDay == monthDays) {
+                diffMonth++;
+                diffDay = 0;
+                monthDays = startCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
+            }
+        }
+        String strdate = "";
+        if (diffMonth / 12 > 0) {
+            strdate = strdate + diffMonth / 12 + "年";
+        }
+        if (diffMonth % 12 > 0) {
+            strdate = strdate + diffMonth % 12 + "月";
+        }
+        if (strdate.equals("") || diffDay > 0) {
+            strdate = strdate + diffDay + "日";
+        }
+        return strdate;
+    }
+
+
+    /**
+     *
+     * @param date 日期
+     * @param strLangFlag 语言标志
+     * @return 中文化的星期X
+     */
+    public static String getCnEnDayOfWeek(Date date, String strLangFlag) {
+        String strDayOfWeek = "星期";
+        String strEnDayOfWeek = "";
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+        if (dayOfWeek == 2) {
+            strDayOfWeek += "一";
+            strEnDayOfWeek += "Monday";
+        } else if (dayOfWeek == 3) {
+            strDayOfWeek += "二";
+            strEnDayOfWeek += "Tuesday";
+        } else if (dayOfWeek == 4) {
+            strDayOfWeek += "三";
+            strEnDayOfWeek += "Wednesday";
+        } else if (dayOfWeek == 5) {
+            strDayOfWeek += "四";
+            strEnDayOfWeek += "Thursday";
+        } else if (dayOfWeek == 6) {
+            strDayOfWeek += "五";
+            strEnDayOfWeek += "Friday";
+        } else if (dayOfWeek == 7) {
+            strDayOfWeek += "六";
+            strEnDayOfWeek += "Saturday";
+        } else {
+            strDayOfWeek += "日";
+            strEnDayOfWeek += "Sunday";
+        }
+        if (StringUtil.isEmpty(strLangFlag)) {
+            return strDayOfWeek;
+        }
+        return strEnDayOfWeek;
+
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 中文化的星期X
+     * @throws ParseException
+     */
+    public static String getCnEnDayOfWeek(String date) throws ParseException {
+        String strDayOfWeek = "星期";
+        String strEnDayOfWeek = "";
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(stringToDate(date, DATE_FORMAT_ONE));
+        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+        if (dayOfWeek == 2) {
+            strDayOfWeek += "一";
+            strEnDayOfWeek += "Monday";
+        } else if (dayOfWeek == 3) {
+            strDayOfWeek += "二";
+            strEnDayOfWeek += "Tuesday";
+        } else if (dayOfWeek == 4) {
+            strDayOfWeek += "三";
+            strEnDayOfWeek += "Wednesday";
+        } else if (dayOfWeek == 5) {
+            strDayOfWeek += "四";
+            strEnDayOfWeek += "Thursday";
+        } else if (dayOfWeek == 6) {
+            strDayOfWeek += "五";
+            strEnDayOfWeek += "Friday";
+        } else if (dayOfWeek == 7) {
+            strDayOfWeek += "六";
+            strEnDayOfWeek += "Saturday";
+        } else {
+            strDayOfWeek += "日";
+            strEnDayOfWeek += "Sunday";
+        }
+
+        return strDayOfWeek;
+
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @param strLangFlag 日期
+     * @return 英文日期
+     */
+    public static String getCurrentDayOfWeek(Date date, String strLangFlag) {
+        SimpleDateFormat sdf = null;
+
+        if (StringUtil.isEmpty(strLangFlag)) {
+            sdf = new SimpleDateFormat(DATE_FORMAT_FORTY, Locale.CHINESE);
+        } else {
+            sdf = new SimpleDateFormat(DATE_FORMAT_THIRTY, Locale.ENGLISH);
+        }
+        String strDate = sdf.format(Calendar.getInstance().getTime());
+        return strDate;
+
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @throws ParseException 异常
+     * @return 今年最后一天 yyyy-MM-dd
+     */
+    public static Date getNowYearLastDay(Date date) throws ParseException {
+        String lastDay = new SimpleDateFormat(DATE_FORMAT_SIX).format(date) + "-12-31";
+        return new SimpleDateFormat(DATE_FORMAT_ONE).parse(lastDay);
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @throws ParseException 异常
+     * @return 今年的第一天 yyyy-MM-dd
+     */
+    public static Date getNowYearFirstDay(Date date) throws ParseException {
+        String firstDay = new SimpleDateFormat(DATE_FORMAT_SIX).format(date) + "-01-01";
+        return new SimpleDateFormat(DATE_FORMAT_ONE).parse(firstDay);
+    }
+
+    /**
+     *
+     * @param sd1 日期
+     * @param ed2 日期
+     * @return 日期相隔天数
+     */
+    public static int diffDay(Date sd1, Date ed2) {
+        if (null == sd1 || null == ed2) {
+            return -1;
+        }
+        Calendar d1 = Calendar.getInstance();
+        Calendar d2 = Calendar.getInstance();
+        d1.setFirstDayOfWeek(Calendar.SUNDAY);
+        d2.setFirstDayOfWeek(Calendar.SUNDAY);
+        d1.setTime(sd1);
+        d2.setTime(ed2);
+        if (d1.after(d2)) { // swap dates so that d1 is start and d2 is end
+            Calendar swap;
+            swap = d1;
+            d1 = d2;
+            d2 = swap;
+        }
+        int days = d2.get(Calendar.DAY_OF_YEAR) - d1.get(Calendar.DAY_OF_YEAR);
+        int y2 = d2.get(Calendar.YEAR);
+        if (d1.get(Calendar.YEAR) != y2) {
+            d1 = (Calendar) d1.clone();
+            do {
+                days += d1.getActualMaximum(Calendar.DAY_OF_YEAR);
+                d1.add(Calendar.YEAR, 1);
+            } while (d1.get(Calendar.YEAR) != y2);
+        }
+        return days;
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @param date1 日期
+     * @param n 倍数
+     * @return 两个日期之间间隔天数是否是n的倍数
+     */
+    public static boolean isDayMultN(Date date, Date date1, int n) {
+        return (diffDay(date, date1) % n) == 0;
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @param date1 日期
+     * @return 日期相隔周数
+     */
+    public static int diffWeek(Date date, Date date1) {
+        return (int) ((getNextMonday(date).getTime() - getNextMonday(date1).getTime()) / (1000 * 60 * 60 * 3600 * 7));
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @param date1 日期
+     * @param n 倍数
+     * @return 两个日期之间间隔周数是否是n的倍数
+     */
+    public static boolean isWeekMultN(Date date, Date date1, int n) {
+        return (diffWeek(date, date1) % n) == 0;
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 获得周一的日期
+     */
+    public static Date getMonday(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setFirstDayOfWeek(Calendar.SUNDAY);
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
+        return c.getTime();
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 获得周一的日期
+     */
+    public static Date getSunday(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setFirstDayOfWeek(Calendar.SUNDAY);
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
+        return c.getTime();
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 获得周六的日期
+     */
+    public static Date getSaturday(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setFirstDayOfWeek(Calendar.SUNDAY);
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
+        return c.getTime();
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 获得某日为该周第几天
+     */
+    public static int getDayOfWeek(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setFirstDayOfWeek(Calendar.SUNDAY);
+        calendar.setTime(date);
+        return calendar.get(Calendar.DAY_OF_WEEK);
+    }
+
+    /**
+     * @param date 日期
+     * @return 获得当月第一天
+     */
+    public static Date getFirstDayOfCurrMonth(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setFirstDayOfWeek(Calendar.SUNDAY);
+        calendar.setTime(date);
+        int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
+        calendar.add(Calendar.DATE, 1 - dayOfMonth);
+        return calendar.getTime();
+    }
+
+    public static String getLastDayOfMonth(int year,int month) {
+        Calendar cal = Calendar.getInstance();
+        //设置年份
+        cal.set(Calendar.YEAR,year);
+        //设置月份
+        cal.set(Calendar.MONTH, month-1);
+        //获取某月最大天数
+        int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
+        //设置日历中月份的最大天数
+        cal.set(Calendar.DAY_OF_MONTH, lastDay);
+        //格式化日期
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String lastDayOfMonth = sdf.format(cal.getTime());
+        return lastDayOfMonth;
+    }
+
+    /**
+     * 取得某天是一年中的多少周
+     *
+     * @param date date
+     * @return 某天是一年中的多少周
+     */
+    public static int getWeekOfYear(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+
+        int currMonth = c.get(Calendar.MONTH);
+        if (currMonth == 11 && c.get(Calendar.WEEK_OF_YEAR) == 1) {
+            // 取上周周一
+            c.add(Calendar.DATE, -7);
+            return c.get(Calendar.WEEK_OF_YEAR) + 1;
+
+        } else {
+            return c.get(Calendar.WEEK_OF_YEAR);
+        }
+    }
+
+    /**
+     * 得到某一年周的总数
+     *
+     * @param year year
+     * @return 某一年周的总数
+     */
+    public static int getMaxWeekNumOfYear(int year) {
+        Calendar c = new GregorianCalendar();
+        c.set(year, Calendar.DECEMBER, 31, 23, 59, 59);
+        return getWeekOfYear(c.getTime());
+    }
+
+    /**
+     *
+     * @param date 日期
+     * @return 该月第几周
+     */
+    public static int getWeekOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setFirstDayOfWeek(Calendar.SUNDAY);
+        c.setTime(date);
+        return c.get(Calendar.WEEK_OF_MONTH);
+    }
+
+    /**
+     * 获得日期的下一个星期一的日期
+     *
+     * @param day day
+     * @return 日期的下一个星期一的日期
+     */
+    public static Date getNextMonday(Date day) {
+        Calendar date = Calendar.getInstance();
+        date.setFirstDayOfWeek(Calendar.SUNDAY);
+        date.setTime(day);
+        Calendar result = null;
+        result = date;
+        do {
+            result = (Calendar) result.clone();
+            result.add(Calendar.DATE, 1);
+        } while (result.get(Calendar.DAY_OF_WEEK) != 2);
+
+        return result.getTime();
+    }
+
+    /**
+     * 获得本周第一天的日期(星期天为第一天)
+     *
+     * @param day day
+     * @return 本周第一天的日期(星期天为第一天)
+     */
+    public static Date getFirstDayOfWeek(Date day) {
+        Calendar date = Calendar.getInstance();
+        date.setFirstDayOfWeek(Calendar.SUNDAY);
+        date.setTime(day);
+        date.set(Calendar.DAY_OF_WEEK, date.getFirstDayOfWeek());
+        return date.getTime();
+    }
+
+    /**
+     * 获得本周最后一天的日期(星期天为第一天)
+     *
+     * @param day day
+     * @return 获得本周最后一天的日期(星期天为第一天)
+     */
+    public static Date getLastDayOfWeek(Date day) {
+        Date firstDayOfWeek = getFirstDayOfWeek(day);
+        Date lastDayOfWeek = addDay2(firstDayOfWeek, 6);
+        return lastDayOfWeek;
+    }
+
+    /**
+     * 获得日期包含月份的最大日期
+     *
+     * @param dateString 日期字符串 "2000-01-01"
+     * @param applyPattern 日期的模式 "yyyy-MM-dd"
+     * @throws ParseException 异常
+     * @return 最大日期
+     */
+    public static int getMaxDayOfMonth(String dateString, String applyPattern) throws ParseException {
+        int d = 0;
+
+        Calendar c = Calendar.getInstance();
+        c.setFirstDayOfWeek(Calendar.SUNDAY);
+        SimpleDateFormat sdf = new SimpleDateFormat();
+        sdf.applyPattern("yyyy-MM-dd");
+        c.setTime(sdf.parse(dateString));
+        d = c.getActualMaximum(Calendar.DAY_OF_MONTH);
+
+        return d;
+    }
+
+    /**
+     * 获取指定日期月份的第一天
+     * @param date 日期
+     * @return 字符串日期
+     */
+    public static String getFirstDayOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateStr = sdf.format(c.getTime());
+        return dateStr;
+    }
+
+    /**
+     * 获取指定日期月份的第一天
+     * @param date 日期
+     * @return 字符串日期
+     */
+    public static Date getFirstDayOfMonth2(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return formatDate(c.getTime(), DATE_FORMAT_ONE);
+    }
+
+    /**
+     * 获取指定日期月份的最后一天
+     * @param date 日期
+     * @return 字符串日期
+     */
+    public static Date getLastDayOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.MONTH, 1);
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        c.add(Calendar.DAY_OF_MONTH, -1);
+        return formatDate(c.getTime(), DATE_FORMAT_ONE);
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @return 日期字符串形式
+     */
+    public static String addDay(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.DAY_OF_MONTH, num);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String dateStr = sdf.format(c.getTime());
+        return dateStr;
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @return 日期字符串形式 yyyy-MM-dd HH:mm:ss
+     */
+    public static String addDayy(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.DAY_OF_MONTH, num);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateStr = sdf.format(c.getTime());
+        return dateStr;
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @return 日期字符串形式
+     * @throws ParseException
+     */
+    public static Date addDay(String date, int num) throws ParseException {
+        Date temDate = string2Date(date, null);
+        Calendar c = Calendar.getInstance();
+        c.setTime(temDate);
+        c.add(Calendar.DAY_OF_MONTH, num);
+        return c.getTime();
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @param format 日期格式
+     * @return 日期字符串形式
+     * @throws ParseException
+     */
+    public static String addDay(String date, int num, String format) throws ParseException {
+        Date temDate = string2Date(date, null);
+        Calendar c = Calendar.getInstance();
+        c.setTime(temDate);
+        c.add(Calendar.DAY_OF_MONTH, num);
+        return DateUtil.dateToString(c.getTime(), format);
+    }
+
+    /**
+     * 在当前日期上追加N月
+     * @param date 当前日期
+     * @param num 添加月数
+     * @return Date
+     * @throws ParseException
+     */
+    public static Date addMonth(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.MONTH, num);
+        return c.getTime();
+    }
+
+
+    /**
+     * 在当前日期上追加N月
+     * @param date 当前日期
+     * @param num 添加月数
+     * @return Date
+     * @throws ParseException
+     */
+    public static String addMonth(String date, int num) {
+        String monthDay = "";
+        try {
+            Date d1 = DateUtil.string2Date(date, DateUtil.DATE_FORMAT_ONE);
+            Date d2 = addMonth(d1, num);
+            monthDay = DateUtil.dateToString(d2, DateUtil.DATE_FORMAT_ONE);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return monthDay;
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @return 日期字符串形式
+     */
+    public static Date addDay2(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.DAY_OF_MONTH, num);
+        return c.getTime();
+    }
+
+    /**
+     * 在当前日期上追加N天
+     * @param date 当前日期
+     * @param num 添加天数
+     * @return 日期字符串形式
+     */
+    public static Date addMinute(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.MINUTE, num);
+        return c.getTime();
+    }
+
+    /**
+     * 在当前日期上追加N周
+     * @param date 当前日期
+     * @param num 添加周数
+     * @return 日期字符串形式
+     */
+    public static Date addWeekDate(String date, int num) {
+        Date weekDay = null;
+        try {
+            Date d1 = DateUtil.string2Date(date, DateUtil.DATE_FORMAT_ONE);
+            weekDay = addWeek(d1, num);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return weekDay;
+    }
+    /**
+     * 在当前日期上追加N周
+     * @param date 当前日期
+     * @param num 添加周数
+     * @return 日期字符串形式
+     */
+    public static String addWeek(String date, int num) {
+        String weekDay = "";
+        try {
+            Date d1 = DateUtil.string2Date(date, DateUtil.DATE_FORMAT_ONE);
+            Date d2 = addWeek(d1, num);
+            weekDay = DateUtil.dateToString(d2, DateUtil.DATE_FORMAT_ONE);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return weekDay;
+    }
+
+    /**
+     * 在当前日期上追加N周
+     * @param date 当前日期
+     * @param num 添加周数
+     * @return 日期字符串形式
+     */
+    public static Date addWeek(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.WEEK_OF_YEAR, num);
+        return c.getTime();
+    }
+
+    /**
+     * 在当前日期上追加N年
+     * @param date 当前日期
+     * @param num 添加年数
+     * @return 日期字符串形式
+     */
+    public static Date addYear(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.YEAR, num);
+        return c.getTime();
+    }
+
+    /**
+     * 根据指定的格式转换字符串为日期,格式为空默认使用“yyyy-MM-dd”
+     * @param date 日期字符串
+     * @param format 格式
+     * @return Date
+     * @throws ParseException
+     */
+    public static Date string2Date(String date, String format) throws ParseException {
+        if (StringUtil.isEmpty(format)) {
+            format = DATE_FORMAT_ONE;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        return sdf.parse(date);
+    }
+
+    /**
+     * 根据指定的格式转换字符串为日期,格式为空默认使用“yyyy-MM-dd”
+     * @param date 日期字符串
+     * @param format 格式
+     * @return Date
+     * @throws ParseException
+     */
+    public static Date stringToDate(String date, String format) throws ParseException {
+        if (StringUtil.isEmpty(format)) {
+            format = DATE_FORMAT_ONE;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        return sdf.parse(date);
+    }
+
+    /**
+     * 获取当前时间指定星期名所在的日期
+     * @param weekDayName 星期名称,值为Calendar.DAY_OF_WEEK
+     */
+    public static Date getDayWeek(int weekDayName) {
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
+        Date dayWeek = c.getTime();
+        return dayWeek;
+    }
+
+    /**
+     * 获取当前时间所在月份第一天
+     */
+    public static Date getFirstDayOfMonth() {
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return c.getTime();
+    }
+
+    /**
+     * 获取当前时间所在月份
+     */
+    public static Integer getCurrMonth() {
+        Calendar c = Calendar.getInstance();
+        return c.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取当前时间所在年份
+     */
+    public static Integer getCurrYear() {
+        Calendar c = Calendar.getInstance();
+        return c.get(Calendar.YEAR);
+    }
+
+    /**
+     * 获取当前时间所在月份
+     */
+    public static Integer getMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        return c.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取当前时间所在年份
+     */
+    public static Integer getYear(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        return c.get(Calendar.YEAR);
+    }
+
+    /**
+     * 获取当前时间所在日
+     */
+    public static Integer getDate(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        return c.get(Calendar.DATE);
+    }
+
+
+    /**
+     * 获得本周周一
+     *
+     * @param day day
+     * @return 本周周一
+     */
+    public static Date getMondayOfWeek(Date day) {
+        Calendar date = Calendar.getInstance();
+        date.setFirstDayOfWeek(Calendar.MONDAY);
+        date.setTime(day);
+        date.set(Calendar.DAY_OF_WEEK, date.getFirstDayOfWeek());
+        return date.getTime();
+    }
+
+    /**
+     * 获取当前时间字符串表示的小时数
+     * @param date 时间字符串
+     * @return Integer 当前时间小时数
+     */
+    public static Integer getMinute(Date date) {
+        Integer minute = null;
+        try {
+            Calendar c = Calendar.getInstance();
+            c.setTime(date);
+            minute = c.get(Calendar.MINUTE);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return minute;
+    }
+
+
+    /**
+     * 在当前日期上追加N小时
+     * @param date 当前日期
+     * @param num 添加小时数
+     * @return 日期字符串形式
+     */
+    public static Date addHour(Date date, int num) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.HOUR_OF_DAY, num);
+        return c.getTime();
+    }
+
+    /**
+     * 指定的时间戳获取日期对象
+     * @param milliseconds 时间戳
+     * @return Date
+     */
+    public static Date getDate(Long milliseconds) {
+        Calendar c = Calendar.getInstance();
+        c.setTimeInMillis(milliseconds);
+        return c.getTime();
+    }
+
+    /**
+     * 计算两个日期之间相隔的天数,如果d2在d1之后返回正数,d2在d1之前返回负数,返回0表示相等
+     * @param d1
+     * @param d2
+     */
+    public static long compareDiffDay(Date d1, Date d2) {
+        long days = 0;
+        if (d1 != null && d2 != null) {
+            long diffMillisecounds = d2.getTime() - d1.getTime();
+            days = diffMillisecounds / DAY_MILLISECONDS;
+            long moreNum = diffMillisecounds % DAY_MILLISECONDS;
+            if (moreNum > 0) {
+                days = days + 1;
+            } else if (moreNum < 0) {
+                days = days - 1;
+            }
+        }
+        return days;
+    }
+
+    /**
+     * 获取当前时间字符串表示的小时数
+     * @param date 时间字符串
+     * @param parent 时间格式
+     * @return Integer 当前时间小时数
+     */
+    public static Integer getHour(String date, String parent) {
+        Integer hour = null;
+        Date tempDate;
+        try {
+            tempDate = stringToDate(date, parent);
+            Calendar c = Calendar.getInstance();
+            c.setTime(tempDate);
+            hour = c.get(Calendar.HOUR_OF_DAY);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return hour;
+    }
+
+    /**
+     * 获取当前时间字符串表示的小时数
+     * @param date 时间字符串
+     * @return Integer 当前时间小时数
+     */
+    public static Integer getHour(Date date) {
+        Integer hour = null;
+        try {
+            Calendar c = Calendar.getInstance();
+            c.setTime(date);
+            hour = c.get(Calendar.HOUR_OF_DAY);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return hour;
+    }
+
+    /**
+     * 获取当前时间字符串表示的分钟数
+     * @param day 时间字符串
+     * @return Integer 当前时间分钟数
+     */
+    public static String getMinute(String day) {
+        String str = "";
+
+        day = day.replaceAll("-", "");
+
+        int min = Integer.parseInt(day.substring(12, 14));
+
+        if (min <= 9) {
+            str = "0" + String.valueOf(min);
+        } else {
+            str = String.valueOf(min);
+        }
+
+        return str;
+    }
+
+    /**
+     * 获取当前时间字符串表示的小时数
+     * @param day 时间格式
+     * @return Integer 当前时间小时数
+     */
+    public static int getHour(String day) {
+
+        day = day.replaceAll("-", "");
+
+        int hour = Integer.parseInt(day.substring(9, 11));
+
+        return hour;
+    }
+
+    /**
+     * 获取在当月中的天数
+     * @param date
+     * @return
+     */
+    public static int getDayOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        return c.get(Calendar.DAY_OF_MONTH);
+    }
+
+    /**
+     * 以友好的方式显示时间
+     *
+     * @param datetime
+     * @return
+     */
+    public static String friendlyTime(Date datetime) {
+        if (datetime == null) {
+            return "";
+        }
+        String ftime = "";
+        long currTime = DateUtil.getTime();
+        long paramTime = datetime.getTime();
+        // 判断是否是同一天
+        String curDate = DateUtil.dateToString(new Date(), DateUtil.DATE_FORMAT_ONE);
+        String paramDate = DateUtil.dateToString(datetime, DateUtil.DATE_FORMAT_ONE);
+        if (curDate.equals(paramDate)) {
+            int hour = (int) ((currTime - paramTime) / 3600000);
+            if (hour == 0) {
+                ftime = Math.max((currTime - paramTime) / 60000, 1) + "分钟前";
+            } else {
+                ftime = hour + "小时前";
+            }
+            return ftime;
+        }
+        long lt = paramTime / 86400000;
+        long ct = currTime / 86400000;
+        int days = (int) (ct - lt);
+        if (days == 0) {
+            int hour = (int) ((paramTime - currTime) / 3600000);
+            if (hour == 0) {
+                ftime = Math.max((paramTime - currTime) / 60000, 1) + "分钟前";
+            } else {
+                ftime = hour + "小时前";
+            }
+        } else if (days == 1) {
+            ftime = "昨天";
+        } else if (days == 2) {
+            ftime = "前天";
+        } else if (days > 2 && days <= 10) {
+            ftime = days + "天前";
+        } else if (days > 10) {
+            ftime = DateUtil.dateToString(datetime, DateUtil.DATE_FORMAT_ONE);
+        }
+        return ftime;
+    }
+
+    /**
+     * 获取当日零点
+     * @param date
+     * @return
+     */
+    public static Date getTodayZeroTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    /**
+     * 获取当日零点
+     * @param date
+     * @return
+     */
+    public static Date getTodayZeroTime(String date) throws ParseException {
+        Date dateTime = stringToDate(date, DATE_FORMAT_ONE);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(dateTime);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    /**
+     * 获取明日零点
+     * @param date
+     * @return
+     */
+    public static Date getTomZeroTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        calendar.add(Calendar.DAY_OF_MONTH, 1);
+        return calendar.getTime();
+    }
+
+    /**
+     * 获取明日零点
+     * @param date
+     * @return
+     */
+    public static Date getTomZeroTime(String date) throws ParseException {
+        return getTomZeroTime(DateUtil.getFormatDate(date, DateUtil.DATE_FORMAT_ONE));
+    }
+
+    /**
+     * 计算2个日期相差多少分钟
+     * @param d1 较大时间
+     * @param d2 较小时间
+     * @return
+     */
+    public static int getCompareDiffDayMin(Date d1, Date d2) {
+        long diffMillisecounds = d1.getTime() - d2.getTime();
+        return (int) (diffMillisecounds / (1000 * 60));
+    }
+
+    public static String getCountDown(long currentTime, long targetTime) {
+        long distTime = targetTime - currentTime;
+        if (distTime <= 0) {
+            return "";
+        }
+        StringBuffer sb = new StringBuffer("");
+        long day = ((distTime / 1000) / (3600 * 24));
+        long hour = ((distTime / 1000) - day * 86400) / 3600;
+        long minutes = ((distTime / 1000) - day * 86400 - hour * 3600) / 60;
+        long seconds = (distTime / 1000) - day * 86400 - hour * 3600 - minutes * 60;
+        if (day > 0) {
+            sb.append(day).append(" 天  ");
+        }
+
+        if (hour < 10) {
+            sb.append("0").append(hour);
+        } else {
+            sb.append(hour);
+        }
+        sb.append(":");
+
+        if (minutes < 10) {
+            sb.append("0").append(minutes);
+        } else {
+            sb.append(minutes);
+        }
+        sb.append(":");
+
+        if (seconds < 10) {
+            sb.append("0").append(seconds);
+        } else {
+            sb.append(seconds);
+        }
+
+        return sb.toString();
+
+    }
+
+    public static String getCountDown(long currentTime, long targetTime, String expireStr) {
+
+        String countDownStr = getCountDown(currentTime, targetTime);
+        if (StringUtil.isEmpty(countDownStr)) {
+            countDownStr = expireStr;
+        }
+        return countDownStr;
+
+    }
+
+    /**
+     * 获取过去第几天的日期
+     *
+     * @param past
+     * @return
+     */
+    public static String getPastDate(int past) {
+        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("yyyy-MM-dd");
+        String result = format.format(today);
+        return result;
+    }
+
+    /**
+     * 获取两个日期之间的日期
+     * @param start 开始日期
+     * @param end 结束日期
+     * @return 日期集合
+     */
+    public static List<String> getBetweenDates(String start, String end) throws Exception {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        List<String> result = new ArrayList<String>();
+        int diffdays = diffDay(format.parse(start), format.parse(end));
+        if (diffdays >= 0) {
+            for (int i = 0; i <= diffdays; i++) {
+                String date = addDay(format.parse(start), i);
+                result.add(date);
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 获取两个日期之间的日期
+     * @param start 开始日期
+     * @param end 结束日期
+     * @return 日期集合
+     */
+    public static List<String> getBetweenDates(Date start, Date end) throws Exception {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        List<String> result = new ArrayList<String>();
+        int diffdays = diffDay(start, end);
+        if (diffdays >= 0) {
+            for (int i = 0; i <= diffdays; i++) {
+                String date = addDay(start, i);
+                result.add(date);
+            }
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 获取当前季度
+     *
+     */
+    public static int getQuarter() {
+        Calendar c = Calendar.getInstance();
+        int month = c.get(c.MONTH) + 1;
+        int quarter = 0;
+        if (month >= 1 && month <= 3) {
+            quarter = 1;
+        } else if (month >= 4 && month <= 6) {
+            quarter = 2;
+        } else if (month >= 7 && month <= 9) {
+            quarter = 3;
+        } else {
+            quarter = 4;
+        }
+        return quarter;
+    }
+
+    /**
+     * 获取某季度的第一天和最后一天
+     * @param num 第几季度
+     * @return
+     */
+    public static String[] getCurrQuarter(int num) {
+        String[] s = new String[2];
+        String str = "";
+        // 设置本年的季
+        Calendar quarterCalendar = null;
+        switch (num) {
+            case 1: // 本年到现在经过了一个季度,在加上前4个季度
+                quarterCalendar = Calendar.getInstance();
+                quarterCalendar.set(Calendar.MONTH, 3);
+                quarterCalendar.set(Calendar.DATE, 1);
+                quarterCalendar.add(Calendar.DATE, -1);
+                str = DateUtil.dateToString(quarterCalendar.getTime(), "yyyy-MM-dd");
+                s[0] = str.substring(0, str.length() - 5) + "01-01";
+                s[1] = str;
+                break;
+            case 2: // 本年到现在经过了二个季度,在加上前三个季度
+                quarterCalendar = Calendar.getInstance();
+                quarterCalendar.set(Calendar.MONTH, 6);
+                quarterCalendar.set(Calendar.DATE, 1);
+                quarterCalendar.add(Calendar.DATE, -1);
+                str = DateUtil.dateToString(quarterCalendar.getTime(), "yyyy-MM-dd");
+                s[0] = str.substring(0, str.length() - 5) + "04-01";
+                s[1] = str;
+                break;
+            case 3:// 本年到现在经过了三个季度,在加上前二个季度
+                quarterCalendar = Calendar.getInstance();
+                quarterCalendar.set(Calendar.MONTH, 9);
+                quarterCalendar.set(Calendar.DATE, 1);
+                quarterCalendar.add(Calendar.DATE, -1);
+                str = DateUtil.dateToString(quarterCalendar.getTime(), "yyyy-MM-dd");
+                s[0] = str.substring(0, str.length() - 5) + "07-01";
+                s[1] = str;
+                break;
+            case 4:// 本年到现在经过了四个季度,在加上前一个季度
+                quarterCalendar = Calendar.getInstance();
+                str = DateUtil.dateToString(quarterCalendar.getTime(), "yyyy-MM-dd");
+                s[0] = str.substring(0, str.length() - 5) + "10-01";
+                s[1] = str.substring(0, str.length() - 5) + "12-31";
+                break;
+        }
+        return s;
+    }
+
+    /**
+     *
+     * @param timeMillis 时间戳
+     * @param format 格式
+     * @author 汤星鹏
+     * @Description 时间戳转换
+     * @return java.lang.String
+     * @date 2019/12/23 12:59
+     */
+    public static String timeMillisToDate(Long timeMillis, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        String sd = sdf.format(new Date(Long.parseLong(String.valueOf(timeMillis))));
+        return sd;
+    }
+
+    /**
+     *
+     * @param date
+     * @author 汤星鹏
+     * @Description 判断该日期是不是今天
+     * @return boolean
+     * @date 2020/3/4 14:13
+     */
+    public static boolean isThisToday(Date date) {
+        Date now = getDate();
+        Date start = getTodayZeroTime(now);
+        Date end = getTomZeroTime(now);
+        boolean rs = false;
+        int large = compareDate(start, date);
+        int small = compareDate(end, date);
+        if (large <= 0 && small == 1) {
+            return true;
+        }
+        return rs;
+    }
+
+
+    /**
+     *
+     * @param date
+     * @author 汤星鹏
+     * @Description 判断是不是昨天
+     * @return boolean
+     * @date 2020/3/6 17:35
+     */
+    public static boolean isYesterday(Date date) {
+        Date now = getDate();
+        Date start = DateUtil.addDay2(getTodayZeroTime(now), -1);
+        Date end = DateUtil.addDay2(getTomZeroTime(now), -1);
+        boolean rs = false;
+        int large = compareDate(start, date);
+        int small = compareDate(end, date);
+        if (large <= 0 && small == 1) {
+            return true;
+        }
+        return rs;
+    }
+
+    /**
+     *
+     * @param date
+     * @author 汤星鹏
+     * @Description 判断是不是本周
+     * @return boolean
+     * @date 2020/3/6 17:35
+     */
+    public static boolean isThisWeek(Date date) {
+        Date now = getDate();
+        Date start = DateUtil.getFirstDayOfWeek(now);
+        Date end = DateUtil.getTomZeroTime(DateUtil.getLastDayOfMonth(now));
+        boolean rs = false;
+        int large = compareDate(start, date);
+        int small = compareDate(end, date);
+        if (large <= 0 && small == 1) {
+            return true;
+        }
+        return rs;
+    }
+
+    /**
+     *
+     * @param sd1 日期(yyyy-MM-dd)
+     * @param ed2 日期(yyyy-MM-dd)
+     * @author 汤星鹏
+     * @Description 日期相隔天数, 包括其本身。如:03-0103-022
+     * @date 2020/3/11 8:03
+     */
+    public static int diffDay(String sd1, String ed2) throws ParseException {
+        Date start = DateUtil.stringToDate(sd1, DateUtil.DATE_FORMAT_SIMPLE);
+        Date end = DateUtil.stringToDate(ed2, DateUtil.DATE_FORMAT_SIMPLE);
+        return diffDay(start, end);
+    }
+
+    /**
+     *
+     * @param sd1 日期(yyyy-MM-dd)
+     * @param ed2 日期(yyyy-MM-dd)
+     * @author 汤星鹏
+     * @Description 日期相隔天数, 包括其本身。如:03-0103-022
+     * @date 2020/3/11 8:03
+     */
+    public static int diffDayInclude(String sd1, String ed2) throws ParseException {
+        Date start = DateUtil.stringToDate(sd1, DateUtil.DATE_FORMAT_SIMPLE);
+        Date end = DateUtil.stringToDate(ed2, DateUtil.DATE_FORMAT_SIMPLE);
+        return diffDay(start, end) + 1;
+    }
+
+    /**
+     *
+     * @param sd1 日期(yyyy-MM-dd)
+     * @param ed2 日期(yyyy-MM-dd)
+     * @author 汤星鹏
+     * @Description 日期相隔天数, 包括其本身。如:03-0103-022
+     * @date 2020/3/11 8:03
+     */
+    public static int diffDayInclude(Date sd1, Date ed2) throws ParseException {
+        return diffDay(sd1, ed2) + 1;
+    }
+
+    private static Map weekNumberMap = new HashMap();
+
+    static {
+        weekNumberMap.put(0, 1);
+        weekNumberMap.put(1, 2);
+        weekNumberMap.put(2, 3);
+        weekNumberMap.put(3, 4);
+        weekNumberMap.put(4, 5);
+        weekNumberMap.put(5, 6);
+        weekNumberMap.put(6, 7);
+
+
+    }
+
+    public static Object getWeekNum(int strWeek) {
+        return weekNumberMap.get(strWeek);
+    }
+
+    public static String weekForNum(List weekDays) {
+        // 返回结果为组合的星期系数
+        String weekNumber = "";
+        for (Object weekDay : weekDays) {
+            weekNumber = weekNumber + "" + getWeekNum((Integer) weekDay).toString();
+        }
+        return weekNumber;
+
+
+    }
+
+    public static Integer dayForWeek(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        return calendar.get(Calendar.DAY_OF_WEEK);
+    }
+
+    public static List getDates(String dateFrom, String dateEnd, List weekDays) {
+        long time;
+        long perDayMilSec = 24L * 60 * 60 * 1000;
+        List dateList = new ArrayList();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        // 需要查询的星期系数
+        String strWeekNumber = weekForNum(weekDays);
+        try {
+            dateFrom = sdf.format(sdf.parse(dateFrom).getTime() - perDayMilSec);
+            while (true) {
+                time = sdf.parse(dateFrom).getTime();
+                time = time + perDayMilSec;
+                Date date = new Date(time);
+                dateFrom = sdf.format(date);
+                if (dateFrom.compareTo(dateEnd) <= 0) {
+                    // 查询的某一时间的星期系数
+                    Integer weekDay = dayForWeek(date);
+                    // 判断当期日期的星期系数是否是需要查询的
+                    if (strWeekNumber.contains(weekDay.toString())) {
+                        dateList.add(dateFrom);
+                    }
+                } else {
+                    break;
+                }
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return dateList;
+    }
+
+    public static List<String> dateParse(String startData, String endData) {
+        List<String> resultList = new ArrayList<>();
+
+        if (StringUtil.isEmpty(startData) || StringUtil.isEmpty(endData)) {
+            return resultList;
+        }
+
+        SimpleDateFormat sdf;
+        if (startData.length() < 10) {
+            sdf = new SimpleDateFormat("yyyy-MM");
+            Date d1 = null;//定义起始日期
+            Date d2 = null;//定义结束日期
+            try {
+                d1 = sdf.parse(startData);
+                d2 = sdf.parse(endData);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            Calendar dd = Calendar.getInstance();//定义日期实例
+            dd.setTime(d1);//设置日期起始时间
+            while (dd.getTime().before(d2)) {//判断是否到结束日期
+                String str = sdf.format(dd.getTime());
+                System.out.println(str);
+                resultList.add(str);
+                dd.add(Calendar.MONTH, 1);//进行当前日期月份加1
+            }
+            resultList.add(endData);
+        } else {
+            sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date dBegin = null;
+            Date dEnd = null;
+            try {
+                dBegin = sdf.parse(startData);
+                dEnd = sdf.parse(endData);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            List<Date> lDate = new ArrayList();
+            lDate.add(dBegin);
+            Calendar calBegin = Calendar.getInstance();
+            // 使用给定的 Date 设置此 Calendar 的时间
+            calBegin.setTime(dBegin);
+            Calendar calEnd = Calendar.getInstance();
+            // 使用给定的 Date 设置此 Calendar 的时间
+            calEnd.setTime(dEnd);
+            // 测试此日期是否在指定日期之后
+            while (dEnd.after(calBegin.getTime())) {   // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+                calBegin.add(Calendar.DAY_OF_MONTH, 1);
+                lDate.add(calBegin.getTime());
+            }
+            for (Date date : lDate) {
+//                System.out.println(sdf.format(date));
+                resultList.add(sdf.format(date));
+            }
+        }
+
+        return resultList;
+    }
+
+    public static int daysBetween(Date date1, Date date2) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date1);
+        long time1 = cal.getTimeInMillis();
+        cal.setTime(date2);
+        long time2 = cal.getTimeInMillis();
+        long between_days = (time2 - time1) / (1000 * 3600 * 24);
+
+        return Integer.parseInt(String.valueOf(between_days));
+    }
+    public static List<String> getPaymentDateArray(String qdrq, String jsrq, int i, String mcfkr) throws ParseException {
+        List<String> resultList = new ArrayList<>();
+
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+        //获取起点时间 结束时间
+        Date qdrqDate = sf.parse(qdrq);
+        Date jsrqDate = sf.parse(jsrq);
+        if (qdrq.substring(qdrq.length() - 2, qdrq.length()).equals("01")) {
+            String tempStr = sf.format(qdrqDate);
+            resultList.add(tempStr);
+        }
+
+        Date tempDate = addMonths(qdrqDate, i);
+
+        while (tempDate.getTime() < jsrqDate.getTime()) {
+            String tempStr = sf.format(tempDate);
+            tempStr = getDesignateDate(tempDate, tempStr, mcfkr);
+            resultList.add(tempStr);
+            tempDate = addMonths(tempDate, i);
+
+
+        }
+        if (jsrq.substring(jsrq.length() - 2, jsrq.length()).equals("01")) {
+            String tempStr = sf.format(jsrqDate);
+            resultList.add(tempStr);
+
+        }
+        return resultList;
+
+    }
+
+    /**
+     * 根据传入的数据进行日期的拼接
+     *
+     * @param tempDate 日期对象
+     * @param tempStr  传入的日期字符串 格式 2019-05-03
+     * @param mcfkr    传入的一月的哪一天 为数字 需要补零
+     * @return
+     */
+    public static String getDesignateDate(Date tempDate, String tempStr, String mcfkr) {
+        //如果传入的默认几日为空 直接返回传入的日期字符串
+        if (StringUtil.isEmpty(mcfkr)) {
+            return tempStr;
+        }
+        Integer tempInt = Integer.parseInt(mcfkr);
+        //如果默认日 大于28 则进行判断 如果30号  二月份应该给28 有30天的月份应该给30
+//		if (tempInt >= 28) {
+//			Calendar cal = Calendar.getInstance();
+//			cal.setTime(tempDate);
+//			int actualMaximum = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
+//			if (actualMaximum < tempInt) {
+//				tempInt = actualMaximum;
+//			}
+//		}
+        String resultStr = tempStr.substring(0, tempStr.length() - 2) + (tempInt > 10 ? tempInt + "" : "0" + tempInt);
+        return resultStr;
+    }
+
+    /**
+     * 给指定日期添加 i 月
+     *
+     * @param targetDate
+     * @param i          添加的月数
+     * @return
+     */
+    public static Date addMonths(Date targetDate, int i) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(targetDate);
+        cal.add(Calendar.MONTH, i);
+        return cal.getTime();
+    }
+
+    /**
+     *
+     * @param second
+     * @return
+     */
+    public static String secondToFormat(int second){
+        int h = second / 3600;
+        int m = second % 3600 / 60;
+        int s = second % 60; //不足60的就是秒,够60就是分
+        return String.format("%02d",h) + ":" + String.format("%02d",m) + ":" + String.format("%02d",s);
+    }
+
+    public static void main(String[] args) {
+        System.out.println(secondToFormat(12001));
+    }
+
+    public static int getYearOfQuarter(int month) {
+        Calendar c = Calendar.getInstance();
+        int quarter = 0;
+        if (month >= 1 && month <= 3) {
+            quarter = 1;
+        } else if (month >= 4 && month <= 6) {
+            quarter = 2;
+        } else if (month >= 7 && month <= 9) {
+            quarter = 3;
+        } else {
+            quarter = 4;
+        }
+        return quarter;
+    }
+
+    public static String getLastYear(Date date){
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.YEAR, -1);
+        Date y = c.getTime();
+        return format.format(y);
+    }
+
+
+}

+ 9 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/site/entity/FeiShuConfigEnum.java

@@ -4,8 +4,8 @@ package org.jeecg.modules.okki.site.entity;
  * @author Chen
  */
 public enum FeiShuConfigEnum {
-    PROD("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "X16RbjCVCasCmds7fn0c0k21nju", "tblSkc8HfEYDL99U", "tblr6rTYtEbLHmAg", "tbl9ykcEZBqZt1vj", "vewiMyOeed"),
-    DEV("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "J7vLb3DSzawXUEsJclic42KZnle", "tbllKsGJnErNNQiv", "tblfgKMLQAzcn7CP", "tblrtDtH1SiWUJiX", "vewiMyOeed");
+    PROD("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "X16RbjCVCasCmds7fn0c0k21nju", "tblSkc8HfEYDL99U", "tblr6rTYtEbLHmAg", "tbl9ykcEZBqZt1vj", "vewiMyOeed","tblihM4KnbHQg7S4"),
+    DEV("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "J7vLb3DSzawXUEsJclic42KZnle", "tbllKsGJnErNNQiv", "tblfgKMLQAzcn7CP", "tblrtDtH1SiWUJiX", "vewiMyOeed","tblihM4KnbHQg7S4");
 
     private final String appId;
     private final String appSecret;
@@ -17,7 +17,9 @@ public enum FeiShuConfigEnum {
     private final String seoTeamTableId;
     private final String kfTableSummaryViewId;
 
-    FeiShuConfigEnum(String appId, String appSecret, String appToken, String kfTableId, String projectTeamTableId, String seoTeamTableId, String kfTableSummaryViewId) {
+    private final String taskTableId;
+
+    FeiShuConfigEnum(String appId, String appSecret, String appToken, String kfTableId, String projectTeamTableId, String seoTeamTableId, String kfTableSummaryViewId,String taskTableId) {
         this.appId = appId;
         this.appSecret = appSecret;
         this.appToken = appToken;
@@ -25,6 +27,7 @@ public enum FeiShuConfigEnum {
         this.projectTeamTableId = projectTeamTableId;
         this.seoTeamTableId = seoTeamTableId;
         this.kfTableSummaryViewId = kfTableSummaryViewId;
+        this.taskTableId = taskTableId;
     }
 
     public String getAppId() {
@@ -55,4 +58,7 @@ public enum FeiShuConfigEnum {
         return kfTableSummaryViewId;
     }
 
+    public String getTaskTableId() {
+        return taskTableId;
+    }
 }

+ 16 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatinnergroup/entity/OkkiShopWechatInnerGroupMsg.java

@@ -120,6 +120,22 @@ public class OkkiShopWechatInnerGroupMsg implements Serializable {
     @ApiModelProperty(value = "updateTime")
     private java.util.Date updateTime;
 
+    /**
+     * dealStatus
+     */
+    @Excel(name = "dealStatus", width = 15)
+    @ApiModelProperty(value = "dealStatus")
+    private java.lang.Integer dealStatus;
+
     @TableField(exist = false)
     private String from;
+
+    @TableField(exist = false)
+    private String taskType;
+
+    @TableField(exist = false)
+    private String taskDay;
+
+    @TableField(exist = false)
+    private String taskUser;
 }

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatinnergroup/job/SyncWechatInnerGroupMsgJob.java

@@ -30,7 +30,7 @@ public class SyncWechatInnerGroupMsgJob implements Job {
         log.info(String.format("开始同步站点-【企业微信-内部群】消息-普通定时任务 SyncWechatInnerGroupMsgJob !  时间:" + DateUtils.now()));
         okkiShopWechatInnerGroupMsgService.getSiteWechatInnerMsgMaxSeqByMysql(this.parameter);
 
-        okkiShopWechatInnerGroupMsgService.getSiteWechatInnerMsgMaxSeqByMongodb(this.parameter);
+//        okkiShopWechatInnerGroupMsgService.getSiteWechatInnerMsgMaxSeqByMongodb(this.parameter);
         long end = System.currentTimeMillis();
         log.info("请求同步站点-【企业微信-内部群】消息-普通定时任务 SyncWechatInnerGroupMsgJob !结束,耗时:{}s", (end - start) / 1000);
     }

+ 5 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatinnergroup/service/IOkkiShopWechatInnerGroupMsgService.java

@@ -25,4 +25,9 @@ public interface IOkkiShopWechatInnerGroupMsgService extends IService<OkkiShopWe
      * @param siteId
      */
     public void getSiteWechatInnerMsgMaxSeqByMongodb(String siteId);
+
+    /**
+     * 获取【企业微信-内部群】任务消息
+     */
+    public void getInnerGroupTaskMsg(String siteId);
 }

+ 441 - 11
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatinnergroup/service/impl/OkkiShopWechatInnerGroupMsgServiceImpl.java

@@ -1,14 +1,38 @@
 package org.jeecg.modules.okki.wechatinnergroup.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.lang.Console;
+import cn.hutool.http.Header;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.lark.oapi.Client;
+import com.lark.oapi.core.utils.Jsons;
+import com.lark.oapi.service.bitable.v1.model.AppTableRecord;
+import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordReq;
+import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordResp;
+import com.volcengine.ark.runtime.model.completion.chat.ChatCompletionChoice;
+import com.volcengine.ark.runtime.model.completion.chat.ChatCompletionRequest;
+import com.volcengine.ark.runtime.model.completion.chat.ChatMessage;
+import com.volcengine.ark.runtime.model.completion.chat.ChatMessageRole;
+import com.volcengine.ark.runtime.service.ArkService;
 import lombok.extern.slf4j.Slf4j;
+import okhttp3.ConnectionPool;
+import okhttp3.Dispatcher;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.util.DateUtil;
 import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.common.util.ThreadPoolUtil;
+import org.jeecg.modules.okki.site.entity.FeiShuConfigEnum;
+import org.jeecg.modules.okki.site.entity.FeiShuConfigManager;
 import org.jeecg.modules.okki.site.entity.OkkiSite;
 import org.jeecg.modules.okki.site.service.IOkkiSiteService;
 import org.jeecg.modules.okki.utils.HttpClientUtils;
@@ -23,7 +47,12 @@ import org.springframework.data.mongodb.core.aggregation.AggregationResults;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.time.Duration;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
 
 /**
  * @Description: okki_shop_wechat_inner_group_msg
@@ -66,7 +95,7 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
                 OkkiShopWechatInnerGroupMsg okkiShopWechatInnerGroupMsg = shopWechatInnerGroupMsgs.get(finalI);
                 int maxSeq = okkiShopWechatInnerGroupMsg.getSeq() == 0 ? 1 : okkiShopWechatInnerGroupMsg.getSeq();
                 log.info("开始处理第{}个,站点ID为:{},seq为:{},【企业微信-内部群】消息", finalI + 1, okkiShopWechatInnerGroupMsg.getSiteId(), maxSeq);
-                saveWechatInnerGroupMsg(String.valueOf(okkiShopWechatInnerGroupMsg.getSiteId()), maxSeq,"mysql");
+                saveWechatInnerGroupMsg(String.valueOf(okkiShopWechatInnerGroupMsg.getSiteId()), maxSeq, "mysql");
             });
         }
     }
@@ -74,10 +103,10 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
     @Override
     public void getSiteWechatInnerMsgMaxSeqByMongodb(String siteId) {
         QueryWrapper<OkkiSite> queryWrapper = new QueryWrapper<>();
-        if(StringUtils.isNotBlank(siteId)){
-            queryWrapper.eq("site_id",siteId);
+        if (StringUtils.isNotBlank(siteId)) {
+            queryWrapper.eq("site_id", siteId);
         }
-        queryWrapper.eq("del_flag",0);
+        queryWrapper.eq("del_flag", 0);
         List<OkkiSite> okkiSites = okkiSiteService.list(queryWrapper);
 
         log.info("一共有:{}个站点,需要【企业微信-内部群】消息", okkiSites.size());
@@ -85,16 +114,16 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
             int finalI = i;
             ThreadPoolUtil.execute(() -> {
                 AggregationResults<GroupMsgResult> aggregationResults = wechatInnerGroupMongodbRepository.findMaxSeqBySiteId(Integer.valueOf(okkiSites.get(finalI).getSiteId()));
-                log.info("aggregationResults:{}",FastJsonUtil.toJSONString(aggregationResults));
+                log.info("aggregationResults:{}", FastJsonUtil.toJSONString(aggregationResults));
 
                 long maxSeq = 1;
-                if(!CollectionUtil.isEmpty(aggregationResults)){
+                if (!CollectionUtil.isEmpty(aggregationResults)) {
                     GroupMsgResult groupMsgResult = aggregationResults.getMappedResults().get(0);
                     maxSeq = groupMsgResult.getMaxSeq();
                 }
 
                 log.info("开始处理第{}个,站点ID为:{},seq为:{},【企业微信-内部群】消息", finalI + 1, okkiSites.get(finalI).getSiteId(), maxSeq);
-                saveWechatInnerGroupMsg(okkiSites.get(finalI).getSiteId(), Math.toIntExact(maxSeq),"mongodb");
+                saveWechatInnerGroupMsg(okkiSites.get(finalI).getSiteId(), Math.toIntExact(maxSeq), "mongodb");
             });
         }
     }
@@ -105,11 +134,12 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
      * @param siteId
      * @param minSeq
      */
-    public void saveWechatInnerGroupMsg(String siteId, Integer minSeq,String type) {
+    public void saveWechatInnerGroupMsg(String siteId, Integer minSeq, String type) {
         List<OkkiShopWechatInnerGroupMsg> wechatInnerGroupMsgList = sendWechatInnerGroupMsgRequest(siteId, minSeq);
         log.info("获取站点ID为:{},seq为:{},【企业微信-内部群】消息 条数一共有:{}", siteId, minSeq, wechatInnerGroupMsgList.size());
         List<OkkiShopWechatInnerGroupMsg> shopWechatInnerGroupMsgs = new ArrayList<>();
         if (!CollectionUtils.isEmpty(wechatInnerGroupMsgList)) {
+            // 循环处理数据,请求下一页
             wechatInnerGroupMsgList.forEach(c -> {
                 OkkiShopWechatInnerGroupMsg shopWechatInnerGroupMsg = new OkkiShopWechatInnerGroupMsg();
                 shopWechatInnerGroupMsg.setMsgId(c.getMsgId());
@@ -125,18 +155,23 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
                 shopWechatInnerGroupMsg.setSiteId(c.getSiteId());
                 shopWechatInnerGroupMsg.setCreateTime(c.getCreateTime());
                 shopWechatInnerGroupMsg.setUpdateTime(c.getUpdateTime());
+                if ("text".equals(c.getMsgType())) {
+                    shopWechatInnerGroupMsg.setDealStatus(0);
+                } else {
+                    shopWechatInnerGroupMsg.setDealStatus(1);
+                }
                 shopWechatInnerGroupMsgs.add(shopWechatInnerGroupMsg);
             });
 
-            if("mongodb".equals(type)){
+            if ("mongodb".equals(type)) {
                 wechatInnerGroupMongodbRepository.saveAll(shopWechatInnerGroupMsgs);
-            }else{
+            } else {
                 this.saveBatch(shopWechatInnerGroupMsgs);
             }
 
             //获取下一页数据
             OkkiShopWechatInnerGroupMsg lastWechatInnerGroupMsg = shopWechatInnerGroupMsgs.get(shopWechatInnerGroupMsgs.size() - 1);
-            saveWechatInnerGroupMsg(siteId, lastWechatInnerGroupMsg.getSeq(),type);
+            saveWechatInnerGroupMsg(siteId, lastWechatInnerGroupMsg.getSeq(), type);
         }
     }
 
@@ -181,4 +216,399 @@ public class OkkiShopWechatInnerGroupMsgServiceImpl extends ServiceImpl<OkkiShop
         return okkiShopWechatInnerGroupMsgs;
     }
 
+    /**
+     * 获取企业微信内部群消息任务
+     */
+    @Override
+    public void getInnerGroupTaskMsg(String siteId) {
+        log.info("-------- 开始获取【企业微信内部群】任务消息 siteId:{} -------", siteId);
+//        String endDay = "2025-02-01";
+//        String endDay = DateUtil.dateToString(DateUtil.addDate(new Date(),-1,3),DateUtil.DATE_FORMAT_ONE);
+//        log.info("查询截止时间: {}", endDay);
+
+        String modelType = "normal";
+        QueryWrapper<OkkiShopWechatInnerGroupMsg> queryWrapper = new QueryWrapper<>();
+
+        if ("normal".equals(modelType)) {
+            queryWrapper.like("content", "收到「");
+        }
+
+        if (StringUtils.isNotBlank(siteId)) {
+            queryWrapper.eq("site_id", siteId);
+        }
+
+        queryWrapper.notLike("from_id","@xiaoman.cn");
+        queryWrapper.eq("msg_type", "text");
+        queryWrapper.eq("deal_status", 0);
+//        queryWrapper.gt("msg_time", endDay);
+        queryWrapper.orderByAsc("msg_time");
+
+        List<OkkiShopWechatInnerGroupMsg> taskMsgs = this.list(queryWrapper);
+        log.info("taskMsgs:{}", FastJsonUtil.toJSONString(taskMsgs));
+
+        if (CollectionUtil.isEmpty(taskMsgs)) {
+            // 将处理过的消息 设为已处理
+            taskMsgs.forEach(c -> {
+                UpdateWrapper<OkkiShopWechatInnerGroupMsg> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.eq("msg_id", c.getMsgId());
+                updateWrapper.set("deal_status", 1);
+                this.update(updateWrapper);
+            });
+            return;
+        }
+
+        Map<Integer, List<OkkiShopWechatInnerGroupMsg>> groupedBySiteId =
+                taskMsgs.stream().collect(Collectors.groupingBy(OkkiShopWechatInnerGroupMsg::getSiteId));
+
+        for (Map.Entry<Integer, List<OkkiShopWechatInnerGroupMsg>> entry : groupedBySiteId.entrySet()) {
+            Integer entryKey = entry.getKey();
+            List<OkkiShopWechatInnerGroupMsg> messages = entry.getValue();
+            log.info("Site ID: {}, Message Count: {}", entryKey, messages.size());
+
+            if ("normal".equals(modelType)) {
+                // 普通模式,直接同步任务到飞书
+                log.info("一共有:{}个任务 需要同步至飞书多维表格", messages.size());
+                log.info("messages:{}", FastJsonUtil.toJSONString(messages));
+                messages.forEach(c -> {
+                    // 同步任务至飞书
+                    syncInnerGroupTaskToFeiShuSheet(c);
+                });
+
+            } else {
+                // AI 处理模式
+                String aiResp = getTaskByAIContent(messages);
+                log.info("aiResp:{}", aiResp);
+                if (StringUtils.isNotBlank(aiResp) &&
+                        !"请求失败,请重试!".equals(aiResp) &&
+                        !"[]".equals(aiResp)) {
+                    JSONArray jsonArray = new JSONArray(JSON.parseArray(aiResp));
+                    for (int i = 0; i < jsonArray.size(); i++) {
+                        JSONObject jsonObject = jsonArray.getJSONObject(i);
+                        log.info("解析出的任务: {}", jsonObject.toJSONString());
+
+                        OkkiShopWechatInnerGroupMsg innerGroupMsg = new OkkiShopWechatInnerGroupMsg();
+                        innerGroupMsg.setSiteId(Integer.valueOf(jsonObject.getString("siteId")));
+                        innerGroupMsg.setFromId(jsonObject.getString("sender"));
+                        innerGroupMsg.setContent(jsonObject.getString("content"));
+                        innerGroupMsg.setMsgTime(jsonObject.getDate("msgTime"));
+                        innerGroupMsg.setTaskType(jsonObject.getString("taskType"));
+                        innerGroupMsg.setTaskDay(jsonObject.getString("taskDay"));
+                        innerGroupMsg.setTaskUser(jsonObject.getString("taskUser"));
+
+                        syncInnerGroupTaskToFeiShuSheet(innerGroupMsg);
+                    }
+                }
+            }
+
+            // 将处理过的消息 设为已处理
+            messages.forEach(c -> {
+                UpdateWrapper<OkkiShopWechatInnerGroupMsg> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.eq("msg_id", c.getMsgId());
+                updateWrapper.set("deal_status", 1);
+                this.update(updateWrapper);
+            });
+
+            log.info("-------- 站点ID:{},获取【企业微信内部群】任务消息结束 -------", entryKey);
+        }
+
+    }
+
+    /**
+     * 根据AI内容获取任务
+     * @param taskMsgs
+     * @return
+     */
+    public String getTaskByAIContent(List<OkkiShopWechatInnerGroupMsg> taskMsgs) {
+        // ok user
+        Set<String> okUsers = new HashSet<>(Arrays.asList(
+                "roc", "tina", "lvy", "miya", "ash", "hardy", "emma", "bella", "kevin", "cora",
+                "jane", "chloe", "lucy", "oliver", "bailey", "lyn", "giselle", "polly", "lily",
+                "janne", "neo", "viani", "eva", "mick"
+        ));
+
+        JSONArray recordArray = new JSONArray();
+        taskMsgs.forEach(c -> {
+            JSONObject jsonRecord = new JSONObject();
+            String sender = okUsers.contains(c.getFromId()) ? c.getFromId() : "小满";
+
+            jsonRecord.put("sender", sender);
+            jsonRecord.put("siteId", c.getSiteId());
+            jsonRecord.put("msgId", c.getMsgId());
+            jsonRecord.put("content", c.getContent());
+            jsonRecord.put("msgTime", DateUtil.dateToString(DateUtil.formatDate(c.getMsgTime(), DateUtil.DATE_FORMAT_FIVE), DateUtil.DATE_FORMAT_FIVE));
+            recordArray.add(jsonRecord);
+        });
+
+        String jsonData = FastJsonUtil.toJSONString(recordArray);
+        log.info("jsonData:{}", jsonData);
+
+        String pormpt = "你需要根据接收到的消息内容识别工作任务,并生成标准化响应。请严格遵循以下处理流程:\n" +
+                "\n" +
+                "首先,检查消息内容是否包含以下7个核心关键词:\n" +
+                "<任务映射表>\n" +
+                "1. 预版式设计 → 预版式设计-建站专员 (2工作日)\n" +
+                "2. 版式设计 → 版式设计-建站专员 (2工作日)\n" +
+                "3. 资料回收 → 资料回收-资料专员 (2工作日)\n" +
+                "4. 拓词 → 关键词拓词-SEO专员 (3工作日)\n" +
+                "5. 网站内容填充 → 网站内容填充-资料专员 (5工作日)\n" +
+                "6. banner设计 → banner设计-UI设计 (3工作日)\n" +
+                "7. 网站细节修改 → 网站细节修改-建站专员 (2工作日)\n" +
+                "</任务映射表>\n" +
+                "\n" +
+                "处理步骤:\n" +
+                "1. 逐句扫描" + jsonData + "中的文本\n" +
+                "2. 按顺序检测content字段是否包含映射表中的精确关键词(中文字符需完全匹配)\n" +
+//                "3. 发现首个匹配的关键词后立即停止扫描\n" +
+                "3. 根据映射表生成对应的:\n" +
+                "   - taskType:任务类型全称\n" +
+                "   - taskDay:\"预计在X个工作日内完成\"中的X\n" +
+//                "   - content:标准响应模板\n" +
+                "   - taskUser:获取检查content字段@的谁\n" +
+                "4. 按顺序提取以下数据元素:\n" +
+                "   a. siteId(从原始数据获取)\n" +
+                "   b. sender(从原始数据获取)\n" +
+                "   c. content(从原始数据获取)\n" +
+                "   d. msgId(从原始数据获取)\n" +
+                "   e. msgTime(从原始数据获取,格式化为yyyy-MM-dd HH:mm:ss)\n" +
+                "5. 若未检测到任何关键词,返回\"[]\"\n" +
+                "\n" +
+                "输出要求:\n" +
+                "- 生成紧凑的JSON数组(无换行符)\n" +
+                "- 字段顺序必须为:siteId,sender, content, msgId, msgTime, taskType, taskDay\n" +
+                "- 所有字符串值使用双引号包裹\n" +
+                "- 严格使用英文标点符号\n" +
+                "- 禁止添加任何解释性文字\n" +
+                "\n" +
+                "示例输出:\n" +
+                "[{\"siteId\":\"123\",\"sender\":\"客户A\",\"content\":\"好的,已收到「版式设计」任务,预计2个工作日内完成。\",\"msgId\":\"MSG002\",\"msgTime\":\"2023-08-15 14:30:00\",\"taskType\":\"版式设计-建站专员\",\"taskDay\":\"2\",\"taskUser\":\"小明\"}]\n";
+
+        log.info("pormpt:{}", pormpt);
+
+        ConnectionPool connectionPool = new ConnectionPool(5, 1, TimeUnit.SECONDS);
+        Dispatcher dispatcher = new Dispatcher();
+        ArkService service = ArkService.builder()
+                .timeout(Duration.ofSeconds(1800))
+                .connectTimeout(Duration.ofSeconds(20))
+                .dispatcher(dispatcher)
+                .connectionPool(connectionPool).baseUrl("https://ark.cn-beijing.volces.com/api/v3")
+                .apiKey("d3371a7b-9ebd-4a23-a73c-8f2f4b7da98d").build();
+
+        List<ChatMessage> messages = new ArrayList<>();
+        ChatMessage userMessage = ChatMessage.builder().role(ChatMessageRole.USER).content(pormpt).build();
+        messages.add(userMessage);
+        ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest.builder()
+                .model("deepseek-r1-250120")
+                .messages(messages)
+                .build();
+
+//        String result = "";
+//        for (ChatCompletionChoice choice : service.createChatCompletion(chatCompletionRequest).getChoices()) {
+//            System.out.println(choice.getMessage().getReasoningContent());
+//            result = choice.getMessage().getContent().toString();
+//        }
+//        return result;
+
+        AtomicReference<String> result = new AtomicReference<>("");
+
+        List<ChatCompletionChoice> choices = service.createChatCompletion(chatCompletionRequest).getChoices();
+        if (choices.isEmpty()) {
+            log.warn("没有返回结果");
+            return "[]";
+        }
+
+        choices.forEach(choice -> {
+            log.info("getReasoningContent():{}", choice.getMessage().getReasoningContent());
+            String content = choice.getMessage().getContent().toString();
+            result.set(content != null ? content : "[]");
+        });
+
+        return result.get();
+    }
+
+    /**
+     * 获取AI回复
+     *
+     * @param taskMsgs
+     * @return
+     */
+    public String getTaskByAIContent2(List<OkkiShopWechatInnerGroupMsg> taskMsgs) {
+        // ok user
+        Set<String> okUsers = new HashSet<>(Arrays.asList(
+                "roc", "tina", "lvy", "miya", "ash", "hardy", "emma", "bella", "kevin", "cora",
+                "jane", "chloe", "lucy", "oliver", "bailey", "lyn", "giselle", "polly", "lily",
+                "janne", "neo", "viani", "eva", "mick"
+        ));
+
+        JSONArray recordArray = new JSONArray();
+        taskMsgs.forEach(c -> {
+            JSONObject jsonRecord = new JSONObject();
+            String sender = okUsers.contains(c.getFromId()) ? c.getFromId() : "小满";
+
+            jsonRecord.put("sender", sender);
+            jsonRecord.put("siteId", c.getSiteId());
+            jsonRecord.put("msgId", c.getMsgId());
+            jsonRecord.put("content", c.getContent());
+            jsonRecord.put("msgTime", DateUtil.dateToString(DateUtil.formatDate(c.getMsgTime(), DateUtil.DATE_FORMAT_FIVE), DateUtil.DATE_FORMAT_FIVE));
+            recordArray.add(jsonRecord);
+        });
+        log.info("recordArray:{}", FastJsonUtil.toJSONString(recordArray));
+        String jsonData = FastJsonUtil.toJSONString(recordArray);
+
+        JSONObject json = new JSONObject();
+        JSONArray messageArr = new JSONArray();
+
+        JSONObject sysMsgJson = new JSONObject();
+        sysMsgJson.put("role", "system");
+        sysMsgJson.put("content", "#角色 任务分配协调员:根据任务类型,将任务分配给合适的角色(如建站专员、SEO 专员、资料专员等)。");
+        messageArr.add(sysMsgJson);
+
+        String pormpt = "你需要根据接收到的消息内容识别工作任务,并生成标准化响应。请严格遵循以下处理流程:\n" +
+                "\n" +
+                "首先,检查消息内容是否包含以下7个核心关键词:\n" +
+                "<任务映射表>\n" +
+                "1. 预版式设计 → 预版式设计-建站专员 (2工作日)\n" +
+                "2. 版式设计 → 版式设计-建站专员 (2工作日)\n" +
+                "3. 资料回收 → 资料回收-资料专员 (2工作日)\n" +
+                "4. 拓词 → 关键词拓词-SEO专员 (3工作日)\n" +
+                "5. 网站内容填充 → 网站内容填充-资料专员 (5工作日)\n" +
+                "6. banner设计 → banner设计-UI设计 (3工作日)\n" +
+                "7. 网站细节修改 → 网站细节修改-建站专员 (2工作日)\n" +
+                "</任务映射表>\n" +
+                "\n" +
+                "处理步骤:\n" +
+                "1. 逐句扫描" + jsonData + "中的文本\n" +
+                "2. 按顺序检测content字段是否包含映射表中的精确关键词(中文字符需完全匹配)\n" +
+//                "3. 发现首个匹配的关键词后立即停止扫描\n" +
+                "3. 根据映射表生成对应的:\n" +
+                "   - taskType:任务类型全称\n" +
+                "   - taskDay:\"预计在X个工作日内完成\"中的X\n" +
+//                "   - content:标准响应模板\n" +
+                "   - taskUser:获取检查content字段@的谁\n" +
+                "4. 按顺序提取以下数据元素:\n" +
+                "   a. siteId(从原始数据获取)\n" +
+                "   b. sender(从原始数据获取)\n" +
+                "   c. content(从原始数据获取)\n" +
+                "   d. msgId(从原始数据获取)\n" +
+                "   e. msgTime(从原始数据获取,格式化为yyyy-MM-dd HH:mm:ss)\n" +
+                "5. 若未检测到任何关键词,返回\"暂无任务\"\n" +
+                "\n" +
+                "输出要求:\n" +
+                "- 生成紧凑的JSON数组(无换行符)\n" +
+                "- 字段顺序必须为:siteId,sender, content, msgId, msgTime, taskType, taskDay\n" +
+                "- 所有字符串值使用双引号包裹\n" +
+                "- 严格使用英文标点符号\n" +
+                "- 禁止添加任何解释性文字\n" +
+                "\n" +
+                "示例输出:\n" +
+                "[{\"siteId\":\"123\",\"sender\":\"客户A\",\"content\":\"好的,已收到「版式设计」任务,预计2个工作日内完成。\",\"msgId\":\"MSG002\",\"msgTime\":\"2023-08-15 14:30:00\",\"taskType\":\"版式设计-建站专员\",\"taskDay\":\"2\",\"taskUser\":\"小明\"}]\n";
+
+        log.info("pormpt:{}", pormpt);
+
+        JSONObject userMsgJson = new JSONObject();
+        userMsgJson.put("role", "user");
+        userMsgJson.put("content", pormpt);
+        messageArr.add(userMsgJson);
+
+//        JSONObject assistantMsgJson = new JSONObject();
+//        assistantMsgJson.put("role", "assistant");
+//        assistantMsgJson.put("content", "```json\n");
+//        assistantMsgJson.put("prefix", true);
+//        messageArr.add(assistantMsgJson);
+
+        json.put("messages", messageArr);
+        json.put("stream", false);
+//        json.put("model", "deepseek-ai/DeepSeek-R1");
+//        json.put("model", "deepseek-ai/DeepSeek-V3");
+
+//        json.put("model", "claude-3-5-sonnet-latest");
+
+//        json.put("model", "deepseek-reasoner");
+//        json.put("model", "deepseek-chat");
+
+        json.put("model", "deepseek-r1-250120");
+//        json.put("model", "doubao-pro-32k-241215");
+//        json.put("model", "doubao-1-5-pro-256k-250115");
+
+        log.info("json:{}", json.toJSONString());
+
+//        String url = "http://100.21.172.224:3000";
+//        String token = "sk-JZ53u4PJKTzdQVnF5c068f09DbCb451cAc7cDbF420FdD666";
+
+//        String url = "https://api.siliconflow.cn";
+//        String token = "sk-nnckizoasmqpvvtmiigmvntqdfxscsazxvsxxcqgzojnsmds";
+
+//        String url = "https://api.deepseek.com";
+//        String url = "https://api.deepseek.com/beta";
+//        String token = "sk-1d5bf2fcb29d4299a23231163d81b91a";
+
+        String url = "https://ark.cn-beijing.volces.com/api";
+        String token = "d3371a7b-9ebd-4a23-a73c-8f2f4b7da98d";
+
+        HttpResponse httpResponse = HttpRequest.post(url + "/v3/chat/completions")
+                .header(Header.AUTHORIZATION, "Bearer " + token)
+                .timeout(1000 * 60 * 5)
+                .body(json.toJSONString())
+                .execute();
+        Console.log(httpResponse);
+
+        String result = "";
+        int status = httpResponse.getStatus();
+
+        if (status == 200) {
+            String getRespResult = httpResponse.body();
+            log.info("getRespResult:{}", getRespResult);
+            JSONObject respJson = JSONObject.parseObject(getRespResult);
+            JSONObject jsonChocieObject = respJson.getJSONArray("choices").getJSONObject(0);
+            JSONObject jsonMessage = jsonChocieObject.getJSONObject("message");
+            result = jsonMessage.getString("content");
+        } else {
+            result = "请求失败,请重试!";
+        }
+
+        log.info("answerText:{}", result);
+        return result;
+    }
+
+    /**
+     * 保存内部群任务至飞书多维表格
+     */
+    public void syncInnerGroupTaskToFeiShuSheet(OkkiShopWechatInnerGroupMsg taskMsg) {
+        FeiShuConfigEnum configEnum = FeiShuConfigManager.getInstance().getConfigEnum();
+        Client client = Client.newBuilder(configEnum.getAppId(), configEnum.getAppSecret()).build();
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("网站ID", taskMsg.getSiteId());
+        map.put("任务状态", "未完成");
+        map.put("企微任务领取人", taskMsg.getFromId().toLowerCase());
+        map.put("任务内容", taskMsg.getContent());
+        map.put("任务领取时间", taskMsg.getMsgTime().getTime());
+        map.put("任务时长 / 工作日", taskMsg.getTaskDay());
+        map.put("企微任务执行人", taskMsg.getTaskUser());
+        map.put("任务类型", taskMsg.getTaskType());
+        CreateAppTableRecordReq req = CreateAppTableRecordReq.newBuilder().appToken(configEnum.getAppToken()).tableId(configEnum.getTaskTableId())
+                .appTableRecord(AppTableRecord.newBuilder()
+                        .fields(map)
+                        .build())
+                .build();
+
+        // 发起请求
+        CreateAppTableRecordResp resp = null;
+        try {
+            resp = client.bitable().v1().appTableRecord().create(req);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+
+        String syncStatus = "成功";
+        if (!resp.success()) {
+            log.error("执行 **** syncInnerGroupTaskToFeiShuSheet **** 同步 【企业微信内容群任务】 到飞书表格 失败:{}", String.format("code:%s,msg:%s,reqId:%s", resp.getCode(), resp.getMsg(), resp.getRequestId()));
+            syncStatus = "失败";
+        }
+
+//        log.info(Jsons.DEFAULT.toJson(resp.getData()));
+
+//        feiShuMsgService.sendSyncFeiShuSheetMsg(okkiSite.getCompanyName(), okkiSite.getSiteId(), okkiSite.getTcName(), syncStatus);
+//        return resp.getData().getRecord().getRecordId();
+    }
 }