From 0485de2feda1b4a5a29d7e2436c11ffd2849675a Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期二, 02 九月 2025 13:37:27 +0800
Subject: [PATCH] 源单列表
---
WebAPI/Models/ClsGy_Billorigin.cs | 30 ++
WebAPI/WebAPI.csproj | 3
WebAPI/Controllers/基础资料/基础资料/Gy_BilloriginController.cs | 780 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 813 insertions(+), 0 deletions(-)
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BilloriginController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BilloriginController.cs"
new file mode 100644
index 0000000..14d0e1e
--- /dev/null
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BilloriginController.cs"
@@ -0,0 +1,780 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web.Http;
+using WebAPI.Models;
+
+
+namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡
+{
+ public class Gy_BilloriginController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+ // GET: Xt_BillSourceSet
+ #region 鍗曟嵁 鍒楄〃
+ [Route("Gy_BilloriginController/BilloriginList")]
+ [HttpGet]
+ public object BilloriginList(string sWhere, string user, string Organization)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ string sql1 = string.Format(@"select * from h_v_Xt_BillSourceSetList where 1 = 1 ");
+ ds = oCN.RunProcReturn(sql1, "h_v_Xt_BillSourceSetList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ 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_BilloriginController/cx")]
+ [HttpGet]
+ public object cx(string HItemID, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ string sql1 = string.Format(@"select * from Xt_BillSourceSet where HItemID = " + HItemID);
+
+ ds = oCN.RunProcReturn(sql1, "Xt_BillSourceSet");
+
+
+ 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_BilloriginController/AddBill")]
+ [HttpPost]
+ public object AddBill([FromBody] JObject msg)
+ {
+ try
+ {
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ //string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ //string msg1 = sArray[0].ToString();
+ //string msg2 = sArray[1].ToString();
+ string msg2 = msg3.ToString();
+
+ //鍙嶅簭鍒楀寲
+ msg2 = "[" + msg2.ToString() + "]";
+
+ List<Models.ClsGy_Billorigin> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Billorigin>>(msg2);
+
+ int HItemID = list[0].HItemID;
+ int HNumber = list[0].HNumber;
+ string HName = list[0].HName;
+ string HHelpCode = list[0].HHelpCode;
+ string HShortNumber = list[0].HShortNumber;
+ string HParentID = list[0].HParentID;
+ string HLevel = list[0].HLevel;
+ string HEndFlag = list[0].HEndFlag;
+ string HRemark = list[0].HRemark;
+ string HSourceBillTypeName = list[0].HSourceBillTypeName;
+ string HSourceBillType = list[0].HSourceBillType;
+ string HRedBlueFlag = list[0].HRedBlueFlag;
+ string HStopFlag = list[0].HStopFlag;
+ ///
+ string HViewName = list[0].HViewName;
+ string HReportTitle = list[0].HReportTitle;
+ string HCondtion = list[0].HCondtion;
+ string HOrderSql = list[0].HOrderSql;
+ string HKeyCol = list[0].HKeyCol;
+ //鍒ゆ柇鏉冮檺
+ //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCN.BeginTran();
+
+
+
+ //涓昏〃
+ oCN.RunProc("INSERT INTO Xt_BillSourceSet " +
+ "(HNumber, HName, HHelpCode, HShortNumber, HParentID, HLevel, HEndFlag, HRemark, " +
+ "HSourceBillType, HSourceBillTypeName, HRedBlueFlag, HStopFlag, " +
+ "HViewName, HReportTitle, HCondtion, HOrderSql, HKeyCol) " +
+ "VALUES('" + HNumber + "', '" + HName + "', '" +
+ HHelpCode + "', '" + HShortNumber + "', " +
+ (string.IsNullOrEmpty(HParentID) ? "0" : HParentID) + ", " +
+ (string.IsNullOrEmpty(HLevel) ? "0" : HLevel) + ", " +
+ (string.IsNullOrEmpty(HEndFlag) ? "0" : HEndFlag) + ", '" +
+ HRemark + "', '" +
+ HSourceBillType + "', '" + HSourceBillTypeName + "', " +
+ (string.IsNullOrEmpty(HRedBlueFlag) ? "0" : HRedBlueFlag) + ", " +
+ (string.IsNullOrEmpty(HStopFlag) ? "0" : HStopFlag) + ", '" +
+ HViewName + "', '" + HReportTitle + "', '" +
+ HCondtion + "', '" + HOrderSql + "', '" +
+ HKeyCol + "')",
+ 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 淇敼淇濆瓨
+ [Route("Gy_BilloriginController/EditBill")]
+ [HttpPost]
+ public object EditBill([FromBody] JObject msg)
+ {
+
+ try
+ {
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ string msg2 = msg3.ToString();
+
+ //鍙嶅簭鍒楀寲
+ msg2 = "[" + msg2.ToString() + "]";
+ List<Models.ClsGy_Billorigin> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Billorigin>>(msg2);
+ int HItemID = list[0].HItemID;
+ int HNumber = list[0].HNumber;
+ string HName = list[0].HName;
+ string HHelpCode = list[0].HHelpCode;
+ string HShortNumber = list[0].HShortNumber;
+ string HParentID = list[0].HParentID;
+ string HLevel = list[0].HLevel;
+ string HEndFlag = list[0].HEndFlag;
+ string HRemark = list[0].HRemark;
+ string HSourceBillTypeName = list[0].HSourceBillTypeName;
+ string HSourceBillType = list[0].HSourceBillType;
+ string HRedBlueFlag = list[0].HRedBlueFlag;
+ string HStopFlag = list[0].HStopFlag;
+ ///
+ string HViewName = list[0].HViewName;
+ string HReportTitle = list[0].HReportTitle;
+ string HCondtion = list[0].HCondtion;
+ string HOrderSql = list[0].HOrderSql;
+ string HKeyCol = list[0].HKeyCol;
+
+ //鍒ゆ柇鏉冮檺
+ //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCN.BeginTran();
+
+
+
+
+ //涓昏〃
+ oCN.RunProc("UPDATE Xt_BillSourceSet SET " +
+ "HNumber='" + HNumber + "', " +
+ "HName='" + HName + "', " +
+ "HHelpCode='" + HHelpCode + "', " +
+ "HKeyCol='" + HKeyCol + "', " +
+ "HOrderSql='" + HOrderSql + "', " +
+ "HViewName='" + HViewName + "', " +
+ "HEndFlag='" + HEndFlag + "', " +
+ "HRemark='" + HRemark + "', " +
+ "HSourceBillTypeName='" + HSourceBillTypeName + "', " +
+ "HSourceBillType='" + HSourceBillType + "', " +
+ "HRedBlueFlag='" + HRedBlueFlag + "', " +
+ "HStopFlag='" + HStopFlag + "'" +
+ " 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 鍒犻櫎
+ [Route("Gy_BilloriginController/Delete")]
+ [HttpGet]
+ public object Delete(string HItemID, string user)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_MatePrice_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Xt_BillSourceSet where HItemID=" + HItemID, "Xt_BillSourceSet");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏁版嵁宸插鏍告棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.RunProc("delete from Xt_BillSourceSet where HItemID=" + HItemID);
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 瀹℃牳銆佸弽瀹℃牳
+
+ [Route("Gy_MatePriceController/MatePriceCheck")]
+ [HttpGet]
+ public object MatePriceCheck(int HInterID, int IsAudit, string CurUserName)
+ {
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+ DAL.ClsGy_MatePrice_Ctl oBill = new DAL.ClsGy_MatePrice_Ctl();
+ List<Model.ClsGy_MatePrice_Model> lsmain = new List<Model.ClsGy_MatePrice_Model>();
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Check", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (lngBillKey == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ ////閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔
+ //if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁
+ //{
+ // if (oBill.oModel.HCheckEmp.Trim() != "")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // //if (oBill.omodel.HDeleteMan.Trim() != "")
+ // //{
+ // // objJsonResult.code = "0";
+ // // objJsonResult.count = 0;
+ // // objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+ // // objJsonResult.data = null;
+ // // return objJsonResult;
+ // //}
+ //}
+ //else
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ var ds = oCN.RunProcReturn("select * from Gy_MaterPrice where HItemID=" + HInterID, "Gy_MaterPrice");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+ {
+ 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;
+ }
+
+ oCN.BeginTran();
+
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_MaterPrice_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPrice_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+ oCN.RunProc("update Gy_MaterPrice set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
+
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_MaterPrice_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaterPrice_AfterCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ string sql1 = "exec h_p_Gy_MaterPrice_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPrice_BeforeUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+
+ oCN.RunProc("update Gy_MaterPrice set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
+
+
+ //鍙嶅鏍稿悗鎺у埗=========================================
+ string sql2 = "exec h_p_Gy_MaterPrice_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaterPrice_AfterUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 绂佺敤銆佸弽绂佺敤
+
+ [Route("Gy_MatePriceController/StopGy_MaterPrice")]
+ [HttpGet]
+ public object StopGy_MaterPrice(int HInterID, int IsStop, string CurUserName)
+ {
+ try
+ {
+ //绂佺敤鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Stop", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_MaterPrice where HItemID=" + HInterID, "Gy_MaterPrice");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+ {
+ 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;
+ }
+
+ oCN.BeginTran();
+
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+
+ //绂佺敤鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_MaterPrice_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPrice_BeforeStopCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:绂佺敤鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+ oCN.RunProc("update Gy_MaterPrice set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+
+ //绂佺敤鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_MaterPrice_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaterPrice_AfterStopCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:绂佺敤鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ //鍙嶇鐢ㄥ墠鎺у埗=========================================
+ string sql1 = "exec h_p_Gy_Gy_MaterPrice_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_Gy_MaterPrice_BeforeUnStopCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:鍙嶇鐢ㄥ墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+ oCN.RunProc("update Gy_MaterPrice set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+
+ //鍙嶇鐢ㄥ悗鎺у埗=========================================
+ string sql2 = "exec h_p_Gy_MaterPrice_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaterPrice_AfterUnStopCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:鍙嶇鐢ㄥ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/ClsGy_Billorigin.cs b/WebAPI/Models/ClsGy_Billorigin.cs
new file mode 100644
index 0000000..72e0c4e
--- /dev/null
+++ b/WebAPI/Models/ClsGy_Billorigin.cs
@@ -0,0 +1,30 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+ public class ClsGy_Billorigin: DBUtility.ClsGy_Base_Ctl
+ {
+ public int HItemID;
+ public int HNumber;
+ public string HName;
+ public string HHelpCode;
+ public string HShortNumber;
+ public string HParentID;
+ public string HLevel;
+ public string HEndFlag;
+ public string HRemark;
+ public string HStopFlag;
+ public string HRedBlueFlag;
+ public string HSourceBillType;
+ public string HSourceBillTypeName;
+ ////////
+ public string HViewName;
+ public string HReportTitle;
+ public string HCondtion;
+ public string HOrderSql;
+ public string HKeyCol;
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 1a7cf94..e3d276a 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -612,6 +612,7 @@
<Compile Include="Controllers\鍝佽川绠$悊\杞﹂棿鑷鍗昞QC_WorkSelfCheckBillController.cs" />
<Compile Include="Controllers\鍗庤繙datamapping\Gy_BarCodeBill_PNL_TempController.cs" />
<Compile Include="Controllers\鍗庤繙datamapping\Gy_BarCodeBill_Set_TempController.cs" />
+ <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_BilloriginController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CardChangeTypeController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CardStatusController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CardAddressController.cs" />
@@ -637,6 +638,7 @@
<Compile Include="Controllers\鍗庤繙datamapping\Gy_PNLInfoController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PNLInfoTypeLevelController.cs" />
<Compile Include="Controllers\椤圭洰绠$悊\宸ョ▼椤圭洰\PM_ProjectBill_WorkController.cs" />
+ <Compile Include="Models\ClsGy_Billorigin.cs" />
<Compile Include="Models\GroupOrderBill.cs" />
<Compile Include="Models\ClsGy_PNLInfoSub.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_ProcMulController.cs" />
@@ -1208,6 +1210,7 @@
<Folder Include="Views\Cj_SingleStation\" />
<Folder Include="Views\Gy_BarCodeBill_Out\" />
<Folder Include="Views\Gy_BarCodeBill_Set_Temp\" />
+ <Folder Include="Views\Gy_Billorigin\" />
<Folder Include="Views\Gy_COMMONCONTACTBill\" />
<Folder Include="Views\Gy_ConkType\" />
<Folder Include="Views\Gy_CustLocation\" />
--
Gitblit v1.9.1