Dun.Jason 11 months ago
parent
commit
44fc5074e4

+ 8 - 2
src/Hotline.Api/Controllers/ArticleController.cs

@@ -1,4 +1,5 @@
-using Hotline.Application.FlowEngine;
+using DotNetCore.CAP;
+using Hotline.Application.FlowEngine;
 using Hotline.Article;
 using Hotline.Article;
 using Hotline.Caching.Interfaces;
 using Hotline.Caching.Interfaces;
 using Hotline.Permissions;
 using Hotline.Permissions;
@@ -34,8 +35,9 @@ namespace Hotline.Api.Controllers
         private readonly ICircularRecordDomainService _circularRecordDomainService;
         private readonly ICircularRecordDomainService _circularRecordDomainService;
         private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
         private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
         private readonly IMediator _mediator;
         private readonly IMediator _mediator;
+        private readonly ICapPublisher _capPublisher;
 
 
-        public ArticleController(IRepository<Bulletin> bulletinRepository, IMapper mapper, ISystemDomainService systemDomainService, ISystemOrganizeRepository organizeRepository, IWorkflowApplication workflowApplication, IRepository<Circular> circularRepository, ISessionContext sessionContext, IRepository<CircularRecord> circularRecordRepository, IRepository<CircularReadGroup> circularReadGroupRepository, IRepository<User> userRepository, ICircularRecordDomainService circularRecordDomainService, ISystemDicDataCacheManager systemDicDataCacheManager, IMediator mediator)
+        public ArticleController(IRepository<Bulletin> bulletinRepository, IMapper mapper, ISystemDomainService systemDomainService, ISystemOrganizeRepository organizeRepository, IWorkflowApplication workflowApplication, IRepository<Circular> circularRepository, ISessionContext sessionContext, IRepository<CircularRecord> circularRecordRepository, IRepository<CircularReadGroup> circularReadGroupRepository, IRepository<User> userRepository, ICircularRecordDomainService circularRecordDomainService, ISystemDicDataCacheManager systemDicDataCacheManager, IMediator mediator, ICapPublisher capPublisher)
         {
         {
             _bulletinRepository = bulletinRepository;
             _bulletinRepository = bulletinRepository;
             _mapper = mapper;
             _mapper = mapper;
@@ -49,6 +51,7 @@ namespace Hotline.Api.Controllers
             _circularRecordDomainService = circularRecordDomainService;
             _circularRecordDomainService = circularRecordDomainService;
             _systemDicDataCacheManager = systemDicDataCacheManager;
             _systemDicDataCacheManager = systemDicDataCacheManager;
             _mediator = mediator;
             _mediator = mediator;
+            _capPublisher = capPublisher;
         }
         }
         #region 通知
         #region 通知
 
 
@@ -471,6 +474,9 @@ namespace Hotline.Api.Controllers
                 bulletin.ExaminManId = _sessionContext.RequiredUserId;
                 bulletin.ExaminManId = _sessionContext.RequiredUserId;
                 await _bulletinRepository.UpdateAsync(bulletin, HttpContext.RequestAborted);
                 await _bulletinRepository.UpdateAsync(bulletin, HttpContext.RequestAborted);
                 var publishBulletin = _mapper.Map<PublishBulletinDto>(bulletin);
                 var publishBulletin = _mapper.Map<PublishBulletinDto>(bulletin);
+
+                await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlinePushBulletin, publishBulletin, cancellationToken: HttpContext.RequestAborted);
+                
                 //todo await _bulletinService.PushBulletin(publishBulletin, HttpContext.RequestAborted);
                 //todo await _bulletinService.PushBulletin(publishBulletin, HttpContext.RequestAborted);
             }
             }
             else
             else

+ 1 - 3
src/Hotline.Api/Controllers/Bi/BiOrderController.cs

@@ -116,9 +116,7 @@ namespace Hotline.Api.Controllers.Bi
                     .WhereIF(dto.QueryType == 3, x => x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()) //业务待办超期
                     .WhereIF(dto.QueryType == 3, x => x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()) //业务待办超期
                     .WhereIF(dto.QueryType == 5, x =>
                     .WhereIF(dto.QueryType == 5, x =>
                         (x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime) || (x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()))
                         (x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime) || (x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()))
