yxj
2024-05-22 aa7072423bf4e89c581b68c9f14774fa2c1faaf7
WebAPI/Controllers/ÌõÂë¹ÜÀí/MouldController.cs
@@ -250,8 +250,300 @@
        #endregion
        #region å™¨å…·ç¼“存列表模块调用方法
        #region å™¨å…·ç¼“存列表界面,返回缓存列表信息
        /// <summary>
        /// å™¨å…·ç¼“存列表界面,返回缓存列表信息
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/GetKf_PonderationBillMain_TempList_New_Json")]
        [HttpGet]
        public object GetKf_PonderationBillMain_TempList_New_Json(string HBillType, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Sc_GetMouldStockBillMain_TempList '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Sc_GetMouldStockBillMain_TempList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    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 = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取单据缓存列表信息成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取单据缓存列表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å™¨å…·ç¼“存列表    ç¼–辑功能调用
        /// <summary>
        /// å™¨å…·ç¼“存列表选择编辑时,判断所选单据是否已存在上传记录
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/MouldTempList_Modify_Json")]
        [HttpGet]
        public object MouldTempList_Modify_Json(long HInterID, string HBillNo, string HBillType)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_MouldTempList_Modify " + HInterID + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_MouldTempList_Modify");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "模具缓存列表编辑前判断失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "缓存列表编辑前判断失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å™¨å…·ç¼“存列表模块  åˆ é™¤ç¼“存列表单据
        /// <summary>
        /// åˆ é™¤ç¼“存列表单据
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/set_DeleteMouldBillList_Json")]
        [HttpGet]
        public object set_DeleteMouldBillList_Json(long HInterID, string HBillType)
        {
            try
            {
                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除器具缓存列表单据失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region å™¨å…·æäº¤ç”Ÿå•处理方法
        #region æ¨¡å…·é‡‡è´­å…¥åº“单     ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// æ¨¡å…·é‡‡è´­å…¥åº“单新增上传
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/set_SaveMouldProdInBill_Json")]
        [HttpPost]
        public object set_SaveMouldProdInBill_Json([FromBody] JObject oMain)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            DAL.ClsSc_MouldProdInBill BillNew = new DAL.ClsSc_MouldProdInBill();
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                string sMainStr = "[" + msg1.ToString() + "]";
                List<Model.ClsSc_MouldProdInBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdInBillMain>>(sMainStr);
                //单据号是否重复
                if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据号重复!不允许保存!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //固定赋值=================================
                BillNew.omodel.HYear = sYear;
                BillNew.omodel.HPeriod = sPeriod;
                BillNew.omodel.HBillType = "3801";
                BillNew.omodel.HInterID = mainList[0].HInterID;
                BillNew.omodel.HBillNo = mainList[0].HBillNo;
                BillNew.omodel.HDate = mainList[0].HDate;
                BillNew.omodel.HRemark = mainList[0].HRemark;
                BillNew.omodel.HMaker = mainList[0].HMaker;
                BillNew.omodel.HSTOCKORGID = mainList[0].HSTOCKORGID;
                DBUtility.ClsPub.CurUserName = mainList[0].HMaker;
                //====================================================
                BillNew.omodel.HSupID = mainList[0].HSupID;
                BillNew.omodel.HSupTypeID = 1; //(1 ä¾›åº”商、2 å®¢æˆ·ã€ 3 è½¦é—´éƒ¨é—¨ï¼‰
                BillNew.omodel.HEmpID = mainList[0].HEmpID;
                BillNew.omodel.HManagerID = mainList[0].HManagerID;
                BillNew.omodel.HSecManagerID = mainList[0].HSecManagerID;
                BillNew.omodel.HKeeperID = mainList[0].HKeeperID;
                BillNew.omodel.HDeptID = mainList[0].HDeptID;
                BillNew.omodel.HWHID = mainList[0].HWHID;
                BillNew.omodel.HSCWHID = mainList[0].HSCWHID;
                BillNew.omodel.HExplanation = mainList[0].HExplanation;
                BillNew.omodel.HInnerBillNo = mainList[0].HInnerBillNo;
                BillNew.omodel.HRedBlueFlag = mainList[0].HRedBlueFlag;
                //子表赋值
                ds = oCn.RunProcReturn("exec h_p_Sc_GetMouldStockBill_Temp " + BillNew.omodel.HInterID.ToString() + ",'" + BillNew.omodel.HBillType + "'", "h_p_Sc_GetMouldStockBill_Temp");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有扫码信息,请先扫描条码,确认无误后再提交!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                    {
                        Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
                        //固定赋值========================================
                        oSub.HEntryID = i + 1;
                        oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
                        oSub.HSourceInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceInterID"]);
                        oSub.HSourceEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceEntryID"]);
                        oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillType"]);
                        oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillNo"]);
                        oSub.HRelationQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationQty"]);
                        oSub.HRelationMoney = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationMoney"]);
                        //=============================
                        oSub.HMaterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]);
                        oSub.HPropertyID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HAuxPropID"]);
                        oSub.HSecUnitID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSecUnitID"]);
                        oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["HSecUnitRate"]);
                        oSub.HUnitID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HUnitID"]);
                        oSub.HBatchNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBatchNo"]);
                        oSub.HQtyMust = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQtyMust"]);
                        oSub.HQtyRel = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQtyRel"]);
                        oSub.HQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQty"]);
                        oSub.HPrice = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HPrice"]);
                        oSub.HMoney = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HMoney"]);
                        oSub.HDesignLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HDesignLife"]);
                        oSub.HLeaveLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HLeaveLife"]);
                        oSub.HUseLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HUseLife"]);
                        oSub.HUseLifeQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HUseLifeQty"]);
                        oSub.HNewLifeQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HNewLifeQty"]);
                        oSub.HWHID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HWHID"]);
                        oSub.HSCWHID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSCWHID"]);
                        oSub.HSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSPID"]);
                        oSub.HSCSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSCSPID"]);
                        oSub.HSPGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSPGroupID"]);
                        oSub.HBarCode = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBarCode"]);
                        oSub.HCorrespondentTypeID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HCorrespondentTypeID"]);
                        oSub.HCorrespondentID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HCorrespondentID"]);
                        oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HPOOrderInterID"]);
                        oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HPOOrderEntryID"]);
                        oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HPOOrderBillNo"]);
                        oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSeOrderInterID"]);
                        oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSeOrderEntryID"]);
                        oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSeOrderBillNo"]);
                        oSub.HStockOrgID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HStockOrgID"]);
                        oSub.HOWNERID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HOWNERID"]);
                        oSub.HOtherOrgID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HOtherOrgID"]);
                        oSub.HOWNERTYPEID = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HOWNERTYPEID"]);
                        BillNew.DetailColl.Add(oSub);
                    }
                }
                //保存
                bool bResult;
                bResult = BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "模具采购入库单上传失败!" + e.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ¨¡å…·é¢†ç”¨å‡ºåº“单     ä¸Šä¼ ç”Ÿå•
@@ -571,6 +863,165 @@
        #endregion
        #region æ¨¡å…·æ”¹åˆ¶å‡ºåº“单     ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// æ¨¡å…·æ”¹åˆ¶å‡ºåº“单新增上传
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/set_SaveMouldRepairOutBill_Json")]
        [HttpPost]
        public object set_SaveMouldRepairOutBill_Json([FromBody] JObject oMain)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            DAL.ClsSc_MouldRepairOutBill BillNew = new DAL.ClsSc_MouldRepairOutBill();
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                string sMainStr = "[" + msg1.ToString() + "]";
                List<Model.ClsSc_MouldRepairOutBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldRepairOutBillMain>>(sMainStr);
                //单据号是否重复
                if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据号重复!不允许保存!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //固定赋值=================================
                BillNew.omodel.HYear = sYear;
                BillNew.omodel.HPeriod = sPeriod;
                BillNew.omodel.HBillType = "3825";
                BillNew.omodel.HInterID = mainList[0].HInterID;
                BillNew.omodel.HBillNo = mainList[0].HBillNo;
                BillNew.omodel.HDate = mainList[0].HDate;
                BillNew.omodel.HRemark = mainList[0].HRemark;
                BillNew.omodel.HMaker = mainList[0].HMaker;
                BillNew.omodel.HSTOCKORGID = mainList[0].HSTOCKORGID;
                DBUtility.ClsPub.CurUserName = mainList[0].HMaker;
                //====================================================
                BillNew.omodel.HSupID = mainList[0].HSupID;
                BillNew.omodel.HSupTypeID = 1; //(1 ä¾›åº”商、2 å®¢æˆ·ã€ 3 è½¦é—´éƒ¨é—¨ï¼‰
                BillNew.omodel.HEmpID = mainList[0].HEmpID;
                BillNew.omodel.HManagerID = mainList[0].HManagerID;
                BillNew.omodel.HSecManagerID = mainList[0].HSecManagerID;
                BillNew.omodel.HKeeperID = mainList[0].HKeeperID;
                BillNew.omodel.HDeptID = mainList[0].HDeptID;
                BillNew.omodel.HWHID = mainList[0].HWHID;
                BillNew.omodel.HSCWHID = mainList[0].HSCWHID;
                BillNew.omodel.HExplanation = mainList[0].HExplanation;
                BillNew.omodel.HInnerBillNo = mainList[0].HInnerBillNo;
                BillNew.omodel.HRedBlueFlag = mainList[0].HRedBlueFlag;
                //子表赋值
                ds = oCn.RunProcReturn("exec h_p_Sc_GetMouldStockBill_Temp " + BillNew.omodel.HInterID.ToString() + ",'" + BillNew.omodel.HBillType + "'", "h_p_Sc_GetMouldStockBill_Temp");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有扫码信息,请先扫描条码,确认无误后再提交!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                    {
                        Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
                        //固定赋值========================================
                        oSub.HEntryID = i + 1;
                        oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
                        oSub.HSourceInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceInterID"]);
                        oSub.HSourceEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSourceEntryID"]);
                        oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillType"]);
                        oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSourceBillNo"]);
                        oSub.HRelationQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationQty"]);
                        oSub.HRelationMoney = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HRelationMoney"]);
                        //=============================
                        oSub.HMaterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]);
                        oSub.HPropertyID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HAuxPropID"]);
                        oSub.HSecUnitID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSecUnitID"]);
                        oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["HSecUnitRate"]);
                        oSub.HUnitID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HUnitID"]);
                        oSub.HBatchNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBatchNo"]);
                        oSub.HQtyMust = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQtyMust"]);
                        oSub.HQtyRel = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQtyRel"]);
                        oSub.HQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQty"]);
                        oSub.HPrice = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HPrice"]);
                        oSub.HMoney = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HMoney"]);
                        oSub.HDesignLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HDesignLife"]);
                        oSub.HLeaveLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HLeaveLife"]);
                        oSub.HUseLife = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HUseLife"]);
                        oSub.HUseLifeQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HUseLifeQty"]);
                        oSub.HNewLifeQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HNewLifeQty"]);
                        oSub.HWHID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HWHID"]);
                        oSub.HSCWHID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSCWHID"]);
                        oSub.HSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSPID"]);
                        oSub.HSCSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSCSPID"]);
                        oSub.HSPGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSPGroupID"]);
                        oSub.HBarCode = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBarCode"]);
                        oSub.HCorrespondentTypeID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HCorrespondentTypeID"]);
                        oSub.HCorrespondentID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HCorrespondentID"]);
                        oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HPOOrderInterID"]);
                        oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HPOOrderEntryID"]);
                        oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HPOOrderBillNo"]);
                        oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSeOrderInterID"]);
                        oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSeOrderEntryID"]);
                        oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HSeOrderBillNo"]);
                        oSub.HStockOrgID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HStockOrgID"]);
                        oSub.HOWNERID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HOWNERID"]);
                        oSub.HOtherOrgID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HOtherOrgID"]);
                        oSub.HOWNERTYPEID = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HOWNERTYPEID"]);
                        BillNew.DetailColl.Add(oSub);
                    }
                }
                //保存
                bool bResult;
                bResult = BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "模具改制出库单上传失败!" + e.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ¨¡å…·è°ƒæ‹¨å•     ä¸Šä¼ ç”Ÿå•
        /// <summary>
@@ -620,7 +1071,7 @@
                BillNew.omodel.HDate = mainList[0].HDate;
                BillNew.omodel.HRemark = mainList[0].HRemark;
                BillNew.omodel.HMaker = mainList[0].HMaker;
                BillNew.omodel.HSTOCKORGID = mainList[0].HSTOCKORGID;
                BillNew.omodel.HSTOCKORGID = mainList[0].HStockInOrgID;
                DBUtility.ClsPub.CurUserName = mainList[0].HMaker;
                //====================================================
                BillNew.omodel.HSupID = mainList[0].HSupID;