|
|
@@ -5,13 +5,14 @@ using System.Text;
|
|
|
using NPOI.SS.UserModel;
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
using Oracle.ManagedDataAccess.Client;
|
|
|
+using Microsoft.Office.Interop.Excel;
|
|
|
|
|
|
namespace FileWatcher
|
|
|
{
|
|
|
public partial class UploadMakePlan : Form
|
|
|
{
|
|
|
|
|
|
- string connectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11710)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
|
|
|
+ string connectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
|
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
@@ -64,11 +65,12 @@ namespace FileWatcher
|
|
|
{
|
|
|
ISheet sheet = workbook.GetSheetAt(i);
|
|
|
string sheetName = sheet.SheetName;
|
|
|
-
|
|
|
+ if (sheetName == "工艺库")
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
{
|
|
|
-
|
|
|
//Console.WriteLine($"Processing sheet: {sheetName}");
|
|
|
-
|
|
|
// 获取标题行(第4行)
|
|
|
string wccode = sheet.GetRow(2).GetCell(2).StringCellValue; // 第4行索引为3
|
|
|
if (wccode == "")
|
|
|
@@ -109,7 +111,7 @@ namespace FileWatcher
|
|
|
{
|
|
|
planqtyIndex = colIndex;
|
|
|
}
|
|
|
- else if (headerValue == "工序")
|
|
|
+ else if (headerValue == "工序名称")
|
|
|
{
|
|
|
stepcodeIndex = colIndex;
|
|
|
}
|
|
|
@@ -190,14 +192,13 @@ namespace FileWatcher
|
|
|
}
|
|
|
dh.ExecuteSql("delete from MakePlanDetail where mpd_orderdetno is null", "delete");
|
|
|
OperateResult.AppendText($"Processing sheet: {sheetName}计划上传成功\n");
|
|
|
- string Error = "";
|
|
|
- param = new string[] { id, "0", Error };
|
|
|
- dh.CallProcedure("USER_PLANSPLIT_COMMIT", ref param);
|
|
|
- dh.CallProcedure("USER_PLANINSERT_WORK", ref param);
|
|
|
}
|
|
|
}
|
|
|
+ string Error = "";
|
|
|
+ param = new string[] { id, "0", Error };
|
|
|
+ dh.CallProcedure("USER_PLANSPLIT_COMMIT", ref param);
|
|
|
+ dh.CallProcedure("USER_PLANINSERT_WORK", ref param);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void ChooseFile_Click(object sender, EventArgs e)
|