Pārlūkot izejas kodu

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

dzx 4 mēneši atpakaļ
vecāks
revīzija
ab53376edf

+ 7 - 1
src/main/java/com/xjrsoft/module/liteflow/node/StudentChangeClassNode.java

@@ -1,6 +1,8 @@
 package com.xjrsoft.module.liteflow.node;
 
 import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.student.entity.StudentChangeClass;
 import com.xjrsoft.module.student.mapper.StudentChangeClassMapper;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
@@ -19,6 +21,8 @@ public class StudentChangeClassNode extends NodeComponent {
     private StudentChangeClassMapper studentChangeClassMapper;
     @Autowired
     private IBaseStudentSchoolRollService studentSchoolRollService;
+    @Autowired
+    private IBaseClassService baseClassService;
     @Override
     public void process() throws Exception {
         // 获取表单中数据编号
@@ -28,8 +32,10 @@ public class StudentChangeClassNode extends NodeComponent {
         if (formId != null) {
             //查询出数据
             StudentChangeClass changeClass = studentChangeClassMapper.selectById(formId);
+
+            BaseClass baseClass =baseClassService.getById(changeClass.getAfterClassId());
             //修改学生班级
-            studentSchoolRollService.updateStudentClass(changeClass.getAfterClassId(), changeClass.getStudentUserId());
+            studentSchoolRollService.updateStudentClass(changeClass.getAfterClassId(),baseClass.getMajorSetId(), changeClass.getStudentUserId());
         }
     }
 }

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

@@ -215,13 +215,13 @@ public class MaterialTaskController {
             excelVo.setDeptName(listVo.getDeptName());
             //状态 1=未提交 2=待审核 3=通过 4=重做
             String state = "";
-            if(listVo.getStatus() != null && listVo.getUserType() == 1){
+            if(listVo.getStatus() != null && listVo.getStatus() == 1){
                 state = "未提交";
-            }else if(listVo.getStatus() != null && listVo.getUserType() == 2){
+            }else if(listVo.getStatus() != null && listVo.getStatus() == 2){
                 state = "待审核";
-            }else if(listVo.getStatus() != null && listVo.getUserType() == 3){
+            }else if(listVo.getStatus() != null && listVo.getStatus() == 3){
                 state = "通过";
-            }else if(listVo.getStatus() != null && listVo.getUserType() == 4){
+            }else if(listVo.getStatus() != null && listVo.getStatus() == 4){
                 state = "重做";
             }
             excelVo.setStatus(state);

+ 2 - 2
src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java

@@ -461,7 +461,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
 //                .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId, MaterialTypeAssign::getUserId)
 //                .leftJoin(Department.class, Department::getId, UserDeptRelation::getDeptId, ext -> ext.selectAs(Department::getName, MaterialTaskAssignListVo::getDeptName))
                 .leftJoin(MaterialTask.class, MaterialTask::getId, MaterialTaskAssign::getMaterialTaskId)
-                .leftJoin(MaterialTaskAppendix.class, MaterialTaskAppendix::getMaterialTaskId, MaterialTaskAssign::getId)
+                .leftJoin(MaterialTaskAppendix.class,on-> on.eq(MaterialTaskAppendix::getMaterialTaskId, MaterialTaskAssign::getId).eq(MaterialTaskAppendix::getDeleteMark,DeleteMark.NODELETE.getCode()) )
                 .leftJoin(File.class, File::getId, MaterialTaskAppendix::getFileId)
                 .like(dto.getName() != null && !"".equals(dto.getName()), XjrUser::getName, dto.getName())
                 .eq(MaterialTaskAssign::getMaterialTaskId, dto.getMaterialTaskId())
@@ -470,7 +470,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
 //                .eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
                 .eq(MaterialTask::getDeleteMark, DeleteMark.NODELETE.getCode())
                 .eq(MaterialTaskAssign::getDeleteMark, DeleteMark.NODELETE.getCode())
-                .eq(MaterialTaskAppendix::getDeleteMark, DeleteMark.NODELETE.getCode())
+//                .eq(MaterialTaskAppendix::getDeleteMark, DeleteMark.NODELETE.getCode())
 //                .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" +

+ 3 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentSchoolRollMapper.java

@@ -45,6 +45,9 @@ public interface BaseStudentSchoolRollMapper extends MPJBaseMapper<BaseStudentSc
     List<BaseStudentInfoCategoryVo> getStudyStatusCount(@Param("dto") BaseStudentInfoPageDto dto);
 
 
+    @Update("UPDATE base_student_school_roll SET class_id = #{classId},major_set_id=#{majorSetId} where user_id = #{userId}")
+    Boolean updateStudentClass(Long classId,Long majorSetId, Long userId);
+
     @Update("UPDATE base_student_school_roll SET class_id = #{classId} where user_id = #{userId}")
     Boolean updateStudentClass(Long classId, Long userId);
 

+ 1 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseStudentSchoolRollService.java

@@ -49,6 +49,7 @@ public interface IBaseStudentSchoolRollService extends MPJBaseService<BaseStuden
     MobileClassStatisticsVo getMobileClassStatistics(BaseStudentInfoPageDto dto);
 
     Boolean updateStudentClass(Long classId, Long userId);
+    Boolean updateStudentClass(Long classId,Long majorSetId, Long userId);
 
     List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto);
 

+ 5 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -197,6 +197,11 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
         return null;
     }
 
+    @Override
+    public Boolean updateStudentClass(Long classId,Long majorSetId, Long userId) {
+        return baseStudentSchoolRollMapper.updateStudentClass(classId,majorSetId, userId);
+    }
+
     @Override
     public Boolean updateStudentClass(Long classId, Long userId) {
         return baseStudentSchoolRollMapper.updateStudentClass(classId, userId);

+ 9 - 0
src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java

@@ -16,7 +16,9 @@ import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
+import com.xjrsoft.module.organization.entity.UserPostRelation;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
+import com.xjrsoft.module.organization.service.IUserPostRelationService;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.service.IDictionarydetailService;
 import com.xjrsoft.module.teacher.dto.AddXjrUserDto;
@@ -59,6 +61,7 @@ public class TeacherbaseManagerController {
     private final ITeacherbaseManagerService teacherbaseManagerService;
     private final IDictionarydetailService dictionarydetailService;
     private final IUserDeptRelationService userDeptRelationService;
+    private final IUserPostRelationService  userPostRelationService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="XjrUser列表(分页)")
@@ -116,6 +119,12 @@ public class TeacherbaseManagerController {
         String allDeptIdStr = StrUtil.join(StringPool.COMMA, deptIds);
         userVo.setDepartmentIds(allDeptIdStr);
 
+        List<Long> postIds = userPostRelationService.list(Wrappers.lambdaQuery(UserPostRelation.class)
+                .eq(UserPostRelation::getUserId,userVo.getId()))
+                .stream().map(UserPostRelation::getPostId).collect(Collectors.toList());
+        String allPostIdStr = StrUtil.join(StringPool.COMMA, postIds);
+        userVo.setPostIds(allPostIdStr);
+
         return R.ok(userVo);
     }
 

+ 3 - 0
src/main/java/com/xjrsoft/module/teacher/dto/AddXjrUserDto.java

@@ -136,4 +136,7 @@ public class AddXjrUserDto implements Serializable {
 
     @ApiModelProperty("部门id")
     private String departmentIds;
+
+    @ApiModelProperty("岗位id")
+    private String postIds;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/teacher/dto/UpdateXjrUserDto.java

@@ -142,4 +142,7 @@ public class UpdateXjrUserDto implements Serializable {
 
     @ApiModelProperty("部门id")
     private String departmentIds;
+
+    @ApiModelProperty("岗位id")
+    private String postIds;
 }

+ 36 - 0
src/main/java/com/xjrsoft/module/teacher/service/impl/TeacherbaseManagerServiceImpl.java

@@ -14,10 +14,12 @@ import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
+import com.xjrsoft.module.organization.entity.UserPostRelation;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.mapper.UserDeptRelationMapper;
 import com.xjrsoft.module.organization.mapper.UserRoleRelationMapper;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
+import com.xjrsoft.module.organization.service.IUserPostRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.teacher.dto.AddXjrUserDto;
 import com.xjrsoft.module.teacher.dto.UpdateXjrUserDto;
@@ -73,6 +75,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
     private final UserDeptRelationMapper userDeptRelationMapper;
     private final IUserService userService;
     private final CommonPropertiesConfig propertiesConfig;
+    private final IUserPostRelationService userPostRelationService;
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean add(AddXjrUserDto dto) {
@@ -128,6 +131,22 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
             userDeptRelationService.saveBatch(userDeptRelationList);
         }
 
+        List<UserPostRelation> userPostRelationList = new ArrayList<>();
+        if (StrUtil.isNotBlank(dto.getPostIds())) {
+            String allPostIdStr = StrUtil.join(StringPool.COMMA, dto.getPostIds());
+            List<Long> postIds = Arrays.stream(allPostIdStr.split(StringPool.COMMA)).map(Convert::toLong).collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(postIds)) {
+                for (Long postId : postIds) {
+                    //将用户所选岗位保存到关联表中
+                    UserPostRelation userPostRelation = new UserPostRelation();
+                    userPostRelation.setUserId(xjrUser.getId());
+                    userPostRelation.setPostId(postId);
+                    userPostRelationList.add(userPostRelation);
+                }
+            }
+            userPostRelationService.saveBatch(userPostRelationList);
+        }
+
         // 添加角色
         UserRoleRelation userRoleRelation = new UserRoleRelation();
         userRoleRelation.setUserId(xjrUser.getId());
@@ -174,6 +193,23 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
             userDeptRelationService.saveBatch(userDeptRelationList);
         }
 
+        userPostRelationService.remove(Wrappers.<UserPostRelation>query().lambda().eq(UserPostRelation::getUserId,xjrUser.getId()));
+        List<UserPostRelation> userPostRelationList = new ArrayList<>();
+        if (StrUtil.isNotBlank(dto.getPostIds())) {
+            String allPostIdStr = StrUtil.join(StringPool.COMMA, dto.getPostIds());
+            List<Long> postIds = Arrays.stream(allPostIdStr.split(StringPool.COMMA)).map(Convert::toLong).collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(postIds)) {
+                for (Long postId : postIds) {
+                    //将用户所选岗位保存到关联表中
+                    UserPostRelation userPostRelation = new UserPostRelation();
+                    userPostRelation.setUserId(xjrUser.getId());
+                    userPostRelation.setPostId(postId);
+                    userPostRelationList.add(userPostRelation);
+                }
+            }
+            userPostRelationService.saveBatch(userPostRelationList);
+        }
+
         //********************************* BaseTeacher  增删改  开始 *******************************************/
         {
             // 查出所有子级的id

+ 3 - 0
src/main/java/com/xjrsoft/module/teacher/vo/XjrUserVo.java

@@ -140,4 +140,7 @@ public class XjrUserVo {
     @ApiModelProperty("部门id")
     private String departmentIds;
 
+    @ApiModelProperty("岗位id")
+    private String postIds;
+
 }