|
|
|
@ -2130,20 +2130,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//查询当前登录人满足的配送计划
|
|
|
|
|
//获取当前登录人
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String roleId = user.getRoleId(); |
|
|
|
|
|
|
|
|
|
//判断当前登录人是否为司机
|
|
|
|
|
boolean delivery = false; |
|
|
|
|
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); |
|
|
|
|
String[] roleIds = value1.split(","); |
|
|
|
|
String[] roleIdsT = roleId.split(","); |
|
|
|
|
for (String id : roleIds) { |
|
|
|
|
for (String s : roleIdsT) { |
|
|
|
|
if (s.equals(id)) { |
|
|
|
|
delivery = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Boolean delivery = judgeIsDriver(user); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (delivery) { |
|
|
|
|
//查询当前登录人的配送任务
|
|
|
|
@ -2183,6 +2173,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return R.data(distributionAppDeliveryListVOS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Boolean judgeIsDriver(BladeUser user) { |
|
|
|
|
boolean delivery = false; |
|
|
|
|
String roleId = user.getRoleId(); |
|
|
|
|
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); |
|
|
|
|
String[] roleIds = value1.split(","); |
|
|
|
|
String[] roleIdsT = roleId.split(","); |
|
|
|
|
for (String id : roleIds) { |
|
|
|
|
for (String s : roleIdsT) { |
|
|
|
|
if (s.equals(id)) { |
|
|
|
|
delivery = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return delivery; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public DistributionAppDeliveryListVO getAppDeliverydetailVO(DistributionDeliveryListEntity detail) { |
|
|
|
|
DistributionAppDeliveryListVO distributionAppDeliveryListVO = new DistributionAppDeliveryListVO(); |
|
|
|
@ -7998,6 +8005,78 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R newLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { |
|
|
|
|
//参数校验
|
|
|
|
|
String method = "########################DistributionAppDeliveryListServiceImpl.newLoadingscan"; |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())){ |
|
|
|
|
log.error(method+"参数缺失DeliveryId"); |
|
|
|
|
return Resp.fail("参数缺失,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())){ |
|
|
|
|
log.error(method+"参数缺失Barcode"); |
|
|
|
|
return Resp.fail("参数缺失,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getType())){ |
|
|
|
|
log.error(method+"参数缺失Type"); |
|
|
|
|
return Resp.fail("参数缺失,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
log.error(method+"作业未选择仓库"); |
|
|
|
|
return R.fail(403,"未授权!!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer type = distrilbutionloadingscanDTO.getType(); |
|
|
|
|
String orderPackageCode = distrilbutionloadingscanDTO.getBarcode(); |
|
|
|
|
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId(); |
|
|
|
|
Long warehouseId = myCurrentWarehouse.getId(); |
|
|
|
|
//查询当前登录人所在计划
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
Boolean isDriverFlag = judgeIsDriver(user); |
|
|
|
|
if (!isDriverFlag) { |
|
|
|
|
return R.fail(403,"无权限执行此操作!!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (type){ |
|
|
|
|
case 1 : |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId()); |
|
|
|
|
if (Objects.isNull(parcelListEntity)){ |
|
|
|
|
//查询是否为库存品
|
|
|
|
|
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (list.isEmpty()){ |
|
|
|
|
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码"); |
|
|
|
|
} else { |
|
|
|
|
return Resp.scanFail("系统无编码", "系统无编码"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){ |
|
|
|
|
return Resp.scanFail("此包件已装车", "此包件已装车"); |
|
|
|
|
} |
|
|
|
|
//再次校验是否装车
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询是否满足计划 以及计划在哪个客户中
|
|
|
|
|
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode,deliveryId,warehouseId); |
|
|
|
|
if (Objects.isNull(reservationId)){ |
|
|
|
|
//判定是否满足异常装车
|
|
|
|
|
} |
|
|
|
|
//正常进行装车
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<DistributionAppStockListVO> handleAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
List<DistributionAppStockListVO> distributionAppStockListVOS = new ArrayList<>(); |
|
|
|
|
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionAppDeliveryListDTO.getId()); |
|
|
|
|