Explorar o código

1、学生处分查询调整
2、数据面板调整

dzx hai 1 ano
pai
achega
8118b6a74b

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

@@ -2,7 +2,6 @@ package com.xjrsoft.module.attendance.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.OutInStatusEnum;
@@ -11,39 +10,21 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
 import com.xjrsoft.module.attendance.dto.TeacherDetailsDto;
-import com.xjrsoft.module.attendance.entity.AttendanceRuleDetails;
-import com.xjrsoft.module.attendance.entity.AttendanceUserRelation;
-import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
 import com.xjrsoft.module.attendance.service.ITeacherAttendanceRecordService;
-import com.xjrsoft.module.attendance.vo.AttendanceRuleDetailsUserVo;
 import com.xjrsoft.module.attendance.vo.TeacherStatisticsPageVo;
 import com.xjrsoft.module.attendance.vo.TeacherStatisticsVo;
 import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.concat.service.IXjrUserService;
-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.entity.UserDeptRelation;
-import com.xjrsoft.module.organization.service.IUserService;
-import com.xjrsoft.module.outint.dto.TeacherOutInRecordDto;
-import com.xjrsoft.module.outint.entity.CarOutInRecord;
 import com.xjrsoft.module.outint.entity.StudentOutInRecord;
-import com.xjrsoft.module.outint.entity.TeacherOutInRecord;
-import com.xjrsoft.module.outint.service.ICarOutInRecordService;
 import com.xjrsoft.module.outint.service.IStudentOutInRecordService;
-import com.xjrsoft.module.outint.service.ITeacherOutInRecordService;
-import com.xjrsoft.module.personnel.entity.CarMessageApply;
 import com.xjrsoft.module.personnel.service.IReservationSchoolService;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.service.IStudentLeaveService;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
-import com.xjrsoft.module.teacher.entity.WfHeadTeacherLeave;
-import com.xjrsoft.module.teacher.entity.WfTeacherleave;
 import com.xjrsoft.module.teacher.entity.XjrUser;
