调整接口
This commit is contained in:
@@ -767,13 +767,13 @@ namespace WMS.Web.Domain.Services.Public
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="formId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Save<T>(T dto, string formId)
|
||||
public async Task<Result<string>> Save<T>(T dto, string formId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var token_result = await this.Init();
|
||||
if (!token_result.IsSuccess)
|
||||
return token_result;
|
||||
return Result<string>.ReFailure(token_result.Message,token_result.Status);
|
||||
var query = new ErpBillQueryDto(token_result.Data);
|
||||
var param = new ErpSave<T>(formId, dto);
|
||||
query.Data = JsonConvert.SerializeObject(param);
|
||||
@@ -784,14 +784,18 @@ namespace WMS.Web.Domain.Services.Public
|
||||
var isSuccess = jobject["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToLower();
|
||||
|
||||
if (jobject["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToLower() == "true")
|
||||
return Result.ReSuccess();
|
||||
{
|
||||
//保存成功后返回Id 后续操作根据Id操作
|
||||
string id = jobject["Result"]["ResponseStatus"]["SuccessEntitys"]["Id"].ToString();
|
||||
return Result<string>.ReSuccess(id);
|
||||
}
|
||||
|
||||
var msg = jobject["Result"]["ResponseStatus"]["Errors"]["Message"].ToString();
|
||||
return Result.ReFailure(msg, 10002);
|
||||
return Result<string>.ReFailure(msg, 10002);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Result.ReFailure("错误", 10002);
|
||||
return Result<string>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user