yxj
2023-09-15 8dca4525e644e06117969e7dd3184912055d0d3d
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
5个文件已修改
410 ■■■■■ 已修改文件
WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutBillController.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/项目管理/项目阶段/Gy_ProjectStageController.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsKf_MateOutBill.cs 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsKf_MateOutBillMain.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsKf_MateOutBillSub.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÁìÁÏ·¢»õ/Kf_MateOutBillController.cs
@@ -403,7 +403,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,物料代码 HMaterCode ,物料名称 HMaterName,规格型号 HMaterSpec,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName,应收数量 HQtyMust,实收数量 HQty,单价 HPrice,金额 HMoney,HWHID,领料仓库代码 HWHCode,领料仓库 HWHName,表体备注 HRemark
                    ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,物料代码 HMaterCode ,物料名称 HMaterName,物料分类 HMaterRuleType,规格型号 HMaterSpec,用量 HRate,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName,应收数量 HQtyMust,实收数量 HQty,单价 HPrice,金额 HMoney,HWHID,领料仓库代码 HWHCode,领料仓库 HWHName,表体备注 HRemark
from h_v_IF_MateOutBillList"), "H_V_IF_MATEOUTBILLLIST");
                }
@@ -411,7 +411,7 @@
                {
                    //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 ";
                    string sql1 = string.Format(@"select HMaterID ,物料代码 HMaterCode ,物料名称 HMaterName,规格型号 HMaterSpec,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName,应收数量 HQtyMust,实收数量 HQty,单价 HPrice,金额 HMoney,HWHID,领料仓库代码 HWHCode,领料仓库 HWHName,表体备注 HRemark
                    string sql1 = string.Format(@"select HMaterID ,物料代码 HMaterCode ,物料名称 HMaterName,物料分类 HMaterRuleType,规格型号 HMaterSpec,用量 HRate, HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName,应收数量 HQtyMust,实收数量 HQty,单价 HPrice,金额 HMoney,HWHID,领料仓库代码 HWHCode,领料仓库 HWHName,表体备注 HRemark
from h_v_IF_MateOutBillList WHERE 1=1");
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "H_V_IF_MATEOUTBILLLIST");
@@ -457,6 +457,8 @@
            string msg3 = sArray[1].ToString();
            string refSav = sArray[2].ToString();
            string msg4 = sArray[3].ToString();
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
@@ -636,6 +638,54 @@
        }
        #endregion
        #region æ ¹æ®å·¥è‰ºå•号(工序流转卡号)获取信息
        [Route("Kf_MateOutBill/getMainDataByHProcExchBillNo")]
        [HttpGet]
        public ApiResult<DataSet> getMainDataByHProcExchBillNo(string HProcExchBillNo)
        {
            if (string.IsNullOrEmpty(HProcExchBillNo))
                return new ApiResult<DataSet> { code = -1, msg = "工艺单号不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql = "select top(1) " +
                "a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HInterID HProcExchInterID,a.HMaterID,m1.HName HMaterName,a.HMaterModel HModel,a.HMaterModel2 HModel2,a.HCusID,c1.HName HCusName,a.HWeight" +
                " from Sc_ProcessExchangeBillMain AS a " +
                " LEFT OUTER JOIN Gy_Material AS m1 on a.HMaterID = m1.HItemID " +
                " LEFT OUTER JOIN Gy_Customer AS c1 on a.HCusID = c1.HItemID " +
                " where a.HBillNo = '" + HProcExchBillNo + "'";
            var dataSet = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在单号" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        #endregion
        #region æ ¹æ®ç‰©æ–™å†…码获取物料信息
        [Route("Kf_MateOutBill/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 å™¨å…·é‡‡è´­å…¥åº“单审核/反审核
        [Route("Sc_MouldProdInHouseBill/AuditMouldProdInHouseBill")]
        [HttpGet]
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/ÏîÄ¿½×¶Î/Gy_ProjectStageController.cs
@@ -1426,10 +1426,8 @@
            public int HInterID;
            public string HBillNo;
            public string HDate;
            public int HProID;
            public int HProjectID;
            public string HProNumber;
            public string HMainSourceBillNo;
            public string HMainSourceBillType;
            public int HProjectStageID;
            public string HProjectStageName;
            public string HStageNote;
@@ -1445,6 +1443,12 @@
            public int HOrgID;
            public string HRemark;
            public string HMaker;
            public int HMainSourceInterID;
            public int HMainSourceEntryID;
            public string HMainSourceBillNo;
            public string HMainSourceBillType;
            public string HUpdater;
            public string HChecker;
            public string HMakerDate;
@@ -1559,10 +1563,8 @@
                int HInterID = mainList[0].HInterID;
                string HBillNo = mainList[0].HBillNo;
                string HDate = mainList[0].HDate;
                int HProID = mainList[0].HProID;
                int HProjectID = mainList[0].HProjectID;
                string HProNumber = mainList[0].HProNumber;
                string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
                string HMainSourceBillType = mainList[0].HMainSourceBillType;
                int HProjectStageID = mainList[0].HProjectStageID;
                string HStageNote = mainList[0].HStageNote;
                string HRelationGoods = mainList[0].HRelationGoods;
@@ -1575,6 +1577,12 @@
                double HRate = mainList[0].HRate;
                int HOrgID = mainList[0].HOrgID;
                string HRemark = mainList[0].HRemark;
                int HMainSourceInterID = mainList[0].HMainSourceInterID;
                int HMainSourceEntryID = mainList[0].HMainSourceEntryID;
                string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
                string HMainSourceBillType = mainList[0].HMainSourceBillType;
                string HMaker = mainList[0].HMaker;
                string HMakerDate = mainList[0].HMakerDate;
                string HUpdater = mainList[0].HUpdater;
@@ -1600,7 +1608,7 @@
                {
                    string sql = "insert into PM_ProjectReportBillMain" +
                        "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" +
                        ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID) " +
                        ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType) " +
                        "values(" +
                        "" + HYear +
                        "," + HPeriod +
@@ -1613,7 +1621,8 @@
                        ",'" + HRemark +
                        "','" + HMaker +
                        "','" + HMakerDate +
                        "','" + HProNumber +
                        "'," + HProjectID +
                        ",'" + HProNumber +
                        "'," + HProjectStageID +
                        ",'" + HStageNote +
                        "','" + HRelationGoods +
@@ -1625,7 +1634,11 @@
                        "','" + HCopyEmp +
                        "'," + HRate +
                        "," + HOrgID +
                        ")";
                        "," + HMainSourceInterID +
                        "," + HMainSourceEntryID +
                        ",'" + HMainSourceBillNo +
                        "','" + HMainSourceBillType +
                        "')";
                    //主表
                    oCN.RunProc(sql);
@@ -1645,7 +1658,8 @@
                        ",HRemark = '" + HRemark +
                        "',HUpdater = '" + HUpdater +
                        "',HUpdateDate = '" + HUpdaterDate +
                        "',HProNumber = '" + HProNumber +
                        "',HProjectID = " + HProjectID +
                        ",HProNumber = '" + HProNumber +
                        "',HProjectStageID = " + HProjectStageID +
                        ",HStageNote = '" + HStageNote +
                        "',HRelationGoods = '" + HRelationGoods +
@@ -1657,7 +1671,11 @@
                        "',HCopyEmp = '" + HCopyEmp +
                        "',HRate = " + HRate +
                        ",HOrgID = " + HOrgID +
                        " where HInterID = " + HInterID;
                        ",HMainSourceInterID = " + HMainSourceInterID +
                        ",HMainSourceEntryID = " + HMainSourceEntryID +
                        ",HMainSourceBillNo = '" + HMainSourceBillNo +
                        "',HMainSourceBillType = '" + HMainSourceBillType +
                        "' where HInterID = " + HInterID;
                    oCN.RunProc(sql);
@@ -1670,7 +1688,7 @@
                {
                    string sql = "insert into PM_ProjectReportBillMain" +
                        "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" +
                        ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
                        ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
                        "values(" +
                        "" + HYear +
                        "," + HPeriod +
@@ -1683,7 +1701,8 @@
                        ",'" + HRemark +
                        "','" + HMaker +
                        "','" + HMakerDate +
                        "','" + HProNumber +
                        "'," + HProjectID +
                        ",'" + HProNumber +
                        "'," + HProjectStageID +
                        ",'" + HStageNote +
                        "','" + HRelationGoods +
@@ -1695,8 +1714,8 @@
                        "','" + HCopyEmp +
                        "'," + HRate +
                        "," + HOrgID +
                        "," + HProID +
                        "," + HProjectStageID +
                        "," + HMainSourceInterID +
                        "," + HMainSourceEntryID +
                        ",'" + HMainSourceBillType +
                        "','" + HMainSourceBillNo +
                        "')";
@@ -1707,7 +1726,7 @@
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "新增项目阶段汇报:" + HBillNo + "','LMES-项目阶段汇报模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //保存子表
                objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo);
                objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HMainSourceInterID, HMainSourceEntryID, HMainSourceBillType, HMainSourceBillNo);
                if (objJsonResult.code == "0")
                {
WebAPI/DLL/ClsKf_MateOutBill.cs
@@ -39,8 +39,8 @@
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Kf_ICStockBillMain set  " +
                string mainSql = "UpDate Kf_ICStockBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
@@ -60,16 +60,75 @@
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                " where HInterID=" + lngBillKey.ToString());
                " where HInterID=" + lngBillKey.ToString();
                //判断使用客户,根据客户进行个性化调整
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                string sErrMsg = "";
                oSystemParameter.ShowBill(ref sErrMsg);
                if (oSystemParameter.omodel.WMS_CampanyName == "")          //乔一客户
                {
                    mainSql = "UpDate Kf_ICStockBillMain set " +
                        " HBillNo='" + omodel.HBillNo +
                        "',HDate='" + omodel.HDate +
                        "',HYear='" + omodel.HYear.ToString() +
                        "',HPeriod='" + omodel.HPeriod.ToString() +
                        "',HRemark='" + omodel.HRemark +
                        "',HUpDater='" + DBUtility.ClsPub.CurUserName +
                        "',HUpDateDate=getdate()" +
                        //========================================
                        ",HSupID=" + omodel.HSupID.ToString() +
                        ",HWHID=" + omodel.HWHID.ToString() +
                        ",HSCWHID=" + omodel.HSCWHID.ToString() +
                        ",HEmpID=" + omodel.HEmpID.ToString() +
                        ",HManagerID=" + omodel.HManagerID.ToString() +
                        ",HSecManagerID=" + omodel.HSecManagerID.ToString() +
                        ",HKeeperID=" + omodel.HKeeperID.ToString() +
                        ",HDeptID=" + omodel.HDeptID.ToString() +
                        ",HExplanation='" + omodel.HExplanation +
                        "',HInnerBillNo='" + omodel.HInnerBillNo +
                        "',HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                        ",HICMOInterID=" + omodel.HICMOInterID +
                        ",HICMOEntryID=" + omodel.HICMOEntryID +
                        ",HICMOBillNo='" + omodel.HICMOBillNo +
                        "',HProcExchInterID=" + omodel.HProcExchInterID +
                        ",HProcExchEntryID=" + omodel.HProcExchEntryID +
                        ",HProcExchBillNo='" + omodel.HProcExchBillNo +
                        "',HMaterID=" + omodel.HMaterID +
                        ",HMaterName='" + omodel.HMaterName +
                        "',HVerNo='" + omodel.HVerNo +
                        "',HModel='" + omodel.HModel +
                        "',HModel2='" + omodel.HModel2 +
                        "',HPieceQty='" + omodel.HPieceQty +
                        "',HCusID=" + omodel.HCusID +
                        ",HWeight=" + omodel.HWeight +
                        ",HLong=" + omodel.HLong +
                        ",HSingleWeight=" + omodel.HSingleWeigth +
                        ",HMaterSumWeight=" + omodel.HMaterSumWeight +
                        ",HMaterEmpID=" + omodel.HMaterEmpID +
                        ",HMachineSpeed=" + omodel.HMachineSpeed +
                        ",HWaterRush=" + omodel.HWaterRush +
                        ",HWaterQty=" + omodel.HWaterQty +
                        ",HWaterRate=" + omodel.HWaterRate +
                        " where HInterID=" + lngBillKey.ToString();
                }
                //更新主表
                oCn.RunProc(mainSql);
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Kf_ICStockBillSub " +
                    string subSql = "Insert into Kf_ICStockBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
@@ -83,7 +142,52 @@
                      "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.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 + "'" +
                      ") ");
                      ") ";
                    if (oSystemParameter.omodel.WMS_CampanyName == "")          //乔一客户
                    {
                        subSql = "Insert into Kf_ICStockBillSub" +
                            "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
                            ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo)" +
                            " 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.HRate.ToString() +
                            "," + oSub.HQty.ToString() +
                            "," + oSub.HPrice.ToString() +
                            "," + oSub.HMoney.ToString() +
                            "," + oSub.HWHID.ToString() +
                            "," + oSub.HSCWHID.ToString() +
                            "," + oSub.HSPID.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 +
                            "') ";
                    }
                    oCn.RunProc(subSql);
                }
                //
                //foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl)
@@ -115,7 +219,7 @@
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
                //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
                //若MAINDI重复则重新获取
                if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID))
                {
@@ -127,22 +231,86 @@
                }
                //
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Kf_ICStockBillMain   " +
                string mainSql = "Insert Into Kf_ICStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + 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) +
                ") ");
                ") ";
                //判断使用客户,根据客户进行个性化调整
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                string sErrMsg = "";
                oSystemParameter.ShowBill(ref sErrMsg);
                if (oSystemParameter.omodel.WMS_CampanyName == "")          //乔一客户
                {
                    mainSql = "Insert Into Kf_ICStockBillMain" +
                        "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HMaker,HMakeDate,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
                        ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HMaterID,HMaterName,HVerNo,HModel,HModel2,HPieceQty,HCusID,HWeight,HLong,HSingleWeight,HMaterSumWeight,HMaterEmpID" +
                        ",HMachineSpeed,HWaterRush,HWaterQty,HWaterRate) " +
                        " values(" +
                        "'" + this.BillType +
                        "','" + this.HBillSubType +
                        "'," + omodel.HInterID.ToString() +
                        ",'" + omodel.HBillNo +
                        "','" + omodel.HDate +
                        "'," + omodel.HYear.ToString() +
                        "," + omodel.HPeriod.ToString() +
                        ",'" + omodel.HRemark +
                        "'," + omodel.HProcExchInterID +
                        ",'" + omodel.HProcExchBillNo +
                        "','" + "3772" +
                        "','" + 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.HICMOInterID +
                        "," + omodel.HICMOEntryID +
                        ",'" + omodel.HICMOBillNo +
                        "'," + omodel.HProcExchInterID +
                        "," + omodel.HProcExchEntryID +
                        ",'" + omodel.HProcExchBillNo +
                        "'," + omodel.HMaterID +
                        ",'" + omodel.HMaterName +
                        "','" + omodel.HVerNo +
                        "','" + omodel.HModel +
                        "','" + omodel.HModel2 +
                        "','" + omodel.HPieceQty +
                        "'," + omodel.HCusID +
                        "," + omodel.HWeight +
                        "," + omodel.HLong +
                        "," + omodel.HSingleWeigth +
                        "," + omodel.HMaterSumWeight +
                        "," + omodel.HMaterEmpID +
                        "," + omodel.HMachineSpeed +
                        "," + omodel.HWaterRush +
                        "," + omodel.HWaterQty +
                        "," + omodel.HWaterRate +
                        ")";
                }
                //主表
                oCn.RunProc(mainSql);
                //插入子表
                foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Kf_ICStockBillSub " +
                    string subSql = "Insert into Kf_ICStockBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
