Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
a7434fbd
Commit
a7434fbd
authored
May 24, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
7532e25b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
StockServiceImpl.java
...om/yeejoin/equipmanage/service/impl/StockServiceImpl.java
+11
-20
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockServiceImpl.java
View file @
a7434fbd
...
@@ -22,6 +22,7 @@ import org.springframework.transaction.TransactionStatus;
...
@@ -22,6 +22,7 @@ import org.springframework.transaction.TransactionStatus;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -492,23 +493,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -492,23 +493,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
// list.add(equipmentSpecific);
// list.add(equipmentSpecific);
// this.equipmentSpecificIndexSave(equipmentDetail, equipmentSpecific);
// this.equipmentSpecificIndexSave(equipmentDetail, equipmentSpecific);
// }
// }
List
<
Equipment
>
equipmentList
;
if
(
redisUtils
.
hasKey
(
"equip_equipDefinitions"
))
{
equipmentList
=
JSONObject
.
parseArray
(
redisUtils
.
get
(
"equip_equipDefinitions"
).
toString
(),
Equipment
.
class
);;
}
else
{
QueryWrapper
<
Equipment
>
equipmentQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Equipment
>
equipmentQueryWrapper
=
new
QueryWrapper
<>();
equipmentQueryWrapper
.
isNotNull
(
"id"
);
equipmentQueryWrapper
.
isNotNull
(
"id"
);
equipmentList
=
equipmentMapper
.
selectList
(
equipmentQueryWrapper
);
List
<
Equipment
>
equipmentList
=
equipmentMapper
.
selectList
(
equipmentQueryWrapper
);
redisUtils
.
set
(
"equip_equipDefinitions"
,
JSONObject
.
toJSONString
(
equipmentList
));
}
List
<
WarehouseStructure
>
warehouseStructures
;
List
<
WarehouseStructure
>
warehouseStructures
=
warehouseStructureService
.
list
();
if
(
redisUtils
.
hasKey
(
"equip_warehouseStructures"
))
{
warehouseStructures
=
JSONObject
.
parseArray
(
redisUtils
.
get
(
"equip_warehouseStructures"
).
toString
(),
WarehouseStructure
.
class
);
}
else
{
warehouseStructures
=
warehouseStructureService
.
list
();
redisUtils
.
set
(
"equip_warehouseStructures"
,
JSONObject
.
toJSONString
(
warehouseStructures
));
}
for
(
int
i
=
0
;
i
<
equipmentDetailDownloadVOS
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
equipmentDetailDownloadVOS
.
size
();
i
++)
{
try
{
try
{
...
@@ -728,16 +717,18 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -728,16 +717,18 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
// warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode());
// warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode());
// WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper);
// WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper);
// 入库位置进行优化
// 入库位置进行优化
WarehouseStructure
warehouseStructure
=
warehouseStructures
.
stream
().
filter
(
x
->
x
.
getCode
().
equals
(
equipmentDetailDownloadVOS
.
getWarehouseStructCode
())).
collect
(
Collectors
.
toList
()).
get
(
0
);
List
<
WarehouseStructure
>
warehouseStructureData
=
warehouseStructures
.
stream
().
filter
(
x
->
x
.
getCode
().
equals
(
equipmentDetailDownloadVOS
.
getWarehouseStructCode
())).
collect
(
Collectors
.
toList
()
);
if
(
warehouseStructure
==
null
)
{
if
(
ValidationUtil
.
isEmpty
(
warehouseStructureData
)
)
{
erryy
.
append
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
())+
","
);
erryy
.
append
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
())+
","
);
throw
new
RuntimeException
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
()));
throw
new
RuntimeException
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
()));
}
else
{
equipmentSpecific
.
setPosition
(
warehouseStructure
.
getFullName
());
equipmentSpecific
.
setWarehouseStructureId
(
warehouseStructure
.
getId
());
equipmentSpecificMapper
.
updateById
(
equipmentSpecific
);
}
}
WarehouseStructure
warehouseStructure
=
warehouseStructureData
.
get
(
0
);
equipmentSpecific
.
setPosition
(
warehouseStructure
.
getFullName
());
equipmentSpecific
.
setWarehouseStructureId
(
warehouseStructure
.
getId
());
equipmentSpecificMapper
.
updateById
(
equipmentSpecific
);
// 插入库存
// 插入库存
Stock
stock
=
new
Stock
();
Stock
stock
=
new
Stock
();
stock
.
setAmount
(
Double
.
valueOf
(
equipmentSpecific
.
getNum
()));
stock
.
setAmount
(
Double
.
valueOf
(
equipmentSpecific
.
getNum
()));
...
...
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