Commit db5e2f74 by ruyun.zhang@suvalue.com

Merge remote-tracking branch 'origin/develop' into develop

parents c1536e42 0ae84bc2
......@@ -693,7 +693,7 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
if (persons.Any(t => t.PersonnelNumber?.Trim() == data.PersonnelNumber?.Trim() && t.DoctorName?.Trim() == data.DoctorName?.Trim())
|| employees.Any(w => w.Department?.Trim() == data.Department?.Trim() && w.DoctorName?.Trim() == data.DoctorName?.Trim())) continue;
if (!string.IsNullOrEmpty(data.Department?.Trim()) || !string.IsNullOrEmpty(data.AccountingUnit?.Trim()) || !string.IsNullOrEmpty(data.DoctorName?.Trim()))
if (!string.IsNullOrEmpty(data.Department?.Trim()) && !string.IsNullOrEmpty(data.AccountingUnit?.Trim()) && !string.IsNullOrEmpty(data.DoctorName?.Trim()))
{
data.HospitalId = HospitalId;
data.AllotId = AllotId;
......@@ -721,7 +721,7 @@ public void SaveDeptDicHands(int HospitalId, SaveCollectData request)
if (depts.Any(t => t.Department?.Trim() == data.Department?.Trim() && t.HISDeptName?.Trim() == data.HISDeptName?.Trim())
|| deptDics.Any(w => w.Department?.Trim() == data.Department?.Trim() && w.HISDeptName?.Trim() == data.HISDeptName?.Trim())) continue;
if (!string.IsNullOrEmpty(data.Department?.Trim()) || !string.IsNullOrEmpty(data.HISDeptName?.Trim()))
if (!string.IsNullOrEmpty(data.Department?.Trim()) && !string.IsNullOrEmpty(data.HISDeptName?.Trim()))
{
DeptDicList(HospitalId, deptDics, data);
}
......
......@@ -30,6 +30,7 @@ public class UserService : IAutoInjection
private PerforResaccountRepository _resaccountRepository;
private PerforPerallotRepository _perallotRepository;
private PerforPerdeptdicRepository _perdeptdicRepository;
private readonly PerforCofaccountingRepository perforCofaccountingRepository;
public UserService(IOptions<Application> application,
PerforSmsRepository smsRepository,
......@@ -44,7 +45,8 @@ public class UserService : IAutoInjection
PerforImspecialunitRepository imspecialunitRepository,
PerforResaccountRepository resaccountRepository,
PerforPerallotRepository perallotRepository,
PerforPerdeptdicRepository perdeptdicRepository)
PerforPerdeptdicRepository perdeptdicRepository,
PerforCofaccountingRepository perforCofaccountingRepository)
{
this.application = application.Value;
this._userRepository = userRepository;
......@@ -60,6 +62,7 @@ public class UserService : IAutoInjection
this._resaccountRepository = resaccountRepository;
this._perallotRepository = perallotRepository;
this._perdeptdicRepository = perdeptdicRepository;
this.perforCofaccountingRepository = perforCofaccountingRepository;
}
/// <summary>
......@@ -733,7 +736,9 @@ public int SaveUserHandsFlat(UserCollectData request)
var roles = _roleRepository.GetEntities();
var hospitals = _hospitalRepository.GetEntities();
//hack:后续修改为accounting中的数据
var depts = _perdeptdicRepository.GetEntities(t => t.HospitalId == request.HospitalId)?.Select(w => w.Department).Distinct();
var accounts = perforCofaccountingRepository.GetEntities();
var allot = _perallotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
var res=accounts.Join(allot, t =>t.AllotId, w =>w.ID, (t, w) => new cof_accounting{ AccountingUnit=t.AccountingUnit }).Distinct();
List<sys_user> users = new List<sys_user>();
List<sys_user_role> userRoles = new List<sys_user_role>();
......@@ -744,9 +749,9 @@ public int SaveUserHandsFlat(UserCollectData request)
var json = JsonHelper.Serialize(item);
var data = JsonHelper.Deserialize<UserHandsResponse>(json);
if(roleArr.Contains(data.RoleName) && (depts==null || !depts.Any())) return 0;
if (roleArr.Contains(data.RoleName) && (res == null || !res.Any())) return 0;
if (users.Any(c => c.Login == data?.Login) || getUsers.Any(c => c.Login == data?.Login)) return 2;
if (roleArr.Contains(data.RoleName) && !depts.Any(t => t == data.Department)) return 3;
if (roleArr.Contains(data.RoleName) && !res.Any(t => t.AccountingUnit == data.Department)) return 3;
if (!string.IsNullOrEmpty(data.Login) && !string.IsNullOrEmpty(data.RealName) && !string.IsNullOrEmpty(data.HosName))
{
......
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