فهرست منبع

Merge remote-tracking branch 'origin/master'

LiGuang 3 سال پیش
والد
کامیت
88f5ab9535

+ 15 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -32,6 +32,12 @@ public class DateUtils extends PropertyEditorSupport {
             return new SimpleDateFormat("yyyyMMdd");
         }
     };
+    public static ThreadLocal<SimpleDateFormat> yyyy_MM = new ThreadLocal<SimpleDateFormat>() {
+        @Override
+        protected SimpleDateFormat initialValue() {
+            return new SimpleDateFormat("yyyy-MM");
+        }
+    };
     public static ThreadLocal<SimpleDateFormat> date_sdf_wz = new ThreadLocal<SimpleDateFormat>() {
         @Override
         protected SimpleDateFormat initialValue() {
@@ -481,6 +487,15 @@ public class DateUtils extends PropertyEditorSupport {
     // 将日期按照一定的格式转化为字符串
     // ////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * 默认方式表示的系统当前日期,具体格式:年-月
+     *
+     * @return 默认日期按“年-月“格式显示
+     */
+    public static String getNYTime() {
+        return yyyy_MM.get().format(getCalendar().getTime());
+    }
+
     /**
      * 默认方式表示的系统当前日期,具体格式:时:分
      *

+ 53 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/ReportIntoU8Job.java

@@ -1,25 +1,73 @@
 package org.jeecg.modules.quartz.job;
 
-import org.jeecg.modules.viewClockIn.entity.bdClockinMonth;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.system.util.DateUtils2;
 import org.jeecg.modules.viewClockIn.service.IbdClockinMonthService;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.List;
+import java.text.ParseException;
+import java.util.Date;
+
 
 public class ReportIntoU8Job implements Job {
     @Autowired
     private IbdClockinMonthService bdClockinMonthService;
 
+    private static String[] parsePatterns = {"yyyy-MM-dd","yyyy年MM月dd日",
+            "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy/MM/dd",
+            "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyyMMdd"};
+
+
+    /**
+     * 若参数变量名修改 QuartzJobController中也需对应修改
+     */
+    private String parameter;
+
+    public void setParameter(String parameter) {
+        this.parameter = parameter;
+    }
+
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
 
-        bdClockinMonthService.reportIntoU8Job("2021-12");
+        if(StringUtils.isEmpty(this.parameter)){
+//            bdClockinMonthService.reportIntoU8Job(DateUtils.getNYTime());
+            System.out.println("==========获取当前月份============"+DateUtils.getNYTime());
+        }else{
+            if(getStrError(this.parameter)){
+//                bdClockinMonthService.reportIntoU8Job(this.parameter);
+                System.out.println("==========获取参数月份============"+this.parameter);
+            }else{
+                System.out.println("==========参数填写有误 例:2021-12 ============"+this.parameter);
+            }
+        }
+
+    }
+
+    public static boolean getStrError(String str){
+
+        try {
+
+            String[] stList = str.split("-");
+            if(stList.length != 2){
+                return false;
+            }
+            if(Integer.valueOf(stList[0]) > 2030 || Integer.valueOf(stList[0]) < 2000){
+                return false;
+            }
+            if(Integer.valueOf(stList[1]) > 12 || Integer.valueOf(stList[1]) < 1){
+                return false;
+            }
 
-        System.out.println("======================");
-        System.out.println("======================");
+        } catch (Exception e) {
+            return false;
+        }
+        return true;
     }
 
 }

+ 29 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysUser.java

@@ -78,10 +78,34 @@ public class SysUser implements Serializable {
     private Date birthday;
 
 
-
+    /**
+     * 人员编码
+     */
     private String code;
 
+    /**
+     * 同步信息(0不同步,1同步到微信,2同步到u8,3都同步)
+     */
+    @Dict(dicCode = "infoSy")
     private Integer infoSy;
+    /**
+     * 同步状态(0未同步,1已同步)
+     */
+    @Dict(dicCode = "syState")
+    private Integer syState;
+
+    /**
+     * 雇佣状态 10在职 20离退 30离职
+     */
+    @Excel(name = "雇佣状态", width = 15,dicCode="employmentStatus")
+    @Dict(dicCode = "employmentStatus")
+    private Integer employmentStatus;
+    /**
+     * 人员类别 101正式工 102 合同工 103 实习生 104 劳务工
+     */
+    @Excel(name = "人员类别", width = 15,dicCode="category")
+    @Dict(dicCode = "category")
+    private Integer category;
 
     /**
      * 性别(1:男 2:女)
@@ -199,6 +223,10 @@ public class SysUser implements Serializable {
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private  Date entryDate;
+    /**离职日期**/
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private  Date termDate;
     /**紧急联系人**/
     @Excel(name="紧急联系人",width = 15)
     private  String urgentName;

+ 9 - 2
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -118,7 +118,7 @@ spring:
         timeBetweenEvictionRunsMillis: 60000
         # 配置一个连接在池中最小生存的时间,单位是毫秒
         minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
+        validationQuery: SELECT 1
         testWhileIdle: true
         testOnBorrow: false
         testOnReturn: false
@@ -131,10 +131,17 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/geke?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://10.0.0.199:3306/geke?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+#          url: jdbc:mysql://127.0.0.1:3306/geke?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: root
           password: 123
           driver-class-name: com.mysql.cj.jdbc.Driver
+
+        multi-datasource1:
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+          url: jdbc:sqlserver://10.0.0.199:1433;SelectMethod=cursor;DatabaseName=UFDATA_111_2021
+          username: sa
+          password: 123@qaz
           # 多数据源配置
           #multi-datasource1:
           #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai