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
653a1b93
Commit
653a1b93
authored
May 28, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl' into develop_dl
parents
12f74ed2
42f77952
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
EquipmentServiceImpl.java
...eejoin/equipmanage/service/impl/EquipmentServiceImpl.java
+10
-2
WlSpareEquipmentServiceImpl.java
...equipmanage/service/impl/WlSpareEquipmentServiceImpl.java
+5
-7
WlSpareEquipmentMapper.xml
...quip/src/main/resources/mapper/WlSpareEquipmentMapper.xml
+2
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentServiceImpl.java
View file @
653a1b93
...
@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
.
collect
(
Collectors
.
groupingBy
(
EquipmentIndex:
:
getEquipmentId
));
.
collect
(
Collectors
.
groupingBy
(
EquipmentIndex:
:
getEquipmentId
));
Map
<
Long
,
Unit
>
unitMap
=
iUnitService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
Unit:
:
getId
,
t
->
t
));
Map
<
Long
,
Unit
>
unitMap
=
iUnitService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
Unit:
:
getId
,
t
->
t
));
Map
<
Long
,
EquipmentCategory
>
categoryMap
=
equipmentCategoryMapper
.
selectList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
EquipmentCategory:
:
getId
,
t
->
t
));
Map
<
Long
,
EquipmentCategory
>
categoryMap
=
equipmentCategoryMapper
.
selectList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
EquipmentCategory:
:
getId
,
t
->
t
));
for
(
Equipment
equipment
:
list
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Equipment
equipment
=
list
.
get
(
i
);
EquipmentCategory
equipmentCategory
=
categoryMap
.
get
(
equipment
.
getCategoryId
());
String
categoryCode
=
equipment
.
getCode
();
// 移除非消耗性设备
if
(
Objects
.
isNull
(
equipmentCategory
)
||
!
Objects
.
equals
(
equipmentCategory
.
getIndustryCode
(),
"2"
)
||
categoryCode
.
charAt
(
0
)
==
'2'
||
categoryCode
.
charAt
(
0
)
==
'9'
)
{
list
.
remove
(
equipment
);
i
--;
continue
;
}
List
<
EquipmentIndex
>
quotaList
=
equipmentIndexMap
.
get
(
equipment
.
getId
().
toString
());
List
<
EquipmentIndex
>
quotaList
=
equipmentIndexMap
.
get
(
equipment
.
getId
().
toString
());
List
<
EquProperty
>
properList
=
new
ArrayList
<
EquProperty
>();
List
<
EquProperty
>
properList
=
new
ArrayList
<
EquProperty
>();
if
(
CollUtil
.
isNotEmpty
(
quotaList
))
{
if
(
CollUtil
.
isNotEmpty
(
quotaList
))
{
...
@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
properList
.
add
(
equProperty
);
properList
.
add
(
equProperty
);
}
}
}
}
EquipmentCategory
equipmentCategory
=
categoryMap
.
get
(
equipment
.
getCategoryId
());
if
(
ObjectUtils
.
isNotEmpty
(
equipmentCategory
))
{
if
(
ObjectUtils
.
isNotEmpty
(
equipmentCategory
))
{
equipment
.
setEquipCategoryId
(
equipmentCategory
.
getId
());
equipment
.
setEquipCategoryId
(
equipmentCategory
.
getId
());
equipment
.
setEquipCategoryCode
(
equipmentCategory
.
getCode
());
equipment
.
setEquipCategoryCode
(
equipmentCategory
.
getCode
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WlSpareEquipmentServiceImpl.java
View file @
653a1b93
...
@@ -240,14 +240,12 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
...
@@ -240,14 +240,12 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
@Override
@Override
public
void
subtractNum
(
Long
id
,
Float
num
)
{
public
void
subtractNum
(
Long
id
,
Float
num
)
{
synchronized
(
id
.
toString
())
{
WlSpareEquipment
wlSpareEquipment
=
this
.
getById
(
id
);
WlSpareEquipment
wlSpareEquipment
=
this
.
getById
(
id
);
if
(
num
>
wlSpareEquipment
.
getStockNum
())
{
if
(
num
>
wlSpareEquipment
.
getStockNum
())
{
throw
new
BadRequest
(
"使用数量大于备品备件库存数量"
);
throw
new
BadRequest
(
"使用数量大于备品备件库存数量"
);
}
wlSpareEquipment
.
setStockNum
(
wlSpareEquipment
.
getStockNum
()
-
num
);
this
.
updateById
(
wlSpareEquipment
);
}
}
wlSpareEquipment
.
setStockNum
(
wlSpareEquipment
.
getStockNum
()
-
num
);
this
.
updateById
(
wlSpareEquipment
);
}
}
@Override
@Override
...
...
amos-boot-system-equip/src/main/resources/mapper/WlSpareEquipmentMapper.xml
View file @
653a1b93
...
@@ -53,6 +53,8 @@
...
@@ -53,6 +53,8 @@
</where>
</where>
GROUP BY
GROUP BY
a.equip_model_id
a.equip_model_id
HAVING
sum( a.stock_num ) != 0
</select>
</select>
<select
id=
"exportList"
resultType=
"com.yeejoin.equipmanage.common.entity.WlSpareEquipment"
>
<select
id=
"exportList"
resultType=
"com.yeejoin.equipmanage.common.entity.WlSpareEquipment"
>
...
...
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