条码生成模块,增加是否启用保质期判断,启用保质期的物料,根据物料保质期单位、保质期算出有效期至写入条码档案
2个文件已修改
162 ■■■■■ 已修改文件
SCM/公用类/ClsPub1.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/条码打印/Gy_BarCodeBill.cs 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/¹«ÓÃÀà/ClsPub1.cs
@@ -14,7 +14,7 @@
        //public static string WEBSURL = "http://124.70.129.242/WEBS-WMS/WebService1.asmx";             //雅琪诺
        //public static string WEBSURL = "http://192.168.1.29/WEBS-WMS/WebService1.asmx";               //圣龙    å†…网
        //public static string WEBSURL = "http://122.227.138.236/WEBS-WMS/WebService1.asmx";            //圣龙(不用)
        public static string WEBSURL = "http://220.189.218.154:8092/WEBS-WMS/WebService1.asmx";   //四维尔    æ–°ä¸­é—´å±‚    å¤–网
        //public static string WEBSURL = "http://220.189.218.154:8092/WEBS-WMS/WebService1.asmx";   //四维尔    æ–°ä¸­é—´å±‚    å¤–网
        //public static string WEBSURL = "http://192.168.0.178:8099/WEBS-WMS/WebService1.asmx";          //四维尔    æ–°ä¸­é—´å±‚    å†…网
        //public static string WEBSURL = "http://192.168.0.178/WEBS-WMS/WebService1.asmx";          //四维尔    æ–°ä¸­é—´å±‚    å†…网(作废)
        //public static string WEBSURL = "http://122.227.199.62:5050/LMESWEBS/WebService1.asmx";        //韩电    å¤–网JIT(不用)
@@ -25,7 +25,7 @@
        //public static string WEBSURL = "http://120.195.29.36:1230/WEBS-WMS/WebService1.asmx";         //江苏龙亨
        //public static string WEBSURL = "http://60.191.27.141:8090/WEBS-WMS/WebService1.asmx";         //森楷
        //public static string WEBSURL = "http://192.168.63.195/WEBS-WMS/WebService1.asmx";
        //public static string WEBSURL = "http://192.168.63.20/WEBS-WMS/WebService1.asmx";              //公司台式机
        public static string WEBSURL = "http://192.168.0.81/WEBS-WMS/WebService1.asmx";              //公司台式机
        //public static string WEBSURL = "http://192.168.0.107/WEBS-WMS/WebService1.asmx";              //å®¶
        //public static string WEBSURL = "http://47.96.97.237/WEBS-WMS/WebService1.asmx";              //公司服务器
SCM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -95,6 +95,11 @@
        public const Int16 POOrderBillNoCol = 74;
        public const Int16 HBarCode_PackCol = 75;
        public const Int16 HCustomQty1Col = 76;
        public const Int16 HProduceDateCol = 77;
        public const Int16 HExpiryDateCol = 78;
        public const Int16 HISKFPERIODCol = 79;
        public const Int16 HEXPUNITCol = 80;
        public const Int16 HEXPPERIODCol = 81;
        public Int16 HSelectCol = 0;
        public Int16 HSno2Col = 1;
@@ -172,6 +177,11 @@
        public Int16 HBarCode_Pack2Col = 73;
        public Int16 HCustomQty12Col = 74;
        public Int16 HCusBarCodeCol = 75;
        public Int16 HProduceDate2Col = 76;
        public Int16 HExpiryDate2Col = 77;
        public Int16 HISKFPERIOD2Col = 78;
        public Int16 HEXPUNIT2Col = 79;
        public Int16 HEXPPERIOD2Col = 80;
        //
        public  string ModName = "85";
        public  string ModCaption = "条码生成";
@@ -189,6 +199,7 @@
        public Int64 HOrgID = -1;
        public string HOrgNumber = "";
        public string CampanyName = ""; //客户定制化名称
        public string SourceQtyCtl = "Y"; //超源单数量控制
        //-------------------------------------------------------------------------
        #region å›ºå®šä»£ç 
         
@@ -635,8 +646,74 @@
                MessageBox.Show("明细行不存在!", "提示");
                return false;
            }
            string sHRemark = "";
            for (int j = 0; j < grdMain.Rows.Count; j++)
            {
                long HSno = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HSnoCol].Value);                  // åºå·
                string HBarCodeType = cmbHBarCodeType.Text;                                                 // æ¡ç ç±»åž‹
                string HSourceBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBillNoCol].Value); // æºå•单号
                long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);          // ç‰©æ–™å†…码
                string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value);     // æ‰¹å·
                long HAuxPropID = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value);      // è¾…助属性ID
                double HSourceQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HinitQtyCol].Value);     // æºå•数量
                double HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);               // æ•°é‡
                double HMinQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);         // æœ€å°åŒ…装数
                if (HMaterID != 0)
                {
                    DataSet oDsCheck = oWeb.getDataSetBySQL("exec h_p_Gy_BarCodeBill_AddCheck " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck", ref DBUtility.ClsPub.sExeReturnInfo);
                    //
                    if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
                    {
                        MessageBox.Show("条码生成完整性判断错误!");
                        return false;
                    }
                    else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
                    {
                        sHRemark = sHRemark + DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]);
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isBool(oDsCheck.Tables[0].Rows[0]["HISKFPERIOD"]))
                        {
                            DateTime HProduceDate;  //生产日期
                            string HEXPUNIT;        //保质期单位
                            int HEXPPERIOD;         //保质期
                            HProduceDate = dtpHDate.Value;
                            HEXPUNIT = DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HEXPUNIT"]);
                            HEXPPERIOD = DBUtility.ClsPub.isInt(oDsCheck.Tables[0].Rows[0]["HEXPPERIOD"]);
                            grdMain.Rows[j].Cells[HISKFPERIODCol].Value = 1;
                            grdMain.Rows[j].Cells[HEXPUNITCol].Value = HEXPUNIT;
                            grdMain.Rows[j].Cells[HEXPPERIODCol].Value = HEXPPERIOD.ToString();
                            grdMain.Rows[j].Cells[HProduceDateCol].Value = HProduceDate.ToShortDateString();
                            if (HEXPUNIT == "Y")
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddYears(HEXPPERIOD).ToShortDateString();
                            }
                            else if (HEXPUNIT == "M")
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddMonths(HEXPPERIOD).ToShortDateString();
                            }
                            else
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddDays(HEXPPERIOD).ToShortDateString();
                            }
                        }
                        else
                        {
                            grdMain.Rows[j].Cells[HISKFPERIODCol].Value = 0;
                            grdMain.Rows[j].Cells[HEXPUNITCol].Value = "";
                            grdMain.Rows[j].Cells[HEXPPERIODCol].Value = 0;
                            grdMain.Rows[j].Cells[HProduceDateCol].Value = "";
                            grdMain.Rows[j].Cells[HExpiryDateCol].Value = "";
                        }
                    }
                }
                if (ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value) != 0 && (ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value) == 0 || ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value) == 0 || ClsPub.isDoule(grdMain.Rows[j].Cells[HBQtyCol].Value) == 0))
                {
                    MessageBox.Show(" ç¬¬" + ClsPub.isLong(grdMain.Rows[j].Cells[HSnoCol].Value) + "行,物料:" + ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNameCol].Value) + " ï¼Œä¸­å­˜åœ¨æ•°é‡ã€æœ€å°åŒ…装数、箱数为 0,不允许生成条码!");
