3
1

18 Revīzijas e59206890b ... d599e9a93c

Autors SHA1 Ziņojums Datums
  qinchaoyue d599e9a93c Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test 4 stundas atpakaļ
  qinchaoyue 54ed6b7d5d Merge branch 'fix/red_pack_audit' into test 4 stundas atpakaļ
  qinchaoyue 265bbe939e 修复根据行业配置的审核部门才能审核市民红包 4 stundas atpakaļ
  xf 5309877a58 Merge branch 'test' into release 7 stundas atpakaļ
  xf 96fb0666ef Merge branch 'test' into release 7 stundas atpakaļ
  xf a7dbe00e45 Merge branch 'test' into release 3 dienas atpakaļ
  xf 538560cc86 test -> release merge confilct 3 dienas atpakaļ
  xf 72096df594 Merge branch 'fix/red_audit_amount' of Fengwo/hotline into release 1 nedēļu atpakaļ
  qinchaoyue e914724465 市民红包审核如果是安全隐患行业如果标记了安全生产为是发20元红包; 1 nedēļu atpakaļ
  qinchaoyue 597fb9b168 市民红包审核如果行业是安全隐患并且标记安全生产就审核金额20; 1 nedēļu atpakaļ
  tangjiang ab8619719e Merge branch 'release_20250418tj' of Fengwo/hotline into release 1 nedēļu atpakaļ
  tangjiang 1927decba8 修改平均派单bug 1 nedēļu atpakaļ
  xf d0f0ae39b4 Merge branch 'fix/snapshot_token' of Fengwo/hotline into release 1 nedēļu atpakaļ
  qinchaoyue a6f1df8c31 修复天阙回复内容OrgId超长问题. 用户不存在返回code:403 1 nedēļu atpakaļ
  tangjiang 74c3bc535b Merge branch 'release_20250418tj' of Fengwo/hotline into release 1 nedēļu atpakaļ
  tangjiang af6256591e 修改短信回复状态处理 1 nedēļu atpakaļ
  xf 00d5ddbc73 Merge branch 'test' into release 1 nedēļu atpakaļ
  xf 72093886d9 更新 OrderController 中的 FlowDirection 检查 1 nedēļu atpakaļ

+ 5 - 2
src/Hotline.Application/Identity/IdentityAppService.cs

@@ -367,8 +367,11 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
 
     public async Task<Dictionary<string, object>> RefreshTokenAsync(string openId, CancellationToken token)
     {
-        var thirdAccount = await _thirdAccountRepository.GetByOpenIdAsync(openId, token)
-            ?? throw UserFriendlyException.SameMessage("未找到用户信息");
+        var thirdAccount = await _thirdAccountRepository.GetByOpenIdAsync(openId, token);
+        if (thirdAccount is null)
+        {
+            throw new UserFriendlyException(403, "用户不存在");
+        }
 
         return await GetJwtToken(thirdAccount, token);
     }

+ 11 - 3
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -267,8 +267,16 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
         var industry = await _industryRepository.Queryable(includeDeleted: true)
             .LeftJoin<OrderSnapshot>((i, o) => i.Id == o.IndustryId)
             .Where((i, o) => o.Id == id)
-            .Select((i, o) => new { i.Id, i.CitizenReadPackAmount, i.ArgeePoints, i.ExtraDeductedPoints, i.RefusePoints, i.IsPoints,
-            o.IsSafetyDepartment, i.Name})
+            .Select((i, o) => new {
+                i.Id,
+                i.CitizenReadPackAmount,
+                i.ArgeePoints,
+                i.ExtraDeductedPoints,
+                i.RefusePoints,
+                i.IsPoints,
+                o.IsSafetyDepartment,
+                i.Name
+            })
             .FirstAsync();
         outDto.Amount = industry.CitizenReadPackAmount;
         if (industry.Name == "安全隐患" && industry.IsSafetyDepartment.HasValue && industry.IsSafetyDepartment == true)
