|
|
@ -149,7 +149,7 @@ public class DepositoryController { |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> RealDeleteSonDepository(id.toString(), finalUserKey, finalToken)); |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> RealDeleteSonDepository(id.toString(), finalUserKey, finalToken)); |
|
|
return CrudUtil.deleteHandle(depositoryService.deleteDepositoryRecordById(id), 1); |
|
|
return CrudUtil.deleteHandle(depositoryService.deleteDepositoryRecordById(id), 1); |
|
|
} else if (map.containsKey("ids")) { |
|
|
} else if (map.containsKey("ids")) { |
|
|
List<Integer> ids = ObjectFormatUtil.objToList(map.get("ids"),Integer.class); |
|
|
List<Integer> ids = ObjectFormatUtil.objToList(map.get("ids"), Integer.class); |
|
|
for (Integer integer : ids) { |
|
|
for (Integer integer : ids) { |
|
|
String id = integer.toString(); |
|
|
String id = integer.toString(); |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> RealDeleteSonDepository(id, finalUserKey, finalToken)); |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> RealDeleteSonDepository(id, finalUserKey, finalToken)); |
|
|
@ -239,7 +239,7 @@ public class DepositoryController { |
|
|
return CrudUtil.deleteHandle(depositoryService.changeStateToDeletedById(id), 1); |
|
|
return CrudUtil.deleteHandle(depositoryService.changeStateToDeletedById(id), 1); |
|
|
|
|
|
|
|
|
} else if (map.containsKey("ids")) { |
|
|
} else if (map.containsKey("ids")) { |
|
|
List<Integer> ids = ObjectFormatUtil.objToList(map.get("ids"),Integer.class); |
|
|
List<Integer> ids = ObjectFormatUtil.objToList(map.get("ids"), Integer.class); |
|
|
for (Integer integer : ids) { |
|
|
for (Integer integer : ids) { |
|
|
String id = integer.toString(); |
|
|
String id = integer.toString(); |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> UpdateSonState(id, 3, true, finalUserKey, finalToken)); |
|
|
HandlesOtherFunctionalThreadPool.execute(() -> UpdateSonState(id, 3, true, finalUserKey, finalToken)); |
|
|
@ -332,8 +332,8 @@ public class DepositoryController { |
|
|
// 获取本月及之前月份各种类别入/出库总量
|
|
|
// 获取本月及之前月份各种类别入/出库总量
|
|
|
List<MaterialType> materialTypeAll = materialTypeService.findMaterialTypeNoParent(); |
|
|
List<MaterialType> materialTypeAll = materialTypeService.findMaterialTypeNoParent(); |
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"),Object.class); |
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"), Object.class); |
|
|
List<Object> sourceList = ObjectFormatUtil.objToList(previousMonth.get("sourceList"),Object.class); |
|
|
List<Object> sourceList = ObjectFormatUtil.objToList(previousMonth.get("sourceList"), Object.class); |
|
|
for (int num = 0; num < months.size() - 1; num++) { |
|
|
for (int num = 0; num < months.size() - 1; num++) { |
|
|
for (MaterialType materialType : materialTypeAll) { |
|
|
for (MaterialType materialType : materialTypeAll) { |
|
|
Map<String, Object> parm = new HashMap<>(); |
|
|
Map<String, Object> parm = new HashMap<>(); |
|
|
@ -583,7 +583,7 @@ public class DepositoryController { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
} |
|
|
} |
|
|
if (sunburstChartData == null || sunburstChartData.size() == 0) { |
|
|
if (sunburstChartData == null || sunburstChartData.size() == 0) { |
|
|
sunburstChartData = ObjectFormatUtil.objToList(((Map<String, Object>) result).get("sunburstChartDataForInventory"),Object.class); |
|
|
sunburstChartData = ObjectFormatUtil.objToList(((Map<String, Object>) result).get("sunburstChartDataForInventory"), Object.class); |
|
|
} |
|
|
} |
|
|
if (lineChartData == null || lineChartData.size() == 0) { |
|
|
if (lineChartData == null || lineChartData.size() == 0) { |
|
|
lineChartData = (Map<Object, Object>) ((Map<String, Object>) result).get("inventoryLineChartData"); |
|
|
lineChartData = (Map<Object, Object>) ((Map<String, Object>) result).get("inventoryLineChartData"); |
|
|
@ -715,9 +715,9 @@ public class DepositoryController { |
|
|
// 获取本月之前的月份
|
|
|
// 获取本月之前的月份
|
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
// 获取月份的时间戳
|
|
|
// 获取月份的时间戳
|
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"),Object.class); |
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"), Object.class); |
|
|
// 获取月份名称
|
|
|
// 获取月份名称
|
|
|
List<Object> sourceList = ObjectFormatUtil.objToList(previousMonth.get("sourceList"),Object.class); |
|
|
List<Object> sourceList = ObjectFormatUtil.objToList(previousMonth.get("sourceList"), Object.class); |
|
|
// 结果集
|
|
|
// 结果集
|
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
int threadSize = months.size(); |
|
|
int threadSize = months.size(); |
|
|
@ -756,9 +756,9 @@ public class DepositoryController { |
|
|
public List<Object> getInventorySunburstData(UserByPort userByPort) { |
|
|
public List<Object> getInventorySunburstData(UserByPort userByPort) { |
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
Map<String, Object> previousMonth = DateUtil.getPreviousMonth(); |
|
|
// 获取所有月份
|
|
|
// 获取所有月份
|
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"),Object.class); |
|
|
List<Object> months = ObjectFormatUtil.objToList(previousMonth.get("months"), Object.class); |
|
|
// 获取月份名称
|
|
|
// 获取月份名称
|
|
|
List<Object> sourceList = ObjectFormatUtil.objToList((List<Object>) previousMonth.get("sourceList"),Object.class); |
|
|
List<Object> sourceList = ObjectFormatUtil.objToList((List<Object>) previousMonth.get("sourceList"), Object.class); |
|
|
Calendar instance = Calendar.getInstance(); |
|
|
Calendar instance = Calendar.getInstance(); |
|
|
instance.add(Calendar.MONTH, 1); |
|
|
instance.add(Calendar.MONTH, 1); |
|
|
instance.set(Calendar.DATE, 1); |
|
|
instance.set(Calendar.DATE, 1); |
|
|
@ -806,9 +806,9 @@ public class DepositoryController { |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
obj = completionService.take().get(); |
|
|
obj = completionService.take().get(); |
|
|
Map<String, Object> objectMap = ObjectFormatUtil.objToMap(obj,String.class,Object.class); |
|
|
Map<String, Object> objectMap = ObjectFormatUtil.objToMap(obj, String.class, Object.class); |
|
|
Integer id = ObjectFormatUtil.toInteger((objectMap).get("id")); |
|
|
Integer id = ObjectFormatUtil.toInteger((objectMap).get("id")); |
|
|
List<InventoryByMTAndDepository> inventoryByMtAndD = ObjectFormatUtil.objToList(objectMap.get("inventoryByMtAndD"),InventoryByMTAndDepository.class); |
|
|
List<InventoryByMTAndDepository> inventoryByMtAndD = ObjectFormatUtil.objToList(objectMap.get("inventoryByMtAndD"), InventoryByMTAndDepository.class); |
|
|
value += ObjectFormatUtil.toDouble(objectMap.get("value")); |
|
|
value += ObjectFormatUtil.toDouble(objectMap.get("value")); |
|
|
inventoryForMTAndDepository.put(id, inventoryByMtAndD); |
|
|
inventoryForMTAndDepository.put(id, inventoryByMtAndD); |
|
|
(objectMap).remove("id"); |
|
|
(objectMap).remove("id"); |
|
|
@ -994,19 +994,43 @@ public class DepositoryController { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
userKey = (String) request.getSession().getAttribute("userKey"); |
|
|
userKey = (String) request.getSession().getAttribute("userKey"); |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
|
|
List<Integer> userIdByDid = roleService.findUserIdByDid(did); |
|
|
// 用于查询对应的管理员权限
|
|
|
List<UserByPortP> list = new ArrayList<>(); |
|
|
Map<String, Object> paramForUserManager = new HashMap<>(); |
|
|
for (Integer integer : userIdByDid) { |
|
|
paramForUserManager.put("depositoryId", did); |
|
|
UserByPort userByPort = PublicConfig.FindUserById(integer, userKey, token); |
|
|
List<UserByPort> list = new ArrayList<>(); |
|
|
// 获取用户的用工关系
|
|
|
; |
|
|
int emptype = userByPort.getEmptype(); |
|
|
List<RoleAndDepository> roleAndDepositoryByCondition = roleService.findRoleAndDepositoryByCondition(paramForUserManager); |
|
|
if(emptype > 10){ |
|
|
for (RoleAndDepository roleAndDepository : roleAndDepositoryByCondition) { |
|
|
continue; |
|
|
int classes = roleAndDepository.getClasses(); |
|
|
|
|
|
Integer userId = roleAndDepository.getUserId(); |
|
|
|
|
|
if (classes == 1) { |
|
|
|
|
|
// 如果是对人设置的权限
|
|
|
|
|
|
UserByPort userByPort = PublicConfig.FindUserById(userId, userKey, token); |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
list.add(userByPort); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是对岗位
|
|
|
|
|
|
|
|
|
|
|
|
// 定义用于获取当前岗位下的人的参数map
|
|
|
|
|
|
Map<String, Object> paramForGetUserByPost = new HashMap<>(); |
|
|
|
|
|
paramForGetUserByPost.put("position", userId); |
|
|
|
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
|
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
list.add(userByPort); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
UserByPortP user = new UserByPortP(userByPort); |
|
|
|
|
|
list.add(user); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int size = list.size(); |
|
|
int size = list.size(); |
|
|
return new RestResponse(list, size, 200); |
|
|
return new RestResponse(list, size, 200); |
|
|
} |
|
|
} |
|
|
|