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
3dc80e2e
Commit
3dc80e2e
authored
May 16, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改巡检代码
parent
4e060184
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
51 deletions
+60
-51
InputItemMapper.java
...join/amos/patrol/business/dao/mapper/InputItemMapper.java
+2
-1
PointServiceImpl.java
...n/amos/patrol/business/service/impl/PointServiceImpl.java
+58
-50
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/InputItemMapper.java
View file @
3dc80e2e
...
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Repository;
...
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Repository;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
@Repository
@Repository
@Mapper
@Mapper
...
@@ -61,7 +62,7 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
...
@@ -61,7 +62,7 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
public
List
<
PointInputItemVo
>
queryCustomInputItem
(
HashMap
<
String
,
Object
>
param
);
public
List
<
PointInputItemVo
>
queryCustomInputItem
(
HashMap
<
String
,
Object
>
param
);
List
<
PointInputItemVo
>
queryCustomInputItemByCodes
(
@Param
(
"inputItemNos"
)
Lis
t
<
String
>
inputItemNos
);
List
<
PointInputItemVo
>
queryCustomInputItemByCodes
(
@Param
(
"inputItemNos"
)
Se
t
<
String
>
inputItemNos
);
public
List
<
InputItemVo
>
getInputItemListByitemNos
(
@Param
(
"itemNos"
)
String
[]
itemNos
);
public
List
<
InputItemVo
>
getInputItemListByitemNos
(
@Param
(
"itemNos"
)
String
[]
itemNos
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PointServiceImpl.java
View file @
3dc80e2e
...
@@ -47,6 +47,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
...
@@ -47,6 +47,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
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
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
@@ -282,60 +283,67 @@ public class PointServiceImpl implements IPointService {
...
@@ -282,60 +283,67 @@ public class PointServiceImpl implements IPointService {
ids
.
add
(
point
.
getId
());
ids
.
add
(
point
.
getId
());
if
(
StringUtil
.
isNotEmpty
(
param
.
getEquipInputInfo
()))
{
if
(
StringUtil
.
isNotEmpty
(
param
.
getEquipInputInfo
()))
{
String
[]
infos
=
param
.
getEquipInputInfo
().
split
(
"\\|"
);
String
[]
info
=
param
.
getEquipInputInfo
().
split
(
"\\|"
);
for
(
int
i
=
0
;
i
<
infos
.
length
;
i
++)
{
Set
<
String
>
infos
=
new
HashSet
<>();
String
[]
split
=
infos
[
i
].
split
(
":"
);
Collections
.
addAll
(
infos
,
info
);
String
equipCode
=
split
[
0
];
for
(
String
e
:
infos
)
{
List
<
String
>
inputItemCodes
=
Arrays
.
asList
(
split
[
1
].
split
(
","
));
String
[]
split
=
e
.
split
(
":"
);
List
<
RoutePoint
>
routePointList
=
iRoutePointDao
.
queryByPointId
(
point
.
getId
());
String
equipCode
=
split
[
0
];
HashMap
<
String
,
String
>
equipByCode
=
routePointItemMapper
.
getEquipByCode
(
equipCode
);
Set
<
String
>
inputItemCodes
=
new
HashSet
<>(
Arrays
.
asList
(
split
[
1
].
split
(
","
)));
if
(
ObjectUtils
.
isEmpty
(
equipByCode
))
{
// List<String> inputItemCodes = Arrays.asList(split[1].split(","));
throw
new
BadRequest
(
"装备编码不存在"
);
List
<
RoutePoint
>
routePointList
=
iRoutePointDao
.
queryByPointId
(
point
.
getId
());
}
HashMap
<
String
,
String
>
equipByCode
=
routePointItemMapper
.
getEquipByCode
(
equipCode
);
PointClassify
newPointClassify
=
new
PointClassify
();
if
(
ObjectUtils
.
isEmpty
(
equipByCode
))
{
newPointClassify
.
setEquipmentId
(
equipByCode
.
get
(
"equipmentId"
));
throw
new
BadRequest
(
"装备编码不存在"
);
newPointClassify
.
setName
(
equipByCode
.
get
(
"name"
));
}
PointClassify
newPointClassify
=
new
PointClassify
();
newPointClassify
.
setEquipmentId
(
equipByCode
.
get
(
"equipmentId"
));
newPointClassify
.
setName
(
equipByCode
.
get
(
"name"
));
// newPointClassify.setInspectionSpecName();
// newPointClassify.setInspectionSpecName();
newPointClassify
.
setCreatorId
(
userId
);
newPointClassify
.
setCreatorId
(
userId
);
newPointClassify
.
setPointId
(
point
.
getId
());
newPointClassify
.
setPointId
(
point
.
getId
());
newPointClassify
.
setOrderNo
(
0
);
newPointClassify
.
setOrderNo
(
0
);
newPointClassify
.
setDataSourceCode
(
"1"
);
newPointClassify
.
setDataSourceCode
(
"1"
);
newPointClassify
.
setDataSourceName
(
"消防装备"
);
newPointClassify
.
setDataSourceName
(
"消防装备"
);
newPointClassify
.
setAddress
(
equipByCode
.
get
(
"address"
));
newPointClassify
.
setAddress
(
equipByCode
.
get
(
"address"
));
newPointClassify
.
setBuildingId
(
String
.
valueOf
(
equipByCode
.
get
(
"sourceId"
)));
newPointClassify
.
setBuildingId
(
String
.
valueOf
(
equipByCode
.
get
(
"sourceId"
)));
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
newPointClassify
.
setOriginalId
(
uuid
.
substring
(
0
,
16
));
newPointClassify
.
setOriginalId
(
uuid
.
substring
(
0
,
16
));
newPointClassify
.
setCategoryCode
(
equipByCode
.
get
(
"categoryCode"
));
newPointClassify
.
setCategoryCode
(
equipByCode
.
get
(
"categoryCode"
));
newPointClassify
.
setCategoryName
(
equipByCode
.
get
(
"categoryName"
));
newPointClassify
.
setCategoryName
(
equipByCode
.
get
(
"categoryName"
));
newPointClassify
.
setCode
(
equipByCode
.
get
(
"code"
));
newPointClassify
.
setCode
(
equipByCode
.
get
(
"code"
));
newPointClassify
.
setBuildingName
(
equipByCode
.
get
(
"fullName"
));
newPointClassify
.
setBuildingName
(
equipByCode
.
get
(
"fullName"
));
List
<
PointClassify
>
pointClassifies
=
iPointClassifyDao
.
queryByPointIdAndEquipmentId
(
point
.
getId
(),
equipByCode
.
get
(
"equipmentId"
));
List
<
PointClassify
>
pointClassifies
=
iPointClassifyDao
.
queryByPointIdAndEquipmentId
(
point
.
getId
(),
equipByCode
.
get
(
"equipmentId"
));
if
(!
CollectionUtils
.
isEmpty
(
pointClassifies
))
{
if
(!
CollectionUtils
.
isEmpty
(
pointClassifies
))
{
newPointClassify
.
setId
(
pointClassifies
.
get
(
0
).
getId
());
newPointClassify
.
setId
(
pointClassifies
.
get
(
0
).
getId
());
}
}
this
.
addPointClassifyByPointId
(
newPointClassify
);
this
.
addPointClassifyByPointId
(
newPointClassify
);
List
<
PointInputItemVo
>
customInputList
=
inputItemMapper
.
queryCustomInputItemByCodes
(
inputItemCodes
);
List
<
PointInputItemVo
>
customInputList
=
inputItemMapper
.
queryCustomInputItemByCodes
(
inputItemCodes
);
for
(
PointInputItemVo
pItemVo
:
customInputList
)
{
if
(
ValidationUtil
.
isEmpty
(
customInputList
)
||
customInputList
.
size
()
<
inputItemCodes
.
size
())
{
PointInputItem
pointInputItem
=
new
PointInputItem
();
throw
new
BadRequest
(
split
[
1
]+
"中存在不正确的检查项编号"
);
pointInputItem
.
setPointId
(
newPointClassify
.
getPointId
());
}
pointInputItem
.
setInputItemId
(
pItemVo
.
getId
());
for
(
PointInputItemVo
pItemVo
:
customInputList
)
{
pointInputItem
.
setClassifyIds
(
Long
.
valueOf
(
newPointClassify
.
getId
()).
toString
());
PointInputItem
pointInputItem
=
new
PointInputItem
();
pointInputItem
.
setId
(
0
);
pointInputItem
.
setPointId
(
newPointClassify
.
getPointId
());
pointInputItem
.
setOrderNo
(
pItemVo
.
getpOrderNo
());
pointInputItem
.
setInputItemId
(
pItemVo
.
getId
());
PointInputItem
pointInputItemResult
=
iPointInputItemDao
.
saveAndFlush
(
pointInputItem
);
pointInputItem
.
setClassifyIds
(
Long
.
valueOf
(
newPointClassify
.
getId
()).
toString
());
//更新巡检路线
pointInputItem
.
setId
(
0
);
if
(
routePointList
.
size
()
>
0
)
{
pointInputItem
.
setOrderNo
(
pItemVo
.
getpOrderNo
());
Long
classifyId
=
newPointClassify
.
getId
();
PointInputItem
pointInputItemResult
=
iPointInputItemDao
.
saveAndFlush
(
pointInputItem
);
for
(
RoutePoint
routePoint
:
routePointList
)
{
//更新巡检路线
RoutePointItem
routePointItem
=
new
RoutePointItem
();
if
(
routePointList
.
size
()
>
0
)
{
routePointItem
.
setPointClassifyId
(
classifyId
);
Long
classifyId
=
newPointClassify
.
getId
();
routePointItem
.
setPointInputItemId
(
pointInputItemResult
.
getId
());
for
(
RoutePoint
routePoint
:
routePointList
)
{
routePointItem
.
setRoutePointId
(
routePoint
.
getId
());
RoutePointItem
routePointItem
=
new
RoutePointItem
();
iRoutePointItemDao
.
save
(
routePointItem
);
routePointItem
.
setPointClassifyId
(
classifyId
);
routePointItem
.
setPointInputItemId
(
pointInputItemResult
.
getId
());
routePointItem
.
setRoutePointId
(
routePoint
.
getId
());
iRoutePointItemDao
.
save
(
routePointItem
);
}
}
}
}
}
}
}
}
}
}
String
inputItems
=
param
.
getInputItems
();
String
inputItems
=
param
.
getInputItems
();
...
...
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