Commit 410d2507 authored by 吴春's avatar 吴春
parents ec0d21b6 b0b93ade
...@@ -3720,7 +3720,7 @@ namespace Mall.Module.Product ...@@ -3720,7 +3720,7 @@ namespace Mall.Module.Product
}); });
} }
goods_OrderRepository.DBSession.Commit(); goods_OrderRepository.DBSession.Commit();
return ApiResult.Success("", new { OrderId, demodel.OrderNo }); return ApiResult.Success("", new { OrderId });
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -7219,6 +7219,13 @@ namespace Mall.Module.Product ...@@ -7219,6 +7219,13 @@ namespace Mall.Module.Product
if (financeConfigurineList != null && financeConfigurineList.Any()) if (financeConfigurineList != null && financeConfigurineList.Any())
{ {
var item = financeConfigurineList.FirstOrDefault(); var item = financeConfigurineList.FirstOrDefault();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = dmodel.OrderId ?? 0 });
string Remark1 = "";
if (dlist.Any()) {
foreach (var qqitem in dlist) {
Remark1 += qqitem.GoodsName + " " + qqitem.Specification + " ";
}
}
var detailList = new List<object>() { var detailList = new List<object>() {
new new
{ {
...@@ -7226,11 +7233,10 @@ namespace Mall.Module.Product ...@@ -7226,11 +7233,10 @@ namespace Mall.Module.Product
Number = 1, Number = 1,
OriginalMoney = Money, OriginalMoney = Money,
UnitPrice = Money, UnitPrice = Money,
Remark = "订单号:" + omodel.OrderNo + "售后单号:" + (dmodel.ReOrderNo ?? "暂无") + " " + dstr Remark = Remark1 + "单号:" + omodel.OrderNo + "售后单号:" + (dmodel.ReOrderNo ?? "暂无") + " " + dstr
} }
}; };
List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>(); List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = dmodel.OrderId ?? 0 });
foreach (var qitem in dlist) foreach (var qitem in dlist)
{ {
ECList.Add(new RB_ECFinanceId_Relation() ECList.Add(new RB_ECFinanceId_Relation()
...@@ -7254,7 +7260,7 @@ namespace Mall.Module.Product ...@@ -7254,7 +7260,7 @@ namespace Mall.Module.Product
TemplateId = item.WorkFlowId, TemplateId = item.WorkFlowId,
OrderSource = 16, OrderSource = 16,
OtherType = 23, OtherType = 23,
ReFinanceId = dmodel.ReOrderId, ReFinanceId = dmodel.OrderId ?? 0,
Remark = "名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据(erp订单)", Remark = "名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据(erp订单)",
detailList, detailList,
RB_Depart_Id = Config.ExpendDepartment, RB_Depart_Id = Config.ExpendDepartment,
...@@ -8303,6 +8309,13 @@ namespace Mall.Module.Product ...@@ -8303,6 +8309,13 @@ namespace Mall.Module.Product
if (financeConfigurineList != null && financeConfigurineList.Any()) if (financeConfigurineList != null && financeConfigurineList.Any())
{ {
var item = financeConfigurineList.FirstOrDefault(); var item = financeConfigurineList.FirstOrDefault();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = omodel.OrderId });
string Remark1 = "";
if (dlist.Any()) {
foreach (var qqitem in dlist) {
Remark1 += qqitem.GoodsName + " " + qqitem.Specification + " ";
}
}
var detailList = new List<object>() { var detailList = new List<object>() {
new new
{ {
...@@ -8310,7 +8323,7 @@ namespace Mall.Module.Product ...@@ -8310,7 +8323,7 @@ namespace Mall.Module.Product
Number = 1, Number = 1,
OriginalMoney = Money, OriginalMoney = Money,
UnitPrice = Money, UnitPrice = Money,
Remark = "订单号:" + omodel.OrderNo + " " + dstr Remark = Remark1 + "单号:" + omodel.OrderNo + " " + dstr
} }
}; };
...@@ -8321,7 +8334,6 @@ namespace Mall.Module.Product ...@@ -8321,7 +8334,6 @@ namespace Mall.Module.Product
Remark = "后台强制取消该订单,用户名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + " 自动生成财务单据(ERP下单)"; Remark = "后台强制取消该订单,用户名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + " 自动生成财务单据(ERP下单)";
} }
List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>(); List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = omodel.OrderId });
foreach (var qitem in dlist) foreach (var qitem in dlist)
{ {
ECList.Add(new RB_ECFinanceId_Relation() ECList.Add(new RB_ECFinanceId_Relation()
......
...@@ -1102,53 +1102,52 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use ...@@ -1102,53 +1102,52 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{ {
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
where += string.Format(" AND TenantId={0} ", query.TenantId); where += string.Format(" AND A.TenantId={0} ", query.TenantId);
} }
if (query.MallBaseId > 0) if (query.MallBaseId > 0)
{ {
where += string.Format(" AND MallBaseId={0} ", query.MallBaseId); where += string.Format(" AND A.MallBaseId={0} ", query.MallBaseId);
} }
if (!string.IsNullOrWhiteSpace(query.UserIds)) if (!string.IsNullOrWhiteSpace(query.UserIds))
{ {
where += string.Format(" AND UserId IN({0}) ", query.UserIds); where += string.Format(" AND A.UserId IN({0}) ", query.UserIds);
} }
if (query.Id > 0) if (query.Id > 0)
{ {
where += string.Format(" AND UserId IN({0}) ", query.Id); where += string.Format(" AND A.UserId IN({0}) ", query.Id);
} }
} }
if (IsGetCurrentMonth) if (IsGetCurrentMonth)
{ {
where += string.Format(" AND DATE_FORMAT(CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') ", DateTime.Now.ToString("yyyy-MM-dd")); where += string.Format(" AND DATE_FORMAT(A.CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') ", DateTime.Now.ToString("yyyy-MM-dd"));
} }
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT UserId AS Id,IsRemit,SUM(A.Commission) AS Commission SELECT UserId AS Id,IsRemit,SUM(A.Commission) AS Commission
FROM FROM
( (
SELECT UserId,SUM(Commission) AS Commission,IsRemit SELECT A.UserId,SUM(A.Commission) AS Commission,A.IsRemit
FROM rb_goods_ordercommission FROM rb_goods_ordercommission AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE UserId>0 {0} WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY UserId GROUP BY A.UserId
UNION ALL UNION ALL
SELECT UserId,SUM(Commission) AS Commission,RemitStatus AS IsRemit SELECT A.UserId,SUM(A.Commission) AS Commission,A.RemitStatus AS IsRemit
FROM rb_goods_orderintroduction FROM rb_goods_orderintroduction AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE UserId>0 {0} WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY UserId,RemitStatus GROUP BY A.UserId,A.RemitStatus
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_vipbuy_commission
WHERE UserId>0 {0}
GROUP BY UserId,IsRemit
UNION ALL UNION ALL
SELECT A.UserId,SUM(A.Commission) AS Commission,IsRemit
SELECT UserId,SUM(Commission) AS Commission,IsRemit FROM rb_vipbuy_commission AS A
FROM rb_smallshops_commission WHERE 1=1 {0}
WHERE UserId>0 {0} GROUP BY A.UserId,A.IsRemit
GROUP BY UserId,IsRemit
UNION ALL
SELECT A.UserId,SUM(A.Commission) AS Commission,A.IsRemit
FROM rb_smallshops_commission AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId,A.IsRemit
) AS A GROUP BY UserId,IsRemit ) AS A GROUP BY UserId,IsRemit
", where); ", where);
return Get<RB_Member_User_Extend>(builder.ToString()).ToList(); return Get<RB_Member_User_Extend>(builder.ToString()).ToList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment