Browse Source

1、操行,数据流程结束后存班级信息增加数据重复校验
2、审核员列表增加姓名去去除重复数据

dzx 1 year ago
parent
commit
6a4724c352

+ 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;
 }

+ 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);