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
66b170da
Commit
66b170da
authored
Nov 19, 2021
by
helinlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加APP待办任务统计
parent
7656d9cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
283 additions
and
301 deletions
+283
-301
IFirefightersService.java
.../boot/module/common/api/service/IFirefightersService.java
+0
-4
FirefightersServiceImpl.java
...dule/common/biz/service/impl/FirefightersServiceImpl.java
+1
-2
FirefightersController.java
...oot/module/jcs/biz/controller/FirefightersController.java
+282
-295
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IFirefightersService.java
View file @
66b170da
...
@@ -29,10 +29,6 @@ public interface IFirefightersService {
...
@@ -29,10 +29,6 @@ public interface IFirefightersService {
void
saveFirefighters
(
FirefightersInfoDto
firefighters
);
void
saveFirefighters
(
FirefightersInfoDto
firefighters
);
Firefighters
selectByAmosOrgId
(
Long
id
);
Firefighters
selectByAmosOrgId
(
Long
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FirefightersServiceImpl.java
View file @
66b170da
...
@@ -89,14 +89,13 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
...
@@ -89,14 +89,13 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
@Override
public
Firefighters
selectByAmosOrgId
(
Long
id
)
{
public
Firefighters
selectByAmosOrgId
(
Long
id
)
{
QueryWrapper
<
Firefighters
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Firefighters
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"amos_user_id"
,
id
);
queryWrapper
.
eq
(
"amos_user_id"
,
id
);
Firefighters
firefighters
=
firefightersMapper
.
selectOne
(
queryWrapper
);
Firefighters
firefighters
=
firefightersMapper
.
selectOne
(
queryWrapper
);
return
firefighters
;
return
firefighters
;
}
}
/**
/**
* 导出列表
* 导出列表
*/
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersController.java
View file @
66b170da
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
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.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -35,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
...
@@ -35,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
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.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
...
@@ -42,23 +16,29 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...
@@ -42,23 +16,29 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.common.api.entity.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersThought
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContractServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersEducationServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersPostServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersThoughtServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersJacketServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersJacketServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
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
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 消防队员
* 消防队员
...
@@ -71,270 +51,277 @@ import io.swagger.annotations.ApiOperation;
...
@@ -71,270 +51,277 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping
(
value
=
"/firefighters"
)
@RequestMapping
(
value
=
"/firefighters"
)
public
class
FirefightersController
extends
BaseController
{
public
class
FirefightersController
extends
BaseController
{
@Autowired
@Autowired
FirefightersServiceImpl
iFirefightersService
;
FirefightersServiceImpl
iFirefightersService
;
@Autowired
@Autowired
FirefightersPostServiceImpl
iFirefightersPostService
;
FirefightersPostServiceImpl
iFirefightersPostService
;
@Autowired
@Autowired
FirefightersContactsServiceImpl
ifirefightersContactsService
;
FirefightersContactsServiceImpl
ifirefightersContactsService
;
@Autowired
@Autowired
FirefightersEducationServiceImpl
ifirefightersEducationService
;
FirefightersEducationServiceImpl
ifirefightersEducationService
;
@Autowired
@Autowired
FirefightersThoughtServiceImpl
iFirefightersThoughtService
;
FirefightersThoughtServiceImpl
iFirefightersThoughtService
;
@Autowired
@Autowired
FirefightersContractServiceImpl
iFirefightersContractService
;
FirefightersContractServiceImpl
iFirefightersContractService
;
@Autowired
@Autowired
FirefightersJacketServiceImpl
iFirefightersJacketService
;
FirefightersJacketServiceImpl
iFirefightersJacketService
;
@Autowired
@Autowired
FireTeamServiceImpl
iFireTeamService
;
FireTeamServiceImpl
iFireTeamService
;
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Autowired
@Autowired
DataDictionaryServiceImpl
dataDictionaryService
;
DataDictionaryServiceImpl
dataDictionaryService
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
private
long
time
;
/**
* 新增消防队员
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防队员"
,
notes
=
"新增消防队员"
)
@Transactional
public
ResponseModel
<
FirefightersInfoDto
>
saveFirefighters
(
@RequestBody
FirefightersInfoDto
firefighters
)
{
try
{
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao start 2021-10-19*/
if
(
firefighters
.
getFirefighters
().
getJobTitleCode
()
!=
null
&&
!
firefighters
.
getFirefighters
().
getJobTitleCode
().
equals
(
""
)){
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
firefighters
.
getFirefighters
().
getJobTitleCode
(),
"GWMC"
);
firefighters
.
getFirefighters
().
setJobTitle
(
gwmc
.
getName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao end 2021-10-19*/
iFirefightersService
.
saveFirefighters
(
firefighters
);
return
ResponseHelper
.
buildResponse
(
firefighters
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
}
/**
* 根据id删除
*
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@Transactional
public
ResponseModel
<
Object
>
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
//BUG 2761 判断人员删除时的逻辑 如果被选为队伍联系人则无法被删除 bykongfm
List
fireTeam
=
iFireTeamService
.
list
(
new
LambdaQueryWrapper
<
FireTeam
>().
eq
(
FireTeam:
:
getIsDelete
,
false
).
eq
(
FireTeam:
:
getContactUserId
,
id
));
if
(
fireTeam
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
QueryWrapper
<
FirefightersJacket
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
queryWrapper
.
eq
(
"is_delete"
,
0
);
List
<
FirefightersJacket
>
firefightersJacket
=
iFirefightersJacketService
.
list
(
queryWrapper
);
if
(
firefightersJacket
!=
null
&&
firefightersJacket
.
size
()
>
0
)
{
// BUG 2222 by litw start 2021年9月10日
return
ResponseHelper
.
buildResponse
(
"-2"
);
}
try
{
iFirefightersService
.
update
(
new
UpdateWrapper
<
Firefighters
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersPostService
.
update
(
new
UpdateWrapper
<
FirefightersPost
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersContactsService
.
update
(
new
UpdateWrapper
<
FirefightersContacts
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersEducationService
.
update
(
new
UpdateWrapper
<
FirefightersEducation
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersThoughtService
.
update
(
new
UpdateWrapper
<
FirefightersThought
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersContractService
.
update
(
new
UpdateWrapper
<
FirefightersContract
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersJacketService
.
update
(
new
UpdateWrapper
<
FirefightersJacket
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
// 删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
return
ResponseHelper
.
buildResponse
(
"0"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"删除失败!"
);
}
}
/**
* 修改消防队员
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防队员"
,
notes
=
"修改消防队员"
)
@Transactional
public
ResponseModel
<
Object
>
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersInfoDto
firefighters
)
{
try
{
Firefighters
firefighter
=
firefighters
.
getFirefighters
();
// BUG2168 居住地户籍所在地为空判断 bykongfm
if
(
firefighter
.
getResidenceDetails
()
!=
null
)
{
FeignClientResult
<
RegionModel
>
region
=
Systemctl
.
regionClient
.
getRegion
(
Long
.
parseLong
(
firefighter
.
getResidenceDetails
()));
firefighter
.
setResidence
(
region
.
getResult
().
getRegionName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao start 2021-10-19*/
if
(
firefighter
.
getJobTitleCode
()
!=
null
){
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
firefighter
.
getJobTitleCode
(),
"GWMC"
);
firefighter
.
setJobTitle
(
gwmc
.
getName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao end 2021-10-19*/
if
(
firefighter
.
getNativePlace
()
!=
null
)
{
FeignClientResult
<
RegionModel
>
nativePlace
=
Systemctl
.
regionClient
.
getRegion
(
Long
.
parseLong
(
firefighter
.
getNativePlace
()));
firefighter
.
setNativePlaceValue
(
nativePlace
.
getResult
().
getRegionName
());
}
iFirefightersService
.
updateById
(
firefighter
);
ifirefightersContactsService
.
updateById
(
firefighters
.
getFirefightersContacts
());
// 删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
firefighter
.
getSequenceNbr
(),
RedisKey
.
FIREFIGHTERS_LIST_ID
+
firefighter
.
getSequenceNbr
());
return
ResponseHelper
.
buildResponse
(
null
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
}
/**
/**
* 根据id查询
* 新增消防队员
*
*
* @param id
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防队员"
,
notes
=
"新增消防队员"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
@Transactional
public
ResponseModel
<
Object
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
<
FirefightersInfoDto
>
saveFirefighters
(
@RequestBody
FirefightersInfoDto
firefighters
)
{
try
{
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao start 2021-10-19*/
if
(
firefighters
.
getFirefighters
().
getJobTitleCode
()
!=
null
&&
!
firefighters
.
getFirefighters
().
getJobTitleCode
().
equals
(
""
))
{
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
firefighters
.
getFirefighters
().
getJobTitleCode
(),
"GWMC"
);
firefighters
.
getFirefighters
().
setJobTitle
(
gwmc
.
getName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao end 2021-10-19*/
iFirefightersService
.
saveFirefighters
(
firefighters
);
return
ResponseHelper
.
buildResponse
(
firefighters
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_ID
+
id
))
{
}
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_ID
+
id
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
Firefighters
firefighters
=
iFirefightersService
.
getById
(
id
);
QueryWrapper
<
FirefightersContacts
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersContacts
firefightersContacts
=
ifirefightersContactsService
.
getOne
(
queryWrapper
);
FirefightersInfoDto
firefightersInfoDto
=
new
FirefightersInfoDto
(
firefighters
,
firefightersContacts
);
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
JSON
.
toJSON
(
firefightersInfoDto
),
time
);
return
ResponseHelper
.
buildResponse
(
firefightersInfoDto
);
}
}
/**
/**
* 列表详情展示
* 根据id删除
*/
*
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@Transactional
public
ResponseModel
<
Object
>
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
//BUG 2761 判断人员删除时的逻辑 如果被选为队伍联系人则无法被删除 bykongfm
List
fireTeam
=
iFireTeamService
.
list
(
new
LambdaQueryWrapper
<
FireTeam
>().
eq
(
FireTeam:
:
getIsDelete
,
false
).
eq
(
FireTeam:
:
getContactUserId
,
id
));
if
(
fireTeam
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
QueryWrapper
<
FirefightersJacket
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
queryWrapper
.
eq
(
"is_delete"
,
0
);
List
<
FirefightersJacket
>
firefightersJacket
=
iFirefightersJacketService
.
list
(
queryWrapper
);
if
(
firefightersJacket
!=
null
&&
firefightersJacket
.
size
()
>
0
)
{
// BUG 2222 by litw start 2021年9月10日
return
ResponseHelper
.
buildResponse
(
"-2"
);
}
try
{
iFirefightersService
.
update
(
new
UpdateWrapper
<
Firefighters
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersPostService
.
update
(
new
UpdateWrapper
<
FirefightersPost
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersContactsService
.
update
(
new
UpdateWrapper
<
FirefightersContacts
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersEducationService
.
update
(
new
UpdateWrapper
<
FirefightersEducation
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersThoughtService
.
update
(
new
UpdateWrapper
<
FirefightersThought
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersContractService
.
update
(
new
UpdateWrapper
<
FirefightersContract
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersJacketService
.
update
(
new
UpdateWrapper
<
FirefightersJacket
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
// 删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
return
ResponseHelper
.
buildResponse
(
"0"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"删除失败!"
);
}
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
/**
@RequestMapping
(
value
=
"/list/{id}"
,
method
=
RequestMethod
.
GET
)
* 修改消防队员
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表详情根据id查询"
,
notes
=
"列表详情根据id查询"
)
*
public
ResponseModel
<
Object
>
listToSelectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
* @return
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
))
{
*/
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
return
ResponseHelper
.
buildResponse
(
obj
);
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
}
else
{
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防队员"
,
notes
=
"修改消防队员"
)
Map
<
String
,
Object
>
firefighters
=
iFirefightersService
.
listToSelectById
(
id
);
@Transactional
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
,
JSON
.
toJSON
(
firefighters
),
time
);
public
ResponseModel
<
Object
>
updateByIdFirefighters
(
HttpServletRequest
request
,
return
ResponseHelper
.
buildResponse
(
firefighters
);
@RequestBody
FirefightersInfoDto
firefighters
)
{
}
try
{
}
Firefighters
firefighter
=
firefighters
.
getFirefighters
();
// BUG2168 居住地户籍所在地为空判断 bykongfm
if
(
firefighter
.
getResidenceDetails
()
!=
null
)
{
FeignClientResult
<
RegionModel
>
region
=
Systemctl
.
regionClient
.
getRegion
(
Long
.
parseLong
(
firefighter
.
getResidenceDetails
()));
firefighter
.
setResidence
(
region
.
getResult
().
getRegionName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao start 2021-10-19*/
if
(
firefighter
.
getJobTitleCode
()
!=
null
)
{
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
firefighter
.
getJobTitleCode
(),
"GWMC"
);
firefighter
.
setJobTitle
(
gwmc
.
getName
());
}
/*3184 消防人员,编辑页面岗位选择子分类保存成功后,概要中岗位未修改 chenzhao end 2021-10-19*/
if
(
firefighter
.
getNativePlace
()
!=
null
)
{
FeignClientResult
<
RegionModel
>
nativePlace
=
Systemctl
.
regionClient
.
getRegion
(
Long
.
parseLong
(
firefighter
.
getNativePlace
()));
firefighter
.
setNativePlaceValue
(
nativePlace
.
getResult
().
getRegionName
());
}
iFirefightersService
.
updateById
(
firefighter
);
ifirefightersContactsService
.
updateById
(
firefighters
.
getFirefightersContacts
());
// 删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
firefighter
.
getSequenceNbr
(),
RedisKey
.
FIREFIGHTERS_LIST_ID
+
firefighter
.
getSequenceNbr
());
return
ResponseHelper
.
buildResponse
(
null
);
}
catch
(
Exception
e
)
{
/**
throw
new
RuntimeException
(
"系统异常"
);
* 列表分页查询
}
*
}
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
Firefighters
>
listPage
(
String
pageNum
,
String
pageSize
,
Firefighters
firefighters
)
{
Page
<
Firefighters
>
pageBean
;
QueryWrapper
<
Firefighters
>
firefightersQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
Firefighters
>
aClass
=
firefighters
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
firefighters
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
if
(!
name
.
equals
(
NameUtils
.
camel2Underline
(
"serialVersionUID"
)))
{
String
fileValue
=
(
String
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
});
IPage
<
Firefighters
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iFirefightersService
.
page
(
pageBean
,
firefightersQueryWrapper
);
return
page
;
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
/**
@RequestMapping
(
value
=
"/getFirefighters"
,
method
=
RequestMethod
.
GET
)
* 根据id查询
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新列表分页查询"
,
notes
=
"新表分页查询"
)
*
public
ResponseModel
<
Page
<
FirefightersZhDto
>>
getFirefighters
(
Integer
pageNum
,
Integer
pageSize
,
* @param id
FirefightersDto
firefighters
)
{
* @return
// 条件分页
*/
if
(
null
==
pageNum
||
null
==
pageSize
)
{
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
pageNum
=
1
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
pageSize
=
Integer
.
MAX_VALUE
;
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
}
public
ResponseModel
<
Object
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
List
<
FirefightersZhDto
>
list
=
iFirefightersService
.
getFirefighters
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_ID
+
id
))
{
firefighters
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_ID
+
id
);
Map
<
String
,
Long
>
num
=
iFirefightersService
.
getFirefightersCount
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
return
ResponseHelper
.
buildResponse
(
obj
);
firefighters
);
}
else
{
Page
<
FirefightersZhDto
>
pageBean
=
new
Page
<>(
pageNum
,
pageSize
,
num
.
get
(
"num"
));
Firefighters
firefighters
=
iFirefightersService
.
getById
(
id
);
pageBean
.
setRecords
(
list
);
QueryWrapper
<
FirefightersContacts
>
queryWrapper
=
new
QueryWrapper
<>();
return
ResponseHelper
.
buildResponse
(
pageBean
);
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
}
FirefightersContacts
firefightersContacts
=
ifirefightersContactsService
.
getOne
(
queryWrapper
);
FirefightersInfoDto
firefightersInfoDto
=
new
FirefightersInfoDto
(
firefighters
,
firefightersContacts
);
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
JSON
.
toJSON
(
firefightersInfoDto
),
time
);
return
ResponseHelper
.
buildResponse
(
firefightersInfoDto
);
}
}
/**
/**
* 岗位树,带统计
* 根据amos ID查询
*
*
* @param
* @return
* @return
*/
* @throws Exception
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
*/
@RequestMapping
(
value
=
"/getFirefighterByAmosUserId"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据AmosId查询"
,
notes
=
"根据AmosId查询"
)
@RequestMapping
(
value
=
"/getFirefightersJobTitleCount"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Object
>
selectByAmosId
()
{
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
Firefighters
firefighters
=
iFirefightersService
.
selectByAmosOrgId
(
Long
.
valueOf
(
getUserId
()));
public
ResponseModel
<
Object
>
getFirefightersJobTitleCount
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
firefighters
);
List
<
Menu
>
menus
=
iFirefightersService
.
getFirefightersJobTitleCount
();
}
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 列表详情展示
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表详情根据id查询"
,
notes
=
"列表详情根据id查询"
)
public
ResponseModel
<
Object
>
listToSelectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
))
{
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
Map
<
String
,
Object
>
firefighters
=
iFirefightersService
.
listToSelectById
(
id
);
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
,
JSON
.
toJSON
(
firefighters
),
time
);
return
ResponseHelper
.
buildResponse
(
firefighters
);
}
}
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
Firefighters
>
listPage
(
String
pageNum
,
String
pageSize
,
Firefighters
firefighters
)
{
Page
<
Firefighters
>
pageBean
;
QueryWrapper
<
Firefighters
>
firefightersQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
Firefighters
>
aClass
=
firefighters
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
firefighters
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
if
(!
name
.
equals
(
NameUtils
.
camel2Underline
(
"serialVersionUID"
)))
{
String
fileValue
=
(
String
)
field
.
get
(
firefighters
);
firefightersQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
});
IPage
<
Firefighters
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iFirefightersService
.
page
(
pageBean
,
firefightersQueryWrapper
);
return
page
;
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getFirefighters"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新列表分页查询"
,
notes
=
"新表分页查询"
)
public
ResponseModel
<
Page
<
FirefightersZhDto
>>
getFirefighters
(
Integer
pageNum
,
Integer
pageSize
,
FirefightersDto
firefighters
)
{
// 条件分页
if
(
null
==
pageNum
||
null
==
pageSize
)
{
pageNum
=
1
;
pageSize
=
Integer
.
MAX_VALUE
;
}
List
<
FirefightersZhDto
>
list
=
iFirefightersService
.
getFirefighters
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
firefighters
);
Map
<
String
,
Long
>
num
=
iFirefightersService
.
getFirefightersCount
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
firefighters
);
Page
<
FirefightersZhDto
>
pageBean
=
new
Page
<>(
pageNum
,
pageSize
,
num
.
get
(
"num"
));
pageBean
.
setRecords
(
list
);
return
ResponseHelper
.
buildResponse
(
pageBean
);
}
/**
* 岗位树,带统计
*
* @param
* @return
* @throws Exception
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getFirefightersJobTitleCount"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
Object
>
getFirefightersJobTitleCount
()
throws
Exception
{
List
<
Menu
>
menus
=
iFirefightersService
.
getFirefightersJobTitleCount
();
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
}
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