yonge 3 سال پیش
والد
کامیت
5f8f1577ac

+ 1 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserDeviceServiceImpl.java

@@ -102,6 +102,7 @@ public class SysUserDeviceServiceImpl extends BaseServiceImpl<Integer, SysUserDe
 			sysUserDevice.setDeviceNum(deviceNum);
 			sysUserDevice.setBindTime(new Date());
 			sysUserDevice.setClientId(clientId);
+			sysUserDevice.setTenantId(tenantId);
 			sysUserDeviceDao.insert(sysUserDevice);
 		}
 		

+ 38 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TenantApplyQueryInfo.java

@@ -0,0 +1,38 @@
+package com.ym.mec.biz.dal.page;
+
+import java.util.Date;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class TenantApplyQueryInfo extends QueryInfo {
+
+	private Date startDateTime;
+	
+	private Date endDateTime;
+	
+	private String name;
+
+	public Date getStartDateTime() {
+		return startDateTime;
+	}
+
+	public void setStartDateTime(Date startDateTime) {
+		this.startDateTime = startDateTime;
+	}
+
+	public Date getEndDateTime() {
+		return endDateTime;
+	}
+
+	public void setEndDateTime(Date endDateTime) {
+		this.endDateTime = endDateTime;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 19 - 3
mec-biz/src/main/resources/config/mybatis/TenantApplyMapper.xml

@@ -81,15 +81,31 @@
 		DELETE FROM tenant_apply WHERE id_ = #{id}
 	</delete>
 
+	<sql id="queryPageCondition">
+		<where>
+			<if test="name != null and name != ''">
+				AND name_ LIKE CONCAT('%', #{name}, '%')
+			</if>
+			<if test="startDateTime != null">
+				AND create_time_ &gt;= #{startDateTime}
+			</if>
+			<if test="endDateTime != null">
+				AND create_time_ &lt;= #{endDateTime}
+			</if>
+		</where>
+	</sql>
+
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="TenantApply" parameterType="map">
-		SELECT * FROM tenant_apply ORDER BY id_
+		SELECT * FROM tenant_apply 
+		<include refid="queryPageCondition"/>
+		ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM
-		tenant_apply
+		SELECT COUNT(*) FROM tenant_apply
+		<include refid="queryPageCondition"/>
 	</select>
 </mapper>

+ 19 - 19
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreCategoriesController.java

@@ -1,23 +1,25 @@
 package com.ym.mec.teacher.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
-import com.ym.mec.biz.service.TeacherService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.TenantConfig;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
+import com.ym.mec.biz.service.TeacherService;
+import com.ym.mec.biz.service.TenantConfigService;
+import com.ym.mec.common.controller.BaseController;
+
 @RequestMapping("sysMusicScoreCategories")
 @Api(tags = "曲库分类服务")
 @RestController
@@ -29,6 +31,9 @@ public class SysMusicScoreCategoriesController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private TeacherService teacherService;
+    
+    @Autowired
+    private TenantConfigService tenantConfigService;
 
 
     @ApiOperation(value = "分页查询")
@@ -44,15 +49,10 @@ public class SysMusicScoreCategoriesController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        Teacher teacher = teacherService.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(teacher.getTeacherOrganId() + "");
-        }
-        if(StringUtils.isNotBlank(teacher.getFlowOrganRange())){
-            queryInfo.setOrganId(queryInfo.getOrganId() + "," + teacher.getFlowOrganRange());
-        }
-        queryInfo.setEnable(true);
-        return succeed(sysMusicScoreCategoriesService.queryTree(queryInfo));
+        
+        TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>().eq("tenant_id_", sysUser.getTenantId()));
+        
+        return succeed(sysMusicScoreCategoriesService.queryCategoriesTreeList(tenantConfig.getTeachingMaterialId()));
     }
 
     @ApiOperation(value = "获取分类详情")

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/TenantApplyController.java

@@ -15,9 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.biz.dal.entity.TenantApply;
+import com.ym.mec.biz.dal.page.TenantApplyQueryInfo;
 import com.ym.mec.biz.service.TenantApplyService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 
 @RequestMapping("tenantApply")
@@ -34,7 +34,7 @@ public class TenantApplyController extends BaseController {
 	@ApiOperation("分页查询")
 	@GetMapping(value = "/list")
 	@PreAuthorize("@pcs.hasPermissions('tenantApply/list')")	
-	public Object getList(QueryInfo queryInfo) {
+	public Object getList(TenantApplyQueryInfo queryInfo) {
 		return succeed(tenantApplyService.queryPage(queryInfo));
 	}