huangjn 2 년 전
부모
커밋
19bdfd2f1d
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 11 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

+ 11 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -116,8 +116,17 @@ public class ContractLogController extends BladeController {
 	@ApiImplicitParam(name = "ids", value = "删除的数据ID", required = true)
 	public R<Boolean> removeByIds(@RequestBody JSONObject json){
 		if(json.containsKey("ids")){
-			List<Long> ids = JSONArray.parseArray(JSONObject.toJSONString(json.get("ids")), Long.class);
-			return R.status(this.contractLogService.deleteLogic(ids));
+			Object ids = json.get("ids");
+			List<Long> idList;
+			if(ids instanceof List){
+				//如果是集合,按集合处理
+				idList = JSONArray.parseArray(JSONObject.toJSONString(ids), Long.class);
+			} else {
+				//否则均按字符串处理
+				idList = Func.toLongList(ids.toString());
+			}
+
+			return R.status(this.contractLogService.deleteLogic(idList));
 		}
 		return R.data(300, false, "未找到具体数据");
 	}