yusijie
2023-10-26 e63ec395579176d627c0198e8d54c065b2cc1556
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
18个文件已修改
1171 ■■■■■ 已修改文件
Model/采购管理/ClsCg_POInStockBackBillMain.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/采购管理/ClsCg_POInStockBackBillSub.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/采购管理/ClsCg_POInStockBillMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/采购管理/ClsCg_POOrderBillMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode_StationOutBill.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs 393 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs 387 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_CompleteController..cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutRequestBillController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsKf_ICStockBillMain.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsKf_ICStockBillSub.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/²É¹º¹ÜÀí/ClsCg_POInStockBackBillMain.cs
@@ -16,5 +16,17 @@
        public Int64 HDeptID;//     int                 --部门    (Gy_Employee)
        public string HExplanation;//  varchar(200)             --ÕªÒª 
        public string HInnerBillNo;//  varchar(50)             --内部单据号
        public long HAPPORGID { get; set; }
        public long HPURCHASEORGIDD { get; set; }
        public long HREQUIREORGID { get; set; }
        public long HSETTLEORGID { get; set; }
        public long HOWNERTYPEID { get; set; }
        public long HOWNERID { get; set; }
        public long HERPInterID { get; set; }
        public long HStatus { get; set; }
        public string HERPBillType { get; set; }
        public string HConfirmMan { get; set; }
        public string HConfirmDate { get; set; }
    }
}
Model/²É¹º¹ÜÀí/ClsCg_POInStockBackBillSub.cs
@@ -19,5 +19,28 @@
        public Int64 HPOOrderInterID;//
        public Int64 HPOOrderEntryID;//
        public string HPOOrderBillNo;//
        public object HSPID { get; set; }
        public object HConfirmMan { get; set; }
        public object HConfirmDate { get; set; }
        public object HStatus { get; set; }
        public object HBacker { get; set; }
        public object HBackDate { get; set; }
        public object HBackRemark { get; set; }
        public object HWWOrderInterID { get; set; }
        public object HWWOrderEntryID { get; set; }
        public object HWWOrderDetaiLID { get; set; }
        public object HWWOrderBillNo { get; set; }
        public object HPropertyID { get; set; }
        public object HSecUnitID { get; set; }
        public object HSecUnitRate { get; set; }
        public object HTaxRate { get; set; }
        public object HBatChNo { get; set; }
        public object HAuxPropID { get; set; }
        public object HERPInterID { get; set; }
        public object HERPEntryID { get; set; }
        public object HERPDetailID { get; set; }
        public object HMTONo { get; set; }
        public object HPlanMode { get; set; }
    }
}
Model/²É¹º¹ÜÀí/ClsCg_POInStockBillMain.cs
@@ -8,6 +8,7 @@
    {
        public string HAddress;//     varchar(200)                --交货地点 
        public Int64 HSupID;//      int                 --供应商 ï¼ˆGy_Supplier)
        public Int64 HSupDealerID;//      int                 --经销商
        public Int64 HCurID;//    int                  --币别 (Gy_Currency)
        public Int64 HWHID;//      int     --仓库
        public Single HExRate;//    money                  --汇率  (选择完币别带出)
Model/²É¹º¹ÜÀí/ClsCg_POOrderBillMain.cs
@@ -10,6 +10,7 @@
        public Int64 HSSID;//     int                //结算方式 (Gy_SettleStyle)
        public Int64 HPSStyleID;//    int             //采购方式 (Gy_PoStockStyle)        new
        public Int64 HSupID;//      int                 //供应商 ï¼ˆGy_Supplier)
        public Int64 HSupDealerID;//      int                 //经销商
        public Int64 HCurID;//    int                  //币别 (Gy_Currency)
        public Single HExRate;//    money                  //汇率  (选择完币别带出)
        public Int64 HEmpID;//     int                   //业务员  (Gy_Employee)
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode.cs
@@ -35,7 +35,7 @@
        public Int64 HSourceEntryID = 0;
        public string HSourceBillNo = "";
        public string HSourceBillType = "";
        public Int64 ProcessExchangeInterID = 0;
        public Int64 HProcessExchangeInterID = 0;
        public Int64 HSupID = 0;
        public double HSourceQty = 0;
        public double HMaterWeight = 0;         //物料克重
@@ -578,6 +578,38 @@
            {
                if (MessageBox.Show("物料维护克重为:"+HMaterWeight.ToString()+ ",实际克重为:" + sQty.ToString() + ",所输入实际克重超出物料维护克重的百分之二十或不足物料维护克重的百分之八十,请检查输入的数据是否正确!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    //return true;
                }
                else
                {
                    return false;
                }
            }
            //条码生成前控制判断
            double HNowQty = 0;     //米数
            double HWeightQyt = 0;  //重量
            double HKDQty = 0;      //扣点数
            HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
            HWeightQyt = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
            HKDQty = DBUtility.ClsPub.isDoule(txtHKDQty.Text);
            DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Kf_WeighToBarCode_AddBarCodeCheck " + HInterID.ToString() + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + "," + HProcessExchangeInterID.ToString() + "," + HSourceQty.ToString() + "," + HNowQty.ToString() + "," + HWeightQyt.ToString() + "," + HKDQty.ToString(), "h_p_Kf_WeighToBarCode_AddBarCodeCheck");
            //
            if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("条码生成前判断错误!");
                return false;
            }
            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
            {
                MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "提示");
                return false;
            }
            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "2")
            {
                if (MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    return true;
                }
                else
@@ -585,7 +617,10 @@
                    return false;
                }
            }
            else
            {
            return true;
            }
        }
        //生成条码
@@ -652,7 +687,7 @@
            string HRemark = "";
            string HMaterName = "";
            string HMaterModel = "";
            string ProcessExchangeBillNo = "";
            string HProcessExchangeBillNo = "";
            Int64 HBarcodeNo = 0;       //包数
            Int64 HBadReasonID = 0;     //不良原因ID
            string HCusMaterName = "";  //客户物料名称
@@ -668,7 +703,7 @@
            HRemark = DBUtility.ClsPub.isStrNull(txtHRemark.Text);
            HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text);
            HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text);
            ProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
            HProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
            HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text);
            HBadReasonID = DBUtility.ClsPub.isLong(txtHRemark.Tag);
            HCusMaterName = DBUtility.ClsPub.isStrNull(txtHCusMaterName.Text);
@@ -694,14 +729,14 @@
                + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + "," + HNowQty.ToString()
                + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
                + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'"
                + ", " + HProcessExchangeInterID.ToString() + ",0,'" + HProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'"
                + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','','1')");
                //回填最大流水号
                oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 ");
                //回填源单临时表HInterID
                oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + ProcessExchangeBillNo + "'");
                oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + HProcessExchangeBillNo + "'");
                //写入条码出入库临时表
                oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
@@ -757,7 +792,7 @@
            HSourceBillNo = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("生产订单")].Value);
            HSourceBillType = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSourceBillType")].Value);
            HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("数量")].Value);
            ProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value);
            HProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value);
            HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value);
            HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value);
        }
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode_StationOutBill.cs
@@ -613,6 +613,36 @@
            {
                if (MessageBox.Show("物料维护克重为:" + HMaterWeight.ToString() + ",实际克重为:" + sQty.ToString() + ",所输入实际克重超出物料维护克重的百分之二十或不足物料维护克重的百分之八十,请检查输入的数据是否正确!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    //return true;
                }
                else
                {
                    return false;
                }
            }
            //条码生成前控制判断
            double HNowQty = 0;     //米数
            double HWeightQyt = 0;  //重量
            HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
            HWeightQyt = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
            DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck " + HInterID.ToString() + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + "," + HProcessExchangeInterID.ToString() + "," + HProcessExchangeEntryID.ToString() + "," + HSourceQty.ToString() + "," + HNowQty.ToString() + "," + HWeightQyt.ToString(), "h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck");
            //
            if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("条码生成前判断错误!");
                return false;
            }
            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
            {
                MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "提示");
                return false;
            }
            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "2")
            {
                if (MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    return true;
                }
                else
@@ -620,8 +650,11 @@
                    return false;
                }
            }
            else
            {
            return true;
        }
        }
        //生成条码
        private void SaveBarCode()
WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs
@@ -77,6 +77,120 @@
                return objJsonResult;
            }
        }
        #region éƒ¨é—¨ æ ‘形图
        public class TreeModel
        {
            public string id { get; set; }
            public string title { get; set; }
            public List<TreeModel> children = new List<TreeModel>();
        }
        [Route("Gy_Department/Gy_DepartmentTreeList")]
        [HttpGet]
        public object Gy_DepartmentTreeList(string sWhere)
        {
            try
            {
                string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Department where 1=1 " + sWhere + " order by hnumber");
                ds = oCN.RunProcReturn(sql1, "Gy_Department");
                List<TreeModel> treeModels = new List<TreeModel>();
                TreeModel first = new TreeModel();
                first.id = "0";
                first.title = "部门设置";
                treeModels.Add(first);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    var strLen = row["hitemid"].ToString().Split('.');
                    if (strLen.Length == 1)
                    {
                        TreeModel tree = new TreeModel();
                        tree.id = row["hitemid"].ToString();
                        tree.title = row["hname"].ToString();
                        treeModels[0].children.Add(tree);
                    }
                }
                digui(ds.Tables[0], treeModels[0].children, 2);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é€’归函数
        /// </summary>
        public void digui(DataTable dt, List<TreeModel> tree, int num)
        {
            for (int m = 0; m < tree.Count; m++)
            {
                tree[m].children = new List<TreeModel>();
                for (int i = 0; i < dt.Rows.Count; i++)//第一次循环,得到所有根节点的子集
                {
                    var strLen = dt.Rows[i]["hnumber"].ToString().Split('.');
                    if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + "."))
                    {
                        TreeModel tbjson = new TreeModel();
                        tbjson.id = dt.Rows[i]["hitemid"].ToString();
                        tbjson.title = dt.Rows[i]["hname"].ToString();
                        tree[m].children.Add(tbjson);
                    }
                }
                var strLens = tree[m].id.Split('.');
                for (int i = 0; i < tree[m].children.Count; i++)
                {
                    digui(dt, tree[m].children, strLens.Length + 2);//再次用子集去循环,拿出子集的子集
                }
            }
        }
        #endregion
        #region è®¾å¤‡åˆ†å¸ƒ ç”Ÿäº§èµ„源对应的订单
        [Route("Sc_OrderStateDistribution/Sc_OrderStateDistribution_Souce")]
        [HttpGet]
        public object Sc_OrderStateDistribution_Souce(string sWhere,string user,int OrganizationID)
        {
            try
            {
                string sql1 = string.Format("exec h_p_sc_HDeptSouceMOList {0},{1}", sWhere, OrganizationID);
                ds = oCN.RunProcReturn(sql1, "h_p_sc_HDeptSouceMOList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
WebAPI/Controllers/CGGL/Cg_POInStockBackBillController.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using Model;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Pub_Class;
using System;
@@ -8,6 +9,8 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
@@ -23,45 +26,9 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Cg_POInStockBackBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where HitemID=" + HInterID, "h_v_IF_POInStockBackBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// è¿”回退料通知单列表
        ///参数:string sql。
@@ -73,6 +40,7 @@
        {
            try
            {
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBackBillQuery", 1, false, user))
                {
@@ -93,6 +61,9 @@
                    string sql = sql1 + sWhere+ " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_POInStockBackBillList");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
@@ -119,6 +90,326 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #region é€€æ–™é€šçŸ¥å• ä¿å­˜/编辑功能
        [Route("Cg_POInStockBackBill/POInStockBackBillEdit")]
        [HttpPost]
        public object POInStockBackBillEdit([FromBody] JObject sMainSub)
        {
            try
            {
                var _value = sMainSub["sMainSub"].ToString();
                string msg1 = _value.ToString();
                oCN.BeginTran();
                //保存主表
                objJsonResult = AddBillMain(msg1);
                if (objJsonResult.code == "0")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = objJsonResult.Message;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                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 = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString(); //主表数据
            string msg3 = sArray[1].ToString(); //子表数据
            int OperationType = int.Parse(sArray[2].ToString()); // æ•°æ®ç±»åž‹ 1添加 3修改
            string user = sArray[3].ToString();
            string msg_allVal = sArray[4].ToString(); //主表+子表所有数据
            try
            {
                msg2 = "[" + msg2.ToString() + "]";
                List<ClsCg_POInStockBackBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBackBillMain>>(msg2);
                long HInterID = mainList[0].HInterID;//递入type得到的单据ID
                string HBillNo = mainList[0].HBillNo;//递入type得到的单据号
                long HPRDORGID = mainList[0].HPRDORGID;//生产组织
                DateTime HDate = mainList[0].HDate;//日期
                string HRemark = mainList[0].HRemark;//备注
                long HEmpID = mainList[0].HEmpID;//业务员
                long HDeptID = mainList[0].HDeptID;//部门
                long HSupID = mainList[0].HSupID;//供应商
                long HWHID = mainList[0].HWHID;//仓库
                long HCurID = mainList[0].HCurID;//币别
                Single HExRate = mainList[0].HExRate;//汇率
                long HManagerID = mainList[0].HManagerID;//主管
                long HAPPORGID = mainList[0].HAPPORGID;//申请组织
                long HPURCHASEORGID = mainList[0].HPURCHASEORGIDD;//采购组织
                long HREQUIREORGID = mainList[0].HREQUIREORGID;//需求组织
                long HSETTLEORGID = mainList[0].HSETTLEORGID;//结算组织
                long HOWNERTYPEID = mainList[0].HOWNERTYPEID;//货主类型
                long HOWNERID = mainList[0].HOWNERID;//货主
                long HERPInterID = mainList[0].HERPInterID;//ERP单据主内码
                long HStatus = mainList[0].HStatus;//状态
                string HMaker = user;//制单人
                string HExplanation = mainList[0].HExplanation;//摘要
                string HInnerBillNo = mainList[0].HInnerBillNo;//内部单据号
                string HAddress = mainList[0].HAddress;//地址
                string HBillType = mainList[0].HBillType;
                string HBillSubType = mainList[0].HBillSubType;
                long HBillStatus = mainList[0].HBillStatus;
                string HERPBillType = mainList[0].HERPBillType;
                string HConfirmMan = mainList[0].HConfirmMan;
                string HConfirmDate = mainList[0].HConfirmDate;
                string HMakeDate = mainList[0].HMakeDate;
                string HChecker = mainList[0].HChecker;
                string HCheckDate = mainList[0].HCheckDate;
                string HUpDater = mainList[0].HUpDater;
                string HUpDateDate = mainList[0].HUpDateDate;
                string HDeleteMan = mainList[0].HDeleteMan;
                string HDeleteDate = mainList[0].HDeleteDate;
                string HCloseMan = mainList[0].HCloseMan;
                string HCloseDate = mainList[0].HCloseDate;
                ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid=" + HInterID + " and å•据号='" + HBillNo + "'", "h_v_IF_POInStockBackBillList");
                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增
                {
                    //主表
                    String sql = $@"Insert Into Cg_POInStockBackBillMain
                        (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
                        ,HAddress,HSupID,HCurID,HWHID,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HRemark
                        ,HInnerBillNo,HAPPORGID,HPURCHASEORGID,HREQUIREORGID,HSETTLEORGID,HOWNERTYPEID
                        ,HOWNERID,HERPInterID,HERPBillType,HConfirmMan,HConfirmDate,HStatus
                        ,HChecker,HCheckDate,HMaker,HMakeDate)
                        values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1105 + "','" +
                    HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
                    "'," + HSupID + "," + HCurID + "," + HWHID + "," + HExRate + "," + HEmpID + "," + HManagerID + "," + HDeptID + ",'" + HExplanation + "','" + HRemark
                    + "','" + HInnerBillNo + "'," + HAPPORGID + "," + HPURCHASEORGID + "," + HREQUIREORGID + ","
                    + HSETTLEORGID + "," + HOWNERTYPEID + "," + HOWNERID + "," + HERPInterID + ",'" + HERPBillType + "','" + HConfirmMan
                    + "','" + HConfirmDate + "'," + HStatus + ",'" + HChecker + "',getdate()" + ",'" + HMaker + "',getdate()" + ")";
                    oCN.RunProc(sql);
                }
                else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                { //修改
                    String sql=$@"update Cg_POInStockBackBillMain  set " +
                                "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" +
                                 ",HSupID=" + HSupID + ",HCurID=" + HCurID+", HWHID = " + HWHID
                                 + ",HExRate=" + HExRate + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID+ ",HOWNERID=" + HOWNERID
                                 + ",HAddress='" + HAddress + "'where HInterID=" + HInterID;
                    oCN.RunProc(sql);
                    //删除子表
                    oCN.RunProc("delete from Cg_POInStockBackBillSub where HInterID='" + HInterID + "'");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, HInterID, OperationType);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = objJsonResult.Message;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = null;
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public json AddBillSub(string msg3, long HInterID, int OperationType)
        {
            List<ClsCg_POInStockBackBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBackBillSub>>(msg3);
            int i = 0;
            IList list = DetailColl;
            for (int i1 = 0; i1 < list.Count; i1++)
            {
                ClsCg_POInStockBackBillSub oSub = (ClsCg_POInStockBackBillSub)list[i1];
                i++;
                if (oSub.HQty <= 0 || oSub.HQty == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,数量不能为0或者小于0";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HMaterID == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,物料不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (oSub.HSourceID == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "第" + i + "行,生产资源不能为空";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (oSub.HUnitID == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,计量单位不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet Cs;
                Int64 NewHEntryID = 1;
                Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Cg_POInStockBackBillSub", "Cg_POInStockBackBillSub");
                if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
                {
                    NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
                    NewHEntryID += 1;
                }
                string sql = $@"Insert into Cg_POInStockBackBillSub
                (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice
                ,HMoney,HWHID,HSPID,HConfirmMan,HConfirmDate,HRelationQty
                ,HStatus,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
                ,HPOOrderInterID,HPOOrderEntryID ,HPOOrderBillNo,HWWOrderInterID
                ,HWWOrderEntryID,HWWOrderDetaiLID,HWWOrderBillNo
                ,HPropertyID,HSecUnitID,HSecUnitRate,HTaxRate
                ,HTaxMoney,HBatChNo,HAuxPropID,HERPInterID,HERPEntryID
                ,HMTONo,HPlanMode,HRemark)
                 values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HPrice}
                ,{oSub.HMoney},{oSub.HWHID},{oSub.HSPID},'{(oSub.HConfirmMan==null ? 0 : oSub.HConfirmMan)}','{oSub.HConfirmDate}',{oSub.HRelationQty}
                ,{(oSub.HStatus == null ? 0 : oSub.HStatus)},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}'
                ,{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}','{(oSub.HWWOrderInterID == null ? 0 : oSub.HWWOrderInterID)}'
                ,{(oSub.HWWOrderEntryID==null ?0:oSub.HWWOrderEntryID)},{(oSub.HWWOrderDetaiLID == null ? 0 : oSub.HWWOrderDetaiLID)},'{(oSub.HWWOrderBillNo == null ? 0 : oSub.HWWOrderBillNo)}'
                ,{(oSub.HPropertyID == null ? 0 : oSub.HPropertyID)},{(oSub.HSecUnitID == null ? 0 : oSub.HSecUnitID)},{(oSub.HSecUnitRate == null ? 0 : oSub.HSecUnitRate)},{(oSub.HTaxRate==null?0:oSub.HTaxRate)}
                ,{oSub.HTaxMoney},'{oSub.HBatChNo}',{(oSub.HAuxPropID==null?0:oSub.HAuxPropID)},{(oSub.HERPInterID==null ? 0 :oSub.HERPInterID)},{(oSub.HERPEntryID == null ? 0 : oSub.HERPEntryID)}
                ,'{(oSub.HMTONo==null?0:oSub.HMTONo)}',{(oSub.HPlanMode==null?0:oSub.HPlanMode)},'{oSub.HRemark}')";
                oCN.RunProc(sql);
            }
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = null;
            objJsonResult.data = null;
            return objJsonResult;
        }
        /// <summary>
        ///删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Cg_POInStockBackBill/DeltetCg_POInStockBackBill")]
        [HttpGet]
        public object DeltetCg_POInStockBackBill(string HInterID)
        {
            try
            {
                oCN.BeginTran();
                oCN.RunProc("Delete From Cg_POInStockBackBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Cg_POInStockBackBillSub where HInterID = " + HInterID);
                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.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Cg_POInStockBackBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid =" + HInterID, "h_v_IF_POInStockBackBillList");
                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;
            }
        }
        private json DeleteKingDee(string hInterID)
        {
            throw new NotImplementedException();
        }
@@ -337,7 +628,6 @@
                        {
                            Qty = ClsPub.isDoule(Cs.Tables[0].Rows[i]["HQty"].ToString());
                            Money = ClsPub.isDoule(Cs.Tables[0].Rows[i]["HMoney"].ToString());
                            WHID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HWHID"].ToString());
                            SPID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HSPID"].ToString());                       
                            SourceBillType = ClsPub.isLong(Cs.Tables[0].Rows[i]["HSourceBillType"].ToString());
                            POOrderInterID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HPOOrderInterID"].ToString());
@@ -456,6 +746,28 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ ¹æ®ç‰©æ–™å†…码获取物料信息
        [Route("Cg_POInStockBackBill/getMaterialByMaterID")]
        [HttpGet]
        public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
                " from Gy_Material AS a " +
                " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
                " where a.HItemID =" + HMaterID;
            var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataTable> { code = -1, msg = "不存在该物料" };
            return new ApiResult<DataTable> { code = 1, msg = "查询成功", data = dataSet.Tables[0] };
        }
        #endregion
@@ -892,3 +1204,4 @@
    }
}
#endregion
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
@@ -170,6 +170,28 @@
            }
        }
        #region æ ¹æ®ç‰©æ–™å†…码获取物料信息
        [Route("Cg_POInStockBill/getMaterialByMaterID")]
        [HttpGet]
        public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
                " from Gy_Material AS a " +
                " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
                " where a.HItemID =" + HMaterID;
            var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataTable> { code = -1, msg = "不存在该物料" };
            return new ApiResult<DataTable> { code = 1, msg = "查询成功", data = dataSet.Tables[0] };
        }
        #endregion
        /// <summary>
        /// åå®¡æ ¸
        /// </summary>
@@ -571,13 +593,13 @@
                sql = @"
Insert Into Cg_POInStockBillMain   
(HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate
,HBillNo,HBillStatus,HSupID,HManagerID,HEmpID,HDeptID,HRemark
,HBillNo,HBillStatus,HSupID,HSupDealerID,HManagerID,HEmpID,HDeptID,HRemark
,HMaker,HMakeDate,HChecker,HCheckDate,HOWNERTYPEID,HOWNERID
,HERPInterID,HERPBillType,HPURCHASEORGID,HSTOCKORGID,HREQUIREORGID
,HSTOCKGROUPID,HSENDBILLNO,HLADBILLNO,HPURDEPTID,HPURGROUPID,HSUPPLYID
,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HSUPPLYADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID,HCurID,HExRate,HAddress,HWHID,HInnerBillNo)
values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1103 + "','" +
mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "'," + mainList[0].HBillStatus + "," + mainList[0].HSupID +
mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "'," + mainList[0].HBillStatus + "," + mainList[0].HSupDealerID + "," + mainList[0].HSupID +
"," + mainList[0].HManagerID + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker +
"','" + mainList[0].HMakeDate + "','" + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HOWNERTYPEID + "'," + mainList[0].HOWNERID + "," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "'," + mainList[0].HPURCHASEORGID + "," + mainList[0].HSTOCKORGID + "," + mainList[0].HREQUIREORGID + "," +
mainList[0].HSTOCKGROUPID + ",'" + mainList[0].HSENDBILLNO + "','" + mainList[0].HLADBILLNO + "'," + mainList[0].HPURDEPTID + "," + mainList[0].HPURGROUPID + "," + mainList[0].HSUPPLYID + "," +
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -989,14 +989,14 @@
                //主表
                oCN.RunProc(@"Insert Into Cg_POOrderBillMain   
                        (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
                        ,HAddress,HSSID,HSSDate,HPSStyleID,HSupID,HCurID
                        ,HAddress,HSSID,HSSDate,HPSStyleID,HSupID,HSupDealerID,HCurID
                        ,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HRemark,HInnerBillNo
                        ,HChecker,HCheckDate,HMaker,HMakeDate
                        ,HERPInterID,HERPBillType,HPURCHASEORGID
                        ,HPURCHASERGROUPID,HPROVIDERID,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HPROVIDERADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID)
                        values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1102 + "','" +
                    mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "','" + mainList[0].HBillStatus + "','" + mainList[0].HAddress +
                    "'," + mainList[0].HSSID + ",'" + mainList[0].HSSDate + "'," + mainList[0].HPSStyleID + "," + mainList[0].HSupID + "," + mainList[0].HCurID +
                    "'," + mainList[0].HSSID + ",'" + mainList[0].HSSDate + "'," + mainList[0].HPSStyleID + "," + mainList[0].HSupDealerID + "," + mainList[0].HSupID + "," + mainList[0].HCurID +
                    "," + mainList[0].HExRate + "," + mainList[0].HEmpID + "," + mainList[0].HManagerID + "," + mainList[0].HDeptID + ",'" + mainList[0].HExplanation + "','" + mainList[0].HRemark + "','" + mainList[0].HInnerBillNo + "','" + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HMaker + "','" +
                    mainList[0].HMakeDate + "'," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "'," + mainList[0].HPURCHASEORGID + "," + mainList[0].HPURCHASERGROUPID + ","
                    + mainList[0].HPROVIDERID + "," + mainList[0].HSETTLEID + "," + mainList[0].HCHARGEID + ",'" + mainList[0].HBUSINESSTYPE + "','" + mainList[0].HPROVIDERADDRESS + "',"
@@ -1118,6 +1118,29 @@
            }
        }
        #region æ ¹æ®ç‰©æ–™å†…码获取物料信息
        [Route("Cg_POOrderBill/getMaterialByMaterID")]
        [HttpGet]
        public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
                " from Gy_Material AS a " +
                " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
                " where a.HItemID =" + HMaterID;
            var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataTable> { code = -1, msg = "不存在该物料" };
            return new ApiResult<DataTable> { code = 1, msg = "查询成功", data = dataSet.Tables[0] };
        }
        #endregion
        #region é‡‡è´­è®¢å• å®¡æ ¸/反审核
        /// <summary>
        /// 
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
@@ -17,47 +17,18 @@
        public DAL.ClsCg_POInStockBill BillOld = new DAL.ClsCg_POInStockBill();
        private json objJsonResult = new json();
        public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        public DataSet ds = new DataSet();
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Kf_POStockInBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
        public object HRemark { get; private set; }
        public object HSourceBillNo { get; private set; }
        public object HSourceBillType { get; private set; }
        public object HPOOrderBillNo { get; private set; }
        public object HAuxPropID { get; private set; }
        public object HBatchNO { get; private set; }
        public object HRelationQty { get; private set; }
        public object sql { get; private set; }
        public object oCn { get; private set; }
                ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where HitemID=" + HInterID, "h_v_Kf_POStockInBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// --返回收料通知单列表
@@ -108,6 +79,343 @@
                return objJsonResult;
            }
        }
        #region é‡‡è´­å…¥åº“单 ä¿å­˜/编辑功能
        [Route("Kf_POStockInBill/POStockInBillEdit")]
        [HttpPost]
        public object POStockInBillEdit([FromBody] JObject sMainSub)
        {
            try
            {
                var _value = sMainSub["sMainSub"].ToString();
                string msg1 = _value.ToString();
                oCN.BeginTran();
                //保存主表
                objJsonResult = AddBillMain(msg1);
                if (objJsonResult.code == "0")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = objJsonResult.Message;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                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 = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString(); //主表数据
            string msg3 = sArray[1].ToString(); //子表数据
            int OperationType = int.Parse(sArray[2].ToString()); // æ•°æ®ç±»åž‹ 1添加 3修改
            string user = sArray[3].ToString();
            string msg_allVal = sArray[4].ToString(); //主表+子表所有数据
            try
            {
                msg2 = "[" + msg2.ToString() + "]";
                List<ClsKf_ICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillMain>>(msg2);
                long HInterID = mainList[0].HInterID;//递入type得到的单据ID
                string HBillNo = mainList[0].HBillNo;//递入type得到的单据号
                long HPRDORGID = mainList[0].HPRDORGID;//生产组织
                DateTime HDate = mainList[0].HDate;//日期
                string HRemark = mainList[0].HRemark;//备注
                long HEmpID = mainList[0].HEmpID;//业务员
                long HDeptID = mainList[0].HDeptID;//部门
                long HSupID = mainList[0].HSupID;//供应商
                long HWHID = mainList[0].HWHID;//仓库
                long HCurID = mainList[0].HCurID;//币别
                long HManagerID = mainList[0].HManagerID;//主管
                long HSTOCKORGID = mainList[0].HSTOCKORGID;//库存组织
                long HOWNERID = mainList[0].HOWNERID;//货主
                long HSCWHID = mainList[0].HSCWHID;//调出仓库
                long HSecManagerID = mainList[0].HSecManagerID;//验收
                long HKeeperID = mainList[0].HKeeperID;//保管员
                string HExplanation = mainList[0].HExplanation;//摘要
                string HInnerBillNo = mainList[0].HInnerBillNo;//内部单据号
                string HAddress = mainList[0].HAddress;//地址
                string HBillType = mainList[0].HBillType;
                string HBillSubType = mainList[0].HBillSubType;
                long HBillStatus = mainList[0].HBillStatus;
                string HMaker = user;//制单人
                string HMakeDate = mainList[0].HMakeDate;
                string HChecker = mainList[0].HChecker;
                string HCheckDate = mainList[0].HCheckDate;
                string HUpDater = mainList[0].HUpDater;
                string HUpDateDate = mainList[0].HUpDateDate;
                string HDeleteMan = mainList[0].HDeleteMan;
                string HDeleteDate = mainList[0].HDeleteDate;
                string HCloseMan = mainList[0].HCloseMan;
                string HCloseDate = mainList[0].HCloseDate;
                ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and å•据号='" + HBillNo + "'", "h_v_Kf_POStockInBillList");
                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增
                {
                    //主表
                    String sql=$@"Insert Into Kf_ICStockBillMain
                        (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
                        ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark
                        ,HInnerBillNo,HSTOCKORGID,HOWNERID ,HChecker,HCheckDate,HMaker,HMakeDate)
                        values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" +
                    HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
                    "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," +
                    HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark
                    + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HChecker + "',getdate()" + ",'" + HMaker + "',getdate()" +")";
                    oCN.RunProc(sql);
                }
                else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                { //修改
                    String sql = $@"update Kf_ICStockBillMain  set " +
                                "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" +
                                 ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID
                                 + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID
                                 + ",HAddress='" + HAddress + "'where HInterID=" + HInterID;
                    oCN.RunProc(sql);
                    //删除子表
                    oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, HInterID, OperationType);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = objJsonResult.Message;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = null;
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public json AddBillSub(string msg3, long HInterID, int OperationType)
        {
            List<ClsKf_ICStockBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillSub>>(msg3);
            List<ClsKf_ICStockBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillSub>>(msg3);
            string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo;
            string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType;
            double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty;
            long HPropertyID = DetailColl2[0].HPropertyID == null ? 0 : DetailColl2[0].HPropertyID;
            long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID;
            string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo;
            string HSeOrderBillNo = DetailColl2[0].HSeOrderBillNo == null ? "''" : DetailColl2[0].HSeOrderBillNo;
            string HRemark = DetailColl2[0].HRemark == null ? "''" : DetailColl2[0].HRemark;
            int i = 0;
            IList list = DetailColl;
            for (int i1 = 0; i1 < list.Count; i1++)
            {
                ClsKf_ICStockBillSub oSub = (ClsKf_ICStockBillSub)list[i1];
                i++;
                if (oSub.HQty <= 0 || oSub.HQty == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,数量不能为0或者小于0";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HMaterID == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,物料不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (oSub.HSourceID == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "第" + i + "行,生产资源不能为空";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (oSub.HUnitID == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,计量单位不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet Cs;
                Int64 NewHEntryID = 1;
                Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Kf_ICStockBillSub", "Kf_ICStockBillSub");
                if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
                {
                    NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
                    NewHEntryID += 1;
                }
                string sql = $@"Insert into Kf_ICStockBillSub
                (HInterID,HEntryID,HMaterID,HUnitID,HQtyMust,HQty,HPrice
                ,HMoney,HOrderPrice,HWHID,HSPID,HRelationQty,HBatchNo
                ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
                ,HPOOrderInterID,HPOOrderEntryID ,HPOOrderBillNo
                ,HPropertyID,HSecUnitID,HSecUnitRate,HPlanMode,HRemark,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo)
                 values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID}
                ,{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HPrice},{oSub.HMoney},{oSub.HOrderPrice},{oSub.HWHID},{oSub.HSPID},{oSub.HRelationQty}
                ,'{oSub.HBatchNo}',{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}'
                ,{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}'
                ,{(oSub.HPropertyID == null ? 0 : oSub.HPropertyID)},{(oSub.HSecUnitID == null ? 0 : oSub.HSecUnitID)},{(oSub.HSecUnitRate == null ? 0 : oSub.HSecUnitRate)}
                ,{(oSub.HPlanMode == null ? 0 : oSub.HPlanMode)},'{oSub.HRemark}',{oSub.HSeOrderInterID},{oSub.HSeOrderEntryID},'{oSub.HSeOrderBillNo}')";
                oCN.RunProc(sql);
            }
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = null;
            objJsonResult.data = null;
            return objJsonResult;
        }
        /// <summary>
        ///删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Kf_POStockInBill/DeltetKf_POStockInBill")]
        [HttpGet]
        public object DeltetKf_POStockInBill(string HInterID)
        {
            try
            {
                oCN.BeginTran();
                oCN.RunProc("Delete From Kf_ICStockBillMain  where HInterID = " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
                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.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Kf_POStockInBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid =" + HInterID, "h_v_Kf_POStockInBillList");
                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("Kf_POStockInBill/getMaterialByMaterID")]
        [HttpGet]
        public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
                " from Gy_Material AS a " +
                " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
                " where a.HItemID =" + HMaterID;
            var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataTable> { code = -1, msg = "不存在该物料" };
            return new ApiResult<DataTable> { code = 1, msg = "查询成功", data = dataSet.Tables[0] };
        }
        #endregion
        #region é‡‡è´­å…¥åº“单 å®¡æ ¸/反审核
        /// <summary>
@@ -543,3 +851,4 @@
    }
}
#endregion
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_CompleteController..cs
@@ -15,6 +15,7 @@
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        DataSet ds;
        #region é½å¥—分析信息明细列表
@@ -41,6 +42,52 @@
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region é½å¥—物料信息明细列表
        /// <summary>
        ///
        /// </summary>
        /// <param name="sWhere">查询条件</param>
        /// <param name="HMainICMOEntryID">生产订单明细表id</param>
        /// <returns></returns>
        [Route("JIT_Complete/JIT_CompleteMaterlDetailList")]
        [HttpGet]
        public object JIT_CompleteMaterlDetailList(string sWhere )
        {
            try
            {
                ds = oCN.RunProcReturn("exec h_p_JIT_MaterDetailList  " + sWhere, "h_p_JIT_MaterDetailList");
                List<object> columnNameList = new List<object>();
                //添加列名
                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));  //获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
@@ -98,7 +145,18 @@
        {
            try
            {
                string Ret = "";
                oSystemParameter.ShowBill(ref Ret);
                if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特")
                {
                    ds = oCN.RunProcReturn("select top 1000 * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory");
                }
                else
                {
                ds = oCN.RunProcReturn("select * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -258,6 +258,7 @@
                        var HOrderNeedQty = list[i]["订单需求数量"].ToString();
                        var HOrderCommitDate = list[i]["订单交货期"].ToString();
                        var HPlanEndDate = list[i]["计划结束日期"].ToString();
                        var HSplitQty = list[i]["拆单数量"].ToString();
                        if (HSourceID == "" || HSourceID == "0")
                        {
@@ -291,7 +292,7 @@
                        oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
                            $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
                            $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}'" +
                            $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty}" +
                            $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["单据号"].ToString()}'");
                    }
@@ -309,7 +310,7 @@
                            objJsonResult = AddBillSub(HInterID == 0 ? list[i]["hmainid"].ToString() : HInterID.ToString()
                                , HBillNo == "" ? list[i]["单据号"].ToString() : HBillNo
                                 , DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString())
                                 , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString())
                                 , Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()),1)
                                 , list[i]);
                            if (objJsonResult.count == 1)
                            {
@@ -355,7 +356,7 @@
            }
        }
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY, Dictionary<string, string> dic)
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic)
        {
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where å•据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
@@ -2617,11 +2618,11 @@
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 æ•°æ®å‡†å¤‡ è®¾ç½®ä»»åŠ¡å•ç›¸å…³ä¿¡æ¯
        [Route("JIT_DayPlanPlatFormBill/ReadyData")]
        [HttpGet]
        public object ReadyData(string HICOMNum)
        public object ReadyData(string SWhere)
        {
            try
            {
                var list = HICOMNum.Split(',');
                var list = SWhere.Split(',');
                DataTable dt = new DataTable("date");
                dt.Columns.Add("HICMOInterID", typeof(string));
                dt.Columns.Add("HICMOEntryID", typeof(string));
@@ -2637,9 +2638,10 @@
                {
                    string HICMOInterID = list[i].Split(';')[0].ToString();
                    string HICMOEntryID = list[i].Split(';')[1].ToString();
                    string HSourceID = list[i].Split(';')[2].ToString();
                    Thread.Sleep(100);
                    ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID, "h_p_Sc_GetInfoByICMOBillNo");
                    ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID+","+ HSourceID, "h_p_Sc_GetInfoByICMOBillNo");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÁìÁÏ·¢»õ/Kf_MateOutRequestBillController.cs
@@ -248,8 +248,13 @@
                }
                string sql = $@"Insert into Kf_MateOutRequestBillSub 
                (HInterID,HEntryID,HDate,HRemark,HMTONo,HMaterID,HUnitID,HBatchNO,HWHID,HSPID,HQtyMust,HQty,HRelationQty,HRelationMoney,HPrice,HMoney,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID,HICMOBillNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo)
                 values({HInterID},{NewHEntryID},getdate(),'{oSub.HRemark}','{oSub.HMTONo}',{oSub.HMaterID},{oSub.HUnitID},'{oSub.HBatchNO}',{oSub.HWHID},{oSub.HSPID},{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HPrice},{oSub.HMoney},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HICMOInterID},{oSub.HICMOEntryID},'{oSub.HICMOBillNo}',{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}')";
                (HInterID,HEntryID,HDate,HRemark,HMTONo,HMaterID,HUnitID,HBatchNO,HWHID,HSPID,HQtyMust,HQty,HRelationQty,
                HRelationMoney,HPrice,HMoney,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID,
                HICMOBillNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo)
                 values({HInterID},{NewHEntryID},getdate(),'{oSub.HRemark}','{oSub.HMTONo}',{oSub.HMaterID},{oSub.HUnitID},
                '{oSub.HBatchNO}',{oSub.HWHID},{oSub.HSPID},{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HRelationQty},{oSub.HRelationMoney},
                {oSub.HPrice},{oSub.HMoney},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HICMOInterID},
                {oSub.HICMOEntryID},'{oSub.HICMOBillNo}',{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}')";
                oCn.RunProc(sql);
            }
WebAPI/Models/ClsKf_ICStockBillMain.cs
@@ -53,5 +53,8 @@
        public string HSourceBillType;
        public Int64 HSourceInterID;
        public Int64 HSourceEntryID;
        public long HPSStyleID { get; internal set; }
    }
}
WebAPI/Models/ClsKf_ICStockBillSub.cs
@@ -67,5 +67,22 @@
        public Single HTaxRate;             //        money           --税率
        public Int64 HSTOCKORGID;           //        int             --库存组织
        public int HAuxPropID { get; internal set; }
        public string HBatchNO { get; internal set; }
        public object HContainerNum { get; internal set; }
        public object HPVC { get; internal set; }
        public object HViscosity { get; internal set; }
        public object HImpurity { get; internal set; }
        public object HIron { get; internal set; }
        public object HGrossQty { get; internal set; }
        public object HMembrane { get; internal set; }
        public object HAluminum { get; internal set; }
        public object HPackWeight { get; internal set; }
        public object HPaper { get; internal set; }
        public object HLoss { get; internal set; }
        public object HWater { get; internal set; }
        public object HPowder { get; internal set; }
        public object HCap { get; internal set; }
        public object HNetQty { get; internal set; }
    }
}
WebAPI/Web.config
@@ -22,7 +22,7 @@
        <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
        <!--<add key="FileIP" value="http://localhost:8080/" />-->
        <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
        <!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/> é¢œå°å¼æœº-->
        <add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/> <!--颜台式机-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> -->
        <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    åšæ—¥ç§‘技-->
@@ -34,7 +34,7 @@
        <!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/>     å®‰ç‘žæœåС噍-->
        <!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/>        --> <!--测试服务器-->
        <!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/>    æœ¬åœ°-->
        <add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/><!--陈雯静本地配置-->
        <!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>    é™ˆé›¯é™æœ¬åœ°é…ç½®-->
        <add key="webpages:Version" value="3.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@
    <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>E:\智云mes\mes\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>false</UseIISExpress>
    <Use64BitIISExpress />