-import com.xjrsoft.module.teacher.service.IWfHeadTeacherLeaveService;
-import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -57,10 +38,7 @@ import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -78,17 +56,10 @@ public class StatisticsController {
 
 
     private final IXjrUserService xjrUserService;
-    private final IUserService userService;
     private final IStudentOutInRecordService studentOutInRecordService;
     private final IStudentLeaveService studentLeaveService;
     private final IReservationSchoolService reservationSchoolService;
     private final ITeacherAttendanceRecordService attendanceRecordService;
-    private final ITeacherOutInRecordService teacherOutInRecordService;
-    private final IAttendanceRuleCategoryService attendanceRuleCategoryService;
-    private final IHolidayDateService holidayDateService;
-    private final IWfTeacherleaveService wfTeacherleaveService;
-    private final IWfHeadTeacherLeaveService headTeacherLeaveService;
-    private final ICarOutInRecordService carOutInRecordService;
 
     @GetMapping(value = "/teacher-statistics")
     @ApiOperation(value="教职工考勤统计")
@@ -108,182 +79,7 @@ public class StatisticsController {
         detailsDto.setDate(dto.getDate());
         detailsDto.setDeptId(dto.getDeptId());
         detailsDto.setTimePeriod(dto.getTimePeriod());
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        String today = LocalDate.now().format(dtf);
-        List<TeacherStatisticsPageVo> list = new ArrayList<>();
-        if(!today.equals(dto.getDate())){
-            list.addAll(attendanceRecordService.getList(detailsDto));
-        }else{
-            MPJLambdaWrapper<User> queryUser = new MPJLambdaWrapper<>();
-            queryUser.disableSubLogicDel().distinct()
-                    .select(" (SELECT GROUP_CONCAT(t1.name) FROM xjr_department t1" +
-                            " INNER JOIN xjr_user_dept_relation t2 ON t1.id = t2.dept_id" +
-                            " WHERE t1.delete_mark = 0 AND t2.user_id = t.id) as dept_name")
-                    .eq(ObjectUtil.isNotNull(dto.getDeptId()), UserDeptRelation::getDeptId, dto.getDeptId())
-                    .selectAs(User::getName, TeacherStatisticsPageVo::getTeacherName)
-                    .selectAs(User::getId, TeacherStatisticsPageVo::getUserId)
-                    .selectAs(User::getMobile, TeacherStatisticsPageVo::getMobile)
-                    .innerJoin(BaseTeacher.class, BaseTeacher::getUserId, User::getId)
-                    .innerJoin(UserDeptRelation.class, UserDeptRelation::getUserId, User::getId)
-                    .leftJoin(AttendanceUserRelation.class, AttendanceUserRelation::getUserId, User::getId);
-            List<TeacherStatisticsPageVo> voIPage = userService.selectJoinList(TeacherStatisticsPageVo.class, queryUser);
-
-            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(statisticsVo);
-                }
-
-                List<Long> userIds = voIPage.stream().map(TeacherStatisticsPageVo::getUserId).collect(Collectors.toList());
-                Map<Long, AttendanceRuleDetailsUserVo> teacherTodyRuleByUserId = attendanceRuleCategoryService.getTeacherTodyRuleByUserId(userIds);
-                List<String> weekList = Arrays.asList("SUNDAY", "SATURDAY");
-
-                List<HolidayDate> workHolidayDates = holidayDateService.list(
-                        new QueryWrapper<HolidayDate>().lambda()
-                                .eq(HolidayDate::getStatus, 2)
-                );
-                List<String> workHolidayDateListg = workHolidayDates.stream().map(HolidayDate::getDate).collect(Collectors.toList());
-
-                List<Integer> holidayTypes = Arrays.asList(1, 3);
-                List<HolidayDate> holidayDates = holidayDateService.list(
-                        new QueryWrapper<HolidayDate>().lambda()
-                                .in(HolidayDate::getStatus, holidayTypes)
-                );
-                List<String> holidayDateList = holidayDates.stream().map(HolidayDate::getDate).collect(Collectors.toList());
-
-                for (TeacherStatisticsPageVo record : voIPage) {
-                    LocalDateTime startTime, endTime, amEndTime = null;
-                    AttendanceRuleDetailsUserVo detailsUserVo = teacherTodyRuleByUserId.get(record.getUserId());
-                    if(detailsUserVo == null){
-                        record.setStatus("不考勤");
-                        continue;
-                    }
-                    AttendanceRuleDetails holidayRule = attendanceRuleCategoryService.getHolidayRuleByParam(record.getUserId());
-                    if(((!workHolidayDateListg.contains(queryDate.format(formatter)) && weekList.contains(queryDate.getDayOfWeek().name()))
-                            || holidayDateList.contains(queryDate.format(formatter))) && (holidayRule.getIsAttendance() == null || holidayRule.getIsAttendance() == 0)){
-                        record.setStatus("不考勤");
-                        continue;
-                    }
-                    if(dto.getTimePeriod() != null && dto.getTimePeriod() == 1){
-                        startTime = queryDate.atTime(5, 0, 0);
-                        if(detailsUserVo.getAmStartTime() != null){
-                            startTime = queryDate.atTime(detailsUserVo.getAmStartTime());
-                        }
-                        endTime = queryDate.atTime(12, 0, 0);
-                        if(detailsUserVo.getAmEndTime() != null){
-                            endTime = queryDate.atTime(detailsUserVo.getAmEndTime());
-                        }
-                    }else if(dto.getTimePeriod() != null && dto.getTimePeriod() == 2){
-                        startTime = queryDate.atTime(12, 0, 0);
-                        if(detailsUserVo.getPmStartTime() != null){
-                            startTime = queryDate.atTime(detailsUserVo.getPmStartTime());
-                        }
-                        endTime = queryDate.atTime(18, 0, 0);
-                        if(detailsUserVo.getPmEndTime() != null){
-                            endTime = queryDate.atTime(detailsUserVo.getPmEndTime());
-                        }
-                        amEndTime  = queryDate.atTime(12, 0, 0);
-                        if(detailsUserVo.getAmEndTime() != null){
-                            amEndTime = queryDate.atTime(detailsUserVo.getAmEndTime());
-                        }
-                    }else{
-                        startTime = queryDate.atTime(0, 0, 0);
-                        if(detailsUserVo.getEveningStartTime() != null){
-                            startTime = queryDate.atTime(detailsUserVo.getEveningStartTime());
-                        }
-                        endTime = queryDate.atTime(23, 59, 59);
-                        if(detailsUserVo.getEveningEndTime() != null){
-                            endTime = queryDate.atTime(detailsUserVo.getEveningEndTime());
-                        }
-                    }
-
-                    WfTeacherleave studentLeave = wfTeacherleaveService.getLeaveByUserId(startTime, endTime, record.getUserId());
-                    if(studentLeave != null){
-                        record.setStatus(studentLeave.getLeaveType());
-                        continue;
-                    }
-
-                    WfHeadTeacherLeave teacherLeave = headTeacherLeaveService.selectJoinOne(WfHeadTeacherLeave.class,
-                            new MPJLambdaWrapper<WfHeadTeacherLeave>()
-                                    .select(WfHeadTeacherLeave.class, x -> VoToColumnUtil.fieldsToColumns(WfHeadTeacherLeave.class).contains(x.getProperty()))
-                                    .innerJoin(XjrUser.class, XjrUser::getId, WfHeadTeacherLeave::getApplicantUserId)
-                                    .eq(WfHeadTeacherLeave::getStatus, 1)
-                                    .eq(WfHeadTeacherLeave::getApplicantUserId, record.getUserId())
-                                    .between(WfHeadTeacherLeave::getStartTime, startTime, endTime)
-                    );
-                    if(teacherLeave != null){
-                        record.setStatus(teacherLeave.getLeaveReason());
-                        continue;
-                    }
-                    TeacherOutInRecordDto outInDto = new TeacherOutInRecordDto();
-                    outInDto.setQueryDate(startTime.toLocalDate());
-                    outInDto.setStartTime(startTime);
-                    outInDto.setEndTime(endTime);
-                    outInDto.setStatus(OutInStatusEnum.enter.getCode());
-                    outInDto.setUserId(record.getUserId());
-                    List<TeacherOutInRecord> outInRecords = teacherOutInRecordService.getListByParam(outInDto);
-
-                    //查询该教师是否通过车辆进入
-                    List<CarOutInRecord> carList = carOutInRecordService.list(
-                            new MPJLambdaWrapper<CarOutInRecord>()
-                                    .select(CarOutInRecord.class, x -> VoToColumnUtil.fieldsToColumns(CarOutInRecord.class).contains(x.getProperty()))
-                                    .leftJoin(CarMessageApply.class, CarMessageApply::getId, CarOutInRecord::getCarMessageApplyId)
-                                    .le(CarOutInRecord::getRecordTime, endTime)
-                                    .eq("DATE_FORMAT(record_time, '%Y-%m-%d')", endTime.toLocalDate())
-                                    .eq(CarMessageApply::getUserId, record.getUserId())
-                                    .ge(dto.getTimePeriod() != null && dto.getTimePeriod() == 2 && amEndTime != null, CarOutInRecord::getRecordTime, amEndTime)
-                                    .eq(CarOutInRecord::getStatus, OutInStatusEnum.enter.getCode())
-                                    .orderByAsc(CarOutInRecord::getRecordTime)
-                    );
-
-                    //最早进入方式:1人脸 2车辆
-                    Integer inStatus = 0;
-                    if(!outInRecords.isEmpty() && !carList.isEmpty()){
-                        TeacherOutInRecord teacherOutInRecord = outInRecords.get(0);
-                        CarOutInRecord carOutInRecord = carList.get(0);
-                        int result = teacherOutInRecord.getRecordTime().compareTo(carOutInRecord.getRecordTime());
-                        if(result < 0){//人脸进入
-                            inStatus = 1;
-                        }else if(result == 0){//同时
-                            inStatus = 0;
-                        }else{//车辆进入
-                            inStatus = 2;
-                        }
-                    }else if(!outInRecords.isEmpty()){
-                        inStatus = 1;
-                    }
-
-                    if(inStatus == 1){
-                        TeacherOutInRecord outInRecord = outInRecords.get(0);
-                        if(outInRecord != null){
-                            record.setRecordTime(outInRecord.getRecordTime());
-                            record.setStatus(outInRecord.getAttendanceStatus());
-                        }
-                    }else if(inStatus == 2){
-                        CarOutInRecord outInRecord = carList.get(0);
-                        if(outInRecord != null && outInRecord.getRecordTime().isBefore(startTime)){
-                            record.setRecordTime(outInRecord.getRecordTime());
-                            record.setStatus("到校");
-                        }else if(outInRecord != null && outInRecord.getRecordTime().isAfter(startTime)){
-                            record.setRecordTime(outInRecord.getRecordTime());
-                            record.setStatus("迟到");
-                            record.setCarNumber(outInRecord.getPlanNo());
-                        }
-                    }
-
-                    if(record.getStatus() == null){
-                        record.setStatus("缺勤");
-                    }
-                    list.add(record);
-                }
-            }
-        }
+        List<TeacherStatisticsPageVo> list = attendanceRecordService.getList(detailsDto);
 
         Long actualCount = 0L;
         Long lateCount = 0L;