@@ -156,7 +324,51 @@
                      "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.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 + "'" +
                      ") ");
                      ") ";
                    if (oSystemParameter.omodel.WMS_CampanyName == "")              //乔一客户
                    {
                        subSql = "Insert into Kf_ICStockBillSub" +
                            "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
                            ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo)" +
                            " 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.HRate.ToString() +
                            "," + oSub.HQty.ToString() +
                            "," + oSub.HPrice.ToString() +
                            "," + oSub.HMoney.ToString() +
                            "," + oSub.HWHID.ToString() +
                            "," + oSub.HSCWHID.ToString() +
                            "," + oSub.HSPID.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 +
                            "') ";
                    }
                        oCn.RunProc(subSql);
                }
                //
                //foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl)
@@ -233,8 +445,41 @@
                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
                omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
                omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]);
                //
                //判断使用客户,根据客户进行个性化调整
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                string sErrMsg = "";
                oSystemParameter.ShowBill(ref sErrMsg);
                if (oSystemParameter.omodel.WMS_CampanyName == "")              //乔一客户
                {
                    omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
                    omodel.HICMOEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOEntryID"]);
                    omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
                    omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]);
                    omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]);
                    omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]);
                    omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                    omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]);
                    omodel.HVerNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HVerNo"]);
                    omodel.HModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel"]);
                    omodel.HModel2 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel2"]);
                    omodel.HPieceQty = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPieceQty"]);
                    omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]);
                    omodel.HWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWeight"]);
                    omodel.HLong = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HLong"]);
                    omodel.HSingleWeigth = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSingleWeight"]);
                    omodel.HMaterSumWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMaterSumWeight"]);
                    omodel.HMaterEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterEmpID"]);
                    omodel.HMachineSpeed = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMachineSpeed"]);
                    omodel.HWaterRush = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRush"]);
                    omodel.HWaterQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterQty"]);
                    omodel.HWaterRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRate"]);
                }
                    //
                //循环
                DataSet DsSub ;
                DsSub = oCn.RunProcReturn("Select * from Kf_ICStockBillSub Where HInterID=" + lngBillKey.ToString(), "Kf_ICStockBillSub");
