Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Property
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
liudong1993
Property
Commits
bb456408
Commit
bb456408
authored
Jul 13, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交记录
parent
bf783e16
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
391 additions
and
6 deletions
+391
-6
RB_Finance_Record.cs
Property.Model/Entity/Mall/RB_Finance_Record.cs
+72
-0
RB_Finance_RecordDetail.cs
Property.Model/Entity/Mall/RB_Finance_RecordDetail.cs
+117
-0
RB_Goods_OrderDetail.cs
Property.Model/Entity/Mall/RB_Goods_OrderDetail.cs
+6
-0
RB_Finance_Record_Extend.cs
Property.Model/Extend/Mall/RB_Finance_Record_Extend.cs
+22
-0
WarehouseOutModule.cs
Property.Module.Mall/WarehouseOutModule.cs
+25
-2
RB_ERP_AuthorizeRepository.cs
Property.Repository/Mall/RB_ERP_AuthorizeRepository.cs
+4
-1
RB_Finance_RecordDetailRepository.cs
...erty.Repository/Mall/RB_Finance_RecordDetailRepository.cs
+71
-0
RB_Finance_RecordRepository.cs
Property.Repository/Mall/RB_Finance_RecordRepository.cs
+42
-0
WarehouseOutController.cs
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
+32
-3
No files found.
Property.Model/Entity/Mall/RB_Finance_Record.cs
0 → 100644
View file @
bb456408
using
REBORN.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Property.Model.Entity.Mall
{
/// <summary>
/// 财务生成记录表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"MallConnection"
)]
public
class
RB_Finance_Record
{
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 类型 1收款 2成本 3退款 4打款
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 财务id
/// </summary>
public
int
FinanceId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// 是否是成本与运费一起制单,0-全部,1-成本,2-运费
/// </summary>
public
int
IsFinanceAll
{
get
;
set
;
}
}
}
Property.Model/Entity/Mall/RB_Finance_RecordDetail.cs
0 → 100644
View file @
bb456408
using
REBORN.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Property.Model.Entity.Mall
{
/// <summary>
/// 财务生成记录详情表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"MallConnection"
)]
public
class
RB_Finance_RecordDetail
{
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 记录表ID
/// </summary>
public
int
RecordId
{
get
;
set
;
}
/// <summary>
/// 类型 1收款 2成本 3退款 4打款
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 财务id
/// </summary>
public
int
FinanceId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// 商品名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 订单id
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 订单详情id
/// </summary>
public
int
OrderDetailId
{
get
;
set
;
}
/// <summary>
/// 商品价格
/// </summary>
public
decimal
GoodsPrice
{
get
;
set
;
}
/// <summary>
/// 运费
/// </summary>
public
decimal
?
FreightMoney
{
get
;
set
;
}
/// <summary>
/// 单价
/// </summary>
public
decimal
?
Unit_Price
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
?
Number
{
get
;
set
;
}
}
}
Property.Model/Entity/Mall/RB_Goods_OrderDetail.cs
View file @
bb456408
...
...
@@ -202,6 +202,12 @@ namespace Property.Model.Entity.Mall
/// 成本单据ID
/// </summary>
public
int
CostFinanceId
{
get
;
set
;
}
/// <summary>
/// 运费成本单据ID
/// </summary>
public
int
FreightFinanceId
{
get
;
set
;
}
/// <summary>
/// 积分赠送
/// </summary>
...
...
Property.Model/Extend/Mall/RB_Finance_Record_Extend.cs
0 → 100644
View file @
bb456408
using
Property.Model.Entity.Mall
;
using
REBORN.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Property.Model.Extend.Mall
{
/// <summary>
/// 财务生成记录表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"MallConnection"
)]
public
class
RB_Finance_Record_Extend
:
RB_Finance_Record
{
/// <summary>
/// 详情
/// </summary>
public
List
<
RB_Finance_RecordDetail
>
RecordDetailList
{
get
;
set
;
}
}
}
Property.Module.Mall/WarehouseOutModule.cs
View file @
bb456408
...
...
@@ -46,7 +46,14 @@ namespace Property.Module.Mall
private
readonly
Rb_employeeRepository
employeeRepository
=
new
Rb_employeeRepository
();
/// <summary>
/// 财务生成记录
/// </summary>
private
static
RB_Finance_RecordRepository
financeRecordRepository
=
new
RB_Finance_RecordRepository
();
/// <summary>
/// 财务生成记录详情
/// </summary>
private
static
RB_Finance_RecordDetailRepository
financeRecordDetailRepository
=
new
RB_Finance_RecordDetailRepository
();
/// <summary>
/// 库存表
...
...
@@ -224,7 +231,7 @@ namespace Property.Module.Mall
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetStockOutInfo
(
RB_WarehouseOut_Apply_Extend
applyModel
,
RB_Supplies_StockOut_Extend
demodel
,
List
<
RB_WarehouseOut_Goods_Extend
>
financeList
,
int
RB_Department_Id
)
public
bool
SetStockOutInfo
(
RB_WarehouseOut_Apply_Extend
applyModel
,
RB_Supplies_StockOut_Extend
demodel
,
List
<
RB_WarehouseOut_Goods_Extend
>
financeList
,
RB_Finance_Record_Extend
record
,
int
RB_Department_Id
)
{
var
trans
=
supplies_StockOutRepository
.
DbTransaction
;
try
...
...
@@ -334,6 +341,22 @@ namespace Property.Module.Mall
//新增申请单的财务单据
warehouseOutFinanceRepository
.
Insert
(
applyModel
.
WarehouseOutFinanceModel
,
trans
);
warehouseOutGoodsDetailRepository
.
InsertBatch
(
applyModel
.
WarehouseOutGoodsDetailList
,
trans
);
//写入电商财务记录
record
.
FinanceId
=
frid
;
int
recordId
=
0
;
if
(
record
.
ID
==
0
)
{
recordId
=
financeRecordRepository
.
Insert
(
record
);
if
(
record
.
RecordDetailList
!=
null
&&
record
.
RecordDetailList
.
Any
())
{
record
.
RecordDetailList
.
ForEach
(
x
=>
x
.
RecordId
=
recordId
);
record
.
RecordDetailList
.
ForEach
(
x
=>
x
.
FinanceId
=
record
.
FinanceId
);
financeRecordDetailRepository
.
InsertBatch
(
record
.
RecordDetailList
);
}
}
}
//编码自动生成
string
BMStr
=
Id
.
ToString
();
...
...
Property.Repository/Mall/RB_ERP_AuthorizeRepository.cs
View file @
bb456408
...
...
@@ -99,7 +99,10 @@ LEFT JOIN rb_tenant as e on e.TenantId = a.TenantId where 1=1");
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_ERP_Authorize_Extend
.
MallUserId
)}
=
{
query
.
MallUserId
}
"
);
}
if
(
query
.
ERPGroupId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_ERP_Authorize_Extend
.
ERPGroupId
)}
=
{
query
.
ERPGroupId
}
"
);
}
}
return
Get
<
RB_ERP_Authorize_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
Property.Repository/Mall/RB_Finance_RecordDetailRepository.cs
0 → 100644
View file @
bb456408
using
Property.Model.Entity.Mall
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Property.Repository.Mall
{
public
class
RB_Finance_RecordDetailRepository
:
RepositoryBase
<
RB_Finance_RecordDetail
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Finance_RecordDetail
);
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_RecordDetail
>
GetList
(
RB_Finance_RecordDetail
dmodel
)
{
string
where
=
$" where 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
Type
)}
=
{
dmodel
.
Type
}
"
;
}
string
sql
=
$@"SELECT * FROM
{
TableName
}
{
where
}
order by Id asc"
;
return
Get
<
RB_Finance_RecordDetail
>(
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_RecordDetail
>
GetListByOrderIds
(
string
orderIds
,
RB_Finance_RecordDetail
dmodel
)
{
string
where
=
$" where 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
Type
)}
=
{
dmodel
.
Type
}
"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
orderIds
))
{
where
+=
$@" and
{
nameof
(
RB_Finance_RecordDetail
.
OrderId
)}
in (
{
orderIds
}
)"
;
}
string
sql
=
$@"SELECT * FROM
{
TableName
}
{
where
}
order by Id asc"
;
return
Get
<
RB_Finance_RecordDetail
>(
sql
).
ToList
();
}
}
}
Property.Repository/Mall/RB_Finance_RecordRepository.cs
0 → 100644
View file @
bb456408
using
Property.Model.Entity.Mall
;
using
Property.Model.Extend.Mall
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Property.Repository.Mall
{
public
class
RB_Finance_RecordRepository
:
RepositoryBase
<
RB_Finance_Record
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Finance_Record
);
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_Record_Extend
>
GetList
(
RB_Finance_Record_Extend
dmodel
)
{
string
where
=
$" where 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_Record
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_Record
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_Record
.
Type
)}
=
{
dmodel
.
Type
}
"
;
}
string
sql
=
$@"SELECT * FROM
{
TableName
}
{
where
}
order by Id asc"
;
return
Get
<
RB_Finance_Record_Extend
>(
sql
).
ToList
();
}
}
}
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
View file @
bb456408
...
...
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Property.Model.Entity.Mall
;
using
Property.Model.Extend
;
using
Property.Model.Extend.Mall
;
using
Property.Module.FixedAssets
;
...
...
@@ -184,7 +185,16 @@ namespace Property.WebApi.Controllers.Mall
return
ApiResult
.
Failed
(
"出库单中的商品已全部出库"
);
}
#
region
财务记录
RB_Finance_Record_Extend
record
=
new
RB_Finance_Record_Extend
();
record
.
MallBaseId
=
applyModel
.
MallBaseId
;
record
.
TenantId
=
applyModel
.
TenantId
;
record
.
Type
=
2
;
record
.
IsFinanceAll
=
1
;
record
.
CreateDate
=
System
.
DateTime
.
Now
;
record
.
RecordDetailList
=
new
List
<
RB_Finance_RecordDetail
>();
#
endregion
//判断此次商品是否已出库与数量是否相等
...
...
@@ -205,7 +215,7 @@ namespace Property.WebApi.Controllers.Mall
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
ProductCode
=
oldOrderGoods
.
ProductCode
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
TenantId
=
oldOrderGoods
.
TenantId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
MallBaseId
=
oldOrderGoods
.
MallBaseId
);
if
(
oldOrderGoods
==
null
)
{
var
nowOrderGoods
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
FirstOrDefault
();
...
...
@@ -228,6 +238,26 @@ namespace Property.WebApi.Controllers.Mall
}
oldOrderGoods
.
CostMoney
=
nowGoodsList
.
Sum
(
x
=>
x
.
CostMoney
??
0
);
applyModel
.
WarehouseOutGoodsList
.
Add
(
oldOrderGoods
);
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
=
oldOrderGoods
.
GoodsName
,
OrderId
=
oldOrderGoods
.
OrderId
,
OrderDetailId
=
oldOrderGoods
.
OrderGoodsId
,
GoodsPrice
=
oldOrderGoods
.
CostMoney
??
0
,
FreightMoney
=
0
,
Unit_Price
=
Math
.
Round
((
oldOrderGoods
.
CostMoney
??
0
)
/
(
oldOrderGoods
.
Number
??
1
),
2
,
MidpointRounding
.
AwayFromZero
),
Number
=
oldOrderGoods
.
Number
};
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
...
...
@@ -381,8 +411,7 @@ namespace Property.WebApi.Controllers.Mall
financeList
.
Add
(
warehouseOutModel
);
}
#
endregion
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
userInfo
.
RB_Department_Id
);
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
record
,
userInfo
.
RB_Department_Id
);
if
(
flag
)
{
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