@ -16,8 +16,8 @@
* /
package com.logpm.distribution.service.impl ;
import com.alibaba.fastjson.JSON ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper ;
import com.alibaba.fastjson.JSON ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper ;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper ;
@ -45,6 +45,7 @@ import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper ;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper ;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient ;
import lombok.AllArgsConstructor ;
import lombok.extern.slf4j.Slf4j ;
import org.apache.commons.lang.StringUtils ;
import org.jetbrains.annotations.NotNull ;
@ -72,7 +73,6 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser ;
import org.springblade.core.secure.utils.AuthUtil ;
import org.springblade.core.tool.api.R ;
import org.springblade.core.tool.utils.DateUtil ;
import org.springblade.core.tool.utils.Func ;
import org.springblade.core.tool.utils.ObjectUtil ;
import org.springblade.system.cache.DictBizCache ;
@ -86,13 +86,11 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream ;
import javax.servlet.http.HttpServletResponse ;
import java.io.BufferedInputStream ;
import java.io.File ;
import java.io.FileInputStream ;
import java.io.IOException ;
import java.io.* ;
import java.math.BigDecimal ;
import java.text.SimpleDateFormat ;
import java.util.* ;
import java.util.List ;
import java.util.concurrent.atomic.AtomicInteger ;
import java.util.function.Function ;
import java.util.stream.Collectors ;
@ -448,7 +446,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionSignfor . setSigningStatus ( SignforStatusConstant . yiqianshou . getValue ( ) ) ;
distributionSignfor . setExamineUserName ( user . getNickName ( ) ) ;
this . updateById ( distributionSignfor ) ;
distributionAsyncService . sendReviewFactory ( id , myCurrentWarehouse . getName ( ) , myCurrentWarehouse . getId ( ) ) ;
distributionAsyncService . sendReviewFactory ( id , myCurrentWarehouse . getName ( ) , myCurrentWarehouse . getId ( ) ) ;
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this . judgmentSignIsHavePackage ( distributionSignfor . getReservationId ( ) ) ;
if ( ! flag ) {
@ -850,7 +848,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Transactional
public R signfor ( DistrilbutionAppsignforDTO distrilbutionloadingscanDTO ) {
List < String > packageCodes = new ArrayList < > ( ) ;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ;
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
@ -925,8 +922,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper . updateSignUser ( loadscanEntity . getDeliveryId ( ) , loadscanEntity . getReservationId ( ) , AuthUtil . getUser ( ) ) ;
//下架解托
packageCodes . add ( loadscanEntity . getOrderPackageCode ( ) ) ;
// warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient . downPackageOrDelTray ( loadscanEntity . getOrderPackageCode ( ) , myCurrentWarehouse . getId ( ) ) ;
//维护订单状态
} else {
//这里装车的数据需要进行补录
@ -1003,7 +999,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护签收包件状态
distributionStockArticleService . maintenanceOrderInfo ( collect . get ( 0 ) . getOrderCode ( ) , myCurrentWarehouse . getId ( ) ) ;
//推送信息至工厂
distributionAsyncService . sendFactory ( collect . get ( 0 ) , signingTime , distributionReservationEntity . getId ( ) , distributionReservationEntity . getReservationCode ( ) , myCurrentWarehouse . getName ( ) ) ;
distributionAsyncService . sendFactory ( collect . get ( 0 ) , signingTime , distributionReservationEntity . getId ( ) , distributionReservationEntity . getReservationCode ( ) , myCurrentWarehouse . getName ( ) ) ;
//TODO 这里就需要一个异步的包件状态维护方法
} else if ( Func . isEmpty ( collect ) ) {
//这里就需要对该包件信息是否属于该配送计划进行判定。如果属于该配送计划则是串货。不是那么则需要提示是否异常签收或者返回的操作
@ -1254,6 +1250,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询这个包件是否满足该客户的要求
DistributionReservationEntity reservationEntity = distributionReservationMapper . selectById ( distrilbutionloadingscanDTO . getReservationId ( ) ) ;
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService . getById ( parcelListEntity . getStockArticleId ( ) ) ;
DistributionSignforEntity signforEntity = distributionSignforMapper . getByReservationId ( reservationEntity . getId ( ) ) ;
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper . selectById ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity ( ) ;
@ -1267,7 +1264,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
. eq ( DistributionDeliveryTripartiteEntity : : getDeliveryId , distrilbutionloadingscanDTO . getDeliveryId ( ) ) ) ;
BeanUtils . copyProperties ( distributionDeliveryTripartiteEntity , distributionDeliverySelfEntity ) ;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH :mm:ss" ) ;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd hh :mm:ss" ) ;
//查询装车扫描表
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService . getOne ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( )
. eq ( DistributionLoadscanEntity : : getDeliveryId , distrilbutionloadingscanDTO . getDeliveryId ( ) )
@ -1306,12 +1303,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( StringUtils . isNotBlank ( distributionDeliverySelfEntity . getVehicleId ( ) ) ) {
distributionLoadscanEntity . setVehicleId ( distributionDeliverySelfEntity . getVehicleId ( ) ) ;
}
if ( StringUtils . isBlank ( distributionLoadscanEntity . getScanTime ( ) ) ) {
distributionLoadscanEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
}
if ( StringUtils . isBlank ( distributionLoadscanEntity . getScanUser ( ) ) ) {
distributionLoadscanEntity . setScanUser ( AuthUtil . getUser ( ) . getNickName ( ) ) ;
}
distributionLoadscanEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
distributionLoadscanEntity . setPackageId ( parcelListEntity . getId ( ) ) ;
distributionLoadscanEntity . setOrderPackageCode ( distrilbutionloadingscanDTO . getBarcode ( ) ) ;
distributionLoadscanEntity . setSigningTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
@ -1325,25 +1317,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity . setOrderId ( parcelListEntity . getStockArticleId ( ) ) ;
distributionLoadscanEntity . setReservationId ( distrilbutionloadingscanDTO . getReservationId ( ) ) ;
distributionLoadscanEntity . setDeliveryId ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
distributionLoadscanEntity . setScanUser ( AuthUtil . getUser ( ) . getNickName ( ) ) ;
distributionLoadscanEntity . setSigningUser ( AuthUtil . getUser ( ) . getNickName ( ) ) ;
distributionLoadscanEntity . setSigningUserId ( AuthUtil . getUser ( ) . getUserId ( ) ) ;
distributionLoadscanEntity . setAbnormalNote ( "异常签收" ) ;
//更新装车时间
//进行签收数量的修改
Integer i = distributionDeliveryListMapper . updateloadingTimeById ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
//修改签收数量
// Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
if ( Func . isEmpty ( loadscanEntity ) ) {
distributionLoadscanEntity . setScanStatus ( LoadingStatusConstant . buluzhuangche . getValue ( ) ) ;
//更新装车包件数和签收包件数
distributionLoadscanService . save ( distributionLoadscanEntity ) ;
//更新装车和签收数
Integer j = distributionSignforMapper . updateSignforByReservationId ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
} else {
distributionLoadscanService . updateById ( distributionLoadscanEntity ) ;
distributionSignforMapper . updateSignforNum ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
}
// else {
// distributionLoadscanService.updateById(distributionLoadscanEntity);
// //更新签收数
// distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
} else {
return Resp . scanFail ( "操作失败" , "不属于该客户" ) ;
}
@ -1378,12 +1367,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( StringUtils . isNotBlank ( distributionDeliverySelfEntity . getVehicleId ( ) ) ) {
distributionLoadscanEntity . setVehicleId ( distributionDeliverySelfEntity . getVehicleId ( ) ) ;
}
if ( StringUtils . isBlank ( distributionLoadscanEntity . getScanTime ( ) ) ) {
distributionLoadscanEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
}
if ( StringUtils . isBlank ( distributionLoadscanEntity . getScanUser ( ) ) ) {
distributionLoadscanEntity . setScanUser ( AuthUtil . getUser ( ) . getNickName ( ) ) ;
}
distributionLoadscanEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
distributionLoadscanEntity . setPackageId ( parcelListEntity . getId ( ) ) ;
distributionLoadscanEntity . setOrderPackageCode ( distrilbutionloadingscanDTO . getBarcode ( ) ) ;
distributionLoadscanEntity . setSigningTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
@ -1399,29 +1383,31 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity . setReservationId ( distrilbutionloadingscanDTO . getReservationId ( ) ) ;
distributionLoadscanEntity . setDeliveryId ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
distributionLoadscanEntity . setScanUser ( AuthUtil . getUser ( ) . getUserName ( ) ) ;
distributionLoadscanEntity . setSigningUser ( AuthUtil . getUser ( ) . getUserName ( ) ) ;
distributionLoadscanEntity . setSigningUserId ( AuthUtil . getUser ( ) . getUserId ( ) ) ;
if ( Func . isEmpty ( loadscanEntity ) ) {
distributionLoadscanEntity . setScanStatus ( LoadingStatusConstant . buluzhuangche . getValue ( ) ) ;
distributionLoadscanService . save ( distributionLoadscanEntity ) ;
Integer j = distributionSignforMapper . updateSignforByReservationId ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
Integer j = distributionSignforMapper . updateSignforNum ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
} else {
distributionLoadscanService . updateById ( distributionLoadscanEntity ) ;
Integer j = distributionSignforMapper . updateSignforNum ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
}
//更新装车时间
//进行签收数量的修改
Integer i = distributionDeliveryListMapper . updateloadingTimeById ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
//修改包件装车、签收状态
} else {
return Resp . scanFail ( "操作失败" , "不属于该客户" ) ;
}
break ;
default :
//修改包件信息
parcelListEntity . setOrderPackageLoadingStatus ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) ) ;
parcelListEntity . setOrderPackageStatus ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
//维护订单信息
distributionStockArticleService . maintenanceOrderInfo ( parcelListEntity . getOrderCode ( ) , parcelListEntity . getWarehouseId ( ) ) ;
break ;
}
//修改包件信息
parcelListEntity . setOrderPackageLoadingStatus ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) ) ;
parcelListEntity . setOrderPackageStatus ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
//维护订单信息
distributionStockArticleService . maintenanceOrderInfo ( parcelListEntity . getOrderCode ( ) , parcelListEntity . getWarehouseId ( ) ) ;
//查询一次是否进行了异常装车,如果没有进行异常装车数据进行审核
List < DistributionLoadscanAbnormalEntity > list = distributionLoadscanAbnormalService . list ( Wrappers . < DistributionLoadscanAbnormalEntity > query ( ) . lambda ( )
. eq ( DistributionLoadscanAbnormalEntity : : getReservationId , distrilbutionloadingscanDTO . getReservationId ( ) )
@ -1449,17 +1435,37 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanAbnormalService . save ( distributionLoadscanAbnormalEntity ) ;
}
//修改对应的签收为可审核
DistributionSignforEntity signforEntity = distributionSignforMapper . getByReservationId ( reservationEntity . getId ( ) ) ;
signforEntity . setIsHaveAbnormalPackage ( 2 ) ;
this . updateById ( signforEntity ) ;
//修改包件的签收数量
distributionParcelListMapper . updateOrderPackageCodeById ( parcelListEntity . getId ( ) , OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ;
//还需要维护包件状态
distributionAsyncService . maintenanceOrderStatus ( parcelListEntity . getOrderCode ( ) , parcelListEntity . getWarehouseId ( ) ) ;
} else {
log . error ( "############出现相同的包件码:{}" , distrilbutionloadingscanDTO . getBarcode ( ) ) ;
return Resp . scanFail ( "操作失败" , "包件信息有误" ) ;
}
checkSignNum ( distrilbutionloadingscanDTO ) ;
return Resp . scanSuccess ( "操作成功" , "异常签收成功" ) ;
String s = checkAbnormalSignNum ( distrilbutionloadingscanDTO ) ;
return Resp . scanSuccess ( "操作成功" , s ) ;
}
/ * *
* 查询当前客户异常签收件数
* @param distrilbutionloadingscanDTO
* @return
* /
private String checkAbnormalSignNum ( DistrilbutionAppsignforDTO distrilbutionloadingscanDTO ) {
DistributionReservationEntity reservationEntity = distributionReservationMapper . selectById ( distrilbutionloadingscanDTO . getReservationId ( ) ) ;
//查询此客户的异常签收包件数
Integer abnormalSiginNum = distributionLoadscanMapper . selectAbnormalSigningByReservationId ( reservationEntity . getId ( ) ) ;
StringBuilder msg = new StringBuilder ( "异常签收" ) ;
if ( abnormalSiginNum > 0 ) {
msg . append ( "操作成功" ) . append ( abnormalSiginNum + "件" ) ;
} else {
msg . append ( "操作失败" ) ;
}
return msg . toString ( ) ;
}
private String checkSignNum ( DistrilbutionAppsignforDTO distrilbutionloadingscanDTO ) {
@ -1468,30 +1474,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
int reservationNum = reservationEntity . getReservationNum ( ) + reservationEntity . getReservationStockListNum ( ) ;
AtomicInteger signingTotal = new AtomicInteger ( ) ;
AtomicInteger abnormalSignTotal = new AtomicInteger ( ) ;
List < DistributionLoadscanEntity > loadscanEntityList = distributionLoadscanService . list ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getReservationId , distrilbutionloadingscanDTO . getReservationId ( ) ) . ne ( DistributionLoadscanEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) ) ) ;
List < DistributionLoadscaninvnEntity > loadscaninvnEntityList = distributionLoadscaninvnService . list ( Wrappers . < DistributionLoadscaninvnEntity > query ( ) . lambda ( ) . eq ( DistributionLoadscaninvnEntity : : getReservationId , distrilbutionloadingscanDTO . getReservationId ( ) ) . ne ( DistributionLoadscaninvnEntity : : getScanState , LoadingStatusConstant . quxiao . getValue ( ) ) ) ;
if ( Func . isNotEmpty ( loadscanEntityList ) ) {
int packSignTotal = loadscanEntityList . stream ( ) . filter ( l - > Func . equals ( l . getSignforState ( ) , LoadScanSigningStatusConstant . yiqianshou . getValue ( ) ) ) . mapToInt ( DistributionLoadscanEntity : : getReceivedQuantity ) . sum ( ) ;
signingTotal . getAndAdd ( packSignTotal ) ;
//异常签收数
int abnormalSignNum = loadscanEntityList . stream ( ) . filter ( l - > Func . equals ( l . getSignforState ( ) , LoadScanSigningStatusConstant . yiqianshou . getValue ( ) ) & & l . getIsAbnormalSigning ( ) = = 2 ) . mapToInt ( DistributionLoadscanEntity : : getReceivedQuantity ) . sum ( ) ;
if ( abnormalSignNum > 0 ) {
abnormalSignTotal . getAndAdd ( abnormalSignNum ) ;
}
}
if ( Func . isNotEmpty ( loadscaninvnEntityList ) ) {
int inventorySignTotal = loadscaninvnEntityList . stream ( ) . filter ( l - > Func . equals ( l . getSignforState ( ) , LoadScanSigningStatusConstant . yiqianshou . getValue ( ) ) ) . mapToInt ( DistributionLoadscaninvnEntity : : getReceivedQuantity ) . sum ( ) ;
signingTotal . getAndAdd ( inventorySignTotal ) ;
}
StringBuilder builder = new StringBuilder ( ) ;
builder . append ( signingTotal . get ( ) + "件" ) ;
if ( abnormalSignTotal . get ( ) > 0 ) {
builder . append ( "异常" ) . append ( abnormalSignTotal . get ( ) + "件" ) ;
}
if ( abnormalSignTotal . get ( ) = = 0 & & reservationNum = = signingTotal . get ( ) ) {
if ( reservationNum = = signingTotal . get ( ) ) {
//这里就是齐套
builder . setLength ( 0 ) ;
builder . append ( "齐套" ) ;
@ -1725,7 +1721,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscaninvnEntity . setScanUser ( user . getUserName ( ) ) ;
distributionLoadscaninvnEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
distributionLoadscaninvnEntity . setPackageNub ( inventory . get ( 0 ) . getNum ( ) ) ;
distributionLoadscaninvnEntity . setScanStatus ( LoadingStatusConstant . bulu zhuangche. getValue ( ) ) ;
distributionLoadscaninvnEntity . setScanStatus ( LoadingStatusConstant . yijian zhuangche. getValue ( ) ) ;
distributionLoadscaninvnEntity . setIsInsert ( LoadingIsInsertConstant . bulu . getValue ( ) ) ;
distributionLoadscaninvnEntity . setScanType ( "1" ) ;
distributionLoadscaninvnEntity . setType ( 2 ) ;
@ -2273,22 +2269,19 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// log.error("#############无图片信息:{}", map);
// return R.fail("无图片信息");
// }
log . info ( ">>>>>>>>>>> tag {}" , 1 ) ;
this . updatePicture ( distributionSignfor ) ;
log . info ( ">>>>>>>>>>> tag {}" , 2 ) ;
//2、维护状态
DistributionReservationEntity reservationEntity = distributionReservationMapper . selectById ( distributionSignfor . getReservationId ( ) ) ;
if ( Func . isEmpty ( reservationEntity ) ) {
log . error ( "#############reservationEntity参数错误:{}" , reservationEntity ) ;
return R . fail ( "服务器正忙~~" ) ;
}
log . info ( ">>>>>>>>>>> tag {}" , 3 ) ;
//查询数据
DistributionSignforEntity distributionSignforEntity = baseMapper . selectOne ( new QueryWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
) ;
log . info ( ">>>>>>>>>>> tag {}" , 3 ) ;
//获取计划配送用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper . selectById ( distributionSignfor . getDeliveryId ( ) ) ;
if ( Func . isEmpty ( distributionDeliveryListEntity ) ) {
@ -2310,7 +2303,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionDeliverySelfEntity = Func . copy ( distributionDeliveryTripartiteEntity , DistributionDeliverySelfEntity . class ) ;
// BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.SSS " ) ;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ;
if ( Func . equals ( distributionSignforEntity . getDriverSigning ( ) , SignforDriverSigningStatusConstant . yiqianshou . getValue ( ) ) ) {
@ -2318,7 +2311,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R . fail ( "签收失败" ) ;
}
BladeUser user = AuthUtil . getUser ( ) ;
log . info ( ">>>>>>>>>>> tag {}" , 6 ) ;
//处理库存品
//查询出该客户下的库存品信息
List < DisStockListDetailEntity > detailEntities = distributionReservationMapper . selectInventoryListByReservation ( distributionSignforEntity . getReservationId ( ) ) ;
@ -2382,7 +2374,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
newLoadscaninvnEntity . setScanUser ( user . getNickName ( ) ) ;
newLoadscaninvnEntity . setScanTime ( simpleDateFormat . format ( new Date ( ) ) ) ;
newLoadscaninvnEntity . setPackageNub ( detailEntity . getNum ( ) ) ;
newLoadscaninvnEntity . setScanStatus ( LoadingStatusConstant . bulu zhuangche. getValue ( ) ) ;
newLoadscaninvnEntity . setScanStatus ( LoadingStatusConstant . yijian zhuangche. getValue ( ) ) ;
newLoadscaninvnEntity . setIsInsert ( LoadingIsInsertConstant . bulu . getValue ( ) ) ;
newLoadscaninvnEntity . setScanType ( "1" ) ;
newLoadscaninvnEntity . setType ( 2 ) ;
@ -2417,7 +2409,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
} else {
log . error ( "################库存品未进行备货操作+{}" , detailEntities ) ;
log . error ( "################库存品未进行备货操作+{}" + detailEntities ) ;
return R . fail ( "库存品未进行备货操作" ) ;
}
}
@ -2426,7 +2418,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//包件不需要考虑备货、装车直接可进行签收 过滤已装车的包件
// List<DistributionParcelListEntity> noLoadingPackage = parcelListEntityList.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList());
//查询该客户下的所有零担信息
log . info ( ">>>>>>>>>>> tag {}" , 7 ) ;
List < DistributionParcelNumberDTO > parcelNumberEntityList = distributionReservationMapper . selectZeroPackageListByReservationId ( distributionSignforEntity . getReservationId ( ) ) ;
if ( Func . isNotEmpty ( parcelNumberEntityList ) ) {
for ( DistributionParcelNumberDTO parcelNumberEntity : parcelNumberEntityList ) {
@ -2527,7 +2518,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity . setDriverPhone ( distributionDeliverySelfEntity . getDriverPhone ( ) ) ;
}
loadscanEntity . setLoadingId ( distributionDeliverySelfEntity . getId ( ) . toString ( ) ) ;
loadscanEntity . setScanStatus ( LoadingStatusConstant . bulu zhuangche. getValue ( ) ) ;
loadscanEntity . setScanStatus ( LoadingStatusConstant . yijian zhuangche. getValue ( ) ) ;
loadscanEntity . setIsInsert ( LoadingIsInsertConstant . bulu . getValue ( ) ) ;
loadscanEntity . setScanType ( "1" ) ;
loadscanEntity . setType ( 2 ) ;
@ -2567,14 +2558,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
}
String signingTime = simpleDateFormat . format ( new Date ( ) ) ;
List < Long > packageIds = new ArrayList < > ( ) ;
List < String > packageCodes = new ArrayList < > ( ) ;
List < String > orderCodes = new ArrayList < > ( ) ;
log . info ( ">>>>>>>>>>> tag {}" , 8 ) ;
if ( Func . isNotEmpty ( parcelListEntityList ) ) {
for ( DistributionParcelListEntity parcelListEntity : parcelListEntityList ) {
String signingTime = simpleDateFormat . format ( new Date ( ) ) ;
//查询是否进行装车
DistributionLoadscanEntity loadscanEntities = distributionLoadscanService . getOne ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( )
. eq ( DistributionLoadscanEntity : : getPackageId , parcelListEntity . getId ( ) )
@ -2612,7 +2600,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity . setDriverPhone ( distributionDeliverySelfEntity . getDriverPhone ( ) ) ;
}
loadscanEntity . setLoadingId ( distributionDeliverySelfEntity . getId ( ) . toString ( ) ) ;
loadscanEntity . setScanStatus ( LoadingStatusConstant . bulu zhuangche. getValue ( ) ) ;
loadscanEntity . setScanStatus ( LoadingStatusConstant . yijian zhuangche. getValue ( ) ) ;
loadscanEntity . setIsInsert ( LoadingIsInsertConstant . bulu . getValue ( ) ) ;
loadscanEntity . setScanType ( "1" ) ;
loadscanEntity . setType ( 2 ) ;
@ -2663,7 +2651,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
distributionAsyncService . sendFactory ( parcelListEntity , signingTime , reservationEntity . getId ( ) , reservationEntity . getReservationCode ( ) , myCurrentWarehouse . getName ( ) ) ;
packageCodes . add ( parcelListEntity . getOrderPackageCode ( ) ) ;
packageIds . add ( parcelListEntity . getId ( ) ) ;
orderCodes . add ( parcelListEntity . getOrderCode ( ) ) ;
@ -2673,19 +2660,19 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
String orderCode = orderCodes . stream ( ) . distinct ( ) . collect ( Collectors . joining ( "," ) ) ;
distributionStockArticleService . maintenanceOrderInfo ( orderCode , myCurrentWarehouse . getId ( ) ) ;
}
if ( Func . isNotEmpty ( packageIds ) ) {
distributionAsyncService . handlPakcage ( packageIds , myCurrentWarehouse . getId ( ) ) ;
//批量推送
distributionAsyncService . sendReviewFactory ( distributionSignforEntity . getId ( ) , myCurrentWarehouse . getName ( ) , myCurrentWarehouse . getId ( ) ) ;
distributionAsyncService . sendReviewFactory ( distributionSignforEntity . getId ( ) , myCurrentWarehouse . getName ( ) , myCurrentWarehouse . getId ( ) ) ;
}
}
//维护客户信息状态
reservationEntity . setLoadingStatus ( ReservationLoadingStatusConstant . yizhuangche . getValue ( ) ) ;
reservationEntity . setSigningStatus ( ReservationSigningStatusConstant . yiqianshou . getValue ( ) ) ;
distributionReservationMapper . updateById ( reservationEntity ) ;
log . info ( ">>>>>>>>>>> tag {}" , 9 ) ;
//维护配送任务
distributionAsyncService . checkDeliverySignStatusByReservation ( distributionSignforEntity . getDeliveryId ( ) ) ;
distributionDeliveryListEntity . setDeliveryListLoadingStatus ( ReservationLoadingStatusConstant . yizhuangche . getValue ( ) ) ;
@ -2695,7 +2682,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionDeliveryListEntity . setDeliveryStatus ( DeliveryStatusConstant . yiwancheng . getValue ( ) ) ;
}
distributionDeliveryListMapper . updateById ( distributionDeliveryListEntity ) ;
log . info ( ">>>>>>>>>>> tag {}" , 10 ) ;
LambdaUpdateWrapper < DistributionSignforEntity > set = new UpdateWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getId , distributionSignforEntity . getId ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getDeliverySignPictures ( ) ) , DistributionSignforEntity : : getDeliverySignPictures , distributionSignfor . getDeliverySignPictures ( ) )
@ -2712,7 +2698,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
. set ( ! distributionSignfor . getIsClerk ( ) , DistributionSignforEntity : : getSjsigningTime , simpleDateFormat . format ( new Date ( ) ) ) ;
boolean update = this . update ( set ) ;
return R . data ( packageCodes ) ;
return R . status ( true ) ;
}
@ -2947,34 +2933,28 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//这里就需要进行该客户的异常包件列表进行查询
List < DistributionLoadscanAbnormalVO > loadscanAbnormalVOS = baseMapper . selectAbnormalPackageList ( signforEntity . getReservationId ( ) , signforEntity . getDeliveryId ( ) ) ;
loadscanAbnormalVOS . forEach ( p - > {
// switch (p.getOrderPackageStatus()) {
// case "10":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.weiruku.getName());
// break;
// case "20":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.yiruku.getName());
// break;
// case "30":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.zhongzhuanruku.getName());
// break;
// case "40":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.zhiliu.getName());
// break;
//// case "50":
//// p.setOrderPackageStatusName(OrderPackageStatusConstant.yichuku.getName());
//// break;
// case "60":
switch ( p . getOrderPackageStatus ( ) ) {
case "10" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . weiruku . getName ( ) ) ;
break ;
case "20" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . yiruku . getName ( ) ) ;
break ;
case "30" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . zhongzhuanruku . getName ( ) ) ;
break ;
case "40" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . zhiliu . getName ( ) ) ;
break ;
// case "50":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.yichuku.getName());
// break;
// case "70":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.yiqianshou.getName());
// break;
// }
if ( p . getOrderPackageStatus ( ) . equals ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ) {
p . setOrderPackageStatusName ( OrderPackageStatusConstant . yiqianshou . getName ( ) ) ;
} else {
p . setOrderPackageStatusName ( "未签收" ) ;
case "60" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . yichuku . getName ( ) ) ;
break ;
case "70" :
p . setOrderPackageStatusName ( OrderPackageStatusConstant . yiqianshou . getName ( ) ) ;
break ;
}
switch ( p . getOrderPackageFreezeStatus ( ) ) {
case "10" :
@ -3028,7 +3008,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// ------------------------------------2023-09-27 异常装车包件审核----------------------------------------------
// 思路:
//
List < Long > longs = Func . toLongList ( ids ) ;
List < DistributionLoadscanAbnormalEntity > distributionLoadscanAbnormalEntities = distributionLoadscanAbnormalService . listByIds ( longs ) ;
if ( Func . isEmpty ( distributionLoadscanAbnormalEntities ) ) {
@ -3076,7 +3055,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionParcelListService . updateById ( parcelListEntity ) ;
distributionLoadscanAbnormalEntity . setAuditingStatus ( 2 ) ;
distributionLoadscanAbnormalEntity . setAuditingTime ( new Date ( ) ) ;
distributionLoadscanAbnormalEntity . setAuditingUser ( AuthUtil . getUser ( ) . getNick Name ( ) ) ;
distributionLoadscanAbnormalEntity . setAuditingUser ( AuthUtil . getUser ( ) . getUser Name ( ) ) ;
distributionLoadscanAbnormalService . updateById ( distributionLoadscanAbnormalEntity ) ;
reservationEntity . setReservationNum ( reservationEntity . getReservationNum ( ) + distributionLoadscanAbnormalEntity . getLoadingQuantity ( ) ) ;
distributionReservationMapper . updateById ( reservationEntity ) ;