Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
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
吴迪
gs1-office-web-sit
Commits
50dedd90
Commit
50dedd90
authored
Dec 11, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】医疗接口
parent
ec2a8369
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
22 deletions
+46
-22
MedicalController.java
...o/office/modules/manage/controller/MedicalController.java
+46
-22
No files found.
src/main/java/io/office/modules/manage/controller/MedicalController.java
View file @
50dedd90
...
...
@@ -8,6 +8,7 @@ import io.office.modules.manage.service.MedicalService;
import
io.office.modules.manage.utils.IdKeysConstant
;
import
io.office.modules.manage.utils.IdWorkerUtils
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -16,12 +17,11 @@ import io.office.common.utils.PageUtils;
import
io.office.common.utils.R
;
/**
* ${comments}
*
* @author wudi
* @email
* @email
* @date 2021-11-21 12:15:48
*/
@RestController
...
...
@@ -34,8 +34,8 @@ public class MedicalController extends AbstractController {
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:medical:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
// @RequiresPermissions("manage:medical:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
PageUtils
page
=
medicalService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
...
...
@@ -45,9 +45,9 @@ public class MedicalController extends AbstractController {
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("manage:medical:info")
public
R
info
(
@PathVariable
(
"id"
)
String
id
){
MedicalEntity
medical
=
medicalService
.
getById
(
id
);
// @RequiresPermissions("manage:medical:info")
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
MedicalEntity
medical
=
medicalService
.
getById
(
id
);
return
R
.
ok
().
put
(
"medical"
,
medical
);
}
...
...
@@ -56,8 +56,8 @@ public class MedicalController extends AbstractController {
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:medical:save")
public
R
save
(
@RequestBody
MedicalEntity
medical
){
// @RequiresPermissions("manage:medical:save")
public
R
save
(
@RequestBody
MedicalEntity
medical
)
{
medical
.
setId
(
IdWorkerUtils
.
getSEQByKey
(
IdKeysConstant
.
ID_SEQ_KEY
));
String
username
=
getUser
().
getUsername
();
medical
.
setInputDate
(
new
Date
());
...
...
@@ -71,13 +71,13 @@ public class MedicalController extends AbstractController {
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:medical:update")
public
R
update
(
@RequestBody
MedicalEntity
medical
){
// @RequiresPermissions("manage:medical:update")
public
R
update
(
@RequestBody
MedicalEntity
medical
)
{
String
username
=
getUser
().
getUsername
();
medical
.
setEditor
(
username
);
medical
.
setLasteditor
(
username
);
medical
.
setUpdatetime
(
new
Date
());
medicalService
.
updateById
(
medical
);
medicalService
.
updateById
(
medical
);
return
R
.
ok
(
"修改成功!"
);
}
...
...
@@ -85,8 +85,8 @@ public class MedicalController extends AbstractController {
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:medical:delete")
public
R
delete
(
@RequestBody
List
<
String
>
ids
){
// @RequiresPermissions("manage:medical:delete")
public
R
delete
(
@RequestBody
List
<
String
>
ids
)
{
MedicalEntity
medical
=
new
MedicalEntity
();
String
username
=
getUser
().
getUsername
();
medical
.
setEditor
(
username
);
...
...
@@ -94,20 +94,20 @@ public class MedicalController extends AbstractController {
medical
.
setUpdatetime
(
new
Date
());
medical
.
setLevel
(
0
);
QueryWrapper
<
MedicalEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
ids
);
medicalService
.
update
(
medical
,
queryWrapper
);
queryWrapper
.
in
(
"id"
,
ids
);
medicalService
.
update
(
medical
,
queryWrapper
);
return
R
.
ok
(
"删除成功!"
);
}
@GetMapping
(
"/getMedicalTypeList"
)
public
R
getMedicalTypeList
()
{
List
<
Map
<
String
,
Object
>>
list
=
medicalService
.
getMedicalTypeList
();
return
R
.
ok
().
put
(
"list"
,
list
);
public
R
getMedicalTypeList
()
{
List
<
Map
<
String
,
Object
>>
list
=
medicalService
.
getMedicalTypeList
();
return
R
.
ok
().
put
(
"list"
,
list
);
}
@PostMapping
(
"/verifyMedical"
)
public
R
verifyMedical
(
@RequestBody
MedicalEntity
medical
)
{
public
R
verifyMedical
(
@RequestBody
MedicalEntity
medical
)
{
String
username
=
getUser
().
getUsername
();
medical
.
setEditor
(
username
);
medical
.
setLasteditor
(
username
);
...
...
@@ -115,9 +115,33 @@ public class MedicalController extends AbstractController {
medical
.
setCheckname
(
username
);
medical
.
setChecktime
(
new
Date
());
QueryWrapper
<
MedicalEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"id"
,
medical
.
getId
());
medicalService
.
update
(
medical
,
queryWrapper
);
queryWrapper
.
eq
(
"id"
,
medical
.
getId
());
medicalService
.
update
(
medical
,
queryWrapper
);
return
R
.
ok
(
"审核成功!"
);
}
@PostMapping
(
"/api/getList10ByType"
)
public
R
getList10ByType
(
@RequestBody
MedicalEntity
medical
)
{
QueryWrapper
<
MedicalEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"top 10 id,title "
);
queryWrapper
.
gt
(
"level"
,
"0"
);
if
(
StringUtils
.
isBlank
(
medical
.
getType
()))
{
return
R
.
error
(
"请输入分类"
);
}
queryWrapper
.
eq
(
"type"
,
medical
.
getType
());
queryWrapper
.
orderByDesc
(
"releaseTime"
);
return
R
.
ok
().
put
(
"data"
,
medicalService
.
list
(
queryWrapper
));
}
@PostMapping
(
"/api/getDetailById"
)
public
R
getDetailById
(
@RequestBody
MedicalEntity
medical
)
{
return
R
.
ok
().
put
(
"data"
,
medicalService
.
getById
(
medical
.
getId
()));
}
}
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