@@ -417,7 +425,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
             .LeftJoin<RedPackRecord>((redPackAudit, order, snapshot, record) => redPackAudit.Id == record.OrderId)
             .LeftJoin<Industry>((redPackAudit, order, snapshot, record, industry) => snapshot.IndustryId == industry.Id)
             .LeftJoin<IndustryCase>((redPackAudit, order, snapshot, record, industry, industryCase) => snapshot.IndustryCase == industryCase.Id)
-            .Where((redPackAudit, order, snapshot, record, industry) => order.Status >= EOrderStatus.Filed)
+            .Where((redPackAudit, order, snapshot, record, industry) => order.Status >= EOrderStatus.Filed && industry.ApproveOrgId == _sessionContext.OrgId)
             .WhereIF(dto.No.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.No.Contains(dto.No))
             .WhereIF(dto.Title.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.Title.Contains(dto.Title))
             .WhereIF(dto.FromPhone.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.FromPhone.Contains(dto.FromPhone))

+ 12 - 12
src/Hotline/Orders/OrderDomainService.cs

@@ -569,20 +569,20 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
 
     #region 平均派单
 
-    public async Task<bool> SchedulingAtWork(string UserId) 
+    public async Task<bool> SchedulingAtWork(string UserId)
     {
-		var time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
-		var atWork =  await _schedulingRepository.Queryable()
-			.Includes(x => x.SchedulingUser)
-			.Where(x => x.SchedulingUser.UserId == UserId && x.SchedulingTime == time && x.WorkingTime <= DateTime.Now.TimeOfDay && x.OffDutyTime >= DateTime.Now.TimeOfDay && x.AtWork == true)
-			.AnyAsync();
+        var time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
+        var atWork = await _schedulingRepository.Queryable()
+            .Includes(x => x.SchedulingUser)
+            .Where(x => x.SchedulingUser.UserId == UserId && x.SchedulingTime == time && x.WorkingTime <= DateTime.Now.TimeOfDay && x.OffDutyTime >= DateTime.Now.TimeOfDay && x.AtWork == true)
+            .AnyAsync();
         return atWork;
-	}
-	/// <summary>
-	/// 平均派单
-	/// </summary>
-	/// <returns></returns>
-	public async Task<StepAssignInfo> AverageOrder(CancellationToken cancellationToken)
+    }
+    /// <summary>
+    /// 平均派单
+    /// </summary>
+    /// <returns></returns>
+    public async Task<StepAssignInfo> AverageOrder(CancellationToken cancellationToken)
     {
         var time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
         var scheduling = await _schedulingRepository.Queryable().Includes(x => x.SchedulingUser)

+ 1 - 1
test/Hotline.Tests/Application/OrderSnapshotApplicationTest.cs

@@ -328,7 +328,7 @@ public class OrderSnapshotApplicationTest : TestBase
 
                 try
                 {
-                    await _redPackApplication.RevocationRedPackSpecialAuditAsync(new List<string> { specialRedAudit.Id });
+                    await _redPackApplication.RevocationRedPackSpecialAuditAsync([specialRedAudit.Id]);
                 }
                 catch (UserFriendlyException e)
                 {

+ 2 - 1
test/Hotline.Tests/Mock/OrderServiceMock.cs

@@ -87,7 +87,8 @@ public class OrderServiceMock
         inDto.Street = "单元测试街道" + DateTime.Now.ToLongDateTimeString();
         inDto.IndustryId = industry.Id;
         inDto.Town = "仙市镇";
-        inDto.County = "大安区";
+        inDto.AreaCode = "510302";
+        inDto.County = "自流井区";
         inDto.Description = "单元测试添加的时间描述";
         inDto.IsSecret = false;
         inDto.PhoneNumber = _sessionContext.Phone;

+ 1 - 1
test/Hotline.Tests/TestBase.cs

@@ -176,7 +176,7 @@ public class TestBase
                 Name = name,
                 OrgId = orgId,
                 PhoneNo = phoneNo,
-                RoleIds = new[] { roleId },
+                RoleIds = [roleId],
                 UserType = userType,
                 UserName = userName
             };