|
@@ -411,9 +411,32 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
scEdCnt.Add(item);
|
|
scEdCnt.Add(item);
|
|
}
|
|
}
|
|
|
|
|
|
- scEdCnt.ForEach(async scProCnt =>
|
|
|
|
|
|
+ //scEdCnt.ForEach(async scProCnt =>
|
|
|
|
+ //{
|
|
|
|
+ // var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProCnt.id, new PartitionKey("ProductSum"));
|
|
|
|
+ // if (response.Status == 200)
|
|
|
|
+ // {
|
|
|
|
+ // using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
|
|
+ // SchoolProductSum ScProductSum = json.ToObject<SchoolProductSum>();
|
|
|
|
+ // //scProCnt.serial = ScProductSum.serial.Count();
|
|
|
|
+ // //scProCnt.service = ScProductSum.service.Count();
|
|
|
|
+ // //scProCnt.hard = ScProductSum.hard.Count();
|
|
|
|
+ // List<string> pSeriCnt = ScProductSum.serial.Select(s=> s.prodCode).ToList();
|
|
|
|
+ // List<string> pServCnt = ScProductSum.service.Select(s=>s.prodCode).ToList();
|
|
|
|
+ // List<string> pHardCnt = ScProductSum.hard.Select(s=>s.prodCode).ToList();
|
|
|
|
+ // scProCnt.serial = pSeriCnt;
|
|
|
|
+ // scProCnt.service = pServCnt;
|
|
|
|
+ // scProCnt.hard = pHardCnt;
|
|
|
|
+ // if (scProCnt.scale >= 500 && (pSeriCnt.Count > 0 || pServCnt.Count > 0 || pHardCnt.Count > 0)) peCnt += 1;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // if (scProCnt.scale >= 500 && scProCnt.serial.Count == 0 && scProCnt.service.Count == 0 && scProCnt.hard.Count == 0) seCnt += 1;
|
|
|
|
+ // if (scProCnt.scale == 0) beCnt += 1;
|
|
|
|
+ //});
|
|
|
|
+
|
|
|
|
+ foreach (var item in scEdCnt)
|
|
{
|
|
{
|
|
- var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProCnt.id, new PartitionKey("ProductSum"));
|
|
|
|
|
|
+ var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.id, new PartitionKey("ProductSum"));
|
|
if (response.Status == 200)
|
|
if (response.Status == 200)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
@@ -421,18 +444,21 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
//scProCnt.serial = ScProductSum.serial.Count();
|
|
//scProCnt.serial = ScProductSum.serial.Count();
|
|
//scProCnt.service = ScProductSum.service.Count();
|
|
//scProCnt.service = ScProductSum.service.Count();
|
|
//scProCnt.hard = ScProductSum.hard.Count();
|
|
//scProCnt.hard = ScProductSum.hard.Count();
|
|
- List<string> pSeriCnt = ScProductSum.serial.Select(s=> s.prodCode).ToList();
|
|
|
|
- List<string> pServCnt = ScProductSum.service.Select(s=>s.prodCode).ToList();
|
|
|
|
- List<string> pHardCnt = ScProductSum.hard.Select(s=>s.prodCode).ToList();
|
|
|
|
- scProCnt.serial = pSeriCnt;
|
|
|
|
- scProCnt.service = pServCnt;
|
|
|
|
- scProCnt.hard = pHardCnt;
|
|
|
|
- if (scProCnt.scale >= 500 && (pSeriCnt.Count > 0 || pServCnt.Count > 0 || pHardCnt.Count > 0)) peCnt += 1;
|
|
|
|
|
|
+ List<string> pSeriCnt = ScProductSum.serial.Select(s => s.prodCode).ToList();
|
|
|
|
+ List<string> pServCnt = ScProductSum.service.Select(s => s.prodCode).ToList();
|
|
|
|
+ List<string> pHardCnt = ScProductSum.hard.Select(s => s.prodCode).ToList();
|
|
|
|
+ item.serial = pSeriCnt;
|
|
|
|
+ item.service = pServCnt;
|
|
|
|
+ item.hard = pHardCnt;
|
|
|
|
+ if (item.scale >= 500 && (pSeriCnt.Count > 0 || pServCnt.Count > 0 || pHardCnt.Count > 0)) peCnt += 1;
|
|
}
|
|
}
|
|
|
|
|
|
- if (scProCnt.scale >= 500 && scProCnt.serial.Count == 0 && scProCnt.service.Count == 0 && scProCnt.hard.Count == 0) seCnt += 1;
|
|
|
|
- if (scProCnt.scale == 0) beCnt += 1;
|
|
|
|
- });
|
|
|
|
|
|
+ if (item.scale >= 500 && item.serial.Count == 0 && item.service.Count == 0 && item.hard.Count == 0) seCnt += 1;
|
|
|
|
+ if (item.scale == 0) beCnt += 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
return Ok(new { state = 200, beCnt, seCnt, peCnt, scEdCnt });
|
|
return Ok(new { state = 200, beCnt, seCnt, peCnt, scEdCnt });
|
|
}
|
|
}
|