Sfoglia il codice sorgente

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

xf 3 mesi fa
parent
commit
ea2d0c1255

+ 3 - 2
src/Hotline.Api/Controllers/ExportData/ExportDataController.cs

@@ -1,4 +1,5 @@
 using Hotline.Application.ExportExcel;
+using Hotline.Share.Attributes;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Tools;
 using Microsoft.AspNetCore.Mvc;
@@ -96,7 +97,7 @@ public class ExportDataController : BaseController
         var result = method.Invoke(serviceInstance, [queryDto]);
 
         var returnType = method.ReturnType.GetGenericArguments()[0];
-        var description = method.GetCustomAttribute<DescriptionAttribute>()?.Description + "_";
+        var fileName = method.GetFileName() + "_";
         if (pageIndex == null || pageSize == null)
         {
             isExportAll = true;
@@ -104,7 +105,7 @@ public class ExportDataController : BaseController
             pageSize = 20;
         }
 
-        return _exportApplication.GetExcelFile(returnType, genericType, exportData, ConvertToList(result, (bool)isExportAll, (int)pageIndex, (int)pageSize), description);
+        return _exportApplication.GetExcelFile(returnType, genericType, exportData, ConvertToList(result, (bool)isExportAll, (int)pageIndex, (int)pageSize), fileName);
     }
 
     public static List<object>? ConvertToList(object? result, bool isExportAll, int pageIndex, int pageSize)

+ 2 - 14
src/Hotline.Api/Controllers/Snapshot/SnapshotBulletinController.cs

@@ -43,20 +43,8 @@ public class SnapshotBulletinController : BaseController
     /// <param name="dto"></param>
     /// <returns></returns>
     [HttpGet("bulletin/query")]
-    public async Task<PagedDto<SnapshotBulletinItemsOutDto>> QueryBulletinList([FromQuery] SnapshotBulletinItemsInDto dto)
-    {
-        var query = _bulletinRepository.Queryable()
-            .Includes(x => x.ExaminMan)
-            .WhereIF(!string.IsNullOrEmpty(dto.SnapshotBulletinTypeName), d => d.SnapshotBulletinTypeName.Contains(dto.SnapshotBulletinTypeName))
-            .WhereIF(!string.IsNullOrEmpty(dto.Title), d => d.Title.Contains(dto.Title))
-            .WhereIF(dto.BeginCreationTime.HasValue, d => d.BulletinTime >= dto.BeginCreationTime)
-            .WhereIF(dto.EndCreationTime.HasValue, d => d.BulletinTime <= dto.EndCreationTime)
-            .WhereIF(dto.State.HasValue, d => d.BulletinState == dto.State)
-            .OrderByDescending(d => d.CreationTime)
-            .Select<SnapshotBulletinItemsOutDto>();
-        return (await query
-            .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted)).ToPaged();
-    }
+    public async Task<PagedDto<SnapshotBulletinItemsOutDto>> QueryBulletinItems([FromQuery] SnapshotBulletinItemsInDto dto)
+        => (await _bulletinApplication.QueryBulletinItems(dto).ToPagedListAsync(dto)).ToPaged();
 
     /// <summary>
     /// 公告详情(内部)

+ 16 - 1
src/Hotline.Application/ExportExcel/ExportApplication.cs

@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.DependencyInjection;
 using MiniExcelLibs;
 using NPOI.HPSF;
+using SqlSugar;
 using System.Net.Http;
 using System.Reflection;
 using XF.Domain.Dependency;
@@ -79,7 +80,21 @@ namespace Hotline.Application.ExportExcel
             dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(columnInfos);
 
             var dtos = items
-                .Select(item => _mapper.Map(item, typeT, dynamicClass))
+                .Select(item =>
+                {
+                    var mappedItem = _mapper.Map(item, typeT, dynamicClass);
+                    foreach (var prop in mappedItem.GetType().GetProperties())
+                    {
+                        if (prop.PropertyType == typeof(string))
+                        {
+                            if((string)prop.GetValue(mappedItem) == "True")
+                                prop.SetValue(mappedItem, "是");
+                            if((string)prop.GetValue(mappedItem) == "False")
+                                prop.SetValue(mappedItem, "否");
+                        }
+                    }
+                    return mappedItem;
+                })
                 .Cast<object>()
                 .ToList();
 

