| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System.Threading.Tasks;
- using System.Web.Mvc;
- using Abp.Web.Mvc.Authorization;
- using Abp.Runtime.Caching;
- using Abp.UI;
- using ContractService.Authorization;
- using ContractService.BaseSystem.Query;
- using ContractService.Configuration;
- using ContractService.LegalContract;
- using IwbZero.Runtime.Session;
- using IwbZero.ToolCommon.StringModel;
- namespace ContractService.Controllers
- {
- [AbpMvcAuthorize]
- public class ClientController : IwbControllerBase
- {
- public ClientController( ICacheManager cacheManager, LegalManager legalManager, QueryAppService queryApp)
- {
- LegalManager = legalManager;
- QueryApp = queryApp;
- CacheManager = cacheManager;
-
- }
- public LegalManager LegalManager { get; }
- public QueryAppService QueryApp { get; }
- [AbpMvcAuthorize]
- public ActionResult Company()
- {
- if (AbpSession.AccountType == AccountTypeDefinition.System)
- {
- return View();
- }
-
- if (AbpSession.AccountType == AccountTypeDefinition.Client && LegalManager.IsCompanyMaster(AbpSession.AccountNo,out var companyNo))
- {
- ViewBag.CompanyNo = companyNo;
- return View("CompanyDetail");
- }
- if (AbpSession.AccountType == AccountTypeDefinition.Client && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定企业员工,不能访问!");
- }
- CheckErrors("非法账号,不能访问!");
- return View();
- }
-
- [AbpMvcAuthorize]
- public ActionResult Staff()
- {
- if (AbpSession.AccountType != AccountTypeDefinition.Client&&AbpSession.AccountType != AccountTypeDefinition.System)
- {
- CheckErrors("非法账号,不能访问!");
- }
- if (AbpSession.AccountType == AccountTypeDefinition.Client && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定企业员工,不能访问!");
- }
- ViewBag.CompanyNo = AbpSession.AccountType == AccountTypeDefinition.Client
- ? AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType)
- : null;
-
- return View();
- }
- [AbpMvcAuthorize]
- public ActionResult Organization()
- {
- if (AbpSession.AccountType != AccountTypeDefinition.Client)
- {
- CheckErrors("非法账号,不能访问!");
- }
- if (AbpSession.AccountType == AccountTypeDefinition.Client && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定企业员工,不能访问!");
- }
- ViewBag.CompanyNo = AbpSession.AccountType == AccountTypeDefinition.Client
- ? AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType)
- : null;
- return View();
- }
- }
- }
|