From 176106cf1be8bb0dfd9921180b26d7cc9efb7a3d Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 16 十二月 2024 08:52:39 +0800
Subject: [PATCH] 外协付款申请功能

---
 CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs |  180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 177 insertions(+), 3 deletions(-)

diff --git a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
index 4795903..eb206e8 100644
--- a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
+++ b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
@@ -688,7 +688,8 @@
                      new SqlParameter("@KaipiaoshenqingId",DBNull.Value){SqlDbType=SqlDbType.UniqueIdentifier},
                      new SqlParameter("@buyerId",DBNull.Value){SqlDbType=SqlDbType.UniqueIdentifier},
                      new SqlParameter("@DocumentName",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=50},
-                     
+                     new SqlParameter("@Orderids",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=500},
+
             };
 
             /*
@@ -772,9 +773,9 @@
                 }
             }
             /*鑾峰彇椤垫暟涓庤繑鍥炴暟鎹潯鏁�*/
-            int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[31].Value);
+            int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[32].Value);
             pagination.PageCount = resultValue.HasValue ? resultValue.Value : 0;
-            resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[32].Value);
+            resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[33].Value);
             pagination.RecordCount = resultValue.HasValue ? resultValue.Value : 0;
 
             return result;
@@ -1302,6 +1303,57 @@
 
         }
 
+
+
+        /// <summary>
+        /// 浣滀笟鏈�佽揣鍒嗛〉鏌ヨ
+        /// </summary>
+        /// <param name="pagination"></param>
+        /// <returns></returns>
+        public IEnumerable<EC_OrderBasic> SelectModelPageWorkBook(Infrastructure.Query.Pagination pagination, Guid _MemberID, string txtBeginDate, string txtEndDate, string txtOrderId, string txtSearchyjname, string selCustormerManager, string selBusinessManager, string selOrderStates)
+        {
+            try
+            {
+                string condition = "  ob.PrintTypeId = 37 ";
+
+                if (_MemberID != Guid.Empty)
+                    condition += " and ob.SellerId = '" + _MemberID + "'";
+
+                if (!string.IsNullOrEmpty(txtBeginDate))
+                    condition += string.Format(" and CAST(ob.CreateTime AS DATE) >='{0}'", txtBeginDate);
+
+                if (!string.IsNullOrEmpty(txtEndDate))
+                {
+                  var EndDate = txtEndDate.ToDateTime2().Value.AddDays(1).ToShortDateString();
+                        condition += string.Format(" and CAST(ob.CreateTime AS DATE) <='{0}'", EndDate);
+                }
+                    
+
+                if (!string.IsNullOrEmpty(txtOrderId))
+                    condition += " and ob.SellerOrderId like '%" + txtOrderId + "%'";
+
+                if (!string.IsNullOrEmpty(txtSearchyjname))
+                    condition += " and ob.DocumentName like '%" + txtSearchyjname + "%'";
+
+                if (!string.IsNullOrEmpty(selCustormerManager))
+                    condition += " and oe.CustomerManagerId = '" + selCustormerManager + "'";
+
+                if (!string.IsNullOrEmpty(selBusinessManager))
+                    condition += " and oe.BusinessManagerId = '" + selBusinessManager + "'";
+
+                if (!string.IsNullOrEmpty(selOrderStates))
+                    condition += " and ob.OrderState = '" + selOrderStates + "'";
+
+ 
+
+                return _dataBase.SelectModelPage<EC_OrderBasic>(pagination, " ob.*,oe.shifouDelivery,oe.DeliveryOrderId,oe.KaipiaoshenqingCreater,oe.KaipiaoshenqingTime,oe.KaipiaoquerenCreater,oe.KaipiaoquerenTime,oe.Kehuqianshou,oe.KehuqianshouCreater,oe.KehuqianshouTime   ,oe.Quchudingdan,oe.QuchudingdanCreater,oe.QuchudingdanTime,oe.PrintPackDeliveryRequir,oe.PrintNum,oe.ExigencyCaseId,opy.Name as yssldw ", " EC_OrderBasic as ob Inner Join EC_OrderExtend as oe On(ob.Keyid=oe.Keyid) Left Join Sys_Dictionary as opy On (opy.DicType='鍗板埛鍗曚綅' And  opy.MeanValue = oe.printunit )   ", " ob.Keyid DESC ", " Keyid DESC ", condition);
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
         /// <summary>
         /// 鍗曚釜鏌ヨ
         /// </summary>
@@ -1380,6 +1432,53 @@
                 throw ex;
             }
 
+        }
+
+
+
+        /// <summary>
+        /// 閿佸崟璁㈠崟
+        /// </summary>
+        /// <param name="orderId">璁㈠崟缂栧彿</param>
+        /// <param name="operater">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        public bool SuodingOrder(int orderId, string operater)
+        {
+            if (0 >= orderId || 0 >= orderId)
+            {
+                return false;
+            }
+            else
+            {
+            }
+           
+            IList<SqlParameter> sqlParms = new List<SqlParameter>()
+            {
+                  
+                    new SqlParameter("@SuodanState",true),
+                    new SqlParameter("@SuodanTime",DateTime.Now),
+                     new SqlParameter("@SuodanOperator",operater),
+                        new SqlParameter("@Keyid",orderId),
+            };
+            IList<SqlParameter> sqlParms1 = new List<SqlParameter>()
+            {
+                        new SqlParameter("@Keyid",orderId),
+            };
+            try
+            {
+                string sql = "Update EC_OrderBasic Set [SuodanState]=@SuodanState,[SuodanTime]=@SuodanTime,[SuodanOperator]=@SuodanOperator  where [Keyid] =@Keyid ";
+                _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+                
+                string sql1 = "Update CoreCmsPlanOrder Set [status]=2  where [orderkeyid] =@Keyid ";
+                _dataBase.ExecuteSql(sql1, sqlParms1.ToArray<SqlParameter>());
+
+
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return true;
         }
 
         /// <summary>
@@ -1794,6 +1893,59 @@
                         else
                             ;
                     }
