|
@@ -7,18 +7,23 @@ import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
-import com.sckw.core.web.model.LoginUserInfo;
|
|
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.fleet.dao.KwfFleetMapper;
|
|
import com.sckw.fleet.dao.KwfFleetMapper;
|
|
|
import com.sckw.fleet.model.KwfFleet;
|
|
import com.sckw.fleet.model.KwfFleet;
|
|
|
import com.sckw.fleet.model.dto.KwfFleetDto;
|
|
import com.sckw.fleet.model.dto.KwfFleetDto;
|
|
|
|
|
+import com.sckw.fleet.model.vo.KwfDriverVo;
|
|
|
import com.sckw.fleet.model.vo.KwfFleetVo;
|
|
import com.sckw.fleet.model.vo.KwfFleetVo;
|
|
|
|
|
+import com.sckw.system.api.RemoteSystemService;
|
|
|
|
|
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
|
|
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author zk
|
|
* @author zk
|
|
@@ -30,6 +35,8 @@ public class KwfFleetService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
KwfFleetMapper fleetDao;
|
|
KwfFleetMapper fleetDao;
|
|
|
|
|
+ @DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
|
|
+ private RemoteSystemService remoteSystemService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @param key 主键id
|
|
* @param key 主键id
|
|
@@ -52,9 +59,20 @@ public class KwfFleetService {
|
|
|
params.put("entId", LoginUserHolder.getEntId());
|
|
params.put("entId", LoginUserHolder.getEntId());
|
|
|
List<KwfFleetVo> fleets = fleetDao.findPage(params);
|
|
List<KwfFleetVo> fleets = fleetDao.findPage(params);
|
|
|
|
|
|
|
|
- /**数据组装**/
|
|
|
|
|
- //dubbo获取用户信息
|
|
|
|
|
|
|
+ /**获取查询数据**/
|
|
|
|
|
+ List<Long> createBys = new ArrayList<>();
|
|
|
|
|
+ for (KwfFleetVo fleetVo:fleets) {
|
|
|
|
|
+ createBys.add(Long.parseLong(fleetVo.getCreateBy()));
|
|
|
|
|
+ }
|
|
|
|
|
+ //用户数据集
|
|
|
|
|
+ createBys = createBys.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
+ Map<Long, UserCacheResDto> users = remoteSystemService.queryUserCacheMapByIds(createBys);
|
|
|
|
|
|
|
|
|
|
+ /**数据组装**/
|
|
|
|
|
+ for (KwfFleetVo fleetVo:fleets) {
|
|
|
|
|
+ UserCacheResDto user = users == null ? null : users.get(Long.parseLong(fleetVo.getCreateBy()));
|
|
|
|
|
+ fleetVo.setCreateByName(user != null ? user.getName() : null);
|
|
|
|
|
+ }
|
|
|
return fleets;
|
|
return fleets;
|
|
|
}
|
|
}
|
|
|
|
|
|