|
@@ -2,10 +2,12 @@ package com.yami.shop.platform.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.yami.shop.bean.model.User;
|
|
|
+import com.yami.shop.bean.po.EnterpriseUserLogPo;
|
|
|
import com.yami.shop.bean.po.EnterpriseUserPo;
|
|
|
import com.yami.shop.bean.vo.EnterpriseUserVo;
|
|
|
import com.yami.shop.common.util.PageParam;
|
|
|
import com.yami.shop.common.util.R;
|
|
|
+import com.yami.shop.security.platform.util.SecurityUtils;
|
|
|
import com.yami.shop.service.UserService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.SneakyThrows;
|
|
@@ -24,10 +26,9 @@ public class UserEnterpriseController {
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
-
|
|
|
+ @SneakyThrows
|
|
|
@GetMapping("/downloadXlsx")
|
|
|
@ApiOperation("下载导入企业员工模板(示例版)")
|
|
|
- @SneakyThrows
|
|
|
public R<Void> downloadZip(HttpServletResponse response) {
|
|
|
response.sendRedirect("https://zswl-shop.oss-cn-chengdu.aliyuncs.com/2025/10/e24a324deb414ba4b46e1928b6d55483.xlsx");
|
|
|
return R.SUCCESS();
|
|
@@ -40,21 +41,27 @@ public class UserEnterpriseController {
|
|
|
return R.SUCCESS();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/uploadExcelGoods")
|
|
|
@ApiOperation("导入企业员工")
|
|
|
+ @PostMapping("/uploadExcelGoods")
|
|
|
public R<Void> downloadExcelGoods(MultipartFile file) {
|
|
|
- userService.uploadExcelGoods(file);
|
|
|
+ userService.uploadExcelGoods(file, SecurityUtils.getSysUser().getUsername());
|
|
|
return R.SUCCESS();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @GetMapping("/enterpriseUserList")
|
|
|
@ApiOperation("员工列表")
|
|
|
+ @GetMapping("/enterpriseUserList")
|
|
|
public R<IPage<EnterpriseUserVo>> enterpriseUserList(EnterpriseUserPo po, PageParam<EnterpriseUserPo> page) {
|
|
|
IPage<EnterpriseUserVo> userPage = userService.enterpriseUserList(page,po);
|
|
|
return R.SUCCESS(userPage);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/enterpriseUserLogList")
|
|
|
+ @ApiOperation("员工导入记录")
|
|
|
+ public R<IPage<EnterpriseUserLogPo>> enterpriseUserLogList(PageParam<EnterpriseUserLogPo> page) {
|
|
|
+ IPage<EnterpriseUserLogPo> logList = userService.enterpriseUserLogList(page);
|
|
|
+ return R.SUCCESS(logList);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/addUser")
|
|
|
@ApiOperation("新增企业员工")
|
|
|
public R<Void> addUser(@RequestBody EnterpriseUserPo po) {
|
|
@@ -62,8 +69,8 @@ public class UserEnterpriseController {
|
|
|
return R.SUCCESS();
|
|
|
}
|
|
|
|
|
|
- @DeleteMapping("/deleteUserById")
|
|
|
@ApiOperation("删除员工")
|
|
|
+ @DeleteMapping("/deleteUserById")
|
|
|
public R<Void> deleteUserById(String userId) {
|
|
|
userService.removeById(userId);
|
|
|
return R.SUCCESS();
|