Browse Source

1、发布功能调整
2、列表条件筛选功能实现

dzx 1 year ago
parent
commit
bef926d9f5

+ 17 - 7
src/main/java/com/xjrsoft/module/evaluate/controller/EvaluateManageController.java

@@ -7,10 +7,13 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.evaluate.dto.AddEvaluateManageDto;
+import com.xjrsoft.module.evaluate.dto.EvaluateManageChangeStatusDto;
 import com.xjrsoft.module.evaluate.dto.EvaluateManagePageDto;
 import com.xjrsoft.module.evaluate.dto.UpdateEvaluateManageDto;
 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.EvaluateManagePageVo;
 import com.xjrsoft.module.evaluate.vo.EvaluateManageVo;
 import io.swagger.annotations.Api;
@@ -42,6 +45,7 @@ public class EvaluateManageController {
 
 
     private final IEvaluateManageService evaluateManageService;
+    private final IEvaluateTemplateService evaluateTemplateService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="评价管理列表(分页)")
@@ -60,15 +64,22 @@ public class EvaluateManageController {
         if (evaluateManage == null) {
            return RT.error("找不到此数据!");
         }
-        return RT.ok(BeanUtil.toBean(evaluateManage, EvaluateManageVo.class));
+        EvaluateTemplate evaluateTemplate = evaluateTemplateService.getById(evaluateManage.getEvaluateTemplateId());
+        EvaluateManageVo manageVo = BeanUtil.toBean(evaluateManage, EvaluateManageVo.class);
+        manageVo.setEvaluateType(evaluateTemplate.getEvaluateType());
+        return RT.ok(manageVo);
     }
 
-    @PostMapping(value = "/release")
-    @ApiOperation(value="发布")
+    @PostMapping(value = "/change-status")
+    @ApiOperation(value="修改状态")
     @SaCheckPermission("evaluatemanage:detail")
-    public RT<Boolean> release(@RequestParam Long id){
-        Boolean release = evaluateManageService.release(id);
-        return RT.ok(release);
+    public RT<Boolean> changeStatus(@RequestParam EvaluateManageChangeStatusDto dto){
+        if(dto.getStatus() == 1){
+            Boolean release = evaluateManageService.release(dto.getId());
+            return RT.ok(release);
+        }
+
+        return RT.ok(true);
     }
 
 
@@ -96,7 +107,6 @@ public class EvaluateManageController {
     @SaCheckPermission("evaluatemanage:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
         return RT.ok(evaluateManageService.delete(ids));
-
     }
 
 }

+ 16 - 4
src/main/java/com/xjrsoft/module/evaluate/dto/EvaluateManagePageDto.java

@@ -4,12 +4,8 @@ import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springframework.format.annotation.DateTimeFormat;
 
-import java.time.LocalTime;
 import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.Date;
 
 
 /**
@@ -22,5 +18,21 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 public class EvaluateManagePageDto extends PageInput {
 
+    @ApiModelProperty("学期id")
+    private Long semesterId;
 
+    @ApiModelProperty("部门id")
+    private Long orgId;
+
+    @ApiModelProperty("评价类型")
+    private String evaluateType;
+
+    @ApiModelProperty("状态(-1:未发布,0:暂停,1:进行中,2:已结束)")
+    private Integer status;
+
+    @ApiModelProperty("开始时间")
+    private LocalDateTime startTime;
+
+    @ApiModelProperty("结束时间")
+    private LocalDateTime endTime;
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/evaluate/service/IEvaluateManageService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.evaluate.dto.EvaluateManagePageDto;
 import com.xjrsoft.module.evaluate.entity.EvaluateManage;
+import com.xjrsoft.module.evaluate.entity.EvaluateObject;
 import com.xjrsoft.module.evaluate.vo.EvaluateManagePageVo;
 
 import java.util.List;
@@ -48,5 +49,12 @@ public interface IEvaluateManageService extends MPJBaseService<EvaluateManage> {
      */
     Page<EvaluateManagePageVo> getPage(Page<EvaluateManagePageDto> page, EvaluateManagePageDto dto);
 
+    /**
+     * 发布功能
+     * @param id
+     * @return
+     */
     Boolean release(Long id);
+
+    List<EvaluateObject> getObjectList(Long id);
 }

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

@@ -1,17 +1,13 @@
 package com.xjrsoft.module.evaluate.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
-import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.module.evaluate.dto.EvaluateManagePageDto;
 import com.xjrsoft.module.evaluate.entity.EvaluateExecuter;
-import com.xjrsoft.module.evaluate.entity.EvaluateItem;
 import com.xjrsoft.module.evaluate.entity.EvaluateManage;
-import com.xjrsoft.module.evaluate.entity.EvaluateManageItem;
 import com.xjrsoft.module.evaluate.entity.EvaluateObject;
 import com.xjrsoft.module.evaluate.mapper.EvaluateExecuterMapper;
 import com.xjrsoft.module.evaluate.mapper.EvaluateItemMapper;
@@ -159,4 +155,10 @@ public class EvaluateManageServiceImpl extends MPJBaseServiceImpl<EvaluateManage
         evaluateManageMapper.insert(evaluateManage);
         return true;
     }
+
+    @Override
+    public List<EvaluateObject> getObjectList(Long id) {
+
+        return null;
+    }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/evaluate/vo/EvaluateManageVo.java

@@ -50,6 +50,9 @@ public class EvaluateManageVo {
     */
     @ApiModelProperty("评价名称")
     private String name;
+
+    @ApiModelProperty("评价类型")
+    private String evaluateType;
     /**
     * 开始时间
     */

+ 19 - 1
src/main/resources/mapper/evaluate/EvaluateManageMapper.xml

@@ -10,12 +10,30 @@
         LEFT JOIN xjr_department t4 ON t4.id = t1.org_id
         LEFT JOIN xjr_dictionary_detail t5 ON t5.code = t3.evaluate_type AND t5.item_id = 1746831039385366530
         WHERE t1.delete_mark = 0
+        <if test="dto.semesterId != null">
+            and t1.base_semester_id = #{dto.semesterId}
+        </if>
+        <if test="dto.orgId != null">
+            and t1.org_id = #{dto.orgId}
+        </if>
+        <if test="dto.evaluateType != null and dto.evaluateType != ''">
+            and t3.evaluate_type = #{dto.evaluateType}
+        </if>
+        <if test="dto.status != null">
+            and t1.status = #{dto.status}
+        </if>
+        <if test="dto.startTime != null">
+            and t1.start_time >= #{dto.startTime}
+        </if>
+        <if test="dto.endTime != null">
+            and #{dto.endTime} >= t1.end_time
+        </if>
         ORDER BY t1.create_date DESC
     </select>
     <select id="getList" parameterType="com.xjrsoft.module.room.dto.RoomPageDto" resultType="com.xjrsoft.module.room.vo.RoomExcelVo">
     </select>
     <select id="getMaxSortCode" resultType="java.lang.Integer">
-        SELECT IFNULL(MAX(sort_code),1) FROM room WHERE delete_mark = 0
+        SELECT IFNULL(MAX(sort_code),1) FROM evaluate_manage WHERE delete_mark = 0
     </select>
 
     <select id="getRoomClassCount" resultType="com.xjrsoft.module.room.vo.RoomClassCountVo">