From 090e358965800ecf7707fbfc69cef0e018836ae1 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期三, 05 一月 2022 17:33:32 +0800
Subject: [PATCH] 委外发料单+设备器具点检保养规程完善

---
 DAL/生产管理/设备管理/ClsSb_EquipDotCheckBill.cs               |    5 
 WebAPI/Controllers/仓存管理/委外用料/WW_PPBomBillController.cs |   73 +++++++++
 WebAPI/WebAPI.csproj.user                              |    4 
 WebAPI/Controllers/WebAPIController.cs                 |  161 ++++++++++++++++++++
 DAL/生产管理/设备管理/ClsSb_EquipMaintainBill.cs               |    5 
 Model/生产管理/模具管理/ClsSc_MouldMaintainBillMain.cs         |    1 
 WebAPI/DLL/ClsWW_PPBomBill.cs                          |  139 +++++++++++++++++
 WebAPI/Models/ClsWW_PPBomBillSub.cs                    |   28 +++
 DAL/生产管理/模具管理/ClsSc_MouldMaintainBill.cs               |    6 
 Model/生产管理/设备管理/ClsSb_EquipDotCheckBillMain.cs         |    6 
 WebAPI/Models/ClsWW_PPBomBillMain.cs                   |   20 ++
 WebAPI/WebAPI.csproj                                   |    4 
 Model/生产管理/设备管理/ClsSb_EquipMaintainBillMain.cs         |    5 
 13 files changed, 444 insertions(+), 13 deletions(-)

diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
index 5e0c1c2..c4a8d5e 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
@@ -57,7 +57,7 @@
                 ",HEndDate='" + omodel.HEndDate + "'" +
                 ",HExplanation='" + omodel.HExplanation + "'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
-
+                ",HMouldMaintainRuleInterID="+omodel.HMouldMaintainRuleInterID.ToString()+
                 //",HDeptID=" + omodel.HDeptID.ToString() +
                 //",HDeptNumber='" + omodel.HDeptNumber +"'"+
                 //",HEmpID=" + omodel.HEmpID.ToString() +
@@ -146,13 +146,13 @@
                 ",HYear,HPeriod,HRemark" +
                 ",HPlanNo,HPlanInterID,HMouldID,HBeginDate"+
                 ",HEndDate"+
-                ",HInnerBillNo,HExplanation" +
+                ",HInnerBillNo,HExplanation,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                 ",'" + omodel.HPlanNo + "'," + omodel.HPlanInterID.ToString() + "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" +
                 ",'" + omodel.HEndDate + "'"+
-                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" +
+                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," +omodel.HMouldMaintainRuleInterID.ToString()+
                 ") ");
 
                 if (DetailCol.Count > 0)
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
index 2e4abe6..49077a5 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
@@ -54,6 +54,7 @@
                 ",HPlanNo='" + omodel.HPlanNo + "'" +
                 ",HExplanation='" + omodel.HExplanation+"'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo+"'" +
+                ",HEquipDotCheckRuleInterID="+omodel.HEquipDotCheckRuleInterID+
                 " where HInterID=" + lngBillKey.ToString());
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
@@ -113,11 +114,11 @@
                 oCn.RunProc("Insert Into Sb_EquipDotCheckBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                 ",HYear,HPeriod,HRemark,HEquipID" +
-                ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo" +
+                ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo,HEquipDotCheckRuleInterID" +
                 ") "+
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
-                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
+                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," +omodel.HEquipDotCheckRuleInterID.ToString()+
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSb_EquipDotCheckBillSub oSub in DetailColl)
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs"
index ac58894..ea7b0aa 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs"
@@ -53,6 +53,7 @@
                 ",HPlanNo='" + omodel.HPlanNo + "'" +
                 ",HExplanation='" + omodel.HExplanation+"'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo+"'" +
