Преглед изворни кода

1、评价管理发布报错调整修复
2、评价模板删除逻辑调整

dzx пре 1 месец
родитељ
комит
6c33e04a69

+ 15 - 0
src/main/java/com/xjrsoft/module/evaluate/controller/EvaluateTemplateController.java

@@ -7,17 +7,23 @@ import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.evaluate.dto.AddEvaluateTemplateDto;
 import com.xjrsoft.module.evaluate.dto.EvaluateTemplatePageDto;
 import com.xjrsoft.module.evaluate.dto.UpdateEvaluateTemplateDto;
 import com.xjrsoft.module.evaluate.dto.UpdateEvaluateTemplateStatusDto;
+import com.xjrsoft.module.evaluate.entity.EvaluateManage;
 import com.xjrsoft.module.evaluate.entity.EvaluateTemplate;
+import com.xjrsoft.module.evaluate.service.IEvaluateManageService;
 import com.xjrsoft.module.evaluate.service.IEvaluateTemplateService;
 import com.xjrsoft.module.evaluate.vo.EvaluateTemplatePageVo;
 import com.xjrsoft.module.evaluate.vo.EvaluateTemplateVo;
+import com.xjrsoft.module.organization.entity.User;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -51,6 +57,7 @@ public class EvaluateTemplateController {
 
 
     private final IEvaluateTemplateService evaluateTemplateService;
+    private final IEvaluateManageService evaluateManageService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="评价模版列表(分页)")
@@ -120,6 +127,14 @@ public class EvaluateTemplateController {
     @ApiOperation(value = "删除评价模版")
     @SaCheckPermission("evaluatetemplate:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        List<EvaluateManage> list = evaluateManageService.list(
+                new QueryWrapper<EvaluateManage>().lambda()
+                        .in(EvaluateManage::getEvaluateTemplateId, ids)
+                        .eq(EvaluateManage::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        if(!list.isEmpty()){
+            return RT.error("该模板已经被使用,无法删除");
+        }
         return RT.ok(evaluateTemplateService.removeBatchByIds(ids));
 
     }

+ 4 - 0
src/main/java/com/xjrsoft/module/evaluate/service/impl/EvaluateManageServiceImpl.java

@@ -12,6 +12,8 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EvaluateTypeEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.courseTable.entity.CourseTable;
 import com.xjrsoft.module.evaluate.dto.DrillEvaluateClassListDto;
 import com.xjrsoft.module.evaluate.dto.EvaluateManagePageDto;
 import com.xjrsoft.module.evaluate.dto.EvaluateManageScoreDto;
@@ -154,6 +156,8 @@ public class EvaluateManageServiceImpl extends MPJBaseServiceImpl<EvaluateManage
         // 查询参加答题的用户进行微信消息通知
         List<User> list = userService.list(
                 new MPJLambdaWrapper<User>()
+                        .select(User::getId)
+                        .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
                         .innerJoin(EvaluateExecuter.class, EvaluateExecuter::getEvaluateObjectId, User::getId)
                         .eq(EvaluateExecuter::getEvaluateManageId, evaluateManage.getId())
                         .eq(EvaluateExecuter::getDeleteMark, DeleteMark.NODELETE.getCode())

+ 2 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -59,6 +59,7 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -349,6 +350,7 @@ public class JianyuekbScheduleTask {
             if(courseList.size() != courseCount){
                 //表明课程变化了,需要重新申请,需要将原来的申请作废并进行微信消息通知
                 courseAdjust.setEnabledMark(EnabledMark.DISABLED.getCode());
+                courseAdjust.setModifyDate(new Date());
                 courseAdjust.setCancelReason("由于课表更新,当前调/顶课课程发生变化,该调顶课已失效,请重新发起调顶课");
                 cancelList.add(courseAdjust);
                 List<String> thing16Str = new ArrayList<>();