fanxp 1 year ago
parent
commit
ca515b8ae7

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

@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dtflys.forest.annotation.Get;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
@@ -55,7 +56,6 @@ import java.util.List;
 @AllArgsConstructor
 public class BaseStudentAssessmentInspectionController {
 
-
     private final IBaseStudentAssessmentInspectionService baseStudentAssessmentInspectionService;
 
     @GetMapping(value = "/page")

+ 13 - 4
src/main/java/com/xjrsoft/module/student/dto/BaseStudentAssessmentInspectionMobilePageDto.java

@@ -1,6 +1,8 @@
 package com.xjrsoft.module.student.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -18,8 +20,15 @@ public class BaseStudentAssessmentInspectionMobilePageDto extends PageInput {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 班级编号
-     */
-    private List<Long> class_ids;
+    @ApiModelProperty("班级编号")
+    private List<Long> classIds;
+
+    @ApiModelProperty("项目编号")
+    private List<Long> projectIds;
+
+    @ApiModelProperty("考核日期-开始")
+    private String startDate;
+
+    @ApiModelProperty("考核日期-结束")
+    private String endDate;
 }

+ 1 - 21
src/main/java/com/xjrsoft/module/student/dto/BaseStudentAssessmentInspectionPageDto.java

@@ -24,24 +24,15 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = false)
 public class BaseStudentAssessmentInspectionPageDto extends PageInput {
 
-    @ApiModelProperty("流程状态")
-    private Integer status;
-
     @ApiModelProperty("考核项目ids")
-    private List<Long> baseStudentAssessmentProjectIds;
+    private List<Long> projectIds;
 
     @ApiModelProperty("年级id")
     private Long gradeId;
 
-    @ApiModelProperty("专业id")
-    private Long majorSetId;
-
     @ApiModelProperty("学期id")
     private Long semesterId;
 
-    @ApiModelProperty("招生类型")
-    private String enrollType;
-
     @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty("考核日期-开始")
     private String startDate;
@@ -50,17 +41,6 @@ public class BaseStudentAssessmentInspectionPageDto extends PageInput {
     @ApiModelProperty("考核日期-结束")
     private String endDate;
 
-    @ApiModelProperty("登记人")
-    private String createUserName;
-
-    @ApiModelProperty("修改人")
-    private String modifyUserName;
-
     @ApiModelProperty("考核人")
     private String assessmentUserName;
-
-    @ApiModelProperty("班级ids")
-    private List<Long> classIds;
-
-
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/entity/BaseStudentAssessmentClassRelation.java

@@ -25,7 +25,7 @@ import java.util.Date;
 */
 @Data
 @TableName("base_student_assessment_class_relation")
-@ApiModel(value = "学生班级巡查考核-关联班级对象", description = "学生班级巡查考核-关联班级")
+@ApiModel(value = "base_student_assessment_class_relation", description = "学生班级巡查考核-关联班级")
 public class BaseStudentAssessmentClassRelation implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 14 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,6 +9,7 @@ import com.github.yulichang.toolkit.MPJWrappers;
 import com.xjrsoft.common.enums.ScoreTypeEnum;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.oa.entity.Schedule;
 import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto;
 import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
@@ -27,6 +29,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @title: 学生班级巡查考核
@@ -44,6 +47,8 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
 
     private final BaseStudentAssessmentClassRelationMapper assessmentClassRelationMapper;
 
+    private final BaseClassMapper baseClassMapper;
+
     private final IFileService fileService;
 
     @Override
@@ -97,6 +102,15 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
 
     @Override
     public Page<BaseStudentAssessmentInspectionMobilePageVo> getMobilePage(Page<BaseStudentAssessmentInspectionMobilePageDto> page, BaseStudentAssessmentInspectionMobilePageDto dto) {
+        if (dto.getClassIds() == null || dto.getClassIds().size() == 0) {
+            // 获取当前用户所管班级
+            List<Long> classIds = baseClassMapper.selectList(
+                    Wrappers.<BaseClass>query().lambda()
+                            .eq(BaseClass::getTeacherId, StpUtil.getLoginIdAsLong())
+                            .select(BaseClass::getId)
+            ).stream().map(BaseClass::getId).collect(Collectors.toList());
+            dto.setClassIds(classIds);
+        }
         Page<BaseStudentAssessmentInspectionMobilePageVo> result = assessmentInspectionMapper.getMobilePage(page, dto);
         // 处理加减分
         result.getRecords().forEach((node) -> {

+ 1 - 1
src/main/resources/apiTemplates/entity.java.ftl

@@ -25,7 +25,7 @@ import java.util.Date;
 */
 @Data
 @TableName("${tableName}")
-@ApiModel(value = "${tableComment}对象", description = "${tableComment}")
+@ApiModel(value = "${tableName}", description = "${tableComment}")
 public class ${entityClass} implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 43 - 5
src/main/resources/mapper/student/BaseStudentAssessmentInspectionMapper.xml

@@ -20,7 +20,28 @@
         left join base_grade t4 on t.grade_id=t4.id
         left join xjr_user t5 on t.assessment_user_id=t5.id
         left join xjr_dictionary_detail t6 on t6.code=t.score_type
-        where  t.delete_mark=0 and t1.delete_mark=0  and t2.delete_mark=0  and t3.delete_mark=0 and t.status=1;
+        where  t.delete_mark=0 and t1.delete_mark=0  and t2.delete_mark=0  and t3.delete_mark=0 and t.status=1
+        <if test="dto.projectIds != null">
+            and t.base_student_assessment_project_id in
+            <foreach item="projectId" index="index" collection="dto.projectIds" open="(" close=")" separator=",">
+                #{projectId}
+            </foreach>
+        </if>
+        <if test="dto.gradeId != null">
+            and t.grade_id = #{dto.gradeId}
+        </if>
+        <if test="dto.semesterId != null">
+            and t.base_semester_id = #{dto.semesterId}
+        </if>
+        <if test="dto.startDate != null and dto.startDate != ''">
+            and t.assessment_date &gt;= #{dto.startDate}
+        </if>
+        <if test="dto.endDate != null and dto.endDate != ''">
+            and t.assessment_date &lt;= #{dto.endDate}
+        </if>
+        <if test="dto.assessmentUserName != null and dto.assessmentUserName != ''">
+            and t5.name like concat('%',#{dto.assessmentUserName},'%')
+        </if>
     </select>
 
     <select id="getInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionVo">
@@ -37,10 +58,12 @@
         where t.id=#{id} and t.delete_mark=0 and t1.delete_mark=0  and t2.delete_mark=0  and t3.delete_mark=0 and t.status=1;
     </select>
 
-    <select id="getMobilePage" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo">
-        select t.id,t1.assessment_date,t2.name as assessment_category_name,t3.name as assessment_project_name,t5.name as assessment_class_name,t1.reason,t1.score,t1.score_type,t4.name as score_type_cn,
+    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo">
+        select t.id,t1.assessment_date,t2.name as assessment_category_name,t3.name as assessment_project_name,t5.name as
+        assessment_class_name,t1.reason,t1.score,t1.score_type,t4.name as score_type_cn,
         (
-            SELECT count(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id = t1.id and class_id=t.class_id
+            SELECT count(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id =
+            t1.id and class_id=t.class_id
         ) as student_count
         from base_student_assessment_class_relation t
         left join base_student_assessment_inspection t1 on t1.id=t.base_student_assessment_inspection_id
@@ -48,7 +71,22 @@
         left join base_student_assessment_project t3 on (t3.id = t1.base_student_assessment_project_id)
         left join xjr_dictionary_detail t4 on t4.code=t1.score_type
         left join base_class t5 on t5.id=t.class_id
-        where  t1.delete_mark=0 and t1.status=1 ;
+        where t1.delete_mark=0 and t1.status=1 and t.class_id in
+        <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
+            #{classId}
+        </foreach>
+        <if test="dto.projectIds != null">
+            and t1.base_student_assessment_project_id in
+            <foreach item="projectId" index="index" collection="dto.projectIds" open="(" close=")" separator=",">
+                #{projectId}
+            </foreach>
+        </if>
+        <if test="dto.startDate != null and dto.startDate != ''">
+            and t1.assessment_date &gt;= #{dto.startDate}
+        </if>
+        <if test="dto.endDate != null and dto.endDate != ''">
+            and t1.assessment_date &lt;= #{dto.endDate}
+        </if>
     </select>
 
     <select id="getMobileInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo">