From 67e7737c88cbe47f595f9f4abfa8ab0f1082b056 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期三, 05 二月 2025 09:37:28 +0800
Subject: [PATCH] no message

---
 cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs b/cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs
index d255339..39e60fe 100644
--- a/cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs
+++ b/cylsg/cylsg.Application/CyOS/CyOSBaoXiaoZHuGuanController.cs
@@ -41,12 +41,13 @@
             Expression<Func<OaWorkPlan, bool>> SearchList = (x) => true;
 
             //宸濆嵃宸ヤ綔鍗�
+            SearchList = SearchList.And(x => x.ApprovalStatus != PlanStatusType.Uncommitted);
             SearchList = SearchList.And(x => x.MemberId == _OAServices.firmId);
             SearchList = SearchList.And(x => x.PlanType == 3);
             SearchList = SearchList.And(x => x.PlanDataType == 17);
             //SearchList = SearchList.And(x =>  x.ApprovalStatus == PlanStatusType.unApproval);
             //SearchList = SearchList.And(x =>  x.OaWorkPlanShenpis.Where(y => y.Buzhou == 1 && y.ApprovalStaffId == Permissions.MemberId).Count()<=0);
-            SearchList = SearchList.And(x => x.DepartId == Permissions.DepartId);
+            //SearchList = SearchList.And(x => x.DepartId == Permissions.DepartId); 閮ㄩ棬绛涢��
             if (!string.IsNullOrEmpty(param.StaffName))
             {
                 SearchList = SearchList.And(x => x.SentStaff.Name.Contains(param.StaffName));
@@ -135,7 +136,18 @@
             {
                 throw Oops.Oh("娌℃湁鏉冮檺");
             }
-            return await _SugarClient.Queryable<OaWorkPlan>().Includes(x => x.OaWorkPlanShenpis.Where(y => y.Buzhou == 1).ToList(), y => y.ApprovalStaff).Includes(x => x.SentStaff).Includes(x => x.Depart).Includes(x => x.WorkPlanAttachments).Where(x=>x.Keyid==id).FirstAsync();
+            return await _SugarClient.Queryable<OaWorkPlan>().Includes(x => x.OaWorkPlanShenpis.Where(y => y.Buzhou == 1).ToList(), y => y.ApprovalStaff).Includes(x => x.SentStaff).Includes(x => x.Depart).Includes(x => x.WorkPlanAttachments).Where(x=>x.Keyid==id).Mapper(x=>
+            {
+                if (x.ApprovalStatus == PlanStatusType.unApproval)
+                {
+                    var oashenpi = x.OaWorkPlanShenpis?.Where(x=>x.ApprovalStaffId==Permissions.MemberId).FirstOrDefault();
+                    if (oashenpi != null)
+                        x.ApprovalStatus = oashenpi.ApprovalStatus;
+
+
+                }
+                            ;
+            }).FirstAsync();
         }
 
         /// <summary>
@@ -157,6 +169,10 @@
                 throw Oops.Oh("娌℃湁鎵惧埌鎶ラ攢鍗�");
             if (data.ApprovalStatus != null && data.ApprovalStatus != PlanStatusType.unApproval)
                 throw Oops.Oh("鎶ラ攢鍗曞凡缁忔壒澶嶅畬姣�");
+            if(data.ApprovalStatus== PlanStatusType.Uncommitted)
+            {
+                throw Oops.Oh("鎶ラ攢鍗曟湭鎻愪氦涓嶅彲瀹℃壒");
+            }
             OaWorkPlanShenpi shenpi = data.OaWorkPlanShenpis.Where(x => x.ApprovalStaffId == Permissions.MemberId&&x.Buzhou==1).FirstOrDefault();
              if (shenpi!=null)
             {
@@ -167,7 +183,14 @@
             }
              else
             {
-              await   _SugarClient.AsTenant().BeginTranAsync();
+    
+
+                data.RewardResult = param.RewardResult;
+                data.PlanContent = param.PlanContent;
+                if (param.PlanMoney > 0 && param.PlanMoney <= data.PlanMoney)
+                    data.PlanMoney = param.PlanMoney;
+
+                await   _SugarClient.AsTenant().BeginTranAsync();
                 try
                 {
                     if (param.ApprovalStatus == PlanStatusType.No)

--
Gitblit v1.9.1