|
|
@ -1426,75 +1426,75 @@ namespace ICSSoft.WebAPI.Controllers |
|
|
|
/// </summary>
|
|
|
|
/// <param name="JsonData"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[Route("api/PurchaseReceiveDocPOArrive/Create")] |
|
|
|
[HttpPost] |
|
|
|
public HttpResponseMessage CreateRdRecord01ByPOArrive([FromBody] object JsonData) |
|
|
|
{ |
|
|
|
log.Info("接口:api/PurchaseReceiveDocPOArrive/Create"); |
|
|
|
log.Info("创建采购入库单(源头单据到货单)传入值:" + JsonData); |
|
|
|
HttpResponseMessage result = new HttpResponseMessage(); |
|
|
|
Result res = new Result(); |
|
|
|
string str = string.Empty; |
|
|
|
try |
|
|
|
{ |
|
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
List<ICSPurchaseReceiveDoc> infos = new List<ICSPurchaseReceiveDoc>(); |
|
|
|
try |
|
|
|
{ |
|
|
|
infos = JsonConvert.DeserializeObject<List<ICSPurchaseReceiveDoc>>(JsonData.ToString()); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
log.Error("转换失败:" + ex.ToString()); |
|
|
|
//[Route("api/PurchaseReceiveDocPOArrive/Create")]
|
|
|
|
//[HttpPost]
|
|
|
|
//public HttpResponseMessage CreateRdRecord01ByPOArrive([FromBody] object JsonData)
|
|
|
|
//{
|
|
|
|
// log.Info("接口:api/PurchaseReceiveDocPOArrive/Create");
|
|
|
|
// log.Info("创建采购入库单(源头单据到货单)传入值:" + JsonData);
|
|
|
|
// HttpResponseMessage result = new HttpResponseMessage();
|
|
|
|
// Result res = new Result();
|
|
|
|
// string str = string.Empty;
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
|
|
// {
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// List<ICSPurchaseReceiveDoc> infos = new List<ICSPurchaseReceiveDoc>();
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// infos = JsonConvert.DeserializeObject<List<ICSPurchaseReceiveDoc>>(JsonData.ToString());
|
|
|
|
// }
|
|
|
|
// catch (Exception ex)
|
|
|
|
// {
|
|
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
|
|
|
|
|
|
res.Success = false; |
|
|
|
res.Message = "JSON格式不正确!"; |
|
|
|
throw new Exception(res.Message); |
|
|
|
} |
|
|
|
PurchaseReceiveDoc action = new PurchaseReceiveDoc(); |
|
|
|
string resultStr = action.CreateRdRecord01sByPOArrive(infos); |
|
|
|
if (!string.IsNullOrWhiteSpace(resultStr)) |
|
|
|
{ |
|
|
|
res.Success = true; |
|
|
|
res.Message = "接口调用成功!"; |
|
|
|
res.Data = resultStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
res.Success = false; |
|
|
|
res.Data = resultStr; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
log.Error("调用后台失败:" + ex.ToString()); |
|
|
|
res.Success = false; |
|
|
|
res.Message = ex.Message; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
res.Success = false; |
|
|
|
res.Message = "请传入参数"; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
log.Error("参数检验失败:" + ex.ToString()); |
|
|
|
res.Success = false; |
|
|
|
res.Message = ex.Message; |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
str = JsonConvert.SerializeObject(res); |
|
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json"); |
|
|
|
} |
|
|
|
log.Debug("创建采购入库单(源头单据到货单)返回值:" + str); |
|
|
|
return result; |
|
|
|
} |
|
|
|
// res.Success = false;
|
|
|
|
// res.Message = "JSON格式不正确!";
|
|
|
|
// throw new Exception(res.Message);
|
|
|
|
// }
|
|
|
|
// PurchaseReceiveDoc action = new PurchaseReceiveDoc();
|
|
|
|
// string resultStr = action.CreateRdRecord01sByPOArrive(infos);
|
|
|
|
// if (!string.IsNullOrWhiteSpace(resultStr))
|
|
|
|
// {
|
|
|
|
// res.Success = true;
|
|
|
|
// res.Message = "接口调用成功!";
|
|
|
|
// res.Data = resultStr;
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// res.Success = false;
|
|
|
|
// res.Data = resultStr;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// catch (Exception ex)
|
|
|
|
// {
|
|
|
|
// log.Error("调用后台失败:" + ex.ToString());
|
|
|
|
// res.Success = false;
|
|
|
|
// res.Message = ex.Message;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// res.Success = false;
|
|
|
|
// res.Message = "请传入参数";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// catch (Exception ex)
|
|
|
|
// {
|
|
|
|
// log.Error("参数检验失败:" + ex.ToString());
|
|
|
|
// res.Success = false;
|
|
|
|
// res.Message = ex.Message;
|
|
|
|
// }
|
|
|
|
// finally
|
|
|
|
// {
|
|
|
|
// str = JsonConvert.SerializeObject(res);
|
|
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
|
|
// }
|
|
|
|
// log.Debug("创建采购入库单(源头单据到货单)返回值:" + str);
|
|
|
|
// return result;
|
|
|
|
//}
|
|
|
|
/// <summary>
|
|
|
|
/// 审核采购入库单
|
|
|
|
/// </summary>
|
|
|
@ -7354,7 +7354,7 @@ namespace ICSSoft.WebAPI.Controllers |
|
|
|
#region U9入库单相关
|
|
|
|
|
|
|
|
#region 审核入库单(采购入库)
|
|
|
|
[Route("api/PurchaseReceiveDoc/Create")] |
|
|
|
[Route("api/PurchaseReceiveDocPOArrive/Create")] |
|
|
|
[HttpPost] |
|
|
|
public HttpResponseMessage ApproveRCV([FromBody] object JsonData) |
|
|
|
{ |
|
|
|