@ -377,17 +377,25 @@ public class DistributionStockArticleController extends BladeController {
@ApiOperationSupport ( order = 5 )
@ApiOperationSupport ( order = 5 )
@ApiOperation ( value = "修改" , notes = "传入distributionStockArticle" )
@ApiOperation ( value = "修改" , notes = "传入distributionStockArticle" )
public R updateBatchClient ( @Valid @RequestBody DistributionStockArticleDTO distributionStockArticleDTO ) {
public R updateBatchClient ( @Valid @RequestBody DistributionStockArticleDTO distributionStockArticleDTO ) {
// 获取勾选的需要修改的订单信息
List < Long > ids = distributionStockArticleDTO . getEntityList ( ) . stream ( ) . map ( DistributionStockArticleEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
// 查询这个订单集合的预约状态
List < DistributionStockArticleEntity > realStockArticleList = distributionStockArticleService . listByIds ( ids ) ;
List < DistributionStockArticleEntity > entityList = distributionStockArticleDTO . getEntityList ( ) ;
List < DistributionStockArticleEntity > entityList = distributionStockArticleDTO . getEntityList ( ) ;
if ( ! entityList . isEmpty ( ) ) {
if ( ! realStockArticle List. isEmpty ( ) ) {
boolean flag = entityList . stream ( ) . anyMatch ( a - > ! OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) . equals ( a . getReservationStatus ( ) ) ) ;
boolean flag = realStockArticle List. stream ( ) . anyMatch ( a - > ! OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) . equals ( a . getReservationStatus ( ) ) ) ;
if ( flag ) {
if ( flag ) {
String orderCode = entityList . stream ( ) . filter ( f - > ! OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) . equals ( f . getReservationStatus ( ) ) ) . map ( DistributionStockArticleEntity : : getOrderCode ) . distinct ( ) . collect ( Collectors . joining ( "," ) ) ;
String orderCode = realStockArticle List. stream ( ) . filter ( f - > ! OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) . equals ( f . getReservationStatus ( ) ) ) . map ( DistributionStockArticleEntity : : getOrderCode ) . distinct ( ) . collect ( Collectors . joining ( "," ) ) ;
return R . fail ( orderCode + "存在预约信息" ) ;
return R . fail ( orderCode + "存在预约信息" ) ;
}
}
}
}
for ( DistributionStockArticleEntity stockArticleEntity : entityList ) {
for ( DistributionStockArticleEntity stockArticleEntity : entityList ) {
Long id = stockArticleEntity . getId ( ) ;
Long id = stockArticleEntity . getId ( ) ;
DistributionStockArticleEntity oldStockArticle = distributionStockArticleService . getBy Id ( id ) ;
DistributionStockArticleEntity oldStockArticle = realStockArticleList . stream ( ) . filter ( f - > f . getId ( ) . equals ( id ) ) . findFirst ( ) . orElse ( null ) ;
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity ( ) ;
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity ( ) ;
BeanUtil . copy ( oldStockArticle , newStockArticle ) ;
BeanUtil . copy ( oldStockArticle , newStockArticle ) ;
String consigneePerson = stockArticleEntity . getConsigneePerson ( ) ;
String consigneePerson = stockArticleEntity . getConsigneePerson ( ) ;