-                    .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.QueryType is 1 or 3 && dto.OrgCode == "001", x => x.ActualHandleOrgCode == dto.OrgCode)
-                    .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.QueryType is 1 or 3 && dto.OrgCode != "001", x => x.ActualHandleOrgCode.StartsWith(dto.OrgCode))
-					.MergeTable();
+                    .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.QueryType is 1 or 3, x => x.ActualHandleOrgCode.StartsWith(dto.OrgCode));
 
 
             if (dto.QueryType is 2 or 4 or 5)
             if (dto.QueryType is 2 or 4 or 5)
             {
             {

+ 1 - 0
src/Hotline.Api/Controllers/KnowledgeController.cs

@@ -503,6 +503,7 @@ namespace Hotline.Api.Controllers
                 .WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.KnowledgeType, typeSpliceName))
                 .WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.KnowledgeType, typeSpliceName))
                 .WhereIF(!string.IsNullOrEmpty(hotspotHotSpotFullName), x => x.HotspotType.HotSpotFullName.EndsWith(hotspotHotSpotFullName!))
                 .WhereIF(!string.IsNullOrEmpty(hotspotHotSpotFullName), x => x.HotspotType.HotSpotFullName.EndsWith(hotspotHotSpotFullName!))
                 .WhereIF(!string.IsNullOrEmpty(pagedDto.CreateOrgId), x => x.SourceOrganizeId != null && x.SourceOrganizeId.EndsWith(pagedDto.CreateOrgId!))
                 .WhereIF(!string.IsNullOrEmpty(pagedDto.CreateOrgId), x => x.SourceOrganizeId != null && x.SourceOrganizeId.EndsWith(pagedDto.CreateOrgId!))
+                .WhereIF(!string.IsNullOrEmpty(pagedDto.ModuleCode), x => x.Workflow.ModuleCode == pagedDto.ModuleCode)
                 .OrderByDescending(d => d.CreationTime)
                 .OrderByDescending(d => d.CreationTime)
                 .ToPagedListAsync(pagedDto.PageIndex, pagedDto.PageSize, HttpContext.RequestAborted);
                 .ToPagedListAsync(pagedDto.PageIndex, pagedDto.PageSize, HttpContext.RequestAborted);
             //temp.ForEach(x => x.IsCanHandle = x.Workflow.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId));
             //temp.ForEach(x => x.IsCanHandle = x.Workflow.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId));

+ 5 - 1
src/Hotline.Application/Orders/OrderApplication.cs

@@ -305,8 +305,12 @@ public class OrderApplication : IOrderApplication, IScopeDependency
                 return ReceiveOrderFromProvinceAsync(dto, dto.Files, current, cancellationToken);
                 return ReceiveOrderFromProvinceAsync(dto, dto.Files, current, cancellationToken);
             case ESource.Police110:
             case ESource.Police110:
             case ESource.CityDataExchangeLz:
             case ESource.CityDataExchangeLz:
-            case ESource.ConvergenceMedia:
             case ESource.WebPortal:
             case ESource.WebPortal:
+            case ESource.ConvergenceMedia:
+            case ESource.IYIBIN:
+            case ESource.ZHYB:
+            case ESource.ZZPT:
+            case ESource.WLLZ:
                 return ReceiveOrderFromOtherPlatformAsync(dto, dto.Files, current, cancellationToken);
                 return ReceiveOrderFromOtherPlatformAsync(dto, dto.Files, current, cancellationToken);
             case ESource.Hotline:
             case ESource.Hotline:
             case ESource.HotlineImport:
             case ESource.HotlineImport:

+ 5 - 0
src/Hotline.Share/Dtos/Knowledge/KnowledgePagedDto.cs

@@ -100,5 +100,10 @@ namespace Hotline.Share.Dtos.Knowledge
         /// </summary>
         /// </summary>
         public string? KnowledgeTypeId { get; set; }
         public string? KnowledgeTypeId { get; set; }
 
 
+        /// <summary>
+        /// 审批类型
+        /// </summary>
+        public string? ModuleCode { get; set; }
+
 	}
 	}
 }
 }

+ 3 - 8
src/Hotline/Authentications/Police110SessionContext.cs

