فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

phoenix 1 سال پیش
والد
کامیت
27619777d8

+ 2 - 2
src/main/java/com/xjrsoft/module/base/entity/BaseCourseSubject.java

@@ -53,6 +53,6 @@ public class BaseCourseSubject implements Serializable {
     @ApiModelProperty("备注")
     private String remark;
 
-    @ApiModelProperty("开课机构")
-    private Long orgId;
+    @ApiModelProperty("标签id")
+    private Long baseLabelId;
 }

+ 59 - 0
src/main/java/com/xjrsoft/module/base/entity/BaseLabel.java

@@ -0,0 +1,59 @@
+package com.xjrsoft.module.base.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 基础标签表
+ * </p>
+ *
+ * @author dzx
+ * @since 2024-02-04
+ */
+@Data
+@TableName("base_label")
+@ApiModel(value = "BaseLabel", description = "基础标签表")
+public class BaseLabel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+
+    @ApiModelProperty("标签名称")
+    private String name;
+
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ApiModelProperty("标签分类")
+    private String category;
+
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/courseTable/entity/CourseTable.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 /**
@@ -89,6 +90,6 @@ public class CourseTable implements Serializable {
     private String jianyueId;
 
     @ApiModelProperty("上课日期")
-    private LocalDateTime scheduleDate;
+    private LocalDate scheduleDate;
 
 }

+ 10 - 6
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -310,7 +310,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             swapCourseTable.setWeeksCn(courseTableBak.getWeeksCn());
             courseTableMapper.updateById(swapCourseTable);
             //提交调课接口
-            sendExchange(courseTableBak, swapCourseTableBak);
+            sendExchange(courseTableBak, swapCourseTableBak, courseAdjust);
 
         }else if(CourseAdjustTypeEnum.courseSubstitute.getCode().equals(courseAdjust.getAdjustType())){
             CourseTable courseTable = courseTableMapper.selectById(courseAdjust.getCourseId());
@@ -335,6 +335,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
         jsonObject.addProperty("timetableId", courseTable.getJianyueId());
         jsonObject.addProperty("isCycles", Boolean.FALSE);
         jsonObject.addProperty("reason", courseAdjust.getReason());
+        jsonObject.addProperty("teacherId", courseAdjust.getUserId());
         JsonArray extendIds = new JsonArray();
         extendIds.add(courseTable.getTeacherId());
         jsonObject.add("extendIds", extendIds);
@@ -344,6 +345,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
         //生成签名
         String sign = ScheduleUtil.createSign(timestamp);
         String result = ScheduleUtil.doPost(url, jsonObject.toString(), sign, timestamp);
+        System.out.println(result);
     }
 
     /**
@@ -352,15 +354,17 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
      * @param swapCourseTable
      * @throws Exception
      */
