zouxuan 5 years ago
parent
commit
ff059b86a9

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -17,7 +17,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @EnableDiscoveryClient
 @EnableFeignClients
 @MapperScan("com.ym.mec.web.dal.dao")
-@ComponentScan(basePackages = "com.ym.mec.web")
+@ComponentScan(basePackages = "com.ym.mec")
 @Configuration
 @EnableSwagger2Doc
 public class WebApplication {

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java

@@ -46,7 +46,7 @@ public class MusicGroupController extends BaseController {
 
     @ApiOperation(value = "根据乐团编号查询乐团")
     @GetMapping("/get/{id}")
-    public Object update(@ApiParam(value = "乐团编号", required = true) @PathVariable("id") String id){
+    public Object get(@ApiParam(value = "乐团编号", required = true) @PathVariable("id") String id){
         return succeed(musicGroupService.get(id));
     }
 

+ 33 - 3
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationController.java

@@ -2,14 +2,16 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.Organization;
 import com.ym.mec.web.dal.page.OrganizationQueryInfo;
 import com.ym.mec.web.service.OrganizationService;
 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.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
 
 @RequestMapping("organization")
 @Api(tags = "组织机构服务")
@@ -24,4 +26,32 @@ public class OrganizationController extends BaseController {
     public Object queryPage(OrganizationQueryInfo queryInfo){
         return organizationService.queryTreePage(queryInfo);
     }
+
+    @ApiOperation(value = "新增机构")
+    @PostMapping("/add")
+    public Object add(Organization organization){
+        Date date = new Date();
+        organization.setCreateTime(date);
+        organization.setUpdateTime(date);
+        return succeed(organizationService.insert(organization));
+    }
+
+    @ApiOperation(value = "根据机构编号删除机构")
+    @DeleteMapping("/del/{id}")
+    public Object del(@ApiParam(value = "组织编号", required = true) @PathVariable("id") Integer id){
+        return succeed(organizationService.delete(id));
+    }
+
+    @ApiOperation(value = "修改机构信息")
+    @PutMapping("/update")
+    public Object update(Organization organization){
+        organization.setUpdateTime(new Date());
+        return succeed(organizationService.update(organization));
+    }
+
+    @ApiOperation(value = "根据机构编号查询机构详情")
+    @GetMapping("/get/{id}")
+    public Object get(@ApiParam(value = "组织编号", required = true) @PathVariable("id") Integer id){
+        return succeed(organizationService.get(id));
+    }
 }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -46,7 +46,7 @@ public class SchoolController extends BaseController {
 
     @ApiOperation(value = "根据学校编号查询学校")
     @GetMapping("/get/{id}")
-    public Object update(@ApiParam(value = "学校编号", required = true) @PathVariable("id") Integer id){
+    public Object get(@ApiParam(value = "学校编号", required = true) @PathVariable("id") Integer id){
         return succeed(schoolService.get(id));
     }
 

+ 58 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -0,0 +1,58 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.web.dal.entity.Teacher;
+import com.ym.mec.web.dal.page.TeacherQueryInfo;
+import com.ym.mec.web.service.TeacherService;
+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.web.bind.annotation.*;
+import java.util.Date;
+
+@RequestMapping("school")
+@Api(tags = "教师服务")
+@RestController
+public class TeacherController extends BaseController {
+
+    @Autowired
+    private TeacherService teacherService;
+
+    @ApiOperation(value = "新增教师")
+    @PostMapping("/add")
+    public Object add(Teacher teacher){
+        Date date = new Date();
+        teacher.setCreateTime(date);
+        teacher.setUpdateTime(date);
+        teacherService.insert(teacher);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除教师")
+    @DeleteMapping("/del/{id}")
+    public Object del(@ApiParam(value = "教师编号", required = true) @PathVariable("id") Integer id){
+        teacherService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改教师")
+    @PutMapping("/update")
+    public Object update(Teacher teacher){
+        teacher.setUpdateTime(new Date());
+        teacherService.update(teacher);
+        return succeed();
+    }
+
+    @ApiOperation(value = "根据教师编号查询教师")
+    @GetMapping("/get/{id}")
+    public Object get(@ApiParam(value = "教师编号", required = true) @PathVariable("id") Integer id){
+        return succeed(teacherService.get(id));
+    }
+
+    @ApiOperation(value = "分页查询教师列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(TeacherQueryInfo queryInfo){
+        return succeed(teacherService.queryPage(queryInfo));
+    }
+}

+ 34 - 10
mec-web/src/main/java/com/ym/mec/web/dal/entity/Teacher.java

@@ -1,5 +1,8 @@
 package com.ym.mec.web.dal.entity;
 
+import com.ym.mec.web.dal.enums.JobNatureEnum;
+import com.ym.mec.web.dal.enums.JobTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -11,42 +14,55 @@ public class Teacher {
 	private Integer userId;
 	
 	/**  */
+	@ApiModelProperty(value = "机构编号",required = false)
 	private Integer organId;
 	
 	/** 职务类型(指导老师、教务老师、教学主管) */
-	private String jobType;
+	@ApiModelProperty(value = "职务类型(指导老师 ADVISER、教务老师 ACADEMIC、教学主管 TEACHING)",required = false)
+	private JobTypeEnum jobType;
 	
 	/** 工作性质(兼职、全职) */
-	private String jobNature;
+	@ApiModelProperty(value = "工作性质(兼职 PART_JOB、全职FULL_JOB)",required = false)
+	private JobNatureEnum jobNature;
 	
 	/** 是否试用期 */
+	@ApiModelProperty(value = "是否试用期1是,0否",required = false)
 	private Boolean isProbationPeriod;
 	
 	/** 学历 */
+	@ApiModelProperty(value = "学历",required = false)
 	private String educationBackground;
 	
 	/** 毕业学校 */
+	@ApiModelProperty(value = "毕业学校",required = false)
 	private String graduateSchool;
 	
 	/** 技术职称 */
+	@ApiModelProperty(value = "技术职称",required = false)
 	private String technicalTitles;
 	
 	/** 工作单位 */
+	@ApiModelProperty(value = "工作单位",required = false)
 	private String workUnit;
 	
 	/** 专业技能(支持多个,用|分隔),对应科目表编号 */
+	@ApiModelProperty(value = "专业技能(支持多个,用|分隔),对应科目表编号",required = false)
 	private String subjectId;
 	
 	/** 入职时间 */
+	@ApiModelProperty(value = "入职时间",required = false)
 	private java.util.Date entryDate;
 	
 	/** 证件类型 */
+	@ApiModelProperty(value = "证件类型",required = false)
 	private String certificateType;
 	
 	/** 证件号码 */
+	@ApiModelProperty(value = "证件号码",required = false)
 	private String certificateNum;
 	
 	/** 流动范围(多个用|分开) */
+	@ApiModelProperty(value = "流动范围(多个用|分开)",required = false)
 	private String flowOrganRange;
 	
 	/**  */
@@ -70,20 +86,28 @@ public class Teacher {
 	public Integer getOrganId(){
 		return this.organId;
 	}
-			
-	public void setJobType(String jobType){
+
+	public JobTypeEnum getJobType() {
+		return jobType;
+	}
+
+	public void setJobType(JobTypeEnum jobType) {
 		this.jobType = jobType;
 	}
-	
-	public String getJobType(){
-		return this.jobType;
+
+	public Boolean getProbationPeriod() {
+		return isProbationPeriod;
 	}
-			
-	public String getJobNature() {
+
+	public void setProbationPeriod(Boolean probationPeriod) {
+		isProbationPeriod = probationPeriod;
+	}
+
+	public JobNatureEnum getJobNature() {
 		return jobNature;
 	}
 
-	public void setJobNature(String jobNature) {
+	public void setJobNature(JobNatureEnum jobNature) {
 		this.jobNature = jobNature;
 	}
 

+ 35 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/JobNatureEnum.java

@@ -0,0 +1,35 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+//工作性质(兼职、全职)
+public enum JobNatureEnum implements BaseEnum<String,JobNatureEnum> {
+    PART_JOB("PART_JOB","兼职"),
+    FULL_JOB("FULL_JOB","全职");
+
+    private String code;
+
+    private String msg;
+
+    JobNatureEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+}

+ 36 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/JobTypeEnum.java

@@ -0,0 +1,36 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+//职务类型(指导老师、教务老师、教学主管)
+public enum JobTypeEnum implements BaseEnum<String,JobTypeEnum> {
+    ADVISER("ADVISER","指导老师"),
+    ACADEMIC("ACADEMIC","教务老师"),
+    TEACHING("TEACHING","教学主管");
+
+    private String code;
+
+    private String msg;
+
+    JobTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+}

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherQueryInfo.java

@@ -0,0 +1,6 @@
+package com.ym.mec.web.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class TeacherQueryInfo extends QueryInfo {
+}