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
b8e5b6b5
Commit
b8e5b6b5
authored
Aug 12, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
33451a62
73f54d9a
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
646 additions
and
40 deletions
+646
-40
AppletUserInfo.cs
Mall.Common/API/AppletUserInfo.cs
+4
-0
RB_Groupbuy_Activity.cs
Mall.Model/Entity/Product/RB_Groupbuy_Activity.cs
+5
-0
RB_Groupbuy_Activity_Specificationprice.cs
...Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
+1
-5
RB_SmallShops_Custom.cs
Mall.Model/Entity/User/RB_SmallShops_Custom.cs
+284
-0
RB_Groupbuy_Activity_Extend.cs
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Extend.cs
+4
-1
FinanceModule.cs
Mall.Module.Product/FinanceModule.cs
+27
-2
GroupBuyConfigActivityModule.cs
Mall.Module.Product/GroupBuyConfigActivityModule.cs
+79
-20
Mall.Module.Product.csproj
Mall.Module.Product/Mall.Module.Product.csproj
+1
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+100
-1
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+14
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+4
-0
GroupBuyController.cs
Mall.WebApi/Controllers/Product/GroupBuyController.cs
+8
-1
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+13
-6
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+100
-2
SupplierController.cs
Mall.WebApi/Controllers/User/SupplierController.cs
+2
-2
No files found.
Mall.Common/API/AppletUserInfo.cs
View file @
b8e5b6b5
...
...
@@ -35,6 +35,10 @@ namespace Mall.Common
/// </summary>
public
int
UserId
{
get
;
set
;
}
/// 用户店铺id
/// </summary>
public
int
SmallShopId
{
get
;
set
;
}
/// <summary>
/// 唯一码
/// </summary>
...
...
Mall.Model/Entity/Product/RB_Groupbuy_Activity.cs
View file @
b8e5b6b5
...
...
@@ -193,5 +193,10 @@ namespace Mall.Model.Entity.Product
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 是否自定义规格 1是 2否
/// </summary>
public
int
IsCustomSpecification
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
View file @
b8e5b6b5
...
...
@@ -138,10 +138,6 @@ namespace Mall.Model.Entity.Product
get
;
set
;
}
/// <summary>
/// 阶梯编号
/// </summary>
public
int
StepId
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_SmallShops_Custom.cs
0 → 100644
View file @
b8e5b6b5
using
VT.FW.DB
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 微店自定义表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_SmallShops_Custom
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 头部背景图片
/// </summary>
public
string
HeadBackImage
{
get
;
set
;
}
/// <summary>
/// 提现按钮圆角像素
/// </summary>
public
int
?
WithdrawalFilletPX
{
get
;
set
;
}
/// <summary>
/// 提现按钮文本
/// </summary>
public
string
WithdrawalText
{
get
;
set
;
}
/// <summary>
/// 提现按钮颜色
/// </summary>
public
string
WithdrawalColor
{
get
;
set
;
}
/// <summary>
/// 按钮文字颜色
/// </summary>
public
string
WithdrawalTextColor
{
get
;
set
;
}
/// <summary>
/// 提现图标
/// </summary>
public
string
WithdrawalImage
{
get
;
set
;
}
/// <summary>
/// 店铺订单名称
/// </summary>
public
string
SmallShopOrderName
{
get
;
set
;
}
/// <summary>
/// 店铺订单图片
/// </summary>
public
string
SmallShopOrderImage
{
get
;
set
;
}
/// <summary>
/// 提现明细
/// </summary>
public
string
WithdrawalDetailName
{
get
;
set
;
}
/// <summary>
/// 提现明细图片
/// </summary>
public
string
WithdrawalDetailImage
{
get
;
set
;
}
/// <summary>
/// 我的客户
/// </summary>
public
string
MyCustomerName
{
get
;
set
;
}
/// <summary>
/// 我的客户图片
/// </summary>
public
string
MyCustomerImage
{
get
;
set
;
}
/// <summary>
/// 店铺二维码
/// </summary>
public
string
SmallShopQRCodeName
{
get
;
set
;
}
/// <summary>
/// 店铺二维码图片
/// </summary>
public
string
SmallShopQRCodeImage
{
get
;
set
;
}
/// <summary>
/// 店铺设置
/// </summary>
public
string
SmallShopSetUpName
{
get
;
set
;
}
/// <summary>
/// 店铺设置图片
/// </summary>
public
string
SmallShopSetUpImage
{
get
;
set
;
}
/// <summary>
/// 直播名称
/// </summary>
public
string
LiveName
{
get
;
set
;
}
/// <summary>
/// 直播图标
/// </summary>
public
string
LiveImage
{
get
;
set
;
}
/// <summary>
/// 已提现佣金描述
/// </summary>
public
string
CommissionWithdrawnName
{
get
;
set
;
}
/// <summary>
/// 未结算佣金描述
/// </summary>
public
string
OutstandingCommissionName
{
get
;
set
;
}
/// <summary>
/// 可提现佣金描述
/// </summary>
public
string
WithdrawableName
{
get
;
set
;
}
///// <summary>
///// 分销商描述
///// </summary>
//public string DistributorName
//{
// get;
// set;
//}
///// <summary>
///// 待打款佣金描述
///// </summary>
//public string CommissionTobePaidName
//{
// get;
// set;
//}
///// <summary>
///// 用户须知描述
///// </summary>
//public string UserNotesName
//{
// get;
// set;
//}
///// <summary>
///// 我要提现描述
///// </summary>
//public string IWantToWithdrawName
//{
// get;
// set;
//}
///// <summary>
///// 提现金额描述
///// </summary>
//public string WithdrawalAmountName
//{
// get;
// set;
//}
///// <summary>
///// 提现方式描述
///// </summary>
//public string WithdrawalWayName
//{
// get;
// set;
//}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Extend.cs
View file @
b8e5b6b5
...
...
@@ -127,6 +127,9 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
SpecificationPriceList
{
get
;
set
;
}
/// <summary>
/// 服务列表
/// </summary>
public
List
<
RB_ImageCommonModel
>
ServiceList
{
get
;
set
;
}
}
}
Mall.Module.Product/FinanceModule.cs
View file @
b8e5b6b5
...
...
@@ -236,7 +236,7 @@ namespace Mall.Module.Finance
#
region
财务记录
public
bool
SetFinanceRecord
(
RB_Finance_Record_Extend
model
)
public
bool
SetFinanceRecord
(
RB_Finance_Record_Extend
model
,
List
<
Model
.
Extend
.
Product
.
RB_Goods_OrderDetail_Extend
>
list
)
{
bool
flag
=
false
;
var
trans
=
financeRecordRepository
.
DbTransaction
;
...
...
@@ -251,16 +251,41 @@ namespace Mall.Module.Finance
{
model
.
RecordDetailList
.
ForEach
(
x
=>
x
.
RecordId
=
recordId
);
model
.
RecordDetailList
.
ForEach
(
x
=>
x
.
FinanceId
=
model
.
FinanceId
);
financeRecordDetailRepository
.
InsertBatch
(
model
.
RecordDetailList
,
trans
);
}
foreach
(
var
item
in
model
.
RecordDetailList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>();
if
(
list
.
Any
(
x
=>
x
.
Id
==
item
.
OrderDetailId
&&
x
.
FinanceType
==
1
)&&
list
.
Any
(
x
=>
x
.
Id
==
item
.
OrderDetailId
&&
x
.
FinanceType
==
2
))
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
),
model
.
FinanceId
},
{
nameof
(
RB_Goods_OrderDetail
.
FreightFinanceId
),
model
.
FinanceId
},
{
nameof
(
RB_Goods_OrderDetail
.
PaidCostMoney
),
item
.
OrderDetailPaid
}
};
}
else
if
(
list
.
Any
(
x
=>
x
.
Id
==
item
.
OrderDetailId
&&
x
.
FinanceType
==
1
))
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
),
model
.
FinanceId
},
{
nameof
(
RB_Goods_OrderDetail
.
PaidCostMoney
),
item
.
OrderDetailPaid
}
};
}
else
if
(
list
.
Any
(
x
=>
x
.
Id
==
item
.
OrderDetailId
&&
x
.
FinanceType
==
2
))
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderDetail
.
FreightFinanceId
),
model
.
FinanceId
},
{
nameof
(
RB_Goods_OrderDetail
.
PaidCostMoney
),
item
.
OrderDetailPaid
}
};
}
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Finance_Configurine_Extend
.
Id
),
...
...
Mall.Module.Product/GroupBuyConfigActivityModule.cs
View file @
b8e5b6b5
using
Mall.Model.Extend.Product
;
using
Mall.Repository.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
System.Linq
;
using
Mall.Model.Entity.Product
;
using
Mall.AOP.CustomerAttribute
;
namespace
Mall.Module.Product
{
...
...
@@ -176,7 +175,8 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetGroupbuyActivityModule
(
RB_Groupbuy_Activity_Extend
extModel
)
[
TransactionCallHandler
]
public
virtual
bool
SetGroupbuyActivityModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
ActivityId
>
0
)
...
...
@@ -216,6 +216,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Groupbuy_Activity_Extend
.
CardIds
),
extModel
.
CardIds
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
App_share_title
),
extModel
.
App_share_title
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
App_share_pic
),
extModel
.
App_share_pic
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
IsCustomSpecification
),
extModel
.
IsCustomSpecification
},
};
flag
=
groupbuy_ActivityRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Extend
.
ActivityId
),
extModel
.
ActivityId
));
}
...
...
@@ -227,14 +228,57 @@ namespace Mall.Module.Product
}
if
(
flag
)
{
if
(
extModel
.
SpecificationList
!=
null
&&
extModel
.
SpecificationList
.
Count
>
0
)
flag
=
SetGoodsSpecificationModule
(
extModel
);
flag
=
SetGoodGroupStepModule
(
extModel
);
}
flag
=
false
;
return
flag
;
}
/// <summary>
/// 添加修改商品规格
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private
bool
SetGoodsSpecificationModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
IsCustomSpecification
==
1
)
{
var
oldSpecList
=
GetGroupbuyActivitySpecificationListModule
(
new
RB_Groupbuy_Activity_Specification_Extend
()
{
MallBaseId
=
extModel
.
MallBaseId
,
TenantId
=
extModel
.
TenantId
,
GoodsId
=
extModel
.
GoodId
,
});
if
(
oldSpecList
.
Count
()
!=
extModel
.
SpecificationList
.
Count
()
||
oldSpecList
.
Count
()
!=
extModel
.
SpecificationList
.
Where
(
x
=>
x
.
Id
>
0
).
Count
())
{
//删除规格
IList
<
WhereHelper
>
specWheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
),
extModel
.
TenantId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
),
extModel
.
GoodId
),
};
groupbuy_Activity_SpecificationRepository
.
Delete
(
specWheres
);
//删除值
IList
<
WhereHelper
>
specValuesWheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
),
extModel
.
TenantId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
),
extModel
.
GoodId
),
};
groupbuy_Activity_SpecificationValueRepository
.
Delete
(
specValuesWheres
);
foreach
(
var
specItem
in
extModel
.
SpecificationList
)
{
specItem
.
TenantId
=
extModel
.
TenantId
;
specItem
.
MallBaseId
=
extModel
.
MallBaseId
;
specItem
.
GoodsId
=
extModel
.
GoodId
;
var
newSpecId
=
groupbuy_Activity_SpecificationRepository
.
Insert
(
specItem
);
specItem
.
Id
=
newSpecId
;
if
(
specItem
.
SpecificationValueList
!=
null
&&
specItem
.
SpecificationValueList
.
Count
>
0
)
{
foreach
(
var
specValueItem
in
specItem
.
SpecificationValueList
)
...
...
@@ -243,30 +287,45 @@ namespace Mall.Module.Product
specValueItem
.
TenantId
=
extModel
.
TenantId
;
specValueItem
.
SpecificationId
=
newSpecId
;
specValueItem
.
GoodsId
=
extModel
.
GoodId
;
var
newSpecValueId
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
)
;
flag
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
)
>
0
;
}
}
}
}
else
{
}
}
return
flag
;
}
if
(
extModel
.
GroupList
!=
null
&&
extModel
.
GroupList
.
Count
>
0
)
/// <summary>
/// 新增修改阶梯团价
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private
bool
SetGoodGroupStepModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
GroupList
!=
null
&&
extModel
.
GroupList
.
Count
>
0
)
{
foreach
(
var
groupItem
in
extModel
.
GroupList
)
{
foreach
(
var
groupItem
in
extModel
.
GroupList
)
groupItem
.
TenantId
=
extModel
.
TenantId
;
groupItem
.
MallBaseId
=
extModel
.
MallBaseId
;
groupItem
.
GoodId
=
extModel
.
GoodId
;
var
newGroupId
=
stepRepository
.
Insert
(
groupItem
);
flag
=
newGroupId
>
0
;
if
(
newGroupId
>
0
)
{
groupItem
.
TenantId
=
extModel
.
TenantId
;
groupItem
.
MallBaseId
=
extModel
.
MallBaseId
;
groupItem
.
GoodId
=
extModel
.
GoodId
;
var
newGroupId
=
stepRepository
.
Insert
(
groupItem
);
if
(
newGroupId
>
0
)
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
priceItem
.
TenantId
=
extModel
.
TenantId
;
priceItem
.
GoodsId
=
extModel
.
GoodId
;
priceItem
.
StepId
=
newGroupId
;
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
);
}
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
priceItem
.
TenantId
=
extModel
.
TenantId
;
priceItem
.
GoodsId
=
extModel
.
GoodId
;
//priceItem.StepId = newGroupId;
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
);
}
}
}
...
...
Mall.Module.Product/Mall.Module.Product.csproj
View file @
b8e5b6b5
...
...
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
...
...
Mall.Module.User/UserModule.cs
View file @
b8e5b6b5
...
...
@@ -6069,6 +6069,9 @@ namespace Mall.Module.User
#
region
申请微店
public
bool
ApplySmallShopsInfo
(
RB_SmallShops_Info_Extend
model
)
{
if
(
model
.
Id
==
0
)
...
...
@@ -6088,7 +6091,103 @@ namespace Mall.Module.User
return
smallShopsInfoRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 小程序用户更新微信名称、logo、公告
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
UpdateShopsInfo
(
RB_SmallShops_Info_Extend
model
)
{
if
(
model
.
Id
>
0
)
{
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info
.
Name
),
model
.
Name
},
{
nameof
(
RB_SmallShops_Info
.
Logo
),
model
.
Logo
},
{
nameof
(
RB_SmallShops_Info
.
Notice
),
model
.
Notice
},
{
nameof
(
RB_SmallShops_Info
.
UpdateDate
),
model
.
UpdateDate
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Info
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
smallShopsInfoRepository
.
Update
(
fileds
,
whereHelpers
);
}
return
false
;
}
/// <summary>
/// 获取粉象我的团队标题列表
/// </summary>
/// <param name="userInfo"></param>
/// <returns></returns>
public
object
GerSmallShopsMyTeamTitelListForFX
(
AppletUserInfo
userInfo
)
{
string
UserIds
=
member_UserRepository
.
GetSmallShopChildIdStr
(
userInfo
.
SmallShopId
);
//获取下级所有等级
var
disList
=
distributor_InfoRepository
.
GetFXGreadeListForMyTeam
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
UserIds
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
var
fxList
=
new
List
<
RB_Distributor_FXGrade_Extend
>();
if
(
disList
.
Where
(
x
=>
x
.
FXGradeId
>
0
).
Any
())
{
string
fxgradeIds
=
string
.
Join
(
","
,
disList
.
Select
(
x
=>
x
.
FXGradeId
));
fxList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
GradeIds
=
fxgradeIds
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
fxList
=
fxList
.
OrderByDescending
(
x
=>
x
.
Grade
).
ToList
();
//倒序 最大的拍前面
}
else
{
//增加一个 普通会员等级
fxList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
IsGuest
=
1
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
}
return
fxList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
GradeName
});
}
/// <summary>
/// 获取我的团队 (粉象)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
object
GetSmallShopsMyTeamPageListForFX
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Distributor_Info_Extend
demodel
)
{
string
UserIds
=
member_UserRepository
.
GetSmallShopChildIdStr
(
demodel
.
UserId
??
0
);
var
list
=
member_UserRepository
.
GetPageListForFX
(
pageIndex
,
pageSize
,
out
count
,
new
RB_Member_User_Extend
()
{
UserIds
=
UserIds
,
FXGradeId
=
demodel
.
FXGradeId
,
Name
=
demodel
.
Name
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
List
<
object
>
RList
=
new
List
<
object
>();
if
(
list
.
Any
())
{
string
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
//获取推广人数
var
tList
=
member_UserRepository
.
GetDistributorReferralsNum
(
userIds
,
1
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
//获取消费金额 + 订单数量
var
oList
=
goods_OrderRepository
.
GetUserOrderNumAndMoney
(
userIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
#
endregion
foreach
(
var
item
in
list
)
{
int
tgNum
=
tList
.
Where
(
x
=>
x
.
SuperiorId
==
item
.
Id
).
FirstOrDefault
()?.
ReferralsNum
??
0
;
var
orderModel
=
oList
.
Where
(
x
=>
x
.
UserId
==
item
.
Id
).
FirstOrDefault
();
RList
.
Add
(
new
{
UserId
=
item
.
Id
,
UserName
=
item
.
Name
,
item
.
Photo
,
CreateDate
=
item
.
CreateDate
.
HasValue
?
item
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
GeneralizeNum
=
tgNum
,
OrderNum
=
orderModel
?.
OrderNum
??
0
,
Income
=
orderModel
?.
Income
??
0
});
}
}
return
RList
;
}
#
endregion
}
}
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
b8e5b6b5
...
...
@@ -797,5 +797,19 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
}
#
endregion
#
region
微店
/// <summary>
/// 获取微店所有的id (包括自己)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
string
GetSmallShopChildIdStr
(
int
id
)
{
string
sql
=
$@" select GetSmallShopChildrenList_AllUser(
{
id
}
)"
;
return
ExecuteScalar
(
sql
).
ToString
();
}
#
endregion
}
}
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
b8e5b6b5
...
...
@@ -75,6 +75,10 @@ namespace Mall.WebApi.Controllers
//背景插件
case
"background"
:
var
backgroundData
=
subItem
.
data
as
backgroundItem
;
if
(
backgroundData
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
backgroundData
.
backgroundPicUrl
))
{
backgroundData
.
backgroundPicUrl
=
Common
.
Config
.
GetFileUrl
(
backgroundData
.
backgroundPicUrl
);
}
obj
=
new
{
id
=
subItem
.
Id
,
...
...
Mall.WebApi/Controllers/Product/GroupBuyController.cs
View file @
b8e5b6b5
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.AOP
;
using
Mall.Common.API
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
...
...
@@ -25,10 +26,12 @@ namespace Mall.WebApi.Controllers.Product
/// </summary>
private
readonly
GroupBuyConfigModule
groupBuyConfigModule
=
new
GroupBuyConfigModule
();
/// <summary>
/// 拼团活动
/// </summary>
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
new
GroupBuyConfigActivityModule
();
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
GroupBuyConfigActivityModule
>
();
#
region
拼团配置设置
/// <summary>
...
...
@@ -125,6 +128,10 @@ namespace Mall.WebApi.Controllers.Product
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Groupbuy_Activity_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
if
(
extModel
.
ServiceList
!=
null
&&
extModel
.
ServiceList
.
Count
>
0
)
{
extModel
.
GoodsService
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
extModel
.
ServiceList
);
}
bool
flag
=
groupBuyConfigActivityModule
.
SetGroupbuyActivityModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
b8e5b6b5
...
...
@@ -33,6 +33,7 @@ namespace Mall.WebApi.Controllers.User
private
readonly
UserModule
userModule
=
new
UserModule
();
private
readonly
CouponModule
couponModule
=
new
CouponModule
();
//private readonly Module.BaseSetUp.MallBaseModule MallBaseModule = new Module.BaseSetUp.MallBaseModule();
/// <summary>
/// 商户小程序处理类
/// </summary>
...
...
@@ -174,22 +175,24 @@ namespace Mall.WebApi.Controllers.User
Source
=
demodel
.
Source
,
SecretKey
=
demodel
.
SecretKey
,
SuperiorId
=
demodel
.
SuperiorId
??
0
,
Token
=
token
Token
=
token
,
SmallShopId
=
0
};
UserReidsCache
.
AppletUserInfoSet
(
UserModuleCacheKeyConfig
.
Applet_Login_Info
+
UserId
,
appletUserInfo
,
Config
.
JwtExpirTime
);
if
(
couponResult
!=
null
&&
couponResult
.
ID
>
0
)
{
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Success
,
""
,
couponResult
.
Name
,
appletUserInfo
);
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Success
,
""
,
couponResult
.
Name
,
appletUserInfo
);
}
else
{
else
{
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Fail
,
""
,
""
,
appletUserInfo
);
}
}
return
ApiResult
.
CouponFailed
(
ResultCode
.
Fail
,
""
,
""
);
// return ApiResult.Failed("注册失败,请联系管理员");
// return ApiResult.Failed("注册失败,请联系管理员");
}
else
{
...
...
@@ -220,6 +223,9 @@ namespace Mall.WebApi.Controllers.User
string
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
var
mmodel
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
umodel
.
MallBaseId
});
//2020-08-12 Add By:W
var
smallShopsInfoModle
=
userModule
.
GetSmallShopsInfoList
(
new
RB_SmallShops_Info_Extend
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
,
UserId
=
umodel
.
Id
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
AppletUserInfo
appletUserInfo
=
new
AppletUserInfo
()
{
MallBaseId
=
umodel
.
MallBaseId
,
...
...
@@ -233,7 +239,8 @@ namespace Mall.WebApi.Controllers.User
Source
=
demodel
.
Source
,
SecretKey
=
umodel
.
SecretKey
,
SuperiorId
=
umodel
.
SuperiorId
??
0
,
Token
=
token
Token
=
token
,
SmallShopId
=
(
smallShopsInfoModle
!=
null
&&
smallShopsInfoModle
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
?
smallShopsInfoModle
.
Id
:
0
};
UserReidsCache
.
AppletUserInfoSet
(
UserModuleCacheKeyConfig
.
Applet_Login_Info
+
umodel
.
Id
,
appletUserInfo
,
Config
.
JwtExpirTime
);
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Fail
,
""
,
""
,
appletUserInfo
);
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
b8e5b6b5
...
...
@@ -1698,10 +1698,28 @@ namespace Mall.WebApi.Controllers.User
}
#
endregion
#
region
开店申请
#
region
微店
/// <summary>
/// 新增修改地址
/// 获取微信基础设置信息
/// </summary>
/// <returns></returns>
public
ApiResult
GetMicroShopBasics
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
microShopBasics
=
MallBaseModule
.
GetMicroShopBasicsList
(
new
Model
.
Entity
.
BaseSetUp
.
RB_MicroShop_Basics
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
microShopBasics
==
null
)
{
microShopBasics
=
new
Model
.
Entity
.
BaseSetUp
.
RB_MicroShop_Basics
();
}
return
ApiResult
.
Success
(
""
,
microShopBasics
);
}
/// <summary>
/// 申请微店
/// </summary>
/// <returns></returns>
[
HttpPost
]
...
...
@@ -1775,6 +1793,7 @@ namespace Mall.WebApi.Controllers.User
demodel
.
Name
=
userInfo
.
Photo
;
}
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
GradeId
=
0
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
...
...
@@ -1792,6 +1811,85 @@ namespace Mall.WebApi.Controllers.User
}
}
/// <summary>
/// 更新微店信息
/// </summary>
/// <returns></returns>
public
ApiResult
UpdateShopsInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_SmallShops_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_SmallShops_Info_Extend
>(
req
.
msg
.
ToString
());
var
oldList
=
userModule
.
GetSmallShopsInfoList
(
new
RB_SmallShops_Info_Extend
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
,
UserId
=
userInfo
.
UserId
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
if
(
oldList
!=
null
)
{
if
(
oldList
.
AuditStatus
==
DistributorAuditStatusEnum
.
Reject
)
{
return
ApiResult
.
Failed
(
"您之前的申请已被拒绝,不能修改"
);
}
else
if
(
oldList
.
AuditStatus
==
DistributorAuditStatusEnum
.
Auditing
)
{
return
ApiResult
.
Failed
(
"您的申请审核中,不能修改"
);
}
}
else
{
return
ApiResult
.
Failed
(
"您还未申请成为微店"
);
}
demodel
.
Id
=
oldList
.
Id
;
demodel
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
flag
=
userModule
.
UpdateShopsInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
(
""
,
"更新成功"
);
}
else
{
return
ApiResult
.
Failed
(
""
,
"更新失败"
);
}
}
/// <summary>
/// 获取微店我的客户列表标题
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GerSmallShopsMyTeamTitelListForFX
()
{
var
userInfo
=
AppletUserInfo
;
var
obj
=
userModule
.
GerSmallShopsMyTeamTitelListForFX
(
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
/// <summary>
/// 获取微店我的客户列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetSmallShopsMyTeamPageListForFX
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
req
.
msg
.
ToString
());
RB_Distributor_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_Info_Extend
>(
req
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
SmallShopId
;
pageModel
.
pageData
=
userModule
.
GetSmallShopsMyTeamPageListForFX
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
count
,
demodel
);
pageModel
.
count
=
Convert
.
ToInt32
(
count
);
return
ApiResult
.
Success
(
""
,
pageModel
);
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/SupplierController.cs
View file @
b8e5b6b5
...
...
@@ -332,7 +332,7 @@ namespace Mall.WebApi.Controllers.User
result
.
Add
(
newOrderGoods
);
}
}
else
if
(
demodel
.
IsSelectAll
==
0
||
demodel
.
IsSelectAll
==
2
)
if
(
demodel
.
IsSelectAll
==
0
||
demodel
.
IsSelectAll
==
2
)
{
if
(
orderGoodsItem
.
FreightCostMoney
.
HasValue
&&
orderGoodsItem
.
FreightCostMoney
.
Value
>
0
&&
orderGoodsItem
.
FreightFinanceId
<=
0
)
{
...
...
@@ -429,7 +429,7 @@ namespace Mall.WebApi.Controllers.User
if
(
resultCode
==
"1"
&&
frid
>
0
)
//新增记录
{
record
.
FinanceId
=
frid
;
bool
addResult
=
financeModule
.
SetFinanceRecord
(
record
);
bool
addResult
=
financeModule
.
SetFinanceRecord
(
record
,
result
);
if
(
addResult
)
{
return
ApiResult
.
Success
(
"财务单据生成成功"
);
...
...
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