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
316b2127
Commit
316b2127
authored
Jun 22, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加缓存
parent
28b35ffd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
179 additions
and
70 deletions
+179
-70
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+16
-6
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+31
-15
AlertFormController.java
...s/boot/module/jcs/biz/controller/AlertFormController.java
+5
-2
DataDictionaryController.java
...t/module/jcs/biz/controller/DataDictionaryController.java
+5
-1
FirefightersContractController.java
...le/jcs/biz/controller/FirefightersContractController.java
+25
-9
FirefightersController.java
...oot/module/jcs/biz/controller/FirefightersController.java
+42
-20
FirefightersPostController.java
...module/jcs/biz/controller/FirefightersPostController.java
+29
-13
FirefightersThoughtController.java
...ule/jcs/biz/controller/FirefightersThoughtController.java
+26
-4
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
316b2127
...
@@ -8,10 +8,20 @@ package com.yeejoin.amos.boot.biz.common.utils;
...
@@ -8,10 +8,20 @@ package com.yeejoin.amos.boot.biz.common.utils;
*/
*/
public
class
RedisKey
{
public
class
RedisKey
{
//动态表单
//根据动态表单code获取动态表单列表
public
static
final
String
FORM
=
"form_"
;
public
static
final
String
FORM_CODE
=
"form_code_"
;
//数据字典
//根据字典code获取数据字典列表
public
static
final
String
DATADICTIONARY
=
"dataDictionary_"
;
public
static
final
String
DATA_DICTIONARY_CODE
=
"data_dictionary_code_"
;
//根据id获取消防人员基本信息
public
static
final
String
FIREFIGHTERS_ID
=
"firefighters_id_"
;
//根据id获取消防人员列表基本信息
public
static
final
String
FIREFIGHTERS_LIST_ID
=
"firefighters_id_list_"
;
//根据消防人员id查询岗位学历信息工作经历
public
static
final
String
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
=
"education_post_experience_firefighters_id_"
;
//根据合同信id 查询合同信息
public
static
final
String
CONTRACT_ID
=
"contract_id"
;
//根据思想状况信息id 查询思想信息
public
static
final
String
THOUGHT_ID
=
"thought_id"
;
//根据警情id查询警情详情记录
public
static
final
String
ALERTCALLED_ID
=
"alertcalled_id"
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
316b2127
...
@@ -16,9 +16,10 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -16,9 +16,10 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -26,7 +27,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -26,7 +27,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm
;
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.RedisUtils
;
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.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
@@ -54,7 +59,10 @@ public class AlertCalledController extends BaseController {
...
@@ -54,7 +59,10 @@ public class AlertCalledController extends BaseController {
IAlertCalledService
iAlertCalledService
;
IAlertCalledService
iAlertCalledService
;
@Autowired
@Autowired
IAlertFormValueService
iAlertFormValueService
;
IAlertFormValueService
iAlertFormValueService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增警情接警记录
* 新增警情接警记录
*
*
...
@@ -124,19 +132,27 @@ public class AlertCalledController extends BaseController {
...
@@ -124,19 +132,27 @@ public class AlertCalledController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
// 警情基本信息
AlertCalled
alertCalled
=
iAlertCalledService
.
getById
(
id
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
)){
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
return
CommonResponseUtil
.
success
(
obj
);
// 警情动态表单数据
}
else
{
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
// 警情基本信息
List
<
FormValue
>
formValue
=
new
ArrayList
();
AlertCalled
alertCalled
=
iAlertCalledService
.
getById
(
id
);
for
(
AlertFormValue
alertFormValue
:
list
)
{
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
isBlock
());
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
formValue
.
add
(
value
);
// 警情动态表单数据
}
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
AlertCalledFormVo
alertCalledFormVo
=
new
AlertCalledFormVo
(
alertCalled
,
formValue
);
List
<
FormValue
>
formValue
=
new
ArrayList
();
return
CommonResponseUtil
.
success
(
alertCalledFormVo
);
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
isBlock
());
formValue
.
add
(
value
);
}
AlertCalledFormVo
alertCalledFormVo
=
new
AlertCalledFormVo
(
alertCalled
,
formValue
);
redisUtils
.
set
(
RedisKey
.
ALERTCALLED_ID
+
id
,
JSON
.
toJSON
(
alertCalledFormVo
),
time
);
return
CommonResponseUtil
.
success
(
alertCalledFormVo
);
}
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertFormController.java
View file @
316b2127
...
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -51,6 +52,8 @@ public class AlertFormController extends BaseController {
...
@@ -51,6 +52,8 @@ public class AlertFormController extends BaseController {
FormList
FormList
;
FormList
FormList
;
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增警情表单
* 新增警情表单
* @return
* @return
...
@@ -116,7 +119,7 @@ public class AlertFormController extends BaseController {
...
@@ -116,7 +119,7 @@ public class AlertFormController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据表态类型code查询表单数据项"
,
notes
=
"根据表态类型code查询表单数据项"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据表态类型code查询表单数据项"
,
notes
=
"根据表态类型code查询表单数据项"
)
public
ResponseModel
selectFormdItem
(
HttpServletRequest
request
,
@PathVariable
String
code
){
public
ResponseModel
selectFormdItem
(
HttpServletRequest
request
,
@PathVariable
String
code
){
List
<
AlertFormVo
>
list
=
new
ArrayList
<
AlertFormVo
>();
List
<
AlertFormVo
>
list
=
new
ArrayList
<
AlertFormVo
>();
if
(
redisUtils
.
hasKey
(
RedisKey
.
FORM_CODE
+
code
)){
if
(
redisUtils
.
hasKey
(
RedisKey
.
FORM_CODE
+
code
)){
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FORM_CODE
+
code
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FORM_CODE
+
code
);
return
CommonResponseUtil
.
success
(
obj
);
return
CommonResponseUtil
.
success
(
obj
);
}
else
{
}
else
{
...
@@ -125,7 +128,7 @@ public class AlertFormController extends BaseController {
...
@@ -125,7 +128,7 @@ public class AlertFormController extends BaseController {
//警情动态表单数据
//警情动态表单数据
List
<
AlertForm
>
alertFormValue
=
iAlertFormService
.
list
(
queryWrapper
);
List
<
AlertForm
>
alertFormValue
=
iAlertFormService
.
list
(
queryWrapper
);
list
=
FormList
.
getFormlist
(
alertFormValue
);
list
=
FormList
.
getFormlist
(
alertFormValue
);
redisUtils
.
set
(
RedisKey
.
FORM_CODE
+
code
,
JSON
.
toJSON
(
list
),
86400
);
redisUtils
.
set
(
RedisKey
.
FORM_CODE
+
code
,
JSON
.
toJSON
(
list
),
time
);
return
CommonResponseUtil
.
success
(
list
);
return
CommonResponseUtil
.
success
(
list
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/DataDictionaryController.java
View file @
316b2127
...
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -49,6 +50,9 @@ public class DataDictionaryController extends BaseController {
...
@@ -49,6 +50,9 @@ public class DataDictionaryController extends BaseController {
IDataDictionaryService
iDataDictionaryService
;
IDataDictionaryService
iDataDictionaryService
;
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增数据字典
* 新增数据字典
* @return
* @return
...
@@ -164,7 +168,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -164,7 +168,7 @@ public class DataDictionaryController extends BaseController {
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
"getParent"
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
"getParent"
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
86400
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
return
CommonResponseUtil
.
success
(
menus
);
return
CommonResponseUtil
.
success
(
menus
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersContractController.java
View file @
316b2127
...
@@ -5,8 +5,15 @@ import java.util.List;
...
@@ -5,8 +5,15 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -43,7 +50,10 @@ public class FirefightersContractController extends BaseController {
...
@@ -43,7 +50,10 @@ public class FirefightersContractController extends BaseController {
@Autowired
@Autowired
IFirefightersContractService
iFirefightersContractService
;
IFirefightersContractService
iFirefightersContractService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增消防员合同
* 新增消防员合同
* @return
* @return
...
@@ -52,12 +62,8 @@ public class FirefightersContractController extends BaseController {
...
@@ -52,12 +62,8 @@ public class FirefightersContractController extends BaseController {
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员合同"
,
notes
=
"新增消防员合同"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员合同"
,
notes
=
"新增消防员合同"
)
public
ResponseModel
saveFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
public
ResponseModel
saveFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
boolean
flag
=
iFirefightersContractService
.
save
(
firefightersContract
);
boolean
flag
=
iFirefightersContractService
.
save
(
firefightersContract
);
return
CommonResponseUtil
.
success
(
firefightersContract
);
return
CommonResponseUtil
.
success
(
firefightersContract
);
}
}
/**
/**
...
@@ -73,6 +79,8 @@ public class FirefightersContractController extends BaseController {
...
@@ -73,6 +79,8 @@ public class FirefightersContractController extends BaseController {
List
<
String
>
ids
=
Arrays
.
asList
(
str
);
List
<
String
>
ids
=
Arrays
.
asList
(
str
);
for
(
String
sequenceNbr
:
ids
)
{
for
(
String
sequenceNbr
:
ids
)
{
iFirefightersContractService
.
update
(
new
UpdateWrapper
<
FirefightersContract
>().
eq
(
"sequence_nbr"
,
Long
.
valueOf
(
sequenceNbr
)).
set
(
"is_delete"
,
1
));
iFirefightersContractService
.
update
(
new
UpdateWrapper
<
FirefightersContract
>().
eq
(
"sequence_nbr"
,
Long
.
valueOf
(
sequenceNbr
)).
set
(
"is_delete"
,
1
));
//删除缓存
redisUtils
.
del
(
RedisKey
.
CONTRACT_ID
+
sequenceNbr
);
}
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
@@ -90,6 +98,8 @@ public class FirefightersContractController extends BaseController {
...
@@ -90,6 +98,8 @@ public class FirefightersContractController extends BaseController {
public
ResponseModel
updateByIdFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
public
ResponseModel
updateByIdFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
boolean
flag
=
iFirefightersContractService
.
updateById
(
firefightersContract
);
boolean
flag
=
iFirefightersContractService
.
updateById
(
firefightersContract
);
if
(
flag
)
{
if
(
flag
)
{
//删除缓存
redisUtils
.
del
(
RedisKey
.
CONTRACT_ID
+
firefightersContract
.
getSequenceNbr
());
return
CommonResponseUtil
.
success
(
firefightersContract
);
return
CommonResponseUtil
.
success
(
firefightersContract
);
}
}
return
CommonResponseUtil
.
failure
(
"修改失败!"
);
return
CommonResponseUtil
.
failure
(
"修改失败!"
);
...
@@ -107,8 +117,14 @@ public class FirefightersContractController extends BaseController {
...
@@ -107,8 +117,14 @@ public class FirefightersContractController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
FirefightersContract
firefightersContract
=
iFirefightersContractService
.
getById
(
id
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
CONTRACT_ID
+
id
)){
return
CommonResponseUtil
.
success
(
firefightersContract
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
CONTRACT_ID
+
id
);
return
CommonResponseUtil
.
success
(
obj
);
}
else
{
FirefightersContract
firefightersContract
=
iFirefightersContractService
.
getById
(
id
);
redisUtils
.
set
(
RedisKey
.
CONTRACT_ID
+
id
,
JSON
.
toJSON
(
firefightersContract
),
time
);
return
CommonResponseUtil
.
success
(
firefightersContract
);
}
}
}
...
...
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 @
316b2127
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
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.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContract
;
...
@@ -27,6 +27,7 @@ import io.swagger.annotations.Api;
...
@@ -27,6 +27,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -68,7 +69,11 @@ public class FirefightersController extends BaseController {
...
@@ -68,7 +69,11 @@ public class FirefightersController extends BaseController {
IFirefightersContractService
iFirefightersContractService
;
IFirefightersContractService
iFirefightersContractService
;
@Autowired
@Autowired
IFirefightersJacketService
iFirefightersJacketService
;
IFirefightersJacketService
iFirefightersJacketService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增消防队员
* 新增消防队员
* @return
* @return
...
@@ -110,8 +115,10 @@ public class FirefightersController extends BaseController {
...
@@ -110,8 +115,10 @@ public class FirefightersController extends BaseController {
ifirefightersEducationService
.
update
(
new
UpdateWrapper
<
FirefightersEducation
>().
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
));
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
));
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
));
iFirefightersJacketService
.
update
(
new
UpdateWrapper
<
FirefightersJacket
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
return
CommonResponseUtil
.
success
();
//删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -129,11 +136,14 @@ public class FirefightersController extends BaseController {
...
@@ -129,11 +136,14 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防队员"
,
notes
=
"修改消防队员"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防队员"
,
notes
=
"修改消防队员"
)
@Transactional
public
ResponseModel
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersVo
firefighters
){
public
ResponseModel
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersVo
firefighters
){
iFirefightersService
.
updateById
(
firefighters
.
getFirefighters
());
Firefighters
firefighter
=
firefighters
.
getFirefighters
();
ifirefightersContactsService
.
updateById
(
firefighters
.
getFirefightersContacts
());
iFirefightersService
.
updateById
(
firefighter
);
return
CommonResponseUtil
.
success
();
ifirefightersContactsService
.
updateById
(
firefighters
.
getFirefightersContacts
());
//删除缓存
redisUtils
.
del
(
RedisKey
.
FIREFIGHTERS_ID
+
firefighter
.
getSequenceNbr
(),
RedisKey
.
FIREFIGHTERS_LIST_ID
+
firefighter
.
getSequenceNbr
());
return
CommonResponseUtil
.
success
();
}
}
...
@@ -147,14 +157,20 @@ public class FirefightersController extends BaseController {
...
@@ -147,14 +157,20 @@ public class FirefightersController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
Firefighters
firefighters
=
iFirefightersService
.
getById
(
id
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_ID
+
id
)){
@SuppressWarnings
(
"rawtypes"
)
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_ID
+
id
);
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
return
CommonResponseUtil
.
success
(
obj
);
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
}
else
{
FirefightersContacts
firefightersContacts
=
ifirefightersContactsService
.
getOne
(
queryWrapper
);
Firefighters
firefighters
=
iFirefightersService
.
getById
(
id
);
FirefightersVo
firefightersVo
=
new
FirefightersVo
(
firefighters
,
firefightersContacts
);
@SuppressWarnings
(
"rawtypes"
)
return
CommonResponseUtil
.
success
(
firefightersVo
);
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersContacts
firefightersContacts
=
ifirefightersContactsService
.
getOne
(
queryWrapper
);
FirefightersVo
firefightersVo
=
new
FirefightersVo
(
firefighters
,
firefightersContacts
);
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_ID
+
id
,
JSON
.
toJSON
(
firefightersVo
),
time
);
return
CommonResponseUtil
.
success
(
firefightersVo
);
}
}
}
/**
/**
...
@@ -165,9 +181,15 @@ public class FirefightersController extends BaseController {
...
@@ -165,9 +181,15 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表详情根据id查询"
,
notes
=
"列表详情根据id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表详情根据id查询"
,
notes
=
"列表详情根据id查询"
)
public
ResponseModel
listToSelectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
listToSelectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
Map
<
String
,
Object
>
firefighters
=
iFirefightersService
.
listToSelectById
(
id
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
)){
return
CommonResponseUtil
.
success
(
firefighters
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
);
return
CommonResponseUtil
.
success
(
obj
);
}
else
{
Map
<
String
,
Object
>
firefighters
=
iFirefightersService
.
listToSelectById
(
id
);
redisUtils
.
set
(
RedisKey
.
FIREFIGHTERS_LIST_ID
+
id
,
JSON
.
toJSON
(
firefighters
),
time
);
return
CommonResponseUtil
.
success
(
firefighters
);
}
}
}
/**
/**
* 列表分页查询
* 列表分页查询
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersPostController.java
View file @
316b2127
...
@@ -3,8 +3,14 @@ import java.util.Arrays;
...
@@ -3,8 +3,14 @@ import java.util.Arrays;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -22,9 +28,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -22,9 +28,6 @@ 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.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersWorkexperience
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersContactsService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersContactsService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersEducationService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersEducationService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersPostService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersPostService
;
...
@@ -54,6 +57,10 @@ public class FirefightersPostController extends BaseController {
...
@@ -54,6 +57,10 @@ public class FirefightersPostController extends BaseController {
IFirefightersEducationService
ifirefightersEducationService
;
IFirefightersEducationService
ifirefightersEducationService
;
@Autowired
@Autowired
IFirefightersWorkexperienceService
ifirefightersWorkexperienceService
;
IFirefightersWorkexperienceService
ifirefightersWorkexperienceService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增岗位信息
* 新增岗位信息
* @return
* @return
...
@@ -82,6 +89,8 @@ public class FirefightersPostController extends BaseController {
...
@@ -82,6 +89,8 @@ public class FirefightersPostController extends BaseController {
iFirefightersPostService
.
update
(
new
UpdateWrapper
<
FirefightersPost
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
iFirefightersPostService
.
update
(
new
UpdateWrapper
<
FirefightersPost
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersWorkexperienceService
.
update
(
new
UpdateWrapper
<
FirefightersWorkexperience
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersWorkexperienceService
.
update
(
new
UpdateWrapper
<
FirefightersWorkexperience
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersEducationService
.
update
(
new
UpdateWrapper
<
FirefightersEducation
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
ifirefightersEducationService
.
update
(
new
UpdateWrapper
<
FirefightersEducation
>().
eq
(
"firefighters_id"
,
id
).
set
(
"is_delete"
,
1
));
//删除缓存
redisUtils
.
del
(
RedisKey
.
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
+
id
);
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
@@ -95,12 +104,14 @@ public class FirefightersPostController extends BaseController {
...
@@ -95,12 +104,14 @@ public class FirefightersPostController extends BaseController {
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改岗位信息"
,
notes
=
"修改岗位信息"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改岗位信息"
,
notes
=
"修改岗位信息"
)
public
ResponseModel
updateByIdFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersData
firefightersData
){
public
ResponseModel
updateByIdFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersData
firefightersData
){
FirefightersPost
firefightersPost
=
firefightersData
.
getFirefightersPost
();
iFirefightersPostService
.
updateById
(
firefighters
Data
.
getFirefightersPost
()
);
iFirefightersPostService
.
updateById
(
firefighters
Post
);
ifirefightersWorkexperienceService
.
updateById
(
firefightersData
.
getFirefightersWorkexperience
());
ifirefightersWorkexperienceService
.
updateById
(
firefightersData
.
getFirefightersWorkexperience
());
ifirefightersEducationService
.
updateById
(
firefightersData
.
getFirefightersEducation
());
ifirefightersEducationService
.
updateById
(
firefightersData
.
getFirefightersEducation
());
return
CommonResponseUtil
.
success
();
//删除缓存
redisUtils
.
del
(
RedisKey
.
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
+
firefightersPost
.
getSequenceNbr
());
return
CommonResponseUtil
.
success
();
}
}
...
@@ -116,12 +127,17 @@ public class FirefightersPostController extends BaseController {
...
@@ -116,12 +127,17 @@ public class FirefightersPostController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据消防员id查询"
,
notes
=
"根据消防员id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据消防员id查询"
,
notes
=
"根据消防员id查询"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
if
(
redisUtils
.
hasKey
(
RedisKey
.
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
+
id
)){
@SuppressWarnings
(
"rawtypes"
)
Object
obj
=
redisUtils
.
get
(
RedisKey
.
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
+
id
);
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
return
CommonResponseUtil
.
success
(
obj
);
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
}
else
{
FirefightersData
firefightersData
=
new
FirefightersData
(
ifirefightersWorkexperienceService
.
getOne
(
queryWrapper
),
ifirefightersEducationService
.
getOne
(
queryWrapper
),
iFirefightersPostService
.
getOne
(
queryWrapper
));
@SuppressWarnings
(
"rawtypes"
)
return
CommonResponseUtil
.
success
(
firefightersData
);
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersData
firefightersData
=
new
FirefightersData
(
ifirefightersWorkexperienceService
.
getOne
(
queryWrapper
),
ifirefightersEducationService
.
getOne
(
queryWrapper
),
iFirefightersPostService
.
getOne
(
queryWrapper
));
redisUtils
.
set
(
RedisKey
.
EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID
+
id
,
JSON
.
toJSON
(
firefightersData
),
time
);
return
CommonResponseUtil
.
success
(
firefightersData
);
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersThoughtController.java
View file @
316b2127
...
@@ -5,8 +5,15 @@ import java.util.List;
...
@@ -5,8 +5,15 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -43,7 +50,10 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -43,7 +50,10 @@ public class FirefightersThoughtController extends BaseController {
@Autowired
@Autowired
IFirefightersThoughtService
iFirefightersThoughtService
;
IFirefightersThoughtService
iFirefightersThoughtService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
/**
* 新增消防员思想谈话记录
* 新增消防员思想谈话记录
* @return
* @return
...
@@ -70,7 +80,9 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -70,7 +80,9 @@ public class FirefightersThoughtController extends BaseController {
List
<
String
>
ids
=
Arrays
.
asList
(
str
);
List
<
String
>
ids
=
Arrays
.
asList
(
str
);
for
(
String
sequenceNbr
:
ids
)
{
for
(
String
sequenceNbr
:
ids
)
{
iFirefightersThoughtService
.
update
(
new
UpdateWrapper
<
FirefightersThought
>().
eq
(
"sequence_nbr"
,
Long
.
valueOf
(
sequenceNbr
)).
set
(
"is_delete"
,
1
));
iFirefightersThoughtService
.
update
(
new
UpdateWrapper
<
FirefightersThought
>().
eq
(
"sequence_nbr"
,
Long
.
valueOf
(
sequenceNbr
)).
set
(
"is_delete"
,
1
));
}
//删除缓存
redisUtils
.
del
(
RedisKey
.
THOUGHT_ID
+
sequenceNbr
);
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
@@ -86,6 +98,8 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -86,6 +98,8 @@ public class FirefightersThoughtController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防员思想谈话记录"
,
notes
=
"修改消防员思想谈话记录"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改消防员思想谈话记录"
,
notes
=
"修改消防员思想谈话记录"
)
public
ResponseModel
updateByIdFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
public
ResponseModel
updateByIdFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
boolean
flag
=
iFirefightersThoughtService
.
updateById
(
firefightersThought
);
boolean
flag
=
iFirefightersThoughtService
.
updateById
(
firefightersThought
);
//删除缓存
redisUtils
.
del
(
RedisKey
.
THOUGHT_ID
+
firefightersThought
.
getSequenceNbr
());
return
CommonResponseUtil
.
success
(
firefightersThought
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
}
}
...
@@ -102,8 +116,16 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -102,8 +116,16 @@ public class FirefightersThoughtController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据消防员id查询"
,
notes
=
"根据消防员id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据消防员id查询"
,
notes
=
"根据消防员id查询"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
FirefightersThought
firefightersThought
=
iFirefightersThoughtService
.
getById
(
id
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
THOUGHT_ID
+
id
)){
Object
obj
=
redisUtils
.
get
(
RedisKey
.
THOUGHT_ID
+
id
);
return
CommonResponseUtil
.
success
(
obj
);
}
else
{
FirefightersThought
firefightersThought
=
iFirefightersThoughtService
.
getById
(
id
);
redisUtils
.
set
(
RedisKey
.
THOUGHT_ID
+
id
,
JSON
.
toJSON
(
firefightersThought
),
time
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
}
}
}
...
...
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