You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1863 lines
88 KiB
1863 lines
88 KiB
using MySqlX.XDevAPI.Common;
|
|
using RS.DBUtility;
|
|
using RS.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Diagnostics.SymbolStore;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace RS.SQLServerDAL
|
|
{
|
|
public class SRecipeWork
|
|
{
|
|
public Dictionary<string, ScrubbingRecipeArm> ScrDic(List<string> strings, int type)
|
|
{
|
|
Dictionary<string, ScrubbingRecipeArm> dicReturn = new Dictionary<string, ScrubbingRecipeArm>();
|
|
try
|
|
{
|
|
string nameRecipe = null;
|
|
foreach (string s in strings)
|
|
{
|
|
if (s != "-" && !string.IsNullOrEmpty(s))
|
|
nameRecipe += "'" + s + "',";
|
|
}
|
|
if (!string.IsNullOrEmpty(nameRecipe))
|
|
{
|
|
string name = nameRecipe.Remove(nameRecipe.Length - 1);
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_scrubbing_recipe_arm`" + " ");
|
|
selectString.AppendLine("where scrub_recipe_name in (" + name + ")" + " ");
|
|
selectString.AppendLine("and scrub_type =" + type + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
for (int i = 0; i < data.Rows.Count; i++)
|
|
{
|
|
ScrubbingRecipeArm scrubbingRecipeArm = new ScrubbingRecipeArm();
|
|
scrubbingRecipeArm.scrub_position_one = Convert.ToSingle(data.Rows[i]["scrub_position_one"]);
|
|
scrubbingRecipeArm.scrub_position_two = Convert.ToSingle(data.Rows[i]["scrub_position_two"]);
|
|
scrubbingRecipeArm.scrub_speed = Convert.ToSingle(data.Rows[i]["scrub_speed"]);
|
|
scrubbingRecipeArm.move_method = data.Rows[i]["move_method"].ToString();
|
|
scrubbingRecipeArm.scrub_recipe_name = data.Rows[i]["scrub_recipe_name"].ToString();
|
|
dicReturn.Add(scrubbingRecipeArm.scrub_recipe_name, scrubbingRecipeArm);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dicReturn;
|
|
}
|
|
public Dictionary<string, FlushRecipeArm> FluDic(List<string> strings, int type)
|
|
{
|
|
Dictionary<string, FlushRecipeArm> dicReturn = new Dictionary<string, FlushRecipeArm>();
|
|
try
|
|
{
|
|
string nameRecipe = null;
|
|
foreach (string s in strings)
|
|
{
|
|
if (s != "-" && !string.IsNullOrEmpty(s))
|
|
nameRecipe += "'" + s + "',";
|
|
}
|
|
if (!string.IsNullOrEmpty(nameRecipe))
|
|
{
|
|
string name = nameRecipe.Remove(nameRecipe.Length - 1);
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_flush_recipe_arm`" + " ");
|
|
selectString.AppendLine("where flush_recipe_name in (" + name + ")" + " ");
|
|
selectString.AppendLine("and flush_type =" + type + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
for (int i = 0; i < data.Rows.Count; i++)
|
|
{
|
|
FlushRecipeArm scrubbingRecipeArm = new FlushRecipeArm();
|
|
scrubbingRecipeArm.flush_location_one = Convert.ToSingle(data.Rows[i]["flush_location_one"]);
|
|
scrubbingRecipeArm.flush_location_two = Convert.ToSingle(data.Rows[i]["flush_location_two"]);
|
|
scrubbingRecipeArm.flush_speed = Convert.ToSingle(data.Rows[i]["flush_speed"]);
|
|
scrubbingRecipeArm.flush_recipe_name = data.Rows[i]["flush_recipe_name"].ToString();
|
|
dicReturn.Add(scrubbingRecipeArm.flush_recipe_name, scrubbingRecipeArm);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dicReturn;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 查找 所有的作业配方(用于作业配方展示)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataTable SelRecipeWorkInfo()
|
|
{
|
|
DataTable dtResult = null;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT work_recipe_name,scr_one_recipe_name,scr_two_recipe_name ,scr_tre_recipe_name,scr_fou_recipe_name,work_createtor,work_time " + " ");
|
|
selectString.AppendLine("FROM `tb_work_recipe`" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
dtResult = dtJobOrderInfo;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 查询所有作业配方(用于作业配方下拉框内容)
|
|
/// </summary>
|
|
/// <param name="len"></param>
|
|
/// <returns></returns>
|
|
public List<string> SelRecipeWorkNameInfo(out int len)
|
|
{
|
|
List<string> list = new List<string>();
|
|
|
|
int length = 0;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT work_recipe_name" + " ");
|
|
selectString.AppendLine("FROM `tb_work_recipe`" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
length = dtJobOrderInfo.Rows.Count;
|
|
//RecipeWork[] recipeWork = new RecipeWork[length];
|
|
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
list.Add((dtJobOrderInfo.Rows[i]["work_recipe_name"] == null) ? "1" : dtJobOrderInfo.Rows[i]["work_recipe_name"].ToString());
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
len = length;
|
|
return list;
|
|
}
|
|
/// <summary>
|
|
/// 根据作业配方配方名称 查询改配方下机台的配方名
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public RecipeWork GetTotalWorkRecipeInfo(string recipeName)
|
|
{
|
|
RecipeWork recipeWork = new RecipeWork();
|
|
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
//
|
|
selectString.AppendLine("SELECT work_recipe_name,scr_one_recipe_name,scr_two_recipe_name ,scr_tre_recipe_name,scr_fou_recipe_name " + " ");
|
|
selectString.AppendLine("FROM `tb_work_recipe`" + " ");
|
|
selectString.AppendLine("where work_recipe_name='" + recipeName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
recipeWork.workRecipeName = (dtJobOrderInfo.Rows[0]["work_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[0]["work_recipe_name"].ToString();
|
|
recipeWork.scrOneRecipeName = (dtJobOrderInfo.Rows[0]["scr_one_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[0]["scr_one_recipe_name"].ToString();
|
|
recipeWork.scrTwoRecipeName = (dtJobOrderInfo.Rows[0]["scr_two_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[0]["scr_two_recipe_name"].ToString();
|
|
recipeWork.scrTreRecipeName = (dtJobOrderInfo.Rows[0]["scr_tre_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[0]["scr_tre_recipe_name"].ToString();
|
|
recipeWork.scrFouRecipeName = (dtJobOrderInfo.Rows[0]["scr_fou_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[0]["scr_fou_recipe_name"].ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return recipeWork;
|
|
}
|
|
/// <summary>
|
|
/// 根据机台配方名称 查询该配方中的所有详细步骤
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public RecipeInDetail[] GetScrmachineRecipeInfo(string recipeName)
|
|
{
|
|
RecipeInDetail[] recipeInDetails = null;
|
|
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
|
|
selectString.AppendLine("SELECT step, use_tim, spindle_speed, acceleration, scrubing_arm, flushing_arm, high_pressure_water," + " ");
|
|
selectString.AppendLine("wafer_flushing, back_qi, blow_qi, capture_cup, pre_pressing_position, wipe_torque_limit, wipe_spindle_speed" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("where scr_recipe_name = '" + recipeName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
recipeInDetails = new RecipeInDetail[dtJobOrderInfo.Rows.Count];
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
recipeInDetails[i] = new RecipeInDetail();
|
|
}
|
|
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
recipeInDetails[i].step = (dtJobOrderInfo.Rows[i]["step"] == null) ? 1 : Convert.ToInt32(dtJobOrderInfo.Rows[i]["step"]);
|
|
recipeInDetails[i].useTim = (dtJobOrderInfo.Rows[i]["use_tim"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["use_tim"]);
|
|
recipeInDetails[i].spindleSpeed = (dtJobOrderInfo.Rows[i]["spindle_speed"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["spindle_speed"]);
|
|
recipeInDetails[i].acceleration = (dtJobOrderInfo.Rows[i]["acceleration"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["acceleration"]);
|
|
recipeInDetails[i].scrubingArm = (dtJobOrderInfo.Rows[i]["scrubing_arm"] == null) ? "" : dtJobOrderInfo.Rows[i]["scrubing_arm"].ToString();
|
|
recipeInDetails[i].flushingArm = (dtJobOrderInfo.Rows[i]["flushing_arm"] == null) ? "" : dtJobOrderInfo.Rows[i]["flushing_arm"].ToString();
|
|
recipeInDetails[i].highPressureWater = (dtJobOrderInfo.Rows[i]["high_pressure_water"] == null) ? "" : dtJobOrderInfo.Rows[i]["high_pressure_water"].ToString();
|
|
recipeInDetails[i].waferFlushing = (dtJobOrderInfo.Rows[i]["wafer_flushing"] == null) ? "" : dtJobOrderInfo.Rows[i]["wafer_flushing"].ToString();
|
|
recipeInDetails[i].backQi = (dtJobOrderInfo.Rows[i]["back_qi"] == null) ? "" : dtJobOrderInfo.Rows[i]["back_qi"].ToString();
|
|
recipeInDetails[i].blowQi = (dtJobOrderInfo.Rows[i]["blow_qi"] == null) ? "" : dtJobOrderInfo.Rows[i]["blow_qi"].ToString();
|
|
recipeInDetails[i].captureCup = (dtJobOrderInfo.Rows[i]["capture_cup"] == null) ? "" : dtJobOrderInfo.Rows[i]["capture_cup"].ToString();
|
|
|
|
}
|
|
recipeInDetails[0].prePressingPosition = (dtJobOrderInfo.Rows[0]["pre_pressing_position"] == null) ? 0.00f : Convert.ToSingle(dtJobOrderInfo.Rows[0]["pre_pressing_position"]);
|
|
recipeInDetails[0].wipeSpindleSpeed = (dtJobOrderInfo.Rows[0]["wipe_spindle_speed"] == null) ? 0.00f : Convert.ToSingle(dtJobOrderInfo.Rows[0]["wipe_spindle_speed"]);
|
|
recipeInDetails[0].wipeTorqueLimit = (dtJobOrderInfo.Rows[0]["wipe_torque_limit"] == null) ? 100 : Convert.ToUInt32(dtJobOrderInfo.Rows[0]["wipe_torque_limit"]);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return recipeInDetails;
|
|
}
|
|
|
|
|
|
public RecipeInDetail[] GetScrmachineRecipeAllInfo(string recipeName)
|
|
{
|
|
RecipeInDetail[] recipeInDetails = null;
|
|
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
|
|
selectString.AppendLine("SELECT * FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("where scr_recipe_name = '" + recipeName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
recipeInDetails = new RecipeInDetail[dtJobOrderInfo.Rows.Count];
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
recipeInDetails[i] = new RecipeInDetail();
|
|
}
|
|
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
recipeInDetails[i].step = (dtJobOrderInfo.Rows[i]["step"] == null) ? 1 : Convert.ToInt32(dtJobOrderInfo.Rows[i]["step"]);
|
|
recipeInDetails[i].useTim = (dtJobOrderInfo.Rows[i]["use_tim"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["use_tim"]);
|
|
recipeInDetails[i].spindleSpeed = (dtJobOrderInfo.Rows[i]["spindle_speed"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["spindle_speed"]);
|
|
recipeInDetails[i].acceleration = (dtJobOrderInfo.Rows[i]["acceleration"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["acceleration"]);
|
|
recipeInDetails[i].scrubingArm = (dtJobOrderInfo.Rows[i]["scrubing_arm"] == null) ? "" : dtJobOrderInfo.Rows[i]["scrubing_arm"].ToString();
|
|
recipeInDetails[i].flushingArm = (dtJobOrderInfo.Rows[i]["flushing_arm"] == null) ? "" : dtJobOrderInfo.Rows[i]["flushing_arm"].ToString();
|
|
recipeInDetails[i].highPressureWater = (dtJobOrderInfo.Rows[i]["high_pressure_water"] == null) ? "" : dtJobOrderInfo.Rows[i]["high_pressure_water"].ToString();
|
|
recipeInDetails[i].waferFlushing = (dtJobOrderInfo.Rows[i]["wafer_flushing"] == null) ? "" : dtJobOrderInfo.Rows[i]["wafer_flushing"].ToString();
|
|
recipeInDetails[i].backQi = (dtJobOrderInfo.Rows[i]["back_qi"] == null) ? "" : dtJobOrderInfo.Rows[i]["back_qi"].ToString();
|
|
recipeInDetails[i].blowQi = (dtJobOrderInfo.Rows[i]["blow_qi"] == null) ? "" : dtJobOrderInfo.Rows[i]["blow_qi"].ToString();
|
|
recipeInDetails[i].captureCup = (dtJobOrderInfo.Rows[i]["capture_cup"] == null) ? "" : dtJobOrderInfo.Rows[i]["capture_cup"].ToString();
|
|
|
|
recipeInDetails[i].scrRecipeName = (dtJobOrderInfo.Rows[i]["scr_recipe_name"] == null) ? "" : dtJobOrderInfo.Rows[i]["scr_recipe_name"].ToString();
|
|
recipeInDetails[i].founder = (dtJobOrderInfo.Rows[i]["founder"] == null) ? "" : dtJobOrderInfo.Rows[i]["founder"].ToString();
|
|
recipeInDetails[i].foundTime = (dtJobOrderInfo.Rows[i]["found_time"] == null) ? "" : dtJobOrderInfo.Rows[i]["found_time"].ToString();
|
|
recipeInDetails[i].prePressingPosition = (dtJobOrderInfo.Rows[i]["pre_pressing_position"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["pre_pressing_position"]);
|
|
recipeInDetails[i].wipeSpindleSpeed = (dtJobOrderInfo.Rows[i]["wipe_spindle_speed"] == null) ? 0.0f : Convert.ToSingle(dtJobOrderInfo.Rows[i]["wipe_spindle_speed"]);
|
|
recipeInDetails[i].wipeTorqueLimit = (dtJobOrderInfo.Rows[i]["wipe_torque_limit"] == null) ? 100 : Convert.ToUInt32(dtJobOrderInfo.Rows[i]["wipe_torque_limit"]);
|
|
recipeInDetails[i].scr_machine = (dtJobOrderInfo.Rows[i]["scr_machine"] == null) ? "" : dtJobOrderInfo.Rows[i]["scr_machine"].ToString();
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return recipeInDetails;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 保存作业配方
|
|
/// </summary>
|
|
/// <param name="recipeWork"></param>
|
|
/// <returns></returns>
|
|
public bool SavePecipeWork(RecipeWork recipeWork)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_work_recipe" + " ");
|
|
selectString.AppendLine("(work_recipe_name,scr_one_recipe_name,scr_two_recipe_name,scr_tre_recipe_name,scr_fou_recipe_name,work_createtor,work_time)" + " ");
|
|
selectString.AppendLine("VALUES(" + " ");
|
|
selectString.AppendLine(" '" + recipeWork.workRecipeName + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.scrOneRecipeName + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.scrTwoRecipeName + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.scrTreRecipeName + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.scrFouRecipeName + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.workCreator + "', ");
|
|
selectString.AppendLine(" '" + recipeWork.workTime + "'");
|
|
selectString.AppendLine(" " + ")");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询名称为SCR的名称下的配方步骤信息
|
|
/// </summary>
|
|
/// <param name="scrName"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetRecipeScr(string scrName, string scr_machine)
|
|
{
|
|
DataTable dtResult = null;
|
|
try
|
|
{
|
|
DataTable dtTempJobInfo = null;
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT step,use_tim, spindle_speed, acceleration, scrubing_arm, flushing_arm, high_pressure_water, wafer_flushing, back_qi, blow_qi, capture_cup" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("where scr_recipe_name = '" + scrName + "'" + " ");
|
|
selectString.AppendLine("and scr_machine = '" + scr_machine + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
dtTempJobInfo.Merge(dtJobOrderInfo);
|
|
}
|
|
else
|
|
{
|
|
dtTempJobInfo = new DataTable();
|
|
dtTempJobInfo = dtJobOrderInfo.Copy();
|
|
}
|
|
}
|
|
}
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
DataView dv = dtTempJobInfo.DefaultView;
|
|
dtResult = dv.ToTable();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存-配方下-详细的步骤
|
|
/// </summary>
|
|
/// <param name="recipeInDetail"></param>
|
|
/// <returns></returns>
|
|
public bool SaveRecipeScr(RecipeInDetail[] recipeInDetail, string scr)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_scr_recipe" + " ");
|
|
selectString.AppendLine("(step,use_tim,spindle_speed,acceleration,scrubing_arm,flushing_arm," + " ");
|
|
selectString.AppendLine("high_pressure_water,wafer_flushing,back_qi,blow_qi,capture_cup,scr_recipe_name," + " ");
|
|
selectString.AppendLine("founder,found_time,pre_pressing_position,wipe_spindle_speed,wipe_torque_limit,scr_machine)" + " ");
|
|
selectString.AppendLine("VALUES" + " ");
|
|
for (int i = 0; i < recipeInDetail.Length; i++)
|
|
{
|
|
if (i == (recipeInDetail.Length - 1))
|
|
{
|
|
recipeInDetail[i].scr_machine = scr;
|
|
selectString.AppendLine("( '" + recipeInDetail[i].step + "', " + " '" + recipeInDetail[i].useTim + "', " + " '" + recipeInDetail[i].spindleSpeed + "', " + " '" + recipeInDetail[i].acceleration + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].scrubingArm + "', " + " '" + recipeInDetail[i].flushingArm + "', " + " '" + recipeInDetail[i].highPressureWater + "', " + " '" + recipeInDetail[i].waferFlushing + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].backQi + "', " + " '" + recipeInDetail[i].blowQi + "', " + " '" + recipeInDetail[i].captureCup + "', " + " '" + recipeInDetail[i].scrRecipeName + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].founder + "', " + " '" + recipeInDetail[i].foundTime + "', " + " '" + recipeInDetail[i].prePressingPosition + "', " + " '" + recipeInDetail[i].wipeSpindleSpeed + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].wipeTorqueLimit + "', " + " '" + recipeInDetail[i].scr_machine + "'" + " " + ");");
|
|
}
|
|
else
|
|
{
|
|
recipeInDetail[i].scr_machine = scr;
|
|
selectString.AppendLine("( '" + recipeInDetail[i].step + "', " + " '" + recipeInDetail[i].useTim + "', " + " '" + recipeInDetail[i].spindleSpeed + "', " + " '" + recipeInDetail[i].acceleration + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].scrubingArm + "', " + " '" + recipeInDetail[i].flushingArm + "', " + " '" + recipeInDetail[i].highPressureWater + "', " + " '" + recipeInDetail[i].waferFlushing + "'" + " " + ",");
|
|
selectString.AppendLine("'" + recipeInDetail[i].backQi + "', " + " '" + recipeInDetail[i].blowQi + "', " + " '" + recipeInDetail[i].captureCup + "', " + " '" + recipeInDetail[i].scrRecipeName + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].founder + "', " + " '" + recipeInDetail[i].foundTime + "', " + " '" + recipeInDetail[i].prePressingPosition + "', " + " '" + recipeInDetail[i].wipeSpindleSpeed + "'" + " " + ",");
|
|
selectString.AppendLine(" '" + recipeInDetail[i].wipeTorqueLimit + "', " + " '" + recipeInDetail[i].scr_machine + "'" + " " + "),");
|
|
}
|
|
}
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 更新-配方下-详细的步骤
|
|
/// </summary>
|
|
/// <param name="recipeInDetail"></param>
|
|
/// <returns></returns>
|
|
public bool UpdateRecipeScr(RecipeInDetail[] recipeInDetail, string scr_machine)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("delete FROM tb_scr_recipe" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name='" + scr_machine + "'" + " ");
|
|
selectString.AppendLine("and scr_machine='" + recipeInDetail[0].scr_machine + "'" + " ");
|
|
sHelper.ExecuteNonQuerySQL(selectString.ToString());
|
|
|
|
}
|
|
|
|
if (recipeInDetail != null && recipeInDetail.Count() > 0)
|
|
{
|
|
for (int i = 0; i < recipeInDetail.Count(); i++)
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_scr_recipe" + " ");
|
|
selectString.AppendLine("(step,use_tim,spindle_speed,acceleration,scrubing_arm,flushing_arm," + " ");
|
|
selectString.AppendLine("high_pressure_water,wafer_flushing,back_qi,blow_qi,capture_cup,scr_recipe_name," + " ");
|
|
selectString.AppendLine("founder,found_time,pre_pressing_position,wipe_spindle_speed,wipe_torque_limit,scr_machine" + " ");
|
|
selectString.AppendLine(")VALUES(" + " ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].step + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].useTim + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].spindleSpeed + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].acceleration + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].scrubingArm + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].flushingArm + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].highPressureWater + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].waferFlushing + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].backQi + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].blowQi + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].captureCup + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].scrRecipeName + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].founder + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].foundTime + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].prePressingPosition + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].wipeSpindleSpeed + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].wipeTorqueLimit + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].scr_machine + "') ");
|
|
dtResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 新增配方模板
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool AddRecipeModel()
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
//StringBuilder 可变字符串
|
|
StringBuilder selectString = new StringBuilder();
|
|
|
|
selectString.AppendLine("INSERT INTO tb_scr_recipe" + " ");
|
|
selectString.AppendLine("(step, use_tim, spindle_speed, acceleration, scrubing_arm, flushing_arm," + " ");
|
|
selectString.AppendLine("high_pressure_water, wafer_flushing, back_qi, blow_qi, capture_cup, scr_recipe_name," + " ");
|
|
selectString.AppendLine("founder, found_time, pre_pressing_position, wipe_spindle_speed, wipe_torque_limit,scr_machine)VALUES" + " ");
|
|
selectString.AppendLine("('1', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR')," + " ");
|
|
selectString.AppendLine("('2', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR')," + " ");
|
|
selectString.AppendLine("('3', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR')," + " ");
|
|
selectString.AppendLine("('4', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR')," + " ");
|
|
selectString.AppendLine("('5', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR')," + " ");
|
|
selectString.AppendLine("('6', '0', '0.0', '0.0', '-', '-', 'OFF', 'OFF', 'OFF', 'OFF', 'DOWN', 'Demo', '默认', '2024-01-01 00:00:00', '0.0', '0.0', '100','SCR');" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据配方名 查询改配方相同的数据信息
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public List<string> GetRecipeSame(string recipeName)
|
|
{
|
|
List<string> list = new List<string>();
|
|
RecipeInDetail recipeInDetail = new RecipeInDetail();
|
|
try
|
|
{
|
|
#region 查询字符串
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scr_recipe_name, founder, found_time, pre_pressing_position, wipe_spindle_speed, wipe_torque_limit" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name = '" + recipeName + "'" + " ");
|
|
DataTable dtResult = new DataTable();
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.QuerySql(selectString.ToString());
|
|
if (dtResult != null)
|
|
{
|
|
if (dtResult.Rows.Count > 0)
|
|
{
|
|
recipeInDetail.scrRecipeName = (dtResult.Rows[0]["scr_recipe_name"] == null) ? "" : dtResult.Rows[0]["scr_recipe_name"].ToString();
|
|
recipeInDetail.founder = (dtResult.Rows[0]["founder"] == null) ? "" : dtResult.Rows[0]["founder"].ToString();
|
|
recipeInDetail.foundTime = (dtResult.Rows[0]["found_time"] == null) ? "" : dtResult.Rows[0]["found_time"].ToString();
|
|
float vs_pre_pressing_position = Convert.ToSingle(dtResult.Rows[0]["pre_pressing_position"].ToString());
|
|
recipeInDetail.prePressingPosition = (dtResult.Rows[0]["pre_pressing_position"] == null) ? 0.0f : (float)Math.Round((vs_pre_pressing_position), 1);
|
|
float vs_wipe_spindle_speed = Convert.ToSingle(dtResult.Rows[0]["wipe_spindle_speed"].ToString());
|
|
recipeInDetail.wipeSpindleSpeed = (dtResult.Rows[0]["wipe_spindle_speed"] == null) ? 0.00f : (float)Math.Round((vs_wipe_spindle_speed), 2);
|
|
recipeInDetail.wipeTorqueLimit = (dtResult.Rows[0]["wipe_torque_limit"] == null) ? 100 : Convert.ToUInt32(dtResult.Rows[0]["wipe_torque_limit"].ToString());
|
|
}
|
|
}
|
|
#endregion 查询字符串
|
|
|
|
list.Add(recipeInDetail.scrRecipeName);
|
|
list.Add(recipeInDetail.founder);
|
|
list.Add(recipeInDetail.foundTime);
|
|
list.Add(recipeInDetail.prePressingPosition.ToString());
|
|
//可用
|
|
list.Add(recipeInDetail.wipeSpindleSpeed.ToString());
|
|
list.Add(recipeInDetail.wipeTorqueLimit.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return list;
|
|
}
|
|
/// <summary>
|
|
/// 根据配方名 查询改配方相同的数据信息
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public List<string> GetRecipeSameAdd(string recipeName)
|
|
{
|
|
List<string> list = new List<string>();
|
|
RecipeInDetail recipeInDetail = new RecipeInDetail();
|
|
try
|
|
{
|
|
#region 查询字符串
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scr_recipe_name, founder, found_time, pre_pressing_position, wipe_spindle_speed, wipe_torque_limit" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name = '" + recipeName + "'" + " ");
|
|
DataTable dtResult = new DataTable();
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.QuerySql(selectString.ToString());
|
|
if (dtResult != null)
|
|
{
|
|
if (dtResult.Rows.Count > 0)
|
|
{
|
|
recipeInDetail.scrRecipeName = null;//(dtResult.Rows[0]["scr_recipe_name"] == null) ? "" : dtResult.Rows[0]["scr_recipe_name"].ToString();
|
|
recipeInDetail.founder = (dtResult.Rows[0]["founder"] == null) ? "" : dtResult.Rows[0]["founder"].ToString();
|
|
recipeInDetail.foundTime = (dtResult.Rows[0]["found_time"] == null) ? "" : dtResult.Rows[0]["found_time"].ToString();
|
|
float vs_pre_pressing_position = Convert.ToSingle(dtResult.Rows[0]["pre_pressing_position"].ToString());
|
|
recipeInDetail.prePressingPosition = (dtResult.Rows[0]["pre_pressing_position"] == null) ? 0.0f : (float)Math.Round((vs_pre_pressing_position), 1);
|
|
float vs_wipe_spindle_speed = Convert.ToSingle(dtResult.Rows[0]["wipe_spindle_speed"].ToString());
|
|
recipeInDetail.wipeSpindleSpeed = (dtResult.Rows[0]["wipe_spindle_speed"] == null) ? 0.0f : (float)Math.Round((vs_wipe_spindle_speed), 2);
|
|
recipeInDetail.wipeTorqueLimit = (dtResult.Rows[0]["wipe_torque_limit"] == null) ? 100 : Convert.ToUInt32(dtResult.Rows[0]["wipe_torque_limit"].ToString());
|
|
}
|
|
}
|
|
#endregion 查询字符串
|
|
|
|
list.Add(recipeInDetail.scrRecipeName);
|
|
list.Add(recipeInDetail.founder);
|
|
list.Add(recipeInDetail.foundTime);
|
|
list.Add(recipeInDetail.prePressingPosition.ToString());
|
|
list.Add(recipeInDetail.wipeSpindleSpeed.ToString());
|
|
list.Add(recipeInDetail.wipeTorqueLimit.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return list;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除机台上的配方名
|
|
/// </summary>
|
|
/// <param name="alarmName"></param>
|
|
/// <returns></returns>
|
|
public bool DelMachineRecipe(string alarmName, string nowMachineName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe = '" + alarmName + "' ");
|
|
selectString.AppendLine("AND scr_machine = '" + nowMachineName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 根据作业配方名称查询 作业配方是否存在
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public bool IsExistWorkRecipeInfo(string recipeName)
|
|
{
|
|
bool isExist = false;
|
|
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT work_recipe_name,scr_one_recipe_name,scr_two_recipe_name ,scr_tre_recipe_name,scr_fou_recipe_name " + " ");
|
|
selectString.AppendLine("FROM `tb_work_recipe`" + " ");
|
|
selectString.AppendLine("where work_recipe_name='" + recipeName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
isExist = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return isExist;
|
|
}
|
|
|
|
|
|
public bool DelWorkRecipe(string alarmName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM `tb_work_recipe`" + " ");
|
|
selectString.AppendLine("WHERE work_recipe_name = '" + alarmName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 更新作业配方
|
|
/// </summary>
|
|
/// <param name="work_recipe_name"></param>
|
|
/// <returns></returns>
|
|
public bool UpdateWorkRecipe(RecipeWork recipeWork, string work_recipe_name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("UPDATE tb_work_recipe set" + " ");
|
|
selectString.AppendLine("work_recipe_name='" + recipeWork.workRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_one_recipe_name='" + recipeWork.scrOneRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_two_recipe_name='" + recipeWork.scrTwoRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_tre_recipe_name='" + recipeWork.scrTreRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_fou_recipe_name='" + recipeWork.scrFouRecipeName + "'," + " ");
|
|
selectString.AppendLine("work_createtor='" + recipeWork.workCreator + "'," + " ");
|
|
selectString.AppendLine("work_time='" + recipeWork.workTime + "'" + " ");
|
|
selectString.AppendLine("WHERE work_recipe_name='" + work_recipe_name + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 查询机台上的配方名
|
|
/// </summary>
|
|
/// <param name="userName"></param>
|
|
/// <returns></returns>
|
|
public bool SelRecipeName(string userName, string scrMachine)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe= '" + userName + "'" + " ");
|
|
selectString.AppendLine("and scr_machine= '" + scrMachine + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
dtResult = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 在配方表中查询 配方名
|
|
/// </summary>
|
|
/// <param name="userName"></param>
|
|
/// <returns></returns>
|
|
public bool SelRecipeNameInRecipe(string userName, string machineRecipe)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name= '" + userName + "'" + " ");
|
|
selectString.AppendLine("and scr_machine= '" + machineRecipe + "'" + " ");
|
|
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
dtResult = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
public bool SelRecipeNameInRecipe(string userName)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name= '" + userName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
dtResult = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 删除配方详细信息
|
|
/// </summary>
|
|
/// <param name="alarmName"></param>
|
|
/// <returns></returns>
|
|
public bool DelRecipeScrInfo(string alarmName, string scr_machine)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name = '" + alarmName + "' ");
|
|
selectString.AppendLine("AND scr_machine = '" + scr_machine + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据机台名——查询该机台下的所有配方
|
|
/// </summary>
|
|
/// <param name="machineName"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetMachineRecipeScr(string machineName)
|
|
{
|
|
DataTable dtResult = null;
|
|
try
|
|
{
|
|
DataTable dtTempJobInfo = null;
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scr_recipe" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("where scr_machine = '" + machineName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
dtTempJobInfo.Merge(dtJobOrderInfo);
|
|
}
|
|
else
|
|
{
|
|
dtTempJobInfo = new DataTable();
|
|
dtTempJobInfo = dtJobOrderInfo.Copy();
|
|
}
|
|
}
|
|
}
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
DataView dv = dtTempJobInfo.DefaultView;
|
|
dtResult = dv.ToTable();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
/// <summary>
|
|
/// 查询机台下的一个配方用于显示
|
|
/// </summary>
|
|
/// <param name="machineName"></param>
|
|
/// <returns></returns>
|
|
public string GetMachineOneRecipeScr(string machineName)
|
|
{
|
|
string scrRecipe = "";
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scr_recipe" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("where scr_machine = '" + machineName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
scrRecipe = (dtJobOrderInfo.Rows[0]["scr_recipe"] == null) ? "" : dtJobOrderInfo.Rows[0]["scr_recipe"].ToString();
|
|
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return scrRecipe;
|
|
}
|
|
/// <summary>
|
|
/// 保存配方绑定关系
|
|
/// </summary>
|
|
/// <param name="recipeMachine"></param>
|
|
/// <returns></returns>
|
|
public bool SaveRecipeMachineInfo(RecipeMachine recipeMachine)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_scr_recipe_machine" + " ");
|
|
selectString.AppendLine("(scr_recipe,scr_machine,founder_id,found_time)" + " ");
|
|
selectString.AppendLine("VALUES(" + " ");
|
|
selectString.AppendLine(" '" + recipeMachine.scrRecipeName + "',");
|
|
selectString.AppendLine(" '" + recipeMachine.scrMachineName + "',");
|
|
selectString.AppendLine(" '" + recipeMachine.founderId + "',");
|
|
selectString.AppendLine(" '" + recipeMachine.foundTime + "'");
|
|
selectString.AppendLine(" " + ")");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新-机台配方绑定关系
|
|
/// </summary>
|
|
/// <param name="recipeMachine"></param>
|
|
/// <returns></returns>
|
|
public bool UpdateRecipeMachineInfo(RecipeMachine recipeMachine, string scrRecipeName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("UPDATE tb_scr_recipe_machine set" + " ");
|
|
selectString.AppendLine("scr_recipe='" + recipeMachine.scrRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_machine='" + recipeMachine.scrMachineName + "'," + " ");
|
|
selectString.AppendLine("founder_id='" + recipeMachine.founderId + "'," + " ");
|
|
selectString.AppendLine("found_time='" + recipeMachine.foundTime + "'" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe='" + scrRecipeName + "'" + " ");
|
|
selectString.AppendLine("AND scr_machine='" + recipeMachine.scrMachineName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 传入 配方名 查看机台上有没有这个配方
|
|
/// </summary>
|
|
/// <param name="recipeName"></param>
|
|
/// <returns></returns>
|
|
public bool FindMachineRecipeScr(string recipeName, string machine)
|
|
{
|
|
bool dtResult = false;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT *" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("where scr_recipe = '" + recipeName + "'" + " ");
|
|
selectString.AppendLine("and scr_machine = '" + machine + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
dtResult = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
|
|
public bool SaveScrubbingRecipeArm(ScrubbingRecipeArm scrubbingRecipeArm)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_scrubbing_recipe_arm" + " ");
|
|
selectString.AppendLine("(scrub_position_one,scrub_position_two,scrub_speed,move_method,scrub_recipe_name,scrub_type)" + " ");
|
|
selectString.AppendLine("VALUES(" + " ");
|
|
selectString.AppendLine(" " + scrubbingRecipeArm.scrub_position_one + ", ");
|
|
selectString.AppendLine(" " + scrubbingRecipeArm.scrub_position_two + ",");
|
|
selectString.AppendLine(" " + scrubbingRecipeArm.scrub_speed + ",");
|
|
selectString.AppendLine(" '" + scrubbingRecipeArm.move_method + "',");
|
|
selectString.AppendLine(" '" + scrubbingRecipeArm.scrub_recipe_name + "',");
|
|
selectString.AppendLine(" '" + scrubbingRecipeArm.scrub_type + "'");
|
|
selectString.AppendLine(" " + ")");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool whetherScrubbing(string flush_recipe_name, string flush_type)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM tb_scrubbing_recipe_arm" + " ");
|
|
selectString.AppendLine("WHERE scrub_recipe_name='" + flush_recipe_name + "'" + " ");
|
|
selectString.AppendLine("AND scrub_type='" + flush_type + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
bResult = true;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
public bool UpdateWorkLog(string numLog, string EndTime, string finishState,int pieces)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
string strSql = "";
|
|
strSql += "UPDATE tb_operate_job_log " + " ";
|
|
strSql += "SET end_time='" + EndTime + "'," + " ";
|
|
strSql += "finish_state='" + finishState + "'," + " ";
|
|
strSql += "pieces='" + pieces + "'" + " ";
|
|
strSql += "WHERE job_log_num ='" + numLog + "'" + " ";
|
|
strSql += "and pieces=26" + " ";
|
|
//strSql += "and job_log_num ='" + numLog + "'" + " ";
|
|
bResult = sHelper.ExecuteBNonQuerySQL(strSql);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存作业日志
|
|
/// </summary>
|
|
/// <param name="operateJobLog"></param>
|
|
/// <returns></returns>
|
|
public bool SaveWorkLog(OperateJobLog operateJobLog)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_operate_job_log" + " ");
|
|
selectString.AppendLine("(job_log_num, recipe, batch, production_id, operator_num, pieces," + " ");
|
|
selectString.AppendLine("finish_state, start_time, end_time, size_select, single_double_sides)" + " ");
|
|
selectString.AppendLine("VALUES(" + " ");
|
|
selectString.AppendLine(" '" + operateJobLog.jobLogNum + "', ");
|
|
selectString.AppendLine(" '" + operateJobLog.recipe + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.batch + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.productionId + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.operatorNum + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.pieces + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.finishState + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.startTime + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.endTime + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.sizeSelect + "',");
|
|
selectString.AppendLine(" '" + operateJobLog.singleDoubleSides + "'");
|
|
selectString.AppendLine(" " + ")");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool SaveFlushRecipeArm(FlushRecipeArm flushRecipeArm)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_flush_recipe_arm" + " ");
|
|
selectString.AppendLine("(flush_location_one,flush_location_two,flush_speed,flush_recipe_name,flush_type)" + " ");
|
|
selectString.AppendLine("VALUES(" + " ");
|
|
selectString.AppendLine(" " + flushRecipeArm.flush_location_one + ", ");
|
|
selectString.AppendLine(" " + flushRecipeArm.flush_location_two + ",");
|
|
selectString.AppendLine(" " + flushRecipeArm.flush_speed + ",");
|
|
selectString.AppendLine(" '" + flushRecipeArm.flush_recipe_name + "',");
|
|
selectString.AppendLine(" '" + flushRecipeArm.flush_type + "'");
|
|
selectString.AppendLine(" " + ")");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
public bool whetherRepeat(string scrub_recipe_name, string scrub_type)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_flush_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE flush_recipe_name='" + scrub_recipe_name + "'" + " ");
|
|
selectString.AppendLine("AND flush_type='" + scrub_type + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
bResult = true;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool DeleteFlushRecipeArm(string name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM tb_flush_recipe_arm " + " ");
|
|
selectString.AppendLine("WHERE flush_recipe_name ='" + name + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool UpdateFlushRecipeArm(FlushRecipeArm flushRecipeArm)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
string strSql = "";
|
|
strSql += "UPDATE tb_flush_recipe_arm " + " ";
|
|
strSql += "SET flush_location_one='" + flushRecipeArm.flush_location_one + "'," + " ";
|
|
strSql += "flush_location_two='" + flushRecipeArm.flush_location_two + "'," + " ";
|
|
strSql += "flush_speed='" + flushRecipeArm.flush_speed + "'" + " ";
|
|
strSql += "WHERE flush_recipe_name ='" + flushRecipeArm.flush_recipe_name + "'" + " ";
|
|
bResult = sHelper.ExecuteBNonQuerySQL(strSql);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool UpdateFlushRecipeArm(FlushRecipeArm flushRecipeArm, string oldName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
string strSql = "";
|
|
strSql += "UPDATE tb_flush_recipe_arm " + " ";
|
|
strSql += "SET flush_location_one='" + flushRecipeArm.flush_location_one + "'," + " ";
|
|
strSql += "flush_location_two='" + flushRecipeArm.flush_location_two + "'," + " ";
|
|
strSql += "flush_speed='" + flushRecipeArm.flush_speed + "'," + " ";
|
|
strSql += "flush_recipe_name='" + flushRecipeArm.flush_recipe_name + "'" + " ";
|
|
strSql += "WHERE flush_recipe_name ='" + oldName + "'" + " ";
|
|
bResult = sHelper.ExecuteBNonQuerySQL(strSql);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
//
|
|
public bool UpdatWorkRecipe(RecipeWork recipeWork)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("UPDATE tb_work_recipe " + " ");
|
|
selectString.AppendLine("SET work_recipe_name='" + recipeWork.workRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_one_recipe_name='" + recipeWork.scrOneRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_two_recipe_name='" + recipeWork.scrTwoRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_tre_recipe_name='" + recipeWork.scrTreRecipeName + "'," + " ");
|
|
selectString.AppendLine("scr_fou_recipe_name='" + recipeWork.scrFouRecipeName + "'" + " ");
|
|
selectString.AppendLine("WHERE work_recipe_name ='" + recipeWork.workRecipeName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
public bool UpdateScrubRecipeArm(ScrubbingRecipeArm scrubbingRecipeArm, string oldName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("UPDATE tb_scrubbing_recipe_arm " + " ");
|
|
selectString.AppendLine("SET scrub_position_one='" + scrubbingRecipeArm.scrub_position_one + "'," + " ");
|
|
selectString.AppendLine("scrub_position_two='" + scrubbingRecipeArm.scrub_position_two + "'," + " ");
|
|
selectString.AppendLine("scrub_speed='" + scrubbingRecipeArm.scrub_speed + "'" + ", ");
|
|
selectString.AppendLine("move_method='" + scrubbingRecipeArm.move_method + "'," + " ");
|
|
selectString.AppendLine("scrub_recipe_name='" + scrubbingRecipeArm.scrub_recipe_name + "'" + " ");
|
|
selectString.AppendLine("WHERE scrub_recipe_name ='" + oldName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 查询茶洗臂
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetScruRecipeScr(int state)
|
|
{
|
|
DataTable dtResult = new DataTable();
|
|
try
|
|
{
|
|
DataTable dtTempJobInfo = null;
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scrub_recipe_name, scrub_position_one, scrub_position_two, scrub_speed, move_method" + " ");
|
|
selectString.AppendLine("FROM `tb_scrubbing_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE scrub_type='" + state + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
dtTempJobInfo.Merge(dtJobOrderInfo);
|
|
}
|
|
else
|
|
{
|
|
dtTempJobInfo = new DataTable();
|
|
dtTempJobInfo = dtJobOrderInfo.Copy();
|
|
}
|
|
}
|
|
}
|
|
if (dtTempJobInfo != null)
|
|
{
|
|
DataView dv = dtTempJobInfo.DefaultView;
|
|
dtResult = dv.ToTable();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
public DataTable GetFluRecipeScr(int state)
|
|
{
|
|
DataTable dtResult = null;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT flush_recipe_name, flush_location_one, flush_location_two, flush_speed" + " ");
|
|
selectString.AppendLine("FROM `tb_flush_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE flush_type='" + state + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo.Rows.Count > 0)
|
|
{
|
|
dtResult = dtJobOrderInfo;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return dtResult;
|
|
}
|
|
public bool DeletScrubRecipeArm(string name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM tb_scrubbing_recipe_arm " + " ");
|
|
selectString.AppendLine("WHERE scrub_recipe_name ='" + name + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
public FlushRecipeArm SelectFlushRecipeArm(string recipeName,string state)
|
|
{
|
|
FlushRecipeArm flushRecipeArm = new FlushRecipeArm();
|
|
try
|
|
{
|
|
#region 查询字符串
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT flush_location_one, flush_location_two, flush_speed" + " ");
|
|
selectString.AppendLine("FROM `tb_flush_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE flush_recipe_name = '" + recipeName + "'" + " ");
|
|
selectString.AppendLine("and flush_type = '" + state + "'" + " ");
|
|
DataTable dtResult = new DataTable();
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.QuerySql(selectString.ToString());
|
|
if (dtResult != null)
|
|
{
|
|
if (dtResult.Rows.Count > 0)
|
|
{
|
|
flushRecipeArm.flush_location_one = (dtResult.Rows[0]["flush_location_one"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["flush_location_one"]);
|
|
flushRecipeArm.flush_location_two = (dtResult.Rows[0]["flush_location_two"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["flush_location_two"]);
|
|
flushRecipeArm.flush_speed = (dtResult.Rows[0]["flush_speed"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["flush_speed"]);
|
|
}
|
|
}
|
|
#endregion 查询字符串
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return flushRecipeArm;
|
|
}
|
|
public ScrubbingRecipeArm SelectScrubbingRecipeArm(string recipeName,string state)
|
|
{
|
|
ScrubbingRecipeArm scrubbingRecipeArm = new ScrubbingRecipeArm();
|
|
try
|
|
{
|
|
#region 查询字符串
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scrub_position_one,scrub_position_two,scrub_speed,move_method" + " ");
|
|
selectString.AppendLine("FROM `tb_scrubbing_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE scrub_recipe_name = '" + recipeName + "'" + " ");
|
|
selectString.AppendLine("and scrub_type = '" + state + "'" + " ");
|
|
DataTable dtResult = new DataTable();
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtResult = sHelper.QuerySql(selectString.ToString());
|
|
if (dtResult != null)
|
|
{
|
|
if (dtResult.Rows.Count > 0)
|
|
{
|
|
scrubbingRecipeArm.scrub_position_one = (dtResult.Rows[0]["scrub_position_one"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["scrub_position_one"]);
|
|
scrubbingRecipeArm.scrub_position_two = (dtResult.Rows[0]["scrub_position_two"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["scrub_position_two"]);
|
|
scrubbingRecipeArm.scrub_speed = (dtResult.Rows[0]["scrub_speed"] == null) ? 0.00f : Convert.ToSingle(dtResult.Rows[0]["scrub_speed"].ToString());
|
|
scrubbingRecipeArm.move_method = (dtResult.Rows[0]["move_method"] == null) ? "" : dtResult.Rows[0]["move_method"].ToString();
|
|
}
|
|
}
|
|
#endregion 查询字符串
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return scrubbingRecipeArm;
|
|
}
|
|
|
|
public List<string> SelFlushRecipeArm(string type)
|
|
{
|
|
List<string> vs = new List<string>();
|
|
int recipeInDetails;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
|
|
selectString.AppendLine("SELECT flush_recipe_name" + " ");
|
|
selectString.AppendLine("FROM `tb_flush_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE flush_type = '" + type + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
recipeInDetails = dtJobOrderInfo.Rows.Count;
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
vs.Add((dtJobOrderInfo.Rows[i]["flush_recipe_name"].ToString() == null) ? "" : dtJobOrderInfo.Rows[i]["flush_recipe_name"].ToString());
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return vs;
|
|
}
|
|
/// <summary>
|
|
/// 查询擦洗臂配方名称
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<string> SelScrubbingRecipeArm(string type)
|
|
{
|
|
List<string> vs = new List<string>();
|
|
int recipeInDetails;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
|
|
selectString.AppendLine("SELECT scrub_recipe_name" + " ");
|
|
selectString.AppendLine("FROM `tb_scrubbing_recipe_arm`" + " ");
|
|
selectString.AppendLine("WHERE scrub_type = '" + type + "'" + " "); ;
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
recipeInDetails = dtJobOrderInfo.Rows.Count;
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
vs.Add((dtJobOrderInfo.Rows[i]["scrub_recipe_name"].ToString() == null) ? "" : dtJobOrderInfo.Rows[i]["scrub_recipe_name"].ToString());
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return vs;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 这个是数据改变后更新数据
|
|
/// </summary>
|
|
/// <param name="recipeInDetail">配方名称</param>
|
|
/// <returns></returns>
|
|
public bool infoChange(RecipeInDetail[] recipeInDetail, string scr_recipe_name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
{
|
|
//删除掉原来的
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM tb_scr_recipe" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name='" + scr_recipe_name + "'" + " ");
|
|
bool bUpdate = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
{
|
|
for (int i = 0; i < recipeInDetail.Count(); i++)
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("INSERT INTO tb_scr_recipe" + " ");
|
|
selectString.AppendLine("(step,use_tim,spindle_speed,acceleration,scrubing_arm,flushing_arm," + " ");
|
|
selectString.AppendLine("high_pressure_water,wafer_flushing,back_qi,blow_qi,capture_cup,scr_recipe_name," + " ");
|
|
selectString.AppendLine("founder,found_time,pre_pressing_position,wipe_spindle_speed,wipe_torque_limit" + " ");
|
|
selectString.AppendLine(")VALUES(" + " ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].step + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].useTim + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].spindleSpeed + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].acceleration + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].scrubingArm + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].flushingArm + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].highPressureWater + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].waferFlushing + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].backQi + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].blowQi + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].captureCup + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].scrRecipeName + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].founder + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].foundTime + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].prePressingPosition + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].wipeSpindleSpeed + "', ");
|
|
selectString.AppendLine("'" + recipeInDetail[i].wipeTorqueLimit + "') ");
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="scr_recipe_name"></param>
|
|
/// <returns></returns>
|
|
public bool infoChange(string scr_recipe)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
{
|
|
//删除掉原来的
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM tb_scr_recipe_machine" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe='" + scr_recipe + "'" + " ");
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex?.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
public List<string> GetWorkMachineRecipeScr(string machineName, out int len)
|
|
{
|
|
List<string> list = new List<string>();
|
|
int length = 0;
|
|
try
|
|
{
|
|
DataTable dtJobOrderInfo = new DataTable();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT scr_recipe" + " ");
|
|
selectString.AppendLine("FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("where scr_machine = '" + machineName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
dtJobOrderInfo = sHelper.QuerySql(selectString.ToString());
|
|
length = dtJobOrderInfo.Rows.Count;
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
if (dtJobOrderInfo != null)
|
|
{
|
|
|
|
for (int i = 0; i < dtJobOrderInfo.Rows.Count; i++)
|
|
{
|
|
list.Add((dtJobOrderInfo.Rows[i]["scr_recipe"] == null) ? "1" : dtJobOrderInfo.Rows[i]["scr_recipe"].ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
len = length;
|
|
return list;
|
|
}
|
|
/// <summary>
|
|
/// 查询是否存在了这个作业配方名
|
|
/// </summary>
|
|
/// <param name="work_recipe_name"></param>
|
|
/// <returns>false不存在true存在</returns>
|
|
public bool whetherExist(string work_recipe_name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM tb_work_recipe" + " ");
|
|
selectString.AppendLine("WHERE work_recipe_name='" + work_recipe_name + "'" + " ");
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null)
|
|
{
|
|
if (data.Rows.Count > 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex?.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 删除作业配方
|
|
/// </summary>
|
|
/// <param name="work_recipe_name">作业配方名称</param>
|
|
/// <returns></returns>
|
|
public bool deleteRecipe(string work_recipe_name)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("delete FROM `TB_WORK_RECIPE`" + " ");
|
|
selectString.AppendLine("WHERE work_recipe_name='" + work_recipe_name + "'" + " ");
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex?.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 删除机台上的配方名
|
|
/// </summary>
|
|
/// <param name="oldName">之前的配方名</param>
|
|
/// <param name="newName">新的配方名</param>
|
|
/// <param name="scr"></param>
|
|
///<param name="founder_id">创建人id</param>
|
|
/// <returns></returns>
|
|
public bool SaveDelMachineRecipe(string oldName, string scr)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("DELETE FROM `tb_scr_recipe_machine`" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe = '" + oldName + "' " + " ");
|
|
selectString.AppendLine("AND scr_machine = '" + scr + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 更新作业配方
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool Updatetb_work_recipe(string oldName, string newName, string scr)
|
|
{
|
|
switch (scr)
|
|
{
|
|
case "SCR1":
|
|
scr = "scr_one_recipe_name";
|
|
break;
|
|
case "SCR2":
|
|
scr = "scr_two_recipe_name";
|
|
break;
|
|
case "SCR3":
|
|
scr = "scr_tre_recipe_name";
|
|
break;
|
|
case "SCR4":
|
|
scr = "scr_fou_recipe_name";
|
|
break;
|
|
}
|
|
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("UPDATE `tb_work_recipe`" + " ");
|
|
selectString.AppendLine("SET " + scr + "='" + newName + "' ");
|
|
selectString.AppendLine("where " + scr + "='" + oldName + "' ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
bResult = sHelper.ExecuteBNonQuerySQL(selectString.ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 判断作业配方中 当前单元配方是否被选择
|
|
/// </summary>
|
|
/// <param name="oldName"></param>
|
|
/// <param name="newName"></param>
|
|
/// <param name="scr"></param>
|
|
/// <returns></returns>
|
|
public bool ExistChoosedUnitRecip(string scrNum, string newName)
|
|
{
|
|
switch (scrNum)
|
|
{
|
|
case "SCR1":
|
|
scrNum = "scr_one_recipe_name";
|
|
break;
|
|
case "SCR2":
|
|
scrNum = "scr_two_recipe_name";
|
|
break;
|
|
case "SCR3":
|
|
scrNum = "scr_tre_recipe_name";
|
|
break;
|
|
case "SCR4":
|
|
scrNum = "scr_fou_recipe_name";
|
|
break;
|
|
}
|
|
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM tb_work_recipe" + " ");
|
|
selectString.AppendLine("where " + scrNum + "='" + newName + "' ");
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null)
|
|
{
|
|
if (data.Rows.Count > 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex?.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询配方步骤
|
|
/// </summary>
|
|
/// <param name="scr"></param>
|
|
///<param name="founder_id">创建人id</param>
|
|
/// <returns></returns>
|
|
public int recipeAllStep(string scr_recipe_name, string scr_machine)
|
|
{
|
|
int iResult = 0;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM tb_scr_recipe" + " ");
|
|
selectString.AppendLine("WHERE scr_recipe_name='" + scr_recipe_name + "'" + " ");
|
|
selectString.AppendLine("AND scr_machine='" + scr_machine + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
iResult = data.Rows.Count;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return iResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询当前
|
|
/// </summary>
|
|
/// <param name="scr">配方SCR</param>
|
|
/// <param name="_arm">擦洗臂还是冲洗臂</param>
|
|
/// <param name="armName">选择的配方名</param>
|
|
/// <returns></returns>
|
|
public bool whetherDelete(string scr, string _arm, string armName)
|
|
{
|
|
bool bResult = false;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM tb_scr_recipe" + " ");
|
|
selectString.AppendLine("WHERE scr_machine='" + scr + "'" + " ");
|
|
selectString.AppendLine("AND " + _arm + "='" + armName + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
for (int i = 0; i < data.Rows.Count; i++)
|
|
{
|
|
string ARM = data.Rows[i][_arm].ToString();
|
|
if (ARM == armName)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return bResult;
|
|
}
|
|
/// <summary>
|
|
/// 查询配方时间
|
|
/// </summary>
|
|
/// <param name="scr_recipe_name"></param>
|
|
/// <param name="scr_machine"></param>
|
|
/// <returns></returns>
|
|
public int selAllTime(string scr_recipe_name, string scr_machine)
|
|
{
|
|
int iResult = 0;
|
|
try
|
|
{
|
|
StringBuilder selectString = new StringBuilder();
|
|
selectString.AppendLine("SELECT * FROM `tb_scr_recipe`" + " ");
|
|
selectString.AppendLine("WHERE scr_machine='" + scr_machine + "'" + " ");
|
|
selectString.AppendLine("AND scr_recipe_name='" + scr_recipe_name + "'" + " ");
|
|
MySqlHelper sHelper = new MySqlHelper();
|
|
DataTable data = sHelper.QuerySql(selectString.ToString());
|
|
if (data != null && data.Rows.Count > 0)
|
|
{
|
|
for (int i = 0; i < data.Rows.Count; i++)
|
|
{
|
|
String use_tim = data.Rows[i]["use_tim"].ToString();
|
|
int.TryParse(use_tim, out int ARM);
|
|
iResult += ARM;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return iResult;
|
|
}
|
|
}
|
|
}
|