+ 0 - 5
src/main/java/com/xjrsoft/module/databoard/controller/DataboardController.java

@@ -35,12 +35,10 @@ import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.service.ITeacherbaseManagerService;
 import com.xjrsoft.module.teacher.vo.XjrUserPageVo;
 import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
-import com.xjrsoft.module.workflow.service.IWorkflowExtraService;
 import com.xjrsoft.module.workflow.service.IWorkflowFormRelationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.camunda.bpm.engine.HistoryService;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -51,7 +49,6 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -68,12 +65,10 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class DataboardController {
 
-    private final HistoryService historyService;
     private final ICourseTableService courseTableService;
     private final IVisitorOutInRecordService visitorService;
     private final IBaseStudentService studentService;
     private final ITeacherbaseManagerService teacherService;
-    private final IWorkflowExtraService extraService;
     private final IWorkflowFormRelationService formRelationService;
 
     @GetMapping(value = "/process-statistics")

+ 0 - 2
src/main/java/com/xjrsoft/module/databoard/controller/DatadetailController.java

@@ -3,7 +3,6 @@ package com.xjrsoft.module.databoard.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
@@ -34,7 +33,6 @@ import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
-import com.xjrsoft.module.teacher.entity.WfHeadTeacherLeave;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.service.ITeacherbaseManagerService;
 import com.xjrsoft.module.teacher.vo.XjrUserPageVo;

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

@@ -27,7 +27,7 @@ public class InsertOutInRecordTask {
     @Autowired
     private IHikvisionDataService hikvisionDataService;
 
-    @Scheduled(cron = "0 30 0 * * ?")
+    @Scheduled(cron = "0 30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();
         if(!"prod".equals(active)){

+ 9 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPunishmentInfoController.java

@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
@@ -24,6 +25,8 @@ import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobileDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobilePageVo;
 import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoPageVo;
+import com.xjrsoft.module.system.entity.File;
+import com.xjrsoft.module.system.service.IFileService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -57,12 +60,14 @@ public class BaseStudentPunishmentInfoController {
     private final IBasePunishmentTypeService punishmentTypeService;
     private final IBaseStudentPunishmentInfoService baseStudentPunishmentInfoService;
     private final IBasePunishmentStudentHandleService handleService;
+    private final IFileService fileService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="学生处分信息管理列表(分页)")
     @SaCheckPermission("basestudentpunishmentinfo:detail")
     public RT<PageOutput<BaseStudentPunishmentInfoPageVo>> page(@Valid BaseStudentPunishmentInfoPageDto dto){
         IPage<BaseStudentPunishmentInfoPageVo> pageList = baseStudentPunishmentInfoService.selectJoinListPagePc(dto);
+
         PageOutput<BaseStudentPunishmentInfoPageVo> pageOutput = ConventPage.getPageOutput(pageList, BaseStudentPunishmentInfoPageVo.class);
         return RT.ok(pageOutput);
     }
@@ -85,6 +90,10 @@ public class BaseStudentPunishmentInfoController {
         if (baseStudentPunishmentInfoDetailVo == null) {
             return RT.error("找不到此数据!");
         }
+        if (baseStudentPunishmentInfoDetailVo.getFileId() != null) {
+            List<File> list = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, baseStudentPunishmentInfoDetailVo.getFileId()));
+            baseStudentPunishmentInfoDetailVo.setFileList(list);
+        }
         return RT.ok(BeanUtil.toBean(baseStudentPunishmentInfoDetailVo,BaseStudentPunishmentInfoDetailVo.class));
     }
 

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoPageVo.java

@@ -100,5 +100,8 @@ public class BaseStudentPunishmentInfoPageVo {
     @ApiModelProperty("处分类型id")
     private Long punishmentTypeId;
 
+    @ApiModelProperty("附件id")
+    private Long fileId;
+
 
 }

+ 3 - 2
src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

@@ -18,6 +18,7 @@
         t5.credential_number,
         t6.name AS gender,
         t3.name AS teacher_name,
+        t.file_id,
         t.class_id,ifnull((SELECT punishment_type_id FROM base_punishment_student_handle
         WHERE base_student_punishment_info_id = t.id
         ORDER BY adjust_date DESC,id desc LIMIT 1), t.punishment_type_id) as punishment_type_id,
@@ -104,7 +105,7 @@
         t5.credential_number as student_id,
         t3.name AS teacher_name,
         t.class_id,
-        t8.name as major,
+        t8.name as major,t.file_id,
         (SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
         LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
         WHERE base_student_punishment_info_id = t.id
@@ -144,7 +145,7 @@
                t5.credential_number,
                t6.name AS gender,
                t3.name AS teacher_name,
-               t.class_id,
+               t.class_id,t.file_id,
                (SELECT adjust_type FROM base_punishment_student_handle
                 WHERE base_student_punishment_info_id = t.id
                 ORDER BY adjust_date DESC LIMIT 1) as adjust_type,