Explorar el Código

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

大数据与最优化研究所 hace 1 año
padre
commit
d63df2c47a

+ 1 - 1
src/main/java/com/xjrsoft/module/assessment/controller/AssessmentTemplateController.java

@@ -52,7 +52,7 @@ public class AssessmentTemplateController {
     public RT<PageOutput<AssessmentTemplatePageVo>> page(@Valid AssessmentTemplatePageDto dto){
 
         LambdaQueryWrapper<AssessmentTemplate> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(StrUtil.isNotEmpty(dto.getName()), AssessmentTemplate::getName, dto.getName())
+        queryWrapper.like(StrUtil.isNotEmpty(dto.getName()), AssessmentTemplate::getName, dto.getName())
             .orderByDesc(AssessmentTemplate::getId)
             .select(AssessmentTemplate.class,x -> VoToColumnUtil.fieldsToColumns(AssessmentTemplatePageVo.class).contains(x.getProperty()));
         IPage<AssessmentTemplate> page = assessmentTemplateService.page(ConventPage.getPage(dto), queryWrapper);

+ 9 - 0
src/main/java/com/xjrsoft/module/assessment/controller/AssessmentTemplatePlanController.java

@@ -67,6 +67,14 @@ public class AssessmentTemplatePlanController {
         return RT.ok(BeanUtil.toBean(assessmentTemplatePlan, AssessmentTemplatePlanVo.class));
     }
 
+    @GetMapping(value = "/semester-class")
+    @ApiOperation(value="根据学期id查询被选择过的班级")
+    @SaCheckPermission("assessmenttemplateplan:detail")
+    public RT<List<Long>> getSemesterClass(@RequestParam Long id){
+        List<Long> semesterClass = planService.getSemesterClass(id);
+        return RT.ok(semesterClass);
+    }
+
 
     @PostMapping
     @ApiOperation(value = "新增考核计划")
@@ -114,4 +122,5 @@ public class AssessmentTemplatePlanController {
         return RT.ok(true);
     }
 
+
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/assessment/mapper/AssessmentTemplatePlanMapper.java

@@ -39,4 +39,6 @@ public interface AssessmentTemplatePlanMapper extends MPJBaseMapper<AssessmentTe
     List<AssessmentTemplatePlanPageVo> getMobilePage(@Param("dto") AssessmentTemplatePlanPageDto dto);
 
     List<AssessmentPlanAnswerStudentVo> getAnswerStudent(@Param("dto") AssessmentPlanAnswerStudentDto dto);
+
+    List<Long> getSemesterClass(Long id);
 }

+ 1 - 2
src/main/java/com/xjrsoft/module/assessment/service/IAssessmentTemplatePlanService.java

@@ -16,7 +16,6 @@ import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerStudentVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerTeacherPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanQuestionVo;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -80,5 +79,5 @@ public interface IAssessmentTemplatePlanService extends MPJBaseService<Assessmen
 
     List<AssessmentPlanAnswerStudentVo> getAnswerStudent(AssessmentPlanAnswerStudentDto dto);
 
-
+    List<Long> getSemesterClass(Long id);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/assessment/service/impl/AssessmentTemplatePlanServiceImpl.java

@@ -345,4 +345,9 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
     public List<AssessmentPlanAnswerStudentVo> getAnswerStudent(AssessmentPlanAnswerStudentDto dto) {
         return templatePlanMapper.getAnswerStudent(dto);
     }
+
+    @Override
+    public List<Long> getSemesterClass(Long id) {
+        return templatePlanMapper.getSemesterClass(id);
+    }
 }

+ 40 - 3
src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java

@@ -1,11 +1,16 @@
 package com.xjrsoft.module.concat.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.module.concat.dto.ConcatTreeDto;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.concat.vo.ConcatTreeVo;
+import com.xjrsoft.module.organization.entity.Department;
+import com.xjrsoft.module.organization.service.IDepartmentService;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -13,6 +18,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -27,14 +33,45 @@ import java.util.List;
 @AllArgsConstructor
 public class ConcatController {
     private final IXjrUserService xjrUserService;
+    private final IDepartmentService departmentService;
 
 
     @GetMapping(value = "/list")
     @ApiOperation(value="教师通讯录")
     @SaCheckPermission("room:detail")
     public RT<List<ConcatTreeVo>> list(ConcatTreeDto dto) throws Exception {
-        List<ConcatTreeVo> concatList = xjrUserService.getConcatList(dto);
-        List<ConcatTreeVo> treeVoList = TreeUtil.build(concatList);
-        return RT.ok(treeVoList);
+        Long parentId = 0L;
+        if(dto.getDeptId() != null){
+            parentId = dto.getDeptId();
+        }
+        List<Department> list = departmentService.list(
+            new QueryWrapper<Department>().lambda()
+            .eq(Department::getParentId, parentId)
+        );
+        List<ConcatTreeVo> concatList = new ArrayList<>();
+        for (Department department : list) {
+            concatList.add(
+                new ConcatTreeVo(){{
+                    setName(department.getName());
+                    setId(department.getId());
+                    setType(1);
+                }}
+            );
+        }
+        MPJLambdaWrapper<XjrUser> wrapper = new MPJLambdaWrapper<>();
+        wrapper.leftJoin("xjr_user_dept_relation t2 on t.id = t2.user_id")
+                .eq("t2.dept_id", parentId);
+        List<XjrUser> userList = xjrUserService.selectJoinList(XjrUser.class, wrapper);
+        for (XjrUser user : userList) {
+            concatList.add(
+                    new ConcatTreeVo(){{
+                        setName(user.getName());
+                        setMobile(user.getMobile());
+                        setType(2);
+                    }}
+            );
+        }
+
+        return RT.ok(concatList);
     }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/concat/dto/ConcatTreeDto.java

@@ -20,4 +20,7 @@ public class ConcatTreeDto extends PageInput {
     @ApiModelProperty("电话")
     private String mobile;
 
+    @ApiModelProperty("部门id")
+    private Long deptId;
+
 }

+ 4 - 1
src/main/java/com/xjrsoft/module/concat/vo/ConcatTreeVo.java

@@ -20,7 +20,7 @@ public class ConcatTreeVo implements ITreeNode<ConcatTreeVo, Long>, Serializable
     @ApiModelProperty("电话")
     private String mobile;
 
-    @ApiModelProperty("id")
+    @ApiModelProperty("id(type=1时为部门id)")
     private Long id;
 
     @ApiModelProperty("disabled")
@@ -32,4 +32,7 @@ public class ConcatTreeVo implements ITreeNode<ConcatTreeVo, Long>, Serializable
     @ApiModelProperty("性别")
     private String gender;
 
+    @ApiModelProperty("类别(1:部门 2:教室)")
+    private Integer type;
+
 }

+ 15 - 0
src/main/resources/mapper/assessment/AssessmentTemplatePlanMapper.xml

@@ -14,6 +14,9 @@
         <if test="dto.assessmentTemplateName != null and dto.assessmentTemplateName != ''">
             and t2.name like concat('%', #{dto.assessmentTemplateName}, '%')
         </if>
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and (t2.name like concat('%', #{dto.keyword}, '%') or t1.name like concat('%', #{dto.keyword}, '%'))
+        </if>
         <if test="dto.assessmentTemplateId != null">
             and t2.id = #{dto.assessmentTemplateId}
         </if>
@@ -35,6 +38,9 @@
         <if test="dto.assessmentTemplateName != null and dto.assessmentTemplateName != ''">
             and t2.name like concat('%', #{dto.assessmentTemplateName}, '%')
         </if>
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and (t2.name like concat('%', #{dto.keyword}, '%') or t1.name like concat('%', #{dto.keyword}, '%'))
+        </if>
         <if test="dto.assessmentTemplateId != null">
             and t2.id = #{dto.assessmentTemplateId}
         </if>
@@ -65,6 +71,9 @@
         <if test="dto.assessmentTemplateName != null and dto.assessmentTemplateName != ''">
             and t2.name like concat('%', #{dto.assessmentTemplateName}, '%')
         </if>
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and (t2.name like concat('%', #{dto.keyword}, '%') or t1.name like concat('%', #{dto.keyword}, '%'))
+        </if>
         <if test="dto.assessmentTemplateId != null">
             and t2.id = #{dto.assessmentTemplateId}
         </if>
@@ -100,4 +109,10 @@
             and t2.name like concat('%', #{dto.keyword}, '%')
         </if>
     </select>
+
+    <select id="getSemesterClass" resultType="java.lang.Long">
+        SELECT distinct t1.class_id FROM assessment_plan_answer_class t1
+        INNER JOIN assessment_template_plan t2 ON t1.assessment_template_plan_id = t2.id
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0 AND t2.status in (0, 1) AND t2.base_semester_id = #{id}
+    </select>
 </mapper>

+ 5 - 1
src/main/resources/sqlScript/20210328_sql.sql

@@ -235,10 +235,14 @@ CREATE TABLE `assessment_plan_answer_result` (
   `enabled_mark` INT DEFAULT NULL,
   `student_user_id` BIGINT DEFAULT NULL COMMENT '学生id',
   `question_id` BIGINT DEFAULT NULL COMMENT '选项id(assessment_plan_question[category=2的id])',
-  `answer_id` varchar(40) DEFAULT NULL COMMENT '选项id(assessment_plan_question[category=3的id])',
+  `answer_id` VARCHAR(40) DEFAULT NULL COMMENT '选项id(assessment_plan_question[category=3的id])',
   `assessment_template_plan_id` BIGINT DEFAULT NULL COMMENT '考核计划id(assessment_template_plan)',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核答题结果';
 
+DROP TABLE IF EXISTS day_time_select;
+CREATE TABLE `day_time_select` (
+  `time` DOUBLE DEFAULT NULL
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;