|
@@ -24,10 +24,7 @@ import com.sckw.order.dao.KwoTransportDemandMapper;
|
|
|
import com.sckw.order.model.KwoTransportDemand;
|
|
import com.sckw.order.model.KwoTransportDemand;
|
|
|
import com.sckw.order.model.dto.TransportDemandExport;
|
|
import com.sckw.order.model.dto.TransportDemandExport;
|
|
|
import com.sckw.order.model.vo.req.*;
|
|
import com.sckw.order.model.vo.req.*;
|
|
|
-import com.sckw.order.model.vo.res.TransportDemandContactInfoRes;
|
|
|
|
|
-import com.sckw.order.model.vo.res.TransportDemandDetailRes;
|
|
|
|
|
-import com.sckw.order.model.vo.res.TransportDemandListRes;
|
|
|
|
|
-import com.sckw.order.model.vo.res.TransportDemandSquaresListRes;
|
|
|
|
|
|
|
+import com.sckw.order.model.vo.res.*;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
@@ -186,6 +183,13 @@ public class KwoTransportDemandService {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), Collections.emptyList());
|
|
return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), Collections.emptyList());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 获取供应企业信息
|
|
|
|
|
+ List<Long> supplyEntIds = list.stream().map(KwoTransportDemand::getEntId).collect(Collectors.toList());
|
|
|
|
|
+ // 通过企业id查询企业信息
|
|
|
|
|
+ List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
|
|
+ Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
|
|
+
|
|
|
List<TransportDemandListRes> result = Lists.newArrayList();
|
|
List<TransportDemandListRes> result = Lists.newArrayList();
|
|
|
list.forEach(e -> {
|
|
list.forEach(e -> {
|
|
|
TransportDemandListRes demand = BeanUtils.copyProperties(e, TransportDemandListRes.class);
|
|
TransportDemandListRes demand = BeanUtils.copyProperties(e, TransportDemandListRes.class);
|
|
@@ -197,7 +201,8 @@ public class KwoTransportDemandService {
|
|
|
.setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
|
|
.setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
|
|
|
.setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
|
|
.setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
|
|
|
.setLoadAddress(loadAreaName + loadDetailAddress)
|
|
.setLoadAddress(loadAreaName + loadDetailAddress)
|
|
|
- .setUnloadAddress(unloadAreaName + unloadDetailAddress);
|
|
|
|
|
|
|
+ .setUnloadAddress(unloadAreaName + unloadDetailAddress)
|
|
|
|
|
+ .setEntName(entMap != null ? entMap.get(e.getEntId()) : null);
|
|
|
result.add(demand);
|
|
result.add(demand);
|
|
|
});
|
|
});
|
|
|
return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), result);
|
|
return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), result);
|
|
@@ -292,6 +297,13 @@ public class KwoTransportDemandService {
|
|
|
if (CollectionUtils.isEmpty(demands)) {
|
|
if (CollectionUtils.isEmpty(demands)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 获取供应企业信息
|
|
|
|
|
+ List<Long> supplyEntIds = demands.stream().map(KwoTransportDemand::getEntId).collect(Collectors.toList());
|
|
|
|
|
+ // 通过企业id查询企业信息
|
|
|
|
|
+ List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
|
|
+ Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
|
|
+
|
|
|
List<TransportDemandExport> result = Lists.newArrayList();
|
|
List<TransportDemandExport> result = Lists.newArrayList();
|
|
|
AtomicInteger i = new AtomicInteger(1);
|
|
AtomicInteger i = new AtomicInteger(1);
|
|
|
demands.forEach(e -> {
|
|
demands.forEach(e -> {
|
|
@@ -302,7 +314,8 @@ public class KwoTransportDemandService {
|
|
|
.setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
|
|
.setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
|
|
|
.setDeadline(Objects.isNull(e.getDeadline()) ? null : DateUtil.dateToStr(e.getDeadline()))
|
|
.setDeadline(Objects.isNull(e.getDeadline()) ? null : DateUtil.dateToStr(e.getDeadline()))
|
|
|
.setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
|
|
.setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
|
|
|
- .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
|
|
|
|
|
|
|
+ .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()))
|
|
|
|
|
+ .setEntName(entMap != null ? entMap.get(e.getEntId()) : null);
|
|
|
result.add(export);
|
|
result.add(export);
|
|
|
});
|
|
});
|
|
|
return result;
|
|
return result;
|