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
e4bc5c11
Commit
e4bc5c11
authored
Mar 30, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检点导入功能添加 装备对象和巡检项
parent
a3dba1bf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
9 deletions
+139
-9
PointController.java
...join/amos/patrol/business/controller/PointController.java
+1
-1
InputItemMapper.java
...join/amos/patrol/business/dao/mapper/InputItemMapper.java
+2
-0
RoutePointItemMapper.java
...amos/patrol/business/dao/mapper/RoutePointItemMapper.java
+12
-1
PointImportParam.java
.../yeejoin/amos/patrol/business/param/PointImportParam.java
+17
-5
PointServiceImpl.java
...n/amos/patrol/business/service/impl/PointServiceImpl.java
+63
-1
routePointItemMapper.xml
...rol/src/main/resources/db/mapper/routePointItemMapper.xml
+44
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PointController.java
View file @
e4bc5c11
...
@@ -864,7 +864,7 @@ public class PointController extends AbstractBaseController {
...
@@ -864,7 +864,7 @@ public class PointController extends AbstractBaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
fileName
=
"巡检点导入模板.xls"
;
//模板名称
String
fileName
=
"巡检点导入模板.xls"
;
//模板名称
String
[]
handers
=
{
"点编号"
,
"点名称"
,
"是否为移动点"
,
"计划外巡检是否评分"
,
"是否允许离线巡检"
,
"参考地址"
,
"最少拍照数量"
,
"最多拍照数量"
,
"风险等级"
,
"备注说明"
,
"
检查项目"
,
"是否室内"
,
"归属单位/部门"
,
"责任人"
,
"所在建筑
"
};
//列标题
String
[]
handers
=
{
"点编号"
,
"点名称"
,
"是否为移动点"
,
"计划外巡检是否评分"
,
"是否允许离线巡检"
,
"参考地址"
,
"最少拍照数量"
,
"最多拍照数量"
,
"风险等级"
,
"备注说明"
,
"
是否室内"
,
"归属单位/部门"
,
"责任人"
,
"所在建筑"
,
"装备对象|检查项编号
"
};
//列标题
List
<
String
[]>
downData
=
new
ArrayList
();
List
<
String
[]>
downData
=
new
ArrayList
();
String
[]
isScore
=
{
"否"
,
"是"
};
String
[]
isScore
=
{
"否"
,
"是"
};
String
[]
isFixed
=
{
"否"
,
"是"
};
String
[]
isFixed
=
{
"否"
,
"是"
};
...
...
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 @
e4bc5c11
...
@@ -57,6 +57,8 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
...
@@ -57,6 +57,8 @@ 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"
)
List
<
String
>
inputItemNos
);
public
List
<
InputItemVo
>
getInputItemListByitemNos
(
@Param
(
"itemNos"
)
String
[]
itemNos
);
public
List
<
InputItemVo
>
getInputItemListByitemNos
(
@Param
(
"itemNos"
)
String
[]
itemNos
);
public
List
<
PointInputItemVo
>
queryCustomInputItemByPointId
(
@Param
(
"classifyId"
)
String
classifyId
);
public
List
<
PointInputItemVo
>
queryCustomInputItemByPointId
(
@Param
(
"classifyId"
)
String
classifyId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/RoutePointItemMapper.java
View file @
e4bc5c11
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dao
.
mapper
;
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePointItem
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePointItem
;
import
java.util.HashMap
;
import
java.util.List
;
public
interface
RoutePointItemMapper
extends
BaseMapper
{
public
interface
RoutePointItemMapper
extends
BaseMapper
{
...
@@ -11,4 +14,12 @@ public interface RoutePointItemMapper extends BaseMapper {
...
@@ -11,4 +14,12 @@ public interface RoutePointItemMapper extends BaseMapper {
int
delRoutePointItemByPointId
(
Long
pointId
);
int
delRoutePointItemByPointId
(
Long
pointId
);
public
void
insertRoutePointItem
(
RoutePointItem
pointItem
);
public
void
insertRoutePointItem
(
RoutePointItem
pointItem
);
/**
* 根据装备编码查装备信息
* @param equipCode 装备code
* @return
*/
HashMap
<
String
,
String
>
getEquipByCode
(
String
equipCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/param/PointImportParam.java
View file @
e4bc5c11
...
@@ -179,20 +179,21 @@ public class PointImportParam {
...
@@ -179,20 +179,21 @@ public class PointImportParam {
/**
/**
* 负责人id
* 负责人id
*/
*/
@Excel
(
name
=
"责任人"
,
orderNum
=
"1
3
"
)
@Excel
(
name
=
"责任人"
,
orderNum
=
"1
2
"
)
private
String
chargePersonId
;
private
String
chargePersonId
;
@Excel
(
name
=
"检查项目"
,
orderNum
=
"10"
)
// @Excel(name = "检查项目", orderNum = "10")
@ExcelIgnore
private
String
inputItems
;
private
String
inputItems
;
@Excel
(
name
=
"是否室内"
,
replace
={
"是_1"
,
"否_0"
},
orderNum
=
"1
1
"
)
@Excel
(
name
=
"是否室内"
,
replace
={
"是_1"
,
"否_0"
},
orderNum
=
"1
0
"
)
private
String
isIndoor
=
"0"
;
private
String
isIndoor
=
"0"
;
/**
/**
* 归属区域/部门id
* 归属区域/部门id
*/
*/
@Excel
(
name
=
"归属单位/部门"
,
orderNum
=
"1
2
"
)
@Excel
(
name
=
"归属单位/部门"
,
orderNum
=
"1
1
"
)
private
String
chargeDeptId
;
private
String
chargeDeptId
;
...
@@ -205,7 +206,7 @@ public class PointImportParam {
...
@@ -205,7 +206,7 @@ public class PointImportParam {
/**
/**
* 物理区域id(数据来源于装备wl_area)
* 物理区域id(数据来源于装备wl_area)
*/
*/
@Excel
(
name
=
"所在建筑"
,
orderNum
=
"1
4
"
)
@Excel
(
name
=
"所在建筑"
,
orderNum
=
"1
3
"
)
private
String
areaId
;
private
String
areaId
;
/**
/**
* 物理区域名称(数据来源于装备wl_area)
* 物理区域名称(数据来源于装备wl_area)
...
@@ -213,6 +214,17 @@ public class PointImportParam {
...
@@ -213,6 +214,17 @@ public class PointImportParam {
@ExcelIgnore
@ExcelIgnore
private
String
areaName
;
private
String
areaName
;
@Excel
(
name
=
"装备对象|检查项编号"
,
orderNum
=
"14"
)
private
String
equipInputInfo
;
public
String
getEquipInputInfo
()
{
return
equipInputInfo
;
}
public
void
setEquipInputInfo
(
String
equipInputInfo
)
{
this
.
equipInputInfo
=
equipInputInfo
;
}
public
String
getChargeDeptId
()
{
public
String
getChargeDeptId
()
{
return
chargeDeptId
;
return
chargeDeptId
;
}
}
...
...
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 @
e4bc5c11
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.constants.XJConstant;
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.constants.XJConstant;
import
com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dto.PointClassifySynDto
;
import
com.yeejoin.amos.patrol.business.dto.PointClassifySynDto
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo
;
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import
com.yeejoin.amos.patrol.business.param.*
;
import
com.yeejoin.amos.patrol.business.param.*
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPointService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPointService
;
import
com.yeejoin.amos.patrol.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.patrol.business.util.DaoCriteria
;
import
com.yeejoin.amos.patrol.business.util.DaoCriteria
;
import
com.yeejoin.amos.patrol.business.vo.*
;
import
com.yeejoin.amos.patrol.business.vo.*
;
import
com.yeejoin.amos.patrol.common.enums.PointStatusEnum
;
import
com.yeejoin.amos.patrol.common.enums.PointStatusEnum
;
...
@@ -45,6 +47,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
...
@@ -45,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.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -92,7 +95,8 @@ public class PointServiceImpl implements IPointService {
...
@@ -92,7 +95,8 @@ public class PointServiceImpl implements IPointService {
private
ICatalogTreeDao
catalogTreeDao
;
private
ICatalogTreeDao
catalogTreeDao
;
@Autowired
@Autowired
private
InputItemMapper
inputItemMapper
;
private
InputItemMapper
inputItemMapper
;
@Autowired
private
RoutePointItemMapper
routePointItemMapper
;
@Resource
@Resource
IPlanTaskDao
planTaskDao
;
IPlanTaskDao
planTaskDao
;
@Autowired
@Autowired
...
@@ -260,6 +264,64 @@ public class PointServiceImpl implements IPointService {
...
@@ -260,6 +264,64 @@ public class PointServiceImpl implements IPointService {
}
}
iPointDao
.
saveAndFlush
(
point
);
iPointDao
.
saveAndFlush
(
point
);
ids
.
add
(
point
.
getId
());
ids
.
add
(
point
.
getId
());
if
(
StringUtil
.
isNotEmpty
(
param
.
getEquipInputInfo
()))
{
String
[]
infos
=
param
.
getEquipInputInfo
().
split
(
"\\|"
);
for
(
int
i
=
0
;
i
<
infos
.
length
;
i
++)
{
String
[]
split
=
infos
[
i
].
split
(
":"
);
String
equipCode
=
split
[
0
];
List
<
String
>
inputItemCodes
=
Arrays
.
asList
(
split
[
1
].
split
(
","
));
List
<
RoutePoint
>
routePointList
=
iRoutePointDao
.
queryByPointId
(
point
.
getId
());
HashMap
<
String
,
String
>
equipByCode
=
routePointItemMapper
.
getEquipByCode
(
equipCode
);
if
(
ObjectUtils
.
isEmpty
(
equipByCode
))
{
throw
new
BadRequest
(
"装备编码不存在"
);
}
PointClassify
newPointClassify
=
new
PointClassify
();
newPointClassify
.
setEquipmentId
(
equipByCode
.
get
(
"equipmentId"
));
newPointClassify
.
setName
(
equipByCode
.
get
(
"name"
));
// newPointClassify.setInspectionSpecName();
newPointClassify
.
setCreatorId
(
userId
);
newPointClassify
.
setPointId
(
point
.
getId
());
newPointClassify
.
setOrderNo
(
0
);
newPointClassify
.
setDataSourceCode
(
"1"
);
newPointClassify
.
setDataSourceName
(
"消防装备"
);
newPointClassify
.
setAddress
(
equipByCode
.
get
(
"address"
));
newPointClassify
.
setBuildingId
(
String
.
valueOf
(
equipByCode
.
get
(
"sourceId"
)));
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
newPointClassify
.
setOriginalId
(
uuid
.
substring
(
0
,
16
));
newPointClassify
.
setCategoryCode
(
equipByCode
.
get
(
"categoryCode"
));
newPointClassify
.
setCategoryName
(
equipByCode
.
get
(
"categoryName"
));
newPointClassify
.
setCode
(
equipByCode
.
get
(
"code"
));
newPointClassify
.
setBuildingName
(
equipByCode
.
get
(
"fullName"
));
List
<
PointClassify
>
pointClassifies
=
iPointClassifyDao
.
queryByPointIdAndEquipmentId
(
point
.
getId
(),
equipByCode
.
get
(
"equipmentId"
));
if
(!
CollectionUtils
.
isEmpty
(
pointClassifies
))
{
newPointClassify
.
setId
(
pointClassifies
.
get
(
0
).
getId
());
}
this
.
addPointClassifyByPointId
(
newPointClassify
);
List
<
PointInputItemVo
>
customInputList
=
inputItemMapper
.
queryCustomInputItemByCodes
(
inputItemCodes
);
for
(
PointInputItemVo
pItemVo
:
customInputList
)
{
PointInputItem
pointInputItem
=
new
PointInputItem
();
pointInputItem
.
setPointId
(
newPointClassify
.
getPointId
());
pointInputItem
.
setInputItemId
(
pItemVo
.
getId
());
pointInputItem
.
setClassifyIds
(
Long
.
valueOf
(
newPointClassify
.
getId
()).
toString
());
pointInputItem
.
setId
(
0
);
pointInputItem
.
setOrderNo
(
pItemVo
.
getpOrderNo
());
PointInputItem
pointInputItemResult
=
iPointInputItemDao
.
save
(
pointInputItem
);
//更新巡检路线
if
(
routePointList
.
size
()
>
0
)
{
Long
classifyId
=
newPointClassify
.
getId
();
for
(
RoutePoint
routePoint
:
routePointList
)
{
RoutePointItem
routePointItem
=
new
RoutePointItem
();
routePointItem
.
setPointClassifyId
(
classifyId
);
routePointItem
.
setPointInputItemId
(
pointInputItemResult
.
getId
());
routePointItem
.
setRoutePointId
(
routePoint
.
getId
());
iRoutePointItemDao
.
save
(
routePointItem
);
}
}
}
}
}
String
inputItems
=
param
.
getInputItems
();
String
inputItems
=
param
.
getInputItems
();
if
(!
ObjectUtils
.
isEmpty
(
inputItems
))
{
if
(!
ObjectUtils
.
isEmpty
(
inputItems
))
{
String
[]
itemNos
=
inputItems
.
replaceAll
(
" "
,
""
).
split
(
","
);
String
[]
itemNos
=
inputItems
.
replaceAll
(
" "
,
""
).
split
(
","
);
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/routePointItemMapper.xml
View file @
e4bc5c11
...
@@ -75,7 +75,50 @@
...
@@ -75,7 +75,50 @@
</insert>
</insert>
<select
id=
"getEquipByCode"
resultType=
"java.util.HashMap"
>
SELECT
Cast( spec.id as char) as equipmentId,
spec.name AS name,
structure.source_id AS sourceId,
structure.source_code AS sourceCode,
spec.system_id AS systemId,
spec.code AS code,
spec.id AS id,
category.NAME AS categoryName,
category.CODE AS categoryCode,
equipment_detail.area AS address,
equipment_detail.equipment_name as eqpDefName,
equipment_detail.equipment_id as eqpDefId,
spec.biz_org_name as bizOrgName,
spec.position AS acre,
we.inspection_spec as inspectionSpecId,
0 as orderNo,
structure.full_name as fullName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN (
SELECT
DISTINCT equipment_specific_id
, warehouse_structure_id
FROM
wl_stock_detail
) AS detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON spec.warehouse_structure_id = structure.id
LEFT JOIN (
SELECT
s.id,
s.name AS prevName
FROM
wl_warehouse_structure s
) AS area ON area.id = structure.parent_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
<where>
<if
test=
"equipCode != '' and equipCode != null"
>
and spec.code = #{equipCode}
</if>
</where>
limit 1
</select>
...
...
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