|
|
|
package com.glxp.api.controller.sup;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
import com.glxp.api.entity.basic.ProductInfoEntity;
|
|
|
|
import com.glxp.api.entity.sup.UserCompanyEntity;
|
|
|
|
import com.glxp.api.req.auth.FilterUserComapanyRequest;
|
|
|
|
import com.glxp.api.req.basic.ProductInfoFilterRequest;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.auth.registComPerResponse;
|
|
|
|
import com.glxp.api.service.sup.UserCompanyService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 客户端企业信息
|
|
|
|
*/
|
|
|
|
@ApiIgnore
|
|
|
|
@RestController
|
|
|
|
@Slf4j
|
|
|
|
public class UserComanyController extends BaseController {
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
UserCompanyService userCompanyService;
|
|
|
|
|
|
|
|
|
|
|
|
// 关键字搜索
|
|
|
|
@AuthRuleAnnotation("udi/auth/user/comapny/search")
|
|
|
|
@GetMapping("udi/auth/user/comapny/search")
|
|
|
|
public BaseResponse search(FilterUserComapanyRequest filterUserComapanyRequest) {
|
|
|
|
//获取部门id
|
|
|
|
if(filterUserComapanyRequest.getSearchKey() == null){
|
|
|
|
filterUserComapanyRequest.setSearchKey("");
|
|
|
|
}
|
|
|
|
List<UserCompanyEntity> userCompanyEntities = userCompanyService.list(new QueryWrapper<UserCompanyEntity>().like("companyName", filterUserComapanyRequest.getSearchKey()).eq("checkStatus",1));
|
|
|
|
|
|
|
|
PageInfo<UserCompanyEntity> pageInfo;
|
|
|
|
pageInfo = new PageInfo<>(userCompanyEntities);
|
|
|
|
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
pageSimpleResponse.setList(userCompanyEntities);
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@GetMapping("udi/auth/user/comapny/filterCompanyName")
|
|
|
|
public BaseResponse filterCompanyName(FilterUserComapanyRequest filterUserComapanyRequest) {
|
|
|
|
|
|
|
|
List<UserCompanyEntity> userCompanyEntities = userCompanyService.filterCompanyName(filterUserComapanyRequest);
|
|
|
|
PageInfo<UserCompanyEntity> pageInfo = new PageInfo<>(userCompanyEntities);
|
|
|
|
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
pageSimpleResponse.setList(userCompanyEntities);
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
}
|
|
|
|
}
|