-    void sendExchange(CourseTable courseTable, CourseTable swapCourseTable) throws Exception {
+    void sendExchange(CourseTable courseTable, CourseTable swapCourseTable, WfCourseAdjust courseAdjust) throws Exception {
         String url = ScheduleUtil.apiUrl + "RescheduleApply/Extend/Submit";
         JsonObject jsonObject = new JsonObject();
         jsonObject.addProperty("timetableId", courseTable.getJianyueId());
         jsonObject.addProperty("isCycles", Boolean.FALSE);
-
-        JsonArray extendIds = new JsonArray();
-        extendIds.add(courseTable.getTeacherId());
-        jsonObject.add("extendIds", extendIds);
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        jsonObject.addProperty("date", swapCourseTable.getScheduleDate().format(formatter));
+        jsonObject.addProperty("numberOfDay", swapCourseTable.getTimeNumber());
+        jsonObject.addProperty("rescheduleId", swapCourseTable.getJianyueId());
+        jsonObject.addProperty("reason", courseAdjust.getReason());
+        jsonObject.addProperty("teacherId", courseAdjust.getUserId());
 
         //获取时间戳
         long timestamp = System.currentTimeMillis();

+ 4 - 4
src/main/java/com/xjrsoft/module/job/JianyuekbBaseDataTask.java

@@ -27,10 +27,10 @@ import java.util.Set;
 public class JianyuekbBaseDataTask {
 
 
-    @Scheduled(cron = "0 */5 * * * ?")
+    @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();
-        if("prod".equals(active)){
+        if(!"prod".equals(active)){
             log.info("非正式环境,无法执行数据推送");
             return;
         }
@@ -71,8 +71,8 @@ public class JianyuekbBaseDataTask {
             tableName = "base_semester";
             dataUtil.insertSemester(use, tableName, dataMap.get(tableName));
             //推送标签
-            tableName = "xjr_department";
-            Map<Long, String> tagMap = dataUtil.insertTag(use, tableName, dataMap.get(tableName));
+            tableName = "base_label";
+            Map<Long, String> tagMap = dataUtil.insertCourseTag(use, tableName, dataMap.get(tableName));
             if(tagMap.isEmpty() && dataMap.get(tableName) != null){
                 tagMap = dataMap.get(tableName);
             }

+ 1 - 1
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -31,7 +31,7 @@ public class JianyuekbScheduleTask {
     @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();
-        if("prod".equals(active)){
+        if(!"prod".equals(active)){
             log.info("非正式环境,无法执行获取课表数据");
             return;
         }

+ 7 - 6
src/main/java/com/xjrsoft/module/schedule/util/DataUtil.java

@@ -9,6 +9,7 @@ import com.google.gson.JsonParser;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseCourseSubject;
 import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.entity.BaseLabel;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.schedule.vo.ClassroomJianyuekbVo;
@@ -201,9 +202,9 @@ public class DataUtil {
             paramJson.addProperty("name", courseSubject.getName() + courseSubject.getCode());
             paramJson.addProperty("code", courseSubject.getCode());
             paramJson.addProperty("extendId", courseSubject.getId().toString());
-            if(tagMap.get(courseSubject.getOrgId()) != null){
+            if(tagMap.get(courseSubject.getBaseLabelId()) != null){
                 JsonArray jsonArray = new JsonArray();
-                jsonArray.add(tagMap.get(courseSubject.getOrgId()));
+                jsonArray.add(tagMap.get(courseSubject.getBaseLabelId()));
                 paramJson.add("tagSerialNos", jsonArray);
             }
 
@@ -277,14 +278,14 @@ public class DataUtil {
         return idMap;
     }
 
-    public Map<Long, String> insertTag(Db db, String tableName, Map<Long, String> ids) throws Exception {
+    public Map<Long, String> insertCourseTag(Db db, String tableName, Map<Long, String> ids) throws Exception {
         String sql = "select * from " + tableName + " where delete_mark = 0" +
-                " and id in (select distinct org_id from base_course_subject where delete_mark = 0)";
-        List<Department> list = db.query(sql, Department.class);
+                " and id in (select distinct base_label_id from base_course_subject where delete_mark = 0)";
+        List<BaseLabel> list = db.query(sql, BaseLabel.class);
         String url = ScheduleUtil.apiUrl + "courseclass/tag/create";
         JsonParser jsonParser = new JsonParser();
         Map<Long, String> idMap = new HashMap<>();
-        for (Department department : list) {
+        for (BaseLabel department : list) {
             if(ids != null && ids.get(department.getId()) != null){
                 continue;
             }

+ 2 - 2
src/main/resources/application-dev.yml

@@ -5,7 +5,7 @@ spring:
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://192.168.144.209:3306/tl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&autoReconnect=true&failOverReadOnly=false
+    url: jdbc:mysql://10.150.10.139:3306/tl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&autoReconnect=true&failOverReadOnly=false
     username: root
     password: Zwr~-f6H,u6QE^]C-AD_
 #    dynamic:
@@ -19,7 +19,7 @@ spring:
 
   redis:
     database: 11
-    host: 192.168.144.209
+    host: 10.150.10.139
     port: 6379
     password: wa3re~86Hu&ifniyM   # 密码(默认为空)
     timeout: 36000ms  # 连接超时时长(毫秒)

+ 27 - 3
src/main/resources/sqlScript/20240125_sql.sql

@@ -127,7 +127,7 @@ DELIMITER $$
 CREATE
     PROCEDURE createCom()
 BEGIN
-    IF not EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='base_course_subject' AND COLUMN_NAME = 'org_id') THEN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='base_course_subject' AND COLUMN_NAME = 'org_id') THEN
 ALTER TABLE `base_course_subject`
     ADD COLUMN `org_id` BIGINT NULL   COMMENT '开课机构id' AFTER `remark`;
 END IF;
@@ -189,7 +189,7 @@ DELIMITER $$
 CREATE
     PROCEDURE createCom()
 BEGIN
-    IF not EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='evaluate_manage' AND COLUMN_NAME = 'is_auto_create') THEN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='evaluate_manage' AND COLUMN_NAME = 'is_auto_create') THEN
 
 ALTER TABLE `evaluate_manage`
     ADD COLUMN `is_auto_create` INT NULL   COMMENT '是否自动生成(0:否,1:是)' AFTER `status`,
@@ -302,7 +302,7 @@ DELIMITER $$
 CREATE
     PROCEDURE createCom()
 BEGIN
-    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='evaluate_result' AND COLUMN_NAME = 'submit_record_id') THEN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='evaluate_submit_record' AND COLUMN_NAME = 'status') THEN
         ALTER TABLE `evaluate_submit_record`
             ADD COLUMN `status` INT(0) NULL   COMMENT '状态(1:已评分,0:未评分)';
     END IF;
@@ -316,4 +316,28 @@ DROP PROCEDURE createCom;
 ALTER TABLE evaluate_submit_record MODIFY id varchar(64);
 -- -------------------------------------------------------------------评价-----------------------------------------------------------------
 
+ALTER TABLE `jianyue_data`   
+  CHANGE `jianyue_id` `jianyue_id` VARCHAR(40) NULL   COMMENT '对应的简约系统的id';
+  
+-- ------------------------------------
+-- 标签表
+-- ------------------------------------
+DROP TABLE IF EXISTS base_label;
+CREATE TABLE base_label
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` DATETIME NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` DATETIME NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `name` VARCHAR(255) NULL DEFAULT NULL COMMENT '标签名称',
+    `category`  VARCHAR(50) NULL DEFAULT NULL COMMENT '标签分类',
+    `remark`  VARCHAR(500) NULL DEFAULT NULL COMMENT '备注',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '基础标签表';
 
+ALTER TABLE `tl`.`base_course_subject`   
+  CHANGE `org_id` `base_label_id` BIGINT NULL   COMMENT '标签id(base_label)';