From 1db1c64dc628d2053617ba2c3cc78fb94b518d2c Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 27 二月 2023 08:57:55 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/Sc_ProcessMangementController.cs | 90 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 80 insertions(+), 10 deletions(-)
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 8e02797..246256d 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -6,10 +6,12 @@
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using System.IO;
using System.Web.Http;
using WebAPI.DLL;
using WebAPI.Models;
using WebAPI.Service;
+using Kingdee.BOS.WebApi.Client;
namespace WebAPI.Controllers
{
@@ -18,7 +20,7 @@
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
private json objJsonResult = new json();
-
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
@@ -517,7 +519,7 @@
FentityModel.Add("FCostRate", dr1["FCostRate"].ToString());// 鎴愭湰鏉冮噸
FentityModel.Add("FISBACKFLUSH", dr1["FISBACKFLUSH"].ToString() == "1" ? true : false);// 鍊掑啿棰嗘枡
FentityModel.Add("FMOMAINENTRYID", dr1["FMOENTRYID"].ToString());//
- FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() }); //鍖呰鏍囪瘑
+ //FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() }); //鍖呰鏍囪瘑
FentityModel.Add("FLot", new JObject() { ["FNumber"] = dr1["FBATCHNO"].ToString() }); //鎵瑰彿
FentityModel.Add("F_bsv_Text", dr1["宸ュ簭娴佽浆鍗″彿"].ToString()); //娴佽浆鍗″彿
JArray Fentity2 = new JArray();
@@ -710,7 +712,21 @@
FentityModel.Add("FBaseRealQty", item["鏁伴噺"].ToString());//
FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");//
FentityModel.Add("FOwnerId", new JObject() { ["FNumber"] = item["HPrdOrgNumber"].ToString() });//
- FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumber"].ToString() }); // 浠撳簱
+ string sErr = "";
+ if (oSystemParameter.ShowBill(ref sErr))
+ {
+ if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+ {
+ if (oSystemParameter.omodel.MES_StationOutBill_InStockType == "宸ヨ壓璺嚎")
+ {
+ FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumbers"].ToString() }); // 浠撳簱
+ }
+ else if (oSystemParameter.omodel.MES_StationOutBill_InStockType == "宸ュ簭")
+ {
+ FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumber"].ToString() }); // 浠撳簱
+ }
+ }
+ }
FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["HBatchNo"].ToString() }); //鎵瑰彿
FentityModel.Add("FISBACKFLUSH", "true");//
FentityModel.Add("FWorkShopId1", new JObject() { ["FNumber"] = item["HWorkShopNumber"].ToString() }); // 鐢熶骇杞﹂棿
@@ -949,7 +965,21 @@
FentityModel.Add("FBaseRealQty", item["鏁伴噺"].ToString());//
FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");//
FentityModel.Add("FOwnerId", new JObject() { ["FNumber"] = item["HPrdOrgNumber"].ToString() });//
- FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumber"].ToString() }); // 浠撳簱
+ string sErr = "";
+ if (oSystemParameter.ShowBill(ref sErr))
+ {
+ if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+ {
+ if (oSystemParameter.omodel.MES_StationOutBill_InStockType == "宸ヨ壓璺嚎")
+ {
+ FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumbers"].ToString() }); // 浠撳簱
+ }
+ else if (oSystemParameter.omodel.MES_StationOutBill_InStockType == "宸ュ簭")
+ {
+ FentityModel.Add("FStockId", new JObject() { ["FNumber"] = item["HStockNumber"].ToString() }); // 浠撳簱
+ }
+ }
+ }
FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["HBatchNo"].ToString() }); //鎵瑰彿
FentityModel.Add("FISBACKFLUSH", "true");//
FentityModel.Add("FWorkShopId1", new JObject() { ["FNumber"] = item["HWorkShopNumber"].ToString() }); // 鐢熶骇杞﹂棿
@@ -1104,14 +1134,30 @@
Int64 HSourceEntryID, string HSourceBillNo, string user,
Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID,
Int64 HMaterID, string HSourceBillType, Int64 HSLInterID,
- Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ)
+ Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID)
{
try
{
//鑾峰彇鐢熶骇姹囨姤鍗曟渶澶nterID鍜屽崟鎹彿
- Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo);
- string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true);
-
+ //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo);
+ //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true);
+
+ DataSet ds1 = oCN.RunProcReturn("select * from MES_AccessoriesList where HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList");
+ string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFileName"]);
+ string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFilePath"]);
+
+
+
+ string path = HFilePath;
+ FileInfo fi = new FileInfo(path);
+ long len = fi.Length;
+ byte[] buffer = new byte[len];
+ FileStream fs = new FileStream(path, FileMode.Open);
+ fs.Read(buffer, 0, (int)len);
+ //鏂囦欢IO娴�
+ string a = Convert.ToBase64String(buffer);
+
+
//淇濆瓨
oCN.BeginTran();
//鐢熶骇姹囨姤鍗曚富琛�
@@ -1159,6 +1205,7 @@
model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //鏉ユ簮缁勭粐
model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //璐ㄦ缁勭粐
model.Add("FISSYNCED", "false");// 鏄惁宸插悓姝�
+ model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 鎶ユ鏃ユ湡
model.Add("FBillNo", HBillNo);
JArray Fentity = new JArray();
@@ -1257,7 +1304,7 @@
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:{HBillNo.ToString()}" + result;
+ objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:{HBillNo.ToString()}" + jsonRoot;
objJsonResult.data = null;
return objJsonResult;
}
@@ -1270,10 +1317,28 @@
{
Ids = fID,
};
+
+ K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/");
+
+
+
result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦
result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦
if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
{
+ string jsonStr = "{" +
+ " \"FileName\":\"" + HFileName + "\"," +
+ " \"FormId\":\"QM_InspectBill\"," +
+ " \"IsLast\":\"true\"," +
+ " \"InterId\":\"" + HInterID + "\"," +
+ " \"BillNO\":\"" + HBillNo + "\"," +
+ " \"AliasFileName\":\"test\"," +
+ " \"SendByte\":\"" + a + "\"," +
+ "}";
+
+ var ret = client.AttachmentUpload(jsonStr);
+
+
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -1328,7 +1393,7 @@
string HBillNo = DBUtility.ClsPub.CreateBillCode("7501", ref DBUtility.ClsPub.sExeReturnInfo, true);
//淇濆瓨
- oCN.BeginTran();
+ //oCN.BeginTran();
//鐢熸垚浜у搧妫�楠屽崟
//oCN.RunProc("Insert Into QC_POStockInCheckBillMain " +
//"(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
@@ -1464,6 +1529,10 @@
//FentityModel.Add("FReferDetail", Fentity3);
Fentity.Add(FentityModel);
model.Add("FEntity", Fentity); //鏄庣粏淇℃伅
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds = oCN.RunProcReturn("select HCheckdate from Sc_ProcessReportMain where hbillno = '" + HSourceBillNo + "'", "Sc_ProcessReportMain");
+ DateTime HCheckDate = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["HCheckdate"]);
JObject jsonRoot = new JObject()
{
["Creator"] = "",
@@ -1472,6 +1541,7 @@
["IsDeleteEntry"] = "false",
["SubSystemId"] = "",
["IsVerifyBaseDataField"] = "false",
+ ["F_PGKJ_Date"] = HCheckDate.ToString(),
//["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳�
["Model"] = model
};
--
Gitblit v1.9.1