yangle
2022-06-22 851efff6c0e8284021eb5bab14707cec3e439d2f
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
3个文件已修改
175 ■■■■■ 已修改文件
Pub_Class/CustomerCls/ClsPub.cs 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsPub.cs
@@ -418,7 +418,7 @@
                            }
                            return sBillNo;
                        case 1://根据 YY年+MM月 + 流水号  生成单据号
                        case 1://根据 YY年+MM月 日 + 流水号  生成单据号 (日 采用了 仓库的字段)
                            sKjYear = sKjYear.Substring(2, 2);
                            sPeriod = "0" + sPeriod;
                            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
@@ -440,7 +440,6 @@
                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'");
                            }
                            return sBillNo;
                        case 2:      //根据年+月+日  生成单据号
                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'", "Gy_MaxNum");
                            if (Ds.Tables[0].Rows.Count != 0)
@@ -476,6 +475,138 @@
            oCn = null;
        }
        //得到最大单据号
        public static string CreateBillCode(string BillCode,string HOrgNumber,Int64 HOrgID,string HWhNumber, ref string sReturn, bool Add)
        {
            Int64 BillCodeMode;
            string Profix;
            Int64 Glida;
            Int32 CodeLen;
            string sBillNo = "";
            char c = Convert.ToChar("0");
            string sKjYear = DateTime.Today.Year.ToString();
            string sPeriod = DateTime.Today.Month.ToString();
            string sDay = DateTime.Today.Day.ToString();
            //得到单据号表 信息
            ClsSqlHelper oCn = new ClsSqlHelper();
            DataSet Ds = new DataSet();
            Ds = oCn.RunProcReturn("Select * from Gy_BillNumber where BillCode='" + BillCode.Trim() + "'", "Gy_BillNumber");
            if (Ds.Tables[0].Rows.Count != 0)
            {
                BillCodeMode = ClsPub.isLong(Ds.Tables[0].Rows[0]["BillCodeMode"].ToString());
                Profix = ClsPub.isStrNull(Ds.Tables[0].Rows[0]["Profix"].ToString());
                Glida = ClsPub.isLong(Ds.Tables[0].Rows[0]["Glida"].ToString());
                CodeLen = ClsPub.isInt(Ds.Tables[0].Rows[0]["CodeLen"].ToString());
            }
            else
            {
                return "";
            }
            //
            string sStr;
            switch (BillCodeMode)
            {
                case 0:
                    switch (Glida)
                    {
                        case 0://纯流水号
                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "'", "Gy_MaxNum");
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oCn.RunProc("insert into Gy_MaxNum(BillCode,NowNumber) values('" + BillCode.Trim() + "',1)");
                                sBillNo = Profix.Trim() + sStr + 1;
                            }
                            if (Add == true)
                            {
                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "'");
                            }
                            return sBillNo;
                        case 1://根据 YY年+MM月 日 + 流水号  生成单据号 (日 采用了 仓库的字段)
                            sKjYear = sKjYear.Substring(2, 2);
                            sPeriod = "0" + sPeriod;
                            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                            sDay = "";
                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'", "Gy_MaxNum");
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + sKjYear + sPeriod + sDay + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oCn.RunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,whcode,NowNumber)  values('" + BillCode.Trim() + "','" + sKjYear + "','" + sPeriod + "','" + sDay + "',1)");
                                sBillNo = Profix.Trim() + sKjYear + sPeriod + sDay + sStr + "1";
                            }
                            if (Add == true)
                            {
                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'");
                            }
                            return sBillNo;
                        case 2:      //根据年+月+日  生成单据号 (这功能 好像是作废了)
                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'", "Gy_MaxNum");
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + sKjYear + ClsPub.isStrNull(("0" + sPeriod)).Substring(ClsPub.isStrNull(("0" + sPeriod)).Length - 2, 2) + ClsPub.isStrNull(("0" + sDay)).Substring(ClsPub.isStrNull(("0" + sDay)).Length - 2, 2) + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oCn.RunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,whcode,NowNumber)  values('" + BillCode.Trim() + "','" + sKjYear + "','" + sPeriod + "','" + sDay + "',1)");
                                sBillNo = Profix.Trim() + sKjYear + ClsPub.isStrNull(("0" + sPeriod)).Substring(ClsPub.isStrNull(("0" + sPeriod)).Length - 2, 2) + ClsPub.isStrNull(("0" + sDay)).Substring(ClsPub.isStrNull(("0" + sDay)).Length - 2, 2) + sStr + 1;
                            }
                            if (Add == true)
                            {
                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'");
                            }
                            return sBillNo;
                        case 3://根据 前缀+组织+ YY年+MM月   + 流水号  生成单据号  (组织 采用了 仓库的字段)
                            sKjYear = sKjYear.Substring(2, 2);
                            sPeriod = "0" + sPeriod;
                            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + HOrgNumber + "'", "Gy_MaxNum");
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + HOrgNumber + sKjYear + sPeriod  + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oCn.RunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,whcode,NowNumber)  values('" + BillCode.Trim() + "','" + sKjYear + "','" + sPeriod + "','" + HOrgNumber + "',1)");
                                sBillNo = Profix.Trim() + sKjYear + sPeriod + sDay + sStr + "1";
                            }
                            if (Add == true)
                            {
                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + HOrgNumber + "'");
                            }
                            return sBillNo;
                        default:
                            return sBillNo;
                    }
                case 1:
                    return sBillNo;
                default:
                    return sBillNo;
            }
            oCn.CnClose();
            oCn.CnDispose();
            oCn = null;
        }
        //得到最大单据号2
        public static string CreateBillCode(string BillCode, ref string sReturn, bool Add,ClsSqlHelper oCn)
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -152,6 +152,10 @@
                    {
                        omodel.Kf_MateOutBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MateOutBill_FIFOList")  //先进先出下架清单
                    {
                        omodel.Kf_MateOutBill_FIFOList = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MateOutBill_FIFOCtl")  //先进先出控制
                    {
                        omodel.Kf_MateOutBill_FIFOCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
@@ -302,6 +306,10 @@
                    {
                        omodel.Kf_EntrustOutBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_EntrustOutBill_FIFOList")  //先进先出下架清单
                    {
                        omodel.Kf_EntrustOutBill_FIFOList = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_EntrustOutBill_FIFOCtl")
                    {
                        omodel.Kf_EntrustOutBill_FIFOCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
@@ -355,6 +363,10 @@
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBill_BillTypeOneScan")
                    {
                        omodel.Kf_SellOutBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBill_FIFOList") //先进先出下架清单
                    {
                        omodel.Kf_SellOutBill_FIFOList = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBill_FIFOCtl")
                    {
@@ -452,6 +464,14 @@
                    {
                        omodel.Kf_MoveStockBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockBill_FIFOList")    //先进先出下架清单
                    {
                        omodel.Kf_MoveStockBill_FIFOList = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockBill_FIFOCtl")
                    {
                        omodel.Kf_MoveStockBill_FIFOCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockBillCheck_MustQtyCtl")
                    {
                        omodel.Kf_MoveStockBillCheck_MustQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
@@ -532,6 +552,10 @@
                    {
                        omodel.Kf_MoveStockStepOutBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockStepOutBill_FIFOList")    //先进先出下架清单
                    {
                        omodel.Kf_MoveStockStepOutBill_FIFOList = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockStepOutBill_FIFOCtl")
                    {
                        omodel.Kf_MoveStockStepOutBill_FIFOCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -23,7 +23,8 @@
        public string Kf_MateOutBill_AutoCheck;
        public string Kf_MateOutBill_ERPMode;
        public string Kf_MateOutBill_MustQtyCtl;
        public string Kf_MateOutBill_FIFOCtl;
        public string Kf_MateOutBill_FIFOList;      //先进先出下架清单
        public string Kf_MateOutBill_FIFOCtl;       //先进先出控制
        public string Kf_MateOutBill_AutoBarCode;   //免扫码模式, 不需要扫码物料条码自动写入临时表(只支持品种码)
        public string Kf_MateOutBill_MulSourceBill;   //多源单模式
        public string Kf_MateOutBill_SimpleMode;   //简洁模式(不显示源单列表,只显示扫码记录,但后台仍控制)
@@ -65,7 +66,8 @@
        public string Kf_EntrustOutBill_AutoCheck;
        public string Kf_EntrustOutBill_ERPMode;
        public string Kf_EntrustOutBill_MustQtyCtl;
        public string Kf_EntrustOutBill_FIFOCtl;
        public string Kf_EntrustOutBill_FIFOList;       //先进先出下架清单
        public string Kf_EntrustOutBill_FIFOCtl;        //先进先出控制
        public string Kf_EntrustOutBill_MulSourceBill; //多源单模式
        public string Kf_EntrustOutBill_SimpleMode;   //简洁模式(不显示源单列表,只显示扫码记录,但后台仍控制)
        public string Kf_EntrustOutBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
@@ -80,7 +82,8 @@
        public string Kf_SellOutBill_AutoCheck;
        public string Kf_SellOutBill_ERPMode;
        public string Kf_SellOutBill_MustQtyCtl;
        public string Kf_SellOutBill_FIFOCtl;
        public string Kf_SellOutBill_FIFOList;        //先进先出下架清单
        public string Kf_SellOutBill_FIFOCtl;         //先进先出控制
        public string Kf_SellOutBill_MulSourceBill; //多源单模式
        public string Kf_SellOutBill_AutoSavePOStockInBill;     //同步生成采购入库单
        public string Kf_SellOutBill_NoRefresh;     //PDA不自动刷新
@@ -106,10 +109,12 @@
        public string Kf_OtherOutBill_BarCodeMustSameSourceBill;   // 条码必须同源单一致
        public string Kf_OtherOutBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
        public string Kf_OtherOutBillCheck_MustQtyCtl;   //校验数量控制
        //调拨
        //直接调拨
        public string Kf_MoveStockBill_AutoCheck;
        public string Kf_MoveStockBill_ERPMode;
        public string Kf_MoveStockBill_MustQtyCtl;
        public string Kf_MoveStockBill_FIFOList;        //先进先出下架清单
        public string Kf_MoveStockBill_FIFOCtl;         //先进先出控制
        public string Kf_MoveStockBill_MulSourceBill; //多源单模式
        public string Kf_MoveStockBill_BarCodeMustSameSourceBill;   // 条码必须同源单一致
        public string Kf_MoveStockBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
@@ -138,7 +143,8 @@
        public string Kf_MoveStockStepOutBill_ERPMode;      //ERPģʽ
        public string Kf_MoveStockStepOutBill_MustQtyCtl;   //
        public string Kf_MoveStockStepOutBill_MulSourceBill;//
        public string Kf_MoveStockStepOutBill_FIFOCtl;               //先进先出控制
        public string Kf_MoveStockStepOutBill_FIFOList;         //先进先出下架清单
        public string Kf_MoveStockStepOutBill_FIFOCtl;          //先进先出控制
        public string Kf_MoveStockStepOutBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
        //分步式调入单
        public string Kf_MoveStockStepInBill_AutoCheck;    //自动审核