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
8eec5677
Commit
8eec5677
authored
Jul 16, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
14ec4b54
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
359 additions
and
102 deletions
+359
-102
RB_WarehouseOut_Goods.cs
Mall.Model/Entity/Property/RB_WarehouseOut_Goods.cs
+1
-8
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+2
-2
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+2
-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
+4
-4
WarehouseOutController.cs
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
+4
-3
SupplierController.cs
Mall.WebApi/Controllers/User/SupplierController.cs
+28
-8
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.Model/Entity/Property/RB_WarehouseOut_Goods.cs
View file @
8eec5677
...
...
@@ -134,14 +134,7 @@ namespace Mall.Model.Entity.Property
set
;
}
/// <summary>
/// 供应商id
/// </summary>
public
int
SupplierId
{
get
;
set
;
}
/// <summary>
/// 成本价
...
...
Mall.Module.Product/OrderModule.cs
View file @
8eec5677
...
...
@@ -8116,9 +8116,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 @
8eec5677
...
...
@@ -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/UserModule.cs
View file @
8eec5677
...
...
@@ -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>
/// 设置打款备注
...
...
@@ -4488,7 +4492,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
>();
...
...
@@ -4496,17 +4501,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
()
+
"%"
);
...
...
@@ -4520,12 +4529,14 @@ namespace Mall.Module.User
ContenList
.
Add
(
itemList
);
}
return
ApiResult
.
Success
(
""
,
new
{
return
ApiResult
.
Success
(
""
,
new
{
TitleList
,
ContenList
});
}
else
{
else
{
return
ApiResult
.
Failed
(
"没有数据"
);
}
}
...
...
@@ -4550,10 +4561,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
));
}
...
...
@@ -4849,6 +4862,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 @
8eec5677
...
...
@@ -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 @
8eec5677
...
...
@@ -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
View file @
8eec5677
...
...
@@ -14,14 +14,14 @@ namespace Mall.Repository.User
/// </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
>
Get
Coup
onPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_FXCommission_Extend
query
)
public
List
<
RB_Distributor_FXCommission_Extend
>
Get
FXCommissi
onPageList
(
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"
);
...
...
@@ -45,11 +45,11 @@ namespace Mall.Repository.User
/// <summary>
///
卡券信息
列表
///
返佣
列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
Get
Coup
onList
(
RB_Distributor_FXCommission_Extend
query
)
public
List
<
RB_Distributor_FXCommission_Extend
>
Get
FXCommissi
onList
(
RB_Distributor_FXCommission_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Distributor_FXCommission_Extend
.
Status
)}
=0 "
);
...
...
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
View file @
8eec5677
...
...
@@ -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 @
8eec5677
...
...
@@ -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/UserController.cs
View file @
8eec5677
...
...
@@ -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
(
"请传递同级返佣比例"
);
}
...
...
@@ -2767,7 +2769,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
);
}
...
...
@@ -2796,6 +2799,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 @
8eec5677
...
...
@@ -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 @
8eec5677
...
...
@@ -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