|
|
|
@ -6562,27 +6562,26 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldPackageSigning)) { |
|
|
|
|
pushOldPackageLoading = handleSignPushDataUnitDTOList(pushOldPackageSigning); |
|
|
|
|
pushOldPackageSigning = handleSignPushDataUnitDTOList(pushOldPackageSigning); |
|
|
|
|
buildNameAndPhone(pushOldPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldPackageSigning); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (distributionReservationEntity.getReservationStockListNum() > 0) {
|
|
|
|
|
//
|
|
|
|
|
// //查询库存品扫描签收
|
|
|
|
|
// List<SignPushDataUnitDTO> loadingPushOldInventory = distributionSignforMapper.selectLoadingPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
|
|
|
|
|
// List<SignPushDataUnitDTO> signingPushOldInventory = distributionSignforMapper.selectSigningPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
|
|
|
|
|
// if (Func.isNotEmpty(loadingPushOldInventory)) {
|
|
|
|
|
// buildNameAndPhone(loadingPushOldInventory);
|
|
|
|
|
// signPushDataUnitDTOS.addAll(loadingPushOldInventory);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (Func.isNotEmpty(signingPushOldInventory)) {
|
|
|
|
|
// buildNameAndPhone(signingPushOldInventory);
|
|
|
|
|
// signPushDataUnitDTOS.addAll(signingPushOldInventory);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (distributionReservationEntity.getReservationStockListNum() > 0) { |
|
|
|
|
//查询是否存在转的库存品
|
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldInventoryPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldInventoryPackageSigning(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageLoading)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageLoading); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageSigning)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageSigning); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//查询签收图片
|
|
|
|
|
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
|
@ -6806,24 +6805,153 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> clerkInventoryCheckPushData(String orderPackageCode) { |
|
|
|
|
//查询此包件
|
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, orderPackageCode) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!loadscaninvnEntityList.isEmpty()) { |
|
|
|
|
//未进行装车
|
|
|
|
|
} |
|
|
|
|
if (loadscaninvnEntityList.size()>1) { |
|
|
|
|
//存在多个记录
|
|
|
|
|
} |
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = loadscaninvnEntityList.get(0); |
|
|
|
|
Map<String,Object> resultMap = new HashMap<>(); |
|
|
|
|
try { |
|
|
|
|
//查询此包件
|
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, orderPackageCode) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!loadscaninvnEntityList.isEmpty()) { |
|
|
|
|
//未进行装车
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"没有装车扫描记录"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
if (loadscaninvnEntityList.size()>1) { |
|
|
|
|
//存在多个记录
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"存在多个装车扫描记录"); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = loadscaninvnEntityList.get(0); |
|
|
|
|
//查询signfor
|
|
|
|
|
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, loadscaninvnEntity.getReservationId()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(signforEntity)) { |
|
|
|
|
//存在多个记录
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"查询signfor数据错误,id:"+loadscaninvnEntity.getReservationId()); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
// 得到配送计划
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(loadscaninvnEntity.getDeliveryId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送计划 distributionDeliveryListEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 得到配送客户
|
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionReservationEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送客户 distributionReservationEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
//组合配送信息
|
|
|
|
|
SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId()); |
|
|
|
|
|
|
|
|
|
WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName()); |
|
|
|
|
if (ObjectUtils.isNotNull(warehouseEntity)) { |
|
|
|
|
// 需要增加老系统的仓库ID
|
|
|
|
|
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + "")); |
|
|
|
|
delivery.setWarehouseName(warehouseEntity.getTitle()); |
|
|
|
|
} |
|
|
|
|
//还需要配送的出库人、配送人、操作人信息
|
|
|
|
|
if (Func.isNotEmpty(delivery)) { |
|
|
|
|
if ("1".equals(delivery.getKind())) { |
|
|
|
|
//自主配送
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId()) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, 2) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity)) { |
|
|
|
|
delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); |
|
|
|
|
delivery.setOutName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
delivery.setOutPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//外协
|
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId())); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)) { |
|
|
|
|
delivery.setOutName(distributionDeliveryTripartiteEntity.getDriverName()); |
|
|
|
|
delivery.setOutPhone(distributionDeliveryTripartiteEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId()); |
|
|
|
|
if (Func.isNotEmpty(userR)) { |
|
|
|
|
User user = userR.getData(); |
|
|
|
|
delivery.setAdministratorsName(user.getName()); |
|
|
|
|
delivery.setAdministratorsPhone(user.getPhone()); |
|
|
|
|
} |
|
|
|
|
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(distributionStockupEntity)) { |
|
|
|
|
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())) { |
|
|
|
|
delivery.setOutToId(distributionStockupEntity.getStockupUserId()); |
|
|
|
|
delivery.setOutToName(distributionStockupEntity.getStockupUser()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询客户信息
|
|
|
|
|
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(customer)) { |
|
|
|
|
//查询客户订单
|
|
|
|
|
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>(); |
|
|
|
|
if (distributionReservationEntity.getReservationStockListNum() > 0) { |
|
|
|
|
//查询包件扫描签收
|
|
|
|
|
//查询包件扫描签收
|
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); |
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldSingleInventoryPackageSigning(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageLoading)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageLoading); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageSigning)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageSigning); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询签收图片
|
|
|
|
|
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(signPushDataUnitDTOS)) { |
|
|
|
|
SignPushDataContactDTO signPushDataContactDTO = customer.get(0); |
|
|
|
|
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS); |
|
|
|
|
if (Func.isNotEmpty(distributionSignPrintVOS)) { |
|
|
|
|
String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(",")); |
|
|
|
|
signPushDataContactDTO.setImage(urls); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(signforEntity.getClerkSignRemarks())) { |
|
|
|
|
signPushDataContactDTO.setContact(signforEntity.getClerkSignRemarks()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
buildReservationNameAndPhone(customer); |
|
|
|
|
//完成客户信息添加
|
|
|
|
|
delivery.setSignPushDataContactDTOs(customer); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.info(">>>> clerkCheckPushData SignPushDataDTO :{}", delivery); |
|
|
|
|
resultMap = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
return resultMap; |
|
|
|
|
}catch (Exception e) { |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "数据准备错误"+e.getMessage()); |
|
|
|
|
log.error(">>>>> 推送老系统签收信息报错", e); |
|
|
|
|
} |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "未知错误"); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) { |
|
|
|
|