zrg
2024-05-15 fb430f2f171cc1ac6e58de1bf14cf4087d27a3f4
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
8个文件已修改
688 ■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSc_MouldProdBackBill.cs 235 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/模具管理/ClsSc_MouldProdOutBill.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/MouldController.cs 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldProdBackBill.cs
@@ -17,7 +17,7 @@
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_MouldStockBillMain";
            base.MvarReportTitle = "模具退库单";
            base.MvarReportTitle = "模具领用退库单";
            base.BillType = "3803";
            base.HBillSubType = "3803";
@@ -29,8 +29,63 @@
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //保存前控制
        public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 HSecManagerID, Int64 HKeeperID, Int64 HSupID, Int64 OperationType, ref string sReturn)
        {
            try
            {
                DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldProdBackBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + HSecManagerID.ToString() + "," + HKeeperID.ToString() + "," + HSupID.ToString() + "," + OperationType.ToString(), "h_p_Sc_MouldProdBackBill_BeforeSaveCtrl");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
                    {
                        sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                        return false;
                    }
                }
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //保存后控制
        public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn)
        {
            try
            {
                DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldProdBackBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldProdBackBill_AfterSaveCtrl");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "保存后判断失败!";
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
                    {
                        sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                        return false;
                    }
                }
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
@@ -38,6 +93,12 @@
            {
                //
                oCn.BeginTran();
                //保存前控制
                if (!BeforeSave(lngBillKey, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 2, ref sReturn))
                {
                    oCn.RollBack();
                    return false;
                }
                //更新主表
                oCn.RunProc("UpDate Sc_MouldStockBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -49,16 +110,18 @@
                ",HUpDateDate=getdate()" +
                //========================================
                ",HSupID=" + omodel.HSupID.ToString() +
                ",HWHID=" + omodel.HWHID.ToString() +
                ",HSCWHID=" + omodel.HSCWHID.ToString() +
                ",HSupTypeID=" + omodel.HSupTypeID.ToString() +
                ",HEmpID=" + omodel.HEmpID.ToString() +
                ",HManagerID=" + omodel.HManagerID.ToString() +
                ",HSecManagerID=" + omodel.HSecManagerID.ToString() +
                ",HKeeperID=" + omodel.HKeeperID.ToString() +
                ",HDeptID=" + omodel.HDeptID.ToString() +
                ",HWHID=" + omodel.HWHID.ToString() +
                ",HSCWHID=" + omodel.HSCWHID.ToString() +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                ",HStockOrgID=" + omodel.HSTOCKORGID.ToString() +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -69,43 +132,32 @@
                foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_MouldStockBillSub " +
                        " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                        ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
                        ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" +
                        ",HDesignLife,HLeaveLife,HUseLife" +
                        ",HSCSPID,HSPGroupID,HBatchNo" +
                        //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
                        //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                        ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" +
                        ",HQtyRel" +
                        ") values("
                        + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                        "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                        "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
                        "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() +
                        "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() +
                        "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'" +
                        //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" +
                        //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                        ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" +
                        "," + 0 +
                        ") ");
                      " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                      ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HBatchNo" +
                      ",HQtyMust,HQtyRel,HQty,HPrice,HMoney,HDesignLife" +
                      ",HLeaveLife,HUseLife,HUseLifeQty,HNewLifeQty,HWHID,HSCWHID" +
                      ",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
                      ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                      ",HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
                      "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HBatchNo + "'" +
                      "," + oSub.HQtyMust.ToString() + "," + oSub.HQtyRel.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HDesignLife.ToString() +
                      "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + "," + oSub.HUseLifeQty.ToString() + "," + oSub.HNewLifeQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() +
                      "," + oSub.HSPID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBarCode + "'," + oSub.HCorrespondentTypeID.ToString() + "," + oSub.HCorrespondentID.ToString() +
                      "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                      "," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + "," + oSub.HOtherOrgID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
                      ") ");
                }
                //
                //foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdBackBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                sReturn = "修改单据成功!";
                //保存后控制
                if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
                {
                    oCn.RollBack();
                    return false;
                }
                sReturn = "单据号:" + omodel.HBillNo + " ä¿®æ”¹æˆåŠŸï¼";
                oCn.Commit();
                return true;
            }
