Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
c571ff0e94 | 1 month ago |
|
81198b24bb | 1 month ago |
|
9af08eb0c5 | 1 month ago |
|
4c61e0b797 | 1 month ago |
|
15d95a17ad | 1 month ago |
|
44505a49ac | 1 month ago |
|
7ece4566fc | 1 month ago |
|
60e7a8e3d3 | 1 month ago |
|
76f2269982 | 1 month ago |
|
54570fe521 | 1 month ago |
|
b1c9aad133 | 1 month ago |
|
a491ca3927 | 1 month ago |
@ -0,0 +1,71 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.prj.common.constant.Constants;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.redis.RedisCache;
|
||||
import com.prj.common.utils.sign.Base64;
|
||||
import com.prj.common.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
{
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath
|
||||
|
||||
;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.prj.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
public class Dept
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门编号 */
|
||||
private Long id;
|
||||
|
||||
/** 部门名 */
|
||||
private String name;
|
||||
|
||||
/** 部门经理 */
|
||||
private String manager;
|
||||
|
||||
/** 汇报对象 */
|
||||
private String reportto;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setManager(String manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getManager()
|
||||
{
|
||||
return manager;
|
||||
}
|
||||
public void setReportto(String reportto)
|
||||
{
|
||||
this.reportto = reportto;
|
||||
}
|
||||
|
||||
public String getReportto()
|
||||
{
|
||||
return reportto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("manager", getManager())
|
||||
.append("reportto", getReportto())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,75 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.prj.common.core.controller.BaseController;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.prj.domain.Dept;
|
||||
import com.prj.service.IDeptService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dept_info")
|
||||
public class DeptController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeptService deptService;
|
||||
|
||||
/**
|
||||
* 查询部门信息管理列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Dept dept)
|
||||
{
|
||||
startPage();
|
||||
List<Dept> list = deptService.selectDeptList(dept);
|
||||
return getDataByPage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门信息管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(deptService.selectDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门信息管理
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Dept dept)
|
||||
{
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门信息管理
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Dept dept)
|
||||
{
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门信息管理
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deptService.deleteDeptByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,75 @@
|
||||
设计图示(类图与时序图)
|
||||
|
||||
1. 类关系图(简化)
|
||||
```mermaid
|
||||
classDiagram
|
||||
class DeptController
|
||||
class EmployeeController
|
||||
class EmployeeKpiController
|
||||
class HireNumController
|
||||
class SalaryLevelController
|
||||
class LoginController
|
||||
class CaptchaController
|
||||
|
||||
class IDeptService
|
||||
class IEmployeeService
|
||||
class IEmployeeKpiService
|
||||
class IHireNumService
|
||||
class ISalaryLevelService
|
||||
|
||||
class Dept
|
||||
class Employee
|
||||
class EmployeeKpi
|
||||
class HireNum
|
||||
class SalaryLevel
|
||||
|
||||
DeptController --> IDeptService
|
||||
EmployeeController --> IEmployeeService
|
||||
EmployeeKpiController --> IEmployeeKpiService
|
||||
HireNumController --> IHireNumService
|
||||
SalaryLevelController --> ISalaryLevelService
|
||||
|
||||
IDeptService --> Dept
|
||||
IEmployeeService --> Employee
|
||||
IEmployeeKpiService --> EmployeeKpi
|
||||
IHireNumService --> HireNum
|
||||
ISalaryLevelService --> SalaryLevel
|
||||
```
|
||||
|
||||
2. 登录时序图
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as User
|
||||
participant FE as Frontend(Vue)
|
||||
participant BE as Backend(Spring Boot)
|
||||
participant REDIS as Redis
|
||||
|
||||
U->>FE: 打开登录页
|
||||
FE->>BE: GET /captchaImage
|
||||
BE->>REDIS: 保存(uuid -> code)
|
||||
BE-->>FE: uuid, img(Base64)
|
||||
U->>FE: 输入 username/password/code
|
||||
FE->>BE: POST /login {username,password,code,uuid}
|
||||
BE->>REDIS: 校验 code
|
||||
BE-->>FE: token
|
||||
FE->>FE: 保存 Admin-Token(Cookie)
|
||||
```
|
||||
|
||||
3. 分页查询时序图
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant FE as Frontend
|
||||
participant CTRL as Controller
|
||||
participant SVC as Service
|
||||
participant DAO as Mapper/Repo
|
||||
|
||||
FE->>CTRL: GET /<module>/list?query
|
||||
CTRL->>CTRL: startPage()
|
||||
CTRL->>SVC: select*List(query)
|
||||
SVC->>DAO: 查询
|
||||
DAO-->>SVC: 列表数据
|
||||
SVC-->>CTRL: 列表数据
|
||||
CTRL-->>FE: TableDataInfo
|
||||
```
|
||||
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.prj.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
public class Employee
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 部门 */
|
||||
private String dept;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
|
||||
/** 职位 */
|
||||
private String position;
|
||||
|
||||
/** 薪资 */
|
||||
private BigDecimal salary;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDept(String dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public String getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setPosition(String position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
public void setSalary(BigDecimal salary)
|
||||
{
|
||||
this.salary = salary;
|
||||
}
|
||||
|
||||
public BigDecimal getSalary()
|
||||
{
|
||||
return salary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dept", getDept())
|
||||
.append("name", getName())
|
||||
.append("position", getPosition())
|
||||
.append("salary", getSalary())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,80 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.prj.common.core.controller.BaseController;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.prj.domain.Employee;
|
||||
import com.prj.service.IEmployeeService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/employee")
|
||||
public class EmployeeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmployeeService employeeService;
|
||||
|
||||
/**
|
||||
* 查询员工信息管理列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Employee employee)
|
||||
{
|
||||
startPage();
|
||||
List<Employee> list = employeeService.selectEmployeeList(employee);
|
||||
return getDataByPage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工信息管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(employeeService.selectEmployeeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工信息管理
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Employee employee)
|
||||
{
|
||||
return toAjax(employeeService.insertEmployee(employee));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工信息管理
|
||||
*/
|
||||
@PutMapping
|
||||
@Transactional(timeout = 20,readOnly = false,isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
|
||||
public AjaxResult edit(@RequestBody Employee employee)
|
||||
{
|
||||
//其它针对数据库的操作
|
||||
return toAjax(employeeService.updateEmployee(employee));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工信息管理
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(employeeService.deleteEmployeeByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,71 @@
|
||||
package com.prj.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
||||
public class EmployeeKpi
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 员工编号 */
|
||||
private Long id;
|
||||
|
||||
/** 考评结果 */
|
||||
private String kpi;
|
||||
|
||||
/** 奖金 */
|
||||
private String bonus;
|
||||
|
||||
/** 考评人 */
|
||||
private String manager;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setKpi(String kpi)
|
||||
{
|
||||
this.kpi = kpi;
|
||||
}
|
||||
|
||||
public String getKpi()
|
||||
{
|
||||
return kpi;
|
||||
}
|
||||
public void setBonus(String bonus)
|
||||
{
|
||||
this.bonus = bonus;
|
||||
}
|
||||
|
||||
public String getBonus()
|
||||
{
|
||||
return bonus;
|
||||
}
|
||||
public void setManager(String manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getManager()
|
||||
{
|
||||
return manager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("kpi", getKpi())
|
||||
.append("bonus", getBonus())
|
||||
.append("manager", getManager())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,76 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.prj.common.core.controller.BaseController;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.prj.domain.EmployeeKpi;
|
||||
import com.prj.service.IEmployeeKpiService;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/employee_kpi")
|
||||
public class EmployeeKpiController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmployeeKpiService employeeKpiService;
|
||||
|
||||
/**
|
||||
* 查询员工评价管理列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmployeeKpi employeeKpi)
|
||||
{
|
||||
startPage();
|
||||
List<EmployeeKpi> list = employeeKpiService.selectEmployeeKpiList(employeeKpi);
|
||||
return getDataByPage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工评价管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(employeeKpiService.selectEmployeeKpiById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工评价管理
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmployeeKpi employeeKpi)
|
||||
{
|
||||
return toAjax(employeeKpiService.insertEmployeeKpi(employeeKpi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工评价管理
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmployeeKpi employeeKpi)
|
||||
{
|
||||
return toAjax(employeeKpiService.updateEmployeeKpi(employeeKpi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工评价管理
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(employeeKpiService.deleteEmployeeKpiByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,81 @@
|
||||
package com.prj.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="hire_num")
|
||||
public class HireNum
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@Id
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
/** 部门 */
|
||||
@Column(name = "dept")
|
||||
private String dept;
|
||||
|
||||
/** 招人名额 */
|
||||
@Column(name = "num")
|
||||
private BigDecimal num;
|
||||
|
||||
/** 截止时间 */
|
||||
@Column(name = "endtime")
|
||||
private String endtime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDept(String dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public String getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
public void setNum(BigDecimal num)
|
||||
{
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public BigDecimal getNum()
|
||||
{
|
||||
return num;
|
||||
}
|
||||
public void setEndtime(String endtime)
|
||||
{
|
||||
this.endtime = endtime;
|
||||
}
|
||||
|
||||
public String getEndtime()
|
||||
{
|
||||
return endtime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dept", getDept())
|
||||
.append("num", getNum())
|
||||
.append("endtime", getEndtime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,75 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.prj.common.core.controller.BaseController;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.prj.domain.HireNum;
|
||||
import com.prj.service.IHireNumService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/hirenum")
|
||||
public class HireNumController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHireNumService hireNumService;
|
||||
|
||||
/**
|
||||
* 查询招人名额列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HireNum hireNum)
|
||||
{
|
||||
startPage();
|
||||
List<HireNum> list = hireNumService.selectHireNumList(hireNum);
|
||||
return getDataByPage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取招人名额详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(hireNumService.selectHireNumById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招人名额
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HireNum hireNum)
|
||||
{
|
||||
return toAjax(hireNumService.insertHireNum(hireNum));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招人名额
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HireNum hireNum)
|
||||
{
|
||||
return toAjax(hireNumService.updateHireNum(hireNum));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除招人名额
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(hireNumService.deleteHireNumByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.prj.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.prj.domain.Dept;
|
||||
|
||||
public interface IDeptService
|
||||
{
|
||||
public Dept selectDeptById(Long id);
|
||||
|
||||
public List<Dept> selectDeptList(Dept dept);
|
||||
|
||||
public int insertDept(Dept dept);
|
||||
|
||||
public int updateDept(Dept dept);
|
||||
|
||||
public int deleteDeptByIds(Long[] ids);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.prj.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.prj.domain.Employee;
|
||||
|
||||
public interface IEmployeeService
|
||||
{
|
||||
public Employee selectEmployeeById(Long id);
|
||||
|
||||
public List<Employee> selectEmployeeList(Employee employee);
|
||||
|
||||
public int insertEmployee(Employee employee);
|
||||
|
||||
public int updateEmployee(Employee employee);
|
||||
|
||||
public int deleteEmployeeByIds(Long[] ids);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.prj.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
public class SalaryLevel
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 职位类型 */
|
||||
private String jobType;
|
||||
|
||||
/** 薪资水平 */
|
||||
private BigDecimal salary;
|
||||
|
||||
/** 上下幅度 */
|
||||
private BigDecimal salaryrange;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setJobType(String jobType)
|
||||
{
|
||||
this.jobType = jobType;
|
||||
}
|
||||
|
||||
public String getJobType()
|
||||
{
|
||||
return jobType;
|
||||
}
|
||||
public void setSalary(BigDecimal salary)
|
||||
{
|
||||
this.salary = salary;
|
||||
}
|
||||
|
||||
public BigDecimal getSalary()
|
||||
{
|
||||
return salary;
|
||||
}
|
||||
public void setSalaryrange(BigDecimal salaryrange)
|
||||
{
|
||||
this.salaryrange = salaryrange;
|
||||
}
|
||||
|
||||
public BigDecimal getSalaryrange()
|
||||
{
|
||||
return salaryrange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("jobType", getJobType())
|
||||
.append("salary", getSalary())
|
||||
.append("salaryrange", getSalaryrange())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,76 @@
|
||||
package com.prj.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.prj.common.core.controller.BaseController;
|
||||
import com.prj.common.core.domain.AjaxResult;
|
||||
import com.prj.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.prj.domain.SalaryLevel;
|
||||
import com.prj.service.ISalaryLevelService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/salary_level")
|
||||
public class SalaryLevelController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISalaryLevelService salaryLevelService;
|
||||
|
||||
/**
|
||||
* 查询薪资标准管理列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SalaryLevel salaryLevel)
|
||||
{
|
||||
startPage();
|
||||
List<SalaryLevel> list = salaryLevelService.selectSalaryLevelList(salaryLevel);
|
||||
return getDataByPage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资标准管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(salaryLevelService.selectSalaryLevelById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增薪资标准管理
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SalaryLevel salaryLevel)
|
||||
{
|
||||
return toAjax(salaryLevelService.insertSalaryLevel(salaryLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改薪资标准管理
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SalaryLevel salaryLevel)
|
||||
{
|
||||
return toAjax(salaryLevelService.updateSalaryLevel(salaryLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除薪资标准管理
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(salaryLevelService.deleteSalaryLevelByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue