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
9edcd163
Commit
9edcd163
authored
Jul 30, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交diam
parent
0b844212
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
14 deletions
+88
-14
Config.cs
Property.Common/Config.cs
+12
-0
WarehouseOutModule.cs
Property.Module.Mall/WarehouseOutModule.cs
+21
-2
RB_WarehouseOut_GoodsDetailRepository.cs
....Repository/Mall/RB_WarehouseOut_GoodsDetailRepository.cs
+39
-1
WarehouseOutController.cs
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
+16
-11
No files found.
Property.Common/Config.cs
View file @
9edcd163
...
...
@@ -269,6 +269,18 @@ namespace REBORN.Common
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"PaymentFinanceApi"
).
Value
;
}
}
/// <summary>
/// 生成收款成本财务单据
/// </summary>
public
static
string
IncomeFinanceApi
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IncomeFinanceApi"
).
Value
;
}
}
/// <summary>
/// 生成成本的公司
/// </summary>
...
...
Property.Module.Mall/WarehouseOutModule.cs
View file @
9edcd163
...
...
@@ -267,12 +267,23 @@ namespace Property.Module.Mall
}
/// <summary>
/// 出库商品成本信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_WarehouseOut_GoodsDetail
>
GetApplyByOrderGoodsIdList
(
RB_WarehouseOut_GoodsDetail
query
,
string
orderGoodsId
)
{
return
warehouseOutGoodsDetailRepository
.
GetApplyByOrderGoodsIdList
(
query
,
orderGoodsId
);
}
/// <summary>
/// 保存出库单
/// </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
,
RB_Finance_Record_Extend
record
,
int
RB_Department_Id
,
List
<
RB_WarehouseOut_Goods_Extend
>
WarehouseOutGoodsList
)
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
,
List
<
RB_WarehouseOut_Goods_Extend
>
WarehouseOutGoodsList
,
List
<
RB_WarehouseOut_GoodsDetail
>
outGoodsDetailList
)
{
var
trans
=
supplies_StockOutRepository
.
DbTransaction
;
try
...
...
@@ -364,11 +375,19 @@ namespace Property.Module.Mall
var
nowGoodsFinan
=
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
OrderGoodsId
);
if
(
nowGoods
!=
null
&&
nowGoods
.
Any
())
{
//查询已有的成本
decimal
oldMoney
=
0
;
var
oldOutGoods
=
outGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
OrderGoodsId
);
if
(
oldOutGoods
!=
null
&&
oldOutGoods
.
Any
())
{
oldMoney
=
oldOutGoods
.
Sum
(
x
=>
x
.
CostMoney
??
0
)
/
Convert
.
ToDecimal
(
oldOutGoods
.
Count
());
}
costMoney
=
(
nowGoods
.
Sum
(
x
=>
x
.
CostMoney
??
0
)
/
nowGoodsFinan
.
Sum
(
x
=>
x
.
Number
??
0
));
//更新申请单的出库状态
Dictionary
<
string
,
object
>
filesGoods
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
),
frid
},
{
nameof
(
RB_Goods_OrderDetail
.
CostMoney
),
Math
.
Round
(
costMoney
,
2
,
MidpointRounding
.
AwayFromZero
)}
{
nameof
(
RB_Goods_OrderDetail
.
CostMoney
),
Math
.
Round
(
(
costMoney
+
oldMoney
)
,
2
,
MidpointRounding
.
AwayFromZero
)}
};
List
<
WhereHelper
>
wheresGoods
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
...
...
Property.Repository/Mall/RB_WarehouseOut_GoodsDetailRepository.cs
View file @
9edcd163
...
...
@@ -67,7 +67,45 @@ namespace Property.Repository.Mall
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
ApplyId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
ApplyId
)}
=
{
query
.
ApplyId
}
"
);
}
}
return
Get
<
RB_WarehouseOut_GoodsDetail
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 出库申请列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_WarehouseOut_GoodsDetail
>
GetApplyByOrderGoodsIdList
(
RB_WarehouseOut_GoodsDetail
query
,
string
orderGoodsId
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" select * from
{
TableName
}
as a where a.Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
MallBaseId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
ApplyId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
ApplyId
)}
=
{
query
.
ApplyId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
orderGoodsId
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_WarehouseOut_GoodsDetail
.
OrderGoodsId
)}
in (
{
orderGoodsId
}
)"
);
}
}
return
Get
<
RB_WarehouseOut_GoodsDetail
>(
builder
.
ToString
()).
ToList
();
}
...
...
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
View file @
9edcd163
...
...
@@ -329,16 +329,16 @@ namespace Property.WebApi.Controllers.Mall
//2020-07-29 Add By:W 判断同一个订单商品拆分后的商品是否是一起出库
var
orderGoodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
GroupBy
(
x
=>
x
.
OrderGoodsId
);
foreach
(
var
item
in
orderGoodsList
)
{
var
oldOrderGoodsList
=
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
);
var
outGoodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
);
if
(
oldOrderGoodsList
.
Count
()!=
outGoodsList
.
Count
())
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoodsList
.
FirstOrDefault
()?.
OrderNo
+
"中的商品必须一起出库"
);
}
}
//
var orderGoodsList = applyModel.WarehouseOutGoodsDetailList.GroupBy(x => x.OrderGoodsId);
//
foreach (var item in orderGoodsList)
//
{
//
var oldOrderGoodsList = oldModel.WarehouseOutGoodsList.Where(x => x.OrderGoodsId == item.Key);
//
var outGoodsList = applyModel.WarehouseOutGoodsDetailList.Where(x=>x.OrderGoodsId==item.Key);
//
if (oldOrderGoodsList.Count()!= outGoodsList.Count())
//
{
//
return ApiResult.Failed("订单号:" + oldOrderGoodsList.FirstOrDefault()?.OrderNo + "中的商品必须一起出库");
//
}
//
}
if
(
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
IsOut
==
0
).
Count
()
==
wareHouseGoodsList
.
Count
())
{
...
...
@@ -496,7 +496,12 @@ namespace Property.WebApi.Controllers.Mall
financeList
.
Add
(
warehouseOutModel
);
}
#
endregion
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
record
,
userInfo
.
RB_Department_Id
,
oldModel
.
WarehouseOutGoodsList
);
#
region
获取出库申请下这批次已出库商品的信息
string
orderGoodsIds
=
string
.
Join
(
","
,
applyModel
.
WarehouseOutGoodsDetailList
.
GroupBy
(
x
=>
x
.
OrderGoodsId
).
Select
(
x
=>
x
.
Key
));
var
outGoodsDetailList
=
warehouseOutModule
.
GetApplyByOrderGoodsIdList
(
new
RB_WarehouseOut_GoodsDetail
{
TenantId
=
applyModel
.
TenantId
,
MallBaseId
=
applyModel
.
MallBaseId
,
ApplyId
=
applyModel
.
ID
},
orderGoodsIds
);
#
endregion
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
record
,
userInfo
.
RB_Department_Id
,
oldModel
.
WarehouseOutGoodsList
,
outGoodsDetailList
);
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