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
0305fe6d
Commit
0305fe6d
authored
Jun 09, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
21de4655
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
212 additions
and
6 deletions
+212
-6
RB_Goods_OrderDetail_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
+6
-0
FinanceModule.cs
Mall.Module.Product/FinanceModule.cs
+21
-5
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+14
-0
RB_Goods_OrderDetailRepository.cs
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
+76
-0
SupplierController.cs
Mall.WebApi/Controllers/User/SupplierController.cs
+95
-1
No files found.
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
View file @
0305fe6d
...
...
@@ -120,6 +120,12 @@ namespace Mall.Model.Extend.Product
/// 是否制单
/// </summary>
public
int
IsFinance
{
get
;
set
;
}
/// <summary>
/// 订单商品ids
/// </summary>
public
List
<
int
>
IdList
{
get
;
set
;
}
#
endregion
}
...
...
Mall.Module.Product/FinanceModule.cs
View file @
0305fe6d
...
...
@@ -44,6 +44,19 @@ namespace Mall.Module.Finance
private
readonly
RB_CurrencyRepository
currencyRepository
=
new
RB_CurrencyRepository
();
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_Configurine_Extend
>
GetFinanceConfigurineList
(
RB_Finance_Configurine_Extend
dmodel
)
{
return
finance_ConfigurineRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 获取财务配置
/// </summary>
...
...
@@ -62,9 +75,11 @@ namespace Mall.Module.Finance
Msg
=
"需新增"
};
}
else
{
else
{
int
TypeId
=
0
;
if
(
fmodel
.
Type
==
1
)
{
if
(
fmodel
.
Type
==
1
)
{
var
backModel
=
backAccountRepository
.
GetAccountList
(
new
RB_BackAccount_Extend
()
{
BankType
=
fmodel
.
AccountType
,
ID
=
fmodel
.
AccountId
??
0
,
RB_Group_Id
=
2
}).
FirstOrDefault
();
TypeId
=
backModel
?.
TypeId
??
0
;
}
...
...
@@ -87,7 +102,7 @@ namespace Mall.Module.Finance
fmodel
.
RemitCostTypeId
,
fmodel
.
WorkFlowId
,
fmodel
.
Type
,
StartTime
=
fmodel
.
StartTime
.
HasValue
?
fmodel
.
StartTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
):
""
,
StartTime
=
fmodel
.
StartTime
.
HasValue
?
fmodel
.
StartTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
fmodel
.
IntervalDay
}
};
...
...
@@ -153,7 +168,8 @@ namespace Mall.Module.Finance
/// 获取币种
/// </summary>
/// <returns></returns>
public
object
GetFinanceCurrencyList
()
{
public
object
GetFinanceCurrencyList
()
{
var
list
=
currencyRepository
.
GetList
(
new
Model
.
Entity
.
Finance
.
RB_Currency
()
{
RB_Group_Id
=
2
});
return
list
.
Select
(
x
=>
new
{
...
...
@@ -202,6 +218,6 @@ namespace Mall.Module.Finance
return
list
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
0305fe6d
...
...
@@ -6524,6 +6524,20 @@ namespace Mall.Module.Product
{
return
goods_OrderDetailRepository
.
GetSupplierOrderPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
}
/// <summary>
/// 获取订单商品列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetSupplierOrderList
(
RB_Goods_OrderDetail_Extend
dmodel
)
{
return
goods_OrderDetailRepository
.
GetSupplierOrderList
(
dmodel
);
}
#
endregion
}
}
Mall.Repository/Product/RB_Goods_OrderDetailRepository.cs
View file @
0305fe6d
...
...
@@ -137,5 +137,81 @@ INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where
{
where
}
order by o.CreateDate desc"
;
return
GetPage
<
RB_Goods_OrderDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取订单商品列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderDetail_Extend
>
GetSupplierOrderList
(
RB_Goods_OrderDetail_Extend
dmodel
)
{
string
where
=
$" 1=1 and o.
{
nameof
(
RB_Goods_Order
.
Status
)}
=0 and o.OrderStatus in(2,3,4,5,6) "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
OrderType
>
0
)
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
OrderType
)}
=
{
dmodel
.
OrderType
}
"
;
}
if
(
dmodel
.
SupplierId
>
0
)
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
if
(
dmodel
.
IsFinance
>
0
)
{
if
(
dmodel
.
IsFinance
==
1
)
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
)}
>0"
;
}
else
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
)}
<=0"
;
}
}
if
(
dmodel
.
IdList
!=
null
&&
dmodel
.
IdList
.
Any
())
{
string
ids
=
string
.
Join
(
","
,
dmodel
.
IdList
.
Select
(
x
=>
x
));
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
Id
)}
in(
{
ids
}
) "
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
CreateDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
CreateDate
)}
<='
{
dmodel
.
EndTime
}
23:59:59'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
like '%
{
dmodel
.
OrderNo
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsName
))
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
GoodsName
)}
like '%
{
dmodel
.
GoodsName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ProductCode
))
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
ProductCode
)}
like '%
{
dmodel
.
ProductCode
}
%'"
;
}
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
();
}
}
}
Mall.WebApi/Controllers/User/SupplierController.cs
View file @
0305fe6d
...
...
@@ -5,8 +5,11 @@ using System.Threading.Tasks;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Finance
;
using
Mall.Model.Extend.Finance
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
using
Mall.Module.Finance
;
using
Mall.Module.Product
;
using
Mall.Module.User
;
using
Mall.WebApi.Filter
;
...
...
@@ -29,6 +32,13 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
private
readonly
OrderModule
orderModule
=
new
OrderModule
();
/// <summary>
/// 财务
/// </summary>
private
readonly
FinanceModule
financeModule
=
new
FinanceModule
();
#
region
供应商管理
[
HttpPost
]
public
ApiResult
GetSupplierList
()
...
...
@@ -173,7 +183,7 @@ namespace Mall.WebApi.Controllers.User
/// <summary>
/// 获取
详情
/// 获取
供应商下拉列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
...
...
@@ -221,6 +231,90 @@ namespace Mall.WebApi.Controllers.User
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
//生成财务单据
/// <summary>
/// 供应商商品生成财务单据
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
PayCostFinance
()
{
var
parms
=
RequestParm
;
RB_Goods_OrderDetail_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderDetail_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
UserInfo
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetSupplierOrderList
(
demodel
);
var
result
=
new
List
<
RB_Goods_OrderDetail_Extend
>();
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
record
.
MallBaseId
=
demodel
.
MallBaseId
;
record
.
TenantId
=
demodel
.
TenantId
;
record
.
Type
=
2
;
record
.
CreateDate
=
System
.
DateTime
.
Now
;
record
.
RecordDetailList
=
new
List
<
RB_Finance_RecordDetail
>();
if
(
list
!=
null
&&
list
.
Any
())
{
//先查询规则
var
financeConfigurineModel
=
financeModule
.
GetFinanceConfigurineList
(
new
Model
.
Extend
.
Finance
.
RB_Finance_Configurine_Extend
{
Type
=
1
,
MallBaseId
=
demodel
.
MallBaseId
,
TenantId
=
demodel
.
TenantId
}).
FirstOrDefault
();
foreach
(
var
orderGoodsItem
in
list
)
{
if
(
orderGoodsItem
.
Final_Price
>
0
)
{
var
newOrderGoods
=
new
RB_Goods_OrderDetail_Extend
();
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
;
result
.
Add
(
newOrderGoods
);
}
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
=
orderGoodsItem
.
GoodsName
,
OrderId
=
orderGoodsItem
.
OrderId
??
0
,
OrderDetailId
=
orderGoodsItem
.
Id
,
GoodsPrice
=
((
orderGoodsItem
.
Final_Price
??
0
)
-
(
orderGoodsItem
.
FreightMoney
??
0
)),
FreightMoney
=
orderGoodsItem
.
FreightMoney
,
Unit_Price
=
orderGoodsItem
.
Unit_Price
,
Number
=
orderGoodsItem
.
Number
};
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
var
detailList
=
result
.
Select
(
x
=>
new
{
CostTypeId
=
x
.
FinanceType
==
1
?
financeConfigurineModel
.
CBCostTypeId
:
financeConfigurineModel
.
FreightCostTypeId
,
Number
=
x
.
FinanceType
==
1
?
x
.
Number
:
1
,
OriginalMoney
=
x
.
FinanceType
==
1
?
x
.
Unit_Price
:
x
.
FreightMoney
,
UnitPrice
=
x
.
FinanceType
==
1
?
(((
x
.
Final_Price
??
0
)
-
(
x
.
FreightMoney
??
0
))
/
(
x
.
Number
??
0
))
:
x
.
FreightMoney
,
Remark
=
x
.
GoodsName
+
x
.
OrderNo
});
}
return
ApiResult
.
Success
(
""
);
}
#
endregion
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment