Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
9c58b922
Commit
9c58b922
authored
Aug 28, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
c911c796
abf6fc18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
212 additions
and
56 deletions
+212
-56
RB_Goods_OrderDetail_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
+4
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+44
-14
RB_Goods_OrderAfterSaleRepository.cs
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
+4
-2
RB_Goods_OrderDetailRepository.cs
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
+61
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+29
-0
FinanceModule.cs
Mall.WindowsService/Module/FinanceModule.cs
+70
-40
No files found.
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
View file @
9c58b922
...
...
@@ -14,6 +14,10 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_OrderDetail_Extend
:
RB_Goods_OrderDetail
{
/// <summary>
/// 用户id
/// </summary>
public
int
?
UserId
{
get
;
set
;
}
/// <summary>
/// 订单财务单据列表
/// </summary>
...
...
Mall.Module.Product/OrderModule.cs
View file @
9c58b922
...
...
@@ -760,7 +760,7 @@ namespace Mall.Module.Product
if
(
dlist
.
Any
())
{
string
orderDetailIds
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
Id
));
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetailIds
=
orderDetailIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetailIds
=
orderDetailIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}
,
false
);
foreach
(
var
item
in
dlist
)
{
item
.
CoverImagePath
=
item
.
CoverImage
;
...
...
@@ -5485,7 +5485,7 @@ namespace Mall.Module.Product
int
Rstr
=
R
.
Next
(
111
,
999
);
demodel
.
ReOrderNo
=
"RE"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)
+
Rstr
;
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetialId
=
demodel
.
OrderDetialId
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetialId
=
demodel
.
OrderDetialId
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}
,
false
);
if
(
oasList
.
Any
())
{
return
false
;
...
...
@@ -8468,7 +8468,11 @@ namespace Mall.Module.Product
decimal
TotalCommission
=
0
,
OldCommission
=
0
;
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
TotalCommission
+=
(
item
.
Commission
??
0
);
var
afterSaleList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetialId
=
item
.
OrderDetailId
,
Type
=
1
,
MallBaseId
=
mallBaseId
,
TenantId
=
tenantId
});
if
(!
afterSaleList
.
Any
())
{
TotalCommission
+=
(
item
.
Commission
??
0
);
}
}
#
region
看微店佣金是否是负数
是的话
需要走总佣金里减去
OldCommission
=
TotalCommission
;
...
...
@@ -8639,36 +8643,41 @@ namespace Mall.Module.Product
var
smallModel
=
smallShops_InfoRepository
.
GetList
(
new
RB_SmallShops_Info_Extend
()
{
UserId
=
ssmodel
.
UserId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
foreach
(
var
item
in
ssList
.
Where
(
x
=>
x
.
CommissionState
==
1
))
{
if
(
smallModel
!=
null
&&
smallModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
//查询是否有申请退款
var
afterSaleList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetialId
=
item
.
OrderDetailId
,
Type
=
1
,
MallBaseId
=
mallBaseId
,
TenantId
=
tenantId
});
if
(!
afterSaleList
.
Any
())
{
//更新微店佣金
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
if
(
smallModel
!=
null
&&
smallModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
{
//更新微店佣金
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info_Extend
.
TotalCommission
),(
smallModel
.
TotalCommission
??
0
)+(
item
.
Commission
??
0
)},
{
nameof
(
RB_SmallShops_Info_Extend
.
Commission
),(
smallModel
.
Commission
??
0
)+(
item
.
Commission
??
0
)},
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Info_Extend
.
Id
),
FiledValue
=
smallModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag1
=
smallShops_InfoRepository
.
Update
(
keyValues2
,
wheres2
);
if
(
flag1
)
{
//更新返佣状态
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
bool
flag1
=
smallShops_InfoRepository
.
Update
(
keyValues2
,
wheres2
);
if
(
flag1
)
{
//更新返佣状态
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Commission_Extend
.
CommissionState
),
2
},
{
nameof
(
RB_SmallShops_Commission_Extend
.
UpdateDate
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Commission_Extend
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
smallShops_CommissionRepository
.
Update
(
keyValues1
,
wheres1
);
smallShops_CommissionRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
}
...
...
@@ -9680,6 +9689,27 @@ namespace Mall.Module.Product
return
list
;
}
/// <summary>
/// 获取待评论商品列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetAppletGoodsWaitCommentPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderDetail_Extend
demodel
)
{
var
list
=
goods_OrderDetailRepository
.
GetAppletGoodsWaitCommentPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
foreach
(
var
item
in
list
)
{
item
.
SpecificationList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Specification
)
&&
item
.
Specification
!=
"[]"
)
{
item
.
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
Specification
);
}
}
return
list
;
}
/// <summary>
/// 获取订单评价列表
/// </summary>
...
...
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
View file @
9c58b922
...
...
@@ -151,10 +151,12 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetList
(
RB_Goods_OrderAfterSale_Extend
dmodel
)
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetList
(
RB_Goods_OrderAfterSale_Extend
dmodel
,
bool
IsNormal
=
true
)
{
string
where
=
$" where 1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
if
(
IsNormal
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
<>
{(
int
)
Common
.
Enum
.
Goods
.
OrderAfterSaleStatusEnum
.
Rejected
}
"
;
}
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
...
...
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
View file @
9c58b922
...
...
@@ -526,5 +526,66 @@ INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where
{
where
}
order by o.CreateDate desc"
;
return
GetPage
<
RB_Goods_OrderDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取待评论商品列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetAppletGoodsWaitCommentPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderDetail_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderDetailIds
))
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
Id
)}
in(
{
dmodel
.
OrderDetailIds
}
)"
;
}
if
(
dmodel
.
OrderId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
if
(
dmodel
.
OrderType
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
OrderType
)}
=
{(
int
)
dmodel
.
OrderType
}
"
;
}
if
(
dmodel
.
IsComment
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
IsComment
)}
=
{(
int
)
dmodel
.
IsComment
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsName
))
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
GoodsName
)}
like '%
{
dmodel
.
GoodsName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ProductCode
))
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
ProductCode
)}
like '%
{
dmodel
.
ProductCode
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderIds
))
{
where
+=
$@" and a.
{
nameof
(
RB_Goods_OrderDetail
.
OrderId
)}
in(
{
dmodel
.
OrderIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
='
{
dmodel
.
OrderNo
}
'"
;
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
string
sql
=
$@"SELECT a.* FROM rb_goods_orderdetail as a
left join rb_goods_order o on a.OrderId = o.OrderId
where
{
where
}
order by a.Id desc"
;
return
GetPage
<
RB_Goods_OrderDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
9c58b922
...
...
@@ -842,6 +842,35 @@ namespace Mall.WebApi.Controllers.MallBase
#
region
订单评价
/// <summary>
/// 获取商品待评论列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsWaitCommentPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_OrderDetail_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderDetail_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
var
list
=
orderModule
.
GetAppletGoodsWaitCommentPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
OrderDetailId
=
x
.
Id
,
x
.
GoodsId
,
x
.
GoodsName
,
x
.
CoverImage
,
x
.
SpecificationList
,
x
.
IsComment
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取商品评论分页列表
/// </summary>
...
...
Mall.WindowsService/Module/FinanceModule.cs
View file @
9c58b922
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment