Explorar o código

Merge branch 'pre'

dzx hai 1 ano
pai
achega
9d4f686a88

+ 4 - 6
src/main/java/com/xjrsoft/module/classtime/dto/AddClassTimeCalendarDto.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.classtime.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -19,19 +20,16 @@ public class AddClassTimeCalendarDto implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-    * 课时统计(class_time_statistics)
-    */
-    @ApiModelProperty("课时统计(class_time_statistics)")
-    private Long classTimeStatisticsId;
     /**
     * 补班日期
     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty("补班日期")
-    private Integer supplementDate;
+    private Date supplementDate;
     /**
     * 补课日期
     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty("补课日期")
     private Date replaceDate;
 

+ 1 - 6
src/main/java/com/xjrsoft/module/classtime/entity/ClassTimeCalendar.java

@@ -70,15 +70,10 @@ public class ClassTimeCalendar implements Serializable {
     @TableField(fill = FieldFill.INSERT)
     private Integer enabledMark;
     /**
-    * 课时统计(class_time_statistics)
-    */
-    @ApiModelProperty("课时统计(class_time_statistics)")
-    private Long classTimeStatisticsId;
-    /**
     * 补班日期
     */
     @ApiModelProperty("补班日期")
-    private Integer supplementDate;
+    private Date supplementDate;
     /**
     * 补课日期
     */

+ 1 - 6
src/main/java/com/xjrsoft/module/classtime/vo/ClassTimeCalendarPageVo.java

