小飞侠
2025-10-21 595df5dac0a782bfdadab766b4dd62d326b0a383
cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs
@@ -2,6 +2,7 @@
using cylsg.Model.utilityViewModel;
using ECTESTOA;
using Furion.LinqBuilder;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,6 +16,7 @@
    /// 报销主管相关控制器
    /// </summary>
    [Authorize]
    [ApiDescriptionSettings("CYOA")]
    public class CyOSBaoXiaoZHuGuanController: IDynamicApiController
    {
        private readonly IOAServices _OAServices;
@@ -25,8 +27,29 @@
            _OAServices = oaservices;
            _SugarClient = sugarClient.AsTenant().GetConnection("ECTESTOADB");
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<List<OaWorkPlan>> gettest()
        {
            var datal = await _SugarClient.Queryable<OaWorkPlan>().Where(x=>x.PlanType==3&&x.PlanDataType==17)
         .Select(x => new OaWorkPlan
         {
             OaWorkPlanShenpi = SqlFunc.Subqueryable<OaWorkPlanShenpi>().Where(y => y.OA_WorkPlanId == x.Keyid).First()
         }, true).MergeTable()
         .OrderBy(z => z.OaWorkPlanShenpi.ApprovalTime).ToListAsync();
            return datal;
            var data2 = await _SugarClient.Queryable<OaWorkPlan>()
                .Select(x => new OaWorkPlan
                {
                    SentStaff = SqlFunc.Subqueryable<OaStaff>().Where(y => y.MemberId == x.SentStaffId).First()
                }, true).MergeTable()
                .OrderBy(y => y.SentStaff.MemberId).ToListAsync();
        }
        /// <summary>
        ///  查询
        /// </summary>
@@ -91,7 +114,7 @@
            RefAsync<int> totle = 0;
            //强制增加员工过滤
            var data = await _SugarClient.Queryable<OaWorkPlan>().Includes(x=>x.Depart)
                    .Includes(x=>x.OaWorkPlanShenpis.Where(y=>y.ApprovalStaffId==Permissions.MemberId&&y.Buzhou==1).ToList())
                    .Where(SearchList).OrderByDescending(x => x.PlanStartTime).Mapper(
@@ -202,6 +225,15 @@
                        data.Operator = Permissions.Name;
                       await  _SugarClient.Updateable(data).ExecuteCommandAsync();
                        //设置设备weixiu状态为拒绝
                        var shenpis = await _SugarClient.Queryable<OA_ShebeiWeixiu>().Where(x => x.FukuanShebeiId == data.Keyid).FirstAsync();
                        if (shenpis != null)
                        {
                            shenpis.ApprovalStatus = (int )PlanStatusType.No;
                            await _SugarClient.Updateable(shenpis).ExecuteCommandAsync();
                        }
                    }
                    shenpi = new OaWorkPlanShenpi()