新增错误返回

parent 21c221f4
...@@ -83,9 +83,11 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -83,9 +83,11 @@ public ApiResponse Import([FromForm] IFormCollection form)
return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效"); return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
var again = againAllotService.GetAgainallot(againid); var again = againAllotService.GetAgainallot(againid);
var allot = allotService.GetAllot(again.AllotID.Value); if (again == null)
if (again == null || allot == null)
return new ApiResponse(ResponseType.Fail, "二次绩效记录不存在"); return new ApiResponse(ResponseType.Fail, "二次绩效记录不存在");
var allot = allotService.GetAllot(again.AllotID.Value);
if (allot == null)
return new ApiResponse(ResponseType.Fail, "一次绩效记录不存在");
var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff"); var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff");
var ext = FileHelper.GetExtension(file.FileName); var ext = FileHelper.GetExtension(file.FileName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment