提交 b9db508d authored 作者: zhoushaopan's avatar zhoushaopan

feat(装备模块,盘存模块): 新增了返回库房,以及状态的过滤

新增了返回库房,以及状态的过滤
上级 5bb2528c
...@@ -22,6 +22,7 @@ import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo; ...@@ -22,6 +22,7 @@ import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO; import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import com.tykj.dev.device.library.subject.vo.*; import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.library.utils.DeviceNumberUtils; import com.tykj.dev.device.library.utils.DeviceNumberUtils;
import com.tykj.dev.device.user.cache.StoreCache;
import com.tykj.dev.device.user.cache.UnitsCache; import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
...@@ -93,6 +94,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -93,6 +94,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Resource @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; private DeviceLibraryPositionService deviceLibraryPositionService;
@Resource
private StoreCache storeCache;
@Override @Override
@UpdateCache @UpdateCache
public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) { public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) {
...@@ -1304,13 +1308,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1304,13 +1308,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo(); DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
BeanUtils.copyProperties(queryTheWarehouseVo,deviceLibrarySelectVo); BeanUtils.copyProperties(queryTheWarehouseVo,deviceLibrarySelectVo);
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
// Specification<DeviceLibrary> or = null;
// if (deviceLibrarySelectVo.getNonStorageLocationId()!=null){
//
// or = predicateBuilder.build().or(getPredicateBuilder2(deviceLibrarySelectVo).build());
// }else {
// or = predicateBuilder.build();
// }
StopWatch stopWatch = new StopWatch("条件查询结果集"); StopWatch stopWatch = new StopWatch("条件查询结果集");
stopWatch.start(); stopWatch.start();
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build()); List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build());
...@@ -1376,11 +1373,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1376,11 +1373,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
collect.stream().map(DeviceLibrary::getName).distinct().collect(Collectors.toList()); collect.stream().map(DeviceLibrary::getName).distinct().collect(Collectors.toList());
List<String> ownUnits = List<String> ownUnits =
collect.stream().map(DeviceLibrary::getOwnUnit).distinct().collect(Collectors.toList()); collect.stream().map(DeviceLibrary::getOwnUnit).distinct().collect(Collectors.toList());
List<Integer> storageLocationIds = collect.stream().map(DeviceLibrary::getStorageLocationId).distinct().collect(Collectors.toList());
Map<Integer, String> idMap = storeCache.getIdMap();
map.put("allVOPage",allVOPage); map.put("allVOPage",allVOPage);
map.put("models",models); map.put("models",models);
map.put("seqNumberList",seqNumberList); map.put("seqNumberList",seqNumberList);
map.put("names",names); map.put("names",names);
map.put("ownUnits",ownUnits); map.put("ownUnits",ownUnits);
map.put("storageLocation",storageLocationIds.stream().map(integer -> new StorageLocationVo(integer,idMap.getOrDefault(integer,null)))
.collect(Collectors.toList()));
return map; return map;
} }
......
...@@ -106,9 +106,11 @@ public class WarehouseInspectionServiceImpl implements WarehouseInspectionServic ...@@ -106,9 +106,11 @@ public class WarehouseInspectionServiceImpl implements WarehouseInspectionServic
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and(); PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.eq("ownUnit",currentUserUnitName); predicateBuilder.eq("ownUnit",currentUserUnitName);
predicateBuilder.eq("locationUnit",currentUserUnitName); predicateBuilder.eq("locationUnit",currentUserUnitName);
List<Integer> statusList = new ArrayList<>(Arrays.asList(5,11,12));
List<DeviceLibrary> allDevices = deviceLibraryService.findAllDevices().stream() List<DeviceLibrary> allDevices = deviceLibraryService.findAllDevices().stream()
.filter(deviceLibrary -> deviceLibrary.getOwnUnit().equals(currentUserUnitName) .filter(deviceLibrary -> deviceLibrary.getOwnUnit().equals(currentUserUnitName)
&& deviceLibrary.getLocationUnit().equals(currentUserUnitName)).collect(Collectors.toList()); && deviceLibrary.getLocationUnit().equals(currentUserUnitName)
&& !statusList.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList());
allDevices.forEach(deviceLibrary -> deviceLibrary.setStatus(0)); allDevices.forEach(deviceLibrary -> deviceLibrary.setStatus(0));
return allDevices; return allDevices;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论