diff --git a/pom.xml b/pom.xml index 6087b9b..dc2a9f0 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,17 @@ + + + org.projectlombok + lombok + + + + com.baomidou + mybatis-plus-boot-starter + 3.3.1 + org.springframework.cloud diff --git a/src/main/java/com/yipin/liuwanr/controller/OrganizationRelationshipController.java b/src/main/java/com/yipin/liuwanr/controller/OrganizationRelationshipController.java new file mode 100644 index 0000000..e94f455 --- /dev/null +++ b/src/main/java/com/yipin/liuwanr/controller/OrganizationRelationshipController.java @@ -0,0 +1,56 @@ +package com.yipin.liuwanr.controller; + +import com.yipin.liuwanr.service.OrganizationRelationshipService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; + +@RestController +@RequestMapping("user") +public class OrganizationRelationshipController { + + @Autowired + private OrganizationRelationshipService organizationRelationshipService; + + @GetMapping("/list") + Response updateState(@RequestParam Integer userId) { + Response resp = new Response(); + if(StringUtils.isEmpty(userId)){ + resp.setStatus(300); + resp.setErrmessage("用户信息不完整"); + }else{ + HashMap ret = organizationRelationshipService.getByuserId(userId); + int status = (int) ret.get("retcode"); + if (200 == status) { + resp.setStatus(status); + resp.setMessage(ret.get("retvalue")); + } else { + resp.setStatus(status); + resp.setErrmessage(ret.get("retvalue").toString()); + } + } + return resp; + } + + @DeleteMapping("/delete") + Response delorganizationRelationship(@RequestParam Integer organizationRelationshipId) { + Response resp = new Response(); + if(StringUtils.isEmpty(organizationRelationshipId)){ + resp.setStatus(300); + resp.setErrmessage("组织关系信息为空"); + }else{ + HashMap ret = organizationRelationshipService.deleteByorganizationRelationshipId(organizationRelationshipId); + int status = (int) ret.get("retcode"); + if (200 == status) { + resp.setStatus(status); + resp.setMessage(ret.get("retvalue")); + } else { + resp.setStatus(status); + resp.setErrmessage(ret.get("retvalue").toString()); + } + } + return resp; + } +} diff --git a/src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java b/src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java new file mode 100644 index 0000000..215b8e6 --- /dev/null +++ b/src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java @@ -0,0 +1,86 @@ +package com.yipin.liuwanr.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 组织关系 + */ +@Accessors(chain = true) +@Data +@TableName("hr_organization_relationship") +public class OrganizationRelationship { + + /** + * 组织关系Id + */ + @TableId + private Integer organizationrelationshipid; + /** + * 绑定用戶Id + */ + private Integer userid; + /** + * 绑定平台Id + */ + private Integer platformid; + /** + * 绑定学校Id + */ + private Integer schoolid; + /** + * 绑定学校名称 + */ + private String schoolname; + /** + * 绑定角色Id + */ + private Integer roleid; + /** + * 工号学号 + */ + private String worknumber; + /** + * 一级部门Id + */ + private Integer onedepartmentid; + /** + * 一级部门名称 + */ + private String onedepartmentname; + /** + * 二级部门Id + */ + private Integer twodepartmentid; + /** + * 二级部门名称 + */ + private String twodepartmentname; + /** + * 专业id + */ + private Integer professionalid; + /** + * 专业名称 + */ + private String professionalname; + /** + * 年级Id + */ + private Integer gradeid; + /** + * 年级名称 + */ + private String gradename; + /** + * 班级Id + */ + private Integer classid; + /** + * 班级名称 + */ + private String classname; + +} diff --git a/src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java b/src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java index aa95625..ea96698 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java @@ -89,7 +89,7 @@ public interface ExperimentalClassMapper { * @return */ @Select({"