@@ -704,6 +781,11 @@
                    //    return false;
                    //}
                }
            }
            if (sHRemark != "")
            {
                MessageBox.Show(sHRemark);
                return false;
            }
            if (CampanyName == "森楷") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            {
@@ -1792,6 +1874,18 @@
                            grdSub.Rows[i].Cells[HCustomQty12Col].Value = ClsPub.isLong(txtHCaseNo.Text) + i;
                            grdSub.Rows[i].Cells[HCusBarCodeCol].Value = CusTM;
                            grdSub.Rows[i].Cells[HLayerNumber2Col].Value = grdMain.Rows[j].Cells[HLayerNumberCol].Value;
                            grdSub.Rows[i].Cells[HProduceDate2Col].Value = grdMain.Rows[j].Cells[HProduceDateCol].Value;
                            grdSub.Rows[i].Cells[HExpiryDate2Col].Value = grdMain.Rows[j].Cells[HExpiryDateCol].Value;
                            grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value = grdMain.Rows[j].Cells[HISKFPERIODCol].Value;
                            grdSub.Rows[i].Cells[HEXPUNIT2Col].Value = grdMain.Rows[j].Cells[HEXPUNITCol].Value;
                            grdSub.Rows[i].Cells[HEXPPERIOD2Col].Value = grdMain.Rows[j].Cells[HEXPPERIODCol].Value;
                            //网格打勾
                            //是否启用保质期
                            DataGridViewCheckBoxCell oCell2 = new DataGridViewCheckBoxCell();
                            oCell2.ThreeState = false;
                            oCell2.Value = grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value;
                            oCell2.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                            grdSub.Rows[i].Cells[HISKFPERIOD2Col] = oCell2;
                            k = k + 1;
                            n = n + 1;
                            //oWeb.getRunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -1886,6 +1980,11 @@
                string HCusBarCode = "";
                string HBarCodeStatus = "";
                Int64 sHLayerNumber = 0;     //码放层数
                string HProduceDate;
                string HExpiryDate;
                bool HISKFPERIOD = false;
                string HEXPUNIT = "";
                double HEXPPERIOD = 0;
                string[] sSQLMul = new string[grdSub.Rows.Count];
@@ -1974,6 +2073,25 @@
                        HCustomQty1 = ClsPub.isLong(grdSub.Rows[i].Cells[HCustomQty12Col].Value); //箱号(森楷)
                        HCusBarCode = ClsPub.isStrNull(grdSub.Rows[i].Cells[HCusBarCodeCol].Value);
                        sHLayerNumber = ClsPub.isLong(grdSub.Rows[i].Cells[HLayerNumber2Col].Value);
                        if (ClsPub.isDate(grdSub.Rows[i].Cells[HProduceDate2Col].Value) < Convert.ToDateTime("1950-01-01"))
                        {
                            HProduceDate = "";
                        }
                        else
                        {
                            HProduceDate = ClsPub.isStrNull(grdSub.Rows[i].Cells[HProduceDate2Col].Value);
                        }
                        if (ClsPub.isDate(grdSub.Rows[i].Cells[HExpiryDate2Col].Value) < Convert.ToDateTime("1950-01-01"))
                        {
                            HExpiryDate = "";
                        }
                        else
                        {
                            HExpiryDate = ClsPub.isStrNull(grdSub.Rows[i].Cells[HExpiryDate2Col].Value);
                        }
                        HISKFPERIOD = ClsPub.isBool(grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value);
                        HEXPUNIT = ClsPub.isStrNull(grdSub.Rows[i].Cells[HEXPUNIT2Col].Value);
                        HEXPPERIOD = ClsPub.isDoule(grdSub.Rows[i].Cells[HEXPPERIOD2Col].Value);
                        sSQLMul[mm] = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1983,6 +2101,8 @@
                                    ",HLogo,HPackageSize,HMaterialJQty,HMaterialMQty,HCustomBatchNo " +
                                    ",HSTOCKORGID,HOWNERID,HBeginDate,HSeOrderBillNo,HGBBarCode " +
                                    ",POOrderBillNo,HInterID,HInitSourceEntryID,HBarCode_Pack " +
                                    ",HProduceDate,HExpiryDate " +
                                    ",HISKFPERIOD,HEXPUNIT,HEXPPERIOD " +
                                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo " +
                                    ",HCustomQty1,HLayerNumber,HCusBarCode,HBarCodeStatus " +
                                    ") values ("
@@ -1995,6 +2115,8 @@
                                    + ",'" + HLogo + "','" + HPackageSize + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + ",'" + HCustomBatchNo + "'"
                                    + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HBeginDate.ToShortDateString() + "','" + HSeOrderBillNo + "','" + HGBBarCode + "'"
                                    + ",'" + POOrderBillNo + "'," + HInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HBarCode_Pack + "'"
                                    + ", " + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
                                    + ", " + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HEXPUNIT + "'," + HEXPPERIOD.ToString()
                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "'"
                                    + ", " + HCustomQty1.ToString() + "," + sHLayerNumber.ToString() + ",'" + HCusBarCode + "','" + HBarCodeStatus + "')";
                        //oCn.RunProc("exec setLSH '" + ClsPub.GetServerDate(0) + "'");
@@ -2078,7 +2200,7 @@
        {
            grdMain.RowCount = 0;
            grdSub.RowCount = 0;
            grdMain.ColumnCount = 77;                       //总列数
            grdMain.ColumnCount = 82;                       //总列数
            ClsPub1.initGridFst(grdMain, this.Name);
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HMainIDCol].HeaderText = "源单主ID";
@@ -2148,6 +2270,11 @@
            grdMain.Columns[POOrderBillNoCol].HeaderText = "采购订单号";
            grdMain.Columns[HBarCode_PackCol].HeaderText = "托条码编号";
            grdMain.Columns[HLayerNumberCol].HeaderText = "码放层数";
            grdMain.Columns[HProduceDateCol].HeaderText = "生产日期";
            grdMain.Columns[HExpiryDateCol].HeaderText = "有效期至";
            grdMain.Columns[HISKFPERIODCol].HeaderText = "是否启用保质期";
            grdMain.Columns[HEXPUNITCol].HeaderText = "保质期单位";
            grdMain.Columns[HEXPPERIODCol].HeaderText = "保质期";
            ////
            //格式化    éšè—åˆ—
            grdMain.Columns[HTagCol].Visible = false;
@@ -2217,6 +2344,11 @@
            grdMain.Columns[HBarCode_PackCol].Visible = false;
            grdMain.Columns[HCustomQty1Col].Visible = false;
            grdMain.Columns[HLayerNumberCol].Visible = false;
            grdMain.Columns[HProduceDateCol].Visible = false;
            grdMain.Columns[HExpiryDateCol].Visible = false;
            grdMain.Columns[HISKFPERIODCol].Visible = false;
            grdMain.Columns[HEXPUNITCol].Visible = false;
            grdMain.Columns[HEXPPERIODCol].Visible = false;
            if (CampanyName == "韩电") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            {
@@ -2301,7 +2433,7 @@
            ClsPub1.initGridLast(sAllowCol, sTotalCol, oSumGrid);
            //----------------------------
            grdSub.ColumnCount = 76;                       //总列数
            grdSub.ColumnCount = 81;                       //总列数
            ClsPub1.initGridFst(grdSub, this.Name);
            grdSub.Columns[HSelectCol].HeaderText = "选择";
            grdSub.Columns[HTMCol].HeaderText = "条码编号";
@@ -2376,6 +2508,11 @@
            grdSub.Columns[HBarCode_Pack2Col].HeaderText = "托条码编号";
            grdSub.Columns[HCusBarCodeCol].HeaderText = "客户条码";
            grdSub.Columns[HLayerNumber2Col].HeaderText = "码放层数";
            grdSub.Columns[HProduceDate2Col].HeaderText = "生产日期";
            grdSub.Columns[HExpiryDate2Col].HeaderText = "有效期至";
            grdSub.Columns[HISKFPERIOD2Col].HeaderText = "是否启用保质期";
            grdSub.Columns[HEXPUNIT2Col].HeaderText = "保质期单位";
            grdSub.Columns[HEXPPERIOD2Col].HeaderText = "保质期";
            //格式化    éšè—åˆ—
            grdSub.Columns[HBarCodeType2Col].Visible = false;
@@ -2444,6 +2581,18 @@
            grdSub.Columns[HCustomQty12Col].Visible = false;
            grdSub.Columns[HCusBarCodeCol].Visible = false;
            grdSub.Columns[HLayerNumber2Col].Visible = false;
            //设置特殊列
            for (int i = 0; i < grdSub.Rows.Count; i++)
            {
                //网格打勾
                //是否启用保质期
                DataGridViewCheckBoxCell oCell2 = new DataGridViewCheckBoxCell();
                oCell2.ThreeState = false;
                oCell2.Value = 0;
                oCell2.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grdSub.Rows[i].Cells[HISKFPERIOD2Col] = oCell2;
            }
            if (CampanyName == "韩电") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            {
@@ -3460,6 +3609,11 @@
            grdMain.Rows[i].Cells[HGroupIDCol].Value = oTable.Rows[0]["HGroupID"].ToString();
            grdMain.Rows[i].Cells[HGroupNumberCol].Value = oTable.Rows[0]["班组代码"].ToString();
            grdMain.Rows[i].Cells[HGroupNameCol].Value = oTable.Rows[0]["班组"].ToString();
            grdMain.Rows[i].Cells[HProduceDateCol].Value = oTable.Rows[0]["HProduceDate"].ToString();
            grdMain.Rows[i].Cells[HExpiryDateCol].Value = oTable.Rows[0]["HExpiryDate"].ToString();
            grdMain.Rows[i].Cells[HISKFPERIODCol].Value = oTable.Rows[0]["HISKFPERIOD"].ToString();
            grdMain.Rows[i].Cells[HEXPUNITCol].Value = oTable.Rows[0]["HEXPUNIT"].ToString();
            grdMain.Rows[i].Cells[HEXPPERIODCol].Value = oTable.Rows[0]["HEXPPERIOD"].ToString();
            //--
            //设置可编辑列
            string sAllowCol = HTagCol.ToString();