@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using XF.Domain.Authentications;
+using XF.Domain.Authentications;
 
 
 namespace Hotline.Authentications
 namespace Hotline.Authentications
 {
 {
@@ -11,8 +6,8 @@ namespace Hotline.Authentications
     {
     {
         public Police110SessionContext()
         public Police110SessionContext()
         {
         {
-            UserId = "08dc73e3-f77f-4484-8309-bed5e532c9f2";
-            UserName = "市公安局110系统账号";
+            UserId = "e90501d7-c453-e18a-f1fa-3a1177930699";
+            UserName = "市公安局110";
             OrgId = "001180";
             OrgId = "001180";
             OrgName = "市公安局110";
             OrgName = "市公安局110";
             OrgLevel = 1;
             OrgLevel = 1;

+ 2 - 2
src/Hotline/Authentications/ProvinceSessionContext.cs

@@ -6,8 +6,8 @@ namespace Hotline.Authentications
     {
     {
         public ProvinceSessionContext()
         public ProvinceSessionContext()
         {
         {
-            UserId = "08dc73dd-56a7-4e95-80e0-47a8113db235";
-            UserName = "省12345平台系统账号";
+            UserId = "03aba148-e7b1-cd03-bf00-3a1177930508";
+            UserName = "省12345平台";
             OrgId = "001171";
             OrgId = "001171";
             OrgName = "省12345平台";
             OrgName = "省12345平台";
             OrgLevel = 1;
             OrgLevel = 1;

+ 2 - 0
src/Hotline/Authentications/SessionContextCreator.cs

@@ -20,6 +20,8 @@ namespace Hotline.Authentications
                     return new Police110SessionContext();
                     return new Police110SessionContext();
                 case "yb-enterprise":
                 case "yb-enterprise":
                     return new YbEnterpriseSessionContext();
                     return new YbEnterpriseSessionContext();
+                case "zzpt":
+                    return new ZzptSessionContext();
                 default:
                 default:
                     throw new ArgumentOutOfRangeException(nameof(source), source, null);
                     throw new ArgumentOutOfRangeException(nameof(source), source, null);
             }
             }

+ 4 - 9
src/Hotline/Authentications/YbEnterpriseSessionContext.cs

@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using XF.Domain.Authentications;
+using XF.Domain.Authentications;
 
 
 namespace Hotline.Authentications
 namespace Hotline.Authentications
 {
 {
@@ -11,10 +6,10 @@ namespace Hotline.Authentications
     {
     {
         public YbEnterpriseSessionContext()
         public YbEnterpriseSessionContext()
         {
         {
-            UserId = "08dc73e5-3ba9-4436-869a-5345c45471fe";
-            UserName = "企业专办系统账号";
+            UserId = "ce42562c-afc1-764b-1dc8-3a1177930346";
+            UserName = "联系服务企业";
             OrgId = "001181";
             OrgId = "001181";
-            OrgName = "企业专办";
+            OrgName = "联系服务企业";
             OrgLevel = 1;
             OrgLevel = 1;
         }
         }
 
 

+ 51 - 0
src/Hotline/Authentications/ZzptSessionContext.cs

@@ -0,0 +1,51 @@
+using XF.Domain.Authentications;
+
+namespace Hotline.Authentications
+{
+    public class ZzptSessionContext : ISessionContext
+    {
+        public ZzptSessionContext()
+        {
+            UserId = "d4cb7151-41fa-a810-6c1e-3a117792fc0c";
+            UserName = "综治平台";
+            OrgId = "001143";
+            OrgName = "综治平台";
+            OrgLevel = 1;
+        }
+
+        /// <summary>
+        /// Id of current tenant or null for host
+        /// </summary>
+        public string? UserId { get; }
+
+        /// <summary>
+        /// Id of current user or throw Exception for guest
+        /// </summary>
+        public string RequiredUserId => UserId ?? throw new ArgumentNullException();
+        public string? UserName { get; }
+        public string? Phone { get; }
+
+        /// <summary>
+        /// Roles
+        /// </summary>
+        public string[] Roles { get; }
+        public string? OrgId { get; set; }
+        public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
+        public string? OrgName { get; set; }
+        public int OrgLevel { get; set; }
+        public string? OrgAreaCode { get; set; }
+        public bool OrgIsCenter { get; set; }
+
+        /// <summary>
+        /// 部门行政区划名称
+        /// </summary>
+        public string? OrgAreaName { get; set; }
+        public string? AreaId { get; }
+        public string? ClientId { get; }
+
+        /// <summary>
+        /// 工号
+        /// </summary>
+        public string? StaffNo { get; }
+    }
+}