Browse Source

团组签证进度进度总览修改

jiangjc 1 year ago
parent
commit
4f078808d8

+ 29 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationVisaRepository.cs

@@ -39,10 +39,36 @@ From DelegationInfo With(Nolock) {2}
 
             foreach (var item in dataSource)
             {
-                string sql2 = string.Format(@" Select * From Grp_VisaProgressCustomer With(Nolock) Where DiId={0} And IsDel=0 ", item.DiId);
-                List<Grp_VisaProgressCustomer> listComplete = _sqlSugar.SqlQueryable<Grp_VisaProgressCustomer>(sql2).ToList();
+                //string sql2 = string.Format(@" Select * From Grp_VisaProgressCustomer With(Nolock) Where DiId={0} And IsDel=0 ", item.DiId);
+                //List<Grp_VisaProgressCustomer> listComplete = _sqlSugar.SqlQueryable<Grp_VisaProgressCustomer>(sql2).ToList();
 
-                item.CompletePNumber = string.Format(@"已完成{0}人", listComplete.Count);
+                string sql2 = string.Format(@" Select WorkStatus as code,COUNT(1) as nums From Grp_VisaProgressCustomer With(Nolock) Where DiId={0} And IsDel=0 Group by WorkStatus ", item.DiId);
+                List<dynamic> listComplete = _sqlSugar.SqlQueryable<dynamic>(sql2).ToList();
+                int totalCount = listComplete.Count;
+
+
+                //未作详细描述文本
+                int count_0 = 0;
+                int count_1 = 0;
+                int count_2 = 0;
+                int count_3 = 0;
+                foreach (var comCount in listComplete)
+                {
+                    switch (comCount.code)
+                    {
+                        case 0: count_0 = comCount.nums; break;
+                        case 1: count_1 = comCount.nums; break;
+                        case 2: count_2 = comCount.nums; break;
+                        case 3: count_3 = comCount.nums; break;
+                        default:
+                            break;
+                    }
+                }
+
+                int comNums = totalCount - count_0;
+
+
+                item.CompletePNumber = string.Format(@"{0} / {1}", comNums, totalCount);
             }
             rst.DataList = new List<Grp_DelegationVisaView>(dataSource);