+                ",HEquipMaintainRuleInterID="+omodel.HEquipMaintainRuleInterID.ToString()+
                 " where HInterID=" + lngBillKey.ToString());
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
@@ -118,11 +119,11 @@
                 oCn.RunProc("Insert Into Sb_EquipMaintainBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                 ",HYear,HPeriod,HRemark,HEquipID" +
-                ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo" +
+                ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo,HEquipMaintainRuleInterID" +
                 ") "+
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
-                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
+                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," +omodel.HEquipMaintainRuleInterID.ToString()+
                 ") ");
                 //鎻掑叆閰嶄欢瀛愯〃
                 foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl)
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBillMain.cs"
index 0176525..c5e6d1b 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBillMain.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBillMain.cs"
@@ -14,5 +14,6 @@
         public string HEndDate;//             --保养结束日期
         public string HExplanation;//       --摘要
         public string HInnerBillNo;//       --内部单据号
+        public int HMouldMaintainRuleInterID;
     }
 }
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBillMain.cs"
index 4aa23a0..04f336a 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBillMain.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBillMain.cs"
@@ -13,6 +13,10 @@
         public string HExplanation;
         public string HInnerBillNo;
         public Int64 HDeptID;
-        
+        public int HEquipMaintainRuleInterID;
+        public int HEquipDotCheckRuleInterID;
+
+
+
     }
 }
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBillMain.cs"
index 2e6e249..e070588 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBillMain.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBillMain.cs"
@@ -13,7 +13,8 @@
         public string HExplanation;
         public string HInnerBillNo;
         public Int64 HDeptID;
-        
-        
+        public int HEquipMaintainRuleInterID;
+
+
     }
 }
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index bab1e9c..886d1da 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -2177,6 +2177,59 @@
                 return objjson;
             }
         }
