|
|
@@ -12,7 +12,9 @@ import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
import com.sckw.contract.dao.KwcContractLogisticsMapper;
|
|
|
import com.sckw.contract.model.dto.req.QueryListReqDto;
|
|
|
+import com.sckw.contract.model.dto.req.TradeEntListQueryFeignDto;
|
|
|
import com.sckw.contract.model.dto.res.QueryListResDto;
|
|
|
+import com.sckw.contract.model.dto.res.TradeEntInfoResVo;
|
|
|
import com.sckw.contract.model.entity.*;
|
|
|
import com.sckw.contract.model.report.LogisticsListExport;
|
|
|
import com.sckw.contract.model.vo.req.*;
|
|
|
@@ -1719,4 +1721,31 @@ public class KwcContractLogisticsService {
|
|
|
contractStatusCount.setOrderNum(String.valueOf(finalStatusAndLogOrdersMap1.getOrDefault(statusEnum.getCode(), new ArrayList<>()).size()));
|
|
|
return contractStatusCount;
|
|
|
}
|
|
|
+
|
|
|
+ public List<TradeEntInfoResVo> queryTradeEntList(TradeEntListQueryFeignDto queryFeignDto) {
|
|
|
+ List<TradeEntInfoResVo> resVos = new ArrayList<>();
|
|
|
+ Long entId = queryFeignDto.getCurEntId();
|
|
|
+ Set<Long> entIds = Sets.newHashSet();
|
|
|
+ entIds.add(entId);
|
|
|
+ Set<Long> contractIds = null;
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(entIds)) {
|
|
|
+ List<KwcContractLogisticsUnit> units = kwcContractLogisticsUnitService.queryByEntIds(entIds);
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(units)) {
|
|
|
+ contractIds = units.stream()
|
|
|
+ .map(KwcContractLogisticsUnit::getContractId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isEmpty(contractIds)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ List<KwcContractLogisticsUnit> tradeUnits = kwcContractLogisticsUnitService.queryByContractIdsAndEntType(contractIds, queryFeignDto.getTradeEntType());
|
|
|
+ for (KwcContractLogisticsUnit tradeUnit : tradeUnits) {
|
|
|
+ TradeEntInfoResVo resVo = new TradeEntInfoResVo();
|
|
|
+ resVo.setEntId(tradeUnit.getEntId());
|
|
|
+ resVo.setEntName(tradeUnit.getFirmName());
|
|
|
+ resVos.add(resVo);
|
|
|
+ }
|
|
|
+ return resVos;
|
|
|
+ }
|
|
|
}
|