|
|
@@ -72,11 +72,11 @@ namespace UAS_MES_NEW.Query
|
|
|
ps_code.Text = code;
|
|
|
if (VaildDate.Checked)
|
|
|
{
|
|
|
- dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + usercode + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
|
|
|
+ dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + usercode + "','在录入','ENTERING')", "insert");
|
|
|
+ dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING')", "insert");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -88,7 +88,16 @@ namespace UAS_MES_NEW.Query
|
|
|
Workbook workbook = new Workbook(FilePath.Text);
|
|
|
List<Worksheet> list = new List<Worksheet>();
|
|
|
List<string> filename = new List<string>();
|
|
|
- dh.ExecuteSql("update ProductSOP set ps_attachsop='' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
|
|
|
+
|
|
|
+ if (VaildDate.Checked)
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
|
|
|
+ }
|
|
|
+
|
|
|
OperatResult.AppendText("一共Sheet: " + workbook.Worksheets.Count + "\n");
|
|
|
for (int i = 0; i < workbook.Worksheets.Count; i++)
|
|
|
{
|
|
|
@@ -110,14 +119,12 @@ namespace UAS_MES_NEW.Query
|
|
|
Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
|
|
|
}
|
|
|
string sheetname = she.Name;
|
|
|
-
|
|
|
// 获取工作表中的所有图片
|
|
|
List<Picture> pictures = new List<Picture>();
|
|
|
foreach (Aspose.Cells.Drawing.Picture picture in she.Pictures)
|
|
|
{
|
|
|
pictures.Add(picture);
|
|
|
}
|
|
|
-
|
|
|
// 获取使用的行数
|
|
|
int totalRows = she.Cells.MaxDataRow + 1;
|
|
|
int imageIndex = 1;
|
|
|
@@ -135,10 +142,16 @@ namespace UAS_MES_NEW.Query
|
|
|
she.PageSetup.PrintArea = $"A{startRow + 1}:{lastColLetter}{endRow + 1}";
|
|
|
if (File.Exists(PrintPath.Text))
|
|
|
{
|
|
|
- //if (startRow == 0)
|
|
|
- //{
|
|
|
- she.Pictures.Add(startRow + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
|
|
|
- //}
|
|
|
+ if (startRow == 0)
|
|
|
+ {
|
|
|
+ she.Pictures.Add(startRow + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ she.Pictures.Add(startRow - 4 + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
// 创建SheetRender对象
|
|
|
SheetRender sr = new SheetRender(she, options);
|
|
|
@@ -178,7 +191,7 @@ namespace UAS_MES_NEW.Query
|
|
|
dic.Add("em_code", "ADMIN");
|
|
|
dic.Add("caller", "ProductSOP");
|
|
|
OperatResult.AppendText("上传文件【" + imagePath + ".jpg" + "】\n");
|
|
|
- string fp_id = UploadFilesToRemoteUrl("http://172.16.1.80:8099/mes/MEScommon/uploadFiles.action?_noc=1", Application.StartupPath + @"\" + ps_prodcode.Text + @"\" + imagename, dic);
|
|
|
+ string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", Application.StartupPath + @"\" + ps_prodcode.Text + @"\" + imagename, dic);
|
|
|
string ps_id = dh.getFieldDataByCondition("ProductSOP", "ps_id", "ps_prodcode='" + ps_prodcode.Text + "'").ToString();
|
|
|
dh.ExecuteSql("insert into ProductSOPdetail(psd_id,psd_psid,psd_attach) select ProductSOPdetail_seq.nextval,ps_id,'" + imagename + ";" + fp_id + "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
|
|
|
}
|
|
|
@@ -337,8 +350,8 @@ namespace UAS_MES_NEW.Query
|
|
|
Dictionary<string, object> map = new Dictionary<string, object>();
|
|
|
string path;
|
|
|
string pathroot = dh.GetConfig("filePathUrl", "sys").ToString();
|
|
|
- dh.ExecuteSql("insert into soprelease(SR_ID, sr_pscode, SR_STATUS, SR_MACHINETYPE)" +
|
|
|
- "values(soprelease_seq.nextval,'" + ps_code.Text + "',0,'" + ps_prodcode.Text + "') ", "insert");
|
|
|
+ dh.ExecuteSql("insert into soprelease(SR_ID, sr_pscode, SR_STATUS, SR_MACHINETYPE,sr_releaseman,sr_readman)" +
|
|
|
+ "select soprelease_seq.nextval,'" + ps_code.Text + "',0,'" + ps_prodcode.Text + "','" + User.UserName + "',em_code from employee ", "insert");
|
|
|
LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "广播SOP", "广播成功", ps_prodcode.Text, "");
|
|
|
MessageBox.Show("文档[" + ps_prodcode.Text + "]下放成功");
|
|
|
}
|