Browse Source

PC签收限制

dist.1.3.0
汤建军 6 months ago
parent
commit
db78324c63
  1. 77
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

77
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -905,6 +905,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "barCode参数缺失");
return R.fail("请联系备货人员进行备货");
}
Integer isStrictLoading = 0;
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())){
isStrictLoading = warehouseConfig.getIsStrictLoading();
}
String[] split = distrilbutionloadingscanDTO.getBarcodes().split(",");
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId());
List<JSONObject> jsonObjects = new ArrayList<>();
@ -938,6 +943,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer i = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
} else {
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){
return R.fail("操作失败,存在未装车包件");
}
//不存在装车数据,需要进行装车数据的补录
//库存品未进行装车
//这里装车的数据需要进行补录
@ -952,6 +960,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
distributionDeliverySelfEntity.setVehicleNub(distributionDeliveryTripartiteEntity.getVehicleNum());
}
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = new DistributionLoadscaninvnEntity();
@ -979,7 +988,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscaninvnEntity.setScanUser(user.getNickName());
distributionLoadscaninvnEntity.setScanTime(simpleDateFormat.format(new Date()));
distributionLoadscaninvnEntity.setPackageNub(inventoryPackage.get(0).getNum());
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
distributionLoadscaninvnEntity.setScanType("1");
distributionLoadscaninvnEntity.setType(2);
@ -1395,6 +1404,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "参数异常,ReservationId为空");
return R.fail("请联系管理员");
}
Integer isStrictLoading = 0;
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())) {
isStrictLoading = warehouseConfig.getIsStrictLoading();
}
//查询订单
String zeroPackageIds = distrilbutionloadingscanDTO.getZeroPackageIds();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
@ -1438,12 +1452,18 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionLoadscanEntity::getPackageId, zeroPackageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
String driverName = "";
String driverPhone = "";
String vehicleNub = "";
Long loadingId = null;
//查询该车次负责司机
List<DistributionDeliverySelfVO> deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId());
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda()
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES)
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
);
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
distributionDeliverySelfEntity.setVehicleNub(distributionDeliveryTripartiteEntity.getVehicleNum());
}
//在库数
int a = 0;
//签收数
@ -1454,19 +1474,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
int d = 0;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
if (Func.isEmpty(loadscanEntity)) {
if ("1".equals(deliveryListEntity.getKind())) {
//自主配送
driverPhone = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverPhone).collect(Collectors.joining(","));
driverName = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverName).collect(Collectors.joining(","));
vehicleNub = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getVehicleNub).collect(Collectors.joining(","));
List<Long> collect = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getId).collect(Collectors.toList());
loadingId = collect.get(0);
} else if ("2".equals(deliveryListEntity.getKind())) {
//外协
} else {
log.error(method + "配送司机异常:{}", distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){
return R.fail("操作失败,存在未装车包件");
}
a = distributionParcelNumberDTO.getHandQuantity() - reservationZeroPackageEntities.getQuantity();
b = distributionParcelNumberDTO.getSigninQuantity() + reservationZeroPackageEntities.getQuantity();
@ -1474,9 +1483,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
d = distributionParcelNumberDTO.getDeliveryQuantity() - reservationZeroPackageEntities.getQuantity();
//未进行装车操作
DistributionLoadscanEntity unLoadscanEntity = new DistributionLoadscanEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
unLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
unLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
unLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
unLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
unLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
unLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setIsInsert(2);
unLoadscanEntity.setLoadingId(loadingId.toString());
unLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId()+"");
unLoadscanEntity.setOrderId(reservationZeroPackageEntities.getStockArticleId());
unLoadscanEntity.setPackageId(reservationZeroPackageEntities.getParcelListId());
unLoadscanEntity.setReservationId(reservationId);
@ -1490,11 +1514,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
unLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
unLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
unLoadscanEntity.setVehicleId(deliveryListEntity.getVehicleId());
unLoadscanEntity.setVehicleName(vehicleNub);
unLoadscanEntity.setDriverId(deliveryListEntity.getDriverId());
unLoadscanEntity.setDriverName(driverName);
unLoadscanEntity.setDriverPhone(driverPhone);
unLoadscanEntity.setLoadingId(driverPhone);
unLoadscanEntity.setScanType(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
unLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date(System.currentTimeMillis() + (6 * 1000))));
@ -1503,7 +1523,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
unLoadscanEntity.setSigningUser(user.getNickName());
unLoadscanEntity.setIsSignfor(2);
unLoadscanEntity.setSignforState(2);
// loadscanEntity.setSigningTime(new Date().toString());
unLoadscanEntity.setReceivedQuantity(reservationZeroPackageEntities.getQuantity());
unLoadscanEntity.setLoadedNub(reservationZeroPackageEntities.getQuantity());
unLoadscanEntity.setPackageNub(reservationZeroPackageEntities.getQuantity());
@ -1529,6 +1548,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("remark", "文员签收");
jsonObjects.add(jsonObject);
} else {
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){
if (loadscanEntity.getPackageNub() < reservationZeroPackageEntities.getQuantity()){
return R.fail("装车未完成,无法完成签收");
}
}
a = distributionParcelNumberEntity.getHandQuantity() + loadscanEntity.getLoadedNub() - reservationZeroPackageEntities.getQuantity();
b = distributionParcelNumberEntity.getSigninQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity();
c = distributionParcelNumberEntity.getOutboundQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity();

Loading…
Cancel
Save