Parcourir la source

Merge branch 'dev' into pre

# Conflicts:
#	src/main/java/com/xjrsoft/config/FileCheckRuleConfig.java
snihwxf il y a 2 mois
Parent
commit
2ab8ed5cfb

+ 9 - 1
src/main/java/com/xjrsoft/config/FileCheckRuleConfig.java

@@ -80,6 +80,12 @@ public final class FileCheckRuleConfig {
                     "application/wps-office.wpt",
                     "application/wps-office.ett",
                     "application/wps-office.dpt",
+
+                    "application/kswps",
+                    // OFD MIME 类型
+                    "application/ofd",
+                    "application/x-ofd",
+
                     // 其他可能的 MIME 类型
                     "application/octet-stream", // 某些 WPS 文件可能被识别为此类型
                     "application/x-msdownload"
@@ -112,7 +118,9 @@ public final class FileCheckRuleConfig {
                     "application/x-iso9660-image",
                     "application/x-apple-diskimage",
                     "application/vnd.android.package-archive",
-                    "application/x-msdownload"
+                    "application/x-msdownload",
+                    "application/x-zip-compressed",
+                    "application/x-compressed"
             )
             .build();
 //    /**

+ 1 - 1
src/main/java/com/xjrsoft/module/courseTable/service/ICourseTableService.java

@@ -67,5 +67,5 @@ public interface ICourseTableService extends IService<CourseTable> {
 
     CurrentWeekVo getCurrentWeek(CourseTableDto dto);
 
-
+    CurrentWeekVo getCurrentWeekOld(CourseTableDto dto);
 }

+ 40 - 1
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -1494,7 +1494,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
     }
 
     @Override
-    public CurrentWeekVo getCurrentWeek(CourseTableDto dto) {
+    public CurrentWeekVo getCurrentWeekOld(CourseTableDto dto) {
         BaseSemester baseSemester = baseSemesterService.getCurrentSemester();
         if (baseSemester == null) {
             return null;
@@ -1524,4 +1524,43 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
         return null;
     }
 
+    @Override
+    public CurrentWeekVo getCurrentWeek(CourseTableDto dto) {
+        BaseSemester baseSemester = baseSemesterService.getCurrentSemester();
+        if (baseSemester == null) {
+            return null;
+        }
+        LocalDateTime now = LocalDateTime.now();
+        if (dto.getScheduleDate() != null) {
+            now = dto.getScheduleDate();
+        }
+
+        LocalDate semesterStart = LocalDate.ofInstant(baseSemester.getTeachingStart().toInstant(), ZoneId.systemDefault());
+        LocalDate semesterEnd = LocalDate.ofInstant(baseSemester.getTeachingEnd().toInstant(), ZoneId.systemDefault());
+
+        // 调整开始日期到本周星期一
+        LocalDate adjustedStart = semesterStart.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
+        // 调整结束日期到本周星期日
+        LocalDate adjustedEnd = semesterEnd.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
+
+        // 计算总周数
+        long totalDays = java.time.temporal.ChronoUnit.DAYS.between(adjustedStart, adjustedEnd) + 1;
+        int totalWeeks = (int) (totalDays / 7);
+
+        // 生成每一周的信息
+        for (int i = 0; i < totalWeeks; i++) {
+            LocalDateTime startDate = adjustedStart.plusWeeks(i).atStartOfDay();//.atTime(0, 0, 0);
+            LocalDateTime endDate = startDate.plusDays(6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+
+            if (now.isAfter(startDate) && now.isBefore(endDate)) {
+                CurrentWeekVo currentWeekVo = new CurrentWeekVo();
+                currentWeekVo.setWeek(i + 1);
+                currentWeekVo.setStartDate(startDate.toLocalDate());
+                currentWeekVo.setEndDate(endDate.toLocalDate());
+                return currentWeekVo;
+            }
+        }
+        return null;
+    }
+
 }

+ 4 - 2
src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java

@@ -357,7 +357,8 @@ public class DataUtil {
                     Entity entity = Entity.create(tableName);
                     entity.set("table_name", tableName);
                     entity.set("create_date", sdf.format(new Date()));
-                    entity.set("source_id", clientMap.get(paramJson.get("clientId").getAsInt()));
+//                    entity.set("source_id", clientMap.get(paramJson.get("clientId").getAsInt()));
+                    entity.set("source_id", paramJson.get("personId").getAsString());
                     entity.set("hikvision_id", paramJson.get("personId").getAsString());
                     entity.set("send_data", paramJson.toString());
                     insertList.add(entity);
@@ -373,11 +374,12 @@ public class DataUtil {
             }
         }
 
+        tableName = "hikvision_data";
+
         if (!insertList.isEmpty()) {
             SqlRunnerAdapter.db().dynamicInsertBatch(tableName, insertList);
         }
 
-        tableName = "hikvision_data";
         apiPath = "/api/resource/v1/person/single/update";
         for (JsonObject paramJson : updateList) {
             Thread.sleep(500);

+ 5 - 10
src/main/java/com/xjrsoft/module/oa/utils/SendMessageUtil.java

@@ -92,7 +92,7 @@ public class SendMessageUtil {
                 String openId = user.getOpenId();
 
                 if (StrUtil.isEmpty(openId)) {
-                    break;
+                    continue;
                 }
 
                 JSONObject data = new JSONObject();
@@ -101,15 +101,10 @@ public class SendMessageUtil {
                     put("value", param.getSchemaName());
                 }});
                 // 事项名称
-                if(StrUtil.isNotEmpty(name) && name.length() > 16){
-                    data.put("thing2", new JSONObject() {{
-                        put("value", name.substring(0, 15));
-                    }});
-                }else{
-                    data.put("thing2", new JSONObject() {{
-                        put("value", name.substring(0, 15));
-                    }});
-                }
+                String subjectName = StrUtil.isNotEmpty(name) && name.length() > 16 ? name.substring(0, 15) : name;
+                data.put("thing2", new JSONObject() {{
+                    put("value", subjectName);
+                }});
 
                 // 申请人
                 data.put("thing6", new JSONObject() {{

+ 2 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/CarMessageApplyServiceImpl.java

@@ -78,6 +78,7 @@ public class CarMessageApplyServiceImpl extends MPJBaseServiceImpl<CarMessageApp
                 new QueryWrapper<CarMessageApply>().lambda()
                         .eq(CarMessageApply::getCarNumber, dto.getCarNumber())
                         .eq(CarMessageApply::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(CarMessageApply::getStatus,1)
         );
         if(countByCarNumber > 0){
             throw new MyException("已存在该车牌号");
@@ -87,6 +88,7 @@ public class CarMessageApplyServiceImpl extends MPJBaseServiceImpl<CarMessageApp
                 new QueryWrapper<CarMessageApply>().lambda()
                         .eq(CarMessageApply::getUserId, dto.getUserId())
                         .eq(CarMessageApply::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(CarMessageApply::getStatus,1)
         );
         if(count > 2){
             throw new MyException("已添加2辆车,无法继续添加");

+ 8 - 2
src/main/resources/mapper/assessment/AssessmentPlanAnswerResultMapper.xml

@@ -28,8 +28,14 @@
     </select>
 
     <select id="getQuestionResult" resultType="com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerDetailVo">
-        SELECT question_id,answer_id,COUNT(*) AS choose_count FROM assessment_plan_answer_result WHERE delete_mark = 0 AND assessment_template_plan_id = #{id}
-        GROUP BY question_id,answer_id
+        SELECT  t1.question_id, t1.answer_id,COUNT(*) AS choose_count
+        FROM assessment_plan_answer_result t1
+        INNER JOIN base_student_school_roll t2 ON t1.student_user_id = t2.user_id
+        INNER JOIN assessment_template_plan t3 ON t1.assessment_template_plan_id = t3.id
+        WHERE t1.delete_mark = 0 AND t1.assessment_template_plan_id = #{id}
+        AND t3.stduy_status like concat('%', t2.stduy_status,'%')
+        AND t2.archives_status = 'FB2901'
+        GROUP BY  t1.question_id, t1.answer_id
     </select>
     <select id="getTextQuestionResult" resultType="com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerDetailVo">
         SELECT t1.* FROM assessment_plan_answer_result t1

+ 1 - 1
src/test/java/com/xjrsoft/module/system/controller/LoginControllerTest.java

@@ -45,7 +45,7 @@ class LoginControllerTest {
 
     @Test
     void testToken() {
-        User user = userService.getById("1000000000000000000");
+        User user = userService.getById("14954809128646");
         LoginVo pc = loginService.getLoginInfo(user, "PC");
         System.out.println(pc);
     }