| | |
| | | /// <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) |
| | | 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 |
| | | { |
| | |
| | | { |
| | | condition += " and oe.BusinessManagerId = " + BusinessManagerId + ""; |
| | | } |
| | | if (!string.IsNullOrEmpty(Shejirenyuan)) |
| | | { |
| | | condition += " and ( oe.Shejirenyuan = " + Shejirenyuan + " or oe.Shejirenyuanneiye = " + Shejirenyuan + " )"; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(BuyerName)) |
| | | condition += " and ob.BuyerName like '%" + BuyerName + "%'"; |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | condition += " and oe.ShejiStatus != 1 "; |
| | | condition += " and (oe.ShejiStatus is null or oe.ShejiStatus != 1) "; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询来源 |
| | | /// </summary> |
| | | 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) |
| | | if (!string.IsNullOrEmpty(shifoujiesuan)) |
| | | { |
| | | var aaaaa = ssss.First(); |
| | | pagination.heji1 = (aaaaa.ShejiSumPrice + aaaaa.ShejiSumPriceneiye + (aaaaa.ShejiSumPriceneiye1.HasValue? aaaaa.ShejiSumPriceneiye1.Value:0) + (aaaaa.ShejiSumPriceneiye2.HasValue ? aaaaa.ShejiSumPriceneiye2.Value : 0) ) ??0; |
| | | |
| | | if (shifoujiesuan == "1") |
| | | { |
| | | condition += " and oe.shifoujiesuan = " + shifoujiesuan + ""; |
| | | } |
| | | else |
| | | { |
| | | condition += " and (oe.shifoujiesuan is null or oe.shifoujiesuan!= 1 ) "; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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.[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); |
| | | 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) |
| | | { |