From 099c199d96f2d92dfcda50e763528a3d161fd5cf Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 15 九月 2025 08:45:34 +0800
Subject: [PATCH] 设计人员查询的时候,也过滤设计提成里边的设计人员 增加结算状态。 批量结算按钮完成
---
CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs | 482 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 468 insertions(+), 14 deletions(-)
diff --git a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
index 9b35b71..1eb2893 100644
--- a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
+++ b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
@@ -124,6 +124,15 @@
{
unitPricePar = new SqlParameter("@UnitPrice", DBNull.Value);
}
+ SqlParameter DeliveryTime = null;
+ if (trueModel.DeliveryTime.HasValue)
+ {
+ DeliveryTime = new SqlParameter("@DeliveryTime", trueModel.DeliveryTime);
+ }
+ else
+ {
+ DeliveryTime = new SqlParameter("@DeliveryTime", DBNull.Value);
+ }
IList<SqlParameter> sqlParms = new List<SqlParameter>()
{
new SqlParameter(){ ParameterName ="@Keyid", SqlDbType=System.Data.SqlDbType.Int, DbType=System.Data.DbType.Int32, Direction=ParameterDirection.Output},
@@ -131,7 +140,7 @@
new SqlParameter("@OrderTypeId",trueModel.OrderTypeId),
new SqlParameter("@PrintTypeId",trueModel.PrintTypeId),
new SqlParameter("@DocumentName",trueModel.DocumentName),
- new SqlParameter("@DeliveryTime",trueModel.DeliveryTime),
+ DeliveryTime,//new SqlParameter("@DeliveryTime",trueModel.DeliveryTime),
new SqlParameter("@SellerId",trueModel.SellerId),
new SqlParameter("@BuyerId",trueModel.BuyerId),
new SqlParameter("@SellerName",trueModel.SellerName){SqlDbType=SqlDbType.VarChar,Size=200},
@@ -178,6 +187,16 @@
{
unitPricePar = new SqlParameter("@UnitPrice", DBNull.Value);
}
+ SqlParameter DeliveryTime = null;
+ if (trueModel.DeliveryTime.HasValue)
+ {
+ DeliveryTime = new SqlParameter("@DeliveryTime", trueModel.DeliveryTime);
+ }
+ else
+ {
+ DeliveryTime = new SqlParameter("@DeliveryTime", DBNull.Value);
+ }
+
IList<SqlParameter> sqlParms = new List<SqlParameter>()
{
@@ -187,8 +206,8 @@
new SqlParameter("@SellerId",trueModel.SellerId),
new SqlParameter("@SellerName",trueModel.SellerName),
new SqlParameter("@DocumentName",trueModel.DocumentName),
- new SqlParameter("@DeliveryTime",trueModel.DeliveryTime),
- unitPricePar,
+ DeliveryTime,//new SqlParameter("@DeliveryTime",trueModel.DeliveryTime),
+ unitPricePar,
new SqlParameter("@SumPrice",trueModel.SumPrice),
new SqlParameter("@PayState",trueModel.PayState),
new SqlParameter("@Operator",trueModel.Operator),
@@ -272,6 +291,31 @@
}
return true;
}
+
+ /// <summary>
+ /// 鍒犻櫎澶栧崗璁㈠崟
+ /// </summary>
+ /// <param name="OrderId"></param>
+ /// <returns></returns>
+ public bool UpdateOldOrderSurplusPrintNum(int OrderId)
+ {
+ IList<SqlParameter> sqlParms = new List<SqlParameter>()
+ {
+ new SqlParameter("@Keyid",OrderId)
+ };
+ string sql = " Update [EC_OrderExtend] Set [SurplusPrintNum]=[PrintNum] where [Keyid] = (select [OrderId] from [OA_OrderWorkListRelation] where [RelationTargetId] = @Keyid and [RelationTypeId]=4 ) ;Update [EC_OrderBasic] Set [OrderState]=2 where [Keyid] = (select [OrderId] from [OA_OrderWorkListRelation] where [RelationTargetId] = @Keyid and [RelationTypeId]=4 ) ";
+
+ try
+ {
+ _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ return true;
+ }
+
/// <summary>
/// 鍒嗛〉鏌ヨ
@@ -609,7 +653,7 @@
if (string.IsNullOrEmpty(ssss.ToString()))
{
- ssss.Append("'4354654657568345429890'");
+ ssss.Append("'11111111-1111-1111-1111-111111111111'");
}
@@ -669,7 +713,10 @@
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},
+ new SqlParameter("@WorkStates",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=500},
+ new SqlParameter("@DeleverStates",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=500},
+
};
/*
@@ -753,9 +800,9 @@
}
}
/*鑾峰彇椤垫暟涓庤繑鍥炴暟鎹潯鏁�*/
- int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[31].Value);
+ int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[34].Value);
pagination.PageCount = resultValue.HasValue ? resultValue.Value : 0;
- resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[32].Value);
+ resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[35].Value);
pagination.RecordCount = resultValue.HasValue ? resultValue.Value : 0;
return result;
@@ -1008,7 +1055,9 @@
new SqlParameter("@businessManager",DBNull.Value){SqlDbType=SqlDbType.Int},
new SqlParameter("@payType",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20},
new SqlParameter("@returnvisit",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20},
- new SqlParameter("@appraise",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20}
+ new SqlParameter("@appraise",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20},
+ new SqlParameter("@Orderids",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=500}
+
};
/*
@@ -1075,9 +1124,9 @@
}
}
/*鑾峰彇椤垫暟涓庤繑鍥炴暟鎹潯鏁�*/
- int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[19].Value);
+ int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[20].Value);
pagination.PageCount = resultValue.HasValue ? resultValue.Value : 0;
- resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[20].Value);
+ resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[21].Value);
pagination.RecordCount = resultValue.HasValue ? resultValue.Value : 0;
return result;
@@ -1283,6 +1332,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>
@@ -1361,6 +1461,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>
@@ -1614,6 +1761,44 @@
}
}
+
+
+
+ /// <summary>
+ /// 淇敼璁㈠崟閫佽揣閲戦
+ /// </summary>
+ /// <param name="orderOperate">璁㈠崟鎿嶄綔</param>
+ /// <returns></returns>
+ internal bool UpdateOrderSonghuoJine(int OrderId,decimal? SonghuoJine)
+ {
+
+
+ _eC_OrderOperateDAL = null == _eC_OrderOperateDAL ? new EC_OrderOperateDAL(_dataBase) : _eC_OrderOperateDAL;
+ try
+ {
+
+ bool isWin = false;
+
+
+ IList<SqlParameter> sqlParms = new List<SqlParameter>()
+ {
+ new SqlParameter("@orderId",OrderId),
+ new SqlParameter("@SonghuoJine",SonghuoJine.HasValue?SonghuoJine.Value:0),
+
+ };
+ string sql = "Update [EC_OrderExtend] Set [SonghuoJine]=@SonghuoJine where [Keyid] =@orderId ";
+
+
+ _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
/// <summary>
/// 鏍规嵁鏂板璁㈠崟鎿嶄綔锛屽苟淇敼璁㈠崟鐘舵��
/// </summary>
@@ -1803,6 +1988,59 @@
}
+
+
+ /// <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);
+ 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>
@@ -1877,7 +2115,7 @@
if (string.IsNullOrEmpty(Keyids))
return null;//閿欒鏁版嵁杩斾細绌�
- IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>("*", "EC_OrderBasic", string.Format(" Keyid in ({0}) and SellerId ='{1}' order by SellerOrderId DESC ", Keyids, FirmId)) as IList<EC_OrderBasic>;//鎵ц鏌ヨ
+ IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>("*", "EC_OrderBasic", string.Format(" Keyid in ({0}) order by SellerOrderId DESC ", Keyids)) as IList<EC_OrderBasic>;//鎵ц鏌ヨ and SellerId ='{1}' , FirmId
return result;//杩斿洖缁撴灉
}
@@ -2426,7 +2664,8 @@
new SqlParameter(){ParameterName="@AppointCourierCompany",Value=awbInfo.AppointCourierCompany,SqlDbType=SqlDbType.VarChar,Size=50},
new SqlParameter(){ParameterName="@FetchAddress",Value=awbInfo.FetchAddress,SqlDbType=SqlDbType.VarChar,Size=200},
new SqlParameter(){ParameterName="@FetchContacts",Value=awbInfo.FetchContacts,SqlDbType=SqlDbType.VarChar,Size=50},
- new SqlParameter(){ParameterName="@FetchPhoneNum",Value=awbInfo.FetchPhoneNum,SqlDbType=SqlDbType.VarChar,Size=20}
+ new SqlParameter(){ParameterName="@FetchPhoneNum",Value=awbInfo.FetchPhoneNum,SqlDbType=SqlDbType.VarChar,Size=20},
+ new SqlParameter(){ParameterName="@SonghuoJine",Value=awbInfo.SonghuoJine.HasValue?awbInfo.SonghuoJine.Value:0,SqlDbType=SqlDbType.Money}
};
_dataBase.Query("sp_EC_AwbInfo_DeliverPresswork", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
isWin = 1.Equals(sqlParms[0].Value);
@@ -2443,6 +2682,17 @@
else
;
isWin = this.UpdateOrderStateUnit(awbInfo.Operate);//淇敼璁㈠崟鐘舵��
+ if (!isWin)
+ return false;
+ else
+ ;
+
+ if(awbInfo.Operate.OperateType == 5)
+ isWin = this.UpdateOrderSonghuoJine(awbInfo.Keyid.Value, awbInfo.SonghuoJine);//淇敼璁㈠崟鐘舵��
+ else
+ {
+ isWin = this.UpdateOrderSonghuoJine(awbInfo.Keyid.Value, 0);//淇敼璁㈠崟鐘舵��
+ }
if (!isWin)
return false;
else
@@ -2628,6 +2878,48 @@
}
}
+
+ /// <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>
+ /// <param name="orderId"></param>
+ public void UpdatePrintfengqianState(int orderId)
+ {
+ try
+ {
+ string sqlStr = string.Empty;
+ sqlStr = "UPDATE EC_OrderExtend SET IsPrintfengqian='true' WHERE Keyid=@orderId";
+ SqlParameter par = new SqlParameter("@orderId", orderId);
+ _dataBase.ExecuteSql(sqlStr, par);
+ }
+ catch
+ {
+
+ }
+ }
+
+
/// <summary>
/// 淇敼鎵撳嵃鐘舵��
/// </summary>
@@ -2661,8 +2953,9 @@
/// <param name="WorkStates"></param>
/// <param name="OutOrderId"></param>
/// <param name="RelationType"></param>
+ /// <param name="PayState"></param>
/// <returns></returns>
- public IEnumerable<EC_OrderBasic> SelectAferOfOutOrder(Infrastructure.Query.Pagination pagination, Guid MemberId, DateTime? StartCreatTime, DateTime? EndCreatTime, DateTime? StartReturnTime, DateTime? EndReturnTime, string Creater, string OutFirm, string WorkStates, string OutOrderId, int? RelationType)
+ public IEnumerable<EC_OrderBasic> SelectAferOfOutOrder(Infrastructure.Query.Pagination pagination, Guid MemberId, DateTime? StartCreatTime, DateTime? EndCreatTime, DateTime? StartReturnTime, DateTime? EndReturnTime, string Creater, string OutFirm, string WorkStates, string OutOrderId, int? RelationType, string PayState = null)
{
try
{
@@ -2673,6 +2966,9 @@
if (RelationType > 0)
condition += " and b.RelationTypeId = '" + RelationType + "' ";
+ if (!string.IsNullOrEmpty(PayState))
+ condition += " and a.PayState = " + PayState + " ";
+
if (StartCreatTime != null)
condition += " and a.CreateTime >= '" + StartCreatTime.Value + "' ";
@@ -2941,7 +3237,7 @@
if (deliverorderId==null || deliverorderId.Equals(Guid.Empty))
return null;//閿欒鏁版嵁杩斾細绌�
- IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>(" ob.*,oe.shifouDelivery,oe.DeliveryOrderId,oe.Kaipiaoshenqing,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,pt.PrintName as PrintTypeName ", "EC_OrderBasic ob Inner Join EC_OrderExtend as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) ", string.Format(" oe.DeliveryOrderId = '{0}' and ob.SellerId ='{1}' order by SellerOrderId DESC ", deliverorderId, FirmId)) as IList<EC_OrderBasic>;//鎵ц鏌ヨ
+ IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>(" ob.*,oe.printunit,oe.shifouDelivery,oe.DeliveryOrderId,oe.Kaipiaoshenqing,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,pt.PrintName as PrintTypeName ", "EC_OrderBasic ob Inner Join EC_OrderExtend as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) ", string.Format(" oe.DeliveryOrderId = '{0}' and ob.SellerId ='{1}' order by SellerOrderId DESC ", deliverorderId, FirmId)) as IList<EC_OrderBasic>;//鎵ц鏌ヨ
return result;//杩斿洖缁撴灉
}
@@ -2951,5 +3247,163 @@
}
}
+
+
+
+ /// <summary>
+ /// 鍒嗛〉鏌ヨ
+ /// </summary>
+ /// <param name="pagination"></param>
+ /// <param name="MemberId"></param>
+ /// <returns></returns>
+ public IEnumerable<Model.EC_OrderBasic> SelectModelPageSheji(Infrastructure.Query.Pagination pagination, Guid MemberId, string BeginCreateTime, string EndCreateTime, string SellerOrderId, string PrintTypeId, string BusinessManagerId, string Shejirenyuan, string BuyerName, string DocumentName, string ShejiStatus, string shifoujiesuan)
+ {
+ try
+ {
+ string condition = " 1=1 ";
+ if (MemberId != Guid.Empty)
+ {
+ var originalGuid = MemberId;
+ Guid reversedGuid = new Guid(originalGuid.ToByteArray().Reverse().ToArray());
+ condition += " and ob.SellerId = '" + reversedGuid + "'";
+ }
+
+
+
+ if (!string.IsNullOrEmpty(BeginCreateTime))
+ condition += string.Format(" and CAST(ob.CreateTime AS DATE) >='{0}'", BeginCreateTime);
+
+ if (!string.IsNullOrEmpty(EndCreateTime))
+ condition += string.Format(" and CAST(ob.CreateTime AS DATE) <='{0}'", EndCreateTime);
+
+ if (!string.IsNullOrEmpty(SellerOrderId))
+ condition += " and ob.SellerOrderId like '%" + SellerOrderId + "%'";
+
+ if (!string.IsNullOrEmpty(PrintTypeId))
+ {
+ condition += " and ob.PrintTypeId = " + PrintTypeId + "";
+ }
+ if (!string.IsNullOrEmpty(BusinessManagerId))
+ {
+ condition += " and oe.BusinessManagerId = " + BusinessManagerId + "";
+ }
+
+ if (!string.IsNullOrEmpty(BuyerName))
+ condition += " and ob.BuyerName like '%" + BuyerName + "%'";
+
+ if (!string.IsNullOrEmpty(DocumentName))
+ condition += " and ob.DocumentName like '%" + DocumentName + "%'";
+
+ if (!string.IsNullOrEmpty(ShejiStatus))
+ {
+ if(ShejiStatus == "1")
+ {
+ condition += " and oe.ShejiStatus = " + ShejiStatus + "";
+ }
+ else
+ {
+ condition += " and (oe.ShejiStatus is null or oe.ShejiStatus != 1) ";
+ }
+ }
+
+ if (!string.IsNullOrEmpty(shifoujiesuan))
+ {
+ if (shifoujiesuan == "1")
+ {
+ condition += " and oe.shifoujiesuan = " + shifoujiesuan + "";
+ }
+ else
+ {
+ condition += " and (oe.shifoujiesuan is null or oe.shifoujiesuan!= 1 ) ";
+ }
+ }
+
+
+
+ if (string.IsNullOrEmpty(Shejirenyuan))
+ {
+ string fromss = " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+ " where " + condition;
+ var ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.[ShejiSumPrice]) as ShejiSumPrice,sum(oe.ShejiSumPriceneiye) as ShejiSumPriceneiye ,sum(oe.ShejiSumPriceneiye1) as ShejiSumPriceneiye1,sum(oe.ShejiSumPriceneiye2) as ShejiSumPriceneiye2 ", fromss);
+ if (ssss.Count > 0)
+ {
+ var aaaaa = ssss.First();
+ pagination.heji1 = (aaaaa.ShejiSumPrice.HasValue ? aaaaa.ShejiSumPrice.Value : 0) + (aaaaa.ShejiSumPriceneiye.HasValue ? aaaaa.ShejiSumPriceneiye.Value : 0) + (aaaaa.ShejiSumPriceneiye1.HasValue ? aaaaa.ShejiSumPriceneiye1.Value : 0) + (aaaaa.ShejiSumPriceneiye2.HasValue ? aaaaa.ShejiSumPriceneiye2.Value : 0);
+
+ }
+ }
+ else
+ {
+ decimal heji1 = 0;
+ var condition1 = " and oe.Shejirenyuan = " + Shejirenyuan + " ";
+
+ string fromss = " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+ " where " + condition + condition1;
+ var ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.[ShejiSumPrice]) as ShejiSumPrice ", fromss);
+ if (ssss.Count > 0)
+ {
+ var aaaaa = ssss.First();
+ heji1 += (aaaaa.ShejiSumPrice.HasValue ? aaaaa.ShejiSumPrice.Value : 0);
+ }
+
+
+ condition1 = " and oe.Shejirenyuanneiye = " + Shejirenyuan + " ";
+
+ fromss = " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+ " where " + condition + condition1;
+ ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.ShejiSumPriceneiye) as ShejiSumPriceneiye ", fromss);
+ if (ssss.Count > 0)
+ {
+ var aaaaa = ssss.First();
+ heji1 += (aaaaa.ShejiSumPriceneiye.HasValue ? aaaaa.ShejiSumPriceneiye.Value : 0);
+
+ }
+
+
+ condition1 = " and oe.Shejirenyuanneiye1 = " + Shejirenyuan + " ";
+
+ fromss = " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+ " where " + condition + condition1;
+ ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.ShejiSumPriceneiye1) as ShejiSumPriceneiye1 ", fromss);
+ if (ssss.Count > 0)
+ {
+ var aaaaa = ssss.First();
+ heji1 += ( aaaaa.ShejiSumPriceneiye1.HasValue ? aaaaa.ShejiSumPriceneiye1.Value : 0);
+
+ }
+
+
+ condition1 = " and oe.Shejirenyuanneiye2 = " + Shejirenyuan + " ";
+
+ fromss = " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+ " where " + condition + condition1;
+ ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.ShejiSumPriceneiye2) as ShejiSumPriceneiye2 ", fromss);
+ if (ssss.Count > 0)
+ {
+ var aaaaa = ssss.First();
+ heji1 += (aaaaa.ShejiSumPriceneiye2.HasValue ? aaaaa.ShejiSumPriceneiye2.Value : 0) ;
+
+ }
+
+
+
+
+ pagination.heji1 = heji1;
+ }
+
+
+ if (!string.IsNullOrEmpty(Shejirenyuan))
+ {
+ condition += " and ( oe.Shejirenyuan = " + Shejirenyuan + " or oe.Shejirenyuanneiye = " + Shejirenyuan + " or oe.Shejirenyuanneiye1 = " + Shejirenyuan + " or oe.Shejirenyuanneiye2 = " + Shejirenyuan + " )";
+ }
+
+ return _dataBase.SelectModelPage<Model.EC_OrderBasic>(pagination, " ob.*,oe.BusinessManagerId,oe.shifouDelivery,oe.IsPrintfengqian,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,oe.Duiyinghetongbianhao,oe.[Shejirenyuan],oe.[Shejileixing] ,oe.[Danshuangmian],oe.[Shejirenyuanneiye],oe.[Shejileixingneiye],oe.[Danshuangmianneiye],oe.[Shejiyaoqiu],oe.[Shejiyaoqiuneiye],oe.[ShejirenyuanName],oe.[ShejirenyuanNameneiye],oe.[ShejiStatus],oe.[shifoujiesuan],oe.[ShejileixingName],oe.[ShejileixingNameneiye],oe.[ShejiUnitPrice] ,oe.[ShejiSumPrice],oe.[ShejiUnitPriceneiye],oe.[ShejiSumPriceneiye] ,oe.[Shejicount],oe.[Shejicountneiye],oe.[ShejiUnitPriceneiye1] ,oe.[ShejiSumPriceneiye1] ,oe.[Shejicountneiye1] ,oe.[ShejiUnitPriceneiye2] ,oe.[ShejiSumPriceneiye2] ,oe.[Shejicountneiye2] ,oe.[Shejirenyuanneiye1] ,oe.[ShejirenyuanNameneiye1] ,oe.[Shejileixingneiye1] ,oe.[ShejileixingNameneiye1] ,oe.[Danshuangmianneiye1] ,oe.[Shejiyaoqiuneiye1],oe.[Shejirenyuanneiye2],oe.[ShejirenyuanNameneiye2],oe.[Shejileixingneiye2] ,oe.[ShejileixingNameneiye2],oe.[Danshuangmianneiye2],oe.[Shejiyaoqiuneiye2] ,pt.PrintName as PrintTypeName ", " EC_OrderBasic as ob Inner Join [EC_OrderExtend] as oe On ob.Keyid=oe.Keyid Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) ", " ob.CreateTime desc", " CreateTime desc ", condition);
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
}
}
--
Gitblit v1.9.1