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
b6b616f2
Commit
b6b616f2
authored
Jul 30, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交diam
parent
f4676dde
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1293 additions
and
97 deletions
+1293
-97
RB_WarehouseOut_Goods.cs
Property.Model/Entity/Mall/RB_WarehouseOut_Goods.cs
+14
-0
RB_Supplies_ReportLossRecord.cs
...rty.Model/Entity/Supplies/RB_Supplies_ReportLossRecord.cs
+118
-0
RB_Supplies_ReportLossRecordDetail.cs
...del/Entity/Supplies/RB_Supplies_ReportLossRecordDetail.cs
+133
-0
RB_Supplies_ReportLossRecordDetail_Extend.cs
...end/Supplies/RB_Supplies_ReportLossRecordDetail_Extend.cs
+29
-0
RB_Supplies_ReportLossRecord_Extend.cs
...el/Extend/Supplies/RB_Supplies_ReportLossRecord_Extend.cs
+21
-0
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+505
-71
RB_Supplies_CheckRepository.cs
Property.Repository/Supplies/RB_Supplies_CheckRepository.cs
+4
-0
RB_Supplies_ReportLossRecordDetailRepository.cs
.../Supplies/RB_Supplies_ReportLossRecordDetailRepository.cs
+75
-0
RB_Supplies_ReportLossRecordRepository.cs
...sitory/Supplies/RB_Supplies_ReportLossRecordRepository.cs
+84
-0
WarehouseOutController.cs
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
+27
-16
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+283
-10
No files found.
Property.Model/Entity/Mall/RB_WarehouseOut_Goods.cs
View file @
b6b616f2
...
@@ -113,6 +113,20 @@ namespace Property.Model.Entity.Mall
...
@@ -113,6 +113,20 @@ namespace Property.Model.Entity.Mall
set
;
set
;
}
}
/// <summary>
/// 商品id
/// </summary>
public
int
NewGoodsId
{
get
;
set
;
}
/// <summary>
/// 出库商品名称
/// </summary>
public
string
NewGoodsName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 规格(出库的规格名称)
/// 规格(出库的规格名称)
/// </summary>
/// </summary>
...
...
Property.Model/Entity/Supplies/RB_Supplies_ReportLossRecord.cs
0 → 100644
View file @
b6b616f2
using
System
;
using
REBORN.Common.AOP
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
{
/// <summary>
/// 资产报损实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ReportLossRecord
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 盘点期数id
/// </summary>
public
int
?
CheckId
{
get
;
set
;
}
/// <summary>
/// 出库/入库id
/// </summary>
public
int
OutOrInId
{
get
;
set
;
}
/// <summary>
/// 报损/报溢 自动生成财务单据
/// </summary>
public
int
?
FinanceId
{
get
;
set
;
}
/// <summary>
/// 盘点状态
/// </summary>
public
PropertyCheckStatusEnum
?
CheckStatus
{
get
;
set
;
}
/// <summary>
/// 仓库id
/// </summary>
public
int
?
WarehouseId
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 公司
/// </summary>
public
int
?
RB_Branch_Id
{
get
;
set
;
}
/// <summary>
/// 集团
/// </summary>
public
int
?
RB_Group_Id
{
get
;
set
;
}
/// <summary>
/// CreateBy
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Entity/Supplies/RB_Supplies_ReportLossRecordDetail.cs
0 → 100644
View file @
b6b616f2
using
System
;
using
REBORN.Common.AOP
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
{
/// <summary>
/// 耗材盘点报损记录详情
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ReportLossRecordDetail
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 盘点期数id
/// </summary>
public
int
?
CheckId
{
get
;
set
;
}
/// <summary>
/// 盘点商品对应的id
/// </summary>
public
int
CheckDetailId
{
get
;
set
;
}
/// <summary>
/// 报损记录id
/// </summary>
public
int
?
ReportLossRecordId
{
get
;
set
;
}
/// <summary>
/// 耗材id
/// </summary>
public
int
?
SuppliesId
{
get
;
set
;
}
/// <summary>
/// 报损数量
/// </summary>
public
int
?
ReportLossNum
{
get
;
set
;
}
/// <summary>
/// 报损价格
/// </summary>
public
decimal
?
ReportLossPrice
{
get
;
set
;
}
/// <summary>
/// 盘点状态
/// </summary>
public
PropertyCheckStatusEnum
?
CheckStatus
{
get
;
set
;
}
/// <summary>
/// 备注(报损 /报溢 需备注记录 出库单号/入库单号)
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 公司
/// </summary>
public
int
?
RB_Branch_Id
{
get
;
set
;
}
/// <summary>
/// 集团
/// </summary>
public
int
?
RB_Group_Id
{
get
;
set
;
}
/// <summary>
/// CreateBy
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Extend/Supplies/RB_Supplies_ReportLossRecordDetail_Extend.cs
0 → 100644
View file @
b6b616f2
using
Property.Model.Entity
;
using
REBORN.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Property.Model.Extend.Supplies
{
/// <summary>
/// 耗材盘点报损记录扩展表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ReportLossRecordDetail_Extend
:
RB_Supplies_ReportLossRecordDetail
{
/// <summary>
/// 商品名称
/// </summary>
public
string
GoodsName
{
get
;
set
;
}
/// <summary>
/// 商品规格名称
/// </summary>
public
string
SpecificationName
{
get
;
set
;
}
}
}
Property.Model/Extend/Supplies/RB_Supplies_ReportLossRecord_Extend.cs
0 → 100644
View file @
b6b616f2
using
Property.Model.Entity
;
using
REBORN.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Property.Model.Extend.Supplies
{
/// <summary>
/// 资产报损扩展体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ReportLossRecord_Extend
:
RB_Supplies_ReportLossRecord
{
/// <summary>
/// 报损详情
/// </summary>
public
List
<
RB_Supplies_ReportLossRecordDetail_Extend
>
DetailList
{
get
;
set
;
}
}
}
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
b6b616f2
This diff is collapsed.
Click to expand it.
Property.Repository/Supplies/RB_Supplies_CheckRepository.cs
View file @
b6b616f2
...
@@ -78,6 +78,10 @@ namespace Property.Repository
...
@@ -78,6 +78,10 @@ namespace Property.Repository
{
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
}
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
Id
)
+
"="
+
dmodel
.
Id
;
}
if
(
dmodel
.
CheckState
.
HasValue
&&
dmodel
.
CheckState
>
0
)
if
(
dmodel
.
CheckState
.
HasValue
&&
dmodel
.
CheckState
>
0
)
{
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
CheckState
)
+
"="
+
(
int
)
dmodel
.
CheckState
;
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
CheckState
)
+
"="
+
(
int
)
dmodel
.
CheckState
;
...
...
Property.Repository/Supplies/RB_Supplies_ReportLossRecordDetailRepository.cs
0 → 100644
View file @
b6b616f2
using
Property.Model.Entity
;
using
Property.Model.Extend.Supplies
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Property.Repository.Supplies
{
public
class
RB_Supplies_ReportLossRecordDetailRepository
:
RepositoryBase
<
RB_Supplies_ReportLossRecordDetail
>
{
public
string
TableName
{
get
{
return
nameof
(
RB_Supplies_ReportLossRecordDetail
);
}
}
/// <summary>
/// 盘点报损分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Supplies_ReportLossRecordDetail_Extend
>
GetWarehouseOutPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Supplies_ReportLossRecordDetail_Extend
query
)
{
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_Supplies_ReportLossRecordDetail_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
query
.
SuppliesId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecordDetail_Extend
.
SuppliesId
)}
=
{
query
.
SuppliesId
}
"
);
}
if
(
query
.
ReportLossRecordId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecordDetail_Extend
.
ReportLossRecordId
)}
=
{
query
.
ReportLossRecordId
}
"
);
}
}
return
GetPage
<
RB_Supplies_ReportLossRecordDetail_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 盘点报损列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Supplies_ReportLossRecordDetail_Extend
>
GetWarehouseOutList
(
RB_Supplies_ReportLossRecordDetail_Extend
query
)
{
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_Supplies_ReportLossRecordDetail_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
query
.
SuppliesId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecordDetail_Extend
.
SuppliesId
)}
=
{
query
.
SuppliesId
}
"
);
}
if
(
query
.
ReportLossRecordId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecordDetail_Extend
.
ReportLossRecordId
)}
=
{
query
.
ReportLossRecordId
}
"
);
}
}
return
Get
<
RB_Supplies_ReportLossRecordDetail_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Property.Repository/Supplies/RB_Supplies_ReportLossRecordRepository.cs
0 → 100644
View file @
b6b616f2
using
Property.Model.Entity
;
using
Property.Model.Extend.Supplies
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Property.Repository.Supplies
{
public
class
RB_Supplies_ReportLossRecordRepository
:
RepositoryBase
<
RB_Supplies_ReportLossRecord
>
{
public
string
TableName
{
get
{
return
nameof
(
RB_Supplies_ReportLossRecord
);
}
}
/// <summary>
/// 盘点报损分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Supplies_ReportLossRecord_Extend
>
GetSuppliesReportLossRecordPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Supplies_ReportLossRecord_Extend
query
)
{
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_Supplies_ReportLossRecord_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
query
.
WarehouseId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
WarehouseId
)}
=
{
query
.
WarehouseId
}
"
);
}
if
(
query
.
CheckId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
CheckId
)}
=
{
query
.
CheckId
}
"
);
}
if
(
query
.
CheckStatus
.
HasValue
&&
query
.
CheckStatus
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
CheckStatus
)}
=
{(
int
)
query
.
CheckStatus
}
"
);
}
}
return
GetPage
<
RB_Supplies_ReportLossRecord_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 盘点报损列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Supplies_ReportLossRecord_Extend
>
GetWarehouseOutList
(
RB_Supplies_ReportLossRecord_Extend
query
)
{
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_Supplies_ReportLossRecord_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
query
.
WarehouseId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
WarehouseId
)}
=
{
query
.
WarehouseId
}
"
);
}
if
(
query
.
CheckId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
CheckId
)}
=
{
query
.
CheckId
}
"
);
}
if
(
query
.
CheckStatus
.
HasValue
&&
query
.
CheckStatus
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Supplies_ReportLossRecord_Extend
.
CheckStatus
)}
=
{(
int
)
query
.
CheckStatus
}
"
);
}
}
return
Get
<
RB_Supplies_ReportLossRecord_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
View file @
b6b616f2
...
@@ -228,7 +228,7 @@ namespace Property.WebApi.Controllers.Mall
...
@@ -228,7 +228,7 @@ namespace Property.WebApi.Controllers.Mall
//判断当前仓库是否在盘点中2020-07-28 Add By:W
//判断当前仓库是否在盘点中2020-07-28 Add By:W
var
suppliesCheckList
=
suppliesModule
.
GetSuppliesCheckList
(
new
RB_Supplies_Check_Extend
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
StartDate
=
System
.
DateTime
.
Now
,
EndDate
=
System
.
DateTime
.
Now
,
WarehouseId
=
applyModel
.
WarehouseId
,
CheckState
=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
});
var
suppliesCheckList
=
suppliesModule
.
GetSuppliesCheckList
(
new
RB_Supplies_Check_Extend
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
StartDate
=
System
.
DateTime
.
Now
,
EndDate
=
System
.
DateTime
.
Now
,
WarehouseId
=
applyModel
.
WarehouseId
,
CheckState
=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
});
if
(
suppliesCheckList
!=
null
&&
suppliesCheckList
.
Any
())
if
(
suppliesCheckList
!=
null
&&
suppliesCheckList
.
Any
())
{
{
return
ApiResult
.
ParamIsNull
(
"仓库盘点中,不能出库"
);
return
ApiResult
.
ParamIsNull
(
"仓库盘点中,不能出库"
);
...
@@ -263,7 +263,8 @@ namespace Property.WebApi.Controllers.Mall
...
@@ -263,7 +263,8 @@ namespace Property.WebApi.Controllers.Mall
//判断此次商品是否已出库与数量是否相等
//判断此次商品是否已出库与数量是否相等
applyModel
.
WarehouseOutGoodsList
=
new
List
<
RB_WarehouseOut_Goods_Extend
>();
applyModel
.
WarehouseOutGoodsList
=
new
List
<
RB_WarehouseOut_Goods_Extend
>();
var
goodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
GroupBy
(
x
=>
x
.
OrderGoodsId
);
// var goodsList = applyModel.WarehouseOutGoodsDetailList.GroupBy(x => x.OrderGoodsId);
var
goodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
GroupBy
(
x
=>
new
{
x
.
OrderGoodsId
,
x
.
GoodsId
,
x
.
SpecificationSort
});
oldModel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
oldModel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
applyModel
.
RB_Branch_Id
=
oldModel
.
RB_Branch_Id
;
applyModel
.
RB_Branch_Id
=
oldModel
.
RB_Branch_Id
;
applyModel
.
RB_Group_Id
=
oldModel
.
RB_Group_Id
;
applyModel
.
RB_Group_Id
=
oldModel
.
RB_Group_Id
;
...
@@ -273,33 +274,32 @@ namespace Property.WebApi.Controllers.Mall
...
@@ -273,33 +274,32 @@ namespace Property.WebApi.Controllers.Mall
var
wareHouseGoodsList
=
warehouseOutModule
.
GetOuGoodsByWarehouseId
(
oldModel
);
var
wareHouseGoodsList
=
warehouseOutModule
.
GetOuGoodsByWarehouseId
(
oldModel
);
foreach
(
var
item
in
goodsList
)
foreach
(
var
item
in
goodsList
)
{
{
var
oldOrderGoods
=
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
FirstOrDefault
();
var
oldOrderGoods
=
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
NewGoodsId
==
item
.
Key
.
GoodsId
&&
x
.
NewSpecificationSort
==
item
.
Key
.
SpecificationSort
).
FirstOrDefault
();
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
OrderId
=
oldOrderGoods
.
OrderId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
OrderId
=
oldOrderGoods
.
OrderId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
GoodsId
=
oldOrderGoods
.
GoodsId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
GoodsId
=
oldOrderGoods
.
New
GoodsId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
GoodsName
=
oldOrderGoods
.
GoodsName
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
GoodsName
=
oldOrderGoods
.
New
GoodsName
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
Specification
=
oldOrderGoods
.
NewSpecification
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
Specification
=
oldOrderGoods
.
NewSpecification
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
SpecificationSort
=
oldOrderGoods
.
NewSpecificationSort
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
SpecificationSort
=
oldOrderGoods
.
NewSpecificationSort
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
ProductCode
=
oldOrderGoods
.
ProductCode
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
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
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
TenantId
=
oldOrderGoods
.
TenantId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
MallBaseId
=
oldOrderGoods
.
MallBaseId
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
ToList
().
ForEach
(
x
=>
x
.
MallBaseId
=
oldOrderGoods
.
MallBaseId
);
if
(
oldOrderGoods
==
null
)
if
(
oldOrderGoods
==
null
)
{
{
var
nowOrderGoods
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
FirstOrDefault
();
var
nowOrderGoods
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
).
FirstOrDefault
();
return
ApiResult
.
Failed
(
"商品不属于出库单,请核实后再出库"
);
return
ApiResult
.
Failed
(
"商品不属于出库单,请核实后再出库"
);
}
}
else
if
(
oldOrderGoods
.
IsOut
==
1
)
else
if
(
oldOrderGoods
.
IsOut
==
1
)
{
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"申请单中已出库"
);
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"申请单中已出库"
);
}
}
var
nowGoodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
);
var
nowGoodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
);
int
goodsCount
=
nowGoodsList
.
Count
();
int
goodsCount
=
nowGoodsList
.
Count
();
if
(
oldOrderGoods
.
NewNumber
!=
goodsCount
)
if
(
oldOrderGoods
.
NewNumber
!=
goodsCount
)
{
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"必须一起出库"
);
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"必须一起出库"
);
}
}
if
(!
wareHouseGoodsList
.
Any
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
))
if
(!
wareHouseGoodsList
.
Any
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
.
OrderGoodsId
&&
x
.
GoodsId
==
item
.
Key
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
Key
.
SpecificationSort
))
{
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"没在当前仓库"
);
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"没在当前仓库"
);
}
}
...
@@ -307,7 +307,6 @@ namespace Property.WebApi.Controllers.Mall
...
@@ -307,7 +307,6 @@ namespace Property.WebApi.Controllers.Mall
oldOrderGoods
.
CostMoney
=
nowGoodsList
.
Sum
(
x
=>
x
.
CostMoney
??
0
);
oldOrderGoods
.
CostMoney
=
nowGoodsList
.
Sum
(
x
=>
x
.
CostMoney
??
0
);
applyModel
.
WarehouseOutGoodsList
.
Add
(
oldOrderGoods
);
applyModel
.
WarehouseOutGoodsList
.
Add
(
oldOrderGoods
);
RB_Finance_RecordDetail
financeRecordDetail
=
new
RB_Finance_RecordDetail
RB_Finance_RecordDetail
financeRecordDetail
=
new
RB_Finance_RecordDetail
{
{
ID
=
0
,
ID
=
0
,
...
@@ -328,6 +327,18 @@ namespace Property.WebApi.Controllers.Mall
...
@@ -328,6 +327,18 @@ namespace Property.WebApi.Controllers.Mall
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
}
//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
+
"中的商品必须一起出库"
);
}
}
if
(
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
IsOut
==
0
).
Count
()
==
wareHouseGoodsList
.
Count
())
if
(
oldModel
.
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
IsOut
==
0
).
Count
()
==
wareHouseGoodsList
.
Count
())
{
{
...
...
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
b6b616f2
This diff is collapsed.
Click to expand it.
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