Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
b5d4c681
Commit
b5d4c681
authored
Jun 01, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增:框架调整
parent
8d5cd27b
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
745 additions
and
734 deletions
+745
-734
OpenapiApplication.java
...pi/src/main/java/com/yeejoin/amos/OpenapiApplication.java
+4
-1
CylinderController.java
...ejoin/amos/api/openapi/controller/CylinderController.java
+3
-17
OpenapiBizTokenController.java
...mos/api/openapi/controller/OpenapiBizTokenController.java
+0
-14
SuperviseController.java
...join/amos/api/openapi/controller/SuperviseController.java
+9
-10
ElevatorAlarmMapper.java
...in/amos/api/openapi/face/orm/dao/ElevatorAlarmMapper.java
+17
-17
ElevatorAlarmTypeMapper.java
...mos/api/openapi/face/orm/dao/ElevatorAlarmTypeMapper.java
+18
-18
ElevatorMapper.java
...yeejoin/amos/api/openapi/face/orm/dao/ElevatorMapper.java
+18
-18
ElevatorStatusMapper.java
...n/amos/api/openapi/face/orm/dao/ElevatorStatusMapper.java
+28
-28
ElevatorTechInfoMapper.java
...amos/api/openapi/face/orm/dao/ElevatorTechInfoMapper.java
+14
-14
MidConstructionInfoMapper.java
...s/api/openapi/face/orm/dao/MidConstructionInfoMapper.java
+1
-1
MidDesignInfoMapper.java
...in/amos/api/openapi/face/orm/dao/MidDesignInfoMapper.java
+1
-1
BaseEnterpriseInfoService.java
...s/api/openapi/face/service/BaseEnterpriseInfoService.java
+22
-0
ConstructionInfoService.java
...mos/api/openapi/face/service/ConstructionInfoService.java
+2
-2
CylinderFillingDataValidationService.java
...pi/face/service/CylinderFillingDataValidationService.java
+3
-2
DesignInfoService.java
...join/amos/api/openapi/face/service/DesignInfoService.java
+2
-7
ElevatorAlarmService.java
...n/amos/api/openapi/face/service/ElevatorAlarmService.java
+136
-136
ElevatorAlarmTypeService.java
...os/api/openapi/face/service/ElevatorAlarmTypeService.java
+38
-38
ElevatorService.java
...eejoin/amos/api/openapi/face/service/ElevatorService.java
+31
-31
ElevatorStatusService.java
.../amos/api/openapi/face/service/ElevatorStatusService.java
+272
-272
ElevatorTechInfoService.java
...mos/api/openapi/face/service/ElevatorTechInfoService.java
+103
-103
EnterpriseInfoService.java
.../amos/api/openapi/face/service/EnterpriseInfoService.java
+3
-4
TzsEnterpriseInfoService.java
...os/api/openapi/face/service/TzsEnterpriseInfoService.java
+20
-0
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/OpenapiApplication.java
View file @
b5d4c681
...
@@ -41,7 +41,10 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
...
@@ -41,7 +41,10 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
@EnableAsync
@EnableAsync
@EnableEurekaClient
@EnableEurekaClient
@EnableScheduling
@EnableScheduling
@MapperScan
(
value
=
{
"org.typroject.tyboot.*.*.face.orm.dao"
,
"com.yeejoin.amos.api.*.face.orm.dao"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
@MapperScan
(
value
=
{
"org.typroject.tyboot.*.*.face.orm.dao"
,
"com.yeejoin.amos.api.*.face.orm.dao"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"com.yeejoin.amos.boot.module.cylinder.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
@ComponentScan
.
Filter
(
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
@ComponentScan
.
Filter
(
type
=
FilterType
.
REGEX
,
type
=
FilterType
.
REGEX
,
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/CylinderController.java
View file @
b5d4c681
...
@@ -4,6 +4,8 @@ import java.util.HashMap;
...
@@ -4,6 +4,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.yeejoin.amos.api.openapi.face.model.*
;
import
com.yeejoin.amos.api.openapi.face.service.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -15,27 +17,11 @@ import org.typroject.tyboot.component.event.RestEventTrigger;
...
@@ -15,27 +17,11 @@ import org.typroject.tyboot.component.event.RestEventTrigger;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseHelper
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseHelper
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderFillingCheckModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderFillingExamineModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderFillingModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderFillingModelList
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderFillingRecordModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderInfoModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderInspectionModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderTagsModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderFillingCheckService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderFillingExamineService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderFillingRecordService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderFillingService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderInspectionService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderTagsService
;
import
com.yeejoin.amos.api.openapi.face.service.TmCylinderUnitService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/OpenapiBizTokenController.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
controller
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
controller
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseHelper
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseHelper
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.api.openapi.face.model.InspectionModel
;
import
com.yeejoin.amos.api.openapi.face.model.InspectionModelList
;
import
com.yeejoin.amos.api.openapi.face.service.ElevatorStatusService
;
import
com.yeejoin.amos.api.openapi.face.service.OpenapiBizTokenService
;
import
com.yeejoin.amos.api.openapi.face.service.OpenapiBizTokenService
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
net.sf.json.JSONObject
;
/**
/**
*
*
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/SuperviseController.java
View file @
b5d4c681
...
@@ -22,7 +22,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.UseInfo;
...
@@ -22,7 +22,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.UseInfo;
import
com.yeejoin.amos.api.openapi.face.service.ConstructionInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.ConstructionInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.CreateCodeService
;
import
com.yeejoin.amos.api.openapi.face.service.CreateCodeService
;
import
com.yeejoin.amos.api.openapi.face.service.DesignInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.DesignInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.ElevatorTechInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.EnclosureInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.EnclosureInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.EnterpriseInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.EnterpriseInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.InspectionInfoService
;
import
com.yeejoin.amos.api.openapi.face.service.InspectionInfoService
;
...
@@ -84,8 +83,8 @@ public class SuperviseController {
...
@@ -84,8 +83,8 @@ public class SuperviseController {
@Autowired
@Autowired
private
OtherInfoService
otherInfoService
;
private
OtherInfoService
otherInfoService
;
@Autowired
//
@Autowired
private
ElevatorTechInfoService
evatorTechInfoService
;
//
private ElevatorTechInfoService evatorTechInfoService;
@Autowired
@Autowired
private
EnclosureInfoService
enclosureInfoService
;
private
EnclosureInfoService
enclosureInfoService
;
...
@@ -181,13 +180,13 @@ public class SuperviseController {
...
@@ -181,13 +180,13 @@ public class SuperviseController {
return
ResponseHelper
.
buildResponse
(
otherInfoService
.
saveOtherInfo
(
otherInfo
));
return
ResponseHelper
.
buildResponse
(
otherInfoService
.
saveOtherInfo
(
otherInfo
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
//
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation
(
value
=
"新增电梯技术参数"
)
//
@ApiOperation(value = "新增电梯技术参数")
@PostMapping
(
value
=
"/elevatorTechInfo"
)
//
@PostMapping(value = "/elevatorTechInfo")
@RestEventTrigger
(
value
=
"openapiLogEventHandler"
)
//
@RestEventTrigger(value = "openapiLogEventHandler")
public
ResponseModel
<
String
>
saveElevatorTechInfo
(
@RequestBody
List
<
ElevatorTechInfoModel
>
elevatorTechInfo
)
throws
Exception
{
//
public ResponseModel<String> saveElevatorTechInfo(@RequestBody List<ElevatorTechInfoModel> elevatorTechInfo) throws Exception {
return
ResponseHelper
.
buildResponse
(
evatorTechInfoService
.
saveElevatorTechInfo
(
elevatorTechInfo
));
//
return ResponseHelper.buildResponse(evatorTechInfoService.saveElevatorTechInfo(elevatorTechInfo));
}
//
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"新增特种设备附件资料信息"
)
@ApiOperation
(
value
=
"新增特种设备附件资料信息"
)
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ElevatorAlarmMapper.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
//package com.yeejoin.amos.api.openapi.face.orm.dao;
//
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarm
;
//import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarm;
//
/**
///**
* <p>
// * <p>
* 电梯故障表 Mapper 接口
// * 电梯故障表 Mapper 接口
* </p>
// * </p>
*
// *
* @author 子杨
// * @author 子杨
* @since 2021-09-27
// * @since 2021-09-27
*/
// */
public
interface
ElevatorAlarmMapper
extends
BaseMapper
<
ElevatorAlarm
>
{
//public interface ElevatorAlarmMapper extends BaseMapper<ElevatorAlarm> {
//
}
//}
\ No newline at end of file
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ElevatorAlarmTypeMapper.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
//package com.yeejoin.amos.api.openapi.face.orm.dao;
//
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarmType
;
//import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarmType;
//
/**
///**
*
// *
* <pre>
// * <pre>
* 电梯故障类型表 Mapper 接口
// * 电梯故障类型表 Mapper 接口
* </pre>
// * </pre>
*
// *
* @author gwb
// * @author gwb
* @version $Id: ElevatorAlarmTypeMapper.java, v 0.1 2021年10月15日 下午2:23:32 gwb Exp $
// * @version $Id: ElevatorAlarmTypeMapper.java, v 0.1 2021年10月15日 下午2:23:32 gwb Exp $
*/
// */
public
interface
ElevatorAlarmTypeMapper
extends
BaseMapper
<
ElevatorAlarmType
>
{
//public interface ElevatorAlarmTypeMapper extends BaseMapper<ElevatorAlarmType> {
//
}
//}
\ No newline at end of file
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ElevatorMapper.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
//package com.yeejoin.amos.api.openapi.face.orm.dao;
//
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.Elevator
;
//import com.yeejoin.amos.api.openapi.face.orm.entity.Elevator;
//
/**
///**
*
// *
* <pre>
// * <pre>
* 电梯 Mapper 接口
// * 电梯 Mapper 接口
* </pre>
// * </pre>
*
// *
* @author gwb
// * @author gwb
* @version $Id: ElevatorMapper.java, v 0.1 2021年9月30日 下午3:28:31 gwb Exp $
// * @version $Id: ElevatorMapper.java, v 0.1 2021年9月30日 下午3:28:31 gwb Exp $
*/
// */
public
interface
ElevatorMapper
extends
BaseMapper
<
Elevator
>
{
//public interface ElevatorMapper extends BaseMapper<Elevator> {
//
}
//}
\ No newline at end of file
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ElevatorStatusMapper.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
//package com.yeejoin.amos.api.openapi.face.orm.dao;
//
import
org.apache.ibatis.annotations.Param
;
//import org.apache.ibatis.annotations.Param;
import
org.apache.ibatis.annotations.Select
;
//import org.apache.ibatis.annotations.Select;
//
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorStatus
;
//import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorStatus;
//
/**
///**
* <p>
// * <p>
* 电梯运行状态表 Mapper 接口
// * 电梯运行状态表 Mapper 接口
* </p>
// * </p>
*
// *
* @author 子杨
// * @author 子杨
* @since 2021-09-27
// * @since 2021-09-27
*/
// */
public
interface
ElevatorStatusMapper
extends
BaseMapper
<
ElevatorStatus
>
{
//public interface ElevatorStatusMapper extends BaseMapper<ElevatorStatus> {
//
//
@Select
(
"SELECT "
+
// @Select("SELECT " +
" * "
+
// " * " +
" FROM "
+
// " FROM " +
" tz_elevator_status c "
+
// " tz_elevator_status c " +
" WHERE "
+
// " WHERE " +
" c.register_code = '${registerCode}' ORDER BY upload_date DESC LIMIT 1"
)
// " c.register_code = '${registerCode}' ORDER BY upload_date DESC LIMIT 1")
ElevatorStatus
getLatelyStatus
(
@Param
(
"registerCode"
)
String
registerCode
);
// ElevatorStatus getLatelyStatus(@Param("registerCode") String registerCode);
}
//}
\ No newline at end of file
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ElevatorTechInfoMapper.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
//
package com.yeejoin.amos.api.openapi.face.orm.dao;
//
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
//
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorTechInfo
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorTechInfo;
//
/**
/
//
**
* 电梯技术参数 Mapper 接口
//
* 电梯技术参数 Mapper 接口
*
//
*
* @author Zhang Yingbin
//
* @author Zhang Yingbin
* @date 2022-07-19
//
* @date 2022-07-19
*/
//
*/
public
interface
ElevatorTechInfoMapper
extends
BaseMapper
<
ElevatorTechInfo
>
{
//
public interface ElevatorTechInfoMapper extends BaseMapper<ElevatorTechInfo> {
//
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/ConstructionInfoMapper.java
→
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/
Mid
ConstructionInfoMapper.java
View file @
b5d4c681
...
@@ -9,6 +9,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
...
@@ -9,6 +9,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
* @author Zhang Yingbin
* @author Zhang Yingbin
* @date 2022-07-19
* @date 2022-07-19
*/
*/
public
interface
ConstructionInfoMapper
extends
BaseMapper
<
ConstructionInfo
>
{
public
interface
Mid
ConstructionInfoMapper
extends
BaseMapper
<
ConstructionInfo
>
{
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/DesignInfoMapper.java
→
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/
Mid
DesignInfoMapper.java
View file @
b5d4c681
...
@@ -9,6 +9,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
...
@@ -9,6 +9,6 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
* @author Zhang Yingbin
* @author Zhang Yingbin
* @date 2022-07-19
* @date 2022-07-19
*/
*/
public
interface
DesignInfoMapper
extends
BaseMapper
<
DesignInfo
>
{
public
interface
Mid
DesignInfoMapper
extends
BaseMapper
<
DesignInfo
>
{
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/BaseEnterpriseInfoService.java
0 → 100644
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.cylinder.api.mapper.TzBaseEnterpriseInfoMapper
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
java.util.List
;
import
java.util.Set
;
@DS
(
"tzs"
)
@Component
public
class
BaseEnterpriseInfoService
extends
AppBaseService
<
TzBaseEnterpriseInfoDto
,
TzBaseEnterpriseInfo
,
TzBaseEnterpriseInfoMapper
>
{
public
List
<
TzBaseEnterpriseInfoDto
>
getEnterpriseInfoByCreditCode
(
@Condition
(
Operator
.
in
)
Set
<
String
>
useCode
)
{
return
this
.
queryForList
(
""
,
false
,
useCode
);
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ConstructionInfoService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.yeejoin.amos.api.openapi.face.model.ConstructionInfoModel
;
import
com.yeejoin.amos.api.openapi.face.model.ConstructionInfoModel
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ConstructionInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.
Mid
ConstructionInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo
;
import
com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
...
@@ -22,7 +22,7 @@ import java.util.List;
...
@@ -22,7 +22,7 @@ import java.util.List;
* @date 2022-07-19
* @date 2022-07-19
*/
*/
@Component
@Component
public
class
ConstructionInfoService
extends
AppBaseService
<
ConstructionInfoModel
,
ConstructionInfo
,
ConstructionInfoMapper
>
{
public
class
ConstructionInfoService
extends
AppBaseService
<
ConstructionInfoModel
,
ConstructionInfo
,
Mid
ConstructionInfoMapper
>
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ConstructionInfoService
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ConstructionInfoService
.
class
);
@Autowired
@Autowired
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/CylinderFillingDataValidationService.java
View file @
b5d4c681
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.api.openapi.enums.*;
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.api.openapi.enums.*;
import
com.yeejoin.amos.api.openapi.face.model.*
;
import
com.yeejoin.amos.api.openapi.face.model.*
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.RegistrationInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.RegistrationInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.RegistrationInfo
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -24,7 +25,7 @@ import java.util.stream.Collectors;
...
@@ -24,7 +25,7 @@ import java.util.stream.Collectors;
public
class
CylinderFillingDataValidationService
{
public
class
CylinderFillingDataValidationService
{
@Autowired
@Autowired
EnterpriseInfoService
enterpriseInfoService
;
Base
EnterpriseInfoService
enterpriseInfoService
;
@Autowired
@Autowired
RegistrationInfoMapper
registrationInfoMapper
;
RegistrationInfoMapper
registrationInfoMapper
;
...
@@ -360,7 +361,7 @@ public class CylinderFillingDataValidationService {
...
@@ -360,7 +361,7 @@ public class CylinderFillingDataValidationService {
* @return
* @return
*/
*/
public
List
<
String
>
getNotExistEnterpriseInfoByCreditCode
(
Set
<
String
>
creditCodes
)
{
public
List
<
String
>
getNotExistEnterpriseInfoByCreditCode
(
Set
<
String
>
creditCodes
)
{
List
<
EnterpriseInfoModel
>
enterpriseInfos
=
enterpriseInfoService
.
getEnterpriseInfoByCreditCode
(
creditCodes
);
List
<
TzBaseEnterpriseInfoDto
>
enterpriseInfos
=
enterpriseInfoService
.
getEnterpriseInfoByCreditCode
(
creditCodes
);
if
(
enterpriseInfos
.
size
()
<
creditCodes
.
size
())
{
if
(
enterpriseInfos
.
size
()
<
creditCodes
.
size
())
{
List
<
String
>
userCodes
=
enterpriseInfos
.
stream
().
map
(
e
->
e
.
getUseCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
userCodes
=
enterpriseInfos
.
stream
().
map
(
e
->
e
.
getUseCode
()).
collect
(
Collectors
.
toList
());
return
creditCodes
.
stream
().
filter
(
c
->
!
userCodes
.
contains
(
c
)).
collect
(
Collectors
.
toList
());
return
creditCodes
.
stream
().
filter
(
c
->
!
userCodes
.
contains
(
c
)).
collect
(
Collectors
.
toList
());
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/DesignInfoService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.api.openapi.enums.JgFileAttributeEnum
;
import
com.yeejoin.amos.api.openapi.enums.JgFileObjectEnum
;
import
com.yeejoin.amos.api.openapi.face.model.DesignInfoModel
;
import
com.yeejoin.amos.api.openapi.face.model.DesignInfoModel
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.DesignInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.
Mid
DesignInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.JgFile
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -24,7 +19,7 @@ import java.util.List;
...
@@ -24,7 +19,7 @@ import java.util.List;
* @date 2022-07-19
* @date 2022-07-19
*/
*/
@Component
@Component
public
class
DesignInfoService
extends
AppBaseService
<
DesignInfoModel
,
DesignInfo
,
DesignInfoMapper
>{
public
class
DesignInfoService
extends
AppBaseService
<
DesignInfoModel
,
DesignInfo
,
Mid
DesignInfoMapper
>{
@Autowired
@Autowired
private
JgFileService
fileService
;
private
JgFileService
fileService
;
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ElevatorAlarmService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
//
package com.yeejoin.amos.api.openapi.face.service;
//
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmModel;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmTypeModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmTypeModel;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorModel;
import
com.yeejoin.amos.api.openapi.face.model.EquipmentCategoryModel
;
//
import com.yeejoin.amos.api.openapi.face.model.EquipmentCategoryModel;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorAlarmMapper
;
//
import com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorAlarmMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarm
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarm;
//
import
org.typroject.tyboot.core.foundation.utils.Bean
;
//
import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
//
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
//
import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
//
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
//
import
java.text.SimpleDateFormat
;
//
import java.text.SimpleDateFormat;
import
java.util.HashMap
;
//
import java.util.HashMap;
import
java.util.List
;
//
import java.util.List;
import
java.util.Map
;
//
import java.util.Map;
//
/**
/
//
**
* <p>
//
* <p>
* 电梯故障表 服务类
//
* 电梯故障表 服务类
* </p>
//
* </p>
*
//
*
* @author 子杨
//
* @author 子杨
* @since 2021-09-27
//
* @since 2021-09-27
*/
//
*/
@Component
//
@Component
public
class
ElevatorAlarmService
extends
//
public class ElevatorAlarmService extends
BaseService
<
ElevatorAlarmModel
,
ElevatorAlarm
,
ElevatorAlarmMapper
>
//
BaseService<ElevatorAlarmModel, ElevatorAlarm, ElevatorAlarmMapper>
{
//
{
//
@Autowired
//
@Autowired
private
ElevatorService
elevatorService
;
//
private ElevatorService elevatorService;
//
@Autowired
//
@Autowired
private
ElevatorAlarmTypeService
elevatorAlarmTypeService
;
//
private ElevatorAlarmTypeService elevatorAlarmTypeService;
//
@Autowired
//
@Autowired
private
EquipmentCategoryService
equipmentCategoryService
;
//
private EquipmentCategoryService equipmentCategoryService;
//
public
Map
<
String
,
String
>
equipmentCategoryMap
=
null
;
//
public Map<String, String> equipmentCategoryMap = null;
//
public
Map
<
String
,
String
>
alarmTypeMap
=
null
;
//
public Map<String, String> alarmTypeMap = null;
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 批量保存电梯故障信息
//
* 批量保存电梯故障信息
* </pre>
//
* </pre>
*
//
*
* @param models
//
* @param models
* @return
//
* @return
* @throws Exception
//
* @throws Exception
*/
//
*/
public
String
multCreateElevatorAlarm
(
List
<
ElevatorAlarmModel
>
models
)
throws
Exception
//
public String multCreateElevatorAlarm(List<ElevatorAlarmModel> models) throws Exception
{
//
{
//
if
(
ValidationUtil
.
isEmpty
(
models
))
//
if (ValidationUtil.isEmpty(models))
throw
new
BadRequest
(
"参数校验失败."
);
//
throw new BadRequest("参数校验失败.");
//
for
(
ElevatorAlarmModel
elevatorAlarmModel
:
models
)
//
for (ElevatorAlarmModel elevatorAlarmModel : models)
{
//
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
elevatorAlarmModel
.
setStartDate
(
//
elevatorAlarmModel.setStartDate(
elevatorAlarmModel
.
getStartTime
()!=
null
?
sdf
.
parse
(
elevatorAlarmModel
.
getStartTime
()):
null
);
//
elevatorAlarmModel.getStartTime()!=null? sdf.parse(elevatorAlarmModel.getStartTime()): null);
elevatorAlarmModel
.
setDealDate
(
//
elevatorAlarmModel.setDealDate(
elevatorAlarmModel
.
getDealTime
()!=
null
?
sdf
.
parse
(
elevatorAlarmModel
.
getDealTime
()):
null
);
//
elevatorAlarmModel.getDealTime()!=null? sdf.parse(elevatorAlarmModel.getDealTime()): null);
//
ElevatorAlarmModel
oldModel
=
queryModelByCodeAndFaultId
(
elevatorAlarmModel
.
getRegisterCode
(),
elevatorAlarmModel
.
getFaultId
());
//
ElevatorAlarmModel oldModel = queryModelByCodeAndFaultId(elevatorAlarmModel.getRegisterCode(), elevatorAlarmModel.getFaultId());
//如果存在该故障编码则进行更新
//
//如果存在该故障编码则进行更新
if
(
ValidationUtil
.
isEmpty
(
oldModel
))
//
if (ValidationUtil.isEmpty(oldModel))
{
//
{
ElevatorModel
elevatorModel
=
elevatorService
.
queryByRegisterCode
(
elevatorAlarmModel
.
getRegisterCode
());
//
ElevatorModel elevatorModel = elevatorService.queryByRegisterCode(elevatorAlarmModel.getRegisterCode());
//只保存现有维护电梯的告警信息
//
//只保存现有维护电梯的告警信息
if
(!
ValidationUtil
.
isEmpty
(
elevatorModel
))
//
if (!ValidationUtil.isEmpty(elevatorModel))
{
//
{
elevatorAlarmModel
.
setRescueCode
(
elevatorModel
.
getRescueCode
());
//
elevatorAlarmModel.setRescueCode(elevatorModel.getRescueCode());
elevatorAlarmModel
.
setProvince
(
elevatorModel
.
getProvince
());
//
elevatorAlarmModel.setProvince(elevatorModel.getProvince());
elevatorAlarmModel
.
setCity
(
elevatorModel
.
getCity
());
//
elevatorAlarmModel.setCity(elevatorModel.getCity());
elevatorAlarmModel
.
setDistrict
(
elevatorModel
.
getDistrict
());
//
elevatorAlarmModel.setDistrict(elevatorModel.getDistrict());
elevatorAlarmModel
.
setAddress
(
elevatorModel
.
getAddress
());
//
elevatorAlarmModel.setAddress(elevatorModel.getAddress());
//填充电梯分类
//
//填充电梯分类
if
(
ValidationUtil
.
isEmpty
(
equipmentCategoryMap
))
//
if (ValidationUtil.isEmpty(equipmentCategoryMap))
{
//
{
equipmentCategoryMap
=
new
HashMap
<
String
,
String
>();
//
equipmentCategoryMap = new HashMap<String, String>();
List
<
EquipmentCategoryModel
>
allEquipmentCategory
=
equipmentCategoryService
.
queryAllForlist
();
//
List<EquipmentCategoryModel> allEquipmentCategory = equipmentCategoryService.queryAllForlist();
for
(
EquipmentCategoryModel
equipmentCategoryModel
:
allEquipmentCategory
)
//
for (EquipmentCategoryModel equipmentCategoryModel : allEquipmentCategory)
{
//
{
equipmentCategoryMap
.
put
(
equipmentCategoryModel
.
getCode
(),
equipmentCategoryModel
.
getName
());
//
equipmentCategoryMap.put(equipmentCategoryModel.getCode(), equipmentCategoryModel.getName());
}
//
}
}
//
}
String
category
=
equipmentCategoryMap
.
get
(
elevatorModel
.
getCategory
());
//
String category = equipmentCategoryMap.get(elevatorModel.getCategory());
elevatorAlarmModel
.
setDeviceCategory
(
category
!=
null
?
category:
elevatorModel
.
getCategory
());
//
elevatorAlarmModel.setDeviceCategory(category!=null? category:elevatorModel.getCategory());
//填充告警类型
//
//填充告警类型
if
(
ValidationUtil
.
isEmpty
(
alarmTypeMap
))
//
if (ValidationUtil.isEmpty(alarmTypeMap))
{
//
{
alarmTypeMap
=
new
HashMap
<
String
,
String
>();
//
alarmTypeMap = new HashMap<String, String>();
List
<
ElevatorAlarmTypeModel
>
allAlarmType
=
elevatorAlarmTypeService
.
queryAllForlist
();
//
List<ElevatorAlarmTypeModel> allAlarmType = elevatorAlarmTypeService.queryAllForlist();
for
(
ElevatorAlarmTypeModel
elevatorAlarmTypeModel
:
allAlarmType
)
//
for (ElevatorAlarmTypeModel elevatorAlarmTypeModel : allAlarmType)
{
//
{
alarmTypeMap
.
put
(
String
.
valueOf
(
elevatorAlarmTypeModel
.
getAlarmCode
()),
elevatorAlarmTypeModel
.
getAlarmName
());
//
alarmTypeMap.put(String.valueOf(elevatorAlarmTypeModel.getAlarmCode()), elevatorAlarmTypeModel.getAlarmName());
}
//
}
}
//
}
String
alarmType
=
alarmTypeMap
.
get
(
elevatorAlarmModel
.
getType
());
//
String alarmType = alarmTypeMap.get(elevatorAlarmModel.getType());
elevatorAlarmModel
.
setTypeName
(
alarmType
!=
null
?
alarmType:
elevatorAlarmModel
.
getType
());
//
elevatorAlarmModel.setTypeName(alarmType!= null? alarmType: elevatorAlarmModel.getType());
//
this
.
createWithModel
(
elevatorAlarmModel
);
//
this.createWithModel(elevatorAlarmModel);
}
//
}
}
else
// }else
{
//
{
Bean
.
copyExistPropertis
(
elevatorAlarmModel
,
oldModel
);
//
Bean.copyExistPropertis(elevatorAlarmModel, oldModel);
this
.
updateWithModel
(
oldModel
);
//
this.updateWithModel(oldModel);
}
//
}
}
//
}
//
return
"OK"
;
//
return "OK";
}
//
}
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 根据电梯注册编码和故障编码查询电梯故障信息
//
* 根据电梯注册编码和故障编码查询电梯故障信息
* </pre>
//
* </pre>
*
//
*
* @param registerCode
//
* @param registerCode
* @param faultId
//
* @param faultId
*/
//
*/
private
ElevatorAlarmModel
queryModelByCodeAndFaultId
(
String
registerCode
,
String
faultId
)
//
private ElevatorAlarmModel queryModelByCodeAndFaultId(String registerCode, String faultId)
{
//
{
return
this
.
queryModelByParams
(
registerCode
,
faultId
);
//
return this.queryModelByParams(registerCode, faultId);
}
//
}
//
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ElevatorAlarmTypeService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
//
package com.yeejoin.amos.api.openapi.face.service;
//
import
java.util.List
;
//
import java.util.List;
//
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
//
import org.typroject.tyboot.core.rdbms.service.BaseService;
//
import
com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmTypeModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorAlarmTypeModel;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorAlarmTypeMapper
;
//
import com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorAlarmTypeMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarmType
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorAlarmType;
//
/**
/
//
**
*
// *
* <pre>
//
* <pre>
* 电梯故障类型表 服务类
//
* 电梯故障类型表 服务类
* </pre>
//
* </pre>
*
//
*
* @author gwb
//
* @author gwb
* @version $Id: ElevatorAlarmTypeService.java, v 0.1 2021年10月15日 下午2:27:54 gwb Exp $
//
* @version $Id: ElevatorAlarmTypeService.java, v 0.1 2021年10月15日 下午2:27:54 gwb Exp $
*/
//
*/
@Component
//
@Component
public
class
ElevatorAlarmTypeService
extends
//
public class ElevatorAlarmTypeService extends
BaseService
<
ElevatorAlarmTypeModel
,
ElevatorAlarmType
,
ElevatorAlarmTypeMapper
>
//
BaseService<ElevatorAlarmTypeModel, ElevatorAlarmType, ElevatorAlarmTypeMapper>
{
//
{
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 查询所有告警类型
//
* 查询所有告警类型
* </pre>
//
* </pre>
*
//
*
* @return
//
* @return
*/
//
*/
public
List
<
ElevatorAlarmTypeModel
>
queryAllForlist
()
//
public List<ElevatorAlarmTypeModel> queryAllForlist()
{
//
{
return
this
.
queryForList
(
"sequence_nbr"
,
true
);
//
return this.queryForList("sequence_nbr", true);
}
//
}
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ElevatorService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
//
package com.yeejoin.amos.api.openapi.face.service;
//
//
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
//
import org.typroject.tyboot.core.rdbms.service.BaseService;
//
import
com.yeejoin.amos.api.openapi.face.model.ElevatorModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorModel;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorMapper
;
//
import com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.Elevator
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.Elevator;
//
//
/**
/
//
**
*
// *
* <pre>
//
* <pre>
* 电梯 服务类
//
* 电梯 服务类
* </pre>
//
* </pre>
*
//
*
* @author gwb
//
* @author gwb
* @version $Id: ElevatorService.java, v 0.1 2021年9月30日 下午3:28:55 gwb Exp $
//
* @version $Id: ElevatorService.java, v 0.1 2021年9月30日 下午3:28:55 gwb Exp $
*/
//
*/
@Component
//
@Component
public
class
ElevatorService
extends
BaseService
<
ElevatorModel
,
Elevator
,
ElevatorMapper
>
{
//
public class ElevatorService extends BaseService<ElevatorModel,Elevator,ElevatorMapper> {
//
//
public
ElevatorModel
queryByRegisterCode
(
String
registerCode
)
//
public ElevatorModel queryByRegisterCode(String registerCode)
{
//
{
return
this
.
queryModelByParams
(
registerCode
);
//
return this.queryModelByParams(registerCode);
}
//
}
//
//
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ElevatorStatusService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
//
package com.yeejoin.amos.api.openapi.face.service;
//
import
java.text.SimpleDateFormat
;
//
import java.text.SimpleDateFormat;
import
java.util.HashMap
;
//
import java.util.HashMap;
import
java.util.List
;
//
import java.util.List;
import
java.util.Map
;
//
import java.util.Map;
//
import
org.slf4j.Logger
;
//
import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
//
import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
//
import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Lazy
;
//
import org.springframework.context.annotation.Lazy;
import
org.springframework.http.HttpEntity
;
//
import org.springframework.http.HttpEntity;
import
org.springframework.http.HttpHeaders
;
//
import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpMethod
;
//
import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
//
import org.springframework.http.HttpStatus;
import
org.springframework.http.MediaType
;
//
import org.springframework.http.MediaType;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
//
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
org.springframework.web.client.RestTemplate
;
//
import org.springframework.web.client.RestTemplate;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
//
import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
//
import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
//
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
//
import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
//
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
//
import
com.fasterxml.jackson.databind.ObjectMapper
;
//
import com.fasterxml.jackson.databind.ObjectMapper;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
//
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import
com.yeejoin.amos.api.openapi.enums.LiftCircuitStatusEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftCircuitStatusEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftContactorStatusEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftContactorStatusEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftDirectionEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftDirectionEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftDoorStatusEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftDoorStatusEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftPersonFlagEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftPersonFlagEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftServiceModelEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftServiceModelEnum;
import
com.yeejoin.amos.api.openapi.enums.LiftStatusEnum
;
//
import com.yeejoin.amos.api.openapi.enums.LiftStatusEnum;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorStatusModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorStatusModel;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorVideoModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorVideoModel;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorStatusMapper
;
//
import com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorStatusMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorStatus
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorStatus;
//
import
net.sf.json.JSONObject
;
//
import net.sf.json.JSONObject;
//
/**
/
//
**
*
// *
* <pre>
//
* <pre>
* 电梯运行状态表 服务类
//
* 电梯运行状态表 服务类
* </pre>
//
* </pre>
*
//
*
* @author gwb
//
* @author gwb
* @version $Id: ElevatorStatusService.java, v 0.1 2021年9月28日 下午7:55:18 gwb Exp $
//
* @version $Id: ElevatorStatusService.java, v 0.1 2021年9月28日 下午7:55:18 gwb Exp $
*/
//
*/
@Component
//
@Component
public
class
ElevatorStatusService
extends
//
public class ElevatorStatusService extends
BaseService
<
ElevatorStatusModel
,
ElevatorStatus
,
ElevatorStatusMapper
>
//
BaseService<ElevatorStatusModel, ElevatorStatus, ElevatorStatusMapper>
{
//
{
//
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ElevatorStatusService
.
class
);
//
private static final Logger logger = LoggerFactory.getLogger(ElevatorStatusService.class);
//
@Autowired
//
@Autowired
private
RestTemplate
restTemplate
;
//
private RestTemplate restTemplate;
//
@Lazy
//
@Lazy
@Autowired
//
@Autowired
private
EmqKeeper
emqKeeper
;
//
private EmqKeeper emqKeeper;
//
@Value
(
"${biz.lxyd.lift.url}"
)
//
@Value("${biz.lxyd.lift.url}")
private
String
lxydLiftUrl
;
//
private String lxydLiftUrl;
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 批量保存电梯运行状态信息
//
* 批量保存电梯运行状态信息
* </pre>
//
* </pre>
*
//
*
* @param models
//
* @param models
* @return
//
* @return
* @throws Exception
//
* @throws Exception
*/
//
*/
public
String
multCreateElevatorStatus
(
List
<
ElevatorStatusModel
>
models
)
throws
Exception
//
public String multCreateElevatorStatus(List<ElevatorStatusModel> models) throws Exception
{
//
{
//
if
(
ValidationUtil
.
isEmpty
(
models
))
//
if (ValidationUtil.isEmpty(models))
throw
new
BadRequest
(
"上报电梯状态数据为空."
);
//
throw new BadRequest("上报电梯状态数据为空.");
//
for
(
ElevatorStatusModel
elevatorStatusModel
:
models
)
//
for (ElevatorStatusModel elevatorStatusModel : models)
{
//
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
elevatorStatusModel
.
setUploadDate
(
//
elevatorStatusModel.setUploadDate(
elevatorStatusModel
.
getUploadTime
()!=
null
?
sdf
.
parse
(
elevatorStatusModel
.
getUploadTime
()):
null
);
//
elevatorStatusModel.getUploadTime()!= null? sdf.parse(elevatorStatusModel.getUploadTime()): null);
//
List
<
ElevatorStatusModel
>
oldModel
=
queryModelByCodeAndStatusId
(
elevatorStatusModel
.
getRegisterCode
(),
elevatorStatusModel
.
getStatusId
());
//
List<ElevatorStatusModel> oldModel = queryModelByCodeAndStatusId(elevatorStatusModel.getRegisterCode(), elevatorStatusModel.getStatusId());
//如果存在该状态编码则不进行发送
//
//如果存在该状态编码则不进行发送
if
(
ValidationUtil
.
isEmpty
(
oldModel
))
//
if (ValidationUtil.isEmpty(oldModel))
{
//
{
//实时消息发送
//
//实时消息发送
ObjectMapper
mapper
=
new
ObjectMapper
();
//
ObjectMapper mapper = new ObjectMapper();
String
resultJson
=
mapper
.
writeValueAsString
(
builEnumName
(
elevatorStatusModel
));
//
String resultJson = mapper.writeValueAsString(builEnumName(elevatorStatusModel));
emqKeeper
.
getMqttClient
().
publish
(
"openapi/lift/runStatusData"
,
resultJson
.
getBytes
(),
2
,
false
);
//
emqKeeper.getMqttClient().publish("openapi/lift/runStatusData" ,resultJson.getBytes(), 2 ,false);
}
//
}
elevatorStatusModel
=
this
.
createWithModel
(
elevatorStatusModel
);
//
elevatorStatusModel = this.createWithModel(elevatorStatusModel);
}
//
}
//
return
"OK"
;
//
return "OK";
}
//
}
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 查询电梯最新一条状态数据
//
* 查询电梯最新一条状态数据
* </pre>
//
* </pre>
*
//
*
* @param registerCode 电梯注册码
//
* @param registerCode 电梯注册码
* @param highUpload 是否开启高频上传
//
* @param highUpload 是否开启高频上传
* @return
//
* @return
* @throws Exception
//
* @throws Exception
*/
//
*/
public
ElevatorStatusModel
getLatelyStatus
(
String
registerCode
,
Boolean
highUpload
)
throws
Exception
//
public ElevatorStatusModel getLatelyStatus(String registerCode, Boolean highUpload) throws Exception
{
//
{
ElevatorStatusModel
elevatorStatusModel
=
null
;
//
ElevatorStatusModel elevatorStatusModel = null;
ElevatorStatus
elevatorStatus
=
baseMapper
.
getLatelyStatus
(
registerCode
);
//
ElevatorStatus elevatorStatus = baseMapper.getLatelyStatus(registerCode);
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatus
))
//
if (!ValidationUtil.isEmpty(elevatorStatus))
{
//
{
elevatorStatusModel
=
Bean
.
toModel
(
elevatorStatus
,
new
ElevatorStatusModel
());
//
elevatorStatusModel = Bean.toModel(elevatorStatus, new ElevatorStatusModel());
elevatorStatusModel
=
builEnumName
(
elevatorStatusModel
);
//
elevatorStatusModel = builEnumName(elevatorStatusModel);
//开启高频上传
//
//开启高频上传
if
(
highUpload
)
//
if (highUpload)
{
//
{
this
.
highUpload
(
registerCode
);
//
this.highUpload(registerCode);
}
//
}
}
else
// }else
{
//
{
elevatorStatusModel
=
new
ElevatorStatusModel
();
//
elevatorStatusModel = new ElevatorStatusModel();
}
//
}
return
elevatorStatusModel
;
//
return elevatorStatusModel;
}
//
}
//
//
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 高频上传状态数据请求
//
* 高频上传状态数据请求
* </pre>
//
* </pre>
*
//
*
* @throws Exception
//
* @throws Exception
*/
//
*/
public
void
highUpload
(
String
registerCode
)
throws
Exception
//
public void highUpload(String registerCode) throws Exception
{
//
{
HttpHeaders
headers
=
new
HttpHeaders
();
//
HttpHeaders headers = new HttpHeaders();
headers
.
add
(
"Content-Type"
,
"application/json"
);
//
headers.add("Content-Type", "application/json");
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
//
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory
.
setConnectTimeout
(
30000
);
//
factory.setConnectTimeout(30000);
factory
.
setReadTimeout
(
30000
);
//
factory.setReadTimeout(30000);
restTemplate
.
setRequestFactory
(
factory
);
//
restTemplate.setRequestFactory(factory);
//
HttpEntity
<
String
>
request
=
new
HttpEntity
<
String
>(
headers
);
//
HttpEntity<String> request = new HttpEntity<String>(headers);
logger
.
info
(
"发起电梯运行状态高频请求,电梯注册码:"
+
registerCode
);
//
logger.info("发起电梯运行状态高频请求,电梯注册码:" + registerCode);
restTemplate
.
exchange
(
lxydLiftUrl
+
"/lift/runstatus?registerCode="
+
registerCode
,
HttpMethod
.
GET
,
request
,
String
.
class
);
//
restTemplate.exchange(lxydLiftUrl + "/lift/runstatus?registerCode=" + registerCode, HttpMethod.GET, request, String.class);
//
}
//
}
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 获取电梯视频播放地址
//
* 获取电梯视频播放地址
* </pre>
//
* </pre>
*
//
*
* @throws Exception
//
* @throws Exception
*/
//
*/
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
//
@SuppressWarnings({ "unchecked", "rawtypes" })
public
ElevatorVideoModel
videoPreview
(
String
registerCode
)
throws
Exception
//
public ElevatorVideoModel videoPreview(String registerCode) throws Exception
{
//
{
HttpHeaders
headers
=
new
HttpHeaders
();
//
HttpHeaders headers = new HttpHeaders();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
//
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
headers
.
setContentType
(
type
);
//
headers.setContentType(type);
headers
.
add
(
"Content-Type"
,
"application/json"
);
//
headers.add("Content-Type", "application/json");
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
//
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory
.
setConnectTimeout
(
30000
);
//
factory.setConnectTimeout(30000);
factory
.
setReadTimeout
(
30000
);
//
factory.setReadTimeout(30000);
restTemplate
.
setRequestFactory
(
factory
);
//
restTemplate.setRequestFactory(factory);
//
HttpEntity
<
String
>
request
=
new
HttpEntity
<
String
>(
headers
);
//
HttpEntity<String> request = new HttpEntity<String>(headers);
logger
.
info
(
"获取电梯视频播放地址,电梯注册码:"
+
registerCode
);
//
logger.info("获取电梯视频播放地址,电梯注册码:" + registerCode);
String
responseJson
=
restTemplate
.
exchange
(
lxydLiftUrl
+
"/lift/video/preview?registerCode="
+
registerCode
,
HttpMethod
.
GET
,
request
,
String
.
class
).
getBody
();
//
String responseJson = restTemplate.exchange(lxydLiftUrl + "/lift/video/preview?registerCode=" + registerCode, HttpMethod.GET, request, String.class).getBody();
JSONObject
jsonobject
=
JSONObject
.
fromObject
(
responseJson
);
//
JSONObject jsonobject = JSONObject.fromObject(responseJson);
Map
<
String
,
Class
>
classMap
=
new
HashMap
<
String
,
Class
>();
//
Map<String, Class> classMap = new HashMap<String, Class>();
classMap
.
put
(
"result"
,
ElevatorVideoModel
.
class
);
//
classMap.put("result", ElevatorVideoModel.class);
ResponseModel
<
ElevatorVideoModel
>
responseModel
=
(
ResponseModel
<
ElevatorVideoModel
>)
JSONObject
.
toBean
(
jsonobject
,
ResponseModel
.
class
,
classMap
);
//
ResponseModel<ElevatorVideoModel> responseModel = (ResponseModel<ElevatorVideoModel>)JSONObject.toBean(jsonobject,ResponseModel.class,classMap);
ElevatorVideoModel
elevatorVideoModel
=
new
ElevatorVideoModel
();
//
ElevatorVideoModel elevatorVideoModel = new ElevatorVideoModel();
elevatorVideoModel
.
setRegisterCode
(
registerCode
);
//
elevatorVideoModel.setRegisterCode(registerCode);
if
(
responseModel
.
getStatus
()
==
HttpStatus
.
OK
.
value
())
//
if (responseModel.getStatus() == HttpStatus.OK.value())
{
//
{
elevatorVideoModel
=
responseModel
.
getResult
();
//
elevatorVideoModel = responseModel.getResult();
}
//
}
return
elevatorVideoModel
;
//
return elevatorVideoModel;
}
//
}
//
/**
//
/**
*
// *
* <pre>
//
* <pre>
* 根据电梯注册编码和故障编码查询电梯故障信息
//
* 根据电梯注册编码和故障编码查询电梯故障信息
* </pre>
//
* </pre>
*
//
*
* @param registerCode
//
* @param registerCode
* @param faultId
//
* @param faultId
*/
//
*/
private
List
<
ElevatorStatusModel
>
queryModelByCodeAndStatusId
(
String
registerCode
,
String
statusId
)
//
private List<ElevatorStatusModel> queryModelByCodeAndStatusId(String registerCode, String statusId)
{
//
{
return
this
.
queryForList
(
"upload_date"
,
false
,
registerCode
,
statusId
);
//
return this.queryForList("upload_date", false,registerCode, statusId);
}
//
}
//
private
ElevatorStatusModel
builEnumName
(
ElevatorStatusModel
elevatorStatusModel
)
//
private ElevatorStatusModel builEnumName(ElevatorStatusModel elevatorStatusModel)
{
//
{
//总接触器吸合或是断开
//
//总接触器吸合或是断开
elevatorStatusModel
.
setMainContactorName
(
String
.
valueOf
(
elevatorStatusModel
.
getMainContactor
()));
//
elevatorStatusModel.setMainContactorName(String.valueOf(elevatorStatusModel.getMainContactor()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getMainContactor
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getMainContactor()) &&
!
ValidationUtil
.
isEmpty
(
LiftContactorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getMainContactor
())))
//
!ValidationUtil.isEmpty(LiftContactorStatusEnum.getEnum(elevatorStatusModel.getMainContactor())))
{
//
{
elevatorStatusModel
.
setMainContactorName
(
LiftContactorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getMainContactor
()).
getName
());
//
elevatorStatusModel.setMainContactorName(LiftContactorStatusEnum.getEnum(elevatorStatusModel.getMainContactor()).getName());
}
//
}
//运行接触器吸合或是断开
//
//运行接触器吸合或是断开
elevatorStatusModel
.
setRunContactorName
(
String
.
valueOf
(
elevatorStatusModel
.
getRunContactor
()));
//
elevatorStatusModel.setRunContactorName(String.valueOf(elevatorStatusModel.getRunContactor()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getRunContactor
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getRunContactor()) &&
!
ValidationUtil
.
isEmpty
(
LiftContactorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getRunContactor
())))
//
!ValidationUtil.isEmpty(LiftContactorStatusEnum.getEnum(elevatorStatusModel.getRunContactor())))
{
//
{
elevatorStatusModel
.
setRunContactorName
(
LiftContactorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getRunContactor
()).
getName
());
//
elevatorStatusModel.setRunContactorName(LiftContactorStatusEnum.getEnum(elevatorStatusModel.getRunContactor()).getName());
}
//
}
//安全回路是否断开
//
//安全回路是否断开
elevatorStatusModel
.
setCircuitName
(
String
.
valueOf
(
elevatorStatusModel
.
getCircuit
()));
//
elevatorStatusModel.setCircuitName(String.valueOf(elevatorStatusModel.getCircuit()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getCircuit
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getCircuit()) &&
!
ValidationUtil
.
isEmpty
(
LiftCircuitStatusEnum
.
getEnum
(
elevatorStatusModel
.
getCircuit
())))
//
!ValidationUtil.isEmpty(LiftCircuitStatusEnum.getEnum(elevatorStatusModel.getCircuit())))
{
//
{
elevatorStatusModel
.
setCircuitName
(
LiftCircuitStatusEnum
.
getEnum
(
elevatorStatusModel
.
getCircuit
()).
getName
());
//
elevatorStatusModel.setCircuitName(LiftCircuitStatusEnum.getEnum(elevatorStatusModel.getCircuit()).getName());
}
//
}
//当前电梯运行模式
//
//当前电梯运行模式
elevatorStatusModel
.
setServiceModelName
(
String
.
valueOf
(
elevatorStatusModel
.
getServiceModel
()));
//
elevatorStatusModel.setServiceModelName(String.valueOf(elevatorStatusModel.getServiceModel()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getServiceModel
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getServiceModel()) &&
!
ValidationUtil
.
isEmpty
(
LiftServiceModelEnum
.
getEnum
(
elevatorStatusModel
.
getServiceModel
())))
//
!ValidationUtil.isEmpty(LiftServiceModelEnum.getEnum(elevatorStatusModel.getServiceModel())))
{
//
{
elevatorStatusModel
.
setServiceModelName
(
LiftServiceModelEnum
.
getEnum
(
elevatorStatusModel
.
getServiceModel
()).
getName
());
//
elevatorStatusModel.setServiceModelName(LiftServiceModelEnum.getEnum(elevatorStatusModel.getServiceModel()).getName());
}
//
}
//轿厢运行状态
//
//轿厢运行状态
elevatorStatusModel
.
setLiftStatusName
(
String
.
valueOf
(
elevatorStatusModel
.
getLiftStatus
()));
//
elevatorStatusModel.setLiftStatusName(String.valueOf(elevatorStatusModel.getLiftStatus()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getLiftStatus
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getLiftStatus()) &&
!
ValidationUtil
.
isEmpty
(
LiftStatusEnum
.
getEnum
(
elevatorStatusModel
.
getLiftStatus
())))
//
!ValidationUtil.isEmpty(LiftStatusEnum.getEnum(elevatorStatusModel.getLiftStatus())))
{
//
{
elevatorStatusModel
.
setLiftStatusName
(
LiftStatusEnum
.
getEnum
(
elevatorStatusModel
.
getLiftStatus
()).
getName
());
//
elevatorStatusModel.setLiftStatusName(LiftStatusEnum.getEnum(elevatorStatusModel.getLiftStatus()).getName());
}
//
}
//轿厢运行方向
//
//轿厢运行方向
elevatorStatusModel
.
setLiftDirectionName
(
String
.
valueOf
(
elevatorStatusModel
.
getLiftDirection
()));
//
elevatorStatusModel.setLiftDirectionName(String.valueOf(elevatorStatusModel.getLiftDirection()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getLiftDirection
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getLiftDirection()) &&
!
ValidationUtil
.
isEmpty
(
LiftDirectionEnum
.
getEnum
(
elevatorStatusModel
.
getLiftDirection
())))
//
!ValidationUtil.isEmpty(LiftDirectionEnum.getEnum(elevatorStatusModel.getLiftDirection())))
{
//
{
elevatorStatusModel
.
setLiftDirectionName
(
LiftDirectionEnum
.
getEnum
(
elevatorStatusModel
.
getLiftDirection
()).
getName
());
//
elevatorStatusModel.setLiftDirectionName(LiftDirectionEnum.getEnum(elevatorStatusModel.getLiftDirection()).getName());
}
//
}
//关门到位
//
//关门到位
elevatorStatusModel
.
setDoorStatusName
(
String
.
valueOf
(
elevatorStatusModel
.
getDoorStatus
()));
//
elevatorStatusModel.setDoorStatusName(String.valueOf(elevatorStatusModel.getDoorStatus()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getDoorStatus
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getDoorStatus()) &&
!
ValidationUtil
.
isEmpty
(
LiftDoorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getDoorStatus
())))
//
!ValidationUtil.isEmpty(LiftDoorStatusEnum.getEnum(elevatorStatusModel.getDoorStatus())))
{
//
{
elevatorStatusModel
.
setDoorStatusName
(
LiftDoorStatusEnum
.
getEnum
(
elevatorStatusModel
.
getDoorStatus
()).
getName
());
//
elevatorStatusModel.setDoorStatusName(LiftDoorStatusEnum.getEnum(elevatorStatusModel.getDoorStatus()).getName());
}
//
}
//轿厢内是否有人
//
//轿厢内是否有人
elevatorStatusModel
.
setPersonFlagName
(
String
.
valueOf
(
elevatorStatusModel
.
getPersonFlag
()));
//
elevatorStatusModel.setPersonFlagName(String.valueOf(elevatorStatusModel.getPersonFlag()));
if
(!
ValidationUtil
.
isEmpty
(
elevatorStatusModel
.
getPersonFlag
())
&&
// if (!ValidationUtil.isEmpty(elevatorStatusModel.getPersonFlag()) &&
!
ValidationUtil
.
isEmpty
(
LiftPersonFlagEnum
.
getEnum
(
elevatorStatusModel
.
getPersonFlag
())))
//
!ValidationUtil.isEmpty(LiftPersonFlagEnum.getEnum(elevatorStatusModel.getPersonFlag())))
{
//
{
elevatorStatusModel
.
setPersonFlagName
(
LiftPersonFlagEnum
.
getEnum
(
elevatorStatusModel
.
getPersonFlag
()).
getName
());
//
elevatorStatusModel.setPersonFlagName(LiftPersonFlagEnum.getEnum(elevatorStatusModel.getPersonFlag()).getName());
}
//
}
return
elevatorStatusModel
;
//
return elevatorStatusModel;
}
//
}
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/ElevatorTechInfoService.java
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
//
package com.yeejoin.amos.api.openapi.face.service;
//
import
com.alibaba.fastjson.JSONObject
;
//
import com.alibaba.fastjson.JSONObject;
import
com.yeejoin.amos.api.openapi.enums.JgFileAttributeEnum
;
//
import com.yeejoin.amos.api.openapi.enums.JgFileAttributeEnum;
import
com.yeejoin.amos.api.openapi.enums.JgFileObjectEnum
;
//
import com.yeejoin.amos.api.openapi.enums.JgFileObjectEnum;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorTechInfoModel
;
//
import com.yeejoin.amos.api.openapi.face.model.ElevatorTechInfoModel;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorTechInfoMapper
;
//
import com.yeejoin.amos.api.openapi.face.orm.dao.ElevatorTechInfoMapper;
import
com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorTechInfo
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorTechInfo;
import
com.yeejoin.amos.api.openapi.face.orm.entity.JgFile
;
//
import com.yeejoin.amos.api.openapi.face.orm.entity.JgFile;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
//
import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
//
import org.springframework.transaction.annotation.Transactional;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
//
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
//
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
//
import
java.util.ArrayList
;
//
import java.util.ArrayList;
import
java.util.Date
;
//
import java.util.Date;
import
java.util.List
;
//
import java.util.List;
//
/**
/
//
**
* 电梯技术参数 服务类
//
* 电梯技术参数 服务类
*
//
*
* @author duanwei
//
* @author duanwei
* @date 2022-07-19
//
* @date 2022-07-19
*/
//
*/
@Component
//
@Component
public
class
ElevatorTechInfoService
extends
AppBaseService
<
ElevatorTechInfoModel
,
ElevatorTechInfo
,
ElevatorTechInfoMapper
>
{
//
public class ElevatorTechInfoService extends AppBaseService<ElevatorTechInfoModel, ElevatorTechInfo, ElevatorTechInfoMapper> {
//
@Autowired
//
@Autowired
private
JgFileService
fileService
;
//
private JgFileService fileService;
//
/**
//
/**
*
//
*
* 新增电梯技术参数
//
* 新增电梯技术参数
*
//
*
* @param model 电梯技术参数实体类集合
//
* @param model 电梯技术参数实体类集合
* @return 成功返回“OK”
//
* @return 成功返回“OK”
*/
//
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
//
@Transactional(rollbackFor= {Exception.class})
public
String
saveElevatorTechInfo
(
List
<
ElevatorTechInfoModel
>
model
)
{
//
public String saveElevatorTechInfo(List<ElevatorTechInfoModel> model) {
// TODO Auto-generated method stub
//
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
{
//
if (ValidationUtil.isEmpty(model)) {
throw
new
BadRequest
(
"电梯技术参数为空."
);
//
throw new BadRequest("电梯技术参数为空.");
}
//
}
//
List
<
JgFile
>
fileList
=
new
ArrayList
<>();
//
List<JgFile> fileList = new ArrayList<>();
List
<
JgFile
>
governorEffiReportList
;
//
List<JgFile> governorEffiReportList;
//
for
(
ElevatorTechInfoModel
models
:
model
)
{
//
for (ElevatorTechInfoModel models : model) {
checkModel
(
models
);
//
checkModel(models);
models
.
setRecDate
(
new
Date
());
//
models.setRecDate(new Date());
models
.
setAppId
(
getAppId
());
//
models.setAppId(getAppId());
//
ElevatorTechInfoModel
elevatorTechInfoModel
=
this
.
createWithModel
(
models
);
//
ElevatorTechInfoModel elevatorTechInfoModel = this.createWithModel(models);
//
governorEffiReportList
=
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
models
.
getGovernorEffiReport
()),
JgFile
.
class
);
//
governorEffiReportList = JSONObject.parseArray(JSONObject.toJSONString(models.getGovernorEffiReport()), JgFile.class);
for
(
JgFile
files
:
governorEffiReportList
)
{
//
for (JgFile files : governorEffiReportList) {
JgFile
file
=
new
JgFile
();
//
JgFile file = new JgFile();
file
.
setSequenceCode
(
models
.
getSequenceCode
());
//
file.setSequenceCode(models.getSequenceCode());
file
.
setAppId
(
getAppId
());
//
file.setAppId(getAppId());
file
.
setObjectType
(
JgFileObjectEnum
.
ELEVATOR_TECH_INFO
.
getObject
());
//
file.setObjectType(JgFileObjectEnum.ELEVATOR_TECH_INFO.getObject());
file
.
setAttributeType
(
JgFileAttributeEnum
.
GOVERNOR_EFFI_REPORT
.
getAttribute
());
//
file.setAttributeType(JgFileAttributeEnum.GOVERNOR_EFFI_REPORT.getAttribute());
file
.
setSyncDate
(
models
.
getSyncDate
());
//
file.setSyncDate(models.getSyncDate());
file
.
setFileUrl
(
files
.
getFileUrl
());
//
file.setFileUrl(files.getFileUrl());
file
.
setFileName
(
files
.
getFileName
());
//
file.setFileName(files.getFileName());
file
.
setRecDate
(
new
Date
());
//
file.setRecDate(new Date());
file
.
setSquNbr
(
elevatorTechInfoModel
.
getSequenceNbr
());
//
file.setSquNbr(elevatorTechInfoModel.getSequenceNbr());
fileList
.
add
(
file
);
//
fileList.add(file);
}
//
}
}
//
}
fileService
.
saveBatch
(
fileList
);
//
fileService.saveBatch(fileList);
return
"OK"
;
//
return "OK";
}
//
}
//
/**
//
/**
* 信息校验
//
* 信息校验
*
//
*
* @param models
//
* @param models
*/
//
*/
private
static
void
checkModel
(
ElevatorTechInfoModel
models
)
{
//
private static void checkModel(ElevatorTechInfoModel models) {
if
(
ValidationUtil
.
isEmpty
(
models
.
getSequenceCode
()))
{
//
if(ValidationUtil.isEmpty(models.getSequenceCode())) {
throw
new
BadRequest
(
"设备唯一标识码不能为空!"
);
//
throw new BadRequest("设备唯一标识码不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getSuperviseCode
()))
{
//
if(ValidationUtil.isEmpty(models.getSuperviseCode())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"监管系统唯一编码不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"监管系统唯一编码不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getRatedSpeed
()))
{
//
if(ValidationUtil.isEmpty(models.getRatedSpeed())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"额定速度不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"额定速度不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getControlType
()))
{
//
if(ValidationUtil.isEmpty(models.getControlType())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"控制方式不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"控制方式不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getRatedLoad
()))
{
//
if(ValidationUtil.isEmpty(models.getRatedLoad())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"额定载重不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"额定载重不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getSyncDate
()))
{
//
if(ValidationUtil.isEmpty(models.getSyncDate())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"同步时间不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"同步时间不能为空!");
}
//
}
if
(
ValidationUtil
.
isEmpty
(
models
.
getSyncState
()))
{
//
if(ValidationUtil.isEmpty(models.getSyncState())) {
throw
new
BadRequest
(
"设备标识码为:"
+
models
.
getSequenceCode
()+
"的设备,"
+
"同步状态不能为空!"
);
//
throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"同步状态不能为空!");
}
//
}
}
//
}
}
//
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/EnterpriseInfoService.java
View file @
b5d4c681
...
@@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -135,8 +137,5 @@ public class EnterpriseInfoService extends AppBaseService<EnterpriseInfoModel, E
...
@@ -135,8 +137,5 @@ public class EnterpriseInfoService extends AppBaseService<EnterpriseInfoModel, E
}
}
}
}
@DS
(
"tzs"
)
public
List
<
EnterpriseInfoModel
>
getEnterpriseInfoByCreditCode
(
Set
<
String
>
useCode
)
{
return
this
.
queryForList
(
""
,
false
,
useCode
);
}
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TzsEnterpriseInfoService.java
0 → 100644
View file @
b5d4c681
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.yeejoin.amos.api.openapi.face.model.EnterpriseInfoModel
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.EnterpriseInfoMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.EnterpriseInfo
;
import
org.springframework.stereotype.Component
;
/**
* 企业数据信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public
class
TzsEnterpriseInfoService
extends
AppBaseService
<
EnterpriseInfoModel
,
EnterpriseInfo
,
EnterpriseInfoMapper
>
{
}
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