Commit 7de555d2 zshaohui

1.虚拟仓设备和库位展示bug修改

1 个父辈 d9d16f41
......@@ -6,10 +6,7 @@ import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.csv.CsvReader;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.PointUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.*;
import com.neotel.smfcore.core.barcode.enums.BARCODE_SOURCE;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
......@@ -88,9 +85,8 @@ public class StorageController {
@GetMapping
@PreAuthorize("@el.check('storage:list')")
public PageData<StorageDto> query(StorageQueryCriteria criteria, Pageable pageable){
List<String> storageIdList = new ArrayList<>();
Collection<Storage> storages = dataCache.getAllStorage().values();
String pageType = criteria.getPageType();
/*List<String> storageIdList = new ArrayList<>();
for (Storage storage : storages) {
if (BARCODE_SOURCE.VIRTUAL.equals(pageType)){
if (!storage.isVirtual()){
......@@ -103,8 +99,30 @@ public class StorageController {
}
storageIdList.add(storage.getId());
}
criteria.setStorageIdList(storageIdList);
Query query= QueryHelp.getQuery(criteria);
criteria.setStorageIdList(storageIdList);*/
Query query = QueryHelp.getQuery(criteria);
List<String> storageIdList = criteria.getStorageIdList();
if (storageIdList == null || storageIdList.isEmpty()) {
List<String> notFindStorageId = new ArrayList<>();
Collection<Storage> storages = dataCache.getAllStorage().values();
String pageType = criteria.getPageType();
for (Storage storage : storages) {
if (BARCODE_SOURCE.VIRTUAL.equals(pageType)) {
if (!storage.isVirtual()) {
notFindStorageId.add(storage.getId());
}
} else {
if (storage.isVirtual()) {
notFindStorageId.add(storage.getId());
}
}
}
if (!notFindStorageId.isEmpty()) {
query.addCriteria(Criteria.where("id").nin(notFindStorageId));
}
}
PageData<Storage> pages=storageManager.findByPage(query,pageable);
List<StorageDto> StorageDtos=storageMapper.toDto(pages.getContent());
StorageDtos=updateDtos(StorageDtos);
......@@ -179,8 +197,7 @@ public class StorageController {
List<Storage> allStorages = storageManager.findAll();
List<Storage> myStorages = new ArrayList<>();
for (Storage s : allStorages
) {
for (Storage s : allStorages) {
if (BARCODE_SOURCE.VIRTUAL.equals(type)){
if (!s.isVirtual()){
continue;
......@@ -190,8 +207,9 @@ public class StorageController {
continue;
}
}
if (mygroups != null && !mygroups.isEmpty()) {
if (mygroups.contains(s.getGroupId())) {
String storageGroupId = s.getGroupId();
if (StringUtils.isNotEmpty(storageGroupId)){
if (mygroups.contains(storageGroupId)) {
myStorages.add(s);
}
} else {
......
......@@ -84,44 +84,38 @@ public class StoragePosController {
@GetMapping
@PreAuthorize("@el.check('storagePos:list')")
public PageData<StoragePosDto> query(StoragePosQueryCriteria criteria, Pageable pageable) {
// if(criteria.getBlurry().startsWith("test1")){
// String mid=criteria.getBlurry().replace("test1","");
// SiemensApi.getMaterialLot(1,"1","storage1",mid);
// }else if(criteria.getBlurry().startsWith("test2")){
// String mid=criteria.getBlurry().replace("test2","");
// SiemensApi.processMaterialLot(1,"1","storage1",mid);
// }
// SiemensApi.getMaterialLot(1,"1","aaa","maid");
if (criteria.getStorageIdList() != null && criteria.getStorageIdList().contains("0")) {
criteria.setStorageIdList(null);
}
List<String> storageIdList = new ArrayList<>();
List<String> groupStorageIdList = QueryHelp.getGroupStorageIdList(criteria.getStorageIdList());
if (groupStorageIdList != null && !groupStorageIdList.isEmpty()){
for (String groupId : groupStorageIdList) {
Storage storage = dataCache.getStorageById(groupId);
if (BARCODE_SOURCE.VIRTUAL.equals(criteria.getType())){
if (storage.isVirtual()){
storageIdList.add(groupId);
}
} else {
if (!storage.isVirtual()){
storageIdList.add(groupId);
}
}
}
}
criteria.setStorageIdList(storageIdList);
String blurry = criteria.getBlurry();
if(!Strings.isNullOrEmpty(blurry)){
//去除库位中的SOxxxx
blurry = blurry.substring(blurry.indexOf("-")+1);
criteria.setBlurry(blurry);
}
Query query = QueryHelp.getQuery(criteria);
List<String> storageIdList = criteria.getStorageIdList();
if (storageIdList == null || storageIdList.isEmpty()) {
List<String> notFindStorageId = new ArrayList<>();
Collection<Storage> storages = dataCache.getAllStorage().values();
String pageType = criteria.getType();
for (Storage storage : storages) {
if (BARCODE_SOURCE.VIRTUAL.equals(pageType)) {
if (!storage.isVirtual()) {
notFindStorageId.add(storage.getId());
}
} else {
if (storage.isVirtual()) {
notFindStorageId.add(storage.getId());
}
}
}
if (!notFindStorageId.isEmpty()) {
query.addCriteria(Criteria.where("storageId").nin(notFindStorageId));
}
}
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!