Browse Source

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

fanxp 1 year ago
parent
commit
f9dffa1bcc

+ 6 - 3
src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java

@@ -268,13 +268,16 @@ public class MaterialTaskController {
                 .eq(dto.getState() == 2, MaterialTaskAssign::getExecutiveStatus, 1)
                 .eq(dto.getState() == 3, MaterialTaskAssign::getStatus, 3)
                 .select(MaterialTaskAssign::getId)
+                .select(XjrUser::getName)
                 .select(MaterialTaskAssign.class, x -> VoToColumnUtil.fieldsToColumns(MaterialTaskAssignListVo.class).contains(x.getProperty()))
                 .innerJoin(XjrUser.class, XjrUser::getId, MaterialTaskAssign::getUserId, ext -> ext.selectAs(XjrUser::getUserName, MaterialTaskAssignListVo::getUserName))
                 .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId, MaterialTypeAssign::getUserId)
                 .leftJoin(Department.class, Department::getId, UserDeptRelation::getDeptId, ext -> ext.selectAs(Department::getName, MaterialTaskAssignListVo::getDeptName))
-                .leftJoin(MaterialTaskAppendix.class, MaterialTaskAppendix::getMaterialTaskId, MaterialTaskAssign::getId)
-                .leftJoin(File.class, File::getId, MaterialTaskAppendix::getFileId)
-                .selectAs(File::getFolderId, MaterialTaskAssignListVo::getFolderId);
+                .select("(\n" +
+                        "SELECT id FROM xjr_file WHERE id IN (\n" +
+                        "SELECT file_id FROM material_task_appendix WHERE material_task_id = t.id\n" +
+                        ") ORDER BY create_date DESC LIMIT 1\n" +
+                        ") AS folderId ");
         List<MaterialTaskAssignListVo> pageOutput = materialTaskAssignService.selectJoinList(MaterialTaskAssignListVo.class, queryWrapper);
         return RT.ok(pageOutput);
     }

+ 5 - 0
src/main/java/com/xjrsoft/module/material/vo/MaterialTaskAssignListVo.java

@@ -48,4 +48,9 @@ public class MaterialTaskAssignListVo {
      * 文件包
      */
     private String folderId;
+
+    /**
+     * 用户名字
+     */
+    private String name;
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPostController.java

@@ -86,7 +86,7 @@ public class BaseStudentPostController {
 
         IPage<BaseStudentPostPageVo> page = baseStudentPostService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentPostPageVo.class,
                 MPJWrappers.<BaseStudentPost>lambdaJoin()
-                .orderByDesc(BaseStudentPost::getSortCode)
+                        .orderByAsc(BaseStudentPost::getSortCode)
                 .selectAs(DictionaryDetail::getName, BaseStudentPostPageVo::getLevelCn)
                 .select(BaseStudentPost.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentPostPageVo.class).contains(x.getProperty()))
                 .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentPost::getLevel)

+ 10 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentClassRelationServiceImpl.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.student.service.impl;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.xjrsoft.common.utils.VoToColumnUtil;
@@ -11,6 +12,7 @@ import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.form.entity.FormHistory;
 import com.xjrsoft.module.student.entity.BaseStudentAssessmentClassRelation;
 import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
+import com.xjrsoft.module.student.entity.BaseStudentCadre;
 import com.xjrsoft.module.student.mapper.BaseStudentAssessmentClassRelationMapper;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentClassRelationService;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
