From e438bae1bc3ded46d1939dd8918e9dbc0f10a8b4 Mon Sep 17 00:00:00 2001 From: zgq <519541279@qq.com> Date: 星期二, 15 六月 2021 16:56:23 +0800 Subject: [PATCH] nothing --- WebAPI/Controllers/BaseSet/Gy_MaintenanceItemController.cs | 437 + WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user | 326 + WebAPI/Models/ClsSb_EquipRepairWorkBillMain.cs | 28 WebAPI/Models/ClsSb_EquipRepairWorkBillSub.cs | 20 WebAPI/WebAPI.csproj.user | 6 WebAPI/Models/MaintenanceMode.cs | 26 WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs | 323 + WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs | 296 + WebAPI/Models/CheckItem.cs | 30 WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs | 1010 ++++ WebAPI/DLL/ClsSc_MouldScrapOutBill.cs | 419 + WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs | 75 WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs | 286 + WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs | 323 + WebAPI/DLL/ClsSb_EquipConkBookBill.cs | 219 WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs | 219 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml | 7 WebAPI/Models/基础资料/Warehouse.cs | 33 WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs | 75 WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs | 333 + WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs | 323 + WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs | 323 + WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 139 WebAPI/Controllers/BaseSet/Gy_GroupController.cs | 354 + WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs | 262 + WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs | 75 WebAPI/DLL/ClsSc_MouldProdBackBill.cs | 315 + WebAPI/Models/MaintenanceAcceptItem.cs | 26 WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs | 440 + WebAPI/Controllers/PublicPageMethodController.cs | 1275 +++++ WebAPI/Controllers/BaseSet/Gy_QCCheckClassController.cs | 425 + /dev/null | 17 WebAPI/Models/Gy_Group.cs | 27 WebAPI/ListModels.cs | 324 + WebAPI/DLL/ClsSc_MouldProdOutBill.cs | 390 + WebAPI/DLL/ClsSc_MouldScrapInBill.cs | 413 + WebAPI/Models/Gy_WorkCenter.cs | 29 WebAPI/Controllers/BaseSet/Gy_MaintenanceModeController.cs | 476 ++ WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs | 1716 +++++++ WebAPI/Controllers/BaseSet/Gy_MaintenanceAcceptItemController.cs | 471 ++ WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs | 300 + WebAPI/Properties/PublishProfiles/API.pubxml.user | 136 WebAPI/DLL/ClsSc_ICMOReportBill.cs | 673 ++ WebAPI/WebAPI.csproj | 33 WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs | 195 45 files changed, 13,488 insertions(+), 160 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs b/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs new file mode 100644 index 0000000..d8d44cf --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs @@ -0,0 +1,440 @@ +锘縰sing DBUtility; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers.BaseSet +{ + public class Gy_CheckItemController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + #region 妫�楠岄」鐩垪琛ㄦ暟鎹� + /// <summary> + /// 杩斿洖妫�楠岄」鐩垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_IF_QCCheckItemList " + sWhere, "h_v_IF_QCCheckItemList"); + } + else + { + string sql1 = "select * from h_v_IF_QCCheckItemList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_QCCheckItemList"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩牴鎹爲鍨婭D鏌ヨ鎵�鏈夊眰绾у垪琛ㄦ暟鎹� + /// <summary> + /// 鏍规嵁鏍戝瀷ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList"); + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_QCCheckItemList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_QCCheckItemList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_IF_QCCheckItemList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍒犻櫎妫�楠岄」鐩� + /// <summary> + /// 妫�楠岄」鐩垪琛ㄥ垹闄ゆ寜閽� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_QCCheckItem_Ctl oDept = new DAL.ClsGy_QCCheckItem_Ctl(); + DAL.ClsGy_QCCheckItem_View oDeptHlp = new DAL.ClsGy_QCCheckItem_View(); + try + { + //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + // objJsonResult.data = null; + // return objJsonResult; + //} + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } + #endregion + + #region 妫�楠岄」鐩柊澧炰繚瀛� + /// <summary> + /// 妫�楠岄」鐩�-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_QCCheckItem_Ctl oDept = new DAL.ClsGy_QCCheckItem_Ctl(); + DAL.ClsGy_QCCheckItem_View oDeptHlp = new DAL.ClsGy_QCCheckItem_View(); + + + + List<CheckItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<CheckItem>>(msg1); + + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID; + long HLevel= list[0].HLevel; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + bool HStopflag = list[0].HStopflag; + bool HUseFlag = list[0].HUseFlag; + long HQCCheckClassID = list[0].HQCCheckClassID; + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_QCCheckItem " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HQCCheckClassID) " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" + + ",'"+ HLevel + "','0','" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','鏈娇鐢�','"+ HQCCheckClassID + "')"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_QCCheckItem set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩慨鏀逛繚瀛� + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_QCCheckItem_Ctl oDept = new DAL.ClsGy_QCCheckItem_Ctl(); + DAL.ClsGy_QCCheckItem_View oDeptHlp = new DAL.ClsGy_QCCheckItem_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<CheckItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<CheckItem>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + long HQCCheckClassID = list[0].HQCCheckClassID; + string HRemark = list[0].HRemark; + bool HStopflag = list[0].HStopflag; + bool HUseFlag = list[0].HUseFlag; + + + //鍒ゆ柇鏉冮檺 + //if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_QCCheckItem set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HQCCheckClassID='" + HQCCheckClassID + "'" + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_QCCheckItem set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩慨鏀硅幏鍙栫粦瀹氭暟鎹� + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_CheckItem/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_QCCheckItem where HItemID=" + HInterID, "Gy_QCCheckItem"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + 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_CheckItem/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("select * from h_v_Gy_QCCheckItemLoadTree", "h_v_Gy_QCCheckItemLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + } +} diff --git a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs index bb916f3..197e03e 100644 --- a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs @@ -20,7 +20,7 @@ /// <summary> - /// 杩斿洖鐝粍鍒楄〃 + /// 杩斿洖宸ヤ綔涓績鍒楄〃 ///鍙傛暟锛歴tring sql銆� ///杩斿洖鍊硷細object銆� /// </summary> @@ -32,13 +32,13 @@ { if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + ds = oCN.RunProcReturn("select * from h_v_GroupList " + sWhere, "h_v_GroupList"); } else { - string sql1 = "select * from h_v_IF_GroupList where 1 = 1 "; + string sql1 = "select * from h_v_GroupList where 1 = 1 "; string sql = sql1 + sWhere; - ds = oCN.RunProcReturn(sql, "h_v_IF_GroupList"); + ds = oCN.RunProcReturn(sql, "h_v_GroupList"); } if (ds == null || ds.Tables[0].Rows.Count == 0) { @@ -67,8 +67,352 @@ } } + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Group/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + ds = oCN.RunProcReturn("select * from h_v_GroupList where HitemID=" + HInterID, "h_v_GroupList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + [Route("Gy_Group/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + ds = oCN.RunProcReturn("select * from h_v_GroupLoadTree", "h_v_GroupLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } - // + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Group/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl(); + List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg1); + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag == "True" ? "1" : "0"; + string HUseFlag = list[0].HUseFlag; + var HEmpQty = list[0].HEmpQty; + var HBarCodeForBase = list[0].HBarCodeForBase; + var HDeptID = list[0].HDeptID; + var HDeptNumber = ""; + var HEndFlag = 0; + var HLevel = ""; + var HProcID = ""; + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + string sql = "Insert into Gy_Group " + + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HDeptNumber,HEmpQty" + + ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" + + ",HProcID) " + + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HItemID.ToString() + + ",'" + HDeptNumber + "'," + HEmpQty + + ",'" + HLevel.ToString() + "'," + HEndFlag + "," + HStopflag + + ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "','" + HProcID + "')"; + oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Group/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + try + { + DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl(); + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg2); + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + var HEmpQty = list[0].HEmpQty; + var HBarCodeForBase = list[0].HBarCodeForBase; + var HDeptID = list[0].HDeptID; + var HProcID = list[0].HProcID; + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_Group set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "'" + + ",HDeptID=" + HDeptID + + ",HEmpQty=" + HEmpQty + + ",HBarCodeForBase='" + HBarCodeForBase + "' " + + ", HProcID = '" + HProcID + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Group,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Group/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_Group where HItemID=" + HInterID, "Gy_Group"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 缁翠慨鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Group/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl(); + DAL.ClsGy_Group_View oDeptHlp = new DAL.ClsGy_Group_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } } } \ No newline at end of file diff --git a/WebAPI/Controllers/BaseSet/Gy_MaintenanceAcceptItemController.cs b/WebAPI/Controllers/BaseSet/Gy_MaintenanceAcceptItemController.cs new file mode 100644 index 0000000..3cbd624 --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_MaintenanceAcceptItemController.cs @@ -0,0 +1,471 @@ +锘縰sing DBUtility; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers.BaseSet +{ + public class Gy_MaintenanceAcceptItemController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖缁翠慨鏂瑰紡鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList " + sWhere, "h_v_IF_RepairCheckList"); + } + else + { + string sql1 = "select * from h_v_IF_RepairCheckList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_RepairCheckList"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList"); + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_RepairCheckList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_RepairCheckList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_IF_RepairCheckList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 缁翠慨鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_RepairCheck_Ctl oDept = new DAL.ClsGy_RepairCheck_Ctl(); + DAL.ClsGy_RepairCheck_View oDeptHlp = new DAL.ClsGy_RepairCheck_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } + + //[Route("Gy_Department/LoadTree")] + //[HttpGet] + //public object LoadTree_Json() + //{ + // DBUtility.Gy_BaseFun.LoadTree(tv, imageList1, this.Text, BillName); + //} + + + + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_RepairCheck_Ctl oDept = new DAL.ClsGy_RepairCheck_Ctl(); + DAL.ClsGy_RepairCheck_View oDeptHlp = new DAL.ClsGy_RepairCheck_View(); + + + + List<MaintenanceAcceptItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceAcceptItem>>(msg1); + + long HItemID = list[0].HItemID.ToString()==""?0: list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_RepairCheck " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark) " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','"+ HItemID + "'" + + ",'1',0,'" + HStopflag + "','" + HRemark + "')"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_RepairCheck set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_RepairCheck_Ctl oDept = new DAL.ClsGy_RepairCheck_Ctl(); + DAL.ClsGy_RepairCheck_View oDeptHlp = new DAL.ClsGy_RepairCheck_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<MaintenanceAcceptItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceAcceptItem>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID =list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_RepairCheck set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_RepairCheck set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_RepairCheck", "Gy_RepairCheck"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceAcceptItem/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_RepairCheck where HItemID=" + HInterID, "Gy_RepairCheck"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + [Route("Gy_MaintenanceAcceptItem/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("select * from h_v_RepairCheckLoadTree", "h_v_RepairCheckLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + + + } +} diff --git a/WebAPI/Controllers/BaseSet/Gy_MaintenanceItemController.cs b/WebAPI/Controllers/BaseSet/Gy_MaintenanceItemController.cs new file mode 100644 index 0000000..b6c240b --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_MaintenanceItemController.cs @@ -0,0 +1,437 @@ +锘縰sing DBUtility; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers.BaseSet +{ + public class Gy_MaintenanceItemController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + /// <summary> + /// 杩斿洖缁翠慨鏂瑰紡鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select HParentID ParentID, * from Gy_Repair" + sWhere, "Gy_Repair"); + } + else + { + string sql1 = "select HParentID ParentID,* from Gy_Repair where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_Repair"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + ds = oCN.RunProcReturn("select * from Gy_Repair where HitemID=" + HInterID, "Gy_Repair"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 缁翠慨鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_Repair_Ctl oDept = new DAL.ClsGy_Repair_Ctl(); + DAL.ClsGy_Repair_View oDeptHlp = new DAL.ClsGy_Repair_View(); + + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_Repair_Ctl oDept = new DAL.ClsGy_Repair_Ctl(); + DAL.ClsGy_Repair_View oDeptHlp = new DAL.ClsGy_Repair_View(); + List<MaintenanceMode> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceMode>>(msg1); + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_Repair " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark) " + + " values('" + HNumber + "','"+ HName + "','"+ HHelpCode + "','" + HShortNumber + "','"+ HItemID + "'" + + ",'1',0,'" + HStopflag + "','"+ HRemark + "')"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_Repair set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_Repair_Ctl oDept = new DAL.ClsGy_Repair_Ctl(); + DAL.ClsGy_Repair_View oDeptHlp = new DAL.ClsGy_Repair_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<MaintenanceMode> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceMode>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_Repair set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "'" + + ",HHelpCode= '" + HHelpCode + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_Repair set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_Repair", "Gy_Repair"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceItem/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_Repair where HItemID=" + HInterID, "Gy_Repair"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + [Route("Gy_MaintenanceItem/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("select * from h_v_RepairLoadTree", "h_v_RepairLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + } +} diff --git a/WebAPI/Controllers/BaseSet/Gy_MaintenanceModeController.cs b/WebAPI/Controllers/BaseSet/Gy_MaintenanceModeController.cs new file mode 100644 index 0000000..6c2baa4 --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_MaintenanceModeController.cs @@ -0,0 +1,476 @@ +锘縰sing DBUtility; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers.BaseSet +{ + public class Gy_MaintenanceModeController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + #region 缁翠慨鏂瑰紡 + + #region 缁翠慨鏂瑰紡鍔犺浇鍒楄〃 + /// <summary> + /// 杩斿洖缁翠慨鏂瑰紡鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_IF_RepairTypeList " + sWhere, "h_v_IF_RepairTypeList"); + } + else + { + string sql1 = "select * from h_v_IF_RepairTypeList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_RepairTypeList"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 缁翠慨鏂瑰紡鏍规嵁鏍戝瀷id鏌ヨ鍒楄〃 + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_RepairTypeList WHERE HitemID="+ HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_RepairTypeList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_IF_RepairTypeList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 缁翠慨鏂瑰紡鍒犻櫎 + /// <summary> + /// 缁翠慨鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_RepairType_Ctl oDept = new DAL.ClsGy_RepairType_Ctl(); + DAL.ClsGy_RepairType_View oDeptHlp = new DAL.ClsGy_RepairType_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } + #endregion + + #region 缁翠慨鏂瑰紡鏂板淇濆瓨 + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_Department_Ctl oDept = new DAL.ClsGy_Department_Ctl(); + DAL.ClsGy_Department_View oDeptHlp = new DAL.ClsGy_Department_View(); + + + + List<MaintenanceMode> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceMode>>(msg1); + + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_RepairType " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark) " + + " values('" + HNumber + "','"+ HName + "','"+ HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" + + ",'1',0,'" + HStopflag + "','"+ HRemark + "')"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_RepairType set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 缁翠慨鏂瑰紡淇敼淇濆瓨 + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_RepairType_Ctl oDept = new DAL.ClsGy_RepairType_Ctl(); + DAL.ClsGy_RepairType_View oDeptHlp = new DAL.ClsGy_RepairType_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<MaintenanceMode> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceMode>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_RepairType set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairType,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_RepairType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_RepairType", "Gy_RepairType"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + #region 缁翠慨鏂瑰紡淇敼鑾峰彇閫変腑鏁版嵁 + + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_MaintenanceMode/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_RepairType where HItemID=" + HInterID, "Gy_RepairType"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("select * from h_v_RepairTypeLoadTree", "h_v_RepairTypeLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + + // + } +} diff --git a/WebAPI/Controllers/BaseSet/Gy_QCCheckClassController.cs b/WebAPI/Controllers/BaseSet/Gy_QCCheckClassController.cs new file mode 100644 index 0000000..16dc3b3 --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_QCCheckClassController.cs @@ -0,0 +1,425 @@ +锘縰sing DBUtility; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers.BaseSet +{ + public class Gy_QCCheckClassController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + #region 妫�楠岄」鐩垪琛ㄦ暟鎹� + /// <summary> + /// 杩斿洖妫�楠岄」鐩垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_IF_QCCheckClassList " + sWhere, "h_v_IF_QCCheckClassList"); + } + else + { + string sql1 = "select * from h_v_IF_QCCheckClassList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_QCCheckClassList"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩牴鎹爲鍨婭D鏌ヨ鎵�鏈夊眰绾у垪琛ㄦ暟鎹� + /// <summary> + /// 鏍规嵁鏍戝瀷ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList"); + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_QCCheckClassList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_QCCheckClassList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_IF_QCCheckClassList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍒犻櫎妫�楠岄」鐩� + /// <summary> + /// 妫�楠岄」鐩垪琛ㄥ垹闄ゆ寜閽� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_QCCheckClass_Ctl oDept = new DAL.ClsGy_QCCheckClass_Ctl(); + DAL.ClsGy_QCCheckClass_View oDeptHlp = new DAL.ClsGy_QCCheckClass_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } + #endregion + + #region 妫�楠岄」鐩柊澧炰繚瀛� + /// <summary> + /// 妫�楠岄」鐩�-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_QCCheckClass_Ctl oDept = new DAL.ClsGy_QCCheckClass_Ctl(); + DAL.ClsGy_QCCheckClass_View oDeptHlp = new DAL.ClsGy_QCCheckClass_View(); + + + + List<CheckItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<CheckItem>>(msg1); + + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + bool HStopflag = list[0].HStopflag; + bool HUseFlag = list[0].HUseFlag; + long HQCCheckClassID = list[0].HQCCheckClassID; + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_QCCheckClass " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag) " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" + + ",'1',0,'" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','0')"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_QCCheckClass set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩慨鏀逛繚瀛� + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_QCCheckClass_Ctl oDept = new DAL.ClsGy_QCCheckClass_Ctl(); + DAL.ClsGy_QCCheckClass_View oDeptHlp = new DAL.ClsGy_QCCheckClass_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<MaintenanceAcceptItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MaintenanceAcceptItem>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_QCCheckClass set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_QCCheckClass set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 妫�楠岄」鐩慨鏀硅幏鍙栫粦瀹氭暟鎹� + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_QCCheckClass/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_QCCheckClass where HItemID=" + HInterID, "Gy_QCCheckClass"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + 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_QCCheckClass/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("select * from h_v_Gy_QCCheckClassLoadTree", "h_v_Gy_QCCheckClassLoadTree"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + #endregion + } +} diff --git a/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs b/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs index e31af79..11a8ed9 100644 --- a/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs @@ -142,5 +142,200 @@ } // + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Warehouse/AddNew")] + [HttpPost] + public object AddNew([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); + DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); + List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(msg1); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HHelpCode = list[0].HHelpCode; + string HShortNumber = list[0].HShortNumber; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + bool HEndFlag = list[0].HEndFlag; + bool HStopflag = list[0].HStopflag; + string HRemark = list[0].HRemark; + string HBarCode = list[0].HBarCode; + long HEmpID = list[0].HEmpID; + string HAddress = list[0].HAddress; + string HPhone = list[0].HPhone; + long HUSEORGID = list[0].HUSEORGID; + string HMaker = list[0].HMaker; + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_Warehouse " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopFlag,HRemark,HBarCode" + + ",HEmpID,HAddress,HPhone,HUSEORGID,HMaker" + + ") " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + + "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + HBarCode + "'" + + "," + HEmpID.ToString() + ",'" + HAddress + "','" + HPhone + "'," + HUSEORGID.ToString() + ",'" + HMaker + "'" + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.RunProc("Update Gy_Warehouse set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Warehouse/ModifyByID")] + [HttpPost] + public object ModifyByID([FromBody] JObject oMain) + { + try + { + DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); + DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); + + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(msg2); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HHelpCode = list[0].HHelpCode; + string HShortNumber = list[0].HShortNumber; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + bool HEndFlag = list[0].HEndFlag; + bool HStopflag = list[0].HStopflag; + string HRemark = list[0].HRemark; + string HBarCode = list[0].HBarCode; + long HEmpID = list[0].HEmpID; + string HAddress = list[0].HAddress; + string HPhone = list[0].HPhone; + long HUSEORGID = list[0].HUSEORGID; + string HUpDater = list[0].HUpDater; + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_Warehouse set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HLevel=" + HLevel.ToString() + + ",HParentID=" + HParentID.ToString() + + ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + + ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + + ",HEmpID=" + HEmpID.ToString() + + ",HAddress='" + HAddress + "'" + + ",HPhone='" + HPhone + "'" + + ",HUpdater='" + HUpDater + "'" + + ",HUpdateDate= getdate()" + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_Warehouse set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + + + } } \ No newline at end of file diff --git a/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs b/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs index 10ab692..67d491b 100644 --- a/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Model; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -23,7 +24,7 @@ ///鍙傛暟锛歴tring sql銆� ///杩斿洖鍊硷細object銆� /// </summary> - [Route("Gy_WorkCenter/list1")] + [Route("Gy_WorkCenter/list")] [HttpGet] public object list(string sWhere) { @@ -31,13 +32,13 @@ { if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select * from h_v_Gy_WorkCenterList " + sWhere, "h_v_Gy_WorkCenterList"); + ds = oCN.RunProcReturn("select * from h_v_WorkCenterList " + sWhere, "h_v_WorkCenterList"); } else { - string sql1 = "select * from h_v_Gy_WorkCenterList where 1 = 1 "; + string sql1 = "select * from h_v_WorkCenterList where 1 = 1 "; string sql = sql1 + sWhere; - ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkCenterList"); + ds = oCN.RunProcReturn(sql, "h_v_WorkCenterList"); } if (ds == null || ds.Tables[0].Rows.Count == 0) { @@ -66,6 +67,45 @@ } } + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_WorkCenter/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + + ds = oCN.RunProcReturn("select * from h_v_WorkCenterList where HitemID=" + HInterID, "h_v_WorkCenterList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } [Route("Gy_WorkCenter/LoadTree")] [HttpGet] @@ -93,8 +133,289 @@ } + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_WorkCenter/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); + List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1); + long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + long HParentID = list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag=="True"?"1":"0"; + string HUseFlag = list[0].HUseFlag; + var HWorkTimes = list[0].HWorkTimes; + var HQty = list[0].HQty; + var HBarCodeForBase = list[0].HBarCodeForBase; + var HDayMoney = list[0].HDayMoney; + var HDeptID = list[0].HDeptID; + var HDeptNumber = ""; + var HEndFlag = 0; + var HLevel = ""; + var HProcID = ""; + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + string sql = "Insert into Gy_WorkCenter " + + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HDeptNumber,HWorkTimes,HQty" + + ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" + + ",HProcID,HDayMoney) " + + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HItemID.ToString() + + ",'" + HDeptNumber + "'," + HWorkTimes + "," + HQty + + ",'" + HLevel.ToString() + "'," + HEndFlag + "," + HStopflag + + ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "','" + HProcID + "'," + HDayMoney + ")"; + oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + if (list[0].HItemID.ToString() != "") + { + oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_WorkCenter/EditBill")] + [HttpPost] + public object EditBill([FromBody] JObject oMain) + { + try + { + DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); + var _value = oMain["oMain"].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 msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg2); + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HNumber; + long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; + string HHelpCode = list[0].HHelpCode; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopflag; + string HUseFlag = list[0].HUseFlag; + var HQty = list[0].HQty; + var HBarCodeForBase = list[0].HBarCodeForBase; + var HDayMoney = list[0].HDayMoney; + var HDeptID = list[0].HDeptID; + var HWorkTimes = list[0].HWorkTimes; + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_WorkCenter set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HHelpCode='" + HHelpCode + "'" + + ",HParentID=" + HParentID + + ",HStopflag='" + HStopflag + "'" + + ",HRemark= '" + HRemark + "'"+ + ",HDeptID=" + HDeptID + + ",HQty=" + HQty + + ",HWorkTimes=" + HWorkTimes + + ",HBarCodeForBase='" + HBarCodeForBase + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> + /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_WorkCenter/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_WorkCenter where HItemID=" + HInterID, "Gy_WorkCenter"); - // + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 缁翠慨鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_WorkCenter/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); + DAL.ClsGy_WorkCenter_View oDeptHlp = new DAL.ClsGy_WorkCenter_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + 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; + } + } } } \ No newline at end of file diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 024517d..c247d35 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; +using System.Web; using System.Web.Http; using WebAPI.Models; @@ -312,7 +314,7 @@ return objJsonResult; } //涓昏〃 - + ds = oCN.RunProcReturn("exec h_p_MES_StationOutBill_QtyCtrl " + HInterID + "", "h_p_MES_StationOutBill_QtyCtrl"); if (ds == null) { @@ -350,10 +352,10 @@ " Where a.HInterID=" + HProcExchInterID + " and b.HEntryID=" + HProcExchEntryID + " ", "Sc_ProcessExchangeBillMain"); if (ds1 == null || ds1.Tables[0].Rows.Count == 0 || HLastSubProc == false) { - + } else if (ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HLastProc"]) == "鏄�") - { + { } oCN.Commit(); @@ -472,5 +474,136 @@ // + + + [Route("Cj_StationOutBill/UploadFile")] + [HttpPost] + public object UploadFile() + { + try + { + int num = 0; + string HBillNo = HttpContext.Current.Request.Params["HBillNo"]; //鍗曟嵁鍙� + string HRemark = HttpContext.Current.Request.Params["HRemark"]; //澶囨敞 + string HUserName = HttpContext.Current.Request.Params["HUserName"]; //鍗曟嵁鍙� + string uploadPath = HttpContext.Current.Server.MapPath("~/App_Data/"); + HttpRequest request = System.Web.HttpContext.Current.Request; + HttpFileCollection files = request.Files; + + string savePath = ""; + if (files == null || files.Count <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏂囦欢涓嶈兘涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + for (int i = 0; i < files.Count; i++) + { + + // 鑾峰彇鏂囦欢 + HttpPostedFile httpPostedFile = files[i]; + + string filePath = Path.GetFullPath(httpPostedFile.FileName);//鏂囦欢涓婁紶璺緞 + string fileExtension = Path.GetExtension(httpPostedFile.FileName);// 鏂囦欢鎵╁睍鍚� + string filename = httpPostedFile.FileName; + string fileSavePath = uploadPath;// 涓婁紶淇濆瓨璺緞 + int filesize = files[i].ContentLength;//鑾峰彇涓婁紶鏂囦欢鐨勫ぇ灏忓崟浣嶄负瀛楄妭byte + int Maxsize = 40000 * 1024;//瀹氫箟涓婁紶鏂囦欢鐨勬渶澶х┖闂村ぇ灏忎负40M + if (filesize >= Maxsize) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "涓婁紶鏂囦欢瓒呰繃40M锛屼笉鑳戒笂浼狅紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (Directory.Exists(fileSavePath) == false)//濡傛灉涓嶅瓨鍦ㄥ氨鍒涘缓file鏂囦欢澶� + { + Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶� + } + savePath = Path.Combine(fileSavePath, filename); + //鏌ヨ鏂囦欢鍏宠仈琛�,鏄惁宸插瓨鍦ㄤ笂浼犳暟鎹� + ds = oCN.RunProcReturn("select * from MES_AccessoriesList where HSourceBillNo = " + HBillNo, "MES_AccessoriesList"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + //鍐欏叆鏈嶅姟鍣ㄦ枃浠� + httpPostedFile.SaveAs(savePath); + //鍐欏叆鏁版嵁琛� + oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" + + ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" + + ",HFileClsID,HSourceBillNo" + + ") values('" + + filename.ToString() + "','" + savePath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString()+ "'" + + ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize + + "','" + 0 + "','" + HBillNo + + "') "); + } + else + { + //鍒犻櫎鏈嶅姟鍣ㄦ枃浠� + FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(savePath)); + file.Delete(); + //鍒犻櫎鏁版嵁琛ㄦ暟鎹� + ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo = " + HBillNo, "MES_AccessoriesList"); + + //鍐欏叆鏈嶅姟鍣ㄦ枃浠� + httpPostedFile.SaveAs(savePath); + //鍐欏叆鏁版嵁琛� + //鍐欏叆鏁版嵁琛� + oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" + + ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" + + ",HFileClsID,HSourceBillNo" + + ") values('" + + filename.ToString() + "','" + savePath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" + + ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize + + "','" + 0 + "','" + HBillNo + + "') "); + } + //if (Directory.Exists(savePath) == true) //濡傛灉瀛樺湪閲嶅悕鏂囦欢灏辨彁绀� + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "瀛樺湪鍚屽悕鏂囦欢锛�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + httpPostedFile.SaveAs(savePath); + string StrPath = "/File/" + filename; + //鍐欏叆鏁版嵁琛� + + num = num + 1; + } + if (num == files.Count) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "涓婁紶鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "涓婁紶澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.Message; + objJsonResult.data = null; + return objJsonResult; + } + + } } } \ No newline at end of file diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs new file mode 100644 index 0000000..86bc81c --- /dev/null +++ b/WebAPI/Controllers/PublicPageMethodController.cs @@ -0,0 +1,1275 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers +{ + public class PublicPageMethodController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + #region 閫夋嫨寰�鏉ュ崟浣嶅熀纭�璧勬枡 + + #region 鏉′欢鏌ヨ寰�鏉ュ崟浣嶅垪琛� + [Route("PublicPageMethod/CustomerList")] + [HttpGet] + public object CustomerList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer where HStopflag=0 Order by HItemID ", "h_v_IF_Customer"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Emp"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘寰�鏉ュ崟浣嶅垪琛� + [Route("Gy_MaintenanceMode/CustomerCX")] + [HttpGet] + public object CustomerCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Customer WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Customer AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Customer"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/CustomerLoadTree")] + [HttpGet] + public object CustomerLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Customer", "h_v_IF_Customer"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨鐢ㄦ埛鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鐢ㄦ埛鍒楄〃 + [Route("PublicPageMethod/UserList")] + [HttpGet] + public object UserList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp where HStopflag=0 Order by HItemID ", "h_v_IF_Emp"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Emp"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘鐢ㄦ埛鍒楄〃 + [Route("Gy_MaintenanceMode/UserCX")] + [HttpGet] + public object UserCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Emp WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Emp AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Emp"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/UserLoadTree")] + [HttpGet] + public object UserLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Emp", "h_v_IF_Emp"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨浠撳簱鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ浠撳簱鍒楄〃 + [Route("PublicPageMethod/WareHouseList")] + [HttpGet] + public object WareHouseList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse where HStopflag=0 Order by HItemID ", "h_v_IF_Warehouse"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Warehouse"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘浠撳簱鍒楄〃 + [Route("Gy_MaintenanceMode/WareHouseCX")] + [HttpGet] + public object WareHouseCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Warehouse WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Warehouse AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Warehouse"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/WareHouseLoadTree")] + [HttpGet] + public object WareHouseLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Warehouse", "h_v_IF_Warehouse"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨閮ㄩ棬鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ閮ㄩ棬鍒楄〃 + [Route("PublicPageMethod/DeptList")] + [HttpGet] + public object DeptList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Department where HStopflag=0 Order by HItemID ", "h_v_IF_Department"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Department where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Department"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘閮ㄩ棬鍒楄〃 + [Route("Gy_MaintenanceMode/DeptCX")] + [HttpGet] + public object DeptCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Department WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Department AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Department"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/DeptLoadTree")] + [HttpGet] + public object DeptLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Department", "h_v_IF_Department"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨鎴愬搧妯″叿鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鎴愬搧妯″叿鍒楄〃 + [Route("PublicPageMethod/MouldList")] + [HttpGet] + public object MouldList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould Order by HNumber", "h_v_IF_Department"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Gy_Mould"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘鎴愬搧妯″叿鍒楄〃 + [Route("Gy_MaintenanceMode/MouldCX")] + [HttpGet] + public object MouldCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_Mould WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_Mould AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_Mould"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/MouldLoadTree")] + [HttpGet] + public object MouldLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID from h_v_Gy_Mould", "h_v_Gy_Mould"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨缁翠慨椤圭洰鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ缁翠慨椤圭洰鍒楄〃 + [Route("PublicPageMethod/RepairItemList")] + [HttpGet] + public object RepairItemList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Repair where HStopflag=0 Order by HItemID", "Gy_Repair"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Repair where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_Repair"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘缁翠慨椤圭洰鍒楄〃 + [Route("Gy_MaintenanceMode/RepairItemCX")] + [HttpGet] + public object RepairItemCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Repair WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Repair AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Repair"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/RepairItemLoadTree")] + [HttpGet] + public object RepairItemLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_Repair", "Gy_Repair"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨渚涘簲鍟嗗熀纭�璧勬枡 + + #region 鏉′欢鏌ヨ渚涘簲鍟嗗垪琛� + [Route("PublicPageMethod/SupplierList")] + [HttpGet] + public object SupplierList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Supplier where HStopflag=0 Order by HItemID", "Gy_Supplier"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Supplier where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_Supplier"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘渚涘簲鍟嗗垪琛� + [Route("Gy_MaintenanceMode/SupplierCX")] + [HttpGet] + public object SupplierCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Supplier WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Supplier AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Supplier"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/SupplierLoadTree")] + [HttpGet] + public object SupplierLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_Supplier", "Gy_Supplier"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨鏁呴殰绫诲瀷鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鏁呴殰绫诲瀷鍒楄〃 + [Route("PublicPageMethod/FaultTypeList")] + [HttpGet] + public object FaultTypeList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ConkType where HStopflag=0 Order by HItemID", "Gy_ConkType"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_ConkType where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_ConkType"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘鏁呴殰绫诲瀷鍒楄〃 + [Route("Gy_MaintenanceMode/FaultTypeCX")] + [HttpGet] + public object FaultTypeCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_ConkType WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_ConkType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ConkType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/FaultTypeLoadTree")] + [HttpGet] + public object FaultTypeLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_ConkType", "Gy_ConkType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨璁惧鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ璁惧鍒楄〃 + [Route("PublicPageMethod/EqpList")] + [HttpGet] + public object EqpList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where HStopflag=0 Order by HItemID", "Gy_EquipMent"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_EquipMent"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘璁惧鍒楄〃 + [Route("Gy_MaintenanceMode/EqpCX")] + [HttpGet] + public object EqpCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_EquipMent WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_EquipMent AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_EquipMent"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/EqpLoadTree")] + [HttpGet] + public object EqpLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_EquipMent", "Gy_EquipMent"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨妫�楠岄」鐩被鍒熀纭�璧勬枡 + + #region 鏉′欢鏌ヨ璁惧鍒楄〃 + [Route("PublicPageMethod/CheckItemTypeList")] + [HttpGet] + public object CheckItemTypeList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_QCCheckClass where HStopflag=0 Order by HItemID", "Gy_QCCheckClass"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_QCCheckClass where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_QCCheckClass"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘璁惧鍒楄〃 + [Route("Gy_MaintenanceMode/CheckItemTypeCX")] + [HttpGet] + public object CheckItemTypeCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_QCCheckClass WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_QCCheckClass AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckClass"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/CheckItemTypeLoadTree")] + [HttpGet] + public object CheckItemTypeLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_QCCheckClass", "Gy_QCCheckClass"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨鐝粍鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鐝粍鍒楄〃 + [Route("PublicPageMethod/GroupList")] + [HttpGet] + public object GroupList(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Group where HStopflag=0 Order by HItemID", "h_v_IF_Group"); + } + else + { + string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Group where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_Group"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鏍规嵁鏍戝瀷id鏌ユ壘鐝粍鍒楄〃 + [Route("Gy_MaintenanceMode/GroupCX")] + [HttpGet] + public object GroupCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Group WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Group AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Group"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + 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_MaintenanceMode/GroupLoadTree")] + [HttpGet] + public object GroupLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Group", "h_v_IF_Group"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + } +} diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs new file mode 100644 index 0000000..cef54fb --- /dev/null +++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs @@ -0,0 +1,323 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.Http; +using WebAPI.Models; +namespace WebAPI.Controllers +{ + public class Sb_EquipDotCheckBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + + #region 璁惧鐐规璁板綍琛� + + /// <summary> + /// 璁惧鐐规璁板綍琛ㄥ垪琛� list鍒楄〃鏁版嵁鍔犺浇 + /// </summary> + /// <returns></returns> + [Route("Sb_EquipDotCheckBill/GetEquipDotCheckBillList")] + [HttpGet] + public object GetEquipDotCheckBillList(string sWhere) + { + try + { + ds = Sb_EquipDotCheckBillList_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #region sql璇彞 + + + public static DataSet Sb_EquipDotCheckBillList_s(string sWhere) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipDotCheckBillList ", "h_v_Sb_EquipDotCheckBillList"); + } + #endregion + + #region 璁惧鐐规璁板綍琛� 淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EquipDotCheckBill/SaveEquipDotCheckBillList")] + [HttpPost] + public object SaveEquipDotCheckBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsSb_EquipDotCheckBill oBill = new DAL.ClsSb_EquipDotCheckBill(); + List<Model.ClsSb_EquipDotCheckBillMain> lsmain = new List<Model.ClsSb_EquipDotCheckBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Sb_EquipDotCheckBillMain(msg2); + foreach (Model.ClsSb_EquipDotCheckBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3903"; + oItem.HBillSubType = "3903"; + + //oItem.HInterID =0; + //oItem.HBillNo = ""; + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //oItem.HMakeDate = ""; + //oItem.HYear = ""; + //oItem.HPeriod = ""; + //oItem.HRemark = ""; + //oItem.HCycleUnit = ""; + //oItem.HCheckCycle = ""; + //oItem.HBeginDate = ""; + //oItem.HEndDate = ""; + //oItem.HInnerBillNo = ""; + //oItem.HExplanation = ""; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipDotCheckBillSub> ls = new List<Model.ClsSb_EquipDotCheckBillSub>(); + ls = oListModels.getObjectByJson_Sb_EquipDotCheckBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipDotCheckBillSub 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 = "";//澶囨敞 + + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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("Sb_EquipDotCheckBill/DeltetEquipDotCheckBillList")] + [HttpGet] + public object DeltetEquipDotCheckBillList(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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.ClsSb_EquipDotCheckBill oBill = new DAL.ClsSb_EquipDotCheckBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #region[璁惧鐐规璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sb_EquipDotCheckBill/Sb_EquipDotCheckBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EquipDotCheckBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipDotCheckBillList where hmainid= " + HID + " ", "h_v_Sb_EquipDotCheckBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ偣妫�璁板綍琛�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + #region[璁惧鐐规璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁] + [Route("Sb_EquipDotCheckBill/Sb_EquipDotCheckBillListProjectDetai")] + [HttpGet] + public object Sb_EquipDotCheckBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckBillList", "h_v_Sb_EquipDotCheckBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + + + + + #endregion + + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs new file mode 100644 index 0000000..1733451 --- /dev/null +++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs @@ -0,0 +1,323 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.Http; +using WebAPI.Models; +namespace WebAPI.Controllers +{ + public class Sb_EquipDotCheckPlanBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + + #region 璁惧鐐规璁″垝琛� + + /// <summary> + /// 璁惧鐐规璁″垝琛ㄥ垪琛� list鍒楄〃鏁版嵁鍔犺浇 + /// </summary> + /// <returns></returns> + [Route("Sb_EquipDotCheckPlanBill/GetEquipDotCheckPlanBillList")] + [HttpGet] + public object GetEquipDotCheckPlanBillList(string sWhere) + { + try + { + ds = Sb_EquipDotCheckPlanBillList_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #region sql璇彞 + + + public static DataSet Sb_EquipDotCheckPlanBillList_s(string sWhere) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipDotCheckPlanBillList ", "h_v_Sb_EquipDotCheckPlanBillList"); + } + #endregion + + #region 璁惧鐐规璁″垝琛� 淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EquipDotCheckPlanBill/SaveEquipDotCheckPlanBillList")] + [HttpPost] + public object SaveEquipDotCheckPlanBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsSb_EquipDotCheckPlanBill oBill = new DAL.ClsSb_EquipDotCheckPlanBill(); + List<Model.ClsSb_EquipDotCheckPlanBillMain> lsmain = new List<Model.ClsSb_EquipDotCheckPlanBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Sb_EquipDotCheckPlanBillMain(msg2); + foreach (Model.ClsSb_EquipDotCheckPlanBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3904"; + oItem.HBillSubType = "3904"; + + //oItem.HInterID =0; + //oItem.HBillNo = ""; + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //oItem.HMakeDate = ""; + //oItem.HYear = ""; + //oItem.HPeriod = ""; + //oItem.HRemark = ""; + //oItem.HCycleUnit = ""; + //oItem.HCheckCycle = ""; + //oItem.HBeginDate = ""; + //oItem.HEndDate = ""; + //oItem.HInnerBillNo = ""; + //oItem.HExplanation = ""; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipDotCheckPlanBillSub> ls = new List<Model.ClsSb_EquipDotCheckPlanBillSub>(); + ls = oListModels.getObjectByJson_Sb_EquipDotCheckPlanBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipDotCheckPlanBillSub 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 = "";//澶囨敞 + + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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("Sb_EquipDotCheckPlanBill/DeltetEquipDotCheckPlanBillList")] + [HttpGet] + public object DeltetEquipDotCheckPlanBillList(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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.ClsSb_EquipDotCheckPlanBill oBill = new DAL.ClsSb_EquipDotCheckPlanBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EquipDotCheckPlanBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipDotCheckPlanBillList where hmainid= " + HID + " ", "h_v_Sb_EquipDotCheckPlanBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ偣妫�璁″垝琛�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁] + [Route("Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai")] + [HttpGet] + public object Sb_EquipDotCheckPlanBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit", "h_v_Sb_EquipDotCheckPlanBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + + + + + #endregion + + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs new file mode 100644 index 0000000..42da450 --- /dev/null +++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs @@ -0,0 +1,323 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.Http; +using WebAPI.Models; +namespace WebAPI.Controllers +{ + public class Sb_EquipMaintainBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + + #region 璁惧淇濆吇璁″垝琛� + + /// <summary> + /// 璁惧淇濆吇璁″垝琛ㄥ垪琛� list鍒楄〃鏁版嵁鍔犺浇 + /// </summary> + /// <returns></returns> + [Route("Sb_EquipMaintainBill/GetEquipMaintainBillList")] + [HttpGet] + public object GetEquipMaintainBillList(string sWhere) + { + try + { + ds = Sb_EquipMaintainBillList_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #region sql璇彞 + + + public static DataSet Sb_EquipMaintainBillList_s(string sWhere) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipMaintainBillList ", "h_v_Sb_EquipMaintainBillList"); + } + #endregion + + #region 璁惧淇濆吇璁″垝琛� 淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EquipMaintainBill/SaveEquipMaintainBillList")] + [HttpPost] + public object SaveEquipMaintainBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsSb_EquipMaintainBill oBill = new DAL.ClsSb_EquipMaintainBill(); + List<Model.ClsSb_EquipMaintainBillMain> lsmain = new List<Model.ClsSb_EquipMaintainBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Sb_EquipMaintainBillMain(msg2); + foreach (Model.ClsSb_EquipMaintainBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3901"; + oItem.HBillSubType = "3901"; + + //oItem.HInterID =0; + //oItem.HBillNo = ""; + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //oItem.HMakeDate = ""; + //oItem.HYear = ""; + //oItem.HPeriod = ""; + //oItem.HRemark = ""; + //oItem.HCycleUnit = ""; + //oItem.HCheckCycle = ""; + //oItem.HBeginDate = ""; + //oItem.HEndDate = ""; + //oItem.HInnerBillNo = ""; + //oItem.HExplanation = ""; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipMaintainBillSub> ls = new List<Model.ClsSb_EquipMaintainBillSub>(); + ls = oListModels.getObjectByJson_Sb_EquipMaintainBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipMaintainBillSub 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 = "";//澶囨敞 + + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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("Sb_EquipMaintainBill/DeltetEquipMaintainBillList")] + [HttpGet] + public object DeltetEquipMaintainBillList(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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.ClsSb_EquipMaintainBill oBill = new DAL.ClsSb_EquipMaintainBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sb_EquipMaintainBill/Sb_EquipMaintainBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EquipMaintainBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipMaintainBillList where hmainid= " + HID + " ", "h_v_Sb_EquipMaintainBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄨ澶囦繚鍏昏褰曡〃" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁] + [Route("Sb_EquipMaintainBill/Sb_EquipMaintainBillListProjectDetai")] + [HttpGet] + public object Sb_EquipMaintainBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select 瀹為檯鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipMaintainBillList", "h_v_Sb_EquipMaintainBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + string sql1 = "select 瀹為檯鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipMaintainBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + + + + + #endregion + + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs new file mode 100644 index 0000000..7c415bd --- /dev/null +++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs @@ -0,0 +1,323 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.Http; +using WebAPI.Models; +namespace WebAPI.Controllers +{ + public class Sb_EquipMaintainPlanBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + + #region 璁惧淇濆吇璁″垝琛� + + /// <summary> + /// 璁惧淇濆吇璁″垝琛ㄥ垪琛� list鍒楄〃鏁版嵁鍔犺浇 + /// </summary> + /// <returns></returns> + [Route("Sb_EquipMaintainPlanBill/GetEquipMaintainPlanBillList")] + [HttpGet] + public object GetEquipMaintainPlanBillList(string sWhere) + { + try + { + ds = Sb_EquipMaintainPlanBillList_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #region sql璇彞 + + + public static DataSet Sb_EquipMaintainPlanBillList_s(string sWhere) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipMaintainPlanBillList ", "h_v_Sb_EquipMaintainPlanBillList"); + } + #endregion + + #region 璁惧淇濆吇璁″垝琛� 淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EquipMaintainPlanBill/SaveEquipMaintainPlanBillList")] + [HttpPost] + public object SaveEquipMaintainPlanBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsSb_EquipMaintainPlanBill oBill = new DAL.ClsSb_EquipMaintainPlanBill(); + List<Model.ClsSb_EquipMaintainPlanBillMain> lsmain = new List<Model.ClsSb_EquipMaintainPlanBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillMain(msg2); + foreach (Model.ClsSb_EquipMaintainPlanBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3902"; + oItem.HBillSubType = "3902"; + + //oItem.HInterID =0; + //oItem.HBillNo = ""; + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //oItem.HMakeDate = ""; + //oItem.HYear = ""; + //oItem.HPeriod = ""; + //oItem.HRemark = ""; + //oItem.HCycleUnit = ""; + //oItem.HCheckCycle = ""; + //oItem.HBeginDate = ""; + //oItem.HEndDate = ""; + //oItem.HInnerBillNo = ""; + //oItem.HExplanation = ""; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipMaintainPlanBillSub> ls = new List<Model.ClsSb_EquipMaintainPlanBillSub>(); + ls = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipMaintainPlanBillSub 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 = "";//澶囨敞 + + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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("Sb_EquipMaintainPlanBill/DeltetEquipMaintainPlanBillList")] + [HttpGet] + public object DeltetEquipMaintainPlanBillList(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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.ClsSb_EquipMaintainPlanBill oBill = new DAL.ClsSb_EquipMaintainPlanBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EquipMaintainPlanBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipMaintainPlanBillList where hmainid= " + HID + " ", "h_v_Sb_EquipMaintainPlanBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ偣妫�璁″垝琛�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁] + [Route("Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetai")] + [HttpGet] + public object Sb_EquipMaintainPlanBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select 鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList", "h_v_Sb_EquipMaintainPlanBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + string sql1 = "select 鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainPlanBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + + + + + #endregion + + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs new file mode 100644 index 0000000..a048efc --- /dev/null +++ b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs @@ -0,0 +1,75 @@ +锘縰sing 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 +{ + //鐢熶骇寮�宸ュ崟Controller + public class Sc_MESBeginWorkBillController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖鐢熶骇寮�宸ュ崟鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_MESBeginWorkBill/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_MESBeginWorkBillList " + sWhere, "h_v_Sc_MESBeginWorkBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MESBeginWorkBillList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MESBeginWorkBillList"); + } + 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 = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + // + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs new file mode 100644 index 0000000..b738b27 --- /dev/null +++ b/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs @@ -0,0 +1,75 @@ +锘縰sing 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 +{ + //鐢熶骇鍋滃伐鍗旵ontroller + public class Sc_MESStopWorkBillController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖鐢熶骇鍋滃伐鍗曞垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_MESStopWorkBill/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_MESStopWorkBillList " + sWhere, "h_v_Sc_MESStopWorkBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MESStopWorkBillList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MESStopWorkBillList"); + } + 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 = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + // + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs new file mode 100644 index 0000000..c6c0132 --- /dev/null +++ b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs @@ -0,0 +1,75 @@ +锘縰sing 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 +{ + //鐢熶骇涓婃枡鍗旵ontroller + public class Sc_MaterToSourceBillController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖鐢熶骇涓婃枡鍗曞垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_MaterToSourceBill/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillList " + sWhere, "h_v_Sc_MaterToSourceBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MaterToSourceBillList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillList"); + } + 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 = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + // + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs b/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs index e33b355..5b475ff 100644 --- a/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs +++ b/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs @@ -19,7 +19,9 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; + #region 鐢熶骇姹囨姤鍗� + #region 鐢熶骇姹囨姤鍗曞垪琛� /// <summary> /// 杩斿洖鐢熶骇姹囨姤鍗曞垪琛� ///鍙傛暟锛歴tring sql銆� @@ -41,22 +43,13 @@ string sql = sql1 + sWhere; ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOReportBillList"); } - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "false锛�"; - objJsonResult.data = null; - return objJsonResult; - } - else - { + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; return objJsonResult; - } + } catch (Exception e) { @@ -67,6 +60,291 @@ return objJsonResult; } } + #endregion + + #region 鐢熶骇姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁 + [Route("Sc_ICMOReportBill/Sc_GetICMOReportBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_GetICMOReportBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_IF_ICMOReportBillList_Edit where hmainid= " + HID + " ", "h_v_IF_ICMOReportBillList_Edit"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ敓浜ф眹鎶ュ崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region 鐢熶骇姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁 + [Route("Sc_ICMOReportBill/Sc_ICMOReportBillListProjectDetai")] + [HttpGet] + public object Sc_ICMOReportBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,鐗╂枡浠g爜 HMaterCode,鐗╂枡鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName,HSourceID,鐢熶骇璧勬簮浠g爜 HSourceCode,鐢熶骇璧勬簮 HSourceName, + HWorkerid,鎿嶄綔鍛樹唬鐮� HWorkerCode,鎿嶄綔鍛� HWorkerName,鐢熶骇鏁伴噺 HQty,琛ㄤ綋澶囨敞 HRemark + FROM h_v_IF_ICMOReportBillList_Edit"), "h_v_IF_ICMOReportBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,鐗╂枡浠g爜 HMaterCode,鐗╂枡鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName,HSourceID,鐢熶骇璧勬簮浠g爜 HSourceCode,鐢熶骇璧勬簮 HSourceName, + HWorkerid,鎿嶄綔鍛樹唬鐮� HWorkerCode,鎿嶄綔鍛� HWorkerName,鐢熶骇鏁伴噺 HQty,琛ㄤ綋澶囨敞 HRemark + FROM h_v_IF_ICMOReportBillList_Edit where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOReportBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 鐢熶骇姹囨姤鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿棰嗙敤鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_ICMOReportBill/SaveGetICMOReportBillList")] + [HttpPost] + public object SaveGetICMOReportBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_ICMOReportBill oBill = new DLL.ClsSc_ICMOReportBill(); + List<Model.ClsSc_ICMOReportBillMain> lsmain = new List<Model.ClsSc_ICMOReportBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_ICMOReportBillMain(msg2); + foreach (Model.ClsSc_ICMOReportBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3711"; + oItem.HBillSubType = "3711"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_ICMOReportBillSub> ls = new List<Model.ClsSc_ICMOReportBillSub>(); + ls = oListModels.getObjectByJson_Gy_ICMOReportBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_ICMOReportBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_ICMOReportBill/DeltetICMOReportBill")] + [HttpGet] + public object DeltetMouldLifeChangeBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_ICMOReportBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSc_ICMOReportBill oBill = new DLL.ClsSc_ICMOReportBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion + /// <summary> /// 杩斿洖鐢熶骇璐ㄩ噺姹囨姤鍗曞垪琛� diff --git a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs new file mode 100644 index 0000000..a35233a --- /dev/null +++ b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs @@ -0,0 +1,1010 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers +{ + public class Sb_CheckEqpRepairWorkBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + public WebServer webserver = new WebServer(); + + #region 璁惧缁翠慨宸ュ崟鍒楄〃 + /// <summary> + /// 璁惧缁翠慨宸ュ崟琛ㄥ垪琛� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/GetEqpRepairWorkBillList")] + [HttpGet] + public object GetEqpRepairWorkBillList(string sWhere) + { + try + { + + ds = Sb_EquipRepairWorkBill_s(sWhere); + + + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 璁惧缁翠慨宸ュ崟鍒楄〃sql璇彞 + public static DataSet Sb_EquipRepairWorkBill_s(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipRepairWorkBillList "+sWhere, "h_v_Sb_EquipRepairWorkBillList"); + } + else + { + string sql1 = "select * from h_v_Sb_EquipRepairWorkBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sb_EquipRepairWorkBillList"); + } + + } + #endregion + + + + #region 璁惧缁翠慨楠屾敹鍗曞垪琛� + /// <summary> + /// 璁惧缁翠慨楠屾敹鍗曞垪琛� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/GetEqpRepairCheckWorkBillList")] + [HttpGet] + public object GetEqpRepairCheckWorkBillList(string sWhere) + { + try + { + + ds = Sb_EquipRepairCheckWorkBill_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 璁惧缁翠慨楠屾敹鍗曞垪琛╯ql璇彞 + public static DataSet Sb_EquipRepairCheckWorkBill_s(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipRepairCheckBillList" + sWhere, "h_v_Sb_EquipRepairCheckBillList"); + } + else + { + string sql1 = "select * from h_v_Sb_EquipRepairCheckBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sb_EquipRepairCheckBillList"); + } + + } + #endregion + + + + #region 璁惧鏁呴殰鐧昏鍗曞垪琛� + /// <summary> + /// 璁惧鏁呴殰鐧昏鍗曞垪琛� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/GetEqpConkBookBillList")] + [HttpGet] + public object GetEqpConkBookBillList(string sWhere) + { + try + { + + ds = Sb_EqpConkBookBillList_s(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 璁惧鏁呴殰鐧昏鍗曞垪琛╯ql璇彞 + public static DataSet Sb_EqpConkBookBillList_s(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sb_EquipConkBookBillList" + sWhere, "h_v_Sb_EquipConkBookBillList"); + } + else + { + string sql1 = "select * from h_v_Sb_EquipConkBookBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sb_EquipConkBookBillList"); + } + } + #endregion + + + + + + #region 璁惧缁翠慨鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨璁惧缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList")] + [HttpPost] + public object SaveGetMouldRepairWorkBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSb_EquipRepairWorkBill oBill = new DLL.ClsSb_EquipRepairWorkBill(); + List<Models.ClsSb_EquipRepairWorkBillMain> lsmain = new List<Models.ClsSb_EquipRepairWorkBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_EquipRepairWorkBillMain(msg2); + foreach (Models.ClsSb_EquipRepairWorkBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + //UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3910"; + oItem.HBillSubType = "3910"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HRepairBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨寮�濮嬫棩鏈� + //oItem.HRepairEndDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --缁翠慨缁撴潫鏃ユ湡 + //oItem.HRepairContent = ""; //缁翠慨鍐呭 + //oItem.HCycleUnit = ""; //鏃堕棿鍗曚綅(灏忔椂锛屽ぉ) + //oItem.HPlanTimes = 0; //璁″垝缁翠慨宸ユ椂 + //oItem.HTimes = 0; //瀹為檯缁翠慨宸ユ椂 + //oItem.HEmpID = 0; //缁翠慨浜�(Gy_Employee) + //oItem.HManagerID = 0; //涓荤(Gy_Employee) + //oItem.HDeptID = 0; //缁翠慨閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //--缁翠慨瑕佹眰 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + //oItem.HMouldID = 0; //鎴愬搧妯″叿ID + //oItem.HSupID = 0; //--渚涘簲鍟嗭紙Gy_Supplier锛� + //oItem.HRepairType = ""; //--缁翠慨绫诲瀷锛堝唴閮ㄧ淮淇紝濮斿缁翠慨锛� addnew + //oItem.HNewModel = ""; //缁翠慨鍚庢柊瑙勬牸 + //oItem.HNewDesignLife = 0; //鏂拌璁″鍛� + //oItem.HRepairID = 0; //缁翠慨椤圭洰(Gy_Repair) + //oItem.HRemark = ""; //澶囨敞 + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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<Models.ClsSb_EquipRepairWorkBillSub> ls = new List<Models.ClsSb_EquipRepairWorkBillSub>(); + ls = oListModels.getObjectByJson_Gy_EquipRepairWorkBillSub(msg3); + int i = 0; + foreach (Models.ClsSb_EquipRepairWorkBillSub 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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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[璁惧缁翠慨鍒楄〃缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EqpRepairWorkBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipRepairWorkBillList where hmainid= " + HID + " ", "h_v_Sb_EquipRepairWorkBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[璁惧缁翠慨鍒楄〃缂栬緫鏃惰幏鍙栬〃浣撴暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillListProjectDetai")] + [HttpGet] + public object Sb_EqpRepairWorkBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); + ds = oCN.RunProcReturn("select HManagerID1,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,HRepairID1, 琛ㄤ綋缁翠慨椤圭洰浠g爜 HRepairCode,琛ㄤ綋缁翠慨椤圭洰 HRepairName,琛ㄤ綋缁翠慨瑕佹眰 HRepairExplanation,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_EquipRepairWorkBillList_Edit", "h_v_Sc_EquipRepairWorkBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; + string sql1 = "select HManagerID1,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,HRepairID1, 琛ㄤ綋缁翠慨椤圭洰浠g爜 HRepairCode,琛ㄤ綋缁翠慨椤圭洰 HRepairName,琛ㄤ綋缁翠慨瑕佹眰 HRepairExplanation,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_EquipRepairWorkBillList_Edit where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipRepairWorkBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region [璁惧缁翠慨鍗曞垹闄ゅ姛鑳絔 + /// <summary> + /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/DeltetEqpRepairWorkBill")] + [HttpGet] + public object DeltetEqpRepairWorkBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSb_EquipRepairWorkBill oBill = new DLL.ClsSb_EquipRepairWorkBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + + + + #region 璁惧缁翠慨楠屾敹鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨璁惧缁翠慨楠屾敹鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList")] + [HttpPost] + public object SaveGetEqpRepairCheckBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSb_EquipRepairCheckBill oBill = new DLL.ClsSb_EquipRepairCheckBill(); + List<Model.ClsSb_EquipRepairCheckBillMain> lsmain = new List<Model.ClsSb_EquipRepairCheckBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_EquipRepairCheckBillMain(msg2); + foreach (Model.ClsSb_EquipRepairCheckBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + //UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3911"; + oItem.HBillSubType = "3911"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HRepairBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨寮�濮嬫棩鏈� + //oItem.HRepairEndDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --缁翠慨缁撴潫鏃ユ湡 + //oItem.HRepairContent = ""; //缁翠慨鍐呭 + //oItem.HCycleUnit = ""; //鏃堕棿鍗曚綅(灏忔椂锛屽ぉ) + //oItem.HPlanTimes = 0; //璁″垝缁翠慨宸ユ椂 + //oItem.HTimes = 0; //瀹為檯缁翠慨宸ユ椂 + //oItem.HEmpID = 0; //缁翠慨浜�(Gy_Employee) + //oItem.HManagerID = 0; //涓荤(Gy_Employee) + //oItem.HDeptID = 0; //缁翠慨閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //--缁翠慨瑕佹眰 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + //oItem.HMouldID = 0; //鎴愬搧妯″叿ID + //oItem.HSupID = 0; //--渚涘簲鍟嗭紙Gy_Supplier锛� + //oItem.HRepairType = ""; //--缁翠慨绫诲瀷锛堝唴閮ㄧ淮淇紝濮斿缁翠慨锛� addnew + //oItem.HNewModel = ""; //缁翠慨鍚庢柊瑙勬牸 + //oItem.HNewDesignLife = 0; //鏂拌璁″鍛� + //oItem.HRepairID = 0; //缁翠慨椤圭洰(Gy_Repair) + //oItem.HRemark = ""; //澶囨敞 + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipRepairCheckBillSub> ls = new List<Model.ClsSb_EquipRepairCheckBillSub>(); + ls = oListModels.getObjectByJson_Gy_EquipRepairCheckBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipRepairCheckBillSub 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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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[璁惧缁翠慨楠屾敹鍒楄〃缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairCheckBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EqpRepairCheckBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipRepairCheckBillList_Edit where hmainid= " + HID + " ", "h_v_Sb_EquipRepairCheckBillList_Edit"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[璁惧缁翠慨鍒楄〃缂栬緫鏃惰幏鍙栬〃浣撴暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairCheckBillListProjectDetai")] + [HttpGet] + public object Sb_EqpRepairCheckBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); + ds = oCN.RunProcReturn("select HRepairCheckID1 HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName, 楠屾敹鍐呭 HRepairCheckContent,HManagerID1 HManagerID,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipRepairCheckBillList_Edit", "h_v_Sb_EquipRepairCheckBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; + string sql1 = "select HRepairCheckID1 HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName, 楠屾敹鍐呭 HRepairCheckContent,HManagerID1 HManagerID,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipRepairCheckBillList_Edit where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipRepairCheckBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region [璁惧缁翠慨鍗曞垹闄ゅ姛鑳絔 + /// <summary> + /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/DeltetEqpRepairCheckBill")] + [HttpGet] + public object DeltetEqpRepairCheckBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_EquipRepairCheckBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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.ClsSb_EquipRepairCheckBill oBill = new DAL.ClsSb_EquipRepairCheckBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + + + + #region 璁惧鏁呴殰鐧昏鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨璁惧鏁呴殰鐧昏鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/SaveGetEqpConkBookBillList")] + [HttpPost] + public object SaveGetEqpConkBookBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSb_EquipConkBookBill oBill = new DLL.ClsSb_EquipConkBookBill(); + List<Model.ClsSb_EquipConkBookBillMain> lsmain = new List<Model.ClsSb_EquipConkBookBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_EquipConkBookBillMain(msg2); + foreach (Model.ClsSb_EquipConkBookBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + //UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3097"; + oItem.HBillSubType = "3097"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HRepairBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨寮�濮嬫棩鏈� + //oItem.HRepairEndDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --缁翠慨缁撴潫鏃ユ湡 + //oItem.HRepairContent = ""; //缁翠慨鍐呭 + //oItem.HCycleUnit = ""; //鏃堕棿鍗曚綅(灏忔椂锛屽ぉ) + //oItem.HPlanTimes = 0; //璁″垝缁翠慨宸ユ椂 + //oItem.HTimes = 0; //瀹為檯缁翠慨宸ユ椂 + //oItem.HEmpID = 0; //缁翠慨浜�(Gy_Employee) + //oItem.HManagerID = 0; //涓荤(Gy_Employee) + //oItem.HDeptID = 0; //缁翠慨閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //--缁翠慨瑕佹眰 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + //oItem.HMouldID = 0; //鎴愬搧妯″叿ID + //oItem.HSupID = 0; //--渚涘簲鍟嗭紙Gy_Supplier锛� + //oItem.HRepairType = ""; //--缁翠慨绫诲瀷锛堝唴閮ㄧ淮淇紝濮斿缁翠慨锛� addnew + //oItem.HNewModel = ""; //缁翠慨鍚庢柊瑙勬牸 + //oItem.HNewDesignLife = 0; //鏂拌璁″鍛� + //oItem.HRepairID = 0; //缁翠慨椤圭洰(Gy_Repair) + //oItem.HRemark = ""; //澶囨敞 + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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.ClsSb_EquipConkBookBillSub> ls = new List<Model.ClsSb_EquipConkBookBillSub>(); + ls = oListModels.getObjectByJson_Gy_EquipConkBookBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_EquipConkBookBillSub 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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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[璁惧缁翠慨楠屾敹鍒楄〃缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sb_EqpConkBookBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipConkBookBillList_Edit where hmainid= " + HID + " ", "h_v_Sb_EquipConkBookBillList_Edit"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[璁惧缁翠慨鍒楄〃缂栬緫鏃惰幏鍙栬〃浣撴暟鎹甝 + [Route("Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListProjectDetai")] + [HttpGet] + public object Sb_EqpConkBookBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); + ds = oCN.RunProcReturn("select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜鍚嶇О HConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerID1 HManagerID,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipConkBookBillList_Edit", "h_v_Sb_EquipConkBookBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; + string sql1 = "select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜鍚嶇О HConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerID1 HManagerID,琛ㄤ綋璐熻矗浜轰唬鐮� HManagerCode,琛ㄤ綋璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipConkBookBillList_Edit where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipConkBookBillList_Edit"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region [璁惧缁翠慨鍗曞垹闄ゅ姛鑳絔 + /// <summary> + /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳� + /// </summary> + /// <returns></returns> + [Route("Sb_EqpRepairWorkBill/DeltetEqpConkBookBill")] + [HttpGet] + public object DeltetEqpConkBookBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sb_EquipConkBookBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSb_EquipConkBookBill oBill = new DLL.ClsSb_EquipConkBookBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + } +} diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs index 9f4fce5..b143558 100644 --- a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs +++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs @@ -464,7 +464,7 @@ /// <summary> - /// 妯″叿鏁呴殰鐧昏琛ㄥ垪琛� + /// 妯″叿缁翠慨楠屾敹鍗曞垪琛� /// </summary> /// <returns></returns> [Route("Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList")] @@ -475,22 +475,12 @@ { ds = Sc_MouldRepairCheckBillList_s(sWhere); - 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]; return objJsonResult; - } + } catch (Exception ex) { @@ -1337,7 +1327,7 @@ if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairWorkBillList where hmainid= " + HID + " ", "h_v_Sc_MouldRepairWorkBillList"); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairWorkBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldRepairWorkBillList_Edit"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; @@ -1356,7 +1346,7 @@ if (sqlWhere == null || sqlWhere.Equals("")) { //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); - ds = oCN.RunProcReturn("select HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); + ds = oCN.RunProcReturn("select HRepairSonID HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; @@ -1365,7 +1355,7 @@ else { //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; - string sql1 = "select HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; + string sql1 = "select HRepairSonID HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; string sql = sql1 + sqlWhere; ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); objJsonResult.code = "0"; @@ -1488,7 +1478,7 @@ ListModels oListModels = new ListModels(); try { - DAL.ClsSc_MouldRepairCheckBill oBill = new DAL.ClsSc_MouldRepairCheckBill(); + DLL.ClsSc_MouldRepairCheckBill oBill = new DLL.ClsSc_MouldRepairCheckBill(); List<Model.ClsSc_MouldRepairCheckBillMain> lsmain = new List<Model.ClsSc_MouldRepairCheckBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n @@ -1497,8 +1487,8 @@ { //oItem.HMaker = ""; UserName = oItem.HMaker; //鍒跺崟浜� - oItem.HBillType = "3815"; - oItem.HBillSubType = "3815"; + oItem.HBillType = "3817"; + oItem.HBillSubType = "3817"; //oItem.HBillNo = ""; //鍗曟嵁鍙� //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� @@ -1611,7 +1601,7 @@ return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairCheckBillList where hmainid= " + HID + " ", "h_v_Sc_MouldRepairCheckBillList"); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairCheckBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldRepairCheckBillList_Edit"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; @@ -1632,7 +1622,7 @@ { //ds = oCN.RunProcReturn("select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub", "Sc_MouldRepairCheckBillSub"); - ds = oCN.RunProcReturn("select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit", "h_v_Sc_MouldRepairCheckBillList_Edit"); + ds = oCN.RunProcReturn("select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit", "h_v_Sc_MouldRepairCheckBillList_Edit"); objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1643,7 +1633,7 @@ { //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; - string sql1 = "select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 "; + string sql1 = "select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 "; string sql = sql1 + sqlWhere; ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairCheckBillList_Edit"); @@ -1674,14 +1664,14 @@ public object DeltetMouldRepairCheckBill(string HInterID) { //缂栬緫鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairCheckBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairCheckBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} Int64 lngBillKey = 0; @@ -1891,7 +1881,7 @@ return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldConkBookBillList where hmainid= " + HID + " ", "h_v_Sc_MouldConkBookBillList"); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldConkBookBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldConkBookBillList_Edit"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; @@ -1912,7 +1902,7 @@ { //ds = oCN.RunProcReturn("select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub", "Sc_MouldRepairCheckBillSub"); - ds = oCN.RunProcReturn("select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜 HHConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldConkBookBillList_Edit", "h_v_Sc_MouldConkBookBillList_Edit"); + ds = oCN.RunProcReturn("select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜 HHConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldConkBookBillList_Edit", "h_v_Sc_MouldConkBookBillList_Edit"); objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1923,7 +1913,7 @@ { //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; - string sql1 = "select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜 HHConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldConkBookBillList_Edit where 1 = 1 "; + string sql1 = "select HConkReasonID,鏁呴殰鍘熷洜浠g爜 HConkReasonCode,鏁呴殰鍘熷洜 HHConkReasonName,鏁呴殰鍘熷洜鎻忚堪 HConkExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldConkBookBillList_Edit where 1 = 1 "; string sql = sql1 + sqlWhere; ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldConkBookBillList_Edit"); @@ -2296,8 +2286,6 @@ #endregion #endregion - - #region 妯″叿淇濆吇璁板綍琛� #region 妯″叿淇濆吇璁板綍琛� 淇濆瓨/缂栬緫 @@ -2382,13 +2370,13 @@ //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 - //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 - //HMaterID = "";//閰嶄欢浠g爜 - //HUnitID = "";//鍗曚綅浠g爜 - //HQty = "";//瀹為檯鐢ㄩ噺 - //HQtyMust = "";//鍗曚綅鐢ㄩ噺 - //HRemark = "";//澶囨敞 - + //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 + //HMaterID = "";//閰嶄欢浠g爜 + //HUnitID = "";//鍗曚綅浠g爜 + //HQty = "";//瀹為檯鐢ㄩ噺 + //HQtyMust = "";//鍗曚綅鐢ㄩ噺 + //HRemark = "";//澶囨敞 + oBill.DetailColl.Add(oItemSub); } @@ -3115,5 +3103,1651 @@ #endregion + + + #region 妯″叿鎶ュ簾鍏ュ簱鍗� + + #region 妯″叿鎶ュ簾鍏ュ簱鍗曞垪琛� + + [Route("Sc_MouldScrapInHouseBill/GetMouldScrapInHouseBill")] + [HttpGet] + public object GetMouldScrapInHouseBill(string sWhere) + { + try + { + + ds = Sc_GetMouldScrapInHouseBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_GetMouldScrapInHouseBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldScrapInHouseBillList " + sWhere, "h_v_Sc_MouldScrapInHouseBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldScrapInHouseBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList"); + } + + } + + #endregion + + #region[妯″叿鎶ュ簾鍏ュ簱鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sc_MouldScrapInHouseBill/Sc_MouldScrapInHouseBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_MouldScrapInHouseBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldScrapInHouseBillList where hmainid= " + HID + " ", "h_v_Sc_MouldScrapInHouseBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[妯″叿鎶ュ簾鍏ュ簱鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Sc_MouldScrapInHouseBill/Sc_MouldScrapInHouseBillListProjectDetai")] + [HttpGet] + public object Sc_MouldScrapInHouseBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark + FROM h_v_Sc_MouldScrapInHouseBillList"), "h_v_Sc_MouldScrapInHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark + FROM h_v_Sc_MouldScrapInHouseBillList where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妯″叿鎶ュ簾鍏ュ簱鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿鎶ュ簾鍏ュ簱鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MouldScrapInHouseBill/SaveGetMouldScrapInHouseBillList")] + [HttpPost] + public object SaveGetMouldScrapInHouseBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); + List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2); + foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3831"; + oItem.HBillSubType = "3831"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_MouldScrapInHouseBill/DeltetMouldScrapInHouseBill")] + [HttpGet] + public object DeltetMouldScrapInHouseBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapInBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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_MouldScrapInBill oBill = new DAL.ClsSc_MouldScrapInBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion + + #region 妯″叿澶勭悊鍑哄簱鍗� + + #region 妯″叿澶勭悊鍑哄簱鍗曞垪琛� + + [Route("Sc_MouldScrapOutHouseBill/GetMouldScrapOutHouseBill")] + [HttpGet] + public object GetMouldScrapOutHouseBill(string sWhere) + { + try + { + + ds = Sc_GetMouldScrapOutHouseBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_GetMouldScrapOutHouseBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldScrapOutHouseBillList ", "h_v_Sc_MouldScrapOutHouseBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldScrapOutHouseBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList"); + } + } + + #endregion + + #region[妯″叿澶勭悊鍑哄簱鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sc_MouldScrapOutHouseBill/Sc_MouldScrapOutHouseBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_MouldScrapOutHouseBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldScrapOutHouseBillList where hmainid= " + HID + " ", "h_v_Sc_MouldScrapOutHouseBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ淮淇崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[妯″叿澶勭悊鍑哄簱鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Sc_MouldScrapOutHouseBill/Sc_MouldScrapOutHouseBillListProjectDetai")] + [HttpGet] + public object Sc_MouldScrapOutHouseBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, 鎹㈢畻鐜� HSecUnitRate, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炲彂鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鍙戣揣浠撳簱浠g爜 HWHCode, 鍙戣揣浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark FROM h_v_Sc_MouldScrapOutHouseBillList"), "h_v_Sc_MouldScrapOutHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�у悕绉� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, 鎹㈢畻鐜� HSecUnitRate, HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炲彂鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鍙戣揣浠撳簱浠g爜 HWHCode, 鍙戣揣浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark FROM h_v_Sc_MouldScrapOutHouseBillList where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妯″叿澶勭悊鍑哄簱鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿澶勭悊鍑哄簱鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MouldScrapOutHouseBill/SaveGetMouldScrapOutHouseBillList")] + [HttpPost] + public object SaveGetMouldScrapOutHouseBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill(); + List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillMain(msg2); + foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3832"; + oItem.HBillSubType = "3832"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_MouldScrapOutHouseBill/DeltetMouldScrapOutHouseBill")] + [HttpGet] + public object DeltetMouldScrapOutHouseBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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_MouldScrapInBill oBill = new DAL.ClsSc_MouldScrapInBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion + + #region 妯″叿閫�搴撳崟 + + #region 妯″叿閫�搴撳崟鍒楄〃 + + [Route("Sc_MouldProdBackBill/GetMouldProdBackBill")] + [HttpGet] + public object GetMouldProdBackBill(string sWhere) + { + try + { + + ds = Sc_GetMouldProdBackBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_GetMouldProdBackBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldProdBackBillList_Edit ", "h_v_Sc_MouldProdBackBillList_Edit"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldProdBackBillList_Edit where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList_Edit"); + } + + } + + #endregion + + #region[妯″叿閫�搴撳崟缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝 + [Route("Sc_MouldProdBackBill/Sc_MouldProdBackBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_MouldProdBackBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldProdBackBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldProdBackBillList_Edit"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄩ��搴撳崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[妯″叿閫�搴撳崟缂栬緫鏃惰幏鍙栬〃浣撴暟鎹甝 + [Route("Sc_MouldProdBackBill/Sc_MouldProdBackBillListProjectDetai")] + [HttpGet] + public object Sc_MouldProdBackBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife,搴旀敹鏁伴噺 HQtyMust, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID1 HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName,妯″叿鏂拌鏍� HNewModel,澹佸帤 HWallThickness,纭害 HHardness,鏈�鍚庣敓浜т骇鍝� HLastProdModel, 鐩村緞 HDiameter,閫�搴撶被鍨� HBackFlag, + 琛ㄤ綋澶囨敞 HRemark FROM h_v_Sc_MouldProdBackBillList_Edit"), "h_v_Sc_MouldProdBackBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅鍚嶇О HSecUnitName, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅鍚嶇О HUnitName, 鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife,搴旀敹鏁伴噺 HQtyMust, 瀹炴敹鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID1 HWHID, 鏀舵枡浠撳簱浠g爜 HWHCode, 鏀舵枡浠撳簱鍚嶇О HWHName, + HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName,妯″叿鏂拌鏍� HNewModel,澹佸帤 HWallThickness,纭害 HHardness,鏈�鍚庣敓浜т骇鍝� HLastProdModel, 鐩村緞 HDiameter,閫�搴撶被鍨� HBackFlag, + 琛ㄤ綋澶囨敞 HRemark FROM h_v_Sc_MouldProdBackBillList_Edit where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妯″叿閫�搴撳崟淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿閫�搴撳崟 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MouldProdBackBill/SaveGetMouldProdBackBillList")] + [HttpPost] + public object SaveGetMouldProdBackBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill(); + List<Model.ClsSc_MouldProdBackBillMain> lsmain = new List<Model.ClsSc_MouldProdBackBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2); + foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3803"; + oItem.HBillSubType = "3803"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_MouldProdBackBillSub> ls = new List<Model.ClsSc_MouldProdBackBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldProdBackBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_MouldProdBackBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_MouldProdBackBill/DeltetMouldProdBackBill")] + [HttpGet] + public object DeltetMouldProdBackBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion + + #region 妯″叿棰嗙敤鍗� + + #region 妯″叿棰嗙敤鍗曞垪琛� + + [Route("Sc_MouldProdOutBill/GetMouldProdOutBill")] + [HttpGet] + public object GetMouldProdOutBill(string sWhere) + { + try + { + + ds = Sc_GetMouldProdOutBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_GetMouldProdOutBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldProdOutHouseBillList ", "h_v_Sc_MouldProdOutHouseBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); + } + + } + + #endregion + + #region[妯″叿棰嗙敤鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sc_MouldProdOutBill/Sc_MouldProdOutBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_MouldProdOutBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldProdOutHouseBillList where hmainid= " + HID + " ", "h_v_Sc_MouldProdOutHouseBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄩ��搴撳崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[妯″叿棰嗙敤鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Sc_MouldProdOutBill/Sc_MouldProdOutBillListProjectDetai")] + [HttpGet] + public object Sc_MouldProdOutBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, + 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, + 浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo, + 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, + 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, + 浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妯″叿棰嗙敤鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿棰嗙敤鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MouldProdOutBill/SaveGetMouldProdOutBillList")] + [HttpPost] + public object SaveGetMouldProdOutBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill(); + List<Model.ClsSc_MouldProdOutBillMain> lsmain = new List<Model.ClsSc_MouldProdOutBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldProdOutBillMain(msg2); + foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3802"; + oItem.HBillSubType = "3802"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_MouldProdOutBill/DeltetMouldProdOutBill")] + [HttpGet] + public object DeltetMouldProdOutBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion + + #region 妯″叿瀵垮懡璋冩暣鍗� + + #region 妯″叿瀵垮懡璋冩暣琛� + + [Route("Sc_MouldLifeChangeBill/GetMouldLifeChangeBill")] + [HttpGet] + public object GetMouldLifeChangeBill(string sWhere) + { + try + { + + ds = Sc_GetMouldLifeChangeBill(sWhere); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_GetMouldLifeChangeBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldLifeChangeBillList ", "h_v_Sc_MouldLifeChangeBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldLifeChangeBillList where 1 = 1 "; + string sql = sql1 + sWhere; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList"); + } + + } + + #endregion + + #region[妯″叿瀵垮懡璋冩暣鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Sc_MouldLifeChangeBill/Sc_GetMouldLifeChangeBillListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> Sc_Sc_GetMouldLifeChangeBillListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldLifeChangeBillList where hmainid= " + HID + " ", "h_v_Sc_MouldLifeChangeBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄩ��搴撳崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[妯″叿瀵垮懡璋冩暣鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Sc_MouldLifeChangeBill/Sc_MouldLifeChangeBillListProjectDetai")] + [HttpGet] + public object Sc_MouldLifeChangeBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿 HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅 HSecUnitName,鎹㈢畻鐜� HSecUnitRate, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName, + 璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLife,琛ㄤ綋澶囨敞 HRemark + FROM h_v_Sc_MouldLifeChangeBillList_Edit"), "h_v_Sc_MouldLifeChangeBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + else + { + + //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; + string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿 HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HPropertyID,杈呭姪灞炴�т唬鐮� HPropertyCode,杈呭姪灞炴�� HPropertyName, + HSecUnitID, 杈呭姪璁¢噺鍗曚綅浠g爜 HSecUnitCode, 杈呭姪璁¢噺鍗曚綅 HSecUnitName,鎹㈢畻鐜� HSecUnitRate, + HUnitID, 璁¢噺鍗曚綅浠g爜 HUnitCode, 璁¢噺鍗曚綅 HUnitName, + 璁捐瀵垮懡 HDesignLife, 鍘熷墿浣欏鍛� HLeaveLife, 鏂板墿浣欏鍛� HNewLife,琛ㄤ綋澶囨敞 HRemark + FROM h_v_Sc_MouldLifeChangeBillList_Edit where 1 = 1 "); + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList_Edit"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妯″叿瀵垮懡璋冩暣鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿棰嗙敤鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MouldLifeChangeBill/SaveGetMouldLifeChangeBillList")] + [HttpPost] + public object SaveGetMouldLifeChangeBillList([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 UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsSc_MouldLifeChangeBill oBill = new DLL.ClsSc_MouldLifeChangeBill(); + List<Model.ClsSc_MouldLifeChangeBillMain> lsmain = new List<Model.ClsSc_MouldLifeChangeBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldLifeChangeBillMain(msg2); + foreach (Model.ClsSc_MouldLifeChangeBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "3824"; + oItem.HBillSubType = "3824"; + //oItem.HBillNo = ""; //鍗曟嵁鍙� + //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) + //oItem.HPeriod = 0; + //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 + //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) + //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) + //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) + //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) + //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) + //oItem.HRemark = ""; //澶囨敞 + + //oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + 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_MouldLifeChangeBillSub> ls = new List<Model.ClsSc_MouldLifeChangeBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldLifeChangeBillSub(msg3); + int i = 0; + foreach (Model.ClsSc_MouldLifeChangeBillSub oItemSub in ls) + { + + i++; + oItemSub.HEntryID = i; + + //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID + //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 + //oItemSub.HManagerID = 0; //璐熻矗浜篒D + //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; //鍏宠仈閲戦 + //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 + //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 + //oItemSub.HMoney = 0; //缁翠慨璐圭敤 + 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 = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + 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_MouldLifeChangeBill/DeltetMouldLifeChangeBill")] + [HttpGet] + public object DeltetMouldLifeChangeBill(string HInterID) + { + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + 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; + } + DLL.ClsSc_MouldLifeChangeBill oBill = new DLL.ClsSc_MouldLifeChangeBill(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, 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 + + #endregion } } \ No newline at end of file diff --git a/WebAPI/DLL/ClsSb_EquipConkBookBill.cs b/WebAPI/DLL/ClsSb_EquipConkBookBill.cs new file mode 100644 index 0000000..25880c7 --- /dev/null +++ b/WebAPI/DLL/ClsSb_EquipConkBookBill.cs @@ -0,0 +1,219 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSb_EquipConkBookBill : DBUtility.ClsXt_BaseBill + { + public Model.ClsSb_EquipConkBookBillMain omodel = new Model.ClsSb_EquipConkBookBillMain(); + public List<Model.ClsSb_EquipConkBookBillSub> DetailColl = new List<Model.ClsSb_EquipConkBookBillSub>(); + + public ClsSb_EquipConkBookBill() + { + base.MvarItemKeySub = "Sb_EquipConkBookBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey = "Sb_EquipConkBookBillMain"; + base.MvarReportTitle = "璁惧浜嬫晠鐧昏琛�"; + base.BillType = "3907"; + } + + #region 鍥哄畾浠g爜 + + ~ClsSb_EquipConkBookBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sb_EquipConkBookBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //========================================= + ",HEquipID=" + omodel.HEquipID.ToString() + + ",HConkTypeID=" + omodel.HConkTypeID.ToString() + + ",HConkBeginDate='" + omodel.HConkBeginDate + "'" + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + //DeleteRelation(ref sReturn, lngBillKey); + ////鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + ////鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSb_EquipConkBookBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sb_EquipConkBookBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HConkReasonID,HConkExplanation,HManagerID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HConkReasonID.ToString() + ",'" + oSub.HConkExplanation + "'," + oSub.HManagerID.ToString() + + ") "); + } + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sb_EquipConkBookBillMain" + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HEquipID,HExplanation,HInnerBillNo,HConkTypeID,HEmpID" + + ",HManagerID,HDeptID,HConkBeginDate" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HConkTypeID.ToString() + "," + omodel.HEmpID.ToString() + + "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HConkBeginDate + "'" + + ") "); + ////鎻掑叆瀛愯〃 + foreach (Model.ClsSb_EquipConkBookBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sb_EquipConkBookBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HConkReasonID,HManagerID,HConkExplanation" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HConkReasonID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HConkExplanation + "'" + + ") "); + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds; + Ds = oCn.RunProcReturn("Select * from Sb_EquipConkBookBillMain Where HInterID=" + lngBillKey.ToString(), "Sb_EquipConkBookBillMain"); + if (Ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //璧嬪�� + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================= + omodel.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]); + omodel.HConkTypeID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HConkTypeID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HConkBeginDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HConkBeginDate"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = Ds.Tables[0].Rows[0]["HExplanation"].ToString().Trim(); + omodel.HInnerBillNo = Ds.Tables[0].Rows[0]["HInnerBillNo"].ToString().Trim(); + //寰幆 + DataSet DsSub; + DsSub = oCn.RunProcReturn("Select * from Sb_EquipConkBookBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sb_EquipConkBookBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSb_EquipConkBookBillSub oSub = new Model.ClsSb_EquipConkBookBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=========================================== + oSub.HConkReasonID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HConkReasonID"]); + oSub.HConkExplanation = DsSub.Tables[0].Rows[i]["HConkExplanation"].ToString().Trim(); + oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]); + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } +} \ No newline at end of file diff --git a/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs b/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs new file mode 100644 index 0000000..97d6272 --- /dev/null +++ b/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs @@ -0,0 +1,219 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSb_EquipRepairCheckBill : DBUtility.ClsXt_BaseBill + { + public Model.ClsSb_EquipRepairCheckBillMain omodel = new Model.ClsSb_EquipRepairCheckBillMain(); + public List<Model.ClsSb_EquipRepairCheckBillSub> DetailColl = new List<Model.ClsSb_EquipRepairCheckBillSub>(); + + public ClsSb_EquipRepairCheckBill() + { + base.MvarItemKeySub = "Sb_EquipRepairCheckBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey = "Sb_EquipRepairCheckBillMain"; + base.MvarReportTitle = "璁惧缁翠慨楠屾敹鍗�"; + base.BillType = "3911"; + } + + #region 鍥哄畾浠g爜 + + ~ClsSb_EquipRepairCheckBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sb_EquipRepairCheckBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //========================================= + ",HEquipID=" + omodel.HEquipID.ToString() + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HCheckBeginDate='" + omodel.HCheckBeginDate + "'" + + ",HCheckResult='" + omodel.HCheckResult + "'" + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + //DeleteRelation(ref sReturn, lngBillKey); + ////鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + ////鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSb_EquipRepairCheckBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sb_EquipRepairCheckBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairCheckID,HManagerID,HRepairCheckContent" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HRepairCheckID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairCheckContent + "'" + + ") "); + } + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sb_EquipRepairCheckBillMain" + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HEquipID,HExplanation,HInnerBillNo,HEmpID" + + ",HManagerID,HDeptID,HCheckResult,HCheckBeginDate" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker+ "',getdate()" + + ", " + omodel.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HEmpID.ToString() + + "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckResult + "','" + omodel.HCheckBeginDate + "'" + + ") "); + ////鎻掑叆瀛愯〃 + foreach (Model.ClsSb_EquipRepairCheckBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sb_EquipRepairCheckBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairCheckID,HManagerID,HRepairCheckContent" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HRepairCheckID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairCheckContent + "'" + + ") "); + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds; + Ds = oCn.RunProcReturn("Select * from Sb_EquipRepairCheckBillMain Where HInterID=" + lngBillKey.ToString(), "Sb_EquipRepairCheckBillMain"); + if (Ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //璧嬪�� + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================= + omodel.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HCheckBeginDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HCheckBeginDate"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HCheckResult = Ds.Tables[0].Rows[0]["HCheckResult"].ToString().Trim(); + omodel.HExplanation = Ds.Tables[0].Rows[0]["HExplanation"].ToString().Trim(); + omodel.HInnerBillNo = Ds.Tables[0].Rows[0]["HInnerBillNo"].ToString().Trim(); + //寰幆 + DataSet DsSub; + DsSub = oCn.RunProcReturn("Select * from Sb_EquipRepairCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sb_EquipRepairCheckBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSb_EquipRepairCheckBillSub oSub = new Model.ClsSb_EquipRepairCheckBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=========================================== + oSub.HRepairCheckID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairCheckID"]); + oSub.HRepairCheckContent = DsSub.Tables[0].Rows[i]["HRepairCheckContent"].ToString().Trim(); + oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]); + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } +} \ No newline at end of file diff --git a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs new file mode 100644 index 0000000..8b3d35b --- /dev/null +++ b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs @@ -0,0 +1,286 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSb_EquipRepairWorkBill:DBUtility.ClsXt_BaseBill + { + public Models.ClsSb_EquipRepairWorkBillMain omodel = new Models.ClsSb_EquipRepairWorkBillMain(); + public List<Models.ClsSb_EquipRepairWorkBillSub> DetailColl = new List<Models.ClsSb_EquipRepairWorkBillSub>(); + + public ClsSb_EquipRepairWorkBill() + { + base.MvarItemKeySub = "Sb_EquipRepairWorkBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sb_EquipRepairWorkBillMain"; + base.MvarReportTitle = "璁惧缁翠慨鍗�"; + base.BillType="3910"; + base.HBillSubType = "3910"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSb_EquipRepairWorkBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sb_EquipRepairWorkBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HEquipID=" + omodel.HEquipID.ToString() + + ",HRepairID=" + omodel.HRepairID.ToString() + + ",HRepairBeginDate='" + omodel.HRepairBeginDate + "'" + + ",HRepairEndDate='" + omodel.HRepairEndDate + "'" + + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HTimes=" + omodel.HTimes.ToString() + + ",HPlanTimes=" + omodel.HPlanTimes.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + ",HRepairContent='" + omodel.HRepairContent + "'" + + ",HCycleUnit='" + omodel.HCycleUnit + "'" + + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HRepairID1.ToString() + ",'"+ oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + ") "); + } + // + //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipRepairWorkBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + string sql = string.Format(@"Insert Into Sb_EquipRepairWorkBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HEquipID,HRepairID,HPlanTimes,HEmpID,HManagerID,HTimes" + + ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HEquipID.ToString() + "," + omodel.HRepairID.ToString() + "," + omodel.HPlanTimes.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HTimes.ToString() + + ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "'" + + ")"); + //涓昏〃 + oCn.RunProc("Insert Into Sb_EquipRepairWorkBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HEquipID,HRepairID,HPlanTimes,HEmpID,HManagerID,HTimes" + + ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HEquipID.ToString() + "," + omodel.HRepairID.ToString() + "," + omodel.HPlanTimes.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HTimes.ToString() + + ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "'" + + ") "); + //鎻掑叆瀛愯〃 + foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) + { + string sql1 = string.Format(@"Insert into Sb_EquipRepairWorkBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HRepairID1.ToString() + ",'" + oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + ")"); + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HRepairID1.ToString() + ",'"+ oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + ") "); + } + // + //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipRepairWorkBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sb_EquipRepairWorkBillMain Where HInterID=" + lngBillKey.ToString(), "Sb_EquipRepairWorkBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]); + omodel.HRepairID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRepairID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HRepairBeginDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HRepairBeginDate"]); + omodel.HRepairEndDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HRepairEndDate"]); + omodel.HRepairContent = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRepairContent"]); + omodel.HCycleUnit = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCycleUnit"]); + omodel.HPlanTimes = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HPlanTimes"]); + omodel.HTimes = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HTimes"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sb_EquipRepairWorkBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sb_EquipRepairWorkBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Models.ClsSb_EquipRepairWorkBillSub oSub = new Models.ClsSb_EquipRepairWorkBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + + oSub.HRepairExplanation = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRepairExplanation"]); + oSub.HRepairID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairID"]); + oSub.HEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEmpID"]); + + + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } + +} diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs new file mode 100644 index 0000000..57ff176 --- /dev/null +++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs @@ -0,0 +1,673 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using DBUtility; + +namespace WebAPI.DLL +{ + public class ClsSc_ICMOReportBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_ICMOReportBillMain omodel = new Model.ClsSc_ICMOReportBillMain(); + public Model.ClsSc_ICMOReportBillSub oSub = new Model.ClsSc_ICMOReportBillSub(); + public List<Model.ClsSc_ICMOReportBillSub> DetailColl = new List<Model.ClsSc_ICMOReportBillSub>(); + + public ClsSc_ICMOReportBill() + { + base.MvarItemKeySub = "Sc_ICMOReportBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_ICMOReportBillMain"; + base.MvarReportTitle="鐢熶骇姹囨姤鍗�"; + base.BillType="3711"; + base.HBillSubType = "3711"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_ICMOReportBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + DataSet Ds; + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_ICMOReportBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HDeptNumber='" + omodel.HDeptNumber +"'"+ + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HEmpNumber='" + omodel.HEmpNumber +"'"+ + ",HGroupID=" + omodel.HGroupID.ToString() + + ",HCheckType='" + omodel.HCheckType + "'" + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_ICMOReportBillSub " + + " (HInterID,HEntryID,HMaterID,HMaterNumber" + + ",HQty,HUnitID,HUnitNumber,HTimes,HSourceID" + + ",HQtyMust,HWorkerID,HWorkerNumber,HBadCount,HWasterQty," + + "HCloseMan,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HICMOInterID,HICMOBillNo,HBarCode" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber +"'"+ + "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() + + "," + oSub.HQtyMust.ToString() + "," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HBarCode + "'" + + ") "); + } + if (omodel.HCheckType == "鍚堟牸") + { + oCn.RunProc("update b set b.hbarcodestatus='姹囨姤',b.HQty = case when HReadyQty=0 then a.HQty else a.HQty+b.HQty end ,HReadyQty = a.HQty " + + "from Sc_ICMOReportBillSub a inner join Gy_BarCodeBill b on a.HBarCode=b.HBarCode " + + "Where a.HInterID=" + lngBillKey.ToString() + " "); + } + //瀹℃牳鍗曟嵁 + Ds = oCn.RunProcReturn("EXEC h_p_Sc_ICMOReportBill_Check " + omodel.HInterID.ToString() + ",'" + omodel.HMaker+ "'", "h_p_Sc_ICMOReportBill_Check"); + if (Ds == null) + { + sReturn = "鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + oCn.RollBack(); + return false; + } + if (Ds.Tables[0].Rows.Count == 0) + { + //sReturn ="鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + //oCn.RollBack(); + //return false; + } + else + { + if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) >= 2) + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]); + oCn.RollBack(); + return false; + } + } + // + //foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_ICMOReportBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" + + ",HGroupID,HDeptID,HDeptNumber" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker+ "',getdate()" + + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HEmpID.ToString() + "','" + omodel.HEmpNumber + + "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber + "'"+ + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_ICMOReportBillSub " + + " (HInterID,HEntryID,HMaterID,HMaterNumber" + + ",HQty,HUnitID,HUnitNumber,HTimes,HSourceID" + + ",HQtyMust,HWorkerID,HWorkerNumber,HBadCount,HWasterQty," + + "HCloseMan,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HICMOInterID,HICMOBillNo,HBarCode" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'" + + "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() + + "," + oSub.HQtyMust.ToString() + "," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HBarCode + "'" + + ") "); + } + // + //foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_ICMOReportBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_ICMOReportBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + //== + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HDeptNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeptNumber"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HEmpNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HEmpNumber"]); + omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]); + omodel.HCheckType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckType"]); + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_ICMOReportBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_ICMOReportBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_ICMOReportBillSub oSub = new Model.ClsSc_ICMOReportBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]); + oSub.HWorkerNumber = DsSub.Tables[0].Rows[i]["HWorkerNumber"].ToString().Trim(); + oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]); + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HMaterNumber = DsSub.Tables[0].Rows[i]["HMaterNumber"].ToString().Trim(); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HUnitNumber = DsSub.Tables[0].Rows[i]["HUnitNumber"].ToString().Trim(); + oSub.HTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HTimes"]); + oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); + oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); + oSub.HBadCount = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HBadCount"]); + oSub.HWasterQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWasterQty"]); + oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); + oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); + oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim(); + oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]); + oSub.HICMOBillNo = DsSub.Tables[0].Rows[i]["HICMOBillNo"].ToString().Trim(); + oSub.HBarCode = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBarCode"]); + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + //鎵爜鐢熸垚浜ч噺姹囨姤鍗曪紙鏃犳潯鐮佸嚭鍏ュ簱璁板綍锛� + public bool AddBill_PDA2(ref string sReturn) + { + try + { + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(omodel.HDate, ref sYear, ref sPeriod, ref s) == false) + { + sReturn = s; + return false; + } + omodel.HYear = sYear; + omodel.HPeriod = sPeriod; + + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_ICMOReportBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" + + ",HGroupID,HDeptID" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',getdate(),'" + omodel.HMaker + "',getdate()" + + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + "鎵弿鐢熸垚" + "'," + omodel.HEmpID.ToString() + ",'" + omodel.HEmpNumber + "'" + + "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_ICMOReportBillSub " + + " (HInterID,HEntryID,HMaterID" + + ",HQty,HUnitID,HTimes,HSourceID" + + ",HQtyMust,HWorkerID,HBadQty,HBadCount,HWasterQty" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HICMOInterID,HICMOBillNo,HSplitNO,HBarCode" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() + + "," + oSub.HQtyMust.ToString() + "," + oSub.HWorkerID.ToString() + "," + oSub.HBadQty.ToString() + "," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HSplitNO + "','" + oSub.HBarCode + "'" + + ") "); + } + //瀹℃牳鍗曟嵁 + oCn.RunProc("Update Sc_ICMOReportBillMain Set HChecker='" + omodel.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + omodel.HInterID.ToString()); + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + //鏍规嵁浠诲姟鍗� 杩斿洖 璇ヤ换鍔″崟涓婁竴娆′骇閲忔眹鎶ヤ俊鎭� + public DataSet GetInfoByHICMOInterID_chanliang(long HSourceInterID, string sWhere) + { + DataSet DS; + try + { + DS = oCn.RunProcReturn("Select top 1 * from h_v_IF_ICMOReportBillList Where HICMOInterID=" + HSourceInterID.ToString() + sWhere + "order by hmainid desc", "h_v_IF_ICMOReportBillList", ref DBUtility.ClsPub.sExeReturnInfo); + if (DS.Tables[0].Rows.Count == 0) + return null; + else + { + return DS; + } + } + catch (Exception e) + { + throw (e); + } + } + + // 鍗曠姹囨姤 + public bool AddBill_PDA(ref string sReturn) + { + try + { + DataSet Ds; + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_ICMOReportBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark,HEmpID" + + ",HGroupID,HDeptID,HCheckType" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',getdate(),'" + omodel.HMaker + "',getdate()" + + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEmpID.ToString() + + "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckType + "'" + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_ICMOReportBillSub " + + " (HInterID,HEntryID,HMaterID" + + ",HQty,HUnitID,HTimes,HSourceID" + + ",HQtyMust,HWorkerID,HBadQty,HBadCount,HWasterQty" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HICMOInterID,HICMOBillNo,HSplitNO,HBarCode" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() + + "," + oSub.HQtyMust.ToString() + "," + oSub.HWorkerID.ToString() + "," + oSub.HBadQty.ToString() + "," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + "灏剧鎵弿鐢熸垚" + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HSplitNO + "','" + oSub.HBarCode + "'" + + ") "); + } + if (omodel.HCheckType == "鍚堟牸") + { + oCn.RunProc("update b set b.hbarcodestatus='姹囨姤',b.HQty = case when HReadyQty=0 then a.HQty else a.HQty+b.HQty end ,HReadyQty = a.HQty " + + "from Sc_ICMOReportBillSub a inner join Gy_BarCodeBill b on a.HBarCode=b.HBarCode " + + "Where a.HInterID=" + omodel.HInterID.ToString() + " "); + } + + //foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + //瀹℃牳鍗曟嵁 + Ds = oCn.RunProcReturn("EXEC h_p_Sc_ICMOReportBill_Check " + omodel.HInterID.ToString() + ",'" + omodel.HMaker + "'", "h_p_Sc_ICMOReportBill_Check"); + if (Ds == null) + { + sReturn = "鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + oCn.RollBack(); + return false; + } + if (Ds.Tables[0].Rows.Count == 0) + { + //sReturn ="鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + //oCn.RollBack(); + //return false; + } + else + { + if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) >= 2) + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]); + oCn.RollBack(); + return false; + } + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + //鏉$爜鎵弿璁板綍,鎵归噺鏂板鍒颁骇鍝佹眹鎶� // 澶氱姹囨姤 + public bool AddBillMul_PDA(Int64 HSource,ref string sReturn) + { + try + { + DataSet Ds; + oCn.BeginTran(); + //鍒犻櫎涓昏〃 + //鎻掑叆瀛愯〃 + oCn.RunProc("EXEC h_p_Sc_ICMOReportBillSub_Insert " + omodel.HInterID.ToString() + "," + HSource.ToString() + ",'" + omodel.HBillNo + "'"); + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Sc_ICMOReportBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark,HEmpID" + + ",HGroupID,HDeptID,HCheckType,HWorkShift" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',getdate(),'" + omodel.HMaker + "',getdate()" + + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEmpID.ToString() + + "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckType + "','" + omodel.HWorkShift + "'" + + ") "); + + if (omodel.HCheckType == "鍚堟牸") + { + oCn.RunProc("update b set b.hbarcodestatus='姹囨姤',b.HQty = case when HReadyQty=0 then a.HQty else a.HQty+b.HQty end ,HReadyQty = a.HQty " + + "from (select HInterID,HBarCode,SUM(HQty) HQty from Sc_ICMOReportBillSub Group by HInterID,HBarCode)as a inner join Gy_BarCodeBill b on a.HBarCode=b.HBarCode " + + "Where a.HInterID=" + omodel.HInterID.ToString() + " "); + } + + //鏇存柊 鍏宠仈鏁伴噺 + //oCn.RunProc("EXEC h_p_K3_UpdateBillRelateData_ProdIn_New " + omodel.HInterID.ToString()); + //鏇存柊鍗曟嵁NEWid + //oCn.RunProc("UPDATE ICStockBill SET FUUID=NEWID() WHERE FInterID=" + omodel.HInterID.ToString()); + //瀹℃牳鍗曟嵁 + Ds = oCn.RunProcReturn("EXEC h_p_Sc_ICMOReportBill_Check " + omodel.HInterID.ToString() + ",'" + omodel.HMaker + "'", "h_p_Sc_ICMOReportBill_Check"); + if (Ds == null) + { + sReturn = "鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + oCn.RollBack(); + return false; + } + if (Ds.Tables[0].Rows.Count == 0) + { + //sReturn ="鍒ゆ柇鏉$爜姹囨姤鏁伴噺鍑洪敊锛�"; + //oCn.RollBack(); + //return false; + } + else + { + if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) >= 2) + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]); + oCn.RollBack(); + return false; + } + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + public string GetNewBillNo() + { + return ClsPub.CreateBillCode(BillType, ref ClsPub.sExeReturnInfo, true); + } + + public DataSet GetInfo(string lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_Sc_CheckICMOReportBill '" + lngBillKey + "'", "h_p_Sc_CheckICMOReportBill"); + if (Ds.Tables[0].Rows.Count == 0) + { + return Ds; + } + else + { + if (DBUtility.ClsPub.isInt(Ds.Tables[1].Rows[0][0]) != 0) + { + sReturn = Ds.Tables[1].Rows[0][1].ToString(); + return Ds; + } + else + { + return Ds; + } + + } + + } + catch (Exception e) + { + sReturn = e.Message; + return null; + } + + } + //鏂板鍗曟嵁 // 鎷嗙姹囨姤 + public bool AddBill_Cai_PDA(Int64 HSoureInterID, string sHBarCode, Int64 sHQty, Int64 sHQty1, ref string sReturn) + { + try + { + for (int i = 0; i < 2; i++) + { + long HQty = 0; + string Type = ""; + if (i == 0) + { + HQty = sHQty; + Type = "鍚堟牸"; + } + else + { + HQty = sHQty1; + Type = "涓嶅悎鏍�"; + } + long HInterID = 0; + string HBillNo = ""; + //寰楀埌mainid + HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + HBillNo = ClsPub.CreateBillCode(BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙� + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_Sc_CaiICMOReportBill '" + sHBarCode + "'," + HInterID.ToString() + "," + HQty.ToString() + ", '" + Type + "','" + HBillNo + "'," + HSoureInterID.ToString(), "h_p_Sc_CaiICMOReportBill"); + if (i == 1) + { + oCn.RunProc(" UpDate a set " + + " a.HDeleteMan='admin' " + + " ,a.HDeleteDate=getdate() " + + " from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID=b.HInterID " + + " where a.HInterID = " + HSoureInterID.ToString()); + oCn.RunProc("update Gy_BarCodeBill set hbarcodestatus='姹囨姤',HQty =case when HReadyQty=0 then " + sHQty.ToString() + " else HQty + " + sHQty.ToString() + " end ,HReadyQty= " + sHQty.ToString() + " where HBarCode = '" + sHBarCode + "'"); + } + oCn.Commit(); + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + + //鏍规嵁浠诲姟鍗� 杩斿洖 璇ヤ换鍔″崟涓婁竴娆℃眹鎶ョ殑鏈哄彴鍜屾搷浣滃伐 + public DataSet GetInfoByHICMOInterID(long HSourceInterID, string sWhere) + { + DataSet DS; + try + { + DS = oCn.RunProcReturn("Select top 1 * from h_v_Sc_ICMOReportBillList Where 婧愬崟涓诲唴鐮�=" + HSourceInterID.ToString() + sWhere + "order by hmainid desc", "h_v_Sc_ICMOReportBillList", ref DBUtility.ClsPub.sExeReturnInfo); + if (DS.Tables[0].Rows.Count == 0) + return null; + else + { + return DS; + } + } + catch (Exception e) + { + throw (e); + } + } + + //鍒犻櫎鍏宠仈 + public void DeleteRelation(Int64 lngBillKey) + { + oCn.RunProc("update b set b.HBarCodeStatus = case when b.HQty - a.HQty > 0 then '姹囨姤' else '' end " + + ",b.HQty = case when b.HQty - a.HQty > 0 then b.HQty-a.HQty else b.HinitQty end " + + ",b.HReadyQty = case when b.HQty - a.HQty > 0 then a.HQty else 0 end " + + "from (select HInterID,HBarCode,SUM(HQty) HQty from Sc_ICMOReportBillSub Group by HInterID,HBarCode)as a inner join Gy_BarCodeBill b on a.HBarCode=b.HBarCode " + + "Where a.HInterID=" + lngBillKey.ToString()); + } + + + + + } + +} diff --git a/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs b/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs new file mode 100644 index 0000000..5ffd1b2 --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs @@ -0,0 +1,262 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldLifeChangeBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldLifeChangeBillMain omodel = new Model.ClsSc_MouldLifeChangeBillMain(); + public List<Model.ClsSc_MouldLifeChangeBillSub> DetailColl = new List<Model.ClsSc_MouldLifeChangeBillSub>(); + + public ClsSc_MouldLifeChangeBill() + { + base.MvarItemKeySub = "Sc_MouldLifeChangeBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldLifeChangeBillMain"; + base.MvarReportTitle = "妯″叿瀵垮懡璋冩暣鍗�"; + base.BillType = "3824"; + base.HBillSubType = "3824"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldLifeChangeBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldLifeChangeBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HMangerID=" + omodel.HMangerID.ToString() + + //",HWHID=" + omodel.HWHID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HReason='" + omodel.HReason + "'" + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + + //",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldLifeChangeBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldLifeChangeBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate" + + ",HUnitID" + + ",HDesignLife,HLeaveLife,HNewLeaveLife" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + + "," + oSub.HUnitID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HNewLeaveLife.ToString() + + ") "); + } + // + //foreach (Model.ClsSc_MouldLifeChangeBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldLifeChangeBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HEmpID,HMangerID,HDeptID" + + ",HReason,HExplanation,HInnerBillNo" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HEmpID.ToString() + ", " + omodel.HMangerID.ToString() + ", " + omodel.HDeptID.ToString() + + ",'" + omodel.HReason + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldLifeChangeBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldLifeChangeBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate" + + ",HUnitID" + + ",HDesignLife,HLeaveLife,HNewLeaveLife" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + + "," + oSub.HUnitID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HNewLeaveLife.ToString() + + ") "); + } + // + //foreach (Model.ClsSc_MouldLifeChangeBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldLifeChangeBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldLifeChangeBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HReason = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReason"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + + + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldLifeChangeBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldLifeChangeBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldLifeChangeBillSub oSub = new Model.ClsSc_MouldLifeChangeBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]); + oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]); + oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HDesignLife"]); + oSub.HLeaveLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLeaveLife"]); + + oSub.HNewLeaveLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HNewLeaveLife"]); + + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } + +} diff --git a/WebAPI/DLL/ClsSc_MouldProdBackBill.cs b/WebAPI/DLL/ClsSc_MouldProdBackBill.cs new file mode 100644 index 0000000..d79bd49 --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldProdBackBill.cs @@ -0,0 +1,315 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldProdBackBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldProdBackBillMain omodel = new Model.ClsSc_MouldProdBackBillMain(); + public List<Model.ClsSc_MouldProdBackBillSub> DetailColl = new List<Model.ClsSc_MouldProdBackBillSub>(); + + public ClsSc_MouldProdBackBill() + { + base.MvarItemKeySub = "Sc_MouldStockBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldStockBillMain"; + base.MvarReportTitle = "妯″叿閫�搴撳崟"; + base.BillType = "3803"; + base.HBillSubType = "3803"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldProdBackBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldStockBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker+ "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HSupID=" + omodel.HSupID.ToString() + + ",HWHID=" + omodel.HWHID.ToString() + + ",HSCWHID=" + omodel.HSCWHID.ToString() + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HSecManagerID=" + omodel.HSecManagerID.ToString() + + ",HKeeperID=" + omodel.HKeeperID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo" + + //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" + + ",HQtyRel" + + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'" + + //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" + + "," + 0 + + ") "); + } + // + //foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdBackBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker+ "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl) + { + + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo"+ + //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" + + ",HQtyRel"+ + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'"+ + //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" + + ","+0+ + ") "); + } + // + //foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdBackBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldStockBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStockBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); + omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]); + omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]); + omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]); + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldStockBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldStockBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldProdBackBillSub oSub = new Model.ClsSc_MouldProdBackBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]); + oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]); + oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); + oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); + oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]); + oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]); + oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]); + oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]); + oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]); + oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]); + oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]); + oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]); + oSub.HDesignLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HDesignLife"]); + oSub.HLeaveLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HLeaveLife"]); + oSub.HUseLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLife"]); + //oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]); + //oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]); + //oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]); + //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); + //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); + //oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]); + + oSub.HNewModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNewModel"]); + oSub.HWallThickness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HWallThickness"]); + oSub.HHardness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HHardness"]); + oSub.HLastProdModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLastProdModel"]); + oSub.HDiameter = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDiameter"]); + oSub.HBackFlag = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBackFlag"]); + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } + +} diff --git a/WebAPI/DLL/ClsSc_MouldProdOutBill.cs b/WebAPI/DLL/ClsSc_MouldProdOutBill.cs new file mode 100644 index 0000000..a930d93 --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldProdOutBill.cs @@ -0,0 +1,390 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldProdOutBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldProdOutBillMain omodel = new Model.ClsSc_MouldProdOutBillMain(); + public List<Model.ClsSc_MouldStockBillSub> DetailColl = new List<Model.ClsSc_MouldStockBillSub>(); + + public ClsSc_MouldProdOutBill() + { + base.MvarItemKeySub = "Sc_MouldStockBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldStockBillMain"; + base.MvarReportTitle = "妯″叿棰嗙敤鍗�"; + base.BillType= "3802"; + base.HBillSubType = "3802"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldProdOutBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldStockBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker+ "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HSupID=" + omodel.HSupID.ToString() + + ",HWHID=" + omodel.HWHID.ToString() + + ",HSCWHID=" + omodel.HSCWHID.ToString() + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HSecManagerID=" + omodel.HSecManagerID.ToString() + + ",HKeeperID=" + omodel.HKeeperID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + ") "); + } + // + //foreach (Model.ClsSc_MouldProdOutBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ",HProcID"+ + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + "," + '0' + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + ") "); + } + // + //foreach (Model.ClsSc_MouldProdOutBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldStockBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStockBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); + omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]); + omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]); + omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]); + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldStockBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldStockBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]); + oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]); + oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); + oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); + oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]); + oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]); + oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]); + oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]); + oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]); + oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]); + oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]); + oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]); + oSub.HDesignLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HDesignLife"]); + oSub.HLeaveLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HLeaveLife"]); + oSub.HUseLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLife"]); + oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]); + oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]); + oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]); + oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); + oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); + oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]); + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + //浣跨敤瀵垮懡绱 + public Int64 Add1(Int64 HMould) + { + try + { + DataSet ds; + ds = oCn.RunProcReturn("Select sum(HUseLIfe) as sHUseLife from Sc_MouldStockBillSub Where HMaterID=" + HMould.ToString(), "Sc_MouldStockBillSub"); + if (ds.Tables[0].Rows.Count == 0) + { + + return 0; + } + else + { + + return DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["sHUseLife"]); + } + //return true; + } + catch (Exception e) + { + return -1; + //throw (e); + } + } + + + //鏉$爜鎵弿璁板綍,鏂板鍒颁骇鍝佸叆搴� + public bool AddBill_PDA(ref string sReturn) + { + try + { + DataSet Ds; + oCn.BeginTran(); + //鍒犻櫎涓昏〃 + oCn.RunProc("Delete From Sc_MouldStockBillMain where HInterID=" + omodel.HInterID.ToString()); + //鎻掑叆瀛愯〃 + oCn.RunProc("EXEC h_p_Sc_MouldProdOutBillSub_Insert " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'"); + //鎻掑叆涓昏〃 + oCn.RunProc("INSERT INTO Sc_MouldStockBillMain " + + "(FInterID,FBillNo,FBrNo,FTranType,FCancellation " + + ",FStatus,FUpStockWhenSave,FROB,FHookStatus,Fdate " + + ",FDeptID,FCheckDate " + + ",FFManagerID,FSManagerID,FBillerID " + + ",FMultiCheckDate1,FMultiCheckDate2,FMultiCheckDate3 " + + ",FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6 " + + ",FVchInterID,FSelTranType,FManageType,FPrintCount " + + ") VALUES (" + + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + this.BillType + "',0" + + ",0,0,1,0,convert(varchar(10),getdate(),120)" + + "," + omodel.HDeptID.ToString() + ",Null " + + "," + omodel.HKeeperID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HBillerID.ToString() + + ",null,null,null" + + ",null,null,null" + + ",0,85,0,0" + + ")"); + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + + //鏍规嵁鏉$爜妗f鑾峰彇淇℃伅 + public Model.ClsSc_MouldProdOutBillSub get_MouldProdOutInfoByBarCode(string sBarCode) + { + try + { + Model.ClsSc_MouldProdOutBillSub oSub = new Model.ClsSc_MouldProdOutBillSub(); + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutInfoByBarCode '" + sBarCode + "'", "xt_xtgnb", ref DBUtility.ClsPub.sExeReturnInfo); + if (Ds == null || Ds.Tables[0].Rows.Count == 0) + { + return null; + } + oSub.HMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HAmount"]); + oSub.HPrice = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HPrice"]); + oSub.HQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HQty"]); + oSub.HBarCode = sBarCode; + oSub.HBatchNo = Ds.Tables[0].Rows[0]["HBatchNo"].ToString(); + oSub.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]); + return oSub; + } + catch (Exception e) + { + DBUtility.ClsPub.sExeReturnInfo += "鏍规嵁鏉$爜鑾峰彇鐩稿簲淇℃伅澶辫触锛�" + e.Message; + return null; + } + } + + + + } + +} diff --git a/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs b/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs new file mode 100644 index 0000000..0744322 --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs @@ -0,0 +1,296 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldRepairCheckBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldRepairCheckBillMain omodel = new Model.ClsSc_MouldRepairCheckBillMain(); + public List<Model.ClsSc_MouldRepairCheckBillSub> DetailColl = new List<Model.ClsSc_MouldRepairCheckBillSub>(); + + public ClsSc_MouldRepairCheckBill() + { + base.MvarItemKeySub = "Sc_MouldRepairCheckBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldRepairCheckBillMain"; + base.MvarReportTitle="妯″叿缁翠慨楠屾敹鍗�"; + base.BillType="3817"; + base.HBillSubType = "3817"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldRepairCheckBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldRepairCheckBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + //",HStockType='" + omodel.HStockType + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker+ "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HMouldID=" + omodel.HMouldID.ToString() + + ",HCheckBeginDate='" + omodel.HCheckBeginDate + "'" + + ",HCheckResult='" + omodel.HCheckResult + "'" + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + + //",HDeptID=" + omodel.HDeptID.ToString() + + //",HDeptNumber='" + omodel.HDeptNumber +"'"+ + //",HEmpID=" + omodel.HEmpID.ToString() + + //",HEmpNumber='" + omodel.HEmpNumber +"'"+ + //",HGroupID=" + omodel.HGroupID.ToString() + + //",HWHID=" + omodel.HWHID.ToString() + + //",HSCWHID=" + omodel.HSCWHID.ToString() + + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldRepairCheckBillSub " + + " (HInterID,HEntryID" + + ",HManagerID,HRepairCheckID,HRepairCheckContent" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + + "," + oSub.HManagerID.ToString() + "," + oSub.HRepairCheckID.ToString() + ",'" + oSub.HRepairCheckContent + "'" + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'"+ + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + ") "); + } + // + //foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldRepairCheckBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldRepairCheckBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark" + + ",HMouldID,HCheckBeginDate,HCheckResult" + + ",HEmpID,HManagerID,HDeptID"+ + ",HInnerBillNo,HExplanation" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+ + "," + omodel.HMouldID.ToString() + ",'" + omodel.HCheckBeginDate + "','" + omodel.HCheckResult + "'" + + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + + ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldRepairCheckBillSub " + + " (HInterID,HEntryID" + + ",HManagerID,HRepairCheckID,HRepairCheckContent" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + + "," + oSub.HManagerID.ToString() + "," + oSub.HRepairCheckID.ToString() + ",'" + oSub.HRepairCheckContent + "'" + + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + ") "); + } + // + //foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldRepairCheckBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldRepairCheckBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldRepairCheckBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + //== + + omodel.HMouldID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMouldID"]); + omodel.HCheckBeginDate = Ds.Tables[0].Rows[0]["HCheckBeginDate"].ToString().Trim(); + omodel.HCheckResult = Ds.Tables[0].Rows[0]["HCheckResult"].ToString().Trim(); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldRepairCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldRepairCheckBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldRepairCheckBillSub oSub = new Model.ClsSc_MouldRepairCheckBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HRepairCheckID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairCheckID"]); + oSub.HRepairCheckContent = DsSub.Tables[0].Rows[i]["HRepairCheckContent"].ToString().Trim(); + oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]); + + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + //瀹℃牳 + //public bool CheckBill(Int64 lngBillKey, ref string sReturn) + //{ + + // try + // { + // string HChecker = DBUtility.ClsPub.CurUserName; + // string HCheckDate = DBUtility.ClsPub.GetServerDate(-1); + // oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); + // //鐢熸垚璋冩嫧鍗� + // //寰楀埌璋冩嫧鍗� mainid 鍗曟嵁鍙� + // long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo); + // string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙� + // oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'"); + // // + // sReturn = ""; + // return true; + // } + // catch (Exception e) + // { + // sReturn = e.Message; + // throw (e); + // } + //} + + + + + + } +} diff --git a/WebAPI/DLL/ClsSc_MouldScrapInBill.cs b/WebAPI/DLL/ClsSc_MouldScrapInBill.cs new file mode 100644 index 0000000..ab96eac --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldScrapInBill.cs @@ -0,0 +1,413 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldScrapInBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldStockBillMain omodel = new Model.ClsSc_MouldStockBillMain(); + public List<Model.ClsSc_MouldStockBillSub> DetailColl = new List<Model.ClsSc_MouldStockBillSub>(); + + public ClsSc_MouldScrapInBill() + { + base.MvarItemKeySub = "Sc_MouldStockBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldStockBillMain"; + base.MvarReportTitle = "妯″叿鎶ュ簾鍏ュ簱鍗�"; + base.BillType = "3831"; + base.HBillSubType = "3831"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldScrapInBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldStockBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HSupID=" + omodel.HSupID.ToString() + + ",HWHID=" + omodel.HWHID.ToString() + + ",HSCWHID=" + omodel.HSCWHID.ToString() + + ",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + ",HSecManagerID=" + omodel.HSecManagerID.ToString() + + ",HKeeperID=" + omodel.HKeeperID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo" + + //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + //",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" + + //",HQtyRel,HNewLifeQty,HNowModel,HNowLife" + + //",HMouldType,HInitModel,HInitDesignLife,HLifeUnitID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'" + + //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + //",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" + + //"," + 0 + "," + oSub.HNewLifeQty.ToString() + ",'" + oSub.HNowModel + "'," + oSub.HNowLife.ToString() + + //"," + oSub.HMouldType.ToString() + ",'" + oSub.HInitModel + "'," + oSub.HInitDesignLife.ToString() + "," + oSub.HLifeUnitID.ToString() + + ") "); + //if (oSub.HBackFlag == "鎶ュ簾鍏ュ簱") + //{ + // oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNewModel.ToString() + "'," + oSub.HNewLifeQty.ToString() + ",'鎶ュ簾'"); + //} + //else + //{ + // oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNewModel.ToString() + "'," + oSub.HNewLifeQty.ToString() + ",'鍦ㄥ簱'"); + //} + } + // + //oCn.RunProcReturn("exec h_p_Sc_MouldFileChangeStatus " + omodel.HInterID.ToString() + ",'鍦ㄥ簱'", "gy_czygl"); + //foreach (Model.ClsSc_MouldScrapInBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldScrapInBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + DataSet Ds; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBill_CheckKF " + omodel.HInterID + "," + oSub.HMaterID + "," + oSub.HWHID + "," + oSub.HSPID + ", 1", "gy_czygl"); + if (Ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "N") + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]) + ", 涓嶅厑璁镐繚瀛橈紒"; + oCn.RollBack(); + return false; + } + } + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife" + + ",HSCSPID,HSPGroupID,HBatchNo" + + //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + + //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + + //",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" + + //",HQtyRel,HNewLifeQty,HNowModel,HNowLife" + + //",HMouldType,HInitModel,HInitDesignLife,HLifeUnitID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'" + + //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + + //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + + //",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" + + //"," + 0 + "," + oSub.HNewLifeQty.ToString() + ",'" + oSub.HNowModel + "'," + oSub.HNowLife.ToString() + + //"," + oSub.HMouldType.ToString() + ",'" + oSub.HInitModel + "'," + oSub.HInitDesignLife.ToString() + "," + oSub.HLifeUnitID.ToString() + + ") "); + // + //if (oSub.HBackFlag == "鎶ュ簾鍏ュ簱") + //{ + // oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNewModel.ToString() + "'," + oSub.HNewLifeQty.ToString() + ",'鎶ュ簾'"); + //} + //else + //{ + // oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNewModel.ToString() + "'," + oSub.HNewLifeQty.ToString() + ",'鍦ㄥ簱'"); + //} + } + // + //foreach (Model.ClsSc_MouldScrapInBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldScrapInBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + DataSet Ds; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBill_CheckKF " + omodel.HInterID + "," + oSub.HMaterID + "," + oSub.HWHID + "," + oSub.HSPID + ", 1", "gy_czygl"); + if (Ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "N") + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]) + ", 涓嶅厑璁镐繚瀛橈紒"; + oCn.RollBack(); + return false; + } + } + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldStockBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStockBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); + omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]); + omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]); + omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]); + omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]); + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldStockBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldStockBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]); + oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]); + oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); + oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); + oSub.HPrice = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPrice"]); + oSub.HMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoney"]); + oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]); + oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]); + oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]); + oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]); + oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]); + oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]); + oSub.HDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HDesignLife"]); + oSub.HLeaveLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLeaveLife"]); + oSub.HUseLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HUseLife"]); + oSub.HUseLifeQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLifeQty"]); + //oSub.HNewLifeQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HNewLifeQty"]); + //oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]); + //oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]); + //oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]); + //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); + //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); + //oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]); + + //oSub.HNewModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNewModel"]); + //oSub.HWallThickness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HWallThickness"]); + //oSub.HHardness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HHardness"]); + //oSub.HLastProdModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLastProdModel"]); + //oSub.HDiameter = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDiameter"]); + //oSub.HBackFlag = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBackFlag"]); + //oSub.HNowModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNowModel"]); + //oSub.HNowLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HNowLife"]); + + //oSub.HMouldType = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMouldType"]); + //oSub.HInitModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HInitModel"]); + //oSub.HInitDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HInitDesignLife"]); + //oSub.HLifeUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HLifeUnitID"]); + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + //鏉$爜鎵弿璁板綍,鏂板鍒颁骇鍝佸叆搴� + public bool AddBill_PDA(ref string sReturn) + { + try + { + DataSet Ds; + oCn.BeginTran(); + //鍒犻櫎涓昏〃 + oCn.RunProc("Delete From Sc_MouldStockBillMain where HInterID=" + omodel.HInterID.ToString()); + //鎻掑叆瀛愯〃 + oCn.RunProc("EXEC h_p_Sc_MouldScrapInBillSub_Insert " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'"); + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',getdate()" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + ") "); + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + + + + } +} diff --git a/WebAPI/DLL/ClsSc_MouldScrapOutBill.cs b/WebAPI/DLL/ClsSc_MouldScrapOutBill.cs new file mode 100644 index 0000000..6886dbb --- /dev/null +++ b/WebAPI/DLL/ClsSc_MouldScrapOutBill.cs @@ -0,0 +1,419 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsSc_MouldScrapOutBill:DBUtility.ClsXt_BaseBill + { + public Model.ClsSc_MouldStockBillMain omodel = new Model.ClsSc_MouldStockBillMain(); + public List<Model.ClsSc_MouldStockBillSub> DetailColl = new List<Model.ClsSc_MouldStockBillSub>(); + + public ClsSc_MouldScrapOutBill() + { + base.MvarItemKeySub = "Sc_MouldStockBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Sc_MouldStockBillMain"; + base.MvarReportTitle = "妯″叿澶勭悊鍑哄簱鍗�"; + base.BillType="3832"; + base.HBillSubType = "3832"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsSc_MouldScrapOutBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Sc_MouldStockBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + omodel.HMaker + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HSupID=" + omodel.HSupID.ToString() + + ",HWHID=" + omodel.HWHID.ToString() + + //",HSCWHID=" + omodel.HSCWHID.ToString() + + //",HEmpID=" + omodel.HEmpID.ToString() + + ",HManagerID=" + omodel.HManagerID.ToString() + + //",HSecManagerID=" + omodel.HSecManagerID.ToString() + + ",HKeeperID=" + omodel.HKeeperID.ToString() + + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HExplanation='" + omodel.HExplanation + "'" + + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + + ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife" + + ",HSCSPID,HSPGroupID,HBatchNo,HUseLife" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HUseLife.ToString() + + + ") "); + + //oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNowModel.ToString() + "'," + oSub.HNowLife.ToString() + ",'鐢熶骇涓�'"); + } + // + //oCn.RunProcReturn("exec h_p_Sc_MouldFileChangeStatus " + omodel.HInterID.ToString() + ",'鐢熶骇涓�'", "gy_czygl"); + //foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldScrapOutBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + DataSet Ds; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBill_CheckKF " + omodel.HInterID + "," + oSub.HMaterID + "," + oSub.HWHID + "," + oSub.HSPID + ", -1", "gy_czygl"); + if (Ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "N") + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]) + ", 涓嶅厑璁镐繚瀛橈紒"; + oCn.RollBack(); + return false; + } + } + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HManagerID,HSCWHID,HEmpID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ""+ + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HSecManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + ") "); + //鎻掑叆瀛愯〃 + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife" + + ",HSCSPID,HSPGroupID,HBatchNo,HUseLife" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + + "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HUseLife.ToString() + + + ") "); + + //oCn.RunProc("exec h_p_Sc_MouldFileChangeStatus " + oSub.HMaterID.ToString() + ",'" + oSub.HNowModel.ToString() + "'," + oSub.HNowLife.ToString() + ",'鐢熶骇涓�'"); + } + // + //foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldScrapOutBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + DataSet Ds; + foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl) + { + Ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBill_CheckKF " + omodel.HInterID + "," + oSub.HMaterID + "," + oSub.HWHID + "," + oSub.HSPID + ", -1", "gy_czygl"); + if (Ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "N") + { + sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]) + ", 涓嶅厑璁镐繚瀛橈紒"; + oCn.RollBack(); + return false; + } + } + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Sc_MouldStockBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStockBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); + omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]); + //omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]); + //omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); + omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); + //omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]); + omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]); + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); + omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); + omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]); + + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Sc_MouldStockBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldStockBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); + oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]); + oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]); + oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]); + oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); + oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); + oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); + oSub.HPrice = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPrice"]); + oSub.HMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoney"]); + oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]); + oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]); + oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]); + oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]); + oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]); + oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]); + oSub.HDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HDesignLife"]); + oSub.HLeaveLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLeaveLife"]); + //oSub.HUseLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HUseLife"]); + //oSub.HMouldType = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMouldType"]); + //oSub.HInitModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HInitModel"]); + //oSub.HInitDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HInitDesignLife"]); + //oSub.HLifeUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HLifeUnitID"]); + //oSub.HNowModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNowModel"]); + //oSub.HNowLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HNowLife"]); + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + //浣跨敤瀵垮懡绱 + public Int64 Add1(Int64 HMould) + { + try + { + DataSet ds; + ds = oCn.RunProcReturn("Select sum(HUseLIfe) as sHUseLife from Sc_MouldStockBillSub Where HMaterID=" + HMould.ToString(), "Sc_MouldStockBillSub"); + if (ds.Tables[0].Rows.Count == 0) + { + + return 0; + } + else + { + + return DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["sHUseLife"]); + } + //return true; + } + catch (Exception e) + { + return -1; + //throw (e); + } + } + + + //鏉$爜鎵弿璁板綍,鏂板鍒颁骇鍝佸叆搴� + public bool AddBill_PDA(ref string sReturn) + { + try + { + DataSet Ds; + oCn.BeginTran(); + //鍒犻櫎涓昏〃 + oCn.RunProc("Delete From Sc_MouldStockBillMain where HInterID=" + omodel.HInterID.ToString()); + //鎻掑叆瀛愯〃 + oCn.RunProc("EXEC h_p_Sc_MouldScrapOutBillSub_Insert " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'"); + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',getdate()" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + + ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HManagerID.ToString() + + ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + + ") "); + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + + + //鏍规嵁鏉$爜妗f鑾峰彇淇℃伅 + public Model.ClsSc_MouldStockBillSub get_MouldProdOutInfoByBarCode(string sBarCode) + { + try + { + Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub(); + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutInfoByBarCode '" + sBarCode + "'", "xt_xtgnb", ref DBUtility.ClsPub.sExeReturnInfo); + if (Ds == null || Ds.Tables[0].Rows.Count == 0) + { + return null; + } + oSub.HMoney = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HAmount"]); + oSub.HPrice = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HPrice"]); + oSub.HQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HQty"]); + oSub.HBarCode = sBarCode; + oSub.HBatchNo = Ds.Tables[0].Rows[0]["HBatchNo"].ToString(); + oSub.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]); + return oSub; + } + catch (Exception e) + { + DBUtility.ClsPub.sExeReturnInfo += "鏍规嵁鏉$爜鑾峰彇鐩稿簲淇℃伅澶辫触锛�" + e.Message; + return null; + } + } + + + + } + +} diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index 61cd440..4e22484 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -345,7 +345,7 @@ return list; } - + /// <summary> /// 澶勭悊鏂板妫�楠屾柟妗堝瓙琛ㄧ殑json /// </summary> @@ -668,6 +668,326 @@ return list; } + /// <summary> + /// 澶勭悊鏂板璁惧缁翠慨涓昏〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Models.ClsSb_EquipRepairWorkBillMain> getObjectByJson_Gy_EquipRepairWorkBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsSb_EquipRepairWorkBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsSb_EquipRepairWorkBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板璁惧缁翠慨瀛愯〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Models.ClsSb_EquipRepairWorkBillSub> getObjectByJson_Gy_EquipRepairWorkBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsSb_EquipRepairWorkBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsSb_EquipRepairWorkBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板璁惧缁翠慨楠屾敹鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipRepairCheckBillMain> getObjectByJson_Gy_EquipRepairCheckBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipRepairCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipRepairCheckBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板璁惧缁翠慨楠屾敹鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipRepairCheckBillSub> getObjectByJson_Gy_EquipRepairCheckBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipRepairCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipRepairCheckBillSub>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板璁惧鏁呴殰鐧昏鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipConkBookBillMain> getObjectByJson_Gy_EquipConkBookBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipConkBookBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipConkBookBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板璁惧鏁呴殰鐧昏鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipConkBookBillSub> getObjectByJson_Gy_EquipConkBookBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipConkBookBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipConkBookBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 璁惧鐐规璁″垝 涓昏〃 + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + // ClsSb_EquipDotCheckPlanBillMain + public List<Model.ClsSb_EquipDotCheckPlanBillMain> getObjectByJson_Sb_EquipDotCheckPlanBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipDotCheckPlanBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipDotCheckPlanBillMain>>(jsonString); + return list; + } + /// <summary> + /// 璁惧鐐规璁″垝 瀛愯〃 + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + // ClsSb_EquipDotCheckPlanBillSub + public List<Model.ClsSb_EquipDotCheckPlanBillSub> getObjectByJson_Sb_EquipDotCheckPlanBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipDotCheckPlanBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipDotCheckPlanBillSub>>(jsonString); + return list; + } + + + + /// <summary> + /// 澶勭悊鏂板妯″叿鎶ュ簾鍏ュ簱鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldStockBillMain> getObjectByJson_Gy_MouldScrapInHouseBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldStockBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿鎶ュ簾鍏ュ簱鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldStockBillSub> getObjectByJson_Gy_MouldScrapInHouseBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldStockBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(jsonString); + return list; + } + + ///璁惧鐐规璁板綍琛� 涓昏〃 + ///ClsSb_EquipDotCheckBillMain + public List<Model.ClsSb_EquipDotCheckBillMain> getObjectByJson_Sb_EquipDotCheckBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipDotCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipDotCheckBillMain>>(jsonString); + return list; + } + ///璁惧鐐规璁板綍琛� 瀛愯〃 + ///ClsSb_EquipDotCheckBillSub + public List<Model.ClsSb_EquipDotCheckBillSub> getObjectByJson_Sb_EquipDotCheckBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipDotCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipDotCheckBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 璁惧淇濆吇璁″垝 涓昏〃 + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipMaintainPlanBillMain> getObjectByJson_Sb_EquipMaintainPlanBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipMaintainPlanBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipMaintainPlanBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 璁惧淇濆吇璁″垝 瀛愯〃 + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipMaintainPlanBillSub> getObjectByJson_Sb_EquipMaintainPlanBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipMaintainPlanBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipMaintainPlanBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 璁惧淇濆吇璁板綍 涓昏〃 + /// ClsSb_EquipMaintainBillMain + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipMaintainBillMain> getObjectByJson_Sb_EquipMaintainBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipMaintainBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipMaintainBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 璁惧淇濆吇璁板綍 瀛愯〃 + /// ClsSb_EquipMaintainBillSub + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSb_EquipMaintainBillSub> getObjectByJson_Sb_EquipMaintainBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSb_EquipMaintainBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipMaintainBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板妯″叿澶勭悊鍑哄簱鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldStockBillMain> getObjectByJson_Gy_MouldScrapOutHouseBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldStockBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿澶勭悊鍑哄簱鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldStockBillSub> getObjectByJson_Gy_MouldScrapOutHouseBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldStockBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿閫�搴撳崟涓昏〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldProdBackBillMain> getObjectByJson_Gy_MouldProdBackBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldProdBackBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdBackBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿閫�搴撳崟瀛愯〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldProdBackBillSub> getObjectByJson_Gy_MouldProdBackBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldProdBackBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdBackBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板妯″叿棰嗙敤鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldProdOutBillMain> getObjectByJson_Gy_MouldProdOutBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldProdOutBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿棰嗙敤鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldStockBillSub> getObjectByJson_Gy_MouldStockBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldStockBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板妯″叿瀵垮懡璋冩暣鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldLifeChangeBillMain> getObjectByJson_Gy_MouldLifeChangeBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldLifeChangeBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldLifeChangeBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿瀵垮懡璋冩暣鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldLifeChangeBillSub> getObjectByJson_Gy_MouldLifeChangeBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldLifeChangeBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldLifeChangeBillSub>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板鐢熶骇姹囨姤鍗曞崟涓昏〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_ICMOReportBillMain> getObjectByJson_Gy_ICMOReportBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_ICMOReportBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ICMOReportBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板鐢熶骇姹囨姤鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_ICMOReportBillSub> getObjectByJson_Gy_ICMOReportBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_ICMOReportBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ICMOReportBillSub>>(jsonString); + return list; + } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/WebAPI/Models/CheckItem.cs b/WebAPI/Models/CheckItem.cs new file mode 100644 index 0000000..afb9aaf --- /dev/null +++ b/WebAPI/Models/CheckItem.cs @@ -0,0 +1,30 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class CheckItem + { + public long HItemID { get; set; } //ID + public string HNumber { get; set; } //浠g爜 + public string HName { get; set; } //鍚嶇О + public string HShortNumber { get; set; } //鐭唬鐮� + public long HParentID { get; set; } //鐖剁骇ID + public long HLevel { get; set; } //灞傜骇 + public long HEndFlag { get; set; } // + + public string HHelpCode { get; set; } // 鍔╄鐮� + + public string HRemark { get; set; } //澶囨敞 + + public bool HStopflag { get; set; } //绂佺敤鏍囧織 + + public bool HUseFlag { get; set; } //浣跨敤鐘舵�� + + public long HQCCheckClassID { get; set; } //妫�楠岄」鐩被鍒獻D + + public string HQCCheckClassName { get; set; }//妫�楠岄」鐩被鍒� + } +} \ No newline at end of file diff --git a/WebAPI/Models/ClsSb_EquipRepairWorkBillMain.cs b/WebAPI/Models/ClsSb_EquipRepairWorkBillMain.cs new file mode 100644 index 0000000..9e4fc2f --- /dev/null +++ b/WebAPI/Models/ClsSb_EquipRepairWorkBillMain.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebAPI.Models +{ + public class ClsSb_EquipRepairWorkBillMain : DBUtility.ClsXt_BaseBillMain + { + + public Int64 HEmpID;// int --维修人 + public Int64 HManagerID;// int --负责人 + public Int64 HSecManagerID;// int --验收 + public Int64 HDeptID;// int --维修部门 + public string HExplanation;// varchar(200) --维修要求 + public string HInnerBillNo;// varchar(50) --内部单据号 + public string HRemark; //加工要求 + + public Int64 HEquipID;// int --设备ID(Gy_EquipMent) + public Int64 HRepairID;//int --维修项目(Gy_Repair) + public DateTime HRepairBeginDate;// datetime --维修开始日期 + public DateTime HRepairEndDate;//datetime --维修结束日期 + public string HRepairContent;//varchar(500) --维修内容 + public string HCycleUnit;//varchar(10) --时间单位(小时,天) + public Single HPlanTimes;// money --计划维修工时 + public Single HTimes;// money --实际维修工时 + + } +} diff --git a/WebAPI/Models/ClsSb_EquipRepairWorkBillSub.cs b/WebAPI/Models/ClsSb_EquipRepairWorkBillSub.cs new file mode 100644 index 0000000..cc4855e --- /dev/null +++ b/WebAPI/Models/ClsSb_EquipRepairWorkBillSub.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebAPI.Models +{ + public class ClsSb_EquipRepairWorkBillSub : DBUtility.ClsXt_BaseBillSub + { + public DateTime HEntryCloseDate;// datetime --行关闭 (默认为'') new + public string HRemark;// varchar(200) --备注 + + + public Int64 HRepairID; // int --维修项目 + public Int64 HEmpID; // int --负责人 + public string HRepairExplanation; // varchar(500)维修要求 + + public Int64 HManagerID1; // int --表体负责人ID + public Int64 HRepairID1; // int --表体维修项目ID + } +} diff --git a/WebAPI/Models/Gy_Group.cs b/WebAPI/Models/Gy_Group.cs new file mode 100644 index 0000000..7f3f1ea --- /dev/null +++ b/WebAPI/Models/Gy_Group.cs @@ -0,0 +1,27 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Gy_Group + { + public long HItemID { get; set; } + public string HNumber { get; set; } // 浠g爜 + public string HName { get; set; } // + public string HHelpCode { get; set; } //鍔╄鐮� + public string HShortNumber { get; set; } //鐭唬鐮� + public string HEndFlag { get; set; } //鏈骇鏍囧織 + public string HStopflag { get; set; } //绂佺敤鏍囧織 + public string HRemark { get; set; } //澶囨敞 + public string HUseFlag { get; set; } //浣跨敤鏍囧織 + public long HParentID { get; set; } //鐖剁骇ID + public long HDeptID { get; set; } + public long HEmpQty { get; set; } + public long HProcID { get; set; } + + public string HBarCodeForBase { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Gy_WorkCenter.cs b/WebAPI/Models/Gy_WorkCenter.cs new file mode 100644 index 0000000..37731a1 --- /dev/null +++ b/WebAPI/Models/Gy_WorkCenter.cs @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Gy_WorkCenter + { + public long HItemID { get; set; } + public string HNumber { get; set; } // 浠g爜 + public string HName { get; set; } // + public string HHelpCode { get; set; } //鍔╄鐮� + public string HShortNumber { get; set; } //鐭唬鐮� + public string HEndFlag { get; set; } //鏈骇鏍囧織 + public string HStopflag { get; set; } //绂佺敤鏍囧織 + public string HRemark { get; set; } //澶囨敞 + public string HUseFlag { get; set; } //浣跨敤鏍囧織 + public long HParentID { get; set; } //鐖剁骇ID + public long HDeptID { get; set; } + public long HWorkTimes { get; set; } + public long HQty { get; set; } + public long HProcID { get; set; } + public long HDayMoney { get; set; } + + public string HBarCodeForBase { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/MaintenanceAcceptItem.cs b/WebAPI/Models/MaintenanceAcceptItem.cs new file mode 100644 index 0000000..f66834b --- /dev/null +++ b/WebAPI/Models/MaintenanceAcceptItem.cs @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class MaintenanceAcceptItem + { + public long HItemID { get; set; } + public string HNumber { get; set; } //缁翠慨楠屾敹椤圭洰浠g爜 + public string HName { get; set; } //缁翠慨楠屾敹椤圭洰 + public string HHelpCode { get; set; } //鍔╄鐮� + public string HShortNumber { get; set; } //鐭唬鐮� + public string HEndFlag { get; set; } //鏈骇鏍囧織 + public string HStopflag { get; set; } //绂佺敤鏍囧織 + public string HRemark { get; set; } //澶囨敞 + public string HUseFlag { get; set; } //浣跨敤鏍囧織 + public long HParentID { get; set; } //鐖剁骇ID + + + + + + } +} \ No newline at end of file diff --git a/WebAPI/Models/MaintenanceMode.cs b/WebAPI/Models/MaintenanceMode.cs new file mode 100644 index 0000000..2f64bad --- /dev/null +++ b/WebAPI/Models/MaintenanceMode.cs @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class MaintenanceMode + { + public long HItemID { get; set; } + public string HNumber { get; set; } + public string HName { get; set; } + public string HShortNumber { get; set; } + public long HParentID { get; set; } + + public string HHelpCode { get; set; } + + public string HRemark { get; set; } + + public string HStopflag { get; set; } + + public string HUseFlag { get; set; } + + + } +} \ No newline at end of file diff --git "a/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Warehouse.cs" "b/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Warehouse.cs" new file mode 100644 index 0000000..813b237 --- /dev/null +++ "b/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Warehouse.cs" @@ -0,0 +1,33 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Warehouse + { + public bool HEndFlag { get; set; } + public string HHelpCode { get; set; } + public long HItemID { get; set; } + public long HLevel { get; set; } + public string HName { get; set; } + public string HNumber { get; set; } + public long HParentID { get; set; } + public string HRemark { get; set; } + public string HShortNumber { get; set; } + public bool HStopflag { get; set; } + public string HUseFlag { get; set; } + public Int64 HEmpID { get; set; } + public string HAddress { get; set; } + public string HPhone { get; set; } + public bool HIsStockMgr { get; set; } + public Int64 HSPGroupID { get; set; } + public string HBarCode { get; set; } + public Int64 HUSEORGID { get; set; } + public string HMaker { get; set; } + public string HUpDater { get; set; } + + + } +} \ No newline at end of file diff --git a/WebAPI/Properties/PublishProfiles/API.pubxml b/WebAPI/Properties/PublishProfiles/API.pubxml deleted file mode 100644 index 515a6ab..0000000 --- a/WebAPI/Properties/PublishProfiles/API.pubxml +++ /dev/null @@ -1,17 +0,0 @@ -锘�<?xml version="1.0" encoding="utf-8"?> -<!-- -鎮� Web 椤圭洰鐨勫彂甯�/鎵撳寘杩涚▼灏嗕娇鐢ㄦ鏂囦欢銆傛偍鍙互閫氳繃缂栬緫姝� MSBuild 鏂囦欢 -鏉ヨ嚜瀹氫箟璇ヨ繘绋嬬殑琛屼负銆傝嫢瑕佷簡瑙d笌姝ょ浉鍏崇殑璇︾粏淇℃伅锛岃璁块棶 http://go.microsoft.com/fwlink/?LinkID=208121銆� ---> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <WebPublishMethod>FileSystem</WebPublishMethod> - <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration> - <LastUsedPlatform>x86</LastUsedPlatform> - <SiteUrlToLaunchAfterPublish /> - <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> - <ExcludeApp_Data>False</ExcludeApp_Data> - <publishUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</publishUrl> - <DeleteExistingFiles>True</DeleteExistingFiles> - </PropertyGroup> -</Project> \ No newline at end of file diff --git a/WebAPI/Properties/PublishProfiles/API.pubxml.user b/WebAPI/Properties/PublishProfiles/API.pubxml.user index 82b65c4..f1ac8a5 100644 --- a/WebAPI/Properties/PublishProfiles/API.pubxml.user +++ b/WebAPI/Properties/PublishProfiles/API.pubxml.user @@ -7,12 +7,12 @@ <PropertyGroup> <TimeStampOfAssociatedLegacyPublishXmlFile /> <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl> - <History>True|2021-05-28T05:57:14.1993693Z;True|2021-05-28T09:42:13.2716745+08:00;True|2021-05-28T09:21:21.7815722+08:00;True|2021-05-28T09:17:59.1409780+08:00;True|2021-05-27T17:47:56.2640274+08:00;True|2021-05-27T14:41:19.9808548+08:00;True|2021-05-27T14:11:40.1924193+08:00;True|2021-05-27T13:37:42.5025517+08:00;True|2021-05-26T16:52:34.3234026+08:00;True|2021-05-26T15:14:15.9395791+08:00;True|2021-05-26T15:04:11.7364402+08:00;True|2021-05-26T14:26:20.5541211+08:00;True|2021-05-26T14:01:41.5357885+08:00;True|2021-05-25T17:51:07.3024087+08:00;True|2021-05-25T17:35:35.9642868+08:00;True|2021-05-25T17:06:01.1192559+08:00;True|2021-05-25T16:52:15.2304370+08:00;True|2021-05-25T16:12:13.5664530+08:00;True|2021-05-25T16:08:27.7007589+08:00;True|2021-05-25T15:58:36.5187538+08:00;True|2021-05-25T15:58:01.0527811+08:00;True|2021-05-25T15:54:45.0576223+08:00;True|2021-05-25T14:18:51.3134586+08:00;True|2021-05-25T11:28:15.6460627+08:00;True|2021-05-25T11:27:17.4884199+08:00;True|2021-05-25T11:26:04.5332872+08:00;True|2021-05-25T09:39:11.8882456+08:00;True|2021-05-23T23:05:37.3855541+08:00;True|2021-05-22T05:45:13.7439233+08:00;True|2021-05-22T05:42:35.4852011+08:00;True|2021-05-22T05:25:16.8821260+08:00;True|2021-05-21T15:58:20.5625475+08:00;True|2021-05-21T15:55:21.1943961+08:00;True|2021-05-21T15:53:35.6852027+08:00;True|2021-05-21T15:46:56.7370418+08:00;True|2021-05-21T15:32:49.2494690+08:00;True|2021-05-21T15:19:19.8145510+08:00;True|2021-05-21T10:16:44.9563480+08:00;True|2021-05-20T19:21:19.8572280+08:00;True|2021-05-20T19:15:57.2506092+08:00;True|2021-05-20T15:58:09.0123323+08:00;True|2021-05-20T15:54:54.6251445+08:00;True|2021-05-20T15:32:04.9783034+08:00;True|2021-05-20T15:31:58.9418248+08:00;True|2021-05-20T15:31:53.2904235+08:00;True|2021-05-20T15:31:48.5385850+08:00;True|2021-05-20T13:31:35.5777988+08:00;True|2021-05-20T10:46:01.6559203+08:00;True|2021-05-20T10:40:53.2131788+08:00;True|2021-05-20T08:58:49.3511837+08:00;True|2021-05-19T16:15:22.7730518+08:00;True|2021-05-19T16:13:03.2756422+08:00;True|2021-05-19T16:11:16.3163692+08:00;True|2021-05-19T15:31:19.7575868+08:00;True|2021-05-19T14:49:47.6104541+08:00;True|2021-05-19T10:46:17.6515193+08:00;True|2021-05-19T10:45:23.6466498+08:00;True|2021-05-18T17:19:36.9591198+08:00;True|2021-05-18T17:16:38.1513255+08:00;True|2021-05-18T10:31:35.2246444+08:00;True|2021-05-17T16:36:00.1226059+08:00;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> + <History>True|2021-06-07T06:44:12.1915959Z;True|2021-06-04T15:58:32.1394491+08:00;True|2021-06-03T14:45:45.5738204+08:00;True|2021-06-01T21:40:14.5889898+08:00;True|2021-06-01T10:45:03.3856917+08:00;True|2021-05-31T19:02:46.8042092+08:00;True|2021-05-31T18:47:52.0278748+08:00;True|2021-05-31T18:42:39.2743903+08:00;True|2021-05-31T17:42:32.1696215+08:00;True|2021-05-31T17:34:46.2817423+08:00;True|2021-05-31T17:24:43.0246592+08:00;True|2021-05-31T16:46:12.3040179+08:00;True|2021-05-31T14:53:09.9410043+08:00;True|2021-05-31T13:02:37.5818554+08:00;True|2021-05-31T12:50:26.7987391+08:00;True|2021-05-28T13:57:14.1993693+08:00;True|2021-05-28T09:42:13.2716745+08:00;True|2021-05-28T09:21:21.7815722+08:00;True|2021-05-28T09:17:59.1409780+08:00;True|2021-05-27T17:47:56.2640274+08:00;True|2021-05-27T14:41:19.9808548+08:00;True|2021-05-27T14:11:40.1924193+08:00;True|2021-05-27T13:37:42.5025517+08:00;True|2021-05-26T16:52:34.3234026+08:00;True|2021-05-26T15:14:15.9395791+08:00;True|2021-05-26T15:04:11.7364402+08:00;True|2021-05-26T14:26:20.5541211+08:00;True|2021-05-26T14:01:41.5357885+08:00;True|2021-05-25T17:51:07.3024087+08:00;True|2021-05-25T17:35:35.9642868+08:00;True|2021-05-25T17:06:01.1192559+08:00;True|2021-05-25T16:52:15.2304370+08:00;True|2021-05-25T16:12:13.5664530+08:00;True|2021-05-25T16:08:27.7007589+08:00;True|2021-05-25T15:58:36.5187538+08:00;True|2021-05-25T15:58:01.0527811+08:00;True|2021-05-25T15:54:45.0576223+08:00;True|2021-05-25T14:18:51.3134586+08:00;True|2021-05-25T11:28:15.6460627+08:00;True|2021-05-25T11:27:17.4884199+08:00;True|2021-05-25T11:26:04.5332872+08:00;True|2021-05-25T09:39:11.8882456+08:00;True|2021-05-23T23:05:37.3855541+08:00;True|2021-05-22T05:45:13.7439233+08:00;True|2021-05-22T05:42:35.4852011+08:00;True|2021-05-22T05:25:16.8821260+08:00;True|2021-05-21T15:58:20.5625475+08:00;True|2021-05-21T15:55:21.1943961+08:00;True|2021-05-21T15:53:35.6852027+08:00;True|2021-05-21T15:46:56.7370418+08:00;True|2021-05-21T15:32:49.2494690+08:00;True|2021-05-21T15:19:19.8145510+08:00;True|2021-05-21T10:16:44.9563480+08:00;True|2021-05-20T19:21:19.8572280+08:00;True|2021-05-20T19:15:57.2506092+08:00;True|2021-05-20T15:58:09.0123323+08:00;True|2021-05-20T15:54:54.6251445+08:00;True|2021-05-20T15:32:04.9783034+08:00;True|2021-05-20T15:31:58.9418248+08:00;True|2021-05-20T15:31:53.2904235+08:00;True|2021-05-20T15:31:48.5385850+08:00;True|2021-05-20T13:31:35.5777988+08:00;True|2021-05-20T10:46:01.6559203+08:00;True|2021-05-20T10:40:53.2131788+08:00;True|2021-05-20T08:58:49.3511837+08:00;True|2021-05-19T16:15:22.7730518+08:00;True|2021-05-19T16:13:03.2756422+08:00;True|2021-05-19T16:11:16.3163692+08:00;True|2021-05-19T15:31:19.7575868+08:00;True|2021-05-19T14:49:47.6104541+08:00;True|2021-05-19T10:46:17.6515193+08:00;True|2021-05-19T10:45:23.6466498+08:00;True|2021-05-18T17:19:36.9591198+08:00;True|2021-05-18T17:16:38.1513255+08:00;True|2021-05-18T10:31:35.2246444+08:00;True|2021-05-17T16:36:00.1226059+08:00;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> </PropertyGroup> <ItemGroup> <File Include="apiapp.json"> <publishTime>04/12/2021 11:33:15</publishTime> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="bin/Antlr3.Runtime.dll"> <publishTime>02/22/2013 08:43:40</publishTime> @@ -27,25 +27,25 @@ <publishTime>05/07/2021 20:31:20</publishTime> </File> <File Include="bin/BLL.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/DAL.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/Dapper.dll"> <publishTime>07/22/2016 14:52:40</publishTime> </File> <File Include="bin/DBUtility.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/Kingdee.BOS.WebApi.Client.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/Kingdee.BOS.WebApi.FormService.dll"> - <publishTime>09/20/2018 19:23:20</publishTime> + <publishTime>04/26/2020 09:57:16</publishTime> </File> <File Include="bin/Kingdee.BOS.WebApi.ServicesStub.dll"> - <publishTime>09/20/2018 19:28:34</publishTime> + <publishTime>04/26/2020 09:57:16</publishTime> </File> <File Include="bin/Microsoft.Azure.AppService.ApiApps.Service.dll"> <publishTime>03/18/2015 17:02:50</publishTime> @@ -57,7 +57,7 @@ <publishTime>07/25/2012 11:48:56</publishTime> </File> <File Include="bin/Model.dll"> - <publishTime>05/20/2021 17:29:58</publishTime> + <publishTime>06/02/2021 13:19:20</publishTime> </File> <File Include="bin/Newtonsoft.Json.dll"> <publishTime>08/03/2014 20:33:56</publishTime> @@ -66,13 +66,13 @@ <publishTime>01/04/2011 13:48:18</publishTime> </File> <File Include="bin/Pub_Class.dll"> - <publishTime>05/21/2020 10:51:50</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/Pub_Control.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/SQLHelper.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/Swashbuckle.Core.dll"> <publishTime>02/15/2015 17:57:08</publishTime> @@ -138,7 +138,7 @@ <publishTime>11/28/2018 13:01:00</publishTime> </File> <File Include="bin/System.Web.Http.WebHost.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="bin/System.Web.Mvc.dll"> <publishTime>01/28/2015 04:02:18</publishTime> @@ -171,10 +171,10 @@ <publishTime>11/24/2014 11:18:48</publishTime> </File> <File Include="bin/WebAPI.dll"> - <publishTime>06/02/2021 14:59:04</publishTime> + <publishTime>06/02/2021 20:00:43</publishTime> </File> <File Include="bin/WebAPI.pdb"> - <publishTime>06/02/2021 14:59:04</publishTime> + <publishTime>06/02/2021 20:00:43</publishTime> </File> <File Include="bin/WebAPI.XmlSerializers.dll"> <publishTime>02/04/2021 21:35:21</publishTime> @@ -192,166 +192,166 @@ <publishTime>03/26/2019 14:23:20</publishTime> </File> <File Include="Content/bootstrap.css"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="Content/bootstrap.min.css"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="Content/Site.css"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/BLL.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/DAL.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/DBUtility.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/Kingdee.BOS.WebApi.Client.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/Model.dll"> - <publishTime>05/20/2021 17:29:58</publishTime> + <publishTime>06/02/2021 13:19:20</publishTime> </File> <File Include="DLL/Newtonsoft.Json.Net35.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/Pub_Class.dll"> - <publishTime>05/21/2020 10:51:50</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/Pub_Control.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="DLL/SQLHelper.dll"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="fonts/glyphicons-halflings-regular.eot"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="fonts/glyphicons-halflings-regular.svg"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="fonts/glyphicons-halflings-regular.ttf"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="fonts/glyphicons-halflings-regular.woff"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Global.asax"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="Index.html"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:15</publishTime> </File> <File Include="packages.config"> - <publishTime>01/21/2021 13:19:40</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="PrecompiledApp.config"> <publishTime>05/07/2021 20:31:19</publishTime> </File> <File Include="Views/Scripts/bootstrap.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/bootstrap.min.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery-1.10.2.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery-1.10.2.min.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery-1.10.2.min.map"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery.validate.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery.validate.min.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery.validate.unobtrusive.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Scripts/modernizr-2.6.2.js"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Shared/Error.cshtml"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/Shared/_Layout.cshtml"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/web.config"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Views/_ViewStart.cshtml"> - <publishTime>01/13/2021 21:47:30</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_Department_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource"> - <publishTime>02/22/2021 09:25:21</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Customer_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Department_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Employee_Model.datasource"> - <publishTime>02/22/2021 09:25:21</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Group_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Source_Model.datasource"> - <publishTime>02/22/2021 09:25:21</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource"> - <publishTime>02/22/2021 09:25:21</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource"> - <publishTime>02/22/2021 09:25:20</publishTime> + <publishTime>05/25/2021 14:18:16</publishTime> </File> <File Include="Web.config"> - <publishTime>06/02/2021 14:59:11</publishTime> + <publishTime>06/02/2021 20:00:48</publishTime> </File> </ItemGroup> </Project> \ No newline at end of file diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml index d16ec41..9250916 100644 --- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml +++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,13 +4,14 @@ --> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> - <DeleteExistingFiles>False</DeleteExistingFiles> + <DeleteExistingFiles>True</DeleteExistingFiles> <ExcludeApp_Data>False</ExcludeApp_Data> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> - <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> - <LastUsedPlatform>Any CPU</LastUsedPlatform> + <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration> + <LastUsedPlatform>x86</LastUsedPlatform> <PublishProvider>FileSystem</PublishProvider> <PublishUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</PublishUrl> <WebPublishMethod>FileSystem</WebPublishMethod> + <SiteUrlToLaunchAfterPublish /> </PropertyGroup> </Project> \ No newline at end of file diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user index a32fee2..aeeb927 100644 --- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -3,4 +3,328 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> -</Project> + <PropertyGroup> + <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl> + <History>True|2021-06-15T07:33:42.0100494Z;True|2021-06-15T15:28:39.7145659+08:00;True|2021-06-15T15:15:02.7939125+08:00;True|2021-06-15T14:49:14.2300396+08:00;True|2021-06-15T14:42:28.1198064+08:00;True|2021-06-15T13:30:12.7997686+08:00;True|2021-06-15T13:25:37.7284670+08:00;True|2021-06-15T13:23:43.6207813+08:00;False|2021-06-15T13:23:19.4190232+08:00;True|2021-06-15T13:16:38.5062674+08:00;True|2021-06-15T13:03:31.2055635+08:00;True|2021-06-15T12:58:43.1653215+08:00;True|2021-06-15T12:39:22.8442109+08:00;True|2021-06-15T12:35:09.1288556+08:00;False|2021-06-15T12:33:50.0723143+08:00;True|2021-06-15T11:28:01.9733727+08:00;True|2021-06-15T11:26:26.6569392+08:00;True|2021-06-15T11:22:43.0366435+08:00;True|2021-06-15T11:07:50.1610580+08:00;True|2021-06-15T10:32:59.1925931+08:00;True|2021-06-10T17:16:57.9552310+08:00;True|2021-06-10T16:44:42.2731836+08:00;True|2021-06-10T14:39:27.6745737+08:00;True|2021-06-10T12:15:05.1524413+08:00;True|2021-06-09T18:19:24.1005606+08:00;True|2021-06-09T17:56:09.5646288+08:00;True|2021-06-09T13:34:06.1882292+08:00;True|2021-06-09T13:29:54.5924933+08:00;True|2021-06-09T13:25:55.7520662+08:00;True|2021-06-09T13:07:47.6686811+08:00;True|2021-06-09T12:59:41.2595048+08:00;True|2021-06-09T12:45:27.1305548+08:00;True|2021-06-09T12:29:52.1418191+08:00;True|2021-06-09T12:24:12.7610588+08:00;True|2021-06-09T11:31:25.3409568+08:00;True|2021-06-09T09:57:44.4387175+08:00;True|2021-06-09T09:54:26.5161307+08:00;True|2021-06-09T09:14:14.7288045+08:00;True|2021-06-09T09:10:25.1812139+08:00;True|2021-06-09T08:46:21.6585123+08:00;True|2021-06-08T19:56:55.7192062+08:00;True|2021-06-08T19:52:59.0326821+08:00;True|2021-06-08T19:49:13.6274217+08:00;True|2021-06-08T19:09:22.1038939+08:00;True|2021-06-08T15:28:41.3716247+08:00;True|2021-06-08T15:26:47.2621178+08:00;True|2021-06-08T13:49:45.8936617+08:00;True|2021-06-08T13:43:18.8115502+08:00;True|2021-06-08T10:04:06.2200731+08:00;True|2021-06-08T09:17:10.0470792+08:00;True|2021-06-08T08:44:37.4395849+08:00;True|2021-06-08T00:01:09.3745613+08:00;True|2021-06-07T23:49:31.5196888+08:00;True|2021-06-07T23:41:00.8017855+08:00;True|2021-06-07T23:21:53.1371134+08:00;True|2021-06-07T23:01:27.5712153+08:00;True|2021-06-07T22:36:12.9274014+08:00;True|2021-06-07T22:23:00.6545134+08:00;True|2021-06-07T17:44:47.5686346+08:00;True|2021-06-07T17:17:01.3431233+08:00;True|2021-06-07T16:53:28.9989587+08:00;True|2021-06-07T16:41:10.4975607+08:00;True|2021-06-07T14:21:06.8176477+08:00;True|2021-06-07T14:10:39.0355659+08:00;True|2021-06-07T12:34:31.4562732+08:00;True|2021-06-07T12:28:44.9629488+08:00;True|2021-06-07T10:30:26.9387988+08:00;True|2021-06-07T09:12:14.7658099+08:00;True|2021-06-07T08:37:19.6353792+08:00;True|2021-06-07T08:35:25.2031954+08:00;True|2021-06-05T07:07:32.0541266+08:00;True|2021-06-05T06:44:35.9475270+08:00;True|2021-06-05T06:37:27.4595197+08:00;True|2021-06-05T06:26:59.7663998+08:00;True|2021-06-05T05:43:12.8699318+08:00;True|2021-06-04T17:00:41.2426007+08:00;True|2021-06-04T16:08:03.8078072+08:00;True|2021-06-04T15:47:21.6412616+08:00;True|2021-06-04T15:21:02.4239800+08:00;True|2021-06-04T15:20:37.8641854+08:00;True|2021-06-04T13:38:51.5088395+08:00;True|2021-06-04T10:20:01.7784282+08:00;True|2021-06-04T10:13:50.3548857+08:00;True|2021-06-04T10:11:25.5017821+08:00;True|2021-06-04T10:09:51.6792228+08:00;True|2021-06-04T10:02:39.5851057+08:00;True|2021-06-04T09:30:40.4495494+08:00;True|2021-06-03T13:16:36.0317546+08:00;True|2021-06-03T13:12:47.0402047+08:00;True|2021-06-02T14:37:08.9683351+08:00;True|2021-06-02T14:10:15.7439829+08:00;True|2021-06-02T13:59:46.5841931+08:00;True|2021-06-02T13:25:18.7962660+08:00;True|2021-06-02T13:23:16.2261980+08:00;True|2021-06-01T15:37:32.2495085+08:00;True|2021-06-01T15:21:01.2856122+08:00;True|2021-06-01T15:13:36.7262365+08:00;True|2021-06-01T15:10:26.8905629+08:00;True|2021-06-01T14:56:17.5231551+08:00;True|2021-06-01T14:38:39.7895927+08:00;True|2021-06-01T14:23:12.3265287+08:00;True|2021-03-01T09:11:31.3226422+08:00;True|2021-05-26T14:54:56.9426462+08:00;True|2021-05-26T13:57:33.7780451+08:00;True|2021-05-26T13:39:02.8043358+08:00;True|2021-02-25T16:01:40.2917200+08:00;True|2021-02-25T15:49:46.6681205+08:00;True|2021-02-25T15:16:30.9372640+08:00;True|2021-05-25T13:10:21.7831921+08:00;True|2021-05-25T11:21:38.5224475+08:00;True|2021-05-25T11:12:52.0637175+08:00;True|2021-05-25T11:02:18.4164663+08:00;True|2021-05-25T10:52:06.8998521+08:00;True|2021-05-25T10:50:45.0929606+08:00;True|2021-05-25T10:45:54.1498313+08:00;True|2021-05-25T10:39:27.8602249+08:00;True|2021-05-25T10:34:49.5771162+08:00;True|2021-05-25T10:17:30.3009163+08:00;True|2021-05-25T10:14:03.8512581+08:00;True|2021-05-25T10:05:33.4343836+08:00;True|2021-05-24T17:01:23.3221168+08:00;True|2021-05-24T10:11:24.0197347+08:00;False|2021-05-24T10:11:07.6338995+08:00;</History> + </PropertyGroup> + <ItemGroup> + <File Include="apiapp.json"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="bin/Antlr3.Runtime.dll"> + <publishTime>02/22/2013 08:43:40</publishTime> + </File> + <File Include="bin/Antlr3.Runtime.pdb"> + <publishTime>02/22/2013 08:43:40</publishTime> + </File> + <File Include="bin/BLL.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/DAL.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/Dapper.dll"> + <publishTime>07/22/2016 14:52:40</publishTime> + </File> + <File Include="bin/DBUtility.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/Kingdee.BOS.WebApi.Client.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/Microsoft.Azure.AppService.ApiApps.Service.dll"> + <publishTime>03/18/2015 17:02:50</publishTime> + </File> + <File Include="bin/Microsoft.CSharp.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/Microsoft.Web.Infrastructure.dll"> + <publishTime>07/25/2012 11:48:56</publishTime> + </File> + <File Include="bin/Model.dll"> + <publishTime>06/02/2021 13:19:20</publishTime> + </File> + <File Include="bin/Newtonsoft.Json.dll"> + <publishTime>08/03/2014 20:33:56</publishTime> + </File> + <File Include="bin/Pub_Class.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/Pub_Control.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/SQLHelper.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/Swashbuckle.Core.dll"> + <publishTime>02/15/2015 17:57:08</publishTime> + </File> + <File Include="bin/System.ComponentModel.DataAnnotations.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Configuration.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Data.DataSetExtensions.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Data.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Drawing.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.EnterpriseServices.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.IdentityModel.Tokens.Jwt.dll"> + <publishTime>08/19/2014 10:03:34</publishTime> + </File> + <File Include="bin/System.Net.Http.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Net.Http.Formatting.dll"> + <publishTime>11/28/2018 13:00:36</publishTime> + </File> + <File Include="bin/System.Runtime.Serialization.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.ApplicationServices.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.Cors.dll"> + <publishTime>11/28/2018 12:58:44</publishTime> + </File> + <File Include="bin/System.Web.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.DynamicData.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.Entity.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.Extensions.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.Helpers.dll"> + <publishTime>01/28/2015 04:04:30</publishTime> + </File> + <File Include="bin/System.Web.Http.Cors.dll"> + <publishTime>11/28/2018 13:01:26</publishTime> + </File> + <File Include="bin/System.Web.Http.dll"> + <publishTime>11/28/2018 13:01:00</publishTime> + </File> + <File Include="bin/System.Web.Http.WebHost.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="bin/System.Web.Mvc.dll"> + <publishTime>01/28/2015 04:02:18</publishTime> + </File> + <File Include="bin/System.Web.Optimization.dll"> + <publishTime>02/11/2014 15:26:04</publishTime> + </File> + <File Include="bin/System.Web.Razor.dll"> + <publishTime>01/28/2015 04:02:32</publishTime> + </File> + <File Include="bin/System.Web.Services.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Web.WebPages.Deployment.dll"> + <publishTime>01/28/2015 04:04:30</publishTime> + </File> + <File Include="bin/System.Web.WebPages.dll"> + <publishTime>01/28/2015 04:04:30</publishTime> + </File> + <File Include="bin/System.Web.WebPages.Razor.dll"> + <publishTime>01/28/2015 04:04:30</publishTime> + </File> + <File Include="bin/System.Xml.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/System.Xml.Linq.dll"> + <publishTime>09/26/2012 03:16:08</publishTime> + </File> + <File Include="bin/WebActivatorEx.dll"> + <publishTime>11/24/2014 11:18:48</publishTime> + </File> + <File Include="bin/WebAPI.dll"> + <publishTime>06/15/2021 15:33:36</publishTime> + </File> + <File Include="bin/WebAPI.pdb"> + <publishTime>06/15/2021 15:33:36</publishTime> + </File> + <File Include="bin/WebGrease.dll"> + <publishTime>07/17/2013 17:03:52</publishTime> + </File> + <File Include="bin/zh-Hans/System.Net.Http.Formatting.resources.dll"> + <publishTime>11/29/2018 13:26:02</publishTime> + </File> + <File Include="bin/zh-Hans/System.Web.Http.resources.dll"> + <publishTime>11/29/2018 13:26:30</publishTime> + </File> + <File Include="Content/bootstrap.css"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="Content/bootstrap.min.css"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="Content/Site.css"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/BLL.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/DAL.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/DBUtility.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/Kingdee.BOS.WebApi.Client.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/Model.dll"> + <publishTime>06/02/2021 13:19:20</publishTime> + </File> + <File Include="DLL/Newtonsoft.Json.Net35.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/Pub_Class.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/Pub_Control.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="DLL/SQLHelper.dll"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="fonts/glyphicons-halflings-regular.eot"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="fonts/glyphicons-halflings-regular.svg"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="fonts/glyphicons-halflings-regular.ttf"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="fonts/glyphicons-halflings-regular.woff"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Global.asax"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="Index.html"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json"> + <publishTime>05/25/2021 14:18:15</publishTime> + </File> + <File Include="packages.config"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/bootstrap.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/bootstrap.min.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery-1.10.2.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery-1.10.2.min.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery-1.10.2.min.map"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery.validate.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery.validate.min.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery.validate.unobtrusive.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Scripts/modernizr-2.6.2.js"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Shared/Error.cshtml"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/Shared/_Layout.cshtml"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/web.config"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Views/_ViewStart.cshtml"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_Department_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Customer_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Department_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Employee_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Group_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Source_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource"> + <publishTime>05/25/2021 14:18:16</publishTime> + </File> + <File Include="Web.config"> + <publishTime>06/15/2021 15:33:41</publishTime> + </File> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index b9cf0cf..aa5e5c3 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -314,6 +314,11 @@ <Compile Include="App_Start\RouteConfig.cs" /> <Compile Include="App_Start\SwaggerConfig.cs" /> <Compile Include="App_Start\WebApiConfig.cs" /> + <Compile Include="Controllers\BaseSet\Gy_QCCheckClassController.cs" /> + <Compile Include="Controllers\BaseSet\Gy_CheckItemController.cs" /> + <Compile Include="Controllers\BaseSet\Gy_MaintenanceAcceptItemController.cs" /> + <Compile Include="Controllers\BaseSet\Gy_MaintenanceItemController.cs" /> + <Compile Include="Controllers\BaseSet\Gy_MaintenanceModeController.cs" /> <Compile Include="Controllers\BaseSet\Gy_WorkCenterController.cs" /> <Compile Include="Controllers\BaseSet\Gy_CurrencyController.cs" /> <Compile Include="Controllers\BaseSet\Gy_UnitController.cs" /> @@ -345,10 +350,20 @@ <Compile Include="Controllers\CJGL\Cj_StationInBillController.cs" /> <Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" /> <Compile Include="Controllers\JHGL\Gy_RoutingBillController.cs" /> + <Compile Include="Controllers\PublicPageMethodController.cs" /> <Compile Include="Controllers\QC_ManagementController.cs" /> + <Compile Include="Controllers\SBGL\Sb_EquipDotCheckBillController.cs" /> + <Compile Include="Controllers\SBGL\Sb_EquipMaintainBillController.cs" /> + <Compile Include="Controllers\SBGL\Sb_EquipMaintainPlanBillController.cs" /> + <Compile Include="Controllers\SBGL\Sb_EquipDotCheckPlanBillController.cs" /> + <Compile Include="Controllers\Sb_CheckEqpRepairWorkBillController.cs" /> + <Compile Include="Controllers\SCGL\Sc_MaterToSourceBillController.cs" /> + <Compile Include="Controllers\SCGL\Sc_MESStopWorkBillController.cs" /> + <Compile Include="Controllers\SCGL\Sc_MESBeginWorkBillController.cs" /> <Compile Include="Controllers\SCGL\QC_LastPieceCheckBillController.cs" /> <Compile Include="Controllers\SCGL\QC_OutCompCheckBillController.cs" /> <Compile Include="Controllers\SCGL\QC_ProcessCheckBillController.cs" /> + <Compile Include="Controllers\SCGL\Sc_QualityReportBillController.cs" /> <Compile Include="Controllers\Sc_ProcessMangementController.cs" /> <Compile Include="Controllers\CJGL\Cj_StationEntrustInBillController.cs" /> <Compile Include="Controllers\LMESController.cs" /> @@ -366,6 +381,16 @@ <Compile Include="DLL\ClsGy_BadReason_Ctl.cs" /> <Compile Include="DLL\ClsQC_NoPassProdCheckBill.cs" /> <Compile Include="DLL\ClsQC_PatrolProcCheckBill.cs" /> + <Compile Include="DLL\ClsSb_EquipConkBookBill.cs" /> + <Compile Include="DLL\ClsSb_EquipRepairCheckBill.cs" /> + <Compile Include="DLL\ClsSb_EquipRepairWorkBill.cs" /> + <Compile Include="DLL\ClsSc_ICMOReportBill.cs" /> + <Compile Include="DLL\ClsSc_MouldLifeChangeBill.cs" /> + <Compile Include="DLL\ClsSc_MouldProdBackBill.cs" /> + <Compile Include="DLL\ClsSc_MouldProdOutBill.cs" /> + <Compile Include="DLL\ClsSc_MouldRepairCheckBill.cs" /> + <Compile Include="DLL\ClsSc_MouldScrapInBill.cs" /> + <Compile Include="DLL\ClsSc_MouldScrapOutBill.cs" /> <Compile Include="DLL\ClsSc_ProcessReport.cs" /> <Compile Include="DLL\ClsSc_ProcessSendWork.cs" /> <Compile Include="DLL\ClsWW_EntrustProcessReportBill.cs" /> @@ -373,6 +398,9 @@ <Compile Include="DLL\ClsWW_EntrustWorkOrderBill.cs" /> <Compile Include="Models\ApiConfig.cs" /> <Compile Include="Models\ApiResult.cs" /> + <Compile Include="Models\CheckItem.cs" /> + <Compile Include="Models\ClsSb_EquipRepairWorkBillMain.cs" /> + <Compile Include="Models\ClsSb_EquipRepairWorkBillSub.cs" /> <Compile Include="Models\ClsSc_ProcessSendWorkMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillSub.cs" /> @@ -381,6 +409,10 @@ <Compile Include="Models\ClsWW_EntrustWorkOrderBillMain.cs" /> <Compile Include="Models\ClsWW_EntrustWorkOrderBillSub.cs" /> <Compile Include="Models\DocumentsView.cs" /> + <Compile Include="Models\Gy_Group.cs" /> + <Compile Include="Models\Gy_WorkCenter.cs" /> + <Compile Include="Models\MaintenanceAcceptItem.cs" /> + <Compile Include="Models\MaintenanceMode.cs" /> <Compile Include="Models\QC_ProcessCheckBillSub.cs" /> <Compile Include="Models\QC_ProcessCheckBillMain.cs" /> <Compile Include="Models\Gy_RoutingBillSub.cs" /> @@ -400,6 +432,7 @@ <Compile Include="Models\WWSendOutBillViewModel.cs" /> <Compile Include="Models\WW_EntrustProcSendWorkViewModel.cs" /> <Compile Include="Models\WW_EntrustWorkOrderViewModel.cs" /> + <Compile Include="Models\鍩虹璧勬枡\Warehouse.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user index 6192eed..c934955 100644 --- a/WebAPI/WebAPI.csproj.user +++ b/WebAPI/WebAPI.csproj.user @@ -7,7 +7,7 @@ <WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected> <WebStackScaffolding_LayoutPageFile /> <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> - <NameOfLastUsedPublishProfile>API</NameOfLastUsedPublishProfile> + <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <UseIISExpress>false</UseIISExpress> <Use64BitIISExpress /> @@ -17,8 +17,8 @@ <IISExpressUseClassicPipelineMode /> <UseGlobalApplicationHostFile /> <ProjectView>ShowAllFiles</ProjectView> - <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> - <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> + <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID> + <Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath> </PropertyGroup> <ProjectExtensions> <VisualStudio> -- Gitblit v1.9.1