1
This commit is contained in:
@@ -217,8 +217,6 @@ namespace BLL.API
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
|
||||
Weld_UsingPlan usingPlan = (from x in db.Weld_UsingPlan where x.UsingPlanId == usingPlanId select x).FirstOrDefault();
|
||||
|
||||
UsingPlanItem planItem = new UsingPlanItem();
|
||||
@@ -415,6 +413,118 @@ namespace BLL.API
|
||||
return respone;
|
||||
}
|
||||
|
||||
public static Model.ResponeData getUsingPlanByUnitStoreCodeAndWelderCode(string unitStoreId, string wED_ID)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var usingPlans = from x in db.Weld_UsingPlan
|
||||
where x.UnitStoreId == unitStoreId && x.UsingManOne == wED_ID
|
||||
&& (x.IsCancel==false || x.IsCancel==null)
|
||||
select x;
|
||||
if (usingPlans.Count() > 0)
|
||||
{
|
||||
List<UsingPlanItem> items = new List<UsingPlanItem>();
|
||||
foreach (var usingPlan in usingPlans)
|
||||
{
|
||||
UsingPlanItem planItem = new UsingPlanItem();
|
||||
planItem.UsingPlanId = usingPlan.UsingPlanId;
|
||||
planItem.WeldId = usingPlan.WeldId;
|
||||
planItem.ProjectId = usingPlan.ProjectId;
|
||||
planItem.UsePosition = usingPlan.UsePosition;
|
||||
planItem.Amount = usingPlan.Amount;
|
||||
planItem.UsingManOne = usingPlan.UsingManOne;
|
||||
planItem.UsingManTwo = usingPlan.UsingManTwo;
|
||||
if (usingPlan.InPutDate != null)
|
||||
{
|
||||
planItem.InPutDate = string.Format("{0:yyyy-MM-dd}", usingPlan.InPutDate);
|
||||
}
|
||||
if (usingPlan.CancelDate != null)
|
||||
{
|
||||
planItem.CancelDate = string.Format("{0:yyyy-MM-dd}", usingPlan.CancelDate);
|
||||
}
|
||||
planItem.IsCancel = usingPlan.IsCancel;
|
||||
planItem.FinishMan = usingPlan.FinishMan;
|
||||
planItem.OrderTime = usingPlan.OrderTime;
|
||||
if (usingPlan.OrderDate != null)
|
||||
{
|
||||
planItem.OrderDate = string.Format("{0:yyyy-MM-dd}", usingPlan.OrderDate);
|
||||
}
|
||||
planItem.CancelResult = usingPlan.CancelResult;
|
||||
planItem.IsSubmit = usingPlan.IsSubmit;
|
||||
planItem.UsingUnit = usingPlan.UsingUnit;
|
||||
planItem.IsNeedConfirm = usingPlan.IsNeedConfirm;
|
||||
planItem.InPutMan = usingPlan.InPutMan;
|
||||
planItem.IsSteelStru = usingPlan.IsSteelStru;
|
||||
planItem.TeamGroupName = usingPlan.TeamGroupId;
|
||||
var teamGroup = db.Base_TeamGroup.FirstOrDefault(x => x.TeamGroupName == usingPlan.TeamGroupId);
|
||||
if (teamGroup != null)
|
||||
{
|
||||
planItem.TeamGroupId = teamGroup.TeamGroupId;
|
||||
}
|
||||
planItem.STE_ID = usingPlan.STE_ID;
|
||||
planItem.IsFinish = usingPlan.IsFinish;
|
||||
planItem.STE_Name = usingPlan.STE_Name;
|
||||
planItem.UnitStoreId = usingPlan.UnitStoreId;
|
||||
planItem.UnitStoreName = BLL.UnitStoreService.GetUnitStoreNameById(usingPlan.UnitStoreId);
|
||||
if (!string.IsNullOrEmpty(planItem.ProjectId))
|
||||
{
|
||||
var project = db.Base_Project.Where(x => x.ProjectId == planItem.ProjectId).FirstOrDefault();
|
||||
if (project != null)
|
||||
{
|
||||
planItem.ProjectName = project.ProjectName;
|
||||
planItem.ProjectCode = project.ProjectCode;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(planItem.WeldId))
|
||||
{
|
||||
var weldInfo = db.Weld_WeldInfo.Where(x => x.WeldId == planItem.WeldId).FirstOrDefault();
|
||||
if (weldInfo != null)
|
||||
{
|
||||
planItem.WeldName = weldInfo.WeldName;
|
||||
planItem.WeldSpec = weldInfo.WeldSpec;
|
||||
planItem.WeldCode = weldInfo.WeldCode;
|
||||
}
|
||||
if (weldInfo != null && !string.IsNullOrEmpty(weldInfo.WeldTypeId))
|
||||
{
|
||||
var weldType = db.Weld_WeldType.Where(x => x.WeldTypeId == weldInfo.WeldTypeId).FirstOrDefault();
|
||||
|
||||
if (weldType != null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(planItem.UsingManOne))
|
||||
{
|
||||
planItem.UsingManOneName = db.HJGL_BS_Welder.Where(x => x.WED_ID == planItem.UsingManOne).Select(x => x.WED_Name).FirstOrDefault();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(planItem.UsingManTwo))
|
||||
{
|
||||
planItem.UsingManTwoName = db.HJGL_BS_Welder.Where(x => x.WED_ID == planItem.UsingManTwo).Select(x => x.WED_Name).FirstOrDefault();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(planItem.UsingUnit))
|
||||
{
|
||||
planItem.UsingUnitName = db.Base_Unit.Where(x => x.UnitId == planItem.UsingUnit).Select(x => x.UnitName).FirstOrDefault();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(planItem.InPutMan))
|
||||
{
|
||||
planItem.InPutManName = db.Sys_User.Where(x => x.UserId == planItem.InPutMan).Select(x => x.UserName).FirstOrDefault();
|
||||
}
|
||||
items.Add(planItem);
|
||||
}
|
||||
respone.data = items;
|
||||
}
|
||||
else
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = "对应焊工无领料计划!";
|
||||
}
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
|
||||
public static Model.ResponeData welderQueIsPass(string welderId, string steelType, bool isSteelStru)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<FineUIPro DebugMode="false" Theme="Cupertino"/>
|
||||
<appSettings>
|
||||
<!--连接字符串-->
|
||||
<add key="ConnectionString" value="Server=.\SQL2022;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
|
||||
<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
|
||||
<!--系统名称-->
|
||||
<add key="SystemName" value="诺必达焊接管理系统"/>
|
||||
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>
|
||||
|
||||
@@ -320,5 +320,38 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData getUsingPlanByUnitStoreCodeAndWelderCode(string unitStoreCode, string welderCode)
|
||||
{
|
||||
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);
|
||||
var welder = db.HJGL_BS_Welder.FirstOrDefault(x => x.WED_Code == welderCode);
|
||||
if (unitStore == null)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = "对应编码的仓库不存在!";
|
||||
return respone;
|
||||
}
|
||||
if (welder == null)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = "对应焊工号的焊工不存在!";
|
||||
return respone;
|
||||
}
|
||||
return APIWeldServices.getUsingPlanByUnitStoreCodeAndWelderCode(unitStore.UnitStoreId, welder.WED_ID);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user