|
@@ -25,7 +25,7 @@ namespace UMESDLLService
|
|
|
bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
|
|
|
bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[,] iTestDetail, out string oErrMessage);
|
|
|
bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oInfo, out string oErrMessage);
|
|
|
- bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNETCODE, string iID1, string iID2, string iID3, out string oErrMessage);
|
|
|
+ bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iPSN, string iNETCODE, string iID1, string iID2, string iID3, out string oErrMessage);
|
|
|
bool GetMobileAllInfo(string iSnCode, out string oInfo, out string oErrorMessage);
|
|
|
bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
|
|
|
bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
|
|
@@ -48,7 +48,7 @@ namespace UMESDLLService
|
|
|
|
|
|
string Master = "N_MES";
|
|
|
//系统默认的的连接字符串
|
|
|
- private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.23)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
|
|
|
+ private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.30.80.23)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
|
|
|
//用户选择的数据库的连接字符串
|
|
|
private OracleConnection connection;
|
|
|
//用户选择的数据库的连接字符串
|
|
@@ -124,9 +124,10 @@ namespace UMESDLLService
|
|
|
return false;
|
|
|
}
|
|
|
string SNcode = iSN;
|
|
|
- if (!GetInfoByMaterial(iSN, out iSN, out oErrMessage))
|
|
|
+ DataTable dt = (DataTable)ExecuteSql("select ms_sncode from makeserial where ms_sncode='" + iSN + "' or ms_imei1='" + iSN + "' or ms_imei2='" + iSN + "' order by ms_id desc", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- oErrMessage = "";
|
|
|
+ iSN = dt.Rows[0]["ms_sncode"].ToString();
|
|
|
}
|
|
|
if (iSN == "")
|
|
|
{
|
|
@@ -137,7 +138,7 @@ namespace UMESDLLService
|
|
|
string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
|
|
|
CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
|
|
|
oErrMessage = param[6];
|
|
|
- DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=( select max(ms_id) from makeserial where ms_sncode in ( select '" + iSN + "' from dual union select sn from makesnrelation where beforesn='" + iSN + "' and sn<>' ' union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' '))", "select");
|
|
|
+ dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=( select max(ms_id) from makeserial where ms_sncode in ( select '" + iSN + "' from dual union select sn from makesnrelation where beforesn='" + iSN + "' and sn<>' ' union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' '))", "select");
|
|
|
string ms_status = "";
|
|
|
string ms_stepcode = "";
|
|
|
string ms_nextstepcode = "";
|
|
@@ -210,7 +211,7 @@ namespace UMESDLLService
|
|
|
oErrMessage = "用户名,密码,岗位资源必须填写";
|
|
|
return false;
|
|
|
}
|
|
|
- if (CheckUserLogin(iUserCode, iPassWord, "N_MES", out oErrMessage))
|
|
|
+ if (CheckUserLogin(iUserCode, iPassWord, out oErrMessage))
|
|
|
{
|
|
|
string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
|
|
|
DataTable dt;
|
|
@@ -393,7 +394,7 @@ namespace UMESDLLService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
+ /// <summary>
|
|
|
/// 获取序列号的所有串号信息
|
|
|
/// </summary>
|
|
|
/// <param name="iSN"></param>
|
|
@@ -427,6 +428,11 @@ namespace UMESDLLService
|
|
|
oErrMessage = "SN不能为空";
|
|
|
return false;
|
|
|
}
|
|
|
+ DataTable dt = (DataTable)ExecuteSql("select ms_sncode from makeserial where ms_sncode='" + iSN + "' or ms_firstsn='" + iSN + "' or ms_imei1='" + iSN + "' or ms_imei2='" + iSN + "' order by ms_id desc", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ iSN = dt.Rows[0]["ms_sncode"].ToString();
|
|
|
+ }
|
|
|
string MacInfo;
|
|
|
//if (!GetAddressRangeByMO(iSN, out MacInfo, out oErrMessage))
|
|
|
//{
|
|
@@ -447,34 +453,34 @@ namespace UMESDLLService
|
|
|
// else
|
|
|
// return false;
|
|
|
//}
|
|
|
- //string ImeiInfo;
|
|
|
- //if (!GetMEIOrNetCodeRange(iSN, "", "", out ImeiInfo, out oErrMessage))
|
|
|
- //{
|
|
|
- // if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
- // return true;
|
|
|
- // else
|
|
|
- // return false;
|
|
|
- //}
|
|
|
- //string IMEI1 = ImeiInfo.Split('^')[0].Replace("IMEI1:", "");
|
|
|
- //string IMEI2 = ImeiInfo.Split('^')[1].Replace("IMEI2:", "");
|
|
|
- //string MEID = ImeiInfo.Split('^')[2].Replace("MEID:", "");
|
|
|
- //string NETCODE = ImeiInfo.Split('^')[3].Replace("NETCODE:", "");
|
|
|
- //string PSN = ImeiInfo.Split('^')[4].Replace("PSN:", "");
|
|
|
- //string ID1 = ImeiInfo.Split('^')[5].Replace("ID1:", "");
|
|
|
- //string ID2 = ImeiInfo.Split('^')[6].Replace("ID2:", "");
|
|
|
- //string ID3 = ImeiInfo.Split('^')[7].Replace("ID3:", "");
|
|
|
- //if (!SetIMEIInfo(iSN, IMEI1 == "null" ? "" : IMEI1, IMEI2 == "null" ? "" : IMEI2, "", MEID == "null" ? "" : MEID, NETCODE == "null" ? "" : NETCODE, ID1 == "null" ? "" : ID1, ID2 == "null" ? "" : ID2, ID3 == "null" ? "" : ID3, out oErrMessage))
|
|
|
- //{
|
|
|
- // if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
- // return true;
|
|
|
- // else
|
|
|
- // return false;
|
|
|
- //}
|
|
|
+ string ImeiInfo;
|
|
|
+ if (!GetMEIOrNetCodeRange(iSN, "", "", out ImeiInfo, out oErrMessage))
|
|
|
+ {
|
|
|
+ if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ string IMEI1 = ImeiInfo.Split('^')[0].Replace("IMEI1:", "");
|
|
|
+ string IMEI2 = ImeiInfo.Split('^')[1].Replace("IMEI2:", "");
|
|
|
+ string MEID = ImeiInfo.Split('^')[2].Replace("MEID:", "");
|
|
|
+ string NETCODE = ImeiInfo.Split('^')[3].Replace("NETCODE:", "");
|
|
|
+ string PSN = ImeiInfo.Split('^')[4].Replace("PSN:", "");
|
|
|
+ string ID1 = ImeiInfo.Split('^')[5].Replace("ID1:", "");
|
|
|
+ string ID2 = ImeiInfo.Split('^')[6].Replace("ID2:", "");
|
|
|
+ string ID3 = ImeiInfo.Split('^')[7].Replace("ID3:", "");
|
|
|
+ if (!SetIMEIInfo(iSN, IMEI1 == "null" ? "" : IMEI1, IMEI2 == "null" ? "" : IMEI2, "", MEID == "null" ? "" : MEID, PSN == "null" ? "" : PSN, NETCODE == "null" ? "" : NETCODE, ID1 == "null" ? "" : ID1, ID2 == "null" ? "" : ID2, ID3 == "null" ? "" : ID3, out oErrMessage))
|
|
|
+ {
|
|
|
+ if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//通过序列号获取最近操作的工单号
|
|
|
string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "' or ms_firstsn='" + iSN + "'").ToString();
|
|
|
if (ms_id != "")
|
|
|
{
|
|
|
- DataTable dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
|
|
|
+ dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
string Code1 = "";
|
|
@@ -504,7 +510,7 @@ namespace UMESDLLService
|
|
|
string Code25 = "";
|
|
|
string[] param = new string[] { ms_id, Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10, Code11, Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20, Code21, Code22, Code23, Code24, Code25 };
|
|
|
string[] ParamName = new string[] { "v_ms_id", "v_i_code1", "v_i_code2", "v_i_code3", "v_i_code4", "v_i_code5", "v_i_code6", "v_i_code7", "v_i_code8", "v_i_code9", "v_i_code10", "v_i_code11", "v_i_code12", "v_i_code13", "v_i_code14", "v_i_code15", "v_i_code16", "v_i_code17", "v_i_code18", "v_i_code19", "v_i_code20", "v_i_code21", "v_i_code22", "v_i_code23", "v_i_code24", "v_i_code25" };
|
|
|
- CallProcedure("GetMobileAllInfo_NEW", ParamName, ref param);
|
|
|
+ CallProcedure("GetMobileAllInfo_NEW_TOOL", ParamName, ref param);
|
|
|
for (int i = 1; i < param.Length; i++)
|
|
|
{
|
|
|
//获取出来的参数使用^分割
|
|
@@ -777,7 +783,7 @@ namespace UMESDLLService
|
|
|
/// <param name="oErrorMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("设置IMEI信息")]
|
|
|
- public bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNETCODE, string iID1, string iID2, string iID3, out string oErrMessage)
|
|
|
+ public bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iPSN, string iNETCODE, string iID1, string iID2, string iID3, out string oErrMessage)
|
|
|
{
|
|
|
if (iSN == "")
|
|
|
{
|
|
@@ -785,7 +791,7 @@ namespace UMESDLLService
|
|
|
return false;
|
|
|
}
|
|
|
oErrMessage = "";
|
|
|
- string[] param = new string[] { iSN, iIMEI1, iIMEI2, iIMEI3, iMEID, iNETCODE, "", iID1, iID2, iID3, oErrMessage };
|
|
|
+ string[] param = new string[] { iSN, iIMEI1, iIMEI2, iIMEI3, iMEID, iNETCODE, iPSN, iID1, iID2, iID3, oErrMessage };
|
|
|
string[] ParamName = new string[] { "v_i_sncode", "v_i_imei1", "v_i_imei2", "v_i_imei3", "v_i_meid", "v_i_netcode", "v_i_psn", "v_i_id1", "v_i_id2", "v_i_id3", "v_o_errmsg" };
|
|
|
CallProcedure("CS_SETIMEIINFO", ParamName, ref param);
|
|
|
oErrMessage = param[10];
|
|
@@ -814,10 +820,10 @@ namespace UMESDLLService
|
|
|
return false;
|
|
|
}
|
|
|
string SNcode = iSN;
|
|
|
- if (!GetInfoByMaterial(iSN, out iSN, out oErrMessage))
|
|
|
- {
|
|
|
- oErrMessage = "";
|
|
|
- }
|
|
|
+ //if (!GetInfoByMaterial(iSN, out iSN, out oErrMessage))
|
|
|
+ //{
|
|
|
+ // oErrMessage = "";
|
|
|
+ //}
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
iSN = SNcode;
|