From 7141e956ca8488f6feb082828cd60653382b6c89 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 24 十一月 2025 16:37:24 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/MateOutController.cs | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 347 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs
index 6c21da1..cfbae7f 100644
--- a/WebAPI/Controllers/MateOutController.cs
+++ b/WebAPI/Controllers/MateOutController.cs
@@ -1116,6 +1116,245 @@
}
}
+ //鍒锋柊琛ㄤ綋 杞﹂棿瀹氫綅 杩斿洖杞﹂棿鍗虫椂搴撳瓨搴撳瓨淇℃伅缃戦〉PDA鐗�
+ [Route("KF_ICInventory_WorkShopByMaterID/GetWorkShopICInventory")]
+ [HttpGet]
+ public object GetWorkShopICInventory(string HBarCode, long sHWHID, long sHSPID, long HOWNERID, string sWhere)
+ {
+ try
+ {
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> columnNameList = new List<object>();
+ DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventory_WorkShopByMaterIDList '" + HBarCode + "'," + sHWHID + "," + sHSPID + "," + HOWNERID + ",'" + sWhere + "'", "h_p_KF_ICInventory_WorkShopByMaterIDList");
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ //杞﹂棿瀹氫綅 杞﹂棿涓嬫灦搴撳瓨淇℃伅鏌ヨ
+ [Route("KF_ICInventory_WorkShop/GetWorkShopXJICInventory")]
+ [HttpGet]
+ public object GetWorkShopXJICInventory(string HCarBarCode, string HEquipBarCode, string HProcExBillNo,string HMaterNumber, long HWHID, long HSPID,string sWhere)
+ {
+ try
+ {
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> columnNameList = new List<object>();
+ DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventory_WorkShopByXJList '" + HCarBarCode + "','" + HEquipBarCode + "','" + HProcExBillNo + "','" + HMaterNumber + "'," + HWHID + "," + HSPID + ",'" + sWhere + "'", "h_p_KF_ICInventory_WorkShopByXJList");
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #region 杞﹂棿瀹氫綅 杞﹂棿鏌ヨ鏉$爜鏄惁瀛樺湪
+ [Route("KF_ICInventory_WorkShop/SearchHBarCode")]
+ [HttpGet]
+ public object checkHBarCode_Batch(string HBarCode, string user, int HOrgID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill");
+
+ //鍒ゆ柇鏉$爜鏄惁瀛樺湪鏉$爜妗f
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-037]鏍¢獙鎴愬姛";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛佸綋鍓嶆壒娆$爜鏃犲叆搴撲俊鎭妫�鏌ユ槸鍚︽壂閿�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #region 杞﹂棿瀹氫綅 鍒犻櫎鏉$爜搴撳瓨璁板綍
+ [Route("KF_ICInventory_WorkShop/ClearHBarCode")]
+ [HttpGet]
+ public object ClearHBarCode(string HBarCode, long HWHID, long HSPID, string user, int HOrgID)
+ {
+ try
+ {
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ ds = oCN.RunProcReturn($"exec h_p_KF_MaterialUpper_Clear '{HBarCode}','{HWHID}',{HSPID},'{user}',{HOrgID}", "h_p_KF_ICInventory_Clear");
+
+ //鍐欏叆鏃ュ織
+ ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛岀墿鏂欎唬鐮侊細" + HBarCode + ",浠撲綅id锛�" + HSPID, user);
+
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ //杞﹂棿瀹氫綅 杞﹂棿涓婁笅鏋舵椂闂存煡璇�
+ [Route("Kf_WorkShopICStockBill/List")]
+ [HttpGet]
+ public object Kf_WorkShopICStockBillList(string HBillType, string HCarBarCode, string HProcExBillNo, string HMaterNumber, long HWHID, long HSPID, string sWhere)
+ {
+ try
+ {
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> columnNameList = new List<object>();
+ if(sWhere!=null)
+ {
+ sWhere = sWhere.Replace("'", "''");
+ }
+ DataSet ds = oCN.RunProcReturn("exec h_p_KF_WorkShopICStockBillList '" + HBillType + "','" + HCarBarCode + "','" + HProcExBillNo + "','" + HMaterNumber + "'," + HWHID + "," + HSPID + ",'" + sWhere + "'", "h_p_KF_WorkShopICStockBillList");
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
[Route("MateOutBill/Delete_Json")]
[HttpGet]
public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType)
@@ -2736,6 +2975,114 @@
}
#endregion
+ #region 宸ュ巶鏃ュ巻淇濆瓨锛堟壒閲忥級
+ [Route("MaterOutEntryReport/Sc_ShopCalendarSaveList")]
+ [HttpPost]
+ public object Sc_ShopCalendarSaveList([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMainList(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁淇濆瓨鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ public class ClsHSourceList
+ {
+ public long HItemID { get; set; }
+ }
+ public class ClsHWorkHourList
+ {
+ public DateTime date { get; set; }
+ public string week { get; set; }
+ public double workHours { get; set; }
+ }
+ public json AddBillMainList(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();//璧勬簮鍒楄〃
+ string msg3 = sArray[1].ToString();//鏁版嵁鍒楄〃
+ string user = sArray[2].ToString();
+
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_PlanShifts_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ List<ClsHSourceList> HSourceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsHSourceList>>(msg2);
+ List<ClsHWorkHourList> HWorkHourList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsHWorkHourList>>(msg3);
+ //閬嶅巻鏇存柊鏁版嵁
+ foreach (ClsHSourceList HSource in HSourceList)
+ {
+ long HSourceID = HSource.HItemID;
+ foreach (ClsHWorkHourList HWorkHour in HWorkHourList)
+ {
+ DateTime date = HWorkHour.date;
+ double workHours = HWorkHour.workHours;
+ ds = oCN.RunProcReturn("select * from Gy_PlanShifts where HDate='" + date + "' and HSourceID=" + HSourceID, "Gy_PlanShifts");
+ string sql = "";
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ sql = $"update Gy_PlanShifts set HOverTimes='" + workHours + "' where HDate ='" + date + "' and HSourceID=" + HSourceID;
+ }
+ else
+ {
+ sql = $"insert into Gy_PlanShifts(HDate,HSourceID,HShiftsID,HOverTimes,HClassCount," +
+ "HRemark,HUseFlag)values" +
+ $"('{date}','{HSourceID}',0,'{workHours}','1'" +
+ $",'','鏈娴�')";
+ }
+ oCN.RunProc(sql);
+ }
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 宸ュ巶鏃ュ巻鎵规敼涓婄彮宸ユ椂
[Route("Gy_PlanShifts/BulkWorkTime")]
[HttpGet]
--
Gitblit v1.9.1