@ -620,7 +620,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
boolean save = this . save ( taskQuest ) ;
// 存入子表 todo 暂时不要商场
if ( ! taskQuest . getList ( ) . isEmpty ( ) ) {
List < TaskQuestChildEntity > list = taskQuest . getList ( ) ;
for ( TaskQuestChildEntity taskQuestChildEntity : list ) {
@ -671,7 +670,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
. eq ( TaskQuestChildEntity : : getQuestId , id )
) ;
//存入子表
if ( taskQuest . getList ( ) . size ( ) > 0 ) {
if ( ! taskQuest . getList ( ) . isEmpty ( ) ) {
List < TaskQuestChildEntity > list = taskQuest . getList ( ) ;
for ( TaskQuestChildEntity taskQuestChildEntity : list ) {
taskQuestChildEntity . setWarehouseId ( id ) ;
@ -1036,7 +1035,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailDTO . stream ( ) . collect ( Collectors . groupingBy ( QuestDetailDTO : : getQuestNum ) ) . forEach ( ( k , v ) - > {
List < QuestDetailEntity > list = new ArrayList < > ( ) ;
v . stream ( ) . forEach ( i - > {
v . forEach ( i - > {
if ( ObjectUtils . isNotNull ( i . getQuestId ( ) ) ) {
QuestDetailEntity questDetail = new QuestDetailEntity ( ) ;
BeanUtil . copyProperties ( i , questDetail ) ;
@ -1158,16 +1157,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
q . setCustomerName ( entityByStockArticle . getCustomerName ( ) ) ;
q . setMaterialName ( entityByStockArticle . getDescriptionGoods ( ) ) ;
v . stream ( ) . forEach ( i - > {
switch ( i . getQuestStatus ( ) ) {
case 1 :
yi . updateAndGet ( v1 - > v1 + 1 ) ;
q . setQuestStatusName ( "部分盘点" ) ;
User user = UserCache . getUser ( i . getUpdateUser ( ) ) ;
q . setUpdateUser ( user . getAccount ( ) ) ;
q . setUpdateTime ( i . getUpdateTime ( ) ) ;
break ;
}
v . forEach ( i - > {
if ( i . getQuestStatus ( ) = = 1 ) {
yi . updateAndGet ( v1 - > v1 + 1 ) ;
q . setQuestStatusName ( "部分盘点" ) ;
User user = UserCache . getUser ( i . getUpdateUser ( ) ) ;
q . setUpdateUser ( user . getAccount ( ) ) ;
q . setUpdateTime ( i . getUpdateTime ( ) ) ;
}
q . setOrderCode ( i . getOrderCode ( ) ) ;
if ( ObjectUtils . isNull ( i . getGroundingPositionCode ( ) ) ) {
q . setGroundingPositionCode ( "无更新" ) ;
@ -1335,7 +1332,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
BladeUser user = AuthUtil . getUser ( ) ;
if ( ObjectUtils . isNotNull ( questDetailDTO ) ) {
questDetailDTO . stream ( ) . forEach ( i - > {
questDetailDTO . forEach ( i - > {
if ( i . getStockNum ( ) > 0 | | i . getWornNum ( ) > 0 | | i . getLossNum ( ) > 0 | | i . getNoRepairNum ( ) > 0 | | i . getDeliveNum ( ) > 0 | | i . getNoReceivedNum ( ) > 0 ) {
//添加
List < QuestDetailChildEntity > childList = new ArrayList < > ( ) ;
@ -1535,6 +1532,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
* @return
* /
public R getAllocationInfo ( TaskSearchDTO taskSearchDTO ) {
BladeUser user = AuthUtil . getUser ( ) ;
// List<TaskDataVO> lists = new ArrayList<>();
TaskDataVO taskDataVO = new TaskDataVO ( ) ;
String questNum = taskSearchDTO . getQuestNum ( ) ;
@ -1547,7 +1545,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail . setAllocationId ( code ) ;
List < QuestDetailEntity > questDetailEntities = baseMapper . selectTaskInfo ( questNum , questDetail ) ;
if ( ObjectUtils . isNull ( questDetailEntities ) ) {
return R . success ( "没有数据!!" ) ;
// 查询业务系统 这个货位上数据
List < PackageListVO > packageDetailList = warehouseUpdownGoodsMapper . findPackageDetailList ( taskSearchDTO . getAllocationId ( ) , taskSearchDTO . getWarehouseId ( ) ) ;
for ( PackageListVO packageListVO : packageDetailList ) {
List < DistributionParcelListEntity > byPacketBarCode = distributionParcelListClient . findByPacketBarCode ( packageListVO . getOrderPackageCode ( ) ) ;
for ( DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode ) {
if ( distributionParcelListEntity . getWarehouseId ( ) . equals ( taskSearchDTO . getWarehouseId ( ) ) ) {
QuestDetailEntity questDetailEntity = buildQuestDetailEntity ( taskSearchDTO . getQuestId ( ) , distributionParcelListEntity , user , null ) ;
questDetailEntities . add ( questDetailEntity ) ;
baseMapper . insertQuestDetail ( taskSearchDTO . getQuestNum ( ) , questDetailEntities ) ;
}
}
}
}
List < TaskPackagelistVO > list = new ArrayList < > ( ) ;
for ( QuestDetailEntity questDetailEntity : questDetailEntities ) {
@ -1565,13 +1578,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if ( questDetailEntity . getHasData ( ) . equals ( 0 ) ) {
continue ;
}
//查询包件信息
// DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
// distributionParcelList.setId(questDetailEntity.getOrderPackageId());
// List<DistributionParcelListEntity> parcelList = distributionParcelListClient.getParcelList(distributionParcelList);
// if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
// continue;
// }
} else {
//没有
@ -1666,14 +1672,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
baseMapper . insertQuestDetail ( taskSearchDTO . getQuestNum ( ) , list1 ) ;
// return taskPageList.setRecords(list);
questDetailEntityList = list1 ;
}
}
}
Map < Integer , List < QuestDetailEntity > > questDetailMap = questDetailEntityList . stream ( ) . collect ( Collectors . groupingBy ( QuestDetailEntity : : getQuestTarget ) ) ;
//订制品
@ -1902,7 +1902,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
taskDataVO . setDataId ( Long . valueOf ( k ) ) ; //托盘ID
AtomicReference < Integer > num = new AtomicReference < > ( 0 ) ; //总数
AtomicReference < Integer > unTotal = new AtomicReference < > ( 0 ) ; //盘点数
// List<QuestDetailVO> detailVOS = new ArrayList<>();
for ( QuestDetailEntity p : v ) {
taskDataVO . setDataCode ( p . getTrayCode ( ) ) ; //托盘ID
@ -1918,11 +1917,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if ( p . getHasData ( ) . equals ( 0 ) ) { //去除零担数据
continue ;
}
//查询包件信息
// DistributionParcelListEntity byPacketBarCode = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(p.getOrderPackageCode(),warehouseId);
// if(ObjectUtils.isNull(byPacketBarCode)){ //去除没有用包件的数据
// continue;
// }
packagelistVO . setQuestDetailId ( p . getId ( ) ) ;
packagelistVO . setState ( String . valueOf ( p . getQuestTarget ( ) ) ) ;
packagelistVO . setOrderPackageCode ( p . getOrderPackageCode ( ) ) ;
@ -1944,26 +1938,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
packagelistVO . setQuestChildVOList ( questDetailChildEntities ) ;
}
taskPackagelistVOS . add ( packagelistVO ) ;
// TaskQuestEntity taskQuestEntity = baseMapper.selectById(p.getQuestId());
// num.set(num.get() + p.getStockNum());
// if(p.getQuestStatus().equals(1) && p.getIsNew().equals(0)){
// QuestDetailChildEntity questDetailChildEntity = new QuestDetailChildEntity();
// questDetailChildEntity.setQuestDetailId(p.getId());
// questDetailChildEntity.setWarehouseId(warehouseId);
// List<QuestDetailChildEntity> list = getQuestDetailInfo(taskQuestEntity.getQuestNum()+"_child",questDetailChildEntity);
// if(!list.isEmpty()){
// int sum = list.stream().filter(i ->i.getCargoName().equals("10")).mapToInt(QuestDetailChildEntity::getQuestNum).sum();
//
// }else{
// throw new ServiceException("未找到对应的处理数据!!");
// }
// }
}
;
taskDataVO . setList ( taskPackagelistVOS ) ;
// taskDataVO.setTotal(num.get());
// taskDataVO.setUnTotal(unTotal.get());
} ) ;
return taskDataVO ;
}