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
c5f2f217
Commit
c5f2f217
authored
Jul 02, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成财务单据条件,
parent
b77446f4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
10 deletions
+78
-10
UserSourceEnum.cs
Mall.Common/Enum/User/UserSourceEnum.cs
+6
-1
RB_Goods_OrderAfterSale_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderAfterSale_Extend.cs
+9
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+7
-2
RB_Goods_OrderAfterSaleRepository.cs
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
+6
-0
FinanceModule.cs
Mall.WindowsService/Module/FinanceModule.cs
+50
-7
No files found.
Mall.Common/Enum/User/UserSourceEnum.cs
View file @
c5f2f217
...
...
@@ -31,6 +31,11 @@ namespace Mall.Common.Enum.User
/// 百度
/// </summary>
[
EnumField
(
"百度"
)]
Baidu
=
4
Baidu
=
4
,
/// <summary>
/// H5站点
/// </summary>
[
EnumField
(
"H5"
)]
H5
=
5
}
}
Mall.Model/Extend/Product/RB_Goods_OrderAfterSale_Extend.cs
View file @
c5f2f217
...
...
@@ -74,5 +74,14 @@ namespace Mall.Model.Extend.Product
/// 凭证列表
/// </summary>
public
List
<
string
>
VoucherList
{
get
;
set
;
}
/// <summary>
/// 完成开始时间
/// </summary>
public
string
FStartTime
{
get
;
set
;
}
/// <summary>
/// 完成结束时间
/// </summary>
public
string
FEndTime
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
c5f2f217
...
...
@@ -5564,6 +5564,7 @@ namespace Mall.Module.Product
if
(
type
==
1
)
{
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
OrderStatus
),
OrderStatusEnum
.
Cancel
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
CancelTime
),
DateTime
.
Now
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
ApplyForCancelStatus
),
1
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
RefundOrderNo
),
RefundOrderNo
);
}
...
...
@@ -5828,6 +5829,7 @@ namespace Mall.Module.Product
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
};
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
OrderStatus
),
OrderStatusEnum
.
Cancel
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
CancelTime
),
DateTime
.
Now
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
RefundOrderNo
),
RefundOrderNo
);
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
NonPayment
)
{
...
...
@@ -6050,8 +6052,11 @@ namespace Mall.Module.Product
goods_OrderRepository
.
DBSession
.
Commit
();
if
(
flag
&&
tenantId
==
1
)
{
//同意 创建财务单据
OrderRefundFinanceModule
(
omodel
,
true
);
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
NonPayment
)
{
//同意 创建财务单据
OrderRefundFinanceModule
(
omodel
,
true
);
}
}
return
flag
;
}
...
...
Mall.Repository/Product/RB_Goods_OrderAfterSaleRepository.cs
View file @
c5f2f217
...
...
@@ -191,6 +191,12 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
OrderDetialId
)}
in(
{
dmodel
.
OrderDetailIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
FStartTime
))
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
FinishTime
)}
>='
{
dmodel
.
FStartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
FEndTime
))
{
where
+=
$" and oas.
{
nameof
(
RB_Goods_OrderAfterSale
.
FinishTime
)}
<='
{
dmodel
.
FEndTime
}
23:59:59'"
;
}
string
sql
=
$@"SELECT oas.* FROM rb_goods_orderaftersale oas
{
where
}
order by oas.ReOrderId desc"
;
return
Get
<
RB_Goods_OrderAfterSale_Extend
>(
sql
).
ToList
();
...
...
Mall.WindowsService/Module/FinanceModule.cs
View file @
c5f2f217
...
...
@@ -1008,8 +1008,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
//查询所有的退款
var
olist
=
goods_OrderRepository
.
GetOrderRefunedCreateList
(
item
.
TenantId
,
item
.
MallBaseId
,
startDate
.
ToString
(
"yyyy-MM-dd"
),
endDate
.
ToString
(
"yyyy-MM-dd"
));
//查询所有的售后退款
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
});
OrderRefundFinanceModule
(
olist
);
var
afterlist
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
FStartTime
=
startDate
.
ToString
(
"yyyy-MM-dd"
),
FEndTime
=
endDate
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
),
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
,
Type
=
1
,
ReOrderStatus
=
OrderAfterSaleStatusEnum
.
Completed
});
OrderRefundFinanceModule
(
olist
,
afterlist
);
}
}
}
...
...
@@ -1030,7 +1030,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
)
public
static
bool
OrderRefundFinanceModule
(
List
<
RB_Goods_Order_Extend
>
oList
,
List
<
RB_Goods_OrderAfterSale_Extend
>
afterList
)
{
var
flag
=
false
;
try
...
...
@@ -1044,12 +1044,13 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
record
.
MallBaseId
=
item
.
MallBaseId
;
record
.
TenantId
=
item
.
TenantId
;
record
.
Type
=
1
;
record
.
Type
=
3
;
record
.
CreateDate
=
System
.
DateTime
.
Now
;
record
.
RecordDetailList
=
new
List
<
RB_Finance_RecordDetail
>();
decimal
TotalMoney
=
0
;
var
detailList
=
new
List
<
object
>();
//订单退款
foreach
(
var
omodel
in
oList
)
{
decimal
Money
=
omodel
.
Income
??
0
;
...
...
@@ -1058,7 +1059,6 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
var
umodel
=
member_UserRepository
.
GetEntity
(
omodel
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
string
dstr
=
"客人付款:"
+
(
omodel
.
Income
??
0
)
+
"金额,退款:"
+
(
omodel
.
Income
??
0
);
detailList
.
Add
(
new
{
...
...
@@ -1066,7 +1066,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
Number
=
1
,
OriginalMoney
=
Money
,
UnitPrice
=
Money
,
Remark
=
"订单号:"
+
omodel
.
OrderNo
+
" "
+
dstr
Remark
=
omodel
.
OrderNo
}
);
...
...
@@ -1080,7 +1080,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
MallBaseId
=
record
.
MallBaseId
,
FinanceId
=
0
,
CreateDate
=
record
.
CreateDate
,
Name
=
""
,
Name
=
"
订单取消退款
"
,
OrderId
=
omodel
.
OrderId
,
OrderDetailId
=
0
,
GoodsPrice
=
0
,
...
...
@@ -1090,6 +1090,49 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
};
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
//售后退款
foreach
(
var
dmodel
in
afterList
)
{
decimal
Money
=
dmodel
.
Refund
??
0
;
TotalMoney
+=
Money
;
//查询用户
var
umodel
=
member_UserRepository
.
GetEntity
(
dmodel
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
var
omodel
=
goods_OrderRepository
.
GetEntity
(
dmodel
.
OrderId
);
if
(
omodel
==
null
)
{
return
false
;
}
string
dstr
=
"客人付款:"
+
(
dmodel
.
Income
??
0
)
+
",退款:"
+
(
dmodel
.
Refund
??
0
);
detailList
.
Add
(
new
{
CostTypeId
=
item
.
RefundCostTypeId
,
Number
=
1
,
OriginalMoney
=
Money
,
UnitPrice
=
Money
,
Remark
=
"订单号:"
+
omodel
.
OrderNo
+
"售后单号:"
+
(
dmodel
.
ReOrderNo
??
"暂无"
)
+
" "
+
dstr
}
);
RB_Finance_RecordDetail
financeRecordDetail
=
new
RB_Finance_RecordDetail
{
ID
=
0
,
RecordId
=
0
,
Type
=
record
.
Type
,
TenantId
=
record
.
TenantId
,
MallBaseId
=
record
.
MallBaseId
,
FinanceId
=
0
,
CreateDate
=
record
.
CreateDate
,
Name
=
"售后退款"
,
OrderId
=
omodel
.
OrderId
,
OrderDetailId
=
dmodel
.
OrderDetialId
??
0
,
GoodsPrice
=
0
,
FreightMoney
=
0
,
Unit_Price
=
Money
,
Number
=
1
};
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
item
.
IsPublic
=
8
;
//默认原路退款
string
Remark
=
System
.
DateTime
.
Now
.
ToString
(
"yyyy年MM月dd日"
)
+
" 自动生成财务单据"
;
...
...
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