This commit is contained in:
余宇波 2025-07-30 11:36:45 +08:00
parent 44462fce14
commit d5410caafe
2 changed files with 12 additions and 5 deletions

View File

@ -20,12 +20,12 @@ namespace MyCode.Project.Services
/// 推送入库申请
/// </summary>
/// <param name="now"></param>
void SendInStock(string sheet);
string SendInStock(string sheet);
/// <summary>
/// 推送出库申请
/// </summary>
/// <param name="now"></param>
void SendOutStock(string sheet);
string SendOutStock(string sheet);
}
}

View File

@ -54,11 +54,12 @@ namespace MyCode.Project.Services.Implementation
/// <summary>
/// 上传入库数据
/// </summary>
public void SendInStock(string sheet)
public string SendInStock(string sheet)
{
var list = _wMStoJackyunInventoryMovementView1Repository.GetInventoryMovement();
//过滤入库数据
var InStockHead = list.Where(t => t.type == "+" && t.relDataId == sheet).Select(p => p.relDataId).Distinct().ToList();
string result = "";
InStockHead.ForEach(relDataId =>
{
CreateAndStockinGetRequestBizData requestBizData = new CreateAndStockinGetRequestBizData();
@ -89,6 +90,7 @@ namespace MyCode.Project.Services.Implementation
Thread.Sleep(500);
JackyunResponse response = Call(EnumAttribute.GetAttribute(ApiEnum.CREATEANDSTOCKIN).Value, "1.0", requestBizData);
string ll = JsonHelper.ToJson(response);
result = ll;
LogHelper.Info("上传入库数据结果:" + ll);
//判断返回结果是否成功
if (response.code == "200")
@ -104,16 +106,19 @@ namespace MyCode.Project.Services.Implementation
}
});
return result;
}
/// <summary>
/// 上传出库数据
/// </summary>
public void SendOutStock(string sheet)
public string SendOutStock(string sheet)
{
var list = _wMStoJackyunInventoryMovementView1Repository.GetInventoryMovement();
//过滤出库数据
var OutStockHead = list.Where(t => t.type != "+" && t.relDataId==sheet).Select(p => p.relDataId).Distinct().ToList();
var OutStockHead = list.Where(t => t.type != "+" && t.relDataId==sheet).Select(p => p.relDataId).Distinct().ToList();
string result = "";
OutStockHead.ForEach(relDataId =>
{
@ -145,6 +150,7 @@ namespace MyCode.Project.Services.Implementation
Thread.Sleep(500);
JackyunResponse response = Call(EnumAttribute.GetAttribute(ApiEnum.CREATEANDSTOCKOUT).Value, "1.0", requestBizData);
string ll = JsonHelper.ToJson(response);
result = ll;
LogHelper.Info(ll);
//判断返回结果是否成功
if (response.code == "200")
@ -159,6 +165,7 @@ namespace MyCode.Project.Services.Implementation
}
});
return result;
}