chore: 初始化东安动力MES采集程序
This commit is contained in:
123
Common/08WebFun_base/WebFun_base/08-WebFun_base.csproj
Normal file
123
Common/08WebFun_base/WebFun_base/08-WebFun_base.csproj
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D98BE764-ADEB-488D-9714-61E308AA8201}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WebFun_base</RootNamespace>
|
||||
<AssemblyName>08WebFun_base</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\dll\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MQTTnet">
|
||||
<HintPath>..\..\dll\MQTTnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MQTTnet.Extensions.ManagedClient">
|
||||
<HintPath>..\..\dll\MQTTnet.Extensions.ManagedClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="MesWebFun_base.cs" />
|
||||
<Compile Include="MesWebFun_baseFun.cs" />
|
||||
<Compile Include="MesWebFun_MateriallPull.cs" />
|
||||
<Compile Include="MesWebFun_MateriallPullFun.cs" />
|
||||
<Compile Include="MesWebFun_Special.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Tab_OperateGuid.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Common_Barcode.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Common_ShowEngineID.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Common_ShowQuality.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Common_ShowTime.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_FixGuiad.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Init.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_MaterialCheck.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Notice.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_OutLineRepair.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Socket.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\Web_Socket_Interface.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%282%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%283%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%284%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%285%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%286%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%287%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%288%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制%289%29.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制 - 复制.cs" />
|
||||
<Compile Include="MisWebInterfaceFunc\WWW - 复制.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Reference.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction01.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction02.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction04.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction05.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction06.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction07.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction08.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction10.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction11.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction12.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction13.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction14.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction15.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction16.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction17.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj">
|
||||
<Project>{1a10fdb2-1a6a-44a8-ab4d-33387563247e}</Project>
|
||||
<Name>00-0Json8.3.1</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
|
||||
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
|
||||
<Name>00MesWorkMqtt</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\01DoWhatPlc\01_01DoWhatPlc.csproj">
|
||||
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
|
||||
<Name>01_01DoWhatPlc</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
|
||||
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
|
||||
<Name>04-DataBaseAccess</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
|
||||
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
|
||||
<Name>07BusinessFacade</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
12
Common/08WebFun_base/WebFun_base/Class1.cs
Normal file
12
Common/08WebFun_base/WebFun_base/Class1.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebFun_base
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
125
Common/08WebFun_base/WebFun_base/MesWebFun_MateriallPull.cs
Normal file
125
Common/08WebFun_base/WebFun_base/MesWebFun_MateriallPull.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using bizFacade;
|
||||
using System.Data;
|
||||
//using SystemFramework;
|
||||
|
||||
|
||||
namespace MesWebFun_MateriallPull
|
||||
{
|
||||
public partial class MesWebFun_MateriallPull
|
||||
{
|
||||
public static string MateriallFuctionRequstBase(string cmd, string opName)
|
||||
{
|
||||
string responseText = "";
|
||||
switch (cmd)
|
||||
{
|
||||
case "AMES_getMaterialInfo":
|
||||
responseText = Init_WorkStationMaterial(opName);
|
||||
break;
|
||||
//--------物料拉动-批次接收-----
|
||||
case "AMES_InitMaterial_Dialog_MaterialNum":
|
||||
responseText = InitMaterial_Dialog_MaterialNum(opName);
|
||||
break;
|
||||
//case "AMES_getMaterialNumInfo":
|
||||
// responseText = getMaterialNumInfo(opName);
|
||||
// break;
|
||||
//--------物料拉动-库存盘点-----
|
||||
case "AMES_Init_MaterialNum_Combobox":
|
||||
responseText = Init_MaterialNum_Combobox(opName);
|
||||
break;
|
||||
//case "AMES_ConsumeStockCount":
|
||||
// responseText = Consume_stockcount(opName);
|
||||
// break;
|
||||
//case "AMES_initStockCount":
|
||||
// responseText = initStockCount(opName);
|
||||
// break;
|
||||
case "AMES_Init_Final_OrderNumber_Combobox":
|
||||
responseText = Init_Final_OrderNumber_Combobox();
|
||||
break;
|
||||
//--------物料拉动-FTT-----
|
||||
case "AMES_Init_FinalList_Combobox":
|
||||
responseText = Init_FinalList_Combobox(opName);
|
||||
break;
|
||||
case "AMES_Init_DefectCode_Combobox":
|
||||
responseText = Init_DefectCode_Combobox(opName);
|
||||
break;
|
||||
//case "AMES_Insert_FTT_Informatinon":
|
||||
// responseText = Insert_FTT_Informatinon(opName);
|
||||
// break;
|
||||
//case "AMES_Insert_FTT_Confirm":
|
||||
// responseText = Insert_FTT_Confirm(opName);
|
||||
// break;
|
||||
case "AMES_ConvertOpname_Ftt":
|
||||
responseText = ConvertOpname_Ftt(opName);
|
||||
break;
|
||||
//--------物料拉动-打卡上线-----
|
||||
case "AMES_GetClasses":
|
||||
responseText = GetClasses();
|
||||
break;
|
||||
case "AMES_Confirmclasses":
|
||||
responseText = Confirmclasses();
|
||||
break;
|
||||
case "AMES_initOnline":
|
||||
responseText = initOnline(opName);
|
||||
break;
|
||||
//case "AMES_WorkingHours_OnlineInfo":
|
||||
// responseText = WorkingHours_OnlineInfo(opName);
|
||||
// break;
|
||||
////工时补录
|
||||
//case "AMES_OrderNum_Query":
|
||||
// responseText = OrderNum_Query();
|
||||
// break;
|
||||
//case "AMES_init_WorkTime":
|
||||
// responseText = init_WorkTime(opName);
|
||||
// break;
|
||||
//case "AMES_Worktime_completeCount":
|
||||
// responseText = Worktime_completeCount();
|
||||
// break;
|
||||
//case "AMES_init_Statistics":
|
||||
// responseText = init_Statistics(opName);
|
||||
// break;
|
||||
//case "AMES_Confirm_Person":
|
||||
// responseText = Confirm_Person();
|
||||
// break;
|
||||
//case "AMES_Init_OrderNum_data":
|
||||
// responseText = Init_OrderNum_data();
|
||||
// break;
|
||||
////班次名称查询
|
||||
//case "AMES_SelectClassCode":
|
||||
// responseText = ClassesCodeSelect();
|
||||
// break;
|
||||
////工时补录增加
|
||||
//case "AMES_Insert_WorkTime":
|
||||
// responseText = Insert_WorkTime(opName);
|
||||
// break;
|
||||
////--------物料拉动-配送单接收-----
|
||||
//case "AMES_receiveDistributionOrder":
|
||||
// responseText = ReceiveDistributionOrder();
|
||||
// break;
|
||||
//--------物料拉动-直供上线-----
|
||||
//case "AMES_initDirectUpload":
|
||||
// responseText = initDirectUpload(opName,);
|
||||
// break;
|
||||
//case "AMES_directUpload_Verify":
|
||||
// responseText = DirectUpload_Verify(opName,,);
|
||||
// break;
|
||||
//case "AMES_directUpload_Barcode_Verify_OK":
|
||||
// responseText = DirectUpload_Barcode_Verify_OK(opName,);
|
||||
// break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
870
Common/08WebFun_base/WebFun_base/MesWebFun_MateriallPullFun.cs
Normal file
870
Common/08WebFun_base/WebFun_base/MesWebFun_MateriallPullFun.cs
Normal file
@@ -0,0 +1,870 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using bizFacade;
|
||||
using System.Data;
|
||||
//using SystemFramework;
|
||||
using MesWebFun_MateriallPull.BarCodeServer_Pro;
|
||||
|
||||
namespace MesWebFun_MateriallPull
|
||||
{
|
||||
public partial class MesWebFun_MateriallPull
|
||||
{
|
||||
private static string Init_WorkStationMaterial(string OpName)
|
||||
{
|
||||
DataTable dt;
|
||||
MaterialPull.getWorkStationMaterialInfo(OpName, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
return JsonHelper.CreateJsonParameters(dt, true, dt.Rows.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
#region 批次接收
|
||||
|
||||
/// <summary>
|
||||
/// 物料号获取
|
||||
/// </summary>
|
||||
/// <returns></returns
|
||||
private static string InitMaterial_Dialog_MaterialNum(string OpName)
|
||||
{
|
||||
|
||||
DataTable dt = null;
|
||||
MaterialPull.InitMaterial_Dialog_MaterialNum(OpName, out dt);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (dt != null)
|
||||
{
|
||||
sb.Append("[{");
|
||||
if (dt.Rows.Count == 1)
|
||||
{
|
||||
sb.Append("\"id\":0,\"text\":\"" + dt.Rows[0][0] + "\",\"selected\":true}]");
|
||||
}
|
||||
else if (dt.Rows.Count > 1)
|
||||
{
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
sb.Append("\"id\":" + i + ",\"text\":\"" + dt.Rows[0][0] + "\",\"selected\":true},{");
|
||||
}
|
||||
if (i != dt.Rows.Count - 1 & i != 0)
|
||||
{
|
||||
sb.Append("\"id\":" + i + ",\"text\":\"" + dt.Rows[i][0] + "\"},{");
|
||||
}
|
||||
else if (i == dt.Rows.Count - 1)
|
||||
{
|
||||
sb.Append("\"id\":" + i + ",\"text\":\"" + dt.Rows[i][0] + "\"}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取卡片一览信息
|
||||
/// </summary>
|
||||
/// <returns></returns
|
||||
private static string getMaterialNumInfo(string OpName, string MateraiNum)
|
||||
{
|
||||
// string MateraiNum = HttpContext.Current.Request["MateraiNum"];
|
||||
DataTable dt;
|
||||
MaterialPull.getMaterialNumInfo(OpName, MateraiNum, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
return JsonHelper.CreateJsonParameters(dt, true, dt.Rows.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
//return "";
|
||||
return "{ total: 1,rows: }";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 批次接收
|
||||
|
||||
#region 库存盘点
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_库存盘点
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string initStockCount(string OpName, string MaterialNum)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
|
||||
//string MaterialNum = HttpContext.Current.Request["MaterialNum"];
|
||||
MaterialPull.init_StockCount(OpName, MaterialNum, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Init_MaterialNum_Combobox(string OpName)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
|
||||
MaterialPull.Init_MaterialNumCombobox(OpName, out dt);
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Init_Final_OrderNumber_Combobox()
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
MaterialPull.Init_FinalOrderNumberCombobox(out dt);
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Consume_stockcount(string OpName, string ConsumeNum, string OrderNumber,string CardNum)
|
||||
{
|
||||
//string ConsumeNum = HttpContext.Current.Request["ConsumeNum"];
|
||||
//string OrderNumber = HttpContext.Current.Request["OrderNumber"];
|
||||
|
||||
//string CardNum = HttpContext.Current.Request["CardNum"];
|
||||
MaterialPull.Consume_StockCount(OrderNumber, ConsumeNum, OpName, CardNum);
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion 库存盘点
|
||||
|
||||
#region FTT模块
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_FTT
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string ConvertOpname_Ftt(string Opname)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
MaterialPull.OpName_Convert_Select(Opname, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Insert_FTT_Confirm(string Opname, string Final_EngineNum, string DefectGroup, string DefectCode)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
//string Final_EngineNum = HttpContext.Current.Request["Final_EngineNum"];
|
||||
//string DefectGroup = HttpContext.Current.Request["DefectGroup"];
|
||||
//string DefectCode = HttpContext.Current.Request["DefectCode"];
|
||||
MaterialPull.Confirm_EngineNum(Final_EngineNum, DefectGroup, DefectCode, Opname, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = dt.Rows[0][0].ToString();
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Insert_FTT_Informatinon(string Opname, string EngineNum, string DefectGroup, string DefectCode, string ProblemDate, int callCount)
|
||||
{
|
||||
string Msg = "";
|
||||
//string EngineNum = HttpContext.Current.Request["Final_EngineNum"];
|
||||
//string DefectGroup = HttpContext.Current.Request["DefectGroup"];
|
||||
//string DefectCode = HttpContext.Current.Request["DefectCode"];
|
||||
//string ProblemDate = HttpContext.Current.Request["ProblemDate"];
|
||||
//int callCount = Convert.ToInt32(HttpContext.Current.Request["callCount"]);
|
||||
MaterialPull.Insert_FTTInformation(Opname, "2", EngineNum, DefectGroup, DefectCode, ProblemDate, callCount, out Msg);
|
||||
|
||||
return Msg;
|
||||
}
|
||||
|
||||
private static string Init_FinalList_Combobox(string Opname)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
MaterialPull.Init_FinalListCombobox(Opname, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string Init_DefectCode_Combobox(string Opname)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
MaterialPull.Init_DefectCodeCombobox(Opname, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
#endregion FTT模块
|
||||
|
||||
#region 打卡上线模块
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_打卡上线
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string GetClasses()
|
||||
{
|
||||
string text = null;
|
||||
System.Data.DataTable dt = null;
|
||||
MaterialPull.Getclasses(out dt);
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string initOnline(string opName)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
System.Data.DataTable dt = null;
|
||||
string classes = "";
|
||||
string operatorName = "";
|
||||
string loginTime = "";
|
||||
string operatorCode = "";
|
||||
string opname = "";
|
||||
MaterialPull.Search_OnlineInfo(opName, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
sb.Append("[");
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
classes = dt.Rows[i]["班次"].ToString();
|
||||
System.Data.DataTable dt_output = null;
|
||||
MaterialPull.ClassName_Select(classes, out dt_output);
|
||||
if (dt_output != null)
|
||||
{
|
||||
if (dt_output.Rows.Count > 0)
|
||||
{
|
||||
classes = dt_output.Rows[0]["班次描述"].ToString();
|
||||
}
|
||||
}
|
||||
opname = dt.Rows[i]["工位号"].ToString();
|
||||
operatorCode = dt.Rows[i]["操作者工号"].ToString();
|
||||
operatorName = dt.Rows[i]["操作者姓名"].ToString();
|
||||
loginTime = dt.Rows[i]["操作时间"].ToString();
|
||||
sb.Append("{\"工位号\":\"" + opname + "\",\"操作者工号\":\"" + operatorCode + "\",\"操作者姓名\":\"" + operatorName + "\",\"班次\":\"" + classes + "\",\"操作时间\":\"" + loginTime + "\"},");
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
}
|
||||
}
|
||||
sb.Append("]");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string Confirmclasses()
|
||||
{
|
||||
string Confirmclass = "";
|
||||
System.Data.DataTable dt_output = null;
|
||||
MaterialPull.ConfirmClass(out Confirmclass);
|
||||
string ConfirmclassName = "";
|
||||
MaterialPull.ClassName_Select(Confirmclass, out dt_output);
|
||||
if (dt_output != null)
|
||||
{
|
||||
if (dt_output.Rows.Count > 0)
|
||||
{
|
||||
ConfirmclassName = dt_output.Rows[0]["班次描述"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return ConfirmclassName;
|
||||
}
|
||||
|
||||
private static string WorkingHours_OnlineInfo(string Opname, string Password, string Classes, string OperatorName)
|
||||
{
|
||||
//string Password = "";
|
||||
//string Classes = "";
|
||||
//string OperatorName = "";
|
||||
string Msg = "";
|
||||
//Password = HttpContext.Current.Request["Password"];
|
||||
//Classes = HttpContext.Current.Request["Classes"];
|
||||
//OperatorName = HttpContext.Current.Request["OperatorName"];
|
||||
MaterialPull.Insert_WorkingHours(Opname, OperatorName, Password, Classes, out Msg);
|
||||
|
||||
return Msg;
|
||||
}
|
||||
|
||||
#endregion 打卡上线模块
|
||||
|
||||
#region 工时
|
||||
|
||||
private static string OrderNum_Query(string start_time, string end_time)
|
||||
{
|
||||
string text = "";
|
||||
// string end_time = "";
|
||||
// string start_time = "";
|
||||
System.Data.DataTable dt = null;
|
||||
|
||||
// start_time = HttpContext.Current.Request["Plan_start_time"];
|
||||
|
||||
// end_time = HttpContext.Current.Request["Plan_end_time"];
|
||||
|
||||
start_time = start_time + " 00:00:00";
|
||||
end_time = end_time + " 23:59:59";
|
||||
|
||||
MaterialPull.Init_OrderNum_Query(start_time, end_time, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
//工时补录初始化
|
||||
private static string init_WorkTime(string Opname, string Ordernum)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
string text = "";
|
||||
int Num = 1;
|
||||
string classes = "";
|
||||
string opname = "";
|
||||
string operatorCode = "";
|
||||
string operatorName = "";
|
||||
string compeleteCount = "";
|
||||
string OrderNum = "";
|
||||
string UploadTime = "";
|
||||
System.Data.DataTable dt = null;
|
||||
// string Ordernum = HttpContext.Current.Request["OrderNum"];
|
||||
MaterialPull.Init_Worktime(Ordernum, Opname, Num, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
sb.Append("[");
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
System.Data.DataTable dt_output = null;
|
||||
classes = dt.Rows[i]["班次"].ToString();
|
||||
MaterialPull.ClassName_Select(classes, out dt_output);
|
||||
if (dt_output != null)
|
||||
{
|
||||
if (dt_output.Rows.Count > 0)
|
||||
{
|
||||
classes = dt_output.Rows[0]["班次描述"].ToString();
|
||||
}
|
||||
}
|
||||
OrderNum = dt.Rows[i]["订单号"].ToString();
|
||||
opname = dt.Rows[i]["工位号"].ToString();
|
||||
operatorCode = dt.Rows[i]["操作者工号"].ToString();
|
||||
operatorName = dt.Rows[i]["员工姓名"].ToString();
|
||||
compeleteCount = dt.Rows[i]["报工数量"].ToString();
|
||||
UploadTime = dt.Rows[i]["报工时间"].ToString();
|
||||
sb.Append("{\"订单号\":\"" + OrderNum + "\",\"工位号\":\"" + opname + "\",\"员工姓名\":\"" + operatorName + "\",\"操作者工号\":\"" + operatorCode + "\",\"报工数量\":\"" + compeleteCount + "\",\"班次\":\"" + classes + "\",\"报工时间\":\"" + UploadTime + "\"},");
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
}
|
||||
}
|
||||
sb.Append("]");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string Worktime_completeCount(string OrderNum)
|
||||
{
|
||||
string text = "0";
|
||||
System.Data.DataTable dt = null;
|
||||
// string OrderNum = HttpContext.Current.Request["OrderNum"];
|
||||
MaterialPull.workTime_CompleteCount(OrderNum, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = dt.Rows[0][0].ToString();
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string init_Statistics(string Opname, string Ordernum)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
// string Ordernum = HttpContext.Current.Request["OrderNum"];
|
||||
MaterialPull.init_Statistics(Ordernum, Opname, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验工时补录人员
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string Confirm_Person(string OperatorName)
|
||||
{
|
||||
string text = "0";
|
||||
System.Data.DataTable dt = null;
|
||||
// string OperatorName = HttpContext.Current.Request["OperatorName"];
|
||||
MaterialPull.Confirm_Person(OperatorName, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = dt.Rows[0][0].ToString();
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
//查询产品型号
|
||||
private static string Init_OrderNum_data(string Ordernum)
|
||||
{
|
||||
string text = "";
|
||||
System.Data.DataTable dt = null;
|
||||
// string Ordernum = HttpContext.Current.Request["OrderNum"];
|
||||
MaterialPull.Init_Ordernum_data(Ordernum, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
text = JsonHelper.DataTableToJson(dt);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string ClassesCodeSelect(string ClassesName)
|
||||
{
|
||||
string ClassCode = "";
|
||||
System.Data.DataTable dt_output = null;
|
||||
// string ClassesName = HttpContext.Current.Request["ClassesName"];
|
||||
MaterialPull.ClassCode_Select(ClassesName, out dt_output);
|
||||
if (dt_output != null)
|
||||
{
|
||||
if (dt_output.Rows.Count > 0)
|
||||
{
|
||||
ClassCode = dt_output.Rows[0]["班次代码"].ToString();
|
||||
}
|
||||
}
|
||||
return ClassCode;
|
||||
}
|
||||
|
||||
//工时补录增加
|
||||
private static string Insert_WorkTime(string Opname, string Ordernum, string OperatorName, string Classes, string EngineType, int Count, string UploadTime)
|
||||
{
|
||||
string text = "";
|
||||
//string Ordernum = HttpContext.Current.Request["OrderNum"];
|
||||
//string OperatorName = HttpContext.Current.Request["OperatorName"];
|
||||
//string Classes = HttpContext.Current.Request["Classes"];
|
||||
//string EngineType = HttpContext.Current.Request["EngineType"];
|
||||
//int Count = Convert.ToInt32(HttpContext.Current.Request["Count"]);
|
||||
//string UploadTime = HttpContext.Current.Request["UploadTime"];
|
||||
|
||||
MaterialPull.Workinghours_Insert(Ordernum, EngineType, Opname, Count, OperatorName, Classes, UploadTime);
|
||||
return text;
|
||||
}
|
||||
|
||||
#endregion 工时
|
||||
|
||||
#region 配送单接收模块
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动-配送单接收
|
||||
/// </summary>
|
||||
/// <returns></returns
|
||||
private static string ReceiveDistributionOrder(string distributionNum)
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
// string distributionNum = HttpContext.Current.Request["distributionNum"];
|
||||
if (distributionNum == null)
|
||||
return text;
|
||||
System.Data.DataTable dt_Document;
|
||||
MaterialPull.DocumentOutLineInfo_Select(distributionNum, out dt_Document);
|
||||
if (dt_Document != null)
|
||||
{
|
||||
//已经接收
|
||||
if (dt_Document.Rows.Count > 0)
|
||||
{
|
||||
text = "配送单号: " + distributionNum + " 已经接收!";
|
||||
return text;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (distributionNum == "")
|
||||
{
|
||||
text = "请扫描配送单号!";
|
||||
return text;
|
||||
}
|
||||
text = MaterialPull_Document_Exec(distributionNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return text;
|
||||
}
|
||||
|
||||
private static bool isExec = false;//防止多次接收
|
||||
|
||||
private static string MaterialPull_Document_Exec(string distributionNum)
|
||||
{
|
||||
string text = "";
|
||||
if (!isExec)//为false才允许接收
|
||||
{
|
||||
//string distributionNum = HttpContext.Current.Request["distributionNum"];
|
||||
isExec = true;
|
||||
text = MaterialPull_Document_Select(distributionNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "不允许接收!";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string MaterialPull_Document_Select(string distributionNum)
|
||||
{
|
||||
//string distributionNum = HttpContext.Current.Request["distributionNum"];
|
||||
string process_Message;
|
||||
try
|
||||
{
|
||||
string wkc = "";
|
||||
System.Data.DataTable dt_wkc;
|
||||
MaterialPull.WorkStationInfo_Select(out dt_wkc);
|
||||
if (dt_wkc != null)
|
||||
{
|
||||
if (dt_wkc.Rows.Count > 0)
|
||||
{
|
||||
wkc = dt_wkc.Rows[0]["工作中心"].ToString();
|
||||
}
|
||||
}
|
||||
if (wkc == "")
|
||||
{
|
||||
process_Message = "工作中心为空!";
|
||||
return process_Message;
|
||||
}
|
||||
string document_Num = distributionNum.ToString();
|
||||
System.Data.DataTable dt_Document;
|
||||
//调试、先屏蔽
|
||||
var BarCodeServer_Document = new BarCodeServer_Pro.BarCodeSever();
|
||||
//sql版本需要用dataset承接
|
||||
DataSet ds_Document;
|
||||
ds_Document = BarCodeServer_Document.Web_MaterialPull_DocumentNum_Select(document_Num, wkc);
|
||||
dt_Document = ds_Document.Tables[0];
|
||||
//Orucal版本需要用dataset承接
|
||||
//dt_Document = BarCodeServer_Document.Web_MaterialPull_DocumentNum_Select(document_Num, wkc);
|
||||
if (dt_Document != null)
|
||||
{
|
||||
if (dt_Document.Rows.Count > 0)
|
||||
{
|
||||
//将条码信息插入到"配送单"表,状态标识为0,暂时不做处理
|
||||
if (MaterialPull.MaterialPull_DocumentInfo_Add(dt_Document))
|
||||
{
|
||||
//执行接收处理
|
||||
process_Message = MaterialPull_Document_Receive(document_Num, BarCodeServer_Document);
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = "-1@失败,[" + document_Num + "]不能重复接收!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = "-1@失败,[" + document_Num + "]无此配送单信息!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = "-1@失败,[" + document_Num + "]无此配送单信息!";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
process_Message = "-1@未知错误,联系管理员!";
|
||||
}
|
||||
isExec = false;
|
||||
return process_Message;
|
||||
}
|
||||
|
||||
//执行接收,传入webservice
|
||||
private static string MaterialPull_Document_Receive(string document_Num, BarCodeSever BarCodeServer_Document)
|
||||
{
|
||||
string process_Message = "";
|
||||
try
|
||||
{
|
||||
string r_source_id = "", r_orderNum = "", r_plant_id = "", r_wkc = "",
|
||||
r_workNum = "", r_delivery_num = "", r_item_code = "", r_recept_flag = "", r_type = "";
|
||||
string p_GroupId = "";
|
||||
string documentInfo = "";
|
||||
|
||||
//产生接收记录,获得GROUPID,还有一个作用就是防止重复接收
|
||||
MaterialPull.MaterialPull_DocumentInfo_CreateRecord(document_Num, out documentInfo);
|
||||
if (documentInfo.Length > 2)
|
||||
{
|
||||
//产生接收记录成功
|
||||
if (documentInfo.Substring(0, 2) == "0@")
|
||||
{
|
||||
p_GroupId = documentInfo.Substring(2, documentInfo.Length - 2);
|
||||
if (p_GroupId == "")
|
||||
return "-1@失败,[" + document_Num + "]产生接收记录失败";
|
||||
System.Data.DataTable dt_record;
|
||||
MaterialPull.MaterialPull_DocumentInfo_ReceiveRecord_Select(document_Num, p_GroupId, out dt_record);
|
||||
if (dt_record != null)
|
||||
{
|
||||
if (dt_record.Rows.Count > 0)
|
||||
{
|
||||
r_source_id = dt_record.Rows[0]["ID"].ToString();
|
||||
r_orderNum = dt_record.Rows[0]["订单号"].ToString();
|
||||
r_plant_id = dt_record.Rows[0]["工厂"].ToString();
|
||||
r_wkc = dt_record.Rows[0]["工作中心"].ToString();
|
||||
r_workNum = dt_record.Rows[0]["工位号"].ToString();
|
||||
r_delivery_num = dt_record.Rows[0]["配送单号"].ToString();
|
||||
r_item_code = dt_record.Rows[0]["物料号"].ToString();
|
||||
r_recept_flag = dt_record.Rows[0]["是否接收"].ToString();
|
||||
r_type = dt_record.Rows[0]["类型"].ToString();
|
||||
|
||||
string outResult;
|
||||
|
||||
outResult = BarCodeServer_Document.Web_MaterialPull_DocumentNum_VerifyOK(r_source_id, r_orderNum, r_plant_id, r_wkc,
|
||||
r_workNum, r_delivery_num, r_item_code, r_recept_flag, r_type, p_GroupId);
|
||||
if (outResult.Length > 2)
|
||||
{
|
||||
//调用成功的话 返回“0@成功0@”
|
||||
//将调用信息更新到接收记录表中
|
||||
//执行调用成功存储过程,将临时表中数据加到库存中
|
||||
if (outResult.Substring(0, 2) == "0@")
|
||||
{
|
||||
System.Data.DataSet Select_AndonCallInfo_DS = BarCodeServer_Document.Select_DocumentReceptCord_Result(document_Num, p_GroupId);
|
||||
System.Data.DataTable Select_AndonCallInfo = Select_AndonCallInfo_DS.Tables[0];
|
||||
if (Select_AndonCallInfo != null)
|
||||
{
|
||||
if (Select_AndonCallInfo.Rows.Count > 0)
|
||||
{
|
||||
string PROCESS_STATUS = Select_AndonCallInfo.Rows[0]["PROCESS_STATUS"].ToString();
|
||||
if (PROCESS_STATUS != "SUCCESS")
|
||||
{
|
||||
MaterialPull.MaterialPull_DocumentInfo_NoticeOK(document_Num, p_GroupId, 0, outResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialPull.MaterialPull_DocumentInfo_NoticeOK(document_Num, p_GroupId, 1, outResult);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialPull.MaterialPull_DocumentInfo_NoticeOK(document_Num, p_GroupId, 0, outResult);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialPull.MaterialPull_DocumentInfo_NoticeOK(document_Num, p_GroupId, 0, outResult);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialPull.MaterialPull_DocumentInfo_NoticeOK(document_Num, p_GroupId, 0, outResult);
|
||||
}
|
||||
}
|
||||
process_Message = outResult + "[" + document_Num + "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = "-1@失败,[" + document_Num + "]产生接收记录失败";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = "-1@失败,[" + document_Num + "]产生接收记录失败";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process_Message = documentInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
process_Message = "-1@未知错误,[" + document_Num + "]联系管理员!";
|
||||
}
|
||||
return process_Message;
|
||||
}
|
||||
|
||||
#endregion 配送单接收模块
|
||||
|
||||
#region 直供上线模块
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动-直供上线
|
||||
/// </summary>
|
||||
/// <returns></returns
|
||||
/// <returns></returns>
|
||||
private static string initDirectUpload(string OpName,string document_Num)
|
||||
{
|
||||
string text = "[{}]";
|
||||
try
|
||||
{
|
||||
DataTable dt_VarifyTemp = new DataTable();
|
||||
string process_Message;
|
||||
|
||||
|
||||
string wkc = DirectUpload_Ini_WKC();
|
||||
// string document_Num = HttpContext.Current.Request["Barcode"];
|
||||
if (document_Num == null)
|
||||
return text;
|
||||
System.Data.DataTable dt_Document;
|
||||
System.Data.DataSet ds_Document;
|
||||
var direct = new BarCodeServer_Pro.BarCodeSever();
|
||||
ds_Document = direct.Web_DirectUpload_Document_Select(document_Num, wkc);
|
||||
dt_Document = ds_Document.Tables[0];
|
||||
MaterialPull.DirectUpload_VerifyTempTable_Delete(OpName);
|
||||
MaterialPull.DirectUpload_VerifyTempTable_Add(OpName, dt_Document);
|
||||
MaterialPull.DirectUpload_VerifyTempTable_Select(OpName, document_Num, out process_Message, out dt_VarifyTemp);
|
||||
if (dt_VarifyTemp == null)
|
||||
{
|
||||
process_Message = "条码查询失败!请重新扫描";
|
||||
return text = "{\"result\":\"1\"}"; ;
|
||||
}
|
||||
|
||||
if (dt_VarifyTemp.Rows.Count == 0)
|
||||
{
|
||||
process_Message = "条码查询失败!请重新扫描";
|
||||
}
|
||||
|
||||
text = JsonHelper.DataTableToJson(dt_VarifyTemp);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ }
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string DirectUpload_Ini_WKC()
|
||||
{
|
||||
string work_center_code = "";
|
||||
System.Data.DataTable dt_wkc;
|
||||
dt_wkc = MaterialPull.DirectUpload_WorkCenterCode_Select();
|
||||
if (dt_wkc != null)
|
||||
{
|
||||
if (dt_wkc.Rows.Count > 0)
|
||||
{
|
||||
work_center_code = dt_wkc.Rows[0]["工作中心"].ToString();
|
||||
}
|
||||
}
|
||||
return work_center_code;
|
||||
}
|
||||
|
||||
private static string DirectUpload_Verify(string OpName, string document_Num, string barcode)
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
string process_Message = "";
|
||||
//string document_Num = HttpContext.Current.Request["documentNum"];//送货单行条码
|
||||
//string barcode = HttpContext.Current.Request["barcode"];//卡片条码
|
||||
System.Data.DataTable dt_VarifyTemp;
|
||||
MaterialPull.DirectUpload_VerifyTempTable_Barcode_Select(OpName, document_Num, barcode, out process_Message, out dt_VarifyTemp);
|
||||
text = JsonHelper.DataTableToJson(dt_VarifyTemp);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string DirectUpload_Barcode_Verify_OK(string OpName, string document_Num)
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
// string document_Num = HttpContext.Current.Request["documentNum"];//送货单行条码
|
||||
if (document_Num == null)
|
||||
return text;
|
||||
string process_Message_verify = "";
|
||||
string p_GroupId = "";
|
||||
|
||||
string r_source_id = "", r_orderNum = "", r_plant_id = "", r_wkc = "",
|
||||
r_workNum = "", r_delivery_num = "", r_item_code = "", r_recept_flag = "";
|
||||
|
||||
System.Data.DataTable dt_ReceiveRecord;
|
||||
|
||||
MaterialPull.DirectUpload_VerifyTempTable_VerifyOK(OpName, document_Num, out process_Message_verify);
|
||||
if (process_Message_verify.Length > 2)
|
||||
{
|
||||
//产生接收记录成功
|
||||
if (process_Message_verify.Substring(0, 2) == "0@")
|
||||
{
|
||||
p_GroupId = process_Message_verify.Substring(2, process_Message_verify.Length - 2);
|
||||
if (p_GroupId == "")
|
||||
return text;
|
||||
MaterialPull.DirectUpload_ReceiveRecord_Select(OpName, document_Num, p_GroupId, out dt_ReceiveRecord);
|
||||
if (dt_ReceiveRecord != null)
|
||||
{
|
||||
if (dt_ReceiveRecord.Rows.Count > 0)
|
||||
{
|
||||
r_source_id = dt_ReceiveRecord.Rows[0]["ID"].ToString();
|
||||
r_orderNum = dt_ReceiveRecord.Rows[0]["订单号"].ToString();
|
||||
r_plant_id = dt_ReceiveRecord.Rows[0]["工厂"].ToString();
|
||||
r_wkc = dt_ReceiveRecord.Rows[0]["工作中心"].ToString();
|
||||
r_workNum = dt_ReceiveRecord.Rows[0]["工位号"].ToString();
|
||||
r_delivery_num = dt_ReceiveRecord.Rows[0]["配送单号"].ToString();
|
||||
r_item_code = dt_ReceiveRecord.Rows[0]["物料号"].ToString();
|
||||
r_recept_flag = dt_ReceiveRecord.Rows[0]["是否接收"].ToString();
|
||||
|
||||
r_workNum = DirectUpload_Ini_Opname(r_workNum);//产生接收记录工位号与SAP一致
|
||||
|
||||
string outResult;
|
||||
var direct = new BarCodeServer_Pro.BarCodeSever();
|
||||
outResult = direct.Web_DirectUpload_Document_VerifyOK(r_source_id, r_orderNum, r_plant_id, r_wkc,
|
||||
r_workNum, r_delivery_num, r_item_code, r_recept_flag, p_GroupId);
|
||||
if (outResult.Length > 2)
|
||||
{
|
||||
//调用成功的话 返回“0@成功0@”
|
||||
//将调用信息更新到接收记录表中
|
||||
//执行调用成功存储过程,将临时表中数据加到库存中
|
||||
if (outResult.Substring(0, 2) == "0@")
|
||||
{
|
||||
MaterialPull.DirectUpload_VerifyTempTable_NoticeOK(OpName, document_Num, p_GroupId, 1, outResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialPull.DirectUpload_VerifyTempTable_NoticeOK(OpName, document_Num, p_GroupId, 0, outResult);
|
||||
}
|
||||
text = JsonHelper.ObjectToJson(outResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//已经接收,不允许重复接收
|
||||
else
|
||||
{
|
||||
text = JsonHelper.ObjectToJson(process_Message_verify);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string DirectUpload_Ini_Opname(string opName_Ori)
|
||||
{
|
||||
string opName_Convert = "";
|
||||
System.Data.DataTable dt_opName_Convert;
|
||||
dt_opName_Convert = MaterialPull.DirectUpload_OpName_Select(opName_Ori);
|
||||
if (dt_opName_Convert != null)
|
||||
{
|
||||
if (dt_opName_Convert.Rows.Count > 0)
|
||||
{
|
||||
opName_Convert = dt_opName_Convert.Rows[0]["指南工位号"].ToString();
|
||||
}
|
||||
}
|
||||
return opName_Convert;
|
||||
}
|
||||
|
||||
#endregion 直供上线模块
|
||||
}
|
||||
}
|
||||
104
Common/08WebFun_base/WebFun_base/MesWebFun_Special.cs
Normal file
104
Common/08WebFun_base/WebFun_base/MesWebFun_Special.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using bizFacade;
|
||||
using System.Data;
|
||||
////using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class MesWebFun_Special
|
||||
{
|
||||
/// <summary>
|
||||
/// 提供调用特殊工位类型方法的调用入口
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public static string SpecialFuctionRequstBase( string cmd,string opName)
|
||||
{
|
||||
// string filepath = context.Request.UrlReferrer.ToString();
|
||||
// string[] fileItem = filepath.Split('/');
|
||||
// string item = fileItem[fileItem.Length - 1];
|
||||
// string[] itemUrl = item.Split('?');
|
||||
// string destUrl = itemUrl[0];//取得页面值
|
||||
// string mesWebFun = ApplicationConfig.MesWebFun[destUrl].ToString();
|
||||
// string type = HttpContext.Current.Request["type"];
|
||||
string responseText = "";
|
||||
// switch (mesWebFun)
|
||||
{
|
||||
//case "01":
|
||||
//WebFunction01 fun01 = new WebFunction01();
|
||||
// responseText = fun01.ProcessRequest(context);
|
||||
// break;
|
||||
//case "02":
|
||||
// WebFunction02 fun02 = new WebFunction02();
|
||||
// responseText = fun02.ProcessRequest(context);
|
||||
// break;
|
||||
//case "04":
|
||||
// WebFunction04 fun04 = new WebFunction04();
|
||||
// responseText = fun04.ProcessRequest(context);
|
||||
// break;
|
||||
//case "05":
|
||||
// WebFunction05 fun05 = new WebFunction05();
|
||||
// responseText = fun05.ProcessRequest(context);
|
||||
// break;
|
||||
//case "06":
|
||||
// WebFunction06 fun06 = new WebFunction06();
|
||||
// responseText = fun06.ProcessRequest(context);
|
||||
// break;
|
||||
//case "07":
|
||||
// WebFunction07 fun07 = new WebFunction07();
|
||||
// responseText = fun07.ProcessRequest(context);
|
||||
// break;
|
||||
//case "08":
|
||||
// WebFunction08 fun08 = new WebFunction08();
|
||||
// responseText = fun08.ProcessRequest(context);
|
||||
// break;
|
||||
//case "10":
|
||||
// WebFunction10 fun10 = new WebFunction10();
|
||||
// responseText = fun10.ProcessRequest(context);
|
||||
// break;
|
||||
//case "11":
|
||||
// WebFunction11 fun11 = new WebFunction11();
|
||||
// responseText = fun11.ProcessRequest(context);
|
||||
// break;
|
||||
//case "12":
|
||||
// WebFunction12 fun12 = new WebFunction12();
|
||||
// responseText = fun12.ProcessRequest(context);
|
||||
// break;
|
||||
//case "13":
|
||||
// WebFunction13 fun13 = new WebFunction13();
|
||||
// responseText = fun13.ProcessRequest(context);
|
||||
// break;
|
||||
//case "14":
|
||||
// WebFunction14 fun14 = new WebFunction14();
|
||||
// responseText = fun14.ProcessRequest(context);
|
||||
// break;
|
||||
//case "15":
|
||||
// WebFunction15 fun15 = new WebFunction15();
|
||||
// responseText = fun15.ProcessRequest(context);
|
||||
// break;
|
||||
//case "16":
|
||||
// WebFunction16 fun16 = new WebFunction16();
|
||||
// responseText = fun16.ProcessRequest(context);
|
||||
// break;
|
||||
//case "17":
|
||||
// WebFunction17 fun17 = new WebFunction17();
|
||||
// responseText = fun17.ProcessRequest(context);
|
||||
// break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
231
Common/08WebFun_base/WebFun_base/MesWebFun_base.cs
Normal file
231
Common/08WebFun_base/WebFun_base/MesWebFun_base.cs
Normal file
@@ -0,0 +1,231 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using bizFacade;
|
||||
using System.Data;
|
||||
//using SystemFramework;
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MesWebFun_base
|
||||
{
|
||||
public string ProcessRequest(string cmd,string opName/*,string engineID*/)
|
||||
{
|
||||
string responseText = "";
|
||||
switch (cmd)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
responseText = MobySelect(opName);
|
||||
break;
|
||||
//操作图片
|
||||
case "PictureShow":
|
||||
responseText = PictureShow(opName);
|
||||
break;
|
||||
//物料信息
|
||||
case "MaterialList":
|
||||
responseText = MaterialList(opName);
|
||||
break;
|
||||
//操作指南
|
||||
case "ProcessList":
|
||||
responseText = ProcessList(opName);
|
||||
break;
|
||||
case "ShaftPosition":
|
||||
responseText = ShaftPotion_Select(opName);
|
||||
break;
|
||||
//选择订单_增加订单号
|
||||
//case "InsertOrderNum":
|
||||
// responseText = InsertOrderNum(,opName);
|
||||
// break;
|
||||
//选择订单_增加发动机型号
|
||||
//case "InsertEngineNum":
|
||||
// responseText = InsertEngineNum(opName,,);
|
||||
// break;
|
||||
//订单完工_选择机型
|
||||
case "Orderenginetypeselect":
|
||||
responseText = Orderenginetypeselect();
|
||||
break;
|
||||
//物料拉动_确认接受
|
||||
//case "AffirmReceive":
|
||||
// responseText = AffirmReceive(opName,);
|
||||
// break;
|
||||
case "ShowTimelyQuality":
|
||||
responseText = Quality_Select(opName);
|
||||
break;
|
||||
//case "MesloadingSelect":
|
||||
// responseText = MesloadingSelect(opName);
|
||||
// break;
|
||||
//工步属性
|
||||
case "StepProperty":
|
||||
responseText = StepProperty(opName);
|
||||
break;
|
||||
//订单信息
|
||||
case "OrderFormList":
|
||||
responseText = OrderFormList(opName);
|
||||
break;
|
||||
//查询单号
|
||||
case "MaterialPush_ListNumer":
|
||||
responseText = MaterialPush_ListNumer(opName);
|
||||
break;
|
||||
//根据单号查询详细信息
|
||||
//case "MaterialPush_Details":
|
||||
// responseText = MaterialPush_Details(opName);
|
||||
// break;
|
||||
case "QualityDataButton_bgColor_Select":
|
||||
responseText = QualityDataButton_bgColor_Select(opName);
|
||||
break;
|
||||
//查询具体ando类型明细
|
||||
case "InitComboboxAndoDetail":
|
||||
responseText = InitComboboxAndoDetail();
|
||||
break;//InitMaterailAndo
|
||||
case "InitMaterailAndo":
|
||||
responseText = InitMaterailAndo(opName);
|
||||
break;
|
||||
//case "InitMaterailAndoCount":
|
||||
// responseText = InitMaterailAndoCount(opName);
|
||||
// break;
|
||||
//物料ando_呼叫
|
||||
//case "submitAndoMaterialCall":
|
||||
// responseText = submitAndoMaterialCall(opName);
|
||||
// break;
|
||||
//ando界面_物料ando_更新物料安东table
|
||||
//case "updataAndoMaterialTabel":
|
||||
// responseText = updataAndoMaterialTabel(opName);
|
||||
// break;
|
||||
//ando界面_质量ando_更新质量安东table
|
||||
//case "updataAndoQualityTabel":
|
||||
// responseText = updataAndoQualityTabel(opName);
|
||||
// break;
|
||||
////ando界面_物料ando_物料ando复位
|
||||
//case "submitAndoMaterialReset":
|
||||
// responseText = submitAndoMaterialReset(opName);
|
||||
// break;
|
||||
////ando界面_复位
|
||||
//case "submitAndoQualityReset":
|
||||
// responseText = submitAndoQualityReset(opName);
|
||||
// break;
|
||||
//////////////////////设备管理
|
||||
case "LoadMachineType": //初始化设备维护类型
|
||||
responseText = LoadMachineType(opName);
|
||||
break;
|
||||
//case "ShowMaintainData":
|
||||
// responseText = ShowMaintainData(opName);
|
||||
// break;
|
||||
//case "ShowMaintainPic":
|
||||
// responseText = ShowMaintainPic(opName);
|
||||
// break;
|
||||
//case "equipmentmanagementSubmit":
|
||||
// responseText = equipmentmanagementSubmit(opName);
|
||||
// break;//equipmentmanagementSubmit
|
||||
/////////////////////////质量查询
|
||||
//case "QualityDataSelect":
|
||||
// responseText = QualityDataSelect(opName);
|
||||
// break;
|
||||
//弹窗消息
|
||||
case "ShowWindowNotice":
|
||||
responseText = ShowWindowNotice(opName);
|
||||
break;
|
||||
//消息滚动
|
||||
case "ShowLEDNotice":
|
||||
responseText = ShowLEDNotice(opName);
|
||||
break;
|
||||
case "GetOrderForm"://获取生产订单
|
||||
responseText = GetOrderForm(opName);
|
||||
break;
|
||||
case "GetEngineType"://获取发动机型号
|
||||
responseText = GetEngineType(opName);
|
||||
break;
|
||||
case "ShowOpNameMessage"://显示工位名称、操作工编号
|
||||
responseText = ShowOpNameMessage(opName);
|
||||
break;
|
||||
case "WebLoginIn"://系统初始化时,复位一些信息
|
||||
responseText = WebLoginIn(opName);
|
||||
break;
|
||||
case "MaterialCheckPosition"://物料检测指导
|
||||
responseText = MaterialCheckPosition(opName);
|
||||
break;
|
||||
//case "functionButtonConfirmOk"://合格放行
|
||||
// responseText = functionButtonConfirmOk(opName);
|
||||
// break;
|
||||
////物料追溯数据查询
|
||||
//case "MaterialDataSelect":
|
||||
// responseText = MaterialDataSelect(opName);
|
||||
// break;
|
||||
//case "MaterialSelect"://电子看板_装配零件_查询
|
||||
// responseText = MaterialSelect(opName);
|
||||
// break;
|
||||
//case "MaterialManualUpdateBetch"://手动修改批次信息以及生产厂家
|
||||
// responseText = MaterialManualUpdateBetch(opName);
|
||||
// break;
|
||||
//case "Insert_OnlineOutline"://将在线,离线,屏蔽更新到数据库中
|
||||
// responseText = Insert_OnlineOutline(opName);
|
||||
// break;
|
||||
case "Init_OnlineOutline"://功能按钮 - 从数据库中初始化在线 / 离线 / 屏蔽的combobox
|
||||
responseText = Init_OnlineOutline(opName);
|
||||
break;
|
||||
case "InitOpNameOuputCount"://初始化节拍数据
|
||||
responseText = InitOpNameOuputCount(opName);
|
||||
break;
|
||||
//case "Insert_ConfirmOk"://电子看板_发动机号_合格放行_记录_增加
|
||||
// responseText = Insert_ConfirmOk(opName);
|
||||
// break;
|
||||
case "OrderFormList_OrderComplete"://订单完工,上线数量大于计划数量,界面提示
|
||||
responseText = OrderFormList_OrderComplete(opName);
|
||||
break;
|
||||
case "GetLoginUrl":
|
||||
responseText = GetLoginOutUrl();
|
||||
break;
|
||||
//case "SetRepaireNum":
|
||||
// responseText = Insert_RepiareNum(opName);
|
||||
// break;
|
||||
case "GetRepaireNum":
|
||||
responseText = GetRepaireNum(opName);
|
||||
break;
|
||||
case "Init_TreeData"://返修上线
|
||||
responseText = Init_TreeData(opName);
|
||||
break;
|
||||
//case "Quality_Select_Repair"://返修上线选择质量数据
|
||||
// responseText = Quality_Select_Repair(opName, engineID);
|
||||
// break;
|
||||
//case "Insert_selectTreeData"://返修上线-将选择的根节点数据更新到数据库中
|
||||
// responseText = Insert_selectTreeData(opName);
|
||||
// break;
|
||||
case "QualityDataButton_bgColor_alert_Select":
|
||||
responseText = QualityDataButton_bgColor_alert_Select(opName);
|
||||
break;
|
||||
////物料追溯数据查询_根据发动机号 20170319
|
||||
//case "MaterialDataSelect_F_EnergineID":
|
||||
// responseText = MaterialDataSelect_F_EnergineID(opName);
|
||||
// break;
|
||||
case "GetPdfSrc":
|
||||
responseText = GetPdfSrc(opName); //获取操作指南的PDF路径
|
||||
break;
|
||||
default:
|
||||
string[] sArray = cmd.Split('_');
|
||||
string Funtype = sArray[0];
|
||||
if (Funtype == "AMES")
|
||||
{
|
||||
responseText = MesWebFun_MateriallPull.MesWebFun_MateriallPull.MateriallFuctionRequstBase(cmd, opName);
|
||||
}
|
||||
else
|
||||
{
|
||||
responseText = MesWebFun.MesWebFun_Special.SpecialFuctionRequstBase(cmd, opName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
1787
Common/08WebFun_base/WebFun_base/MesWebFun_baseFun.cs
Normal file
1787
Common/08WebFun_base/WebFun_base/MesWebFun_baseFun.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
// /*该js文件用于处理"操作指南"业务逻辑处理*/
|
||||
|
||||
// bool IsShow = false;
|
||||
// //是否显示绿脸_全局变量
|
||||
// bool IsShowGreenSmile = false;
|
||||
// //是否显示红脸_全局变量
|
||||
// bool IsShowRedSmile = false;
|
||||
// //显示绿色笑脸
|
||||
|
||||
// //显示红色笑脸
|
||||
|
||||
|
||||
// //显示绿色笑脸
|
||||
// void ShowGreenSmile_match()
|
||||
// {
|
||||
// $('#RedAndGreenSmile_match').attr("src", "");
|
||||
// if (IsShowGreenSmile_match == true)
|
||||
// {
|
||||
// $('#RedAndGreenSmile_match').attr("src", "../images/img_MatchSuccess.png");
|
||||
// $('#RedAndGreenDiv_match').css({
|
||||
// "display": "block"
|
||||
// });
|
||||
// IsShowGreenSmile_match = false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#RedAndGreenDiv_match').css({
|
||||
// "display": "none"
|
||||
// }); //设置不显示
|
||||
// }
|
||||
// }
|
||||
// //显示红色笑脸
|
||||
// void ShowRedSmile_match()
|
||||
// {
|
||||
// $('#RedAndGreenSmile_match').attr("src", "");
|
||||
// if (IsShowRedSmile_match == true)
|
||||
// {
|
||||
// $('#RedAndGreenSmile_match').attr("src", "../images/img_MatchFail.png");
|
||||
// $('#RedAndGreenDiv_match').css({
|
||||
// "display": "block"
|
||||
// }); //设置显示
|
||||
// IsShowRedSmile_match = false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#RedAndGreenDiv_match').css({
|
||||
// "display": "none"
|
||||
// }); //设置不显示
|
||||
// }
|
||||
// }
|
||||
|
||||
// //初始化工艺卡
|
||||
// void initoperationcard()
|
||||
// {
|
||||
// var cardwidth = $("#div_tab_operationcard").width();
|
||||
// var cardheight = $("#div_tab_operationcard").height();
|
||||
// $("#pdf_operationcard").media({ width: cardwidth, height: cardheight });
|
||||
// }
|
||||
|
||||
// //初始化操作指南
|
||||
// void initProcessData()
|
||||
// {
|
||||
// var serialNumWidth = $("#div_tab_assembly_craft").width() * 0.1;
|
||||
// var processWidth = $("#div_tab_assembly_craft").width() * 0.4;
|
||||
// var technologyRequestWidth = $("#div_tab_assembly_craft").width() * 0.3;
|
||||
// var processPropetyWidth = $("#div_tab_assembly_craft").width() * 0.2;
|
||||
// $('#datagrid_processinfo').datagrid({
|
||||
// url: '',
|
||||
// title: '',
|
||||
// sortOrder: 'desc', //升序降序 //2017-01-03
|
||||
// idField: 'JSON_工步号',
|
||||
// fit: true,
|
||||
// fitColumns: true,
|
||||
// rownumbers: true,
|
||||
// columns:
|
||||
// [[
|
||||
// { title: "序号", field: 'JSON_工步号', width: 70, align: 'left', hidden: true },
|
||||
// { title: '工序内容', field: 'JSON_操作内容', width: 264, align: 'left', resizable: false },
|
||||
// { title: '工步属性', field: 'JSON_工步属性名称', width: 180, align: 'left', resizable: false }
|
||||
// ]],
|
||||
// nowrap: false,
|
||||
// fit: true,
|
||||
// singleSelect: true,
|
||||
// rowStyler: function(rowIndex, rowData) {
|
||||
// if (rowIndex % 2 == 0)
|
||||
// {
|
||||
// return 'background-color:#D0D8E8; height:45px';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return 'background-color:#E9EDF4; height:45px';
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// //初始化物料(物料拉动模块)
|
||||
// void initAssembleDataMaterrial()
|
||||
// {
|
||||
// var serialNumWidth = $("#div_tab_assembly_material").width() * 0.1;
|
||||
// var materialNumWidth = $("#div_tab_assembly_material").width() * 0.2;
|
||||
// var materialNameWidth = $("#div_tab_assembly_material").width() * 0.2;
|
||||
// var demandCountWidth = $("#div_tab_assembly_material").width() * 0.1;
|
||||
// var reserveCountWidth = $("#div_tab_assembly_material").width() * 0.2;
|
||||
// var batchNumWidth = $("#div_tab_assembly_material").width() * 0.2;
|
||||
// $('#datagridview_div_tab_distributematerrial').datagrid({
|
||||
// url: '',
|
||||
// title: '',
|
||||
// idField: 'JSON_标号',
|
||||
// columns:
|
||||
// [[
|
||||
// { title: '序号', field: 'JSON_标号', width: 60, align: 'left', hidden: true },
|
||||
// { title: '零件图号', field: 'JSON_零件图号', width: 150, align: 'left', resizable: false },
|
||||
// { title: '零件名称', field: 'JSON_零件名称', width: 150, align: 'left', resizable: false },
|
||||
// { title: '零件数量', field: 'JSON_零件数量', width: 60, align: 'left', resizable: false },
|
||||
// { title: '库存数量', field: 'JSON_库存数量', width: 60, align: 'left', hidden: false },
|
||||
// { title: '卡片条码', field: 'JSON_卡片条码', width: 150, align: 'left', hidden: false },
|
||||
// ]],
|
||||
// nowrap: false,
|
||||
// fit: true,fitColumns: true,
|
||||
// singleSelect: true,
|
||||
// rownumbers: true
|
||||
// });
|
||||
// }
|
||||
|
||||
//显示操作指南
|
||||
string ReceivedSignal_ProcessList(string opName)
|
||||
{
|
||||
|
||||
//url: '../submit/OpName.ashx?type=ProcessList&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("ProcessList", opName);
|
||||
return responseStr;
|
||||
|
||||
}
|
||||
|
||||
//显示物料
|
||||
string ReceivedSignal_MaterialList(string opName)
|
||||
{
|
||||
// initAssembleData();
|
||||
// url: '../submit/OpName.ashx?type=MaterialList&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("MaterialList", opName);
|
||||
return responseStr;
|
||||
|
||||
}
|
||||
|
||||
//显示操作图片√
|
||||
string ReceivedSignal_PictureShow(string opName)
|
||||
{
|
||||
//url: '../submit/OpName.ashx?type=PictureShow&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("PictureShow", opName);
|
||||
return responseStr;
|
||||
|
||||
}
|
||||
|
||||
// void pdf_operationcardshowORhidden(title)
|
||||
// {
|
||||
// $("#div_tab_operationcard").toggle();
|
||||
// var tab = $('#div_tab').tabs('getSelected');
|
||||
// var launageType = $("#Hidden_language").val();
|
||||
// if (launageType == 1)
|
||||
// {
|
||||
// if (tab.title == "操作指南")
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "工艺卡" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "操作指南" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// if (launageType == 2)
|
||||
// {
|
||||
// if (tab.title == "OperageGuid")
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "ProcessCard" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "OperageGuid" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
////using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//////using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
////using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
/*该js文件用于处理显示"条码"业务逻辑处理*/
|
||||
|
||||
//MES主界面_扫描条码_点击扫描条码事件
|
||||
void scanbarcodesubmit()
|
||||
{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var value = $("#tbx_scanbarcode").val();
|
||||
// var sendmessage = "MSG,Barcode|" + opName + "|" + value;
|
||||
// sendMessage(sendmessage);
|
||||
//$.messager.show({
|
||||
// title: '提示',
|
||||
// msg: '条码扫描成功!',
|
||||
// timeout: 2000,
|
||||
// showType: 'slide'
|
||||
//});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
// /*该js文件用于处理显示"工件信息"业务逻辑处理*/
|
||||
// string isOpenMaterialPush = "0"; //是否启用物料拉动
|
||||
|
||||
// //显示托盘信息
|
||||
// void ShowPalletInfo(string m_Value)
|
||||
// {
|
||||
// var s_valueArrays = m_Value.Split('&');
|
||||
// if (s_valueArrays.Length > 0)
|
||||
// {
|
||||
// var s_palletinfo = s_valueArrays[0]; //托盘状态
|
||||
// switch (s_palletinfo)
|
||||
// {
|
||||
// case "0": //托盘错误
|
||||
// //$('#txt_status').val('托盘错误');
|
||||
// //$('#txt_status').css({ 'background-color': 'red' });
|
||||
// break;
|
||||
// case "1": //合格
|
||||
// //$('#txt_status').val('合格');
|
||||
// //$('#txt_status').css({ 'background-color': 'green' });
|
||||
// break;
|
||||
// case "2": //不合格
|
||||
// //$('#txt_status').val('不合格');
|
||||
// //$('#txt_status').css({ 'background-color': 'red' });
|
||||
// break;
|
||||
// case "3": //返修
|
||||
// //$('#txt_status').val('返修');
|
||||
// //$('#txt_status').css({ 'background-color': 'yellow' });
|
||||
// break;
|
||||
// case "4": //空托盘
|
||||
// //$('#txt_status').val('空托盘');
|
||||
// //$('#txt_status').css({ 'background-color': 'white' });
|
||||
// break;
|
||||
// default:
|
||||
// //$('#txt_status').val('系统错误');
|
||||
// //$('#txt_status').css({ 'background-color': 'red' });
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //显示分线托盘信息
|
||||
// void ShowPalletInfo_Subline(m_Value)
|
||||
// { //2017-1-3
|
||||
// var s_valueArrays = m_Value.split('&');
|
||||
// if (s_valueArrays.length > 0)
|
||||
// {
|
||||
// var s_palletinfo = s_valueArrays[0]; //托盘状态
|
||||
// switch (s_palletinfo)
|
||||
// {
|
||||
// case "0": //托盘错误
|
||||
// $('#txt_status_subline').val('托盘错误');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'red' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/red.png";
|
||||
// break;
|
||||
// case "1": //合格
|
||||
// $('#txt_status_subline').val('合格');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'green' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/green.png";
|
||||
// break;
|
||||
// case "2": //不合格
|
||||
// $('#txt_status_subline').val('不合格');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'red' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/red.png";
|
||||
// break;
|
||||
// case "3": //返修
|
||||
// $('#txt_status_subline').val('返修');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'yellow' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/green.png";
|
||||
// break;
|
||||
// case "4": //空托盘
|
||||
// $('#txt_status_subline').val('空托盘');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'white' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/red.png";
|
||||
// break;
|
||||
// default:
|
||||
// $('#txt_status_subline').val('系统错误');
|
||||
// $('#txt_status_subline').css({ 'background-color': 'red' });
|
||||
// document.getElementById("img_ForceMatch_SubLine").src = "../images/red.png";
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//显示托盘信息√
|
||||
string ReceivedSignal_MobySelect(string opName)
|
||||
{
|
||||
//url: '../submit/OpName.ashx?type=MobySelect&value=' + opName + '',
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("MobySelect", opName);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
// //初始化时,显示当前工位、工件信息
|
||||
// void Init_ReceivedSignal_MobySelect()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=ShowOpNameMessage&value=' + opName + '',
|
||||
// success: function(data) {
|
||||
// if (data != "" && data != null)
|
||||
// {
|
||||
// var dataArrays = data.split('&'); //返回多参数,拆分
|
||||
// var craftname = dataArrays[0]; //工序名称
|
||||
// var operator = dataArrays[1]; //操作者工号
|
||||
// isOpenMaterialPush = dataArrays[2]; //是否启动物料拉动
|
||||
// $("#tbx_opnamediscription").val(craftname);
|
||||
// $("#tbt_operator").val(operator);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// ReceivedSignal_MobySelect();//显示工件信息
|
||||
// }
|
||||
// //显示分线托盘信息√
|
||||
// void ReceivedSignal_MobySelect_Subline(m_Value)
|
||||
// {
|
||||
// var opName = m_Value;
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=MobySelect&value=' + opName + '',
|
||||
// success: function(data) {
|
||||
// if (data != "" && data != null)
|
||||
// {
|
||||
// var dataArrays = data.split('&'); //返回多参数,拆分
|
||||
// var orderNum = dataArrays[0];
|
||||
// var EngineTypeID = dataArrays[1];
|
||||
// var EngineType = dataArrays[2];
|
||||
// var EngineID = dataArrays[3];
|
||||
// var PartPallet_Code = dataArrays[4];
|
||||
// var IsrepairBarcode = dataArrays[5];
|
||||
// var repairBarcode = dataArrays[6];
|
||||
// $("#txt_enginetype_subline").val(EngineType);
|
||||
// $("#txt_num_subline").val(EngineID);
|
||||
// $("#txt_num_subline_Pallet").val(PartPallet_Code);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
//namespace MesWebFun_base
|
||||
//{
|
||||
// public partial class MisWebInterface
|
||||
// {
|
||||
|
||||
// /*该js文件用于处理显示"质量数据"业务逻辑处理*/
|
||||
|
||||
|
||||
// //初始化质量状态数据--主界面
|
||||
// void initQualityData()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var serialnumWidth = $("#div_quality").width() * 0.2;
|
||||
// var twistWidth = $("#div_quality").width() * 0.37;
|
||||
// var cornerWidth = $("#div_quality").width() * 0.37;
|
||||
// datagrid_Quality = $('#datagrid_quality').datagrid({
|
||||
// url: '',
|
||||
// title: '',
|
||||
// sortName: '', //按哪个字段排序,将把这个提交给服务器
|
||||
// sortOrder: 'desc', //升序降序
|
||||
// idField: '',
|
||||
// //columns: [[
|
||||
// // { title: "名称", field: 'JSON_名称', width: 60, align: 'center' },
|
||||
// // { title: '项目1', field: 'JSON_测量项目1', width: 50, align: 'center' },
|
||||
// // { title: '项目2', field: 'JSON_测量项目2', width: 50, align: 'center' },
|
||||
// // { title: '合格标志', field: 'JSON_合格标志', align: 'center', hidden: true }
|
||||
// // ]],
|
||||
// nowrap: false,
|
||||
// fit: true,fitColumns: true,
|
||||
// singleSelect: true,
|
||||
// rowStyler: function(index, row) {
|
||||
// if (row.JSON_合格标志 == "1")
|
||||
// {
|
||||
// return 'background-color:green';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// return 'background-color:red';
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,187 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
//namespace MesWebFun_base
|
||||
//{
|
||||
// public partial class MisWebInterface
|
||||
// {
|
||||
|
||||
|
||||
|
||||
// /*该js文件用于处理显示"当前时间"业务逻辑处理*/
|
||||
|
||||
// //js实时显示日期
|
||||
// void showtime_data()
|
||||
// {
|
||||
// var today, hour, second, minute, year, month, date;
|
||||
// var strDate;
|
||||
// today = new Date();
|
||||
// var n_day = today.getDay();
|
||||
// switch (n_day)
|
||||
// {
|
||||
// case 0:
|
||||
// {
|
||||
// strDate = "星期日"
|
||||
// }
|
||||
// break;
|
||||
// case 1:
|
||||
// {
|
||||
// strDate = "星期一"
|
||||
// }
|
||||
// break;
|
||||
// case 2:
|
||||
// {
|
||||
// strDate = "星期二"
|
||||
// }
|
||||
// break;
|
||||
// case 3:
|
||||
// {
|
||||
// strDate = "星期三"
|
||||
// }
|
||||
// break;
|
||||
// case 4:
|
||||
// {
|
||||
// strDate = "星期四"
|
||||
// }
|
||||
// break;
|
||||
// case 5:
|
||||
// {
|
||||
// strDate = "星期五"
|
||||
// }
|
||||
// break;
|
||||
// case 6:
|
||||
// {
|
||||
// strDate = "星期六"
|
||||
// }
|
||||
// break;
|
||||
// case 7:
|
||||
// {
|
||||
// strDate = "星期日"
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// year = today.getFullYear();
|
||||
// month = today.getMonth() + 1;
|
||||
// date = today.getDate();
|
||||
// hour = today.getHours();
|
||||
// minute = today.getMinutes();
|
||||
// second = today.getSeconds();
|
||||
|
||||
// if (month < 10)
|
||||
// {
|
||||
// month_New = "0" + month;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// month_New = month;
|
||||
// }
|
||||
|
||||
// if (date < 10)
|
||||
// {
|
||||
// date_New = "0" + date;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// date_New = date;
|
||||
// }
|
||||
// document.getElementById('time').innerHTML = year + "-" + month_New + "-" + date_New; //显示时间
|
||||
// setTimeout("showtime_data();", 1000000); //设定函数自动执行时间为 1000 ms(1 s)
|
||||
// }
|
||||
|
||||
// //实时显示时间
|
||||
// void showtime_time()
|
||||
// {
|
||||
// var today, hour, second, minute, year, month, date;
|
||||
// var strDate;
|
||||
// today = new Date();
|
||||
// var n_day = today.getDay();
|
||||
// switch (n_day)
|
||||
// {
|
||||
// case 0:
|
||||
// {
|
||||
// strDate = "星期日"
|
||||
// }
|
||||
// break;
|
||||
// case 1:
|
||||
// {
|
||||
// strDate = "星期一"
|
||||
// }
|
||||
// break;
|
||||
// case 2:
|
||||
// {
|
||||
// strDate = "星期二"
|
||||
// }
|
||||
// break;
|
||||
// case 3:
|
||||
// {
|
||||
// strDate = "星期三"
|
||||
// }
|
||||
// break;
|
||||
// case 4:
|
||||
// {
|
||||
// strDate = "星期四"
|
||||
// }
|
||||
// break;
|
||||
// case 5:
|
||||
// {
|
||||
// strDate = "星期五"
|
||||
// }
|
||||
// break;
|
||||
// case 6:
|
||||
// {
|
||||
// strDate = "星期六"
|
||||
// }
|
||||
// break;
|
||||
// case 7:
|
||||
// {
|
||||
// strDate = "星期日"
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// year = today.getFullYear();
|
||||
// month = today.getMonth() + 1;
|
||||
// date = today.getDate();
|
||||
// hour = today.getHours();
|
||||
// if (hour < 10)
|
||||
// {
|
||||
// hour_New = "0" + hour;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// hour_New = hour;
|
||||
// }
|
||||
// minute = today.getMinutes();
|
||||
// if (minute < 10)
|
||||
// {
|
||||
// minute_New = "0" + minute;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// minute_New = minute;
|
||||
// }
|
||||
// second = today.getSeconds();
|
||||
// if (second < 10)
|
||||
// {
|
||||
// second_New = "0" + second;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// second_New = second;
|
||||
// }
|
||||
// document.getElementById('Span_time').innerHTML = hour_New + ":" + minute_New + ":" + second_New + "  " + strDate; ; //显示时间
|
||||
// setTimeout("showtime_time();", 1000); //设定函数自动执行时间为 1000 ms(1 s)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,327 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
// /*该js文件用于处理"详细具体指导(拧紧、检测、称重等业务指导)"业务逻辑处理*/
|
||||
|
||||
// ////////////////////////////////////////////////////////4
|
||||
|
||||
// var jsonArrayStatic; //全局json
|
||||
// var CircleDivList; //全局记录包含image的div
|
||||
// var CircleDivListCount = 0;
|
||||
// var CircleImageList; //全局记录全部的拧紧或者压装小圆圈图片
|
||||
// var CircleImageListCount = 0;
|
||||
|
||||
|
||||
//动态创建拧紧指导div
|
||||
string InitShowGuidCircle(string opName)
|
||||
{
|
||||
// url: '../submit/OpName.ashx?type=ShaftPosition&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("ShaftPosition", opName);
|
||||
return responseStr;
|
||||
}
|
||||
// //创建div
|
||||
// void SetUpCircleDiv(data)
|
||||
// {
|
||||
// CircleDivList = { };
|
||||
// CircleImageList = { };
|
||||
// CircleImageListCount = 0;
|
||||
// CircleImageListCount = 0;
|
||||
|
||||
// var CircleImage = "<div></div>"; //默认
|
||||
// var CricleColor = "ni_png_0910"; //默认
|
||||
// var CricleColor_1 = "ni_png_0910"; //拧紧类型
|
||||
// var CricleColor_2 = "bluerectangle"; //其它类型
|
||||
// var height = $(window).height();
|
||||
// var width = $(window).width();
|
||||
// if (data != "" && data != null)
|
||||
// {
|
||||
|
||||
// for (var i = 0; i < data.length; i++)
|
||||
// {
|
||||
// var divImgWidth = $("#div_tab_assembly_craft_main").width();
|
||||
// var CircleDivID = "CircleDivID" + i;
|
||||
// var CircleImageID = "CircleImageID" + i;
|
||||
// var CircleLabelID = "CircleLabelID" + i;
|
||||
// var LocationX_data = (data[i].测量位置X / 1000) * width;
|
||||
// //var LocationX = divImgWidth + LocationX_data + 8;
|
||||
// var LocationX = divImgWidth + LocationX_data;
|
||||
// //var LocationY = data[i].测量位置Y + 115;
|
||||
// var LocationY = (data[i].测量位置Y / 760) * height;
|
||||
// var contrlosWidth = data[i].控件宽度;
|
||||
// var contrlosHeight = data[i].控件高度;
|
||||
// var instruction = data[i].说明;
|
||||
// var controlcode = data[i].控件类型;
|
||||
// var isrepaire = data[i].是否返修;
|
||||
|
||||
// var number = data[i].序号;
|
||||
|
||||
// if (controlcode == "1")
|
||||
// {//其它类型
|
||||
// CricleColor = CricleColor_1;
|
||||
// }
|
||||
|
||||
// else
|
||||
// {//其它类型
|
||||
// CricleColor = CricleColor_2;
|
||||
// }
|
||||
|
||||
// switch (data[i].拧紧完成)
|
||||
// {
|
||||
// case 1:
|
||||
// CricleColor = "green";
|
||||
// break;
|
||||
// default:
|
||||
// CricleColor = "ni_png_0910";
|
||||
// break;
|
||||
|
||||
// }
|
||||
|
||||
// //普通拧紧
|
||||
// if (isrepaire == 0)
|
||||
// {
|
||||
|
||||
// if (controlcode == "1")
|
||||
// {//拧紧类型
|
||||
// CircleImage = "<div "
|
||||
// + " id=" + "'" + CircleDivID + "'"
|
||||
// + ">"
|
||||
// + "<img src='../images/" + CricleColor + ".png'"
|
||||
// + " id=" + "'" + CircleImageID + "'"
|
||||
// + " />"
|
||||
// + "</div>"
|
||||
// }
|
||||
|
||||
// else
|
||||
// {//其它类型
|
||||
// CircleImage = "<div "
|
||||
// + " id=" + "'" + CircleDivID + "'"
|
||||
// + ">"
|
||||
// + "<label"
|
||||
// + " id='" + CircleLabelID + "'>" + instruction + "</label>"
|
||||
// + "<img src='../images/" + CricleColor + ".png'"
|
||||
// + " id=" + "'" + CircleImageID + "'"
|
||||
// + " />"
|
||||
// + "</div>"
|
||||
// }
|
||||
// }
|
||||
// //返修拧紧
|
||||
// else
|
||||
// {
|
||||
// if (data[i].拧紧完成 == "2")
|
||||
// {
|
||||
// CricleColor = "red";
|
||||
// }
|
||||
|
||||
// if (controlcode == "1")
|
||||
// {//拧紧类型
|
||||
// CircleImage = "<div "
|
||||
// + " id=" + "'" + CircleDivID + "'"
|
||||
// + ">"
|
||||
// + "<img src='../images/" + CricleColor + ".png'"
|
||||
// + " id=" + "'" + CircleImageID + "'"
|
||||
// + " />"
|
||||
// + "</div>"
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// $('#div_tab_assembly_craft').append(CircleImage);
|
||||
// $('#' + CircleDivID).css(
|
||||
// {
|
||||
// "top": LocationY + "px",
|
||||
// "left": LocationX + "px",
|
||||
// "z-index": "4",
|
||||
// "width": contrlosWidth,
|
||||
// "height": contrlosHeight,
|
||||
// "position": "absolute"
|
||||
// });
|
||||
|
||||
// $('#' + CircleImageID).css(
|
||||
// {
|
||||
// "width": contrlosWidth,
|
||||
// "height": contrlosHeight
|
||||
// }
|
||||
// );
|
||||
|
||||
// if (controlcode != "1")
|
||||
// {//其它类型
|
||||
// $('#' + CircleLabelID).css(
|
||||
// {
|
||||
// "top": 7 + "px",
|
||||
// "left": 17 + "px",
|
||||
// "z-index": "4",
|
||||
// "position": "absolute"
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
// CircleDivList[i] = CircleDivID;
|
||||
// CircleImageList[number] = CircleImageID; //改过[i]
|
||||
// CircleDivListCount++;
|
||||
// CircleImageListCount++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //移除控件
|
||||
// void ClearCircle()
|
||||
// {
|
||||
// //console.info(CircleDivListCount);
|
||||
// if (CircleDivListCount > 0)
|
||||
// {
|
||||
// for (var i = CircleDivListCount - 1; i >= 0; i--)
|
||||
// {
|
||||
// var id = CircleDivList[i];
|
||||
// $('#' + id).remove();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //获取第一次拧紧的组号和套筒号
|
||||
// void GetFirstGroupNumAndBoltCode(data)
|
||||
// {
|
||||
// var groupindex = 0;
|
||||
// var boltcode = 0;
|
||||
// var isfinish = 0; //拧紧完成
|
||||
|
||||
// var isOK = 0;//是否存在未拧紧轴
|
||||
// if (data != "" && data != null)
|
||||
// {
|
||||
// for (var j = 0; j < data.length; j++)
|
||||
// {
|
||||
// if (data[j].拧紧完成 == 0)
|
||||
// {
|
||||
// isOK = 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// for (var i = 0; i < data.length; i++)
|
||||
// {
|
||||
// isfinish = data[i].拧紧完成;
|
||||
// groupindex = data[i].组号;
|
||||
// boltcode = data[i].套筒号;
|
||||
|
||||
// if (isOK == 1)
|
||||
// {
|
||||
// if (isfinish == 0)
|
||||
// {
|
||||
// return groupindex;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (isfinish == 2)
|
||||
// {
|
||||
// return groupindex;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //根据序列号,显示对应的状态(status为0表示不合格,status为1为合格,status为2为还未开始,status为4为开始拧紧)
|
||||
// void ShowStep(GroupNum, status, jsonArray)
|
||||
// {
|
||||
|
||||
// //先判断是否还有未完成拧紧或者的位置
|
||||
// var imageid;
|
||||
// var imagesrc;
|
||||
// var Num;
|
||||
// var ReadGroupNum;
|
||||
// var boltCode; //套筒号
|
||||
// var controlcode; //控件类型
|
||||
|
||||
// // ShowAndHideFixAgainButton(false); //默认隐藏
|
||||
// if (CircleImageListCount > 0)
|
||||
// {
|
||||
// for (var i = 0; i < jsonArray.length; i++)
|
||||
// {
|
||||
// ReadGroupNum = jsonArray[i].组号;
|
||||
// if (GroupNum == ReadGroupNum)
|
||||
// {
|
||||
// Num = jsonArray[i].序号;
|
||||
// controlcode = jsonArray[i].控件类型;
|
||||
// imageid = CircleImageList[Num]; //改过-1
|
||||
|
||||
|
||||
// if (status == 0)
|
||||
// {
|
||||
// if (controlcode == "1")
|
||||
// {
|
||||
// imagesrc = "../images/red.png";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// imagesrc = "../images/redrectangle.png";
|
||||
// //清空套筒号
|
||||
// ClearBoltCode();
|
||||
// }
|
||||
// }
|
||||
// if (status == 1)
|
||||
// {
|
||||
// if (controlcode == "1")
|
||||
// {
|
||||
// imagesrc = "../images/green.png";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// imagesrc = "../images/greenrectangle.png";
|
||||
// //清空套筒号
|
||||
// ClearBoltCode();
|
||||
// }
|
||||
// //开始拧紧下一个
|
||||
// }
|
||||
// if (status == 2)
|
||||
// {
|
||||
// if (controlcode == "1")
|
||||
// {
|
||||
// imagesrc = "../images/ni_png_0910.png";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// imagesrc = "../images/bluerectangle.png";
|
||||
// //清空套筒号
|
||||
// ClearBoltCode();
|
||||
// }
|
||||
// }
|
||||
// if (status == 4)
|
||||
// {
|
||||
// if (controlcode == "1")
|
||||
// {
|
||||
// imagesrc = "../images/StartWorkCircle.gif";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// imagesrc = "../images/blinkrectangle.gif";
|
||||
// //清空套筒号
|
||||
// ClearBoltCode();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// $('#' + imageid).attr("src", imagesrc);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
816
Common/08WebFun_base/WebFun_base/MisWebInterfaceFunc/Web_Init.cs
Normal file
816
Common/08WebFun_base/WebFun_base/MisWebInterfaceFunc/Web_Init.cs
Normal file
@@ -0,0 +1,816 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
//namespace MesWebFun_base
|
||||
//{
|
||||
// public partial class MisWebInterface
|
||||
// {
|
||||
|
||||
|
||||
// /*该js文件用于处理"页面初始化"业务逻辑处理*/
|
||||
|
||||
// //记录TabSelect时的Tab顺序
|
||||
// var Tab_Index = '操作指南';
|
||||
// //记录操作指南区域的先后顺序:1显示操作指南,0显示工艺卡
|
||||
// var Index = 1;
|
||||
// var btnconfig =
|
||||
// {
|
||||
// btn: {
|
||||
// close:'<span class="glyphicon glyphicon glyphicon-off" aria-hidden="true"></span> 重新工作',
|
||||
// comfrie:'<span class="glyphicon glyphicon glyphicon-ok" aria-hidden="true"></span> 继续工作'
|
||||
// }
|
||||
// }
|
||||
//var dditConfig = {
|
||||
// btn: {
|
||||
// close:'<span class="glyphicon glyphicon glyphicon-off" aria-hidden="true"></span> 重新工作',
|
||||
// comfrie:'<span class="glyphicon glyphicon glyphicon-ok" aria-hidden="true"></span> 继续工作'
|
||||
// },
|
||||
// hintLayer: {
|
||||
// icon: 7,
|
||||
// title: ["涂胶-拧紧超时报警","background-color:#4476A7"],
|
||||
// area: ['600px', '320px'],
|
||||
// skin: 'layui-layer-molv',
|
||||
// offset: '240px',
|
||||
// btn: [btnconfig.btn.comfrie, btnconfig.btn.close]
|
||||
// },
|
||||
// hintLayer1: {
|
||||
// icon: 1,
|
||||
// area: ['360px', '250px'],
|
||||
// title: "提示信息",
|
||||
// skin: 'layerStyle',
|
||||
// offset: '350px',
|
||||
// btn: ["确定登录", "取消登录"]
|
||||
//}
|
||||
//}
|
||||
////初始化MES界面
|
||||
//void loadingMes()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// //初始化Mes界面_更新上面的数据
|
||||
// loadingMesData();
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=MesloadingSelect&value=' + opName,
|
||||
// data:
|
||||
// {
|
||||
// mainModule: 1, //主模块代码
|
||||
// MesWebCode: 2//页面代码
|
||||
// },
|
||||
// dataType: 'json',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// for (i = 0; i < data.length; i++)
|
||||
// {
|
||||
// switch (data[i].标签属性)
|
||||
// {
|
||||
// case "lbl":
|
||||
// {
|
||||
// updataLbl(data[i]);
|
||||
// }
|
||||
// break;
|
||||
// case "tab":
|
||||
// {
|
||||
// updataTab(data[i]);
|
||||
// }
|
||||
// break;
|
||||
// case "btn":
|
||||
// {
|
||||
// updataBtn(data[i]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// //更新lbl
|
||||
// void updataLbl(data)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var key = data.标签ID;
|
||||
// var value = data.标签文字;
|
||||
// $('#' + key).text(value);
|
||||
// }
|
||||
// catch (Error)
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
////更新btn
|
||||
//void updataBtn(data)
|
||||
//{
|
||||
// var key = data.标签ID;
|
||||
// var value = data.标签文字;
|
||||
// $('#' + key).val(value);
|
||||
//}
|
||||
////更新tab
|
||||
//void updataTab(data)
|
||||
//{
|
||||
// //第一步取到tab的控件
|
||||
// var tab_key = data.所属父级ID;
|
||||
// var launageType = data.语言编号;
|
||||
// $("#Hidden_language").val(launageType);
|
||||
// var value = data.模块描述;
|
||||
// //console.info(value);
|
||||
// var tab_index = data.模块编号;
|
||||
|
||||
// if (data.是否禁用 == 0 && data.是否禁用 != undefined)
|
||||
// {
|
||||
// var tab_child = $('#' + tab_key).tabs('getTab', value);
|
||||
// if (tab_child != null)
|
||||
// {
|
||||
// $('#' + tab_key).tabs('update', {
|
||||
// tab: tab_child,
|
||||
// options:
|
||||
// {
|
||||
// title: value // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// } else
|
||||
//{
|
||||
// $('#' + tab_key).tabs('close', value);
|
||||
// $('#' + tab_key).tabs('select', 0);
|
||||
//}
|
||||
// }
|
||||
//}
|
||||
////初始化Mes界面_更新上面的input
|
||||
//void loadingMesData()
|
||||
//{
|
||||
//}
|
||||
|
||||
////打开功能按钮对话框
|
||||
//void OpenPanel()
|
||||
//{
|
||||
// $("#div_btnfunction_main").toggle();
|
||||
//}
|
||||
|
||||
////根据对象以及百分比获取实际absolutely长度大小
|
||||
//void FixWidth(sender, percent)
|
||||
//{
|
||||
// alert('0');
|
||||
// return $('#' + sender).width() * percent;
|
||||
//}
|
||||
|
||||
////获取html页面参数
|
||||
//void getvalue(name)
|
||||
//{
|
||||
// var str = window.location.search;
|
||||
// if (str.indexOf(name) != -1)
|
||||
// {
|
||||
// var pos_start = str.indexOf(name) + name.length + 1;
|
||||
// var pos_end = str.indexOf("&", pos_start);
|
||||
// if (pos_end == -1)
|
||||
// {
|
||||
// return str.substring(pos_start);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return str.substring(pos_start, pos_end)
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return "没有这个name值";
|
||||
// }
|
||||
//}
|
||||
|
||||
////初始化工步属性
|
||||
//void IniStepProperty()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=StepProperty&value=' + opName + '',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// var stepProperty = data.toString();
|
||||
// $("#Hidden_stepProperty").val(stepProperty);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//}
|
||||
|
||||
////在线,离线,启用点击事件
|
||||
//void show_Pannel_status1()
|
||||
//{
|
||||
// $('#combobox_btnfunction_status').combobox('showPanel');
|
||||
//}
|
||||
////功能按钮-从数据库中初始化在线/离线/屏蔽的combobox
|
||||
//void initOnlineOutlineCombobox()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "../submit/OpName.ashx?type=Init_OnlineOutline",
|
||||
// data:
|
||||
// {
|
||||
// opnameValue: opName
|
||||
// },
|
||||
// dataType: 'json',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// if (data.value == "2")
|
||||
// {
|
||||
// $("#btn_function").css("background-color", "red");
|
||||
// $("#combobox_btnfunction_status").combobox("setValue", "2");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $("#btn_function").css("background-color", "green");
|
||||
// $("#combobox_btnfunction_status").combobox("setValue", "0");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
////初始化combox--功能按钮
|
||||
//void initCombobox()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var headwidth = $("#div_btnfunction_status").width();
|
||||
// var headheight = $("#div_btnfunction_status").height();
|
||||
// $("#combobox_btnfunction_status").combobox({
|
||||
// width: 130,
|
||||
// height: 35,
|
||||
// //panelHeight: headheight,
|
||||
// panelHeight: 80,
|
||||
// valueField: "id",
|
||||
// textField: "line",
|
||||
// value: "在线",
|
||||
// data:
|
||||
// [{
|
||||
// id: "0",
|
||||
// line: "在线"
|
||||
// }, {
|
||||
// id: "2",
|
||||
// line: "屏蔽"
|
||||
// }],
|
||||
// editable: false,
|
||||
// onSelect: function(record) {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var text = $("#combobox_btnfunction_status").combobox("getText");
|
||||
// var value = $("#combobox_btnfunction_status").combobox("getValue");
|
||||
// if (value == 2)
|
||||
// {
|
||||
// $("#btn_function").css("background-color", "red");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $("#btn_function").css("background-color", "green");
|
||||
// }
|
||||
// //插入到数据库
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "../submit/OpName.ashx?type=Insert_OnlineOutline",
|
||||
// data:
|
||||
// {
|
||||
// opnameValue: opName,
|
||||
// selectValue: value
|
||||
// },
|
||||
// dataType: 'json',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// if (data.falg == "1")
|
||||
// {
|
||||
// //发送信号
|
||||
// var sendmessage = "MSG,OnLineState|" + opName + "|" + value;
|
||||
// sendMessage(sendmessage);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
//} //初始化tab
|
||||
|
||||
//var slectTabFlag = 1;
|
||||
|
||||
////初始化tab
|
||||
//void initTab()
|
||||
//{
|
||||
// var meswidth = $("#div_mes_main").width();
|
||||
// var timewidth = $("#div_time_main").width();
|
||||
// // var tabWidth = (meswidth - timewidth) * 0.975;
|
||||
// var tabWidth = (meswidth - timewidth) * 0.83;
|
||||
// var tabHeight = $("#div_time_main").height();
|
||||
// $('#div_tab').tabs({
|
||||
// border: false,
|
||||
// tabWidth: tabWidth / 6,
|
||||
// tabHeight: tabHeight,
|
||||
// onSelect: function(title, index) {
|
||||
// switch (title)
|
||||
// {
|
||||
// case '操作指南':
|
||||
// SettingIndex(title);
|
||||
// initProcessData();
|
||||
// initAssembleData();
|
||||
// ShowCraft();
|
||||
// break;
|
||||
// case '工艺卡':
|
||||
// SettingIndex(title);
|
||||
// ShowCraft();
|
||||
// break;
|
||||
// case '订单完工':
|
||||
// SettingIndex(title);
|
||||
// initOrderInfoData();
|
||||
// ReloadOrderInfoData();
|
||||
// break;
|
||||
// case '物料拉动':
|
||||
// SettingIndex(title);
|
||||
// initOrderInfoData();
|
||||
// ReloadOrderInfoData();
|
||||
// break;
|
||||
// case '质量查询':
|
||||
// SettingIndex(title);
|
||||
// IniQualityButtons_bgColor();
|
||||
// initStationdata();
|
||||
// repairMark = 0;
|
||||
// break;
|
||||
// case '设备管理':
|
||||
// SettingIndex(title);
|
||||
// initMaintainInfodata();
|
||||
// var tab = $('#div_tab').tabs('getSelected');
|
||||
// tab.panel('refresh');
|
||||
// break;
|
||||
// case 'ANDON':
|
||||
// SettingIndex(title);
|
||||
// ///测试
|
||||
// init_Combobox_ando_call();
|
||||
// init_combobox_ando_reset();
|
||||
// InitMaterailAndo();
|
||||
// //alert($("#tbx_opname").val());
|
||||
// $('#div_andon_table_material').css({
|
||||
// "left": "0px"
|
||||
// });
|
||||
////初始化物料ando弹出的div
|
||||
//Init_ando_popup();
|
||||
////初始化质量ando弹出的div
|
||||
//Init_ando_quality_popup();
|
||||
////初始化设备ando弹出的div
|
||||
//Init_ando_machine_popup();
|
||||
//break;
|
||||
// case '返修管理':
|
||||
// SettingIndex(title);
|
||||
//initStationdataRepair();
|
||||
//IniQualityButtons_bgColorRepair();
|
||||
//repairMark = 1;
|
||||
//break;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
////点击Tab设置Index
|
||||
//void SettingIndex(index)
|
||||
//{
|
||||
// switch (index)
|
||||
// {
|
||||
// case '操作指南': //操作指南
|
||||
// if (Tab_Index != '操作指南')
|
||||
// {
|
||||
// Index = 0;
|
||||
// Tab_Index = '操作指南';
|
||||
// return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (Index == 1)
|
||||
// {
|
||||
// Index = 0;
|
||||
// return;
|
||||
// }
|
||||
// if (Index == 0)
|
||||
// {
|
||||
// Index = 1;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// case '工艺卡': //工艺卡
|
||||
// if (Tab_Index != '工艺卡')
|
||||
// {
|
||||
// Index = 0;
|
||||
// Tab_Index = '操作指南';
|
||||
// return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (Index == 1)
|
||||
// {
|
||||
// Index = 0;
|
||||
// return;
|
||||
// }
|
||||
// if (Index == 0)
|
||||
// {
|
||||
// Index = 1;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// case '订单完工': //订单完工
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// case '物料拉动': //物料拉动
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// case '质量查询': //质量查询
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// case '设备管理': //设备管理
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// case 'ANDON': //Andon
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// case '返修管理': //返修管理
|
||||
// Tab_Index = index;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// default:
|
||||
// Tab_Index = 0;
|
||||
// Index = 0;
|
||||
// return;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
////显示工序卡和操作指南头
|
||||
//void ShowCraft()
|
||||
//{
|
||||
// if (Index == 0)
|
||||
// {
|
||||
// var tab = $('#div_tab').tabs('getSelected');
|
||||
// var launageType = $("#Hidden_language").val();
|
||||
// if (launageType == 1)
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "操作指南" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// if (launageType == 2)
|
||||
//{
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "OperageGuid" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
// $("#div_tab_operationcard").css({
|
||||
// "display": "none"
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
//{
|
||||
// //20170331 CORBIN
|
||||
// var opName = $('#tbx_opname').val();
|
||||
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=GetPdfSrc&value=' + opName,
|
||||
// success: function(data) {
|
||||
// if (data != "" || data == null)
|
||||
// {
|
||||
// if (document.getElementById('pdf_operationcard') != null)
|
||||
// {
|
||||
// $('#pdf_operationcard').attr("src", data);
|
||||
// initoperationcard();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#pdf_operationcard').attr("src", "../pdf/确认是否上传PDF.pdf");
|
||||
// initoperationcard();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
// //20170331 CORBIN
|
||||
|
||||
// $("#div_tab_operationcard").css({
|
||||
// "display": "block"
|
||||
// });
|
||||
// var tab = $('#div_tab').tabs('getSelected');
|
||||
// var launageType = $("#Hidden_language").val();
|
||||
// if (launageType == 1)
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "工艺卡" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// if (launageType == 2)
|
||||
// {
|
||||
// $('#div_tab').tabs('update', {
|
||||
// tab: tab,
|
||||
// options:
|
||||
// {
|
||||
// title: "ProcessCard" // 新tab的title
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//}
|
||||
//}
|
||||
|
||||
////测试虚拟键盘
|
||||
//void test_tbx_scanbarcode()
|
||||
//{
|
||||
// VirtualKeyboard.toggle('', 'softkey');
|
||||
// $("#kb_langselector,#kb_mappingselector,#copyrights").css("display", "none");
|
||||
//}
|
||||
|
||||
////工位刚登入时,将一些信息复位掉
|
||||
//void Web_Login()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=WebLoginIn&value=' + opName + '',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
////初始化界面
|
||||
////显示操作指南 ph- 2014年11月18日
|
||||
//ReceivedSignal_ProcessList(); //显示操作指南
|
||||
//ReceivedSignal_MaterialList(); //显示物料
|
||||
//ReceivedSignal_PictureShow(); //显示操作图片
|
||||
//ShowLEDNotice(); //初始化LED
|
||||
//}
|
||||
|
||||
//void InitMaterialLeave_dialog()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#MaterialLeave_dialog").html(),
|
||||
// btn:["确定" ],
|
||||
// yes: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
////质量门
|
||||
//void MaterailQuality_dialoga()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#MaterailQuality_dialog").html(),
|
||||
// btn:["确定"],
|
||||
// yes: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
////涂胶延时提醒
|
||||
//void InitdelayTime_dialog()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// title:["延时提醒提示"],
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#delayTime_dialog").html(),
|
||||
// btn:["继续工作", "重新工作", ],
|
||||
// yes: function(index, layero) {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
|
||||
// sendMessage(sendmessage);
|
||||
// layer.close(index);
|
||||
// },
|
||||
// btn2: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// },
|
||||
// });
|
||||
//}
|
||||
////打印条码提醒
|
||||
//void InitPrintConfirm_dialog()
|
||||
//{
|
||||
// $('#PrintConfirm_dialog').dialog({
|
||||
// title: '打印条码扫描验证错误',
|
||||
// width: 600,
|
||||
// height: 270,
|
||||
// modal: true,
|
||||
// closed: true,
|
||||
// buttons:
|
||||
// [{
|
||||
// text: '继续工作',
|
||||
// iconCls: 'icon-ok',
|
||||
// handler: function() {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var sendmessage = "MSG,PrinterrorAlter|" + opName + "|1";
|
||||
// sendMessage(sendmessage);
|
||||
// $('#PrintConfirm_dialog').dialog('close');
|
||||
// }
|
||||
// }, {
|
||||
// text: '重新工作',
|
||||
// iconCls: 'icon-cancel',
|
||||
// handler: function() {
|
||||
// $('#PrintConfirm_dialog').dialog('close');
|
||||
// }
|
||||
// }]
|
||||
// });
|
||||
//}
|
||||
////OP2150涂胶延时提醒
|
||||
//void InitTightdelayTime_dialog()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// title:["涂胶延时提醒"],
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#tightTime_dialog").html(),
|
||||
// btn:["继续工作", "重新工作",],
|
||||
// yes: function(index, layero) {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
|
||||
// sendMessage(sendmessage);
|
||||
// layer.close(index);
|
||||
// },
|
||||
// btn2: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// },
|
||||
// });
|
||||
//}
|
||||
////涂胶时间不足提醒
|
||||
//void InitNotenough_dialog()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// title:["涂胶-测试台架时间不足"],
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#Notenough_dialog").html(),
|
||||
// btn:["继续工作", "重新工作", ],
|
||||
// yes: function(index, layero) {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
|
||||
// sendMessage(sendmessage);
|
||||
// layer.close(index);
|
||||
// },
|
||||
// btn2: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// },
|
||||
// });
|
||||
//}
|
||||
////OP4150打标重复报警
|
||||
//void InitMarking_dialog()
|
||||
//{
|
||||
// //open方法
|
||||
// layer.open({
|
||||
// icon: 7,
|
||||
// title:["打标工件编号重复"],
|
||||
// closeBtn: 1,
|
||||
// skin: 'layui-layer-lan',
|
||||
// area:['600px', '350px'],
|
||||
// content: $("#Marking_dialog").html(),
|
||||
// btn:["继续工作", "重新工作", ],
|
||||
// yes: function(index, layero) {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
|
||||
// sendMessage(sendmessage);
|
||||
// layer.close(index);
|
||||
// },
|
||||
// btn2: function(index, layero) {
|
||||
// layer.close(index);
|
||||
// },
|
||||
// });
|
||||
//}
|
||||
////二维码零件未扫描
|
||||
//void InitNoScan_dialog()
|
||||
//{
|
||||
// $('#NoScanMats_dialog').dialog({
|
||||
// title: '物料未扫描完全',
|
||||
// width: 600,
|
||||
// height: 270,
|
||||
// modal: true,
|
||||
// closed: true,
|
||||
// buttons:
|
||||
// [{
|
||||
// text: '确定',
|
||||
// iconCls: 'icon-ok',
|
||||
// handler: function() {
|
||||
// $('#NoScanMats_dialog').dialog('close');
|
||||
// }
|
||||
// }]
|
||||
// });
|
||||
//}
|
||||
////删除排队
|
||||
//void button_Orderdele()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var orderengine_num = $("#txt_orderengine_num").val();
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: '../submit/OpName.ashx?type=OrderlistDelete&value=' + opName + '&orderengine_num=' + orderengine_num,
|
||||
// dataType: 'json',
|
||||
// success: function(data) {
|
||||
// $("#txt_orderengine_num").val('');
|
||||
// }
|
||||
// });
|
||||
//sendMessage(sendmessage);
|
||||
// $.messager.show({
|
||||
//title: '提示',
|
||||
// msg: '删除成功!',
|
||||
// timeout: 2000,
|
||||
// showType: 'slide'
|
||||
// });
|
||||
//}
|
||||
|
||||
////线外工位质量数据、物料数据
|
||||
//void InitLineout_dialog()
|
||||
//{
|
||||
// $('#Lineout_dialog').dialog({
|
||||
// title: '线外工装数据显示',
|
||||
// width: 860,
|
||||
// height: 610,
|
||||
// closed: false,
|
||||
// cache: false,
|
||||
// modal: true
|
||||
// });
|
||||
//IniQualityButtons_bgColor_alert();
|
||||
//initStationdata_alert();
|
||||
|
||||
//}
|
||||
|
||||
//void btn_Lineout_dialog_Cancel()
|
||||
//{
|
||||
// $('#Lineout_dialog').dialog({
|
||||
// closed: true,
|
||||
// });
|
||||
//}
|
||||
|
||||
//void btn_Lineout_dialog_Continue()
|
||||
//{
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var barcode = $("#Lineout_barcode").val();
|
||||
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|" + barcode;
|
||||
// sendMessage(sendmessage);
|
||||
// $('#Lineout_dialog').dialog({
|
||||
// closed: true,
|
||||
// });
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
// /*该js文件用于处理"物料检测"业务逻辑处理*/
|
||||
|
||||
// var jsonArrayStatic_MaterialCheck; //全局json_物料检测
|
||||
// var CircleDivList_MaterialCheck; //全局记录包含image的div
|
||||
// var CircleDivListCount_MaterialCheck = 0;
|
||||
// var CircleImageList_MaterialCheck; //全局记录全部的物料检测小圆圈图片
|
||||
// var CircleImageListCount_MaterialCheck = 0;
|
||||
|
||||
//初始化物料检测指导
|
||||
string InitMaterialCheck(string opName)
|
||||
{
|
||||
//url: '../submit/OpName.ashx?type=MaterialCheckPosition&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("MaterialCheckPosition", opName);
|
||||
return responseStr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// //创建div(MaterialCheck)
|
||||
// void SetUpCircleDiv_MaterialCheck(data)
|
||||
// {
|
||||
// CircleDivList_MaterialCheck = { };
|
||||
// CircleImageList_MaterialCheck = { };
|
||||
// CircleImageListCount_MaterialCheck = 0;
|
||||
// CircleImageListCount_MaterialCheck = 0;
|
||||
|
||||
// var CircleImage = "<div></div>"; //默认
|
||||
// var CricleColor = "checkred"; //默认
|
||||
|
||||
// for (var i = 0; i < data.length; i++)
|
||||
// {
|
||||
// var divImgWidth = $("#div_tab_assembly_craft_main").width();
|
||||
// var CircleDivID = "CheckMaterialDivID" + i;
|
||||
// var CircleImageID = "CheckMaterialImageID" + i;
|
||||
// var LocationX_data = data[i].测量位置X;
|
||||
// var LocationX = divImgWidth + LocationX_data;
|
||||
// var LocationY = data[i].测量位置Y;
|
||||
// var contrlosWidth = data[i].控件宽度;
|
||||
// var contrlosHeight = data[i].控件高度;
|
||||
|
||||
// CircleImage = "<div "
|
||||
// + " id=" + "'" + CircleDivID + "'"
|
||||
// + ">"
|
||||
// + "<img src='../images/" + CricleColor + ".gif'"
|
||||
// + " id=" + "'" + CircleImageID + "'"
|
||||
// + " />"
|
||||
// + "</div>"
|
||||
|
||||
// $('#div_tab_assembly_craft').append(CircleImage);
|
||||
// $('#' + CircleDivID).css(
|
||||
// {
|
||||
// "top": LocationY + "px",
|
||||
// "left": LocationX + "px",
|
||||
// "z-index": "4",
|
||||
// "width": contrlosWidth,
|
||||
// "height": contrlosHeight,
|
||||
// "position": "absolute"
|
||||
// });
|
||||
|
||||
// $('#' + CircleImageID).css(
|
||||
// {
|
||||
// "width": contrlosWidth,
|
||||
// "height": contrlosHeight
|
||||
// }
|
||||
// );
|
||||
|
||||
// //赋值变量
|
||||
// CircleDivList_MaterialCheck[i] = CircleDivID;
|
||||
// CircleImageList_MaterialCheck[i] = CircleImageID;
|
||||
// CircleDivListCount_MaterialCheck++;
|
||||
// CircleImageListCount_MaterialCheck++;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //移除控件
|
||||
// void ClearCircle_MaterialCheck()
|
||||
// {
|
||||
// if (CircleDivListCount_MaterialCheck > 0)
|
||||
// {
|
||||
// for (var i = CircleDivListCount_MaterialCheck - 1; i >= 0; i--)
|
||||
// {
|
||||
// var id = CircleDivList_MaterialCheck[i];
|
||||
// $('#' + id).remove();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// //根据传递的物料检测信息
|
||||
// void ShowMaterialCheck(m_Value)
|
||||
// {
|
||||
|
||||
// //先判断是否还有未完成拧紧或者的位置
|
||||
// var imageid;
|
||||
// var imagesrc;
|
||||
// var Num;
|
||||
// var check;
|
||||
|
||||
// var s_valueArrays = m_Value.split('&'); //将接收到的检测信息split
|
||||
// if (CircleImageListCount_MaterialCheck > 0)
|
||||
// {
|
||||
// if (s_valueArrays.length > 0)
|
||||
// {
|
||||
// for (var i = 0; i < jsonArrayStatic_MaterialCheck.length; i++)
|
||||
// {
|
||||
// Num = jsonArrayStatic_MaterialCheck[i].物料检测; //检测序号
|
||||
// imageid = CircleImageList_MaterialCheck[Num];
|
||||
// if (Num <= (s_valueArrays.length - 1))
|
||||
// {
|
||||
// check = s_valueArrays[Num];
|
||||
// if (check == 0)
|
||||
// {//未能检测到显示红色动画
|
||||
// imagesrc = "../images/checkred.gif";
|
||||
// }
|
||||
// if (check == 1)
|
||||
// {//检测到显示绿色动画
|
||||
// imagesrc = "../images/checkgreen.gif";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// imagesrc = "../images/checkred.gif";
|
||||
// }
|
||||
// $('#' + imageid).attr("src", imagesrc);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
|
||||
/*该js文件用于处理"弹窗消息"业务逻辑处理*/
|
||||
string ShowWindowNotice(string opName)
|
||||
{
|
||||
//url: '../submit/OpName.ashx?type=ShowWindowNotice&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("ShowWindowNotice", opName);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
//LED消息提醒
|
||||
string ShowLEDNotice(string opName)
|
||||
{
|
||||
// url: '../submit/OpName.ashx?type=ShowLEDNotice&value=' + opName,
|
||||
var responseStr = _MesWebFun_base.ProcessRequest("ShowLEDNotice", opName);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,420 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
//namespace MesWebFun_base
|
||||
//{
|
||||
// public partial class MisWebInterface
|
||||
// {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// //初始化返修上线dialog
|
||||
// void Initdiv_RepairPartLoad_dialg()
|
||||
// {
|
||||
// $('#div_RepairPartLoad_dialg').dialog({
|
||||
// title: '返修上线',
|
||||
// width: 600,
|
||||
// height: 350,
|
||||
// closed: true
|
||||
// });
|
||||
// }
|
||||
// //获取日期字符串
|
||||
// void RepairPartLoad_GetDate()
|
||||
// {
|
||||
// var today, hour, second, minute, year, month, date;
|
||||
// var strDate;
|
||||
// today = new Date();
|
||||
// year = today.getFullYear();
|
||||
// month = today.getMonth() + 1;
|
||||
// date = today.getDate();
|
||||
// hour = today.getHours();
|
||||
// minute = today.getMinutes();
|
||||
// second = today.getSeconds();
|
||||
|
||||
// if (month < 10)
|
||||
// {
|
||||
// month_New = "0" + month;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// month_New = month;
|
||||
// }
|
||||
|
||||
// if (date < 10)
|
||||
// {
|
||||
// date_New = "0" + date;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// date_New = date;
|
||||
// }
|
||||
// // var date3 = document.getElementById('input_RepairPartLoad_EngineID_date').value = year + "-" + month_New + "-" + date_New; //显示时间
|
||||
// }
|
||||
|
||||
|
||||
// //更新返修状态
|
||||
// void update_RepairStatus(data)
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val(); //工位号
|
||||
// var str0 = data;
|
||||
// var str1 = new Array();
|
||||
// str1 = str0.split("_");
|
||||
// var opname = str1[1]
|
||||
// var btnColor = document.getElementById("" + data + "").style.backgroundColor;
|
||||
// var status = 0;
|
||||
|
||||
// if (btnColor == "lime")
|
||||
// {
|
||||
// status = 1;
|
||||
|
||||
// }
|
||||
// if (btnColor == "")
|
||||
// {
|
||||
// status = 0;
|
||||
// }
|
||||
|
||||
// //更新到数据库中
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=updateRepairStatus&value=' + opName
|
||||
// + '&opname=' + opname
|
||||
// + '&status=' + status,
|
||||
// success: function(data) {
|
||||
|
||||
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// //全选
|
||||
// void SelectAllBtn()
|
||||
// {
|
||||
// var btn_Str = "";
|
||||
// var repairtags = document.getElementsByName("RepairBtn");
|
||||
// var str_value = "";
|
||||
// for (var i = 0; i < repairtags.length; i++)
|
||||
// {
|
||||
// repairtags[i].style.backgroundColor = "green";
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// //清空
|
||||
// void RemoveAllBtn()
|
||||
// {
|
||||
// var btn_Str = "";
|
||||
// var repairtags = document.getElementsByName("RepairBtn");
|
||||
// var str_value = "";
|
||||
// for (var i = 0; i < repairtags.length; i++)
|
||||
// {
|
||||
// repairtags[i].style.backgroundColor = "gray";
|
||||
// }
|
||||
// }
|
||||
|
||||
// //反选
|
||||
// void ReverseSelectBtn()
|
||||
// {
|
||||
// var btn_Str = "";
|
||||
// var repairtags = document.getElementsByName("RepairBtn");
|
||||
// var str_value = "";
|
||||
// for (var i = 0; i < repairtags.length; i++)
|
||||
// {
|
||||
// var btnColor = repairtags[i].style.backgroundColor;
|
||||
// if (btnColor == "green")//判断按钮背景色
|
||||
// {
|
||||
// repairtags[i].style.backgroundColor = "gray";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// repairtags[i].style.backgroundColor = "green";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //保存返修数据
|
||||
// void RepairPartLoad_Confirm()
|
||||
// {
|
||||
// var btn_Str = "";
|
||||
// var repairtags = document.getElementsByName("RepairBtn");
|
||||
// var str_value = "";
|
||||
// for (var i = 0; i < repairtags.length; i++)
|
||||
// {
|
||||
// var btnColor = repairtags[i].style.backgroundColor;
|
||||
// if (btnColor == "green")//判断按钮背景色
|
||||
// {
|
||||
// str_value = repairtags[i].value + "^" + "1" + "|" + str_value;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// str_value = repairtags[i].value + "^" + "0" + "|" + str_value;
|
||||
// }
|
||||
// }
|
||||
// var RepairMethod = $("input[name='RepairMethod']:checked").val();
|
||||
// var engineID = $("#text_selectByID").val();
|
||||
// var OpNanme_Str = btn_Str.split("|");
|
||||
// var engineType = $("#text_engingeType").val();
|
||||
// var OpName = $("#tbx_opname").val(); //工位号
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=SaveRepairStatus&str_value=' + str_value + '&engineID=' + engineID + '&RepairMethod=' + RepairMethod + '&engineType=' + engineType + '&OpName=' + OpName,
|
||||
// success: function(data) {
|
||||
|
||||
// if (data == "True")
|
||||
// {
|
||||
// $.messager.show({
|
||||
// title: '提示',
|
||||
// msg: "返修上线数据保存成功!",
|
||||
// timeout: 5000,
|
||||
// showType: 'slide'
|
||||
// });
|
||||
// $('#div_RepairPartLoad_dialg').dialog({
|
||||
|
||||
// closed: true
|
||||
// });
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var value = $("#text_selectByID").val();
|
||||
// var m_value = value + "/" + RepairMethod;
|
||||
// var sendmessage = "MSG,RepairMarks|" + opName + "|" + m_value;
|
||||
// sendMessage(sendmessage);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $.messager.show({
|
||||
// title: '提示',
|
||||
// msg: "返修上线数据保存失败!",
|
||||
// timeout: 5000,
|
||||
// showType: 'slide'
|
||||
// });
|
||||
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// //初始化返修上线弹出框的动态按钮
|
||||
// void Initdiv_RepairPartLoadBtn()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val(); //工位号
|
||||
// var text_selectByID = $("#text_selectByID").val(); //工件编号
|
||||
// if (text_selectByID == "")
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=RepairStatusInit&value=' + opName + '&text_selectByID=' + text_selectByID,
|
||||
// success: function(data)
|
||||
// {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// document.getElementById("div_RepairPartLoad_zbz").innerHTML = '' + data + '';
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
// //关闭弹窗
|
||||
// void RepairPartLoad_Cancel()
|
||||
// {
|
||||
|
||||
// $('#div_RepairPartLoad_dialg').dialog({
|
||||
|
||||
// closed: true
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
// //点击返修上线按钮
|
||||
// void btn_outlinerepair()
|
||||
// {
|
||||
// /////////////////////返修上线////////////////////
|
||||
// //弹出返修上线dialog
|
||||
|
||||
// $("#div_RepairPartLoad_dialg").dialog("open");
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// void RepairBtnClick(data)
|
||||
// {
|
||||
|
||||
// var opname = data.value;
|
||||
// var btnColor = document.getElementById("Btn_" + opname + "").style.backgroundColor;
|
||||
// if (btnColor == "green")//判断按钮背景色
|
||||
// {
|
||||
// $('#Btn_' + opname).css({
|
||||
// "background-color": "gray"//设置背景色为空
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#Btn_' + opname).css({
|
||||
// "background-color": "green"
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// //初始化质量查询返修
|
||||
// void initStationdataRepair()
|
||||
// {
|
||||
// //console.info("质量查询的tab");
|
||||
// var opNumWidth = $("#div_tab_stationdata").width() * 0.3;
|
||||
// var measureDataWidth = $("#div_tab_stationdata").width() * 0.2;
|
||||
// var measureNameWidth = $("#div_tab_stationdata").width() * 0.3;
|
||||
// var qualifiedMarkWidth = $("#div_tab_stationdata").width() * 0.19;
|
||||
// $('#datagridview_stationdata_repair').datagrid({
|
||||
// url: '',
|
||||
// title: '',
|
||||
// sortName: '', //按哪个字段排序,把这个提交给服务器
|
||||
// sortOrder: 'desc', //升序降序
|
||||
// idField: '',
|
||||
// fit: true,
|
||||
// fitColumns: true,
|
||||
// columns:
|
||||
// [[
|
||||
// { title: '工位号', field: 'JSON_工位号', width: 70, align: 'center' },
|
||||
// { title: '测量位置', field: 'JSON_测量位置', width: 110, align: 'center' },
|
||||
// { title: '测量数据', field: 'JSON_测量值', width: 80, align: 'center' },
|
||||
// { title: '测量名称', field: 'JSON_测量项目', width: 75, align: 'center' },
|
||||
// { title: '是否合格', field: 'JSON_合格标志', width: 70, align: 'center' }
|
||||
// ]],
|
||||
|
||||
// rowStyler: function(index, row) {
|
||||
// if (index % 2 == 0 && row.JSON_合格标志 == "OK")
|
||||
// {
|
||||
// return 'background-color:#D0D8E8';
|
||||
// }
|
||||
// else if (index % 2 != 0 && row.JSON_合格标志 == "OK")
|
||||
// {
|
||||
// return 'background-color:#E9EDF4';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return 'background-color:red';
|
||||
// }
|
||||
// }
|
||||
|
||||
// })
|
||||
//}
|
||||
// //更新质量查询模块按钮颜色返修界面
|
||||
// void IniQualityButtons_bgColorRepair()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=QualityDataButton_bgColor_Select&value=' + opName + '&v=' + new Date().getTime(),
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// document.getElementById("div_tab_station_Repair").innerHTML = data;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// //更新质量查询模块按钮颜色返修
|
||||
// void IniQualityButtons_bgColor_byenergineID_Repair()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// var energineID = $("#text_selectByID").val();
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: '../submit/OpName.ashx?type=QualityDataButton_bgColor_Select_ByEnergineID&value=' + opName + '&energineID=' + energineID + '&v=' + new Date().getTime(),
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// //document.getElementById("div_tab_station_Repair").innerHTML = data;
|
||||
// $("#div_tab_station_Repair").html(data);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// //显示 机型
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: '../submit/OpName.ashx?type=Select_engineType_ByEnergineID&value=' + opName + '&energineID=' + energineID + '&v=' + new Date().getTime(),
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// var engineType = data.engineType; //机型
|
||||
// $("#text_engingeType").val(engineType);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// //对应返修质量数据查询
|
||||
// void QualityDataSelectRepair(opname)
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val(); //当前工位号
|
||||
// var opname = opname; //选择工位号
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: '../submit/OpName.ashx?type=QualityDataSelect&value=' + opName + '&opname=' + opname,
|
||||
// dataType: 'json',
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// $("#datagridview_stationdata_repair").datagrid("loadData", data);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//}
|
||||
|
||||
|
||||
// var time = 0;
|
||||
// //根据发动机号查询质量数据
|
||||
// void qualityDataSelect()
|
||||
// {
|
||||
|
||||
// if (time == 0)
|
||||
// {
|
||||
// document.getElementById('button_select').style.background = 'green';
|
||||
// QualityDataSelectRepair('0000'); //用于清空缓存数据
|
||||
// IniQualityButtons_bgColor_byenergineID_Repair();
|
||||
// time = 2;
|
||||
// }
|
||||
// if (time == 1)
|
||||
// {
|
||||
|
||||
// document.getElementById('button_select').style.background = 'gray';
|
||||
// QualityDataSelectRepair('0000');
|
||||
// document.getElementById('text_selectByID').value = "";
|
||||
// document.getElementById('text_engingeType').value = "";
|
||||
// IniQualityButtons_bgColorRepair();
|
||||
// time = 0;
|
||||
// }
|
||||
// if (time == 2)
|
||||
// {
|
||||
// time = 1;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// //更新质量查询模块按钮颜色返修用
|
||||
// void IniQualityButtons_bgColorRepair()
|
||||
// {
|
||||
// var opName = $("#tbx_opname").val();
|
||||
// $.ajax({
|
||||
// url: '../submit/OpName.ashx?type=QualityDataButton_bgColor_Select&value=' + opName + '&v=' + new Date().getTime(),
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// document.getElementById("div_tab_station_Repair").innerHTML = data;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun_base
|
||||
{
|
||||
public partial class MisWebInterface
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static MesWebFun_base _MesWebFun_base = new MesWebFun_base();
|
||||
|
||||
|
||||
public string WebSocket_Function(string msg)
|
||||
{
|
||||
var responseStr = "";
|
||||
try
|
||||
{
|
||||
//返回的数据msg.data,包含了协议中的4部分9
|
||||
var arrays_signal = msg.Split('|');
|
||||
var m_Source = arrays_signal[0];
|
||||
var m_Command = arrays_signal[1];
|
||||
var m_Opname = arrays_signal[2];
|
||||
var m_Value = arrays_signal[3];
|
||||
// var opName = $("#tbx_opname").val();
|
||||
switch (m_Source)
|
||||
{
|
||||
case "MES":
|
||||
|
||||
switch (m_Command)
|
||||
{
|
||||
//显示托盘信息 √
|
||||
case "ShowMoby":
|
||||
try
|
||||
{
|
||||
responseStr = ReceivedSignal_MobySelect( m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowMoby" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//显示操作指南√
|
||||
case "ProcessList":
|
||||
try
|
||||
{
|
||||
responseStr = ReceivedSignal_ProcessList(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ProcessList" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//显示物料√
|
||||
case "MaterialList":
|
||||
try
|
||||
{
|
||||
responseStr = ReceivedSignal_MaterialList(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:MaterialList" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//显示操作图片√
|
||||
case "PicShow":
|
||||
try
|
||||
{
|
||||
responseStr = ReceivedSignal_PictureShow(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:PicShow" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//显示拧紧位置√
|
||||
case "ShaftPosition":
|
||||
try
|
||||
{
|
||||
responseStr = InitShowGuidCircle(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShaftPosition" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//实时显示质量数据√
|
||||
case "ShowTimelyQuality":
|
||||
try
|
||||
{
|
||||
// url: '../submit/OpName.ashx?type=ShowTimelyQuality&value=' + opName,
|
||||
responseStr = _MesWebFun_base.ProcessRequest("ShowTimelyQuality", m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowTimelyQuality" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//手动拧紧实时显示质量数据√
|
||||
case "ShowTimelyQuality_Tight":
|
||||
try
|
||||
{
|
||||
// url: '../submit/OpName.ashx?type=ShowTimelyQuality&value=' + opName,
|
||||
responseStr = _MesWebFun_base.ProcessRequest("ShowTimelyQuality", m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowTimelyQuality_Tight" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
|
||||
//√
|
||||
case "OrderFormList":
|
||||
try
|
||||
{
|
||||
// ReloadOrderInfoData();
|
||||
//url: '../submit/OpName.ashx?type=OrderFormList&value=' + opName,
|
||||
responseStr = _MesWebFun_base.ProcessRequest("OrderFormList", m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:OrderFormList" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//弹窗消息√
|
||||
case "Notice":
|
||||
try
|
||||
{
|
||||
responseStr = ShowWindowNotice(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:Notice" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//LED消息提醒√
|
||||
case "ScrollNotice":
|
||||
try
|
||||
{
|
||||
responseStr = ShowLEDNotice(m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ScrollNotice" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
//物料检测初始化√
|
||||
case "MaterialCheckPosition":
|
||||
responseStr = InitMaterialCheck(m_Opname);
|
||||
break;
|
||||
//返修质量数据显示√
|
||||
case "RepairQuality":
|
||||
try
|
||||
{
|
||||
// IniQualityButtons_bgColor_byenergineID_socket(m_Value);
|
||||
//url: '../submit/OpName.ashx?type=QualityDataButton_bgColor_Select_ByEnergineID&value=' + opName + '&energineID=' + energineID + '&v=' + new Date().getTime(),
|
||||
responseStr = _MesWebFun_base.ProcessRequest("QualityDataButton_bgColor_Select_ByEnergineID", m_Opname);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:RepairQuality" + "|" + "info");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Web_Socket_Interface(m_Opname, msg);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
var error = exception.ToString();
|
||||
//ApplicationLog.WriteLog("信息提示" + "|" + "系统出现错误,接受onmessage:" + "|" + error + "|" + "info");
|
||||
responseStr = "";
|
||||
}
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using SystemFramework;
|
||||
|
||||
//namespace MesWebFun_base
|
||||
//{
|
||||
// public partial class MisWebInterface
|
||||
// {
|
||||
|
||||
|
||||
// /*该js文件用于处理"弹窗消息"业务逻辑处理*/
|
||||
|
||||
// //接口函数
|
||||
// void Web_Socket_Interface(opName, msg)
|
||||
// {
|
||||
// //获取工位号对应Fun类型
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=' + opName + '&value=' + opName,
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// switch (data)
|
||||
// {
|
||||
// case "01":
|
||||
// Web_Socket_Fun01(opName, msg);
|
||||
// break;
|
||||
// case "02":
|
||||
// Web_Socket_Fun02(opName, msg);
|
||||
// break;
|
||||
// case "03":
|
||||
// Web_Socket_Fun03(opName, msg);
|
||||
// break;
|
||||
// case "04":
|
||||
// Web_Socket_Fun04(opName, msg);
|
||||
// break;
|
||||
// case "05":
|
||||
// Web_Socket_Fun05(opName, msg);
|
||||
// break;
|
||||
// case "06":
|
||||
// Web_Socket_Fun06(opName, msg);
|
||||
// break;
|
||||
// case "07":
|
||||
// Web_Socket_Fun07(opName, msg);
|
||||
// break;
|
||||
// case "08":
|
||||
// Web_Socket_Fun08(opName, msg);
|
||||
// break;
|
||||
// case "09":
|
||||
// Web_Socket_Fun09(opName, msg);
|
||||
// break;
|
||||
// case "10":
|
||||
// Web_Socket_Fun10(opName, msg);
|
||||
// break;
|
||||
// case "11":
|
||||
// Web_Socket_Fun11(opName, msg);
|
||||
// break;
|
||||
// case "12":
|
||||
// Web_Socket_Fun12(opName, msg);
|
||||
// break;
|
||||
// case "13":
|
||||
// Web_Socket_Fun13(opName, msg);
|
||||
// break;
|
||||
// case "14":
|
||||
// Web_Socket_Fun14(opName, msg);
|
||||
// break;
|
||||
// case "15":
|
||||
// Web_Socket_Fun15(opName, msg);
|
||||
// break
|
||||
// case "16":
|
||||
// Web_Socket_Fun16(opName, msg);
|
||||
// break;
|
||||
// case "17":
|
||||
// Web_Socket_Fun17(opName, msg);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
//}
|
||||
|
||||
// //特殊functionjs处理
|
||||
// void Web_Socket_MesWebFun_Interface(opName, msg)
|
||||
// {
|
||||
|
||||
// //获取工位号对应Fun类型
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '../submit/OpName.ashx?type=' + opName + '&value=' + opName,
|
||||
// success: function(data) {
|
||||
// if (data != null && data != "")
|
||||
// {
|
||||
// switch (data)
|
||||
// {
|
||||
// case "01":
|
||||
// Web_Socket_MesWebFun01(opName, msg);
|
||||
// break;
|
||||
// case "02":
|
||||
// Web_Socket_MesWebFun02(opName, msg);
|
||||
// break;
|
||||
// case "03":
|
||||
// Web_Socket_MesWebFun03(opName, msg);
|
||||
// break;
|
||||
// case "04":
|
||||
// Web_Socket_MesWebFun04(opName, msg);
|
||||
// break;
|
||||
// case "05":
|
||||
// Web_Socket_MesWebFun05(opName, msg);
|
||||
// break;
|
||||
// case "06":
|
||||
// Web_Socket_MesWebFun06(opName, msg);
|
||||
// break;
|
||||
// case "07":
|
||||
// Web_Socket_MesWebFun07(opName, msg);
|
||||
// break;
|
||||
// case "08":
|
||||
// Web_Socket_MesWebFun08(opName, msg);
|
||||
// break;
|
||||
// case "09":
|
||||
// Web_Socket_MesWebFun09(opName, msg);
|
||||
// break;
|
||||
// case "10":
|
||||
// Web_Socket_MesWebFun10(opName, msg);
|
||||
// break;
|
||||
// case "11":
|
||||
// Web_Socket_MesWebFun11(opName, msg);
|
||||
// break;
|
||||
// case "12":
|
||||
// Web_Socket_MesWebFun12(opName, msg);
|
||||
// break;
|
||||
// case "13":
|
||||
// Web_Socket_MesWebFun13(opName, msg);
|
||||
// break;
|
||||
// case "14":
|
||||
// Web_Socket_MesWebFun14(opName, msg);
|
||||
// break;
|
||||
// case "15":
|
||||
// Web_Socket_MesWebFun15(opName, msg);
|
||||
// break;
|
||||
// case "16":
|
||||
// Web_Socket_MesWebFun16(opName, msg);
|
||||
// break;
|
||||
// case "17":
|
||||
// Web_Socket_MesWebFun17(opName, msg);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
36
Common/08WebFun_base/WebFun_base/Properties/AssemblyInfo.cs
Normal file
36
Common/08WebFun_base/WebFun_base/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("WebFun_base")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WebFun_base")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("d98be764-adeb-488d-9714-61e308aa8201")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
1224
Common/08WebFun_base/WebFun_base/Reference.cs
Normal file
1224
Common/08WebFun_base/WebFun_base/Reference.cs
Normal file
File diff suppressed because it is too large
Load Diff
475
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction01.cs
Normal file
475
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction01.cs
Normal file
@@ -0,0 +1,475 @@
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction01
|
||||
{
|
||||
// HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(string cmd)
|
||||
{
|
||||
string responseText = "";
|
||||
switch (cmd)
|
||||
{
|
||||
////保存手动生成条码
|
||||
//case "SavingEngineIDShift":
|
||||
// responseText = SavingEngineIDShift();
|
||||
// break;
|
||||
//case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
// responseText = SaveRepairStatus();
|
||||
// break;
|
||||
//case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
// responseText = RepairStatusInit();
|
||||
// break;
|
||||
//case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
// responseText = Select_engineType_ByEnergineID();
|
||||
// break;
|
||||
//case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
// responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
// break;
|
||||
/////////////////////////质量查询根据发动机号
|
||||
//case "QualityDataSelectByEnergineID":
|
||||
// responseText = QualityDataSelectByEnergineID();
|
||||
// break;
|
||||
default:
|
||||
responseText = "01";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID(string opName, string energineID)
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift(string opname, string date, string num)
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
//string date = HttpContext.Current.Request["date"];//日期
|
||||
//string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit(string Opname, string selectID)
|
||||
{
|
||||
//string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus(string RepairStatus, string engineID, int RepairMethod, string engineType, string RepairOpName)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
//string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
//string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
//int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
//string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
//string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect(string energineID, string opname)
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
//string energineID = HttpContext.Current.Request["energineID"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID(string energineID, string opname)
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//string energineID = HttpContext.Current.Request["value"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
489
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction02.cs
Normal file
489
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction02.cs
Normal file
@@ -0,0 +1,489 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction02
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "02";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction04.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction04.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction04
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "04";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction05.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction05.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction05
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "05";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction06.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction06.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction06
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "06";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
417
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction07.cs
Normal file
417
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction07.cs
Normal file
@@ -0,0 +1,417 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction07
|
||||
{
|
||||
private HttpContext contextMesWebFun;
|
||||
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
|
||||
default:
|
||||
responseText = "07";
|
||||
break;
|
||||
}
|
||||
|
||||
return responseText;
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string outtext = CreateRepairUpLine(Opname);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
string[] StationData;//最近一条返修工位数据数组
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairData(OpName, out dt);
|
||||
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修工位"].ToString();
|
||||
StationData = StationDataStr.Split('|');
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
string TargetOpName = RepairSta[i];//目标工位号
|
||||
|
||||
for (int j = 0; j < StationData.Length; j++)
|
||||
{
|
||||
string[] OpNameDate;
|
||||
OpNameDate = StationData[j].Split('^');
|
||||
if (TargetOpName == OpNameDate[0])
|
||||
{
|
||||
if (j < (StationData.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + OpNameDate[1] + "^";
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + OpNameDate[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
}
|
||||
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
}/// <summary>
|
||||
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun07:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
}
|
||||
}
|
||||
}
|
||||
695
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction08.cs
Normal file
695
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction08.cs
Normal file
@@ -0,0 +1,695 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction08
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
|
||||
case "SelectSublineStatus":
|
||||
responseText = SelectSublineStatus();
|
||||
break;
|
||||
|
||||
case "SelectAssemblylineStatus":
|
||||
responseText = SelectAssemblylineStatus();
|
||||
break;
|
||||
|
||||
case "QueueListDataSelect":
|
||||
responseText = QueueListDataSelect();
|
||||
break;
|
||||
case "MatchingListDataSelect":
|
||||
responseText = MatchingListDataSelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "08";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据总线机型查询轴系线托盘号、发动机型号
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="EngineID_Subline"></param>
|
||||
/// <param name="PalletNumSubline"></param>
|
||||
private void SelectSublineEngineIDAndPalletnum(string EngineID, out string EngineID_Subline, out int PalletNumSubline)
|
||||
{
|
||||
EngineID_Subline = "";
|
||||
PalletNumSubline = 0;
|
||||
|
||||
string produceName;
|
||||
produceName = "分线上总线_分线托盘号总成编号_根据总线总成编号_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总装线总成编号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@轴系线总成编号", SqlDbType.NVarChar, 50, "轴系线总成编号");
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@轴系线托盘号", SqlDbType.Int, 4, "轴系线托盘号");
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
if (thisParms[1].Value != null && thisParms[2].Value != null)
|
||||
{
|
||||
EngineID_Subline = thisParms[1].Value.ToString();
|
||||
PalletNumSubline = Convert.ToInt32(thisParms[2].Value);
|
||||
}
|
||||
}
|
||||
|
||||
private string SelectSublineStatus()
|
||||
{
|
||||
|
||||
|
||||
string data = "";
|
||||
try
|
||||
{
|
||||
string EngineID_Subline = "";
|
||||
int PalletNumSubline = 0;
|
||||
string EngineID = contextMesWebFun.Request["EngineID"];
|
||||
|
||||
SelectSublineEngineIDAndPalletnum(EngineID, out EngineID_Subline, out PalletNumSubline);
|
||||
data = EngineID_Subline + "&" + PalletNumSubline;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "SelectSublineStatus");
|
||||
}
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// /////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// 根据轴系线机型查询总装线托盘号、发动机型号
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="EngineID_Subline"></param>
|
||||
/// <param name="PalletNumSubline"></param>
|
||||
private void SelectAssemblylineEngineIDAndPalletnum(string EngineID, out string EngineID_Assemblyline, out int PalletNumAssemblyline)
|
||||
{
|
||||
EngineID_Assemblyline = "";
|
||||
PalletNumAssemblyline = 0;
|
||||
|
||||
string produceName;
|
||||
produceName = "分线上总线_总装线托盘号总成编号_根据轴系线总成编号_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@轴系线总成编号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@总装线总成编号", SqlDbType.NVarChar, 50, "总装线总成编号");
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@总装线托盘号", PalletNumAssemblyline);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
EngineID_Assemblyline = thisParms[1].Value.ToString();
|
||||
PalletNumAssemblyline = Convert.ToInt32(thisParms[2].Value);
|
||||
|
||||
}
|
||||
|
||||
private string SelectAssemblylineStatus()
|
||||
{
|
||||
|
||||
|
||||
string data = "";
|
||||
try
|
||||
{
|
||||
string EngineID_Assemblyline = "";
|
||||
int PalletNumAssemblyline = 0;
|
||||
string EngineID = contextMesWebFun.Request["EngineID"];
|
||||
|
||||
SelectAssemblylineEngineIDAndPalletnum(EngineID, out EngineID_Assemblyline, out PalletNumAssemblyline);
|
||||
data = EngineID_Assemblyline + "&" + PalletNumAssemblyline;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "SelectSublineStatus");
|
||||
}
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取排队列表数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QueueListDataSelect()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
QueueListSelect(out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
|
||||
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun12:QueueListDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 输出轴轴承外圈排队列表_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool QueueListSelect(out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "轴承外圈轴系追踪号排队_查询全部";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[0];
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取匹配列表数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string MatchingListDataSelect()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
MatchingListSelect(out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
|
||||
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun12:MatchingListDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输出轴轴承外圈匹配列表_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool MatchingListSelect(out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "轴承外圈轴系总成号与总线总成号匹配列表_查询全部";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[0];
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
482
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction10.cs
Normal file
482
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction10.cs
Normal file
@@ -0,0 +1,482 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction10
|
||||
{
|
||||
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "10";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string outtext = CreateRepairUpLine(Opname);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
string[] StationData;//最近一条返修工位数据数组
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairData(OpName, out dt);
|
||||
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修工位"].ToString();
|
||||
StationData = StationDataStr.Split('|');
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
string TargetOpName = RepairSta[i];//目标工位号
|
||||
|
||||
for (int j = 0; j < StationData.Length; j++)
|
||||
{
|
||||
string[] OpNameDate;
|
||||
OpNameDate = StationData[j].Split('^');
|
||||
if (TargetOpName == OpNameDate[0])
|
||||
{
|
||||
if (j < (StationData.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + OpNameDate[1] + "^";
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + OpNameDate[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}/// <summary>
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction11.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction11.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction11
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "05";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction12.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction12.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction12
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "05";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction13.cs
Normal file
491
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction13.cs
Normal file
@@ -0,0 +1,491 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction13
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "05";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
493
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction14.cs
Normal file
493
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction14.cs
Normal file
@@ -0,0 +1,493 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction14
|
||||
{
|
||||
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "14";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname,selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName,string selectID ,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName,string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}/// <summary>
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
489
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction15.cs
Normal file
489
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction15.cs
Normal file
@@ -0,0 +1,489 @@
|
||||
using DataLinkMesWork;
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction15
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//托盘信息
|
||||
case "MobySelect":
|
||||
// responseText = MobySelect();
|
||||
break;
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "15";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
483
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction16.cs
Normal file
483
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction16.cs
Normal file
@@ -0,0 +1,483 @@
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction16
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "01";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
483
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction17.cs
Normal file
483
Common/08WebFun_base/WebFun_base/SpecialFun/WebFunction17.cs
Normal file
@@ -0,0 +1,483 @@
|
||||
using bizFacade;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
//using SystemFramework;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction17
|
||||
{
|
||||
HttpContext contextMesWebFun;
|
||||
public string ProcessRequest(HttpContext context)
|
||||
{
|
||||
contextMesWebFun = context; ;
|
||||
context.Response.ContentType = "text/plain";
|
||||
string type = contextMesWebFun.Request["type"];
|
||||
string responseText = "";
|
||||
switch (type)
|
||||
{
|
||||
//保存手动生成条码
|
||||
case "SavingEngineIDShift":
|
||||
responseText = SavingEngineIDShift();
|
||||
break;
|
||||
case "SaveRepairStatus"://将返修路径及返修数据保存到数据库
|
||||
responseText = SaveRepairStatus();
|
||||
break;
|
||||
case "RepairStatusInit"://将返修路径及返修数据保存到数据库
|
||||
responseText = RepairStatusInit();
|
||||
break;
|
||||
case "Select_engineType_ByEnergineID": //根据发动机号显示机型
|
||||
responseText = Select_engineType_ByEnergineID();
|
||||
break;
|
||||
case "QualityDataButton_bgColor_Select_ByEnergineID":
|
||||
responseText = QualityDataButton_bgColor_Select_energineSelect();
|
||||
break;
|
||||
///////////////////////质量查询根据发动机号
|
||||
case "QualityDataSelectByEnergineID":
|
||||
responseText = QualityDataSelectByEnergineID();
|
||||
break;
|
||||
default:
|
||||
responseText = "17";
|
||||
break;
|
||||
}
|
||||
return responseText;
|
||||
}
|
||||
/// <summary>
|
||||
/// //根据发动机号显示机型,界面提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string Select_engineType_ByEnergineID()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string opName = HttpContext.Current.Request["value"];//发动机号
|
||||
string energineID = HttpContext.Current.Request["energineID"];//发动机号
|
||||
GetEngineID_Select(energineID, opName, out dt);
|
||||
|
||||
string engineType = "";
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineType = dt.Rows[0]["发动机型号"].ToString();
|
||||
}
|
||||
}
|
||||
text = "{\"engineType\":\"" + engineType + "\"}";
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun08:Select_engineType_ByEnergineID");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存手动要求的条码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string SavingEngineIDShift()
|
||||
{
|
||||
string text = "";
|
||||
bool flag = false;
|
||||
System.Data.DataTable dt = null;
|
||||
try
|
||||
{
|
||||
string opname = HttpContext.Current.Request["value"];//工位号
|
||||
string date = HttpContext.Current.Request["date"];//日期
|
||||
string num = HttpContext.Current.Request["num"];//流水号
|
||||
string[] dates = date.Split('-');
|
||||
if (dates.Length > 2)
|
||||
{
|
||||
int year = Convert.ToInt32(dates[0]);
|
||||
int month = Convert.ToInt32(dates[1]);
|
||||
int day = Convert.ToInt32(dates[2]);
|
||||
int single = Convert.ToInt32(num);
|
||||
MES.OpName_MIS_Manual_Insert(opname, year, month, day, single);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
text = "{\"flag\":\"1\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
text = "{\"flag\":\"0\"}";
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun01:SavingEngineIDShift");
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private static string RepairStatusInit()
|
||||
{
|
||||
string Opname = HttpContext.Current.Request["value"];//工位号
|
||||
string selectID = HttpContext.Current.Request["text_selectByID"];//工位号 text_selectByID
|
||||
string outtext = CreateRepairUpLine(Opname, selectID);
|
||||
return outtext;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建返修上线工位按钮
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateRepairUpLine(string OpName, string selectID)
|
||||
{
|
||||
StringBuilder HtmlStr = new StringBuilder();//可修改字符串
|
||||
|
||||
string BtnData = "";
|
||||
int RouteNum = 0;
|
||||
bool HaveDataOrNot = false;
|
||||
DataTable dt;
|
||||
|
||||
string StationDataStr;//最近一条返修工位数据
|
||||
//查询返修上线字符串及路径数目
|
||||
RepairBtnDataSelect(OpName, out BtnData, out RouteNum);
|
||||
string[] RepairSta = BtnData.Split('^');//目标工位数组
|
||||
string TargetStationData = "";//目标工位数据
|
||||
//查询之前的返修上线数据
|
||||
HaveDataOrNot = selectRepairStrSelect(OpName, selectID, out dt);
|
||||
//合成界面显示按钮字符串
|
||||
if (HaveDataOrNot)
|
||||
{
|
||||
StationDataStr = dt.Rows[0]["返修字符串"].ToString();
|
||||
if (StationDataStr == "")
|
||||
{
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = StationDataStr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
if (i < (RepairSta.Length - 1))
|
||||
{
|
||||
TargetStationData = TargetStationData + "1^";
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetStationData = TargetStationData + "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
//页面定义
|
||||
HtmlStr.Append("<table style=\"width:100%;height:100%;\" ><tr><td style=\"height:15px\"></td></tr>\r\n<tr>");
|
||||
for (int i = 0; i < RepairSta.Length; i++)
|
||||
{
|
||||
//动态生成标签
|
||||
//样式定义
|
||||
string td_style = "width:20%;height:35px";//td样式
|
||||
string btn_style = "width:98%;height:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";//标签样式
|
||||
string type = "button";
|
||||
string tagID = "Btn_" + RepairSta[i];
|
||||
string value = RepairSta[i];
|
||||
string onclick = "RepairBtnClick(Btn_" + value + ")";
|
||||
string[] StationDataArray = TargetStationData.Split('^');
|
||||
string bgColor;
|
||||
|
||||
if (StationDataArray[i] == "1")
|
||||
{
|
||||
bgColor = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColor = "background-color: gray";
|
||||
}
|
||||
//保证每行5个按钮
|
||||
if (i < RepairSta.Length - 1)
|
||||
{
|
||||
if (i % 5 < 4)
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HtmlStr.Append("<td style=\"" + td_style + "\"><input name=\"RepairBtn\" id=\"" + tagID + "\" type=\"" + type + "\" style=\"" + btn_style + ";" + bgColor + "\" value=\"" + value + "\" onclick=\"" + onclick + "\"/></td>");
|
||||
HtmlStr.Append("</tr><tr><td style=\"height:15px\"></td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
HtmlStr.Append("</table>");
|
||||
//上线路径大于1条则显示上线路径
|
||||
if (RouteNum > 1)
|
||||
{
|
||||
|
||||
}
|
||||
return HtmlStr.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool updateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
private static string SaveRepairStatus()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string RepairStatus = HttpContext.Current.Request["str_value"];//返修工位状态
|
||||
string engineID = HttpContext.Current.Request["engineID"];//返修零件总成号
|
||||
int RepairMethod = Convert.ToInt32(HttpContext.Current.Request["RepairMethod"]);//返修路径
|
||||
string engineType = HttpContext.Current.Request["engineType"];//返修零件总成号
|
||||
string RepairOpName = HttpContext.Current.Request["OpName"];//返修上线点
|
||||
string[] RepairStatusSplit = RepairStatus.Split('|');
|
||||
for (int i = 0; i < RepairStatusSplit.Length - 1; i++)
|
||||
{
|
||||
updateRepairStatusTo_SQL(RepairStatusSplit[i].Split('^')[0], RepairStatusSplit[i].Split('^')[1]);
|
||||
}
|
||||
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@返修上线点", RepairOpName);
|
||||
string result = Convert.ToString(DataAccess.ExecuteStoredProcedure(produceName, ref thisParms));
|
||||
return result;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号] 20160728 majian
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineID_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private string QualityDataButton_bgColor_Select_energineSelect()
|
||||
{
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
//单号
|
||||
string energineID = HttpContext.Current.Request["energineID"];
|
||||
string opname = HttpContext.Current.Request["value"];
|
||||
QualityDataButton_bgColor_Select(opname, energineID, out dt);//此处重新写函数
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count >= 0)
|
||||
{
|
||||
text = Buttons.Createbuttons(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun02:QualityDataButton_bgColor_Select");
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取对应工位的质量数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string QualityDataSelectByEnergineID()
|
||||
{
|
||||
string qualitydata = "";
|
||||
try
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
string energineID = HttpContext.Current.Request["value"];
|
||||
string opname = HttpContext.Current.Request["opname"];
|
||||
QualityDataSelect(opname, energineID, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
//if (dt.Rows.Count > 0)
|
||||
{
|
||||
qualitydata = JsonHelper.CreateJsonParameters(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "MesWebFun10:QualityDataSelect");
|
||||
}
|
||||
return qualitydata;
|
||||
|
||||
}
|
||||
|
||||
static public bool QualityDataSelect(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_根据_工位号_发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修上线工位及返修路径数目
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="BtnData"></param>
|
||||
/// <param name="RouteNum"></param>
|
||||
public static void RepairBtnDataSelect(string OpName, out string BtnData, out int RouteNum)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
BtnData = "";
|
||||
RouteNum = 0;
|
||||
procedureName = "返修上线_返修工位_返修上线点及返修路径_基础配置_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
BtnData = dt.Rows[0]["待返修工位"].ToString();
|
||||
RouteNum = Convert.ToInt32(dt.Rows[0]["返修路径数目"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前上线点上次选择的返修工位,用于界面按钮颜色原始数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairData(string OpName, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_最近数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool selectRepairStrSelect(string OpName, string selectID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "返修上线_返修工位及返修路径_是否工作判断";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@返修上线点", OpName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", selectID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Common/08WebFun_base/WebFun_base/SpecialFun/vssver2.scc
Normal file
BIN
Common/08WebFun_base/WebFun_base/SpecialFun/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user