update 流转日志, 选择全部

This commit is contained in:
2021-07-08 10:55:59 +08:00
parent 37aa61855d
commit 598de7c026
6 changed files with 84 additions and 16 deletions

View File

@@ -51,22 +51,22 @@ LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6)
WHERE {0}";
WHERE T.IsEnabled = 1 {0}";
var user = await _userManager.CheckUserAsync();
if (user == null) throw Oops.Oh("登录信息丢失");
var userRoles = await _userManager.GetUserRoleList();
var userOrg = await _userManager.GetUserOrgInfo();
var param = new DynamicParameters();
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Count() > 0)
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Any())
{
sql = String.Format(sql, " T.UserID=@UserID ");
sql = String.Format(sql, " AND T.UserID=@UserID ");
param.Add("UserID", user.Id);
}
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()).Count() > 0)
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()).Any())
{
sql = String.Format(sql, " (T.Status=3 OR T.Status=6) AND HC.ZoneId = @ZoneId ");
sql = String.Format(sql, " AND (T.Status=3 OR T.Status=6) AND HC.ZoneId = @ZoneId ");
param.Add("ZoneId", userOrg.Id);
}