|
|
@@ -41,9 +41,9 @@ public class SupplyHierarchyController {
|
|
|
@PostMapping("/set")
|
|
|
public Result<Void> setHierarchy(@RequestBody Map<String, Object> params) {
|
|
|
try {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long parentId = params.get("parentId") != null ? ((Number) params.get("parentId")).longValue() : null;
|
|
|
- Long childId = params.get("childId") != null ? ((Number) params.get("childId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long parentId = params.get("parentId") != null ? Long.valueOf(params.get("parentId").toString()) : null;
|
|
|
+ Long childId = params.get("childId") != null ? Long.valueOf(params.get("childId").toString()) : null;
|
|
|
if (systemId == null || parentId == null || childId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -59,8 +59,8 @@ public class SupplyHierarchyController {
|
|
|
@PostMapping("/remove")
|
|
|
public Result<Void> removeRelation(@RequestBody Map<String, Object> params) {
|
|
|
try {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long childId = params.get("childId") != null ? ((Number) params.get("childId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long childId = params.get("childId") != null ? Long.valueOf(params.get("childId").toString()) : null;
|
|
|
if (systemId == null || childId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -73,8 +73,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/direct-children")
|
|
|
public Result<List<User>> getDirectChildren(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long parentId = params.get("parentId") != null ? ((Number) params.get("parentId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long parentId = params.get("parentId") != null ? Long.valueOf(params.get("parentId").toString()) : null;
|
|
|
if (systemId == null || parentId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -84,8 +84,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/all-children")
|
|
|
public Result<List<User>> getAllChildren(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long parentId = params.get("parentId") != null ? ((Number) params.get("parentId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long parentId = params.get("parentId") != null ? Long.valueOf(params.get("parentId").toString()) : null;
|
|
|
if (systemId == null || parentId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -95,8 +95,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/parent")
|
|
|
public Result<User> getParent(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long userId = params.get("userId") != null ? ((Number) params.get("userId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long userId = params.get("userId") != null ? Long.valueOf(params.get("userId").toString()) : null;
|
|
|
if (systemId == null || userId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -106,8 +106,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/parent-chain")
|
|
|
public Result<List<User>> getParentChain(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long userId = params.get("userId") != null ? ((Number) params.get("userId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long userId = params.get("userId") != null ? Long.valueOf(params.get("userId").toString()) : null;
|
|
|
if (systemId == null || userId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -117,7 +117,7 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/tree")
|
|
|
public Result<List<Map<String, Object>>> getTree(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
if (systemId == null) {
|
|
|
return Result.error("systemId 不能为空");
|
|
|
}
|
|
|
@@ -181,8 +181,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/my")
|
|
|
public Result<Map<String, Object>> getMyRelation(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long userId = params.get("userId") != null ? ((Number) params.get("userId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long userId = params.get("userId") != null ? Long.valueOf(params.get("userId").toString()) : null;
|
|
|
if (systemId == null || userId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
}
|
|
|
@@ -197,11 +197,8 @@ public class SupplyHierarchyController {
|
|
|
|
|
|
@PostMapping("/change-requests")
|
|
|
public Result<List<SupplyHierarchyChangeRequest>> getChangeRequests(@RequestBody Map<String, Object> params) {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
String status = (String) params.get("status");
|
|
|
- if (systemId == null) {
|
|
|
- return Result.error("systemId 不能为空");
|
|
|
- }
|
|
|
List<SupplyHierarchyChangeRequest> requests = supplyHierarchyService.getChangeRequests(systemId, status);
|
|
|
return Result.success(requests);
|
|
|
}
|
|
|
@@ -209,8 +206,8 @@ public class SupplyHierarchyController {
|
|
|
@PostMapping("/change/apply")
|
|
|
public Result<Void> applyChange(@RequestBody Map<String, Object> params) {
|
|
|
try {
|
|
|
- Long systemId = params.get("systemId") != null ? ((Number) params.get("systemId")).longValue() : null;
|
|
|
- Long targetParentId = params.get("targetParentId") != null ? ((Number) params.get("targetParentId")).longValue() : null;
|
|
|
+ Long systemId = params.get("systemId") != null ? Long.valueOf(params.get("systemId").toString()) : null;
|
|
|
+ Long targetParentId = params.get("targetParentId") != null ? Long.valueOf(params.get("targetParentId").toString()) : null;
|
|
|
String reason = (String) params.get("reason");
|
|
|
if (systemId == null || targetParentId == null) {
|
|
|
return Result.error("参数不完整");
|
|
|
@@ -227,7 +224,7 @@ public class SupplyHierarchyController {
|
|
|
@PostMapping("/change/review")
|
|
|
public Result<Void> reviewChange(@RequestBody Map<String, Object> params) {
|
|
|
try {
|
|
|
- Long requestId = params.get("requestId") != null ? ((Number) params.get("requestId")).longValue() : null;
|
|
|
+ Long requestId = params.get("requestId") != null ? Long.valueOf(params.get("requestId").toString()) : null;
|
|
|
String status = (String) params.get("status");
|
|
|
String rejectReason = (String) params.get("rejectReason");
|
|
|
if (requestId == null || status == null) {
|