This commit is contained in:
qianhao.xu
2024-12-04 10:35:39 +08:00
parent b4aafa8345
commit 37e6e19fef
3 changed files with 16 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ public class ReportFlowController : BaseController
var response = _reportFlowService.GetWorkOrderDetail(workOrder);
if (response == null)
{
return ToResponse(ResultCode.NO_DATA, "工单不存在");
return ToResponse(ResultCode.SUCCESS, "工单不存在");
}
return SUCCESS(response);
}
@@ -50,9 +50,9 @@ public class ReportFlowController : BaseController
{
if (string.IsNullOrEmpty(workorder))
{
throw new CustomException("workorder or process is null");
throw new CustomException("workorder is null");
}
return SUCCESS(_reportFlowService.GetProcessReportWorkDetail(workorder, processId));
return ToResponse(ResultCode.SUCCESS,_reportFlowService.GetProcessReportWorkDetail(workorder, processId));
}
//TODO 工序报工

View File

@@ -55,6 +55,10 @@ namespace Infrastructure.Controllers
{
return ToResponse(new ApiResult((int)resultCode, msg));
}
protected IActionResult ToResponse(ResultCode resultCode, Object data)
{
return ToResponse(new ApiResult((int)resultCode, data));
}
/// <summary>
/// 导出Excel

View File

@@ -53,6 +53,15 @@ namespace Infrastructure.Model
Add(DATA_TAG, data);
}
}
public ApiResult(int code, object data)
{
Add(CODE_TAG, code);
if (data != null)
{
Add(DATA_TAG, data);
}
}
/// <summary>
/// 返回成功消息