Explorar o código

白名单功能调整

dzx hai 3 meses
pai
achega
cae3feeaa6

+ 9 - 1
src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java

@@ -37,7 +37,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -143,7 +145,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
 
         List<WhitelistManagement> whitelistManagements = new ArrayList<>();
         List<String> errorLogs = new ArrayList<>();
-
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         for (Map<Integer, Object> vo : savedDataList) {
             if(vo.get(0) == null || vo.get(1) == null || vo.get(2) == null){
                 errorList.add(vo);
@@ -158,6 +160,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
             Long userId = this.getUserId(credentialNumber);
             String phone = vo.get(2).toString();
 
+
             if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.isEmpty()) {
                 WhitelistManagement whitelistManagement = new WhitelistManagement();
                 whitelistManagement.setCreateDate(new Date());
@@ -168,6 +171,11 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
                 whitelistManagement.setCredentialNumber(credentialNumber);
                 whitelistManagement.setPhone(phone);
                 whitelistManagements.add(whitelistManagement);
+                if(vo.get(3) != null && "".equals(vo.get(3).toString())){
+                    LocalDate date = LocalDate.parse(vo.get(3).toString(), formatter);
+                    whitelistManagement.setEndTime(date);
+                    whitelistManagement.setIsTemporary(1);
+                }
             }
         }
 

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

@@ -5,7 +5,7 @@ server:
 spring:
   # 环 io境 dev|pre|prod
   profiles:
-    active: pre
+    active: prod
   # jackson时间格式化
   jackson:
     time-zone: GMT+8

+ 2 - 2
src/main/resources/sqlScript/all_sql.sql

@@ -384,9 +384,9 @@ CREATE TABLE IF NOT EXISTS course_subject_detail
     core_course            varchar(16)  NOT NULL COMMENT '是否专业核心课程',
     theory_time            int          NOT NULL COMMENT '理论教学时数',
     practice_time          int          NOT NULL COMMENT '实践教学时数',
-    online_course          varchar(1)   NOT NULL COMMENT '是否有线上课程',
+    online_course          varchar(20)   NOT NULL COMMENT '是否有线上课程',
     course_url             longtext     NULL COMMENT '线上课程网址',
-    ideology_demo          varchar(1)   NOT NULL COMMENT '是否思政示范课程',
+    ideology_demo          varchar(20)   NOT NULL COMMENT '是否思政示范课程',
     course_resource        varchar(10)  NULL DEFAULT '' COMMENT '课堂教学设计主要选用课程资源',
     emulation_time         int          NOT NULL COMMENT '虚拟仿真实训课时数',
     emulation_name         varchar(256) NULL DEFAULT '' COMMENT '主要开设虚拟仿真实训项目名称',