فهرست منبع

教室端曲库管理

zouxuan 4 سال پیش
والد
کامیت
9924076398

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java

@@ -5,12 +5,23 @@ import io.swagger.annotations.ApiModelProperty;
 
 public class SysExamSongQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "上传人",required = true)
+    private Integer createUserId;
+
     @ApiModelProperty(value = "声部",required = true)
     private Integer subjectId;
 
     @ApiModelProperty(value = "类型",required = true)
     private String type;
 
+    public Integer getCreateUserId() {
+        return createUserId;
+    }
+
+    public void setCreateUserId(Integer createUserId) {
+        this.createUserId = createUserId;
+    }
+
     public Integer getSubjectId() {
         return subjectId;
     }

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

@@ -77,6 +77,9 @@
 			<if test="search != null and search != ''">
 				AND (ses.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
+			<if test="createUserId != null">
+				AND ses.create_user_id_ = #{createUserId}
+			</if>
 			<if test="type != null and type != ''">
 				AND ses.type_ = #{type}
 			</if>

+ 64 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongController.java

@@ -0,0 +1,64 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysExamSong;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysExamSongService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysExamSong")
+@Api(tags = "曲库服务")
+@RestController
+public class SysExamSongController extends BaseController {
+
+    @Autowired
+    private SysExamSongService sysExamSongService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    public Object update(@RequestBody SysExamSong sysExamSong) {
+        sysExamSongService.update(sysExamSong);
+        return succeed();
+    }
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object add(@RequestBody SysExamSong sysExamSong) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        sysExamSong.setCreateUserId(sysUser.getId());
+        sysExamSongService.insert(sysExamSong);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del/{id}")
+    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
+        sysExamSongService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        queryInfo.setCreateUserId(sysUser.getId());
+        return succeed(sysExamSongService.queryPage(queryInfo));
+    }
+
+}

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysExamSongController.java

@@ -1,9 +1,12 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.SysExamSong;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysExamSongService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -18,6 +21,8 @@ public class SysExamSongController extends BaseController {
 
     @Autowired
     private SysExamSongService sysExamSongService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "修改")
     @PostMapping("/update")
@@ -31,6 +36,11 @@ public class SysExamSongController extends BaseController {
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('sysExamSong/add')")
     public Object add(@RequestBody SysExamSong sysExamSong) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        sysExamSong.setCreateUserId(sysUser.getId());
         sysExamSongService.insert(sysExamSong);
         return succeed();
     }