|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.controller.sup;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
@ -8,11 +9,15 @@ 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.entity.sup.UserCompanyOnlineEntity;
|
|
|
|
|
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.res.sup.UserCompanyOnlineResponse;
|
|
|
|
|
import com.glxp.api.service.sup.UserCompanyOnlineService;
|
|
|
|
|
import com.glxp.api.service.sup.UserCompanyService;
|
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@ -38,10 +43,10 @@ public class UserComanyController extends BaseController {
|
|
|
|
|
@GetMapping("udi/auth/user/comapny/search")
|
|
|
|
|
public BaseResponse search(FilterUserComapanyRequest filterUserComapanyRequest) {
|
|
|
|
|
//获取部门id
|
|
|
|
|
if(filterUserComapanyRequest.getSearchKey() == null){
|
|
|
|
|
if (filterUserComapanyRequest.getSearchKey() == null) {
|
|
|
|
|
filterUserComapanyRequest.setSearchKey("");
|
|
|
|
|
}
|
|
|
|
|
List<UserCompanyEntity> userCompanyEntities = userCompanyService.list(new QueryWrapper<UserCompanyEntity>().like("companyName", filterUserComapanyRequest.getSearchKey()).eq("checkStatus",1));
|
|
|
|
|
List<UserCompanyEntity> userCompanyEntities = userCompanyService.list(new QueryWrapper<UserCompanyEntity>().like("companyName", filterUserComapanyRequest.getSearchKey()).eq("checkStatus", 1));
|
|
|
|
|
|
|
|
|
|
PageInfo<UserCompanyEntity> pageInfo;
|
|
|
|
|
pageInfo = new PageInfo<>(userCompanyEntities);
|
|
|
|
@ -64,4 +69,31 @@ public class UserComanyController extends BaseController {
|
|
|
|
|
pageSimpleResponse.setList(userCompanyEntities);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
UserCompanyOnlineService userCompanyOnlineService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("udi/auth/user/comapny/status/filter")
|
|
|
|
|
public BaseResponse filterCompanyStaus(FilterUserComapanyRequest filterUserComapanyRequest) {
|
|
|
|
|
|
|
|
|
|
List<UserCompanyEntity> userCompanyEntities = userCompanyService.filterCompanyName(filterUserComapanyRequest);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(userCompanyEntities)) {
|
|
|
|
|
for (UserCompanyEntity userCompanyEntity : userCompanyEntities) {
|
|
|
|
|
UserCompanyOnlineResponse userCompanyOnlineResponse = userCompanyOnlineService.findOnLineByConfig(userCompanyEntity.getId());
|
|
|
|
|
if (DateUtil.isExpire(userCompanyOnlineResponse.getUpdateTime(), userCompanyOnlineResponse.getHeartRate())) {
|
|
|
|
|
userCompanyEntity.setOnLineStatus(2);
|
|
|
|
|
} else
|
|
|
|
|
userCompanyEntity.setOnLineStatus(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageInfo<UserCompanyEntity> pageInfo = new PageInfo<>(userCompanyEntities);
|
|
|
|
|
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(userCompanyEntities);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|