zzr99
2022-01-05 090e358965800ecf7707fbfc69cef0e018836ae1
委外发料单+设备器具点检保养规程完善
4个文件已添加
9个文件已修改
457 ■■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSc_MouldMaintainBill.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipDotCheckBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipMaintainBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldMaintainBillMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipDotCheckBillMain.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipMaintainBillMain.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/仓存管理/委外用料/WW_PPBomBillController.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsWW_PPBomBill.cs 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsWW_PPBomBillMain.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsWW_PPBomBillSub.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/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)
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/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)
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/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)
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainBillMain.cs
@@ -14,5 +14,6 @@
        public string HEndDate;//             --保养结束日期
        public string HExplanation;//       --ÕªÒª
        public string HInnerBillNo;//       --内部单据号
        public int HMouldMaintainRuleInterID;
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipDotCheckBillMain.cs
@@ -13,6 +13,10 @@
        public string HExplanation;
        public string HInnerBillNo;
        public Int64 HDeptID;
        public int HEquipMaintainRuleInterID;
        public int HEquipDotCheckRuleInterID;
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipMaintainBillMain.cs
@@ -13,7 +13,8 @@
        public string HExplanation;
        public string HInnerBillNo;
        public Int64 HDeptID;
        public int HEquipMaintainRuleInterID;
    }
}
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>
WebAPI/Controllers/²Ö´æ¹ÜÀí/ίÍâÓÃÁÏ/WW_PPBomBillController.cs
New file
@@ -0,0 +1,73 @@
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 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
    }
}
WebAPI/DLL/ClsWW_PPBomBill.cs
New file
@@ -0,0 +1,139 @@
using 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 å›ºå®šä»£ç 
        ~ClsWW_PPBomBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                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);
            }
        }
    }
}
WebAPI/Models/ClsWW_PPBomBillMain.cs
New file
@@ -0,0 +1,20 @@
using 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) ç±»åž‹(可能是 å§”外和生产)
    }
}
WebAPI/Models/ClsWW_PPBomBillSub.cs
New file
@@ -0,0 +1,28 @@
using 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 ä»»åŠ¡å•ID
        public string HICMOBillNo;// varchar(100)  ä»»åŠ¡å•å·
        public string HSeOrderBillNo;//  varchar(50)   //(销售订单号)
        public int HSeOrderInterID;// int   //(销售订单主内码)
        public int HSeOrderEntryID;//   int  //(销售订单子内码)
        public int HChangeTimes;//    int     //变更次数
    }
}
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" />
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>