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
6d75fcdf
Commit
6d75fcdf
authored
Jun 16, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
bc65499f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
292 additions
and
206 deletions
+292
-206
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+76
-35
MiniProgramModule.cs
Mall.Module.User/MiniProgramModule.cs
+158
-158
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+55
-12
WeChatNotifyController.cs
...WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
+3
-1
No files found.
Mall.Module.Product/OrderModule.cs
View file @
6d75fcdf
...
...
@@ -180,6 +180,7 @@ namespace Mall.Module.Product
/// 小程序基础
/// </summary>
private
readonly
RB_MallBaseRepository
mallBaseRepository
=
new
RB_MallBaseRepository
();
/// <summary>
/// 和平返佣
/// </summary>
...
...
@@ -631,7 +632,8 @@ namespace Mall.Module.Product
{
item
.
ExpressName
=
logistics_ExpressRepository
.
GetEntity
(
item
.
ExpressId
)?.
Name
??
""
;
}
else
{
else
{
item
.
ExpressName
=
item
.
Remark
;
}
}
...
...
@@ -1758,6 +1760,25 @@ namespace Mall.Module.Product
//has_goods_form= false
});
//minModel
List
<
string
>
template_message_list
=
new
List
<
string
>();
if
(
minModel
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
minModel
.
OrderSuccessTpl
))
{
template_message_list
.
Add
(
minModel
.
OrderSuccessTpl
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
minModel
.
OrderCancelTpl
))
{
template_message_list
.
Add
(
minModel
.
OrderCancelTpl
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
minModel
.
OrderDeliverGoodsTpl
))
{
template_message_list
.
Add
(
minModel
.
OrderDeliverGoodsTpl
);
}
}
var
Robj
=
new
{
mch_list
,
...
...
@@ -1784,7 +1805,7 @@ namespace Mall.Module.Product
//custom_currency_all= [],
//allZiti= false,
//hasCity= false,
template_message_list
=
new
List
<
string
>()
{
"WPELErDfYO3JnizA5Zikta6Y8qrBBAgecuj2aLoucuY"
,
"pCmTJwvTqNpyRREo7vvqIYBcrATNWoitfbLS61fLhzU"
,
"i6QPsaOHgfNwlIRMwmvFGSCqX28g0cRa8XaLZ5_gpgc"
}
template_message_list
=
template_message_list
//
new List<string>() { "WPELErDfYO3JnizA5Zikta6Y8qrBBAgecuj2aLoucuY", "pCmTJwvTqNpyRREo7vvqIYBcrATNWoitfbLS61fLhzU", "i6QPsaOHgfNwlIRMwmvFGSCqX28g0cRa8XaLZ5_gpgc" }
};
#
endregion
return
ApiResult
.
Success
(
""
,
Robj
);
...
...
@@ -2104,7 +2125,8 @@ namespace Mall.Module.Product
}
var
OrderGoodsNumList
=
new
List
<
RB_Goods_Order_Extend
>();
if
(
gList
.
Where
(
x
=>
x
.
LimitBuyGoodsNum
>
0
).
Any
())
{
if
(
gList
.
Where
(
x
=>
x
.
LimitBuyGoodsNum
>
0
).
Any
())
{
string
LimitGoodsIds
=
string
.
Join
(
","
,
gList
.
Where
(
x
=>
x
.
LimitBuyGoodsNum
>
0
).
Select
(
x
=>
x
.
Id
));
//查询用户该商品已下单数量
OrderGoodsNumList
=
goods_OrderRepository
.
GetUserOrderGoodsNum
(
demodel
.
UserId
??
0
,
LimitGoodsIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
...
...
@@ -2117,9 +2139,11 @@ namespace Mall.Module.Product
OrderNumList
=
goods_OrderRepository
.
GetUserOrderNum
(
demodel
.
UserId
??
0
,
LimitGoodsIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
}
//验证限购
if
(
OrderGoodsNumList
.
Any
()
||
OrderNumList
.
Any
())
{
if
(
OrderGoodsNumList
.
Any
()
||
OrderNumList
.
Any
())
{
List
<
int
>
GoodsIdList
=
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
??
0
).
Distinct
().
ToList
();
foreach
(
var
item
in
GoodsIdList
)
{
foreach
(
var
item
in
GoodsIdList
)
{
int
GoodsNum
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
).
Sum
(
x
=>
x
.
Number
??
0
);
var
gmodel
=
gList
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
();
if
(
gmodel
==
null
||
gmodel
.
GoodsStatus
!=
1
)
...
...
@@ -2138,7 +2162,8 @@ namespace Mall.Module.Product
}
}
}
if
(
gmodel
.
LimitBuyOrderNum
>
0
)
{
if
(
gmodel
.
LimitBuyOrderNum
>
0
)
{
var
ogModel
=
OrderNumList
.
Where
(
x
=>
x
.
GoodsId
==
gmodel
.
Id
).
FirstOrDefault
();
if
(
ogModel
!=
null
)
{
...
...
@@ -2616,13 +2641,14 @@ namespace Mall.Module.Product
if
(
umodel
.
CouponsNum
<
0
)
{
umodel
.
CouponsNum
=
0
;
}
keyValues
.
Add
(
nameof
(
RB_Member_User_Extend
.
CouponsNum
),
umodel
.
CouponsNum
);
}
if
(
demodel
.
Use_Integral
==
1
&&
TotalIntegralNumber
>
0
)
{
if
(
demodel
.
Use_Integral
==
1
&&
TotalIntegralNumber
>
0
)
{
keyValues
.
Add
(
nameof
(
RB_Member_User_Extend
.
Integral
),
(
umodel
.
Integral
??
0
));
member_IntegralRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Member_Integral
()
{
Id
=
0
,
CreateDate
=
DateTime
.
Now
,
Description
=
"订单使用积分抵扣"
+
TotalIntegralMoney
+
"元,订单号:"
+
demodel
.
OrderNo
,
Description
=
"订单使用积分抵扣"
+
TotalIntegralMoney
+
"元,订单号:"
+
demodel
.
OrderNo
,
Image
=
0
,
Integral
=
TotalIntegralNumber
,
MallBaseId
=
demodel
.
MallBaseId
,
...
...
@@ -2731,7 +2757,8 @@ namespace Mall.Module.Product
public
string
SetAppletGoodsOrderOtherPay
(
int
orderId
,
int
type
,
AppletUserInfo
userInfo
)
{
var
omodel
=
goods_OrderRepository
.
GetEntity
(
orderId
);
if
(
omodel
==
null
)
{
if
(
omodel
==
null
)
{
return
"订单不存在,请核实后再试"
;
}
var
umodel
=
member_UserRepository
.
GetEntity
(
userInfo
.
UserId
);
...
...
@@ -2746,14 +2773,16 @@ namespace Mall.Module.Product
return
"暂不支持该支付方式"
;
}
}
else
if
(
type
==
2
)
{
else
if
(
type
==
2
)
{
if
(!(
","
+
mallModel
.
PayWay
+
","
).
Contains
(
","
+
(
int
)
OrderPaymentTypeEnum
.
YEPayment
+
","
))
{
return
"暂不支持该支付方式"
;
}
}
}
else
{
else
{
return
"暂不支持该支付方式"
;
}
if
(
type
==
1
)
...
...
@@ -2771,14 +2800,17 @@ namespace Mall.Module.Product
}
};
bool
flag
=
goods_OrderRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
return
""
;
}
return
"支付失败,请联系管理员"
;
}
else
{
if
((
omodel
.
Income
??
0
)
>
(
umodel
.
Balance
??
0
))
{
return
"您当前余额不足:"
+
(
umodel
.
Balance
??
0
);
else
{
if
((
omodel
.
Income
??
0
)
>
(
umodel
.
Balance
??
0
))
{
return
"您当前余额不足:"
+
(
umodel
.
Balance
??
0
);
}
//更新订单信息
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -3428,9 +3460,9 @@ namespace Mall.Module.Product
UpdateDate
=
DateTime
.
Now
,
IsComment
=
2
,
FreightMoney
=
item
.
FreightMoney
,
IntegralMoney
=
item
.
IntegralMoney
,
IntegralNumber
=
item
.
IntegralNumber
,
CouponMoney
=
item
.
CouponMoney
,
IntegralMoney
=
item
.
IntegralMoney
,
IntegralNumber
=
item
.
IntegralNumber
,
CouponMoney
=
item
.
CouponMoney
,
IntegralGoodsPresent
=
IntegralPresent
},
trans
);
item
.
Id
=
detailId
;
...
...
@@ -3672,14 +3704,16 @@ namespace Mall.Module.Product
TenantId
=
tenantId
});
if
(
item
.
IntegralNumber
>
0
)
{
if
(
item
.
IntegralNumber
>
0
)
{
TotalIntegralNumber
+=
(
item
.
IntegralNumber
??
0
);
}
}
}
var
umodel
=
member_UserRepository
.
GetEntity
(
omodel
.
UserId
);
//积分抵扣回滚
if
(
TotalIntegralNumber
>
0
)
{
if
(
TotalIntegralNumber
>
0
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_User_Extend
.
Integral
),
umodel
.
Integral
+
TotalIntegralNumber
}
};
...
...
@@ -3691,7 +3725,8 @@ namespace Mall.Module.Product
}
};
bool
flag2
=
member_UserRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
if
(
flag2
)
{
if
(
flag2
)
{
member_IntegralRepository
.
Insert
(
new
Model
.
Entity
.
User
.
RB_Member_Integral
()
{
Id
=
0
,
...
...
@@ -3710,9 +3745,11 @@ namespace Mall.Module.Product
}
}
//优惠券回滚
if
(!
string
.
IsNullOrEmpty
(
omodel
.
CouponsIds
))
{
if
(!
string
.
IsNullOrEmpty
(
omodel
.
CouponsIds
))
{
var
cList
=
member_CouponRepository
.
GetList
(
new
RB_Member_DiscountCoupon_Extend
()
{
UseState
=
1
,
Ids
=
omodel
.
CouponsIds
,
UserId
=
omodel
.
UserId
,
TenantId
=
omodel
.
TenantId
,
MallBaseId
=
omodel
.
MallBaseId
});
foreach
(
var
item
in
cList
)
{
foreach
(
var
item
in
cList
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_DiscountCoupon_Extend
.
UseState
),
0
}
};
...
...
@@ -4672,7 +4709,7 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
SetOrderAfterSaleAudit
(
int
reOrderId
,
int
type
,
int
DeliveryId
,
int
tenantId
,
int
mallBaseId
)
public
ApiResult
SetOrderAfterSaleAudit
(
int
reOrderId
,
int
type
,
int
DeliveryId
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderAfterSaleRepository
.
GetEntity
(
reOrderId
);
if
(
model
==
null
)
...
...
@@ -4873,7 +4910,7 @@ namespace Mall.Module.Product
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"自动生成财务退款单据:"
+
apir
.
data
.
ToString
(),
Content
=
"自动生成财务退款单据:"
+
apir
.
data
.
ToString
(),
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
dmodel
.
MallBaseId
,
ReOrderId
=
dmodel
.
ReOrderId
,
...
...
@@ -4968,7 +5005,7 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
bool
SetOrderAfterSaleForRefunds
(
int
reOrderId
,
decimal
refund
,
string
RefundOrderNo
,
int
tenantId
,
int
mallBaseId
)
public
bool
SetOrderAfterSaleForRefunds
(
int
reOrderId
,
decimal
refund
,
string
RefundOrderNo
,
int
tenantId
,
int
mallBaseId
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -5769,14 +5806,18 @@ namespace Mall.Module.Product
}
//积分赠送
var
dlist
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
OrderId
=
orderModel
.
OrderId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(
dlist
.
Any
())
{
if
(
dlist
.
Any
())
{
int
IntegralGoodsPresent
=
0
;
foreach
(
var
item
in
dlist
)
{
if
(
item
.
IntegralGoodsPresent
>
0
)
{
foreach
(
var
item
in
dlist
)
{
if
(
item
.
IntegralGoodsPresent
>
0
)
{
IntegralGoodsPresent
+=
(
item
.
IntegralGoodsPresent
??
0
);
}
}
if
(
IntegralGoodsPresent
>
0
)
{
if
(
IntegralGoodsPresent
>
0
)
{
//保存积分赠送
var
umodel
=
member_UserRepository
.
GetEntity
(
orderModel
.
UserId
);
//用户订单数增加
...
...
Mall.Module.User/MiniProgramModule.cs
View file @
6d75fcdf
...
...
@@ -462,7 +462,7 @@ namespace Mall.Module.User
extModel
.
FavoriteFootMenuList
=
menuList
?.
Where
(
qitem
=>
qitem
.
MenuType
==
1
)?.
ToList
();
extModel
.
OrderMenuList
=
menuList
?.
Where
(
qitem
=>
qitem
.
MenuType
==
3
)?.
ToList
();
extModel
.
AccountMenuList
=
menuList
?.
Where
(
qitem
=>
qitem
.
MenuType
==
2
)?.
ToList
();
extModel
.
SelfMenuList
=
menuList
?.
Where
(
qitem
=>
qitem
.
MenuType
==
4
).
OrderBy
(
qitem
=>
qitem
.
PageSort
)?.
ToList
();
extModel
.
SelfMenuList
=
menuList
?.
Where
(
qitem
=>
qitem
.
MenuType
==
4
).
OrderBy
(
qitem
=>
qitem
.
PageSort
)?.
ToList
();
}
}
if
(
isGetHomeData
)
...
...
@@ -1046,23 +1046,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
OrderSuccessTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.OrderSuccessTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1135,23 +1135,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
OrderCancelTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.OrderCancelTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1226,23 +1226,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
OrderDeliverGoodsTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.OrderDeliverGoodsTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1315,23 +1315,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
RefundTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.RefundTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1399,23 +1399,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
ActiveStateTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.ActiveStateTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1486,23 +1486,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
AuditResultTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.AuditResultTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1574,23 +1574,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
ReflectSuccessTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.ReflectSuccessTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1652,23 +1652,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
MallBaseId
=
MallBaseId
,
TempleteId
=
appletWeChatModel
.
ReflectFailTpl
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, MallBaseId = MallBaseId, TempleteId = appletWeChatModel.ReflectFailTpl, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1730,23 +1730,23 @@ namespace Mall.Module.User
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
var
list
=
subscriptionRepository
.
GetList
(
new
RB_Member_Subscription_Extend
()
{
OpenId
=
OpenId
,
Type
=
1
,
TempleteId
=
appletWeChatModel
.
MembersLevelChangeTpl
,
MallBaseId
=
MallBaseId
,
TenantId
=
TenantId
});
if
(
list
.
Any
())
{
// 减少订阅次数
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Member_Subscription
.
Count
),
model
.
Count
>
0
?(
model
.
Count
--):
0
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Subscription
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
subscriptionRepository
.
Update
(
files
,
wheres
);
}
//
var list = subscriptionRepository.GetList(new RB_Member_Subscription_Extend() { OpenId = OpenId, Type = 1, TempleteId = appletWeChatModel.MembersLevelChangeTpl, MallBaseId = MallBaseId, TenantId = TenantId });
//
if (list.Any())
//
{
//
// 减少订阅次数
//
var model = list.FirstOrDefault();
//
Dictionary<string, object> files = new Dictionary<string, object>() {
//
{ nameof(RB_Member_Subscription.Count),model.Count>0?( model.Count--):0 }
//
};
//
List<WhereHelper> wheres = new List<WhereHelper>() {
//
new WhereHelper(){
//
FiledName=nameof(RB_Member_Subscription.Id),
//
FiledValue=model.Id,
//
OperatorEnum=OperatorEnum.Equal
//
}
//
};
//
subscriptionRepository.Update(files, wheres);
//
}
return
true
;
}
else
...
...
@@ -1997,7 +1997,7 @@ namespace Mall.Module.User
var
obj
=
new
{
//支付订单数
OrderCount
=
list
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)??
0
,
OrderCount
=
list
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
//支付金额
Income
=
list
?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
,
...
...
Mall.Module.User/UserCommonModule.cs
View file @
6d75fcdf
...
...
@@ -44,20 +44,25 @@ namespace Mall.Module.User
/// 订单信息
/// </summary>
private
readonly
RB_Goods_OrderRepository
goods_OrderRepository
=
new
RB_Goods_OrderRepository
();
/// <summary>
/// 订单商品信息
/// </summary>
private
readonly
RB_Goods_OrderDetailRepository
goodsOrderDetailRepository
=
new
RB_Goods_OrderDetailRepository
();
/// <summary>
/// 会员信息
/// </summary>
private
readonly
RB_Member_UserRepository
member_UserRepository
=
new
RB_Member_UserRepository
();
private
readonly
MiniProgramModule
appletWeChatModule
=
new
MiniProgramModule
();
/// <summary>
/// 初始化分销基础配置
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
bool
InitializeDistributorBasicsInfo
(
int
TenantId
,
int
MallBaseId
)
public
bool
InitializeDistributorBasicsInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
OModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
OModel
==
null
)
...
...
@@ -93,7 +98,8 @@ namespace Mall.Module.User
HpReferralsGradeAudit
=
2
})
>
0
;
}
else
{
else
{
return
true
;
}
}
...
...
@@ -112,7 +118,7 @@ namespace Mall.Module.User
{
Id
=
0
,
ApplicationAgreement
=
"分销申请协议"
,
HeadImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968479000.png"
),
HeadImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968479000.png"
),
BottomImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968716000.png"
),
ButtonColor
=
"#FF4544"
,
ButtonFilletPX
=
40
,
...
...
@@ -149,7 +155,8 @@ namespace Mall.Module.User
UpdateDate
=
DateTime
.
Now
})
>
0
;
}
else
{
else
{
return
true
;
}
}
...
...
@@ -160,7 +167,8 @@ namespace Mall.Module.User
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
bool
InitializeCategoryStyleInfo
(
int
TenantId
,
int
MallBaseId
)
{
public
bool
InitializeCategoryStyleInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
OModel
=
product_CategoryStyleRepository
.
GetList
(
new
RB_Product_CategoryStyle_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
OModel
==
null
)
{
...
...
@@ -177,7 +185,8 @@ namespace Mall.Module.User
UpdateDate
=
DateTime
.
Now
})
>
0
;
}
else
{
else
{
return
true
;
}
}
...
...
@@ -188,7 +197,8 @@ namespace Mall.Module.User
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
bool
InitializeProductRecommendInfo
(
int
TenantId
,
int
MallBaseId
)
{
public
bool
InitializeProductRecommendInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
oModel
=
product_RecommendRepository
.
GetList
(
new
RB_Product_Recommend_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
oModel
==
null
)
{
...
...
@@ -209,7 +219,8 @@ namespace Mall.Module.User
UpdateDate
=
DateTime
.
Now
})
>
0
;
}
else
{
else
{
return
true
;
}
}
...
...
@@ -226,11 +237,28 @@ namespace Mall.Module.User
/// <param name="Money">金额</param>
/// <param name="Pay_Result">状态</param>
/// <returns></returns>
public
bool
InsertOrderPayInfo
(
int
UserId
,
int
OrderId
,
string
Out_Trade_No
,
string
Transaction_Id
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
PayWay
,
string
PayType
,
decimal
Money
,
DateTime
Time_End
,
int
Pay_Result
)
{
public
bool
InsertOrderPayInfo
(
int
UserId
,
int
OrderId
,
string
Out_Trade_No
,
string
Transaction_Id
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
PayWay
,
string
PayType
,
decimal
Money
,
DateTime
Time_End
,
int
Pay_Result
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
UserId
);
if
(
umodel
==
null
)
{
if
(
umodel
==
null
)
{
return
false
;
}
//判断订单状态是否是待支付 2020-06-16 Add By:W
var
oldOrder
=
goods_OrderRepository
.
GetEntity
(
OrderId
);
if
(
oldOrder
==
null
)
{
return
false
;
}
if
(
oldOrder
.
OrderStatus
!=
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
NonPayment
)
{
return
false
;
}
//获取订单商品
var
orderGoodsList
=
goodsOrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
{
TenantId
=
oldOrder
.
TenantId
,
MallBaseId
=
oldOrder
.
MallBaseId
,
OrderId
=
oldOrder
.
OrderId
});
bool
flag
=
goods_Online_TradeRepository
.
Insert
(
new
Model
.
Entity
.
Product
.
RB_Goods_Online_Trade
()
{
Id
=
0
,
...
...
@@ -254,7 +282,8 @@ namespace Mall.Module.User
Transaction_Id
=
Transaction_Id
,
Type
=
1
})
>
0
;
if
(
flag
)
{
if
(
flag
)
{
//更新订单信息
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_Order_Extend
.
OrderStatus
),
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
WaitSendGoods
},
...
...
@@ -287,6 +316,20 @@ namespace Mall.Module.User
};
member_UserRepository
.
Update
(
keyValues1
,
wheres1
);
}
//发送订阅消息
string
goodsName
=
orderGoodsList
.
FirstOrDefault
().
GoodsName
;
if
(
orderGoodsList
.
Count
>
1
)
{
goodsName
+=
"等"
+
orderGoodsList
.
Count
+
"件商品"
;
}
appletWeChatModule
.
SendOrderSucceedMsg
(
oldOrder
.
TenantId
,
oldOrder
.
MallBaseId
,
umodel
.
OpenId
,
oldOrder
.
OrderNo
,
oldOrder
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
"微信"
,
goodsName
);
}
return
flag
;
}
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
View file @
6d75fcdf
...
...
@@ -68,6 +68,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#
region
新增订单支付信息
userCommonModule
.
InsertOrderPayInfo
(
UserId
,
OrderId
,
sOrderNo
,
TransactionId
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
.
WeChatPay
,
PayType
,
dPaid
,
PayDate
,
0
);
#
endregion
}
//告诉微信我们已经处理成功,不需要再调用我们的接口了
...
...
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