From 5b4fb9c56426b5096555560a44dd365b02853ad4 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期六, 17 六月 2023 13:14:54 +0800
Subject: [PATCH] 代码加组织过滤

---
 VueWebApi/DLL/DAL/LoginDAL.cs |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/VueWebApi/DLL/DAL/LoginDAL.cs b/VueWebApi/DLL/DAL/LoginDAL.cs
index 54e94cc..890b9cc 100644
--- a/VueWebApi/DLL/DAL/LoginDAL.cs
+++ b/VueWebApi/DLL/DAL/LoginDAL.cs
@@ -28,7 +28,9 @@
         {
 
             //鎵цsql
-            strProcName = "select *  from [dbo].[TUser] where usercode=@username and password=@password and is_delete='0'";
+            strProcName = @"select *  from TUser U
+                            left join TOrganization T on U.stu_torgcode = T.org_code
+                            where U.usercode =@username and U.password =@password and U.is_delete = '0'";
             //鍒涘缓鍙傛暟
             listStr.Add(new SqlParameter("@username", username));
             listStr.Add(new SqlParameter("@password", password));
@@ -40,18 +42,19 @@
         #endregion
 
         #region [鍐欏叆鐧诲綍璁板綍琛╙
-        public static ToMessage LoginBas(string usercode, string usertype)
+        public static ToMessage LoginBas(string usercode, string usertype,string stu_torgcode)
         {
             var sql = "";
             var cont = 0;
             var dynamicParams = new DynamicParameters();
             try
             {
-                sql = @"insert into T_Bas_Login(usercode,status,indate,origin) 
-                            values(@usercode,'Y',@indate,@usertype)";
+                sql = @"insert into T_Bas_Login(usercode,status,indate,origin,torg_code) 
+                            values(@usercode,'Y',@indate,@usertype,@stu_torgcode)";
                 dynamicParams.Add("@usercode", usercode);
                 dynamicParams.Add("@usertype", usertype);
                 dynamicParams.Add("@indate", DateTime.Now.ToString());
+                dynamicParams.Add("@stu_torgcode", stu_torgcode);
                 cont = DapperHelper.SQL(sql, dynamicParams);
                 if (cont > 0)
                 {
@@ -301,7 +304,7 @@
         #endregion
 
         #region[PC鐧诲嚭]
-        public static ToMessage LoginOut(int userid, string usercode, string username, string usertype)
+        public static ToMessage LoginOut(int userid, string usercode, string username, string usertype,string stu_torgcode)
         {
             var sql = "";
             var cont = 0;
@@ -309,15 +312,16 @@
             RedisHelper redis = new RedisHelper();
             try
             {
-                sql = @"insert into T_Bas_Login(usercode,status,outdate,origin) 
-                            values(@usercode,'N',@outdate,@usertype)";
+                sql = @"insert into T_Bas_Login(usercode,status,outdate,origin,torg_code) 
+                            values(@usercode,'N',@outdate,@usertype,@stu_torgcode)";
                 dynamicParams.Add("@usercode", usercode);
                 dynamicParams.Add("@usertype", usertype);
                 dynamicParams.Add("@outdate", DateTime.Now.ToString());
+                dynamicParams.Add("@stu_torgcode", stu_torgcode);
                 cont = DapperHelper.SQL(sql, dynamicParams);
                 if (cont > 0)
                 {
-                    redis.Remove(Enterprise + "LoginUserID" + usertype + userid, 0); //鍒犻櫎redis
+                    redis.Remove(Enterprise + stu_torgcode + "LoginUserID" + usertype + userid, 0); //鍒犻櫎redis
                     mes.code = "200";
                     mes.count = 0;
                     mes.Message = "鐧诲嚭鎴愬姛!";
@@ -399,7 +403,7 @@
                         left  join TOrganization T on B.wkshp_code=T.org_code 
                         left  join TAnDonType D on A.type=d.code
                         left  join TUser U on A.resp_user=U.usercode
-                        where A.resp_user=@usercode and B.status='START' and U.rid=@rid  and T.description='W'";
+                        where A.resp_user=@usercode and B.status='START' and U.rid=@rid";
                 dynamicParams.Add("@usercode", usercode);
                 dynamicParams.Add("@rid", rid);
                 var data = DapperHelper.selectdata(sql, dynamicParams);

--
Gitblit v1.9.3