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
1b006293
Commit
1b006293
authored
Jul 16, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
# Conflicts: # Mall.Module.Product/OrderModule.cs
parents
ba7a0ef6
8eec5677
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
686 additions
and
186 deletions
+686
-186
UserInfo.cs
Mall.Common/API/UserInfo.cs
+14
-14
RB_WarehouseOut_Goods.cs
Mall.Model/Entity/Property/RB_WarehouseOut_Goods.cs
+1
-8
RB_Distributor_FXCommission.cs
Mall.Model/Entity/User/RB_Distributor_FXCommission.cs
+99
-0
RB_Distributor_FXCommission_Extend.cs
Mall.Model/Extend/User/RB_Distributor_FXCommission_Extend.cs
+25
-0
RB_Distributor_FXGrade_Extend.cs
Mall.Model/Extend/User/RB_Distributor_FXGrade_Extend.cs
+6
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+5
-3
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+2
-2
EmployeeModule.cs
Mall.Module.User/EmployeeModule.cs
+29
-2
UserModule.cs
Mall.Module.User/UserModule.cs
+74
-10
RB_Goods_OrderDetailRepository.cs
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
+2
-2
RB_WarehouseOut_GoodsRepository.cs
Mall.Repository/Property/RB_WarehouseOut_GoodsRepository.cs
+3
-13
RB_Distributor_FXCommissionRepository.cs
....Repository/User/RB_Distributor_FXCommissionRepository.cs
+78
-0
RB_RoleRepository.cs
Mall.Repository/User/RB_RoleRepository.cs
+12
-6
WarehouseOutController.cs
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
+4
-3
SupplierController.cs
Mall.WebApi/Controllers/User/SupplierController.cs
+28
-8
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+65
-65
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+168
-3
FinanceModule.cs
Mall.WindowsService/Module/FinanceModule.cs
+38
-14
WindowsService.cs
Mall.WindowsService/WindowsService.cs
+33
-33
No files found.
Mall.Common/API/UserInfo.cs
View file @
1b006293
...
...
@@ -127,20 +127,20 @@ namespace Mall.Common
/// </summary>
public
int
EmpId
{
get
;
set
;
}
//
public string erptoken { get; set; }
///
//
<summary>
///
//
erp用户id
///
//
</summary>
//
public int ERPEmpId { get; set; }
///
//
<summary>
///
//
erp公司id
///
//
</summary>
//
public int ERPBranchId { get; set; }
///
//
<summary>
///
//
erp集团id
///
//
</summary>
//
public int ERPGroupId { get; set; }
public
string
erptoken
{
get
;
set
;
}
/// <summary>
/// erp用户id
/// </summary>
public
int
ERPEmpId
{
get
;
set
;
}
/// <summary>
/// erp公司id
/// </summary>
public
int
ERPBranchId
{
get
;
set
;
}
/// <summary>
/// erp集团id
/// </summary>
public
int
ERPGroupId
{
get
;
set
;
}
}
}
Mall.Model/Entity/Property/RB_WarehouseOut_Goods.cs
View file @
1b006293
...
...
@@ -134,14 +134,7 @@ namespace Mall.Model.Entity.Property
set
;
}
/// <summary>
/// 供应商id
/// </summary>
public
int
SupplierId
{
get
;
set
;
}
/// <summary>
/// 成本价
...
...
Mall.Model/Entity/User/RB_Distributor_FXCommission.cs
0 → 100644
View file @
1b006293
using
Mall.Common.AOP
;
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_Distributor_FXCommission
{
/// <summary>
/// Id
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 等级ID
/// </summary>
public
int
FXGradeId
{
get
;
set
;
}
/// <summary>
/// 返佣等级ID
/// </summary>
public
int
CommissionGradeId
{
get
;
set
;
}
/// <summary>
/// 等级类型,-直接,2-间接
/// </summary>
public
int
GradeType
{
get
;
set
;
}
/// <summary>
/// 返佣金额
/// </summary>
public
decimal
?
CommissionPrice
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
?
Status
{
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/User/RB_Distributor_FXCommission_Extend.cs
0 → 100644
View file @
1b006293
using
Mall.Common.AOP
;
using
Mall.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 粉象返佣等级扩展表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_FXCommission_Extend
:
RB_Distributor_FXCommission
{
/// <summary>
/// GradeName
/// </summary>
public
string
GradeName
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_FXGrade_Extend.cs
View file @
1b006293
...
...
@@ -17,5 +17,11 @@ namespace Mall.Model.Extend.User
/// ids
/// </summary>
public
string
GradeIds
{
get
;
set
;
}
/// <summary>
/// 返佣佣金
/// </summary>
public
List
<
RB_Distributor_FXCommission_Extend
>
FXCommissionList
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
1b006293
...
...
@@ -2291,8 +2291,10 @@ namespace Mall.Module.Product
var
categoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
();
item
.
InventoryNum
=
gmodel
.
InventoryNum
??
0
;
item
.
CostMoney
=
gmodel
.
CostPrice
??
0
;
item
.
CommissionPrice
=
gmodel
.
Commission
;
// 粉象 返佣金额
item
.
CostMoney
=
gmodel
.
CostPrice
??
0
;
//(gmodel.IsCustomSpecification==2)?(gmodel.CostPrice ?? 0):(speciPList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationSort == item.SpecificationSort).FirstOrDefault().CostMoney);
item
.
ProductCode
=
gmodel
.
GoodsNumbers
;
item
.
CategoryIdList
=
categoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
ToList
();
int
GoodsWeight
=
gmodel
.
GoodsWeight
??
0
;
//商品重量
...
...
@@ -8395,9 +8397,9 @@ namespace Mall.Module.Product
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetNoOutOrderGoodsList
(
RB_Goods_OrderDetail_Extend
dmodel
)
public
List
<
RB_Goods_OrderDetail_Extend
>
GetNoOutOrderGoodsList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderDetail_Extend
dmodel
)
{
return
goods_OrderDetailRepository
.
GetNoOutOrderGoodsList
(
dmodel
);
return
goods_OrderDetailRepository
.
GetNoOutOrderGoodsList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
}
#
endregion
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
1b006293
...
...
@@ -3825,7 +3825,7 @@ namespace Mall.Module.Product
foreach
(
var
item
in
splist
)
{
var
pupmodel
=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
).
FirstOrDefault
();
if
(
item
.
SellingPrice
!=
pupmodel
.
SellingPrice
||
item
.
InventoryNum
!=
pupmodel
.
InventoryNum
||
item
.
GoodsNumbers
!=
pupmodel
.
GoodsNumbers
||
item
.
GoodsWeight
!=
pupmodel
.
GoodsWeight
)
if
(
item
.
Commission
!=
pupmodel
.
Commission
||
item
.
CostMoney
!=
pupmodel
.
CostMoney
||
item
.
SellingPrice
!=
pupmodel
.
SellingPrice
||
item
.
InventoryNum
!=
pupmodel
.
InventoryNum
||
item
.
GoodsNumbers
!=
pupmodel
.
GoodsNumbers
||
item
.
GoodsWeight
!=
pupmodel
.
GoodsWeight
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_SpecificationPrice
.
SellingPrice
),
pupmodel
.
SellingPrice
},
...
...
@@ -3882,7 +3882,7 @@ namespace Mall.Module.Product
foreach
(
var
item
in
splist
)
{
var
pupmodel
=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
).
FirstOrDefault
();
if
(
item
.
SellingPrice
!=
pupmodel
.
SellingPrice
||
item
.
InventoryNum
!=
pupmodel
.
InventoryNum
||
item
.
GoodsNumbers
!=
pupmodel
.
GoodsNumbers
||
item
.
GoodsWeight
!=
pupmodel
.
GoodsWeight
)
if
(
item
.
Commission
!=
pupmodel
.
Commission
||
item
.
CostMoney
!=
pupmodel
.
CostMoney
||
item
.
SellingPrice
!=
pupmodel
.
SellingPrice
||
item
.
InventoryNum
!=
pupmodel
.
InventoryNum
||
item
.
GoodsNumbers
!=
pupmodel
.
GoodsNumbers
||
item
.
GoodsWeight
!=
pupmodel
.
GoodsWeight
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_SpecificationPrice
.
SellingPrice
),
pupmodel
.
SellingPrice
},
...
...
Mall.Module.User/EmployeeModule.cs
View file @
1b006293
...
...
@@ -58,9 +58,36 @@ namespace Mall.Module.User
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtModule
(
RB_Role_Extend
query
)
public
string
GetRoleListExtModule
(
RB_Role_Extend
query
)
{
return
roleRepository
.
GetRoleListExtRepository
(
query
);
string
menuIds
=
""
;
List
<
string
>
menuIdList
=
new
List
<
string
>();
var
list
=
roleRepository
.
GetRoleListExtRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
item
.
RoleAuth
))
{
var
tempArray
=
item
.
RoleAuth
.
Split
(
','
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
>
0
)
{
foreach
(
var
subItem
in
tempArray
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
subItem
))
{
menuIdList
.
Add
(
subItem
);
}
}
}
}
}
}
if
(
menuIdList
!=
null
&&
menuIdList
.
Count
>
0
)
{
menuIds
=
string
.
Join
(
","
,
menuIdList
);
}
return
menuIds
;
}
/// <summary>
...
...
Mall.Module.User/UserModule.cs
View file @
1b006293
...
...
@@ -142,6 +142,10 @@ namespace Mall.Module.User
private
RB_Distributor_FXGradeRepository
distributor_FXGradeRepository
=
new
RB_Distributor_FXGradeRepository
();
/// <summary>
/// 粉象返佣金额
/// </summary>
private
RB_Distributor_FXCommissionRepository
distributor_FXCommissionRepository
=
new
RB_Distributor_FXCommissionRepository
();
...
...
@@ -2260,7 +2264,7 @@ namespace Mall.Module.User
}
return
flag
;
}
}
/// <summary>
/// 设置打款备注
...
...
@@ -4620,7 +4624,8 @@ namespace Mall.Module.User
if
(
list
.
Any
())
{
var
pModel
=
list
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
pModel
==
null
)
{
if
(
pModel
==
null
)
{
return
ApiResult
.
Failed
(
"未查询到普通会员等级"
);
}
List
<
string
>
TitleList
=
new
List
<
string
>();
...
...
@@ -4628,17 +4633,21 @@ namespace Mall.Module.User
TitleList
.
Add
(
"级别标准"
);
TitleList
.
Add
(
pModel
.
GradeName
);
TitleList
.
Add
(
"间接普会"
);
foreach
(
var
item
in
list
)
{
if
(
item
.
Id
!=
pModel
.
Id
)
{
foreach
(
var
item
in
list
)
{
if
(
item
.
Id
!=
pModel
.
Id
)
{
TitleList
.
Add
(
item
.
GradeName
);
}
}
List
<
object
>
ContenList
=
new
List
<
object
>();
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
List
<
string
>
itemList
=
new
List
<
string
>();
itemList
.
Add
(
item
.
GradeName
);
itemList
.
Add
((
item
.
CommissionRatio
??
0
).
ToString
()
+
"%"
);
foreach
(
var
qitem
in
list
)
{
foreach
(
var
qitem
in
list
)
{
if
(
qitem
.
Id
==
pModel
.
Id
)
{
itemList
.
Add
(
GetFXGradeRatioCommon
(
list
,
item
.
Id
,
qitem
.
Id
,
1
).
ToString
()
+
"%"
);
...
...
@@ -4652,12 +4661,14 @@ namespace Mall.Module.User
ContenList
.
Add
(
itemList
);
}
return
ApiResult
.
Success
(
""
,
new
{
return
ApiResult
.
Success
(
""
,
new
{
TitleList
,
ContenList
});
}
else
{
else
{
return
ApiResult
.
Failed
(
"没有数据"
);
}
}
...
...
@@ -4682,10 +4693,12 @@ namespace Mall.Module.User
{
return
0
;
}
if
(
model1
.
Grade
>
model2
.
Grade
&&
Type
==
1
)
{
if
(
model1
.
Grade
>
model2
.
Grade
&&
Type
==
1
)
{
return
(
model1
.
CommissionRatio
??
0
)
-
(
model2
.
CommissionRatio
??
0
);
}
if
(
id2
==
pModel
.
Id
&&
Type
==
2
)
{
if
(
id2
==
pModel
.
Id
&&
Type
==
2
)
{
if
(
id1
==
id2
)
{
return
0
;
}
return
(
model1
.
CommissionRatio
??
0
)
-
((
pModel
.
CommissionRatio
??
0
)
+
(
pModel
.
SiblingRatio
??
0
));
}
...
...
@@ -4981,6 +4994,57 @@ namespace Mall.Module.User
return
flag
;
}
#
endregion
#
region
粉象返佣金额设置
/// <summary>
/// 返佣列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
GetFXCommissionList
(
RB_Distributor_FXCommission_Extend
query
)
{
return
distributor_FXCommissionRepository
.
GetFXCommissionList
(
query
);
}
/// <summary>
/// 新增/修改返佣设置
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
AddOrUpdateFxCommission
(
List
<
RB_Distributor_FXCommission_Extend
>
list
)
{
var
trans
=
distributor_FXCommissionRepository
.
DbTransaction
;
try
{
foreach
(
var
item
in
list
)
{
if
(
item
.
ID
==
0
)
{
item
.
CreateDate
=
System
.
DateTime
.
Now
;
item
.
UpdateDate
=
System
.
DateTime
.
Now
;
distributor_FXCommissionRepository
.
Insert
(
item
,
trans
);
}
else
if
(
item
.
ID
>
0
)
{
item
.
UpdateDate
=
System
.
DateTime
.
Now
;
distributor_FXCommissionRepository
.
Update
(
item
,
trans
);
}
}
distributor_FXCommissionRepository
.
DBSession
.
Commit
();
return
true
;
}
catch
(
Exception
ex
)
{
distributor_FXCommissionRepository
.
DBSession
.
Rollback
(
"AddOrUpdateFxCommission"
);
LogHelper
.
Write
(
ex
,
"AddOrUpdateFxCommission"
);
return
false
;
}
}
#
endregion
}
}
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
View file @
1b006293
...
...
@@ -365,7 +365,7 @@ where {where} order by o.CreateDate desc";
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetNoOutOrderGoodsList
(
RB_Goods_OrderDetail_Extend
dmodel
)
public
List
<
RB_Goods_OrderDetail_Extend
>
GetNoOutOrderGoodsList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderDetail_Extend
dmodel
)
{
string
where
=
$" 1=1 and o.
{
nameof
(
RB_Goods_Order
.
Status
)}
=0 and o.OrderStatus=2"
;
string
childreWhere
=
""
;
...
...
@@ -437,7 +437,7 @@ where {where} order by o.CreateDate desc";
string
sql
=
$@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od
INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where
{
where
}
order by o.CreateDate desc"
;
return
Get
<
RB_Goods_OrderDetail_Extend
>(
sql
).
ToList
();
return
Get
Page
<
RB_Goods_OrderDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Mall.Repository/Property/RB_WarehouseOut_GoodsRepository.cs
View file @
1b006293
...
...
@@ -53,10 +53,7 @@ namespace Mall.Repository.Property
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
GoodsName
)}
like '%
{
query
.
GoodsName
}
%'"
);
}
if
(
query
.
SupplierId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
SupplierId
)}
=
{
query
.
SupplierId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
OrderGoodsIds
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
OrderGoodsId
)}
in (
{
query
.
OrderGoodsIds
}
)"
);
...
...
@@ -98,10 +95,7 @@ namespace Mall.Repository.Property
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
GoodsName
)}
like '%
{
query
.
GoodsName
}
%'"
);
}
if
(
query
.
SupplierId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
SupplierId
)}
=
{
query
.
SupplierId
}
"
);
}
}
return
Get
<
RB_WarehouseOut_Goods_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
@@ -142,11 +136,7 @@ namespace Mall.Repository.Property
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
GoodsName
)}
like '%
{
query
.
GoodsName
}
%'"
);
}
if
(
query
.
SupplierId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
SupplierId
)}
=
{
query
.
SupplierId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
OrderGoodsIds
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_Goods_Extend
.
OrderGoodsId
)}
in (
{
query
.
OrderGoodsIds
}
)"
);
...
...
Mall.Repository/User/RB_Distributor_FXCommissionRepository.cs
0 → 100644
View file @
1b006293
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.User
{
public
class
RB_Distributor_FXCommissionRepository
:
RepositoryBase
<
RB_Distributor_FXCommission
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Distributor_FXCommission
);
}
}
/// <summary>
/// 返佣分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
GetFXCommissionPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_FXCommission_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Distributor_FXCommission_Extend
.
Status
)}
=0"
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
FXGradeId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
FXGradeId
)}
=
{
query
.
FXGradeId
}
"
);
}
}
return
GetPage
<
RB_Distributor_FXCommission_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 返佣列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
GetFXCommissionList
(
RB_Distributor_FXCommission_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Distributor_FXCommission_Extend
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
FXGradeId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
FXGradeId
)}
=
{
query
.
FXGradeId
}
"
);
}
}
return
Get
<
RB_Distributor_FXCommission_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/User/RB_RoleRepository.cs
View file @
1b006293
...
...
@@ -79,13 +79,19 @@ namespace Mall.Repository.User
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtRepository
(
RB_Role_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT group_concat(RoleAuth) AS RoleAuth
string
empRoleSql
=
string
.
Format
(
@" SELECT RoleAuth FROM rb_employee WHERE empId={0} "
,
query
.
EmpId
);
var
roleObj
=
base
.
ExecuteScalar
(
empRoleSql
);
if
(
roleObj
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
roleObj
.
ToString
()))
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_role
WHERE `Status`=0 AND RoleId IN (SELECT group_concat(RoleAuth) AS RoleAuth FROM rb_employee WHERE empId={0} )
"
,
query
.
EmpId
);
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
WHERE `Status`=0 AND RoleId IN ({0})
"
,
roleObj
.
ToString
());
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
}
return
new
List
<
RB_Role_Extend
>();
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
View file @
1b006293
...
...
@@ -131,7 +131,6 @@ namespace Mall.WebApi.Controllers.Property
{
item
.
TenantId
=
orderGoodsDetailModel
.
TenantId
;
item
.
MallBaseId
=
orderGoodsDetailModel
.
MallBaseId
;
item
.
SupplierId
=
orderGoodsDetailModel
.
SupplierId
;
item
.
SpecificationSort
=
orderGoodsDetailModel
.
SpecificationSort
;
item
.
OrderId
=
orderGoodsDetailModel
.
OrderId
.
Value
;
item
.
OrderNo
=
orderGoodsDetailModel
.
OrderNo
;
...
...
@@ -188,8 +187,10 @@ namespace Mall.WebApi.Controllers.Property
RB_Goods_OrderDetail_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderDetail_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetNoOutOrderGoodsList
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
);
var
list
=
orderModule
.
GetNoOutOrderGoodsList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
Mall.WebApi/Controllers/User/SupplierController.cs
View file @
1b006293
...
...
@@ -280,22 +280,42 @@ namespace Mall.WebApi.Controllers.User
{
if
(
demodel
.
IsSelectAll
==
0
||
demodel
.
IsSelectAll
==
1
)
{
if
(
orderGoodsItem
.
CostMoney
>
0
)
if
(
orderGoodsItem
.
CostMoney
>
0
&&
orderGoodsItem
.
CostFinanceId
<=
0
)
{
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
();
newOrderGoods
=
orderGoodsItem
;
newOrderGoods
.
FinanceType
=
1
;
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 1;
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
{
FinanceType
=
1
,
Final_Price
=
orderGoodsItem
.
Final_Price
,
Number
=
1
,
FreightMoney
=
orderGoodsItem
.
FreightMoney
,
GoodsName
=
orderGoodsItem
.
GoodsName
,
OrderNo
=
orderGoodsItem
.
OrderNo
,
Id
=
orderGoodsItem
.
Id
};
result
.
Add
(
newOrderGoods
);
}
}
else
if
(
demodel
.
IsSelectAll
==
0
||
demodel
.
IsSelectAll
==
2
)
{
if
(
orderGoodsItem
.
FreightCostMoney
.
HasValue
&&
orderGoodsItem
.
FreightCostMoney
.
Value
>
0
)
if
(
orderGoodsItem
.
FreightCostMoney
.
HasValue
&&
orderGoodsItem
.
FreightCostMoney
.
Value
>
0
&&
orderGoodsItem
.
FreightFinanceId
<=
0
)
{
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
();
newOrderGoods
=
orderGoodsItem
;
newOrderGoods
.
FinanceType
=
2
;
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 2;
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
{
FinanceType
=
2
,
Final_Price
=
orderGoodsItem
.
Final_Price
,
Number
=
1
,
FreightMoney
=
orderGoodsItem
.
FreightMoney
,
GoodsName
=
orderGoodsItem
.
GoodsName
,
OrderNo
=
orderGoodsItem
.
OrderNo
,
Id
=
orderGoodsItem
.
Id
};
result
.
Add
(
newOrderGoods
);
}
}
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
1b006293
...
...
@@ -77,7 +77,7 @@ namespace Mall.WebApi.Controllers.User
private
ProductModule
productModule
=
new
ProductModule
();
//
private Module.Property.AuthorizeModule authorizeModule = new Module.Property.AuthorizeModule();
private
Module
.
Property
.
AuthorizeModule
authorizeModule
=
new
Module
.
Property
.
AuthorizeModule
();
#
region
商户信息
[
AllowAnonymous
]
...
...
@@ -115,63 +115,63 @@ namespace Mall.WebApi.Controllers.User
#
region
add
by
:
W
2020
-
07
-
06
erp
授权信息
//
var erpUserInfo = new Mall.Model.Entity.Property.RB_Employee();
//
string erptoken = "";
//
if (model.EmpId > 0)
//
{
//
//判断当前登录人是否有erp账号信息
//
var authorizeModel = authorizeModule.GetAuthorizeList(new Model.Extend.Property.RB_ERP_Authorize_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId, MallUserId = model.EmpId, Type = 1 }).FirstOrDefault();
//
if (authorizeModel != null && authorizeModel.Status == 2)
//
{
//
//先查询是否存在是否是登陆手机号登陆
//
erpUserInfo = authorizeModule.GetByLoginMobileAndPwd(authorizeModel.Account, authorizeModel.Password, authorizeModel.ERPGroupId);
//
if (erpUserInfo == null)
//
{
//
//再查询是否存在是否是账号登陆
//
erpUserInfo = authorizeModule.GetNewByAccountAndPwd(authorizeModel.Account, authorizeModel.Password, authorizeModel.ERPGroupId);
//
}
//
if (erpUserInfo != null && !string.IsNullOrWhiteSpace(erpUserInfo.EmLoginMobile) && erpUserInfo.IsLeave == 0)
//
{
//
TokenUserInfo erpUserInfoToken = new TokenUserInfo { uid = erpUserInfo.EmployeeId.ToString(), requestFrom = Common.Enum.ApiRequestFromEnum.ERP };
//
#region JWT
//
IDateTimeProvider erpprovider = new UtcDateTimeProvider();
//
var erpnow = erpprovider.GetNow().AddMinutes(-1);
//
var erpunixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); // or use JwtValidator.UnixEpoch
//
var erpsecondsSinceEpoch = Math.Round((erpnow - erpunixEpoch).TotalSeconds);
//
var erppayload = new Dictionary<string, object>
//
{
//
{"iat",erpsecondsSinceEpoch },
//
{"exp",erpsecondsSinceEpoch+Config.JwtExpirTime},
//
{"userInfo",erpUserInfoToken }
//
};
//
IJwtAlgorithm erpalgorithm = new HMACSHA256Algorithm();
//
IJsonSerializer erpserializer = new JsonNetSerializer();
//
IBase64UrlEncoder erpurlEncoder = new JwtBase64UrlEncoder();
//
IJwtEncoder erpencoder = new JwtEncoder(erpalgorithm, erpserializer, erpurlEncoder);
//
string erpsecret = Config.JwtSecretKey;
//
erptoken = erpencoder.Encode(erppayload, erpsecret);
//
#endregion
//
//ERPUserInfo erpObj = new ERPUserInfo
//
//{
//
// Domain = authorizeModel.DomainName,
//
// emName = erpUserInfo.EmName,
//
// EmployeeId = erpUserInfo.EmployeeId,
//
// RB_Group_id = erpUserInfo.RB_Group_id,
//
// RB_Branch_id = erpUserInfo.RB_Branch_id,
//
// RB_Post_Id = erpUserInfo.RB_Post_Id,
//
// RB_Department_Id = erpUserInfo.RB_Department_Id,
//
// token = erptoken,
//
// SecretKey = erpUserInfo.SecretKey,
//
// //ImAccount = imAccount?.AccID ?? model.EmLoginMobile, //model.EmLoginMobile,
//
// //ImToken = IMService.DefaultPassword(),
//
//};
//
//UserReidsCache.UserInfoSet(UserModuleCacheKeyConfig.ERP_Login_Info_+ erpUserInfo.EmployeeId, erpObj, Config.JwtExpirTime);
//
}
//
}
//
}
var
erpUserInfo
=
new
Mall
.
Model
.
Entity
.
Property
.
RB_Employee
();
string
erptoken
=
""
;
if
(
model
.
EmpId
>
0
)
{
//判断当前登录人是否有erp账号信息
var
authorizeModel
=
authorizeModule
.
GetAuthorizeList
(
new
Model
.
Extend
.
Property
.
RB_ERP_Authorize_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
MallUserId
=
model
.
EmpId
,
Type
=
1
}).
FirstOrDefault
();
if
(
authorizeModel
!=
null
&&
authorizeModel
.
Status
==
2
)
{
//先查询是否存在是否是登陆手机号登陆
erpUserInfo
=
authorizeModule
.
GetByLoginMobileAndPwd
(
authorizeModel
.
Account
,
authorizeModel
.
Password
,
authorizeModel
.
ERPGroupId
);
if
(
erpUserInfo
==
null
)
{
//再查询是否存在是否是账号登陆
erpUserInfo
=
authorizeModule
.
GetNewByAccountAndPwd
(
authorizeModel
.
Account
,
authorizeModel
.
Password
,
authorizeModel
.
ERPGroupId
);
}
if
(
erpUserInfo
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
erpUserInfo
.
EmLoginMobile
)
&&
erpUserInfo
.
IsLeave
==
0
)
{
TokenUserInfo
erpUserInfoToken
=
new
TokenUserInfo
{
uid
=
erpUserInfo
.
EmployeeId
.
ToString
(),
requestFrom
=
Common
.
Enum
.
ApiRequestFromEnum
.
ERP
};
#
region
JWT
IDateTimeProvider
erpprovider
=
new
UtcDateTimeProvider
();
var
erpnow
=
erpprovider
.
GetNow
().
AddMinutes
(-
1
);
var
erpunixEpoch
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
// or use JwtValidator.UnixEpoch
var
erpsecondsSinceEpoch
=
Math
.
Round
((
erpnow
-
erpunixEpoch
).
TotalSeconds
);
var
erppayload
=
new
Dictionary
<
string
,
object
>
{
{
"iat"
,
erpsecondsSinceEpoch
},
{
"exp"
,
erpsecondsSinceEpoch
+
Config
.
JwtExpirTime
},
{
"userInfo"
,
erpUserInfoToken
}
};
IJwtAlgorithm
erpalgorithm
=
new
HMACSHA256Algorithm
();
IJsonSerializer
erpserializer
=
new
JsonNetSerializer
();
IBase64UrlEncoder
erpurlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtEncoder
erpencoder
=
new
JwtEncoder
(
erpalgorithm
,
erpserializer
,
erpurlEncoder
);
string
erpsecret
=
Config
.
JwtSecretKey
;
erptoken
=
erpencoder
.
Encode
(
erppayload
,
erpsecret
);
#
endregion
//ERPUserInfo erpObj = new ERPUserInfo
//{
// Domain = authorizeModel.DomainName,
// emName = erpUserInfo.EmName,
// EmployeeId = erpUserInfo.EmployeeId,
// RB_Group_id = erpUserInfo.RB_Group_id,
// RB_Branch_id = erpUserInfo.RB_Branch_id,
// RB_Post_Id = erpUserInfo.RB_Post_Id,
// RB_Department_Id = erpUserInfo.RB_Department_Id,
// token = erptoken,
// SecretKey = erpUserInfo.SecretKey,
// //ImAccount = imAccount?.AccID ?? model.EmLoginMobile, //model.EmLoginMobile,
// //ImToken = IMService.DefaultPassword(),
//};
//UserReidsCache.UserInfoSet(UserModuleCacheKeyConfig.ERP_Login_Info_+ erpUserInfo.EmployeeId, erpObj, Config.JwtExpirTime);
}
}
}
#
endregion
...
...
@@ -210,10 +210,10 @@ namespace Mall.WebApi.Controllers.User
SecretKey
=
""
,
MallBaseId
=
0
,
EmpId
=
model
.
EmpId
,
//
erptoken = erptoken,
//
ERPEmpId = erpUserInfo.EmployeeId,
//
ERPBranchId = erpUserInfo.RB_Branch_id,
//
ERPGroupId = erpUserInfo.RB_Group_id
erptoken
=
erptoken
,
ERPEmpId
=
erpUserInfo
.
EmployeeId
,
ERPBranchId
=
erpUserInfo
.
RB_Branch_id
,
ERPGroupId
=
erpUserInfo
.
RB_Group_id
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
...
...
@@ -970,10 +970,10 @@ namespace Mall.WebApi.Controllers.User
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
{
var
roleList
=
employeeModule
.
GetRoleListExtModule
(
new
RB_Role_Extend
()
{
EmpId
=
RequestParm
.
EmpId
});
if
(
roleList
!=
null
&&
roleList
.
Count
>
0
)
var
menuIds
=
employeeModule
.
GetRoleListExtModule
(
new
RB_Role_Extend
()
{
EmpId
=
RequestParm
.
EmpId
});
if
(
!
string
.
IsNullOrWhiteSpace
(
menuIds
)
)
{
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
QMenuIds
=
roleList
?.
FirstOrDefault
()?.
RoleAuth
});
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
QMenuIds
=
menuIds
});
var
superList
=
new
List
<
RB_Menu_Extend
>();
foreach
(
var
item
in
list
)
{
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
1b006293
...
...
@@ -2703,10 +2703,12 @@ namespace Mall.WebApi.Controllers.User
{
return
ApiResult
.
ParamIsNull
(
"请选择等级"
);
}
if
((
demodel
.
CommissionRatio
??
0
)
<=
0
)
{
if
((
demodel
.
CommissionRatio
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递返佣比例"
);
}
if
((
demodel
.
SiblingRatio
??
0
)
<=
0
)
{
if
((
demodel
.
SiblingRatio
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递同级返佣比例"
);
}
//验证等级是否重复
...
...
@@ -2770,7 +2772,8 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetFXDistributorGradeView
()
{
public
ApiResult
GetFXDistributorGradeView
()
{
var
req
=
RequestParm
;
return
userModule
.
GetFXDistributorGradeView
(
req
.
TenantId
,
req
.
MallBaseId
);
}
...
...
@@ -2799,6 +2802,168 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
""
,
base64Img
);
}
#
endregion
#
region
粉象返佣金额设置
/// <summary>
/// 获取粉象分销返佣信息列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetFXFxCommissionList
()
{
var
parms
=
RequestParm
;
RB_Distributor_FXGrade_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_FXGrade_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
userModule
.
GetFXDistributorGradeList
(
demodel
).
Where
(
x
=>
x
.
IsGuest
>
1
);
//获取返佣价格设置
var
listCommission
=
userModule
.
GetFXCommissionList
(
new
RB_Distributor_FXCommission_Extend
{
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
),
MallBaseId
=
parms
.
MallBaseId
});
List
<
RB_Distributor_FXGrade_Extend
>
titleList
=
new
List
<
RB_Distributor_FXGrade_Extend
>();
foreach
(
var
item
in
list
)
{
item
.
FXCommissionList
=
new
List
<
RB_Distributor_FXCommission_Extend
>();
var
nowList
=
listCommission
.
Where
(
x
=>
x
.
FXGradeId
==
item
.
Id
);
RB_Distributor_FXGrade_Extend
titleModel
=
new
RB_Distributor_FXGrade_Extend
{
GradeName
=
item
.
IsGuest
==
3
?
"直接"
+
item
.
GradeName
:
item
.
GradeName
,
};
titleList
.
Add
(
titleModel
);
if
(
item
.
IsGuest
==
3
)
{
titleModel
=
new
RB_Distributor_FXGrade_Extend
{
GradeName
=
"间接"
+
item
.
GradeName
,
};
titleList
.
Add
(
titleModel
);
}
foreach
(
var
commissionItem
in
list
)
{
if
(
nowList
.
Any
(
x
=>
x
.
CommissionGradeId
==
commissionItem
.
Id
&&
x
.
FXGradeId
==
item
.
Id
))
{
var
nowCommissionList
=
nowList
.
Where
(
x
=>
x
.
CommissionGradeId
==
commissionItem
.
Id
&&
x
.
FXGradeId
==
item
.
Id
);
nowCommissionList
.
ToList
().
ForEach
(
x
=>
x
.
GradeName
=
(
commissionItem
.
IsGuest
==
3
?
"直接"
+
commissionItem
.
GradeName
:
commissionItem
.
GradeName
));
item
.
FXCommissionList
.
AddRange
(
nowCommissionList
);
if
(
commissionItem
.
IsGuest
==
3
&&
nowCommissionList
.
Count
()
<
2
)
{
if
(
nowCommissionList
.
FirstOrDefault
().
GradeType
==
1
)
{
RB_Distributor_FXCommission_Extend
model
=
new
RB_Distributor_FXCommission_Extend
{
ID
=
0
,
FXGradeId
=
item
.
Id
,
CommissionGradeId
=
commissionItem
.
Id
,
GradeType
=
2
,
CommissionPrice
=
0
,
Status
=
0
,
GradeName
=
"间接"
+
commissionItem
.
GradeName
,
MallBaseId
=
item
.
MallBaseId
,
TenantId
=
item
.
TenantId
,
};
item
.
FXCommissionList
.
Add
(
model
);
}
else
{
RB_Distributor_FXCommission_Extend
model
=
new
RB_Distributor_FXCommission_Extend
{
ID
=
0
,
FXGradeId
=
item
.
Id
,
CommissionGradeId
=
commissionItem
.
Id
,
GradeType
=
1
,
CommissionPrice
=
0
,
Status
=
0
,
GradeName
=
"间接"
+
commissionItem
.
GradeName
,
MallBaseId
=
item
.
MallBaseId
,
TenantId
=
item
.
TenantId
,
};
item
.
FXCommissionList
.
Add
(
model
);
}
}
}
else
{
RB_Distributor_FXCommission_Extend
model
=
new
RB_Distributor_FXCommission_Extend
{
ID
=
0
,
FXGradeId
=
item
.
Id
,
CommissionGradeId
=
commissionItem
.
Id
,
GradeType
=
1
,
CommissionPrice
=
0
,
Status
=
0
,
GradeName
=
commissionItem
.
IsGuest
==
3
?
"直接"
+
commissionItem
.
GradeName
:
commissionItem
.
GradeName
,
MallBaseId
=
item
.
MallBaseId
,
TenantId
=
item
.
TenantId
,
};
item
.
FXCommissionList
.
Add
(
model
);
if
(
commissionItem
.
IsGuest
==
3
)
{
model
=
new
RB_Distributor_FXCommission_Extend
{
ID
=
0
,
FXGradeId
=
item
.
Id
,
CommissionGradeId
=
commissionItem
.
Id
,
GradeType
=
2
,
CommissionPrice
=
0
,
Status
=
0
,
GradeName
=
"间接"
+
commissionItem
.
GradeName
,
MallBaseId
=
item
.
MallBaseId
,
TenantId
=
item
.
TenantId
,
};
item
.
FXCommissionList
.
Add
(
model
);
}
}
}
}
var
result
=
new
{
resultList
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
GradeName
,
x
.
FXCommissionList
,
x
.
Grade
,
}),
titleList
=
titleList
.
Select
(
x
=>
new
{
x
.
GradeName
})
};
return
ApiResult
.
Success
(
""
,
result
);
}
/// <summary>
/// 新增修改等级
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetFXFxCommissionInfo
()
{
var
req
=
RequestParm
;
RB_Distributor_FXGrade_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_FXGrade_Extend
>(
req
.
msg
.
ToString
());
if
(
demodel
.
FXCommissionList
.
Any
(
x
=>
x
.
CommissionPrice
<
0
))
{
return
ApiResult
.
Failed
(
"返佣价格不能小于0"
);
}
bool
flag
=
userModule
.
AddOrUpdateFxCommission
(
demodel
.
FXCommissionList
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
}
}
\ No newline at end of file
Mall.WindowsService/Module/FinanceModule.cs
View file @
1b006293
...
...
@@ -193,17 +193,36 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
{
if
(
orderGoodsItem
.
Final_Price
>
0
)
{
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
();
newOrderGoods
=
orderGoodsItem
;
newOrderGoods
.
FinanceType
=
1
;
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
{
FinanceType
=
1
,
Final_Price
=
orderGoodsItem
.
Final_Price
,
Number
=
1
,
FreightMoney
=
orderGoodsItem
.
FreightMoney
,
GoodsName
=
orderGoodsItem
.
GoodsName
,
OrderNo
=
orderGoodsItem
.
OrderNo
,
Id
=
orderGoodsItem
.
Id
};
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 1;
result
.
Add
(
newOrderGoods
);
}
if
(
orderGoodsItem
.
FreightMoney
.
HasValue
&&
orderGoodsItem
.
FreightMoney
.
Value
>
0
)
{
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
();
newOrderGoods
=
orderGoodsItem
;
newOrderGoods
.
FinanceType
=
2
;
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 2;
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
{
FinanceType
=
2
,
Final_Price
=
orderGoodsItem
.
Final_Price
,
Number
=
1
,
FreightMoney
=
orderGoodsItem
.
FreightMoney
,
GoodsName
=
orderGoodsItem
.
GoodsName
,
OrderNo
=
orderGoodsItem
.
OrderNo
,
Id
=
orderGoodsItem
.
Id
};
result
.
Add
(
newOrderGoods
);
}
RB_Finance_RecordDetail
financeRecordDetail
=
new
RB_Finance_RecordDetail
...
...
@@ -267,7 +286,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
Remark
=
System
.
DateTime
.
Now
.
ToString
(
"yyyy年MM月dd日"
)
+
"自动生成财务单据"
,
detailList
,
OriginalFee
,
RB_Depart_Id
=
Config
.
IncomeDepartment
RB_Depart_Id
=
Config
.
IncomeDepartment
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
FinanceKey
);
var
resultInfo
=
new
...
...
@@ -973,7 +992,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
/// 批量制退款单
/// </summary>
/// <returns></returns>
public
static
bool
AutoCreateFinanceRefund
()
{
public
static
bool
AutoCreateFinanceRefund
()
{
try
{
//先查询规则
...
...
@@ -1019,7 +1039,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
{
OrderRefundFinanceModule
(
olist
,
afterlist
);
}
else
{
else
{
//没有 创建一条记录 财务单据为0的记录
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
record
.
MallBaseId
=
item
.
MallBaseId
;
...
...
@@ -1050,7 +1071,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
/// </summary>
/// <param name="omodel"></param>
/// <returns></returns>
public
static
bool
OrderRefundFinanceModule
(
List
<
RB_Goods_Order_Extend
>
oList
,
List
<
RB_Goods_OrderAfterSale_Extend
>
afterList
)
public
static
bool
OrderRefundFinanceModule
(
List
<
RB_Goods_Order_Extend
>
oList
,
List
<
RB_Goods_OrderAfterSale_Extend
>
afterList
)
{
var
flag
=
false
;
try
...
...
@@ -1111,7 +1132,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
//售后退款
foreach
(
var
dmodel
in
afterList
)
{
foreach
(
var
dmodel
in
afterList
)
{
decimal
Money
=
dmodel
.
Refund
??
0
;
TotalMoney
+=
Money
;
//查询用户
...
...
@@ -1194,7 +1216,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
record
.
RecordDetailList
.
ForEach
(
x
=>
x
.
FinanceId
=
frid
);
flag
=
financeRecordDetailRepository
.
InsertBatch
(
record
.
RecordDetailList
);
foreach
(
var
omodel
in
oList
)
{
foreach
(
var
omodel
in
oList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_Order_Extend
.
Remark
),
omodel
.
Remark
+
" 自动生成财务退款单据:"
+
frid
}
};
...
...
@@ -1217,7 +1240,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
};
goods_OrderRepository
.
Update
(
keyValues
,
wheres
);
}
foreach
(
var
dmodel
in
afterList
)
{
foreach
(
var
dmodel
in
afterList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReRemark
),
dmodel
.
ReRemark
+
" 自动生成财务退款单据:"
+
frid
},
{
nameof
(
RB_Goods_OrderAfterSale
.
FinanceId
),
frid
},
...
...
@@ -1252,7 +1276,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
});
}
}
Helper
.
LogHelper
.
Write
(
apiResult
);
Helper
.
LogHelper
.
Write
(
apiResult
);
}
}
catch
(
Exception
ex
)
...
...
Mall.WindowsService/WindowsService.cs
View file @
1b006293
...
...
@@ -12,9 +12,9 @@ namespace Mall.WindowsService
partial
class
WindowsService
:
ServiceBase
{
System
.
Timers
.
Timer
timer1
;
//计时器
private
System
.
Timers
.
Timer
timer2
;
//订单取消计时器
private
System
.
Timers
.
Timer
timer3
;
//订单自动收货计时器
private
System
.
Timers
.
Timer
timer4
;
//七天自动取消下线计时器
//
private System.Timers.Timer timer2; //订单取消计时器
//
private System.Timers.Timer timer3; //订单自动收货计时器
//
private System.Timers.Timer timer4; //七天自动取消下线计时器
public
WindowsService
()
{
...
...
@@ -27,44 +27,44 @@ namespace Mall.WindowsService
Helper
.
LogHelper
.
Write
(
"主服务开始运行......"
);
TimersHelper
helper
=
new
TimersHelper
();
timer1
=
new
System
.
Timers
.
Timer
();
timer1
.
Interval
=
1000
*
(
60
*
60
);
//60分钟
timer1
.
Interval
=
1000
*
(
60
*
0.5
);
//60分钟
timer1
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
RevenueFinance
);
timer1
.
Enabled
=
true
;
#
region
订单取消定时器
//
#region 订单取消定时器
timer2
=
new
System
.
Timers
.
Timer
{
Interval
=
1000
*
(
60
*
10
)
//10分钟处理一次
};
timer2
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
AutoCancelOrder
);
timer2
.
Enabled
=
true
;
//
timer2 = new System.Timers.Timer
//
{
//
Interval = 1000 * (60 * 10) //10分钟处理一次
//
};
//
timer2.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoCancelOrder);
//
timer2.Enabled = true;
#
endregion
//
#endregion
#
region
订单自动完成定时器
//
#region 订单自动完成定时器
timer3
=
new
System
.
Timers
.
Timer
();
timer3
=
new
System
.
Timers
.
Timer
{
Interval
=
1000
*
(
60
*
60
)
//60分钟调用一次
};
timer3
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
AutoReceivingOrder
);
timer3
.
Enabled
=
true
;
//
timer3 = new System.Timers.Timer();
//
timer3 = new System.Timers.Timer
//
{
//
Interval = 1000 * (60 * 60) //60分钟调用一次
//
};
//
timer3.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReceivingOrder);
//
timer3.Enabled = true;
#
endregion
//
#endregion
#
region
七天自动取消下线
//
#region 七天自动取消下线
timer4
=
new
System
.
Timers
.
Timer
();
timer4
=
new
System
.
Timers
.
Timer
{
Interval
=
1000
*
(
60
*
60
)
//60分钟调用一次
};
timer4
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
helper
.
AutoReleaseTheOffline
);
timer4
.
Enabled
=
true
;
//
timer4 = new System.Timers.Timer();
//
timer4 = new System.Timers.Timer
//
{
//
Interval = 1000 * (60 * 60) //60分钟调用一次
//
};
//
timer4.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReleaseTheOffline);
//
timer4.Enabled = true;
#
endregion
//
#endregion
}
protected
override
void
OnStop
()
...
...
@@ -72,9 +72,9 @@ namespace Mall.WindowsService
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
Helper
.
LogHelper
.
Write
(
"主服务停止运行......"
);
this
.
timer1
.
Enabled
=
false
;
this
.
timer2
.
Enabled
=
false
;
this
.
timer3
.
Enabled
=
false
;
this
.
timer4
.
Enabled
=
false
;
//
this.timer2.Enabled = false;
//
this.timer3.Enabled = false;
//
this.timer4.Enabled = false;
}
}
}
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