@@ -50,15 +50,10 @@ public class ClassTimeCalendarPageVo {
     @ApiModelProperty("有效标志")
     private Integer enabledMark;
     /**
-    * 课时统计(class_time_statistics)
-    */
-    @ApiModelProperty("课时统计(class_time_statistics)")
-    private Long classTimeStatisticsId;
-    /**
     * 补班日期
     */
     @ApiModelProperty("补班日期")
-    private Integer supplementDate;
+    private Date supplementDate;
     /**
     * 补课日期
     */

+ 1 - 6
src/main/java/com/xjrsoft/module/classtime/vo/ClassTimeCalendarVo.java

@@ -20,15 +20,10 @@ public class ClassTimeCalendarVo {
     @ApiModelProperty("主键编号")
     private Long id;
     /**
-    * 课时统计(class_time_statistics)
-    */
-    @ApiModelProperty("课时统计(class_time_statistics)")
-    private Long classTimeStatisticsId;
-    /**
     * 补班日期
     */
     @ApiModelProperty("补班日期")
-    private Integer supplementDate;
+    private Date supplementDate;
     /**
     * 补课日期
     */

+ 1 - 1
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -123,7 +123,7 @@ public class NewsController {
     public RT<NewsVo> info(@RequestParam Long id, @RequestParam(required = false) Boolean isRead) {
         News news = newsService.getById(id);
         if (news == null) {
-            RT.error("找不到此新闻!");
+            return RT.error("该内容不存在或已被删除!");
         }
 
         List<NewsRelationVo> newsRelationVoList = new ArrayList<>();

+ 1 - 1
src/main/java/com/xjrsoft/module/oa/controller/ProclamationController.java

@@ -109,7 +109,7 @@ public class ProclamationController {
     public RT<ProclamationVo> info(@RequestParam Long id) {
         ProclamationVo proclamationVo = newsService.getProclamationById(id);
         if (proclamationVo == null) {
-            RT.error("找不到此公告!");
+            return RT.error("该内容不存在或已被删除!");
         }
         return RT.ok(proclamationVo);
     }

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

@@ -92,7 +92,9 @@ public class BaseStudentAssessmentInspectionController {
     public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto) {
         BaseStudentAssessmentInspection inspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
         inspection.setCreateDate(new Date());
+        inspection.setPersonalStudentUserIds(dto.getStudentUserIds());
         boolean isSuccess = inspectionService.save(inspection);
+        inspectionService.dataHandle(inspection.getId());
         return RT.ok(isSuccess);
     }
 

+ 5 - 1
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentAssessmentInspectionDto.java

@@ -2,8 +2,11 @@ package com.xjrsoft.module.student.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
+import java.text.DateFormat;
+import java.time.LocalDate;
 import java.util.Date;
 
 
@@ -54,8 +57,9 @@ public class AddBaseStudentAssessmentInspectionDto implements Serializable {
     /**
      * 考核时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty("考核时间")
-    private Date assessmentDate;
+    private LocalDate assessmentDate;
     /**
      * 分数
      */

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

@@ -20,7 +20,7 @@ import java.util.List;
 public class BaseStudentAssessmentInspectionPageDto extends PageInput {
 
     @ApiModelProperty("考核项目ids")
-    private List<Long> projectIds;
+    private Long projectIds;
 
     @ApiModelProperty("年级id")
     private Long gradeId;

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

@@ -103,7 +103,7 @@ public class BaseStudentAssessmentInspection implements Serializable {
      * 学生Ids(多选)
      */
     @ApiModelProperty("学生Ids(多选)")
-    private String studentUserIds;
+    private String personalStudentUserIds;
     /**
     * 考核时间
     */

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentAssessmentInspectionMapper.java

@@ -7,6 +7,7 @@ import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
 import com.xjrsoft.module.student.dto.QuantitativeAssessmentExcelDto;
 import com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto;
 import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
@@ -61,4 +62,7 @@ public interface BaseStudentAssessmentInspectionMapper extends MPJBaseMapper<Bas
 
     List<QuantitativeAssessmentSingleScoreVo> getParamilitaryList(@Param("dto") QuantitativeAssessmentSingleScoreDto dto);
 
+
+    List<BaseStudentAssessmentStudentRelation> getStudentListByInspectionId(Long id);
+
 }

+ 9 - 18
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.support.ExcelTypeEnum;
@@ -139,11 +140,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
         result.setClassList(baseStudentAssessmentClassListVos);
 
         // 获取学生信息
-        List<BaseStudentAssessmentStudentRelation> baseStudentAssessmentStudentRelations = assessmentStudentRelationMapper.selectList(
-                Wrappers.<BaseStudentAssessmentStudentRelation>query().lambda()
-                        .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, result.getId())
-        );
-        result.setStudentList(baseStudentAssessmentStudentRelations);
+        result.setStudentList(assessmentInspectionMapper.getStudentListByInspectionId(id));
 
         // 获取文件列表
         result.setFileInfos(fileService.list(Wrappers.<File>query().lambda().eq(File::getFolderId, result.getFileId())));
@@ -496,14 +493,11 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
         //获取考核记录
         BaseStudentAssessmentInspection baseStudentAssessmentInspection = this.getById(id);
         if(baseStudentAssessmentInspection != null){
-            //同步数据到考核关联班级表
-            if(baseStudentAssessmentInspection.getAssessmentType() != null
-                    && baseStudentAssessmentInspection.getAssessmentType().equals("class")
-                    && baseStudentAssessmentInspection.getClassIds() != null
-                    && !baseStudentAssessmentInspection.getClassIds().equals("")){
+            if(StrUtil.isNotEmpty(baseStudentAssessmentInspection.getClassIds())) {
+                //同步数据到考核关联班级表
                 String[] classIds = baseStudentAssessmentInspection.getClassIds().split(",");
-                for (String classId: classIds) {
-                    assessmentClassRelationMapper.insert(new BaseStudentAssessmentClassRelation(){{
+                for (String classId : classIds) {
+                    assessmentClassRelationMapper.insert(new BaseStudentAssessmentClassRelation() {{
                         setClassId(Long.parseLong(classId));
                         setBaseStudentAssessmentInspectionId(baseStudentAssessmentInspection.getId());
                         QueryWrapper<BaseStudentAssessmentClassRelation> queryWrapperSortcode = new QueryWrapper<>();
@@ -514,11 +508,8 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
                 }
             }
             //同步数据到考核关联学生表
-            if(baseStudentAssessmentInspection.getAssessmentType() != null
-                    && baseStudentAssessmentInspection.getAssessmentType().equals("personal")
-                    && baseStudentAssessmentInspection.getStudentUserIds() != null
-                    && !baseStudentAssessmentInspection.getStudentUserIds().equals("")){
-                String[] studentIds = baseStudentAssessmentInspection.getStudentUserIds().split(",");
+            if(StrUtil.isNotEmpty(baseStudentAssessmentInspection.getPersonalStudentUserIds())){
+                String[] studentIds = baseStudentAssessmentInspection.getPersonalStudentUserIds().split(",");
                 for (String studentId: studentIds) {
                     assessmentStudentRelationMapper.insert(new BaseStudentAssessmentStudentRelation(){{
                         MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
@@ -571,7 +562,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
             data.put("const3", new JSONObject() {{
                 put("value", AssessmentTypeEnum.PERSONAL.getValue());
             }});
-            String[] studentUsers = inspection.getStudentUserIds().split(",");
+            String[] studentUsers = inspection.getPersonalStudentUserIds().split(",");
             List<String> studentIds = new ArrayList<>();
             for (String studentUser : studentUsers) {
                 studentIds.add(studentUser.trim());

+ 14 - 7
src/main/resources/mapper/student/BaseStudentAssessmentInspectionMapper.xml

@@ -15,16 +15,13 @@
         FROM base_student_assessment_inspection t
         LEFT JOIN base_student_assessment_category t1 ON (t1.id = t.base_student_assessment_category_id)
         LEFT JOIN base_student_assessment_project t2 ON (t2.id = t.base_student_assessment_project_id)
-        LEFT JOIN base_semester t3 ON t.base_semester_id=t3.id
+        LEFT JOIN base_semester t3 ON t.base_semester_id = t3.id
         LEFT JOIN base_grade t4 ON t.grade_id = t4.id
-        LEFT JOIN xjr_user t5 ON t.create_user_id = t5.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
-        <if test="dto.projectIds != null and dto.projectIds.size() > 0">
-            and t.base_student_assessment_project_id in
-            <foreach item="projectId" index="index" collection="dto.projectIds" open="(" close=")" separator=",">
-                #{projectId}
-            </foreach>
+        <if test="dto.projectIds != null">
+            and t.base_student_assessment_category_id = #{dto.projectIds}
         </if>
         <if test="dto.gradeId != null">
             and t.grade_id = #{dto.gradeId}
@@ -307,4 +304,14 @@
         </if>
         group by t.class_id;
     </select>
+    <select id="getStudentListByInspectionId"
+            resultType="com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation">
+        SELECT t1.id,t1.user_id,t1.class_id,t3.student_id,t2.name,t6.name AS nation,t4.name AS class_name,t5.name AS major_name FROM base_student_assessment_student_relation t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        INNER JOIN base_student t3 ON t2.id = t3.user_id
+        INNER JOIN base_class t4 ON t4.id = t1.class_id
+        INNER JOIN base_major_set t5 ON t4.major_set_id = t5.id
+        LEFT JOIN xjr_dictionary_detail t6 ON t3.nation = t6.code
+        WHERE t1.base_student_assessment_inspection_id = #{id}
+    </select>
 </mapper>