@@ -277,6 +522,12 @@
                    oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
                    oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
                    oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
                    if (oSystemParameter.omodel.WMS_CampanyName == "")              //乔一客户
                    {
                        oSub.HRate = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HRate"]);
                    }
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
WebAPI/Models/ClsKf_MateOutBillMain.cs
@@ -17,5 +17,29 @@
        public string HExplanation;//   varchar(200)        --ÕªÒª
        public string HInnerBillNo;//  varchar(50)         --内部单据号
        public bool HRedBlueFlag;//  bit            --红蓝单
        public Int64 HICMOInterID;          //int   --任务单内码
        public Int64 HICMOEntryID;          //int   --任务单子内码
        public string HICMOBillNo;          //int   --任务单号
        public Int64 HProcExchInterID;      //int   --工序流转卡内码
        public Int64 HProcExchEntryID;      //int   --工序流转卡子内码
        public string HProcExchBillNo;      //int   --工序流转卡号
        public Int64 HMaterID;              //int   --主产品内码
        public string HMaterName;           //varchar(100)  --颜色
        public string HVerNo;               //varchar(50)   --花版号
        public string HModel;               //varchar(100)  --规格型号1
        public string HModel2;              //varchar(100)  --规格型号2
        public string HPieceQty;            //varchar(20)   --只数
        public Int64 HCusID;                //int           --客户
        public double HWeight;              //dec(18,8)     --重量
        public double HLong;                //dec(18,8)     --米数
        public double HSingleWeigth;        //dec(18,8)     --单桶重量
        public double HMaterSumWeight;      //dec(18,8)     --总浆重量
        public Int64 HMaterEmpID;           //int           --打浆人
        public double HMachineSpeed;        //dec(18,8)     --机速
        public double HWaterRush;           //dec(18,8)     --水冲
        public double HWaterQty;            //dec(18,8)     --水量
        public double HWaterRate;           //dec(18,8)     --水比
    }
}
WebAPI/Models/ClsKf_MateOutBillSub.cs
@@ -30,5 +30,7 @@
        public Int64 HSeOrderEntryID;//      int            --销售订单子内码
        public string HSeOrderBillNo;//    varchar(50)        --销售订单号
        public double HRate;        //money             --用量
    }
}