@ -97,26 +97,25 @@ public class StockOrderDetailController {
List < StockOrderDetailEntity > stockOrderDetailEntityList
= stockOrderDetailService . filterStockOrderDetail ( stockOrderDetailFilterRequest ) ;
//计算实际数量
if ( CollUtil . isNotEmpty ( stockOrderDetailEntityList ) ) {
List < WarehouseEntity > codeList = codesService . findByReceiptId ( stockOrderEntity . getOrderIdFk ( ) ) ;
if ( CollUtil . isNotEmpty ( codeList ) ) {
stockOrderDetailEntityList . forEach ( stockOrderDetailEntity - > {
codeList . forEach ( codeEntity - > {
if ( StrUtil . trimToEmpty ( codeEntity . getRelId ( ) ) . equals ( StrUtil . trimToEmpty ( stockOrderDetailEntity . getRelId ( ) ) ) & & ( StrUtil . trimToEmpty ( codeEntity . getBatchNo ( ) ) . equals ( StrUtil . trimToEmpty ( stockOrderDetailEntity . getBatchNo ( ) ) ) ) ) {
int actCount = udiRelevanceService . getActCountByRelIdAndNameCode ( stockOrderDetailEntity . getRelId ( ) , codeEntity . getNameCode ( ) ) ;
stockOrderDetailEntity . setReCount ( String . valueOf ( codeEntity . getCount ( ) * actCount ) ) ;
}
} ) ;
} ) ;
}
}
// //计算实际数量
// if (CollUtil.isNotEmpty(stockOrderDetailEntityList)) {
// List<WarehouseEntity> codeList = codesService.findByReceiptId(stockOrderEntity.getOrderIdFk());
// if (CollUtil.isNotEmpty(codeList)) {
// stockOrderDetailEntityList.forEach(stockOrderDetailEntity -> {
// codeList.forEach(codeEntity -> {
// if (StrUtil.trimToEmpty(codeEntity.getRelId()).equals(StrUtil.trimToEmpty(stockOrderDetailEntity.getRelId())) && (StrUtil.trimToEmpty(codeEntity.getBatchNo()).equals(StrUtil.trimToEmpty(stockOrderDetailEntity.getBatchNo())))) {
// int actCount = udiRelevanceService.getActCountByRelIdAndNameCode(stockOrderDetailEntity.getRelId(), codeEntity.getNameCode());
// stockOrderDetailEntity.setReCount(String.valueOf(codeEntity.getCount() * actCount));
// }
// });
//
// });
// }
//
// }
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService . findBTByAction ( stockOrderEntity . getBillType ( ) ) ;
if ( bussinessLocalTypeEntity . getOrderVisibleType ( ) = = 1 & & ( stockOrderEntity . getStatus ( ) . equals ( "4" ) | | stockOrderEntity . getStatus ( ) . equals ( "5" ) ) ) {
stockOrderDetailEntityList = transferSerList ( stockOrderDetailEntityList , stockOrderEntity . getOrderIdFk ( ) ) ;
}
@ -146,10 +145,10 @@ public class StockOrderDetailController {
item . setCodeId ( codeDetaiEntity . getId ( ) . intValue ( ) ) ;
item . setSerialNo ( codeDetaiEntity . getSerialNo ( ) ) ;
item . setCount ( codeDetaiEntity . getCount ( ) + "" ) ;
//item.setReCount(codeDetaiEntity.getCount() + "");
item . setReCount ( codeDetaiEntity . getCount ( ) + "" ) ;
//计算实际数量
int actCount = udiRelevanceService . getActCountByRelIdAndNameCode ( codeDetaiEntity . getRelId ( ) , codeDetaiEntity . getNameCode ( ) ) ;
item . setReCount ( String . valueOf ( codeDetaiEntity . getCount ( ) * actCount ) ) ;
// int actCount = udiRelevanceService.getActCountByRelIdAndNameCode(codeDetaiEntity.getRelId(), codeDetaiEntity.getNameCode());
// item.setReCount(String.valueOf(codeDetaiEntity.getCount() * actCount));
resultList . add ( item ) ;
}
@ -159,7 +158,9 @@ public class StockOrderDetailController {
}
}
Collections . sort ( resultList , ( o1 , o2 ) - > {
Integer cp = o1 . getCodeId ( ) - o2 . getCodeId ( ) ;
String o1Str = o1 . getProductName ( ) + o1 . getSpec ( ) + o1 . getBatchNo ( ) + o1 . getSerialNo ( ) ;
String o2Str = o2 . getProductName ( ) + o2 . getSpec ( ) + o2 . getBatchNo ( ) + o1 . getSerialNo ( ) ;
Integer cp = o1Str . compareTo ( o2Str ) ;
return cp ;
} ) ;