duhe
2025-03-19 bdddd7b94a6d437b693a9b43bd9a4a0b220b4818
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_automaticallyByPLC_New.cs
@@ -1038,7 +1038,29 @@
            //拼接批号
            HBarCode_MaxNo = sYear + sPeriod + sDay + LIU;
            return HBarCode_MaxNo;
            long HBarCode_MaxNo_long = long.Parse(HBarCode_MaxNo);
            while (true)
            {
                int HCount_BarCodeBillList = 0;
                int HCount_SubBarCodeBill = 0;
                string sql_confirm = "select * from h_v_IF_BarCodeBillList where æ¡ç ç¼–号 = '" + (ClsPub.isStrNull(grdSub.Rows[0].Cells[HMaterModel2Col].Value) + HBarCode_MaxNo_long.ToString()) + "' and æ¡ç ç±»åž‹ = '唯一条码'" + " and CONVERT(varchar(100),条码日期, 23) = '" + HDate + "'";
                ds = oCn.RunProcReturn(sql_confirm, "h_v_IF_BarCodeBillList");
                HCount_BarCodeBillList = ds.Tables[0].Rows.Count;
                sql_confirm = "select * from Gy_BarCodeBill_SWELL_SubBarCodeBill Where HBarCode = '" + (ClsPub.isStrNull(grdSub.Rows[0].Cells[HMaterModel2Col].Value) + HBarCode_MaxNo_long.ToString()) + "' and HBarCodeType = '唯一条码'" + " and CONVERT(varchar(100),HMakeDate, 23) = '" + HDate + "'";
                ds = oCn.RunProcReturn(sql_confirm, "Gy_BarCodeBill_SWELL_SubBarCodeBill");
                HCount_SubBarCodeBill = ds.Tables[0].Rows.Count;
                if (HCount_BarCodeBillList + HCount_SubBarCodeBill > 0)
                {
                    HBarCode_MaxNo_long += 1;
                }
                else
                {
                    break;
                }
            }
            return HBarCode_MaxNo_long.ToString();
        }
        #endregion
@@ -2520,6 +2542,21 @@
        #endregion
        #endregion
        #region å»ºç«‹é€šè®¯åŽï¼Œä¸æ–­å‘服务器发送数据,用于帮助服务端确定连接状态
        private void timer4_Tick(object sender, EventArgs e)
        {
            if (getTargetInternetStatus()&& socket!=null && socket.Connected)
            {
                try
                {
                    socket.Send(Encoding.ASCII.GetBytes("1"));
                }
                catch (Exception ex)
                {
                }
            }
        }
        #endregion
    }
}