Browse Source

自动审核 保险 调整

LEIYI 3 months ago
parent
commit
57e62643b1

+ 62 - 0
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -20,6 +20,9 @@ using OASystem.API.OAMethodLib.Hub.HubClients;
 using static OASystem.API.OAMethodLib.Hub.Hubs.ChatHub;
 using static OASystem.API.OAMethodLib.JWTHelper;
 using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Customer;
+using static QRCoder.PayloadGenerator.SwissQrCode;
+using OASystem.Domain.AesEncryption;
 
 namespace OASystem.API.Controllers
 {
@@ -867,5 +870,64 @@ namespace OASystem.API.Controllers
 
         }
 
+        /// <summary>
+        /// ClientTest
+        /// </summary>
+        /// <param name="depId">部门Id</param>
+        /// <returns></returns>
+        [HttpPost("ClientTest")]
+        [ProducesResponseType(typeof(LoginView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ClientTest()
+        {
+            var _sqlsugar = _loginRep._sqlSugar;
+            var groups = await _sqlsugar.Queryable<Grp_DelegationInfo>()
+                .Where(x => x.IsDel == 0 && x.VisitDate >= Convert.ToDateTime("2024-01-01") && x.VisitDate<= Convert.ToDateTime("2024-12-31"))
+                .Select(x => new { x.Id, x.TeamName, x.ClientUnit, x.ClientName, x.VisitDate })
+                .ToListAsync();
+
+            var newClients = await _sqlsugar.Queryable<Crm_NewClientData>()
+                .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.Contact))
+                .Select(x => new Crm_NewClientData() { Contact = x.Contact, Telephone = x.Telephone, Phone = x.Phone })
+                .ToListAsync();
+            foreach (var item in newClients) EncryptionProcessor.DecryptProperties(item);
+
+            var datas = new List<NewClientInfo>();
+            foreach (var group in groups)
+            {
+                var clientName = group.ClientName;
+                var clientInfo = newClients.Find(x => !string.IsNullOrEmpty(clientName) && !string.IsNullOrEmpty(x.Contact) &&  clientName.Contains(x.Contact));
+                if (clientInfo != null)
+                {
+                    datas.Add(new NewClientInfo()
+                    {
+                        TeamName = group.TeamName,
+                        ClientUnit = group.ClientUnit,
+                        ClientName = group.ClientName,
+                        VisitDate = group.VisitDate,
+                        NewClientContact = clientInfo?.Contact ?? "",
+                        Telephone = clientInfo?.Telephone ?? "",
+                        Phone = clientInfo?.Phone ?? "",
+                    });
+                }
+               
+            }
+
+            datas = datas.OrderBy(x => x.VisitDate).ToList();
+
+            return Ok(JsonView(datas));
+
+        }
+
+
+        public class NewClientInfo
+        {
+            public string TeamName { get; set; }
+            public string ClientUnit { get; set; }
+            public string ClientName { get; set; }
+            public DateTime VisitDate { get; set; }
+            public string NewClientContact { get; set; }
+            public string Telephone { get; set; }
+            public string Phone { get; set; }
+        }
     }
 }

+ 3 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2396,7 +2396,7 @@ namespace OASystem.API.Controllers
                         case 80:  // 80   签证
 
                             string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", groupInfo.Id);
-                            List<SimplClientInfo> arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
+                            var arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
 
                             string visaClientName = visaDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.VisaClient ?? "";
                             string clientName = "-";
@@ -2411,8 +2411,10 @@ namespace OASystem.API.Controllers
                                 if (success)
                                 {
                                     SimplClientInfo tempInfo = arr.FirstOrDefault(s => s.Id == tempId);
+                                    
                                     if (tempInfo != null)
                                     {
+                                        EncryptionProcessor.DecryptProperties(tempInfo);
                                         if (count > 1)
                                         {
                                             clientName = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);

+ 1 - 1
OASystem/OASystem.Domain/Entities/Financial/Fin_ForeignReceivables.cs

@@ -22,7 +22,7 @@ namespace OASystem.Domain.Entities.Financial
         /// <summary>
         /// 费用名称
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
         public string? PriceName { get; set; }
 
         /// <summary>

+ 6 - 0
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsInfo.cs

@@ -49,6 +49,12 @@ namespace OASystem.Domain.Entities.PersonnelModule
         [SugarColumn(ColumnDescription = "现有库存", IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal StockQuantity { get; set; }
 
+        /// <summary>
+        /// 单位(个、箱、包 等等)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "单位(个、箱、包 等等)", IsNullable = true, ColumnDataType = "varchar(20)")]
+        public decimal Unit { get; set; }
+
         /// <summary>
         /// 最后操作人
         /// </summary>

+ 21 - 15
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -487,31 +487,37 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         CNYPrice = ccp.PayMoney * ccp.DayRate
                     })
                     .ToList();
+
                 if (!insuranceCostData1.Any())
                 {
                     _view.Msg = $"暂无保险数据,不可自动审核!";
                     return _view;
                 }
 
-                #region 处理已审核的 “新数据请不要选此项” 数据
+                if (insuranceCostData1.Where(x => x.Iid == 2).ToList().Any())
+                {
+                    _view.Msg = $"保险数据为类型为“新数据请不要选此项”,不可自动审核!";
+                    return _view;
+                }
+
+                #region 处理 “新数据请不要选此项” 数据
                 var insuranceCostData2 = insuranceCostData1.Where(x => x.Iid == 2).ToList();
 
                 if (insuranceCostData2.Any())
                 {
-                    var ccpIds = insuranceCostData2.Select(x => x.ccpId).ToList();
-
-                    var auditCcpIds = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && ccpIds.Contains(x.Id) && x.IsAuditGM == 3).Select(x => x.Id).ToList();
-
-                    if (auditCcpIds.Any())
-                    {
-                        var ccpUpd = _sqlSugar.Updateable<Grp_CreditCardPayment>()
-                       .SetColumns(it => it.IsAuditGM == 0)
-                       .SetColumns(it => it.AuditGMOperate == 0)
-                       .SetColumns(it => it.AuditGMDate == "")
-                       .Where(s => auditCcpIds.Contains(s.Id))
-                       .ExecuteCommand();
-                    }
-                   
+                    _view.Msg = $"保险数据为类型为“新数据请不要选此项”,不可自动审核!";
+                    return _view;
+                    //var ccpIds = insuranceCostData2.Select(x => x.ccpId).ToList();
+                    //var auditCcpIds = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && ccpIds.Contains(x.Id) && x.IsAuditGM == 3).Select(x => x.Id).ToList();
+                    //if (auditCcpIds.Any())
+                    //{
+                    //    var ccpUpd = _sqlSugar.Updateable<Grp_CreditCardPayment>()
+                    //   .SetColumns(it => it.IsAuditGM == 0)
+                    //   .SetColumns(it => it.AuditGMOperate == 0)
+                    //   .SetColumns(it => it.AuditGMDate == "")
+                    //   .Where(s => auditCcpIds.Contains(s.Id))
+                    //   .ExecuteCommand();
+                    //}
                 }
 
                 #endregion