|
|
|
@ -44,6 +44,8 @@ import org.springblade.core.tool.api.R;
|
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
import java.util.function.Function; |
|
|
|
@ -95,38 +97,57 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(IPage<DistributionParcelListVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) { |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.selectDistributionDeliverywrapInfoPage(page, distributionDeliveryInfoDTO); |
|
|
|
|
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList); |
|
|
|
|
parcelListVOS.forEach(p -> { |
|
|
|
|
//查询扫描表,
|
|
|
|
|
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId()).eq(DistributionLoadscanEntity::getOrderPackageCode, p.getOrderPackageCode())); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity)) { |
|
|
|
|
switch (loadscanEntity.getScanState().toString()) { |
|
|
|
|
case "1": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.quxiao.getName()); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.saomiao.getName()); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.queren.getName()); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) { |
|
|
|
|
p.setSigningTime(loadscanEntity.getSigningTime()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getScanUser())) { |
|
|
|
|
p.setScanUser(loadscanEntity.getScanUser()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getDriverName())) { |
|
|
|
|
p.setDriverName(loadscanEntity.getDriverName()); |
|
|
|
|
public IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(Map<String, Object> reservationPackageDTO, IPage<DistributionParcelListVO> page) { |
|
|
|
|
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(reservationPackageDTO.get("orderPackageStatus"))) { |
|
|
|
|
String orderPackageStatus = (String) reservationPackageDTO.get("orderPackageStatus"); |
|
|
|
|
if (Func.isNotBlank(orderPackageStatus)) { |
|
|
|
|
if (!orderPackageStatus.equals("70")) { |
|
|
|
|
reservationPackageDTO.put("unSigning", "70"); |
|
|
|
|
reservationPackageDTO.remove(orderPackageStatus); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.selectDistributionDeliverywrapInfoPage(page, reservationPackageDTO); |
|
|
|
|
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList); |
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
parcelListVOS.forEach(p -> { |
|
|
|
|
//查询扫描表,
|
|
|
|
|
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId()).eq(DistributionLoadscanEntity::getOrderPackageCode, p.getOrderPackageCode())); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity)) { |
|
|
|
|
try { |
|
|
|
|
p.setLoadingTime(sdf.parse(loadscanEntity.getScanTime())); |
|
|
|
|
switch (loadscanEntity.getScanState().toString()) { |
|
|
|
|
case "1": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.quxiao.getName()); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.saomiao.getName()); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.queren.getName()); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
p.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) { |
|
|
|
|
p.setSigningTime(loadscanEntity.getSigningTime()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getScanUser())) { |
|
|
|
|
p.setScanUser(loadscanEntity.getScanUser()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity.getDriverName())) { |
|
|
|
|
p.setDriverName(loadscanEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return page.setRecords(parcelListVOS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -150,17 +171,17 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId")) |
|
|
|
|
); |
|
|
|
|
Map<Long, List<DistributionLoadscanEntity>> orderLoadMap; |
|
|
|
|
if (!Objects.isNull(loadList)){ |
|
|
|
|
if (!Objects.isNull(loadList)) { |
|
|
|
|
orderLoadMap = loadList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId)); |
|
|
|
|
} else { |
|
|
|
|
orderLoadMap = null; |
|
|
|
|
} |
|
|
|
|
distributionDeliveryInfoVOS.forEach(s -> { |
|
|
|
|
orderLoadMap = null; |
|
|
|
|
} |
|
|
|
|
distributionDeliveryInfoVOS.forEach(s -> { |
|
|
|
|
//匹配当前配送任务签收数量
|
|
|
|
|
s.setSigningNumber(0); |
|
|
|
|
if (Func.isNotEmpty(orderLoadMap)){ |
|
|
|
|
if (Func.isNotEmpty(orderLoadMap)) { |
|
|
|
|
List<DistributionLoadscanEntity> orderLoading = orderLoadMap.get(s.getId()); |
|
|
|
|
if (Func.isNotEmpty(orderLoading)){ |
|
|
|
|
if (Func.isNotEmpty(orderLoading)) { |
|
|
|
|
int signingNum = orderLoading.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
s.setSigningNumber(signingNum); |
|
|
|
|
} |
|
|
|
|