From d33be117347967dc7a791b983d9733b3270cceb2 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 23 九月 2022 20:26:26 +0800
Subject: [PATCH] 产品与器具清单控制器及类的添加

---
 Model/基础资料/其他基础资料/ClsGy_MateMould_Model.cs   |   25 ++
 DAL/DAL.csproj                               |    1 
 DAL/基础资料/其他基础资料/ClsGy_MateMould_Ctl.cs       |  197 +++++++++++++++++
 Model/Model.csproj                           |    1 
 WebAPI/Models/ClsGy_MateMould.cs             |   23 ++
 WebAPI/Controllers/WebAPIController.cs       |   98 ++++++++
 WebAPI/WebAPI.csproj                         |    9 
 WebAPI/Controllers/Gy_MateMouldController.cs |  253 +++++++++++++++++++++++
 8 files changed, 607 insertions(+), 0 deletions(-)

diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index ff369fb..82212a3 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -86,6 +86,7 @@
     <Compile Include="鍩虹璧勬枡\InterFace鍩虹璧勬枡\ClsIF_ORGANIZATIONS_View.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_FactoryDayOff_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_FactoryDayOff_View.cs" />
+    <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_MateMould_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_QCCheckProject_View.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_StdWorkTimes_Ctl.cs" />
     <Compile Include="婧愬崟\ERP婧愬崟\Cls_S_Sc_ABJJD.cs" />
diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs"
new file mode 100644
index 0000000..1a11afe
--- /dev/null
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs"
@@ -0,0 +1,197 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace DAL
+{
+    public class ClsGy_MateMould_Ctl : DBUtility.ClsGy_Base_Ctl
+    {
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
+        public string HOldNumber;
+        public List<Model.ClsGy_MateMould_Model> DetailColl = new List<Model.ClsGy_MateMould_Model>();
+
+        //鍙嶅鏍�
+        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                oCn.RunProc(" Update Gy_MateMouldInfo set HChecker='',HCheckDate=null Where HItemID=" + lngBillKey.ToString());
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                return false;
+            }
+        }
+
+        //瀹℃牳
+        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                oCn.RunProc(" Update Gy_MateMouldInfo set HUsed=0,HChecker='" + DBUtility.ClsPub.CurUserName + "',HCheckDate='" + DBUtility.ClsPub.GetServerDate(-1) + "' Where HItemID=" + lngBillKey.ToString());
+                //灏嗗叾浠� 宸ヤ环璁剧疆涓� 鍋滅敤
+                oCn.RunProc(" exec h_p_Gy_MateMouldStopflag   " + lngBillKey.ToString());
+                //
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                return false;
+            }
+        }
+
+
+        //鏂板
+        public override bool AddNew()
+        {
+
+            try
+            {
+                oCn.BeginTran();
+                //鎻掑叆瀛愯〃
+                foreach (Model.ClsGy_MateMould_Model oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Gy_MateMouldInfo " +
+                        " (HMaterID,HRelationID,HUnitID" +
+                        ",HBeginDate,HEndDate" +
+                        ",HUsed,HRemark,HMaker,HMakeDate)" +
+                        " values(" + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
+                        ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
+                }
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //淇敼
+        public override bool ModifyByID(Int64 sItemID)
+        {
+            try
+            {
+                oCn.BeginTran();
+                DeleteByID(sItemID);        //鍒犻櫎璁板綍
+                //鎻掑叆琛�
+                foreach (Model.ClsGy_MateMould_Model oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Gy_MateMouldInfo " +
+                        " (HMaterID,HRelationID,HUnitID" +
+                        ",HBeginDate,HEndDate" +
+                        ",HUsed,HRemark,HMaker,HMakeDate)" +
+                        " values(" + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
+                        ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
+                }
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //鏄剧ず鍗曟嵁
+        public bool ShowBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //鏌ヨ涓昏〃
+                DataSet DsSub = new DataSet();
+                DsSub = oCn.RunProcReturn("Select * from Gy_MateMouldInfo Where HitemID=" + lngBillKey.ToString(), "Gy_MateMouldInfo");
+                DetailColl.Clear();//娓呯┖
+                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+                {
+                    Model.ClsGy_MateMould_Model oSub = new Model.ClsGy_MateMould_Model();
+                    oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+                    oSub.HRelationID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRelationID"]);
+                    oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+                    oSub.HBeginDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HBeginDate"]);
+                    oSub.HEndDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEndDate"]);
+                    oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]);
+                    oSub.HMaker = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMaker"]);
+                    oSub.HMakeDate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMakeDate"]);
+                    oSub.HChecker = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HChecker"]);
+                    oSub.HCheckDate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCheckDate"]);
+
+                    DetailColl.Add(oSub);
+                }
+                sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                return false;
+            }
+        }
+
+        //鎵规敼鍗曟嵁
+        //public bool BatchModifyBill(Int64 lngBillKey, double sPrice, ref string sReturn)
+        //{
+        //    try
+        //    {
+        //        oCn.BeginTran();
+        //        oCn.RunProc(" Update Gy_MateMouldInfo set HPrice=" + sPrice.ToString() + "  Where HItemID=" + lngBillKey.ToString());
+        //        sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+        //        oCn.Commit();
+        //        return true;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        sReturn = e.Message;
+        //        oCn.RollBack();
+        //        return false;
+        //    }
+        //}
+
+        //鏍规嵁鐗╂枡鍜屽伐搴忚繑鍥炲伐浠�   //b 鍗曚环涓簍ure锛屽畾棰濅负false
+        //public double LoadProcPrice(Int64 sMaterID, Int64 sProcID, Int64 sSourceID, bool b)
+        //{
+        //    double sPrice = 0;
+        //    try
+        //    {
+        //        //鏌ヨ涓昏〃
+        //        DataSet DsSub = new DataSet();
+        //        DsSub = oCn.RunProcReturn("Select top 1 * from Gy_ProcPrice Where HStopflag=0 and HEndDate>=convert(varchar(10),Getdate(),120)  and HChecker<>''  and HMaterID=" + sMaterID.ToString() + " and HProcID=" + sProcID.ToString() + " and HSourceID=" + sSourceID.ToString(), "Gy_ProcPrice");
+        //        if (DsSub == null)
+        //        {
+        //            return 0;
+        //        }
+        //        if (b)
+        //        {
+        //            sPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HPrice"]);
+        //        }
+        //        else
+        //        {
+        //            sPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HFixPrice"]);
+        //        }
+        //        return sPrice;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        return 0;
+        //    }
+        //}
+
+        //鏋勯�犲嚱鏁�
+        public ClsGy_MateMould_Ctl()
+        {
+            MvarItemKey = "Gy_MateMouldInfo";
+            MvarReportTitle = "妯″叿瀵瑰簲浜у搧璧勬枡";
+        }
+    }
+}
diff --git a/Model/Model.csproj b/Model/Model.csproj
index 1eed0d9..df0774c 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -290,6 +290,7 @@
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_CostCenterDeptRelation_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_CostItemAccount_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_MateMouldInfo_Model.cs" />
+    <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_MateMould_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_MatePriceProperty_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_QCCheckProjectMain.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_QCCheckProjectSub.cs" />
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Model.cs"
new file mode 100644
index 0000000..06230cf
--- /dev/null
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Model.cs"
@@ -0,0 +1,25 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Model
+{
+    public class ClsGy_MateMould_Model :  DBUtility.ClsGy_Base_Model
+    {
+        public long HItemID;
+        public long HMaterID;
+        public long HRelationID;
+        public long HUnitID;
+        public bool HUsed;         //褰撳墠姝e湪鍚敤
+        public DateTime HBeginDate;
+        public DateTime HEndDate;
+        public string HRemark;
+        public string HMaker;
+        public string HMakeDate;
+        public string HChecker;
+        public string HCheckDate;
+        public string HType;
+        public long HMouldQty;
+    }
+}
diff --git a/WebAPI/Controllers/Gy_MateMouldController.cs b/WebAPI/Controllers/Gy_MateMouldController.cs
new file mode 100644
index 0000000..595a5e4
--- /dev/null
+++ b/WebAPI/Controllers/Gy_MateMouldController.cs
@@ -0,0 +1,253 @@
+锘縰sing Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Web;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers
+{
+    public class Gy_MateMouldController : 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_MateMould/list")]
+        [HttpGet]
+        public object list(string sWhere, string user, string Organization)
+        {
+            try
+            {
+                //缂栬緫鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log_second("Gy_MateMould", 1, false, user))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                string sql1 = string.Format(@"select * from h_v_Gy_MateMouldInfoList where 1 =1 ");//where 缁勭粐鍚嶇О='" + Organization + "'
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_MateMouldInfoList");
+                }
+                else
+                {
+                    string sql = sql1 + sWhere + " order by HItemID";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_MateMouldInfoList");
+                }
+
+                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_MateMould/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from h_v_Gy_MateMouldInfoList where HitemID=" + HInterID, "h_v_Gy_MateMouldInfoList");
+                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;
+            }
+        }
+
+        #region 浜у搧涓庡櫒鍏锋竻鍗曚繚瀛�
+        [Route("Gy_MateMould/set_SaveBill")]
+        [HttpPost]
+        public object set_SaveBill([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            //淇濆瓨鍗曟嵁
+            return objJsonResult = AddBillMain(msg1);
+        }
+
+        public json AddBillMain(string msg1)
+        {
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+            string OperationType = sArray[2].ToString().Trim();
+            string msg4 = sArray[3].ToString();
+            bool bResult;
+            try
+            {
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_ProcPriceList_Edit", 1, false, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                msg2 = "[" + msg2.ToString() + "]";
+                List<ClsGy_MateMould> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_MateMould>>(msg2);
+                List<ClsGy_MateMould> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_MateMould>>(msg3);
+                DAL.ClsGy_MateMould_Ctl BillNew = new DAL.ClsGy_MateMould_Ctl();
+                BillNew.DetailColl = new List<Model.ClsGy_MateMould_Model>();
+                Model.ClsGy_MateMould_Model BillOld = new Model.ClsGy_MateMould_Model();
+                for (int i = 0; i < subList.ToArray().Length; i++)
+                {
+                    if (i >= 0)//HQty
+                    {
+                        Model.ClsGy_MateMould_Model oSub = new Model.ClsGy_MateMould_Model();
+                        oSub.HMaterID = DBUtility.ClsPub.isLong(subList[i].HMaterIDCol);
+                        oSub.HRelationID = DBUtility.ClsPub.isLong(subList[i].HRelationIDCol);
+                        oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitIDCol);
+                        oSub.HBeginDate = DBUtility.ClsPub.isDate(subList[i].HBeginDateCol);
+                        oSub.HEndDate = DBUtility.ClsPub.isDate(subList[i].HEndDateCol);
+                        oSub.HUsed = false;
+                        oSub.HMaker = DBUtility.ClsPub.isStrNull(mainList[0].HMaker);
+                        oSub.HMakeDate = DateTime.Today.ToString();
+                        oSub.HRemark = DBUtility.ClsPub.isStrNull(subList[i].HRemarkCol);
+                        BillNew.DetailColl.Add(oSub);
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏃犳槑缁嗚淇℃伅!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (OperationType.Equals("1.1") || OperationType.Equals("1.2") || OperationType.Equals("2"))
+                {
+                    bResult = BillNew.AddNew();
+                }
+                else
+                {
+                    bResult = BillNew.ModifyByID(DBUtility.ClsPub.isLong(mainList[0].HItemID));
+                }
+                //鎻愮ず
+                if (bResult == true)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    //objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 缂栬緫鏃惰繑鍥炰骇鍝佷笌鍣ㄥ叿娓呭崟淇℃伅
+        [Route("Gy_MateMould/GetMateMouldValue")]
+        [HttpGet]
+        public object GetMateMouldValue(int HItemID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select " +
+                    "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HRelationID) 妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName HRelationNameCol" +
+                    ",b.HNumber HRelationNumberCol,a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
+                    ",a.HRelationID HRelationIDCol,d.HNumber HUnitNumberCol,d.HName HUnitNameCol" +
+                    ",a.HUnitID HUnitIDCol" +
+                    ",a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
+                    ",a.HRemark HRemarkCol " +
+                    " from Gy_MateMouldInfo a " +
+                    " left join h_v_Gy_Mould b on a.HRelationID = b.HItemID " +
+                    " left join Gy_Material c on a.HMaterID = c.HItemID " +
+                    " left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo");
+                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
+
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index cfeba12..4358a18 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1380,6 +1380,104 @@
         }
 
         /// <summary>
+        /// 鑾峰彇鐗╂枡鍒楄〃
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/GetMaterList_Json")]
+        [HttpGet]
+        public object GetMaterList_Json(string sWhere)
+        {
+            DataSet ds;
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (sWhere != "")
+            {
+                sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ds = oCN.RunProcReturn("Select HItemID,HNumber 鐗╂枡浠g爜,HName 鐗╂枡,HModel 瑙勬牸鍨嬪彿 from Gy_Material where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Material");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇妯″叿鍒楄〃
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/GetRelationList_Json")]
+        [HttpGet]
+        public object GetRelationList_Json(string sWhere)
+        {
+            DataSet ds;
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (sWhere != "")
+            {
+                sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ds = oCN.RunProcReturn("Select HItemID,HNumber 妯″叿浠g爜,HName 妯″叿,HModel 瑙勬牸鍨嬪彿 from h_v_Gy_Mould where HStopflag=0 " + sWhere + " Order by HItemID ", "h_v_Gy_Mould");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
         /// 鑾峰彇褰撳墠鏁版嵁搴撳悕
         /// </summary>
         /// <returns></returns>
diff --git a/WebAPI/Models/ClsGy_MateMould.cs b/WebAPI/Models/ClsGy_MateMould.cs
new file mode 100644
index 0000000..daf1f1c
--- /dev/null
+++ b/WebAPI/Models/ClsGy_MateMould.cs
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class ClsGy_MateMould
+    {
+        public long HMaterIDCol { get; set; }
+        public long HRelationIDCol { get; set; }
+        public long HUnitIDCol { get; set; }
+
+        public DateTime HBeginDateCol { get; set; }
+
+        public DateTime HEndDateCol { get; set; }
+
+        public string HMaker { get; set; }
+
+        public string HRemarkCol { get; set; }
+        public long HItemID { get; set; }
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index dd0a2ec..95a7100 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -321,6 +321,9 @@
     <Compile Include="App_Start\WebApiConfig.cs" />
     <Compile Include="Controllers\BaseSet\Gy_BarCodeBillController.cs" />
     <Compile Include="Controllers\BaseSet\Gy_RoutingGroupController.cs" />
+    <Compile Include="Controllers\BaseSet\Gy_TechnologyController.cs" />
+    <Compile Include="Controllers\BaseSet\Gy_TechnologyParUnitController.cs" />
+    <Compile Include="Controllers\BaseSet\Gy_TechParamByProcController.cs" />
     <Compile Include="Controllers\BaseSet\Pay_PeriodInfoSetController.cs" />
     <Compile Include="Controllers\BaseSet\Gy_OrderBackInfoController.cs" />
     <Compile Include="Controllers\BaseSet\Gy_OrderLevController.cs" />
@@ -379,6 +382,7 @@
     <Compile Include="Controllers\CJGL\Cj_StationInBillController.cs" />
     <Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" />
     <Compile Include="Controllers\CJGL\Sc_WorkBillAutoSortBillMainController.cs" />
+    <Compile Include="Controllers\Gy_MateMouldController.cs" />
     <Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱DataHelper.cs" />
     <Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱JIT_Cg_PODemandPlanBillController.cs" />
     <Compile Include="Controllers\SCGL\Sc_CallGoodsBackRequestBillController.cs" />
@@ -550,6 +554,7 @@
     <Compile Include="HttpClient.cs" />
     <Compile Include="InvokeHelper.cs" />
     <Compile Include="Log.cs" />
+    <Compile Include="Models\ClsGy_MateMould.cs" />
     <Compile Include="Models\ClsSc_AssemblyBillMain.cs" />
     <Compile Include="Models\ClsSc_AssemblyBillSub.cs" />
     <Compile Include="Models\JIT_Cg_PODemandPlanBillMain.cs" />
@@ -581,6 +586,9 @@
     <Compile Include="Models\Sc_WorkBillSortBillSub.cs" />
     <Compile Include="Models\Sc_WorkDemandPlanBillMain.cs" />
     <Compile Include="Models\Sc_WorkDemandPlanBillSub.cs" />
+    <Compile Include="Models\TechnologyParameter.cs" />
+    <Compile Include="Models\TechnologyParameterUnit.cs" />
+    <Compile Include="Models\TechParamByProc.cs" />
     <Compile Include="Models\鍏跺畠\ReciveBill_FastModel.cs" />
     <Compile Include="Models\鍔ㄦ�佸垪\OptionListModel.cs" />
     <Compile Include="Models\鍩虹璧勬枡\Gy_ClassTimePrj.cs" />
@@ -839,6 +847,7 @@
     <Folder Include="Views\Cj_SendGoodsBill\" />
     <Folder Include="Views\Gy_EquipType\" />
     <Folder Include="Views\Gy_ICBomBill\" />
+    <Folder Include="Views\Gy_MateMould\" />
     <Folder Include="Views\Gy_RoutingGroup\" />
     <Folder Include="Views\Gy_WorkStation\" />
     <Folder Include="Views\JIT_DayPlanPlatFormBill\" />

--
Gitblit v1.9.1