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
e0ed948c
Commit
e0ed948c
authored
Aug 10, 2021
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理pom文件,优化代码
parent
03350ab1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
270 additions
and
247 deletions
+270
-247
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+24
-0
LinkageUnitDto.java
...ejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
+1
-3
MaintenanceCompany.java
...mos/boot/module/common/api/entity/MaintenanceCompany.java
+4
-5
IMaintenanceCompanyService.java
...module/common/api/service/IMaintenanceCompanyService.java
+0
-1
pom.xml
...ule/amos-boot-module-api/amos-boot-module-tzs-api/pom.xml
+6
-0
pom.xml
.../amos-boot-module-biz/amos-boot-module-common-biz/pom.xml
+0
-17
FireExpertsController.java
...t/module/common/biz/controller/FireExpertsController.java
+19
-6
KeySiteController.java
.../boot/module/common/biz/controller/KeySiteController.java
+18
-22
MaintenanceCompanyController.java
...e/common/biz/controller/MaintenanceCompanyController.java
+0
-1
KeySiteServiceImpl.java
...ot/module/common/biz/service/impl/KeySiteServiceImpl.java
+17
-21
LinkageUnitServiceImpl.java
...odule/common/biz/service/impl/LinkageUnitServiceImpl.java
+16
-17
BeanDtoVoUtils.java
...oin/amos/boot/module/common/biz/utils/BeanDtoVoUtils.java
+134
-134
pom.xml
...ule/amos-boot-module-biz/amos-boot-module-tzs-biz/pom.xml
+6
-6
ElevatorServiceImpl.java
...boot/module/tzs/biz/service/impl/ElevatorServiceImpl.java
+3
-4
pom.xml
amos-boot-system-tzs/pom.xml
+15
-7
AmosTzsApplication.java
...zs/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
+1
-1
application.properties
...boot-system-tzs/src/main/resources/application.properties
+6
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
e0ed948c
...
...
@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.util.*
;
/**
...
...
@@ -663,4 +664,27 @@ public class DateUtils {
return
date
.
after
(
begin
)
&&
date
.
before
(
end
);
}
/**
* 由出生日期获得年龄
*
* @param birthDay 出生日期
*/
public
static
int
getAge
(
Date
birthDay
)
{
if
(
birthDay
==
null
)
{
return
0
;
}
LocalDate
now
=
LocalDate
.
now
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
birthDay
);
int
yearBirth
=
cal
.
get
(
Calendar
.
YEAR
);
int
monthBirth
=
cal
.
get
(
Calendar
.
MONTH
)
+
1
;
int
dayOfMonthBirth
=
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
LocalDate
birth
=
LocalDate
.
of
(
yearBirth
,
monthBirth
,
dayOfMonthBirth
);
if
(
birth
.
isAfter
(
now
))
{
return
0
;
}
int
age
=
birth
.
until
(
now
).
getYears
();
return
age
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.List
;
import
org.omg.CORBA.PRIVATE_MEMBER
;
/**
* 联动单位
*
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/MaintenanceCompany.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
entity
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IMaintenanceCompanyService.java
View file @
e0ed948c
...
...
@@ -4,7 +4,6 @@ import java.util.List;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/pom.xml
View file @
e0ed948c
...
...
@@ -16,6 +16,12 @@
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-elasticsearch
</artifactId>
<version>
4.0.9.RELEASE
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/pom.xml
View file @
e0ed948c
...
...
@@ -15,22 +15,5 @@
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-jcs-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<!-- <dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-maintenance-biz</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency> -->
<!-- <dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-patrol-biz</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>-->
</dependencies>
</project>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FireExpertsController.java
View file @
e0ed948c
...
...
@@ -6,22 +6,35 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireExperts
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.utils.BeanDtoVoUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -100,7 +113,7 @@ public class FireExpertsController extends BaseController {
public
ResponseModel
<
FireExpertsDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
FireExpertsDto
fireExpertsDto
=
fireExpertsServiceImpl
.
queryBySeq
(
sequenceNbr
);
Date
birthdayTime
=
fireExpertsDto
.
getBirthdayTime
();
int
age
=
BeanDtoVo
Utils
.
getAge
(
birthdayTime
);
int
age
=
Date
Utils
.
getAge
(
birthdayTime
);
fireExpertsDto
.
setAge
(
age
);
return
ResponseHelper
.
buildResponse
(
fireExpertsDto
);
}
...
...
@@ -125,7 +138,7 @@ public class FireExpertsController extends BaseController {
Page
<
FireExpertsDto
>
fireExpertsDtoPage
=
fireExpertsServiceImpl
.
queryForFireExpertsPage
(
page
,
false
,
fireExpertsDto
.
getName
(),
fireExpertsDto
.
getExpertCode
());
List
<
FireExpertsDto
>
fireExpertsDtoList
=
fireExpertsDtoPage
.
getRecords
().
stream
().
map
(
item
->
{
item
.
setAge
(
BeanDtoVo
Utils
.
getAge
(
item
.
getBirthdayTime
()));
item
.
setAge
(
Date
Utils
.
getAge
(
item
.
getBirthdayTime
()));
return
item
;
}).
collect
(
Collectors
.
toList
());
fireExpertsDtoPage
.
setRecords
(
fireExpertsDtoList
);
...
...
@@ -143,7 +156,7 @@ public class FireExpertsController extends BaseController {
public
ResponseModel
<
List
<
FireExpertsDto
>>
selectForList
()
{
List
<
FireExpertsDto
>
fireExpertsDtoList
=
fireExpertsServiceImpl
.
queryForFireExpertsList
(
false
);
fireExpertsDtoList
.
stream
().
map
(
item
->
{
item
.
setAge
(
BeanDtoVo
Utils
.
getAge
(
item
.
getBirthdayTime
()));
item
.
setAge
(
Date
Utils
.
getAge
(
item
.
getBirthdayTime
()));
return
item
;
}).
collect
(
Collectors
.
toList
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/KeySiteController.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -21,22 +29,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 重点部位
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/MaintenanceCompanyController.java
View file @
e0ed948c
...
...
@@ -6,7 +6,6 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/KeySiteServiceImpl.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Foreach
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto
;
...
...
@@ -40,6 +19,23 @@ import com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 重点部位服务实现类
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/LinkageUnitServiceImpl.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -38,6 +21,21 @@ import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.mapper.LinkageUnitMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 联动单位服务实现类
...
...
@@ -260,6 +258,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return
update
;
}
@Override
public
List
<
Menu
>
getEmergencyLinkageUnitCodeGroupBy
(
String
type
,
String
rootName
)
{
List
<
Map
<
String
,
Object
>>
map
=
linkageUnitMapper
.
getEmergencyLinkageUnitCodeGroupByAndCount
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/utils/BeanDtoVoUtils.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
utils
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireExperts
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDate
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* @title: 实体类 Dto,Vo,entity 转换工具类
* @Author fpy
* @Date: 2021/6/3 13:53
*/
@Component
public
class
BeanDtoVoUtils
{
/**
* Dot ,Vo ,Entity 相互转换
*
* @param source 原数据
* @param targetClass 目标类
* @param <T> 泛型类
* @return 转换返回值
*/
public
static
<
T
>
T
convert
(
Object
source
,
Class
<
T
>
targetClass
)
{
// 判断source是否为空
if
(
source
==
null
)
{
return
null
;
}
// 判断targetClass是否为空
if
(
targetClass
==
null
)
{
return
null
;
}
try
{
// 创建新的对象实例
T
target
=
targetClass
.
newInstance
();
// 把原对象数据拷贝到新对象
BeanUtils
.
copyProperties
(
source
,
target
);
// 返回新对象
return
target
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* Dot ,Vo ,Entity 相互转换
*
* @param source 原数据
* @return 转换返回值
*/
public
static
FireExpertsDto
convertFireExperts
(
FireExperts
source
)
{
// 判断source是否为空
if
(
source
==
null
)
{
return
null
;
}
try
{
// 创建新的对象实例
FireExpertsDto
target
=
FireExpertsDto
.
class
.
newInstance
();
// 把原对象数据拷贝到新对象
BeanUtils
.
copyProperties
(
source
,
target
);
// 计算年龄
int
age
=
getAge
(
source
.
getBirthdayTime
());
target
.
setAge
(
age
);
// 返回新对象
return
target
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* IPage<Entity> 分页对象转 Page<Dto>
*
* @param page 原分页对象
* @param v 目标vo类
* @param <E> 泛型类
* @param <V> 泛型类
* @return 转换后的分页对象
*/
public
static
<
E
,
V
>
IPage
<
V
>
iPageDtoStream
(
IPage
<
E
>
page
,
Class
<
V
>
v
)
{
return
page
.
convert
(
item
->
{
try
{
return
convert
(
item
,
v
);
}
catch
(
Exception
e
)
{
return
null
;
}
});
}
/**
* IPage<Entity> 分页对象转 Page<Dto>
*
* @param page 原分页对象
* @return 转换后的分页对象
*/
public
static
IPage
<
FireExpertsDto
>
iPageDtoStreamFireExperts
(
IPage
<
FireExperts
>
page
)
{
return
page
.
convert
(
item
->
{
try
{
return
convertFireExperts
(
item
);
}
catch
(
Exception
e
)
{
return
null
;
}
});
}
//由出生日期获得年龄
public
static
int
getAge
(
Date
birthDay
)
{
if
(
birthDay
==
null
)
{
return
0
;
}
LocalDate
now
=
LocalDate
.
now
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
birthDay
);
int
yearBirth
=
cal
.
get
(
Calendar
.
YEAR
);
int
monthBirth
=
cal
.
get
(
Calendar
.
MONTH
)
+
1
;
int
dayOfMonthBirth
=
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
LocalDate
birth
=
LocalDate
.
of
(
yearBirth
,
monthBirth
,
dayOfMonthBirth
);
if
(
birth
.
isAfter
(
now
))
{
return
0
;
}
int
age
=
birth
.
until
(
now
).
getYears
();
return
age
;
}
}
\ No newline at end of file
//package com.yeejoin.amos.boot.module.common.biz.utils;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
//import com.yeejoin.amos.boot.module.common.api.entity.FireExperts;
//import org.springframework.beans.BeanUtils;
//import org.springframework.stereotype.Component;
//
//import java.time.LocalDate;
//import java.util.Calendar;
//import java.util.Date;
//
///**
// * @title: 实体类 Dto,Vo,entity 转换工具类
// * @Author fpy
// * @Date: 2021/6/3 13:53
// */
//@Component
//public class BeanDtoVoUtils {
//
// /**
// * Dot ,Vo ,Entity 相互转换
// *
// * @param source 原数据
// * @param targetClass 目标类
// * @param <T> 泛型类
// * @return 转换返回值
// */
// public static <T> T convert(Object source, Class<T> targetClass) {
// // 判断source是否为空
// if (source == null) {
// return null;
// }
// // 判断targetClass是否为空
// if (targetClass == null) {
// return null;
// }
// try {
// // 创建新的对象实例
// T target = targetClass.newInstance();
// // 把原对象数据拷贝到新对象
// BeanUtils.copyProperties(source, target);
// // 返回新对象
// return target;
// } catch (Exception e) {
// e.printStackTrace();
// return null;
// }
// }
//
// /**
// * Dot ,Vo ,Entity 相互转换
// *
// * @param source 原数据
// * @return 转换返回值
// */
// public static FireExpertsDto convertFireExperts(FireExperts source) {
// // 判断source是否为空
// if (source == null) {
// return null;
// }
// try {
// // 创建新的对象实例
// FireExpertsDto target = FireExpertsDto.class.newInstance();
// // 把原对象数据拷贝到新对象
// BeanUtils.copyProperties(source, target);
// // 计算年龄
// int age = getAge(source.getBirthdayTime());
// target.setAge(age);
// // 返回新对象
// return target;
// } catch (Exception e) {
// e.printStackTrace();
// return null;
// }
// }
//
// /**
// * IPage<Entity> 分页对象转 Page<Dto>
// *
// * @param page 原分页对象
// * @param v 目标vo类
// * @param <E> 泛型类
// * @param <V> 泛型类
// * @return 转换后的分页对象
// */
// public static <E, V> IPage<V> iPageDtoStream(IPage<E> page, Class<V> v) {
// return page.convert(item -> {
// try {
// return convert(item, v);
// } catch (Exception e) {
// return null;
// }
// });
// }
//
// /**
// * IPage<Entity> 分页对象转 Page<Dto>
// *
// * @param page 原分页对象
// * @return 转换后的分页对象
// */
// public static IPage<FireExpertsDto> iPageDtoStreamFireExperts(IPage<FireExperts> page) {
// return page.convert(item -> {
// try {
// return convertFireExperts(item);
// } catch (Exception e) {
// return null;
// }
// });
// }
//
// //由出生日期获得年龄
// public static int getAge(Date birthDay) {
// if (birthDay == null) {
// return 0;
// }
// LocalDate now = LocalDate.now();
// Calendar cal = Calendar.getInstance();
// cal.setTime(birthDay);
// int yearBirth = cal.get(Calendar.YEAR);
// int monthBirth = cal.get(Calendar.MONTH) + 1;
// int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
//
// LocalDate birth = LocalDate.of(yearBirth, monthBirth, dayOfMonthBirth);
// if (birth.isAfter(now)) {
// return 0;
// }
// int age = birth.until(now).getYears();
// return age;
// }
//
//}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/pom.xml
View file @
e0ed948c
...
...
@@ -10,14 +10,14 @@
<artifactId>
amos-boot-module-tzs-biz
</artifactId>
<dependencies>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-tzs-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-tzs-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-
biz-common
</artifactId>
<artifactId>
amos-boot-
module-common-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ElevatorServiceImpl.java
View file @
e0ed948c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
//import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
...
...
@@ -23,8 +22,8 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
@Service
public
class
ElevatorServiceImpl
extends
BaseService
<
ElevatorDto
,
Elevator
,
ElevatorMapper
>
implements
IElevatorService
{
//
@Autowired
// ISourceFileService
sourceFileService;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Autowired
AlertCalledServiceImpl
alertCalledServiceImpl
;
...
...
amos-boot-system-tzs/pom.xml
View file @
e0ed948c
...
...
@@ -10,12 +10,20 @@
<version>
1.0.0
</version>
</parent>
<dependencies>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-tzs-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-tzs-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
amos-boot-system-tzs/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
View file @
e0ed948c
...
...
@@ -40,7 +40,7 @@ import java.net.UnknownHostException;
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.
tzs
.api.mapper"
,
"com.yeejoin.amos.boot.module.
*
.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AmosTzsApplication
{
...
...
amos-boot-system-tzs/src/main/resources/application.properties
View file @
e0ed948c
...
...
@@ -16,4 +16,8 @@ spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
120000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
\ No newline at end of file
spring.datasource.hikari.connection-test-query
=
SELECT 1
iot.fegin.name
=
AMOS-API-IOT
equip.fegin.name
=
AMOS-EQUIPMANAGE
\ No newline at end of file
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