From f34c6a21dc58bc0d40a011d6d7366c5eb3f15f15 Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期五, 20 九月 2024 13:59:34 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Sc_ProcessSendWorkController.cs | 472 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 236 insertions(+), 236 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessSendWorkController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessSendWorkController.cs index b1f415a..d30df7b 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessSendWorkController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessSendWorkController.cs @@ -1,253 +1,253 @@ -锘縰sing Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Pub_Class; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Data.SqlClient; -using System.Web.Http; -using WebAPI.Models; +锘�//using Newtonsoft.Json; +//using Newtonsoft.Json.Linq; +//using Pub_Class; +//using System; +//using System.Collections; +//using System.Collections.Generic; +//using System.Data; +//using System.Data.SqlClient; +//using System.Web.Http; +//using WebAPI.Models; -namespace WebAPI.Controllers -{ - public class Sc_ProcessSendWorkController : ApiController - { - private json objJsonResult = new json(); - public DataSet ds = new DataSet(); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); +//namespace WebAPI.Controllers +//{ +// public class Sc_ProcessSendWorkController : ApiController +// { +// private json objJsonResult = new json(); +// public DataSet ds = new DataSet(); +// SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - #region 宸ュ簭娲惧伐鍗� 鍒楄〃 - /// <summary> - /// 宸ュ簭娲惧伐鍗曞垪琛� - /// </summary> - /// <returns></returns> - [Route("Sc_ProcessSendWork/Sc_ProcessSendWorkList")] - [HttpGet] - public object Sc_ProcessSendWorkList(string sWhere, string user) - { - try - { - List<object> columnNameList = new List<object>(); +// #region 宸ュ簭娲惧伐鍗� 鍒楄〃 +// /// <summary> +// /// 宸ュ簭娲惧伐鍗曞垪琛� +// /// </summary> +// /// <returns></returns> +// [Route("Sc_ProcessSendWork/Sc_ProcessSendWorkList")] +// [HttpGet] +// public object Sc_ProcessSendWorkList(string sWhere, string user) +// { +// try +// { +// List<object> columnNameList = new List<object>(); - ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessSendWorkList where 1=1 " + sWhere, "h_v_Sc_ProcessSendWorkList"); +// ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessSendWorkList where 1=1 " + sWhere, "h_v_Sc_ProcessSendWorkList"); - //娣诲姞鍒楀悕 - 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鍒楀璞$殑鍒楀悕 - } +// //娣诲姞鍒楀悕 +// 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 = "杩斿洖璁板綍鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - objJsonResult.list = columnNameList; - return objJsonResult; +// objJsonResult.code = "1"; +// objJsonResult.count = 1; +// objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; +// 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 +// } +// catch (Exception ex) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); +// objJsonResult.data = null; +// return objJsonResult; +// } +// } +// #endregion - #region 宸ュ簭娲惧伐鍗� 淇濆瓨/缂栬緫 - /// <summary> - /// 宸ュ簭娲惧伐鍗� 淇濆瓨 - /// </summary> - /// <param name="msg"></param> - /// <returns></returns> - [Route("Sc_ProcessSendWork/SaveProcessSendWork")] - [HttpPost] - public object SaveProcessSendWork([FromBody] JObject msg) - { - var _value = msg["msg"].ToString(); - string msg1 = _value.ToString(); - string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); - string msg2 = sArray[0].ToString(); - string msg3 = sArray[1].ToString(); - string msg4 = sArray[2].ToString(); +// #region 宸ュ簭娲惧伐鍗� 淇濆瓨/缂栬緫 +// /// <summary> +// /// 宸ュ簭娲惧伐鍗� 淇濆瓨 +// /// </summary> +// /// <param name="msg"></param> +// /// <returns></returns> +// [Route("Sc_ProcessSendWork/SaveProcessSendWork")] +// [HttpPost] +// public object SaveProcessSendWork([FromBody] JObject msg) +// { +// var _value = msg["msg"].ToString(); +// string msg1 = _value.ToString(); +// string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); +// string msg2 = sArray[0].ToString(); +// string msg3 = sArray[1].ToString(); +// string msg4 = sArray[2].ToString(); - string UserName = ""; - ListModels oListModels = new ListModels(); - try - { - DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); - List<Model.ClsSc_ProcessSendWorkMain> lsmain = new List<Model.ClsSc_ProcessSendWorkMain>(); - msg2 = msg2.Replace("\\", ""); - msg2 = msg2.Replace("\n", ""); //\n - lsmain = oListModels.getObjectByJson_ClsSc_ProcessSendWorkMain(msg2); - foreach (Model.ClsSc_ProcessSendWorkMain oItem in lsmain) - { - //oItem.HMaker = ""; - UserName = oItem.HMaker; //鍒跺崟浜� - oItem.HBillType = "3712"; - oItem.HBillSubType = "3712"; - oItem.HBillStatus = 1; - DBUtility.ClsPub.CurUserName = UserName; - oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); +// string UserName = ""; +// ListModels oListModels = new ListModels(); +// try +// { +// DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); +// List<Model.ClsSc_ProcessSendWorkMain> lsmain = new List<Model.ClsSc_ProcessSendWorkMain>(); +// msg2 = msg2.Replace("\\", ""); +// msg2 = msg2.Replace("\n", ""); //\n +// lsmain = oListModels.getObjectByJson_ClsSc_ProcessSendWorkMain(msg2); +// foreach (Model.ClsSc_ProcessSendWorkMain oItem in lsmain) +// { +// //oItem.HMaker = ""; +// UserName = oItem.HMaker; //鍒跺崟浜� +// oItem.HBillType = "3712"; +// oItem.HBillSubType = "3712"; +// oItem.HBillStatus = 1; +// DBUtility.ClsPub.CurUserName = UserName; +// oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); - if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; - objJsonResult.data = 1; - return objJsonResult; - } - oBill.omodel = oItem; - } - //琛ㄤ綋鏁版嵁 - //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� - msg3 = msg3.Substring(1, msg3.Length - 2); - msg3 = msg3.Replace("\\", ""); - msg3 = msg3.Replace("\n", ""); //\n - //msg2 = msg2.Replace("'", "鈥�"); - List<Model.ClsSc_ProcessSendWorkSub> ls = new List<Model.ClsSc_ProcessSendWorkSub>(); - ls = oListModels.getObjectByJson_ClsSc_ProcessSendWorkSub(msg3); - int i = 0; - foreach (Model.ClsSc_ProcessSendWorkSub oItemSub in ls) - { +// if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; +// objJsonResult.data = 1; +// return objJsonResult; +// } +// oBill.omodel = oItem; +// } +// //琛ㄤ綋鏁版嵁 +// //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� +// msg3 = msg3.Substring(1, msg3.Length - 2); +// msg3 = msg3.Replace("\\", ""); +// msg3 = msg3.Replace("\n", ""); //\n +// //msg2 = msg2.Replace("'", "鈥�"); +// List<Model.ClsSc_ProcessSendWorkSub> ls = new List<Model.ClsSc_ProcessSendWorkSub>(); +// ls = oListModels.getObjectByJson_ClsSc_ProcessSendWorkSub(msg3); +// int i = 0; +// foreach (Model.ClsSc_ProcessSendWorkSub oItemSub in ls) +// { - i++; - oItemSub.HEntryID = i; - //oItemSub.HCloseMan = ""; //琛屽叧闂� - oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); - oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 - //oItemSub.HRemark = ""; //澶囨敞 - oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� - oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� - //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 - //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 - oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 - //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 - //HMaterID = "";//閰嶄欢浠g爜 - //HUnitID = "";//鍗曚綅浠g爜 - //HQty = "";//瀹為檯鐢ㄩ噺 - //HQtyMust = "";//鍗曚綅鐢ㄩ噺 - //HRemark = "";//澶囨敞 +// i++; +// oItemSub.HEntryID = i; +// //oItemSub.HCloseMan = ""; //琛屽叧闂� +// oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); +// oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 +// //oItemSub.HRemark = ""; //澶囨敞 +// oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� +// oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� +// //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 +// //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 +// oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 +// //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 +// //HMaterID = "";//閰嶄欢浠g爜 +// //HUnitID = "";//鍗曚綅浠g爜 +// //HQty = "";//瀹為檯鐢ㄩ噺 +// //HQtyMust = "";//鍗曚綅鐢ㄩ噺 +// //HRemark = "";//澶囨敞 - oBill.DetailColl.Add(oItemSub); +// oBill.DetailColl.Add(oItemSub); - } - //淇濆瓨 - //淇濆瓨瀹屾瘯鍚庡鐞� - bool bResult; - if (oBill.omodel.HInterID == 0) - { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); - bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); - } - else - { - bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); - } - if (bResult) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - objJsonResult.data = 1; - return objJsonResult; - } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = 1; - return objJsonResult; - } - } - catch (Exception e) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); - objJsonResult.data = 1; - return objJsonResult; - } - } - #endregion +// } +// //淇濆瓨 +// //淇濆瓨瀹屾瘯鍚庡鐞� +// bool bResult; +// if (oBill.omodel.HInterID == 0) +// { +// // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); +// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); +// } +// else +// { +// bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); +// } +// if (bResult) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 1; +// objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; +// objJsonResult.data = 1; +// return objJsonResult; +// } +// else +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; +// objJsonResult.data = 1; +// return objJsonResult; +// } +// } +// catch (Exception e) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); +// objJsonResult.data = 1; +// return objJsonResult; +// } +// } +// #endregion - #region 宸ュ簭娲惧伐鍗� 鍒犻櫎 - /// <summary> - /// 宸ュ簭娲惧伐鍗曞垹闄� - /// </summary> - /// <returns></returns> - [Route("Sc_ProcessSendWork/DelProcessSendWork")] - [HttpGet] - public object DelProcessSendWork(string HInterID, string user) - { - Int64 lngBillKey = 0; - lngBillKey = DBUtility.ClsPub.isLong(HInterID); - if (lngBillKey == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); - if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) - { - ds = oCN.RunProcReturn("select * from Sc_ProcessSendWorkMain where HInterID=" + lngBillKey, "Sc_ProcessSendWorkMain"); - if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; - objJsonResult.data = null; - return objJsonResult; - } +// #region 宸ュ簭娲惧伐鍗� 鍒犻櫎 +// /// <summary> +// /// 宸ュ簭娲惧伐鍗曞垹闄� +// /// </summary> +// /// <returns></returns> +// [Route("Sc_ProcessSendWork/DelProcessSendWork")] +// [HttpGet] +// public object DelProcessSendWork(string HInterID, string user) +// { +// Int64 lngBillKey = 0; +// lngBillKey = DBUtility.ClsPub.isLong(HInterID); +// if (lngBillKey == 0) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; +// objJsonResult.data = null; +// return objJsonResult; +// } +// DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); +// if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) +// { +// ds = oCN.RunProcReturn("select * from Sc_ProcessSendWorkMain where HInterID=" + lngBillKey, "Sc_ProcessSendWorkMain"); +// if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; +// objJsonResult.data = null; +// return objJsonResult; +// } - if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; - objJsonResult.data = null; - return objJsonResult; - } +// if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; +// objJsonResult.data = null; +// return objJsonResult; +// } - bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); - if (IsDete) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - else - { +// bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); +// if (IsDete) +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 1; +// objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; +// objJsonResult.data = null; +// return objJsonResult; +// } +// else +// { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; - objJsonResult.data = null; - return objJsonResult; - } - } - #endregion - } -} \ No newline at end of file +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; +// objJsonResult.data = null; +// return objJsonResult; +// } +// } +// else +// { +// objJsonResult.code = "0"; +// objJsonResult.count = 0; +// objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; +// objJsonResult.data = null; +// return objJsonResult; +// } +// } +// #endregion +// } +//} \ No newline at end of file -- Gitblit v1.9.1