zouxuan 2 years ago
parent
commit
ac4b749e5d

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ManagerDownloadDao.java

@@ -2,7 +2,9 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.ManagerDownload;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 public interface ManagerDownloadDao extends BaseDAO<Integer,ManagerDownload> {
 
+    void batchDel(@Param("ids") String ids);
 }

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.page;
 
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author Joburgess
@@ -23,7 +24,18 @@ public class VipGroupQueryInfo extends QueryInfo {
     private Integer educationalTeacherId;
 
     private Boolean hasEducationalTeacherId;
-    
+
+    @ApiModelProperty(value = "上课时间,年月日",required = false)
+    private String classDate;
+
+    public String getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(String classDate) {
+        this.classDate = classDate;
+    }
+
     public Boolean getHasEducationalTeacherId() {
         return hasEducationalTeacherId;
     }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ManagerDownloadService.java

@@ -5,4 +5,5 @@ import com.ym.mec.common.service.BaseService;
 
 public interface ManagerDownloadService extends BaseService<Integer, ManagerDownload> {
 
+    void batchDel(String ids);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -4413,6 +4413,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         } else {
             dataList = courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(),GroupType.VIP.getCode());
         }
+		if(!CollectionUtils.isEmpty(dataList)){
+			Stream<CourseSchedule> stream = dataList.stream();
+			if(StringUtils.isNotEmpty(queryInfo.getSearch())){
+				stream = stream.filter(e -> e.getId().toString().equals(queryInfo.getSearch()) || e.getName().equals(queryInfo.getSearch()));
+			}
+			if(StringUtils.isNotEmpty(queryInfo.getClassDate())){
+				stream.filter(e->DateUtil.dateToString(e.getClassDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT).equals(queryInfo.getClassDate()));
+			}
+			dataList = stream.collect(Collectors.toList());
+		}
 
         int count = dataList.size();
         if (count > 0) {

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ManagerDownloadServiceImpl.java

@@ -19,4 +19,8 @@ public class ManagerDownloadServiceImpl extends BaseServiceImpl<Integer, Manager
         return managerDownloadDao;
     }
 
+    @Override
+    public void batchDel(String ids) {
+        managerDownloadDao.batchDel(ids);
+    }
 }

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ManagerDownloadMapper.xml

@@ -25,6 +25,9 @@
         delete from manager_download
         where id_ = #{id,jdbcType=INTEGER}
     </delete>
+    <delete id="batchDel">
+        delete from manager_download where FIND_IN_SET(id_, #{ids})
+    </delete>
     <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ManagerDownload"
             useGeneratedKeys="true">
         <!--@mbg.generated-->

+ 13 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ManagerDownloadController.java

@@ -8,9 +8,11 @@ import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
 import com.ym.mec.biz.service.ManagerDownloadService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -44,4 +46,15 @@ public class ManagerDownloadController extends BaseController {
         return succeed(managerDownloadService.delete(id));
     }
 
+    @ApiOperation(value = "删除")
+    @PostMapping("/batchDel")
+    @PreAuthorize("@pcs.hasPermissions('managerDownload/batchDel')")
+    public Object batchDel(String ids) {
+        if(StringUtils.isEmpty(ids)){
+            throw new BizException("参数校验失败");
+        }
+        managerDownloadService.batchDel(ids);
+        return succeed();
+    }
+
 }