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
086dd6f9
Commit
086dd6f9
authored
Apr 23, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理提示数据
parent
1ef8f611
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
10 deletions
+49
-10
PersonBasicController.java
...ot/module/jxiop/biz/controller/PersonBasicController.java
+44
-5
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+5
-5
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonBasicController.java
View file @
086dd6f9
...
...
@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.PersonDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.UserMapperDto
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -10,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -43,10 +49,20 @@ public class PersonBasicController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增人员基本信息"
,
notes
=
"新增人员基本信息"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
PersonDto
model
,
HttpServletRequest
httpServletRequest
)
{
personBasicServiceImpl
.
addPerson
(
model
,
httpServletRequest
);
try
{
personBasicServiceImpl
.
addPerson
(
model
,
httpServletRequest
);
}
catch
(
InnerInvokException
e
){
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 根据sequenceNbr更新
*
...
...
@@ -57,7 +73,13 @@ public class PersonBasicController extends BaseController {
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新人员基本信息"
,
notes
=
"根据sequenceNbr更新人员基本信息"
)
public
ResponseModel
<
PersonDto
>
updateBySequenceNbrPersonBasic
(
@RequestBody
PersonDto
model
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
HttpServletRequest
httpServletRequest
)
{
return
ResponseHelper
.
buildResponse
(
personBasicServiceImpl
.
updatePerson
(
model
,
httpServletRequest
,
sequenceNbr
));
try
{
personBasicServiceImpl
.
updatePerson
(
model
,
httpServletRequest
,
sequenceNbr
);
}
catch
(
InnerInvokException
e
){
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
...
...
@@ -70,10 +92,16 @@ public class PersonBasicController extends BaseController {
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除人员基本信息"
,
notes
=
"根据sequenceNbr删除人员基本信息"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"ids"
)
String
ids
){
String
[]
idss
=
ids
.
split
(
","
);
int
num
=
personBasicServiceImpl
.
deletePerson
(
idss
);
int
num
=
0
;
try
{
String
[]
idss
=
ids
.
split
(
","
);
num
=
personBasicServiceImpl
.
deletePerson
(
idss
);
}
catch
(
InnerInvokException
e
){
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
num
>
0
?
true
:
false
);
return
ResponseHelper
.
buildResponse
(
num
>
0
?
true
:
false
);
}
/**
...
...
@@ -127,4 +155,15 @@ public class PersonBasicController extends BaseController {
public
ResponseModel
<
List
<
PersonBasicDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
personBasicServiceImpl
.
queryForPersonBasicList
());
}
public
ResponseModel
buildResponseFalse
(
String
message
)
{
ResponseModel
response
=
new
ResponseModel
();
response
.
setResult
(
null
);
response
.
setDevMessage
(
"FAILURE"
);
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
response
.
setMessage
(
message
);
response
.
setDevMessage
(
message
);
return
response
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
086dd6f9
...
...
@@ -293,7 +293,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
if
(
amosUser
.
getStatus
()==
200
){
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
();
throw
new
RuntimeException
(
amosUser
.
getMessage
()
);
}
}
return
user
;
...
...
@@ -308,7 +308,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
if
(
amosUser
.
getStatus
()==
200
){
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
();
throw
new
RuntimeException
(
amosUser
.
getMessage
()
);
}
}
return
user
;
...
...
@@ -323,7 +323,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
if
(
de
.
getStatus
()==
200
){
departmentModel
=
de
.
getResult
();
}
else
{
throw
new
RuntimeException
();
throw
new
RuntimeException
(
de
.
getMessage
()
);
}
}
return
departmentModel
;
...
...
@@ -336,7 +336,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
if
(
cResult
.
getStatus
()==
200
){
companyModel
=
cResult
.
getResult
();
}
else
{
throw
new
RuntimeException
();
throw
new
RuntimeException
(
cResult
.
getMessage
()
);
}
}
return
companyModel
;
...
...
@@ -346,7 +346,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()!=
200
){
throw
new
RuntimeException
();
throw
new
RuntimeException
(
cResult
.
getMessage
()
);
}
}
}
...
...
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