This commit is contained in:
2026-08-25 14:23:19 +08:00
parent 4ea20f0077
commit 47d0ea2169
4 changed files with 93 additions and 12 deletions
+65 -10
View File
@@ -581,18 +581,37 @@ namespace BLL.API
{
usingMat.StoreMan = user.StoremanId;
}
if (amount == plan.Amount) //全部领取
BLL.UsingMatService.AddUsingMat(usingMat);
// 修改库存已使用的数量
BLL.StockInService.UpdateStockInUsingAmount(usingMat.StockInId, usingMat.Amount, usingMat.TwoAmount);
if (amount < plan.Amount) //部分领取
{
BLL.UsingMatService.AddUsingMat(usingMat);
// 修改库存已使用的数量
BLL.StockInService.UpdateStockInUsingAmount(usingMat.StockInId, usingMat.Amount, usingMat.TwoAmount);
Model.Weld_UsingPlan newPlan = new Weld_UsingPlan();
newPlan.UnitStoreId = plan.UnitStoreId;
newPlan.WeldId = plan.WeldId;
newPlan.ProjectId = plan.ProjectId;
newPlan.UsePosition = plan.UsePosition;
newPlan.UsingUnit = plan.UsingUnit;
newPlan.STE_ID = plan.STE_ID;
newPlan.STE_Name = plan.STE_Name;
newPlan.Amount = plan.Amount - amount;
newPlan.UsingManOne = plan.UsingManOne;
newPlan.InPutDate = DateTime.Now;
newPlan.OrderDate = plan.OrderDate;
newPlan.OrderTime = plan.OrderTime;
newPlan.TeamGroupId = plan.TeamGroupId;
newPlan.CancelDate = null;
newPlan.IsCancel = plan.IsCancel;
newPlan.CancelResult = plan.CancelResult;
newPlan.IsSubmit = plan.IsSubmit;
newPlan.InPutMan = plan.InPutMan;
newPlan.Type = "1";
newPlan.IsSteelStru = plan.IsSteelStru;
newPlan.UsingPlanId = SQLHelper.GetNewID(typeof(Model.Weld_UsingPlan));
BLL.UsingPlanService.AddUsingPlan(newPlan);
}
else
{
}
respone.code = 1;
respone.message = "领料成功!";
}
else
{
@@ -879,5 +898,41 @@ namespace BLL.API
return responeData;
}
#endregion
#region
/// <summary>
/// 发料异常接口
/// </summary>
/// <param name="personId">人员ID</param>
/// <param name="type">交换类型</param>
/// <returns></returns>
public static Model.ResponeData saveMachineErrlog(string unitStoreId, string errlog)
{
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Sys_ErrLogInfo errLogInfo = new Sys_ErrLogInfo();
errLogInfo.ErrLogId = SQLHelper.GetNewID();
errLogInfo.ErrType = "WeldMachine";
errLogInfo.ErrMessage = errlog;
errLogInfo.ErrIP = unitStoreId;
errLogInfo.ErrTime = DateTime.Now;
db.Sys_ErrLogInfo.InsertOnSubmit(errLogInfo);
db.SubmitChanges();
responeData.code = 1;
responeData.message = "异常保存成功!";
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(ex, "发料异常接口", "WeldController.saveMachineErrlog");
}
return responeData;
}
#endregion
}
}
@@ -2,7 +2,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
@@ -379,5 +379,31 @@ namespace WebAPI.Controllers
}
return respone;
}
[HttpGet]
public Model.ResponeData saveMachineErrlog(string unitStoreCode, string errlog)
{
Model.ResponeData respone = new ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(BLL.Funs.ConnString))
{
var unitStore = db.Weld_UnitStore.FirstOrDefault(x => x.UnitStoreCode == unitStoreCode);
if (unitStore == null)
{
respone.code = 0;
respone.message = "对应编码的仓库不存在!";
return respone;
}
return APIWeldServices.saveMachineErrlog(unitStore.UnitStoreId, errlog);
}
}
catch (Exception e)
{
respone.code = 0;
respone.message = e.Message;
}
return respone;
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />