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
b5090a6e
Commit
b5090a6e
authored
May 19, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
5271067a
3769945d
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
2006 additions
and
55 deletions
+2006
-55
ByteDanceRedis.cs
Mall.CacheManager/ByteDance/ByteDanceRedis.cs
+76
-0
UserModuleCacheKeyConfig.cs
Mall.CacheManager/keyManager/UserModuleCacheKeyConfig.cs
+6
-0
Config.cs
Mall.Common/Config.cs
+12
-0
AfterSaleSelectStatusEnum.cs
Mall.Common/Enum/Goods/AfterSaleSelectStatusEnum.cs
+36
-0
OrderAfterSaleExportEnum.cs
Mall.Common/Enum/Goods/OrderAfterSaleExportEnum.cs
+106
-0
OrderAfterSaleStatusEnum.cs
Mall.Common/Enum/Goods/OrderAfterSaleStatusEnum.cs
+46
-0
RB_Goods_OrderAfterSale.cs
Mall.Model/Entity/Product/RB_Goods_OrderAfterSale.cs
+6
-1
RB_Goods_DistributionCommission_Extend.cs
.../Extend/Product/RB_Goods_DistributionCommission_Extend.cs
+8
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+10
-0
RB_Goods_MemberPrice_Extend.cs
Mall.Model/Extend/Product/RB_Goods_MemberPrice_Extend.cs
+8
-0
RB_Goods_OrderAfterSale_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderAfterSale_Extend.cs
+29
-0
RB_Goods_OrderDetail_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
+9
-0
RB_Goods_Order_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
+4
-0
RB_Goods_SpecificationPrice_Extend.cs
...odel/Extend/Product/RB_Goods_SpecificationPrice_Extend.cs
+4
-0
RB_Member_User_Extend.cs
Mall.Model/Extend/User/RB_Member_User_Extend.cs
+27
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+681
-5
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+86
-0
RB_Logistics_ExpressRepository.cs
Mall.Repository/BaseSetUp/RB_Logistics_ExpressRepository.cs
+4
-1
RB_Goods_OrderAfterSaleRepository.cs
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
+65
-4
RB_Goods_OrderExpressRepository.cs
Mall.Repository/Product/RB_Goods_OrderExpressRepository.cs
+3
-0
RB_Goods_OrderRepository.cs
Mall.Repository/Product/RB_Goods_OrderRepository.cs
+28
-0
ByteDanceController.cs
Mall.WebApi/Controllers/ByteDance/ByteDanceController.cs
+234
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+170
-41
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+316
-1
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+23
-2
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+8
-0
appsettings.json
Mall.WebApi/appsettings.json
+1
-0
No files found.
Mall.CacheManager/ByteDance/ByteDanceRedis.cs
0 → 100644
View file @
b5090a6e
using
Mall.CacheManager.DataStatistic
;
using
Mall.Common.Plugin.Redis
;
using
Mall.Model.Extend.User
;
using
Newtonsoft.Json
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.CacheManager.ByteDance
{
public
class
ByteDanceRedis
{
static
RedisHelper
redis
=
new
RedisHelper
(
DataConstant
.
REDIS_DB2
);
/// <summary>
/// 获取微信用的formID
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
public
static
List
<
ByteDanceCustomer
>
GetByteDanceList
(
int
customerId
,
string
FormId
)
{
string
cacheKey
=
CacheKey
.
UserModuleCacheKeyConfig
.
ByteDanceFormId
+
customerId
+
"_"
+
FormId
;
List
<
ByteDanceCustomer
>
airInfo
=
new
List
<
ByteDanceCustomer
>();
try
{
var
dic
=
redis
.
StringGet
(
cacheKey
);
foreach
(
var
item
in
dic
)
{
var
model
=
JsonConvert
.
DeserializeObject
<
List
<
ByteDanceCustomer
>>(
item
.
ToString
());
airInfo
.
AddRange
(
model
);
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetByteDanceList"
);
}
return
airInfo
;
}
/// <summary>
/// 设置缓存
/// </summary>
/// <param name="airList"></param>
public
static
void
SetDyteDanceInfo
(
List
<
ByteDanceCustomer
>
airList
)
{
string
cacheKey
=
CacheKey
.
UserModuleCacheKeyConfig
.
ByteDanceFormId
+
airList
.
FirstOrDefault
().
UserID
+
"_"
+
airList
.
FirstOrDefault
().
FormId
;
TimeSpan
ts
=
GetExpirTime
(
7
*
60
*
60
*
24
-
60
*
1
);
redis
.
StringSet
(
cacheKey
,
JsonConvert
.
SerializeObject
(
airList
),
ts
);
}
/// <summary>
/// 获取缓存时长
/// </summary>
/// <param name="JwtExpirTime"></param>
/// <returns></returns>
private
static
TimeSpan
GetExpirTime
(
int
JwtExpirTime
)
{
DateTime
dt
=
DateTime
.
Now
;
DateTime
dt2
=
DateTime
.
Now
;
TimeSpan
ts
=
dt
.
AddSeconds
(
JwtExpirTime
)
-
dt2
;
return
ts
;
}
/// <summary>
/// 设置缓存
/// </summary>
/// <param name="airList"></param>
public
static
void
RemoveCacheKey
(
string
CustomerID
,
string
FormId
,
ByteDanceCustomer
model
)
{
string
cacheKey
=
CacheKey
.
UserModuleCacheKeyConfig
.
ByteDanceFormId
+
CustomerID
+
"_"
+
FormId
;
redis
.
ListRemove
(
cacheKey
,
model
);
}
}
}
Mall.CacheManager/keyManager/UserModuleCacheKeyConfig.cs
View file @
b5090a6e
...
@@ -31,5 +31,11 @@ namespace Mall.CacheKey
...
@@ -31,5 +31,11 @@ namespace Mall.CacheKey
{
{
get
{
return
"DATA_WeiXinToken"
;
}
get
{
return
"DATA_WeiXinToken"
;
}
}
}
public
static
string
ByteDanceFormId
{
get
{
return
"ByteDanceFormId_"
;
}
}
}
}
}
}
Mall.Common/Config.cs
View file @
b5090a6e
...
@@ -318,5 +318,17 @@ namespace Mall.Common
...
@@ -318,5 +318,17 @@ namespace Mall.Common
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FirstPage"
).
Value
;
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FirstPage"
).
Value
;
}
}
}
}
/// <summary>
/// 抖音发送消息模板
/// </summary>
public
static
string
ByteDanceSendTemplate
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"ByteDanceSendTemplate"
).
Value
;
}
}
}
}
}
}
\ No newline at end of file
Mall.Common/Enum/Goods/AfterSaleSelectStatusEnum.cs
0 → 100644
View file @
b5090a6e
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.Goods
{
/// <summary>
/// 订单售后查询状态枚举
/// </summary>
public
enum
AfterSaleSelectStatusEnum
{
/// <summary>
/// 待审核
/// </summary>
[
EnumField
(
"待审核"
)]
Auditing
=
1
,
/// <summary>
/// 待买家处理
/// </summary>
[
EnumField
(
"待买家处理"
)]
DeliveryToBuyer
=
2
,
/// <summary>
/// 待卖家处理
/// </summary>
[
EnumField
(
"待卖家处理"
)]
ReceivedBySeller
=
3
,
/// <summary>
/// 已完成
/// </summary>
[
EnumField
(
"已完成"
)]
RefundedBySeller
=
4
}
}
Mall.Common/Enum/Goods/OrderAfterSaleExportEnum.cs
0 → 100644
View file @
b5090a6e
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.Goods
{
/// <summary>
/// 订单售后列表导出选项枚举
/// </summary>
public
enum
OrderAfterSaleExportEnum
{
/// <summary>
/// 所属平台
/// </summary>
[
EnumField
(
"所属平台"
)]
SSPT
=
1
,
/// <summary>
/// 订单号
/// </summary>
[
EnumField
(
"订单号"
)]
DDH
=
2
,
/// <summary>
/// 下单用户
/// </summary>
[
EnumField
(
"下单用户"
)]
XDYH
=
4
,
/// <summary>
/// 商品名
/// </summary>
[
EnumField
(
"商品名"
)]
SPM
=
5
,
/// <summary>
/// 规格
/// </summary>
[
EnumField
(
"规格"
)]
GG
=
6
,
/// <summary>
/// 数量
/// </summary>
[
EnumField
(
"数量"
)]
SL
=
7
,
/// <summary>
/// 货号
/// </summary>
[
EnumField
(
"货号"
)]
HH
=
8
,
/// <summary>
/// 收件人
/// </summary>
[
EnumField
(
"收件人"
)]
SJR
=
10
,
/// <summary>
/// 收件人电话
/// </summary>
[
EnumField
(
"收件人电话"
)]
SJRDH
=
11
,
/// <summary>
/// 收件人地址
/// </summary>
[
EnumField
(
"收件人地址"
)]
SJRDZ
=
12
,
/// <summary>
/// 商家备注
/// </summary>
[
EnumField
(
"商家备注"
)]
ZJE
=
13
,
/// <summary>
/// 售后类型
/// </summary>
[
EnumField
(
"售后类型"
)]
SJFK
=
14
,
/// <summary>
/// 退款金额
/// </summary>
[
EnumField
(
"退款金额"
)]
YF
=
15
,
/// <summary>
/// 申请理由
/// </summary>
[
EnumField
(
"申请理由"
)]
XDSJ
=
16
,
/// <summary>
/// 申请售后时间
/// </summary>
[
EnumField
(
"申请售后时间"
)]
ZFFS
=
17
,
/// <summary>
/// 售后状态
/// </summary>
[
EnumField
(
"售后状态"
)]
DDZT
=
18
,
/// <summary>
/// 用户发货快递
/// </summary>
[
EnumField
(
"用户发货快递"
)]
FKZT
=
19
,
/// <summary>
/// 用户发货快递单号
/// </summary>
[
EnumField
(
"用户发货快递单号"
)]
FKSJ
=
20
}
}
Mall.Common/Enum/Goods/OrderAfterSaleStatusEnum.cs
0 → 100644
View file @
b5090a6e
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.Goods
{
/// <summary>
/// 订单售后状态枚举
/// </summary>
public
enum
OrderAfterSaleStatusEnum
{
/// <summary>
/// 待审核
/// </summary>
[
EnumField
(
"待审核"
)]
Auditing
=
1
,
/// <summary>
/// 待买家发货
/// </summary>
[
EnumField
(
"待买家发货"
)]
DeliveryToBuyer
=
2
,
/// <summary>
/// 待卖家收货
/// </summary>
[
EnumField
(
"待卖家收货"
)]
ReceivedBySeller
=
3
,
/// <summary>
/// 待卖家退款
/// </summary>
[
EnumField
(
"待卖家退款"
)]
RefundedBySeller
=
4
,
/// <summary>
/// 已完成
/// </summary>
[
EnumField
(
"已完成"
)]
Completed
=
5
,
/// <summary>
/// 已拒绝
/// </summary>
[
EnumField
(
"已拒绝"
)]
Rejected
=
6
}
}
Mall.Model/Entity/Product/RB_Goods_OrderAfterSale.cs
View file @
b5090a6e
using
Mall.Common.AOP
;
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Goods
;
using
Mall.Common.Enum.User
;
using
Mall.Common.Enum.User
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -101,7 +102,7 @@ namespace Mall.Model.Entity.Product
...
@@ -101,7 +102,7 @@ namespace Mall.Model.Entity.Product
/// <summary>
/// <summary>
/// 售后状态 1待审核 2待买家发货 3已发货待商家处理(待卖家收货) 4待卖家退款 5已完成 6已拒绝
/// 售后状态 1待审核 2待买家发货 3已发货待商家处理(待卖家收货) 4待卖家退款 5已完成 6已拒绝
/// </summary>
/// </summary>
public
int
?
ReOrderStatus
public
OrderAfterSaleStatusEnum
?
ReOrderStatus
{
{
get
;
get
;
set
;
set
;
...
@@ -178,5 +179,9 @@ namespace Mall.Model.Entity.Product
...
@@ -178,5 +179,9 @@ namespace Mall.Model.Entity.Product
get
;
get
;
set
;
set
;
}
}
/// <summary>
/// 商家备注
/// </summary>
public
string
ReRemark
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_DistributionCommission_Extend.cs
View file @
b5090a6e
...
@@ -17,5 +17,13 @@ namespace Mall.Model.Extend.Product
...
@@ -17,5 +17,13 @@ namespace Mall.Model.Extend.Product
/// 商品ids
/// 商品ids
/// </summary>
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
public
string
GoodsIds
{
get
;
set
;
}
/// <summary>
/// 等级列表
/// </summary>
public
List
<
RB_Goods_DistributionCommission_Extend
>
GradeCommissionList
{
get
;
set
;
}
/// <summary>
/// 规格值列表
/// </summary>
public
object
AttrList
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
b5090a6e
...
@@ -109,10 +109,20 @@ namespace Mall.Model.Extend.Product
...
@@ -109,10 +109,20 @@ namespace Mall.Model.Extend.Product
/// 分销佣金列表
/// 分销佣金列表
/// </summary>
/// </summary>
public
List
<
RB_Goods_DistributionCommission_Extend
>
DistributionCommissionList
{
get
;
set
;
}
public
List
<
RB_Goods_DistributionCommission_Extend
>
DistributionCommissionList
{
get
;
set
;
}
/// <summary>
/// 分销佣金列表(2号)
/// </summary>
public
List
<
RB_Goods_DistributionCommission_Extend
>
DistributionCommissionTreeList
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 会员价格列表
/// 会员价格列表
/// </summary>
/// </summary>
public
List
<
RB_Goods_MemberPrice_Extend
>
MemberPriceList
{
get
;
set
;
}
public
List
<
RB_Goods_MemberPrice_Extend
>
MemberPriceList
{
get
;
set
;
}
/// <summary>
/// 会员价格列表
/// </summary>
public
List
<
RB_Goods_MemberPrice_Extend
>
MemberPriceTreeList
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否收藏 true/false
/// 是否收藏 true/false
...
...
Mall.Model/Extend/Product/RB_Goods_MemberPrice_Extend.cs
View file @
b5090a6e
...
@@ -17,5 +17,13 @@ namespace Mall.Model.Extend.Product
...
@@ -17,5 +17,13 @@ namespace Mall.Model.Extend.Product
/// 商品ids
/// 商品ids
/// </summary>
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
public
string
GoodsIds
{
get
;
set
;
}
/// <summary>
/// 等级价格列表
/// </summary>
public
List
<
RB_Goods_MemberPrice_Extend
>
GradePriceList
{
get
;
set
;
}
/// <summary>
/// 规格值列表
/// </summary>
public
object
AttrList
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_OrderAfterSale_Extend.cs
View file @
b5090a6e
...
@@ -13,6 +13,10 @@ namespace Mall.Model.Extend.Product
...
@@ -13,6 +13,10 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_OrderAfterSale_Extend
:
RB_Goods_OrderAfterSale
public
class
RB_Goods_OrderAfterSale_Extend
:
RB_Goods_OrderAfterSale
{
{
/// <summary>
/// 订单明细ids
/// </summary>
public
string
OrderDetailIds
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 订单号
/// 订单号
/// </summary>
/// </summary>
...
@@ -45,5 +49,30 @@ namespace Mall.Model.Extend.Product
...
@@ -45,5 +49,30 @@ namespace Mall.Model.Extend.Product
/// 结束时间
/// 结束时间
/// </summary>
/// </summary>
public
string
EndTime
{
get
;
set
;
}
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 订单
/// </summary>
public
RB_Goods_Order_Extend
OrderModel
{
get
;
set
;
}
/// <summary>
/// 订单明细
/// </summary>
public
RB_Goods_OrderDetail_Extend
OrderDetailModel
{
get
;
set
;
}
/// <summary>
/// 导出选项
/// </summary>
public
List
<
int
>
ExcelEnumIds
{
get
;
set
;
}
/// <summary>
/// 客人退货物流名称
/// </summary>
public
string
ReExpressName
{
get
;
set
;
}
/// <summary>
/// 查询状态
/// </summary>
public
int
SelectStatus
{
get
;
set
;
}
/// <summary>
/// 凭证列表
/// </summary>
public
List
<
string
>
VoucherList
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
View file @
b5090a6e
...
@@ -53,5 +53,14 @@ namespace Mall.Model.Extend.Product
...
@@ -53,5 +53,14 @@ namespace Mall.Model.Extend.Product
/// 分销佣金类型 1百分比 2固定值
/// 分销佣金类型 1百分比 2固定值
/// </summary>
/// </summary>
public
int
?
SeparateDistributionMoneyType
{
get
;
set
;
}
public
int
?
SeparateDistributionMoneyType
{
get
;
set
;
}
/// <summary>
/// 规格列表
/// </summary>
public
List
<
string
>
SpecificationList
{
get
;
set
;
}
/// <summary>
/// 是否申请售后
/// </summary>
public
int
?
IsApplyForAfterSale
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
View file @
b5090a6e
...
@@ -13,6 +13,10 @@ namespace Mall.Model.Extend.Product
...
@@ -13,6 +13,10 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Order_Extend
:
RB_Goods_Order
public
class
RB_Goods_Order_Extend
:
RB_Goods_Order
{
{
/// <summary>
/// 订单ids
/// </summary>
public
string
OrderIds
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否来自购物车 1是 2否
/// 是否来自购物车 1是 2否
/// </summary>
/// </summary>
...
...
Mall.Model/Extend/Product/RB_Goods_SpecificationPrice_Extend.cs
View file @
b5090a6e
...
@@ -17,5 +17,9 @@ namespace Mall.Model.Extend.Product
...
@@ -17,5 +17,9 @@ namespace Mall.Model.Extend.Product
/// 商品ids
/// 商品ids
/// </summary>
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
public
string
GoodsIds
{
get
;
set
;
}
/// <summary>
/// 规格值列表
/// </summary>
public
object
AttrList
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/User/RB_Member_User_Extend.cs
View file @
b5090a6e
...
@@ -73,4 +73,31 @@ namespace Mall.Model.Extend.User
...
@@ -73,4 +73,31 @@ namespace Mall.Model.Extend.User
#
endregion
#
endregion
}
}
/// <summary>
/// 抖音客户实体类
/// </summary>
public
class
ByteDanceCustomer
{
/// <summary>
/// form Id
/// </summary>
public
string
FormId
{
get
;
set
;
}
/// <summary>
/// form Id缓存时间
/// </summary>
public
DateTime
FormCreateDate
{
get
;
set
;
}
/// <summary>
/// 用户的标识
/// </summary>
public
string
Openid
{
get
;
set
;
}
/// <summary>
/// 客户编号
/// </summary>
public
int
UserID
{
get
;
set
;
}
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
b5090a6e
...
@@ -132,6 +132,18 @@ namespace Mall.Module.Product
...
@@ -132,6 +132,18 @@ namespace Mall.Module.Product
private
readonly
RB_Member_CouponRepository
member_CouponRepository
=
new
RB_Member_CouponRepository
();
private
readonly
RB_Member_CouponRepository
member_CouponRepository
=
new
RB_Member_CouponRepository
();
private
readonly
RB_DiscountCouponRepository
discountCouponRepository
=
new
RB_DiscountCouponRepository
();
private
readonly
RB_DiscountCouponRepository
discountCouponRepository
=
new
RB_DiscountCouponRepository
();
private
readonly
RB_DiscountCoupon_ProductRepository
discountCoupon_ProductRepository
=
new
RB_DiscountCoupon_ProductRepository
();
private
readonly
RB_DiscountCoupon_ProductRepository
discountCoupon_ProductRepository
=
new
RB_DiscountCoupon_ProductRepository
();
/// <summary>
/// 售后订单列表
/// </summary>
private
readonly
RB_Goods_OrderAfterSaleRepository
goods_OrderAfterSaleRepository
=
new
RB_Goods_OrderAfterSaleRepository
();
/// <summary>
/// 售后订单流程
/// </summary>
private
readonly
RB_Goods_OrderAfterSaleLogRepository
goods_OrderAfterSaleLogRepository
=
new
RB_Goods_OrderAfterSaleLogRepository
();
/// <summary>
/// 公司收货地址
/// </summary>
private
readonly
RB_Logistics_DeliveryRepository
logistics_DeliveryRepository
=
new
RB_Logistics_DeliveryRepository
();
#
region
购物车
#
region
购物车
...
@@ -442,10 +454,16 @@ namespace Mall.Module.Product
...
@@ -442,10 +454,16 @@ namespace Mall.Module.Product
List
<
RB_Material_Info_Extend
>
Mlist
=
new
List
<
RB_Material_Info_Extend
>();
List
<
RB_Material_Info_Extend
>
Mlist
=
new
List
<
RB_Material_Info_Extend
>();
if
(
dlist
.
Any
())
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
});
Mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
MaterialIds
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
CoverImage
))
});
Mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
MaterialIds
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
CoverImage
))
});
foreach
(
var
item
in
dlist
)
foreach
(
var
item
in
dlist
)
{
{
item
.
CoverImagePath
=
Mlist
.
Where
(
x
=>
x
.
Id
==
item
.
CoverImage
).
FirstOrDefault
()?.
Path
??
""
;
item
.
CoverImagePath
=
Mlist
.
Where
(
x
=>
x
.
Id
==
item
.
CoverImage
).
FirstOrDefault
()?.
Path
??
""
;
item
.
IsApplyForAfterSale
=
2
;
if
(
oasList
.
Where
(
x
=>
x
.
OrderDetialId
==
item
.
Id
).
Any
())
{
item
.
IsApplyForAfterSale
=
1
;
}
}
}
}
}
model
.
DetailList
=
dlist
;
model
.
DetailList
=
dlist
;
...
@@ -489,9 +507,10 @@ namespace Mall.Module.Product
...
@@ -489,9 +507,10 @@ namespace Mall.Module.Product
x
.
GoodsId
,
x
.
GoodsId
,
x
.
GoodsName
,
x
.
GoodsName
,
x
.
CoverImagePath
,
x
.
CoverImagePath
,
x
.
Specification
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
Specification
)
,
x
.
Number
,
x
.
Number
,
x
.
Final_Price
x
.
Final_Price
,
x
.
IsApplyForAfterSale
}),
}),
model
.
IsApplyForCancel
,
model
.
IsApplyForCancel
,
model
.
RejectRemark
model
.
RejectRemark
...
@@ -569,7 +588,7 @@ namespace Mall.Module.Product
...
@@ -569,7 +588,7 @@ namespace Mall.Module.Product
dModel
.
CoverImagePath
,
dModel
.
CoverImagePath
,
dModel
.
GoodsId
,
dModel
.
GoodsId
,
dModel
.
GoodsName
,
dModel
.
GoodsName
,
dModel
.
Specification
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
dModel
.
Specification
)
,
dModel
.
Number
,
dModel
.
Number
,
dModel
.
Final_Price
dModel
.
Final_Price
});
});
...
@@ -2077,6 +2096,261 @@ namespace Mall.Module.Product
...
@@ -2077,6 +2096,261 @@ namespace Mall.Module.Product
}
}
/// <summary>
/// 申请售后
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetAppletMyOrderAfterSale
(
RB_Goods_OrderAfterSale_Extend
demodel
)
{
var
dModel
=
goods_OrderDetailRepository
.
GetEntity
(
demodel
.
OrderDetialId
);
if
(
demodel
.
Type
==
1
&&
dModel
.
Final_Price
<
demodel
.
Refund
)
{
return
false
;
}
demodel
.
Income
=
dModel
.
Final_Price
;
demodel
.
RefundActual
??=
0
;
demodel
.
Refund
??=
0
;
demodel
.
DeliveryId
??=
0
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
OrderId
=
dModel
.
OrderId
;
demodel
.
ReExpressId
??=
0
;
demodel
.
ReExpressNumber
??=
""
;
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetialId
=
demodel
.
OrderDetialId
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
oasList
.
Any
())
{
return
false
;
}
int
Id
=
goods_OrderAfterSaleRepository
.
Insert
(
demodel
);
if
(
Id
>
0
)
{
//流程
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"买家申请售后"
,
Type
=
1
,
ReOrderId
=
Id
,
TenantId
=
demodel
.
TenantId
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
demodel
.
MallBaseId
});
return
true
;
}
return
false
;
}
/// <summary>
/// 获取买家发货界面信息
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
GetAppletOrderBuyerToDeliverInfo
(
int
reOrderId
,
int
tenantId
,
int
mallBaseId
)
{
var
omodel
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
omodel
==
null
)
{
return
ApiResult
.
Failed
(
"售后订单不存在"
);
}
if
(
omodel
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
DeliveryToBuyer
)
{
return
ApiResult
.
Failed
(
"状态不正确,刷新后再试"
);
}
if
((
omodel
.
DeliveryId
??
0
)
<=
0
)
{
return
ApiResult
.
Failed
(
"该订单出错啦,请联系管理员"
);
}
var
delmodel
=
logistics_DeliveryRepository
.
GetEntity
(
omodel
.
DeliveryId
);
if
(
delmodel
==
null
)
{
return
ApiResult
.
Failed
(
"收货地址有误,请联系管理员"
);
}
string
DistrictAddress
=
(
destinationRepository
.
GetEntity
(
delmodel
.
ProvinceId
)?.
Name
??
""
)
+
" "
+
(
destinationRepository
.
GetEntity
(
delmodel
.
CityId
)?.
Name
??
""
)
+
" "
+
(
destinationRepository
.
GetEntity
(
delmodel
.
DistrictId
)?.
Name
??
""
);
var
detailmodel
=
goods_OrderDetailRepository
.
GetEntity
(
omodel
.
OrderDetialId
);
if
(
detailmodel
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在,请联系管理员"
);
}
string
ImagePath
=
material_InfoRepository
.
GetEntity
(
detailmodel
.
CoverImage
)?.
Path
??
""
;
return
ApiResult
.
Success
(
""
,
new
{
omodel
.
ReOrderId
,
omodel
.
ReOrderStatus
,
ReOrderStatusName
=
omodel
.
ReOrderStatus
.
GetEnumName
(),
omodel
.
Type
,
omodel
.
Remark
,
omodel
.
Refund
,
VoucherList
=
string
.
IsNullOrEmpty
(
omodel
.
Voucher
)?
new
List
<
string
>()
:
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
omodel
.
Voucher
),
RecipientInfo
=
new
{
delmodel
.
Name
,
delmodel
.
Mobile
,
DistrictAddress
,
delmodel
.
Address
,
delmodel
.
Remarks
},
OrderInfo
=
new
{
detailmodel
.
Id
,
ImagePath
,
detailmodel
.
GoodsName
,
detailmodel
.
GoodsId
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
detailmodel
.
Specification
),
detailmodel
.
Final_Price
}
});
}
/// <summary>
/// 售后买家发货
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="expressId"></param>
/// <param name="expressNumber"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
bool
SetAppletOrderSendGoods
(
int
reOrderId
,
int
expressId
,
string
expressNumber
,
int
tenantId
,
int
mallBaseId
)
{
var
omodel
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
omodel
==
null
)
{
return
false
;
}
if
(
omodel
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
DeliveryToBuyer
)
{
return
false
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
ReceivedBySeller
},
{
nameof
(
RB_Goods_OrderAfterSale
.
ReExpressId
),
expressId
},
{
nameof
(
RB_Goods_OrderAfterSale
.
ReExpressNumber
),
expressNumber
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
reOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 获取售后订单详情
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
GetAppletOrderAfterSaleInfo
(
int
reOrderId
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
<
RB_Goods_OrderAfterSale_Extend
>(
reOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
ParamIsNull
();
}
var
gModel
=
goods_OrderRepository
.
GetEntity
<
RB_Goods_Order_Extend
>(
model
.
OrderId
);
if
(
gModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"订单不存在"
);
}
var
odModel
=
goods_OrderDetailRepository
.
GetEntity
<
RB_Goods_OrderDetail_Extend
>(
model
.
OrderDetialId
);
if
(
odModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"订单明细不存在"
);
}
odModel
.
CoverImagePath
=
material_InfoRepository
.
GetEntity
(
odModel
.
CoverImage
)?.
Path
??
""
;
//物流信息
List
<
object
>
TExpressList
=
new
List
<
object
>();
List
<
object
>
HExpressList
=
new
List
<
object
>();
if
(
model
.
DeliveryId
>
0
)
{
var
leModel
=
logistics_ExpressRepository
.
GetEntity
(
model
.
ReExpressId
);
TExpressList
.
Add
(
new
{
ExpressName
=
leModel
.
Name
??
""
,
ExpressNumber
=
model
.
ReExpressNumber
,
Type
=
1
});
}
if
(
model
.
Type
==
2
)
{
var
oeModel
=
goods_OrderExpressRepository
.
GetList
(
new
RB_Goods_OrderExpress_Extend
()
{
AfterSaleOrderId
=
model
.
ReOrderId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
oeModel
.
Type
==
1
)
{
var
leModel
=
logistics_ExpressRepository
.
GetEntity
(
oeModel
.
ExpressId
);
HExpressList
.
Add
(
new
{
ExpressName
=
leModel
.
Name
??
""
,
oeModel
.
ExpressNumber
,
Type
=
1
});
}
else
{
HExpressList
.
Add
(
new
{
ExpressName
=
""
,
ExpressNumber
=
oeModel
.
Remark
,
Type
=
2
});
}
}
return
ApiResult
.
Success
(
""
,
new
{
model
.
ReOrderId
,
model
.
ReOrderNo
,
model
.
Type
,
TypeName
=
model
.
Type
==
1
?
"退货退款"
:
"换货"
,
VoucherList
=
string
.
IsNullOrEmpty
(
model
.
Voucher
)
?
new
List
<
string
>()
:
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
Voucher
),
model
.
Income
,
model
.
Refund
,
model
.
RefundActual
,
model
.
ReOrderStatus
,
ReOrderStatusName
=
model
.
ReOrderStatus
.
GetEnumName
(),
AuditTime
=
model
.
AuditTime
.
HasValue
?
model
.
AuditTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
FinishTime
=
model
.
FinishTime
.
HasValue
?
model
.
FinishTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
CreateDate
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
OrderInfo
=
new
{
odModel
.
OrderId
,
odModel
.
CoverImagePath
,
odModel
.
GoodsId
,
odModel
.
GoodsName
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
odModel
.
Specification
),
odModel
.
Number
,
odModel
.
Final_Price
},
TExpressList
,
HExpressList
});
}
/// <summary>
/// 获取售后订单列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetAppletOrderAfterPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
demodel
)
{
var
list
=
goods_OrderAfterSaleRepository
.
GetAppletPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
string
orderDetilIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
OrderDetialId
));
var
gdList
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
OrderDetailIds
=
orderDetilIds
});
if
(
gdList
.
Any
())
{
var
Mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
MaterialIds
=
string
.
Join
(
","
,
gdList
.
Select
(
x
=>
x
.
CoverImage
))
});
foreach
(
var
item
in
gdList
)
{
item
.
CoverImagePath
=
Mlist
.
Where
(
x
=>
x
.
Id
==
item
.
CoverImage
).
FirstOrDefault
()?.
Path
??
""
;
}
}
foreach
(
var
item
in
list
)
{
item
.
OrderDetailModel
=
gdList
.
Where
(
x
=>
x
.
Id
==
item
.
OrderDetialId
).
FirstOrDefault
();
}
}
return
list
;
}
#
endregion
#
endregion
#
region
订单管理
#
region
订单管理
...
@@ -2277,6 +2551,68 @@ namespace Mall.Module.Product
...
@@ -2277,6 +2551,68 @@ namespace Mall.Module.Product
return
list
;
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_OrderAfterSale_Extend
>
GetGoodsOrderAfterPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
demodel
)
{
var
list
=
goods_OrderAfterSaleRepository
.
GetERPPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
string
orderids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
OrderId
).
Distinct
());
string
orderDetilIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
OrderDetialId
));
var
gList
=
goods_OrderRepository
.
GetOrderList
(
new
RB_Goods_Order_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
OrderIds
=
orderids
});
var
gdList
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
OrderDetailIds
=
orderDetilIds
});
if
(
gdList
.
Any
())
{
var
Mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
MaterialIds
=
string
.
Join
(
","
,
gdList
.
Select
(
x
=>
x
.
CoverImage
))
});
foreach
(
var
item
in
gdList
)
{
item
.
CoverImagePath
=
Mlist
.
Where
(
x
=>
x
.
Id
==
item
.
CoverImage
).
FirstOrDefault
()?.
Path
??
""
;
}
}
string
areaIds1
=
string
.
Join
(
","
,
gList
.
Select
(
x
=>
x
.
Province
??
0
).
Distinct
());
string
areaIds2
=
string
.
Join
(
","
,
gList
.
Select
(
x
=>
x
.
City
??
0
).
Distinct
());
string
areaIds3
=
string
.
Join
(
","
,
gList
.
Select
(
x
=>
x
.
District
??
0
).
Distinct
());
string
areaIds
=
"0"
;
if
(!
string
.
IsNullOrEmpty
(
areaIds1
))
{
areaIds
+=
","
+
areaIds1
;
}
if
(!
string
.
IsNullOrEmpty
(
areaIds2
))
{
areaIds
+=
","
+
areaIds2
;
}
if
(!
string
.
IsNullOrEmpty
(
areaIds3
))
{
areaIds
+=
","
+
areaIds3
;
}
var
arealist
=
destinationRepository
.
GetDictvalueListForIds
(
areaIds
);
foreach
(
var
item
in
gList
)
{
item
.
DistrictAddress
=
(
arealist
.
Where
(
x
=>
x
.
ID
==
item
.
Province
).
FirstOrDefault
()?.
Name
??
""
)
+
" "
+
(
arealist
.
Where
(
x
=>
x
.
ID
==
item
.
City
).
FirstOrDefault
()?.
Name
??
""
)
+
" "
+
(
arealist
.
Where
(
x
=>
x
.
ID
==
item
.
District
).
FirstOrDefault
()?.
Name
??
""
);
}
List
<
Model
.
Entity
.
BaseSetUp
.
RB_Logistics_Express
>
ExpressList
=
new
List
<
Model
.
Entity
.
BaseSetUp
.
RB_Logistics_Express
>();
if
(
list
.
Where
(
x
=>
x
.
ReExpressId
>
0
).
Any
())
{
ExpressList
=
logistics_ExpressRepository
.
GetLogisticsExpressList
(
new
Model
.
Entity
.
BaseSetUp
.
RB_Logistics_Express
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
},
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
ReExpressId
>
0
).
Select
(
x
=>
x
.
ReExpressId
)));
}
foreach
(
var
item
in
list
)
{
item
.
OrderModel
=
gList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
FirstOrDefault
();
item
.
OrderDetailModel
=
gdList
.
Where
(
x
=>
x
.
Id
==
item
.
OrderDetialId
).
FirstOrDefault
();
if
(
item
.
ReExpressId
>
0
)
{
item
.
ReExpressName
=
ExpressList
.
Where
(
x
=>
x
.
ID
==
item
.
ReExpressId
)?.
FirstOrDefault
()?.
Name
??
""
;
}
}
}
return
list
;
}
/// <summary>
/// <summary>
/// 会员购买情况
/// 会员购买情况
/// </summary>
/// </summary>
...
@@ -2300,6 +2636,346 @@ namespace Mall.Module.Product
...
@@ -2300,6 +2636,346 @@ namespace Mall.Module.Product
return
goods_OrderRepository
.
GetEntity
(
OrderId
).
RefMapperTo
<
RB_Goods_Order_Extend
>();
return
goods_OrderRepository
.
GetEntity
(
OrderId
).
RefMapperTo
<
RB_Goods_Order_Extend
>();
}
}
/// <summary>
/// 获取售后订单详情
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
GetOrderAfterSaleInfo
(
int
reOrderId
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
<
RB_Goods_OrderAfterSale_Extend
>(
reOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
ParamIsNull
();
}
var
gModel
=
goods_OrderRepository
.
GetEntity
<
RB_Goods_Order_Extend
>(
model
.
OrderId
);
if
(
gModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"订单不存在"
);
}
var
odModel
=
goods_OrderDetailRepository
.
GetEntity
<
RB_Goods_OrderDetail_Extend
>(
model
.
OrderDetialId
);
if
(
odModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"订单明细不存在"
);
}
odModel
.
CoverImagePath
=
material_InfoRepository
.
GetEntity
(
odModel
.
CoverImage
)?.
Path
??
""
;
var
slList
=
goods_OrderAfterSaleLogRepository
.
GetList
(
new
RB_Goods_OrderAfterSaleLog_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
ReOrderId
=
reOrderId
});
var
uModel
=
member_UserRepository
.
GetEntity
(
model
.
UserId
);
//物流信息
List
<
object
>
ExpressList
=
new
List
<
object
>();
if
(
model
.
DeliveryId
>
0
)
{
var
ldModel
=
logistics_DeliveryRepository
.
GetEntity
(
model
.
DeliveryId
);
var
leModel
=
logistics_ExpressRepository
.
GetEntity
(
model
.
ReExpressId
);
ExpressList
.
Add
(
new
{
Name
=
ldModel
.
Name
??
""
,
ExpressName
=
leModel
.
Name
??
""
,
ExpressNumber
=
model
.
ReExpressNumber
,
Type
=
1
});
}
if
(
model
.
Type
==
2
)
{
var
oeModel
=
goods_OrderExpressRepository
.
GetList
(
new
RB_Goods_OrderExpress_Extend
()
{
AfterSaleOrderId
=
model
.
ReOrderId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
oeModel
.
Type
==
1
)
{
var
leModel
=
logistics_ExpressRepository
.
GetEntity
(
oeModel
.
ExpressId
);
ExpressList
.
Add
(
new
{
Name
=
uModel
.
Name
??
""
,
ExpressName
=
leModel
.
Name
??
""
,
oeModel
.
ExpressNumber
,
Type
=
1
});
}
else
{
ExpressList
.
Add
(
new
{
Name
=
uModel
.
Name
??
""
,
ExpressName
=
""
,
ExpressNumber
=
oeModel
.
Remark
,
Type
=
2
});
}
}
return
ApiResult
.
Success
(
""
,
new
{
model
.
ReOrderId
,
model
.
ReOrderNo
,
model
.
Type
,
TypeName
=
model
.
Type
==
1
?
"退货退款"
:
"换货"
,
VoucherList
=
string
.
IsNullOrEmpty
(
model
.
Voucher
)
?
new
List
<
string
>()
:
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
Voucher
),
model
.
Income
,
model
.
Refund
,
model
.
RefundActual
,
UserName
=
uModel
?.
Name
??
""
,
model
.
ReOrderStatus
,
AuditTime
=
model
.
AuditTime
.
HasValue
?
model
.
AuditTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
FinishTime
=
model
.
FinishTime
.
HasValue
?
model
.
FinishTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
CreateDate
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
AfterSaleLoglist
=
slList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Type
,
x
.
Content
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
):
""
}),
OrderInfo
=
new
{
odModel
.
OrderId
,
odModel
.
CoverImagePath
,
odModel
.
GoodsId
,
odModel
.
GoodsName
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
odModel
.
Specification
),
odModel
.
Number
,
odModel
.
Original_Price
,
odModel
.
Final_Price
,
odModel
.
Unit_Price
,
gModel
.
PreferPrice
,
gModel
.
Income
,
gModel
.
CouponMoney
,
gModel
.
FreightMoney
},
ExpressList
});
}
/// <summary>
/// 售后订单审核
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="type"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
SetOrderAfterSaleAudit
(
int
reOrderId
,
int
type
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"售后订单不存在"
);
}
if
(
model
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
Auditing
)
{
return
ApiResult
.
Failed
(
"状态不正确"
);
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
};
if
(
type
==
1
)
{
//通过
keyValues
.
Add
(
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
DeliveryToBuyer
);
keyValues
.
Add
(
nameof
(
RB_Goods_OrderAfterSale
.
AuditTime
),
DateTime
.
Now
);
}
else
{
keyValues
.
Add
(
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
Rejected
);
keyValues
.
Add
(
nameof
(
RB_Goods_OrderAfterSale
.
AuditTime
),
DateTime
.
Now
);
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
reOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//记录流程
string
Content
=
""
;
if
(
type
==
1
)
{
Content
=
"卖家同意售后"
;
}
else
{
Content
=
"卖家拒绝售后"
;
}
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
Content
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
mallBaseId
,
ReOrderId
=
reOrderId
,
TenantId
=
tenantId
,
Type
=
2
});
return
ApiResult
.
Success
();
}
return
ApiResult
.
Failed
();
}
/// <summary>
/// 收货 (退货退款)
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
SetOrderReceivingForReturnsAndRefunds
(
int
reOrderId
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"售后订单不存在"
);
}
if
(
model
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
ReceivedBySeller
)
{
return
ApiResult
.
Failed
(
"状态不正确"
);
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
RefundedBySeller
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
reOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
),
FiledValue
=
tenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
),
FiledValue
=
mallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"卖家确认收货"
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
mallBaseId
,
ReOrderId
=
reOrderId
,
TenantId
=
tenantId
,
Type
=
2
});
return
ApiResult
.
Success
();
}
return
ApiResult
.
Failed
();
}
/// <summary>
/// 售后订单退款
/// </summary>
/// <param name="reOrderId"></param>
/// <param name="refund"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
SetOrderAfterSaleForRefunds
(
int
reOrderId
,
decimal
refund
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"售后订单不存在"
);
}
if
(
model
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
RefundedBySeller
)
{
return
ApiResult
.
Failed
(
"状态不正确"
);
}
if
(
model
.
Refund
<
refund
)
{
return
ApiResult
.
Failed
(
"退款金额不能大于"
+
model
.
Refund
);
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
Completed
},
{
nameof
(
RB_Goods_OrderAfterSale
.
RefundActual
),
refund
},
{
nameof
(
RB_Goods_OrderAfterSale
.
FinishTime
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
reOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
),
FiledValue
=
tenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
),
FiledValue
=
mallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//操作原路退款
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"卖家已退款"
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
mallBaseId
,
ReOrderId
=
reOrderId
,
TenantId
=
tenantId
,
Type
=
2
});
return
ApiResult
.
Success
();
}
return
ApiResult
.
Failed
();
}
/// <summary>
/// 售后订单 发货
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
ApiResult
SetOrderAfterSaleSendGoods
(
RB_Goods_OrderExpress_Extend
demodel
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
(
demodel
.
AfterSaleOrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"售后订单不存在"
);
}
if
(
model
.
ReOrderStatus
!=
OrderAfterSaleStatusEnum
.
ReceivedBySeller
)
{
return
ApiResult
.
Failed
(
"状态不正确"
);
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
),
OrderAfterSaleStatusEnum
.
Completed
},
{
nameof
(
RB_Goods_OrderAfterSale
.
ReRemark
),
demodel
.
Remark
},
{
nameof
(
RB_Goods_OrderAfterSale
.
FinishTime
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
demodel
.
AfterSaleOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
),
FiledValue
=
demodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
),
FiledValue
=
demodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//快递
demodel
.
OrderId
=
0
;
goods_OrderExpressRepository
.
Insert
(
demodel
);
//流程
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"卖家已发货"
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
demodel
.
MallBaseId
,
ReOrderId
=
demodel
.
AfterSaleOrderId
,
TenantId
=
demodel
.
TenantId
,
Type
=
2
});
return
ApiResult
.
Success
();
}
return
ApiResult
.
Failed
();
}
/// <summary>
/// <summary>
/// 订单发货
/// 订单发货
/// </summary>
/// </summary>
...
@@ -3061,7 +3737,7 @@ namespace Mall.Module.Product
...
@@ -3061,7 +3737,7 @@ namespace Mall.Module.Product
x
.
GoodsName
,
x
.
GoodsName
,
x
.
CoverImage
,
x
.
CoverImage
,
x
.
CoverImagePath
,
x
.
CoverImagePath
,
x
.
Specification
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
Specification
)
,
x
.
Unit_Price
,
x
.
Unit_Price
,
x
.
Number
,
x
.
Number
,
x
.
Original_Price
,
x
.
Original_Price
,
...
...
Mall.Module.Product/ProductModule.cs
View file @
b5090a6e
...
@@ -2555,18 +2555,104 @@ namespace Mall.Module.Product
...
@@ -2555,18 +2555,104 @@ namespace Mall.Module.Product
}
}
}
}
model
.
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
model
.
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
model
.
SpecificationPriceList
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
SpecificationSort
))
{
var
ssarr
=
item
.
SpecificationSort
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
string
pic_url
=
model
.
SpecificationList
[
0
].
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Sort
).
FirstOrDefault
()?.
ImagePath
;
List
<
object
>
AttrList
=
new
List
<
object
>();
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
AttrList
.
Add
(
new
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
.
Sort
,
SVName
=
svmodel
.
Name
});
}
item
.
AttrList
=
AttrList
;
}
}
}
}
model
.
AreaList
=
new
List
<
RB_Goods_Area_Extend
>();
model
.
AreaList
=
new
List
<
RB_Goods_Area_Extend
>();
if
(
model
.
IsAreaBuy
==
1
)
{
if
(
model
.
IsAreaBuy
==
1
)
{
model
.
AreaList
=
goods_AreaRepository
.
GetList
(
new
RB_Goods_Area_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
model
.
AreaList
=
goods_AreaRepository
.
GetList
(
new
RB_Goods_Area_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
}
model
.
DistributionCommissionList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
model
.
DistributionCommissionList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
model
.
DistributionCommissionTreeList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
if
(
model
.
SeparateDistribution
==
1
)
{
if
(
model
.
SeparateDistribution
==
1
)
{
model
.
DistributionCommissionList
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
model
.
DistributionCommissionList
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
model
.
DistributionCommissionList
.
Any
())
{
var
KeyList
=
model
.
DistributionCommissionList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
foreach
(
var
qitem
in
KeyList
)
{
var
treemodel
=
model
.
DistributionCommissionList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
FirstOrDefault
();
treemodel
.
GradeCommissionList
=
model
.
DistributionCommissionList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
ToList
();
if
(
model
.
SeparateDistributionType
==
2
)
{
if
(!
string
.
IsNullOrEmpty
(
qitem
))
{
var
ssarr
=
qitem
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
string
pic_url
=
model
.
SpecificationList
[
0
].
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Sort
).
FirstOrDefault
()?.
ImagePath
;
List
<
object
>
AttrList
=
new
List
<
object
>();
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
AttrList
.
Add
(
new
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
.
Sort
,
SVName
=
svmodel
.
Name
});
}
treemodel
.
AttrList
=
AttrList
;
}
}
model
.
DistributionCommissionTreeList
.
Add
(
treemodel
);
}
}
}
}
model
.
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
model
.
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
model
.
MemberPriceTreeList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
){
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
){
model
.
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
model
.
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
model
.
MemberPriceList
.
Any
())
{
var
KeyList
=
model
.
MemberPriceList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
foreach
(
var
qitem
in
KeyList
)
{
var
treemodel
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
FirstOrDefault
();
treemodel
.
GradePriceList
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
qitem
))
{
var
ssarr
=
qitem
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
string
pic_url
=
model
.
SpecificationList
[
0
].
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Sort
).
FirstOrDefault
()?.
ImagePath
;
List
<
object
>
AttrList
=
new
List
<
object
>();
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
AttrList
.
Add
(
new
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
.
Sort
,
SVName
=
svmodel
.
Name
});
}
treemodel
.
AttrList
=
AttrList
;
}
model
.
MemberPriceTreeList
.
Add
(
treemodel
);
}
}
}
}
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
...
...
Mall.Repository/BaseSetUp/RB_Logistics_ExpressRepository.cs
View file @
b5090a6e
...
@@ -22,7 +22,7 @@ namespace Mall.Repository.BaseSetUp
...
@@ -22,7 +22,7 @@ namespace Mall.Repository.BaseSetUp
/// <param name="rowCount">总条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Logistics_Express
>
GetLogisticsExpressList
(
RB_Logistics_Express
query
)
public
List
<
RB_Logistics_Express
>
GetLogisticsExpressList
(
RB_Logistics_Express
query
,
string
ExpressIds
=
""
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Logistics_Express
.
Status
)}
=0 "
);
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Logistics_Express
.
Status
)}
=0 "
);
...
@@ -44,6 +44,9 @@ namespace Mall.Repository.BaseSetUp
...
@@ -44,6 +44,9 @@ namespace Mall.Repository.BaseSetUp
{
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Logistics_Express
.
Name
)}
like '%
{
query
.
Name
}
%'"
);
builder
.
Append
(
$" AND
{
nameof
(
RB_Logistics_Express
.
Name
)}
like '%
{
query
.
Name
}
%'"
);
}
}
if
(!
string
.
IsNullOrEmpty
(
ExpressIds
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Logistics_Express
.
ID
)}
in(
{
ExpressIds
}
)"
);
}
}
}
return
Get
<
RB_Logistics_Express
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Logistics_Express
>(
builder
.
ToString
()).
ToList
();
...
...
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
View file @
b5090a6e
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
/// <param name="dmodel"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetERPPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
dmodel
)
{
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetERPPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
dmodel
)
{
string
where
=
$" 1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
string
where
=
$"
where
1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
...
@@ -48,6 +48,9 @@ namespace Mall.Repository.Product
...
@@ -48,6 +48,9 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
where
+=
$" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
like '%
{
dmodel
.
OrderNo
}
%'"
;
where
+=
$" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
like '%
{
dmodel
.
OrderNo
}
%'"
;
}
}
if
(
dmodel
.
OrderSource
>
0
)
{
where
+=
$" and o.
{
nameof
(
RB_Goods_Order
.
OrderSource
)}
=
{
dmodel
.
OrderSource
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Consignee
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Consignee
))
{
{
where
+=
$" and o.
{
nameof
(
RB_Goods_Order
.
Consignee
)}
like '%
{
dmodel
.
Consignee
}
%'"
;
where
+=
$" and o.
{
nameof
(
RB_Goods_Order
.
Consignee
)}
like '%
{
dmodel
.
Consignee
}
%'"
;
...
@@ -65,12 +68,27 @@ namespace Mall.Repository.Product
...
@@ -65,12 +68,27 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
CreateDate
)}
<='
{
dmodel
.
EndTime
}
23:59:59'"
;
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
CreateDate
)}
<='
{
dmodel
.
EndTime
}
23:59:59'"
;
}
}
if
(
dmodel
.
SelectStatus
==
1
)
//待审核
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
=1"
;
}
else
if
(
dmodel
.
SelectStatus
==
2
)
//待买家处理
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
=2"
;
}
else
if
(
dmodel
.
SelectStatus
==
3
)
{
//待卖家处理
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
in(3,4)"
;
}
else
if
(
dmodel
.
SelectStatus
==
4
)
//已完成
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
in(5,6)"
;
}
string
sql
=
$@"SELECT oas.*,mu.Name as UserName FROM rb_goods_orderaftersale oas
string
sql
=
$@"SELECT oas.*,mu.Name as UserName FROM rb_goods_orderaftersale oas
INNER JOIN rb_goods_order o on oas.OrderId=o.OrderId
INNER JOIN rb_goods_order o on oas.OrderId=o.OrderId
INNER JOIN rb_goods_orderdetail od on od.Id=oas.OrderDetialId
INNER JOIN rb_goods_orderdetail od on od.Id=oas.OrderDetialId
INNER JOIN rb_member_user mu on mu.Id=oas.UserId
INNER JOIN rb_member_user mu on mu.Id=oas.UserId
{
where
}
order by Id desc"
;
{
where
}
order by
oas.ReOrder
Id desc"
;
return
GetPage
<
RB_Goods_OrderAfterSale_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_Goods_OrderAfterSale_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
...
@@ -85,7 +103,7 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
...
@@ -85,7 +103,7 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetAppletPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
dmodel
)
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetAppletPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderAfterSale_Extend
dmodel
)
{
{
string
where
=
$" 1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
string
where
=
$"
where
1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
if
(
dmodel
.
TenantId
>
0
)
{
{
...
@@ -103,14 +121,57 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
...
@@ -103,14 +121,57 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
{
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
}
if
(
dmodel
.
ReOrderStatus
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderStatus
)}
=
{(
int
)
dmodel
.
ReOrderStatus
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ReOrderNo
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ReOrderNo
))
{
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderNo
)}
like '%
{
dmodel
.
ReOrderNo
}
%'"
;
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderNo
)}
like '%
{
dmodel
.
ReOrderNo
}
%'"
;
}
}
string
sql
=
$@"SELECT oas.* FROM rb_goods_orderaftersale oas
{
where
}
order by Id desc"
;
string
sql
=
$@"SELECT oas.* FROM rb_goods_orderaftersale oas
{
where
}
order by
ReOrder
Id desc"
;
return
GetPage
<
RB_Goods_OrderAfterSale_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_Goods_OrderAfterSale_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderAfterSale_Extend
>
GetList
(
RB_Goods_OrderAfterSale_Extend
dmodel
)
{
string
where
=
$" where 1=1 and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
OrderId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
if
(
dmodel
.
OrderDetialId
>
0
)
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderDetialId
)}
=
{
dmodel
.
OrderDetialId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ReOrderNo
))
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderNo
)}
like '%
{
dmodel
.
ReOrderNo
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderDetailIds
))
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderDetialId
)}
in(
{
dmodel
.
OrderDetailIds
}
)"
;
}
string
sql
=
$@"SELECT oas.* FROM rb_goods_orderaftersale oas
{
where
}
order by oas.ReOrderId desc"
;
return
Get
<
RB_Goods_OrderAfterSale_Extend
>(
sql
).
ToList
();
}
}
}
}
}
Mall.Repository/Product/RB_Goods_OrderExpressRepository.cs
View file @
b5090a6e
...
@@ -45,6 +45,9 @@ namespace Mall.Repository.Product
...
@@ -45,6 +45,9 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderExpressIds
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderExpressIds
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_OrderExpress
.
Id
)}
in(
{
dmodel
.
OrderExpressIds
}
)"
;
where
+=
$@" and
{
nameof
(
RB_Goods_OrderExpress
.
Id
)}
in(
{
dmodel
.
OrderExpressIds
}
)"
;
}
}
if
(
dmodel
.
AfterSaleOrderId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_OrderExpress
.
AfterSaleOrderId
)}
=
{
dmodel
.
AfterSaleOrderId
}
"
;
}
string
sql
=
$@"SELECT * FROM RB_Goods_OrderExpress where
{
where
}
order by Id asc"
;
string
sql
=
$@"SELECT * FROM RB_Goods_OrderExpress where
{
where
}
order by Id asc"
;
return
Get
<
RB_Goods_OrderExpress_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Goods_OrderExpress_Extend
>(
sql
).
ToList
();
...
...
Mall.Repository/Product/RB_Goods_OrderRepository.cs
View file @
b5090a6e
...
@@ -111,6 +111,34 @@ where {where} group by o.OrderId order by o.CreateDate desc";
...
@@ -111,6 +111,34 @@ where {where} group by o.OrderId order by o.CreateDate desc";
return
GetPage
<
RB_Goods_Order_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_Goods_Order_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Order_Extend
>
GetOrderList
(
RB_Goods_Order_Extend
dmodel
)
{
string
where
=
$" 1=1 and o.
{
nameof
(
RB_Goods_Order
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
OrderId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderIds
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderId
)}
in(
{
dmodel
.
OrderIds
}
)"
;
}
string
sql
=
$@"SELECT o.* FROM rb_goods_order o
where
{
where
}
group by o.OrderId asc"
;
return
Get
<
RB_Goods_Order_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// <summary>
/// 会员购买
/// 会员购买
/// </summary>
/// </summary>
...
...
Mall.WebApi/Controllers/ByteDance/ByteDanceController.cs
0 → 100644
View file @
b5090a6e
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
using
System.Threading.Tasks
;
using
Google.Protobuf.WellKnownTypes
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
Mall.Module.User
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.ByteDance
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
ByteDanceController
:
BaseController
{
private
readonly
UserModule
userModule
=
new
UserModule
();
/// <summary>
/// 保存客户formId
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
ApiResult
SaveFormId
()
{
var
parms
=
RequestParm
;
JObject
parmsJob
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
customerId
=
parmsJob
.
GetInt
(
"customerId"
);
string
formId
=
parmsJob
.
GetStringValue
(
"formId"
);
// string openid = GetWx(code);
RB_Member_User
customerInfo
=
new
RB_Member_User
();
//判断是否绑定了openid
customerInfo
=
userModule
.
GetMemberUserInfo
(
customerId
);
if
(
customerInfo
!=
null
)
{
ByteDanceCustomer
wechatExtend
=
new
ByteDanceCustomer
{
FormCreateDate
=
System
.
DateTime
.
Now
,
FormId
=
formId
,
Openid
=
customerInfo
.
OpenId
,
UserID
=
customerInfo
.
Id
};
List
<
ByteDanceCustomer
>
listCustomerWechat
=
new
List
<
ByteDanceCustomer
>
{
wechatExtend
};
CacheManager
.
ByteDance
.
ByteDanceRedis
.
SetDyteDanceInfo
(
listCustomerWechat
);
}
return
ApiResult
.
Success
(
""
);
}
/// <summary>
/// 向客户抖音小程序发送消息
/// </summary>
/// <param name="content"></param>
/// <param name="model"></param>
/// <param name="ID"></param>
/// <param name="guestModel"></param>
public
void
SendMsg
(
string
content
,
ByteDanceCustomer
model
,
int
ID
,
RB_Member_User
userModel
)
{
//谁来接受微信消息通知
string
tempOpenId
=
model
.
Openid
;
//要使用的form_id
string
formId
=
""
;
var
list
=
CacheManager
.
ByteDance
.
ByteDanceRedis
.
GetByteDanceList
(
model
.
UserID
,
formId
);
if
(
list
!=
null
&&
list
.
Any
())
{
formId
=
list
.
OrderBy
(
x
=>
x
.
FormCreateDate
).
FirstOrDefault
().
FormId
;
string
WeChatSendTemplate
=
Common
.
Config
.
ByteDanceSendTemplate
;
var
tempData
=
new
{
keyword1
=
new
{
value
=
"旅客意见调查表"
,
},
keyword2
=
new
{
value
=
userModel
.
AliasName
,
},
keyword3
=
new
{
value
=
content
,
},
};
//拼接字符串
var
msgData
=
new
{
access_token
=
""
,
touser
=
tempOpenId
,
//openId,推送给谁,给那个用户
template_id
=
WeChatSendTemplate
,
//模板消息ID,在微信小程序后台的模板消息里有.。这个是*****成功通知。的id
// topcolor = "#173177",
page
=
""
,
//点击消息卡片之后打开的小程序页面地址,空则无跳转。
form_id
=
formId
,
//要从服务器数据库里取最近7天时间最长的一条没有使用的来,用完了要设置这个formId被用过了。
data
=
tempData
};
string
postData
=
JsonHelper
.
Serialize
(
msgData
);
string
tempUrl
=
"https://developer.toutiao.com/api/apps/game/template/send"
;
string
resulr
=
WebRequestPostOrGet
(
tempUrl
,
postData
);
CacheManager
.
ByteDance
.
ByteDanceRedis
.
RemoveCacheKey
(
model
.
UserID
.
ToString
(),
formId
,
model
);
}
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="sUrl"></param>
/// <param name="sParam"></param>
/// <returns></returns>
public
static
string
WebRequestPostOrGet
(
string
sUrl
,
string
sParam
)
{
byte
[]
bt
=
System
.
Text
.
Encoding
.
UTF8
.
GetBytes
(
sParam
);
Uri
uriurl
=
new
Uri
(
sUrl
);
HttpWebRequest
req
=
(
HttpWebRequest
)
HttpWebRequest
.
Create
(
uriurl
);
//HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url + (url.IndexOf("?") > -1 ? "" : "?") + param);
req
.
Method
=
"Post"
;
req
.
Timeout
=
120
*
1000
;
req
.
ContentType
=
"application/x-www-form-urlencoded;"
;
req
.
ContentLength
=
bt
.
Length
;
using
(
Stream
reqStream
=
req
.
GetRequestStream
())
//using 使用可以释放using段内的内存
{
reqStream
.
Write
(
bt
,
0
,
bt
.
Length
);
reqStream
.
Flush
();
}
try
{
using
(
WebResponse
res
=
req
.
GetResponse
())
{
Stream
resStream
=
res
.
GetResponseStream
();
StreamReader
resStreamReader
=
new
StreamReader
(
resStream
,
System
.
Text
.
Encoding
.
UTF8
);
string
resLine
;
System
.
Text
.
StringBuilder
resStringBuilder
=
new
System
.
Text
.
StringBuilder
();
while
((
resLine
=
resStreamReader
.
ReadLine
())
!=
null
)
{
resStringBuilder
.
Append
(
resLine
+
System
.
Environment
.
NewLine
);
}
resStream
.
Close
();
resStreamReader
.
Close
();
return
resStringBuilder
.
ToString
();
}
}
catch
(
Exception
ex
)
{
return
ex
.
Message
;
//url错误时候回报错
}
}
public
ApiResult
GetTest
()
{
string
info
=
ExecuteInCmd
(
"ipconfig"
);
// ProcessCore.ExecuteOutCmd("-I http://www.baidu.com", @"C:\curl.exe");
return
ApiResult
.
Success
(
""
,
info
);
}
/// <summary>
/// 执行外部命令
/// </summary>
/// <param name="argument">命令参数</param>
/// <param name="application">命令程序路径</param>
/// <returns>执行结果</returns>
public
static
string
ExecuteOutCmd
(
string
argument
,
string
applocaltion
)
{
using
(
var
process
=
new
System
.
Diagnostics
.
Process
())
{
process
.
StartInfo
.
Arguments
=
argument
;
process
.
StartInfo
.
FileName
=
applocaltion
;
process
.
StartInfo
.
UseShellExecute
=
false
;
process
.
StartInfo
.
RedirectStandardInput
=
true
;
process
.
StartInfo
.
RedirectStandardOutput
=
true
;
process
.
StartInfo
.
RedirectStandardError
=
true
;
process
.
StartInfo
.
CreateNoWindow
=
true
;
process
.
Start
();
process
.
StandardInput
.
AutoFlush
=
true
;
process
.
StandardInput
.
WriteLine
(
"exit"
);
//获取cmd窗口的输出信息
string
output
=
process
.
StandardOutput
.
ReadToEnd
();
process
.
WaitForExit
();
process
.
Close
();
return
output
;
}
}
/// <summary>
/// 执行内部命令(cmd.exe 中的命令)
/// </summary>
/// <param name="cmdline">命令行</param>
/// <returns>执行结果</returns>
public
static
string
ExecuteInCmd
(
string
cmdline
)
{
using
(
var
process
=
new
System
.
Diagnostics
.
Process
())
{
process
.
StartInfo
.
FileName
=
"cmd.exe"
;
process
.
StartInfo
.
UseShellExecute
=
false
;
process
.
StartInfo
.
RedirectStandardInput
=
true
;
process
.
StartInfo
.
RedirectStandardOutput
=
true
;
process
.
StartInfo
.
RedirectStandardError
=
true
;
process
.
StartInfo
.
CreateNoWindow
=
true
;
process
.
Start
();
process
.
StandardInput
.
AutoFlush
=
true
;
process
.
StandardInput
.
WriteLine
(
cmdline
+
"&exit"
);
//获取cmd窗口的输出信息
string
output
=
process
.
StandardOutput
.
ReadToEnd
();
process
.
WaitForExit
();
process
.
Close
();
return
output
;
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
b5090a6e
...
@@ -189,7 +189,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -189,7 +189,7 @@ namespace Mall.WebApi.Controllers.MallBase
y
.
OrderType
,
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
y
.
GoodsName
,
y
.
Specification
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
)
,
y
.
ProductCode
,
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Final_Price
,
y
.
Number
y
.
Number
...
@@ -219,44 +219,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -219,44 +219,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
return
orderModule
.
GetAppletMyOrderInfo
(
OrderId
,
userInfo
.
UserId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
return
orderModule
.
GetAppletMyOrderInfo
(
OrderId
,
userInfo
.
UserId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
}
/// <summary>
/// 获取我的订单商品售后初始信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletMyOrderAfterSaleInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderDetailId
=
parms
.
GetInt
(
"OrderDetailId"
,
0
);
if
(
OrderDetailId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
GetAppletMyOrderAfterSaleInfo
(
OrderDetailId
,
userInfo
.
UserId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
/// <summary>
/// 申请售后
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetAppletMyOrderAfterSale
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderDetailId
=
parms
.
GetInt
(
"OrderDetailId"
,
0
);
if
(
OrderDetailId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
ApiResult
.
Success
();
}
/// <summary>
/// <summary>
/// 获取我的订单快递信息
/// 获取我的订单快递信息
...
@@ -383,9 +346,11 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -383,9 +346,11 @@ namespace Mall.WebApi.Controllers.MallBase
if
((
item
.
Number
??
0
)
<=
0
)
{
if
((
item
.
Number
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品数量"
);
return
ApiResult
.
ParamIsNull
(
"请传递商品数量"
);
}
}
if
(
string
.
IsNullOrEmpty
(
item
.
Specification
))
{
if
(
item
.
SpecificationList
==
null
||
!
item
.
SpecificationList
.
Any
())
return
ApiResult
.
ParamIsNull
(
"请传递规格名"
);
{
return
ApiResult
.
ParamIsNull
(
"请传递规格名SpecificationList"
);
}
}
item
.
Specification
=
JsonConvert
.
SerializeObject
(
item
.
SpecificationList
);
}
}
demodel
.
BuyerMessage
??=
""
;
//买家留言
demodel
.
BuyerMessage
??=
""
;
//买家留言
...
@@ -437,6 +402,170 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -437,6 +402,170 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
}
/// <summary>
/// 获取我的订单商品售后申请页面 订单信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletMyOrderAfterSaleInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderDetailId
=
parms
.
GetInt
(
"OrderDetailId"
,
0
);
if
(
OrderDetailId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
GetAppletMyOrderAfterSaleInfo
(
OrderDetailId
,
userInfo
.
UserId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
/// <summary>
/// 申请售后
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetAppletMyOrderAfterSale
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Goods_OrderAfterSale_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderAfterSale_Extend
>(
req
.
msg
.
ToString
());
if
((
demodel
.
OrderDetialId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单明细id"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Remark
))
{
return
ApiResult
.
ParamIsNull
(
"请输入退换货原因"
);
}
if
(
demodel
.
Type
==
1
)
{
if
((
demodel
.
Refund
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入退款金额"
);
}
}
if
((
demodel
.
ReNumber
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"数量不正确"
);
}
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
Status
=
0
;
demodel
.
ReOrderStatus
=
Common
.
Enum
.
Goods
.
OrderAfterSaleStatusEnum
.
Auditing
;
if
(
demodel
.
VoucherList
!=
null
&&
demodel
.
VoucherList
.
Any
()){
demodel
.
Voucher
=
JsonConvert
.
SerializeObject
(
demodel
.
VoucherList
);
}
bool
flag
=
orderModule
.
SetAppletMyOrderAfterSale
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取买家发货页面详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletOrderBuyerToDeliverInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
GetAppletOrderBuyerToDeliverInfo
(
ReOrderId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
/// <summary>
/// 用户发货
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetAppletOrderSendGoods
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
int
ExpressId
=
parms
.
GetInt
(
"ExpressId"
,
0
);
string
ExpressNumber
=
parms
.
GetStringValue
(
"ExpressNumber"
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
if
(
ExpressId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择快递"
);
}
if
(
string
.
IsNullOrEmpty
(
ExpressNumber
))
{
return
ApiResult
.
ParamIsNull
(
"请输入快递单号"
);
}
bool
flag
=
orderModule
.
SetAppletOrderSendGoods
(
ReOrderId
,
ExpressId
,
ExpressNumber
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取售后订单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletOrderAfterSaleInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
GetAppletOrderAfterSaleInfo
(
ReOrderId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
/// <summary>
/// 售后订单分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletOrderAfterPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_OrderAfterSale_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderAfterSale_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
var
list
=
orderModule
.
GetAppletOrderAfterPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ReOrderId
,
x
.
ReOrderNo
,
OrderDetailModel
=
new
{
x
.
OrderDetailModel
.
Id
,
x
.
OrderDetailModel
.
GoodsName
,
x
.
OrderDetailModel
.
GoodsId
,
x
.
OrderDetailModel
.
CoverImagePath
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
OrderDetailModel
.
Specification
),
x
.
OrderDetailModel
.
Final_Price
},
x
.
Type
,
x
.
ReNumber
,
x
.
Remark
,
x
.
Income
,
x
.
Refund
,
x
.
RefundActual
,
x
.
ReOrderStatus
,
ReOrderStatusName
=
x
.
ReOrderStatus
.
GetEnumName
(),
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
b5090a6e
...
@@ -67,7 +67,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -67,7 +67,7 @@ namespace Mall.WebApi.Controllers.MallBase
y
.
OrderType
,
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
y
.
GoodsName
,
y
.
Specification
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
)
,
y
.
ProductCode
,
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Final_Price
,
y
.
Number
,
y
.
Number
,
...
@@ -157,6 +157,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -157,6 +157,8 @@ namespace Mall.WebApi.Controllers.MallBase
new
ExcelColumn
(
value
:
Num
.
ToString
()){
},
new
ExcelColumn
(
value
:
Num
.
ToString
()){
},
}
}
};
};
List
<
string
>
arr
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item2
.
Specification
);
item2
.
Specification
=
string
.
Join
(
","
,
arr
);
foreach
(
var
qitem
in
demodel
.
ExcelEnumIds
)
foreach
(
var
qitem
in
demodel
.
ExcelEnumIds
)
{
{
switch
(
qitem
)
switch
(
qitem
)
...
@@ -1072,6 +1074,319 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1072,6 +1074,319 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
#
endregion
#
region
售后订单
/// <summary>
/// 商品订单后台分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsOrderAfterPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_OrderAfterSale_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderAfterSale_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetGoodsOrderAfterPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ReOrderId
,
x
.
ReOrderNo
,
x
.
UserId
,
x
.
UserName
,
OrderModel
=
new
{
x
.
OrderModel
.
OrderId
,
x
.
OrderModel
.
OrderNo
,
x
.
OrderModel
.
OrderSource
,
OrderSourceName
=
x
.
OrderModel
.
OrderSource
.
GetEnumName
(),
x
.
OrderModel
.
Consignee
,
x
.
OrderModel
.
Mobile
,
x
.
OrderModel
.
Province
,
x
.
OrderModel
.
City
,
x
.
OrderModel
.
District
,
x
.
OrderModel
.
DistrictAddress
,
x
.
OrderModel
.
ShoppingAddress
},
OrderDetailModel
=
new
{
x
.
OrderDetailModel
.
Id
,
x
.
OrderDetailModel
.
GoodsName
,
x
.
OrderDetailModel
.
GoodsId
,
x
.
OrderDetailModel
.
CoverImagePath
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
OrderDetailModel
.
Specification
),
},
x
.
Type
,
x
.
ReNumber
,
x
.
Remark
,
x
.
Income
,
x
.
Refund
,
x
.
RefundActual
,
VoucherList
=
string
.
IsNullOrEmpty
(
x
.
Voucher
)?
new
List
<
string
>()
:
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
Voucher
),
x
.
ReOrderStatus
,
ReOrderStatusName
=
x
.
ReOrderStatus
.
GetEnumName
(),
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取订单售后导出选项列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOrderAfterSaleExportEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
OrderAfterSaleExportEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
/// <summary>
/// 订单售后下载
/// </summary>
[
HttpPost
]
public
FileContentResult
GetGoodsOrderAfterListToExcel
()
{
var
parms
=
RequestParm
;
RB_Goods_OrderAfterSale_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderAfterSale_Extend
>(
parms
.
msg
.
ToString
());
string
ExcelName
=
"订单售后"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
if
(
demodel
.
ExcelEnumIds
==
null
||
!
demodel
.
ExcelEnumIds
.
Any
())
{
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
var
Enumlist
=
EnumHelper
.
GetEnumList
(
typeof
(
OrderListExportEnum
));
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"序号"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
}
};
foreach
(
var
item
in
demodel
.
ExcelEnumIds
)
{
var
Name
=
Enumlist
.
Where
(
x
=>
x
.
Value
==
item
.
ToString
()).
FirstOrDefault
().
Key
??
""
;
header
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
Name
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
});
}
slist
.
Add
(
header
);
try
{
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetGoodsOrderAfterPageList
(
1
,
10000
,
out
long
count
,
demodel
);
#
region
组装数据
int
Num
=
0
;
foreach
(
var
item
in
list
)
{
Num
++;
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
Num
.
ToString
()){
},
}
};
List
<
string
>
arr
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
OrderDetailModel
.
Specification
);
string
Specification
=
string
.
Join
(
","
,
arr
);
foreach
(
var
qitem
in
demodel
.
ExcelEnumIds
)
{
switch
(
qitem
)
{
case
1
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderModel
.
OrderSource
.
GetEnumName
())
{
});
break
;
case
2
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
ReOrderNo
)
{
});
break
;
case
4
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
UserName
)
{
});
break
;
case
5
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderDetailModel
.
GoodsName
)
{
});
break
;
case
6
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
Specification
)
{
});
break
;
case
7
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
(
item
.
ReNumber
??
0
).
ToString
())
{
});
break
;
case
8
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderDetailModel
.
ProductCode
)
{
});
break
;
case
10
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderModel
.
Consignee
)
{
});
break
;
case
11
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderModel
.
Mobile
)
{
});
break
;
case
12
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
OrderModel
.
DistrictAddress
+
" "
+
item
.
OrderModel
.
ShoppingAddress
)
{
});
break
;
case
13
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
ReRemark
??
""
)
{
});
break
;
case
14
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Type
==
1
?
"退货退款"
:
"换货"
)
{
});
break
;
case
15
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
(
item
.
Refund
??
0
).
ToString
())
{
});
break
;
case
16
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Remark
)
{
});
break
;
case
17
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
))
{
});
break
;
case
18
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
ReOrderStatus
.
GetEnumName
())
{
});
break
;
case
19
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
ReExpressName
)
{
});
break
;
case
20
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
ReExpressNumber
)
{
});
break
;
}
}
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetFileFromWebApi_requestData: {0}"
,
JsonHelper
.
Serialize
(
RequestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
/// <summary>
/// 获取订单售后查询枚举
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAfterSaleSelectStatusEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
AfterSaleSelectStatusEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
/// <summary>
/// 订单售后详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOrderAfterSaleInfo
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
GetOrderAfterSaleInfo
(
ReOrderId
,
req
.
TenantId
,
req
.
MallBaseId
);
}
/// <summary>
/// 订单售后审核
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderAfterSaleAudit
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//1 审核通过 2拒绝
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
SetOrderAfterSaleAudit
(
ReOrderId
,
Type
,
req
.
TenantId
,
req
.
MallBaseId
);
}
/// <summary>
/// 订单售后收货(退货退款)
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderReceivingForReturnsAndRefunds
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
return
orderModule
.
SetOrderReceivingForReturnsAndRefunds
(
ReOrderId
,
req
.
TenantId
,
req
.
MallBaseId
);
}
/// <summary>
/// 订单售后退款
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderAfterSaleForRefunds
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ReOrderId
=
parms
.
GetInt
(
"ReOrderId"
,
0
);
decimal
Refund
=
parms
.
GetDecimal
(
"Refund"
);
if
(
ReOrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
if
(
Refund
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递金额"
);
}
return
orderModule
.
SetOrderAfterSaleForRefunds
(
ReOrderId
,
Refund
,
req
.
TenantId
,
req
.
MallBaseId
);
}
/// <summary>
/// 售后订单发货
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderAfterSaleSendGoods
()
{
var
req
=
RequestParm
;
RB_Goods_OrderExpress_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderExpress_Extend
>(
req
.
msg
.
ToString
());
if
((
demodel
.
AfterSaleOrderId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
if
(
demodel
.
Type
==
1
)
{
if
(!
demodel
.
ExpressId
.
HasValue
||
demodel
.
ExpressId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择快递公司"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ExpressNumber
))
{
return
ApiResult
.
ParamIsNull
(
"请输入快递单号"
);
}
}
else
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
Remark
))
{
return
ApiResult
.
ParamIsNull
(
"请输入物流内容"
);
}
}
demodel
.
TenantId
=
req
.
TenantId
;
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
return
orderModule
.
SetOrderAfterSaleSendGoods
(
demodel
);
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
b5090a6e
...
@@ -1304,7 +1304,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1304,7 +1304,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
GoodsWeight
,
x
.
GoodsWeight
,
x
.
InventoryNum
,
x
.
InventoryNum
,
x
.
SellingPrice
,
x
.
SellingPrice
,
x
.
SpecificationSort
x
.
SpecificationSort
,
x
.
AttrList
}),
}),
AreaList
=
model
.
AreaList
.
Select
(
x
=>
new
{
AreaList
=
model
.
AreaList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Id
,
...
@@ -1320,12 +1321,32 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1320,12 +1321,32 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
ThreeCommission
,
x
.
ThreeCommission
,
x
.
TwoCommission
x
.
TwoCommission
}),
}),
MemberPriceList
=
model
.
MemberPriceList
.
Select
(
x
=>
new
{
DistributionCommissionTreeList
=
model
.
DistributionCommissionTreeList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
SpecificationSort
,
x
.
AttrList
,
GradeCommissionList
=
x
.
GradeCommissionList
.
Select
(
y
=>
new
{
y
.
DistributorGrade
,
y
.
OneCommission
,
y
.
ThreeCommission
,
y
.
TwoCommission
})
}),
MemberPriceList
=
model
.
MemberPriceList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Id
,
x
.
MemberGrade
,
x
.
MemberGrade
,
x
.
MemberPrice
,
x
.
MemberPrice
,
x
.
SpecificationSort
x
.
SpecificationSort
}),
}),
MemberPriceTreeList
=
model
.
MemberPriceTreeList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
SpecificationSort
,
x
.
AttrList
,
GradePriceList
=
x
.
GradePriceList
.
Select
(
y
=>
new
{
y
.
MemberGrade
,
y
.
MemberPrice
})
}),
model
.
CarouselImageList
,
model
.
CarouselImageList
,
model
.
ServiceList
model
.
ServiceList
});
});
...
...
Mall.WebApi/Mall.WebApi.csproj
View file @
b5090a6e
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\ByteDance\ByteDanceController.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Content Remove="web.config" />
<Content Remove="web.config" />
</ItemGroup>
</ItemGroup>
...
@@ -25,5 +29,9 @@
...
@@ -25,5 +29,9 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\ByteDance\" />
</ItemGroup>
</Project>
</Project>
Mall.WebApi/appsettings.json
View file @
b5090a6e
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
"ProjectUrl"
:
"D:/project/GitProject/tripfriend"
,
"ProjectUrl"
:
"D:/project/GitProject/tripfriend"
,
"DeveloperKitsPort"
:
"63994"
,
"DeveloperKitsPort"
:
"63994"
,
"FirstPage"
:
"pages/index/index.html"
,
"FirstPage"
:
"pages/index/index.html"
,
"ByteDanceSendTemplate"
:
"https://developer.toutiao.com/api/apps/game/template/send"
,
"RedisSetting"
:
{
"RedisSetting"
:
{
"RedisServer"
:
"192.168.2.214"
,
"RedisServer"
:
"192.168.2.214"
,
"RedisPort"
:
"6379"
,
"RedisPort"
:
"6379"
,
...
...
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