+
+                    //鏇存柊璁㈠崟鏀粯閲戦
+                    isWin = this.UpdateOrderPayedMoney(orderId, -1, firmAccountRecord.Money.Value);
+                    if (!isWin)
+                    {
+                        return isWin;
+                    }
+                    else
+                        ;
+                    //鏇存柊璁㈠崟鐘舵��
+                    isWin = this.UpdateOrderPayState(orderId);
+                    if (!isWin)
+                    {
+                        return isWin;
+                    }
+                    else
+                        ;
+                    tran.Complete();
+                }
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return isWin;
+
+        }
+
+
+
+        /// <summary>
+        /// 鏀舵(绾夸笅杞处銆佺幇閲�)
+        /// </summary>
+        /// <param name="orderId">璁㈠崟缂栧彿</param>
+        /// <param name="firmAccountRecord">鎿嶄綔璁板綍</param>
+        /// <returns></returns>
+        public bool ReceiveMoneyToQueren(int orderId, OA_FirmAccountRecord firmAccountRecord)
+        {
+            bool isWin = false;
+            if (0 >= orderId  || !firmAccountRecord.Money.HasValue)
+                return false;
+            else
+                ;
+            if ( 0 > firmAccountRecord.Money.Value)
+                return false;
+            else
+                ;
+            try
+            {
+                OA_FirmAccountRecordDAL oA_FirmAccountRecordDAL = new OA_FirmAccountRecordDAL(_dataBase);
+                using (TransactionScope tran = new TransactionScope())
+                {
+                    
 
                     //鏇存柊璁㈠崟鏀粯閲戦
                     isWin = this.UpdateOrderPayedMoney(orderId, -1, firmAccountRecord.Money.Value);
@@ -2647,6 +2799,28 @@
             }
         }
 
+
+        /// <summary>
+        /// 淇敼鎵撳嵃鐘舵��
+        /// </summary>
+        /// <param name="orderId"></param>
+        public bool Updatejinedanjia(int orderId, decimal SumPrice, decimal UnitPrice,int num)
+        {
+            try
+            {
+                string sqlStr = string.Empty;
+                sqlStr = "UPDATE EC_OrderBasic SET SumPrice="+ SumPrice + " ,UnitPrice="+ UnitPrice + " WHERE Keyid=@orderId;UPDATE [EC_OrderExtend] SET [PrintNum]=" + num + "  WHERE Keyid="+ orderId ;
+                SqlParameter par = new SqlParameter("@orderId", orderId);
+                _dataBase.ExecuteSql(sqlStr, par);
+            }
+            catch
+            {
+
+            }
+
+            return true;
+        }
+
         /// <summary>
         /// 淇敼鎵撳嵃鐘舵��
         /// </summary>

--
Gitblit v1.9.1