Prechádzať zdrojové kódy

Merge branch 'dev' of https://git.yingcaibx.com/tl/api into dev

brealinxx 5 mesiacov pred
rodič
commit
f2bcaefefc

+ 1 - 0
src/main/java/com/xjrsoft/module/attendance/controller/StatisticsController.java

@@ -145,6 +145,7 @@ public class StatisticsController {
                 .disableSubLogicDel()
                 .distinct()
                 .eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseStudentSchoolRoll::getGradeId, dto.getGradeId())
+                .eq(BaseStudentSchoolRoll::getArchivesStatus, "FB2901")
                 .eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudentSchoolRoll::getClassId, dto.getClassId())
                 .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
                 .innerJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId);

+ 21 - 2
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -17,6 +17,8 @@ import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
 import com.xjrsoft.module.attendance.vo.StudentStatisticsPageVo;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.holiday.entity.HolidayDate;
+import com.xjrsoft.module.holiday.service.IHolidayDateService;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.outint.entity.StudentOutInRecord;
@@ -65,6 +67,7 @@ public class StudentStatisticsController {
     private final IStudentOutInRecordService studentOutInRecordService;
     private final IStudentLeaveService studentLeaveService;
     private final IBaseClassService classService;
+    private final IHolidayDateService holidayDateService;
 
     @GetMapping(value = "/class-statistics")
     @ApiOperation(value="班级考勤统计")
@@ -78,6 +81,15 @@ public class StudentStatisticsController {
         if(dto.getDate() != null && !"".equals(dto.getDate())){
             DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
             LocalDate queryDate = LocalDate.parse(dto.getDate(), formatter);
+
+            HolidayDate holidayDate = holidayDateService.getOne(
+                    new QueryWrapper<HolidayDate>().lambda()
+                            .eq(HolidayDate::getDate, queryDate)
+            );
+            if(holidayDate != null && holidayDate.getWay() != null && holidayDate.getWay() != 0){
+                return RT.ok(ConventPage.getPageOutput(attendancePage, ClassStatisticsVo.class));
+            }
+
             LocalDateTime startTime, endTime;
 
 
@@ -94,8 +106,6 @@ public class StudentStatisticsController {
                 startTime = queryDate.atTime(0, 0, 0);
                 endTime = queryDate.atTime(23, 59, 59);
             }
-            LocalDateTime lastSundayStart = startTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
-            LocalDateTime lastSundayEnd = endTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
 
             //查询每个班的走读生实到人数
             Map<Long, List<StudentOutInRecordVo>> notStayMap = studentOutInRecordService.getList(startTime, endTime, classIds);
@@ -176,6 +186,14 @@ public class StudentStatisticsController {
         if(dto.getDate() != null && !"".equals(dto.getDate())){
             DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
             LocalDate queryDate = LocalDate.parse(dto.getDate(), formatter);
+            HolidayDate holidayDate = holidayDateService.getOne(
+                    new QueryWrapper<HolidayDate>().lambda()
+                            .eq(HolidayDate::getDate, queryDate)
+            );
+            if(holidayDate != null && holidayDate.getWay() != null && holidayDate.getWay() != 0){
+                return RT.ok(new PageOutput<>());
+            }
+
             LocalDateTime startTime, endTime;
 
             if(dto.getTimePeriod() != null && dto.getTimePeriod() == 1){
@@ -237,6 +255,7 @@ public class StudentStatisticsController {
             LocalDateTime startTime = LocalDate.parse(dto.getStartTime(), formatter).atTime(0, 0, 0);
             LocalDateTime endTime = LocalDate.parse(dto.getEndTime(), formatter).atTime(23, 59, 59);
 
+
             //查询每个班的走读生实到人数
             Map<Long, List<StudentOutInRecordVo>> notStayMap = studentOutInRecordService.getNotStayList(startTime, endTime, classIds);
             //查询住校生的实到情况

+ 13 - 0
src/main/java/com/xjrsoft/module/attendance/controller/TeacherStatisticsController.java

@@ -10,7 +10,10 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.attendance.dto.TeacherDetailsDto;
+import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
 import com.xjrsoft.module.attendance.vo.TeacherStatisticsPageVo;
+import com.xjrsoft.module.holiday.entity.HolidayDate;
+import com.xjrsoft.module.holiday.service.IHolidayDateService;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
@@ -51,6 +54,7 @@ public class TeacherStatisticsController {
     private final IUserService xjrUserService;
     private final ITeacherOutInRecordService teacherOutInRecordService;
     private final IWfTeacherleaveService wfTeacherleaveService;
+    private final IHolidayDateService holidayDateService;
 
 
     @GetMapping(value = "/teacher-details")
@@ -73,6 +77,15 @@ public class TeacherStatisticsController {
         if(dto.getDate() != null && !"".equals(dto.getDate())){
             DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
             LocalDate queryDate = LocalDate.parse(dto.getDate(), formatter);
+
+            HolidayDate holidayDate = holidayDateService.getOne(
+                    new QueryWrapper<HolidayDate>().lambda()
+                            .eq(HolidayDate::getDate, queryDate)
+            );
+            if(holidayDate != null && holidayDate.getWay() != null && holidayDate.getWay() != 0){
+                return RT.ok(ConventPage.getPageOutput(voIPage, TeacherStatisticsPageVo.class));
+            }
+
             LocalDateTime startTime, endTime;
 
             if(dto.getTimePeriod() == 1){

+ 3 - 0
src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java

@@ -62,6 +62,9 @@ public class ConcatController {
         MPJLambdaWrapper<XjrUser> wrapper = new MPJLambdaWrapper<>();
         wrapper.leftJoin("xjr_user_dept_relation t2 on t.id = t2.user_id")
                 .eq("t2.dept_id", parentId)
+                .leftJoin("xjr_user_role_relation t3 ON t.id = t3.user_id")
+                .leftJoin("xjr_role t4 ON t4.id = t3.role_id")
+                .eq("t4.id", 2)
                 .eq(XjrUser::getDeleteMark, DeleteMark.NODELETE.getCode());
         List<XjrUser> userList = xjrUserService.selectJoinList(XjrUser.class, wrapper);
         for (XjrUser user : userList) {

+ 2 - 1
src/main/java/com/xjrsoft/module/hikvision/controller/EventController.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.hikvision.controller;
 
+import cn.hutool.core.util.IdUtil;
 import cn.hutool.db.Db;
 import com.alibaba.fastjson.JSONObject;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
@@ -117,7 +118,7 @@ public class EventController {
                         WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
                         weChatSendMessageDto.setUserId(member.getOpenId());
                         weChatSendMessageDto.setTemplateId(weChatUtil.getOutInTemplate());
-                        weChatSendMessageDto.setMsgId(member.getId().toString());
+                        weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                         JSONObject paramJson = new JSONObject();
 
                         JSONObject thing1 = new JSONObject();

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

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.job;
 
+import cn.hutool.core.util.IdUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -110,7 +111,7 @@ public class AttenDanceWarnNoticeTask {
             WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
             weChatSendMessageDto.setUserId(xjrUser.getOpenId());
             weChatSendMessageDto.setTemplateId(wechatTemplate);
-            weChatSendMessageDto.setMsgId(xjrUser.getId().toString());
+            weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
             JSONObject paramJson = new JSONObject();
 
             JSONObject thing8 = new JSONObject();

+ 3 - 2
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.job;
 
+import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
@@ -206,7 +207,7 @@ public class AttendanceMessageTask {
                 weChatSendMessageDto.setUrl(StrUtil.format("{}pages/attendance/teacher/index", commonPropertiesConfig.getDomainApp()));
 
                 for (XjrUser xjrUser : userList) {
-                    weChatSendMessageDto.setMsgId(xjrUser.getId().toString());
+                    weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
                     weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }
@@ -251,7 +252,7 @@ public class AttendanceMessageTask {
                 weChatSendMessageDto.setUrl(StrUtil.format("{}pages/attendance/class/index", commonPropertiesConfig.getDomainApp()));
 
                 for (XjrUser xjrUser : userList) {
-                    weChatSendMessageDto.setMsgId(xjrUser.getId().toString());
+                    weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
                     weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }

+ 3 - 0
src/main/java/com/xjrsoft/module/organization/dto/WeChatSendMessageDto.java

@@ -8,6 +8,9 @@ public class WeChatSendMessageDto {
     private String userId;
     private String templateId;
     private String url;
+    /**
+     * 不同消息需要
+     */
     private String msgId;
     private JSONObject content;
 }

+ 2 - 2
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -78,7 +78,7 @@ public class TextbookController {
         textbookMPJLambdaWrapper
                 .select(Textbook::getId)
                 .selectAs(Textbook::getId,TextbookSubscriptionListVo::getTextbookId)
-                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseSubjectIdCn)
+                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseName)
                 .selectSum(BaseClassMajorSet::getTotalStudent, TextbookSubscriptionListVo::getStudentSubscriptionNumber)
                 .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
                 .leftJoin(BaseClassCourse.class, BaseClassCourse::getCourseId, Textbook::getCourseSubjectId)
@@ -140,7 +140,7 @@ public class TextbookController {
         textbookMPJLambdaWrapper
                 .select(Textbook::getId)
                 .selectAs(Textbook::getId,TextbookSubscriptionListVo::getTextbookId)
-                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseSubjectIdCn)
+                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseName)
                 .selectSum(BaseClassMajorSet::getTotalStudent, TextbookSubscriptionListVo::getStudentSubscriptionNumber)
                 .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
                 .leftJoin(TextbookClassRelation.class, TextbookClassRelation::getTextbookId, Textbook::getId)

+ 2 - 0
src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookSubscriptionServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.textbook.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yulichang.base.MPJBaseServiceImpl;
@@ -58,6 +59,7 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean add(WfTextbookSubscription wfTextbookSubscription) {
+        wfTextbookSubscription.setApplicantUserId(StpUtil.getLoginIdAsLong());
         wfTextbookSubscription.setStatus(1);
         wfTextbookSubscription.setCreateDate(new Date());
         wfTextbookSubscriptionWfTextbookSubscriptionMapper.insert(wfTextbookSubscription);

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionListVo.java

@@ -36,7 +36,7 @@ public class TextbookSubscriptionListVo {
      * 课程编号(base_course_subject)
      */
     @ApiModelProperty("课程编号(base_course_subject)")
-    private String courseSubjectIdCn;
+    private String courseName;
     /**
     * 书名
     */

+ 3 - 1
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -12,7 +12,9 @@
         (SELECT GROUP_CONCAT(c2.name) FROM textbook_class_relation c1
         LEFT JOIN base_class c2 ON c1.class_id = c2.id
         WHERE c1.textbook_id = t1.id) AS use_class,
-        t6.name AS use_grade,t1.version FROM textbook t1
+        t6.name AS use_grade,t1.version,
+        t1.use_type
+        FROM textbook t1
         LEFT JOIN subject_group t2 ON t1.subject_group_id = t2.id
         LEFT JOIN base_semester t3 ON t1.base_semester_id = t3.id
         LEFT JOIN base_course_subject t4 ON t1.course_subject_id = t4.id

+ 45 - 3
src/test/java/com/xjrsoft/module/job/AttendanceMessageTaskTest.java

@@ -86,6 +86,48 @@ class AttendanceMessageTaskTest {
     private IWechatMessageLogService wechatMessageLogService;
 
 
+    @Test
+    void test2(){
+        String  wechatTemplate = "o-KboOcqcJ3YpjPN2xwgM_NcjN-0yzwWlDDXYfTM0Q4";
+        WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
+        weChatSendMessageDto.setTemplateId(wechatTemplate);
+        JSONObject paramJson = new JSONObject();
+
+        JSONObject thing6 = new JSONObject();
+        thing6.put("value", "教职工");
+        paramJson.put("thing6", thing6);
+
+        JSONObject time11 = new JSONObject();
+        time11.put("value", "2024-6-12 11:02:30");
+        paramJson.put("time11", time11);
+
+        JSONObject const23 = new JSONObject();
+        const23.put("value", "上午考勤");
+        paramJson.put("const23", const23);
+
+        JSONObject character_string18 = new JSONObject();
+        character_string18.put("value", "222");
+        paramJson.put("character_string18", character_string18);
+
+        JSONObject const3 = new JSONObject();
+        const3.put("value", "出勤率 99%");
+        paramJson.put("const3", const3);
+
+        weChatSendMessageDto.setContent(paramJson);
+        weChatSendMessageDto.setUrl(StrUtil.format("{}pages/attendance/teacher/index", commonPropertiesConfig.getDomainApp()));
+
+        List<String> userList = new ArrayList<>();
+        userList.add("oWZy-wec72H78ApagVBFomC5TNyw");
+        userList.add("oWZy-wUTki8Vi7ao3Wn5JGNDauVI");
+        for (String xjrUser : userList) {
+            weChatSendMessageDto.setMsgId(xjrUser);
+            weChatSendMessageDto.setUserId(xjrUser);
+            weChatService.sendTemplateMessage(weChatSendMessageDto);
+        }
+
+
+    }
+
     @Test
     void test(){
         doExecute();
@@ -111,9 +153,9 @@ class AttendanceMessageTaskTest {
                         .eq(WechatMessageLog::getSendTime, recentlyTime)
                         .eq(WechatMessageLog::getTemplateId, wechatTemplate)
         );
-        if(log != null){//已经推送过,不再进行推送
-            return;
-        }
+//        if(log != null){//已经推送过,不再进行推送
+//            return;
+//        }
 
         WechatMessageLog messageLog = new WechatMessageLog();
         messageLog.setTemplateId(wechatTemplate);