@@ -44,6 +46,14 @@ public class BaseStudentAssessmentClassRelationServiceImpl extends ServiceImpl<B
         List<String> classIdList = StrUtil.split(baseStudentAssessmentInspection.getClassIds(), ",");
 
         for (String classId : classIdList) {
+            List<BaseStudentAssessmentClassRelation> list = baseStudentAssessmentClassRelationMapper.selectList(
+                    Wrappers.lambdaQuery(BaseStudentAssessmentClassRelation.class)
+                            .eq(BaseStudentAssessmentClassRelation::getClassId, classId)
+                            .eq(BaseStudentAssessmentClassRelation::getBaseStudentAssessmentInspectionId, dataId)
+            );
+            if(!list.isEmpty() && list.size() > 0){
+                continue;
+            }
             BaseStudentAssessmentClassRelation classRelation = new BaseStudentAssessmentClassRelation();
             Long classIdAsLong = Convert.toLong(classId);
             classRelation.setClassId(classIdAsLong);

+ 9 - 5
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentBehaviorClassRelationServiceImpl.java

@@ -1,18 +1,14 @@
 package com.xjrsoft.module.student.service.impl;
 
 import cn.hutool.core.convert.Convert;
-import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.yulichang.toolkit.MPJWrappers;
-import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.student.entity.BaseStudentBehaviorClassRelation;
 import com.xjrsoft.module.student.entity.BaseStudentBehaviorManage;
 import com.xjrsoft.module.student.mapper.BaseStudentBehaviorClassRelationMapper;
 import com.xjrsoft.module.student.service.IBaseStudentBehaviorClassRelationService;
 import com.xjrsoft.module.student.service.IBaseStudentBehaviorManageService;
-import com.xjrsoft.module.teacher.entity.XjrUser;
-import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -37,6 +33,14 @@ public class BaseStudentBehaviorClassRelationServiceImpl extends ServiceImpl<Bas
         List<String> classIdList = StrUtil.split(behaviorManage.getClassIds(), ",");
 
         for (String classId : classIdList) {
+            List<BaseStudentBehaviorClassRelation> list = baseStudentBehaviorClassRelationMapper.selectList(
+                    Wrappers.lambdaQuery(BaseStudentBehaviorClassRelation.class)
+                            .eq(BaseStudentBehaviorClassRelation::getClassId, classId)
+                            .eq(BaseStudentBehaviorClassRelation::getBaseStudentBehaviorManageId, dataId)
+            );
+            if(!list.isEmpty() && list.size() > 0){
+                continue;
+            }
             BaseStudentBehaviorClassRelation classRelation = new BaseStudentBehaviorClassRelation();
             Long classIdAsLong = Convert.toLong(classId);
             classRelation.setClassId(classIdAsLong);

+ 8 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentPunishmentInfoServiceImpl.java

@@ -27,6 +27,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 lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -50,6 +52,9 @@ public class BaseStudentPunishmentInfoServiceImpl extends MPJBaseServiceImpl<Bas
 
     IBasePunishStudentRelationService basePunishStudentRelationService;
 
+    private final IFileService fileService;
+
+
     /**
      * 学生处分信息管理列表(分页)
      * @param dto 处分管理信息前端请求实体对象
@@ -93,6 +98,9 @@ public class BaseStudentPunishmentInfoServiceImpl extends MPJBaseServiceImpl<Bas
 
         baseStudentPunishmentInfoDetailVo.setStudentList(studentList);
 
+        // 添加文件列表
+        baseStudentPunishmentInfoDetailVo.setFileList(fileService.list(Wrappers.<File>query().lambda().eq(File::getFolderId, baseStudentPunishmentInfoDetailVo.getFileId())));
+
         return baseStudentPunishmentInfoDetailVo;
     }
 

+ 13 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoDetailVo.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.student.vo;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
 import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
+import com.xjrsoft.module.system.entity.File;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -24,4 +25,16 @@ public class BaseStudentPunishmentInfoDetailVo extends BaseStudentPunishmentInfo
     @ApiModelProperty("学生集合")
     private List<BasePunishmentStudentRelation> studentList;
 
+
+    /**
+     * 文件id
+     */
+    @ApiModelProperty("文件id")
+    private Long fileId;
+
+    /**
+     * 该处分信息下的文件集合
+     */
+    @ApiModelProperty("文件集合")
+    private List<File> fileList;
 }

+ 4 - 1
src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

@@ -63,6 +63,7 @@
             and t.name like concat('$',#{dto.studentName},'%')
         </if>
     </select>
+
     <select id="getMobileInfo" parameterType="com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoMobileDetailDto" resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobileDetailVo">
         SELECT t.id,t3.name as student_name,t3.gender,t3.credential_number,t4.punishment_type,t1.reason,t1.start_time,t5.student_id,
         t.adjust_date,t.adjust_type,t.adjust_reason,t.modify_date,t1.create_date,t1.is_publicity,t1.end_time,t.class_name,t.major FROM base_punishment_student_relation t
@@ -74,6 +75,7 @@
         WHERE t1.status = 1 AND t1.delete_mark = 0 AND t3.delete_mark = 0 AND t2.delete_mark = 0
         and t.id = #{dto.id}
     </select>
+
     <select id="getInfo"
             resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoDetailVo">
         SELECT
@@ -85,7 +87,8 @@
         t.end_time,
         t.is_publicity,
         t.push_message_object,
-        t.reason
+        t.reason,
+        t.file_id
         FROM base_student_punishment_info t
         INNER JOIN base_semester t1 ON (t1.id = t.base_semester_id)
         INNER JOIN base_punishment_type t2 ON (t2.id = t.punishment_type_id)