Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java
master
zhiyong.ning 4 years ago
commit fce3cccd0d
  1. 11
      pom.xml
  2. 56
      src/main/java/com/yipin/liuwanr/controller/OrganizationRelationshipController.java
  3. 2
      src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java
  4. 23
      src/main/java/com/yipin/liuwanr/mapper/OrganizationRelationshipMapper.java
  5. 52
      src/main/java/com/yipin/liuwanr/service/OrganizationRelationshipService.java
  6. 2
      src/main/resources/application.properties
  7. 2
      src/test/java/com/yipin/liuwanr/Mian.java

@ -38,6 +38,17 @@
</dependencyManagement>
<dependencies>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!--mybatis-plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.1</version>
</dependency>
<!-- springcloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>

@ -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<String, Object> 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<String, Object> 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;
}
}

@ -89,7 +89,7 @@ public interface ExperimentalClassMapper {
* @return
*/
@Select({"<script>",
"select s.studentId,studentName,studentNumber,gradeName,className,professionalName from experimental_class_student st,student s,class c,grade g,professional p"
"select s.studentId,studentName,studentNumber,g.gradeName,c.className,p.professionalName from experimental_class_student st,student s,class c,grade g,professional p"
+ " where st.studentId=s.studentId and s.classId=c.classId and c.gradeId=g.gradeId and s.professionalId=p.professionalId and st.experimentalClassId=#{experimentalClassId} ",
" <if test='professionalId!=null'>and stu.professionalId = #{professionalId} </if>",
" <if test='classId !=null'>and stu.classId = #{classId} </if>",

@ -0,0 +1,23 @@
package com.yipin.liuwanr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yipin.liuwanr.entity.OrganizationRelationship;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface OrganizationRelationshipMapper {
@Select("select organizationRelationshipId,schoolName,professionalName,gradeName,className,workNumber,roleId " +
"from hr_organization_relationship where userId=#{userId} ")
List<OrganizationRelationship> getByuserId(Integer userId);
@Delete("delete from hr_organization_relationship where organizationRelationshipId =#{organizationRelationshipId}")
boolean deleteByorganizationRelationshipId(Integer organizationRelationshipId);
}

@ -0,0 +1,52 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.OrganizationRelationship;
import com.yipin.liuwanr.entity.Student;
import com.yipin.liuwanr.mapper.OrganizationRelationshipMapper;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
@Service("organizationRelationshipService")
public class OrganizationRelationshipService {
@Autowired
private OrganizationRelationshipMapper organizationRelationshipMapper;
private static Logger logger = Logger.getLogger(OrganizationRelationshipService.class);
public HashMap<String, Object> getByuserId(Integer userId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
List<OrganizationRelationship> relationships = organizationRelationshipMapper.getByuserId(userId);
resp.put("retcode", 200);
resp.put("retvalue", relationships);
} catch (Exception e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> deleteByorganizationRelationshipId(Integer organizationRelationshipId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
boolean result = organizationRelationshipMapper.deleteByorganizationRelationshipId(organizationRelationshipId);
resp.put("retcode", 200);
resp.put("retvalue", result);
} catch (Exception e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "DELATE Failed");
return resp;
}
return resp;
}
}

@ -10,7 +10,7 @@ logging.level.com.yipin.liuwar.mapper=DEBUG
spring.datasource.url=jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true
spring.datasource.username=super
spring.datasource.password=huoran888
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.mina.port=9123
spring.mina.buffersize=2048

@ -15,7 +15,7 @@ public class Mian {
//end()返回匹配到的子字符串的最后一个字符在字符串中的索引位置.
//group()返回匹配到的子字符串
String[] arg = {"5"};//前端【输入框输入的数据】
String[] arg = {"5","4"};//前端【输入框输入的数据】
//【代码】
String str="i = input(\"请输入\")\n" +

Loading…
Cancel
Save