|
|
@ -160,18 +160,7 @@ public class MaterialController { |
|
|
isadmin = 1; |
|
|
isadmin = 1; |
|
|
} |
|
|
} |
|
|
if (isadmin != 4 && Integer.compare(userToken.getMaindeparment(), 361) != 0) { |
|
|
if (isadmin != 4 && Integer.compare(userToken.getMaindeparment(), 361) != 0) { |
|
|
// 查询当前用户管理的仓库
|
|
|
List<Integer> didList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); |
|
|
|
|
|
// 查询当前用户部门拥有的仓库
|
|
|
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
|
|
|
// 定义仓库编号列表
|
|
|
|
|
|
List<Integer> didList = new ArrayList<>(); |
|
|
|
|
|
for (RoleAndDepository andDepository : depositoryAndRole) { |
|
|
|
|
|
didList.add(andDepository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (Depository value : depositoryByAdminorg) { |
|
|
|
|
|
didList.add(value.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
map.put("depositoryIds", didList); |
|
|
map.put("depositoryIds", didList); |
|
|
|
|
|
|
|
|
@ -423,10 +412,6 @@ public class MaterialController { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
// 获取当前部门仓库
|
|
|
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
|
|
|
// 查询当前用户管理的仓库
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
String code = map.get("code").toString(); |
|
|
String code = map.get("code").toString(); |
|
|
@ -439,17 +424,8 @@ public class MaterialController { |
|
|
List<InventoryP> inventoryPByCondition = new ArrayList<>(); |
|
|
List<InventoryP> inventoryPByCondition = new ArrayList<>(); |
|
|
param.put("mcode", code); |
|
|
param.put("mcode", code); |
|
|
|
|
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
for (Depository depository : depositoryByAdminorg |
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
) { |
|
|
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (RoleAndDepository rad : depositoryAndRole |
|
|
|
|
|
) { |
|
|
|
|
|
if (!depositoryIdList.contains(rad.getDepositoryId())) { |
|
|
|
|
|
depositoryIdList.add(rad.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 获取该用户额外可见的仓库
|
|
|
// 获取该用户额外可见的仓库
|
|
|
List<Integer> tempDepositoryIdlist = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
List<Integer> tempDepositoryIdlist = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
depositoryIdList= (List<Integer>) CollectionUtils.union(tempDepositoryIdlist,depositoryIdList); |
|
|
depositoryIdList= (List<Integer>) CollectionUtils.union(tempDepositoryIdlist,depositoryIdList); |
|
|
@ -534,20 +510,9 @@ public class MaterialController { |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
// 查询当前用于部门的仓库
|
|
|
// 查询当前用于部门的仓库
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
// 查询当前用户管理的仓库
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); |
|
|
|
|
|
List<InventoryP> inventoryPList = new ArrayList<>(); |
|
|
List<InventoryP> inventoryPList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
for (Depository depository : depositoryByAdminorg |
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
) { |
|
|
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (RoleAndDepository rad : depositoryAndRole |
|
|
|
|
|
) { |
|
|
|
|
|
if (!depositoryIdList.contains(rad.getDepositoryId())) { |
|
|
|
|
|
depositoryIdList.add(rad.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Integer> tempDepositoryIDList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
List<Integer> tempDepositoryIDList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(tempDepositoryIDList,depositoryIdList); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(tempDepositoryIDList,depositoryIdList); |
|
|
@ -650,15 +615,23 @@ public class MaterialController { |
|
|
String key = "WMS_temporaryValue_" + type + userByPort.getNumber(); |
|
|
String key = "WMS_temporaryValue_" + type + userByPort.getNumber(); |
|
|
List<String> range = redisTemplate.opsForList().range(key, 0, -1); |
|
|
List<String> range = redisTemplate.opsForList().range(key, 0, -1); |
|
|
List<Inventory> result = new ArrayList<>(); |
|
|
List<Inventory> result = new ArrayList<>(); |
|
|
|
|
|
|
|
|
if (range != null && range.size() > 0) { |
|
|
if (range != null && range.size() > 0) { |
|
|
for (String value : |
|
|
for (String value : |
|
|
range) { |
|
|
range) { |
|
|
if ("".equals(value)) { |
|
|
if ("".equals(value)) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取当前用户可见的仓库
|
|
|
|
|
|
List<Depository> depositoryList = new ArrayList<>(); |
|
|
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value)); |
|
|
Inventory inventoryById = materialService.findInventoryById(ObjectFormatUtil.toInteger(value)); |
|
|
|
|
|
Depository depository = new Depository(); |
|
|
|
|
|
depository.setId(inventoryById.getDepositoryId()); |
|
|
|
|
|
depository.setDname(inventoryById.getDepositoryName()); |
|
|
|
|
|
depositoryList.add(depository); |
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid()); |
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid()); |
|
|
inventoryById.setSplitInfoList(splitInfoByMid); |
|
|
inventoryById.setSplitInfoList(splitInfoByMid); |
|
|
|
|
|
inventoryById.setDepositoryList(depositoryList); |
|
|
result.add(inventoryById); |
|
|
result.add(inventoryById); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -908,10 +881,6 @@ public class MaterialController { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
} |
|
|
} |
|
|
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token); |
|
|
// 获取当前用户所在部门拥有的仓库
|
|
|
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userByPort.getMaindeparment().toString()); |
|
|
|
|
|
// 查询当前用户管理的仓库
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
|
|
|
// 获取当前扫描的二维码
|
|
|
// 获取当前扫描的二维码
|
|
|
String qrCode = (String) map.get("qrCode"); |
|
|
String qrCode = (String) map.get("qrCode"); |
|
|
// 根据扫描的二维码获取对应的物料编码
|
|
|
// 根据扫描的二维码获取对应的物料编码
|
|
|
@ -931,15 +900,7 @@ public class MaterialController { |
|
|
// 获取物料与条形码的对应关系
|
|
|
// 获取物料与条形码的对应关系
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param); |
|
|
boolean flag = false; |
|
|
boolean flag = false; |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userByPort); |
|
|
for (Depository depository : depositoryByAdminorg) { |
|
|
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (RoleAndDepository depository : depositoryAndRole) { |
|
|
|
|
|
if (!depositoryIdList.contains(depository.getDepositoryId())) { |
|
|
|
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<Integer> tempDepositoryIdList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userByPort); |
|
|
List<Integer> tempDepositoryIdList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userByPort); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(depositoryIdList,tempDepositoryIdList); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(depositoryIdList,tempDepositoryIdList); |
|
|
|
|
|
|
|
|
@ -1101,19 +1062,7 @@ public class MaterialController { |
|
|
// 获取条形码与物料的映射
|
|
|
// 获取条形码与物料的映射
|
|
|
MaterialAndBarCode materialByBarCode = materialService.findMaterialByBarCode(barCode); |
|
|
MaterialAndBarCode materialByBarCode = materialService.findMaterialByBarCode(barCode); |
|
|
if (materialByBarCode != null) { |
|
|
if (materialByBarCode != null) { |
|
|
// 获取当前用户部门所拥有仓库
|
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userByPort); |
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userByPort.getMaindeparment().toString()); |
|
|
|
|
|
// 查询当前用户管理的仓库
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
for (Depository depository : depositoryByAdminorg) { |
|
|
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (RoleAndDepository depository : depositoryAndRole) { |
|
|
|
|
|
if (!depositoryIdList.contains(depository.getDepositoryId())) { |
|
|
|
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<Integer> tempDepositoryIdList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userByPort); |
|
|
List<Integer> tempDepositoryIdList = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userByPort); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(depositoryIdList,tempDepositoryIdList); |
|
|
depositoryIdList = (List<Integer>) CollectionUtils.union(depositoryIdList,tempDepositoryIdList); |
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
@ -1684,23 +1633,8 @@ public class MaterialController { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
// 获取当前部门所拥有的仓库
|
|
|
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
|
|
|
// 查询当前用户管理的仓库
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取用户可见的仓库
|
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
for (Depository depository : depositoryByAdminorg |
|
|
|
|
|
) { |
|
|
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
for (RoleAndDepository rad : depositoryAndRole |
|
|
|
|
|
) { |
|
|
|
|
|
if (!depositoryIdList.contains(rad.getDepositoryId())) { |
|
|
|
|
|
depositoryIdList.add(rad.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
map.put("userTokenId", userToken.getId()); |
|
|
map.put("userTokenId", userToken.getId()); |
|
|
List<MaterialAndPlaceForViewP> materialAndPlaceForViews = materialService.findInventoryByMidAndDepository(map, depositoryIdList); |
|
|
List<MaterialAndPlaceForViewP> materialAndPlaceForViews = materialService.findInventoryByMidAndDepository(map, depositoryIdList); |
|
|
Integer count = placeService.findPlaceAndMaterialCountByDidsAndMid(depositoryIdList, map); |
|
|
Integer count = placeService.findPlaceAndMaterialCountByDidsAndMid(depositoryIdList, map); |
|
|
|