Commit 9a0ed827 by ruyun.zhang

优化

parent 19aa6aa2
......@@ -301,7 +301,7 @@ public void SheetDataImport(per_allot allot)
var connectionString = _configuration.GetValue("AppConnection:PerformanceConnectionString", "");
using var conn = new MySqlConnection(connectionString);
if (conn.State != ConnectionState.Open) conn.Open();
conn.Execute("call proc_allot_import(@AllotId);", new { AllotId = allot.ID });
conn.Execute("call proc_allot_import(@AllotId);", new { AllotId = allot.ID }, commandTimeout: 60 * 60 * 5);
}
}
public class ImportData
......
......@@ -244,7 +244,7 @@ public bool SetHospital(int userId, int[] hosIDArray)
{
var user = _userRepository.GetEntity(t => t.ID == userId && t.IsDelete == 1);
if (null == user)
throw new PerformanceException($"用户不存在 UserId:{userId}");
throw new PerformanceException("用户或密码错误");
var userHospital = _userhospitalRepository.GetUserHospital(userId);
bool rmResult = true, addResult = true;
......@@ -277,7 +277,7 @@ public UserResponse UpdateSelf(UserRequest request)
{
var user = _userRepository.GetEntity(t => t.ID == request.ID && t.IsDelete == 1);
if (null == user)
throw new PerformanceException($"用户不存在 UserId:{request.ID}");
throw new PerformanceException("用户或密码错误");
var vlist = _userRepository.GetEntities(t => t.ID != user.ID && t.Login == request.Login && (t.ParentID == null || t.ParentID == 0) && t.IsDelete == 1);
if (null != vlist && vlist.Count() > 0)
......@@ -306,7 +306,7 @@ public UserResponse UpdatePwd(PasswordRequest request, int userId)
{
var user = _userRepository.GetEntity(t => t.ID == userId && t.IsDelete == 1);
if (null == user)
throw new PerformanceException($"用户不存在 UserId:{userId}");
throw new PerformanceException("用户或密码错误");
if (string.IsNullOrEmpty(request.NewPwd))
throw new PerformanceException($"新密码错误");
......@@ -416,7 +416,7 @@ public UserResponse ResetPwd(int userId, int loginUserId, string password)
{
var user = _userRepository.GetEntity(t => t.ID == userId && t.IsDelete == 1);
if (user == null)
throw new PerformanceException($"用户不存在 UserId:{userId}");
throw new PerformanceException("用户或密码错误");
var loginUser = _userRepository.GetEntity(t => t.ID == loginUserId);
if (loginUser == null)
......@@ -628,7 +628,7 @@ public ApiResponse DeleteUser(int userId)
//{
// var user = _userRepository.GetEntity(t => t.ID == iD && t.IsDelete == 1);
// if (null == user)
// throw new PerformanceException($"用户不存在 UserId:{iD}");
// throw new PerformanceException("用户或密码错误");
// user.IsDelete = 2;
// var result = _userRepository.Remove(user);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment