Просмотр исходного кода

修改教师评语,亲密度数据重复,审批权限问题

liu 1 год назад
Родитель
Сommit
c8a5b32853

+ 1 - 1
src/main/java/com/template/api/SmartScoreControllerAPI.java

@@ -113,7 +113,7 @@ public interface SmartScoreControllerAPI {
 
     @GetMapping(value = "/teacherMessage")
     @ApiOperation(value = "老师寄语", notes = "老师寄语", httpMethod = "GET")
-    CommonResult teacherMessage(@RequestParam String cardNo);
+    CommonResult teacherMessage(@RequestParam String cardNo,@RequestParam String termId);
 
     @GetMapping(value = "/studentExamName")
     @ApiOperation(value = "学生考试名称分组", notes = "学生考试名称分组", httpMethod = "GET")

+ 8 - 8
src/main/java/com/template/controller/SmartScoreController.java

@@ -915,14 +915,14 @@ public class SmartScoreController implements SmartScoreControllerAPI {
 
     @Override
     @DESRespondSecret(validated = true)
-    public CommonResult teacherMessage(String cardNo) {
-        LocalDateTime now = LocalDateTime.now();
-        SmartSemester smartSemester = smartSemesterService.getSemester(now);
-        if (ObjectUtils.isEmpty(smartSemester)) {
-            return CommonResult.ok("当前时间不属于任何学期");
-        }
-        String name = smartSemester.getName();
-        SmartEvaluateStudent smartEvaluateStudent = smartEvaluateStudentService.getTeacherMessage(cardNo, name);
+    public CommonResult teacherMessage(String cardNo,String termId) {
+//        LocalDateTime now = LocalDateTime.now();
+//        SmartSemester smartSemester = smartSemesterService.getSemester(now);
+//        if (ObjectUtils.isEmpty(smartSemester)) {
+//            return CommonResult.ok("当前时间不属于任何学期");
+//        }
+//        String name = smartSemester.getName();
+        SmartEvaluateStudent smartEvaluateStudent = smartEvaluateStudentService.getTeacherMessage(cardNo, termId);
         HashMap<String, String> map = new HashMap<>();
         if (ObjectUtils.isNotEmpty(smartEvaluateStudent)) {
             String scoreComment = smartEvaluateStudent.getScoreComment();

+ 19 - 6
src/main/java/com/template/controller/SmartVisitorController.java

@@ -651,16 +651,29 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
                 SmartUser smartUser = smartUserService.getById(respondent);
                 Integer schoolClass = smartUser.getSchoolClass();
                 SmartVisitorParentsConfig svpc = smartVisitorParentsConfigService.getById(schoolClass);
-                Integer appPushConfig = svpc.getAppPushConfig();
-//                判断是否需要推送
-                if (5 == appPushConfig) {//需要推送
+                //                先判断是管理端还是小程序
+                Integer source = sv.getSource();
+                Integer pushConfig=0;
+                Integer cancelConfig=0;
+                if (source==1) {
+                    //                判断小程序是否需要推送
+                    pushConfig = svpc.getAppPushConfig();
+                    //                核销
+                    cancelConfig  = svpc.getAppCancelConfig();
+                }else {
+                    //                判断大屏是否需要推送
+                    pushConfig = svpc.getScreenPushConfig();
+                    //                核销
+                    cancelConfig  = svpc.getScreenCancelConfig();
+                }
+
+                if (5 == pushConfig) {//需要推送
                     String content = sv.getRespondentName() + "你的家长将于" + TimeExchange.chineseDateTime(sv.getVisitorTime()) + "到校!";
                     //将预约信息推送到希沃班牌
                     CommonResult seewo = pushInfo(sv.getUserPhone(), sv.getResponcode(), content);
                 }
-//                核销
-                Integer appCancelConfig = svpc.getAppCancelConfig();
-                if (6 == appCancelConfig) {//需要核销
+
+                if (6 == cancelConfig) {//需要核销
                     sv.setStatu(7);
                 } else {//不需要核销
                     sv.setStatu(9);

+ 2 - 0
src/main/java/com/template/services/SmartAttendanceService.java

@@ -54,4 +54,6 @@ public interface SmartAttendanceService extends IService<SmartAttendance> {
     List<AckDetailVo> ackDetail(Integer userId, LocalDateTime startTime, LocalDateTime endTime);
 
     Integer deleteDatasByids(List<Integer> ids);
+
+    List<SmartAttendance> toDateList(LocalDateTime start, LocalDateTime end);
 }

+ 1 - 1
src/main/java/com/template/services/SmartEvaluateStudentService.java

@@ -41,7 +41,7 @@ public interface SmartEvaluateStudentService extends IService<SmartEvaluateStude
      * @param name
      * @return
      */
-    SmartEvaluateStudent getTeacherMessage(String cardNo, String name);
+    SmartEvaluateStudent getTeacherMessage(String cardNo, String termId);
 
     List<HistoricalEvaluationVo> getHistoricalEvaluation(String cardNo);
 

+ 9 - 0
src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java

@@ -1,5 +1,6 @@
 package com.template.services.impl;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -194,4 +195,12 @@ public class SmartAttendanceServiceImpl extends ServiceImpl<SmartAttendanceMappe
         int result = smartAttendanceMapper.deleteBatchIds(ids);
         return result;
     }
+
+    @Override
+    public List<SmartAttendance> toDateList(LocalDateTime start, LocalDateTime end) {
+        LambdaQueryWrapper<SmartAttendance> wrapper=new LambdaQueryWrapper<>();
+        wrapper.between(SmartAttendance::getAttendTime,start,end);
+        List<SmartAttendance> list = this.list(wrapper);
+        return list;
+    }
 }

+ 2 - 2
src/main/java/com/template/services/impl/SmartEvaluateStudentServiceImpl.java

@@ -83,9 +83,9 @@ public class SmartEvaluateStudentServiceImpl extends ServiceImpl<SmartEvaluateSt
     }
 
     @Override
-    public SmartEvaluateStudent getTeacherMessage(String cardNo, String name) {
+    public SmartEvaluateStudent getTeacherMessage(String cardNo, String termId) {
         LambdaQueryWrapper<SmartEvaluateStudent> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(SmartEvaluateStudent::getTerm, name)
+        wrapper.eq(SmartEvaluateStudent::getTermId, termId)
                 .eq(SmartEvaluateStudent::getCardNo, cardNo);
         SmartEvaluateStudent ses = this.getOne(wrapper);
         return ses;

+ 25 - 8
src/main/java/com/template/services/impl/SmartRelationServiceImpl.java

@@ -7,19 +7,13 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.config.ScheduleConfig;
 import com.template.model.dto.WarningUserDto;
-import com.template.model.pojo.SmartAccess;
-import com.template.model.pojo.SmartFaceDiscern;
-import com.template.model.pojo.SmartRelation;
+import com.template.model.pojo.*;
 import com.template.mapper.SmartRelationMapper;
-import com.template.model.pojo.SmartUser;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.SmartRelationVo;
 import com.template.model.vo.UserVo;
-import com.template.services.SmartAccessService;
-import com.template.services.SmartFaceDiscernService;
-import com.template.services.SmartRelationService;
+import com.template.services.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.template.services.SmartUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -54,8 +48,13 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
     SmartUserService smartUserService;
 
     @Autowired
+    SmartAttendanceService smartAttendanceService;
+
+
+    @Autowired
     SmartRelationMapper smartRelationMapper;
 
+
     @Async
     @Scheduled(cron = "0 20 0 * * ? ")//每天凌晨一点
 //    @Scheduled(cron = "0 10 14 * * ? ")//每天凌晨一点
@@ -185,6 +184,24 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
         }
     }
 
+    @Async
+    @Scheduled(cron = "0 20 3 * * ? ")//每天凌晨一点
+    public void getAttendanceListSmartRelation() {
+        if (scheduleConfig.getIsOpen().equals("1")) {
+            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            LocalDateTime now = LocalDateTime.now();
+            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
+            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
+            String format = start.format(pattern);
+
+//            找到昨天的所有数据
+            List<SmartAttendance> attendanceList = smartAttendanceService.toDateList(start, end);
+
+
+        }
+    }
+
+
 
     @Override
     public PageUtils<SmartRelationVo> getList(int currentPage,int pageCount,Integer userId, String startTime, String endTime) {

+ 1 - 0
src/main/resources/mapper/template/SmartRelationMapper.xml

@@ -26,6 +26,7 @@
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and sr.date_time &gt;= #{startTime} and sr.date_time &lt; #{endTime}
         </if>
+        GROUP BY sr.relation_id
         ORDER BY count DESC
 
     </select>