init: 导入项目到 meswork Gitea
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using bizFacade;
|
||||
using System.Data;
|
||||
using SystemFramework;
|
||||
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class MesWebFun_Special
|
||||
{
|
||||
/// <summary>
|
||||
/// 提供调用特殊工位类型方法的调用入口
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public static string SpecialFuctionRequstBase(HttpContext context)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{23477F90-856B-492C-8486-01F64F3CEFE1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MesWebFun_Special</RootNamespace>
|
||||
<AssemblyName>MesWebFun_Special</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</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="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MesWebFun_Special.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction06.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction08.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction07.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction05.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction04.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction02.cs" />
|
||||
<Compile Include="SpecialFun\WebFunction01.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="..\WebBusinessFacade\BusinessFacade.csproj">
|
||||
<Project>{9521ec25-d820-42f8-b3e2-7a5667b5e9f7}</Project>
|
||||
<Name>BusinessFacade</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DataAccess\BizDataAccess.csproj">
|
||||
<Project>{bbe7d8b5-da6d-46db-99de-0fad76448125}</Project>
|
||||
<Name>BizDataAccess</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SystemFrameworks\SystemFramework.csproj">
|
||||
<Project>{8f2c19e9-9a45-4f47-95a3-87f4778b7190}</Project>
|
||||
<Name>SystemFramework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = "relative:MesWebFun_Special"
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("MesWebFun_Special")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MesWebFun_Special")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("23477f90-856b-492c-8486-01f64f3cefe1")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
@@ -0,0 +1,484 @@
|
||||
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 BizDataAccess;
|
||||
|
||||
namespace MesWebFun
|
||||
{
|
||||
public class WebFunction01
|
||||
{
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,417 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,695 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,482 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,493 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
using BizDataAccess;
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
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 BizDataAccess;
|
||||
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
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 BizDataAccess;
|
||||
|
||||
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 = SQLCommon.ExecuteStoredProcedure(procedureName, connectionString, ref thisParms, out ds, out errorMessage);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
SCC = This is a Source Code Control file
|
||||
|
||||
[MesWebFun_Special.csproj]
|
||||
SCC_Aux_Path = "\\192.168.0.100\vss\MES4.0"
|
||||
SCC_Project_Name = "$/MISweb/MISweb/MesWebFun_Special", OABAAAAA
|
||||
BIN
MisData_3.0_2022.08.23.1622.LLX/WebFun_Special/vssver2.scc
Normal file
BIN
MisData_3.0_2022.08.23.1622.LLX/WebFun_Special/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user