@@ -158,66 +210,79 @@
        {
            try
            {
                //获取系统参数
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                if (oSystemParameter.ShowBillByOrgID(omodel.HSTOCKORGID, ref sReturn) == false)
                {
                    sReturn = "获取系统参数失败! " + sReturn;
                    return false;
                }
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                if (omodel.HInterID == 0)
                {
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //保存前控制
                if (!BeforeSave(omodel.HInterID, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 1, ref sReturn))
                {
                    return false;
                }
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_MouldStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
                ",HSupID,HSupTypeID,HEmpID,HManagerID,HSecManagerID" +
                ",HKeeperID,HDeptID,HWHID,HSCWHID,HRedBlueFlag" +
                ",HExplanation,HInnerBillNo,HStockOrgID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() +
                ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                ", " + omodel.HSupID.ToString() + "," + omodel.HSupTypeID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() +
                ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HSTOCKORGID.ToString() +
                ") ");
                //插入子表
                foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_MouldStockBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
                      ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" +
                      ",HDesignLife,HLeaveLife,HUseLife" +
                      ",HSCSPID,HSPGroupID,HBatchNo"+
                      //",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
                      //",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                      ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" +
                      ",HQtyRel"+
                      " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                      ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HBatchNo" +
                      ",HQtyMust,HQtyRel,HQty,HPrice,HMoney,HDesignLife" +
                      ",HLeaveLife,HUseLife,HUseLifeQty,HNewLifeQty,HWHID,HSCWHID" +
                      ",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
                      ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                      ",HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
                      "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() +
                      "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() +
                      "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'"+
                      //"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" +
                      //"," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                      ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" +
                      ","+0+
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
                      "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HBatchNo + "'" +
                      "," + oSub.HQtyMust.ToString() + "," + oSub.HQtyRel.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HDesignLife.ToString() +
                      "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + "," + oSub.HUseLifeQty.ToString() + "," + oSub.HNewLifeQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() +
                      "," + oSub.HSPID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBarCode + "'," + oSub.HCorrespondentTypeID.ToString() + "," + oSub.HCorrespondentID.ToString() +
                      "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                      "," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + "," + oSub.HOtherOrgID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
                      ") ");
                }
                //
                //foreach (Model.ClsSc_MouldProdBackBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdBackBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                //
                sReturn = "新增单据成功!";
                //保存后控制
                if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
                {
                    oCn.RollBack();
                    return false;
                }
                if (oSystemParameter.omodel.Sc_MouldProdBackBill_AutoCheck.ToUpper() == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸
                {
                    //审核单据
                    oCn.RunProc("Update Sc_MouldStockBillMain Set HChecker='" + DBUtility.ClsPub.CurUserName + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + omodel.HInterID.ToString());
                    sReturn = "单据号:" + omodel.HBillNo + " æ–°å¢žå®¡æ ¸æˆåŠŸï¼";
                }
                else
                {
                    sReturn = "单据号:" + omodel.HBillNo + " æ–°å¢žæˆåŠŸï¼";
                }
                oCn.Commit();
                return true;
            }
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldProdOutBill.cs
@@ -173,19 +173,25 @@
        {
            try
            {
                //获取系统参数
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                if (oSystemParameter.ShowBillByOrgID(omodel.HSTOCKORGID, ref sReturn) == false)
                {
                    sReturn = "获取系统参数失败! " + sReturn;
                    return false;
                }
                //得到mainid
                if(omodel.HInterID==0)
                if (omodel.HInterID==0)
                {
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制
                if (!BeforeSave(omodel.HInterID, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 1, ref sReturn))
                {
                    oCn.RollBack();
                    return false;
                }
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_MouldStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
@@ -229,7 +235,17 @@
                    oCn.RollBack();
                    return false;
                }
                sReturn = "单据号:" + omodel.HBillNo + " æ–°å¢žæˆåŠŸï¼";
                if (oSystemParameter.omodel.Sc_MouldProdOutBill_AutoCheck.ToUpper() == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸
                {
                    //审核单据
                    oCn.RunProc("Update Sc_MouldStockBillMain Set HChecker='" + DBUtility.ClsPub.CurUserName + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + omodel.HInterID.ToString());
                    sReturn = "单据号:" + omodel.HBillNo + " æ–°å¢žå®¡æ ¸æˆåŠŸï¼";
                }
                else
                {
                    sReturn = "单据号:" + omodel.HBillNo + " æ–°å¢žæˆåŠŸï¼";
                }
                oCn.Commit();
                return true;
            }
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -1409,6 +1409,99 @@
                        omodel.BarCode_UpdatePrintQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //============================================================================器具管理EAM系统参数
                    //===========器具采购入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdInBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具领用出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_SaveAutoAddnew")
                    {
                        omodel.Sc_MouldProdOutBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_DeleterAndMakerMustSame")
                    {
                        omodel.Sc_MouldProdOutBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_MouldLifeCtrl")
                    {
                        omodel.Sc_MouldProdOutBill_MouldLifeCtrl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_MouldLifeCtrlType")
                    {
                        omodel.Sc_MouldProdOutBill_MouldLifeCtrlType = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具领用退库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdBackBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdBackBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具改制出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldRepairOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldRepairOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具改制入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldRepairInBill_AutoCheck")
                    {
                        omodel.Sc_MouldRepairInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具其他入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldOtherInBill_AutoCheck")
                    {
                        omodel.Sc_MouldOtherInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具其他出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldOtherOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldOtherOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具暂借入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldBorrowInBill_AutoCheck")
                    {
                        omodel.Sc_MouldBorrowInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具暂借出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldBorrowOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldBorrowOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具报废入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldScrapInBill_AutoCheck")
                    {
                        omodel.Sc_MouldScrapInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具报废出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldScrapOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldScrapOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具直接调拨单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdMoveBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdMoveBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具分步调出单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldMoveStockStepOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldMoveStockStepOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具分步调入单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldMoveStockStepInBill_AutoCheck")
                    {
                        omodel.Sc_MouldMoveStockStepInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具盘点单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdCheckStockBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdCheckStockBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //==============================================================================================
                    //-======进站单
@@ -3168,6 +3261,100 @@
                    {
                        omodel.BarCode_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //============================================================================器具管理EAM系统参数
                    //===========器具采购入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdInBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具领用出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_SaveAutoAddnew")
                    {
                        omodel.Sc_MouldProdOutBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_DeleterAndMakerMustSame")
                    {
                        omodel.Sc_MouldProdOutBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_MouldLifeCtrl")
                    {
                        omodel.Sc_MouldProdOutBill_MouldLifeCtrl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdOutBill_MouldLifeCtrlType")
                    {
                        omodel.Sc_MouldProdOutBill_MouldLifeCtrlType = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具领用退库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdBackBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdBackBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具改制出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldRepairOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldRepairOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具改制入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldRepairInBill_AutoCheck")
                    {
                        omodel.Sc_MouldRepairInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具其他入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldOtherInBill_AutoCheck")
                    {
                        omodel.Sc_MouldOtherInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具其他出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldOtherOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldOtherOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具暂借入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldBorrowInBill_AutoCheck")
                    {
                        omodel.Sc_MouldBorrowInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具暂借出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldBorrowOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldBorrowOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具报废入库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldScrapInBill_AutoCheck")
                    {
                        omodel.Sc_MouldScrapInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具报废出库单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldScrapOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldScrapOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具直接调拨单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdMoveBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdMoveBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具分步调出单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldMoveStockStepOutBill_AutoCheck")
                    {
                        omodel.Sc_MouldMoveStockStepOutBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具分步调入单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldMoveStockStepInBill_AutoCheck")
                    {
                        omodel.Sc_MouldMoveStockStepInBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //===========器具盘点单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MouldProdCheckStockBill_AutoCheck")
                    {
                        omodel.Sc_MouldProdCheckStockBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //============================================================================MES系统参数
                    //-==================生产订单
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -410,6 +410,59 @@
        public string BarCode_AutoSellOutBackBillWMS;   //选源单销售退货单生成条码时是否自动同步生成条码出入库记录('Y'为自动同步)
        public string BarCode_DeleterAndMakerMustSame;  //条码主档删除人必须是制单人
        //====================================================器具管理EAM
        //器具采购入库单
        public string Sc_MouldProdInBill_AutoCheck; //保存后是否自动审核
        //器具领用出库单
        public string Sc_MouldProdOutBill_AutoCheck; //保存后是否自动审核
        public string Sc_MouldProdOutBill_SaveAutoAddnew; //保存后变为新增状态
        public string Sc_MouldProdOutBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string Sc_MouldProdOutBill_MouldLifeCtrl; //保存时器具寿命控制 ï¼ˆY æŽ§åˆ¶ï¼Œ N ä¸æŽ§åˆ¶ å½“器具预计寿命或者当前寿命不足时,不允许领用)
        public string Sc_MouldProdOutBill_MouldLifeCtrlType; //保存时器具寿命控制类型 ï¼ˆY å¼ºåˆ¶æŽ§åˆ¶ï¼Œ N ä»…提示)
        //器具领用退库单
        public string Sc_MouldProdBackBill_AutoCheck; //保存后是否自动审核
        //器具改制出库单
        public string Sc_MouldRepairOutBill_AutoCheck; //保存后是否自动审核
        //器具改制入库单
        public string Sc_MouldRepairInBill_AutoCheck; //保存后是否自动审核
        //器具其他入库单
        public string Sc_MouldOtherInBill_AutoCheck; //保存后是否自动审核
        //器具其他出库单
        public string Sc_MouldOtherOutBill_AutoCheck; //保存后是否自动审核
        //器具暂借入库单
        public string Sc_MouldBorrowInBill_AutoCheck; //保存后是否自动审核
        //器具暂借出库单
        public string Sc_MouldBorrowOutBill_AutoCheck; //保存后是否自动审核
        //器具报废入库单
        public string Sc_MouldScrapInBill_AutoCheck; //保存后是否自动审核
        //器具报废出库单
        public string Sc_MouldScrapOutBill_AutoCheck; //保存后是否自动审核
        //器具直接调拨单
        public string Sc_MouldProdMoveBill_AutoCheck; //保存后是否自动审核
        //器具分步调出单
        public string Sc_MouldMoveStockStepOutBill_AutoCheck; //保存后是否自动审核
        //器具分步调入单
        public string Sc_MouldMoveStockStepInBill_AutoCheck; //保存后是否自动审核
        //器具盘点单
        public string Sc_MouldProdCheckStockBill_AutoCheck; //保存后是否自动审核
        //====================================================工序流转WIP
        //生产订单
@@ -549,19 +602,6 @@
        public string QC_ProcessCheckBill_QCSchemeSource;               //质检方案来源
        //EAM
        //器具领用出库单
        public string Sc_MouldProdOutBill_AutoCheck; //保存后是否自动审核
        public string Sc_MouldProdOutBill_SaveAutoAddnew; //保存后变为新增状态
        public string Sc_MouldProdOutBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string Sc_MouldProdOutBill_MouldLifeCtrl; //保存时器具寿命控制 ï¼ˆY æŽ§åˆ¶ï¼Œ N ä¸æŽ§åˆ¶ å½“器具预计寿命或者当前寿命不足时,不允许领用)
        public string Sc_MouldProdOutBill_MouldLifeCtrlType; //保存时器具寿命控制类型 ï¼ˆY å¼ºåˆ¶æŽ§åˆ¶ï¼Œ N ä»…提示)
        //工艺路线
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -682,6 +682,9 @@
                oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
values({HInterID}, '{HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)");
                //把条码写入日志里面
                LogService.CustomWriteLog("条码:" + omodel.HBarCode_P + ",工序:"+ HProcID + ",出站时间:" + DateTime.Now, "TM" + DateTime.Now.ToString("yyyy-MM-dd"));
                //反写工序出站单的合格数量
                oCN.RunProc("update Sc_StationOutBillMain set HQty+=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HInterID=" + HInterID);
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2356,7 +2356,8 @@
                    oCn.BeginTran();
                    oCn.RunProc("delete from Sc_StationOutBillSub_SN where HInterID="+ HInterID+ " and HBarCode='"+ HBardcode + "'");
                    oCn.RunProc("delete from Sc_StationOutBillSub_SN where HInterID=" + HInterID + " and HBarCode='" + HBardcode + "'");
                    oCn.RunProc("update  Sc_StationOutBillMain set HQty-=1 where HInterID=" + HInterID);
                    oCn.Commit();
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -1056,8 +1056,8 @@
        }
        #endregion
        #region é¦–件检验单根据源单类型获取信息-源单为工序流转卡
        [Route("QC_FirstPieceCheckBill/get_ProcessExchangeBill")]
        #region é¦–ä»¶/工序 æ£€éªŒå•根据源单类型获取信息-源单为工序流转卡
        [Route("CheckBill/get_ProcessExchangeBill")]
        [HttpGet]
        public object get_ProcessExchangeBill(string HInterID, string user)
        {
WebAPI/Controllers/ÌõÂë¹ÜÀí/MouldController.cs
@@ -162,7 +162,9 @@
        #endregion
        #region æ¨¡å…·é¢†ç”¨å‡ºåº“单
        #region å™¨å…·æäº¤ç”Ÿå•处理方法
        #region æ¨¡å…·é¢†ç”¨å‡ºåº“单     ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// æ¨¡å…·é¢†ç”¨å‡ºåº“单新增上传
@@ -321,9 +323,169 @@
        #endregion
        #region æ¨¡å…·é¢†ç”¨é€€åº“单     ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// æ¨¡å…·é¢†ç”¨é€€åº“单新增上传
        /// </summary>
        /// <returns></returns>
        [Route("MouldController/set_SaveMouldProdBackBill_Json")]
        [HttpPost]
        public object set_SaveMouldProdBackBill_Json([FromBody] JObject oMain)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            DAL.ClsSc_MouldProdBackBill BillNew = new DAL.ClsSc_MouldProdBackBill();
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                string sMainStr = "[" + msg1.ToString() + "]";
                List<Model.ClsSc_MouldProdBackBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdBackBillMain>>(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 = "3803";
                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 = mainList[0].HSupTypeID;
                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
        #endregion