Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
b2fe25f9
Commit
b2fe25f9
authored
Mar 11, 2020
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级最新平台
parent
3287f94c
Hide whitespace changes
Inline
Side-by-side
Showing
130 changed files
with
4030 additions
and
575 deletions
+4030
-575
pom.xml
YeeAmosFireAutoSysCommon/pom.xml
+3
-2
CommonPageable.java
.../yeejoin/amos/fas/core/common/request/CommonPageable.java
+1
-1
DateUtil.java
...va/com/yeejoin/amos/fas/core/common/request/DateUtil.java
+1343
-0
BasicEntity.java
...ain/java/com/yeejoin/amos/fas/dao/entity/BasicEntity.java
+1
-2
BusinessEntity.java
.../java/com/yeejoin/amos/fas/dao/entity/BusinessEntity.java
+110
-0
ContingencyOriginalData.java
.../yeejoin/amos/fas/dao/entity/ContingencyOriginalData.java
+0
-1
ContingencyPlanInstance.java
.../yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
+0
-1
Equipment.java
.../main/java/com/yeejoin/amos/fas/dao/entity/Equipment.java
+5
-3
FireCar.java
...rc/main/java/com/yeejoin/amos/fas/dao/entity/FireCar.java
+3
-3
FireEquipment.java
...n/java/com/yeejoin/amos/fas/dao/entity/FireEquipment.java
+3
-3
FireEquipmentPoint.java
...a/com/yeejoin/amos/fas/dao/entity/FireEquipmentPoint.java
+3
-3
Fmea.java
...n/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
+15
-15
NodeMessageView.java
...java/com/yeejoin/amos/fas/dao/entity/NodeMessageView.java
+3
-1
PPoint.java
...src/main/java/com/yeejoin/amos/fas/dao/entity/PPoint.java
+6
-6
SCompany.java
...c/main/java/com/yeejoin/amos/fas/dao/entity/SCompany.java
+5
-5
SDepartment.java
...ain/java/com/yeejoin/amos/fas/dao/entity/SDepartment.java
+5
-5
SUser.java
.../src/main/java/com/yeejoin/amos/fas/dao/entity/SUser.java
+5
-5
TopographyLine.java
.../java/com/yeejoin/amos/fas/dao/entity/TopographyLine.java
+0
-1
TopographyNode.java
.../java/com/yeejoin/amos/fas/dao/entity/TopographyNode.java
+0
-1
TopographyNodeDetail.java
...com/yeejoin/amos/fas/dao/entity/TopographyNodeDetail.java
+0
-4
pom.xml
YeeAmosFireAutoSysService/pom.xml
+32
-4
AccidentTypeController.java
.../amos/fas/business/controller/AccidentTypeController.java
+15
-8
AlarmController.java
...yeejoin/amos/fas/business/controller/AlarmController.java
+2
-2
BaseController.java
.../yeejoin/amos/fas/business/controller/BaseController.java
+138
-58
BizMessageController.java
...in/amos/fas/business/controller/BizMessageController.java
+8
-5
CommonController.java
...eejoin/amos/fas/business/controller/CommonController.java
+14
-11
DictController.java
.../yeejoin/amos/fas/business/controller/DictController.java
+10
-12
EquipmentController.java
...oin/amos/fas/business/controller/EquipmentController.java
+22
-16
EvaModelController.java
...join/amos/fas/business/controller/EvaModelController.java
+2
-2
ExcelController.java
...yeejoin/amos/fas/business/controller/ExcelController.java
+3
-4
FileController.java
.../yeejoin/amos/fas/business/controller/FileController.java
+1
-4
FireCarController.java
...ejoin/amos/fas/business/controller/FireCarController.java
+16
-10
FireEquimtPointController.java
...os/fas/business/controller/FireEquimtPointController.java
+7
-6
FireSourceController.java
...in/amos/fas/business/controller/FireSourceController.java
+8
-5
FireStationController.java
...n/amos/fas/business/controller/FireStationController.java
+11
-9
FireStrengthController.java
.../amos/fas/business/controller/FireStrengthController.java
+7
-9
Node3dVoController.java
...join/amos/fas/business/controller/Node3dVoController.java
+3
-3
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+5
-6
RiskFactorController.java
...in/amos/fas/business/controller/RiskFactorController.java
+11
-7
RiskLevelController.java
...oin/amos/fas/business/controller/RiskLevelController.java
+9
-6
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+13
-10
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+19
-19
TimeLineController.java
...join/amos/fas/business/controller/TimeLineController.java
+6
-6
TopographyController.java
...in/amos/fas/business/controller/TopographyController.java
+2
-2
WaterResourceController.java
...amos/fas/business/controller/WaterResourceController.java
+12
-8
BizMessageMapper.java
...eejoin/amos/fas/business/dao/mapper/BizMessageMapper.java
+1
-1
ContingencyOriginalMapper.java
...os/fas/business/dao/mapper/ContingencyOriginalMapper.java
+1
-1
FireEquipMapper.java
...yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
+3
-3
FireEquipPointMapper.java
...in/amos/fas/business/dao/mapper/FireEquipPointMapper.java
+1
-1
FireStationMapper.java
...ejoin/amos/fas/business/dao/mapper/FireStationMapper.java
+2
-2
FireStrengthMapper.java
...join/amos/fas/business/dao/mapper/FireStrengthMapper.java
+1
-1
ImpAndFireEquipMapper.java
...n/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
+1
-1
ImpEquipMapper.java
.../yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
+1
-1
WaterResourceMapper.java
...oin/amos/fas/business/dao/mapper/WaterResourceMapper.java
+2
-2
FireStrengthPointDao.java
...mos/fas/business/dao/repository/FireStrengthPointDao.java
+4
-1
IContingencyOriginalDataDao.java
.../business/dao/repository/IContingencyOriginalDataDao.java
+2
-2
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+3
-3
IDeptmentDao.java
...eejoin/amos/fas/business/dao/repository/IDeptmentDao.java
+4
-2
IEquipmentDao.java
...ejoin/amos/fas/business/dao/repository/IEquipmentDao.java
+3
-1
IFireCarDao.java
...yeejoin/amos/fas/business/dao/repository/IFireCarDao.java
+3
-1
IFireEquipmentDao.java
...n/amos/fas/business/dao/repository/IFireEquipmentDao.java
+2
-1
IFireEquipmentDataDao.java
...os/fas/business/dao/repository/IFireEquipmentDataDao.java
+3
-1
IFireEquipmentPointDao.java
...s/fas/business/dao/repository/IFireEquipmentPointDao.java
+3
-1
IFireStationDao.java
...oin/amos/fas/business/dao/repository/IFireStationDao.java
+3
-1
IFmeaDao.java
...om/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
+2
-1
INodeMsgViewRepository.java
...s/fas/business/dao/repository/INodeMsgViewRepository.java
+1
-2
IPPointDao.java
.../yeejoin/amos/fas/business/dao/repository/IPPointDao.java
+2
-1
IRiskFactorDao.java
...join/amos/fas/business/dao/repository/IRiskFactorDao.java
+2
-1
IRiskLevelDao.java
...ejoin/amos/fas/business/dao/repository/IRiskLevelDao.java
+2
-1
IRiskSourceDao.java
...join/amos/fas/business/dao/repository/IRiskSourceDao.java
+2
-1
IUserDao.java
...om/yeejoin/amos/fas/business/dao/repository/IUserDao.java
+3
-1
IWaterResourceDao.java
...n/amos/fas/business/dao/repository/IWaterResourceDao.java
+4
-1
IWaterResourceEquipmentDao.java
...s/business/dao/repository/IWaterResourceEquipmentDao.java
+2
-1
AMOSSecurityFallback.java
...yeejoin/amos/fas/business/feign/AMOSSecurityFallback.java
+3
-1
CompanyUserFeignServer.java
...ejoin/amos/fas/business/feign/CompanyUserFeignServer.java
+3
-1
DeptmentServer.java
...a/com/yeejoin/amos/fas/business/feign/DeptmentServer.java
+3
-1
IAMOSSecurityServer.java
.../yeejoin/amos/fas/business/feign/IAMOSSecurityServer.java
+4
-2
IMaasVisualServer.java
...om/yeejoin/amos/fas/business/feign/IMaasVisualServer.java
+4
-2
MassVisualFallback.java
...m/yeejoin/amos/fas/business/feign/MassVisualFallback.java
+1
-1
RemoteRuleServer.java
...com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
+18
-11
RemoteSecurityService.java
...eejoin/amos/fas/business/feign/RemoteSecurityService.java
+592
-0
RemoteWebSocketServer.java
...eejoin/amos/fas/business/feign/RemoteWebSocketServer.java
+13
-5
TreeUserFeignServer.java
.../yeejoin/amos/fas/business/feign/TreeUserFeignServer.java
+3
-1
CommonService.java
...yeejoin/amos/fas/business/service/impl/CommonService.java
+23
-14
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+56
-45
ContingencyOriginalServiceImpl.java
...business/service/impl/ContingencyOriginalServiceImpl.java
+6
-7
DictServiceImpl.java
...ejoin/amos/fas/business/service/impl/DictServiceImpl.java
+11
-4
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+46
-9
ExcelServiceImpl.java
...join/amos/fas/business/service/impl/ExcelServiceImpl.java
+1
-1
FireCarServiceImpl.java
...in/amos/fas/business/service/impl/FireCarServiceImpl.java
+16
-3
FireEquipPointServiceImpl.java
.../fas/business/service/impl/FireEquipPointServiceImpl.java
+19
-6
FireEquipServiceImpl.java
.../amos/fas/business/service/impl/FireEquipServiceImpl.java
+34
-8
FireStationServiceImpl.java
...mos/fas/business/service/impl/FireStationServiceImpl.java
+20
-5
FireStrengthServiceImpl.java
...os/fas/business/service/impl/FireStrengthServiceImpl.java
+7
-2
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+17
-4
ITopographyNodeServiceImpl.java
...fas/business/service/impl/ITopographyNodeServiceImpl.java
+1
-1
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+7
-3
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+82
-26
WaterResourceServiceImpl.java
...s/fas/business/service/impl/WaterResourceServiceImpl.java
+9
-4
AMOSSecurityServer.java
...n/amos/fas/business/service/intfc/AMOSSecurityServer.java
+3
-2
ICommonService.java
...ejoin/amos/fas/business/service/intfc/ICommonService.java
+6
-5
IEquipmentService.java
...in/amos/fas/business/service/intfc/IEquipmentService.java
+1
-1
IFireEquipPontService.java
...mos/fas/business/service/intfc/IFireEquipPontService.java
+1
-1
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+1
-1
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+4
-3
FireEquimentData.java
...oin/amos/fas/business/service/model/FireEquimentData.java
+1
-2
ProtalData.java
...m/yeejoin/amos/fas/business/service/model/ProtalData.java
+1
-2
TaskData.java
...com/yeejoin/amos/fas/business/service/model/TaskData.java
+1
-2
CacheFactory.java
...java/com/yeejoin/amos/fas/business/util/CacheFactory.java
+21
-0
CacheMap.java
...ain/java/com/yeejoin/amos/fas/business/util/CacheMap.java
+40
-0
CacheValue.java
...n/java/com/yeejoin/amos/fas/business/util/CacheValue.java
+21
-0
Constants.java
...in/java/com/yeejoin/amos/fas/business/util/Constants.java
+64
-0
JSONUtil.java
...ain/java/com/yeejoin/amos/fas/business/util/JSONUtil.java
+88
-0
StringUtil.java
...n/java/com/yeejoin/amos/fas/business/util/StringUtil.java
+141
-0
CompanyBo.java
...main/java/com/yeejoin/amos/fas/business/vo/CompanyBo.java
+114
-0
DepartmentBo.java
...n/java/com/yeejoin/amos/fas/business/vo/DepartmentBo.java
+87
-0
ReginParams.java
...in/java/com/yeejoin/amos/fas/business/vo/ReginParams.java
+35
-0
RoleBo.java
...rc/main/java/com/yeejoin/amos/fas/business/vo/RoleBo.java
+31
-0
Toke.java
.../src/main/java/com/yeejoin/amos/fas/business/vo/Toke.java
+30
-0
RsDataQueue.java
.../java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
+22
-4
Config.java
...ice/src/main/java/com/yeejoin/amos/fas/config/Config.java
+7
-2
CommonResponse.java
...n/java/com/yeejoin/amos/fas/core/util/CommonResponse.java
+101
-0
CommonResponseUtil.java
...va/com/yeejoin/amos/fas/core/util/CommonResponseUtil.java
+55
-0
Constants.java
...c/main/java/com/yeejoin/amos/fas/core/util/Constants.java
+64
-0
DaoCriteria.java
...main/java/com/yeejoin/amos/fas/core/util/DaoCriteria.java
+75
-0
FileUtil.java
...rc/main/java/com/yeejoin/amos/fas/core/util/FileUtil.java
+1
-2
BaseQuerySpecification.java
...join/amos/fas/core/util/query/BaseQuerySpecification.java
+3
-3
YeeAmosFireAutoSysStart.java
...c/main/java/com/yeejoin/amos/YeeAmosFireAutoSysStart.java
+10
-5
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+31
-32
pom.xml
pom.xml
+21
-10
No files found.
YeeAmosFireAutoSysCommon/pom.xml
View file @
b2fe25f9
...
...
@@ -16,11 +16,11 @@
<version>
1.0.0
</version>
</parent>
<dependencies>
<
!-- <
dependencies>
<dependency>
<groupId>com.yeejoin.amos</groupId>
<artifactId>AmosOPService</artifactId>
<version>${YeeOp.version}</version>
</dependency>
</dependencies>
</dependencies>
-->
</project>
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/request/CommonPageable.java
View file @
b2fe25f9
...
...
@@ -62,7 +62,7 @@ public class CommonPageable implements Pageable {
return
pageSize
;
}
public
int
getOffset
()
{
public
long
getOffset
()
{
offset
=
pageSize
*
pageNumber
;
return
offset
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/request/DateUtil.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
common
.
request
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.GregorianCalendar
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Random
;
import
org.apache.commons.lang.StringUtils
;
/**
* 日期工具类
*
*/
public
class
DateUtil
{
// 默认日期格式
public
static
final
String
DATE_DEFAULT_FORMAT
=
"yyyy-MM-dd"
;
// 默认日期格式
public
static
final
String
DATE_YEARANDMONTH_FORMAT
=
"yyyy-MM"
;
// 默认时间格式
public
static
final
String
DATETIME_DEFAULT_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
TIME_DEFAULT_FORMAT
=
"HH:mm:ss"
;
// 日期格式化
private
static
DateFormat
dateFormat
=
null
;
// 时间格式化
private
static
DateFormat
dateTimeFormat
=
null
;
// 年月格式化
private
static
DateFormat
dateYearAndMonthFormat
=
null
;
private
static
DateFormat
timeFormat
=
null
;
private
static
Calendar
gregorianCalendar
=
null
;
static
{
dateFormat
=
new
SimpleDateFormat
(
DATE_DEFAULT_FORMAT
);
dateYearAndMonthFormat
=
new
SimpleDateFormat
(
DATE_YEARANDMONTH_FORMAT
);
dateTimeFormat
=
new
SimpleDateFormat
(
DATETIME_DEFAULT_FORMAT
);
timeFormat
=
new
SimpleDateFormat
(
TIME_DEFAULT_FORMAT
);
gregorianCalendar
=
new
GregorianCalendar
();
}
/**
* 日期格式化yyyy-MM-dd
*
* @param date
* @return
*/
public
static
Date
formatDate
(
String
date
,
String
format
)
{
try
{
return
new
SimpleDateFormat
(
format
).
parse
(
date
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 日期格式化yyyy-MM-dd
*
* @param date
* @return
*/
public
static
String
getDateFormat
(
Date
date
)
{
return
dateFormat
.
format
(
date
);
}
/**
* 日期格式化yyyy-MM
*
* @param date
* @return
*/
public
static
String
getDateYearAndMonthFormat
(
Date
date
)
{
return
dateYearAndMonthFormat
.
format
(
date
);
}
/**
* 日期格式化yyyy-MM-dd HH:mm:ss
*
* @param date
* @return
*/
public
static
String
getDateTimeFormat
(
Date
date
)
{
return
dateTimeFormat
.
format
(
date
);
}
/**
* 时间格式化
*
* @param date
* @return HH:mm:ss
*/
public
static
String
getTimeFormat
(
Date
date
)
{
return
timeFormat
.
format
(
date
);
}
/**
* 日期格式化
*
* @param date
* @param 格式类型
* @return
*/
public
static
String
getDateFormat
(
Date
date
,
String
formatStr
)
{
if
(
StringUtils
.
isNotBlank
(
formatStr
))
{
return
new
SimpleDateFormat
(
formatStr
).
format
(
date
);
}
return
null
;
}
/**
* 日期格式化
*
* @param date
* @return
*/
public
static
Date
getDateFormat
(
String
date
)
{
try
{
return
dateFormat
.
parse
(
date
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 时间格式化
*
* @param date
* @return
*/
public
static
Date
getDateTimeFormat
(
String
date
)
{
try
{
return
dateTimeFormat
.
parse
(
date
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 获取当前日期(yyyy-MM-dd)
*
* @param date
* @return
*/
public
static
Date
getNowDate
()
{
return
DateUtil
.
getDateFormat
(
dateFormat
.
format
(
new
Date
()));
}
/**
* 获取当前日期星期一日期
*
* @return date
*/
public
static
Date
getFirstDayOfWeek
()
{
gregorianCalendar
.
setFirstDayOfWeek
(
Calendar
.
MONDAY
);
gregorianCalendar
.
setTime
(
new
Date
());
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_WEEK
,
gregorianCalendar
.
getFirstDayOfWeek
());
// Monday
return
gregorianCalendar
.
getTime
();
}
/**
* 获取当前日期星期日日期
*
* @return date
*/
public
static
Date
getLastDayOfWeek
()
{
gregorianCalendar
.
setFirstDayOfWeek
(
Calendar
.
MONDAY
);
gregorianCalendar
.
setTime
(
new
Date
());
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_WEEK
,
gregorianCalendar
.
getFirstDayOfWeek
()
+
6
);
// Monday
return
gregorianCalendar
.
getTime
();
}
/**
* 获取日期星期一日期
*
* @param 指定日期
* @return date
*/
public
static
Date
getFirstDayOfWeek
(
Date
date
)
{
if
(
date
==
null
)
{
return
null
;
}
gregorianCalendar
.
setFirstDayOfWeek
(
Calendar
.
MONDAY
);
gregorianCalendar
.
setTime
(
date
);
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_WEEK
,
gregorianCalendar
.
getFirstDayOfWeek
());
// Monday
return
gregorianCalendar
.
getTime
();
}
/**
* 获取日期星期一日期
*
* @param 指定日期
* @return date
*/
public
static
Date
getLastDayOfWeek
(
Date
date
)
{
if
(
date
==
null
)
{
return
null
;
}
gregorianCalendar
.
setFirstDayOfWeek
(
Calendar
.
MONDAY
);
gregorianCalendar
.
setTime
(
date
);
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_WEEK
,
gregorianCalendar
.
getFirstDayOfWeek
()
+
6
);
// Monday
return
gregorianCalendar
.
getTime
();
}
/**
* 获取当前月的第一天
*
* @return date
*/
public
static
Date
getFirstDayOfMonth
()
{
gregorianCalendar
.
setTime
(
new
Date
());
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取当前月的最后一天
*
* @return
*/
public
static
Date
getLastDayOfMonth
()
{
gregorianCalendar
.
setTime
(
new
Date
());
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
gregorianCalendar
.
add
(
Calendar
.
MONTH
,
1
);
gregorianCalendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取指定月的第一天
*
* @param date
* @return
*/
public
static
Date
getFirstDayOfMonth
(
Date
date
)
{
gregorianCalendar
.
setTime
(
date
);
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取指定月的最后一天
*
* @param date
* @return
*/
public
static
Date
getLastDayOfMonth
(
Date
date
)
{
gregorianCalendar
.
setTime
(
date
);
gregorianCalendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
gregorianCalendar
.
add
(
Calendar
.
MONTH
,
1
);
gregorianCalendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取日期前一天
*
* @param date
* @return
*/
public
static
Date
getDayBefore
(
Date
date
)
{
gregorianCalendar
.
setTime
(
date
);
int
day
=
gregorianCalendar
.
get
(
Calendar
.
DATE
);
gregorianCalendar
.
set
(
Calendar
.
DATE
,
day
-
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取日期后一天
*
* @param date
* @return
*/
public
static
Date
getDayAfter
(
Date
date
)
{
gregorianCalendar
.
setTime
(
date
);
int
day
=
gregorianCalendar
.
get
(
Calendar
.
DATE
);
gregorianCalendar
.
set
(
Calendar
.
DATE
,
day
+
1
);
return
gregorianCalendar
.
getTime
();
}
/**
* 获取当前年
*
* @return
*/
public
static
int
getNowYear
()
{
Calendar
d
=
Calendar
.
getInstance
();
return
d
.
get
(
Calendar
.
YEAR
);
}
/**
* 获取当前月份
*
* @return
*/
public
static
int
getNowMonth
()
{
Calendar
d
=
Calendar
.
getInstance
();
return
d
.
get
(
Calendar
.
MONTH
)
+
1
;
}
/**
* 获取date的年
*
* @return
*/
public
static
int
getDateYear
(
Date
date
)
{
Calendar
d
=
Calendar
.
getInstance
();
d
.
setTime
(
date
);
return
d
.
get
(
Calendar
.
YEAR
);
}
/**
* 获取date的月份
*
* @return
*/
public
static
int
getDateMonth
(
Date
date
)
{
Calendar
d
=
Calendar
.
getInstance
();
d
.
setTime
(
date
);
return
d
.
get
(
Calendar
.
MONTH
)
+
1
;
}
/**
* 获取当月天数
*
* @return
*/
public
static
int
getNowMonthDay
()
{
Calendar
d
=
Calendar
.
getInstance
();
return
d
.
getActualMaximum
(
Calendar
.
DATE
);
}
/**
* 获取时间段的每一天
*
* @param 开始日期
* @param 结算日期
* @return 日期列表
*/
public
static
List
<
Date
>
getEveryDay
(
Date
startDate
,
Date
endDate
)
{
if
(
startDate
==
null
||
endDate
==
null
)
{
return
null
;
}
// 格式化日期(yy-MM-dd)
startDate
=
DateUtil
.
getDateFormat
(
DateUtil
.
getDateFormat
(
startDate
));
endDate
=
DateUtil
.
getDateFormat
(
DateUtil
.
getDateFormat
(
endDate
));
List
<
Date
>
dates
=
new
ArrayList
<
Date
>();
gregorianCalendar
.
setTime
(
startDate
);
dates
.
add
(
gregorianCalendar
.
getTime
());
while
(
gregorianCalendar
.
getTime
().
compareTo
(
endDate
)
<
0
)
{
// 加1天
gregorianCalendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
dates
.
add
(
gregorianCalendar
.
getTime
());
}
return
dates
;
}
/**
* 获取提前多少个月
*
* @param monty
* @return
*/
public
static
Date
getFirstMonth
(
int
monty
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
-
monty
);
return
c
.
getTime
();
}
/**
* 得到现在时间
*
* @return
*/
public
static
Date
getNow
()
{
Date
currentTime
=
new
Date
();
return
currentTime
;
}
/**
* 获取现在时间
*
* @return 返回时间类型 yyyy-MM-dd HH:mm:ss
*/
public
static
String
getNowDateLongForHandset
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy:MM:dd-HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
public
static
String
getDateLongForHandset
(
java
.
util
.
Date
dateDate
){
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy:MM:dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
public
static
String
getDateStr
(
String
formatterstr
)
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
formatterstr
);
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
/**
* 获取现在时间
*
* @return 返回时间类型 yyyy-MM-dd HH:mm:ss
*/
public
static
Date
getNowDateLong
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
currentTime
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
currentTime_2
=
formatter
.
parse
(
dateString
,
pos
);
return
currentTime_2
;
}
/**
* 获取现在时间
*
* @return返回短时间格式 yyyy-MM-dd
*/
public
static
Date
getNowDateShort
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
dateString
=
formatter
.
format
(
currentTime
);
ParsePosition
pos
=
new
ParsePosition
(
8
);
Date
currentTime_2
=
formatter
.
parse
(
dateString
,
pos
);
return
currentTime_2
;
}
/**
* 获取现在时间字符串
*
* @return返回字符串格式 yyyy-MM-dd HH:mm:ss
*/
public
static
String
getNowStrLong
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
/**
* 获取现在时间字符串
*
* @return 返回短时间字符串格式yyyy-MM-dd
*/
public
static
String
getNowStrShort
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
/**
* 获取时间 小时:分;秒 HH:mm:ss
*
* @return
*/
public
static
String
getNowHHMMSS
()
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
Date
currentTime
=
new
Date
();
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
/**
*
* <pre>
*
* </pre>
*
* @param strDate
* @param dateFormat
* @return
*/
public
static
Date
str2Date
(
String
strDate
,
String
dateFormat
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
dateFormat
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
;
}
/**
*
* <pre>
* e.g localDateStr ="2017-03-30T06:28:12.803Z";
* </pre>
*
* @param strDate
* @param dateFormat
* @return
*/
public
static
Date
localDateStr2Date
(
String
localDateStr
)
{
LocalDateTime
localDate
=
LocalDateTime
.
parse
(
localDateStr
,
DateTimeFormatter
.
ISO_ZONED_DATE_TIME
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
formatLocalDate2Str
=
localDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
formatLocalDate2Str
,
pos
);
return
strtodate
;
}
/**
* 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
*
* @param strDate
* @return
*/
public
static
Date
longStr2Date
(
String
strDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
;
}
/**
* 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm
*
* @param strDate
* @return
*/
public
static
Date
longStr3Date
(
String
strDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
;
}
/**
* 将长时间格式字符串转换为long型数据
*
* @param strDate
* @return
*/
public
static
Long
longStr2Long
(
String
strDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
.
getTime
();
}
/**
* 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
*
* @param dateDate
* @return
*/
public
static
String
date2LongStr
(
Date
dateDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
/**
* 将短时间格式时间转换为字符串 yyyy-MM-dd
*
* @param dateDate
* @param k
* @return
*/
public
static
String
date2ShortStr
(
java
.
util
.
Date
dateDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
/**
*
* <pre>
*
* </pre>
*
* @param l
* @param dateFormat
* @return
*/
public
static
String
long2Str
(
long
l
,
String
dateFormat
)
{
if
(
l
==
0
)
{
return
""
;
}
try
{
Date
dateDate
=
new
Date
(
l
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
dateFormat
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
/**
* 把LONG数据类型转换为字符串
*
* @param l
* @return
*/
public
static
String
long2LongStr
(
long
l
)
{
if
(
l
==
0
)
{
return
""
;
}
try
{
Date
dateDate
=
new
Date
(
l
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
/**
* 把LONG数据类型转换为字符串
*
* <pre>
*
* </pre>
*
* @param l
* @return
*/
public
static
String
long2ShortStr
(
long
l
)
{
if
(
l
==
0
)
{
return
""
;
}
try
{
Date
dateDate
=
new
Date
(
l
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
dateString
=
formatter
.
format
(
dateDate
);
return
dateString
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd
*
* @param strDate
* @return
*/
public
static
Date
shortStr2ShortDate
(
String
strDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
;
}
/**
* 提取一个月中的最后一天
*
* @param day
* @return
*/
public
static
Date
getLastDateOfThisMonth
(
long
day
)
{
Date
date
=
new
Date
();
long
date_3_hm
=
date
.
getTime
()
-
3600000
*
34
*
day
;
Date
date_3_hm_date
=
new
Date
(
date_3_hm
);
return
date_3_hm_date
;
}
/**
* 获取日期中的年
*
* @param date
* @return
*/
public
static
String
getYear
(
Date
date
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
date
);
String
year
;
year
=
dateString
.
substring
(
0
,
4
);
return
year
;
}
/**
* 得到现在小时
*/
public
static
String
getHour
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
currentTime
);
String
hour
;
hour
=
dateString
.
substring
(
11
,
13
);
return
hour
;
}
/**
* 得到现在分钟
*
* @return
*/
public
static
String
getMinute
()
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateString
=
formatter
.
format
(
currentTime
);
String
min
;
min
=
dateString
.
substring
(
14
,
16
);
return
min
;
}
/**
* 根据用户传入的时间表示格式,返回当前时间的格式 如果是yyyyMMdd,注意字母y不能大写。
*
* @param sformat
* yyyyMMddhhmmss
* @return
*/
public
static
String
parseDate
(
String
sformat
)
{
Date
currentTime
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
sformat
);
String
dateString
=
formatter
.
format
(
currentTime
);
return
dateString
;
}
/**
* 二个小时时间间的差值,必须保证二个时间都是"HH:MM"的格式,返回字符型的分钟
*/
public
static
String
getTwoHour
(
String
st1
,
String
st2
)
{
String
[]
kk
=
null
;
String
[]
jj
=
null
;
kk
=
st1
.
split
(
":"
);
jj
=
st2
.
split
(
":"
);
if
(
Integer
.
parseInt
(
kk
[
0
])
<
Integer
.
parseInt
(
jj
[
0
]))
return
"0"
;
else
{
double
y
=
Double
.
parseDouble
(
kk
[
0
])
+
Double
.
parseDouble
(
kk
[
1
])
/
60
;
double
u
=
Double
.
parseDouble
(
jj
[
0
])
+
Double
.
parseDouble
(
jj
[
1
])
/
60
;
if
((
y
-
u
)
>
0
)
return
y
-
u
+
""
;
else
return
"0"
;
}
}
/**
* 得到二个日期间的间隔天数
*/
public
static
String
getTwoDay
(
String
sj1
,
String
sj2
)
{
SimpleDateFormat
myFormatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
long
day
=
0
;
try
{
java
.
util
.
Date
date
=
myFormatter
.
parse
(
sj1
);
java
.
util
.
Date
mydate
=
myFormatter
.
parse
(
sj2
);
day
=
(
date
.
getTime
()
-
mydate
.
getTime
())
/
(
24
*
60
*
60
*
1000
);
}
catch
(
Exception
e
)
{
return
""
;
}
return
day
+
""
;
}
/**
* 时间前推或后推分钟,其中JJ表示分钟.
*/
public
static
String
getPreTime
(
String
sj1
,
String
jj
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
mydate1
=
""
;
try
{
Date
date1
=
format
.
parse
(
sj1
);
long
Time
=
(
date1
.
getTime
()
/
1000
)
+
Integer
.
parseInt
(
jj
)
*
60
;
date1
.
setTime
(
Time
*
1000
);
mydate1
=
format
.
format
(
date1
);
}
catch
(
Exception
e
)
{
mydate1
=
""
;
}
return
mydate1
;
}
/**
* 得到一个时间延后或前移几天的时间,nowdate为时间,delay为前移或后延的天数
*/
public
static
String
getNextDay
(
String
nowdate
,
String
delay
)
{
try
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
mdate
=
""
;
Date
d
=
shortStr2ShortDate
(
nowdate
);
long
myTime
=
(
d
.
getTime
()
/
1000
)
+
Integer
.
parseInt
(
delay
)
*
24
*
60
*
60
;
d
.
setTime
(
myTime
*
1000
);
mdate
=
format
.
format
(
d
);
return
mdate
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
/**
* 判断是否润年
*
* @param ddate
* @return
*/
public
static
boolean
isLeapYear
(
String
ddate
)
{
/**
* 详细设计: 1.被400整除是闰年,否则: 2.不能被4整除则不是闰年 3.能被4整除同时不能被100整除则是闰年
* 3.能被4整除同时能被100整除则不是闰年
*/
Date
d
=
shortStr2ShortDate
(
ddate
);
GregorianCalendar
gc
=
(
GregorianCalendar
)
Calendar
.
getInstance
();
gc
.
setTime
(
d
);
int
year
=
gc
.
get
(
Calendar
.
YEAR
);
if
((
year
%
400
)
==
0
)
return
true
;
else
if
((
year
%
4
)
==
0
)
{
if
((
year
%
100
)
==
0
)
return
false
;
else
return
true
;
}
else
return
false
;
}
/**
* 返回美国时间格式 26 Apr 2006
*
* @param str
* @return
*/
public
static
String
getEDate
(
String
str
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
str
,
pos
);
String
j
=
strtodate
.
toString
();
String
[]
k
=
j
.
split
(
" "
);
return
k
[
2
]
+
k
[
1
].
toUpperCase
()
+
k
[
5
].
substring
(
2
,
4
);
}
/**
* 获取一个月的最后一天
*
* @param dat
* @return
*/
public
static
String
getEndDateOfMonth
(
String
dat
)
{
// yyyy-MM-dd
String
str
=
dat
.
substring
(
0
,
8
);
String
month
=
dat
.
substring
(
5
,
7
);
int
mon
=
Integer
.
parseInt
(
month
);
if
(
mon
==
1
||
mon
==
3
||
mon
==
5
||
mon
==
7
||
mon
==
8
||
mon
==
10
||
mon
==
12
)
{
str
+=
"31"
;
}
else
if
(
mon
==
4
||
mon
==
6
||
mon
==
9
||
mon
==
11
)
{
str
+=
"30"
;
}
else
{
if
(
isLeapYear
(
dat
))
{
str
+=
"29"
;
}
else
{
str
+=
"28"
;
}
}
return
str
;
}
/**
* 判断二个时间是否在同一个周
*
* @param date1
* @param date2
* @return
*/
public
static
boolean
isSameWeekDates
(
Date
date1
,
Date
date2
)
{
Calendar
cal1
=
Calendar
.
getInstance
();
Calendar
cal2
=
Calendar
.
getInstance
();
cal1
.
setTime
(
date1
);
cal2
.
setTime
(
date2
);
int
subYear
=
cal1
.
get
(
Calendar
.
YEAR
)
-
cal2
.
get
(
Calendar
.
YEAR
);
if
(
0
==
subYear
)
{
if
(
cal1
.
get
(
Calendar
.
WEEK_OF_YEAR
)
==
cal2
.
get
(
Calendar
.
WEEK_OF_YEAR
))
return
true
;
}
else
if
(
1
==
subYear
&&
11
==
cal2
.
get
(
Calendar
.
MONTH
))
{
// 如果12月的最后一周横跨来年第一周的话则最后一周即算做来年的第一周
if
(
cal1
.
get
(
Calendar
.
WEEK_OF_YEAR
)
==
cal2
.
get
(
Calendar
.
WEEK_OF_YEAR
))
return
true
;
}
else
if
(-
1
==
subYear
&&
11
==
cal1
.
get
(
Calendar
.
MONTH
))
{
if
(
cal1
.
get
(
Calendar
.
WEEK_OF_YEAR
)
==
cal2
.
get
(
Calendar
.
WEEK_OF_YEAR
))
return
true
;
}
return
false
;
}
/**
* 产生周序列,即得到当前时间所在的年度是第几周
*
* @return
*/
public
static
String
getSeqWeek
()
{
Calendar
c
=
Calendar
.
getInstance
(
Locale
.
CHINA
);
String
week
=
Integer
.
toString
(
c
.
get
(
Calendar
.
WEEK_OF_YEAR
));
if
(
week
.
length
()
==
1
)
week
=
"0"
+
week
;
String
year
=
Integer
.
toString
(
c
.
get
(
Calendar
.
YEAR
));
return
year
+
week
;
}
/**
* 获得一个日期所在的周的星期几的日期,如要找出2002年2月3日所在周的星期一是几号
*
* @param sdate
* @param num
* @return
*/
public
static
String
getWeek
(
String
sdate
,
String
num
)
{
// 再转换为时间
Date
dd
=
shortStr2ShortDate
(
sdate
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
dd
);
if
(
num
.
equals
(
"1"
))
// 返回星期一所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
MONDAY
);
else
if
(
num
.
equals
(
"2"
))
// 返回星期二所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
TUESDAY
);
else
if
(
num
.
equals
(
"3"
))
// 返回星期三所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
WEDNESDAY
);
else
if
(
num
.
equals
(
"4"
))
// 返回星期四所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
THURSDAY
);
else
if
(
num
.
equals
(
"5"
))
// 返回星期五所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
FRIDAY
);
else
if
(
num
.
equals
(
"6"
))
// 返回星期六所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
SATURDAY
);
else
if
(
num
.
equals
(
"0"
))
// 返回星期日所在的日期
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
SUNDAY
);
return
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
c
.
getTime
());
}
/**
* 根据一个日期,返回是星期几的字符串
*
* @param sdate
* @return
*/
public
static
String
getWeek
(
String
sdate
)
{
// 再转换为时间
Date
date
=
shortStr2ShortDate
(
sdate
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
// int hour=c.get(Calendar.DAY_OF_WEEK);
// hour中存的就是星期几了,其范围 1~7
// 1=星期日 7=星期六,其他类推
return
new
SimpleDateFormat
(
"EEEE"
).
format
(
c
.
getTime
());
}
public
static
String
getWeekStr
(
String
sdate
)
{
String
str
=
""
;
str
=
getWeek
(
sdate
);
if
(
"1"
.
equals
(
str
))
{
str
=
"星期日"
;
}
else
if
(
"2"
.
equals
(
str
))
{
str
=
"星期一"
;
}
else
if
(
"3"
.
equals
(
str
))
{
str
=
"星期二"
;
}
else
if
(
"4"
.
equals
(
str
))
{
str
=
"星期三"
;
}
else
if
(
"5"
.
equals
(
str
))
{
str
=
"星期四"
;
}
else
if
(
"6"
.
equals
(
str
))
{
str
=
"星期五"
;
}
else
if
(
"7"
.
equals
(
str
))
{
str
=
"星期六"
;
}
return
str
;
}
/**
* 两个时间之间的天数
*
* @param date1
* @param date2
* @return
*/
public
static
long
getDays
(
String
date1
,
String
date2
)
{
if
(
date1
==
null
||
date1
.
equals
(
""
))
return
0
;
if
(
date2
==
null
||
date2
.
equals
(
""
))
return
0
;
// 转换为标准时间
SimpleDateFormat
myFormatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
java
.
util
.
Date
date
=
null
;
java
.
util
.
Date
mydate
=
null
;
try
{
date
=
myFormatter
.
parse
(
date1
);
mydate
=
myFormatter
.
parse
(
date2
);
}
catch
(
Exception
e
)
{
;
}
long
day
=
(
date
.
getTime
()
-
mydate
.
getTime
())
/
(
24
*
60
*
60
*
1000
);
return
day
;
}
/**
* 形成如下的日历 , 根据传入的一个时间返回一个结构 星期日 星期一 星期二 星期三 星期四 星期五 星期六 下面是当月的各个时间
* 此函数返回该日历第一行星期日所在的日期
*
* @param sdate
* @return
*/
public
static
String
getNowMonth
(
String
sdate
)
{
// 取该时间所在月的一号
sdate
=
sdate
.
substring
(
0
,
8
)
+
"01"
;
// 得到这个月的1号是星期几
Date
date
=
shortStr2ShortDate
(
sdate
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
int
u
=
c
.
get
(
Calendar
.
DAY_OF_WEEK
);
String
newday
=
DateUtil
.
getNextDay
(
sdate
,
(
1
-
u
)
+
""
);
return
newday
;
}
/**
* 取得数据库主键 生成格式为yyyymmddhhmmss+k位随机数
*
* @param k
* 表示是取几位随机数,可以自己定
*/
public
static
String
getNo
(
int
k
)
{
return
parseDate
(
"yyyyMMddhhmmss"
)
+
getRandom
(
k
);
}
/**
* 返回一个随机数
*
* @param i
* @return
*/
private
static
String
getRandom
(
int
i
)
{
Random
jjj
=
new
Random
();
// int suiJiShu = jjj.nextInt(9);
if
(
i
==
0
)
return
""
;
String
jj
=
""
;
for
(
int
k
=
0
;
k
<
i
;
k
++)
{
jj
=
jj
+
jjj
.
nextInt
(
9
);
}
return
jj
;
}
/**
*
* @param args
*/
public
static
boolean
rightDate
(
String
date
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
if
(
date
==
null
)
return
false
;
if
(
date
.
length
()
>
10
)
{
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
}
else
{
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
}
try
{
sdf
.
parse
(
date
);
}
catch
(
ParseException
e
)
{
return
false
;
}
return
true
;
}
public
static
void
main
(
String
[]
args
)
{
//
}
/**
* 将date 按照指定 的 格式 formatStr 转换成 字符串
*
* @param date
* @param formatStr
* @return
*/
public
static
String
date2Str
(
Date
date
,
String
formatStr
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
formatStr
);
String
dateString
=
formatter
.
format
(
date
);
return
dateString
;
}
/**
* 增加hours小時
*
* @param date
* @param hours
* @return
*/
public
static
Date
addHours
(
Date
date
,
int
hours
)
{
if
(
date
==
null
)
return
null
;
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
add
(
Calendar
.
HOUR_OF_DAY
,
hours
);
// 24小时制
// cal.add(Calendar.HOUR, x);12小时制
date
=
cal
.
getTime
();
return
date
;
}
/**
* 增加minutes分鐘
*
* @param date
* @param minutes
* @return
*/
public
static
Date
addMinutes
(
Date
date
,
int
minutes
)
{
if
(
date
==
null
)
return
null
;
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
add
(
Calendar
.
MINUTE
,
minutes
);
//
date
=
cal
.
getTime
();
return
date
;
}
/**
* 功能描述:格式化日期
*
* @param dateStr
* String 字符型日期
* @param format
* String 格式
* @return Date 日期
*/
public
static
Date
parseDate
(
String
dateStr
,
String
format
)
{
Date
date
=
null
;
try
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
format
);
date
=
(
Date
)
dateFormat
.
parse
(
dateStr
);
}
catch
(
Exception
e
)
{
}
return
date
;
}
// 指定模式的时间格式
private
static
SimpleDateFormat
getSDFormat
(
String
pattern
)
{
return
new
SimpleDateFormat
(
pattern
);
}
/**
* 当前日历,这里用中国时间表示
*
* @return 以当地时区表示的系统当前日历
*/
public
static
Calendar
getCalendar
()
{
return
Calendar
.
getInstance
();
}
/**
* 默认日期按指定格式显示
*
* @param pattern
* 指定的格式
* @return 默认日期按指定格式显示
*/
public
static
String
formatDate
(
String
pattern
)
{
return
getSDFormat
(
pattern
).
format
(
getCalendar
().
getTime
());
}
/**
* 获取当前时间任意
* @return
*/
public
static
String
get
(
int
field
)
{
return
String
.
valueOf
(
getCalendar
().
get
(
field
));
}
/**
* 获取今日的开始时间
* @return
*/
public
static
Date
getTodayBeginTime
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
Date
today
=
calendar
.
getTime
();
return
today
;
}
/**
* 获取今日的结束时间
* @return
*/
public
static
Date
getTodayEndTime
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
Date
today
=
calendar
.
getTime
();
return
today
;
}
/**
* 获取两个时间相差的 *小时*分钟
* @param endDate
* @param nowDate
* @return
*/
public
static
String
getDatePoorToMin
(
Date
endDate
,
Date
nowDate
)
{
// long nd = 1000 * 24 * 60 * 60;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long
diff
=
endDate
.
getTime
()
-
nowDate
.
getTime
();
// 计算差多少天
// long day = diff / nd;
// 计算差多少小时
long
hour
=
diff
/
nh
;
// 计算差多少分钟
long
min
=
diff
%
nh
/
nm
;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return
hour
+
"小时"
+
min
+
"分钟"
;
}
public
static
String
getDatePoorToSec
(
Date
endDate
,
Date
nowDate
)
{
long
nd
=
1000
*
24
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
long
ss
=
1000
;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long
diff
=
endDate
.
getTime
()
-
nowDate
.
getTime
();
// 计算差多少天
long
day
=
diff
/
nd
;
// 计算差多少小时
long
hour
=
diff
%
nd
/
nh
;
// 计算差多少分钟
long
min
=
diff
%
nd
%
nh
/
nm
;
long
sen
=
diff
%
nd
%
nh
%
nm
/
ss
;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return
day
+
"天"
+
hour
+
"小时"
+
min
+
"分钟"
+
sen
+
"秒"
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/BasicEntity.java
View file @
b2fe25f9
...
...
@@ -13,7 +13,6 @@ import javax.persistence.MappedSuperclass;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
com.yeejoin.amos.op.core.entity.Resource
;
/**
* <pre>
...
...
@@ -25,7 +24,7 @@ import com.yeejoin.amos.op.core.entity.Resource;
@MappedSuperclass
@EntityListeners
(
AuditingEntityListener
.
class
)
public
class
BasicEntity
extends
Resource
implements
Serializable
{
public
class
BasicEntity
/*extends Resource*/
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5464322936854328207L
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/BusinessEntity.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.EntityListeners
;
import
javax.persistence.MappedSuperclass
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
/**
*
* <pre>
* 涓氬姟瀹炰綋鎶借薄绫�
* </pre>
*
* @author as-guowubin
* @version $Id: BusinessEntity.java, v 0.1 2018骞�5鏈�18鏃� 涓嬪崍2:27:17 as-guowubin Exp $
*/
@MappedSuperclass
@EntityListeners
(
value
=
AuditingEntityListener
.
class
)
public
abstract
class
BusinessEntity
implements
Serializable
{
/**
* <pre>
*
* </pre>
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* 鍒涘缓鏃堕棿
*/
@Column
(
name
=
"create_date"
,
updatable
=
false
)
private
Date
createDate
;
/**
* 鍒涘缓鐢ㄦ埛
*/
@Column
(
name
=
"create_user"
,
updatable
=
false
)
private
String
createUser
;
/**
* 鏇存柊鏃堕棿
*/
@Column
(
name
=
"update_date"
)
private
Date
updateDate
;
/**
* 鏇存柊鐢ㄦ埛
*/
@Column
(
name
=
"update_user"
)
private
String
updateUser
;
/**
* 鏄惁鍒犻櫎
*/
@Column
(
name
=
"is_delete"
)
private
Boolean
isDelete
=
false
;
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
String
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
String
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Date
getUpdateDate
()
{
return
updateDate
;
}
public
void
setUpdateDate
(
Date
updateDate
)
{
this
.
updateDate
=
updateDate
;
}
public
String
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
String
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
public
Boolean
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Boolean
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyOriginalData.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.yeejoin.amos.op.core.entity.BusinessEntity
;
import
org.hibernate.annotations.GenericGenerator
;
import
javax.persistence.*
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.yeejoin.amos.op.core.entity.BusinessEntity
;
import
org.hibernate.annotations.GenericGenerator
;
import
javax.persistence.*
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Equipment.java
View file @
b2fe25f9
...
...
@@ -20,6 +20,8 @@ public class Equipment extends BasicEntity {
private
String
building
;
/**
* 所属风险区域id
*/
...
...
@@ -102,7 +104,7 @@ public class Equipment extends BasicEntity {
@Column
(
name
=
"create_by"
)
private
int
createBy
;
private
String
createBy
;
private
String
name
;
...
...
@@ -162,11 +164,11 @@ public class Equipment extends BasicEntity {
this
.
code
=
code
;
}
public
int
getCreateBy
()
{
public
String
getCreateBy
()
{
return
this
.
createBy
;
}
public
void
setCreateBy
(
int
createBy
)
{
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FireCar.java
View file @
b2fe25f9
...
...
@@ -23,7 +23,7 @@ public class FireCar extends BasicEntity {
private
String
country
;
@Column
(
name
=
"create_by"
)
private
int
createBy
;
private
String
createBy
;
@Column
(
name
=
"engine_num"
)
private
String
engineNum
;
...
...
@@ -95,11 +95,11 @@ public class FireCar extends BasicEntity {
this
.
country
=
country
;
}
public
int
getCreateBy
()
{
public
String
getCreateBy
()
{
return
this
.
createBy
;
}
public
void
setCreateBy
(
int
createBy
)
{
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FireEquipment.java
View file @
b2fe25f9
...
...
@@ -37,7 +37,7 @@ public class FireEquipment extends BasicEntity {
private
Boolean
isIndoor
;
@Column
(
name
=
"create_by"
)
private
int
createBy
;
private
String
createBy
;
@Temporal
(
TemporalType
.
DATE
)
@Column
(
name
=
"effective_date"
)
...
...
@@ -181,11 +181,11 @@ public class FireEquipment extends BasicEntity {
this
.
code
=
code
;
}
public
int
getCreateBy
()
{
public
String
getCreateBy
()
{
return
this
.
createBy
;
}
public
void
setCreateBy
(
int
createBy
)
{
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FireEquipmentPoint.java
View file @
b2fe25f9
...
...
@@ -21,7 +21,7 @@ public class FireEquipmentPoint extends BasicEntity {
private
String
code
;
@Column
(
name
=
"create_by"
)
private
Lo
ng
createBy
;
private
Stri
ng
createBy
;
@Column
(
name
=
"fire_equipment_id"
)
private
Long
fireEquipmentId
;
...
...
@@ -50,11 +50,11 @@ public class FireEquipmentPoint extends BasicEntity {
this
.
code
=
code
;
}
public
Lo
ng
getCreateBy
()
{
public
Stri
ng
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
Lo
ng
createBy
)
{
public
void
setCreateBy
(
Stri
ng
createBy
)
{
this
.
createBy
=
createBy
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
View file @
b2fe25f9
...
...
@@ -23,7 +23,7 @@ public class Fmea extends BasicEntity {
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"create_by"
)
private
int
createBy
;
private
String
createBy
;
@Lob
private
String
disposal
;
...
...
@@ -79,16 +79,16 @@ public class Fmea extends BasicEntity {
private
RiskSource
riskSource
;
@Column
(
name
=
"company_leader"
)
private
Lo
ng
companyLeader
;
private
Stri
ng
companyLeader
;
@Column
(
name
=
"department_leader"
)
private
Lo
ng
departmentLeader
;
private
Stri
ng
departmentLeader
;
@Column
(
name
=
"group_leader"
)
private
Lo
ng
groupLeader
;
private
Stri
ng
groupLeader
;
@Column
(
name
=
"person_leader"
)
private
Lo
ng
personLeader
;
private
Stri
ng
personLeader
;
@Column
(
name
=
"identify_user"
)
private
Integer
identifyUser
;
...
...
@@ -99,11 +99,11 @@ public class Fmea extends BasicEntity {
public
Fmea
()
{
}
public
int
getCreateBy
()
{
public
String
getCreateBy
()
{
return
this
.
createBy
;
}
public
void
setCreateBy
(
int
createBy
)
{
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
...
...
@@ -266,35 +266,35 @@ public class Fmea extends BasicEntity {
this
.
rpn
=
rpn
;
}
public
Lo
ng
getCompanyLeader
()
{
public
Stri
ng
getCompanyLeader
()
{
return
companyLeader
;
}
public
void
setCompanyLeader
(
Lo
ng
companyLeader
)
{
public
void
setCompanyLeader
(
Stri
ng
companyLeader
)
{
this
.
companyLeader
=
companyLeader
;
}
public
Lo
ng
getDepartmentLeader
()
{
public
Stri
ng
getDepartmentLeader
()
{
return
departmentLeader
;
}
public
void
setDepartmentLeader
(
Lo
ng
departmentLeader
)
{
public
void
setDepartmentLeader
(
Stri
ng
departmentLeader
)
{
this
.
departmentLeader
=
departmentLeader
;
}
public
Lo
ng
getGroupLeader
()
{
public
Stri
ng
getGroupLeader
()
{
return
groupLeader
;
}
public
void
setGroupLeader
(
Lo
ng
groupLeader
)
{
public
void
setGroupLeader
(
Stri
ng
groupLeader
)
{
this
.
groupLeader
=
groupLeader
;
}
public
Lo
ng
getPersonLeader
()
{
public
Stri
ng
getPersonLeader
()
{
return
personLeader
;
}
public
void
setPersonLeader
(
Lo
ng
personLeader
)
{
public
void
setPersonLeader
(
Stri
ng
personLeader
)
{
this
.
personLeader
=
personLeader
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/NodeMessageView.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.yeejoin.amos.op.core.util.DateUtil
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PPoint.java
View file @
b2fe25f9
...
...
@@ -92,10 +92,10 @@ public class PPoint extends BasicEntity {
private
Boolean
isDelete
;
// '是否删除:0表示未删除,1表示已删除',
@Column
(
name
=
"charge_dept_id"
)
private
Integer
chargeDeptId
;
// '责任部门id',
private
String
chargeDeptId
;
// '责任部门id',
@Column
(
name
=
"charge_person_id"
)
private
Lo
ng
chargePersonId
;
// '负责人id',
private
Stri
ng
chargePersonId
;
// '负责人id',
@Column
(
name
=
"status"
)
private
String
status
;
// '状态:0 未纳入巡检,1 合格;2 不合格;3 漏检',
...
...
@@ -310,19 +310,19 @@ public class PPoint extends BasicEntity {
isDelete
=
delete
;
}
public
Integer
getChargeDeptId
()
{
public
String
getChargeDeptId
()
{
return
chargeDeptId
;
}
public
void
setChargeDeptId
(
Integer
chargeDeptId
)
{
public
void
setChargeDeptId
(
String
chargeDeptId
)
{
this
.
chargeDeptId
=
chargeDeptId
;
}
public
Lo
ng
getChargePersonId
()
{
public
Stri
ng
getChargePersonId
()
{
return
chargePersonId
;
}
public
void
setChargePersonId
(
Lo
ng
chargePersonId
)
{
public
void
setChargePersonId
(
Stri
ng
chargePersonId
)
{
this
.
chargePersonId
=
chargePersonId
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/SCompany.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
/*
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
...
...
@@ -11,9 +11,9 @@ import java.io.Serializable;
import java.util.Date;
/**
*/
/**
* The persistent class for the s_company database table.
*/
*/
/*
@Entity
@Table(name = "s_company")
@NamedQuery(name = "SCompany.findAll", query = "SELECT s FROM SCompany s")
...
...
@@ -247,4 +247,4 @@ public class SCompany implements Serializable {
this.updateUser = updateUser;
}
}
\ No newline at end of file
}*/
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/SDepartment.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
/*
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
...
...
@@ -11,9 +11,9 @@ import java.io.Serializable;
import java.util.Date;
/**
*/
/**
* The persistent class for the s_department database table.
*/
*/
/*
@Entity
@Table(name = "s_department")
@NamedQuery(name = "SDepartment.findAll", query = "SELECT s FROM SDepartment s")
...
...
@@ -145,4 +145,4 @@ public class SDepartment implements Serializable {
this.updateUser = updateUser;
}
}
\ No newline at end of file
}*/
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/SUser.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
/*
package com.yeejoin.amos.fas.dao.entity;
import org.hibernate.annotations.Where;
...
...
@@ -13,9 +13,9 @@ import java.io.Serializable;
import java.util.Date;
/**
*/
/**
* The persistent class for the s_user database table.
*/
*/
/*
@Entity
@Table(name = "s_user")
@NamedQuery(name = "SUser.findAll", query = "SELECT s FROM SUser s")
...
...
@@ -256,4 +256,4 @@ public class SUser implements Serializable {
this.userName = userName;
}
}
\ No newline at end of file
}*/
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/TopographyLine.java
View file @
b2fe25f9
...
...
@@ -8,7 +8,6 @@ import javax.persistence.Table;
import
org.hibernate.annotations.GenericGenerator
;
import
com.yeejoin.amos.op.core.entity.BusinessEntity
;
/**
* 拓扑图连线
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/TopographyNode.java
View file @
b2fe25f9
...
...
@@ -8,7 +8,6 @@ import javax.persistence.Table;
import
org.hibernate.annotations.GenericGenerator
;
import
com.yeejoin.amos.op.core.entity.BusinessEntity
;
/**
* 拓扑图
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/TopographyNodeDetail.java
View file @
b2fe25f9
...
...
@@ -5,11 +5,7 @@ import javax.persistence.Entity;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
org.hibernate.annotations.GenericGenerator
;
import
com.yeejoin.amos.op.core.entity.BusinessEntity
;
/**
* 拓扑图-节点详情
*
...
...
YeeAmosFireAutoSysService/pom.xml
View file @
b2fe25f9
...
...
@@ -23,6 +23,12 @@
<artifactId>
YeeAmosFireAutoSysCommon
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.jsoup
</groupId>
<artifactId>
jsoup
</artifactId>
<version>
1.8.3
</version>
</dependency>
<!-- <dependency>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAMOSPatrolCommon</artifactId>
...
...
@@ -42,7 +48,7 @@
<!-- <version>${YeeOp.version}</version>-->
<!-- </dependency>-->
<dependency>
<
!-- <
dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-cache</artifactId>
<version>1.1.13-Ty</version>
...
...
@@ -56,15 +62,37 @@
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-redis
</artifactId>
<version>
1.4.5.RELEASE
</version>
</dependency>
<!-- 平台接口 -->
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-privilege
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-feign
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>com.yeejoin.amos</groupId>
<artifactId>amos-authtoken</artifactId>
<version>${YeeSecurity.version}</version>
...
...
@@ -78,7 +106,7 @@
<artifactId>spring-security-config</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
-->
<dependency>
<groupId>
cn.afterturn
</groupId>
<artifactId>
easypoi-base
</artifactId>
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/AccidentTypeController.java
View file @
b2fe25f9
...
...
@@ -15,12 +15,13 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IAccidentTypeService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.AccidentType
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.entity.User
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -58,7 +59,9 @@ public class AccidentTypeController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"事故类型查询不分页"
,
notes
=
"事故类型查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskLevel
()
{
List
<
HashMap
<
String
,
Object
>>
list
=
iAccidentTypeService
.
queryAccidentType
(
getOrgCode
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
HashMap
<
String
,
Object
>>
list
=
iAccidentTypeService
.
queryAccidentType
(
compCode
);
return
CommonResponseUtil
.
success
(
list
);
}
...
...
@@ -71,11 +74,15 @@ public class AccidentTypeController extends BaseController {
@RequestMapping
(
value
=
"/editAccidentType"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"事故类型对象"
,
required
=
true
)
@RequestBody
AccidentType
param
)
{
try
{
User
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
dep
=
getDepartmentId
(
reginParams
);
String
compCode
=
getOrgCode
(
reginParams
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"dept_id"
,
user
.
getDepartment
()
==
null
?
"0"
:
user
.
getDepartment
().
getId
()
);
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
()
);
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"dept_id"
,
dep
);
map
.
put
(
"org_code"
,
compCode
);
map
.
put
(
"user_id"
,
user
.
get
User
Id
());
map
.
put
(
"param"
,
param
);
iAccidentTypeService
.
editAccidentType
(
map
);
return
CommonResponseUtil
.
success
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/AlarmController.java
View file @
b2fe25f9
...
...
@@ -15,8 +15,8 @@ import com.yeejoin.amos.fas.business.service.intfc.IAlarmService;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
op
.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
import
com.yeejoin.amos.
fas
.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/BaseController.java
View file @
b2fe25f9
...
...
@@ -11,17 +11,24 @@ import javax.servlet.http.HttpServletRequest;
import
javax.validation.ConstraintViolationException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.transaction.TransactionSystemException
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.enums.QueryOperatorEnum
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.op.core.common.query.DaoCriteria
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.security.common.remote.RemoteSecurityServer
;
import
com.yeejoin.amos.security.entity.User
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -34,11 +41,11 @@ import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
@RestController
@RequestMapping
(
"/base"
)
@Authorization
//
@Authorization
public
class
BaseController
{
@Autowired
private
RemoteSecurityServer
remoteSecurityServer
;
//
@Autowired
//
private RemoteSecurityServer remoteSecurityServer;
@Autowired
protected
HttpServletRequest
request
;
...
...
@@ -58,18 +65,49 @@ public class BaseController {
*/
protected
static
final
int
DEFAULT_PAGE_SIZE
=
10
;
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
protected
String
getToken
()
{
/* Get token from header */
String
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
/* If token not found get it from request parameter */
if
(
authToken
==
null
)
{
authToken
=
request
.
getParameter
(
"token"
);
}
return
authToken
;
}
protected
String
getToken
()
{
String
authToken
=
request
.
getHeader
(
"token"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
}
return
authToken
;
}
protected
String
getProduct
()
{
String
authToken
=
request
.
getHeader
(
"product"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getParameter
(
"product"
);
}
return
authToken
;
}
protected
String
getAppKey
()
{
String
authToken
=
request
.
getHeader
(
"appKey"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getParameter
(
"appKey"
);
}
return
authToken
;
}
//redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
//return "region_" + userId + "_" + token.substring(0, token.indexOf('_', 1));
return
"region_"
+
userId
+
"_"
+
token
;
}
protected
void
saveSelectedOrgInfo
(
ReginParams
reginParams
)
{
redisTemplate
.
opsForValue
().
set
(
buildKey
(
getUserId
(),
getToken
()),
JSONObject
.
toJSONString
(
reginParams
));
}
protected
ReginParams
getSelectedOrgInfo
()
{
return
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
getUserId
(),
getToken
())),
ReginParams
.
class
);
}
/**
*
...
...
@@ -79,65 +117,80 @@ public class BaseController {
*
* @return
*/
protected
boolean
isDirector
()
{
if
(
getUserInfo
()
==
null
){
return
false
;
}
return
getUserInfo
().
getRole
().
getRoleType
()
!=
3
;
}
//
protected boolean isDirector()
//
{
//
if(getUserInfo() == null){
//
return false;
//
}
//
return getUserInfo().getRole().getRoleType() != 3;
//
}
/**
* 获取用户角色id
* @return
*/
protected
String
getRoleId
()
/*
protected String getRoleId()
{
if(getUserInfo() == null){
return "";
}
return getUserInfo().getRole().getRoleType().toString();
}
}
*/
/**
* 当前登录用户信息
*/
protected
User
getUserInfo
()
{
if
(
getToken
()
==
null
){
return
null
;
}
return
remoteSecurityServer
.
loginAuthentication
(
getToken
());
}
protected
AgencyUserModel
getUserInfo
()
{
AgencyUserModel
userModel
=
null
;
if
(
getToken
()!=
null
){
RequestContext
.
setToken
(
getToken
());
RequestContext
.
setProduct
(
getProduct
());
RequestContext
.
setAppKey
(
getAppKey
());
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
userModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
}
return
userModel
;
// return CurrentAuthentication.getAuthenticatedUserThreadLocal();
}
protected
Lo
ng
getUserId
()
protected
Stri
ng
getUserId
()
{
Lo
ng
userId
=
null
;
Stri
ng
userId
=
null
;
if
(
getUserInfo
()
!=
null
)
{
userId
=
getUserInfo
().
getId
();
userId
=
getUserInfo
().
get
User
Id
();
}
return
userId
;
}
protected
Long
getCompanyId
()
{
Long
companyId
=
null
;
if
(
getUserInfo
()
!=
null
)
{
companyId
=
getUserInfo
().
getCompany
().
getId
();
}
return
companyId
;
}
protected
String
getCompanyId
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getSequenceNbr
();
}
return
null
;
}
/**
* 获取当前用户所属公司名称
* @return
*/
protected
String
getCurrentCompanyNameOfUser
(){
if
(
getUserInfo
()
==
null
){
return
""
;
protected
String
getCurrentCompanyNameOfUser
()
{
if
(
getUserInfo
()
==
null
)
{
return
""
;
}
return
getSelectedOrgInfo
().
getCompany
().
getCompanyName
();
}
return
getUserInfo
().
getCompany
().
getCompanyName
();
}
/**
...
...
@@ -158,12 +211,39 @@ public class BaseController {
* 获取公司orgcode
* @return
*/
protected
String
getOrgCode
(){
if
(
getUserInfo
()
==
null
){
return
""
;
}
return
getUserInfo
().
getCompany
().
getCompCode
();
}
protected
String
getCompanyName
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getCompanyName
();
}
return
null
;
}
protected
String
getDepartmentId
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getDepartment
()
!=
null
)
{
return
reginParams
.
getDepartment
().
getSequenceNbr
();
}
return
null
;
}
protected
String
getOrgCode
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
// if (reginParams.getDepartment() != null) {
// return reginParams.getDepartment().getDeptOrgCode();
// }
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getOrgCode
();
}
return
null
;
}
/**
* 生成查询条件
...
...
@@ -211,7 +291,7 @@ public class BaseController {
* 暂时未用到
* @return
*/
public
List
<
DaoCriteria
>
buildDaoCriteriasNoParam
()
{
/*
public List<DaoCriteria> buildDaoCriteriasNoParam() {
List<DaoCriteria> daoCriterias = new ArrayList<DaoCriteria>();
String orgCode = getOrgCode();
if(isDirector()){
...
...
@@ -220,7 +300,7 @@ public class BaseController {
daoCriterias = buildOrgDaoCriteriaOutChildren(daoCriterias,orgCode);
}
return daoCriterias;
}
}
*/
/**
*
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/BizMessageController.java
View file @
b2fe25f9
...
...
@@ -3,11 +3,12 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.service.intfc.IBizMessageService
;
import
com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -26,7 +27,7 @@ public class BizMessageController extends BaseController{
@Autowired
IBizMessageService
iBizMessageService
;
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询消息"
,
notes
=
"分页查询消息"
)
@RequestMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
forPage
(
...
...
@@ -37,8 +38,10 @@ public class BizMessageController extends BaseController{
@RequestParam
int
pageSize
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
iBizMessageService
.
queryForPage
(
StringUtils
.
trimToNull
(
time
),
StringUtils
.
trimToNull
(
type
),
StringUtils
.
trimToNull
(
title
),
StringUtils
.
trimToNull
(
this
.
getOrgCode
().
split
(
"_"
)[
0
]
),
commonPageable
));
return
CommonResponseUtil
.
success
(
iBizMessageService
.
queryForPage
(
StringUtils
.
trimToNull
(
time
),
StringUtils
.
trimToNull
(
type
),
StringUtils
.
trimToNull
(
title
),
StringUtils
.
trimToNull
(
compCode
),
commonPageable
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/CommonController.java
View file @
b2fe25f9
...
...
@@ -3,13 +3,13 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.business.param.QueryParamUtil
;
import
com.yeejoin.amos.fas.business.service.intfc.ICommonService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.dao.entity.SDepartment
;
import
com.yeejoin.amos.fas.dao.entity.SUser
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -41,11 +41,12 @@ public class CommonController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前用户获取公司下部门信息"
,
notes
=
"根据当前用户获取公司下部门信息"
)
@RequestMapping
(
value
=
"/deptment/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getDeptments
()
{
Long
companyId
=
getCompanyId
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
companyId
=
getCompanyId
(
reginParams
);
if
(
companyId
==
null
)
{
return
CommonResponseUtil
.
failure
(
"公司信息获取失败!"
);
}
List
<
SDepartment
>
deps
=
commonService
.
getDepartment
(
companyId
);
List
<
DepartmentModel
>
deps
=
commonService
.
getDepartment
(
getToken
(),
getProduct
(),
getAppKey
(),
companyId
);
return
CommonResponseUtil
.
success
(
deps
);
}
...
...
@@ -79,7 +80,7 @@ public class CommonController extends BaseController {
* @param
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
value
=
"查询巡检点项信息"
,
notes
=
"查询巡检点项信息"
)
@PostMapping
(
value
=
"/pointInputlist"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getPointInputs
(
...
...
@@ -105,18 +106,20 @@ public class CommonController extends BaseController {
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据部门获取部门人员信息"
,
notes
=
"根据部门获取部门人员信息"
)
@RequestMapping
(
value
=
"/{departmentId}/user/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getUsers
(
@ApiParam
(
value
=
"部门ID"
,
required
=
true
)
@PathVariable
Lo
ng
departmentId
)
{
public
CommonResponse
getUsers
(
@ApiParam
(
value
=
"部门ID"
,
required
=
true
)
@PathVariable
Stri
ng
departmentId
)
{
if
(
departmentId
==
null
)
{
return
CommonResponseUtil
.
failure
(
"部门信息获取失败!"
);
}
List
<
SUser
>
users
=
commonService
.
getUsers
(
departmentId
);
List
<
AgencyUserModel
>
users
=
commonService
.
getUsers
(
getToken
(),
getProduct
(),
getAppKey
(),
departmentId
);
return
CommonResponseUtil
.
success
(
users
);
}
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取公司下人员列表"
,
notes
=
"获取公司下人员列表"
)
@GetMapping
(
value
=
"/user/list"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getAllUser
()
{
List
<
SUser
>
users
=
commonService
.
getAllUser
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
AgencyUserModel
>
users
=
commonService
.
getAllUser
(
getToken
(),
getProduct
(),
getAppKey
(),
compCode
);
return
CommonResponseUtil
.
success
(
users
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/DictController.java
View file @
b2fe25f9
...
...
@@ -13,11 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -37,7 +35,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据查询条件列出字典列表"
,
notes
=
"根据查询条件列出字典列表"
)
@RequestMapping
(
value
=
"/dict/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
page
(
Dict
dict
,
@ApiParam
(
value
=
"分页参数"
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
){
try
{
...
...
@@ -55,7 +53,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据查询条件列出字典列表"
,
notes
=
"根据查询条件列出字典列表"
)
@RequestMapping
(
value
=
"/dict/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
list
(
Dict
dict
){
try
{
List
<
Dict
>
dictList
=
dictService
.
getDictList
(
dict
);
...
...
@@ -72,7 +70,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据IDs查询字典详情"
,
notes
=
"根据IDs查询字典详情"
)
@RequestMapping
(
value
=
"/dict/list/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
list
(
Long
[]
ids
){
List
<
Dict
>
dictList
=
dictService
.
getDictListByIds
(
ids
);
return
CommonResponseUtil
.
success
(
dictList
);
...
...
@@ -84,7 +82,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据ID查询字典详情"
,
notes
=
"根据ID查询字典详情"
)
@RequestMapping
(
value
=
"/dict/list/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
list
(
long
id
){
Dict
dict
=
dictService
.
getDictById
(
id
);
return
CommonResponseUtil
.
success
(
dict
);
...
...
@@ -97,7 +95,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据ID删除字典"
,
notes
=
"根据ID删除字典"
)
@RequestMapping
(
value
=
"/dict/delete/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
delete
(
long
id
){
dictService
.
deleteDictById
(
id
);
return
CommonResponseUtil
.
success
();
...
...
@@ -109,7 +107,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据IDs删除字典"
,
notes
=
"根据IDs删除字典"
)
@RequestMapping
(
value
=
"/dict/delete/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
deletes
(
long
[]
ids
){
dictService
.
deleteDictByIds
(
ids
);
return
CommonResponseUtil
.
success
();
...
...
@@ -121,7 +119,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增字典"
,
notes
=
"新增字典"
)
@RequestMapping
(
value
=
"/dict/add"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
add
(
@RequestBody
Dict
dict
){
dictService
.
saveDict
(
dict
);
return
CommonResponseUtil
.
success
();
...
...
@@ -133,7 +131,7 @@ public class DictController extends BaseController{
*/
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑字典信息"
,
notes
=
"编辑字典信息"
)
@RequestMapping
(
value
=
"/dict/edit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore=true)
public
CommonResponse
edit
(
@RequestBody
Dict
dict
){
dictService
.
saveDict
(
dict
);
return
CommonResponseUtil
.
success
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentController.java
View file @
b2fe25f9
...
...
@@ -2,16 +2,17 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.param.ImgParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.op.core.common.query.DaoCriteria
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -42,9 +43,12 @@ public class EquipmentController extends BaseController {
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
create
(
@RequestBody
Equipment
equipment
)
throws
Exception
{
equipment
.
setCreateBy
(
this
.
getUserId
().
intValue
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
equipment
.
setCreateBy
(
getUserId
());
equipment
.
setCreateDate
(
new
Date
());
equipment
.
setOrgCode
(
this
.
getOrgCode
()
);
equipment
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iEquipService
.
save
(
equipment
));
}
...
...
@@ -90,7 +94,7 @@ public class EquipmentController extends BaseController {
* @param id
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"现场图查询"
,
notes
=
"现场图查询"
)
@RequestMapping
(
value
=
"/pre-picture"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryImpEquipImg
(
...
...
@@ -131,7 +135,7 @@ public class EquipmentController extends BaseController {
*
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"绑定消防设备"
,
notes
=
"绑定消防设备"
)
@RequestMapping
(
value
=
"/{id}/fireeqmt"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
bindFireEqumt
(
@PathVariable
(
"id"
)
Long
equipmentId
,
@RequestBody
List
<
EquipmentFireEquipment
>
equipmentFireEquipment
)
throws
Exception
{
...
...
@@ -146,7 +150,7 @@ public class EquipmentController extends BaseController {
*
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"解除绑定消防设备"
,
notes
=
"解除绑定消防设备"
)
@RequestMapping
(
value
=
"/{equipmentId}/fireeqmt/{fireEquipmentIds}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
bindFireEqumt
(
...
...
@@ -189,7 +193,7 @@ public class EquipmentController extends BaseController {
* @param img4 消防取水图
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"编辑装备及上传现场图"
,
notes
=
"编辑装备及上传现场图"
)
@RequestMapping
(
value
=
"/uploadEquipmentImg"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
uploadEquipmentImg
(
...
...
@@ -197,6 +201,8 @@ public class EquipmentController extends BaseController {
@RequestParam
(
value
=
"img2"
,
required
=
false
)
MultipartFile
img2
,
@RequestParam
(
value
=
"img3"
,
required
=
false
)
MultipartFile
img3
,
@RequestParam
(
value
=
"img4"
,
required
=
false
)
MultipartFile
img4
,
Equipment
equipment
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ImgParam
[]
imgs
=
new
ImgParam
[
4
];
ImgParam
imgParam1
=
new
ImgParam
();
imgParam1
.
setFile
(
img1
);
...
...
@@ -214,8 +220,8 @@ public class EquipmentController extends BaseController {
imgs
[
1
]
=
imgParam2
;
imgs
[
2
]
=
imgParam3
;
imgs
[
3
]
=
imgParam4
;
equipment
.
setOrgCode
(
this
.
getOrgCode
()
);
equipment
.
setCreateBy
(
this
.
getUserId
().
intValue
());
equipment
.
setOrgCode
(
compCode
);
equipment
.
setCreateBy
(
getUserId
());
iEquipService
.
saveEquipmentAndImg
(
imgs
,
equipment
);
return
CommonResponseUtil
.
success
();
}
...
...
@@ -226,7 +232,7 @@ public class EquipmentController extends BaseController {
* @param equipmentId
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定重点设备已经绑定的消防设备"
,
notes
=
"查询指定重点设备已经绑定的消防设备"
)
@GetMapping
(
value
=
"/videos"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
findVideoList
()
{
...
...
@@ -239,7 +245,7 @@ public class EquipmentController extends BaseController {
* @param equipmentId
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点装备详情"
,
notes
=
"重点装备详情"
)
@GetMapping
(
value
=
"/detail/{equipmentId}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
findEquipDetail
(
@PathVariable
Long
equipmentId
)
{
...
...
@@ -252,7 +258,7 @@ public class EquipmentController extends BaseController {
* @param equipmentId
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取所有重点装备无分页"
,
notes
=
"获取所有重点装备无分页"
)
@GetMapping
(
value
=
"/all"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
findAll
()
{
...
...
@@ -279,7 +285,7 @@ public class EquipmentController extends BaseController {
*
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取设备数据"
,
notes
=
"获取设备数据"
)
@RequestMapping
(
value
=
"/queryEquipmentDate/{code}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryEquipmentData
(
@PathVariable
String
code
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EvaModelController.java
View file @
b2fe25f9
...
...
@@ -9,8 +9,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IEvaModelService
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
op
.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
import
com.yeejoin.amos.
fas
.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ExcelController.java
View file @
b2fe25f9
...
...
@@ -6,10 +6,9 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam;
import
com.yeejoin.amos.fas.business.param.WaterResourceParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.util.FileHelper
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.FileUtil
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -73,7 +72,7 @@ public class ExcelController extends BaseController {
@ApiOperation
(
value
=
"导出数据"
,
notes
=
"导出数据"
)
@PostMapping
(
value
=
"/export"
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
public
void
export
(
HttpServletResponse
response
,
@ApiParam
(
value
=
"data:导出数据;model:导出模板"
,
required
=
true
)
@RequestParam
String
exportType
,
@ApiParam
(
value
=
"point:监测点;equipment:设备"
,
required
=
true
)
@RequestParam
String
modelName
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FileController.java
View file @
b2fe25f9
...
...
@@ -3,9 +3,6 @@ package com.yeejoin.amos.fas.business.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.core.util.*
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -34,7 +31,7 @@ import java.util.Map;
@RestController
@RequestMapping
(
value
=
"/file"
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
public
class
FileController
extends
BaseController
{
private
static
final
transient
Logger
log
=
LoggerFactory
.
getLogger
(
FileController
.
class
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireCarController.java
View file @
b2fe25f9
...
...
@@ -12,11 +12,11 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.multipart.MultipartFile
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireCarService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -34,13 +34,16 @@ public class FireCarController extends BaseController {
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
create
(
@RequestBody
FireCar
fireCar
)
throws
Exception
{
fireCar
.
setCreateBy
(
this
.
getUserId
().
intValue
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireCar
.
setCreateBy
(
getUserId
());
fireCar
.
setCreateDate
(
new
Date
());
fireCar
.
setOrgCode
(
this
.
getOrgCode
()
);
fireCar
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
fireCarService
.
save
(
fireCar
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑消防车"
,
notes
=
"编辑消防车"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
udpate
(
@PathVariable
Long
id
,
@RequestBody
FireCar
fireCar
)
{
...
...
@@ -63,12 +66,15 @@ public class FireCarController extends BaseController {
return
CommonResponseUtil
.
success
(
fireCarService
.
delete
(
idArray
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传消防车图片"
,
notes
=
"上传消防车图片"
)
@RequestMapping
(
value
=
"/uploadCarImg"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
uploadCarImg
(
@ApiParam
(
value
=
"消防车图片"
,
required
=
false
)
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
file
,
FireCar
fireCar
)
{
fireCar
.
setOrgCode
(
this
.
getOrgCode
());
fireCar
.
setCreateBy
(
this
.
getUserId
().
intValue
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireCar
.
setOrgCode
(
compCode
);
fireCar
.
setCreateBy
(
getUserId
());
fireCarService
.
saveFireCarAndPhoto
(
fireCar
,
file
);
return
CommonResponseUtil
.
success
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireEquimtPointController.java
View file @
b2fe25f9
...
...
@@ -4,10 +4,11 @@ import com.google.common.collect.Maps;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
//import com.yeejoin.amos.security.authorization.Authorization;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -49,13 +50,13 @@ public class FireEquimtPointController extends BaseController {
||
StringUtils
.
isEmpty
(
fireEquipmentPoint
.
getCode
()))
throw
new
Exception
(
"数据校验失败."
);
fireEquipmentPoint
.
setCreateBy
(
this
.
getUserId
());
fireEquipmentPoint
.
setCreateBy
(
getUserId
());
fireEquipmentPoint
.
setCreateDate
(
new
Date
());
return
CommonResponseUtil
.
success
(
fireEquipPontService
.
savePoint
(
fireEquipmentPoint
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑风险点"
,
notes
=
"编辑风险点"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
udpatePoint
(
@PathVariable
Long
id
,
@RequestBody
FireEquipmentPoint
fireEquipmentPoint
)
{
...
...
@@ -72,7 +73,7 @@ public class FireEquimtPointController extends BaseController {
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除风险点"
,
notes
=
"查询单个风险单"
)
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
deletePoint
(
@PathVariable
String
ids
)
throws
Exception
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireSourceController.java
View file @
b2fe25f9
...
...
@@ -5,11 +5,13 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.business.vo.FireCarDetailVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -34,10 +36,11 @@ public class FireSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加消防装备"
,
notes
=
"添加消防装备"
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
create
(
@RequestBody
FireEquipment
fireEquipment
)
throws
Exception
{
fireEquipment
.
setCreateBy
(
this
.
getUserId
().
intValue
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireEquipment
.
setCreateBy
(
getUserId
());
fireEquipment
.
setCreateDate
(
new
Date
());
fireEquipment
.
setOrgCode
(
this
.
getOrgCode
()
);
fireEquipment
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iFireEquipService
.
save
(
fireEquipment
));
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireStationController.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireStationService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireStation
;
import
com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -35,10 +35,11 @@ public class FireStationController extends BaseController {
||
StringUtils
.
isEmpty
(
fireStation
.
getAddress
())
||
StringUtils
.
isEmpty
(
fireStation
.
getPosition3d
())
||
StringUtils
.
isEmpty
(
fireStation
.
getCode
()))
throw
new
Exception
(
"数据校验失败."
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireStation
.
setCreateBy
(
0
);
fireStation
.
setCreateDate
(
new
Date
());
fireStation
.
setOrgCode
(
this
.
getOrgCode
()
);
fireStation
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iFireStationService
.
save
(
fireStation
));
}
...
...
@@ -109,7 +110,7 @@ public class FireStationController extends BaseController {
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
type
),
commonPageable
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表查询消防小室"
,
notes
=
"分页查询消防小室"
)
@RequestMapping
(
value
=
"/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
forList
(
...
...
@@ -122,7 +123,7 @@ public class FireStationController extends BaseController {
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
type
)));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加消防小室及上传图片"
,
notes
=
"添加消防小室及上传图片"
)
@RequestMapping
(
value
=
"createAndSaveImg"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
createAndSaveImg
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
file
,
...
...
@@ -133,10 +134,11 @@ public class FireStationController extends BaseController {
// || StringUtils.isEmpty(fireStation.getPosition3d())
||
StringUtils
.
isEmpty
(
fireStation
.
getCode
()))
throw
new
Exception
(
"数据校验失败."
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireStation
.
setCreateBy
(
0
);
fireStation
.
setCreateDate
(
new
Date
());
fireStation
.
setOrgCode
(
this
.
getOrgCode
()
);
fireStation
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iFireStationService
.
saveAndUpd
(
fireStation
,
file
));
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireStrengthController.java
View file @
b2fe25f9
...
...
@@ -14,11 +14,9 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.fas.business.service.intfc.FireStengthService
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireStrength
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -31,7 +29,7 @@ public class FireStrengthController extends BaseController{
@Autowired
FireStengthService
fireStengthService
;
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加专职人员"
,
notes
=
"添加专职人员"
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
createPoint
(
@RequestBody
FireStrength
fireStrength
)
throws
Exception
{
...
...
@@ -48,7 +46,7 @@ public class FireStrengthController extends BaseController{
return
CommonResponseUtil
.
success
(
fireStengthService
.
savePoint
(
fireStrength
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑专职人员"
,
notes
=
"编辑专职人员"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
udpatePoint
(
@PathVariable
Long
id
,
@RequestBody
FireStrength
fireStrength
)
{
...
...
@@ -56,7 +54,7 @@ public class FireStrengthController extends BaseController{
return
CommonResponseUtil
.
success
(
fireStengthService
.
savePoint
(
fireStrength
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单个专职人员"
,
notes
=
"查询单个专职人员"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryPoint
(
@PathVariable
Long
id
)
{
...
...
@@ -65,7 +63,7 @@ public class FireStrengthController extends BaseController{
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除专职人员"
,
notes
=
"查询单个专职人员"
)
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
deletePoint
(
@PathVariable
String
ids
)
throws
Exception
{
...
...
@@ -73,7 +71,7 @@ public class FireStrengthController extends BaseController{
return
CommonResponseUtil
.
success
(
fireStengthService
.
deletePoint
(
idArray
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询专职人员"
,
notes
=
"分页查询专职人员"
)
@RequestMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
pointList
(
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/Node3dVoController.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.Node3dVoService
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
op
.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
import
com.yeejoin.amos.
fas
.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -64,7 +63,7 @@ public class PlanVisual3dController extends BaseController {
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getTextPlanInfoById
(
id
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@RequestMapping
(
value
=
"/plan/text/downloadFile/{id}"
,
method
=
RequestMethod
.
GET
)
public
HttpServletResponse
download
(
@PathVariable
(
"id"
)
Long
id
)
{
TextPlan
testPlan
=
planVisual3dService
.
getTextPlanInfoById
(
id
);
...
...
@@ -113,7 +112,7 @@ public class PlanVisual3dController extends BaseController {
* 资源设备信息查询
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资源查询"
,
notes
=
"资源查询"
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@GetMapping
(
value
=
"/resource/{type}/list"
)
public
CommonResponse
getResourceList
(
@ApiParam
(
value
=
"资源类型"
,
required
=
true
)
@PathVariable
String
type
)
{
return
planVisual3dService
.
getResourceListByType
(
type
);
...
...
@@ -125,7 +124,7 @@ public class PlanVisual3dController extends BaseController {
* @param id
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@GetMapping
(
value
=
"/{type}/detail/{id}"
)
@ApiOperation
(
value
=
"数据项查询"
,
notes
=
"按照分类及id查询数据项"
)
public
CommonResponse
getResourceDetail
(
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskFactorController.java
View file @
b2fe25f9
...
...
@@ -3,12 +3,13 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.RiskFactor
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.entity.User
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -66,11 +67,14 @@ public class RiskFactorController extends BaseController {
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"危险因素名称重复:"
+
param
.
getName
());
}
User
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
dep
=
getDepartmentId
(
reginParams
);
String
compCode
=
getOrgCode
(
reginParams
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
()
);
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"dept_id"
,
user
.
getDepartment
()
==
null
?
"0"
:
user
.
getDepartment
().
getId
()
);
map
.
put
(
"org_code"
,
compCode
);
map
.
put
(
"user_id"
,
user
.
get
User
Id
());
map
.
put
(
"dept_id"
,
dep
);
map
.
put
(
"param"
,
param
);
iRiskFactorService
.
editRiskFactor
(
map
);
return
CommonResponseUtil
.
success
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskLevelController.java
View file @
b2fe25f9
...
...
@@ -3,12 +3,13 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.entity.User
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -69,10 +70,12 @@ public class RiskLevelController extends BaseController {
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"风险等级重复:"
+
param
.
getLevel
()
+
"级"
);
}
User
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
()
);
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"org_code"
,
compCode
);
map
.
put
(
"user_id"
,
user
.
get
User
Id
());
map
.
put
(
"param"
,
param
);
iRiskLevelService
.
editRiskLevel
(
map
);
return
CommonResponseUtil
.
success
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
b2fe25f9
...
...
@@ -5,15 +5,16 @@ import com.yeejoin.amos.fas.business.param.RiskFmeaParam;
import
com.yeejoin.amos.fas.business.service.intfc.IFmeaService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.security.entity.User
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -68,10 +69,12 @@ public class RiskModelController extends BaseController {
if
(
type
.
equals
(
2
)
&&
isRegion
.
equals
(
"TRUE"
))
{
return
CommonResponseUtil
.
failure
(
"该区域下只能添加风险点"
);
}
User
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
user
.
getOrgCode
()
);
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"org_code"
,
compCode
);
map
.
put
(
"user_id"
,
user
.
get
User
Id
());
map
.
put
(
"param"
,
param
);
return
CommonResponseUtil
.
success
(
riskSourceService
.
editRiskSource
(
map
));
}
catch
(
Exception
e
)
{
...
...
@@ -84,7 +87,7 @@ public class RiskModelController extends BaseController {
* 风险模型删除
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险模型删除"
,
notes
=
"风险模型删除"
)
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@RequestMapping
(
value
=
"/riskSource/deleteRiskSource"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteRiskSource
(
@ApiParam
(
value
=
"风险模型id"
,
required
=
true
)
@RequestBody
Long
[]
riskSourceId
)
{
try
{
...
...
@@ -116,9 +119,9 @@ public class RiskModelController extends BaseController {
@RequestMapping
(
value
=
"/fmea/editFmea"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
editFmea
(
@ApiParam
(
value
=
"Fmea模型对象"
,
required
=
true
)
@RequestBody
List
<
Fmea
>
params
)
{
try
{
User
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"user_id"
,
user
.
get
User
Id
());
map
.
put
(
"fmeas"
,
params
);
fmeaService
.
editFmea
(
map
);
RsDataQueue
rs
=
RsDataQueue
.
getInstance
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
b2fe25f9
...
...
@@ -9,9 +9,9 @@ import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import
com.yeejoin.amos.fas.business.service.model.ProtalDataRo
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
op
.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
import
com.yeejoin.amos.
fas
.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -46,7 +46,7 @@ public class RiskSourceController extends BaseController {
@Autowired
IRiskSourceService
riskSourceService
;
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询风险点子项"
,
notes
=
"查询风险点子项"
)
@RequestMapping
(
value
=
"/children/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceByPage
()
{
...
...
@@ -54,7 +54,7 @@ public class RiskSourceController extends BaseController {
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"三维图统计"
,
notes
=
"三维图统计"
)
@RequestMapping
(
value
=
"/collection3d"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
collection3d
()
{
...
...
@@ -102,7 +102,7 @@ public class RiskSourceController extends BaseController {
*
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取风险点树型结构"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getRiskSourceTress
()
{
...
...
@@ -110,7 +110,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
getRiskSourcesTree
(
riskSources
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/query3DStatistics/{markerType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
query3DStatistics
(
@PathVariable
(
value
=
"markerType"
,
required
=
true
)
String
markerType
)
throws
Exception
{
...
...
@@ -133,7 +133,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
failure
(
"未定义类型"
);
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
riskSourceStatistics
()
throws
Exception
{
...
...
@@ -142,7 +142,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
riskSourceStatistics
(
treeRiskSources
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面设备统计"
,
notes
=
"统计级别为1的风险点下面设备统计"
)
@RequestMapping
(
value
=
"/equipStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
equipStatistics
()
throws
Exception
{
...
...
@@ -151,7 +151,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
riskSourceEquipStatistics
(
treeRiskSources
,
true
,
0
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的巡检点统计"
,
notes
=
"统计级别为1的巡检点统计"
)
@RequestMapping
(
value
=
"/checkPointStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
riskStatistics
()
throws
Exception
{
...
...
@@ -271,7 +271,7 @@ public class RiskSourceController extends BaseController {
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面设备统计"
,
notes
=
"统计级别为1的风险点下面设备统计"
)
@RequestMapping
(
value
=
"/equipStatistics/{type}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
equipStatistics
(
@PathVariable
(
value
=
"type"
,
required
=
true
)
String
[]
type
)
throws
Exception
{
...
...
@@ -541,14 +541,14 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
importantEquipId
,
equimentId
,
equipmentPointName
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传消防设备数据"
,
notes
=
"上传消防设备数据"
)
@RequestMapping
(
value
=
"/data/fireqeuiment"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postFireEqumentData
(
@RequestBody
FireEquimentDataRo
deviceData
)
throws
Exception
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
processFireEqumtData
(
deviceData
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传消防设备数据"
,
notes
=
"上传消防设备数据"
)
@RequestMapping
(
value
=
"/data/fireqeuiment/soe"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
postFireEqumentData
(
@RequestBody
AlarmParam
alarm
)
throws
Exception
{
...
...
@@ -557,7 +557,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
();
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传消防设备数据"
,
notes
=
"上传消防设备数据"
)
@RequestMapping
(
value
=
"/data/fireqeuiment/all"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
postFireEqumentData
(
@RequestBody
List
<
AlarmParam
>
deviceDatas
)
throws
Exception
{
...
...
@@ -566,15 +566,15 @@ public class RiskSourceController extends BaseController {
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检数据"
,
notes
=
"上传巡检数据"
)
@RequestMapping
(
value
=
"/data/patroldata"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postPatrolData
(
@RequestBody
ProtalDataRo
protalData
)
throws
Exception
{
riskSourceService
.
processProtalData
(
protalData
);
riskSourceService
.
processProtalData
(
getToken
(),
getProduct
(),
getAppKey
(),
protalData
);
return
CommonResponseUtil
.
success
();
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检任务数据"
,
notes
=
"上传巡检任务数据"
)
@RequestMapping
(
value
=
"/data/task"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postTaskData
(
@RequestBody
ProtalDataRo
taskData
)
throws
Exception
{
...
...
@@ -631,7 +631,7 @@ public class RiskSourceController extends BaseController {
/**
* @return
*/
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设置预案节点自动执行"
,
notes
=
"设置预案节点自动执行"
)
@RequestMapping
(
value
=
"/contingency/setup"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskSourceSecondLevel
(
@RequestBody
ContingencyDeviceStatus
contingencyDeviceStatus
)
{
...
...
@@ -639,7 +639,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
();
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"初始化預案水資源"
,
notes
=
"初始化預案水資源"
)
@RequestMapping
(
value
=
"/contingency/water"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryContingencyWater
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TimeLineController.java
View file @
b2fe25f9
...
...
@@ -6,9 +6,9 @@ import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
op
.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
import
com.yeejoin.amos.
fas
.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -37,7 +37,7 @@ public class TimeLineController extends BaseController{
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据批次号查询时间轴"
,
notes
=
"根据批次号查询时间轴"
)
@RequestMapping
(
value
=
"/{instanceNo}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryPoint
(
@PathVariable
String
instanceNo
,
@RequestParam
(
"recordType"
)
String
recordType
)
throws
Exception
{
...
...
@@ -46,7 +46,7 @@ public class TimeLineController extends BaseController{
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/fire"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
fire
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
...
...
@@ -112,7 +112,7 @@ public class TimeLineController extends BaseController{
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询预案记录"
,
notes
=
"查询预案记录"
)
@RequestMapping
(
value
=
"/contingency/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
contingencyRecord
(
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TopographyController.java
View file @
b2fe25f9
...
...
@@ -18,11 +18,11 @@ import com.alibaba.fastjson.JSONObject;
import
com.yeejoin.amos.fas.business.service.intfc.ITopographyLineService
;
import
com.yeejoin.amos.fas.business.service.intfc.ITopographyNodeDetailService
;
import
com.yeejoin.amos.fas.business.service.intfc.ITopographyNodeService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.TopographyLine
;
import
com.yeejoin.amos.fas.dao.entity.TopographyNode
;
import
com.yeejoin.amos.fas.dao.entity.TopographyNodeDetail
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/WaterResourceController.java
View file @
b2fe25f9
...
...
@@ -15,12 +15,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -45,10 +46,11 @@ public class WaterResourceController extends BaseController{
// || StringUtils.isEmpty(waterResource.getPosition3d())
||
StringUtils
.
isEmpty
(
waterResource
.
getCode
()
))
throw
new
Exception
(
"数据校验失败."
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
waterResource
.
setCreateBy
(
0
);
waterResource
.
setCreateDate
(
new
Date
());
waterResource
.
setOrgCode
(
this
.
getOrgCode
()
);
waterResource
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iWaterResourceService
.
save
(
waterResource
));
}
...
...
@@ -57,11 +59,13 @@ public class WaterResourceController extends BaseController{
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
udpate
(
@PathVariable
Long
id
,
@RequestBody
WaterResource
waterResource
)
{
waterResource
.
setId
(
id
);
waterResource
.
setOrgCode
(
this
.
getOrgCode
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
waterResource
.
setOrgCode
(
compCode
);
return
CommonResponseUtil
.
success
(
iWaterResourceService
.
save
(
waterResource
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单个水资源"
,
notes
=
"查询单个水资源"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryPoint
(
@PathVariable
Long
id
)
{
...
...
@@ -91,7 +95,7 @@ public class WaterResourceController extends BaseController{
return
CommonResponseUtil
.
success
(
iWaterResourceService
.
queryForPage
(
StringUtils
.
trimToNull
(
name
),
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
type
),
commonPageable
));
}
@Authorization
(
ingore
=
true
)
//
@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询水资源"
,
notes
=
"分页查询水资源"
)
@RequestMapping
(
value
=
"/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
list
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/BizMessageMapper.java
View file @
b2fe25f9
...
...
@@ -12,7 +12,7 @@ public interface BizMessageMapper extends BaseMapper {
@Param
(
"type"
)
String
type
,
@Param
(
"title"
)
String
title
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"time"
)
String
time
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyOriginalMapper.java
View file @
b2fe25f9
...
...
@@ -16,7 +16,7 @@ public interface ContingencyOriginalMapper extends BaseMapper {
List
<
Map
>
queryForPage
(
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"createTime"
)
String
createTime
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
View file @
b2fe25f9
...
...
@@ -34,7 +34,7 @@ public interface FireEquipMapper extends BaseMapper {
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"start"
)
int
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
int
length
);
...
...
@@ -47,7 +47,7 @@ public interface FireEquipMapper extends BaseMapper {
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipClassify"
)
String
equipClassify
,
@Param
(
"start"
)
int
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
int
length
);
...
...
@@ -68,7 +68,7 @@ public interface FireEquipMapper extends BaseMapper {
List
<
FireEquipmentEntity
>
listByType
(
@Param
(
"type"
)
Integer
type
);
List
<
Map
>
queryEquimentRelation
(
@Param
(
"start"
)
int
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
int
length
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"fname"
)
String
fname
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireEquipPointMapper.java
View file @
b2fe25f9
...
...
@@ -13,7 +13,7 @@ public interface FireEquipPointMapper extends BaseMapper {
Map
queryOne
(
@Param
(
"id"
)
Long
id
);
List
<
Map
>
queryForPage
(
@Param
(
"fireEqumntId"
)
Long
fireEqumntId
,
@Param
(
"name"
)
String
name
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"length"
)
Integer
length
);
List
<
Map
>
queryForPage
(
@Param
(
"fireEqumntId"
)
Long
fireEqumntId
,
@Param
(
"name"
)
String
name
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"fireEqumntId"
)
Long
fireEqumntId
,
@Param
(
"name"
)
String
name
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireStationMapper.java
View file @
b2fe25f9
...
...
@@ -11,7 +11,7 @@ public interface FireStationMapper extends BaseMapper {
List
<
Map
>
queryForFireEqumntPage
(
@Param
(
"fireStationId"
)
Long
fireStationId
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForFireEqumntPage
(
@Param
(
"fireStationId"
)
Long
fireStationId
);
...
...
@@ -20,7 +20,7 @@ public interface FireStationMapper extends BaseMapper {
List
<
Map
>
queryForPage
(
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"type"
)
String
type
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"name"
)
String
name
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireStrengthMapper.java
View file @
b2fe25f9
...
...
@@ -10,6 +10,6 @@ public interface FireStrengthMapper extends BaseMapper {
Map
queryOne
(
@Param
(
"id"
)
Long
id
);
List
<
Map
>
queryForPage
(
@Param
(
"username"
)
String
username
,
@Param
(
"code"
)
String
code
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"length"
)
Integer
length
);
List
<
Map
>
queryForPage
(
@Param
(
"username"
)
String
username
,
@Param
(
"code"
)
String
code
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"username"
)
String
username
,
@Param
(
"code"
)
String
code
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
View file @
b2fe25f9
...
...
@@ -25,7 +25,7 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
* @param equipmentId
* @return
*/
List
<
FireEquipment
>
queryBindFirEqumtPage
(
@Param
(
"start"
)
int
start
,
@Param
(
"length"
)
int
length
,
@Param
(
"equipmentId"
)
String
equipmentId
);
List
<
FireEquipment
>
queryBindFirEqumtPage
(
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
int
length
,
@Param
(
"equipmentId"
)
String
equipmentId
);
Long
queryBindFirEqumtPageCount
(
@Param
(
"equipmentId"
)
String
equipmentId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
View file @
b2fe25f9
...
...
@@ -12,7 +12,7 @@ public interface ImpEquipMapper extends BaseMapper {
List
<
Map
>
getEquipPage
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"offset"
)
long
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
Long
getEquipPageCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/WaterResourceMapper.java
View file @
b2fe25f9
...
...
@@ -17,7 +17,7 @@ public interface WaterResourceMapper extends BaseMapper {
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"type"
)
String
type
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"name"
)
String
name
,
...
...
@@ -26,7 +26,7 @@ public interface WaterResourceMapper extends BaseMapper {
List
<
Map
>
queryForBindFireEqumntPage
(
@Param
(
"waterResourceId"
)
Long
waterResourceId
,
@Param
(
"start"
)
Integer
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForBindFireEqumntPage
(
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/FireStrengthPointDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.FireStrength
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
@Repository
(
"fireStrengthPointDao"
)
public
interface
FireStrengthPointDao
extends
BaseDao
<
FireStrength
,
Long
>
{
FireStrength
findById
(
Long
id
);
Optional
<
FireStrength
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyOriginalDataDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.
op.core.jpa.IBaseRepository
;
import
com.yeejoin.amos.
fas.dao.entity.FireStrength
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -16,7 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
* @version $Id: IMessageRepository.java, v 0.1 2018年1月18日 下午7:52:13 HK Exp $
*/
@Repository
public
interface
IContingencyOriginalDataDao
extends
IBaseRepository
<
ContingencyOriginalData
,
String
>
{
public
interface
IContingencyOriginalDataDao
extends
BaseDao
<
ContingencyOriginalData
,
String
>
{
ContingencyOriginalData
findByBatchNo
(
String
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.op.core.jpa.IBaseRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Optional
;
/**
* <pre>
...
...
@@ -16,7 +16,7 @@ import java.util.List;
* @version $Id: IMessageRepository.java, v 0.1 2018年1月18日 下午7:52:13 HK Exp $
*/
@Repository
public
interface
IContingencyPlanInstanceRepository
extends
IBaseRepository
<
ContingencyPlanInstance
,
String
>
{
public
interface
IContingencyPlanInstanceRepository
extends
BaseDao
<
ContingencyPlanInstance
,
String
>
{
int
countByBatchNo
(
String
batchNo
);
...
...
@@ -46,5 +46,5 @@ public interface IContingencyPlanInstanceRepository extends IBaseRepository<Cont
" order by t.sort desc "
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
queryForContent
(
String
batch_no
,
String
category
,
String
subCategory
);
ContingencyPlanInstance
findById
(
String
id
);
Optional
<
ContingencyPlanInstance
>
findById
(
String
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IDeptmentDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
/*
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.SDepartment;
import org.springframework.data.jpa.repository.Query;
...
...
@@ -9,5 +9,6 @@ import java.util.List;
@Repository("deptmentDao")
public interface IDeptmentDao extends BaseDao<SDepartment, Long> {
@Query("select u from SDepartment u where u.isDelete = ?2 and u.companyId = ?1")
public
List
<
SDepartment
>
findDeptmentByCompanyId
(
Lo
ng
companyId
,
byte
isDel
);
public List<SDepartment> findDeptmentByCompanyId(
Stri
ng companyId, byte isDel);
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IEquipmentDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
...
...
@@ -8,6 +10,6 @@ import com.yeejoin.amos.fas.dao.entity.Equipment;
@Repository
(
"iEquipmentDao"
)
public
interface
IEquipmentDao
extends
BaseDao
<
Equipment
,
Long
>
{
Equipment
findById
(
Long
id
);
Optional
<
Equipment
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireCarDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
@Repository
(
"iFireCarDao"
)
public
interface
IFireCarDao
extends
BaseDao
<
FireCar
,
Long
>
{
FireCar
findById
(
Long
id
);
Optional
<
FireCar
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireEquipmentDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -13,6 +14,6 @@ public interface IFireEquipmentDao extends BaseDao<FireEquipment, Long> {
@Query
(
value
=
"select distinct production_area from f_fire_equipment "
,
nativeQuery
=
true
)
List
<
String
>
findFireEquipArea
();
FireEquipment
findById
(
Long
id
);
Optional
<
FireEquipment
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireEquipmentDataDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentData
;
...
...
@@ -7,7 +9,7 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipmentData;
@Repository
(
"iFireEquipmentDataDao"
)
public
interface
IFireEquipmentDataDao
extends
BaseDao
<
FireEquipmentData
,
Long
>
{
FireEquipmentData
findById
(
Long
id
);
Optional
<
FireEquipmentData
>
findById
(
Long
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireEquipmentPointDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
...
...
@@ -7,7 +9,7 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
@Repository
(
"iFireEquipmentPointDao"
)
public
interface
IFireEquipmentPointDao
extends
BaseDao
<
FireEquipmentPoint
,
Long
>
{
FireEquipmentPoint
findById
(
Long
id
);
Optional
<
FireEquipmentPoint
>
findById
(
Long
id
);
FireEquipmentPoint
findOneByCode
(
String
pointCode
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireStationDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.dao.entity.FireStation
;
...
...
@@ -7,6 +9,6 @@ import com.yeejoin.amos.fas.dao.entity.FireStation;
@Repository
(
"iFireStationDao"
)
public
interface
IFireStationDao
extends
BaseDao
<
FireStation
,
Long
>
{
FireStation
findById
(
Long
id
);
Optional
<
FireStation
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -37,7 +38,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
void
deleteById
(
Long
[]
fmeaIds
);
Fmea
findById
(
Long
id
);
Optional
<
Fmea
>
findById
(
Long
id
);
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_point_inputitem` WHERE fmea_id in ?1"
,
nativeQuery
=
true
)
int
countAssociatedInputItemByIds
(
String
[]
ids
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/INodeMsgViewRepository.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.NodeMessageView
;
import
com.yeejoin.amos.op.core.jpa.IBaseRepository
;
import
org.springframework.stereotype.Repository
;
/**
...
...
@@ -14,7 +13,7 @@ import org.springframework.stereotype.Repository;
* @version $Id: INodeMsgViewRepository.java, v 0.1 2019年1月2日 下午2:47:13 amos Exp $
*/
@Repository
public
interface
INodeMsgViewRepository
extends
IBaseRepository
<
NodeMessageView
,
String
>
public
interface
INodeMsgViewRepository
extends
BaseDao
<
NodeMessageView
,
String
>
{
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPPointDao.java
View file @
b2fe25f9
...
...
@@ -5,8 +5,9 @@ import com.yeejoin.amos.fas.dao.entity.RiskSource;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Optional
;
@Repository
(
"iPPointDao"
)
public
interface
IPPointDao
extends
BaseDao
<
PPoint
,
Long
>
{
PPoint
findById
(
Long
id
);
Optional
<
PPoint
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IRiskFactorDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -19,6 +20,6 @@ public interface IRiskFactorDao extends BaseDao<RiskFactor, Long> {
@Query
(
value
=
"delete from f_risk_factor where id in (?1)"
,
nativeQuery
=
true
)
void
deleteAllByIds
(
Long
[]
param
);
RiskFactor
findById
(
Long
id
);
Optional
<
RiskFactor
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IRiskLevelDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -19,5 +20,5 @@ public interface IRiskLevelDao extends BaseDao<RiskLevel, Long> {
@Query
(
value
=
"delete from f_risk_level where id in (?1)"
,
nativeQuery
=
true
)
void
deleteAllByIds
(
Long
[]
param
);
RiskLevel
findById
(
Long
id
);
Optional
<
RiskLevel
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IRiskSourceDao.java
View file @
b2fe25f9
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.dao.repository;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -21,7 +22,7 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
int
countByParentId
(
Long
parentId
);
RiskSource
findById
(
Long
id
);
Optional
<
RiskSource
>
findById
(
Long
id
);
/**
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IUserDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
/*
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.SUser;
import org.springframework.data.jpa.repository.Query;
...
...
@@ -15,3 +15,4 @@ public interface IUserDao extends BaseDao<SUser, Long> {
List<SUser> findAllUser();
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IWaterResourceDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
@Repository
(
"iWaterResourceDao"
)
public
interface
IWaterResourceDao
extends
BaseDao
<
WaterResource
,
Long
>
{
WaterResource
findById
(
Long
id
);
Optional
<
WaterResource
>
findById
(
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IWaterResourceEquipmentDao.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -9,7 +10,7 @@ import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
@Repository
(
"iWaterResourceEquipmentDao"
)
public
interface
IWaterResourceEquipmentDao
extends
BaseDao
<
WaterResourceEquipment
,
Long
>
{
WaterResourceEquipment
findById
(
Long
id
);
Optional
<
WaterResourceEquipment
>
findById
(
Long
id
);
WaterResourceEquipment
findByWaterResourceIdAndFireEquipmentId
(
Long
waterResourceId
,
Long
fireEquipmentId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/AMOSSecurityFallback.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
/*
package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.op.core.common.response.CommonResponse;
...
...
@@ -33,3 +33,4 @@ public class AMOSSecurityFallback implements IAMOSSecurityServer{
}
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/CompanyUserFeignServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
/*
package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
...
...
@@ -46,3 +46,4 @@ public class CompanyUserFeignServer extends Thread{
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/DeptmentServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
/*
package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
...
...
@@ -38,3 +38,4 @@ public class DeptmentServer extends Thread{
latch.countDown();
}
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/IAMOSSecurityServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
/*
package com.yeejoin.amos.fas.business.feign;
import
org.springframework.cloud.
netflix.
feign.FeignClient
;
import org.springframework.cloud.
open
feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
...
...
@@ -22,3 +22,4 @@ public interface IAMOSSecurityServer {
@RequestMapping(value = "/company/specify-tree/{companyId}", method = RequestMethod.GET)
public CommonResponse queryCompanyLeavesById(@PathVariable("companyId") String companyId);
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/IMaasVisualServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
org.springframework.cloud.
netflix.
feign.FeignClient
;
import
org.springframework.cloud.
open
feign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
@FeignClient
(
name
=
"${visual.fegin.name}"
,
fallback
=
MassVisualFallback
.
class
,
configuration
=
FeignConfiguration
.
class
)
public
interface
IMaasVisualServer
{
@RequestMapping
(
value
=
"/tree/subject/findAll"
,
method
=
RequestMethod
.
GET
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/MassVisualFallback.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
import
com.yeejoin.amos.
op.core.common.response
.CommonResponse
;
import
com.yeejoin.amos.
fas.core.util
.CommonResponse
;
public
class
MassVisualFallback
implements
IMaasVisualServer
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
View file @
b2fe25f9
...
...
@@ -3,13 +3,16 @@ package com.yeejoin.amos.fas.business.feign;
import
com.yeejoin.amos.fas.business.service.model.BasicsRo
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo
;
import
com.yeejoin.amos.op.core.util.ApplicationConfig
;
import
com.yeejoin.amos.op.core.util.Constants
;
import
com.yeejoin.amos.op.core.util.JSONUtil
;
//import com.yeejoin.amos.op.core.util.ApplicationConfig;
//import com.yeejoin.amos.op.core.util.Constants;
import
com.yeejoin.amos.fas.business.util.Constants
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
org.codehaus.jackson.map.ObjectMapper
;
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.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -32,9 +35,11 @@ import java.util.Map;
@Service
(
"remoteRuleServer"
)
public
class
RemoteRuleServer
{
@Autowired
private
ApplicationConfig
applicationConfig
;
/* @Autowired
private ApplicationConfig applicationConfig;*/
@Value
(
"${params.remoteRuleUrl}"
)
private
String
remoteRuleUrl
;
private
final
RestTemplate
restTemplate
;
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RemoteRuleServer
.
class
);
...
...
@@ -55,7 +60,8 @@ public class RemoteRuleServer {
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"className"
,
riskSourceRuleRo
.
getClass
().
getName
());
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
/*String url = applicationConfig.getParamValueStr("params.remoteRuleUrl");*/
String
url
=
remoteRuleUrl
;
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
...
...
@@ -91,8 +97,8 @@ public class RemoteRuleServer {
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"processId"
,
processId
);
map
.
put
(
"className"
,
resFact
.
getClass
().
getName
());
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
//
String url = applicationConfig.getParamValueStr("params.remoteRuleUrl");
String
url
=
remoteRuleUrl
;
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
...
...
@@ -114,8 +120,9 @@ public class RemoteRuleServer {
public
Object
autoProcessContingency
(
ContingencyDeviceStatus
contingencyDeviceStatus
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
// String url = "http://172.16.10.70:8080/";
// String url = applicationConfig.getParamValueStr("params.remoteRuleUrl");
String
url
=
remoteRuleUrl
;
// String url = "http://172.16.10.70:8080/";
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
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.feign.privilege.model.PermissionModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"remoteSecurityService"
)
public
class
RemoteSecurityService
{
@Value
(
"${security.password}"
)
private
String
password
;
@Value
(
"${security.loginId}"
)
private
String
loginId
;
@Value
(
"${security.productWeb}"
)
private
String
productWeb
;
@Value
(
"${security.appKeyWeb}"
)
private
String
appKeyWeb
;
//根据公司名称获取公司人
public
List
<
CompanyModel
>
listCompanyTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyName
)
{
// CommonResponse commonResponse = iAmosSecurityServer.listCompanyTree();
//return handleArray(commonResponse, CompanyBo.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
userModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
queryAgencyTree
(
companyName
);
userModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
userModel
;
}
//部门id获取部门信息
public
DepartmentModel
getDepartmentByDeptId
(
String
toke
,
String
product
,
String
appKey
,
String
deparmentId
)
{
if
(
deparmentId
==
null
||
deparmentId
.
equals
(
""
))
{
return
null
;
}
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentByDeptId(deparmentId);
// return handleObj(commonResponse, DepartmentBo.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
DepartmentModel
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
seleteOne
(
Long
.
valueOf
(
deparmentId
));
departmentModel
=
(
DepartmentModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
}
//查询指定部门数
public
List
<
DepartmentModel
>
listDepartmentsByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptTree
(
null
,
Long
.
valueOf
(
companyId
));
departmentModel
=
(
List
<
DepartmentModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listDepartmentsByCompanyId(companyId);
//return handleArray(commonResponse, DepartmentBo.class);
}
// * 根据公司id查询机构用户
public
List
<
AgencyUserModel
>
listUserByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
AgencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByCompanyId
(
Long
.
valueOf
(
companyId
),
null
);
AgencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
AgencyUserModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listUserByCompanyId(companyId);
//return handleArray(commonResponse, UserModel.class);
}
// * 根据公司RoleIds
public
List
<
AgencyUserModel
>
getUserByRoleIds
(
String
toke
,
String
product
,
String
appKey
,
String
RoleIds
)
{
if
(
RoleIds
==
null
||
RoleIds
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
RoleIds
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
public
Toke
come
()
{
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
loginId
);
dPasswordAuthModel
.
setPassword
(
password
);
Map
map
=
null
;
FeignClientResult
feignClientResult
;
Toke
oked
=
new
Toke
();
try
{
RequestContext
.
setProduct
(
productWeb
);
feignClientResult
=
Privilege
.
authClient
.
idpassword
(
dPasswordAuthModel
);
map
=
(
Map
)
feignClientResult
.
getResult
();
if
(
map
!=
null
){
oked
.
setToke
(
map
.
get
(
"token"
).
toString
());
oked
.
setProduct
(
productWeb
);
oked
.
setAppKey
(
appKeyWeb
);
}
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
oked
;
}
/* public List<UserModel> listUserByRoleIds(String roleIds) {
CommonResponse commonResponse = iAmosSecurityServer.listUserByRoleIds(roleIds);
return handleArray(commonResponse, UserModel.class);
}*/
//用户id批量获取用户信息
public
List
<
AgencyUserModel
>
listUserByUserIds
(
String
toke
,
String
product
,
String
appKey
,
String
userIds
)
{
// CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds);
//return handleArray(commonResponse, UserModel.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByIds
(
userIds
);
agencyUserModel
=
(
List
<
AgencyUserModel
>
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
//用户id获取用户信息
public
AgencyUserModel
getUserById
(
String
toke
,
String
product
,
String
appKey
,
String
userId
)
{
if
(
userId
==
null
||
userId
.
equals
(
""
))
{
return
null
;
}
// CommonResponse commonResponse = iAmosSecurityServer.getUserById(userId);
// return handleObj(commonResponse, UserModel.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
userId
);
agencyUserModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
//根据orgCode查询机构用户
public
List
<
AgencyUserModel
>
listUserByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByOrgCode
(
orgCode
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
}
//根据orgCode查询机构
public
Map
<
String
,
Object
>
listByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
Map
<
String
,
Object
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
);
agencyUserModel
=
(
Map
<
String
,
Object
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
}
// 根据部门id查询机构用户
public
List
<
AgencyUserModel
>
listUserByDepartmentId
(
String
toke
,
String
product
,
String
appKey
,
String
departmentId
)
{
if
(
departmentId
==
null
||
departmentId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
departmentId
),
null
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByDepartmentId(departmentId);
// return handleArray(commonResponse, UserModel.class);
}
/* public UserModel getUserByToken() {
CommonResponse commonResponse = iAmosSecurityServer.getUserByToken();
return handleObj(commonResponse, UserModel.class);
}*/
//* 获取子公司信息树结构
public
List
<
CompanyModel
>
getCompanyTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
companyModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
querySubAgencyTree
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
companyModel
;
//CommonResponse commonResponse = iAmosSecurityServer.getCompanyTreeByCompanyId(companyId);
//return handleArray(commonResponse, CompanyBo.class);
}
//查询指定公司的部门树
public
List
<
DepartmentModel
>
getDepartmentTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptTree
(
null
,
Long
.
valueOf
(
companyId
));
departmentModel
=
(
List
<
DepartmentModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentTreeByCompanyId(companyId);
// return handleArray(commonResponse, DepartmentBo.class);
}
//根据id批量获取部门信息
public
List
<
LinkedHashMap
>
listDepartmentByDeptIds
(
String
toke
,
String
product
,
String
appKey
,
String
departmentIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
LinkedHashMap
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptByIds
(
departmentIds
);
departmentModel
=
(
List
<
LinkedHashMap
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listDepartmentByDeptIds(departmentIds);
//return handleArray(commonResponse, DepartmentBo.class);
}
private
<
T
>
List
<
T
>
handleArray
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
if
(
commonResponse
!=
null
&&
commonResponse
.
isSuccess
())
{
String
jsonStr
=
JSON
.
toJSONString
(
commonResponse
.
getDataList
());
return
JSONArray
.
parseArray
(
jsonStr
,
t
);
}
return
null
;
}
private
<
T
>
T
handleObj
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
if
(
commonResponse
!=
null
&&
commonResponse
.
isSuccess
())
{
String
jsonStr
=
JSON
.
toJSONString
(
commonResponse
.
getDataList
());
return
JSONObject
.
parseObject
(
jsonStr
,
t
);
}
return
null
;
}
/**
* 基础平台全部菜单权限树,用于平台登录前端初始化路由
*/
public
CommonResponse
searchPermissionTree
(
String
toke
,
String
product
,
String
appKey
,
String
appType
)
{
// CommonResponse commonResponse = iAmosSecurityServer.listPermissionTree(appType);
// return commonResponse;
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
PermissionModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
permissionClient
.
queryPermissionTree
(
appType
,
null
,
null
,
null
);
dictionarieModel
=
(
List
<
PermissionModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
CommonResponse
commonResponse
=
new
CommonResponse
(
"SUCCESS"
,
dictionarieModel
);
return
commonResponse
;
}
//根据Code查询指定的字典信息.
public
JSONArray
listDictionaryByDictCode
(
String
toke
,
String
product
,
String
appKey
,
String
dictCode
)
{
/* CommonResponse commonResponse = iAmosSecurityServer.listDictionaryByDictCode(dictCode);
if (commonResponse != null && commonResponse.isSuccess()) {
String jsonStr = JSON.toJSONString(commonResponse.getDataList());
return JSONArray.parseArray(jsonStr);
}*/
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DictionarieValueModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Systemctl
.
dictionarieClient
.
dictValues
(
dictCode
);
dictionarieModel
=
(
List
<
DictionarieValueModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(
dictionarieModel
!=
null
)
{
String
jsonStr
=
JSON
.
toJSONString
(
dictionarieModel
);
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
}
/**
* 查询指定公司信息与其部门用户树
*/
public
CompanyModel
listUserByCompanyId1
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
//CommonResponse commonResponse = iAmosSecurityServer.getuserTreeByCompanyId(companyId);
// String jsonStr = JSON.toJSONString(commonResponse);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
//List<CompanyModel> companyModel=null;
CompanyModel
companyModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
withDeptAndUsers
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
CompanyModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
companyModel
;
// return JSONObject.parseObject(jsonStr);
}
public
boolean
loginOutFromApp
(
String
toke
,
String
product
,
String
appKey
)
{
// CommonResponse commonResponse = iAmosSecurityServer.loginOutFromApp();
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
boolean
flag
=
false
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
authClient
.
removeToken
();
flag
=
true
;
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
public
JSONArray
listDepartmentUserTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
CompanyModel
companyModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
withDeptAndUsers
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
CompanyModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(
companyModel
!=
null
)
{
String
jsonStr
=
null
;
jsonStr
=
JSON
.
toJSONString
(
companyModel
.
getChildren
());
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
/*CommonResponse commonResponse = iAmosSecurityServer.listDepartmentUserTree(companyId);
if (commonResponse != null && commonResponse.isSuccess()) {
String jsonStr = JSON.toJSONString(commonResponse.getDataList());
return JSONArray.parseArray(jsonStr);
}
return null;*/
}
public
boolean
editPassword
(
String
toke
,
String
product
,
String
appKey
,
String
userId
,
String
oldPassword
,
String
newPassword
)
{
// JSONObject request = new JSONObject();
//
//
// request.put("originalPassword", oldPassword);
// request.put("userId", userId);
// request.put("password", newPassword);
// request.put("rePassword", newPassword);
boolean
flag
=
false
;
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setPassword
(
oldPassword
);
agencyUserModel
.
setRePassword
(
newPassword
);
agencyUserModel
.
setOriginalPassword
(
newPassword
);
AgencyUserModel
agencyUserModel2
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
modifyPassword
(
userId
,
agencyUserModel
);
agencyUserModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(
agencyUserModel2
!=
null
){
flag
=
true
;
}
// CommonResponse commonResponse = iAmosSecurityServer.editPassword(userId, request);
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
return
false
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteWebSocketServer.java
View file @
b2fe25f9
...
...
@@ -5,6 +5,7 @@ import java.util.Map;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -13,13 +14,18 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
com.yeejoin.amos.op.core.util.ApplicationConfig
;
import
com.yeejoin.amos.op.core.util.Constants
;
import
com.yeejoin.amos.fas.business.util.Constants
;
@Service
(
"remoteWebSocketServer"
)
public
class
RemoteWebSocketServer
{
@Autowired
private
ApplicationConfig
applicationConfig
;
/*@Autowired
private ApplicationConfig applicationConfig;*/
@Value
(
"${params.remoteWebsocketUrl}"
)
private
String
remoteRuleUrl
;
private
final
RestTemplate
restTemplate
;
private
ObjectMapper
objectMapper
=
new
ObjectMapper
();
...
...
@@ -35,7 +41,9 @@ public class RemoteWebSocketServer {
map
.
put
(
"filter"
,
null
);
map
.
put
(
"message"
,
message
);
map
.
put
(
"path"
,
path
);
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteWebsocketUrl"
);
//String url = applicationConfig.getParamValueStr("params.remoteWebsocketUrl");
String
url
=
remoteRuleUrl
;
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/TreeUserFeignServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
/*
package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
...
...
@@ -41,3 +41,4 @@ public class TreeUserFeignServer extends Thread{
}
}
*/
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/CommonService.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.dao.mapper.CommonMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IDeptmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IUserDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.business.service.intfc.ICommonService
;
import
com.yeejoin.amos.fas.dao.entity.SDepartment
;
import
com.yeejoin.amos.fas.dao.entity.SUser
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
...
...
@@ -18,18 +18,23 @@ import java.util.List;
@Service
(
"commonService"
)
public
class
CommonService
implements
ICommonService
{
@Autowired
/*
@Autowired
private IDeptmentDao deptmentDao;
*/
@Autowired
private
CommonMapper
commonMapper
;
@Autowired
private
IUserDao
userDao
;
private
RemoteSecurityService
remoteSecurityService
;
/* @Autowired
private IUserDao userDao;*/
@Override
public
List
<
SDepartment
>
getDepartment
(
Long
companyId
)
{
return
deptmentDao
.
findDeptmentByCompanyId
(
Long
.
valueOf
(
companyId
),
(
byte
)
0
);
public
List
<
DepartmentModel
>
getDepartment
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
List
<
DepartmentModel
>
list
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
toke
,
product
,
appKey
,
companyId
);
return
list
;
}
@Override
...
...
@@ -49,12 +54,16 @@ public class CommonService implements ICommonService {
}
@Override
public
List
<
SUser
>
getUsers
(
Long
departmentId
)
{
return
userDao
.
findUserByDeptmentId
(
new
Long
(
departmentId
.
toString
()),
(
byte
)
0
);
public
List
<
AgencyUserModel
>
getUsers
(
String
toke
,
String
product
,
String
appKey
,
String
departmentId
)
{
List
<
AgencyUserModel
>
list
=
remoteSecurityService
.
listUserByDepartmentId
(
toke
,
product
,
appKey
,
departmentId
);
return
list
;
}
@Override
public
List
<
SUser
>
getAllUser
()
{
return
userDao
.
findAllUser
();
public
List
<
AgencyUserModel
>
getAllUser
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
List
<
AgencyUserModel
>
list
=
remoteSecurityService
.
listUserByOrgCode
(
toke
,
product
,
appKey
,
orgCode
);
return
list
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
b2fe25f9
...
...
@@ -11,7 +11,6 @@ import com.yeejoin.amos.fas.business.service.model.OperateGroup;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.op.core.jpa.GenericManagerImpl
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -30,12 +29,15 @@ import org.typroject.tyboot.component.cache.Redis;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
public
class
ContingencyInstanceImpl
extends
GenericManagerImpl
<
ContingencyPlanInstance
,
String
>
implements
IContingencyInstance
{
public
class
ContingencyInstanceImpl
/*extends GenericManagerImpl<ContingencyPlanInstance, String>*/
implements
IContingencyInstance
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ContingencyInstanceImpl
.
class
);
IContingencyPlanInstanceRepository
repository
;
@Autowired
private
IContingencyPlanInstanceRepository
repository
;
@Autowired
...
...
@@ -62,10 +64,10 @@ public class ContingencyInstanceImpl extends GenericManagerImpl<ContingencyPlanI
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
public
ContingencyInstanceImpl
(
IContingencyPlanInstanceRepository
repository
)
{
/*
public ContingencyInstanceImpl(IContingencyPlanInstanceRepository repository) {
super(repository);
this.repository = repository;
}
}
*/
/**
...
...
@@ -101,7 +103,7 @@ public class ContingencyInstanceImpl extends GenericManagerImpl<ContingencyPlanI
* @throws Exception
*/
public
List
<
ContingencyPlanInstance
>
queryForTimeLine
(
String
instanceNo
,
String
recordType
)
throws
Exception
{
List
<
ContingencyPlanInstance
>
categorys
=
this
.
repository
.
queryForCategory
(
instanceNo
,
recordType
);
List
<
ContingencyPlanInstance
>
categorys
=
repository
.
queryForCategory
(
instanceNo
,
recordType
);
return
categorys
;
}
...
...
@@ -180,49 +182,58 @@ public class ContingencyInstanceImpl extends GenericManagerImpl<ContingencyPlanI
public
void
setButtonExecuted
(
String
batchNo
,
String
contingencyPlanId
,
String
code
,
String
buttonState
)
throws
Exception
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ContingencyPlanInstance
contingencyPlanInstance
=
this
.
repository
.
findById
(
contingencyPlanId
);
if
(
contingencyPlanInstance
!=
null
&&
"OPERATE"
.
equals
(
contingencyPlanInstance
.
getRecordType
()))
{
String
operateJson
=
contingencyPlanInstance
.
getContent
();
OperateGroup
operateGroup
=
objectMapper
.
readValue
(
operateJson
,
OperateGroup
.
class
);
List
<
Operate
>
operates
=
operateGroup
.
getOperate
();
if
(!
CollectionUtils
.
isEmpty
(
operates
))
{
for
(
Operate
operate
:
operates
)
{
if
(
code
.
equals
(
operate
.
getCode
())
&&
(
"executed"
.
equals
(
operate
.
getState
())
||
"disable"
.
equals
(
operate
.
getState
()))){
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
)){
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
throw
new
Exception
(
"请勿重复操作."
);
}
if
(
"CONFIRM"
.
equals
(
buttonState
))
{
if
(
code
.
equals
(
operate
.
getCode
()))
{
operate
.
setState
(
"executed"
);
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
))
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
else
{
operate
.
setState
(
"disable"
);
}
}
}
}
if
(
buttonState
.
equals
(
"CONFIRM"
))
contingencyPlanInstance
.
setRunstate
(
true
);
operateJson
=
objectMapper
.
writeValueAsString
(
operateGroup
);
contingencyPlanInstance
.
setContent
(
operateJson
);
this
.
repository
.
save
(
contingencyPlanInstance
);
Optional
<
ContingencyPlanInstance
>
contingencyPlanInstance1
=
repository
.
findById
(
contingencyPlanId
);
ContingencyPlanInstance
contingencyPlanInstance
=
contingencyPlanInstance1
.
get
();
if
(
contingencyPlanInstance1
.
isPresent
()){
if
(
contingencyPlanInstance
!=
null
&&
"OPERATE"
.
equals
(
contingencyPlanInstance
.
getRecordType
()))
{
String
operateJson
=
contingencyPlanInstance
.
getContent
();
OperateGroup
operateGroup
=
objectMapper
.
readValue
(
operateJson
,
OperateGroup
.
class
);
List
<
Operate
>
operates
=
operateGroup
.
getOperate
();
if
(!
CollectionUtils
.
isEmpty
(
operates
))
{
for
(
Operate
operate
:
operates
)
{
if
(
code
.
equals
(
operate
.
getCode
())
&&
(
"executed"
.
equals
(
operate
.
getState
())
||
"disable"
.
equals
(
operate
.
getState
()))){
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
)){
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
throw
new
Exception
(
"请勿重复操作."
);
}
if
(
"CONFIRM"
.
equals
(
buttonState
))
{
if
(
code
.
equals
(
operate
.
getCode
()))
{
operate
.
setState
(
"executed"
);
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
))
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
else
{
operate
.
setState
(
"disable"
);
}
}
}
}
if
(
buttonState
.
equals
(
"CONFIRM"
))
contingencyPlanInstance
.
setRunstate
(
true
);
operateJson
=
objectMapper
.
writeValueAsString
(
operateGroup
);
contingencyPlanInstance
.
setContent
(
operateJson
);
repository
.
save
(
contingencyPlanInstance
);
}
}
}
public
void
setButtonWait
(
String
batchNo
,
String
contingencyPlanId
,
String
buttonState
)
throws
Exception
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ContingencyPlanInstance
contingencyPlanInstance
=
this
.
repository
.
findById
(
contingencyPlanId
);
Optional
<
ContingencyPlanInstance
>
contingencyPlanInstance1
=
repository
.
findById
(
contingencyPlanId
);
ContingencyPlanInstance
contingencyPlanInstance
=
null
;
if
(
contingencyPlanInstance1
.
isPresent
()){
contingencyPlanInstance
=
contingencyPlanInstance1
.
get
();
}
if
(
contingencyPlanInstance
!=
null
&&
"OPERATE"
.
equals
(
contingencyPlanInstance
.
getRecordType
()))
{
String
operateJson
=
contingencyPlanInstance
.
getContent
();
OperateGroup
operateGroup
=
objectMapper
.
readValue
(
operateJson
,
OperateGroup
.
class
);
...
...
@@ -242,7 +253,7 @@ public class ContingencyInstanceImpl extends GenericManagerImpl<ContingencyPlanI
contingencyPlanInstance
.
setRunstate
(
true
);
operateJson
=
objectMapper
.
writeValueAsString
(
operateGroup
);
contingencyPlanInstance
.
setContent
(
operateJson
);
this
.
repository
.
save
(
contingencyPlanInstance
);
repository
.
save
(
contingencyPlanInstance
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyOriginalServiceImpl.java
View file @
b2fe25f9
...
...
@@ -5,8 +5,6 @@ import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.op.core.jpa.GenericManagerImpl
;
import
liquibase.exception.DatabaseException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
...
...
@@ -18,25 +16,26 @@ import java.util.List;
import
java.util.Map
;
@Service
public
class
ContingencyOriginalServiceImpl
extends
GenericManagerImpl
<
ContingencyOriginalData
,
String
>
implements
IContingencyOriginalDataService
public
class
ContingencyOriginalServiceImpl
/*extends GenericManagerImpl<ContingencyOriginalData, String>*/
implements
IContingencyOriginalDataService
{
IContingencyOriginalDataDao
repository
;
@Autowired
private
IContingencyOriginalDataDao
repository
;
@Autowired
private
ContingencyOriginalMapper
contingencyOriginalMapper
;
public
ContingencyOriginalServiceImpl
(
IContingencyOriginalDataDao
repository
)
/*
public ContingencyOriginalServiceImpl(IContingencyOriginalDataDao repository)
{
super(repository);
this.repository = repository;
}
}
*/
public
ContingencyOriginalData
queryByBatchNo
(
String
batchNo
)
{
return
this
.
repository
.
findByBatchNo
(
batchNo
);
return
repository
.
findByBatchNo
(
batchNo
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/DictServiceImpl.java
View file @
b2fe25f9
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -35,23 +36,29 @@ public class DictServiceImpl implements IDictService {
public
List
<
Dict
>
getDictListByIds
(
Long
[]
ids
)
{
List
<
Long
>
resultList
=
new
ArrayList
<>(
ids
.
length
);
Collections
.
addAll
(
resultList
,
ids
);
return
dictDao
.
findAll
(
resultList
);
return
dictDao
.
findAll
ById
(
resultList
);
}
@Override
public
Dict
getDictById
(
long
id
)
{
return
dictDao
.
findOne
(
id
);
Optional
<
Dict
>
dict1
=
dictDao
.
findById
(
id
);
Dict
dict
=
null
;
if
(
dict1
.
isPresent
()){
dict
=
dict1
.
get
();
}
return
dict
;
}
@Override
public
void
deleteDictById
(
long
id
)
{
dictDao
.
delete
(
id
);
dictDao
.
delete
ById
(
id
);
}
@Override
public
void
deleteDictByIds
(
long
[]
ids
)
{
for
(
long
id
:
ids
)
{
dictDao
.
delete
(
id
);
dictDao
.
delete
ById
(
id
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
b2fe25f9
...
...
@@ -16,13 +16,14 @@ import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.query.BaseQuerySpecification
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.op.core.common.query.DaoCriteria
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -50,6 +51,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"equipService"
)
public
class
EquipmentServiceImpl
implements
IEquipmentService
{
...
...
@@ -111,14 +113,30 @@ public class EquipmentServiceImpl implements IEquipmentService {
public
Equipment
queryOne
(
Long
id
)
{
return
iEquipmentDao
.
findById
(
id
);
Optional
<
Equipment
>
dict1
=
iEquipmentDao
.
findById
(
id
);
Equipment
dict
=
null
;
if
(
dict1
.
isPresent
()){
dict
=
dict1
.
get
();
}
return
dict
;
}
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
Equipment
equipment
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
Equipment
>
equipment1
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Equipment
equipment
=
null
;
if
(
equipment1
.
isPresent
()){
equipment
=
equipment1
.
get
();
}
if
(
equipment
!=
null
)
{
this
.
iEquipmentDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
iEquipmentDao
.
delete
ById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteImpEqumt
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
...
...
@@ -210,7 +228,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
if
(
equipmentFireEquipment
!=
null
)
{
result
=
equipmentFireEquipment
.
getId
();
this
.
equipmentFireEquipmentDao
.
delete
(
equipmentFireEquipment
.
getId
());
this
.
equipmentFireEquipmentDao
.
delete
ById
(
equipmentFireEquipment
.
getId
());
}
ids
.
add
(
result
);
}
...
...
@@ -226,7 +244,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
* @return
*/
public
Page
queryBindFirEqumtList
(
CommonPageable
commonPageable
,
Long
equipmentId
)
{
int
start
=
-
1
;
long
start
=
-
1
;
int
length
=
-
1
;
if
(
null
!=
commonPageable
)
{
start
=
commonPageable
.
getOffset
();
...
...
@@ -277,7 +295,12 @@ public class EquipmentServiceImpl implements IEquipmentService {
pp
.
setCreateBy
(
userId
.
intValue
());
pp
.
setPicture
(
picture
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
equipment
.
setCreateDate
(
iEquipmentDao
.
findById
(
equipment
.
getId
()).
getCreateDate
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
());
}
preplanPictureDao
.
saveAndFlush
(
pp
);
...
...
@@ -302,12 +325,26 @@ public class EquipmentServiceImpl implements IEquipmentService {
if
(
imgs
==
null
||
imgs
.
length
<
1
)
{
equipment
=
save
(
equipment
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
equipment
.
setCreateDate
(
iEquipmentDao
.
findById
(
equipment
.
getId
()).
getCreateDate
()
==
null
?
new
Date
()
:
iEquipmentDao
.
findById
(
equipment
.
getId
()).
getCreateDate
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
}
}
else
{
equipment
=
save
(
equipment
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
equipment
.
setCreateDate
(
iEquipmentDao
.
findById
(
equipment
.
getId
()).
getCreateDate
()
==
null
?
new
Date
()
:
iEquipmentDao
.
findById
(
equipment
.
getId
()).
getCreateDate
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
}
Long
equipmentId
=
Long
.
valueOf
(
equipment
.
getId
());
for
(
int
i
=
0
;
i
<
imgs
.
length
;
i
++)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ExcelServiceImpl.java
View file @
b2fe25f9
...
...
@@ -13,8 +13,8 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam;
import
com.yeejoin.amos.fas.business.param.WaterResourceParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageImpl
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireCarServiceImpl.java
View file @
b2fe25f9
...
...
@@ -5,6 +5,7 @@ import java.io.IOException;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -57,17 +58,29 @@ public class FireCarServiceImpl implements IFireCarService {
public
FireCar
queryOne
(
Long
id
)
{
return
iFireCarDao
.
findById
(
id
);
Optional
<
FireCar
>
FireCar1
=
iFireCarDao
.
findById
(
id
);
FireCar
fireCar
=
null
;
if
(
FireCar1
.
isPresent
()){
fireCar
=
FireCar1
.
get
();
}
return
fireCar
;
}
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id:
idArray
)
{
FireCar
fireCar
=
iFireCarDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireCar
>
fireCar1
=
iFireCarDao
.
findById
(
Long
.
parseLong
(
id
));
FireCar
fireCar
=
null
;
if
(
fireCar1
.
isPresent
()){
fireCar
=
fireCar1
.
get
();
}
if
(
fireCar
!=
null
)
{
this
.
iFireCarDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
iFireCarDao
.
delete
ById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteFireCar
(
Long
.
parseLong
(
id
));
}
else
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipPointServiceImpl.java
View file @
b2fe25f9
...
...
@@ -9,10 +9,11 @@ import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.op.core.util.StringUtil
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -21,6 +22,7 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"fireEquipPoint"
)
public
class
FireEquipPointServiceImpl
implements
IFireEquipPontService
{
...
...
@@ -44,14 +46,25 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
public
FireEquipmentPoint
queryOne
(
Long
id
)
{
return
fireEquipmentPointDao
.
findOne
(
id
);
Optional
<
FireEquipmentPoint
>
fireCar1
=
fireEquipmentPointDao
.
findById
(
id
);
FireEquipmentPoint
fireCar
=
null
;
if
(
fireCar1
.
isPresent
()){
fireCar
=
fireCar1
.
get
();
}
return
fireCar
;
}
public
String
[]
deletePoint
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
FireEquipmentPoint
fireEquipmentPoint
=
fireEquipmentPointDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireEquipmentPoint
>
fireEquipmentPoint1
=
fireEquipmentPointDao
.
findById
(
Long
.
parseLong
(
id
));
FireEquipmentPoint
fireEquipmentPoint
=
null
;
if
(
fireEquipmentPoint1
.
isPresent
()){
fireEquipmentPoint
=
fireEquipmentPoint1
.
get
();
}
if
(
fireEquipmentPoint
!=
null
)
{
this
.
fireEquipmentPointDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
fireEquipmentPointDao
.
delete
ById
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipServiceImpl.java
View file @
b2fe25f9
...
...
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"fireEquipService"
)
public
class
FireEquipServiceImpl
implements
IFireEquipService
{
...
...
@@ -59,14 +60,23 @@ public class FireEquipServiceImpl implements IFireEquipService {
public
FireEquipment
queryOne
(
Long
id
)
{
return
iFireEquipmentDao
.
findById
(
id
);
Optional
<
FireEquipment
>
fireEquipment1
=
iFireEquipmentDao
.
findById
(
id
);
if
(
fireEquipment1
.
isPresent
()){
return
fireEquipment1
.
get
();
}
return
null
;
}
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireEquipment
>
fireEquipment1
=
iFireEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
FireEquipment
fireEquipment
=
null
;
if
(
fireEquipment1
.
isPresent
()){
fireEquipment
=
fireEquipment1
.
get
();
}
if
(
fireEquipment
!=
null
)
{
this
.
iFireEquipmentDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
iFireEquipmentDao
.
delete
ById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteFierEqumt
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
...
...
@@ -147,24 +157,40 @@ public class FireEquipServiceImpl implements IFireEquipService {
{
case
pool:
case
hydrant:
WaterResource
waterResource
=
this
.
iWaterResourceDao
.
findById
(
id
);
returnEntity
=
waterResource
;
Optional
<
WaterResource
>
waterResource
=
this
.
iWaterResourceDao
.
findById
(
id
);
if
(
waterResource
.
isPresent
()){
returnEntity
=
waterResource
.
get
();
}
break
;
case
fireFoamRoom:
case
fireChamber:
FireStation
fireStation
=
iFireStationDao
.
findById
(
id
);
Optional
<
FireStation
>
fireStation1
=
iFireStationDao
.
findById
(
id
);
FireStation
fireStation
=
null
;
if
(
fireStation1
.
isPresent
()){
fireStation
=
fireStation1
.
get
();
}
fireStation
.
setFireEquipmentInfo
(
this
.
fireEquipMapper
.
queryForGroupCount
(
id
));
returnEntity
=
fireStation
;
break
;
case
extinguisher:
case
video:
case
monitorEquipment:
FireEquipment
fireEquipment
=
this
.
iFireEquipmentDao
.
findById
(
id
);
Optional
<
FireEquipment
>
fireEquipment1
=
this
.
iFireEquipmentDao
.
findById
(
id
);
FireEquipment
fireEquipment
=
null
;
if
(
fireEquipment1
.
isPresent
()){
fireEquipment
=
fireEquipment1
.
get
();
}
fireEquipment
.
setProtectObjNames
(
this
.
impEquipMapper
.
queryProtectObjNames
(
fireEquipment
.
getId
()));
returnEntity
=
fireEquipment
;
break
;
case
fireDetection:
FireEquipment
fireDetection
=
this
.
iFireEquipmentDao
.
findById
(
id
);
Optional
<
FireEquipment
>
fireDetection1
=
this
.
iFireEquipmentDao
.
findById
(
id
);
FireEquipment
fireDetection
=
null
;
if
(
fireDetection1
.
isPresent
()){
fireDetection
=
fireDetection1
.
get
();
}
fireDetection
.
setProtectObjNames
(
this
.
impEquipMapper
.
queryProtectObjNames
(
fireDetection
.
getId
()));
returnEntity
=
fireDetection
;
break
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireStationServiceImpl.java
View file @
b2fe25f9
...
...
@@ -6,6 +6,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -71,8 +72,18 @@ public class FireStationServiceImpl implements IFireStationService {
List
<
FireStationFireEquipment
>
fireStationFireEquipments
)
throws
Exception
{
for
(
FireStationFireEquipment
fireStationFireEquipment
:
fireStationFireEquipments
)
{
FireStation
fireStation
=
iFireStationDao
.
findById
(
fireStationFireEquipment
.
getFireStationId
());
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
findById
(
fireStationFireEquipment
.
getFireEquipmentId
());
Optional
<
FireStation
>
fireStation1
=
iFireStationDao
.
findById
(
fireStationFireEquipment
.
getFireStationId
());
Optional
<
FireEquipment
>
fireEquipment1
=
iFireEquipmentDao
.
findById
(
fireStationFireEquipment
.
getFireEquipmentId
());
FireStation
fireStation
=
null
;
FireEquipment
fireEquipment
=
null
;
if
(
fireStation1
.
isPresent
()){
fireStation
=
fireStation1
.
get
();
}
if
(
fireEquipment1
.
isPresent
()){
fireEquipment
=
fireEquipment1
.
get
();
}
Map
map
=
fireStationEquipmentMapper
.
queryRelation
(
fireStationFireEquipment
.
getFireStationId
(),
fireStationFireEquipment
.
getFireEquipmentId
());
if
(
fireStation
==
null
)
...
...
@@ -94,7 +105,7 @@ public class FireStationServiceImpl implements IFireStationService {
fireStationFireEquipment
.
getFireEquipmentId
());
if
(!
CollectionUtils
.
isEmpty
(
map
))
{
Long
id
=
Long
.
parseLong
(
String
.
valueOf
(
map
.
get
(
"id"
)));
this
.
iFireStationEquipmentDao
.
delete
(
id
);
this
.
iFireStationEquipmentDao
.
delete
ById
(
id
);
}
else
{
throw
new
Exception
(
"指定的数据不存在."
);
...
...
@@ -116,9 +127,13 @@ public class FireStationServiceImpl implements IFireStationService {
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
FireStation
fireStation
=
iFireStationDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireStation
>
fireStation1
=
iFireStationDao
.
findById
(
Long
.
parseLong
(
id
));
FireStation
fireStation
=
null
;
if
(
fireStation1
.
isPresent
()){
fireStation
=
fireStation1
.
get
();
}
if
(
fireStation
!=
null
)
{
this
.
iFireStationDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
iFireStationDao
.
delete
ById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteStation
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireStrengthServiceImpl.java
View file @
b2fe25f9
...
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"fireStengthService"
)
public
class
FireStrengthServiceImpl
implements
FireStengthService
{
...
...
@@ -38,10 +39,14 @@ public class FireStrengthServiceImpl implements FireStengthService {
{
for
(
String
id:
idArray
)
{
FireStrength
fireEquipmentPoint
=
fireStrengthPointDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireStrength
>
fireEquipmentPoint1
=
fireStrengthPointDao
.
findById
(
Long
.
parseLong
(
id
));
FireStrength
fireEquipmentPoint
=
null
;
if
(
fireEquipmentPoint1
.
isPresent
()){
fireEquipmentPoint
=
fireEquipmentPoint1
.
get
();
}
if
(
fireEquipmentPoint
!=
null
)
{
this
.
fireStrengthPointDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
fireStrengthPointDao
.
delete
ById
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
b2fe25f9
...
...
@@ -27,6 +27,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.UUID
;
@Service
(
"fmeaService"
)
...
...
@@ -65,7 +66,7 @@ public class FmeaServiceImpl implements IFmeaService {
List
<
Fmea
>
fmeas
=
(
List
<
Fmea
>)
paramMap
.
get
(
"fmeas"
);
fmeas
.
forEach
(
fmea
->
{
String
userId
=
paramMap
.
get
(
"user_id"
)
==
null
?
"0"
:
paramMap
.
get
(
"user_id"
).
toString
();
fmea
.
setCreateBy
(
Integer
.
parseInt
(
userId
)
);
fmea
.
setCreateBy
(
userId
);
// RiskSource riskSource = iRiskSourceDao.findById(fmea.getRiskSourceId());
// fmea.setRiskSource(riskSource);
iFmeaDao
.
save
(
fmea
);
...
...
@@ -177,7 +178,11 @@ public class FmeaServiceImpl implements IFmeaService {
riskSourceRo
.
setRiskState
(
riskSource
.
getStatus
());
riskSourceRo
.
setRpni
(
rpni
);
RiskLevel
riskLevel
=
iRiskLevelDao
.
findOne
(
riskSource
.
getRiskLevelId
());
Optional
<
RiskLevel
>
riskLevel1
=
iRiskLevelDao
.
findById
(
riskSource
.
getRiskLevelId
());
RiskLevel
riskLevel
=
null
;
if
(
riskLevel1
.
isPresent
()){
riskLevel
=
riskLevel1
.
get
();
}
if
(
riskLevel
!=
null
)
{
riskSourceRo
.
setRiskLevel
(
riskLevel
.
getLevel
());
}
...
...
@@ -190,7 +195,11 @@ public class FmeaServiceImpl implements IFmeaService {
if
(!
CollectionUtils
.
isEmpty
(
fmeaList
))
{
for
(
Fmea
fmea
:
fmeaList
)
{
RPNiSum
.
add
(
fmea
.
getRpni
());
RiskFactor
factor
=
iRiskFactorDao
.
findOne
(
fmea
.
getRiskFactorsId
());
RiskFactor
factor
=
null
;
Optional
<
RiskFactor
>
factor1
=
iRiskFactorDao
.
findById
(
fmea
.
getRiskFactorsId
());
if
(
factor1
.
isPresent
()){
factor
=
factor1
.
get
();
}
if
(
factor
!=
null
)
riskFactor
+=
factor
.
getName
()
+
"\n"
;
}
...
...
@@ -221,7 +230,11 @@ public class FmeaServiceImpl implements IFmeaService {
Integer
maxLevel
=
0
;
List
<
RiskSource
>
anomalyRiskSource
=
findAnomalyRiskSource
(
regionRiskSourceId
);
for
(
RiskSource
anomaly
:
anomalyRiskSource
)
{
RiskLevel
anomalyLevel
=
this
.
iRiskLevelDao
.
findOne
(
anomaly
.
getRiskLevelId
());
Optional
<
RiskLevel
>
anomalyLevel1
=
this
.
iRiskLevelDao
.
findById
(
anomaly
.
getRiskLevelId
());
RiskLevel
anomalyLevel
=
null
;
if
(
anomalyLevel1
.
isPresent
()){
anomalyLevel
=
anomalyLevel1
.
get
();
}
if
(
anomalyLevel
!=
null
&&
anomalyLevel
.
getLevel
()
>
maxLevel
)
maxLevel
=
anomalyLevel
.
getLevel
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ITopographyNodeServiceImpl.java
View file @
b2fe25f9
...
...
@@ -33,7 +33,7 @@ public class ITopographyNodeServiceImpl implements ITopographyNodeService{
TopographyNode
node
=
nodeData
.
stream
().
filter
(
n
->
topographyNode
.
getId
().
equals
(
n
.
getId
())).
findFirst
().
get
();
topographyNode
.
setLoc
(
node
.
getLoc
());
}
topographyNodeDao
.
save
(
list
);
topographyNodeDao
.
save
All
(
list
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
b2fe25f9
...
...
@@ -8,10 +8,10 @@ import com.yeejoin.amos.fas.business.feign.IMaasVisualServer;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -63,7 +63,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
public
TextPlan
getTextPlanInfoById
(
Long
id
)
{
return
iTextPlanDao
.
findOne
(
id
);
Optional
<
TextPlan
>
textPlan
=
iTextPlanDao
.
findById
(
id
);
if
(
textPlan
.
isPresent
()){
return
textPlan
.
get
();
}
return
null
;
}
private
List
<
TreeSubjectVo
>
listToTree
(
List
<
Object
>
list
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
b2fe25f9
...
...
@@ -26,8 +26,8 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRpnChangeLogDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IUserDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteRuleServer
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.jpush.AppMessagePushService
;
import
com.yeejoin.amos.fas.business.jpush.JPushTypeEnum
;
...
...
@@ -68,8 +68,9 @@ import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.dao.entity.RpnChangeLog
;
import
com.yeejoin.amos.fas.dao.entity.SUser
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -96,6 +97,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.concurrent.BlockingQueue
;
...
...
@@ -175,7 +177,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
IPPointDao
iPPointDao
;
@Autowired
private
IUserDao
iUserDao
;
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
IRpnChangeLogDao
iRpnChangeLogDao
;
...
...
@@ -229,7 +231,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
String
userId
=
map
.
get
(
"user_id"
)
==
null
?
"0"
:
map
.
get
(
"user_id"
).
toString
();
riskSource
.
setOrgCode
(
orgCode
);
riskSource
.
setCreateBy
(
Integer
.
parseInt
(
userId
));
RiskSource
oldRiskSource
=
iRiskSourceDao
.
findById
(
id
);
Optional
<
RiskSource
>
oldRiskSource1
=
iRiskSourceDao
.
findById
(
id
);
RiskSource
oldRiskSource
=
null
;
if
(
oldRiskSource1
.
isPresent
()){
oldRiskSource
=
oldRiskSource1
.
get
();
}
if
(
id
==
0
)
{
//新增
riskSource
.
setStatus
(
FasConstant
.
RISK_SOURCE_STATUS_NORMAL
);
riskSource
.
setCreateDate
(
new
Date
());
...
...
@@ -262,7 +268,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Long
id
=
Collections
.
min
(
Arrays
.
asList
(
riskSourceId
));
Long
parentId
=
0L
;
if
(
null
!=
id
)
{
RiskSource
rs
=
iRiskSourceDao
.
findById
(
id
);
Optional
<
RiskSource
>
rs1
=
iRiskSourceDao
.
findById
(
id
);
RiskSource
rs
=
null
;
if
(
rs1
.
isPresent
()){
rs
=
rs1
.
get
();
}
parentId
=
rs
.
getParentId
();
}
for
(
Long
rId
:
riskSourceId
)
{
...
...
@@ -270,7 +280,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
count
>
0
)
{
throw
new
YeeException
(
"该数据有关联子项,请先删除子项数据"
);
}
iRiskSourceDao
.
delete
(
rId
);
iRiskSourceDao
.
delete
ById
(
rId
);
}
// if (null != parentId) {
//// updateRiskSourceRpni(parentId);
...
...
@@ -476,7 +486,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
deviceData
.
setNodeState
(
deviceData
.
getValue
());
String
batchNo
=
UUID
.
randomUUID
().
toString
();
deviceData
.
setBatchNo
(
batchNo
);
FireEquipment
fireEquipment
=
this
.
iFireEquipmentDao
.
findById
(
deviceData
.
getFireEquimentId
());
Optional
<
FireEquipment
>
fireEquipment1
=
this
.
iFireEquipmentDao
.
findById
(
deviceData
.
getFireEquimentId
());
FireEquipment
fireEquipment
=
null
;
if
(
fireEquipment1
.
isPresent
()){
fireEquipment
=
fireEquipment1
.
get
();
}
Equipment
equipment
=
null
;
if
(
fireEquipment
!=
null
)
{
deviceData
.
setCode
(
fireEquipment
.
getCode
());
...
...
@@ -615,7 +630,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceRo
.
setRiskState
(
riskSource
.
getStatus
());
riskSourceRo
.
setRpni
(
rpni
);
RiskLevel
riskLevel
=
iRiskLevelDao
.
findById
(
riskSource
.
getRiskLevelId
());
Optional
<
RiskLevel
>
riskLevel1
=
iRiskLevelDao
.
findById
(
riskSource
.
getRiskLevelId
());
RiskLevel
riskLevel
=
null
;
if
(
riskLevel1
.
isPresent
()){
riskLevel
=
riskLevel1
.
get
();
}
if
(
riskLevel
!=
null
)
{
riskSourceRo
.
setRiskLevel
(
riskLevel
.
getLevel
());
}
...
...
@@ -628,7 +647,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(!
CollectionUtils
.
isEmpty
(
fmeaList
))
{
for
(
Fmea
fmea
:
fmeaList
)
{
RPNiSum
.
add
(
fmea
.
getRpni
());
RiskFactor
factor
=
iRiskFactorDao
.
findById
(
fmea
.
getRiskFactorsId
());
Optional
<
RiskFactor
>
factor1
=
iRiskFactorDao
.
findById
(
fmea
.
getRiskFactorsId
());
RiskFactor
factor
=
null
;
if
(
factor1
.
isPresent
()){
factor
=
factor1
.
get
();
}
if
(
factor
!=
null
)
riskFactor
+=
factor
.
getName
()
+
"\n"
;
}
...
...
@@ -732,7 +755,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Integer
maxLevel
=
0
;
List
<
RiskSource
>
anomalyRiskSource
=
findAnomalyRiskSource
(
regionRiskSourceId
);
for
(
RiskSource
anomaly
:
anomalyRiskSource
)
{
RiskLevel
anomalyLevel
=
this
.
iRiskLevelDao
.
findById
(
anomaly
.
getRiskLevelId
());
Optional
<
RiskLevel
>
anomalyLevel1
=
this
.
iRiskLevelDao
.
findById
(
anomaly
.
getRiskLevelId
());
RiskLevel
anomalyLevel
=
null
;
if
(
anomalyLevel1
.
isPresent
()){
anomalyLevel
=
anomalyLevel1
.
get
();
}
if
(
anomalyLevel
!=
null
&&
anomalyLevel
.
getLevel
()
>
maxLevel
)
maxLevel
=
anomalyLevel
.
getLevel
();
}
...
...
@@ -828,19 +855,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Async
public
void
processProtalData
(
ProtalDataRo
protalData
)
{
public
void
processProtalData
(
String
toke
,
String
product
,
String
appKey
,
ProtalDataRo
protalData
)
{
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
protalData
.
setBatchNo
(
bacthNo
);
PPoint
pPoint
=
iPPointDao
.
findById
(
protalData
.
getId
());
Optional
<
PPoint
>
pPoint1
=
iPPointDao
.
findById
(
protalData
.
getId
());
PPoint
pPoint
=
null
;
if
(
pPoint1
.
isPresent
()){
pPoint
=
pPoint1
.
get
();
}
if
(
pPoint
!=
null
)
{
protalData
.
setOriginalNodeState
(
pPoint
.
getStatus
());
protalData
.
setLevel
(
pPoint
.
getLevel
());
protalData
.
setPointNo
(
pPoint
.
getPointNo
());
protalData
.
setPointName
(
pPoint
.
getName
());
SUser
sUser
=
this
.
iUserDao
.
findById
(
pPoint
.
getChargePersonId
());
AgencyUserModel
sUser
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
pPoint
.
getChargePersonId
());
if
(
sUser
!=
null
)
{
protalData
.
setUserName
(
sUser
.
getName
());
protalData
.
setUserName
(
sUser
.
get
User
Name
());
}
else
{
protalData
.
setUserName
(
""
);
}
...
...
@@ -983,7 +1017,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
BigDecimal
findParent
(
RiskSource
riskSource
,
BigDecimal
RPNi
)
throws
Exception
{
if
(
null
!=
riskSource
&&
riskSource
.
getId
()
!=
0
&&
riskSource
.
getParentId
()
!=
0
&&
null
!=
RPNi
&&
RPNi
.
doubleValue
()
!=
0
)
{
// RiskSource parent = iRiskSourceDao.getOne(0L);
RiskSource
parent
=
iRiskSourceDao
.
findById
(
riskSource
.
getParentId
());
Optional
<
RiskSource
>
parent1
=
iRiskSourceDao
.
findById
(
riskSource
.
getParentId
());
RiskSource
parent
=
null
;
if
(
parent1
.
isPresent
()){
parent
=
parent1
.
get
();
}
if
(
null
!=
parent
)
{
List
<
BigDecimal
>
childRpniList
=
new
ArrayList
<>();
List
<
RiskSource
>
children
=
iRiskSourceDao
.
findByParentId
(
parent
.
getId
());
...
...
@@ -1065,7 +1103,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Dict
dict
=
dictDao
.
getOne
(
fireEquipmentPoint
.
getAlarmType
());
fireEquipmentPointType
=
dict
.
getDictValue
();
}
FireEquipment
fireEquipment
=
this
.
iFireEquipmentDao
.
findById
(
fireEquipmentPoint
.
getFireEquipmentId
());
Optional
<
FireEquipment
>
fireEquipment1
=
this
.
iFireEquipmentDao
.
findById
(
fireEquipmentPoint
.
getFireEquipmentId
());
FireEquipment
fireEquipment
=
null
;
if
(
fireEquipment1
.
isPresent
()){
fireEquipment
=
fireEquipment1
.
get
();
}
Equipment
equipment
=
null
;
if
(
fireEquipment
!=
null
)
{
deviceData
.
setCode
(
fireEquipment
.
getCode
());
...
...
@@ -1219,7 +1261,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
param
.
getPointCode
());
Dict
dict
=
null
;
if
(
fireEquipmentPoint
.
getAlarmType
()
!=
null
)
{
dict
=
dictDao
.
findOne
(
fireEquipmentPoint
.
getAlarmType
());
Optional
<
Dict
>
dict1
=
dictDao
.
findById
(
fireEquipmentPoint
.
getAlarmType
());
if
(
dict1
.
isPresent
()){
dict
=
dict1
.
get
();
}
}
if
(!
param
.
getState
().
equals
(
fireEquipmentPoint
.
getValue
()))
{
fireEquipmentPoint
.
setValue
(
param
.
getState
());
...
...
@@ -1255,7 +1300,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
data
;
}).
filter
(
param
->
!
ObjectUtils
.
isEmpty
(
param
)).
collect
(
Collectors
.
toList
());
equipCommunicationDao
.
save
(
list
);
equipCommunicationDao
.
save
All
(
list
);
}
private
void
notifyAlarm
(
FireEquipmentPoint
fireEquipmentPoint
,
AlarmParam
param
)
{
...
...
@@ -1424,7 +1469,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 修改、添加导致rpn、rpni改变
*/
@Override
public
void
notifyFmeaFromUpdate
(
Long
fmeaId
,
String
nofityType
)
{
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
return
;
...
...
@@ -1449,7 +1494,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmea
.
setRpn
(
rpn
);
if
(
newLevel
!=
null
)
{
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
jpushTarget
=
getJpushTarget
(
fmea
,
newLevel
.
getLevel
());
jpushTarget
=
getJpushTarget
(
toke
,
product
,
appKey
,
fmea
,
newLevel
.
getLevel
());
}
fmeaMapper
.
updateRpn
(
fmea
);
saveRpnLog
(
fmea
.
getRiskSourceId
(),
fmeaId
,
rpn
,
rpni
);
...
...
@@ -1457,9 +1502,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
private
String
getJpushTarget
(
Fmea
fmea
,
Integer
level
)
{
private
String
getJpushTarget
(
String
toke
,
String
product
,
String
appKey
,
Fmea
fmea
,
Integer
level
)
{
String
jpushTarget
=
null
;
Lo
ng
userId
=
null
;
Stri
ng
userId
=
null
;
if
(
level
.
equals
(
1
))
{
userId
=
fmea
.
getCompanyLeader
();
}
else
if
(
level
.
equals
(
2
))
{
...
...
@@ -1470,7 +1515,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
userId
=
fmea
.
getPersonLeader
();
}
if
(
userId
!=
null
)
{
SUser
user
=
iUserDao
.
findById
(
userId
);
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
userId
);
if
(
user
!=
null
)
{
jpushTarget
=
user
.
getMobile
();
}
...
...
@@ -1482,7 +1528,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 告警或者不合格项导致fmea的rpn、new_evaluation_oid改变
*/
@Override
public
void
notifyFmeaFromAbnormal
(
Long
fmeaId
,
String
notifyType
)
{
public
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
return
;
...
...
@@ -1505,7 +1551,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmea
.
setNewEvaluationOid
(
oEvaluationModel
.
getId
());
String
jpushTarget
=
null
;
if
(
newLevel
!=
null
)
{
jpushTarget
=
getJpushTarget
(
fmea
,
newLevel
.
getLevel
());
jpushTarget
=
getJpushTarget
(
toke
,
product
,
appKey
,
fmea
,
newLevel
.
getLevel
());
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
}
fmeaMapper
.
updateRpn
(
fmea
);
...
...
@@ -1582,7 +1628,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
*/
@Override
public
void
notifyRiskSource
(
Long
riskSourceId
,
String
notifyType
,
String
jpushTarget
)
{
RiskSource
riskSource
=
iRiskSourceDao
.
findById
(
riskSourceId
);
Optional
<
RiskSource
>
riskSource1
=
iRiskSourceDao
.
findById
(
riskSourceId
);
RiskSource
riskSource
=
null
;
if
(
riskSource1
.
isPresent
()){
riskSource
=
riskSource1
.
get
();
}
if
(
riskSource
==
null
)
{
return
;
}
...
...
@@ -1692,4 +1742,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
return
null
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/WaterResourceServiceImpl.java
View file @
b2fe25f9
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -59,10 +60,14 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
{
for
(
String
id:
idArray
)
{
WaterResource
waterResource
=
iWaterResourceDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
WaterResource
>
waterResource1
=
iWaterResourceDao
.
findById
(
Long
.
parseLong
(
id
));
WaterResource
waterResource
=
null
;
if
(
waterResource1
.
isPresent
()){
waterResource
=
waterResource1
.
get
();
}
if
(
waterResource
!=
null
)
{
this
.
iWaterResourceDao
.
delete
(
Long
.
parseLong
(
id
));
this
.
iWaterResourceDao
.
delete
ById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteWater
(
Long
.
parseLong
(
id
));
}
else
{
...
...
@@ -93,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
saveList
.
add
(
waterResourceEquipment
);
}
}
iWaterResourceEquipmentDao
.
save
(
saveList
);
iWaterResourceEquipmentDao
.
save
All
(
saveList
);
}
...
...
@@ -107,7 +112,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
deleteList
.
add
(
waterResourceEquipment
);
}
}
iWaterResourceEquipmentDao
.
delete
(
deleteList
);
iWaterResourceEquipmentDao
.
delete
All
(
deleteList
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/AMOSSecurityServer.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
org.springframework.cloud.
netflix.
feign.FeignClient
;
import
org.springframework.cloud.
open
feign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
@FeignClient
(
"AMOSSECURITY"
)
public
interface
AMOSSecurityServer
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/ICommonService.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.dao.entity.SDepartment
;
import
com.yeejoin.amos.fas.dao.entity.SUser
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.data.domain.Page
;
import
java.util.HashMap
;
...
...
@@ -10,7 +11,7 @@ import java.util.List;
public
interface
ICommonService
{
List
<
SDepartment
>
getDepartment
(
Lo
ng
companyId
);
List
<
DepartmentModel
>
getDepartment
(
String
toke
,
String
product
,
String
appKey
,
Stri
ng
companyId
);
Page
<
HashMap
<
String
,
Object
>>
getPointList
(
PointListParam
params
);
...
...
@@ -22,12 +23,12 @@ public interface ICommonService {
* @param departmentId
* @return
*/
List
<
SUser
>
getUsers
(
Lo
ng
departmentId
);
List
<
AgencyUserModel
>
getUsers
(
String
toke
,
String
product
,
String
appKey
,
Stri
ng
departmentId
);
/**
* 获取公司下所有用户
*
* @return
*/
List
<
SUser
>
getAllUser
(
);
List
<
AgencyUserModel
>
getAllUser
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentService.java
View file @
b2fe25f9
...
...
@@ -4,10 +4,10 @@ import com.yeejoin.amos.fas.business.param.ImgParam;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.op.core.common.query.DaoCriteria
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFireEquipPontService.java
View file @
b2fe25f9
...
...
@@ -2,8 +2,8 @@ package com.yeejoin.amos.fas.business.service.intfc;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
b2fe25f9
...
...
@@ -72,7 +72,7 @@ public interface IRiskSourceService {
boolean
processTaskData
(
ProtalDataRo
taskData
)
throws
Exception
;
void
processProtalData
(
ProtalDataRo
protalData
)
throws
Exception
;
void
processProtalData
(
String
toke
,
String
product
,
String
appKey
,
ProtalDataRo
protalData
)
throws
Exception
;
RiskSourceTreeResponse
queryRiskSourceDetailById
(
Long
id
);
...
...
@@ -107,9 +107,10 @@ public interface IRiskSourceService {
Integer
getChildTypeByPid
(
Long
riskSourceId
);
void
notifyFmeaFromAbnormal
(
Long
fmeaId
,
String
notifyType
);
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
);
void
notifyFmeaFromUpdate
(
Long
fmeaId
,
String
nofityType
);
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
);
void
notifyRiskSource
(
Long
riskSourceId
,
String
notifyType
,
String
jpushTarget
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/FireEquimentData.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.op.core.entity.Resource
;
import
java.io.Serializable
;
public
class
FireEquimentData
extends
Resource
implements
Serializable
public
class
FireEquimentData
/*extends Resource*/
implements
Serializable
{
private
long
fireEquimentId
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ProtalData.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.op.core.entity.Resource
;
import
java.io.Serializable
;
public
class
ProtalData
extends
Resource
implements
Serializable
public
class
ProtalData
/*extends Resource*/
implements
Serializable
{
private
long
id
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/TaskData.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.op.core.entity.Resource
;
import
java.io.Serializable
;
public
class
TaskData
extends
Resource
implements
Serializable
{
public
class
TaskData
/*extends Resource*/
implements
Serializable
{
private
Long
taskID
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/CacheFactory.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
//获取对象
public
class
CacheFactory
{
private
static
CacheMap
cacheMap
;
private
CacheFactory
(){
}
public
synchronized
static
CacheMap
newChacheMap
(){
if
(
cacheMap
==
null
){
cacheMap
=
new
CacheMap
();
}
return
cacheMap
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/CacheMap.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentHashMap
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
public
class
CacheMap
{
//缓存Map
ConcurrentHashMap
<
String
,
CacheValue
>
cacheMap
=
new
ConcurrentHashMap
<
String
,
CacheValue
>
();
//保证不能被外界 构造
CacheMap
(){
}
public
void
setex
(
String
key
,
Toke
value
,
long
times
){
CacheValue
cValue
=
new
CacheValue
();
cValue
.
setTimes
(
System
.
currentTimeMillis
()+
times
*
1000
);
cValue
.
setValue
(
value
);
cacheMap
.
put
(
key
,
cValue
);
}
public
Toke
getValue
(
String
key
){
CacheValue
cValue
=
cacheMap
.
get
(
key
);
if
(
cValue
!=
null
&&
cValue
.
getTimes
()>
System
.
currentTimeMillis
()){
return
cValue
.
getValue
();
}
else
if
(
cValue
!=
null
&&
cacheMap
.
containsKey
(
key
)){
//清理一次
cacheMap
.
remove
(
key
);
}
return
null
;
}
/**
获取key集合
@return
*/
public
Set
getKeys
(){
return
cacheMap
.
keySet
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/CacheValue.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
public
class
CacheValue
{
private
Toke
value
;
//真实数据对象
private
long
times
;
//缓存到期时间
public
Toke
getValue
()
{
return
value
;
}
public
void
setValue
(
Toke
value
)
{
this
.
value
=
value
;
}
public
long
getTimes
()
{
return
times
;
}
public
void
setTimes
(
long
times
)
{
this
.
times
=
times
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/Constants.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
/**
* <pre>
* 系统常量
* </pre>
*
* @author mincx
* @version Constants.java v0.1
* @time 2017-9-19 15:43:32
*/
public
class
Constants
{
public
static
final
String
ERROR_MESSAGE
=
"系统异常"
;
public
static
final
String
RESULT_SUCCESS
=
"SUCCESS"
;
public
static
final
String
RESULT_FAILURE
=
"FAILURE"
;
public
static
final
String
RULE_FACT_PREFIX
=
"rule_"
;
public
static
final
String
RULE_COMPILATION_ERROR
=
"规则编译异常"
;
public
static
final
String
NEW_LINE
=
"\r\n"
;
public
static
final
String
POSITION_LATITUDE
=
"latitude"
;
public
static
final
String
POSITION_LONGITUDE
=
"longitude"
;
public
static
final
double
PI
=
3.1415
;
public
static
final
double
EARTH_RADIUS
=
6370.996
;
public
static
final
String
RULE_CONDITION_AND
=
"&&"
;
public
static
final
String
RULE_CONDITION_OR
=
"||"
;
/**
* DES加密解密默认key
*/
public
static
final
String
XSS_KEY
=
"qaz"
;
/**
* 灾情状态
*/
public
static
final
String
FireHappenStateID
=
"90db70b7-49a4-4a72-b54b-0fabbed9bec7"
;
//发生
public
static
final
String
FireDevelopStateID
=
"1f7fe7d7-b30c-4518-8c95-6e3bc506ca86"
;
//猛烈
/**
* 车辆状态
*/
public
static
final
String
CarArrivedStateID
=
"ad55748a-1206-4507-8831-95b7f2ad804f"
;
//到达
public
static
final
String
CarDispatchingStateID
=
"43a23576-3d0f-4c3d-a46b-555391a4d870"
;
//待出动
public
static
final
String
CarOnDutyStateID
=
"21cc717f-60b4-46ae-942e-9efd63d13415"
;
//执勤
public
static
final
String
CarOnSiteStateID
=
"d7eddc16-4c55-4de0-b726-3547c7b0b980"
;
//在位
public
static
final
String
CarOnTheWayStateID
=
"5e1b6e98-d1dc-4c49-a7ad-b959d2278dba"
;
//在途
public
static
final
String
CarRepairStateID
=
"e86d455b-e9fd-4938-9826-38ca46623287"
;
//维修
/**
* 战斗力量编队状态
*/
public
static
final
String
RescuePowerArrivedStateID
=
"0951f770-7f75-43d8-bcec-47d7559be727"
;
//到达
public
static
final
String
RescuePowerDispatchedStateID
=
"ec4afc56-6cec-41a3-95f5-20c735f052d4"
;
//已调派
public
static
final
String
RescuePowerEnhanceStateID
=
"3d6cf113-b69d-47c3-a3a8-ded448cc4636"
;
//增援
public
static
final
String
RescuePowerFightingStateID
=
"4bacd4b4-b07d-454e-b737-431e7c997cde"
;
//战斗
public
static
final
String
RescuePowerStandByStateID
=
"4fc6e4d6-c6a8-453c-b554-ce7de0b828b2"
;
//待命
/**
* sql注入关键字
*/
public
static
String
badStr
=
"'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|"
+
"char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|"
+
"table|from|grant|use|group_concat|column_name|"
+
"information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|"
+
"chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#"
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/JSONUtil.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
com.google.gson.reflect.TypeToken
;
/**
*
* <pre>
* JSON宸ュ叿绫�
* </pre>
*
* @author dell
* @version $Id: JSONUtil.java, v 0.1 2017骞�3鏈�28鏃� 涓嬪崍9:04:47 dell Exp $
*/
public
class
JSONUtil
{
private
static
Gson
gson
=
null
;
static
{
gson
=
new
Gson
();
}
public
static
synchronized
Gson
newInstance
()
{
if
(
gson
==
null
)
{
gson
=
new
Gson
();
}
return
gson
;
}
public
static
String
toJson
(
Object
obj
)
{
return
gson
.
toJson
(
obj
);
}
public
static
<
T
>
T
toBean
(
String
json
,
Class
<
T
>
clz
)
{
return
gson
.
fromJson
(
json
,
clz
);
}
public
static
<
T
>
Map
<
String
,
T
>
toMap
(
String
json
,
Class
<
T
>
clz
)
{
Map
<
String
,
JsonObject
>
map
=
gson
.
fromJson
(
json
,
new
TypeToken
<
Map
<
String
,
JsonObject
>>()
{
}.
getType
());
Map
<
String
,
T
>
result
=
new
HashMap
<>();
for
(
String
key
:
map
.
keySet
())
{
result
.
put
(
key
,
gson
.
fromJson
(
map
.
get
(
key
),
clz
));
}
return
result
;
}
public
static
Map
<
String
,
Object
>
toMap
(
String
json
)
{
Map
<
String
,
Object
>
map
=
gson
.
fromJson
(
json
,
new
TypeToken
<
Map
<
String
,
Object
>>()
{
}.
getType
());
return
map
;
}
public
static
<
T
>
List
<
T
>
toList
(
String
json
,
Class
<
T
>
clz
)
{
JsonArray
array
=
new
JsonParser
().
parse
(
json
).
getAsJsonArray
();
List
<
T
>
list
=
new
ArrayList
<>();
for
(
final
JsonElement
elem
:
array
)
{
list
.
add
(
gson
.
fromJson
(
elem
,
clz
));
}
return
list
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/StringUtil.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
java.math.BigDecimal
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
StringUtil
{
private
static
Pattern
NOT_ZERO_AT_THE_END
=
Pattern
.
compile
(
"[1-9]+\\d*[1-9]+"
);
private
static
Pattern
numericPattern
=
Pattern
.
compile
(
"-?[0-9]+\\.?[0-9]*"
);
/**
* 鍒ゆ柇瀵硅薄鏄惁涓虹┖
*
* @param str
* @return
*/
public
static
boolean
isNotEmpty
(
Object
str
)
{
boolean
flag
=
true
;
if
(
str
!=
null
&&
!
str
.
equals
(
""
))
{
if
(
str
.
toString
().
length
()
>
0
)
{
flag
=
true
;
}
}
else
{
flag
=
false
;
}
return
flag
;
}
/***************************************************************************
* repeat - 閫氳繃婧愬瓧绗︿覆閲嶅鐢熸垚N娆$粍鎴愭柊鐨勫瓧绗︿覆銆�
*
* @param src
* - 婧愬瓧绗︿覆 渚嬪: 绌烘牸(" "), 鏄熷彿("*"), "娴欐睙" 绛夌瓑...
* @param num
* - 閲嶅鐢熸垚娆℃暟
* @return 杩斿洖宸茬敓鎴愮殑閲嶅瀛楃涓�
* @version 1.0 (2006.10.10) Wilson Lin
**************************************************************************/
public
static
String
repeat
(
String
src
,
int
num
)
{
StringBuffer
s
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
num
;
i
++)
s
.
append
(
src
);
return
s
.
toString
();
}
/**
* 鍒ゆ柇鏄惁鏁板瓧琛ㄧず
*
* @param
* @return 鏄惁鏁板瓧鐨勬爣蹇�
*/
public
static
boolean
isNumeric
(
String
str
)
{
// 璇ユ鍒欒〃杈惧紡鍙互鍖归厤鎵�鏈夌殑鏁板瓧 鍖呮嫭璐熸暟
String
bigStr
;
try
{
bigStr
=
new
BigDecimal
(
str
).
toString
();
}
catch
(
Exception
e
)
{
return
false
;
//寮傚父 璇存槑鍖呭惈闈炴暟瀛椼��
}
Matcher
isNum
=
numericPattern
.
matcher
(
bigStr
);
// matcher鏄叏鍖归厤
if
(!
isNum
.
matches
())
{
return
false
;
}
return
true
;
}
public
static
int
toInt
(
String
s
)
{
if
(
s
!=
null
&&
!
""
.
equals
(
s
.
trim
()))
{
try
{
return
Integer
.
parseInt
(
s
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
return
0
;
}
/**
* 鎴彇鍓嶅悗閮戒笉鏄�0鐨勬暟瀛楀瓧绗︿覆
* <p>
* 12010102 => 12010102
* 12010100 => 120101
* ab1201100b => 12011
*
* @param str
* @return
*/
public
static
String
delEndZero
(
String
str
)
{
Matcher
mat
=
NOT_ZERO_AT_THE_END
.
matcher
(
str
);
boolean
rs
=
mat
.
find
();
if
(
rs
)
{
return
mat
.
group
(
0
);
}
return
null
;
}
/**
* <pre>
* 绉婚櫎瀛楃涓插悗闈㈢殑0
* </pre>
*
* @param s
* @return
*/
public
static
String
removeSufixZero
(
String
s
)
{
if
(
s
==
null
)
{
return
""
;
}
while
(
s
.
endsWith
(
"0"
))
{
if
(
s
.
equals
(
"0"
))
{
s
=
""
;
break
;
}
s
=
s
.
substring
(
0
,
s
.
length
()
-
1
);
}
return
s
;
}
public
static
String
notNull
(
String
s
){
return
s
!=
null
?
s:
""
;
}
public
static
boolean
isStartWithDigit
(
String
str
){
char
firstCharacter
=
str
.
charAt
(
0
);
return
Character
.
isDigit
(
firstCharacter
);
}
public
static
void
main
(
String
[]
args
){
System
.
out
.
println
(
isStartWithDigit
(
"a3730e937-17e5-4720-8f69-99e8d87d2ee7"
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/CompanyBo.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
java.util.List
;
public
class
CompanyBo
{
private
String
address
;
private
String
companyName
;
private
Long
companyOrgCode
;
private
String
email
;
private
String
landlinePhone
;
private
String
latitude
;
private
String
level
;
private
String
longitude
;
private
String
orgCode
;
private
String
parentId
;
private
String
sequenceNbr
;
private
List
<
CompanyBo
>
children
;
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
Long
getCompanyOrgCode
()
{
return
companyOrgCode
;
}
public
void
setCompanyOrgCode
(
Long
companyOrgCode
)
{
this
.
companyOrgCode
=
companyOrgCode
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getLandlinePhone
()
{
return
landlinePhone
;
}
public
void
setLandlinePhone
(
String
landlinePhone
)
{
this
.
landlinePhone
=
landlinePhone
;
}
public
String
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
public
String
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
String
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getSequenceNbr
()
{
return
sequenceNbr
;
}
public
void
setSequenceNbr
(
String
sequenceNbr
)
{
this
.
sequenceNbr
=
sequenceNbr
;
}
public
List
<
CompanyBo
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
CompanyBo
>
children
)
{
this
.
children
=
children
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/DepartmentBo.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
java.util.List
;
public
class
DepartmentBo
{
private
String
departmentName
;
private
String
level
;
private
String
deptOrgCode
;
private
String
orgCode
;
private
String
departmentDesc
;
private
String
companySeq
;
private
String
sequenceNbr
;
private
String
parentId
;
private
List
<
DepartmentBo
>
children
;
public
String
getDepartmentName
()
{
return
departmentName
;
}
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
;
}
public
String
getDeptOrgCode
()
{
return
deptOrgCode
;
}
public
void
setDeptOrgCode
(
String
deptOrgCode
)
{
this
.
deptOrgCode
=
deptOrgCode
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
String
getDepartmentDesc
()
{
return
departmentDesc
;
}
public
void
setDepartmentDesc
(
String
departmentDesc
)
{
this
.
departmentDesc
=
departmentDesc
;
}
public
String
getCompanySeq
()
{
return
companySeq
;
}
public
void
setCompanySeq
(
String
companySeq
)
{
this
.
companySeq
=
companySeq
;
}
public
String
getSequenceNbr
()
{
return
sequenceNbr
;
}
public
void
setSequenceNbr
(
String
sequenceNbr
)
{
this
.
sequenceNbr
=
sequenceNbr
;
}
public
String
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
List
<
DepartmentBo
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
DepartmentBo
>
children
)
{
this
.
children
=
children
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ReginParams.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
java.io.Serializable
;
public
class
ReginParams
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
CompanyBo
company
;
private
RoleBo
role
;
private
DepartmentBo
department
;
public
CompanyBo
getCompany
()
{
return
company
;
}
public
void
setCompany
(
CompanyBo
company
)
{
this
.
company
=
company
;
}
public
RoleBo
getRole
()
{
return
role
;
}
public
void
setRole
(
RoleBo
role
)
{
this
.
role
=
role
;
}
public
DepartmentBo
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
DepartmentBo
department
)
{
this
.
department
=
department
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/RoleBo.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
public
class
RoleBo
{
private
String
roleName
;
private
String
roleType
;
private
String
sequenceNbr
;
public
String
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
String
roleName
)
{
this
.
roleName
=
roleName
;
}
public
String
getRoleType
()
{
return
roleType
;
}
public
void
setRoleType
(
String
roleType
)
{
this
.
roleType
=
roleType
;
}
public
String
getSequenceNbr
()
{
return
sequenceNbr
;
}
public
void
setSequenceNbr
(
String
sequenceNbr
)
{
this
.
sequenceNbr
=
sequenceNbr
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/Toke.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
//请求参数
public
class
Toke
{
public
String
toke
;
public
String
product
;
public
String
appKey
;
public
String
getToke
()
{
return
toke
;
}
public
void
setToke
(
String
toke
)
{
this
.
toke
=
toke
;
}
public
String
getProduct
()
{
return
product
;
}
public
void
setProduct
(
String
product
)
{
this
.
product
=
product
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
client
.
invoke
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.util.CacheFactory
;
import
com.yeejoin.amos.fas.business.util.CacheMap
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.context.IotContext
;
import
org.apache.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.Executors
;
...
...
@@ -19,7 +25,10 @@ public class RsDataQueue {
private
ScheduledExecutorService
service_apdu
=
null
;
private
IRiskSourceService
riskSourceService
;
private
volatile
static
RsDataQueue
instance
=
null
;
private
static
final
String
TOKE
=
"TOKE"
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RsDataQueue
()
{
riskSourceService
=
(
IRiskSourceService
)
IotContext
.
getInstance
().
getBean
(
IRiskSourceService
.
class
);
}
...
...
@@ -69,15 +78,24 @@ public class RsDataQueue {
while
(
true
)
{
try
{
FmeaMessage
fmeaMessage
=
blockingQueue
.
take
();
if
(
riskSourceService
!=
null
)
{
//获取缓存
CacheMap
cacheMap
=
CacheFactory
.
newChacheMap
();
Toke
toke
=
cacheMap
.
getValue
(
TOKE
);
if
(
toke
==
null
){
toke
=
remoteSecurityService
.
come
();
Long
times
=
(
long
)
(
20
*
24
*
60
*
60
);
cacheMap
.
setex
(
TOKE
,
toke
,
times
);
}
String
from
=
fmeaMessage
.
getNorifyFrom
();
Long
handId
=
fmeaMessage
.
getHandId
();
if
(
from
.
equals
(
"patrol"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
}
else
if
(
from
.
equals
(
"equipment"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
}
else
if
(
from
.
equals
(
"update"
))
{
riskSourceService
.
notifyFmeaFromUpdate
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromUpdate
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
}
else
if
(
from
.
equals
(
"delete"
))
{
riskSourceService
.
notifyRiskSource
(
handId
,
from
,
null
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/Config.java
View file @
b2fe25f9
...
...
@@ -98,13 +98,18 @@ public class Config {
* @param redisTemplate
* @return
*/
@Bean
/*
@Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {
RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
cacheManager.setDefaultExpiration(60*60); // 设置key-value超时时间
return cacheManager;
}*/
@Bean
public
CacheManager
cacheManager
(
RedisConnectionFactory
factory
)
{
RedisCacheManager
cacheManager
=
RedisCacheManager
.
create
(
factory
);
return
cacheManager
;
}
@Bean
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/CommonResponse.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
import
java.io.Serializable
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <pre>
* 返回封装对象
* </pre>
*
* @author mincx
* @version CommonReponse.java v0.1
* @time 2017-9-19 15:43:32
*/
public
class
CommonResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8737351878134480646L
;
/**
* 操作状态
*/
@ApiModelProperty
(
required
=
true
,
value
=
"操作状态"
)
private
String
result
;
/**
* 数据
*/
@ApiModelProperty
(
required
=
false
,
value
=
"数据"
)
private
Object
dataList
;
/**
* 操作详细信息
*/
@ApiModelProperty
(
required
=
false
,
value
=
"操作详细信息"
)
private
String
message
;
public
CommonResponse
(){
}
public
CommonResponse
(
String
result
)
{
this
.
result
=
result
;
}
public
CommonResponse
(
Object
dataList
)
{
this
.
dataList
=
dataList
;
this
.
result
=
""
;
}
public
CommonResponse
(
String
result
,
Object
dataList
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
}
public
CommonResponse
(
String
result
,
String
message
)
{
this
.
result
=
result
;
this
.
message
=
message
;
}
public
CommonResponse
(
String
result
,
Object
dataList
,
String
message
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
this
.
message
=
message
;
}
public
Boolean
isSuccess
(){
return
"SUCCESS"
.
equals
(
getResult
());
}
public
String
getResult
()
{
return
result
;
}
public
void
setResult
(
String
result
)
{
this
.
result
=
result
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Object
getDataList
()
{
return
dataList
;
}
public
void
setDataList
(
Object
dataList
)
{
this
.
dataList
=
dataList
;
}
public
String
toJsonStr
()
throws
Exception
{
return
JSON
.
toJSONString
(
this
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
SkipTransientField
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/CommonResponseUtil.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
public
class
CommonResponseUtil
{
public
static
CommonResponse
success
()
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
return
response
;
}
public
static
CommonResponse
success
(
Object
obj
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
response
.
setDataList
(
obj
);
return
response
;
}
public
static
CommonResponse
success
(
Object
obj
,
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
response
.
setDataList
(
obj
);
response
.
setMessage
(
message
);
return
response
;
}
public
static
CommonResponse
failure
()
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
return
response
;
}
public
static
CommonResponse
failure
(
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
response
.
setMessage
(
message
);
return
response
;
}
public
static
CommonResponse
failure
(
Object
obj
,
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
response
.
setDataList
(
obj
);
response
.
setMessage
(
message
);
return
response
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/Constants.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
/**
* <pre>
* 系统常量
* </pre>
*
* @author mincx
* @version Constants.java v0.1
* @time 2017-9-19 15:43:32
*/
public
class
Constants
{
public
static
final
String
ERROR_MESSAGE
=
"系统异常"
;
public
static
final
String
RESULT_SUCCESS
=
"SUCCESS"
;
public
static
final
String
RESULT_FAILURE
=
"FAILURE"
;
public
static
final
String
RULE_FACT_PREFIX
=
"rule_"
;
public
static
final
String
RULE_COMPILATION_ERROR
=
"规则编译异常"
;
public
static
final
String
NEW_LINE
=
"\r\n"
;
public
static
final
String
POSITION_LATITUDE
=
"latitude"
;
public
static
final
String
POSITION_LONGITUDE
=
"longitude"
;
public
static
final
double
PI
=
3.1415
;
public
static
final
double
EARTH_RADIUS
=
6370.996
;
public
static
final
String
RULE_CONDITION_AND
=
"&&"
;
public
static
final
String
RULE_CONDITION_OR
=
"||"
;
/**
* DES加密解密默认key
*/
public
static
final
String
XSS_KEY
=
"qaz"
;
/**
* 灾情状态
*/
public
static
final
String
FireHappenStateID
=
"90db70b7-49a4-4a72-b54b-0fabbed9bec7"
;
//发生
public
static
final
String
FireDevelopStateID
=
"1f7fe7d7-b30c-4518-8c95-6e3bc506ca86"
;
//猛烈
/**
* 车辆状态
*/
public
static
final
String
CarArrivedStateID
=
"ad55748a-1206-4507-8831-95b7f2ad804f"
;
//到达
public
static
final
String
CarDispatchingStateID
=
"43a23576-3d0f-4c3d-a46b-555391a4d870"
;
//待出动
public
static
final
String
CarOnDutyStateID
=
"21cc717f-60b4-46ae-942e-9efd63d13415"
;
//执勤
public
static
final
String
CarOnSiteStateID
=
"d7eddc16-4c55-4de0-b726-3547c7b0b980"
;
//在位
public
static
final
String
CarOnTheWayStateID
=
"5e1b6e98-d1dc-4c49-a7ad-b959d2278dba"
;
//在途
public
static
final
String
CarRepairStateID
=
"e86d455b-e9fd-4938-9826-38ca46623287"
;
//维修
/**
* 战斗力量编队状态
*/
public
static
final
String
RescuePowerArrivedStateID
=
"0951f770-7f75-43d8-bcec-47d7559be727"
;
//到达
public
static
final
String
RescuePowerDispatchedStateID
=
"ec4afc56-6cec-41a3-95f5-20c735f052d4"
;
//已调派
public
static
final
String
RescuePowerEnhanceStateID
=
"3d6cf113-b69d-47c3-a3a8-ded448cc4636"
;
//增援
public
static
final
String
RescuePowerFightingStateID
=
"4bacd4b4-b07d-454e-b737-431e7c997cde"
;
//战斗
public
static
final
String
RescuePowerStandByStateID
=
"4fc6e4d6-c6a8-453c-b554-ce7de0b828b2"
;
//待命
/**
* sql注入关键字
*/
public
static
String
badStr
=
"'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|"
+
"char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|"
+
"table|from|grant|use|group_concat|column_name|"
+
"information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|"
+
"chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#"
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/DaoCriteria.java
0 → 100644
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
import
java.io.Serializable
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
/**
*
* <pre>
* 查询条件封装类
* </pre>
*
* @author as-hanshipeng
* @version $Id: DaoCriteria.java, v 0.1 2016-12-9 下午12:22:03 as-hanshipeng Exp $
*/
public
class
DaoCriteria
implements
Serializable
{
private
static
final
long
serialVersionUID
=
812759366580443779L
;
//属性名称
private
String
propertyName
;
//操作符
private
String
operator
;
//属性值
private
Object
value
;
public
String
getOperator
()
{
return
operator
;
}
public
void
setOperator
(
String
operator
)
{
this
.
operator
=
operator
;
}
public
String
getPropertyName
()
{
return
propertyName
;
}
public
void
setPropertyName
(
String
propertyName
)
{
this
.
propertyName
=
propertyName
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
public
DaoCriteria
()
{
}
public
DaoCriteria
(
String
property
,
String
operator
,
Object
value
)
{
propertyName
=
property
;
this
.
operator
=
operator
;
this
.
value
=
value
;
}
public
String
toString
()
{
return
(
new
ToStringBuilder
(
this
)).
append
(
"Property"
,
propertyName
).
append
(
operator
).
append
(
"Value"
,
value
).
toString
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/FileUtil.java
View file @
b2fe25f9
package
com
.
yeejoin
.
amos
.
fas
.
core
.
util
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.CollectionUtils
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/query/BaseQuerySpecification.java
View file @
b2fe25f9
...
...
@@ -13,12 +13,12 @@ import javax.persistence.criteria.Order;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
org.hibernate.
jpa.criteria
.CriteriaBuilderImpl
;
import
org.hibernate.
jpa.criteria
.predicate.InPredicate
;
import
org.hibernate.
query.criteria.internal
.CriteriaBuilderImpl
;
import
org.hibernate.
query.criteria.internal
.predicate.InPredicate
;
import
org.springframework.data.jpa.domain.Specification
;
import
com.yeejoin.amos.fas.core.enums.QueryOperatorEnum
;
import
com.yeejoin.amos.
op.core.common.query
.DaoCriteria
;
import
com.yeejoin.amos.
fas.core.util
.DaoCriteria
;
/**
* 基础Specification
...
...
YeeAmosFireAutoSysStart/src/main/java/com/yeejoin/amos/YeeAmosFireAutoSysStart.java
View file @
b2fe25f9
...
...
@@ -7,15 +7,19 @@ import org.apache.log4j.Logger;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.BeansException
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.netflix.
feign.EnableFeignClients
;
import
org.springframework.cloud.netflix.
eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.hystrix.EnableHystrix
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.core.env.Environment
;
import
org.springframework.data.jpa.repository.config.EnableJpaAuditing
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -34,18 +38,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
* @author amos
* @version $Id: AmosOPStart.java, v 0.1 2018年11月26日 下午4:56:29 amos Exp $
*/
@EnableHystrix
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableSwagger2
@ServletComponentScan
@EnableJpaAuditing
@EnableDiscoveryClient
@EnableFeignClients
@EnableHystrix
// @Configuration
// @EnableApolloConfig
@EnableAsync
@EnableScheduling
@EnableEurekaClient
@ComponentScan
({
"org.typroject"
,
"com.yeejoin.amos"
})
@MapperScan
(
basePackages
=
{
"com.yeejoin.amos.fas.business.dao.mapper"
})
public
class
YeeAmosFireAutoSysStart
implements
ApplicationContextAware
{
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
b2fe25f9
spring.application.name
=
Amos-autosys-xkq
security.password
=
tw123456
security.loginId
=
tw3
security.productWeb
=
CONVERTER_STATION_WEB
security.appKeyWeb
=
CONVERTER_STATION
#environment
spring.profiles.active
=
dev
eureka.client.serviceUrl.defaultZone
=
http://172.16.10.91:10500
/eureka/
#
spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone
=
http://47.108.89.109:10001
/eureka/
eureka.client.register-with-eureka
=
true
eureka.client.fetch-registry
=
true
eureka.client.healthcheck.enabled
=
true
eureka.client.fetchRegistry
=
true
#spring.freemarker.cache=false
spring.devtools.restart.enabled
=
true
spring.devtools.restart.additional-paths
=
src/main/java
spring.devtools.restart.exclude
=
WEB-INF/**
eureka.instance.hostname
=
${spring.cloud.client.ipAddress}
eureka.instance.statusPageUrlPath
=
${management.context-path}/info
eureka.instance.healthCheckUrlPath
=
${management.context-path}/health
eureka.instance.preferIpAddress
=
true
eureka.instance.instance-id
=
${spring.cloud.client.ipAddress}:${server.port}
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.lease-renewal-interval-in-seconds
=
5
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
#eureka.instance.hostname = ${spring.cloud.client.ipAddress}
#eureka.instance.statusPageUrlPath = ${management.context-path}/info
#eureka.instance.healthCheckUrlPath = ${management.context-path}/health
#eureka.instance.preferIpAddress = true
#eureka.instance.instance-id = ${spring.cloud.client.ipAddress}:${server.port}
#eureka.instance.lease-expiration-duration-in-seconds = 10
#eureka.instance.lease-renewal-interval-in-seconds = 5
server.port
=
8083
#DB properties:
spring.datasource.url
=
jdbc:mysql://172.16.10.99:3306/91-safety-business?useSSL=false&&allowMultiQueries=true
spring.datasource.username
=
root
spring.datasource.password
=
admin_1234
spring.datasource.url
=
jdbc:mysql://47.103.14.66:3306/91-safety-business?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
# HikariCP settings
# spring.datasource.hikari.*
# contection life time (ms)
spring.datasource.hikari.maxLifetime
=
1765000
#((core_count*2)+effective_spindle_count
spring.datasource.hikari.maximum-pool-size
=
10
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQuery
=
SELECT 1
...
...
@@ -63,8 +61,8 @@ mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase
=
true
#liquibase
liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.
liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled
=
false
#mongodb
spring.data.mongodb.uri
=
mongodb://172.16.11.33:27017/iecmonitor
...
...
@@ -83,16 +81,17 @@ params.xssSecurity = false
params.remoteRuleUrl
=
http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
#redis database index
spring.redis.database
=
5
#redis ip
spring.redis.host
=
172.16.11.33
spring.redis.port
=
6379
#redis password (default is empty)
spring.redis.password
=
1234560
spring.redis.timeout
=
1000
security.fegin.name
=
AMOSSECURITY-HLZ
spring.redis.host
=
127.0.0.1
spring.redis.port
=
6379
spring.redis.password
=
spring.redis.jedis.pool.max-active
=
200
spring.redis.jedis.pool.max-wait
=
-1
spring.redis.jedis.pool.max-idle
=
10
spring.redis.jedis.pool.min-idle
=
0
spring.redis.timeout
=
1000
#security.fegin.name=AMOSSECURITY-HLZ
visual.fegin.name
=
maas-visual
spring.http.multipart.maxFileSize
=
10480000
spring.http.multipart.MaxRequestSize
=
50480000
...
...
pom.xml
View file @
b2fe25f9
...
...
@@ -11,7 +11,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.4.2
.RELEASE
</version>
<version>
2.1.6
.RELEASE
</version>
</parent>
<modules>
...
...
@@ -24,17 +24,18 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<liquibase.version>
3.
5
.3
</liquibase.version>
<liquibase.version>
3.
6
.3
</liquibase.version>
<swagger.version>
2.7.0
</swagger.version>
<spring-cloud.version>
Dalston.SR5
</spring-cloud.version>
<spring-cloud.version>
Greenwich.SR1
</spring-cloud.version>
<YeeSecurity.version>
2.1.0
</YeeSecurity.version>
<YeeOp.version>
2.0.1
</YeeOp.version>
<maven-jar-plugin.version>
3.0.0
</maven-jar-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-
eureka
</artifactId>
<artifactId>
spring-cloud-starter-
netflix-eureka-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -42,11 +43,11 @@
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
<artifactId>
spring-cloud-starter-
open
feign
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-hystrix
</artifactId>
<artifactId>
spring-cloud-starter-
netflix-
hystrix
</artifactId>
</dependency>
<!-- Swagger2模块 -->
<dependency>
...
...
@@ -87,7 +88,7 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<
!-- <
dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
...
...
@@ -100,7 +101,7 @@
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
</dependency>
-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j
</artifactId>
...
...
@@ -141,6 +142,16 @@
<version>
0.9.1
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.jackson
</groupId>
<artifactId>
jackson-jaxrs
</artifactId>
<version>
1.9.11
</version>
</dependency>
<!-- 通用Mapper -->
<dependency>
<groupId>
com.github.abel533
</groupId>
...
...
@@ -165,8 +176,8 @@
</dependency>
<dependency>
<groupId>
org.liquibase
</groupId>
<artifactId>
liquibase-core
</artifactId>
</dependency>
<artifactId>
liquibase-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
...
...
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