部门、成员修改
parent
cd1e0baa2d
commit
c53750465c
@ -1,50 +0,0 @@
|
||||
package com.kiisoo.ic.department.controller;
|
||||
|
||||
import com.kiisoo.ic.common.BaseController;
|
||||
import com.kiisoo.ic.department.entity.DepartmentDO;
|
||||
import com.kiisoo.ic.department.service.DepartmentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 部门管理controller
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/7 0002 10:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/department")
|
||||
@Slf4j
|
||||
public class DepartmentConreoller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
public Map<String,Object> addDepartment(@RequestBody DepartmentDO departmentDO){
|
||||
try {
|
||||
Boolean hasAdd = departmentService.addDepartment(departmentDO);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "sync",method = RequestMethod.GET)
|
||||
public Map<String,Object> syncDepartment(){
|
||||
try {
|
||||
Boolean hasAdd = departmentService.syncDepartment();
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.kiisoo.ic.department.controller;
|
||||
|
||||
import com.kiisoo.ic.common.BaseController;
|
||||
import com.kiisoo.ic.department.entity.DepartmentDO;
|
||||
import com.kiisoo.ic.department.service.DepartmentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 部门管理controller
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/7 0002 10:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/department")
|
||||
@Slf4j
|
||||
public class DepartmentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
|
||||
/**
|
||||
* 查询部门
|
||||
* @param
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "list",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> listDepartment(){
|
||||
try {
|
||||
Boolean hasAdd = departmentService.listDepartment();
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加部门
|
||||
* @param departmentDO 部门实体类
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> addDepartment(@RequestBody DepartmentDO departmentDO){
|
||||
try {
|
||||
Boolean hasAdd = departmentService.addDepartment(departmentDO);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
* @param departmentDO 部门实体类
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "update",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateDepartment(@RequestBody DepartmentDO departmentDO){
|
||||
try {
|
||||
Boolean hasUpdate = departmentService.updateDepartment(departmentDO);
|
||||
return data(hasUpdate);
|
||||
}catch (Exception e){
|
||||
log.error("修改部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
* @param departmentId 部门实体id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "delete",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteDepartment(@RequestParam("departmentId") Long departmentId){
|
||||
try {
|
||||
Boolean hasDel = departmentService.deleteDepartment(departmentId);
|
||||
return data(hasDel);
|
||||
}catch (Exception e){
|
||||
log.error("删除部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "sync",method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Map<String,Object> syncDepartment(){
|
||||
try {
|
||||
Boolean hasSync = departmentService.syncDepartment();
|
||||
return data(hasSync);
|
||||
}catch (Exception e){
|
||||
log.error("添加部门失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package com.kiisoo.ic.employee.controller;
|
||||
|
||||
import com.kiisoo.ic.common.BaseController;
|
||||
import com.kiisoo.ic.employee.entity.EmployeeDO;
|
||||
import com.kiisoo.ic.employee.service.EmployeeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 用户管理controller
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/7 0002 10:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/user")
|
||||
@Slf4j
|
||||
public class EmployeeConreoller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private EmployeeService employeeService;
|
||||
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
public Map<String,Object> addUser(@RequestBody EmployeeDO employee){
|
||||
try {
|
||||
Boolean hasAdd = employeeService.addUser(employee);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加用户失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.kiisoo.ic.employee.controller;
|
||||
|
||||
import com.kiisoo.ic.common.BaseController;
|
||||
import com.kiisoo.ic.employee.entity.EmployeeDO;
|
||||
import com.kiisoo.ic.employee.entity.PrivilageCpUserDO;
|
||||
import com.kiisoo.ic.employee.service.EmployeeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 用户管理controller
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/7 0002 10:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/user")
|
||||
@Slf4j
|
||||
public class EmployeeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private EmployeeService employeeService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增成员
|
||||
* @param employee 成员实体
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@RequestMapping(value = "list",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> listUser(){
|
||||
try {
|
||||
List<PrivilageCpUserDO> privilageCpUserDOS = employeeService.listUser();
|
||||
return data(privilageCpUserDOS);
|
||||
}catch (Exception e){
|
||||
log.error("添加用户失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成员
|
||||
* @param employee 成员实体
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> addUser(@RequestBody EmployeeDO employee){
|
||||
try {
|
||||
Boolean hasAdd = employeeService.addUser(employee);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加用户失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成员
|
||||
* @param employee 成员实体
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@RequestMapping(value = "update",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateUser(@RequestBody EmployeeDO employee){
|
||||
try {
|
||||
Boolean hasAdd = employeeService.updateUser(employee);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("修改用户失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成员
|
||||
* @param employee 成员实体
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteUser(@RequestParam("cpUserId") Long cpUserId){
|
||||
try {
|
||||
Boolean hasAdd = employeeService.deleteUser(cpUserId);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("删除用户失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.kiisoo.ic.department.mapper.PrivilageDepartmentDOMapper">
|
||||
|
||||
<select id="selectMaxDepartmentId" resultType="java.lang.Long">
|
||||
select max(id) from privilage_department
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue