parent
87d116dc32
commit
3a97be6a6b
17 changed files with 936 additions and 52 deletions
@ -0,0 +1,48 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.vo.StaffVo; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.List; |
||||
|
||||
@Api(value = "系统设置",tags = "系统设置") |
||||
public interface SystemSetttingApi { |
||||
|
||||
@ApiOperation(value = "新增员工",notes = "新增员工") |
||||
public R addStaff(StaffVo staffVo); |
||||
|
||||
@ApiOperation(value = "员工列表",notes = "员工列表信息") |
||||
public R queryStaff(StaffVo staffVo); |
||||
|
||||
@ApiOperation(value = "查看员工详情",notes = "查看员工详情") |
||||
public R querystaffDetail( Integer userId); |
||||
|
||||
@ApiOperation(value = "编辑员工信息",notes = "编辑员工信息") |
||||
public R updateStaff( StaffVo staffVo); |
||||
|
||||
@ApiOperation(value = "删除员工信息",notes = "删除员工信息") |
||||
public R deleteStaff(StaffVo staffVo); |
||||
|
||||
@ApiOperation(value = "批量删除员工信息",notes = "批量删除员工信息") |
||||
public R daleteBatchStaff( List<Integer> userIds); |
||||
|
||||
@ApiOperation(value = "新增部门",notes = "新增部门") |
||||
public R addDepartment( StaffVo staffVo); |
||||
|
||||
@ApiOperation(value = "员工信息导入模板下载",notes = "员工信息导入模板下载") |
||||
public R downloadFiles(HttpServletResponse response) throws IOException; |
||||
|
||||
@ApiOperation(value = "导入员工信息",notes = "导入员工信息") |
||||
public R importStaff(MultipartFile file) throws IOException; |
||||
|
||||
@ApiOperation(value = "导入员工失败原因导出",notes = "导入员工失败原因导出") |
||||
public void exportFailureRecord(HttpServletResponse response, String token) throws Exception; |
||||
} |
@ -1,30 +1,143 @@ |
||||
package com.msdw.tms.controller; |
||||
|
||||
import com.msdw.tms.api.SystemSetttingApi; |
||||
import com.msdw.tms.common.utils.ConstantUtils; |
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.vo.StaffVo; |
||||
import com.msdw.tms.service.SystemSetttingService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 系统设置 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/tms/system") |
||||
public class SystemSettingController { |
||||
public class SystemSettingController implements SystemSetttingApi { |
||||
@Autowired |
||||
private SystemSetttingService systemSetttingService; |
||||
|
||||
/** |
||||
* 新增员工 |
||||
* @param staffVo |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping("/addStaff") |
||||
public R addStaff(@RequestBody StaffVo staffVo){ |
||||
systemSetttingService.addStaff(staffVo); |
||||
return R.ok(); |
||||
R r = systemSetttingService.addStaff(staffVo); |
||||
return r; |
||||
} |
||||
|
||||
/** |
||||
* 员工列表 |
||||
* @param staffVo |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping("/queryStaff") |
||||
public R queryStaff(@RequestBody StaffVo staffVo){ |
||||
PageUtils query = systemSetttingService.queryStaff(staffVo); |
||||
return R.ok().put("data",query); |
||||
} |
||||
|
||||
/** |
||||
* 查看用户详情 |
||||
* @param userId |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@GetMapping("/querystaffDetail") |
||||
public R querystaffDetail(@RequestParam Integer userId){ |
||||
HashMap<String, Object> map = systemSetttingService.querystaffDetail(userId); |
||||
return R.ok().put("data",map); |
||||
} |
||||
|
||||
/** |
||||
* 编辑员工信息 |
||||
* @param staffVo |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PutMapping("/updateStaff") |
||||
public R updateStaff(@RequestBody StaffVo staffVo){ |
||||
R r = systemSetttingService.updateStaff(staffVo); |
||||
return r; |
||||
} |
||||
|
||||
/** |
||||
* 删除员工信息 |
||||
* @param staffVo |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping("/deleteStaff") |
||||
public R deleteStaff(@RequestBody StaffVo staffVo){ |
||||
|
||||
systemSetttingService.deleteStaff(staffVo.getUserId()); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除员工信息 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping("/daleteBatchStaff") |
||||
public R daleteBatchStaff(@RequestBody List<Integer> userIds){ |
||||
systemSetttingService.daleteBatchStaff(userIds); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 新增部门 |
||||
*/ |
||||
@Override |
||||
@PostMapping("/addDepartment") |
||||
public R addDepartment(@RequestBody StaffVo staffVo){ |
||||
HashMap<String, Object> map = systemSetttingService.addDepartment(staffVo); |
||||
return R.ok().put("data",map); |
||||
} |
||||
|
||||
/** |
||||
* excel模板文件下载 |
||||
*/ |
||||
@Override |
||||
@GetMapping("/download") |
||||
public R downloadFiles(HttpServletResponse response) throws IOException { |
||||
systemSetttingService.downloadFiles(response); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 批量导入员工信息 |
||||
* @param file |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@PostMapping("/uploadFile") |
||||
public R importStaff(MultipartFile file) throws IOException{ |
||||
Map<String,String> upload = systemSetttingService.upload(file); |
||||
return R.ok().put("data",upload); |
||||
} |
||||
|
||||
/** |
||||
* 导入员工信息失败数据导出 |
||||
* @param response |
||||
* @param token |
||||
* @throws Exception |
||||
*/ |
||||
@Override |
||||
@GetMapping("/export_failure") |
||||
public void exportFailureRecord(HttpServletResponse response, @RequestParam String token) throws Exception{ |
||||
systemSetttingService.exportFailureRecord(response,token); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,64 @@ |
||||
package com.msdw.tms.entity.vo; |
||||
|
||||
import com.msdw.tms.common.utils.poi.ExcelAttribute; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
@Data |
||||
@Accessors(chain = true) |
||||
public class StaffExportVo { |
||||
|
||||
//序列号
|
||||
private Long index; |
||||
|
||||
//姓名
|
||||
@ExcelAttribute(sort = 0) |
||||
private String userName; |
||||
|
||||
//账号
|
||||
@ExcelAttribute(sort = 1) |
||||
private String account; |
||||
|
||||
//角色
|
||||
@ExcelAttribute(sort = 2) |
||||
private String role; |
||||
|
||||
//工号
|
||||
@ExcelAttribute(sort = 3) |
||||
private String workNumber; |
||||
|
||||
//管理员专业名称
|
||||
@ExcelAttribute(sort = 4) |
||||
private String staffGradeName; |
||||
|
||||
//管理员组织架构名称
|
||||
@ExcelAttribute(sort = 5) |
||||
private String staffProfessionalArchitectureName; |
||||
|
||||
//老师专业组织名称
|
||||
@ExcelAttribute(sort = 6) |
||||
private String staffGradeNameTwo; |
||||
|
||||
//老师组织架构名称
|
||||
@ExcelAttribute(sort = 7) |
||||
private String staffProfessionalArchitectureNameTwo; |
||||
|
||||
//手机号码
|
||||
@ExcelAttribute(sort = 8) |
||||
private String phone; |
||||
|
||||
//邮箱
|
||||
@ExcelAttribute(sort = 9) |
||||
private String email; |
||||
|
||||
//所属院校
|
||||
@ExcelAttribute(sort = 10) |
||||
private String schoolAppellationName; |
||||
|
||||
//失败原因
|
||||
@ExcelAttribute(sort = 11) |
||||
private String failureMsg; |
||||
|
||||
|
||||
|
||||
} |
@ -1,11 +1,35 @@ |
||||
package com.msdw.tms.service; |
||||
|
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.vo.StaffVo; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface SystemSetttingService { |
||||
|
||||
boolean addStaff(StaffVo staffVo); |
||||
R addStaff(StaffVo staffVo); |
||||
|
||||
PageUtils queryStaff(StaffVo staffVo); |
||||
|
||||
HashMap<String, Object> querystaffDetail(Integer userId); |
||||
|
||||
R updateStaff(StaffVo staffVo); |
||||
|
||||
boolean deleteStaff(Integer userId); |
||||
|
||||
HashMap<String, Object> addDepartment(StaffVo staffVo); |
||||
|
||||
boolean daleteBatchStaff(List<Integer> userIds); |
||||
|
||||
Map<String, String> upload(MultipartFile file) throws IOException; |
||||
|
||||
void exportFailureRecord(HttpServletResponse response, String token) throws Exception; |
||||
|
||||
void downloadFiles(HttpServletResponse response) throws IOException; |
||||
} |
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue