@ -53,6 +53,7 @@ import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant ;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant ;
import org.springblade.common.constant.RabbitConstant ;
import org.springblade.common.constant.billLading.BillLadingStatusConstant ;
import org.springblade.common.constant.common.IsOrNoConstant ;
import org.springblade.common.constant.delivery.DeliveryStatusConstant ;
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant ;
@ -78,6 +79,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func ;
import org.springblade.core.tool.utils.ObjectUtil ;
import org.springblade.system.cache.DictBizCache ;
import org.springblade.system.entity.User ;
import org.springblade.system.feign.IDictBizClient ;
import org.springblade.system.feign.IUserClient ;
import org.springframework.amqp.rabbit.core.RabbitTemplate ;
@ -186,6 +188,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Lazy
private IDistrilbutionBillLadingService distrilbutionBillLadingService ;
@Autowired
@Lazy
private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper ;
@Autowired
@Lazy
private IDistributionBillLadingScanService distributionBillLadingScanService ;
@Autowired
private RabbitTemplate rabbitTemplate ;
@Autowired
@ -828,10 +836,51 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
billLadingNodeVo . setNodeInfo ( "计划自提" + billLadingNum + "件" ) ;
nodeVos . add ( billLadingNodeVo ) ;
//查询自提扫描数量
Integer loadingNum = distrilbutionBillLadingMapper . selectBillLadingLoading ( distrilbutionBillLadingEntity . getId ( ) ) ;
if ( loadingNum > 0 ) {
StringBuilder sb = new StringBuilder ( ) ;
//存在装车环境,进行数量的比对
DeliveryNodeVo middleBillLadingNodeVo = new DeliveryNodeVo ( ) ;
middleBillLadingNodeVo . setNodeName ( BillLadingNode . qianshouzhong . getName ( ) ) ;
if ( loadingNum = = billLadingNum ) {
middleBillLadingNodeVo . setNodeName ( BillLadingNode . qianshouwancheng . getName ( ) ) ;
}
//自提签收的操作人
List < DistributionBillLadingScanEntity > distributionBillLadingScanEntityList = distributionBillLadingScanService . list ( Wrappers . < DistributionBillLadingScanEntity > query ( ) . lambda ( )
. eq ( DistributionBillLadingScanEntity : : getBillLadingId , distrilbutionBillLadingEntity . getId ( ) )
) ;
if ( Func . isNotEmpty ( distributionBillLadingScanEntityList ) ) {
List < Long > userIds = distributionBillLadingScanEntityList . stream ( ) . map ( DistributionBillLadingScanEntity : : getCreateUser ) . collect ( Collectors . toList ( ) ) ;
if ( Func . isNotEmpty ( userIds ) ) {
//查询用户
for ( Long userId : userIds ) {
R < User > userR = userClient . userInfoById ( userId ) ;
if ( Func . isNotEmpty ( userR ) ) {
sb . append ( userR . getData ( ) . getName ( ) + "," ) ;
}
}
}
//取操作节点最后结束时间
List < Date > collect = distributionBillLadingScanEntityList . stream ( ) . map ( DistributionBillLadingScanEntity : : getCreateTime ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
Date max = Collections . max ( collect ) ;
middleBillLadingNodeVo . setTime ( max ) ;
middleBillLadingNodeVo . setNodeUserName ( sb . delete ( sb . length ( ) - 1 , sb . length ( ) ) . toString ( ) ) ;
middleBillLadingNodeVo . setNodeInfo ( "计划自提" + billLadingNum + "件," + "装车" + loadingNum + "件" ) ;
nodeVos . add ( middleBillLadingNodeVo ) ;
}
if ( distrilbutionBillLadingEntity . getConditions ( ) . equals ( BillLadingStatusConstant . yiqianshou . getValue ( ) ) ) {
//文员完成确动作
DeliveryNodeVo endBillLadingNodeVo = new DeliveryNodeVo ( ) ;
endBillLadingNodeVo . setNodeName ( BillLadingNode . yiwancheng . getName ( ) ) ;
endBillLadingNodeVo . setTime ( distrilbutionBillLadingEntity . getUpdateTime ( ) ) ;
String endUserName = userClient . userInfoById ( distrilbutionBillLadingEntity . getUpdateUser ( ) ) . getData ( ) . getName ( ) ;
endBillLadingNodeVo . setNodeUserName ( endUserName ) ;
endBillLadingNodeVo . setNodeInfo ( "计划自提" + billLadingNum + "件," + "签收" + loadingNum + "件" ) ;
nodeVos . add ( endBillLadingNodeVo ) ;
}
}
} catch ( Exception e ) {
throw new RuntimeException ( e ) ;
}
return nodeVos ;