|
|
@@ -7,6 +7,7 @@ import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.page.PageHelperUtil;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.utils.NumberUtils;
|
|
|
+import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
|
import com.sckw.report.model.vo.KwfCapacityVo;
|
|
|
import com.sckw.system.api.RemoteUserService;
|
|
|
@@ -37,14 +38,26 @@ public class KwFleetService {
|
|
|
* @date 2023/9/1
|
|
|
**/
|
|
|
public PageResult capacity(HashMap<String, Object> params) {
|
|
|
- //企业数据查询
|
|
|
- List<KwfCapacityVo> list = new ArrayList<>();
|
|
|
+ // 参数组装
|
|
|
List<Long> entIds = new ArrayList<>();
|
|
|
+ Integer capacityAmountMin = null;
|
|
|
+ Integer capacityAmountMax = null;
|
|
|
+ String totalLoadStr = StringUtils.objectStr(params.get("totalLoad"));
|
|
|
+ String [] array = StringUtils.isNotBlank(totalLoadStr) ? totalLoadStr.split(Global.MINUS_SIGN) : null;
|
|
|
+ capacityAmountMin = NumberUtils.parseEmptyInteger(array != null && array.length > 0 ? array[0] : null);
|
|
|
+ capacityAmountMax = NumberUtils.parseEmptyInteger(array != null && array.length > 1 ? array[1] : null);
|
|
|
+ if (capacityAmountMin != null || capacityAmountMax != null) {
|
|
|
+ List<Map<String, Object>> statistics = fleetService.capacityStatistics(entIds, capacityAmountMin, capacityAmountMax);
|
|
|
+ statistics.forEach(e -> entIds.add(NumberUtils.parseEmptyLong(e.get("entId"))));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 企业数据查询
|
|
|
+ List<KwfCapacityVo> list = new ArrayList<>();
|
|
|
Integer cityCode = NumberUtils.parseIntV1(params.get("cityCode"));
|
|
|
List<Integer> entTypes = new ArrayList<>(Arrays.asList(3, 4));
|
|
|
Integer page = PageResult.getPage(params);
|
|
|
Integer pageSize = PageResult.getPageSize(params);
|
|
|
- PageResult pageResult = userService.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypes, page, pageSize);
|
|
|
+ PageResult pageResult = userService.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypes, entIds, page, pageSize);
|
|
|
List<KwsEnterpriseResDto> ents = JSON.parseArray(JSON.toJSONString(pageResult.getList()), KwsEnterpriseResDto.class);
|
|
|
for (KwsEnterpriseResDto ent:ents) {
|
|
|
KwfCapacityVo capacity = new KwfCapacityVo();
|
|
|
@@ -58,11 +71,9 @@ public class KwFleetService {
|
|
|
}
|
|
|
|
|
|
//企业运力统计
|
|
|
- List<Map<String, Object>> statistics = fleetService.capacityStatistics(entIds);
|
|
|
+ List<Map<String, Object>> statistics = fleetService.capacityStatistics(entIds, capacityAmountMin, capacityAmountMax);
|
|
|
Map<Long, Map<String, Object>> entMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
- for (Map<String, Object> statistic:statistics) {
|
|
|
- entMap.put(NumberUtils.parseLong(statistic.get("entId")), statistic);
|
|
|
- }
|
|
|
+ statistics.forEach(e -> entMap.put(NumberUtils.parseEmptyLong(e.get("entId")), e));
|
|
|
|
|
|
//企业运力统计查询
|
|
|
for (KwfCapacityVo capacity:list) {
|