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
91012ee6
Commit
91012ee6
authored
Jul 27, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/liudong1993/property
parents
9114355e
fc7862e9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
13 deletions
+61
-13
Config.cs
Property.Common/Config.cs
+10
-0
RB_WarehouseOut_Goods.cs
Property.Model/Entity/Mall/RB_WarehouseOut_Goods.cs
+24
-0
WarehouseOutModule.cs
Property.Module.Mall/WarehouseOutModule.cs
+9
-6
RB_WarehouseOut_GoodsRepository.cs
Property.Repository/Mall/RB_WarehouseOut_GoodsRepository.cs
+1
-1
WarehouseOutController.cs
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
+17
-6
No files found.
Property.Common/Config.cs
View file @
91012ee6
...
...
@@ -269,5 +269,15 @@ namespace REBORN.Common
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"PaymentFinanceApi"
).
Value
;
}
}
/// <summary>
/// 生成成本的公司
/// </summary>
public
static
string
ExpendBranchId
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"ExpendBranchId"
).
Value
;
}
}
}
}
\ No newline at end of file
Property.Model/Entity/Mall/RB_WarehouseOut_Goods.cs
View file @
91012ee6
...
...
@@ -93,11 +93,35 @@ namespace Property.Model.Entity.Mall
get
;
set
;
}
/// <summary>
/// 规格key
/// </summary>
public
string
SpecificationSort
{
get
;
set
;
}
/// <summary>
/// 规格key(出库的规格)
/// </summary>
public
string
NewSpecificationSort
{
get
;
set
;
}
/// <summary>
/// 规格(出库的数量)
/// </summary>
public
int
NewNumber
{
get
;
set
;
}
/// <summary>
/// 规格(出库的规格名称)
/// </summary>
public
string
NewSpecification
{
get
;
set
;
}
/// <summary>
/// 货号
/// </summary>
...
...
Property.Module.Mall/WarehouseOutModule.cs
View file @
91012ee6
...
...
@@ -239,9 +239,11 @@ namespace Property.Module.Mall
{
if
(
item
.
ID
>
0
)
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
nameof
(
RB_WarehouseOut_Goods
.
Number
),
item
.
Number
}
{
nameof
(
RB_WarehouseOut_Goods
.
Number
),
item
.
Number
},
{
nameof
(
RB_WarehouseOut_Goods
.
NewSpecification
),
item
.
NewSpecification
},
{
nameof
(
RB_WarehouseOut_Goods
.
NewSpecificationSort
),
item
.
NewSpecificationSort
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -270,7 +272,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
,
RB_Finance_Record_Extend
record
,
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
,
List
<
RB_WarehouseOut_Goods_Extend
>
WarehouseOutGoodsList
)
{
var
trans
=
supplies_StockOutRepository
.
DbTransaction
;
try
...
...
@@ -296,7 +298,7 @@ namespace Property.Module.Mall
ClientID
=
3134
,
CurrencyId
=
Config
.
OutCurrencyId
,
WBMoney
=
financeList
.
Sum
(
x
=>
(
x
.
CostMoney
??
0
)
*
(
x
.
Number
??
0
)),
RB_Branch_Id
=
demodel
.
RB_Branch_
Id
,
RB_Branch_Id
=
Config
.
ExpendBranch
Id
,
PayDate
=
System
.
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
128
,
OrderSource
=
16
,
...
...
@@ -358,10 +360,11 @@ namespace Property.Module.Mall
//更新订单商品的财务id与成本价
decimal
costMoney
=
0
;
var
nowGoods
=
financeList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
OrderGoodsId
);
var
nowGoods
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
OrderGoodsId
);
var
nowGoodsFinan
=
WarehouseOutGoodsList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
OrderGoodsId
);
if
(
nowGoods
!=
null
&&
nowGoods
.
Any
())
{
costMoney
=
(
nowGoods
.
Sum
(
x
=>
x
.
CostMoney
??
0
)
/
nowGoods
.
Sum
(
x
=>
x
.
Number
??
0
));
costMoney
=
(
nowGoods
.
Sum
(
x
=>
x
.
CostMoney
??
0
)
/
nowGoods
Finan
.
Sum
(
x
=>
x
.
Number
??
0
));
//更新申请单的出库状态
Dictionary
<
string
,
object
>
filesGoods
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderDetail
.
CostFinanceId
),
frid
},
...
...
Property.Repository/Mall/RB_WarehouseOut_GoodsRepository.cs
View file @
91012ee6
...
...
@@ -161,7 +161,7 @@ namespace Property.Repository.Mall
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@
$"SELECT b.*,d.WarehouseId,d.Number as SuppliesNum,d.SuppliesId from rb_warehouseout_goods as b
LEFT
JOIN
rb_warehouseout_apply
as
a
on
b
.
ApplyId
=
a
.
ID
LEFT
JOIN
rb_supplies_material
as
c
on
c
.
GoodsId
=
b
.
GoodsId
and
c
.
SpecificationKey
=
b
.
SpecificationSort
LEFT
JOIN
rb_supplies_material
as
c
on
c
.
GoodsId
=
b
.
GoodsId
and
c
.
SpecificationKey
=
b
.
New
SpecificationSort
LEFT
JOIN
rb_supplies_inventory
as
d
on
d
.
SuppliesId
=
c
.
Id
where
a
.
`
Status
`
=
0
and
b
.
`
Status
`
=
0
and
c
.
`
Status
`
=
0
and
d
.
`
Status
`
=
0
and
b
.
IsOut
=
0
");
if
(
query
!=
null
)
{
...
...
Property.WebApi/Controllers/Mall/WarehouseOutController.cs
View file @
91012ee6
...
...
@@ -165,6 +165,10 @@ namespace Property.WebApi.Controllers.Mall
return
ApiResult
.
Failed
(
"商品名称:"
+
item
.
GoodsName
+
"订单号:"
+
item
.
OrderNo
+
"不属于当前申请单"
);
}
}
//判断商品规格是否属于该商品
var
result
=
warehouseOutModule
.
UpdateWarehouseOutGoods
(
demodel
.
WarehouseOutGoodsList
);
if
(
result
)
{
...
...
@@ -266,8 +270,8 @@ namespace Property.WebApi.Controllers.Mall
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
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
).
ToList
().
ForEach
(
x
=>
x
.
GoodsName
=
oldOrderGoods
.
GoodsName
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
Specification
=
oldOrderGoods
.
Specification
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
SpecificationSort
=
oldOrderGoods
.
SpecificationSort
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
Specification
=
oldOrderGoods
.
New
Specification
);
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
).
ToList
().
ForEach
(
x
=>
x
.
SpecificationSort
=
oldOrderGoods
.
New
SpecificationSort
);
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
);
...
...
@@ -284,7 +288,7 @@ namespace Property.WebApi.Controllers.Mall
var
nowGoodsList
=
applyModel
.
WarehouseOutGoodsDetailList
.
Where
(
x
=>
x
.
OrderGoodsId
==
item
.
Key
);
int
goodsCount
=
nowGoodsList
.
Count
();
if
(
oldOrderGoods
.
Number
!=
goodsCount
)
if
(
oldOrderGoods
.
N
ewN
umber
!=
goodsCount
)
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"必须一起出库"
);
}
...
...
@@ -292,6 +296,7 @@ namespace Property.WebApi.Controllers.Mall
{
return
ApiResult
.
Failed
(
"订单号:"
+
oldOrderGoods
.
OrderNo
+
"商品名称:"
+
oldOrderGoods
.
GoodsName
+
"没在当前仓库"
);
}
oldOrderGoods
.
CostMoney
=
nowGoodsList
.
Sum
(
x
=>
x
.
CostMoney
??
0
);
applyModel
.
WarehouseOutGoodsList
.
Add
(
oldOrderGoods
);
...
...
@@ -310,8 +315,8 @@ namespace Property.WebApi.Controllers.Mall
OrderDetailId
=
oldOrderGoods
.
OrderGoodsId
,
GoodsPrice
=
oldOrderGoods
.
CostMoney
??
0
,
FreightMoney
=
0
,
Unit_Price
=
Math
.
Round
((
oldOrderGoods
.
CostMoney
??
0
)
/
(
oldOrderGoods
.
N
umber
??
1
),
2
,
MidpointRounding
.
AwayFromZero
),
Number
=
oldOrderGoods
.
Number
Unit_Price
=
Math
.
Round
((
oldOrderGoods
.
CostMoney
??
0
)
/
(
oldOrderGoods
.
N
ewNumber
),
2
,
MidpointRounding
.
AwayFromZero
),
Number
=
oldOrderGoods
.
N
ewN
umber
};
record
.
RecordDetailList
.
Add
(
financeRecordDetail
);
}
...
...
@@ -373,6 +378,12 @@ namespace Property.WebApi.Controllers.Mall
foreach
(
var
item
in
applyModel
.
WarehouseOutGoodsDetailList
.
GroupBy
(
x
=>
x
.
MaterialId
))
{
var
oldOrderGoods
=
wareHouseGoodsList
.
Where
(
x
=>
x
.
SuppliesId
==
item
.
Key
).
FirstOrDefault
();
if
(!
wareHouseGoodsList
.
Any
(
x
=>
x
.
SuppliesId
==
item
.
Key
))
{
return
ApiResult
.
Failed
(
"出库商品的规格与出库规格不一致"
);
}
RB_Supplies_StockOutDetail_Extend
stockOutDetailModel
=
new
RB_Supplies_StockOutDetail_Extend
{
...
...
@@ -467,7 +478,7 @@ namespace Property.WebApi.Controllers.Mall
financeList
.
Add
(
warehouseOutModel
);
}
#
endregion
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
record
,
userInfo
.
RB_Department_Id
);
bool
flag
=
warehouseOutModule
.
SetStockOutInfo
(
applyModel
,
demodel
,
financeList
,
record
,
userInfo
.
RB_Department_Id
,
oldModel
.
WarehouseOutGoodsList
);
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