Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import com.cool.store.utils.DataSourceHelper;
|
||||
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseUserController
|
||||
* @Description:
|
||||
* @date 2023-05-30 17:20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/enterprises/{enterprise-id}/users"})
|
||||
@Slf4j
|
||||
public class EnterpriseUserController {
|
||||
|
||||
@Resource
|
||||
public EnterpriseUserService enterpriseUserService;
|
||||
|
||||
@GetMapping(path = "/dept/userList")
|
||||
public ResponseResult<PageInfo<EnterpriseUserPageVO>> getUserList(@PathVariable(value = "enterprise-id", required = true) String eid,
|
||||
@RequestParam(name = "user_name", required = false) String userName,
|
||||
@RequestParam(name = "dept_id", required = false) String deptId,
|
||||
@RequestParam(name = "role_id", required = false) Long roleId,
|
||||
@RequestParam(name = "order_by", required = false) String orderBy,
|
||||
@RequestParam(name = "order_rule", required = false, defaultValue = "asc") String orderRule,
|
||||
@RequestParam(name = "user_status", required = false) Integer userStatus,
|
||||
@RequestParam(name = "page_num", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "page_size", required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "job_number", required = false) String jobNumber,
|
||||
@RequestParam(name = "region_id", required = false) String regionId,
|
||||
@RequestParam(name = "has_page", required = false,defaultValue = "true") Boolean hasPage) {
|
||||
DataSourceHelper.changeToMy();
|
||||
List<EnterpriseUserPageVO> deptUserList = enterpriseUserService.listUser(eid, userName, deptId, orderBy, orderRule, roleId, userStatus, pageNum, pageSize, jobNumber,regionId,hasPage);
|
||||
if(CollectionUtils.isNotEmpty(deptUserList)){
|
||||
return ResponseResult.success(new PageInfo<>(deptUserList));
|
||||
}else {
|
||||
return ResponseResult.success(new PageInfo<>());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user