Fix Bug #571: 根因+修复方案摘要
This commit is contained in:
@@ -194,8 +194,8 @@ public class RequestFormManageController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public R<?> deleteRequestForm(@RequestBody Map<String, Long> data) {
|
public R<?> deleteRequestForm(@RequestBody Map<String, Object> data) {
|
||||||
return iRequestFormManageAppService.deleteRequestForm(data.get("requestFormId"));
|
return iRequestFormManageAppService.deleteRequestForm(parseLong(data.get("requestFormId")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,7 +205,24 @@ public class RequestFormManageController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/withdraw")
|
@PostMapping(value = "/withdraw")
|
||||||
public R<?> withdrawRequestForm(@RequestBody Map<String, Long> data) {
|
public R<?> withdrawRequestForm(@RequestBody Map<String, Object> data) {
|
||||||
return iRequestFormManageAppService.withdrawRequestForm(data.get("requestFormId"));
|
return iRequestFormManageAppService.withdrawRequestForm(parseLong(data.get("requestFormId")));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long parseLong(Object value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (value instanceof Long) {
|
||||||
|
return (Long) value;
|
||||||
|
}
|
||||||
|
if (value instanceof Number) {
|
||||||
|
return ((Number) value).longValue();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Long.parseLong(value.toString());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user