| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System.Data.Entity;
- using System.Linq.Dynamic.Core;
- using System.Threading.Tasks;
- using System.Web.Mvc;
- using Abp.Web.Mvc.Authorization;
- using Abp.Runtime.Caching;
- using Abp.UI;
- using ContractService.BaseSystem.Query;
- using ContractService.Configuration;
- using ContractService.LegalContract;
- using IwbZero.Runtime.Session;
- using IwbZero.ToolCommon.StringModel;
- namespace ContractService.Controllers
- {
- [AbpMvcAuthorize]
- public class LegalCaseController : IwbControllerBase
- {
- public LegalCaseController( ICacheManager cacheManager, QueryAppService queryApp, LegalManager legalManager)
- {
- QueryApp = queryApp;
- LegalManager = legalManager;
- CacheManager = cacheManager;
-
- }
- public QueryAppService QueryApp { get; }
- public LegalManager LegalManager { get; }
- [AbpMvcAuthorize]
- public async Task<ActionResult> Case()
- {
- if (AbpSession.AccountType != AccountTypeDefinition.System && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定律师(或企业员工),不能访问!");
- }
- if (AbpSession.AccountType == AccountTypeDefinition.Client)
- {
- var companyNo = AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType);
- ViewBag.CompanyNo = companyNo;
- }
- ViewBag.IsCompanyMaster = await LegalManager.IsCompanyMaster();
- ViewBag.Level = await QueryApp.GetCaseLevelSelectStr();
- ViewBag.State = await QueryApp.GetCaseStateSelectStr();
- ViewBag.ServiceType = await QueryApp.GetServiceTypeSelectStr("");
- return View();
- }
- [AbpMvcAuthorize]
- public async Task<ActionResult> CaseDetail(string id)
- {
- if (AbpSession.AccountType != AccountTypeDefinition.System && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定律师(或企业员工),不能访问!");
- }
- if (id.Empty())
- {
- CheckErrors("项目不存在,请检查后再试!");
- }
- ViewBag.CaseNo = id;
- ViewBag.IsLawFirmMaster = LegalManager.IsLawFirmMaster(AbpSession.AccountNo);
- ViewBag.IsCaseMaster = await LegalManager.IsClientCaseMaster(id);
- ViewBag.CaseState = await QueryApp.GetCaseStateSelectStr();
- ViewBag.ContractState = await QueryApp.GetContractStateSelectStr();
- return View();
- }
- [AbpMvcAuthorize]
- public async Task<ActionResult> ContractDetail(string id)
- {
- if (AbpSession.AccountType != AccountTypeDefinition.System && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定律师(或企业员工),不能访问!");
- }
- if (id.Empty())
- {
- CheckErrors("合同不存在,请检查后再试!");
- }
- ViewBag.ContractNo = id;
- ViewBag.IsCompanyMaster = await LegalManager.IsCompanyMaster();
- ViewBag.IsContractMaster = await LegalManager.IsClientContractMaster(id);
- ViewBag.MasterLawyer = (await LegalManager.QueryMasterLawyerByContract(id).FirstOrDefaultAsync())?.Name ?? "";
- ViewBag.MasterStaff = (await LegalManager.QueryMasterStaffByContract(id).FirstOrDefaultAsync())?.Name ?? "";
- ViewBag.ContractState = await QueryApp.GetContractStateSelectStr();
- ViewBag.KeyPointState = await QueryApp.GetKeyPointStateSelectStr();
- ViewBag.KeyPointLevel = await QueryApp.GetKeyPointLevelSelectStr();
- return View();
- }
- [AbpMvcAuthorize]
- public async Task<ActionResult> Contract()
- {
- if (AbpSession.AccountType != AccountTypeDefinition.System && AbpSession.GetClaimValue(IwbConsts.UserCompanyLawFirmClaimType).Empty())
- {
- throw new UserFriendlyException("当前账号未绑定律师(或企业员工),不能访问!");
- }
- ViewBag.State = await QueryApp.GetContractStateSelectStr();
- ViewBag.IsCompanyMaster = LegalManager.IsCompanyMaster(AbpSession.AccountNo);
- ViewBag.IsLawFirmMaster = LegalManager.IsLawFirmMaster(AbpSession.AccountNo);
- return View();
- }
- }
- }
|