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
cbb9f187
Commit
cbb9f187
authored
Jun 10, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础信息接口
parent
b5db5ef9
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
428 additions
and
76 deletions
+428
-76
DataDictionaryController.java
...t/module/jcs/biz/controller/DataDictionaryController.java
+137
-0
FireTeamController.java
...os/boot/module/jcs/biz/controller/FireTeamController.java
+60
-7
FirefightersContractController.java
...le/jcs/biz/controller/FirefightersContractController.java
+27
-8
FirefightersController.java
...oot/module/jcs/biz/controller/FirefightersController.java
+100
-12
FirefightersJacketController.java
...dule/jcs/biz/controller/FirefightersJacketController.java
+34
-23
FirefightersPostController.java
...module/jcs/biz/controller/FirefightersPostController.java
+41
-11
FirefightersThoughtController.java
...ule/jcs/biz/controller/FirefightersThoughtController.java
+27
-14
UserController.java
...n/amos/boot/module/jcs/biz/controller/UserController.java
+2
-1
No files found.
amos-boot-biz-common/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
0 → 100644
View file @
cbb9f187
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IDataDictionaryService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
/**
* 数据字典
*
* @author tb
* @date 2021-06-07
*/
@RestController
@Api
(
tags
=
"数据字典Api"
)
@RequestMapping
(
value
=
"/jcs/data-dictionary"
)
public
class
DataDictionaryController
extends
BaseController
{
@Autowired
IDataDictionaryService
iDataDictionaryService
;
/**
* 新增数据字典
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增数据字典"
,
notes
=
"新增数据字典"
)
public
boolean
saveDataDictionary
(
HttpServletRequest
request
,
@RequestBody
DataDictionary
dataDictionary
){
return
iDataDictionaryService
.
save
(
dataDictionary
);
}
/**
* 根据id删除
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iDataDictionaryService
.
removeById
(
id
);
}
/**
* 修改数据字典
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改数据字典"
,
notes
=
"修改数据字典"
)
public
boolean
updateByIdDataDictionary
(
HttpServletRequest
request
,
@RequestBody
DataDictionary
dataDictionary
){
return
iDataDictionaryService
.
updateById
(
dataDictionary
);
}
/**
* 根据id查询
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
DataDictionary
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iDataDictionaryService
.
getById
(
id
);
}
/**
* 列表分页查询
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
DataDictionary
>
listPage
(
String
pageNum
,
String
pageSize
,
DataDictionary
dataDictionary
){
Page
<
DataDictionary
>
pageBean
;
QueryWrapper
<
DataDictionary
>
dataDictionaryQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
DataDictionary
>
aClass
=
dataDictionary
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
dataDictionary
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
dataDictionary
);
dataDictionaryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
dataDictionary
);
dataDictionaryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
dataDictionary
);
dataDictionaryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
dataDictionary
);
dataDictionaryQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
DataDictionary
>
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
=
iDataDictionaryService
.
page
(
pageBean
,
dataDictionaryQueryWrapper
);
return
page
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FireTeamController.java
View file @
cbb9f187
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.IFireTeamService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersListVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.Menu
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TreeParser
;
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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.FireTeam
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -54,8 +67,9 @@ public class FireTeamController extends BaseController {
...
@@ -54,8 +67,9 @@ public class FireTeamController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFireTeamService
.
removeById
(
id
);
iFireTeamService
.
update
(
new
UpdateWrapper
<
FireTeam
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
1
));
return
CommonResponseUtil
.
success
();
}
}
...
@@ -68,8 +82,10 @@ public class FireTeamController extends BaseController {
...
@@ -68,8 +82,10 @@ public class FireTeamController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFireTeam
(
HttpServletRequest
request
,
@RequestBody
FireTeam
fireTeam
){
public
ResponseModel
updateByIdFireTeam
(
HttpServletRequest
request
,
@RequestBody
FireTeam
fireTeam
){
return
iFireTeamService
.
updateById
(
fireTeam
);
boolean
flag
=
iFireTeamService
.
updateById
(
fireTeam
);
return
CommonResponseUtil
.
success
();
}
}
...
@@ -88,6 +104,43 @@ public class FireTeamController extends BaseController {
...
@@ -88,6 +104,43 @@ public class FireTeamController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新列表分页查询"
,
notes
=
"新表分页查询"
)
public
ResponseModel
getFirefighters
(
Integer
pageNum
,
Integer
pageSize
,
FireTeamListVo
fireTeamList
){
//条件分页
List
<
FireTeamVo
>
list
=
iFireTeamService
.
getFireTeam
(
pageNum
,
pageSize
,
fireTeamList
);
Map
<
String
,
Long
>
num
=
iFireTeamService
.
getFireTeamCount
(
pageNum
,
pageSize
,
fireTeamList
);
Page
<
FireTeamVo
>
pageBean
=
new
Page
<>(
pageNum
,
pageSize
,
num
.
get
(
"num"
));
pageBean
.
setRecords
(
list
);
return
CommonResponseUtil
.
success
(
pageBean
);
}
/**
* 列表分页查询
* @return
* @throws Exception
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/listTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"队伍树"
,
notes
=
"队伍树"
)
public
ResponseModel
listTree
()
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"is_delete"
,
0
);
Collection
<
FireTeam
>
list
=
iFireTeamService
.
listByMap
(
columnMap
);
FireTeam
ll
=
new
FireTeam
();
//List<Menu> menus=TreeParser.getTree(null,list);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
3
,
"getName"
,
"getParent"
);
return
CommonResponseUtil
.
success
(
menus
);
}
/**
/**
* 列表分页查询
* 列表分页查询
* @return
* @return
...
...
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 @
cbb9f187
...
@@ -15,8 +15,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -15,8 +15,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.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersThought
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -42,8 +45,13 @@ public class FirefightersContractController extends BaseController {
...
@@ -42,8 +45,13 @@ public class FirefightersContractController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员合同"
,
notes
=
"新增消防员合同"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员合同"
,
notes
=
"新增消防员合同"
)
public
boolean
saveFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
public
ResponseModel
saveFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
return
iFirefightersContractService
.
save
(
firefightersContract
);
boolean
flag
=
iFirefightersContractService
.
save
(
firefightersContract
);
return
CommonResponseUtil
.
success
(
firefightersContract
);
}
}
/**
/**
...
@@ -54,8 +62,9 @@ public class FirefightersContractController extends BaseController {
...
@@ -54,8 +62,9 @@ public class FirefightersContractController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersContractService
.
removeById
(
id
);
boolean
flag
=
iFirefightersContractService
.
removeById
(
id
);
return
CommonResponseUtil
.
success
();
}
}
...
@@ -68,8 +77,13 @@ public class FirefightersContractController extends BaseController {
...
@@ -68,8 +77,13 @@ public class FirefightersContractController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
public
ResponseModel
updateByIdFirefightersContract
(
HttpServletRequest
request
,
@RequestBody
FirefightersContract
firefightersContract
){
return
iFirefightersContractService
.
updateById
(
firefightersContract
);
boolean
flag
=
iFirefightersContractService
.
updateById
(
firefightersContract
);
if
(
flag
)
{
return
CommonResponseUtil
.
success
(
firefightersContract
);
}
return
CommonResponseUtil
.
failure
(
"修改失败!"
);
}
}
...
@@ -82,8 +96,13 @@ public class FirefightersContractController extends BaseController {
...
@@ -82,8 +96,13 @@ public class FirefightersContractController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@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
FirefightersContract
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersContractService
.
getById
(
id
);
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefightersId"
,
id
);
FirefightersContract
firefightersContract
=
iFirefightersContractService
.
getOne
(
queryWrapper
);
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 @
cbb9f187
...
@@ -5,22 +5,43 @@ import io.swagger.annotations.Api;
...
@@ -5,22 +5,43 @@ import io.swagger.annotations.Api;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
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.IFirefightersContactsService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersContractService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersEducationService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersJacketService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersPostService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersThoughtService
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersListVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersVo
;
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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.FireTeam
;
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.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersThought
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -36,6 +57,18 @@ public class FirefightersController extends BaseController {
...
@@ -36,6 +57,18 @@ public class FirefightersController extends BaseController {
@Autowired
@Autowired
IFirefightersService
iFirefightersService
;
IFirefightersService
iFirefightersService
;
@Autowired
IFirefightersPostService
iFirefightersPostService
;
@Autowired
IFirefightersContactsService
ifirefightersContactsService
;
@Autowired
IFirefightersEducationService
ifirefightersEducationService
;
@Autowired
IFirefightersThoughtService
iFirefightersThoughtService
;
@Autowired
IFirefightersContractService
iFirefightersContractService
;
@Autowired
IFirefightersJacketService
iFirefightersJacketService
;
/**
/**
* 新增消防队员
* 新增消防队员
...
@@ -44,8 +77,10 @@ public class FirefightersController extends BaseController {
...
@@ -44,8 +77,10 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防队员"
,
notes
=
"新增消防队员"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防队员"
,
notes
=
"新增消防队员"
)
public
boolean
saveFirefighters
(
HttpServletRequest
request
,
@RequestBody
Firefighters
firefighters
){
public
ResponseModel
saveFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersVo
firefighters
){
return
iFirefightersService
.
save
(
firefighters
);
iFirefightersService
.
save
(
firefighters
.
getFirefighters
());
ifirefightersContactsService
.
save
(
firefighters
.
getFirefightersContacts
());
return
CommonResponseUtil
.
success
();
}
}
/**
/**
...
@@ -56,8 +91,30 @@ public class FirefightersController extends BaseController {
...
@@ -56,8 +91,30 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
@Transactional
return
iFirefightersService
.
removeById
(
id
);
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
try
{
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersJacket
firefightersJacket
=
iFirefightersJacketService
.
getOne
(
queryWrapper
);
if
(
firefightersJacket
!=
null
)
{
return
CommonResponseUtil
.
failure
(
"该消防还有在装装备!"
);
}
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
));
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"删除失败!"
);
}
}
}
...
@@ -70,8 +127,11 @@ public class FirefightersController extends BaseController {
...
@@ -70,8 +127,11 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
Firefighters
firefighters
){
public
ResponseModel
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersVo
firefighters
){
return
iFirefightersService
.
updateById
(
firefighters
);
iFirefightersService
.
updateById
(
firefighters
.
getFirefighters
());
ifirefightersContactsService
.
updateById
(
firefighters
.
getFirefightersContacts
());
return
CommonResponseUtil
.
success
();
}
}
...
@@ -84,17 +144,34 @@ public class FirefightersController extends BaseController {
...
@@ -84,17 +144,34 @@ public class FirefightersController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@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
Firefighters
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersService
.
getById
(
id
);
Firefighters
firefighters
=
iFirefightersService
.
getById
(
id
);
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersContacts
firefightersContacts
=
ifirefightersContactsService
.
getOne
(
queryWrapper
);
FirefightersVo
firefightersVo
=
new
FirefightersVo
(
firefighters
,
firefightersContacts
);
return
CommonResponseUtil
.
success
(
firefightersVo
);
}
}
/**
* 列表详情展示
*
* */
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表详情根据id查询"
,
notes
=
"列表详情根据id查询"
)
public
ResponseModel
listToSelectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
Map
<
String
,
Object
>
firefighters
=
iFirefightersService
.
listToSelectById
(
id
);
return
CommonResponseUtil
.
success
(
firefighters
);
}
/**
/**
* 列表分页查询
* 列表分页查询
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
tru
e
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
fals
e
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
Firefighters
>
listPage
(
String
pageNum
,
String
pageSize
,
Firefighters
firefighters
){
public
IPage
<
Firefighters
>
listPage
(
String
pageNum
,
String
pageSize
,
Firefighters
firefighters
){
...
@@ -134,5 +211,16 @@ public class FirefightersController extends BaseController {
...
@@ -134,5 +211,16 @@ public class FirefightersController extends BaseController {
page
=
iFirefightersService
.
page
(
pageBean
,
firefightersQueryWrapper
);
page
=
iFirefightersService
.
page
(
pageBean
,
firefightersQueryWrapper
);
return
page
;
return
page
;
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getFirefighters"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新列表分页查询"
,
notes
=
"新表分页查询"
)
public
ResponseModel
getFirefighters
(
Integer
pageNum
,
Integer
pageSize
,
FirefightersListVo
firefighters
){
//条件分页
List
<
Firefighters
>
list
=
iFirefightersService
.
getFirefighters
(
pageNum
,
pageSize
,
firefighters
);
Map
<
String
,
Long
>
num
=
iFirefightersService
.
getFirefightersCount
(
pageNum
,
pageSize
,
firefighters
);
Page
<
Firefighters
>
pageBean
=
new
Page
<>(
pageNum
,
pageSize
,
num
.
get
(
"num"
));
pageBean
.
setRecords
(
list
);
return
CommonResponseUtil
.
success
(
pageBean
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersJacketController.java
View file @
cbb9f187
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -14,19 +15,21 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -14,19 +15,21 @@ import javax.servlet.http.HttpServletRequest;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.FirefightersContract
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
/**
* 消防人员配装记录
* 消防人员配装记录
*
*
* @author tb
* @author tb
* @date 2021-06-07
* @date 2021-06-07
*/
*/
@RestController
@RestController
@Api
(
tags
=
"消防人员配装记录Api"
)
@Api
(
tags
=
"消防人员配装记录Api"
)
@RequestMapping
(
value
=
"/jcs/firefighters-jacket"
)
@RequestMapping
(
value
=
"/jcs/firefighters-jacket"
)
...
@@ -37,65 +40,74 @@ public class FirefightersJacketController extends BaseController {
...
@@ -37,65 +40,74 @@ public class FirefightersJacketController extends BaseController {
/**
/**
* 新增消防人员配装记录
* 新增消防人员配装记录
*
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防人员配装记录"
,
notes
=
"新增消防人员配装记录"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防人员配装记录"
,
notes
=
"新增消防人员配装记录"
)
public
boolean
saveFirefightersJacket
(
HttpServletRequest
request
,
@RequestBody
FirefightersJacket
firefightersJacket
){
public
ResponseModel
saveFirefightersJacket
(
HttpServletRequest
request
,
return
iFirefightersJacketService
.
save
(
firefightersJacket
);
@RequestBody
FirefightersJacket
firefightersJacket
)
{
boolean
flag
=
iFirefightersJacketService
.
save
(
firefightersJacket
);
return
CommonResponseUtil
.
success
(
firefightersJacket
);
}
}
/**
/**
* 根据id删除
* 根据id删除
*
* @param id
* @param id
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iFirefightersJacketService
.
removeById
(
id
);
}
boolean
flag
=
iFirefightersJacketService
.
removeById
(
id
);
return
CommonResponseUtil
.
success
();
}
/**
/**
* 修改消防人员配装记录
* 修改消防人员配装记录
*
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFirefightersJacket
(
HttpServletRequest
request
,
@RequestBody
FirefightersJacket
firefightersJacket
){
public
ResponseModel
updateByIdFirefightersJacket
(
HttpServletRequest
request
,
return
iFirefightersJacketService
.
updateById
(
firefightersJacket
);
@RequestBody
FirefightersJacket
firefightersJacket
)
{
boolean
flag
=
iFirefightersJacketService
.
updateById
(
firefightersJacket
);
return
CommonResponseUtil
.
success
(
firefightersJacket
);
}
}
/**
/**
* 根据id查询
* 根据id查询
*
* @param id
* @param id
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@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
FirefightersJacket
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iFirefightersJacketService
.
getById
(
id
);
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersJacket
firefightersJacket
=
iFirefightersJacketService
.
getOne
(
queryWrapper
);
return
CommonResponseUtil
.
success
(
firefightersJacket
);
}
}
/**
/**
* 列表分页查询
* 列表分页查询
*
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
FirefightersJacket
>
listPage
(
String
pageNum
,
String
pageSize
,
FirefightersJacket
firefightersJacket
)
{
public
IPage
<
FirefightersJacket
>
listPage
(
String
pageNum
,
String
pageSize
,
FirefightersJacket
firefightersJacket
)
{
Page
<
FirefightersJacket
>
pageBean
;
Page
<
FirefightersJacket
>
pageBean
;
QueryWrapper
<
FirefightersJacket
>
firefightersJacketQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FirefightersJacket
>
firefightersJacketQueryWrapper
=
new
QueryWrapper
<>();
...
@@ -133,5 +145,4 @@ public class FirefightersJacketController extends BaseController {
...
@@ -133,5 +145,4 @@ public class FirefightersJacketController extends BaseController {
page
=
iFirefightersJacketService
.
page
(
pageBean
,
firefightersJacketQueryWrapper
);
page
=
iFirefightersJacketService
.
page
(
pageBean
,
firefightersJacketQueryWrapper
);
return
page
;
return
page
;
}
}
}
}
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 @
cbb9f187
...
@@ -5,18 +5,27 @@ import io.swagger.annotations.Api;
...
@@ -5,18 +5,27 @@ import io.swagger.annotations.Api;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
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.IFirefightersContactsService
;
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
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFirefightersWorkexperienceService
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersData
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
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.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.FirefightersContacts
;
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.FirefightersPost
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -34,7 +43,12 @@ public class FirefightersPostController extends BaseController {
...
@@ -34,7 +43,12 @@ public class FirefightersPostController extends BaseController {
@Autowired
@Autowired
IFirefightersPostService
iFirefightersPostService
;
IFirefightersPostService
iFirefightersPostService
;
@Autowired
IFirefightersContactsService
ifirefightersContactsService
;
@Autowired
IFirefightersEducationService
ifirefightersEducationService
;
@Autowired
IFirefightersWorkexperienceService
ifirefightersWorkexperienceService
;
/**
/**
* 新增岗位信息
* 新增岗位信息
* @return
* @return
...
@@ -42,8 +56,13 @@ public class FirefightersPostController extends BaseController {
...
@@ -42,8 +56,13 @@ public class FirefightersPostController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增岗位信息"
,
notes
=
"新增岗位信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增岗位信息"
,
notes
=
"新增岗位信息"
)
public
boolean
saveFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersPost
firefightersPost
){
@Transactional
return
iFirefightersPostService
.
save
(
firefightersPost
);
public
ResponseModel
saveFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersData
firefightersData
){
iFirefightersPostService
.
save
(
firefightersData
.
getFirefightersPost
());
ifirefightersWorkexperienceService
.
save
(
firefightersData
.
getFirefightersWorkexperience
());
ifirefightersEducationService
.
save
(
firefightersData
.
getFirefightersEducation
())
;
return
CommonResponseUtil
.
success
();
}
}
/**
/**
...
@@ -53,7 +72,7 @@ public class FirefightersPostController extends BaseController {
...
@@ -53,7 +72,7 @@ public class FirefightersPostController extends BaseController {
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据
id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersPostService
.
removeById
(
id
);
return
iFirefightersPostService
.
removeById
(
id
);
}
}
...
@@ -68,8 +87,13 @@ public class FirefightersPostController extends BaseController {
...
@@ -68,8 +87,13 @@ public class FirefightersPostController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersPost
firefightersPost
){
public
ResponseModel
updateByIdFirefightersPost
(
HttpServletRequest
request
,
@RequestBody
FirefightersData
firefightersData
){
return
iFirefightersPostService
.
updateById
(
firefightersPost
);
iFirefightersPostService
.
updateById
(
firefightersData
.
getFirefightersPost
());
ifirefightersWorkexperienceService
.
updateById
(
firefightersData
.
getFirefightersWorkexperience
());
ifirefightersEducationService
.
updateById
(
firefightersData
.
getFirefightersEducation
());
return
CommonResponseUtil
.
success
();
}
}
...
@@ -79,11 +103,17 @@ public class FirefightersPostController extends BaseController {
...
@@ -79,11 +103,17 @@ public class FirefightersPostController extends BaseController {
* @param id
* @param id
* @return
* @return
*/
*/
@SuppressWarnings
(
"unchecked"
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@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
FirefightersPost
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersPostService
.
getById
(
id
);
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersData
firefightersData
=
new
FirefightersData
(
ifirefightersWorkexperienceService
.
getOne
(
queryWrapper
),
ifirefightersEducationService
.
getOne
(
queryWrapper
),
iFirefightersPostService
.
getOne
(
queryWrapper
));
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 @
cbb9f187
...
@@ -15,8 +15,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -15,8 +15,10 @@ 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.FirefightersThought
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersThought
;
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
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -42,8 +44,10 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -42,8 +44,10 @@ public class FirefightersThoughtController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员思想谈话记录"
,
notes
=
"新增消防员思想谈话记录"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增消防员思想谈话记录"
,
notes
=
"新增消防员思想谈话记录"
)
public
boolean
saveFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
public
ResponseModel
saveFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
return
iFirefightersThoughtService
.
save
(
firefightersThought
);
boolean
flag
=
iFirefightersThoughtService
.
save
(
firefightersThought
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
}
}
/**
/**
...
@@ -54,22 +58,25 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -54,22 +58,25 @@ public class FirefightersThoughtController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersThoughtService
.
removeById
(
id
);
boolean
flag
=
iFirefightersThoughtService
.
removeById
(
id
);
return
CommonResponseUtil
.
success
();
}
}
/**
/** 修改消防员思想谈话记录
* 修改消防员思想谈话记录
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
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
boolean
updateByIdFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
public
ResponseModel
updateByIdFirefightersThought
(
HttpServletRequest
request
,
@RequestBody
FirefightersThought
firefightersThought
){
return
iFirefightersThoughtService
.
updateById
(
firefightersThought
);
boolean
flag
=
iFirefightersThoughtService
.
updateById
(
firefightersThought
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
}
}
...
@@ -79,11 +86,17 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -79,11 +86,17 @@ public class FirefightersThoughtController extends BaseController {
* @param id
* @param id
* @return
* @return
*/
*/
@SuppressWarnings
(
"unchecked"
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@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
FirefightersThought
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iFirefightersThoughtService
.
getById
(
id
);
@SuppressWarnings
(
"rawtypes"
)
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"firefighters_id"
,
id
);
FirefightersThought
firefightersThought
=
iFirefightersThoughtService
.
getOne
(
queryWrapper
);
return
CommonResponseUtil
.
success
(
firefightersThought
);
}
}
...
@@ -95,7 +108,7 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -95,7 +108,7 @@ public class FirefightersThoughtController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
FirefightersThought
>
listPage
(
String
pageNum
,
String
pageSize
,
FirefightersThought
firefightersThought
){
public
ResponseModel
listPage
(
String
pageNum
,
String
pageSize
,
FirefightersThought
firefightersThought
){
Page
<
FirefightersThought
>
pageBean
;
Page
<
FirefightersThought
>
pageBean
;
QueryWrapper
<
FirefightersThought
>
firefightersThoughtQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FirefightersThought
>
firefightersThoughtQueryWrapper
=
new
QueryWrapper
<>();
...
@@ -131,7 +144,7 @@ public class FirefightersThoughtController extends BaseController {
...
@@ -131,7 +144,7 @@ public class FirefightersThoughtController extends BaseController {
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
}
page
=
iFirefightersThoughtService
.
page
(
pageBean
,
firefightersThoughtQueryWrapper
);
page
=
iFirefightersThoughtService
.
page
(
pageBean
,
firefightersThoughtQueryWrapper
);
return
page
;
}
return
CommonResponseUtil
.
success
(
page
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/UserController.java
View file @
cbb9f187
...
@@ -198,6 +198,8 @@ public class UserController extends BaseController {
...
@@ -198,6 +198,8 @@ public class UserController extends BaseController {
reginParams
.
setRole
(
role
);
reginParams
.
setRole
(
role
);
reginParams
.
setDepartment
(
department
);
reginParams
.
setDepartment
(
department
);
saveSelectedOrgInfo
(
reginParams
);
saveSelectedOrgInfo
(
reginParams
);
//保存用户信息
saveUser
(
user
);
return
buildCurCompany
(
selectUserInfo
,
user
);
return
buildCurCompany
(
selectUserInfo
,
user
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -206,7 +208,6 @@ public class UserController extends BaseController {
...
@@ -206,7 +208,6 @@ public class UserController extends BaseController {
throw
new
RuntimeException
(
"系统繁忙,请稍后再试"
);
throw
new
RuntimeException
(
"系统繁忙,请稍后再试"
);
}
}
}
}
private
JSONObject
buildCurCompany
(
ReginParams
selectUserInfo
,
AgencyUserModel
user
)
{
private
JSONObject
buildCurCompany
(
ReginParams
selectUserInfo
,
AgencyUserModel
user
)
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"userId"
,
user
.
getUserId
());
result
.
put
(
"userId"
,
user
.
getUserId
());
...
...
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