@ -270,6 +270,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IBasicCarModelClient iBasicCarModelClient ;
@Autowired
private IDistributionPositioningService distributionPositioningService ;
@Override
public IPage < DistributionSignforVO > selectDistributionSignforPage ( IPage < DistributionSignforVO > page , DistributionSignforVO distributionSignfor ) {
@ -4741,29 +4744,42 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
) ;
if ( null ! = distributionSignforEntity . getPositioning ( ) | | null ! = distributionSignforEntity . getPositioningAdr ( ) ) {
return Resp . scanSuccess ( "已打卡" , "已打卡" ) ;
}
BladeUser user = AuthUtil . getUser ( ) ;
Boolean driver = distributionDeliveryListService . judgeIsDriver ( user ) ;
String positioning = distributionSignfor . getPositioning ( ) ;
GAddressVo add = GaoDeApiUtil . getAdd ( positioning ) ;
boolean update = this . update ( new UpdateWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getPositioning ( ) ) , DistributionSignforEntity : : getPositioning , distributionSignfor . getPositioning ( ) )
. set ( StringUtils . isNotBlank ( add . getAddress ( ) ) , DistributionSignforEntity : : getPositioningAdr , add . getAddress ( ) )
) ;
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService . getById ( distributionSignforEntity . getDeliveryId ( ) ) ;
DistributionReservationEntity reservationEntity = distributionReservationService . getById ( distributionSignforEntity . getReservationId ( ) ) ;
BladeUser user = AuthUtil . getUser ( ) ;
DistributionPositioningEntity distributionPositioning = createdDistributionPositioningEntity ( deliveryListEntity , reservationEntity , AuthUtil . getUser ( ) , driver , positioning ) ;
//进行打卡信息保存
distributionPositioningService . save ( distributionPositioning ) ;
NodeFanoutMsg < ConsigneeArriveVO > nodeFanoutMsg = buildConsigneeArriveVO ( deliveryListEntity , reservationEntity , add , user ) ;
iDistributionNodeWorkService . carArrived ( nodeFanoutMsg , user ) ;
return Resp . scanSuccess ( "打卡成功" , "打卡成功" ) ;
}
private DistributionPositioningEntity createdDistributionPositioningEntity ( DistributionDeliveryListEntity deliveryListEntity ,
DistributionReservationEntity reservationEntity ,
BladeUser user ,
Boolean driver ,
String positioning ) {
GAddressVo add = GaoDeApiUtil . getAdd ( positioning ) ;
DistributionPositioningEntity distributionPositioningEntity = new DistributionPositioningEntity ( ) ;
distributionPositioningEntity . setAddress ( positioning ) ;
distributionPositioningEntity . setLatitudeAndLongitude ( add . getAddress ( ) ) ;
distributionPositioningEntity . setDeliveryId ( deliveryListEntity . getId ( ) ) ;
distributionPositioningEntity . setReservationId ( reservationEntity . getId ( ) ) ;
distributionPositioningEntity . setOperationUsername ( user . getNickName ( ) ) ;
distributionPositioningEntity . setOperationId ( user . getUserId ( ) ) ;
if ( "1" . equals ( deliveryListEntity . getKind ( ) ) ) {
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService . getDriver ( deliveryListEntity , user , null , driver ) ;
distributionPositioningEntity . setVehicleNumber ( deliverySelfEntity . getVehicleNub ( ) ) ;
distributionPositioningEntity . setVehicleId ( Long . parseLong ( deliverySelfEntity . getVehicleId ( ) ) ) ;
}
return distributionPositioningEntity ;
}
private NodeFanoutMsg < ConsigneeArriveVO > buildConsigneeArriveVO ( DistributionDeliveryListEntity deliveryListEntity , DistributionReservationEntity reservationEntity , GAddressVo add , BladeUser user ) {
NodeFanoutMsg < ConsigneeArriveVO > nodeFanoutMsg = new NodeFanoutMsg ( ) ;
@ -7570,6 +7586,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log . error ( method + "Barcode参数缺失" ) ;
return Resp . scanFail ( "参数缺失,请联系管理员" , "参数缺失,请联系管理员" ) ;
}
//校验当前包件是否存在回库任务
boolean isHaveRetention = warehouseRetentionScanClient . judgeIsHaveRetention ( distrilbutionloadingscanDTO . getBarcode ( ) , myCurrentWarehouse . getId ( ) ) ;
if ( isHaveRetention ) {
return Resp . scanFail ( "当前包件存在回库任务" , "当前包件存在回库任务" ) ;
}
barcode = distrilbutionloadingscanDTO . getBarcode ( ) ;
DistributionParcelListEntity parcelListEntity = distributionParcelListService . selectByOrderPackageCode ( distrilbutionloadingscanDTO . getBarcode ( ) , myCurrentWarehouse . getId ( ) ) ;
if ( Objects . isNull ( parcelListEntity ) ) {
@ -7585,12 +7606,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( parcelListEntity . getOrderPackageStatus ( ) . equals ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ) {
return Resp . scanFail ( "包件已签收" , "包件已签收" ) ;
}
List < JSONObject > aaa = new ArrayList < > ( ) ;
DistributionReservationPackageEntity planPackage = distributionReservationPackageService . getPlanPackageByReservationAndCode ( reservationId , barcode ) ;
if ( ! Objects . isNull ( planPackage ) ) {
if ( parcelListEntity . getOrderPackageLoadingStatus ( ) . equals ( OrderPackageLoadingStatusConstant . weizhuancghe . getValue ( ) ) ) {
return Resp . scanFail ( "包件已签收" , "包件已签收 " ) ;
return Resp . scanFail ( "包件未装车" , "包件未装车 " ) ;
}
List < DistributionLoadscanAbnormalEntity > abnormalEntities = distributionLoadscanAbnormalService . list ( Wrappers . < DistributionLoadscanAbnormalEntity > query ( ) . lambda ( )
. eq ( DistributionLoadscanAbnormalEntity : : getPackageCode , barcode )
@ -7660,6 +7680,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//判断客户
boolean flag = judgmentClient ( reservationEntity , parcelListEntity . getStockArticleId ( ) ) ;
if ( flag ) {
if ( OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) . equals ( parcelListEntity . getOrderPackageReservationStatus ( ) ) ) {
return Resp . scanFail ( "当前包件存在配送计划" , "当前包件存在配送计划" ) ;
}
return R . fail ( 3006 , null ) ;
} else {
//查询出未审核如果存在多个则不行
@ -7875,7 +7898,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log . error ( method + "Barcode参数缺失" ) ;
return Resp . scanFail ( "参数缺失,请联系管理员" , "参数缺失,请联系管理员" ) ;
}
//校验当前包件是否存在回库任务
boolean isHaveInventoryRetention = warehouseRetentionScanClient . judgeIsHaveRetention ( distrilbutionloadingscanDTO . getBarcode ( ) , myCurrentWarehouse . getId ( ) ) ;
if ( isHaveInventoryRetention ) {
return Resp . scanFail ( "当前包件存在回库任务" , "当前包件存在回库任务" ) ;
}
//库存品
List < DisStockListDetailEntity > detailEntities = distributionReservationMapper . selectInventoryListByReservation ( distrilbutionloadingscanDTO . getReservationId ( ) ) ;
if ( detailEntities . isEmpty ( ) ) {
@ -8509,6 +8536,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( ! isDriverFlag ) {
return Resp . scanFail ( "此操作只能司机完成" , "此操作只能司机完成" ) ;
}
parcelListEntity . setOrderPackageLoadingStatus ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) ) ;
parcelListEntity . setOrderPackageStatus ( OrderPackageStatusConstant . yichuku . getValue ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService . getDriver ( deliveryListEntity , user , null , isDriverFlag ) ;
List < JSONObject > logList = new ArrayList < > ( ) ;
//生成异常
@ -8519,7 +8550,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanAbnormalEntity . setWarehouseName ( myCurrentWarehouse . getName ( ) ) ;
distributionLoadscanAbnormalEntity . setWarehouseId ( myCurrentWarehouse . getId ( ) ) ;
distributionLoadscanAbnormalEntity . setReservationId ( reservationEntity . getId ( ) ) ;
distributionLoadscanAbnormalEntity . setAuditingStatus ( LoadingAbnormalAuditingStatusConstant . daishenhe . getValue ( ) ) ;
distributionLoadscanAbnormalEntity . setAuditingStatus ( LoadingAbnormalAuditingStatusConstant . yiqueding . getValue ( ) ) ;
distributionLoadscanAbnormalEntity . setGoodsType ( 1 ) ;
distributionLoadscanAbnormalEntity . setPackageId ( parcelListEntity . getId ( ) ) ;
distributionLoadscanAbnormalEntity . setStockArticleId ( parcelListEntity . getStockArticleId ( ) ) ;
@ -8537,7 +8568,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//生成回库
createdRefuseSignfor ( myCurrentWarehouse , deliveryListEntity , reservationEntity , deliverySelfEntity , parcelListEntity , distributionLoadscanAbnormalEntity . getId ( ) ) ;
//记录当前包件生成待回库任务
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + user . getNickName ( ) + "异常签收拒签生成待回库任务,配送车次号:" + deliveryListEntity . getTrainNumber ( ) + "预约任务号:" + reservationEntity . getReservationCode ( ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + user . getNickName ( ) + "异常签收拒签标注出库并 生成待回库任务,配送车次号:" + deliveryListEntity . getTrainNumber ( ) + "预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject jsonObject = handleLogJSONObject ( myCurrentWarehouse , user , parcelListEntity . getOrderPackageCode ( ) , content , WorkNodeEnums . DISTRIBUTION_ABNORMAL_REJECT . getCode ( ) , deliveryListEntity . getTrainNumber ( ) , parcelListEntity . getWarehouseEntryTimeEnd ( ) ) ;
logList . add ( jsonObject ) ;
if ( ! logList . isEmpty ( ) ) {