소스 검색

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

liqk 4 년 전
부모
커밋
45efba9cca
2개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 0
      TEAMModelOS/Controllers/Item/ItemController.cs
  2. 4 4
      TEAMModelOS/Services/Common/ItemService.cs

+ 5 - 0
TEAMModelOS/Controllers/Item/ItemController.cs

@@ -48,6 +48,11 @@ namespace TEAMModelOS.Controllers
             _serviceBus = serviceBus;
             _configuration = configuration;
         }
+        /// <summary>
+        /// 参数{"periodId":"学段id","schoolCode":"学校编码"} 其中periodId 不填则是全部学段的。
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("cond-count")]
         public async Task<IActionResult> CondCount(JsonElement request) {

+ 4 - 4
TEAMModelOS/Services/Common/ItemService.cs

@@ -18,7 +18,7 @@ namespace TEAMModelOS.Services.Common
             //检查两个对象是否是同一条记录
             if (newItem != null && odlItem == null)
             {
-                string newKey = $"{newItem.periodId}-{newItem.subjectId}";
+                string newKey = $"{newItem.subjectId}";
                 List<string> grade = newItem.gradeIds;
                 UpdateItemCond(cond, true,newKey, grade, newItem.type, newItem.level, newItem.field.HasValue?newItem.field.Value:0);
             }
@@ -28,18 +28,18 @@ namespace TEAMModelOS.Services.Common
                 if (newItem.id == odlItem.id && newItem.code == odlItem.code)
                 {
                     //先增加
-                    string newKey = $"{newItem.periodId}-{newItem.subjectId}";
+                    string newKey = $"{newItem.subjectId}";
                     List<string> newGrade = newItem.gradeIds;
                     UpdateItemCond(cond, true, newKey, newGrade, newItem.type, newItem.level, newItem.field.HasValue ? newItem.field.Value : 0);
                     //后变更删除
-                    string oldKey = $"{odlItem.periodId}-{odlItem.subjectId}";
+                    string oldKey = $"{odlItem.subjectId}";
                     List<string> oldGrade = odlItem.gradeIds;
                     UpdateItemCond(cond, false, oldKey, oldGrade, odlItem.type, odlItem.level, odlItem.field.HasValue ? odlItem.field.Value : 0);
                 }
             }
             else if (newItem == null && odlItem != null)
             {
-                string oldKey = $"{odlItem.periodId}-{odlItem.subjectId}";
+                string oldKey = $"{odlItem.subjectId}";
                 List<string> oldGrade = odlItem.gradeIds;
                 UpdateItemCond(cond, false, oldKey, oldGrade, odlItem.type, odlItem.level, odlItem.field.HasValue ? odlItem.field.Value : 0);
             }