From beba4cc024540474e8c51a5596913db2ceab8208 Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Thu, 27 Aug 2020 15:26:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E7=8F=AD=E7=BA=A7=E8=AF=A6?= =?UTF-8?q?=E6=83=85+=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 11 +++ .../OrganizationRelationshipController.java | 56 ++++++++++++ .../entity/OrganizationRelationship.java | 86 +++++++++++++++++++ .../mapper/ExperimentalClassMapper.java | 2 +- .../OrganizationRelationshipMapper.java | 23 +++++ .../OrganizationRelationshipService.java | 52 +++++++++++ src/main/resources/application.properties | 2 +- src/test/java/com/yipin/liuwanr/Mian.java | 2 +- 8 files changed, 231 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/yipin/liuwanr/controller/OrganizationRelationshipController.java create mode 100644 src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java create mode 100644 src/main/java/com/yipin/liuwanr/mapper/OrganizationRelationshipMapper.java create mode 100644 src/main/java/com/yipin/liuwanr/service/OrganizationRelationshipService.java 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({"