CrazyIter_Bin il y a 1 an
Parent
commit
47e376dd80

+ 3 - 3
TEAMModelOS.SDK/Models/Service/GroupListService.cs

@@ -191,7 +191,7 @@ namespace TEAMModelOS.SDK
         /// <param name="type"></param>
         /// <param name="type"></param>
         /// <param name="school"></param>
         /// <param name="school"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static async Task<(int status, GroupList stuList,Member member)> CodeJoinList(CosmosClient client,AzureRedisFactory _azureRedis, string _stuListNo, string userid, int type, string school,int year,string name ,string picture,string lang )
+        public static async Task<(int status, GroupList stuList,Member member)> CodeJoinList(CosmosClient client,AzureRedisFactory _azureRedis, string _stuListNo, string userid, int type, string school,int year,string name ,string picture,string lang,string courseId= null)
         {
         {
             var queryNo = $"SELECT  value(c)  FROM c where  c.no ='{_stuListNo}'";
             var queryNo = $"SELECT  value(c)  FROM c where  c.no ='{_stuListNo}'";
             (int status, GroupList stuList,Member member) data = (-1, null,null);
             (int status, GroupList stuList,Member member) data = (-1, null,null);
@@ -212,7 +212,6 @@ namespace TEAMModelOS.SDK
                     //状态=4 表示未开放加入。
                     //状态=4 表示未开放加入。
                     return (4, item, null) ;
                     return (4, item, null) ;
                 }
                 }
-              
                if (item.review ==1)
                if (item.review ==1)
                 {
                 {
 
 
@@ -242,7 +241,7 @@ namespace TEAMModelOS.SDK
                             groupName= item.name,
                             groupName= item.name,
                             applyTime=now
                             applyTime=now
                         };
                         };
-
+                        string sql = "select value c from c join b in c.schedules where b.groupId='60f92012-72cf-4d5c-a66a-552678303fad'"; 
                         string key = $"GroupList:GroupWaitingList:{item.scope}:{item.id}";
                         string key = $"GroupList:GroupWaitingList:{item.scope}:{item.id}";
                         string filed = !string.IsNullOrWhiteSpace(school) ? $"{school}_{userid}" : userid;
                         string filed = !string.IsNullOrWhiteSpace(school) ? $"{school}_{userid}" : userid;
                         await _azureRedis.GetRedisClient(8).HashSetAsync(key, filed, waitingList.ToJsonString());
                         await _azureRedis.GetRedisClient(8).HashSetAsync(key, filed, waitingList.ToJsonString());
@@ -294,6 +293,7 @@ namespace TEAMModelOS.SDK
             /// 申请状态,-1 申请中,0 通过,1 拒绝,2 已过期。 
             /// 申请状态,-1 申请中,0 通过,1 拒绝,2 已过期。 
             /// </summary>
             /// </summary>
             public int status { get; set; } = -1;
             public int status { get; set; } = -1;
+           public List<IdName> courses  { get; set; }= new List<IdName>();
         }
         }
         public static (int status, GroupList stuList, Member member) JoinList(GroupList stuList, string userid, int type, string school,int year)
         public static (int status, GroupList stuList, Member member) JoinList(GroupList stuList, string userid, int type, string school,int year)
         {
         {

+ 5 - 3
TEAMModelOS/Controllers/Both/GroupListController.cs

@@ -103,6 +103,7 @@ namespace TEAMModelOS.Controllers
         {
         {
             if (!json.TryGetProperty("stuListNo", out JsonElement _stuListNo)) return BadRequest();
             if (!json.TryGetProperty("stuListNo", out JsonElement _stuListNo)) return BadRequest();
             json.TryGetProperty("school", out JsonElement school);
             json.TryGetProperty("school", out JsonElement school);
+            json.TryGetProperty("courseId", out JsonElement _courseId);
             var client = _azureCosmos.GetCosmosClient();
             var client = _azureCosmos.GetCosmosClient();
             json.TryGetProperty("id_token", out JsonElement id_token);
             json.TryGetProperty("id_token", out JsonElement id_token);
             var jwt = new JwtSecurityToken(id_token.GetString());
             var jwt = new JwtSecurityToken(id_token.GetString());
@@ -136,7 +137,7 @@ namespace TEAMModelOS.Controllers
                 }
                 }
             }
             }
             int year = DateTimeOffset.UtcNow.Year;
             int year = DateTimeOffset.UtcNow.Year;
-            (int status, GroupList stuList, Member member) data = await GroupListService.CodeJoinList(client, _azureRedis, $"{_stuListNo}", id, type: 1, $"{school}", year, $"{name}", $"{picture}", $"{lang}");
+            (int status, GroupList stuList, Member member) data = await GroupListService.CodeJoinList(client, _azureRedis, $"{_stuListNo}", id, type: 1, $"{school}", year, $"{name}", $"{picture}", $"{lang}",$"{_courseId}");
             //没有TmdUser时
             //没有TmdUser时
             if (data.status == 0)
             if (data.status == 0)
             {
             {
@@ -1284,8 +1285,9 @@ namespace TEAMModelOS.Controllers
                                     {
                                     {
                                         await _azureRedis.GetRedisClient(8).HashDeleteAsync(stuKey, $"{group.groupScope}:{group.groupId}");
                                         await _azureRedis.GetRedisClient(8).HashDeleteAsync(stuKey, $"{group.groupScope}:{group.groupId}");
                                     }
                                     }
-                                    else {
-                                        if (now>group.qrcodeExpire) 
+                                    else
+                                    {
+                                        if (now>group.qrcodeExpire)
                                         {
                                         {
                                             group.status=2;
                                             group.status=2;
                                             await _azureRedis.GetRedisClient(8).HashDeleteAsync(stuKey, $"{group.groupScope}:{group.groupId}");
                                             await _azureRedis.GetRedisClient(8).HashDeleteAsync(stuKey, $"{group.groupScope}:{group.groupId}");

Fichier diff supprimé car celui-ci est trop grand
+ 92 - 10
TEAMModelOS/Controllers/System/WeChatPayController.cs


+ 1 - 0
TEAMModelOS/TEAMModelOS.csproj

@@ -9,6 +9,7 @@
 	<PackageReference Include="EPPlus" Version="6.2.6" />
 	<PackageReference Include="EPPlus" Version="6.2.6" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
 	<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="2.20.0" />
 	<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="2.20.0" />
+	<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <None Remove="ClientApp\src\static\BaseDataDefault.json" />
     <None Remove="ClientApp\src\static\BaseDataDefault.json" />