提交 40aa399e authored 作者: 艾庆国's avatar 艾庆国

运单预警

上级 4ff95dc7
...@@ -173,4 +173,6 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -173,4 +173,6 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
Integer unloadTimeAvg(Integer sendAddressId, Integer receiveAddressId, Integer unloadTimeAvg(Integer sendAddressId, Integer receiveAddressId,
Integer sendSystemAddressId, Integer receiveSystemAddressId, Integer sendSystemAddressId, Integer receiveSystemAddressId,
String beginTime); String beginTime);
List<OrderChild> listByChildNoList(List<String> childNoList);
} }
...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Repository; ...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Repository;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
...@@ -554,4 +555,9 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -554,4 +555,9 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
sendSystemAddressId,receiveSystemAddressId, sendSystemAddressId,receiveSystemAddressId,
beginTime); beginTime);
} }
@Override
public List<OrderChild> listByChildNoList(List<String> childNoList) {
return list(lQrWrapper().in(OrderChild :: getChildNo,childNoList));
}
} }
package com.clx.performance.service.impl.vehiclewarn; package com.clx.performance.service.impl.vehiclewarn;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.OrderChildDao; import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.vehiclewarn.VehicleWarnInfoDao; import com.clx.performance.dao.vehiclewarn.VehicleWarnInfoDao;
import com.clx.performance.dao.vehiclewarn.VehicleWarnLogDao; import com.clx.performance.dao.vehiclewarn.VehicleWarnLogDao;
...@@ -30,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -30,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -139,6 +142,16 @@ public class VehicleWarnInfoServiceImpl implements VehicleWarnInfoService { ...@@ -139,6 +142,16 @@ public class VehicleWarnInfoServiceImpl implements VehicleWarnInfoService {
@Override @Override
public IPage<VehicleWarnInfoVO> pageInfo(PageVehicleWarnInfoParam param) { public IPage<VehicleWarnInfoVO> pageInfo(PageVehicleWarnInfoParam param) {
Page<VehicleWarnInfoVO> page = vehicleWarnInfoStruct.convertPage(vehicleWarnInfoDao.pageByParam(param));
List<String> childNoList = page.getRecords().stream().map(item -> item.getChildNo()).collect(Collectors.toList());
if (!childNoList.isEmpty()) {
List<OrderChild> list = orderChildDao.listByChildNoList(childNoList);
Map<String, OrderChild> map = list.stream().collect(Collectors.toMap(item -> item.getChildNo(), item -> item));
for (VehicleWarnInfoVO record : page.getRecords()) {
record.setStatus(map.get(record.getChildNo()).getStatus());
}
}
return vehicleWarnInfoStruct.convertPage(vehicleWarnInfoDao.pageByParam(param)); return vehicleWarnInfoStruct.convertPage(vehicleWarnInfoDao.pageByParam(param));
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论