+        /// <summary>
+        /// 鏍规嵁鍣ㄥ叿涓诲唴鐮佽幏鍙栧櫒鍏蜂繚鍏绘楠岄」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetMouldMaintainItemtemByMaintainRuleID")]
+        [HttpGet]
+        public object GetMouldMaintainItemtemByMaintainRuleID(int MouldMaintainRuleID)
+        {
+
+            if (MouldMaintainRuleID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鍣ㄥ叿淇濆吇瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                List<object> list = new List<object>();
+                DataSet ds2;
+                DataSet ds1;
+                string sql1 = string.Format(@"select t.HMaintainItemID ,m.HNumber HMaintainItemNumber,t.HMaintainItem,t.HMaintainPart,t.HClaim,t.HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+                                                from Sc_MouldMaintainRuleBillMain a left join Sc_MouldMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
+                                                left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
+                                                left join Gy_Employee e on e.HItemID=t.HManagerID
+                                                where a.HInterID=" + MouldMaintainRuleID);
+
+                string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, m.HModel HMaterSpec,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark from Sc_MouldMaintainRuleBillMain a  
+												left join Sc_MouldMaintainRuleBillSub b on a.HInterID=b.HInterID 
+                                                left join h_v_IF_Material m on b.HMaterID=m.HItemID
+												left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+                                                where a.HInterID=" + MouldMaintainRuleID);
+                ds1 = oCN.RunProcReturn(sql1, "Sc_MouldMaintainRuleBillMain");//淇濆吇
+                ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+                list.Add(ds1.Tables[0]);
+                list.Add(ds2.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
+                return objJsonResult;
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
 
 
         /// <summary>
@@ -2271,6 +2324,59 @@
                 return objjson;
             }
         }
+        /// <summary>
+        /// 鏍规嵁璁惧淇濆吇瑙勭▼鏄剧ず璁惧淇濆吇瑙勭▼椤圭洰
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetMaintainItemtemByMaintainRuleID")]
+        [HttpGet]
+        public object GetMaintainItemtemByMaintainRuleID(int EquipProjectID)
+        {
+            if (EquipProjectID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "璁惧淇濆吇瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                List<object> list = new List<object>();
+                DataSet ds2;
+                DataSet ds1;
+                string sql1 = string.Format(@"select t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+                                                from Sb_EquipMaintainRuleBillMain a left join Sb_EquipMaintainRuleBillSub_Item t on a.HInterID=t.HInterID 
+                                                left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
+                                                left join Gy_Employee e on e.HItemID=t.HManagerID
+                                                where a.HInterID=" + EquipProjectID );
+                string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HRemark from Sb_EquipMaintainRuleBillMain a  
+												left join Sb_EquipMaintainRuleBillSub b on a.HInterID=b.HInterID 
+                                                left join h_v_IF_Material m on b.HMaterID=m.HItemID
+												left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+                                                where a.HInterID=" + EquipProjectID);
+
+                ds1 = oCN.RunProcReturn(sql1, "Sb_EquipMaintainRuleBillMain");//淇濆吇
+                ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+                list.Add(ds1.Tables[0]);
+                list.Add(ds2.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
+                return objJsonResult;
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
 
         /// <summary>
         /// 鏍规嵁璁惧鏄剧ず璁惧鐐规绋嬮」鐩�
@@ -2324,7 +2430,60 @@
                 return objjson;
             }
         }
-
+        /// <summary>
+        /// 鏍规嵁璁惧鐐规瑙勭▼鏄剧ず璁惧鐐规绋嬮」鐩�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetDotCheckRuleItemByDotCheckRuleID")]
+        [HttpGet]
+        public object GetDotCheckRuleItemByDotCheckRuleID(int HDotCheckRuleInterID)
+        {
+            if (HDotCheckRuleInterID <= 0)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "璁惧鐐规瑙勭▼鏈�夋嫨";
+                objjson.data = null;
+                return objjson;
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"select b.HDotCheckItemID HDotCheckItemID,c.HNumber HDotCheckCode,b.HDotCheckItem,b.HDotCheckPart,b.HClaim,
+                                    b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark from Sb_EquipDotCheckRuleBillMain  a 
+									left join Sb_EquipDotCheckRuleBillSub b on a.HInterID=b.HInterID 
+                                    left join Gy_QCCheckItem c on c.HItemID=b.HDotCheckItemID
+                                     left join Gy_Employee e on e.HItemID=b.HManagerID
+                                    where a.HInterID=" + HDotCheckRuleInterID);
+                ds = oCN.RunProcReturn(sql, "Sb_EquipDotCheckRuleBillMain");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "1";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+        
+        
         /// <summary>
         /// 鑾峰彇缁翠慨椤圭洰鍒楄〃
         /// </summary>
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\345\247\224\345\244\226\347\224\250\346\226\231/WW_PPBomBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\345\247\224\345\244\226\347\224\250\346\226\231/WW_PPBomBillController.cs"
new file mode 100644
index 0000000..14c7204
--- /dev/null
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\345\247\224\345\244\226\347\224\250\346\226\231/WW_PPBomBillController.cs"
@@ -0,0 +1,73 @@
+锘縰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 WW_PPBomBillController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
+        private json objJsonResult = new json();
+        public DataSet ds = new DataSet();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        public DLL.ClsWW_PPBomBill BillNew0 = new DLL.ClsWW_PPBomBill();   
+        public DLL.ClsWW_PPBomBill BillOld0 = new DLL.ClsWW_PPBomBill();
+
+        #region 妯″叿閲囪喘鍏ュ簱鍗曞垪琛�
+
+        [Route("WW_PPBomBillController/Get_WW_PPBomBillList")]
+        [HttpGet]
+        public object Get_WW_PPBomBillList(string sWhere)
+        {
+            try
+            {
+                ds = WW_PPBomBillList(sWhere);
+                if (ds == null)
+                {
+                    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)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        public static DataSet WW_PPBomBillList(string sWhere)
+        {
+            string sql1 = string.Format(@"select * from h_v_WW_PPBomBillList");
+            if (sWhere == null || sWhere.Equals(""))
+            {
+                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + "order by 鏃ユ湡 desc", "h_v_WW_PPBomBillList");
+            }
+            else
+            {
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
+                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_WW_PPBomBillList");
+            }
+        }
+
+        #endregion
+    }
+}
diff --git a/WebAPI/DLL/ClsWW_PPBomBill.cs b/WebAPI/DLL/ClsWW_PPBomBill.cs
new file mode 100644
index 0000000..b0d2b75
--- /dev/null
+++ b/WebAPI/DLL/ClsWW_PPBomBill.cs
@@ -0,0 +1,139 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.DLL
+{
+    public class ClsWW_PPBomBill : DBUtility.ClsXt_BaseBill
+    {
+        public Models.ClsWW_PPBomBillMain omodel = new Models.ClsWW_PPBomBillMain();
+        public List<Models.ClsWW_PPBomBillSub> DetailColl = new List<Models.ClsWW_PPBomBillSub>();
+
+        public ClsWW_PPBomBill()
+        {
+            base.MvarItemKeySub = "WW_PPBomBillSub";
+            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub3 = "";
+            base.MvarItemKeySub4 = "";
+            base.MvarItemKey = "WW_PPBomBillMain";
+            base.MvarReportTitle = "濮斿鐢ㄦ枡鍗�";
+            base.BillType = "1604";
+            base.HBillSubType = "1604";
+        }
+
+        #region 鍥哄畾浠g爜
+
+        ~ClsWW_PPBomBill()
+        {
+            DetailColl = null;
+        }
+
+        #endregion   鑷畾涔夋柟娉�
+
+        //鏂板鍗曟嵁
+        public override bool AddBill(ref string sReturn)
+        {
+            try
+            {
+                //寰楀埌mainid
+                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCn.BeginTran();
+                string sql = "Insert Into WW_PPBomBillMain   " +
+                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+                ",HRemark,HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HDeptID,HMaterID,HUnitID,HQty,HType" +
+                ") " +
+                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+                ", '" + omodel.HRemark.ToString() + "','" + omodel.HMaker + "',getdate()" + /*omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" +*/
+                ","+ omodel.HDeptID.ToString() +","+ omodel.HMaterID.ToString() + ","+ omodel.HUnitID.ToString() +","+ omodel.HQty.ToString()+",'"+ omodel.HQty+
+                "') ";
+                //涓昏〃
+                oCn.RunProc(sql);
+                //鎻掑叆瀛愯〃
+                foreach (Models.ClsWW_PPBomBillSub oSub in DetailColl)
+                {
+
+                    oCn.RunProc("Insert into WW_PPBomBillSub " +
+                          " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ",HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust,HQty" +
+                          ",HWHID,HQtyScrap,HSendDate,HSPID" +
+                          ") 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.HMaterNumber+ "'," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "',"  + oSub.HQtyMust.ToString() +
+                          "," + oSub.HQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HQtyScrap.ToString() + ",'" + oSub.HSendDate + "'," + oSub.HSPID.ToString() + 
+                          ") ");
+                }
+                sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //淇敼鍗曟嵁
+        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //
+                oCn.BeginTran();
+                //鏇存柊涓昏〃
+                oCn.RunProc("UpDate WW_PPBomBillMain 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() +
+                ",HMaterID=" + omodel.HMaterID.ToString() +
+                ",HUnitID=" + omodel.HUnitID.ToString() +
+                ",HQty=" + omodel.HQty.ToString() +
+                ",HType=" + omodel.HType.ToString() +
+
+                " where HInterID=" + lngBillKey.ToString());
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎瀛愯〃
+                DeleteBillSub(lngBillKey);
+                //鎻掑叆瀛愯〃
+                foreach (Models.ClsWW_PPBomBillSub oSub in DetailColl)
+                {
+
+                    oCn.RunProc("Insert into WW_PPBomBillSub " +
+                          " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ",HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust,HQty" +
+                          ",HWHID,HQtyScrap,HSendDate,HSPID" +
+                          ") 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.HMaterNumber + "'," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HQtyMust.ToString() +
+                          "," + oSub.HQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HQtyScrap.ToString() + ",'" + oSub.HSendDate + "'," + oSub.HSPID.ToString() +
+                          ") ");
+                }
+                sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/ClsWW_PPBomBillMain.cs b/WebAPI/Models/ClsWW_PPBomBillMain.cs
new file mode 100644
index 0000000..71f712a
--- /dev/null
+++ b/WebAPI/Models/ClsWW_PPBomBillMain.cs
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class ClsWW_PPBomBillMain : DBUtility.ClsXt_BaseBillMain
+    {
+        public int HDeptID;// int  	--閮ㄩ棬
+        public int HICMOInterI;// D    int
+        public int HSeOrderInterID;// int
+        public int HSeOrderEntryID;// int
+        public string HSeOrderBillNo;//  varchar(50)
+        public int HMaterID;// int
+        public int HUnitID;//     int
+        public int HQty;//        dec(18,8)
+        public string HType;// varchar(10) 绫诲瀷(鍙兘鏄� 濮斿鍜岀敓浜�)
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/ClsWW_PPBomBillSub.cs b/WebAPI/Models/ClsWW_PPBomBillSub.cs
new file mode 100644
index 0000000..e7a107e
--- /dev/null
+++ b/WebAPI/Models/ClsWW_PPBomBillSub.cs
@@ -0,0 +1,28 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class ClsWW_PPBomBillSub : DBUtility.ClsXt_BaseBillSub
+    {
+        public int HMaterID;// int        //鐗╂枡ID
+        public string HMaterNumber;//
+        public int HUnitID;// int         //鍗曚綅ID
+        public string HUnitNumber;//
+        public float HQtyMust;//
+        public float HQty;//    dec(18,8)   --鏁伴噺
+        public int HWHID;//   int		--浠撳簱
+        public float HQtyScrap;//   dec(18,8)   --鎹熻�楃巼
+        public DateTime HSendDate;//   datetime	--鍙戞枡鏃ユ湡
+        public int HSPID;//       int		--浠撲綅
+        public int HBomInterID;// int		--BOM
+        public int HICMOInterID;//     int 浠诲姟鍗旾D
+        public string HICMOBillNo;// varchar(100)  浠诲姟鍗曞彿
+        public string HSeOrderBillNo;//  varchar(50)   //(閿�鍞鍗曞彿)
+        public int HSeOrderInterID;// int   //(閿�鍞鍗曚富鍐呯爜)
+        public int HSeOrderEntryID;//   int  //(閿�鍞鍗曞瓙鍐呯爜)
+        public int HChangeTimes;//    int     //鍙樻洿娆℃暟
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 0cf6b76..334652f 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -351,6 +351,7 @@
     <Compile Include="Controllers\SCGL\Sc_ProductionReturnBillController.cs" />
     <Compile Include="Controllers\SCGL\Sc_PackUnionBillController.cs" />
     <Compile Include="Controllers\Sc_ProcessMangementController.cs" />
+    <Compile Include="Controllers\浠撳瓨绠$悊\濮斿鐢ㄦ枡\WW_PPBomBillController.cs" />
     <Compile Include="Controllers\鍗氭棩鑷姩鎵爜绾縗ScanlineAPIController.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_StockCheckItemBillController.cs" />
     <Compile Include="Controllers\宸ヨ祫绠$悊\Gy_ClassTimePrjBillController.cs" />
@@ -457,6 +458,7 @@
     <Compile Include="DLL\ClsSc_MouldOtherInBill.cs" />
     <Compile Include="DLL\ClsSc_MouldMoveStockStepOutBill.cs" />
     <Compile Include="DLL\ClsSc_PackUnionBill.cs" />
+    <Compile Include="DLL\ClsWW_PPBomBill.cs" />
     <Compile Include="DLL\宸ヨ祫绠$悊\ClsPay_GroupBalBill.cs" />
     <Compile Include="DLL\宸ヨ祫绠$悊\ClsGy_GroupEmpBill.cs" />
     <Compile Include="DLL\宸ヨ祫绠$悊\ClsPay_WorkTimesBill.cs" />
@@ -467,6 +469,8 @@
     <Compile Include="Models\ClsSc_PackUnionBillSub.cs" />
     <Compile Include="Models\ClsSc_ProcessReportMain.cs" />
     <Compile Include="Models\ClsSc_ProcessReportSub.cs" />
+    <Compile Include="Models\ClsWW_PPBomBillMain.cs" />
+    <Compile Include="Models\ClsWW_PPBomBillSub.cs" />
     <Compile Include="Models\GetWeekList.cs" />
     <Compile Include="Models\jsonScanline.cs" />
     <Compile Include="Models\ScanLineCode.cs" />
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 6af1cc0..ceaae00 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -19,8 +19,8 @@
     <IISExpressUseClassicPipelineMode />
     <UseGlobalApplicationHostFile />
     <ProjectView>ProjectFiles</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