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
4bb03dbc
Commit
4bb03dbc
authored
Aug 19, 2021
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of 172.16.10.76:moa/amos-boot-biz into develop
parents
770be55d
16713cca
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
249 additions
and
2414 deletions
+249
-2414
WorkflowFeignService.java
.../boot/biz/common/workflow/feign/WorkflowFeignService.java
+10
-1
KeySiteMapper.xml
...le-common-api/src/main/resources/mapper/KeySiteMapper.xml
+28
-35
AppVersion.java
...a/com/yeejoin/amos/maintenance/dao/entity/AppVersion.java
+0
-124
Config.java
.../java/com/yeejoin/amos/maintenance/dao/entity/Config.java
+0
-59
AlertCalled.java
.../yeejoin/amos/boot/module/tzs/api/entity/AlertCalled.java
+0
-2
AlertCalledMapper.xml
...e-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
+18
-18
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+1
-1
KeySiteServiceImpl.java
...ot/module/common/biz/service/impl/KeySiteServiceImpl.java
+1
-0
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+25
-25
CommonController.java
...mos/maintenance/business/controller/CommonController.java
+0
-68
ConfigController.java
...mos/maintenance/business/controller/ConfigController.java
+0
-56
MsgController.java
...n/amos/maintenance/business/controller/MsgController.java
+0
-429
PointController.java
...amos/maintenance/business/controller/PointController.java
+15
-54
UserController.java
.../amos/maintenance/business/controller/UserController.java
+6
-798
AppVersionDao.java
...os/maintenance/business/dao/repository/AppVersionDao.java
+0
-12
IConfigDao.java
.../amos/maintenance/business/dao/repository/IConfigDao.java
+0
-12
PlanTaskPointInputItemBo.java
...nce/business/entity/mybatis/PlanTaskPointInputItemBo.java
+28
-143
EquipFeignClient.java
...oin/amos/maintenance/business/feign/EquipFeignClient.java
+18
-12
AppServiceImpl.java
...mos/maintenance/business/service/impl/AppServiceImpl.java
+0
-85
CheckServiceImpl.java
...s/maintenance/business/service/impl/CheckServiceImpl.java
+4
-4
MessageServiceImpl.java
...maintenance/business/service/impl/MessageServiceImpl.java
+2
-2
PlanTaskServiceImpl.java
...aintenance/business/service/impl/PlanTaskServiceImpl.java
+19
-333
PointServiceImpl.java
...s/maintenance/business/service/impl/PointServiceImpl.java
+2
-3
StatisticsServiceImpl.java
...ntenance/business/service/impl/StatisticsServiceImpl.java
+5
-5
IAppService.java
.../amos/maintenance/business/service/intfc/IAppService.java
+0
-19
IPlanTaskService.java
.../maintenance/business/service/intfc/IPlanTaskService.java
+15
-39
PersonIdentify.java
...ejoin/amos/maintenance/core/framework/PersonIdentify.java
+1
-1
PersonIdentifyAspect.java
...amos/maintenance/core/framework/PersonIdentifyAspect.java
+1
-1
JobService.java
.../java/com/yeejoin/amos/maintenance/quartz/JobService.java
+3
-34
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+20
-22
DispatchPaperServiceImpl.java
...module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
+12
-6
RepairConsultServiceImpl.java
...module/tzs/biz/service/impl/RepairConsultServiceImpl.java
+2
-2
application.properties
...tem-maintenance/src/main/resources/application.properties
+3
-3
dbTemplate_plan_task.xml
...nce/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+10
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/feign/WorkflowFeignService.java
View file @
4bb03dbc
...
...
@@ -81,7 +81,7 @@ public interface WorkflowFeignService {
* @param taskID
* @return
*/
@RequestMapping
(
value
=
"/task/pickuptask/{taskID}"
,
method
=
RequestMethod
.
GE
T
)
@RequestMapping
(
value
=
"/task/pickuptask/{taskID}"
,
method
=
RequestMethod
.
PU
T
)
JSONObject
pickuptask
(
@PathVariable
(
"taskID"
)
String
taskID
)
;
/**
* 直接完成任务
...
...
@@ -94,5 +94,14 @@ public interface WorkflowFeignService {
@RequestMapping
(
value
=
"/task/getTaskAssign/{taskId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getTaskAssign
(
@PathVariable
(
"taskId"
)
String
taskId
)
;
/**
* 不操作FormInstance直接完成任务
* @param taskID
* @param variable
* @return
* @throws Exception
*/
@RequestMapping
(
value
=
"/task/completeTask/noFromInstanceAdd/{taskID}"
,
method
=
RequestMethod
.
POST
)
JSONObject
completeNoExecuteFromInstanceAdd
(
@PathVariable
(
"taskID"
)
String
taskID
,
@RequestBody
(
required
=
false
)
HashMap
<
String
,
Object
>
variable
)
throws
Exception
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/KeySiteMapper.xml
View file @
4bb03dbc
...
...
@@ -3,10 +3,8 @@
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper"
>
<select
id=
"getPageList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT
SELECT
c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
...
...
@@ -33,35 +31,33 @@ SELECT
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM
FROM
cb_key_site c
left join
cb_org_usr cou on c.belong_id =cou.sequence_nbr
where c.is_delete=FALSE
<if
test=
"name != null and name != ''"
>
left join
cb_org_usr cou on c.belong_id =cou.sequence_nbr
where c.is_delete=FALSE
<if
test=
"name != null and name != ''"
>
AND c.`name` like concat(#{name}, '%')
</if>
<if
test=
"buildingId != null and buildingId != -1"
>
</if>
<if
test=
"buildingId != null and buildingId != -1"
>
AND c.`building_id`= #{buildingId}
</if>
<if
test=
"fireEnduranceRate != null and fireEnduranceRate != ''"
>
</if>
<if
test=
"fireEnduranceRate != null and fireEnduranceRate != ''"
>
AND c.`fire_endurance_rate`= #{fireEnduranceRate}
</if>
<if
test=
"useNature != null and useNature != ''"
>
</if>
<if
test=
"useNature != null and useNature != ''"
>
AND c.`use_nature`= #{useNature}
</if>
<if
test=
"fireFacilitiesInfo != null and fireFacilitiesInfo != ''"
>
</if>
<if
test=
"fireFacilitiesInfo != null and fireFacilitiesInfo != ''"
>
AND c.`fire_facilities_info`= #{fireFacilitiesInfo}
</if>
<if
test=
"belongId != null and belongId!='-1' and belongId != -1"
>
</if>
<if
test=
"belongId != null and belongId!='-1' and belongId != -1"
>
AND c.`belong_id`= #{belongId}
</if>
</if>
order by c.rec_date desc
</select>
<select
id=
"getSequenceNbr"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT
c.`name` as name,
SELECT c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
...
...
@@ -87,16 +83,14 @@ where c.is_delete=FALSE
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM
cb_key_site c
left join cb_org_usr cou on c.belong_id =cou.sequence_nbr
where c.sequence_nbr=#{sequenceNbr} and c.is_delete=
FALSE;
</select>
FROM cb_key_site c
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.sequence_nbr = #{sequenceNbr}
and c.is_delete =
FALSE;
</select>
<select
id=
"getKeySiteList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT
c.`name` as name,
SELECT c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
...
...
@@ -122,10 +116,9 @@ where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE;
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM
cb_key_site c
left join cb_org_usr cou on c.belong_id =cou.sequence_nbr
where c.is_delete=FALSE;
</select>
FROM cb_key_site c
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.is_delete = FALSE;
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/AppVersion.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
org.hibernate.annotations.Where
;
@Entity
@Table
(
name
=
"p_app_version"
)
@NamedQuery
(
name
=
"AppVersion.findAll"
,
query
=
"SELECT c FROM AppVersion c"
)
@Where
(
clause
=
"is_latest_version=1"
)
//表示未删除的数据
public
class
AppVersion
extends
BasicEntity
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
3207180951171522450L
;
/**
* app版本
*/
@Column
(
name
=
"version"
)
private
String
version
;
/**
* 版本说明
*/
@Column
(
name
=
"remark"
)
private
String
remark
;
/**
* app发布人id
*/
@Column
(
name
=
"publisher"
)
private
int
publisher
;
/**
* app发布人名称
*/
@Column
(
name
=
"publisher_name"
)
private
String
publisherName
;
/**
* 是否需要强制更新
*/
@Column
(
name
=
"update_type"
)
private
int
updateType
;
/**
* 是否为最新版本
*/
@Column
(
name
=
"is_latest_version"
)
private
Boolean
isLatestVersion
;
/**
* app保存路径
*/
@Column
(
name
=
"url"
)
private
String
url
;
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
int
getPublisher
()
{
return
publisher
;
}
public
void
setPublisher
(
int
publisher
)
{
this
.
publisher
=
publisher
;
}
public
String
getPublisherName
()
{
return
publisherName
;
}
public
void
setPublisherName
(
String
publisherName
)
{
this
.
publisherName
=
publisherName
;
}
public
int
getUpdateType
()
{
return
updateType
;
}
public
void
setUpdateType
(
int
updateType
)
{
this
.
updateType
=
updateType
;
}
public
Boolean
getIsLatestVersion
()
{
return
isLatestVersion
;
}
public
void
setIsLatestVersion
(
Boolean
isLatestVersion
)
{
this
.
isLatestVersion
=
isLatestVersion
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
static
long
getSerialversionuid
()
{
return
serialVersionUID
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/Config.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
@Entity
@Table
(
name
=
"p_config"
)
@NamedQuery
(
name
=
"Config.findAll"
,
query
=
"SELECT c FROM Config c"
)
public
class
Config
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 描述
*/
@Column
(
name
=
"des"
)
private
String
des
;
/**
* 名称
*/
@Column
(
name
=
"name"
)
private
String
name
;
/**
* 属性
*/
@Column
(
name
=
"attribute"
)
private
String
attribute
;
public
String
getDes
()
{
return
des
;
}
public
void
setDes
(
String
des
)
{
this
.
des
=
des
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getAttribute
()
{
return
attribute
;
}
public
void
setAttribute
(
String
attribute
)
{
this
.
attribute
=
attribute
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/AlertCalled.java
View file @
4bb03dbc
...
...
@@ -192,8 +192,6 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty
(
value
=
"使用单位"
)
private
String
useUnit
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
4bb03dbc
...
...
@@ -26,16 +26,16 @@
<select
id=
"queryNearlyCount"
resultType=
"java.util.Map"
>
SELECT
DATE_ADD(#{beginDate},INTERVAL -
1
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
7
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
1
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
7
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
1
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
7
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
@@ -43,16 +43,16 @@
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -
2
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
6
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
2
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
6
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
2
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
6
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
@@ -60,16 +60,16 @@
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -
3
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
5
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
3
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
5
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
3
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
5
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
@@ -94,16 +94,16 @@
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -
5
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
3
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
5
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
3
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
5
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
3
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
@@ -111,16 +111,16 @@
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -
6
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
2
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
6
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
2
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
6
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
2
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
@@ -128,16 +128,16 @@
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -
7
DAY) dateTime,
DATE_ADD(#{beginDate},INTERVAL -
1
DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if
test=
"beginDate != null and beginDate != ''"
>
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
7
DAY)
and call_time >= DATE_ADD(#{beginDate},INTERVAL -
1
DAY)
</if>
<if
test=
"endDate != null and endDate != ''"
>
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
7
DAY)
and call_time
<![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -
1
DAY)
</if>
<if
test=
"orgCode != null and orgCode != '' and recUserId != null and recUserId != ''"
>
and org_code= #{orgCode}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
4bb03dbc
...
...
@@ -344,7 +344,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
complete
ByVariable
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
workflowFeignService
.
complete
NoExecuteFromInstanceAdd
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/KeySiteServiceImpl.java
View file @
4bb03dbc
...
...
@@ -67,6 +67,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
String
useNature
,
String
fireFacilitiesInfo
,
Long
belongId
){
return
keySiteMapper
.
getPageList
(
page
,
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
belongId
);
}
@Override
public
List
<
Object
>
getBuildTree
()
{
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/CheckController.java
View file @
4bb03dbc
...
...
@@ -48,7 +48,7 @@ import java.util.Map;
@RestController
@RequestMapping
(
value
=
"/api/check"
)
@Api
(
tags
=
"
巡检
记录api"
)
@Api
(
tags
=
"
维保
记录api"
)
public
class
CheckController
extends
AbstractBaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
CheckController
.
class
);
@Autowired
...
...
@@ -196,7 +196,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存
巡检记录-mobile"
,
notes
=
"保存巡检
记录-mobile"
)
@ApiOperation
(
value
=
"保存
维保记录-mobile"
,
notes
=
"保存维保
记录-mobile"
)
@RequestMapping
(
value
=
"/saveRecord"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
saveCheckRecord
(
@ApiParam
(
value
=
"检查信息"
)
@RequestBody
CheckRecordParam
requestParam
)
{
...
...
@@ -213,35 +213,35 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除
巡检记录"
,
notes
=
"删除巡检
记录"
)
@ApiOperation
(
value
=
"删除
维保记录"
,
notes
=
"删除维保
记录"
)
@RequestMapping
(
value
=
"/testPush"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteCheckById
(
@ApiParam
(
value
=
"
巡检
计划ID"
,
required
=
true
)
@RequestBody
Long
id
)
{
public
CommonResponse
deleteCheckById
(
@ApiParam
(
value
=
"
维保
计划ID"
,
required
=
true
)
@RequestBody
Long
id
)
{
try
{
asyncTask
.
pushCheckMessage
(
id
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"删除
巡检
记录失败"
);
return
CommonResponseUtil
.
failure
(
"删除
维保
记录失败"
);
}
}
/**
*
巡检
计划删除(支持批量)
*
维保
计划删除(支持批量)
*
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除
巡检记录"
,
notes
=
"删除巡检
记录"
)
@ApiOperation
(
value
=
"删除
维保记录"
,
notes
=
"删除维保
记录"
)
@RequestMapping
(
value
=
"/deleteCheckById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteCheckById
(
@ApiParam
(
value
=
"
巡检
计划ID"
,
required
=
true
)
@RequestBody
List
<
Long
>
ids
)
{
public
CommonResponse
deleteCheckById
(
@ApiParam
(
value
=
"
维保
计划ID"
,
required
=
true
)
@RequestBody
List
<
Long
>
ids
)
{
try
{
checkService
.
delCheckById
(
ids
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"删除
巡检
记录失败"
);
return
CommonResponseUtil
.
failure
(
"删除
维保
记录失败"
);
}
}
...
...
@@ -266,7 +266,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取
巡检计划巡检点(已完成或漏检的巡检点)详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检计划巡检点(已完成或漏检的巡检
点)详情信息<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"获取
维保计划维保点(已完成或漏检的维保点)详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取维保计划维保点(已完成或漏检的维保
点)详情信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/queryCheckPointDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryCheckPointDetail
(
@RequestParam
long
checkId
)
{
try
{
...
...
@@ -280,7 +280,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取
巡检计划巡检点(已完成或漏检的巡检点)详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检计划巡检点(已完成或漏检的巡检
点)详情信息<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"获取
维保计划维保点(已完成或漏检的维保点)详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取维保计划维保点(已完成或漏检的维保
点)详情信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/v2/queryCheckPointDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryCheckPointDetailInVersion2
(
@RequestParam
long
checkId
)
{
try
{
...
...
@@ -294,7 +294,7 @@ public class CheckController extends AbstractBaseController {
}
/**
* 获取
巡检
日历数据
* 获取
维保
日历数据
*
* @param date
* @return
...
...
@@ -317,7 +317,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取
巡检点巡检记录列表信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检点巡检
记录列表信息<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"获取
维保点维保记录列表信息<font color='blue'>手机app</font>"
,
notes
=
"获取维保点维保
记录列表信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/queryCheckRecord"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRecordByPointId
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
)
{
...
...
@@ -341,7 +341,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取
巡检记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检
记录详情信息<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"获取
维保记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取维保
记录详情信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/queryCheckDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
...
...
@@ -349,15 +349,15 @@ public class CheckController extends AbstractBaseController {
}
/**
* 根据
巡检记录ID获取巡检
记录详情
* 根据
维保记录ID获取维保
记录详情
*
* @param checkId
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据
巡检记录ID获取巡检记录详情"
,
notes
=
"根据巡检记录ID获取巡检
记录详情"
)
@ApiOperation
(
value
=
"根据
维保记录ID获取维保记录详情"
,
notes
=
"根据维保记录ID获取维保
记录详情"
)
@RequestMapping
(
value
=
"/queryCheckInfo"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
printTaskDetail
(
@ApiParam
(
value
=
"
巡检
记录ID"
)
@RequestParam
(
required
=
true
)
int
checkId
)
{
public
CommonResponse
printTaskDetail
(
@ApiParam
(
value
=
"
维保
记录ID"
)
@RequestParam
(
required
=
true
)
int
checkId
)
{
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
String
xml
=
ToolUtils
.
map2Xml
(
map
,
"CheckInfo"
);
if
(
ObjectUtils
.
isEmpty
(
xml
))
{
...
...
@@ -400,13 +400,13 @@ public class CheckController extends AbstractBaseController {
}
/**
* 获取
巡检点,巡检
线路初始数据
* 获取
维保点,维保
线路初始数据
*
* @return
*/
//@Authorization(ingore=true)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取
巡检点初始数据(<font color='blue'>release</font>)"
,
notes
=
"获取巡检
点初始数据"
)
@ApiOperation
(
value
=
"获取
维保点初始数据(<font color='blue'>release</font>)"
,
notes
=
"获取维保
点初始数据"
)
@RequestMapping
(
value
=
"/viewModule/initData"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getViewModuleInitData
()
{
try
{
...
...
@@ -420,7 +420,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
巡检情况统计分析"
,
notes
=
"巡检
情况统计分析"
)
@ApiOperation
(
value
=
"
维保情况统计分析"
,
notes
=
"维保
情况统计分析"
)
@RequestMapping
(
value
=
"/statisticalAnalysis"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getCheckStatisticalAnalysis
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
CheckStatisticalParam
queryRequests
)
{
...
...
@@ -432,7 +432,7 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出
巡检情况统计分析"
,
notes
=
"导出巡检
情况统计分析"
)
@ApiOperation
(
value
=
"导出
维保情况统计分析"
,
notes
=
"导出维保
情况统计分析"
)
@RequestMapping
(
value
=
"/exportStatisticalAnalysis"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/vnd.ms-excel;charset=UTF-8"
)
public
void
exportStatisticalAnalysis
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
CheckStatisticalParam
queryRequests
,
...
...
@@ -442,13 +442,13 @@ public class CheckController extends AbstractBaseController {
String
loginOrgCode
=
getOrgCode
(
reginParams
);
queryRequests
.
setOrgCode
(
loginOrgCode
);
List
<
CheckAnalysisVo
>
list
=
checkService
.
getCheckStatisticalAnalysis
(
getToken
(),
getProduct
(),
getAppKey
(),
queryRequests
);
String
fileName
=
"
巡检
记录"
+
new
Date
().
getTime
();
FileHelper
.
exportExcel
(
list
,
"
巡检情况统计分析\""
,
"巡检
情况统计分析\""
,
CheckAnalysisVo
.
class
,
fileName
+
".xls"
,
response
);
String
fileName
=
"
维保
记录"
+
new
Date
().
getTime
();
FileHelper
.
exportExcel
(
list
,
"
维保情况统计分析\""
,
"维保
情况统计分析\""
,
CheckAnalysisVo
.
class
,
fileName
+
".xls"
,
response
);
}
/**
* 根据检查项ID和检查输入项ID查询图片, 如果输入项ID位0时,查询
巡检
现场照片, 如果不为0查询检查项照片
* 根据检查项ID和检查输入项ID查询图片, 如果输入项ID位0时,查询
维保
现场照片, 如果不为0查询检查项照片
*
* @param checkId
* @param checkInputId
...
...
@@ -458,7 +458,7 @@ public class CheckController extends AbstractBaseController {
@ApiOperation
(
value
=
"获取检查项照片URL(<font color='blue'>release</font>)"
,
notes
=
"获取检查项照片URL"
)
@RequestMapping
(
value
=
"/getCheckPic"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getCheckPhotosByCheckAndInputId
(
@ApiParam
(
value
=
"
巡检
记录ID"
)
@RequestParam
(
required
=
true
)
int
checkId
,
@ApiParam
(
value
=
"
维保
记录ID"
)
@RequestParam
(
required
=
true
)
int
checkId
,
@ApiParam
(
value
=
"检查输入项ID"
)
@RequestParam
(
required
=
false
)
int
checkInputId
,
@ApiParam
(
value
=
"分类ID"
)
@RequestParam
(
required
=
false
)
int
classifyId
)
{
try
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/CommonController.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IAppService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.common.enums.CheckStatisticsTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskExecution
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum
;
import
com.yeejoin.amos.maintenance.common.enums.TaskStatisticsTypeEnum
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@RestController
@RequestMapping
(
value
=
"/api/common"
)
@Api
(
tags
=
"公共接口api"
)
public
class
CommonController
extends
AbstractBaseController
{
/*@Autowired
IUserService userService;*/
@Autowired
private
IAppService
iAppService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"任务统计口径类型"
,
notes
=
"任务统计口径类型"
)
@RequestMapping
(
value
=
"/taskgetStatisticsType"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getTaskStatisticsType
()
{
return
CommonResponseUtil
.
success
(
TaskStatisticsTypeEnum
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"巡检统计口径类型"
,
notes
=
"巡检统计口径类型"
)
@RequestMapping
(
value
=
"/checkStatisticsType"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getCheckStatisticsType
()
{
return
CommonResponseUtil
.
success
(
CheckStatisticsTypeEnum
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"计划任务完成种类"
,
notes
=
"计划任务完成种类"
)
@RequestMapping
(
value
=
"/planTaskFinishStatus"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPlanTaskFinishStatus
()
{
return
CommonResponseUtil
.
success
(
PlanTaskFinishStatusEnum
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"计划任务执行情况种类"
,
notes
=
"计划任务执行情况种类"
)
@RequestMapping
(
value
=
"/planTaskExecution"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPlanTaskExecution
()
{
return
CommonResponseUtil
.
success
(
PlanTaskExecution
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取app最新版本信息"
,
notes
=
"获取app最新版本信息"
)
@RequestMapping
(
value
=
"/queryAppVersion"
,
method
=
RequestMethod
.
GET
)
//@Authorization(ingore=true)
public
CommonResponse
getAppLastVersion
()
{
return
CommonResponseUtil
.
success
(
iAppService
.
queryAppLastVersion
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/ConfigController.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IConfigDao
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.dao.entity.Config
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* 获取主题信息
*
* @author
*
*/
@RestController
@RequestMapping
(
value
=
"/api/config"
)
@Api
(
tags
=
"配置接口api"
)
public
class
ConfigController
extends
AbstractBaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
ConfigController
.
class
);
@Autowired
private
IConfigDao
configDao
;
/**
* <pre>
* 获取配置接口信息
* </pre>
*
*
* @return
*/
//@Authorization(ingore = true)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取配置接口信息"
,
notes
=
" 获取配置接口信息"
)
@RequestMapping
(
value
=
"/getConfigsInfo"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getConfigsInfo
()
{
List
<
Config
>
configs
=
configDao
.
findAll
();
return
CommonResponseUtil
.
success
(
configs
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/MsgController.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
java.beans.BeanInfo
;
import
java.beans.Introspector
;
import
java.beans.PropertyDescriptor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao
;
import
com.yeejoin.amos.maintenance.business.param.MsgInfoPageParam
;
import
com.yeejoin.amos.maintenance.business.param.NoticePublishParam
;
import
com.yeejoin.amos.maintenance.business.param.UserMsgInitParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IAppService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IMessageService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IRouteService
;
import
com.yeejoin.amos.maintenance.business.util.ClazzFieldUtil
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.business.util.DaoCriteria
;
import
com.yeejoin.amos.maintenance.business.util.MsgParamUtils
;
import
com.yeejoin.amos.maintenance.business.vo.MsgVo
;
import
com.yeejoin.amos.maintenance.common.enums.CheckEmailEnum
;
import
com.yeejoin.amos.maintenance.common.enums.CheckTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.MsgTypeEnum
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
import
com.yeejoin.amos.maintenance.dao.entity.Msg
;
import
com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe
;
import
com.yeejoin.amos.maintenance.quartz.IJobService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
/**
* 消息订阅接口 --- 手机
* @author gaodongdong
*
*/
@RestController
@RequestMapping
(
"/api/msgSubscribe"
)
@Api
(
value
=
"手机--消息订阅"
,
tags
=
"消息模块api"
)
public
class
MsgController
extends
AbstractBaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
MsgController
.
class
);
@Autowired
private
IRouteService
routeService
;
@Autowired
private
IMsgSubscribeService
msgSubscribeService
;
@Autowired
private
IMessageService
iMsgService
;
@Autowired
private
IJobService
jobService
;
@Autowired
private
IAppService
iAppService
;
@Autowired
private
IMsgSubscribeDao
msgSubscribeDao
;
/*@Autowired
private IUserService iUserService;
*/
/**
* 获取用户当前所选择公司的消息订阅信息
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取用户当前所选择公司的消息订阅信息"
,
notes
=
"获取用户当前所选择公司的消息订阅信息"
)
@GetMapping
(
value
=
"/querySubscribe"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryMsgSetting
()
{
try
{
AgencyUserModel
userModel
=
getUserInfo
();
String
userId
=
userModel
.
getUserId
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
deptId
=
null
;
if
(
reginParams
.
getDepartment
()!=
null
){
deptId
=
reginParams
.
getDepartment
().
getDepartmentDesc
();
}
/*if(XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName)){
orgCode = param.getUserOrgCode();
}else if(XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)){
deptId = param.getDepartmentId();
userId = param.getUserId();
}else if(XJConstant.ROLE_NAME_PERSON.equals(roleTypeName)){
userId = param.getUserId();
}*/
List
<
HashMap
<
String
,
Object
>>
routeList
=
routeService
.
queryRouteListByOrgCode
(
loginOrgCode
,
userId
,
deptId
);
List
<
Map
<
String
,
Object
>>
checkType
=
CheckTypeEnum
.
getEnumList
();
List
<
Map
<
String
,
Object
>>
emailType
=
CheckEmailEnum
.
getEnumList
();
UserMsgInitParam
userInitParam
=
new
UserMsgInitParam
();
userInitParam
.
setOrgCode
(
loginOrgCode
);
userInitParam
.
setUserId
(
userModel
.
getUserId
());
List
<
MsgSubscribe
>
msgSubs
=
iAppService
.
saveUserMsgInit
(
userInitParam
);
// 获取搜友消息推送类型
if
(
ObjectUtils
.
isEmpty
(
msgSubs
)){
}
emailType
=
setupSelectItem
(
emailType
,
msgSubs
);
//标记已经选择的邮件消息推送类型
checkType
=
setupSelectItem
(
checkType
,
msgSubs
);
// 标记已经选择的检查类型消息
/**
* 获取所有已经选择的路线id数组
*/
String
sRoutes
=
""
;
for
(
MsgSubscribe
msg
:
msgSubs
)
{
if
(
"route"
.
equals
(
msg
.
getMsgType
()))
{
sRoutes
=
msg
.
getAttribute1
();
}
}
List
<
Map
<
String
,
Object
>>
respRoute
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
sRoutes
))
{
String
[]
aRoutes
=
sRoutes
.
split
(
","
);
for
(
HashMap
<
String
,
Object
>
route
:
routeList
)
{
for
(
String
s
:
aRoutes
)
{
if
(!
ObjectUtils
.
isEmpty
(
s
)
&&
s
.
equals
(
route
.
get
(
"id"
)))
{
route
.
put
(
"selected"
,
true
);
respRoute
.
add
(
route
);
break
;
}
else
{
respRoute
.
add
(
route
);
}
}
}
//将已经选择的路线标记位已选择
}
Map
<
String
,
Object
>
response
=
new
HashMap
<>();
response
.
put
(
"route"
,
respRoute
);
response
.
put
(
"email"
,
emailType
);
response
.
put
(
"check"
,
checkType
);
List
<
Map
<
String
,
Object
>>
listf
=
new
ArrayList
<>();
if
(
msgSubs
!=
null
&&
msgSubs
.
size
()>
0
){
for
(
MsgSubscribe
msg
:
msgSubs
)
{
listf
.
add
(
objectToMap1
(
msg
));
}
}
response
.
put
(
"checkPlan"
,
listf
);
return
CommonResponseUtil
.
success
(
response
);
}
catch
(
IllegalAccessException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
();
}
}
/**
* 保存用户消息订阅信息
* @param subscribe
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存用户消息订阅信息"
,
notes
=
"保存用户消息订阅信息"
)
@PostMapping
(
value
=
"/saveSubscribe"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
saveSubscribe
(
@ApiParam
(
value
=
"消息订阅信息"
,
required
=
false
)
@RequestBody
(
required
=
true
)
List
<
MsgSubscribe
>
subscribe
)
{
try
{
AgencyUserModel
userModel
=
getUserInfo
();
String
userId
=
userModel
.
getUserId
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
getOrgCode
(
reginParams
);
for
(
MsgSubscribe
s:
subscribe
)
{
s
.
setOrgCode
(
orgCode
);
s
.
setUserId
(
userModel
.
getUserId
());
}
//查询当前用户是否已保存
List
<
MsgSubscribe
>
lits
=
msgSubscribeService
.
queryMsgSubscribes
(
userId
);
// if(lits!=null&&lits.size()>0){
// //删除
// List<Long> userIds=new ArrayList<>();
// userIds.add(Long.valueOf(userId));
// msgSubscribeDao.delMsgSubscribeByUserId(userIds);
// }
//
msgSubscribeService
.
saveSubscribe
(
subscribe
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
return
CommonResponseUtil
.
success
();
}
private
List
<
Map
<
String
,
Object
>>
setupSelectItem
(
List
<
Map
<
String
,
Object
>>
type
,
List
<
MsgSubscribe
>
msgSubs
)
{
for
(
Map
map
:
type
)
{
for
(
MsgSubscribe
msg
:
msgSubs
)
{
if
(!
msg
.
getMsgType
().
equals
(
map
.
get
(
"ower"
)))
continue
;
if
(
map
.
get
(
"code"
).
equals
(
msg
.
getAttribute1
()))
{
map
.
put
(
"selected"
,
true
);
break
;
}
}
}
return
type
;
}
private
Map
<
String
,
Object
>
objectToMap
(
Object
obj
)
throws
Exception
{
if
(
obj
==
null
)
return
null
;
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
BeanInfo
beanInfo
=
Introspector
.
getBeanInfo
(
obj
.
getClass
());
PropertyDescriptor
[]
propertyDescriptors
=
beanInfo
.
getPropertyDescriptors
();
for
(
PropertyDescriptor
property
:
propertyDescriptors
)
{
String
key
=
property
.
getName
();
if
(
key
.
compareToIgnoreCase
(
"class"
)
==
0
)
{
continue
;
}
Method
getter
=
property
.
getReadMethod
();
Object
value
=
getter
!=
null
?
getter
.
invoke
(
obj
)
:
null
;
map
.
put
(
key
,
value
);
}
return
map
;
}
/**
* 根据登陆用户APP获取未读消息个数
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"APP根据登陆用户获取未读消息个数"
,
notes
=
"APP根据登陆用户获取未读消息个数"
)
@GetMapping
(
value
=
"/unreadCount"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getUnreadCount
()
{
try
{
AgencyUserModel
user
=
getUserInfo
();
int
count
=
msgSubscribeService
.
getUnreadCount
(
user
);
return
CommonResponseUtil
.
success
(
count
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 获取消息类型
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"APP获取消息类型"
,
notes
=
"APP获取消息类型"
)
@GetMapping
(
value
=
"/MsgType"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getMsgType
()
{
try
{
return
CommonResponseUtil
.
success
(
MsgTypeEnum
.
getEnumList
());
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
"获取消息类型失败"
);
}
}
/**
* 根据条件获取消息列表
* @param queryRequests
* @param commonPageable
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"APP 根据条件获取消息列表"
,
notes
=
"APP 根据条件获取消息列表"
)
@PostMapping
(
value
=
"/msgList"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryMsgList
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
roleTypeName
=
getRoleTypeName
(
reginParams
);
CommonRequest
request
=
new
CommonRequest
();
CommonRequest
request1
=
new
CommonRequest
();
request
.
setName
(
"userId"
);
request
.
setValue
(
user
.
getUserId
());
request1
.
setName
(
"status"
);
request1
.
setValue
(
XJConstant
.
IS_SENT
);
queryRequests
.
add
(
request1
);
queryRequests
.
add
(
request
);
List
<
Map
<
String
,
Object
>>
listf
=
new
ArrayList
<>();
List
<
DaoCriteria
>
criterias
=
buildDaoCriterias
(
queryRequests
,
false
,
loginOrgCode
,
roleTypeName
);
Page
<
Msg
>
msgList
=
msgSubscribeService
.
queryMsgList
(
criterias
,
commonPageable
);
List
<
Msg
>
li
=
msgList
.
getContent
();
if
(
li
!=
null
&&
li
.
size
()>
0
){
for
(
Msg
msg
:
li
)
{
listf
.
add
(
objectToMap1
(
msg
));
}
}
Page
<
Map
<
String
,
Object
>>
pd
=
new
PageImpl
<>(
listf
,
msgList
.
getPageable
(),
msgList
.
getTotalElements
());
return
CommonResponseUtil
.
success
(
pd
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"件获取消息列表失败"
);
}
}
public
static
Map
<
String
,
Object
>
objectToMap1
(
Object
obj
)
throws
IllegalAccessException
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
if
(
obj
!=
null
){
for
(
Field
field
:
ClazzFieldUtil
.
getAllFields
(
obj
))
{
field
.
setAccessible
(
true
);
String
fieldName
=
field
.
getName
();
Object
value
=
nvl
(
field
.
get
(
obj
));
if
(
"userId"
.
equals
(
fieldName
)){
map
.
put
(
fieldName
,
Long
.
valueOf
(
value
.
toString
()));
}
else
{
map
.
put
(
fieldName
,
value
);
}
}
return
map
;
}
return
map
;
}
public
static
Object
nvl
(
Object
param
)
{
return
param
!=
null
?
param
:
null
;
}
/**
* 根据条件查询消息列表
* @param queryRequests
* @param commonPageable
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据条件获取消息列表"
,
notes
=
"APP 根据条件获取消息列表"
)
@PostMapping
(
value
=
"/list"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
querylist
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
roleTypeName
=
getRoleTypeName
(
reginParams
);
HashMap
<
String
,
Object
>
paramMap
=
buildMybatisCriterias
(
loginOrgCode
,
roleTypeName
);
if
(
XJConstant
.
ROLE_NAME_DEPTADMIN
.
equals
(
roleTypeName
)||
XJConstant
.
ROLE_NAME_PERSON
.
equals
(
roleTypeName
))
paramMap
.
put
(
"userId"
,
getUserId
());
MsgInfoPageParam
param
=
MsgParamUtils
.
fillMsgInfoParam
(
queryRequests
,
commonPageable
,
paramMap
);
Page
<
MsgVo
>
dataList
=
iMsgService
.
queryMsgInfoList
(
param
);
return
CommonResponseUtil
.
success
(
dataList
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"件获取消息列表失败"
);
}
}
/**
* 修改消失为已读
* @param msgId
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"修改消失为已读"
,
notes
=
"修改消失为已读"
)
@PostMapping
(
value
=
"/isRead"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
isRead
(
@ApiParam
(
value
=
"消息id"
,
required
=
true
)
@RequestBody
Long
msgId
)
{
try
{
Msg
msg
=
msgSubscribeService
.
isRead
(
msgId
);
return
CommonResponseUtil
.
success
(
msg
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"修改消失为已读失败"
);
}
}
/**
* 通知发布
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"通知发布"
,
notes
=
"通知发布"
)
@PostMapping
(
value
=
"/noticePublish"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
noticePublish
(
@ApiParam
(
value
=
"通知信息"
,
required
=
true
)
@RequestBody
NoticePublishParam
msg
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
msg
.
setCreateBy
(
user
.
getUserId
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
msg
.
setUserName
(
user
.
getRealName
());
String
loginOrgCode
=
getOrgCode
(
reginParams
);
msg
.
setOrgCode
(
loginOrgCode
);
List
<
Msg
>
msgList
=
iMsgService
.
publishNotice
(
getToken
(),
getProduct
(),
getAppKey
(),
msg
);
msgList
.
forEach
(
m
->{
jobService
.
msgAddJob
(
m
);
});
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
"通知发布失败!"
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/PointController.java
View file @
4bb03dbc
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.servlet.http.HttpServletResponse
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.maintenance.business.dto.PointDto
;
import
com.yeejoin.amos.maintenance.business.param.MovePointParam
;
import
com.yeejoin.amos.maintenance.business.param.PointImportParam
;
import
com.yeejoin.amos.maintenance.business.param.PointImportQueryParam
;
import
com.yeejoin.amos.maintenance.business.param.PointParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IPointService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.business.util.DaoCriteria
;
import
com.yeejoin.amos.maintenance.business.util.FileHelper
;
import
com.yeejoin.amos.maintenance.business.util.PointParamUtils
;
import
com.yeejoin.amos.maintenance.business.util.*
;
import
com.yeejoin.amos.maintenance.business.vo.MaintenanceResourceData
;
import
com.yeejoin.amos.maintenance.business.vo.PointClassifyVo
;
import
com.yeejoin.amos.maintenance.business.vo.PointInputItemVo
;
import
com.yeejoin.amos.maintenance.business.vo.PointVo
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
import
com.yeejoin.amos.maintenance.core.common.response.PointResponse
;
import
com.yeejoin.amos.maintenance.dao.entity.Point
;
import
com.yeejoin.amos.maintenance.dao.entity.PointClassify
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
@RestController
@RequestMapping
(
value
=
"/api/point"
)
...
...
@@ -73,9 +46,6 @@ public class PointController extends AbstractBaseController {
@Autowired
private
ICatalogTreeService
catalogTreeService
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
/**
* 增加巡检点
*
...
...
@@ -86,23 +56,14 @@ public class PointController extends AbstractBaseController {
@ApiOperation
(
value
=
"新增巡检点"
,
notes
=
"新增巡检点"
)
@PostMapping
(
value
=
"/addPoint"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
addPoint
(
@ApiParam
(
value
=
"巡检点"
,
required
=
true
)
@RequestBody
PointParam
pointParam
)
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
//点归属于公司
pointParam
.
getPoint
().
setOrgCode
(
loginOrgCode
);
pointParam
.
getPoint
().
setCreatorId
(
user
.
getUserId
());
pointParam
.
getPoint
().
setCreatorId
(
getUserId
());
Point
point
=
iPointService
.
addPoint
(
pointParam
);
return
CommonResponseUtil
.
success
(
point
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"巡检点新增失败"
);
}
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/UserController.java
View file @
4bb03dbc
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.maintenance.business.param.AppLoginUserParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IAppService
;
import
com.yeejoin.amos.maintenance.business.util.*
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.jpush.AppMessagePushService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.env.Environment
;
import
org.springframework.http.*
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.lang.reflect.Field
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 获取用户信息
*
...
...
@@ -46,775 +20,9 @@ import java.util.stream.Collectors;
@RequestMapping
(
value
=
"/api/user"
)
@Api
(
tags
=
"用户信息api"
)
public
class
UserController
extends
AbstractBaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserController
.
class
);
@Autowired
private
IAppService
iAppService
;
@Autowired
private
Environment
env
;
private
static
final
String
appType
=
"APP"
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
AppMessagePushService
appMessagePushService
;
@Value
(
"${Security.fegin.name}"
)
private
String
SecurityName
;
@Value
(
"${security.productApp}"
)
private
String
productApp
;
@Value
(
"${security.appKey}"
)
private
String
appKey
;
@Autowired
private
RestTemplate
restTemplate
;
/**
* 根据部门id查询用户信息
*
* @param deptId
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"部门人员查询"
,
notes
=
"部门人员查询"
)
@RequestMapping
(
value
=
"/queryDeptUser"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryDeptUser
(
@RequestParam
(
value
=
"deptId"
,
required
=
false
)
String
deptId
)
{
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByDepartmentId
(
getToken
(),
getProduct
(),
getAppKey
(),
deptId
);
List
<
LinkedHashMap
<
String
,
Object
>>
userList
=
new
ArrayList
<>();
if
(
"-1"
.
equals
(
deptId
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
dep
=
reginParams
.
getCompany
().
getSequenceNbr
().
toString
();
//查询没有部门的人员信息
CompanyModel
companyModel
=
remoteSecurityService
.
listUserByCompanyId1
(
getToken
(),
getProduct
(),
getAppKey
(),
dep
);
List
children
=
(
List
)
companyModel
.
getChildren
();
for
(
int
i
=
0
;
i
<
children
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
(
LinkedHashMap
)
children
.
get
(
i
);
if
(
"其他"
.
equals
((
map
.
get
(
"departmentName"
).
toString
())))
{
List
<
LinkedHashMap
<
String
,
Object
>>
user1
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
map
.
get
(
"userModelList"
);
for
(
int
j
=
0
;
j
<
user1
.
size
();
j
++)
{
LinkedHashMap
<
String
,
Object
>
user
=
new
LinkedHashMap
<>();
user
.
put
(
"id"
,
user1
.
get
(
j
).
get
(
"userId"
).
toString
());
user
.
put
(
"key"
,
user1
.
get
(
j
).
get
(
"userId"
).
toString
());
user
.
put
(
"value"
,
user1
.
get
(
j
).
get
(
"userId"
).
toString
());
user
.
put
(
"checked"
,
false
);
user
.
put
(
"state"
,
"open"
);
user
.
put
(
"name"
,
user1
.
get
(
j
).
get
(
"realName"
).
toString
());
user
.
put
(
"desc"
,
null
);
user
.
put
(
"writeable"
,
0
);
user
.
put
(
"userName"
,
user1
.
get
(
j
).
get
(
"realName"
).
toString
());
if
(
StringUtil
.
isNotEmpty
(
user1
.
get
(
j
).
get
(
"mobile"
)))
{
user
.
put
(
"mobile"
,
user1
.
get
(
j
).
get
(
"mobile"
).
toString
());
}
else
{
user
.
put
(
"mobile"
,
""
);
}
if
(
StringUtil
.
isNotEmpty
(
user1
.
get
(
j
).
get
(
"landlinePhone"
)))
{
user
.
put
(
"telephone"
,
user1
.
get
(
j
).
get
(
"landlinePhone"
).
toString
());
}
else
{
user
.
put
(
"telephone"
,
""
);
}
user
.
put
(
"departmentName"
,
"其他"
);
userList
.
add
(
user
);
}
}
}
}
else
{
userList
=
paraseData
(
userModels
,
null
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
return
CommonResponseUtil
.
success
(
userList
);
}
private
List
<
LinkedHashMap
<
String
,
Object
>>
paraseData
(
List
<
AgencyUserModel
>
list
,
String
userNmae
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
userList
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
for
(
AgencyUserModel
userModel
:
list
)
{
LinkedHashMap
<
String
,
Object
>
user
=
new
LinkedHashMap
<>();
user
.
put
(
"id"
,
userModel
.
getUserId
().
toString
());
user
.
put
(
"key"
,
userModel
.
getUserId
().
toString
());
user
.
put
(
"value"
,
userModel
.
getUserId
().
toString
());
user
.
put
(
"checked"
,
false
);
user
.
put
(
"state"
,
"open"
);
user
.
put
(
"name"
,
userModel
.
getRealName
());
user
.
put
(
"desc"
,
null
);
user
.
put
(
"writeable"
,
0
);
user
.
put
(
"userName"
,
userModel
.
getUserId
().
toString
());
user
.
put
(
"mobile"
,
userModel
.
getMobile
());
user
.
put
(
"telephone"
,
userModel
.
getLandlinePhone
());
user
.
put
(
"departmentName"
,
"其他"
);
userList
.
add
(
user
);
}
}
return
userList
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"部门人员树查询"
,
notes
=
"部门人员树查询"
)
@RequestMapping
(
value
=
"/queryDeptUserTree1"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryDeptUserTree1
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
CompanyModel
companyModel
=
remoteSecurityService
.
listUserByCompanyId1
(
getToken
(),
getProduct
(),
getAppKey
(),
reginParams
.
getCompany
().
getSequenceNbr
().
toString
());
List
children
=
(
List
)
companyModel
.
getChildren
();
List
<
DepartmentUserTreeWebVo
>
list
=
Lists
.
newArrayList
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
for
(
int
i
=
0
;
i
<
children
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
(
LinkedHashMap
)
children
.
get
(
i
);
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
));
DepartmentUserTreeWebVo
deptTreeWeb
=
new
DepartmentUserTreeWebVo
();
JSONArray
childrens
=
json
.
getJSONArray
(
"children"
);
deptTreeWeb
.
setType
(
"department"
);
deptTreeWeb
.
setKey
(
map
.
get
(
"sequenceNbr"
).
toString
());
deptTreeWeb
.
setLabel
(
map
.
get
(
"sequenceNbr"
).
toString
());
deptTreeWeb
.
setTitle
(
map
.
get
(
"departmentName"
).
toString
());
deptTreeWeb
.
setValue
(
map
.
get
(
"sequenceNbr"
).
toString
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"userModelList"
)))
{
List
userModalList
=
(
List
)
((
List
)
map
.
get
(
"userModelList"
)).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
deptTreeWeb
.
setUserModelList
(
userModalList
);
}
list
.
add
(
deptTreeWeb
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
)
{
buildUserDeptTreeForWebBefore
(
list
,
childrens
);
}
list
=
buildUserDeptTreeForWeb
(
list
);
}
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 重构数据,用户存放在部门的children
*
* @param list
* @return
*/
private
List
<
DepartmentUserTreeWebVo
>
buildUserDeptTreeForWeb
(
List
<
DepartmentUserTreeWebVo
>
list
)
{
list
.
forEach
(
x
->
{
List
<
DepartmentUserTreeWebVo
>
users
=
Lists
.
newArrayList
();
if
(!
ObjectUtils
.
isEmpty
(
x
.
getUserModelList
()))
{
List
<
DepartmentUserTreeWebVo
>
collects
=
x
.
getUserModelList
().
stream
().
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
userModelList
=
(
List
)
collects
;
userModelList
.
forEach
(
userModel
->
{
DepartmentUserTreeWebVo
userTreeWeb
=
new
DepartmentUserTreeWebVo
();
userTreeWeb
.
setType
(
"user"
);
userTreeWeb
.
setKey
(
userModel
.
get
(
"userId"
).
toString
()
+
"*"
+
x
.
getValue
()
+
"*"
+
UUID
.
randomUUID
().
toString
());
userTreeWeb
.
setLabel
(
userModel
.
get
(
"realName"
).
toString
());
userTreeWeb
.
setTitle
(
userModel
.
get
(
"realName"
).
toString
());
userTreeWeb
.
setValue
(
userModel
.
get
(
"userId"
).
toString
()
+
"*"
+
x
.
getValue
()
+
"*"
+
UUID
.
randomUUID
().
toString
());
users
.
add
(
userTreeWeb
);
}
);
x
.
setChildren
(
users
);
collects
.
clear
();
x
.
setUserModelList
(
collects
);
}
}
);
return
list
;
}
/**
* 部门数据预处理(获取所有子节点)
*
* @param list
* @param children
*/
private
void
buildUserDeptTreeForWebBefore
(
List
<
DepartmentUserTreeWebVo
>
list
,
JSONArray
children
)
{
for
(
int
i
=
0
;
i
<
children
.
size
();
i
++)
{
JSONObject
json
=
children
.
getJSONObject
(
i
);
DepartmentUserTreeWebVo
deptTreeWeb
=
new
DepartmentUserTreeWebVo
();
Map
deptMap
=
JSONObject
.
parseObject
(
json
.
toJSONString
(),
Map
.
class
);
deptTreeWeb
.
setType
(
"department"
);
deptTreeWeb
.
setKey
(
deptMap
.
get
(
"sequenceNbr"
).
toString
());
deptTreeWeb
.
setLabel
(
deptMap
.
get
(
"sequenceNbr"
).
toString
());
deptTreeWeb
.
setTitle
(
deptMap
.
get
(
"departmentName"
).
toString
());
deptTreeWeb
.
setValue
(
deptMap
.
get
(
"sequenceNbr"
).
toString
());
if
(!
ObjectUtils
.
isEmpty
(
deptMap
.
get
(
"userModelList"
)))
{
deptTreeWeb
.
setUserModelList
((
List
)
deptMap
.
get
(
"userModelList"
));
}
if
(
json
!=
null
&&
json
.
size
()
>
0
)
{
list
.
add
(
deptTreeWeb
);
}
else
{
JSONArray
childrens
=
json
.
getJSONArray
(
"children"
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
)
{
buildUserDeptTreeForWebBefore
(
deptTreeWeb
.
getChildren
(),
childrens
);
}
if
(
"0"
.
equals
(
deptMap
.
get
(
"parentId"
)))
{
list
.
add
(
deptTreeWeb
);
}
}
}
}
/**
* 查询用户权限人员
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"人员查询"
,
notes
=
"人员查询"
)
@RequestMapping
(
value
=
"/queryAuthUsers"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
// @Authorization(ingore = true)
public
CommonResponse
queryAllUser
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByOrgCode
(
getToken
(),
getProduct
(),
getAppKey
(),
loginOrgCode
);
List
<
LinkedHashMap
<
String
,
Object
>>
userList
=
paraseData
(
userModels
,
null
);
return
CommonResponseUtil
.
success
(
userList
);
}
/**
* 查询用户部门人员树
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"部门人员树查询"
,
notes
=
"部门人员树查询"
)
@RequestMapping
(
value
=
"/queryDeptUserTree"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryDeptUserTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
departmentId
=
getDepartmentId
(
reginParams
);
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByDepartmentId
(
getToken
(),
getProduct
(),
getAppKey
(),
departmentId
);
List
<
LinkedHashMap
<
String
,
Object
>>
userList
=
paraseData
(
userModels
,
null
);
return
CommonResponseUtil
.
success
(
userList
);
}
/**
* 查询用户部门人员树
*
* @return
* @RequestParam userName 用户名
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"通讯录(<font color='blue'>手机app</font>)"
,
notes
=
"通讯录(<font color='blue'>手机app</font>)"
)
@RequestMapping
(
value
=
"/queryUserAddressList"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryUserAddressListTree
(
@ApiParam
(
value
=
"用户名"
,
required
=
false
)
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
CompanyBo
companyBo
=
reginParams
.
getCompany
();
JSONArray
arr
=
remoteSecurityService
.
listDepartmentUserTree
(
getToken
(),
getProduct
(),
getAppKey
(),
companyBo
.
getSequenceNbr
().
toString
());
DepartmentUserTreeAppVo
departmentUserTreeDto
=
new
DepartmentUserTreeAppVo
();
if
(
arr
!=
null
&&
arr
.
size
()
>
0
)
{
buildUserDeptTree
(
departmentUserTreeDto
,
arr
);
}
List
<
LinkedHashMap
<
String
,
Object
>>
content
=
new
ArrayList
<>();
//数据重新封装
List
<
DepartmentUserTreeAppVo
>
list
=
departmentUserTreeDto
.
getChildren
();
LinkedHashMap
<
String
,
Object
>
otherDept1
=
new
LinkedHashMap
<>();
for
(
DepartmentUserTreeAppVo
departmentUserTreeAppVo
:
list
)
{
LinkedHashMap
<
String
,
Object
>
otherDept
=
new
LinkedHashMap
<>();
if
(
"其他"
.
equals
(
departmentUserTreeAppVo
.
getName
()))
{
otherDept1
.
put
(
"children"
,
paraseData1
(
getToken
(),
getProduct
(),
getAppKey
(),
departmentUserTreeAppVo
.
getChildren
(),
"其他"
,
"-1"
,
userName
));
otherDept1
.
put
(
"id"
,
-
1
);
otherDept1
.
put
(
"key"
,
-
1
);
otherDept1
.
put
(
"value"
,
-
1
);
otherDept1
.
put
(
"state"
,
"open"
);
otherDept1
.
put
(
"type"
,
"department"
);
otherDept1
.
put
(
"label"
,
"其他"
);
otherDept1
.
put
(
"title"
,
"其他"
);
otherDept1
.
put
(
"name"
,
"其他"
);
otherDept1
.
put
(
"desc"
,
"其他"
);
otherDept1
.
put
(
"writeable"
,
0
);
otherDept1
.
put
(
"attributes"
,
""
);
}
else
{
otherDept
.
put
(
"children"
,
paraseData1
(
getToken
(),
getProduct
(),
getAppKey
(),
departmentUserTreeAppVo
.
getChildren
(),
departmentUserTreeAppVo
.
getName
(),
departmentUserTreeAppVo
.
getId
(),
userName
));
otherDept
.
put
(
"id"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"key"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"value"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"state"
,
"open"
);
otherDept
.
put
(
"type"
,
"department"
);
otherDept
.
put
(
"label"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"title"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"name"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"desc"
,
null
);
otherDept
.
put
(
"writeable"
,
0
);
otherDept
.
put
(
"attributes"
,
""
);
content
.
add
(
otherDept
);
}
}
if
(
otherDept1
!=
null
)
{
content
.
add
(
otherDept1
);
}
return
CommonResponseUtil
.
success
(
content
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"通讯录异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
private
List
<
LinkedHashMap
<
String
,
Object
>>
paraseData1
(
String
toke
,
String
product
,
String
appKey
,
List
<
DepartmentUserTreeAppVo
>
map
,
String
name
,
String
depid
,
String
username
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
content
=
new
ArrayList
<>();
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
for
(
DepartmentUserTreeAppVo
departmentUserTreeAppVo
:
map
)
{
if
(
"dept"
.
equals
(
departmentUserTreeAppVo
.
getType
()))
{
LinkedHashMap
<
String
,
Object
>
otherDept
=
new
LinkedHashMap
<>();
otherDept
.
put
(
"children"
,
paraseData1
(
getToken
(),
getProduct
(),
getAppKey
(),
departmentUserTreeAppVo
.
getChildren
(),
departmentUserTreeAppVo
.
getName
(),
departmentUserTreeAppVo
.
getId
(),
username
));
otherDept
.
put
(
"id"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"key"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"value"
,
departmentUserTreeAppVo
.
getId
());
otherDept
.
put
(
"state"
,
"open"
);
otherDept
.
put
(
"type"
,
"department"
);
otherDept
.
put
(
"label"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"title"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"name"
,
departmentUserTreeAppVo
.
getName
());
otherDept
.
put
(
"desc"
,
null
);
otherDept
.
put
(
"writeable"
,
0
);
otherDept
.
put
(
"attributes"
,
""
);
content
.
add
(
otherDept
);
}
else
{
LinkedHashMap
<
String
,
Object
>
user
=
new
LinkedHashMap
<>();
user
.
put
(
"id"
,
departmentUserTreeAppVo
.
getId
());
user
.
put
(
"key"
,
departmentUserTreeAppVo
.
getId
());
user
.
put
(
"value"
,
departmentUserTreeAppVo
.
getId
());
user
.
put
(
"checked"
,
false
);
user
.
put
(
"state"
,
"open"
);
user
.
put
(
"type"
,
"user"
);
user
.
put
(
"label"
,
departmentUserTreeAppVo
.
getName
());
user
.
put
(
"title"
,
departmentUserTreeAppVo
.
getName
());
user
.
put
(
"name"
,
departmentUserTreeAppVo
.
getName
());
user
.
put
(
"desc"
,
null
);
user
.
put
(
"writeable"
,
0
);
user
.
put
(
"userName"
,
departmentUserTreeAppVo
.
getName
());
user
.
put
(
"depid"
,
depid
);
//获取电话邮箱
Map
<
String
,
String
>
userObj
=
departmentUserTreeAppVo
.
getObject
();
if
(
userObj
!=
null
&&
userObj
.
get
(
"telephone"
)
!=
null
)
{
user
.
put
(
"mobile"
,
userObj
.
get
(
"telephone"
));
}
else
{
user
.
put
(
"mobile"
,
""
);
}
if
(
userObj
!=
null
&&
userObj
.
get
(
"email"
)
!=
null
)
{
user
.
put
(
"email"
,
userObj
.
get
(
"email"
));
}
else
{
user
.
put
(
"email"
,
""
);
}
if
(
userObj
!=
null
&&
userObj
.
get
(
"mobile"
)
!=
null
)
{
user
.
put
(
"mobile"
,
userObj
.
get
(
"mobile"
));
}
else
{
user
.
put
(
"mobile"
,
""
);
}
// AgencyUserModel userdate=remoteSecurityService.getUserById( toke, product, appKey, departmentUserTreeAppVo.getId());
// if(userdate!=null){
// user.put("telephone", userdate.getLandlinePhone());
// user.put("mobile", userdate.getMobile());
// user.put("email", userdate.getEmail());
// }else{
// user.put("mobile", "");
// }
user
.
put
(
"departmentName"
,
name
);
if
(
username
!=
null
&&
!
""
.
equals
(
username
))
{
if
(!
ObjectUtils
.
isEmpty
(
departmentUserTreeAppVo
.
getName
())
&&
departmentUserTreeAppVo
.
getName
().
indexOf
(
username
)
!=
-
1
)
{
content
.
add
(
user
);
}
}
else
{
content
.
add
(
user
);
}
}
}
return
content
;
}
return
null
;
}
private
List
<
LinkedHashMap
<
String
,
Object
>>
filterUser
(
List
<
LinkedHashMap
<
String
,
Object
>>
tempChildren
,
String
userNmae
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
userList
=
new
ArrayList
<
LinkedHashMap
<
String
,
Object
>>();
if
(
ObjectUtils
.
isEmpty
(
tempChildren
))
{
return
userList
;
}
userList
.
forEach
((
item
)
->
{
if
(!
ObjectUtils
.
isEmpty
(
userNmae
)
&&
item
.
get
(
"label"
).
toString
().
indexOf
(
userNmae
)
!=
-
1
)
{
userList
.
add
(
item
);
}
});
return
userList
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"用户登录成功之后数据初始化(<font color='blue'>手机app</font>)"
,
notes
=
"用户登录成功之后数据初始化"
)
@RequestMapping
(
value
=
"/initData"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
initUserApp
()
{
try
{
CommonResponse
secResponse
=
remoteSecurityService
.
searchPermissionTree
(
getToken
(),
getProduct
(),
getAppKey
(),
appType
);
if
(!
secResponse
.
isSuccess
())
{
return
CommonResponseUtil
.
failure
(
"权限获取失败"
);
}
List
<
LinkedHashMap
<
String
,
Object
>>
response
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
resp
=
new
HashMap
<>();
resp
.
put
(
"permissionitems"
,
secResponse
.
getDataList
());
resp
.
put
(
"companys"
,
response
);
return
CommonResponseUtil
.
success
(
resp
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
"数据初始化失败"
);
}
}
/**
* 递归调用获取list中的末端节点
*
* @param src
* @return
*/
private
List
<
LinkedHashMap
<
String
,
Object
>>
getLeaves
(
List
<
LinkedHashMap
<
String
,
Object
>>
src
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
dest
=
new
ArrayList
<>();
for
(
LinkedHashMap
<
String
,
Object
>
leaves
:
src
)
{
if
(
ObjectUtils
.
isEmpty
(
leaves
.
get
(
"children"
)))
{
dest
.
add
(
leaves
);
}
else
{
List
<
LinkedHashMap
<
String
,
Object
>>
list
=
getLeaves
((
List
<
LinkedHashMap
<
String
,
Object
>>)
leaves
.
get
(
"children"
));
dest
.
addAll
(
list
);
}
}
return
dest
;
}
///////////////////////////////2019-11-18安全服务升级///////////////////////////////
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"通讯录"
,
notes
=
"通讯录"
)
@RequestMapping
(
value
=
"/mobile/addressList"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
addressList
()
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
CompanyBo
companyBo
=
reginParams
.
getCompany
();
JSONArray
arr
=
remoteSecurityService
.
listDepartmentUserTree
(
getToken
(),
getProduct
(),
getAppKey
(),
companyBo
.
getSequenceNbr
().
toString
());
DepartmentUserTreeAppVo
departmentUserTreeDto
=
new
DepartmentUserTreeAppVo
();
if
(
arr
!=
null
&&
arr
.
size
()
>
0
)
{
buildUserDeptTree
(
departmentUserTreeDto
,
arr
);
}
return
CommonResponseUtil
.
success
(
departmentUserTreeDto
.
getChildren
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"通讯录异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
private
void
buildUserDeptTree
(
DepartmentUserTreeAppVo
deptUser
,
JSONArray
childs
)
{
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
JSONObject
json
=
childs
.
getJSONObject
(
i
);
DepartmentUserTreeAppVo
treeDto
=
new
DepartmentUserTreeAppVo
();
treeDto
.
setName
(
json
.
getString
(
"departmentName"
));
treeDto
.
setId
(
json
.
getString
(
"sequenceNbr"
));
treeDto
.
setType
(
json
.
getString
(
"level"
));
JSONArray
childrens
=
json
.
getJSONArray
(
"children"
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
)
{
buildUserDeptTree
(
treeDto
,
childrens
);
}
JSONArray
userModelList
=
json
.
getJSONArray
(
"userModelList"
);
if
(
userModelList
!=
null
&&
userModelList
.
size
()
>
0
)
{
List
<
HashMap
>
modelList
=
JSONObject
.
parseArray
(
userModelList
.
toJSONString
(),
HashMap
.
class
);
modelList
=
modelList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
userModelList
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
modelList
));
UserDeptTree
(
treeDto
,
userModelList
);
}
deptUser
.
getChildren
().
add
(
treeDto
);
}
}
//部门下用户
private
void
UserDeptTree
(
DepartmentUserTreeAppVo
deptUser
,
JSONArray
childs
)
{
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
JSONObject
json
=
childs
.
getJSONObject
(
i
);
DepartmentUserTreeAppVo
treeDto
=
new
DepartmentUserTreeAppVo
();
treeDto
.
setName
(
json
.
getString
(
"realName"
));
treeDto
.
setId
(
json
.
getString
(
"userId"
));
//treeDto.setType(json.getString("level"));
treeDto
.
setType
(
"user"
);
// JSONObject object = json.getJSONObject("object");
Map
<
String
,
String
>
user
=
Maps
.
newHashMap
();
user
.
put
(
"mobile"
,
json
.
getString
(
"mobile"
));
user
.
put
(
"telephone"
,
json
.
getString
(
"landlinePhone"
));
user
.
put
(
"email"
,
json
.
getString
(
"email"
));
treeDto
.
setObject
(
user
);
deptUser
.
getChildren
().
add
(
treeDto
);
}
}
/**
* APP登录
*/
@ApiOperation
(
value
=
"APP登录"
,
notes
=
"APP登录"
)
@PostMapping
(
value
=
"/mobile/login"
)
public
CommonResponse
mobileLogin
(
@ApiParam
(
value
=
"账号"
,
required
=
true
)
@RequestBody
AppLoginUserParam
param
)
{
try
{
JSONObject
jsonObject
=
null
;
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
param
.
getUserName
());
dPasswordAuthModel
.
setPassword
(
DesUtil
.
decode
(
param
.
getPassword
(),
"yeejoin"
));
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"product"
,
productApp
);
HttpEntity
httpEntity
=
new
HttpEntity
<>(
dPasswordAuthModel
,
headers
);
FeignClientResult
feignClientResult
=
restTemplate
.
postForObject
(
"http://"
+
SecurityName
+
"/privilege/v1/auth/idpassword"
,
httpEntity
,
FeignClientResult
.
class
);
if
(
feignClientResult
.
getStatus
()
==
200
)
{
Map
map
=
(
Map
)
feignClientResult
.
getResult
();
map
.
put
(
"appKey"
,
appKey
);
map
.
put
(
"product"
,
productApp
);
String
jsonStr
=
JSON
.
toJSONString
(
map
);
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
}
else
{
return
CommonResponseUtil
.
failure
(
feignClientResult
.
getMessage
());
}
if
(
jsonObject
!=
null
)
{
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"token"
,
jsonObject
.
getString
(
"token"
));
result
.
put
(
"userId"
,
jsonObject
.
getString
(
"userId"
));
result
.
put
(
"appKey"
,
jsonObject
.
getString
(
"appKey"
));
result
.
put
(
"product"
,
jsonObject
.
getString
(
"product"
));
result
.
put
(
"jpushUserKey"
,
param
.
getUserName
());
// //删除别名关联设备
// CommonResponse commonResponse=PushFeign.PushDevice(appMessagePushService.buildJpushUserKey(jsonObject.getString("userId")));
return
CommonResponseUtil
.
success
(
result
);
}
return
CommonResponseUtil
.
failure
(
"登录失败"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"APP登录异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
/**
* APP登出
*/
@ApiOperation
(
value
=
"APP登出"
,
notes
=
"APP登出"
)
@PostMapping
(
value
=
"/mobile/loginOut"
)
public
CommonResponse
mobileLoginOut
()
{
try
{
// if (remoteSecurityService.loginOutFromApp(getToken(), getProduct(), getAppKey())) {
// return CommonResponseUtil.success();
// } else {
// return CommonResponseUtil.failure("APP登出失败");
// }
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"APP登出异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
/**
* 获取公司选择信息
*/
@ApiOperation
(
value
=
"获取公司选择信息"
,
notes
=
"获取公司选择信息"
)
@GetMapping
(
value
=
"/selectInfo"
)
public
CommonResponse
selectInfo
()
{
try
{
JSONObject
result
=
new
JSONObject
();
AgencyUserModel
user
=
getUserInfo
();
if
(
user
!=
null
)
{
List
<
CompanyModel
>
list
=
user
.
getCompanys
().
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
CompanyModel:
:
getSequenceNbr
))),
ArrayList:
:
new
));
Map
<
Long
,
List
<
DepartmentModel
>>
mapDepartments
=
user
.
getCompanyDepartments
();
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
mapdate
=
new
HashMap
<
String
,
List
<
Map
<
String
,
Object
>>>();
List
<
Map
>
listCompanyModel
=
new
ArrayList
();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
CompanyModel
article
:
list
)
{
Map
<
String
,
Object
>
map
=
objectToMap
(
article
);
map
.
put
(
"companySeq"
,
map
.
get
(
"companySeq"
)
+
""
);
map
.
put
(
"parentId"
,
map
.
get
(
"parentId"
)
+
""
);
listCompanyModel
.
add
(
map
);
long
key
=
Long
.
valueOf
(
map
.
get
(
"sequenceNbr"
).
toString
());
List
<
DepartmentModel
>
listdep
=
mapDepartments
.
get
(
key
);
List
<
Map
<
String
,
Object
>>
dep
=
new
ArrayList
();
for
(
DepartmentModel
departmentModel
:
listdep
)
{
if
(
departmentModel
!=
null
)
{
Map
<
String
,
Object
>
mapo
=
objectToMap
(
departmentModel
);
mapo
.
put
(
"sequenceNbr"
,
mapo
.
get
(
"sequenceNbr"
).
toString
());
dep
.
add
(
mapo
);
}
}
mapdate
.
put
(
map
.
get
(
"sequenceNbr"
).
toString
(),
dep
);
}
}
result
.
put
(
"companys"
,
listCompanyModel
);
result
.
put
(
"orgRoles"
,
user
.
getOrgRoles
());
result
.
put
(
"companyDepartments"
,
mapdate
);
return
CommonResponseUtil
.
success
(
result
);
}
return
CommonResponseUtil
.
failure
(
"请重新登录"
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取公司选择信息异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
//对象转map
public
static
Map
<
String
,
Object
>
objectToMap
(
Object
obj
)
throws
IllegalAccessException
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
if
(
obj
!=
null
)
{
Class
<?>
clazz
=
obj
.
getClass
();
for
(
Field
field
:
clazz
.
getDeclaredFields
())
{
field
.
setAccessible
(
true
);
String
fieldName
=
field
.
getName
();
Object
value
=
nvl
(
field
.
get
(
obj
));
map
.
put
(
fieldName
,
value
);
}
return
map
;
}
return
map
;
}
public
static
Object
nvl
(
Object
param
)
{
return
param
!=
null
?
param
:
""
;
}
/**
* 保存登陆用户选择公司信息
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存登陆用户选择公司信息"
,
notes
=
"保存登陆用户选择公司信息"
)
@PostMapping
(
value
=
"/save/curCompany"
)
public
CommonResponse
saveCurCompany
(
@ApiParam
(
value
=
"当前登陆用户所选单位机构编号"
,
required
=
true
)
@RequestBody
ReginParams
reginParams
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
// saveSelectedOrgInfo(reginParams);
return
CommonResponseUtil
.
success
(
buildCurCompany
(
getToken
(),
getProduct
(),
getAppKey
(),
reginParams
,
user
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"保存登陆用户选择公司信息异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
private
JSONObject
buildCurCompany
(
String
toke
,
String
product
,
String
appKey
,
ReginParams
reginParams
,
AgencyUserModel
user
)
{
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"userId"
,
user
.
getUserId
());
result
.
put
(
"realName"
,
user
.
getRealName
());
result
.
put
(
"userMobile"
,
user
.
getMobile
());
result
.
put
(
"userName"
,
user
.
getUserName
());
result
.
put
(
"email"
,
user
.
getEmail
());
CommonResponse
secResponse
=
remoteSecurityService
.
searchPermissionTree
(
Long
.
valueOf
(
reginParams
.
getRole
().
getSequenceNbr
()),
toke
,
product
,
appKey
,
appType
);
if
(
secResponse
.
isSuccess
()
&&
secResponse
.
getDataList
()
!=
null
)
{
JSONArray
arr
=
JSON
.
parseArray
(
JSONArray
.
toJSONString
(
secResponse
.
getDataList
()));
Map
<
String
,
JSONObject
>
map
=
Maps
.
newHashMap
();
if
(
arr
!=
null
&&
arr
.
size
()
>
0
)
{
JSONObject
obj
=
arr
.
getJSONObject
(
0
);
if
(
obj
!=
null
)
{
JSONArray
childrens
=
obj
.
getJSONArray
(
"children"
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
childrens
.
size
();
i
++)
{
JSONObject
child
=
childrens
.
getJSONObject
(
i
);
map
.
put
(
child
.
getString
(
"path"
),
child
);
}
}
}
List
<
String
>
userHaveToDo
=
iAppService
.
getHaveToDoList
(
user
.
getUserId
());
result
.
put
(
"userHaveToDo"
,
userHaveToDo
);
result
.
put
(
"userPower"
,
map
.
get
(
"appPower"
));
result
.
put
(
"userShow"
,
map
.
get
(
"appMenu"
));
}
}
result
.
put
(
"companyModel"
,
reginParams
.
getCompany
());
result
.
put
(
"departmentModel"
,
reginParams
.
getDepartment
());
result
.
put
(
"roleModel"
,
reginParams
.
getRole
());
return
result
;
}
/**
* 装备登录返回巡检统计信息
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"装备登录返回巡检统计信息"
,
notes
=
"装备登录返回巡检统计信息"
)
@GetMapping
(
value
=
"/patrolCount"
)
public
CommonResponse
getPatrolCount
()
{
try
{
AgencyUserModel
user
=
getUserInfo
();
List
<
String
>
userHaveToDo
=
iAppService
.
getHaveToDoList
(
user
.
getUserId
());
return
CommonResponseUtil
.
success
(
userHaveToDo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"保存登陆用户选择公司信息异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
/**
* 修改密码
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
" 修改密码"
,
notes
=
" 修改密码"
)
@GetMapping
(
value
=
"/editPassword"
)
public
CommonResponse
editPassword
(
@ApiParam
(
value
=
"旧密码"
,
required
=
true
)
@RequestParam
String
password
,
@ApiParam
(
value
=
"新密码"
,
required
=
true
)
@RequestParam
String
newPassword
)
{
AgencyUserModel
userModel
=
getUserInfo
();
boolean
flag
=
false
;
if
(
password
.
equals
(
newPassword
))
{
return
CommonResponseUtil
.
failure
(
"新密码不能跟旧密码相同!"
);
}
try
{
//flag=remoteSecurityService.editPassword(getToken(), getProduct(), getAppKey(), userModel.getUserId(), password, newPassword);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setPassword
(
newPassword
);
agencyUserModel
.
setRePassword
(
newPassword
);
agencyUserModel
.
setOriginalPassword
(
password
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"product"
,
getProduct
());
headers
.
set
(
"token"
,
getToken
());
headers
.
set
(
"appKey"
,
getAppKey
());
HttpEntity
httpEntity
=
new
HttpEntity
<>(
agencyUserModel
,
headers
);
ResponseEntity
<
FeignClientResult
>
feignClientResult
=
restTemplate
.
exchange
(
"http://"
+
SecurityName
+
"/privilege/v1/agencyuser/"
+
userModel
.
getUserId
()
+
"/password"
,
HttpMethod
.
PUT
,
httpEntity
,
FeignClientResult
.
class
);
if
(
feignClientResult
.
getBody
().
getStatus
()
==
200
)
{
CommonResponse
dates
=
CommonResponseUtil
.
success
();
dates
.
setMessage
(
"修改成功!"
);
return
dates
;
}
else
{
return
CommonResponseUtil
.
failure
(
feignClientResult
.
getBody
().
getMessage
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"修改密码异常"
,
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PersonIdentify
(
isNeedIdentity
=
true
)
@PersonIdentify
@ApiOperation
(
value
=
"获取人员身份信息"
,
notes
=
" 获取人员身份信息"
)
@GetMapping
(
value
=
"/identify"
)
public
CommonResponse
personIdentity
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/repository/AppVersionDao.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
repository
;
import
org.springframework.data.jpa.repository.Query
;
import
com.yeejoin.amos.maintenance.dao.entity.AppVersion
;
public
interface
AppVersionDao
extends
BaseDao
<
AppVersion
,
Long
>{
@Query
(
value
=
"SELECT * FROM p_app_version v ORDER BY v.id DESC LIMIT 0,1"
,
nativeQuery
=
true
)
AppVersion
findLastVersion
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/repository/IConfigDao.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
repository
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.maintenance.dao.entity.Config
;
@Repository
(
"configDao"
)
public
interface
IConfigDao
extends
BaseDao
<
Config
,
Long
>{
List
<
Config
>
findAll
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/PlanTaskPointInputItemBo.java
View file @
4bb03dbc
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author DELL
*/
@Data
public
class
PlanTaskPointInputItemBo
{
/**
...
...
@@ -66,152 +72,31 @@ public class PlanTaskPointInputItemBo {
private
Long
classifyId
;
//新增执行部门
/**
* 执行部门
*/
private
String
depId
;
//执行人名称
/**
* 执行人名称
*/
private
String
userName
;
//执行部门名称
private
String
depName
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getDepName
()
{
return
depName
;
}
public
void
setDepName
(
String
depName
)
{
this
.
depName
=
depName
;
}
public
Long
getInputItemId
()
{
return
inputItemId
;
}
public
void
setInputItemId
(
Long
inputItemId
)
{
this
.
inputItemId
=
inputItemId
;
}
public
int
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
int
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
public
long
getPointId
()
{
return
pointId
;
}
public
void
setPointId
(
long
pointId
)
{
this
.
pointId
=
pointId
;
}
public
long
getPlanTaskId
()
{
return
planTaskId
;
}
public
void
setPlanTaskId
(
long
planTaskId
)
{
this
.
planTaskId
=
planTaskId
;
}
public
long
getRouteId
()
{
return
routeId
;
}
public
void
setRouteId
(
long
routeId
)
{
this
.
routeId
=
routeId
;
}
public
long
getPlanId
()
{
return
planId
;
}
public
void
setPlanId
(
long
planId
)
{
this
.
planId
=
planId
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
long
getRoutePointItemId
()
{
return
routePointItemId
;
}
public
void
setRoutePointItemId
(
long
routePointItemId
)
{
this
.
routePointItemId
=
routePointItemId
;
}
public
long
getPlanTaskDetailId
()
{
return
planTaskDetailId
;
}
public
void
setPlanTaskDetailId
(
long
planTaskDetailId
)
{
this
.
planTaskDetailId
=
planTaskDetailId
;
}
public
String
getClassifyName
()
{
return
classifyName
;
}
public
void
setClassifyName
(
String
classifyName
)
{
this
.
classifyName
=
classifyName
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
String
getInputName
()
{
return
inputName
;
}
public
void
setInputName
(
String
inputName
)
{
this
.
inputName
=
inputName
;
}
public
String
getDepId
()
{
return
depId
;
}
/**
* 执行部门名称
*/
private
String
depName
;
public
void
setDepId
(
String
depId
)
{
this
.
depId
=
depId
;
}
/**
* 冗余字段:点名称
*/
private
String
pointName
;
/**
* 冗余字段:路线名称
*/
private
String
routeName
;
/**
* 冗余字段:计划名称
*/
private
String
planName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/EquipFeign.java
→
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/EquipFeign
Client
.java
View file @
4bb03dbc
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
//装备
@FeignClient
(
name
=
"${equip.fegin.name}"
)
public
interface
EquipFeign
{
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/equipSpecific/getSourceNameByEquipSpeId"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipDetail
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
Long
id
);
/**
* @author DELL
*/
//装备
@FeignClient
(
name
=
"${equip.feign.name}"
)
public
interface
EquipFeignClient
{
String
PREFIX
=
"${equip.feign.prefix}"
;
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/equipSpecific/getSourceNameList"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
PREFIX
+
"/equipSpecific/getSourceNameByEquipSpeId"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipDetail
(
@RequestParam
(
value
=
"id"
)
Long
id
);
@RequestMapping
(
value
=
PREFIX
+
"/equipSpecific/getSourceNameList"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getEquipList
(
@RequestBody
Long
id
);
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/warehouse-structure/listAll"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
PREFIX
+
"/warehouse-structure/listAll"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
String
getStructureNameAll
();
/**
...
...
@@ -24,10 +30,10 @@ public interface EquipFeign {
*
* @return
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
PREFIX
+
"/building/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getBuildingTree
();
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/building/getBuildingAbsolutePosition"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
PREFIX
+
"/building/getBuildingAbsolutePosition"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getBuildingAbsolutePosition
();
/**
...
...
@@ -35,7 +41,7 @@ public interface EquipFeign {
*
* @return
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
PREFIX
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
/**
...
...
@@ -45,7 +51,7 @@ public interface EquipFeign {
* @param id
* @return
*/
@GetMapping
(
value
=
"${equip.fegin.prefix}+
/maintenanceResourceData/getFireFacilityList"
)
List
<
Map
<
String
,
Object
>>
overTimeMaintenanceFacility
(
@RequestParam
String
type
,
@RequestParam
String
id
);
@GetMapping
(
value
=
PREFIX
+
"
/maintenanceResourceData/getFireFacilityList"
)
ResponseModel
<
List
<
Map
<
String
,
Object
>
>>
overTimeMaintenanceFacility
(
@RequestParam
String
type
,
@RequestParam
String
id
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/AppServiceImpl.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.maintenance.business.dao.repository.AppVersionDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao
;
import
com.yeejoin.amos.maintenance.business.param.UserMsgInitParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IAppService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService
;
import
com.yeejoin.amos.maintenance.common.enums.MsgSubscribeTypeEnum
;
import
com.yeejoin.amos.maintenance.dao.entity.AppVersion
;
import
com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
(
"iAppService"
)
public
class
AppServiceImpl
implements
IAppService
{
@Autowired
private
IMsgSubscribeDao
msgSubscribeDao
;
@Autowired
private
AppVersionDao
appVersionDao
;
@Autowired
private
IMsgSubscribeService
msgSubscribeService
;
@Autowired
private
PlanTaskMapper
planTaskMapper
;
@Override
public
AppVersion
queryAppLastVersion
()
{
// TODO Auto-generated method stub
return
appVersionDao
.
findLastVersion
();
}
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public
List
<
MsgSubscribe
>
saveUserMsgInit
(
UserMsgInitParam
userInitParam
)
{
Long
count
=
msgSubscribeDao
.
countByUserId
(
userInitParam
.
getUserId
());
if
(
count
>
0
)
{
// 已存在用户订阅,直接返回
return
msgSubscribeService
.
queryMsgSubscribes
(
userInitParam
.
getUserId
());
}
List
<
MsgSubscribe
>
msgConfigs
=
new
ArrayList
<
MsgSubscribe
>();
for
(
MsgSubscribeTypeEnum
type
:
MsgSubscribeTypeEnum
.
values
())
{
MsgSubscribe
msgSub
=
new
MsgSubscribe
();
msgSub
.
setOrgCode
(
userInitParam
.
getOrgCode
());
msgSub
.
setUserId
(
userInitParam
.
getUserId
());
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANBEGIN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANWARN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANEND
))
{
msgSub
.
setAttribute1
(
"False"
);
msgSub
.
setAttribute2
(
10
+
""
);
}
else
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKTYPE
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKEMAIL
))
{
msgSub
.
setAttribute1
(
"error"
);
}
msgSub
.
setMsgType
(
type
.
getName
());
msgSubscribeDao
.
saveAndFlush
(
msgSub
);
msgConfigs
.
add
(
msgSub
);
}
return
msgConfigs
;
}
@Override
public
List
<
String
>
getHaveToDoList
(
String
userId
)
{
int
taskCount
=
planTaskMapper
.
getCurrentPlanTaskCount
(
userId
);
List
<
String
>
havetoDoList
=
Lists
.
newArrayList
();
if
(
taskCount
>
0
)
{
havetoDoList
.
add
(
"planPatrol"
);
}
return
havetoDoList
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/CheckServiceImpl.java
View file @
4bb03dbc
...
...
@@ -21,7 +21,7 @@ import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import
com.yeejoin.amos.maintenance.business.dto.CheckRecordDto
;
import
com.yeejoin.amos.maintenance.business.dto.CheckShotDto
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.*
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
Client
;
import
com.yeejoin.amos.maintenance.business.param.*
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ICheckService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IEquipmentHandlerService
;
...
...
@@ -246,8 +246,8 @@ public class CheckServiceImpl implements ICheckService {
//6.消息广播最近维保日期
if
(
StringUtil
.
isNotEmpty
(
point
.
getOriginalId
())){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"facilityId"
,
point
.
getOriginalId
());
jsonObject
.
put
(
"
check
Time"
,
check
.
getCheckTime
());
jsonObject
.
put
(
"f
ireF
acilityId"
,
point
.
getOriginalId
());
jsonObject
.
put
(
"
maintenance
Time"
,
check
.
getCheckTime
());
mqttGateway
.
publish
(
CHECK_UPDATE_TOPIC
,
jsonObject
.
toJSONString
());
}
//7.返回不合格记录
...
...
@@ -950,7 +950,7 @@ public class CheckServiceImpl implements ICheckService {
}
@Autowired
private
EquipFeign
equipment
;
private
EquipFeign
Client
equipment
;
@Override
public
List
<
HashMap
<
String
,
Object
>>
getEquipByCheckId
(
CheckDetailInputPageParam
param
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/MessageServiceImpl.java
View file @
4bb03dbc
...
...
@@ -23,7 +23,7 @@ import com.yeejoin.amos.maintenance.business.dao.repository.IMsgDao;
import
com.yeejoin.amos.maintenance.business.dao.repository.IPlanTaskDetailDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IPointDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IRouteDao
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
Client
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IMessageService
;
import
com.yeejoin.amos.maintenance.business.util.StringUtil
;
import
com.yeejoin.amos.maintenance.business.vo.MsgVo
;
...
...
@@ -106,7 +106,7 @@ public class MessageServiceImpl implements IMessageService {
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Override
public
void
pushCheckMessage
(
String
toke
,
String
product
,
String
appKey
,
Long
checkId
)
{
try
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
View file @
4bb03dbc
...
...
@@ -14,7 +14,7 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import
com.yeejoin.amos.maintenance.business.dao.repository.*
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.PointCheckDetailBo
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
Client
;
import
com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam
;
import
com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ICheckService
;
...
...
@@ -81,7 +81,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private
ICheckService
checkService
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
IPointDao
iPointDao
;
...
...
@@ -117,17 +117,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
//3.计算生成数据的日期区间(前10位:yyyy-MM-dd)
CalDateVo
vo
=
PlanTaskUtil
.
reGenPlanTaskData
(
plan
,
strBeginDate
,
strEndDate
);
if
(
null
==
vo
)
{
//计划未开始,则结束
//计划未开始,则结束
if
(
null
==
vo
)
{
return
;
}
if
(!
vo
.
getIsGenData
())
{
//日期不符合条件直接结束
//日期不符合条件直接结束
if
(!
vo
.
getIsGenData
())
{
return
;
}
//
3
.删除planTask表,按照计划id+日期
//
4
.删除planTask表,按照计划id+日期
deletePlanTaskAndDet
(
param
);
//5.执行数据生成(具体时间 + 人员)
...
...
@@ -135,68 +134,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
//6.插入planTask及planTaskDetail
insertPlanTaskAndDet
(
list
,
plan
,
flag
,
new
Date
());
//7.重新统计计划
if
(
ObjectUtils
.
isEmpty
(
plan
.
getUserId
()))
{
return
;
}
reformStatisticsPlanTask
(
strBeginDate
,
strEndDate
,
plan
.
getUserId
(),
plan
.
getOrgCode
());
}
}
@Override
public
void
reformStatisticsPlanTask
(
String
strBginDate
,
String
strEndDate
,
String
userId
,
String
orgCode
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
startTime
=
sdf
.
parse
(
strBginDate
);
Date
endTime
=
sdf
.
parse
(
strEndDate
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
startTime
);
Date
currentDate
=
new
Date
();
String
strCurrentDate
=
sdf
.
format
(
currentDate
);
long
abortTime
=
endTime
.
getTime
();
if
(
endTime
.
getTime
()
>=
sdf
.
parse
(
strCurrentDate
).
getTime
())
{
abortTime
=
sdf
.
parse
(
strCurrentDate
).
getTime
();
}
String
[]
ids
=
userId
.
split
(
","
);
// StringBuffer orgCodeBuffer = new StringBuffer();
// Map<String,String> deptMap =new HashMap<>();
// Set<Object> userIds =new HashSet<>();
// for (int i = 0; i <ids.length ; i++) {
// userIds.add(ids[i].toString());
// }
// Map<String,AgencyUserModel> agencyUserModelMap = remoteSecurityService.getUsersMap(toke.getToke(),toke.getProduct(),toke.getAppKey(),userIds);
// List<Map<String, String>> idOrgCodeList = new ArrayList<>();
// for(Map.Entry<String, AgencyUserModel> entry : agencyUserModelMap.entrySet()){
// String id = entry.getKey();
// AgencyUserModel agencyUserModels = entry.getValue();
// StringBuffer agencyUserOrgcode = new StringBuffer();
// if(agencyUserModelMap.size() > 0){
// agencyUserModels.getCompanys().forEach(companyModel -> {
// agencyUserOrgcode.append(companyModel.getOrgCode()).append(",");
// });
// }
// Map<String,String> map = new HashMap<>();
// map.put(id,agencyUserOrgcode.toString().substring(0,agencyUserOrgcode.length()-1));
// }
//
// Map<String, String> userIdOrgCodeMap = new HashMap<>(ids.length);
// if (!CollectionUtils.isEmpty(idOrgCodeList)) {
// userIdOrgCodeMap = idOrgCodeList.stream().collect(Collectors.toMap(x-> String.valueOf(x.get(
// "id")), x->x.get("org_code")));
// }
while
(
cal
.
getTime
().
getTime
()
<=
abortTime
)
{
String
refDate
=
sdf
.
format
(
cal
.
getTime
());
for
(
String
id
:
ids
)
{
if
(!
ObjectUtils
.
isEmpty
(
id
))
{
planTaskMapper
.
reformStatistics
(
id
,
refDate
,
orgCode
);
// planTaskMapper.reformStatistics(id, refDate, userIdOrgCodeMap.get(id));
}
}
cal
.
add
(
Calendar
.
DATE
,
1
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -514,8 +454,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
jobService
.
planTaskAddJob
(
planTask
);
}
// 3.如果为自动任务调用,则更新id,如果重做或且下次时间大于等于明天,则更新planTaskId到plan表
Date
genDate
=
DateUtil
.
str2Date
(
list
.
get
(
list
.
size
()
-
1
).
get
(
"NEXT_GEN_DATE"
).
toString
(),
"yyyy-MM-dd"
);
//下次生成日期
// 3.如果为自动任务调用,则更新id,如果重做或且下次时间大于等于明天,则更新planTaskId到plan表
,下次生成日期
Date
genDate
=
DateUtil
.
str2Date
(
list
.
get
(
list
.
size
()
-
1
).
get
(
"NEXT_GEN_DATE"
).
toString
(),
"yyyy-MM-dd"
);
//明天
Date
tomorrow
=
DateUtil
.
getIntervalDate
(
now
,
1
);
String
strGenDate
=
list
.
get
(
list
.
size
()
-
1
).
get
(
"NEXT_GEN_DATE"
).
toString
().
substring
(
0
,
10
);
...
...
@@ -523,17 +463,21 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
paramMap
.
put
(
"id"
,
plan
.
getId
());
paramMap
.
put
(
"next_gen_date"
,
strGenDate
);
if
(
XJConstant
.
SCHED_FLAG
.
equals
(
flag
))
{
paramMap
.
put
(
"plan_task_id"
,
0
);
//修改为初始值
//修改为初始值
paramMap
.
put
(
"plan_task_id"
,
0
);
paramMap
.
put
(
"first_flag"
,
XJConstant
.
PLAN_FIRST_STATUS_NO
);
}
else
if
(!
XJConstant
.
SCHED_FLAG
.
equals
(
flag
)
&&
(
genDate
.
getTime
()
-
tomorrow
.
getTime
()
>=
0
)
&&
XJConstant
.
FIX_DATE_NO
.
equals
(
plan
.
getIsFixedDate
()))
{
//更新日期及plantaskId到plan表
}
else
if
(
genDate
.
getTime
()
-
tomorrow
.
getTime
()
>=
0
&&
XJConstant
.
FIX_DATE_NO
.
equals
(
plan
.
getIsFixedDate
()))
{
//更新日期及plantaskId到plan表
long
planTaskId
=
iplanTaskDao
.
findMaxIdByBatchNo
(
batchNo
);
paramMap
.
put
(
"plan_task_id"
,
planTaskId
);
// 更新新的任务id到plan
// 更新新的任务id到plan
paramMap
.
put
(
"plan_task_id"
,
planTaskId
);
paramMap
.
put
(
"first_flag"
,
XJConstant
.
PLAN_FIRST_STATUS_NO
);
}
if
(
DateUtil
.
str2Date
(
strGenDate
,
"yyyy-MM-dd"
).
getTime
()
-
now
.
getTime
()
<
0
||
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
strGenDate
))
{
paramMap
.
put
(
"next_gen_date"
,
DateUtil
.
formatDatrToStr
(
now
,
"yyyy-MM-dd"
));
}
planMapper
.
updPlanStatusOrGenDate
(
paramMap
);
// 更新下次任务生成日期
// 更新下次任务生成日期
planMapper
.
updPlanStatusOrGenDate
(
paramMap
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -542,8 +486,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Override
public
List
<
PlanTask
>
getPlanTaskByRouteId
(
Long
routeId
)
{
List
<
PlanTask
>
planTaskList
=
planTaskMapper
.
getPlanTaskByRouteId
(
routeId
);
return
planTaskList
;
return
planTaskMapper
.
getPlanTaskByRouteId
(
routeId
);
}
@Override
...
...
@@ -578,11 +521,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public
int
getCurrentPlanTaskCount
(
String
userId
)
{
return
planTaskMapper
.
getCurrentPlanTaskCount
(
userId
);
}
@Override
public
List
<
PlanTaskVo
>
getPlanTaskListByIds
(
String
toke
,
String
product
,
String
appKey
,
Long
[]
ids
)
{
List
<
PlanTaskVo
>
content
=
planTaskMapper
.
getPlanTaskListByIds
(
ids
);
...
...
@@ -717,153 +655,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return
result
;
}
@Override
public
Map
<
String
,
Object
>
getPlanTaskStatisticsForApp
(
HashMap
<
String
,
Object
>
params
)
{
return
planTaskMapper
.
getPlanTaskStatisticsForApp
(
params
);
}
@Override
public
AppPointCheckRespone
queryPointPlanTaskDetail
(
String
toke
,
String
product
,
String
appKey
,
Long
planTaskId
,
Long
pointId
)
{
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
Check
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
planTaskId
,
pointId
);
if
(
check
!=
null
)
{
pointCheckRespone
=
checkService
.
queryCheckPointDetail
(
toke
,
product
,
appKey
,
check
.
getId
());
}
else
{
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
if
(
planPointInfo
!=
null
)
{
List
<
String
>
userIds
=
Arrays
.
asList
(
planPointInfo
.
getUsername
().
split
(
","
));
List
<
AgencyUserModel
>
userModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
planPointInfo
.
getUsername
());
Map
<
String
,
String
>
userModelMap
=
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
,
(
k1
,
k2
)
->
k2
));
if
(
userModelMap
!=
null
)
{
List
<
String
>
userNameList
=
new
ArrayList
<>();
for
(
String
userId
:
userIds
)
{
userNameList
.
add
(
userModelMap
.
get
(
userId
));
}
userNameList
.
remove
(
""
);
userNameList
.
remove
(
null
);
pointCheckRespone
.
setUsername
(
Joiner
.
on
(
","
).
join
(
userNameList
));
}
DepartmentModel
departmentBo
=
remoteSecurityService
.
getDepartmentByDeptId
(
toke
,
product
,
appKey
,
planPointInfo
.
getUsername
());
if
(
departmentBo
!=
null
)
{
pointCheckRespone
.
setDepartmentName
(
departmentBo
.
getDepartmentName
());
}
pointCheckRespone
.
setPointId
(
pointId
);
pointCheckRespone
.
setPointName
(
planPointInfo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
planPointInfo
.
getPointNo
());
pointCheckRespone
.
setPointStatus
(
"0"
);
pointCheckRespone
.
setPlanName
(
planPointInfo
.
getPlanName
());
List
<
PointCheckDetailBo
>
pointInputs
=
planTaskMapper
.
getPointInputByRouteIdAndPointId
(
planPointInfo
.
getRouteId
(),
planPointInfo
.
getPointId
());
JSONObject
appResponeMap
=
new
JSONObject
();
pointInputs
.
forEach
(
action
->
{
AppCheckInputRespone
input
=
new
AppCheckInputRespone
();
input
.
setInputName
(
action
.
getInputName
());
input
.
setCheckInputId
(
action
.
getCheckInputId
());
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setItemType
(
action
.
getItemType
());
input
.
setOrderNo
(
action
.
getOrderNo
());
input
.
setPictureJson
(
action
.
getPictureJson
());
input
.
setClassifyId
(
action
.
getClassifyId
());
input
.
setClassifyName
(
action
.
getClassifyName
());
String
key
=
ObjectUtils
.
isEmpty
(
action
.
getClassifyName
())
?
"其他"
:
action
.
getClassifyName
();
if
(
appResponeMap
.
containsKey
(
key
))
{
appResponeMap
.
getJSONArray
(
key
).
add
(
input
);
}
else
{
List
<
AppCheckInputRespone
>
appCheckInputResponeList
=
new
ArrayList
<
AppCheckInputRespone
>();
appCheckInputResponeList
.
add
(
input
);
appResponeMap
.
put
(
key
,
appCheckInputResponeList
);
}
});
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
}
else
{
return
null
;
}
}
return
pointCheckRespone
;
}
@Override
public
AppPointCheckRespone
queryPointPlanTaskDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
Long
planTaskId
,
Long
pointId
)
{
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
Check
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
planTaskId
,
pointId
);
if
(
check
!=
null
)
{
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
toke
,
product
,
appKey
,
check
.
getId
());
}
else
{
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
if
(
planPointInfo
!=
null
)
{
pointCheckRespone
.
setPointId
(
pointId
);
pointCheckRespone
.
setPointName
(
planPointInfo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
planPointInfo
.
getPointNo
());
pointCheckRespone
.
setPointStatus
(
"0"
);
pointCheckRespone
.
setPlanName
(
planPointInfo
.
getPlanName
());
List
<
AgencyUserModel
>
userModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
planPointInfo
.
getUserId
());
for
(
AgencyUserModel
userModel
:
userModelList
)
{
pointCheckRespone
.
setUsername
(
userModel
.
getRealName
());
}
// DepartmentModel departmentModel= remoteSecurityService.getDepartmentByDeptId(toke, product, appKey,planPointInfo.getCheckDepartmentId());
DepartmentModel
departmentModel
=
new
DepartmentModel
();
pointCheckRespone
.
setDepartmentName
(
departmentModel
.
getDepartmentName
());
List
<
PointCheckDetailBo
>
pointInputs
=
planTaskMapper
.
getPointInputByRouteIdAndPointId
(
planPointInfo
.
getRouteId
(),
planPointInfo
.
getPointId
());
JSONObject
appResponeMap
=
new
JSONObject
();
pointInputs
.
forEach
(
action
->
{
AppCheckInputRespone
input
=
new
AppCheckInputRespone
();
input
.
setInputName
(
action
.
getInputName
());
input
.
setCheckInputId
(
action
.
getCheckInputId
());
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setItemType
(
action
.
getItemType
());
input
.
setOrderNo
(
action
.
getOrderNo
());
input
.
setPictureJson
(
action
.
getPictureJson
());
input
.
setClassifyId
(
action
.
getClassifyId
());
input
.
setClassifyName
(
action
.
getClassifyName
());
String
classifyName
=
action
.
getClassifyName
();
if
(!
StringUtil
.
isNotEmpty
(
classifyName
))
{
classifyName
=
"其他"
;
}
String
riskDesc
=
action
.
getRiskDesc
();
if
(!
StringUtil
.
isNotEmpty
(
riskDesc
))
{
riskDesc
=
XJConstant
.
DEFAULT_RISKDESC
;
}
JSONObject
classifyJson
;
if
(
appResponeMap
.
containsKey
(
classifyName
))
{
classifyJson
=
appResponeMap
.
getJSONObject
(
classifyName
);
}
else
{
classifyJson
=
new
JSONObject
();
}
JSONArray
riskDescArr
;
if
(
classifyJson
.
containsKey
(
riskDesc
))
{
riskDescArr
=
classifyJson
.
getJSONArray
(
riskDesc
);
}
else
{
riskDescArr
=
new
JSONArray
();
}
riskDescArr
.
add
(
action
);
classifyJson
.
put
(
riskDesc
,
riskDescArr
);
appResponeMap
.
put
(
classifyName
,
classifyJson
);
});
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
}
else
{
return
null
;
}
}
return
pointCheckRespone
;
}
@Override
public
String
getCumulativePlanCountByOrgCode
(
String
loginOrgCode
)
{
return
planTaskMapper
.
getCumulativePlanCountByOrgCode
(
loginOrgCode
);
}
@Override
public
List
<
LeavePlanTaskVo
>
queryLeavePlanTask
(
HashMap
<
String
,
Object
>
params
)
{
return
planTaskMapper
.
queryLeavePlanTask
(
params
);
}
@Override
public
PlanTask
selectPlanTaskStatus
(
Long
id
)
{
...
...
@@ -880,121 +681,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planMapper
.
initUpdatePlanNextGenDate
();
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryPlanTaskTimeAxis
(
Long
userId
,
Integer
createDate
)
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"userId"
,
userId
);
String
endTime
=
DateUtil
.
getShortCurrentDate
();
;
String
beginTime
=
""
;
if
(
createDate
!=
null
&&
createDate
==
7
)
{
beginTime
=
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
7
,
"yyyy-MM-dd"
);
}
else
if
(
createDate
!=
null
&&
createDate
==
30
)
{
beginTime
=
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
30
,
"yyyy-MM-dd"
);
}
else
{
beginTime
=
DateUtil
.
getShortCurrentDate
();
}
params
.
put
(
"beginTime"
,
beginTime
+
" 00:00:00"
);
params
.
put
(
"endTime"
,
endTime
+
" 23:59:59"
);
List
<
Map
<
String
,
Object
>>
content
=
planTaskMapper
.
queryPlanTaskTimeAxis
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
content
.
forEach
(
e
->
{
String
id
=
e
.
get
(
"userId"
).
toString
();
if
(
StringUtil
.
isNotEmpty
(
id
))
{
userIds
.
add
(
id
);
}
});
Toke
toke
=
remoteSecurityService
.
getServerToken
();
List
<
AgencyUserModel
>
userModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
String
>
userModelMap
=
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
,
(
k1
,
k2
)
->
k2
));
content
.
forEach
(
e
->
{
StringBuffer
userNames
=
new
StringBuffer
();
List
<
String
>
userIds1
=
Arrays
.
asList
(
e
.
get
(
"userId"
).
toString
().
split
(
","
));
for
(
String
userId1
:
userIds1
)
{
userNames
.
append
(
userModelMap
.
get
(
userId1
)).
append
(
","
);
}
e
.
put
(
"userName"
,
userNames
.
substring
(
0
,
userNames
.
length
()
-
1
));
e
.
put
(
"beginTime"
,
DateUtil
.
formatDatrToStr
((
Date
)
e
.
get
(
"beginTime"
),
DateUtil
.
LONG_PATTERN
));
e
.
put
(
"endTime"
,
DateUtil
.
formatDatrToStr
((
Date
)
e
.
get
(
"endTime"
),
DateUtil
.
LONG_PATTERN
));
});
}
return
content
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
Long
userId
,
Integer
createDate
)
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"userId"
,
userId
);
String
endTime
=
DateUtil
.
getShortCurrentDate
();
;
String
beginTime
=
""
;
if
(
createDate
!=
null
&&
createDate
==
7
)
{
beginTime
=
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
7
,
"yyyy-MM-dd"
);
}
else
if
(
createDate
!=
null
&&
createDate
==
30
)
{
beginTime
=
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
30
,
"yyyy-MM-dd"
);
}
else
{
beginTime
=
DateUtil
.
getShortCurrentDate
();
}
params
.
put
(
"beginTime"
,
beginTime
+
" 00:00:00"
);
params
.
put
(
"endTime"
,
endTime
+
" 23:59:59"
);
String
structListString
=
equipFeign
.
getStructureNameAll
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
structListString
);
JSONArray
structList
=
jsonObject
.
getJSONArray
(
"result"
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
content
=
planTaskMapper
.
queryTimeAxis
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
content
.
forEach
(
e
->
{
String
id
=
e
.
get
(
"userId"
).
toString
();
if
(
StringUtil
.
isNotEmpty
(
id
))
{
userIds
.
add
(
id
);
}
});
Toke
toke
=
remoteSecurityService
.
getServerToken
();
List
<
AgencyUserModel
>
userModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
String
>
userModelMap
=
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
,
(
k1
,
k2
)
->
k2
));
content
.
forEach
(
e
->
{
StringBuffer
userNames
=
new
StringBuffer
();
List
<
String
>
userIds1
=
Arrays
.
asList
(
e
.
get
(
"userId"
).
toString
().
split
(
","
));
for
(
String
userId1
:
userIds1
)
{
userNames
.
append
(
userModelMap
.
get
(
userId1
)).
append
(
","
);
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
();
map
.
put
(
"userName"
,
userNames
.
substring
(
0
,
userNames
.
length
()
-
1
));
map
.
put
(
"beginTime"
,
DateUtil
.
formatDatrToStr
((
Date
)
e
.
get
(
"beginTime"
),
DateUtil
.
LONG_PATTERN
));
map
.
put
(
"endTime"
,
DateUtil
.
formatDatrToStr
((
Date
)
e
.
get
(
"endTime"
),
DateUtil
.
LONG_PATTERN
));
map
.
put
(
"leftName"
,
"巡检点"
);
map
.
put
(
"titleName"
,
userNames
.
substring
(
0
,
userNames
.
length
()
-
1
)
+
"-"
+
e
.
get
(
"name"
).
toString
()
+
"-"
+
e
.
get
(
"STATUS"
).
toString
());
String
structName
=
""
;
if
(!
StringUtils
.
isEmpty
(
e
.
get
(
"risk_source_id"
)))
{
for
(
int
i
=
0
;
i
<
structList
.
size
();
i
++)
{
if
(
structList
.
getJSONObject
(
i
).
get
(
"id"
).
equals
(
e
.
get
(
"risk_source_id"
)))
{
structName
=
structList
.
getJSONObject
(
i
).
get
(
"name"
).
toString
();
}
}
}
else
{
structName
=
"无"
;
}
if
(!
StringUtils
.
isEmpty
(
e
.
get
(
"executorDate"
)))
{
map
.
put
(
"firstPropsValue"
,
structName
+
"-"
+
e
.
get
(
"executorDate"
));
}
else
{
map
.
put
(
"firstPropsValue"
,
structName
+
"-无"
);
}
result
.
add
(
map
);
});
}
return
result
;
}
@Override
public
Map
<
String
,
Object
>
planTaskPointDetail
(
String
planTaskDetailId
,
String
routePointId
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PointServiceImpl.java
View file @
4bb03dbc
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -14,7 +13,7 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import
com.yeejoin.amos.maintenance.business.dao.repository.*
;
import
com.yeejoin.amos.maintenance.business.dto.PointDto
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckPtListBo
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
Client
;
import
com.yeejoin.amos.maintenance.business.param.*
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IPointService
;
import
com.yeejoin.amos.maintenance.business.util.DaoCriteria
;
...
...
@@ -92,7 +91,7 @@ public class PointServiceImpl implements IPointService {
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
EquipFeign
equipFeign
;
private
EquipFeign
Client
equipFeign
;
@Autowired
Sequence
sequence
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/StatisticsServiceImpl.java
View file @
4bb03dbc
...
...
@@ -2,14 +2,14 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
Client
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -24,7 +24,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
@Autowired
PlanTaskMapper
planTaskMapper
;
@Autowired
EquipFeign
equipFeign
;
EquipFeign
Client
equipFeign
;
@Override
public
Map
<
String
,
Object
>
taskStatusStatistics
(
ReginParams
.
PersonIdentity
opIdentifyInfo
,
String
orgCode
)
{
...
...
@@ -37,8 +37,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
resultMap
.
put
(
"waitExecuteTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
()));
// 超时任务数量
resultMap
.
put
(
"overTimeTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
()));
List
<
Map
<
String
,
Object
>>
overTimeFacility
=
new
ArrayList
<>(
);
//overTimeFacility = equipFeign.overTimeMaintenanceFacility(opIdentifyInfo.getIdentityType(),opIdentifyInfo.getCompanyId()
);
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
response
=
equipFeign
.
overTimeMaintenanceFacility
(
opIdentifyInfo
.
getIdentityType
(),
opIdentifyInfo
.
getCompanyId
()
);
List
<
Map
<
String
,
Object
>>
overTimeFacility
=
response
.
getResult
(
);
// 到期维保设备
resultMap
.
put
(
"overTimeFacility"
,
overTimeFacility
.
size
());
return
resultMap
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IAppService.java
deleted
100644 → 0
View file @
770be55d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
java.util.List
;
import
com.yeejoin.amos.maintenance.business.param.UserMsgInitParam
;
import
com.yeejoin.amos.maintenance.dao.entity.AppVersion
;
import
com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe
;
public
interface
IAppService
{
AppVersion
queryAppLastVersion
();
List
<
MsgSubscribe
>
saveUserMsgInit
(
UserMsgInitParam
userInitParam
);
List
<
String
>
getHaveToDoList
(
String
userId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IPlanTaskService.java
View file @
4bb03dbc
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo
;
import
com.yeejoin.amos.maintenance.business.
vo.CodeOrderVo
;
import
com.yeejoin.amos.maintenance.business.
vo.LeavePlanTaskVo
;
import
com.yeejoin.amos.maintenance.business.
param.CheckPtListPageParam
;
import
com.yeejoin.amos.maintenance.business.
param.PlanTaskPageParam
;
import
com.yeejoin.amos.maintenance.business.vo.PlanTaskVo
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.dao.entity.PlanTask
;
import
org.springframework.data.domain.Page
;
import
com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam
;
import
com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam
;
import
com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone
;
import
com.yeejoin.amos.maintenance.dao.entity.PlanTask
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
interface
IPlanTaskService
{
...
...
@@ -39,8 +35,10 @@ public interface IPlanTaskService {
* 执行计划导出
*/
List
<
PlanTaskVo
>
planTaskReport
(
String
toke
,
String
product
,
String
appKey
,
PlanTaskPageParam
params
);
/**
* 自动任务执行
*
* @param runDate
*/
void
taskExecution
(
String
runDate
);
...
...
@@ -61,10 +59,9 @@ public interface IPlanTaskService {
void
disablePlanTask
(
Long
[]
routeIds
);
/**
* 计划任务列表
*
* @param params
* @param page
* @return
...
...
@@ -74,19 +71,15 @@ public interface IPlanTaskService {
/**
* 根据计划ID获取所有的 任务计划巡检点
*
* @param param
* @return
*/
List
getPlanTaskPoints
(
Map
<
String
,
Object
>
param
);
/**
* 获取用户当前所有有的计划任务
* @param userId
* @return
*/
int
getCurrentPlanTaskCount
(
String
userId
);
/**
* 今日执行情况
*
* @param params
* @return
*/
...
...
@@ -94,43 +87,26 @@ public interface IPlanTaskService {
/**
* 根据id获取执行计划
*
* @param ids
* @return
*/
List
<
PlanTaskVo
>
getPlanTaskListByIds
(
String
toke
,
String
product
,
String
appKey
,
Long
[]
ids
);
/**
* 根据任务id点id 获取点详情
* @param planTaskId
* @param pointId
* @return
*/
AppPointCheckRespone
queryPointPlanTaskDetail
(
String
toke
,
String
product
,
String
appKey
,
Long
planTaskId
,
Long
pointId
);
AppPointCheckRespone
queryPointPlanTaskDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
Long
planTaskId
,
Long
pointId
);
Map
<
String
,
Object
>
getPlanTaskStatisticsForApp
(
HashMap
<
String
,
Object
>
params
);
List
<
PlanTaskVo
>
getPlanTaskListByIds
(
String
toke
,
String
product
,
String
appKey
,
Long
[]
ids
);
/**
* 获取公司计划累计情况
*
* @param loginOrgCode
* @return
*/
String
getCumulativePlanCountByOrgCode
(
String
loginOrgCode
);
List
<
LeavePlanTaskVo
>
queryLeavePlanTask
(
HashMap
<
String
,
Object
>
params
);
PlanTask
selectPlanTaskStatus
(
Long
id
);
void
reformStatisticsPlanTask
(
String
strBginDate
,
String
strEndDate
,
String
userId
,
String
orgCode
)
throws
ParseException
;
void
initPlanStatusOrGenDate
();
List
<
Map
<
String
,
Object
>>
queryPlanTaskTimeAxis
(
Long
userId
,
Integer
createDate
);
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
Long
userId
,
Integer
createDate
);
/**
* 任务点详情
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/core/framework/PersonIdentify.java
View file @
4bb03dbc
...
...
@@ -19,6 +19,6 @@ public @interface PersonIdentify {
* 是否进行人员校验
* @return
*/
boolean
isNeedIdentity
()
default
fals
e
;
boolean
isNeedIdentity
()
default
tru
e
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/core/framework/PersonIdentifyAspect.java
View file @
4bb03dbc
...
...
@@ -40,7 +40,7 @@ public class PersonIdentifyAspect {
String
identityType
=
"1"
;
String
personSeq
=
"1421016571081420802"
;
String
personName
=
"SHG"
;
String
companyId
=
"1
0
"
;
String
companyId
=
"1
420727427956502529
"
;
reginParam
.
setPersonIdentity
(
new
ReginParams
.
PersonIdentity
(
identityType
,
personSeq
,
personName
,
companyId
));
redisUtils
.
set
(
buildKey
(
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParam
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/quartz/JobService.java
View file @
4bb03dbc
...
...
@@ -38,8 +38,6 @@ public class JobService implements IJobService {
@Autowired
private
IPlanTaskDao
iPlanTaskDao
;
@Autowired
private
IPlanDao
iPlanDao
;
@Autowired
private
IPlanTaskDetailDao
iPlanTaskDetailDao
;
...
...
@@ -51,9 +49,6 @@ public class JobService implements IJobService {
private
PlanTaskMapper
planTaskMapper
;
@Autowired
private
MsgMapper
msgMapper
;
@Autowired
private
ICheckDao
iCheckDao
;
@Autowired
...
...
@@ -69,14 +64,10 @@ public class JobService implements IJobService {
private
ITaskFeedbackDao
taskFeedbackDao
;
@Autowired
private
CheckMapper
checkMapper
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Value
(
"${amosRefresh.patrol.topic}"
)
private
String
patrolTopic
;
@Autowired
private
MqttGateway
webMqttComponent
;
@Override
@Transactional
...
...
@@ -204,12 +195,15 @@ public class JobService implements IJobService {
check
.
setUserId
(
planTask
.
getUserId
());
check
.
setUserName
(
planTask
.
getUserName
());
check
.
setDepName
(
""
);
check
.
setPointName
(
arg
.
getPointName
());
check
.
setPointId
(
arg
.
getPointId
());
check
.
setUploadTime
(
new
Date
());
check
.
setPlanId
(
arg
.
getPlanId
());
check
.
setPlanName
(
arg
.
getPlanName
());
check
.
setPlanTaskId
(
arg
.
getPlanTaskId
());
check
.
setPlanTaskDetailId
(
arg
.
getPlanTaskDetailId
());
check
.
setRouteId
(
arg
.
getRouteId
());
check
.
setRouteName
(
arg
.
getRouteName
());
check
.
setCheckTime
(
arg
.
getEndTime
());
check
.
setIsOk
(
CheckStatusEnum
.
OMISSION
.
getCode
());
check
=
iCheckDao
.
saveAndFlush
(
check
);
...
...
@@ -301,7 +295,6 @@ public class JobService implements IJobService {
@Override
public
void
planTaskAddJob
(
PlanTask
planTask
)
{
// TODO Auto-generated method stub
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
endTime
=
sdf
.
parse
(
planTask
.
getEndTime
());
...
...
@@ -316,30 +309,6 @@ public class JobService implements IJobService {
||
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
()
==
status
)
{
addJob
(
"planTask"
,
XJConstant
.
STATUS_MONITOR_END
,
planTask
.
getId
(),
endTime
);
// 添加监控任务开始结束定时任务
}
// 查询需要推送消息提醒
List
<
MsgConfigParam
>
configParam
=
msgMapper
.
getPlanTaskMsgConfigByUserIdAndStatus
(
planTask
.
getUserId
().
split
(
","
),
"True"
);
if
(!
configParam
.
isEmpty
())
{
configParam
.
forEach
(
config
->
{
String
jobType
=
""
;
Date
time
=
new
Date
();
int
minute
=
Integer
.
valueOf
(
config
.
getValue
());
long
tempTime
=
minute
*
60
*
1000
;
if
(
MsgSubscribeTypeEnum
.
PLANWARN
.
getName
().
equals
(
config
.
getMsgType
()))
{
time
=
new
Date
(
beginTime
.
getTime
()
-
tempTime
);
jobType
=
XJConstant
.
PLAN_TASK_WARN_MSG_PUSH
+
"-"
+
config
.
getUserId
();
}
else
if
(
MsgSubscribeTypeEnum
.
PLANBEGIN
.
getName
().
equals
(
config
.
getMsgType
()))
{
time
=
new
Date
(
beginTime
.
getTime
()
+
tempTime
);
jobType
=
XJConstant
.
PLAN_TASK_BEGIN_MSG_PUSH
+
"-"
+
config
.
getUserId
();
}
else
if
(
MsgSubscribeTypeEnum
.
PLANEND
.
getName
().
equals
(
config
.
getMsgType
()))
{
time
=
new
Date
(
endTime
.
getTime
()
+
tempTime
);
jobType
=
XJConstant
.
PLAN_TASK_END_MSG_PUSH
+
"-"
+
config
.
getUserId
();
}
addJob
(
"planTask"
,
jobType
,
planTask
.
getId
(),
time
);
});
}
}
else
{
updatePlanTaskStatus
(
planTask
,
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
());
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
4bb03dbc
...
...
@@ -25,9 +25,9 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImp
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -147,7 +147,7 @@ public class AlertCalledController extends BaseController {
alertCallInfoDto
.
setCallTime
(
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd HH:mm:ss "
));
alertCallInfoDto
.
setWorkOrderNumber
(
workOrderNumber
);
alertCallInfoDto
.
setRecUserId
(
getUserInfo
().
getUserId
());
alertCallInfoDto
.
setRecUserName
(
getUserInfo
().
get
User
Name
());
alertCallInfoDto
.
setRecUserName
(
getUserInfo
().
get
Real
Name
());
return
ResponseHelper
.
buildResponse
(
alertCallInfoDto
);
}
...
...
@@ -162,12 +162,13 @@ public class AlertCalledController extends BaseController {
String
number
=
DateUtils
.
stampToDate
(
SystemClock
.
now
(),
"yyyy-MM-dd HH:mm:ss SSS"
);
String
newNumber
=
number
.
replace
(
"-"
,
""
).
replace
(
" "
,
""
).
replace
(
":"
,
""
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
// Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00",
// DateUtils.dateFormat(new Date(),"")+" 23:59:59",reginParams.getCompany().getOrgCode(),
// reginParams.getUserModel().getUserId());
AgencyUserModel
user
=
reginParams
.
getUserModel
();
String
orgCode
=
ValidationUtil
.
isEmpty
(
user
.
getCompanys
())
?
null
:
user
.
getCompanys
().
get
(
0
).
getOrgCode
();
Map
<
String
,
Object
>
map
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_TIME_PATTERN
),
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_TIME_PATTERN
),
null
,
null
);
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_TIME_PATTERN
),
orgCode
,
user
.
getUserId
());
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
newNumber
);
String
workOrderNumber
=
stringBuilder
.
append
(
map
.
get
(
"calledCount"
)
==
null
?
"1"
:
String
.
valueOf
(
Integer
.
parseInt
(
map
.
get
(
"calledCount"
).
toString
())
+
1
)).
toString
()
;
...
...
@@ -257,7 +258,7 @@ public class AlertCalledController extends BaseController {
page
=
iAlertCalledService
.
page
(
pageBean
,
alertCalledQueryWrapper
);
IPage
<
AlertCalledDto
>
calledVoIPage
=
AlertBeanDtoVoUtils
.
alertCalledIPageDto
(
page
);
calledVoIPage
.
getRecords
().
stream
().
forEach
(
e
->{
e
.
setAlertAddress
(
e
.
getCity
()+
e
.
getDistrict
());
//e.setAlertAddress(e.getAddress
());
});
return
ResponseHelper
.
buildResponse
(
calledVoIPage
);
}
...
...
@@ -319,6 +320,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询警情事件记录"
,
notes
=
"查询警情事件记录"
)
@PostMapping
(
"/selectRecord"
)
...
...
@@ -344,43 +346,39 @@ public class AlertCalledController extends BaseController {
/**
* 冻结工单-维修
* @param forzenResult
* @param alertId
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveForzen"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"冻结工单-维修"
,
notes
=
"冻结工单-维修"
)
public
ResponseModel
<
Boolean
>
forzenAlertById
(
@
ApiParam
(
value
=
"冻结原因"
,
required
=
true
)
@RequestParam
String
forzenResult
,
@ApiParam
(
value
=
"警情id"
,
required
=
true
)
@RequestParam
Long
alertId
)
{
if
(
ValidationUtil
.
isEmpty
(
alert
Id
)
||
ValidationUtil
.
isEmpty
(
forzenResult
)){
public
ResponseModel
<
Boolean
>
forzenAlertById
(
@
RequestBody
AlertCalledDto
alertCalledDto
)
{
if
(
ValidationUtil
.
isEmpty
(
alert
CalledDto
.
getSequenceNbr
()
)
||
ValidationUtil
.
isEmpty
(
alertCalledDto
.
getForzenResult
()
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
LambdaUpdateWrapper
<
AlertCalled
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
AlertCalled:
:
getForzenResult
,
forzenResult
);
updateWrapper
.
set
(
AlertCalled:
:
getForzenResult
,
alertCalledDto
.
getForzenResult
()
);
updateWrapper
.
set
(
AlertCalled:
:
getAlertStage
,
1
);
updateWrapper
.
eq
(
AlertCalled:
:
getSequenceNbr
,
alert
Id
);
updateWrapper
.
eq
(
AlertCalled:
:
getSequenceNbr
,
alert
CalledDto
.
getSequenceNbr
()
);
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
update
(
updateWrapper
));
}
/**
* 工单结案-投诉
* @param finalReason
* @param alertId
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveFinalReason"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"工单结案-投诉"
,
notes
=
"工单结案-投诉"
)
public
ResponseModel
<
Boolean
>
finishAlertById
(
@
ApiParam
(
value
=
"结案说明"
,
required
=
true
)
@RequestParam
String
finalReason
,
@ApiParam
(
value
=
"警情id"
,
required
=
true
)
@RequestParam
Long
alertId
)
{
if
(
ValidationUtil
.
isEmpty
(
finalReason
)
||
ValidationUtil
.
isEmpty
(
alert
Id
)){
public
ResponseModel
<
Boolean
>
finishAlertById
(
@
RequestBody
AlertCalledDto
alertCalledDto
)
{
if
(
ValidationUtil
.
isEmpty
(
alertCalledDto
.
getFinalReason
()
)
||
ValidationUtil
.
isEmpty
(
alert
CalledDto
.
getSequenceNbr
()
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
LambdaUpdateWrapper
<
AlertCalled
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
AlertCalled:
:
getFinalReason
,
finalReason
);
updateWrapper
.
set
(
AlertCalled:
:
getFinalReason
,
alertCalledDto
.
getFinalReason
()
);
updateWrapper
.
set
(
AlertCalled:
:
getAlertStage
,
1
);
updateWrapper
.
eq
(
AlertCalled:
:
getSequenceNbr
,
alert
Id
);
updateWrapper
.
eq
(
AlertCalled:
:
getSequenceNbr
,
alert
CalledDto
.
getSequenceNbr
()
);
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
update
(
updateWrapper
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
View file @
4bb03dbc
...
...
@@ -297,7 +297,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto
.
setErrorResult
(
value
);
break
;
case
TzsCommonParam
.
FIX_REMARK
:
value
=
alertFormValue
.
getFieldValue
Code
();
value
=
alertFormValue
.
getFieldValue
();
dispatchSaveFeedbackDto
.
setFixRemark
(
value
);
break
;
}
...
...
@@ -365,12 +365,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break
;
}
});
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getFeedbackCode
()))
{
dispatchPaper
.
setFeedbackCode
(
dispatchSaveFeedbackDto
.
getFeedbackCode
());
dispatchPaper
.
setFeedbackType
(
dispatchSaveFeedbackDto
.
getFeedbackType
());
dispatchPaper
.
setFeedbackType
(
DispatchPaperEnums
.
getEnumById
(
dispatchSaveFeedbackDto
.
getFeedbackCode
()).
getValue
());
}
dispatchPaper
.
setFeedbackFinishTime
(
dispatchSaveFeedbackDto
.
getFeedbackFinishTime
());
dispatchPaper
.
setFeedbackUid
(
dispatchSaveFeedbackDto
.
getFeedbackUid
());
dispatchPaper
.
setFeedbackUname
(
dispatchSaveFeedbackDto
.
getFeedbackUname
());
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchSaveFeedbackDto
.
getFeedbackTime
()
!=
null
)
{
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchSaveFeedbackDto
.
getFeedback
Finish
Time
()
!=
null
)
{
// 维修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
...
...
@@ -379,8 +381,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK
,
taskId
,
user
);
// 修改警情到维修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK
);
dispatchPaper
.
setFeedbackTime
(
dispatchSaveFeedbackDto
.
getFeedbackFinishTime
());
// 没有回访时间只有维修完成时间
}
dispatchPaper
.
setFeedbackTime
(
dispatchSaveFeedbackDto
.
getFeedbackTime
());
// 保存动态表单数据
iAlertFormValueService
.
updateBatchById
(
dynamicFormAlert
);
// 保存派遣表
...
...
@@ -568,8 +570,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break
;
}
});
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFeedbackCode
()))
{
dispatchPaper
.
setFeedbackCode
(
dispatchRepairFeedbackDto
.
getFeedbackCode
());
dispatchPaper
.
setFeedbackType
(
dispatchRepairFeedbackDto
.
getFeedbackType
());
dispatchPaper
.
setFeedbackType
(
DispatchPaperEnums
.
getEnumById
(
dispatchRepairFeedbackDto
.
getFeedbackCode
()).
getValue
());
}
dispatchPaper
.
setFeedbackFinishTime
(
dispatchRepairFeedbackDto
.
getFeedbackFinishTime
());
dispatchPaper
.
setFeedbackUid
(
dispatchRepairFeedbackDto
.
getFeedbackUid
());
dispatchPaper
.
setFeedbackUname
(
dispatchRepairFeedbackDto
.
getFeedbackUname
());
...
...
@@ -772,8 +776,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break
;
}
});
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getFeedbackCode
()))
{
dispatchPaper
.
setFeedbackCode
(
dispatchConsultFeedbackDto
.
getFeedbackCode
());
dispatchPaper
.
setFeedbackType
(
dispatchConsultFeedbackDto
.
getFeedbackType
());
dispatchPaper
.
setFeedbackType
(
DispatchPaperEnums
.
getEnumById
(
dispatchConsultFeedbackDto
.
getFeedbackCode
()).
getValue
());
}
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchConsultFeedbackDto
.
getFeedbackTime
()
!=
null
)
{
tempMap
.
put
(
"FEEDBACK"
,
true
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/RepairConsultServiceImpl.java
View file @
4bb03dbc
...
...
@@ -93,7 +93,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$createUser"
,
createUser
).
replace
(
"$call"
,
emergency_call
);
content
=
content
.
replace
(
"$area"
,
area
).
replace
(
"$alertType"
,
alertType
);
}
else
if
(
TzsCommonParam
.
PQ
.
equals
(
type
))
{
String
createUser
=
user
.
getUser
Name
();
String
createUser
=
user
.
getReal
Name
();
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
unit
=
dispatchTask
.
getResponseOrgName
();
if
(
unit
==
null
)
...
...
@@ -129,7 +129,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String
FKFS
=
rescueProcessDto
.
getArriveFeedbackType
();
content
=
content
.
replace
(
"$FKFS"
,
FKFS
);
}
else
if
(
TzsCommonParam
.
JYHF
.
equals
(
type
))
{
String
createUser
=
user
.
getUser
Name
();
String
createUser
=
user
.
getReal
Name
();
String
create
=
alertCalledVo
.
getEmergencyPerson
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$createUser"
,
createUser
).
replace
(
"$create"
,
create
);
}
else
if
(
TzsCommonParam
.
WXFK
.
equals
(
type
))
{
//从派遣单获取数据
...
...
amos-boot-system-maintenance/src/main/resources/application.properties
View file @
4bb03dbc
...
...
@@ -31,8 +31,8 @@ spring.liquibase.enabled=true
mybatis.configuration.log-impl
=
org.apache.ibatis.logging.stdout.StdOutImpl
equip.fe
gin.name
=
AMOS-EQUIPMANAGE
equip.fe
gi
n.prefix
=
/equip
equip.fe
ign.name
=
AMOS-EQUIPMANAGE-SHG
equip.fe
ig
n.prefix
=
/equip
input.custom.prefix
=
QYZD
input.statute.prefix
=
FG
...
...
@@ -54,7 +54,7 @@ management.endpoints.web.exposure.exclude=*
## redis失效时间
redis.cache.failure.time
=
10800
## eureka properties:
eureka.client.registry-fetch-interval-seconds
=
5
eureka.client.registry-fetch-interval-seconds
=
5
0
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
4bb03dbc
...
...
@@ -378,13 +378,14 @@
</select>
<select
id=
"getPlanTaskPointInputItemByPlanTaskId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.PlanTaskPointInputItemBo"
>
SELECT
ppi.input_item_id inputItemId,
temp1.order_no orderNo,
temp1.routePointItemId,
temp1.classifyId,
temp1.classifyName,
temp1.routeName,
temp1.pointName,
pii.`name` inputName,
temp2.*
FROM
...
...
@@ -399,11 +400,15 @@
prp.route_id,
prpi.id routePointItemId,
ppc.id classifyId,
ppc.`name` classifyName
ppc.`name` classifyName,
r.name as routeName,
p.name as pointName
FROM
p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON prpi.point_classify_id = ppc.id
LEFT JOIN p_route r ON r.id = prp.route_id
LEFT JOIN p_point p ON p.id = prp.point_id
) temp1 ON(ppi.id = temp1.point_input_item_id)
RIGHT JOIN
...
...
@@ -417,16 +422,15 @@
ptd.org_code AS orgCode,
ptd.end_time AS endTime,
pptd.id as planTaskDetailId,
(select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId
(select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId,
(select p_plan.name from p_plan where p_plan.id=ptd.plan_id) planName
FROM
p_plan_task_detail pptd,
p_plan_task ptd
WHERE
pptd.task_no = ptd.id
AND ptd.id = #{planTaskId} and pptd.`status` = #{planTaskDetailStatus}
) temp2 on(temp1.point_id = temp2.pointId
AND temp1.route_id = temp2.routeId)
) temp2 on temp1.point_id = temp2.pointId AND temp1.route_id = temp2.routeId
</select>
<!-- 巡检执行情况统计分页用 -->
<select
id=
"countChkExListData"
resultType=
"long"
>
...
...
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