+ 2 - 2
src/Hotline.Application/Jobs/XingTangCallsSyncJob.cs

@@ -82,7 +82,7 @@ namespace Hotline.Application.Jobs
             if (!occupyCalls.Any()) return;
             try
             {
-                if (occupyCalls.Any(m => m.UserData.IsNullOrEmpty() == true))
+                if (occupyCalls.Any(m => m.Customerid.IsNullOrEmpty() == true))
                 {
                     var calls = _mapper.Map<List<CallNative>>(occupyCalls);
                     //填充user信息
@@ -142,7 +142,7 @@ namespace Hotline.Application.Jobs
                     {
                         var call = occupyCall.Adapt<CallNative>();
                         call.Id = await GetCallIdAsync(call.CallNo, context.CancellationToken);
-                        var userSplit = occupyCall.UserData.Split(':');
+                        var userSplit = occupyCall.Customerid.Split(':');
                         call.UserId = userSplit[0];
                         call.UserName = userSplit[1];
 

+ 4 - 1
src/Hotline.Application/Snapshot/ISnapshotBulletinApplication.cs

@@ -1,4 +1,6 @@
-using System;
+using Hotline.Share.Dtos.Snapshot;
+using SqlSugar;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -14,4 +16,5 @@ public interface ISnapshotBulletinApplication
     /// <param name="sHtmlText"></param>
     /// <returns></returns>
     string GetSiteUrls(string sHtmlText);
+    ISugarQueryable<SnapshotBulletinItemsOutDto> QueryBulletinItems(SnapshotBulletinItemsInDto dto);
 }

+ 7 - 5
src/Hotline.Application/Snapshot/IndustryApplication.cs

@@ -3,6 +3,7 @@ using Hotline.Caching.Interfaces;
 using Hotline.File;
 using Hotline.Repository.SqlSugar.Extensions;
 using Hotline.Settings;
+using Hotline.Share.Attributes;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Snapshot;
 using Hotline.Share.Tools;
@@ -72,7 +73,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
         return id;
     }
 
-    [Description("行业集合")]
+    [ExportExcel("行业集合")]
     public ISugarQueryable<IndustryItemsOutDto> GetIndustres(IndustryListInDto dto)
     {
         var query = _industryRepository.Queryable()
@@ -124,7 +125,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     }
 
     #region 行业线索
-    [Description("行业线索")]
+    [ExportExcel("行业线索")]
     public ISugarQueryable<IndustryCaseItemOutDto> GetIndustryCaseItems(IndustryCaseItemInDto dto)
     {
         var query = _industryCaseRepository.Queryable()
@@ -182,7 +183,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("行业模板")]
+    [ExportExcel("行业审批短信")]
     public ISugarQueryable<SnapshotSMSTemplateItemsOutDto> GetSMSTemplates(SnapshotSMSTemplateItemsInDto dto)
     {
         var query = _snapshotSMSTemplateRepository.Queryable()
@@ -245,6 +246,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     /// <param name="dto"></param>
     /// <returns></returns>
     /// <exception cref="NotImplementedException"></exception>
+    [ExportExcel("区域从业人员")]
     public ISugarQueryable<PractitionerItemsOutDto> GetPractitionerItems(PractitionerItemsInDto dto)
     {
         var query = _practitionerRepository.Queryable()
@@ -315,7 +317,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    /// <exception cref="NotImplementedException"></exception>
+    [ExportExcel("志愿者名单")]
     public ISugarQueryable<VolunteerItemsOutDto> GetVolunteerItems(VolunteerItemsInDto dto)
     {
         var query = _volunteerRepository.Queryable()
@@ -379,7 +381,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("志愿者上报")]
+    [ExportExcel("志愿者上报")]
     public ISugarQueryable<VolunteerReportItemsOutDto> GetVolunteerReportItems(VolunteerReportItemsInDto dto)
     {
         var query = _volunteerReportRepository.Queryable()

+ 7 - 6
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -1,4 +1,5 @@
 using Hotline.Orders;
+using Hotline.Share.Attributes;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Snapshot;
 using Hotline.Share.Enums.Order;
@@ -207,7 +208,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("市民红包审批")]
+    [ExportExcel("市民红包审批")]
     public ISugarQueryable<SnapshotOrderAuditItemsOutDto> GetRedPackAuditItems(SnapshotOrderAuditItemsInDto dto)
     {
         ERedPackAuditStatus? status = null;
@@ -285,7 +286,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("网格员红包审批")]
+    [ExportExcel("网格员红包审批")]
     public ISugarQueryable<SnapshotOrderGuiderAuditItemsOutDto> GetRedPackGuiderAuditItems(SnapshotOrderGuiderAuditItemsInDto dto)
     {
         var areaCode = _sessionContext.OrgAreaCode;
@@ -434,7 +435,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("市民红包发放记录")]
+    [ExportExcel("市民红包发放记录")]
     public ISugarQueryable<SnapshotRedPackRecordItemsOutDto> GetRedPackRecordItems(SnapshotRedPackRecordItemsInDto dto)
     {
         var query = _redPackRecordRepository.Queryable()
@@ -471,7 +472,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
         return order;
     }
 
-    [Description("网格员红包发放记录")]
+    [ExportExcel("网格员红包发放记录")]
     public ISugarQueryable<SnapshotRedPackRecordItemsGuiderOutDto> GetRedPackRecordGuiderItems(SnapshotRedPackRecordItemsGuiderInDto dto)
     {
         var query = _redPackRecordRepository.Queryable()
@@ -492,7 +493,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
         return query;
     }
 
-    [Description("红包发放明细")]
+    [ExportExcel("红包发放明细")]
     public ISugarQueryable<SnapshotRedPackRecordSendOutDto> GetRedPackRecordDetail(SnapshotRedPackRecordSendInDto dto)
     {
         var query = _redPackRecordRepository.Queryable()
@@ -524,7 +525,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    [Description("补充发放")]
+    [ExportExcel("补充发放")]
     public ISugarQueryable<SnapshotRedPackRecordSupplementItemsOutDto> GetRedPackRecordSupplementItems(SnapshotRedPackRecordSupplementItemsInDto dto)
     {
         var query = _supplementRecordRepository.Queryable()

+ 23 - 1
src/Hotline.Application/Snapshot/SnapshotBulletinApplication.cs

@@ -1,5 +1,10 @@
 using Hotline.Caching.Interfaces;
 using Hotline.Settings;
+using Hotline.Share.Attributes;
+using Hotline.Share.Dtos.Snapshot;
+using Hotline.Snapshot.Interfaces;
+using Microsoft.AspNetCore.Http;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -13,10 +18,12 @@ public class SnapshotBulletinApplication : ISnapshotBulletinApplication, IScopeD
 {
 
     private readonly ISystemSettingCacheManager _systemSettingCacheManager;
+    private readonly ISnapshotBulletinRepository _bulletinRepository;
 
-    public SnapshotBulletinApplication(ISystemSettingCacheManager systemSettingCacheManager)
+    public SnapshotBulletinApplication(ISystemSettingCacheManager systemSettingCacheManager, ISnapshotBulletinRepository bulletinRepository)
     {
         _systemSettingCacheManager = systemSettingCacheManager;
+        _bulletinRepository = bulletinRepository;
     }
 
     /// <summary>
@@ -65,4 +72,19 @@ public class SnapshotBulletinApplication : ISnapshotBulletinApplication, IScopeD
 
         return sb.ToString();
     }
+
+    [ExportExcel("随手拍公告")]
+    public ISugarQueryable<SnapshotBulletinItemsOutDto> QueryBulletinItems(SnapshotBulletinItemsInDto dto)
+    {
+        var query = _bulletinRepository.Queryable()
+            .Includes(x => x.ExaminMan)
+            .WhereIF(!string.IsNullOrEmpty(dto.SnapshotBulletinTypeName), d => d.SnapshotBulletinTypeName.Contains(dto.SnapshotBulletinTypeName))
+            .WhereIF(!string.IsNullOrEmpty(dto.Title), d => d.Title.Contains(dto.Title))
+            .WhereIF(dto.BeginCreationTime.HasValue, d => d.BulletinTime >= dto.BeginCreationTime)
+            .WhereIF(dto.EndCreationTime.HasValue, d => d.BulletinTime <= dto.EndCreationTime)
+            .WhereIF(dto.State.HasValue, d => d.BulletinState == dto.State)
+            .OrderByDescending(d => d.CreationTime)
+            .Select<SnapshotBulletinItemsOutDto>();
+        return query;
+    }
 }

+ 7 - 0
src/Hotline.Application/Snapshot/SnapshotOrderApplication.cs

@@ -3,6 +3,7 @@ using Hotline.File;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.Workflows;
 using Hotline.Orders;
+using Hotline.Share.Attributes;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.FlowEngine;
@@ -21,6 +22,7 @@ using NPOI.POIFS.Properties;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -169,6 +171,7 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
+    [ExportExcel("随手拍公开")]
     public ISugarQueryable<GetOrderSnapshotPublishItemsOutDto> GetOrderSnapshotPublishItems(GetOrderSnapshotPublishItemsInDto dto)
     {
         var query = _orderSnapshotRepository.Queryable(includeDeleted: true)
@@ -200,6 +203,7 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
+    [ExportExcel("工单标注")]
     public ISugarQueryable<SignOrderSnapshotItemsOutDto> GetSignOrderSnapshotItems(SignOrderSnapshotItemsInDto dto)
     {
         var query = _orderSnapshotRepository.Queryable()
@@ -352,6 +356,7 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
+    [ExportExcel("工单标注日志")]
     public ISugarQueryable<LabelOrderSnapshotLogItemsOutDto> GetLabelOrderSnapshotLogItems(LabelOrderSnapshotLogItemsInDto dto)
     {
         var query = _snapshotLabelLogRepository.Queryable()
@@ -424,6 +429,7 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
 
     }
 
+    [ExportExcel("随手拍工单")]
     public ISugarQueryable<OrderSnapshotItemsOutDto> GetOrderSnapshotItems(OrderSnapshotItemsInDto dto)
     {
         var query = _orderSnapshotRepository.Queryable()
@@ -444,6 +450,7 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
+    [ExportExcel("工单标注")]
     public ISugarQueryable<LabeledOrderSnapshotItemsOutDto> GetLabeledOrderSnapshotItems(LabeledOrderSnapshotItemsInDto dto)
     {
         var query = _orderSnapshotRepository.Queryable()

+ 19 - 0
src/Hotline.Share/Attributes/ExportExcelAttribute.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Attributes;
+public class ExportExcelAttribute : Attribute
+{
+    /// <summary>
+    /// 文件名称
+    /// </summary>
+    public string FileName { get; }
+
+    public ExportExcelAttribute(string fileName)
+    {
+        FileName = fileName;
+    }
+}

+ 16 - 0
src/Hotline.Share/Dtos/Snapshot/IndustryDto.cs

@@ -398,6 +398,11 @@ public class IndustryCaseItemOutDto : AddIndustryCaseDto
     /// 网络员发放红包金额(单位:元)
     /// </summary>
     public string GuiderReadPackAmountTxt => GuiderReadPackAmount.ToYuanFinance();
+
+    /// <summary>
+    /// 是否启用
+    /// </summary>
+    public string IsEnableTxt => IsEnable ? "启用" : "禁用";
 }
 
 public class UpdateIndustryCaseDto : AddIndustryCaseDto
@@ -466,6 +471,17 @@ public class SnapshotSMSTemplateItemsOutDto : AddSnapshotSMSTemplateInDto
     /// 行业名称
     /// </summary>
     public string IndustryName { get; set; }
+
+    /// <summary>
+    /// 是否启用
+    /// </summary>
+    public string IsEnableTxt => IsEnable ? "启用" : "禁用";
+
+    /// <summary>
+    /// 是否公用
+    /// </summary>
+    public string IsPublicTxt => IsPublic ? "是" : "否";
+
 }
 
 public class UpdateSnapshotSMSTemplateInDto : AddSnapshotSMSTemplateInDto

+ 40 - 0
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -538,6 +538,11 @@ public class SnapshotOrderGuiderAuditItemsOutDto
     /// </summary>
     public bool? IsIssued { get; set; }
 
+    /// <summary>
+    /// 网格员奖励发放结果
+    /// </summary>
+    public string? IsIssuedTxt => IsIssued.HasValue == false ? "" : IsIssued.Value ? "已发放" : "未发放";
+
     /// <summary>
     /// 区域
     /// </summary>
@@ -549,26 +554,51 @@ public class SnapshotOrderGuiderAuditItemsOutDto
     /// </summary>
     public bool? IsRectify { get; set; }
 
+    /// <summary>
+    /// 部门是否整改完成
+    /// </summary>
+    public string? IsRectifyTxt => IsRectify.HasValue == false ? "" : IsRectify.Value ? "是" : "否";
+
     /// <summary>
     /// 部门是否属实
     /// </summary>
     public bool? IsTruthDepartment { get; set; }
 
+    /// <summary>
+    /// 部门是否属实
+    /// </summary>
+    public string? IsTruthDepartmentTxt => IsTruthDepartment.HasValue == false ? "" : IsTruthDepartment.Value ? "是" : "否";
+
     /// <summary>
     /// 网格员是否属实
     /// </summary>
     public bool? IsTruth { get; set; }
 
+    /// <summary>
+    /// 网格员是否属实
+    /// </summary>
+    public string? IsTruthTxt => IsTruth.HasValue == false ? "" : IsTruth.Value ? "是" : "否";
+
     /// <summary>
     /// 是否重复
     /// </summary>
     public bool? IsRepetition { get; set; }
 
+    /// <summary>
+    /// 是否重复
+    /// </summary>
+    public string? IsRepetitionTxt => IsRepetition.HasValue == false ? "" : IsRepetition.Value ? "是" : "否";
+
     /// <summary>
     /// 网格员是否办理
     /// </summary>
     public bool? IsDeal { get; set; }
 
+    /// <summary>
+    /// 网格员是否办理
+    /// </summary>
+    public string? IsDealTxt => IsDeal.HasValue == false ? "" : IsDeal.Value ? "是" : "否";
+
     /// <summary>
     /// 网格E通编号
     /// </summary>
@@ -1170,6 +1200,11 @@ public class SignOrderSnapshotItemsOutDto
     /// </summary>
     public bool? IsSafetyDepartment { get; set; }
 
+    /// <summary>
+    /// 标注状态
+    /// </summary>
+    public string IsSafetyDepartmentTxt => IsSafetyDepartment == true ? "是" : "否";
+
     /// <summary>
     /// 回复内容;
     /// 网格员回复内容
@@ -1258,6 +1293,11 @@ public class GetOrderSnapshotPublishItemsOutDto
     /// 网格员是否属实
     /// </summary>
     public bool IsTruth { get; set; }
+
+    /// <summary>
+    /// 网格员是否属实
+    /// </summary>
+    public string IsTruthTxt => IsTruth ? "是" : "否";
 }
 
 public record GetOrderSnapshotPublishItemsInDto : PagedRequest

+ 20 - 0
src/Hotline.Share/Tools/MethodInfoExtensions.cs

@@ -0,0 +1,20 @@
+using Hotline.Share.Attributes;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Tools;
+public static class MethodInfoExtensions
+{
+
+    public static string GetFileName(this MethodInfo? value)
+    {
+        if (value == null) return string.Empty;
+        var att = value.GetCustomAttribute<ExportExcelAttribute>();
+        if (att == null) return string.Empty;
+        return att.FileName;
+    }
+}

+ 1 - 1
src/XingTang.Sdk/XingtangCall.cs

@@ -127,7 +127,7 @@ public class XingtangCall
     /// </summary>
     public string? OrgCaller { get; set; }
 
-    public string? UserData { get; set; }
+    public string? Customerid { get; set; }
 
     #region 未启用