|
@@ -21627,40 +21627,40 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
DateTime setTime = Convert.ToDateTime(oracleTrConn.GetSqlResultToObj("SELECT OLDSYNCTIME FROM TP_SYS_SAPCONFIG"));
|
|
DateTime setTime = Convert.ToDateTime(oracleTrConn.GetSqlResultToObj("SELECT OLDSYNCTIME FROM TP_SYS_SAPCONFIG"));
|
|
|
|
|
|
|
|
//010接口停不停,要等小鸟通知
|
|
//010接口停不停,要等小鸟通知
|
|
|
- if (now < setTime)
|
|
|
|
|
- {
|
|
|
|
|
- foreach (Zppfm010 sapParameter010 in sapParameterList)
|
|
|
|
|
- {
|
|
|
|
|
- ZPPFM010Response result010 = SAPDataLogic.HGSAPDK_ZPPFM010(sapParameter010, yyyymmdd);
|
|
|
|
|
- //sre.Message = result010.ZMSG;
|
|
|
|
|
- sre.Message = $"{result010.ZMSG}({sapParameter010.ZSUM})";
|
|
|
|
|
- sre.Result = result010.ZTYPE;
|
|
|
|
|
|
|
+ //if (now < setTime)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // foreach (Zppfm010 sapParameter010 in sapParameterList)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ZPPFM010Response result010 = SAPDataLogic.HGSAPDK_ZPPFM010(sapParameter010, yyyymmdd);
|
|
|
|
|
+ // //sre.Message = result010.ZMSG;
|
|
|
|
|
+ // sre.Message = $"{result010.ZMSG}({sapParameter010.ZSUM})";
|
|
|
|
|
+ // sre.Result = result010.ZTYPE;
|
|
|
|
|
|
|
|
- if (result010.TABLE_OUT != null && result010.TABLE_OUT.Length > 0)
|
|
|
|
|
- {
|
|
|
|
|
- sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = nvl(:ZTYPE,'S'), ZMSG = :ZMSG where barcode=:barcode and sapflbatchno=:sapflbatchno and logid=:logid";
|
|
|
|
|
- foreach (ZSPP110 item in result010.TABLE_OUT)
|
|
|
|
|
- {
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":barcode",OracleDbType.Varchar2, item.ZSCTM, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, item.ZBZBS, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":logid", logid)
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (result010.TABLE_OUT != null && result010.TABLE_OUT.Length > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = nvl(:ZTYPE,'S'), ZMSG = :ZMSG where barcode=:barcode and sapflbatchno=:sapflbatchno and logid=:logid";
|
|
|
|
|
+ // foreach (ZSPP110 item in result010.TABLE_OUT)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":barcode",OracleDbType.Varchar2, item.ZSCTM, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, item.ZBZBS, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":logid", logid)
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- if (result010.ZTYPE != "S")
|
|
|
|
|
- {
|
|
|
|
|
- sre.Result = -2;
|
|
|
|
|
- sre.Message = "同步条码失败," + result010.ZMSG;
|
|
|
|
|
- return sre;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (result010.ZTYPE != "S")
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sre.Result = -2;
|
|
|
|
|
+ // sre.Message = "同步条码失败," + result010.ZMSG;
|
|
|
|
|
+ // return sre;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
#region 同步产量
|
|
#region 同步产量
|
|
@@ -21754,69 +21754,69 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
|
- if (now < setTime)
|
|
|
|
|
- {
|
|
|
|
|
- ZPPFM008Response result = SAPDataLogic.HGSAPDK_ZPPFM008(sapParameter, yyyymmdd, "60");
|
|
|
|
|
-
|
|
|
|
|
- //if (result.Ztype == "E")
|
|
|
|
|
- //{
|
|
|
|
|
- // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = 'E', DataMSG = DataMSG||:msg where logid = :logid";
|
|
|
|
|
- // oracleParameter = new OracleParameter[]
|
|
|
|
|
- // {
|
|
|
|
|
- // new OracleParameter(":msg",OracleDbType.Varchar2, result.Zmsg, ParameterDirection.Input),
|
|
|
|
|
- // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
- // };
|
|
|
|
|
- // r = oracleConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- //}
|
|
|
|
|
- //else
|
|
|
|
|
- if (result.TABLE_OUT != null && result.TABLE_OUT.Length > 0)
|
|
|
|
|
- {
|
|
|
|
|
- sqlString = "update TSAP_HEGII_WorkData t set t.ZTime =sysdate, ZTYPE = :ZTYPE, ZMSG = :ZMSG where logid = " + logid +
|
|
|
|
|
- " \n and YYYYMMDD='" + yyyymmdd + "' and WorkCode='" + workcode +
|
|
|
|
|
- "' and DataCode='60' and GoodsCode=:GoodsCode and SAPCode=:SAPCode and UserCode=:UserCode \n" +
|
|
|
|
|
- "and OrderCode=:OrderCode and OrderItem=:OrderItem";
|
|
|
|
|
- foreach (ZSPP100 item in result.TABLE_OUT)
|
|
|
|
|
- {
|
|
|
|
|
- string posnr = item.POSNR.TrimStart('0');
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":GoodsCode",OracleDbType.Varchar2, item.GROES, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":SAPCode",OracleDbType.Varchar2, item.MATNR, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":UserCode",OracleDbType.Varchar2, item.ZGHNU, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":OrderCode",OracleDbType.Varchar2, (string.IsNullOrEmpty(item.VBELN) ? " " : item.VBELN), ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":OrderItem",OracleDbType.Varchar2, (string.IsNullOrEmpty(posnr) ? "0" : posnr), ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (now < setTime)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // ZPPFM008Response result = SAPDataLogic.HGSAPDK_ZPPFM008(sapParameter, yyyymmdd, "60");
|
|
|
|
|
+
|
|
|
|
|
+ // //if (result.Ztype == "E")
|
|
|
|
|
+ // //{
|
|
|
|
|
+ // // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = 'E', DataMSG = DataMSG||:msg where logid = :logid";
|
|
|
|
|
+ // // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // // {
|
|
|
|
|
+ // // new OracleParameter(":msg",OracleDbType.Varchar2, result.Zmsg, ParameterDirection.Input),
|
|
|
|
|
+ // // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
+ // // };
|
|
|
|
|
+ // // r = oracleConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // //}
|
|
|
|
|
+ // //else
|
|
|
|
|
+ // if (result.TABLE_OUT != null && result.TABLE_OUT.Length > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sqlString = "update TSAP_HEGII_WorkData t set t.ZTime =sysdate, ZTYPE = :ZTYPE, ZMSG = :ZMSG where logid = " + logid +
|
|
|
|
|
+ // " \n and YYYYMMDD='" + yyyymmdd + "' and WorkCode='" + workcode +
|
|
|
|
|
+ // "' and DataCode='60' and GoodsCode=:GoodsCode and SAPCode=:SAPCode and UserCode=:UserCode \n" +
|
|
|
|
|
+ // "and OrderCode=:OrderCode and OrderItem=:OrderItem";
|
|
|
|
|
+ // foreach (ZSPP100 item in result.TABLE_OUT)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // string posnr = item.POSNR.TrimStart('0');
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":GoodsCode",OracleDbType.Varchar2, item.GROES, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":SAPCode",OracleDbType.Varchar2, item.MATNR, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":UserCode",OracleDbType.Varchar2, item.ZGHNU, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":OrderCode",OracleDbType.Varchar2, (string.IsNullOrEmpty(item.VBELN) ? " " : item.VBELN), ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":OrderItem",OracleDbType.Varchar2, (string.IsNullOrEmpty(posnr) ? "0" : posnr), ParameterDirection.Input),
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- //:msg||chr(13)||DataMSG
|
|
|
|
|
- result.ZMSG = $"{result.ZMSG}({sapParameter.ZSUM})";
|
|
|
|
|
- sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":DataStuts",OracleDbType.Varchar2, result.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":msg",OracleDbType.Varchar2, result.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // //:msg||chr(13)||DataMSG
|
|
|
|
|
+ // result.ZMSG = $"{result.ZMSG}({sapParameter.ZSUM})";
|
|
|
|
|
+ // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":DataStuts",OracleDbType.Varchar2, result.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":msg",OracleDbType.Varchar2, result.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- if (result.ZTYPE != "S")
|
|
|
|
|
- {
|
|
|
|
|
- sre.Result = -2;
|
|
|
|
|
- sre.Message = "同步产量失败," + result.ZMSG;
|
|
|
|
|
- return sre;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (result.ZTYPE != "S")
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sre.Result = -2;
|
|
|
|
|
+ // sre.Message = "同步产量失败," + result.ZMSG;
|
|
|
|
|
+ // return sre;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- sqlString =
|
|
|
|
|
- "UPDATE tp_pm_groutingdailydetail bar\n" +
|
|
|
|
|
- " SET bar.issync = '1'\n" +
|
|
|
|
|
- " WHERE 1 = 1" + fifter;
|
|
|
|
|
|
|
+ // sqlString =
|
|
|
|
|
+ // "UPDATE tp_pm_groutingdailydetail bar\n" +
|
|
|
|
|
+ // " SET bar.issync = '1'\n" +
|
|
|
|
|
+ // " WHERE 1 = 1" + fifter;
|
|
|
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString);
|
|
|
|
|
+ //}
|
|
|
//else
|
|
//else
|
|
|
//{
|
|
//{
|
|
|
//
|
|
//
|
|
@@ -22107,28 +22107,28 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //if (JObject.Parse(result)["ZTYPE"].ToString() != "S")
|
|
|
|
|
- //{
|
|
|
|
|
- // sre.Result = -2;
|
|
|
|
|
- // sre.Message = "同步产量失败," + JObject.Parse(result)["ZMSG"].ToString();
|
|
|
|
|
- // return sre;
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ if (JObject.Parse(result)["ZTYPE"].ToString() != "S")
|
|
|
|
|
+ {
|
|
|
|
|
+ sre.Result = -2;
|
|
|
|
|
+ sre.Message = "同步产量失败," + JObject.Parse(result)["ZMSG"].ToString();
|
|
|
|
|
+ return sre;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- //sre.Result = -2;
|
|
|
|
|
- //sre.Message = "sap030接口同步失败," + ex.Message;
|
|
|
|
|
- //return sre;
|
|
|
|
|
|
|
+ sre.Result = -2;
|
|
|
|
|
+ sre.Message = "sap030接口同步失败," + ex.Message;
|
|
|
|
|
+ return sre;
|
|
|
|
|
|
|
|
- //:msg||chr(13)||DataMSG
|
|
|
|
|
- sqlString = "update tsap_hegii_datalog_bg t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":DataStuts",OracleDbType.Varchar2, "E", ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":msg",OracleDbType.Varchar2, ex.Message, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":logid",OracleDbType.Int32, logid_bg, ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
|
|
+ ////:msg||chr(13)||DataMSG
|
|
|
|
|
+ //sqlString = "update tsap_hegii_datalog_bg t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
+ //oracleParameter = new OracleParameter[]
|
|
|
|
|
+ //{
|
|
|
|
|
+ // new OracleParameter(":DataStuts",OracleDbType.Varchar2, "E", ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":msg",OracleDbType.Varchar2, ex.Message, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":logid",OracleDbType.Int32, logid_bg, ParameterDirection.Input),
|
|
|
|
|
+ //};
|
|
|
|
|
+ //r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//sqlString =
|
|
//sqlString =
|
|
@@ -22797,54 +22797,56 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
|
// 停用时间
|
|
// 停用时间
|
|
|
DateTime setTime = Convert.ToDateTime(oracleTrConn.GetSqlResultToObj("SELECT OLDSYNCTIME FROM TP_SYS_SAPCONFIG"));
|
|
DateTime setTime = Convert.ToDateTime(oracleTrConn.GetSqlResultToObj("SELECT OLDSYNCTIME FROM TP_SYS_SAPCONFIG"));
|
|
|
- if (now < setTime)
|
|
|
|
|
- {
|
|
|
|
|
- foreach (Zppfm010 sapParameter010 in sapParameterList)
|
|
|
|
|
- {
|
|
|
|
|
- ZPPFM010Response result010 = SAPDataLogic.HGSAPDK_ZPPFM010(sapParameter010, yyyymmdd);
|
|
|
|
|
- //sre.Message = result010.ZMSG;
|
|
|
|
|
- sre.Message = $"{result010.ZMSG}({sapParameter010.ZSUM})";
|
|
|
|
|
- sre.Result = result010.ZTYPE;
|
|
|
|
|
|
|
+ //if (now < setTime)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // foreach (Zppfm010 sapParameter010 in sapParameterList)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ZPPFM010Response result010 = SAPDataLogic.HGSAPDK_ZPPFM010(sapParameter010, yyyymmdd);
|
|
|
|
|
+ // //sre.Message = result010.ZMSG;
|
|
|
|
|
+ // sre.Message = $"{result010.ZMSG}({sapParameter010.ZSUM})";
|
|
|
|
|
+ // sre.Result = result010.ZTYPE;
|
|
|
|
|
|
|
|
- if (result010.TABLE_OUT != null && result010.TABLE_OUT.Length > 0)
|
|
|
|
|
- {
|
|
|
|
|
- // 保留条码同步履历 2020-10-14 by chenxy ztype = 'S'
|
|
|
|
|
- //sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = nvl(:ZTYPE,'S'), ZMSG = :ZMSG where barcode=:barcode and sapflbatchno=:sapflbatchno";
|
|
|
|
|
- sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = 'D', ZMSG = :ZMSG where barcode=:barcode and ztype = 'S' and sapflbatchno=:sapflbatchno";
|
|
|
|
|
- foreach (ZSPP110 item in result010.TABLE_OUT)
|
|
|
|
|
- {
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":barcode",OracleDbType.Varchar2, item.ZSCTM, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, item.ZBZBS, ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (result010.TABLE_OUT != null && result010.TABLE_OUT.Length > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // // 保留条码同步履历 2020-10-14 by chenxy ztype = 'S'
|
|
|
|
|
+ // //sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = nvl(:ZTYPE,'S'), ZMSG = :ZMSG where barcode=:barcode and sapflbatchno=:sapflbatchno";
|
|
|
|
|
+ // sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = 'D', ZMSG = :ZMSG where barcode=:barcode and ztype = 'S' and sapflbatchno=:sapflbatchno";
|
|
|
|
|
+ // foreach (ZSPP110 item in result010.TABLE_OUT)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":barcode",OracleDbType.Varchar2, item.ZSCTM, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, item.ZBZBS, ParameterDirection.Input),
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- if (result010.ZTYPE != "S")
|
|
|
|
|
- {
|
|
|
|
|
- sre.Result = -2;
|
|
|
|
|
- sre.Message = "同步条码失败," + result010.ZMSG;
|
|
|
|
|
- return sre;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ // if (result010.ZTYPE != "S")
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sre.Result = -2;
|
|
|
|
|
+ // sre.Message = "同步条码失败," + result010.ZMSG;
|
|
|
|
|
+ // return sre;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
|
|
+ //else
|
|
|
|
|
+ //{
|
|
|
|
|
+
|
|
|
|
|
+ sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = 'D' where barcode=:barcode and ztype = 'S' and sapflbatchno=:sapflbatchno";
|
|
|
|
|
+ foreach (DataRow row in fpData.Rows)
|
|
|
{
|
|
{
|
|
|
- sqlString = "update tsap_hegii_finishedproduct t set t.ZTime =sysdate, ZTYPE = 'D' where barcode=:barcode and ztype = 'S' and sapflbatchno=:sapflbatchno";
|
|
|
|
|
- foreach (DataRow row in fpData.Rows)
|
|
|
|
|
|
|
+ oracleParameter = new OracleParameter[]
|
|
|
{
|
|
{
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":barcode",OracleDbType.Varchar2, row["barcode"], ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, row["sapflbatchno"], ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ new OracleParameter(":barcode",OracleDbType.Varchar2, row["barcode"], ParameterDirection.Input),
|
|
|
|
|
+ new OracleParameter(":sapflbatchno",OracleDbType.Varchar2, row["sapflbatchno"], ParameterDirection.Input),
|
|
|
|
|
+ };
|
|
|
|
|
+ r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //}
|
|
|
// 删除已同步条码
|
|
// 删除已同步条码
|
|
|
// 保留条码同步履历 2020-10-14 by chenxy ztype = 'S'
|
|
// 保留条码同步履历 2020-10-14 by chenxy ztype = 'S'
|
|
|
//sql = "Delete from tsap_hegii_finishedproduct bar where 1 = 1" + fifter;
|
|
//sql = "Delete from tsap_hegii_finishedproduct bar where 1 = 1" + fifter;
|
|
@@ -22943,69 +22945,69 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
|
|
|
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
//2022年9月23日13:06:25 添加时间限制,10月1号零点整不再传输原接口产量数据
|
|
|
// 当前时间
|
|
// 当前时间
|
|
|
- if (now < setTime)
|
|
|
|
|
- {
|
|
|
|
|
- ZPPFM008Response result = SAPDataLogic.HGSAPDK_ZPPFM008(sapParameter, yyyymmdd, "60");
|
|
|
|
|
-
|
|
|
|
|
- //if (result.Ztype == "E")
|
|
|
|
|
- //{
|
|
|
|
|
- // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = 'E', DataMSG = DataMSG||:msg where logid = :logid";
|
|
|
|
|
- // oracleParameter = new OracleParameter[]
|
|
|
|
|
- // {
|
|
|
|
|
- // new OracleParameter(":msg",OracleDbType.Varchar2, result.Zmsg, ParameterDirection.Input),
|
|
|
|
|
- // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
- // };
|
|
|
|
|
- // r = oracleConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- //}
|
|
|
|
|
- //else
|
|
|
|
|
- if (result.TABLE_OUT != null && result.TABLE_OUT.Length > 0)
|
|
|
|
|
- {
|
|
|
|
|
- sqlString = "update TSAP_HEGII_WorkData t set t.ZTime =sysdate, ZTYPE = :ZTYPE, ZMSG = :ZMSG where logid = " + logid +
|
|
|
|
|
- " \n and YYYYMMDD='" + yyyymmdd + "' and WorkCode='" + workcode +
|
|
|
|
|
- "' and DataCode='60' and GoodsCode=:GoodsCode and SAPCode=:SAPCode and UserCode=:UserCode \n" +
|
|
|
|
|
- "and OrderCode=:OrderCode and OrderItem=:OrderItem";
|
|
|
|
|
- foreach (ZSPP100 item in result.TABLE_OUT)
|
|
|
|
|
- {
|
|
|
|
|
- string posnr = item.POSNR.TrimStart('0');
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":GoodsCode",OracleDbType.Varchar2, item.GROES, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":SAPCode",OracleDbType.Varchar2, item.MATNR, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":UserCode",OracleDbType.Varchar2, item.ZGHNU, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":OrderCode",OracleDbType.Varchar2, (string.IsNullOrEmpty(item.VBELN) ? " " : item.VBELN), ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":OrderItem",OracleDbType.Varchar2, (string.IsNullOrEmpty(posnr) ? "0" : posnr), ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (now < setTime)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // ZPPFM008Response result = SAPDataLogic.HGSAPDK_ZPPFM008(sapParameter, yyyymmdd, "60");
|
|
|
|
|
+
|
|
|
|
|
+ // //if (result.Ztype == "E")
|
|
|
|
|
+ // //{
|
|
|
|
|
+ // // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = 'E', DataMSG = DataMSG||:msg where logid = :logid";
|
|
|
|
|
+ // // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // // {
|
|
|
|
|
+ // // new OracleParameter(":msg",OracleDbType.Varchar2, result.Zmsg, ParameterDirection.Input),
|
|
|
|
|
+ // // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
+ // // };
|
|
|
|
|
+ // // r = oracleConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // //}
|
|
|
|
|
+ // //else
|
|
|
|
|
+ // if (result.TABLE_OUT != null && result.TABLE_OUT.Length > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sqlString = "update TSAP_HEGII_WorkData t set t.ZTime =sysdate, ZTYPE = :ZTYPE, ZMSG = :ZMSG where logid = " + logid +
|
|
|
|
|
+ // " \n and YYYYMMDD='" + yyyymmdd + "' and WorkCode='" + workcode +
|
|
|
|
|
+ // "' and DataCode='60' and GoodsCode=:GoodsCode and SAPCode=:SAPCode and UserCode=:UserCode \n" +
|
|
|
|
|
+ // "and OrderCode=:OrderCode and OrderItem=:OrderItem";
|
|
|
|
|
+ // foreach (ZSPP100 item in result.TABLE_OUT)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // string posnr = item.POSNR.TrimStart('0');
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":ZTYPE",OracleDbType.Varchar2, item.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":ZMSG",OracleDbType.Varchar2, item.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":GoodsCode",OracleDbType.Varchar2, item.GROES, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":SAPCode",OracleDbType.Varchar2, item.MATNR, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":UserCode",OracleDbType.Varchar2, item.ZGHNU, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":OrderCode",OracleDbType.Varchar2, (string.IsNullOrEmpty(item.VBELN) ? " " : item.VBELN), ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":OrderItem",OracleDbType.Varchar2, (string.IsNullOrEmpty(posnr) ? "0" : posnr), ParameterDirection.Input),
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- //:msg||chr(13)||DataMSG
|
|
|
|
|
- result.ZMSG = $"{result.ZMSG}({sapParameter.ZSUM})";
|
|
|
|
|
- sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":DataStuts",OracleDbType.Varchar2, result.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":msg",OracleDbType.Varchar2, result.ZMSG, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // //:msg||chr(13)||DataMSG
|
|
|
|
|
+ // result.ZMSG = $"{result.ZMSG}({sapParameter.ZSUM})";
|
|
|
|
|
+ // sqlString = "update tsap_hegii_datalog t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
+ // oracleParameter = new OracleParameter[]
|
|
|
|
|
+ // {
|
|
|
|
|
+ // new OracleParameter(":DataStuts",OracleDbType.Varchar2, result.ZTYPE, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":msg",OracleDbType.Varchar2, result.ZMSG, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":logid",OracleDbType.Int32, logid, ParameterDirection.Input),
|
|
|
|
|
+ // };
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- if (result.ZTYPE != "S")
|
|
|
|
|
- {
|
|
|
|
|
- sre.Result = -2;
|
|
|
|
|
- sre.Message = "同步产量失败," + result.ZMSG;
|
|
|
|
|
- return sre;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (result.ZTYPE != "S")
|
|
|
|
|
+ // {
|
|
|
|
|
+ // sre.Result = -2;
|
|
|
|
|
+ // sre.Message = "同步产量失败," + result.ZMSG;
|
|
|
|
|
+ // return sre;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- sqlString =
|
|
|
|
|
- "UPDATE tp_pm_groutingdailydetail bar\n" +
|
|
|
|
|
- " SET bar.issync = NULL\n" +
|
|
|
|
|
- " WHERE 1 = 1" + fifter;
|
|
|
|
|
|
|
+ // sqlString =
|
|
|
|
|
+ // "UPDATE tp_pm_groutingdailydetail bar\n" +
|
|
|
|
|
+ // " SET bar.issync = NULL\n" +
|
|
|
|
|
+ // " WHERE 1 = 1" + fifter;
|
|
|
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // r = oracleTrConn.ExecuteNonQuery(sqlString);
|
|
|
|
|
+ //}
|
|
|
//else
|
|
//else
|
|
|
//{
|
|
//{
|
|
|
#region 调新报工接口
|
|
#region 调新报工接口
|
|
@@ -23292,28 +23294,28 @@ updateuserid=:updateuserid where barcode=:barcode";
|
|
|
r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //if (JObject.Parse(result)["ZTYPE"].ToString() != "S")
|
|
|
|
|
- //{
|
|
|
|
|
- // sre.Result = -2;
|
|
|
|
|
- // sre.Message = "同步产量失败," + JObject.Parse(result)["ZMSG"].ToString();
|
|
|
|
|
- // return sre;
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ if (JObject.Parse(result)["ZTYPE"].ToString() != "S")
|
|
|
|
|
+ {
|
|
|
|
|
+ sre.Result = -2;
|
|
|
|
|
+ sre.Message = "同步产量失败," + JObject.Parse(result)["ZMSG"].ToString();
|
|
|
|
|
+ return sre;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- //sre.Result = -2;
|
|
|
|
|
- //sre.Message = "sap030接口同步失败," + ex.Message;
|
|
|
|
|
- //return sre;
|
|
|
|
|
|
|
+ sre.Result = -2;
|
|
|
|
|
+ sre.Message = "sap030接口同步失败," + ex.Message;
|
|
|
|
|
+ return sre;
|
|
|
|
|
|
|
|
- //:msg||chr(13)||DataMSG
|
|
|
|
|
- sqlString = "update tsap_hegii_datalog_bg t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
- oracleParameter = new OracleParameter[]
|
|
|
|
|
- {
|
|
|
|
|
- new OracleParameter(":DataStuts",OracleDbType.Varchar2, "E", ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":msg",OracleDbType.Varchar2, ex.Message, ParameterDirection.Input),
|
|
|
|
|
- new OracleParameter(":logid",OracleDbType.Int32, logid_bg, ParameterDirection.Input),
|
|
|
|
|
- };
|
|
|
|
|
- r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
|
|
|
|
+ ////:msg||chr(13)||DataMSG
|
|
|
|
|
+ //sqlString = "update tsap_hegii_datalog_bg t set t.EndTime = sysdate, DataStuts = :DataStuts, DataMSG =nvl2(:msg,:msg||' '||chr(13)||DataMSG,DataMSG) where logid = :logid";
|
|
|
|
|
+ //oracleParameter = new OracleParameter[]
|
|
|
|
|
+ //{
|
|
|
|
|
+ // new OracleParameter(":DataStuts",OracleDbType.Varchar2, "E", ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":msg",OracleDbType.Varchar2, ex.Message, ParameterDirection.Input),
|
|
|
|
|
+ // new OracleParameter(":logid",OracleDbType.Int32, logid_bg, ParameterDirection.Input),
|
|
|
|
|
+ //};
|
|
|
|
|
+ //r = oracleTrConn.ExecuteNonQuery(sqlString, oracleParameter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//r = oracleTrConn.ExecuteNonQuery(sqlString);
|
|
//r = oracleTrConn.ExecuteNonQuery(sqlString);
|