From a247547df86f0fad8f03aebb91de68d3f2bc7918 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期四, 01 五月 2025 10:16:52 +0800
Subject: [PATCH] 修正sugsql导航更新加配置的bug

---
 cylsg/cylsg.Application/CyOS/CyOSSettingController.cs |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 100 insertions(+), 14 deletions(-)

diff --git a/cylsg/cylsg.Application/CyOS/CyOSSettingController.cs b/cylsg/cylsg.Application/CyOS/CyOSSettingController.cs
index 5442385..87256d7 100644
--- a/cylsg/cylsg.Application/CyOS/CyOSSettingController.cs
+++ b/cylsg/cylsg.Application/CyOS/CyOSSettingController.cs
@@ -1,25 +1,29 @@
 锘縰sing cylsg.Model.ECTEModel;
 using ECTESTOA;
 using EzCoreNet.Redis;
+using Models;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using static SKIT.FlurlHttpClient.Wechat.Api.Models.ProductOfflineGetSameCityTemplateResponse.Types.Template.Types;
 
 namespace cylsg.Application.CyOS
 {
     /// <summary>
     /// 宸濆嵃閫氱敤淇℃伅鑾峰彇
     /// </summary>
-    public class CYOSSettingController: IDynamicApiController
+    [Authorize]
+    [ApiDescriptionSettings("CYOA")]
+    public class CYOSSettingController : IDynamicApiController
     {
 
         private readonly ISqlSugarClient _client;
         private readonly IOAServices _oAServices;
         private readonly IEzCoreNetRedisService _eZCoreNetRedisService;
-         
-        public CYOSSettingController( ISqlSugarClient client,IOAServices oAServices,IEzCoreNetRedisService netRedisService )
+
+        public CYOSSettingController(ISqlSugarClient client, IOAServices oAServices, IEzCoreNetRedisService netRedisService)
         {
             _client = client.AsTenant().GetConnection("ECTESTOADB");
             _oAServices = oAServices;
@@ -31,37 +35,119 @@
         /// </summary>
         /// <returns></returns>
         [HttpGet]
-        public async Task< List<OaDepartment>> GetDepartLstt()
+        public async Task<List<OaDepartment>> GetDepartLstt()
         {
-            return await _client.Queryable<OaDepartment>().Where(x=>x.Status== "鍚敤"&&x.FirmId== _oAServices.firmId).Select(x=>new OaDepartment
+            return await _client.Queryable<OaDepartment>().Where(x => x.Status == "鍚敤" && x.FirmId == _oAServices.firmId).Select(x => new OaDepartment
             {
-                  Name=x.Name,
-                    Keyid=x.Keyid,
-                     Remark=x.Remark,
-            }).WithCache(3600).ToListAsync();
+                Name = x.Name,
+                Keyid = x.Keyid,
+                Remark = x.Remark,
+            }).WithCache(60).ToListAsync();
         }
         /// <summary>
         /// 鑾峰彇绉戠洰鍒楄〃
         /// </summary>
         /// <returns></returns>
         [HttpGet]
+        [AllowAnonymous]
         public async Task<List<OaSubjectSet>> getKeMuList()
         {
-            return await _client.Queryable<OaSubjectSet>().Where(x => x.Status == true && x.FirmId == _oAServices.firmId&& x.SubjectType=="璐�").Select(x => new OaSubjectSet
+            return await _client.Queryable<OaSubjectSet>().Where(x => x.Status == true && x.FirmId == _oAServices.firmId && x.SubjectType == "璐�").Select(x => new OaSubjectSet
             {
                 SubjectName = x.SubjectName,
                 Keyid = x.Keyid,
                 Remark = x.Remark,
-            }).WithCache(3600).ToListAsync();
+            }).WithCache(60).ToListAsync();
         }
         /// <summary>
         /// 鑾峰彇娴佹按鍙�
         /// </summary>
         /// <returns></returns>
         [HttpGet]
-        public  string GetShowID()
+        [AllowAnonymous]
+        public string GetShowID()
         {
-          return   _eZCoreNetRedisService.GetYYYMMddAnd4sn();
+            return _eZCoreNetRedisService.GetYYYMMddAnd4sn();
         }
-    }
+        /// <summary>
+        /// 鑾峰彇瀹㈡埛鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        //[AllowAnonymous]
+        public async Task<object> GeCorporateClients()
+        {
+             return  await _client.Queryable<OA_CorporateClients>()
+                .LeftJoin<OA_CustomerCommunications>((Co,Cu)=>Co.Keyid==Cu.Keyid)
+                .Where((Co, Cu) => Co.Shifouwanjie != 1 && Co.FirmId == _oAServices.firmId).Select((Co, Cu) => new 
+            {
+                 Co.Keyid,
+                    Co.CompanyName,
+                  adder=Cu.Province+Cu.City+Cu.County+Cu.DetailedAddress,
+                  Cu.CompanyPhone,
+                  Cu.BusinessManagers,     
+
+
+            }).MergeTable().OrderBy(Co => Co.CompanyName).WithCache(1800).ToListAsync();
+        }
+        /// <summary>
+        /// 鑾峰彇鍙告満鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<List<OaStaff>> Getdrivers()
+        {
+            return await _client.Queryable<OaStaff>().Includes(x=>x.Car).Where(x => x.Status == "鍦ㄨ亴" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff
+            {
+                Name = x.Name,
+                MemberId = x.MemberId,
+                Keyid = x.Keyid,
+                Car=x.Car
+
+            }).ToListAsync();
+        }
+
+
+        /// <summary>
+        /// 鑾峰彇7澶╁唴鍙告満鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<List<OaStaff>> GetDriversOfWithin7days()
+        {
+           
+            var list = await _client.Queryable<OA_DeliverPlanPaiche>().Where(x =>( x.DeliverTime.Value.Date < DateTime.Now.AddDays(8).Date) && (x.DeliverTime.Value.Date >= DateTime.Now.Date)).Select(x => x.DriverId).ToListAsync();
+            return await _client.Queryable<OaStaff>().Includes(x=>x.Car).Where(x=>list.Contains(x.Keyid)).Where(x => x.Status == "鍦ㄨ亴" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff
+            {
+                Name = x.Name,
+                MemberId = x.MemberId,
+                Keyid = x.Keyid,
+                Car=x.Car
+
+            })/*.WithCache(30)*/.ToListAsync(); //Includes(x => x.Car)鍔犵紦瀛樹細鎶ラ敊
+            ////      return await _client.Queryable<OA_DeliverPlan>()
+            ////.LeftJoin<OaStaff>((dp, os) => dp.DriverId == os.Keyid)
+            ////.Where((dp, os) => SqlFunc.ToDate(dp.DeliverTime) < DateTime.Now.AddDays(8).Date
+            ////    && SqlFunc.ToDate(dp.DeliverTime) >= DateTime.Now.Date
+            ////    && os.Status == "鍦ㄨ亴"
+            ////    && os.FirmId == _oAServices.firmId
+            ////    )
+            ////.GroupBy((dp, os) => dp.DriverId)
+            ////.Select((dp, os) => new OaStaff
+            ////{
+            ////    Name = SqlFunc.AggregateMax(os.Name),
+            ////    MemberId = SqlFunc.AggregateMax(os.MemberId),
+            ////    Keyid = SqlFunc.AggregateMax(os.Keyid),
+            ////})
+            ////.WithCache(1800)
+            ////.ToListAsync();
+             }
+
+
+
+
+
+        }
 }

--
Gitblit v1.9.1