From 175b53e6f0adb40a0d861981f56f120615d55897 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 13 十一月 2024 14:52:31 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
Pub_Class/CustomerCls/ClsPub.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 88 insertions(+), 16 deletions(-)
diff --git a/Pub_Class/CustomerCls/ClsPub.cs b/Pub_Class/CustomerCls/ClsPub.cs
index 3c2dd5c..b242eab 100644
--- a/Pub_Class/CustomerCls/ClsPub.cs
+++ b/Pub_Class/CustomerCls/ClsPub.cs
@@ -1,12 +1,11 @@
锘縰sing System;
-using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Forms;
using System.Drawing;
-using System.Data.SqlClient;
using System.Net.Sockets;
using System.Net;
+using SyntacticSugar.constant;
namespace Pub_Class
{
@@ -59,11 +58,12 @@
public static DateTime XFCurEDate;
public static DateTime KQCurBDate;
public static DateTime KQCurEDate;
-
public static bool check;
public static int HCheckStatus;
public static string sSQLInfo;
public static string sErrInfo;
+
+
public enum Enum_BillStatus : int
{
@@ -897,6 +897,76 @@
}
+ //寰楀埌鏈�澶у熀纭�璧勬枡鐨勬祦姘村彿 HNumber
+ public static string CreateHNumber(string BillCode,string HName,string TableName, ref string sReturn, bool Add)
+ {
+
+ Int64 Glida;
+ Int32 CodeLen;
+ string sBillNumber = "";
+ 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();
+ DataSet Dss = new DataSet();
+ //绗竴娆℃煡璇㈡暟鎹槸鍚﹀瓨鍦� 涓嶅瓨鍦ㄥ氨娣诲姞
+ Ds = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
+ //鎻掑叆鏂拌褰� 琛ㄥ悕,琛ㄥ悕绉�,褰撳墠id
+ if (Ds.Tables[0].Rows.Count == 0)
+ {
+
+ oCn.RunProc("insert into Gy_MaxNumber(BillType,BillName,IDNow) values('" + TableName.Trim() + "','" + HName.Trim() + "',1)");
+ }
+
+ //绗簩娆℃煡璇� 鏄煡璇㈡彃鍏ョ殑鏂版暟鎹�
+ Dss = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
+ if (Dss.Tables[0].Rows.Count != 0)
+ {
+
+ Glida = ClsPub.isLong(Dss.Tables[0].Rows[0]["Glida"].ToString());
+ CodeLen = ClsPub.isInt(Dss.Tables[0].Rows[0]["CodeLen"].ToString());
+ }
+ else
+ {
+ return "";
+ }
+ string sStr;
+ switch (Glida)
+ {
+ case 0://绾祦姘村彿
+ Ds = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
+ if (Ds.Tables[0].Rows.Count != 0)
+ {
+ sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["IDNow"].ToString()).Length);
+ sBillNumber = BillCode.Trim() + sStr + Ds.Tables[0].Rows[0]["IDNow"].ToString().Trim();
+ }
+
+ if (Add == true)
+ {
+ oCn.RunProc("update Gy_MaxNumber set IDNow=IDNow+1 where BillName='" + HName.Trim() + "'");
+ }
+ return sBillNumber;
+
+ case 1://鏍规嵁 YY骞�+MM鏈� 鏃� + 娴佹按鍙� 鐢熸垚鍗曟嵁鍙� 锛堟棩 閲囩敤浜� 浠撳簱鐨勫瓧娈碉級
+ return sBillNumber;
+ case 2: //鏍规嵁骞�+鏈�+鏃� 鐢熸垚鍗曟嵁鍙�
+ return sBillNumber;
+ case 3: //鏍规嵁 涔斾竴 锛圫 + 骞达紙23锛�+浜斾綅娴佹按鍙凤級瀹炰緥锛歋2300001
+ return sBillNumber;
+ case 4: //鏍规嵁 涔斾竴 宸ュ簭娴佽浆鍗″彿鏀规垚骞�+鏈�+鍥涗綅娴佹按鍙凤紙23050001锛�
+ return sBillNumber;
+ default:
+ return sBillNumber;
+
+ }
+ oCn.CnClose();
+ oCn.CnDispose();
+ oCn = null;
+ }
+
//鍒ゆ柇鏄惁瀛樺湪鏉冮檺,骞跺啓鍏ユ棩蹇�
public static bool Security_Log(string gnsy, int LogTF, bool Msg,string CurUserName)
{
@@ -946,7 +1016,7 @@
}
else
{
- if (ClsPub.isStrNull(DsUser.Tables[0].Rows[0]["AuthorityID"]).Length > ModID
+ if (ClsPub.isStrNull(DsUser.Tables[0].Rows[0]["AuthorityID"]).Length >= ModID
&& DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
{
HavRight = true;
@@ -963,10 +1033,10 @@
}
else
{
- HavRight = false;
+ //HavRight = false;
for (int i = 0; i < DsJS.Tables[0].Rows.Count; i++)
{
- if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length > ModID)
+ if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length >= ModID)
{
if (DsJS.Tables[0].Rows[i]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
{
@@ -1055,7 +1125,7 @@
}
else
{
- if (DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
+ if (ClsPub.isStrNull(DsUser.Tables[0].Rows[0]["AuthorityID"]).Length >= ModID && DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
{
HavRight = true;
}
@@ -1064,7 +1134,7 @@
//鑾峰彇鐢ㄦ埛缁� 骞跺惊鐜垽鏂潈闄�
//鍒ゆ柇瑙掕壊鏄惁鏈夋潈闄�
DsJS = oCn.RunProcReturn("select isnull(AuthorityID,'') AuthorityID from System_UserGroupinfo a inner join System_UserGroup b on a.GroupID=b.GroupID " +
- " Where a.USERID='" + UserID.Trim() + "'", "gy_czygl");
+ " Where a.USERID='" + DsUser.Tables[0].Rows[0]["Czybm"].ToString().Trim() + "'", "gy_czygl");
if (DsJS == null)
{
HavRight = false;
@@ -1074,7 +1144,7 @@
HavRight = false;
for (int i = 0; i < DsJS.Tables[0].Rows.Count; i++)
{
- if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length > ModID)
+ if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length >= ModID)
{
if (DsJS.Tables[0].Rows[i]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
{
@@ -1327,16 +1397,17 @@
{
ClsSqlHelper oCn = new ClsSqlHelper();
DataSet Ds = new DataSet();
+
try
{
Ds = oCn.RunProcReturn("Select GetDate() as CurDate", "xt_xtgnb");
switch (iType)
{
- case 0:
+ case TimeConstant.TIME_OF_THE_MONTH:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd");
- case 1:
+ case TimeConstant.TIME_OF_THE_HOUR:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("HH:mm:ss");
- case -1:
+ case TimeConstant.PRECISE_TIME:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd HH:mm:ss");
default:
return "1900-01-01";
@@ -1357,11 +1428,13 @@
Ds = oCn.RunProcReturn("Select GetDate() as CurDate", "xt_xtgnb");
switch (iType)
{
- case 0:
+ case TimeConstant.TIME_OF_THE_MONTH:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd");
- case 1:
+
+ case TimeConstant.TIME_OF_THE_HOUR:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("hh:mm:ss");
- case -1:
+
+ case TimeConstant.PRECISE_TIME:
return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd HH:mm:ss");
default:
return "1900-01-01";
@@ -1515,7 +1588,6 @@
}
}
}
-
// 璇诲彇鍒楀datagridview
public static void GetGridView(DataGridView oGrd, string KeyItem, string AppPath)
--
Gitblit v1.9.1