From 862257fe2991fa96e0f20e31bcf00e4f9b1f86a2 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 22 十二月 2025 16:07:44 +0800
Subject: [PATCH] 来料检验单 生产入库检验单 出厂检验单 添加 检验数量 字段,添加 检验值字段
---
WebAPI/Controllers/Sc_ProcessMangementController.cs | 454 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 451 insertions(+), 3 deletions(-)
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 8efb342..bd41db0 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -12,6 +12,7 @@
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
+using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -34,12 +35,21 @@
{
try
{
+ List<object> a = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ a.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = a;
+
return objJsonResult;
//}
//else
@@ -1392,7 +1402,7 @@
}
}
-
+ #region
/// <summary>
/// 鐢熸垚閲戣澏浜戞潵鏂欐楠屽崟
/// </summary>
@@ -1638,9 +1648,306 @@
return objJsonResult;
}
}
+ #endregion
+
+
+ #region 鐢熸垚閲戣澏浜戞潵鏂欐楠屽崟 2025/11/26
+ [Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json2")]
+ [HttpGet]
+ public object set_SaveQCStockInCheckBill_Json2(string HZJOrgNumber, string HMaterNumber, string HUnitNumber,
+ double HCheckQty, double HRightQty, double HBadQty,
+ string HCheckResult, string HSupNumber,
+ string HUseResult, Int64 HSeQ, Int64 HSourceInterID,
+ 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, string HBillNo, Int64 HInterID, string HBatchNo)
+ {
+ try
+ {
+ //鑾峰彇鐢熶骇姹囨姤鍗曟渶澶nterID鍜屽崟鎹彿
+ //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo);
+ //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true);
+ HBatchNo = HBatchNo ?? "";
+ //淇濆瓨
+ oCN.BeginTran();
+ //鐢熶骇姹囨姤鍗曚富琛�
+ oCN.RunProc("Insert Into QC_POStockInCheckBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
+ ",HYear,HPeriod,HRemark,HSupID,HMaterID" +
+ ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" +
+ ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" +
+ ") " +
+ " values('7503','7503'," + HInterID.ToString() + ",'" + HBillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" +
+ ",DATENAME(YEAR,GETDATE()),0,''," + HSupID.ToString() + "," + HMaterID.ToString() +
+ ",'" + HCheckQty.ToString() + "','" + HCheckQty.ToString() + "','" + HRightQty.ToString() + "','" + HBadQty.ToString() + "','" + HKeeperID.ToString() + "'" +
+ ",'" + HCheckResult.ToString() + "','', '','',''" +
+ ") ");
+ //鐢熶骇姹囨姤鍗曞瓙琛�
+ oCN.RunProc("Insert into QC_POStockInCheckBillSub " +
+ " (HInterID,HEntryID,HCloseMan,HCloseType" +
+ ",HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HRelationQty,HRelationMoney,HQCCheckClassID,HQCCheckItemID,HQCStd," +
+ "HResult,HQCRelValue,HProcCheckEmp,HProcCheckTime" +
+ ") values("
+ + HInterID.ToString() + ",1,'',''" +
+ ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" +
+ ",0,0,0,0,''" +
+ ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" +
+ ") ");
+ //鍚屾閲戣澏
+ //璁块棶閲戣澏
+ var loginRet = InvokeHelper.Login();
+ var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+ if (isSuccess == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎿嶄綔澶辫触,閲戣澏璐﹀彿鐧诲綍寮傚父銆�" + loginRet;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ // string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e
+ // join AIS20210811135644..T_HR_EMPINFO a on e.HNumber = a.FNUMBER
+ // join AIS20210811135644..T_BD_STAFFTEMP c on c.FID = a.FID
+ // join AIS20210811135644..T_BD_DEPARTMENT d on c.FDEPTID = d.FDEPTID
+ // where e.HItemID ='" + HKeeperID + "' ";
+ // //鏌ヨ璐ㄦ鍛樺搴旇川妫�閮ㄩ棬
+ // ds = oCN.RunProcReturn(sql, "T_HR_EMPINFO");
+ // LogService.Write("sql" + sql);
+ // if (ds.Tables[0].Rows.Count == 0)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鎿嶄綔澶辫触,璐ㄦ鍛樺搴旇川妫�閮ㄩ棬鏃犳暟鎹��" + sql;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+
+ JObject model = new JObject();
+ model.Add("FBillTypeID", new JObject() { ["Fnumber"] = "JYD001_SYS" }); //鍗曟嵁绫诲瀷 鏉ユ枡妫�楠屽崟JYD001_SYS
+ model.Add("FBusinessType", "1"); //涓氬姟绫诲瀷
+ model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //鍗曟嵁鏃ユ湡
+ model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //璐ㄦ缁勭粐
+ model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //鏉ユ簮缁勭粐
+ //model.Add("FInspectDepId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Dept"].ToString() }); //璐ㄦ閮ㄩ棬
+ //model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //璐ㄦ鍛�
+ model.Add("FISSYNCED", "false");// 鏄惁宸插悓姝�
+ model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 鎶ユ鏃ユ湡
+ model.Add("FBillNo", HBillNo);
+
+ // LogService.Write("璐ㄦ閮ㄩ棬" + ds.Tables[0].Rows[0]["Dept"].ToString());
+ // LogService.Write("璐ㄦ鍛�" + ds.Tables[0].Rows[0]["Employee"].ToString());
+
+ JArray Fentity = new JArray();
+ JObject FentityModel = new JObject();
+ FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜
+ FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//璁¢噺鍗曚綅鍐呯爜
+ FentityModel.Add("FInspectQty", HCheckQty.ToString());// 妫�楠屾暟閲�
+ FentityModel.Add("FQualifiedQty", HRightQty.ToString());// 鍚堟牸鏁伴噺
+ FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());// 涓嶅悎鏍兼暟閲�
+ FentityModel.Add("FInspectResult", HCheckResult.ToString());// 妫�楠岀粨鏋�
+ FentityModel.Add("FQCStatus", "1");// 璐ㄦ鐘舵��
+ FentityModel.Add("FIsRelated", false);// 涓嶈壇鍝佸叧鑱旀爣蹇�
+ FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");// 婧愬崟绫诲瀷
+ FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//鍩烘湰鍗曚綅
+ FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//鍩烘湰鍗曚綅妫�楠屾暟閲�
+ FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); // 渚涘簲鍟�
+ //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 浠撳簱
+ FentityModel.Add("FInspectTimes", "1"); // 妫�楠屾鏁�
+ FentityModel.Add("FTimeUnit", "24");//鏃堕棿鍗曚綅
+ FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//鏍锋湰鐮村潖鎵挎媴鏂�
+ FentityModel.Add("FISFIRSTINSPECT", false);//棣栨
+ FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//鍩烘湰鍗曚綅鍚堟牸鏁�
+ FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//鍩烘湰鍗曚綅鎺ユ敹鏁�
+ FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//甯佸埆
+ FentityModel.Add("FIsSplitRow ", false);// 鏄惁鎷嗗垎琛�
+ FentityModel.Add("FLot", new JObject() { ["Fnumber"] = HBatchNo.ToString() });//鎵瑰彿
+
+ JArray Fentity2 = new JArray();
+ JObject FentityModel2 = new JObject();
+ FentityModel2.Add("FPolicyMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜
+ FentityModel2.Add("FPolicyStatus", "1"); //鐘舵��
+ FentityModel2.Add("FPolicyQty", HRightQty.ToString() == "0" ? HBadQty.ToString() : HRightQty.ToString()); //鏁伴噺
+ FentityModel2.Add("FBasePolicyQty", HRightQty.ToString() == "0" ? HBadQty.ToString() : HRightQty.ToString()); //鍩烘湰鍗曚綅鏁伴噺
+ FentityModel2.Add("FUsePolicy", HUseResult.ToString()); //浣跨敤鍐崇瓥
+ FentityModel2.Add("FIsCheck", false); //鏄惁鎶芥
+ FentityModel2.Add("FIsDefectProcess", false); //涓嶈壇澶勭悊
+ FentityModel2.Add("FCanSale", false); //鍙攢鍞�
+ FentityModel2.Add("FIsMRBReview", false); //MRP璇勫
+ FentityModel2.Add("FIsReturn", true); //鍒ら��
+ FentityModel2.Add("FIsRelatedDefect", false); //涓嶈壇鍝佸叧鑱旀爣蹇�
+ Fentity2.Add(FentityModel2);
+ FentityModel.Add("FPolicyDetail", Fentity2);
+ JArray Fentity3 = new JArray();
+ JObject FentityModel3 = new JObject();
+ FentityModel3.Add("FDetailID", "0");//
+ FentityModel3.Add("FSrcBillType", "PUR_ReceiveBill"); //婧愬崟绫诲瀷
+ FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString()); //鏀舵枡閫氱煡鍗曞崟鍙�
+ FentityModel3.Add("FSrcInterId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富ID
+ FentityModel3.Add("FSrcEntryId", HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙ID
+ FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString()); //婧愬崟琛屽彿
+ FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PUR_PurchaseOrder" }); // 璁㈠崟绫诲瀷
+ FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString()); //璁㈠崟鍗曞彿
+ FentityModel3.Add("FOrderId", HSourceInterID.ToString()); //璁㈠崟涓籌D
+ FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString()); //璁㈠崟瀛怚D
+ FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString()); //璁㈠崟琛屽彿
+ Fentity3.Add(FentityModel3);
+ FentityModel.Add("FReferDetail", Fentity3);
+
+
+ JArray Fentity4 = new JArray();
+ JObject FentityModel4 = new JObject();
+ FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect"); //鍗曟嵁杞崲瑙勫垯
+ FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY"); //鏀舵枡閫氱煡鍗曞瓙琛�
+ FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富鍐呯爜
+ FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙鍐呯爜
+ FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString()); //
+ FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString()); //
+ FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString()); //
+ FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString()); //
+ Fentity4.Add(FentityModel4);
+ FentityModel.Add("FEntity_Link", Fentity4);
+
+
+
+ Fentity.Add(FentityModel);
+ model.Add("FEntity", Fentity); //鏄庣粏淇℃伅
+ JObject jsonRoot = new JObject()
+ {
+ ["Creator"] = "",
+ ["NeedUpDateFields"] = new JArray(),
+ ["NeedReturnFields"] = new JArray(),
+ ["IsDeleteEntry"] = "false",
+ ["SubSystemId"] = "",
+ ["IsVerifyBaseDataField"] = "false",
+ //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳�
+ ["Model"] = model
+ };
+ LogService.Write("妫�楠屽崟json锛�" + jsonRoot);
+ string result = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨
+ //鍒ゆ柇淇濆瓨鏄惁鎴愬姛
+ if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ LogService.Write("鏉ユ枡妫�楠屽崟淇濆瓨閿欒jsonRoot:" + jsonRoot);
+ LogService.Write("鎶ラ敊:" + result);
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:{HBillNo.ToString()}" + jsonRoot;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鎻愪氦瀹℃牳
+ string result1 = string.Empty;
+ string result2 = string.Empty;
+ var fID = JObject.Parse(result)["Result"]["Id"].ToString();
+ var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
+ var json = new
+ {
+ Ids = fID,
+ };
+
+ K3CloudApiClient client = new K3CloudApiClient("http://47.96.97.237/k3cloud");
+ // 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")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍙凤細{fBillNo}锛屾彁浜ゅけ璐�" + result;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+
+ DataSet ds1 = oCN.RunProcReturn("select * from MES_AccessoriesList where HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList");
+
+ for (var i = 0; i < ds1.Tables[0].Rows.Count; i++)
+ {
+ string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[i]["HFileName"]);
+ string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[i]["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);
+
+ ds = oCN.RunProcReturn("select * from AIS20210811135644..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL");
+
+ HInterID = long.Parse(ds.Tables[0].Rows[0]["FID"].ToString());
+
+ string jsonStr = "{" +
+ " \"FileName\":\"" + HFileName + "\"," +
+ " \"FormId\":\"QM_InspectBill\"," +
+ " \"IsLast\":\"true\"," +
+ " \"InterId\":\"" + HInterID + "\"," +
+ " \"BillNo\":\"" + HBillNo + "\"," +
+ " \"AliasFileName\":\"test\"," +
+ " \"SendByte\":\"" + a + "\"" +
+ "}";
+ string _vlog = InvokeHelper.UpLoad("QM_InspectBill", jsonStr);
+ LogService.Write("json:" + jsonStr);
+ LogService.Write("_vlog:" + _vlog);
+
+ if (JObject.Parse(_vlog)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍙凤細{fBillNo}锛岀収鐗囧悓姝ュけ璐�" + _vlog;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ //string jsonStr = "{" +
+ // " \"FileName\":\"" + HFileName + "\"," +
+ // " \"FormId\":\"QM_InspectBill\"," +
+ // " \"IsLast\":\"true\"," +
+ // " \"InterId\":\"" + HInterID + "\"," +
+ // " \"BillNO\":\"" + HBillNo + "\"," +
+ // " \"AliasFileName\":\"test\"," +
+ // " \"SendByte\":\"" + a + "\"," +
+ // "}";
+
+ //var ret = client.AttachmentUpload(jsonStr);
+ }
+
+ oCN.Commit();
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
@@ -2075,6 +2382,7 @@
DataSet ds;
try
{
+
if (!DBUtility.ClsPub.Security_Log("Sc_ProcessPlan_Query", 1, false, user))
{
objJsonResult.code = "0";
@@ -2095,6 +2403,7 @@
string sql = sql1 + sWhere + " order by hmainid desc ";
ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList");
}
+
}
catch (Exception e)
{
@@ -6110,6 +6419,61 @@
}
#endregion
+ #region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍒嗛〉鍒楄〃
+ [Route("Sc_ProcessMangement/get锘縂et_QC_NoPassProdDisposeBillListPage")]
+ [HttpGet]
+ public json Get_QC_NoPassProdDisposeBillListPage(string sWhere, string user, int page, int size)
+ {
+ DataSet ds;
+ json res = new json();
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("QC_NoPassProdDisposeBillMain_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡璇紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",''", "h_p_QC_NoPassProdDisposeBillList");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_NoPassProdDisposeBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ res.code = CodeConstant.SUCCEED;
+ res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ res.Message = "Sucess锛�";
+ res.list = columnNameList;
+ res.data = ds.Tables[0];
+ return res;
+ }
+ catch (Exception e)
+ {
+ res.code = CodeConstant.FAIL;
+ res.count = CountConstant.FAIL;
+ res.Message = "Exception锛�" + e.ToString();
+ res.data = null;
+ return res;
+ }
+ }
+ #endregion
+
#region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍒犻櫎
[Route("Sc_ProcessMangement/DeleteQC_NoPassProdDisposeBill")]
@@ -6528,8 +6892,30 @@
//杩涜闇�瑕佽繘琛岀殑鍏抽棴/鍙嶅叧闂搷浣�
if (IsAudit == 0) //鍏抽棴鎻愪氦
{
+ //鍏抽棴鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:鍏抽棴鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
//鍏抽棴鎻愪氦
- if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -6548,8 +6934,31 @@
}
if (IsAudit == 1) //鍙嶅叧闂彁浜�
{
+ //鍙嶅叧闂墠鎺у埗=========================================
+ string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl ");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:鍙嶅叧闂墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
//鍙嶅叧闂彁浜�
- if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -6716,6 +7125,45 @@
}
#endregion
+ #region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍑虹珯鍗曚笅鎺ㄦ煡璇�
+
+ [Route("Sc_ProcessMangement/Get_Sc_StationOutBill")]
+ [HttpGet]
+ public object Get_Sc_StationOutBill(string HID)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql = "select * from h_v_MES_StationOutBillList where hmainid='" + HID + "'";
+ ds = oCN.RunProcReturn(sql, "h_v_MES_StationOutBillList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#endregion
#region 涓嶈壇鍝佽瘎瀹″鐞嗛獙鏀跺崟
--
Gitblit v1.9.1