| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 新增 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public bool InserModelsheji(Infrastructure.Domain.IAggregateRoot model) |
| | | { |
| | | Model.EC_OrderBasic trueModel = model as Model.EC_OrderBasic; |
| | | if (trueModel == null) |
| | | { |
| | | return false; |
| | | } |
| | | SqlParameter unitPricePar = null; |
| | | if (trueModel.UnitPrice.HasValue) |
| | | { |
| | | unitPricePar = new SqlParameter("@UnitPrice", trueModel.UnitPrice); |
| | | } |
| | | else |
| | | { |
| | | 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}, |
| | | new SqlParameter(){ ParameterName="@SellerOrderId",SqlDbType=System.Data.SqlDbType.VarChar,Size=25,DbType=System.Data.DbType.String, Direction=ParameterDirection.Output}, |
| | | new SqlParameter("@OrderTypeId",trueModel.OrderTypeId), |
| | | new SqlParameter("@PrintTypeId",trueModel.PrintTypeId), |
| | | new SqlParameter("@DocumentName",trueModel.DocumentName), |
| | | 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}, |
| | | new SqlParameter("@BuyerName",trueModel.BuyerName){SqlDbType=SqlDbType.VarChar,Size=200}, |
| | | unitPricePar, |
| | | new SqlParameter("@SumPrice",trueModel.SumPrice), |
| | | new SqlParameter("@Creater",trueModel.Creater), |
| | | new SqlParameter("@Operator",trueModel.Operator), |
| | | new SqlParameter("@Remark",trueModel.Remark??"") , |
| | | new SqlParameter("@OutId",(trueModel.OutId==null ? "0":trueModel.OutId.ToString())) |
| | | }; |
| | | try |
| | | { |
| | | _dataBase.Query("sp_EC_OrderBasic_Insertsheji", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>()); |
| | | trueModel.Keyid = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[0].Value); |
| | | trueModel.SellerOrderId = CY.Infrastructure.Common.MyConvert.ConvertToString(sqlParms[1].Value); |
| | | return trueModel.Keyid.HasValue; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改 |
| | | /// </summary> |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public bool DeleteModelsheji(Infrastructure.Domain.IAggregateRoot model) |
| | | { |
| | | Model.EC_OrderBasic trueModel = model as Model.EC_OrderBasic; |
| | | if (trueModel == null) |
| | | { |
| | | return false; |
| | | } |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | | new SqlParameter("@Keyid",trueModel.Keyid) |
| | | }; |
| | | try |
| | | { |
| | | |
| | | _eC_OrderOperateDAL = null == _eC_OrderOperateDAL ? new EC_OrderOperateDAL(_dataBase) : _eC_OrderOperateDAL; |
| | | bool isWin = _eC_OrderOperateDAL.InserModel(new EC_OrderOperate() |
| | | { |
| | | OrderId = trueModel.Keyid, |
| | | OperateType = 0, |
| | | Remark = "终止订单", |
| | | Operator = trueModel.Operator |
| | | }); |
| | | if (!isWin) |
| | | return false; |
| | | else |
| | | ; |
| | | _dataBase.Query("sp_EC_OrderBasic_DeleteRowsheji", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>()); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除外协订单 |
| | |
| | | |
| | | if (string.IsNullOrEmpty(ssss.ToString())) |
| | | { |
| | | ssss.Append("'4354654657568345429890'"); |
| | | ssss.Append("'11111111-1111-1111-1111-111111111111'"); |
| | | } |
| | | |
| | | |
| | |
| | | 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}, |
| | | |
| | | }; |
| | | |
| | |
| | | } |
| | | } |
| | | /*获取页数与返回数据条数*/ |
| | | int? resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[32].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[33].Value); |
| | | resultValue = CY.Infrastructure.Common.MyConvert.ConvertToInt32(sqlParms[35].Value); |
| | | pagination.RecordCount = resultValue.HasValue ? resultValue.Value : 0; |
| | | |
| | | return result; |
| | |
| | | new SqlParameter("@createTimeEnd",DBNull.Value){SqlDbType=SqlDbType.Date}, |
| | | new SqlParameter("@printType",DBNull.Value){SqlDbType=SqlDbType.Int}, |
| | | new SqlParameter("@orderType",DBNull.Value){SqlDbType=SqlDbType.Int}, |
| | | new SqlParameter("@orderState",DBNull.Value){SqlDbType=SqlDbType.Int}, |
| | | new SqlParameter("@orderState",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20}, |
| | | new SqlParameter("@orderPayState",DBNull.Value){SqlDbType=SqlDbType.Int}, |
| | | new SqlParameter("@creater",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20}, |
| | | new SqlParameter("@customerLevel",DBNull.Value){SqlDbType=SqlDbType.Int}, |
| | |
| | | /// </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) |
| | | 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, string BuyerName) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (!string.IsNullOrEmpty(txtSearchyjname)) |
| | | condition += " and ob.DocumentName like '%" + txtSearchyjname + "%'"; |
| | | |
| | | if (!string.IsNullOrEmpty(BuyerName)) |
| | | condition += " and ob.BuyerName like '%" + BuyerName + "%'"; |
| | | |
| | | if (!string.IsNullOrEmpty(selCustormerManager)) |
| | | condition += " and oe.CustomerManagerId = '" + selCustormerManager + "'"; |
| | | |
| | |
| | | condition += " and oe.BusinessManagerId = '" + selBusinessManager + "'"; |
| | | |
| | | if (!string.IsNullOrEmpty(selOrderStates)) |
| | | condition += " and ob.OrderState = '" + selOrderStates + "'"; |
| | | { |
| | | if(selOrderStates == "0") |
| | | { |
| | | condition += " and ob.OrderState in (1,2,3,4)"; |
| | | } |
| | | else if (selOrderStates == "1") |
| | | { |
| | | condition += " and ob.OrderState in ( 5,6,-1)"; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据类型查询 订单 |
| | | /// </summary> |
| | | /// <param name="orderId">订单编号</param> |
| | | /// <returns></returns> |
| | | public IEnumerable<EC_OrderBasic> GetOrderByPrintTypeId(int PrintTypeId) |
| | | { |
| | | |
| | | IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>(" * ", "EC_OrderBasic ", string.Format(" PrintTypeId = {0} and OrderState = 4 ", PrintTypeId)); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据客户ID和订单支付状态获取订单列表 |
| | | /// </summary> |
| | | /// <param name="BuyerId">卖家ID</param> |
| | | /// <returns></returns> |
| | | public IList<EC_OrderBasic> GetOrderById(Guid BuyerId, int PayState) |
| | | public IList<EC_OrderBasic> GetOrderById(Guid BuyerId, int PayState, Guid SellerId) |
| | | { |
| | | IList<EC_OrderBasic> result = new List<EC_OrderBasic>(); |
| | | |
| | | result = _dataBase.SelectModel<EC_OrderBasic>(" * ", "EC_OrderBasic ", string.Format(" BuyerId = '{0}' and PayState!={1}", BuyerId,PayState)); |
| | | result = _dataBase.SelectModel<EC_OrderBasic>(" * ", "EC_OrderBasic ", string.Format(" BuyerId = '{0}' and PayState!={1} and SellerId = '{2}'", BuyerId,PayState, SellerId)); |
| | | return result; |
| | | } |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据编号获取订单信息 |
| | | /// </summary> |
| | | /// <param name="orderId">订单唯一编号</param> |
| | | /// <returns></returns> |
| | | public EC_OrderBasic SelectModelByxiadanId(int orderId) |
| | | { |
| | | if (0 >= orderId) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | } |
| | | string condition = " "; |
| | | if (orderId > 0) |
| | | { |
| | | condition = " b.[XiadanKeyid]=" + orderId + ""; |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>("a.*", " EC_OrderBasic a inner join [EC_OrderExtend] b on a.[Keyid] = b.[Keyid] ", condition) as IList<EC_OrderBasic>;//执行查询 |
| | | |
| | | return (null == result || result.Count == 0) ? null : result[0];//返回结果 |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据订单编号获取订单 |
| | | /// </summary> |
| | | /// <param name="orderIds">订单编号</param> |
| | |
| | | }; |
| | | _dataBase.Query("sp_Order_UpdateOrderState", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>()); |
| | | return isWin = 1.Equals(sqlParms[2].Value); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <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) |
| | | { |
| | |
| | | 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;//返回结果 |
| | | } |
| | |
| | | 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); |
| | |
| | | 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 |
| | |
| | | /// <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 |
| | | { |
| | |
| | | |
| | | 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 + "' "; |
| | | |
| | | if (EndCreatTime != null) |
| | | condition += " and a.CreateTime =< '" + EndCreatTime.Value.AddDays(1) + "' "; |
| | | condition += " and a.CreateTime <= '" + EndCreatTime.Value.AddDays(1) + "' "; |
| | | |
| | | if (StartReturnTime != null) |
| | | condition += " and d.DeliverTime >= '" + StartReturnTime.Value + "' "; |
| | |
| | | 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;//返回结果 |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |