Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
0f6d1fe6
Commit
0f6d1fe6
authored
Aug 29, 2024
by
wujipeng
Browse files
逻辑修改
parent
d9e40f3d
Changes
4
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/ProjectController.java
View file @
0f6d1fe6
...
@@ -56,13 +56,6 @@ public class ProjectController {
...
@@ -56,13 +56,6 @@ public class ProjectController {
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
public
ResponseEntity
<
ProjectEntity
>
getProjectById
(
@PathVariable
Integer
id
)
{
public
ResponseEntity
<
ProjectEntity
>
getProjectById
(
@PathVariable
Integer
id
)
{
ProjectEntity
project
=
projectService
.
getProjectById
(
id
);
ProjectEntity
project
=
projectService
.
getProjectById
(
id
);
String
createUserId
=
project
.
getCreateUserId
();
if
(
BeanUtil
.
isNotEmpty
(
createUserId
))
{
UserEntity
user
=
userService
.
getById
(
createUserId
);
if
(
BeanUtil
.
isNotEmpty
(
user
))
{
project
.
setProjectLeader
(
user
.
getName
());
}
}
return
ResponseEntity
.
ok
(
project
);
return
ResponseEntity
.
ok
(
project
);
}
}
...
@@ -74,6 +67,13 @@ public class ProjectController {
...
@@ -74,6 +67,13 @@ public class ProjectController {
*/
*/
@PostMapping
@PostMapping
public
ResponseEntity
<
Integer
>
insertProject
(
@RequestBody
ProjectEntity
project
)
{
public
ResponseEntity
<
Integer
>
insertProject
(
@RequestBody
ProjectEntity
project
)
{
String
createUserId
=
project
.
getUserId
();
if
(
BeanUtil
.
isNotEmpty
(
createUserId
))
{
UserEntity
user
=
userService
.
getById
(
createUserId
);
if
(
BeanUtil
.
isNotEmpty
(
user
))
{
project
.
setProjectLeader
(
user
.
getName
());
}
}
int
result
=
projectService
.
insertProject
(
project
);
int
result
=
projectService
.
insertProject
(
project
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
CREATED
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
CREATED
);
}
}
...
...
src/main/java/com/ruzhoukj/sms/entity/UserEntity.java
View file @
0f6d1fe6
...
@@ -26,4 +26,5 @@ public class UserEntity {
...
@@ -26,4 +26,5 @@ public class UserEntity {
private
String
departments
;
private
String
departments
;
private
String
email
;
private
String
email
;
private
String
password
;
private
String
password
;
private
String
phone
;
}
}
src/main/resources/com/ruzhoukj/sms/dao/ProjectDao.xml
View file @
0f6d1fe6
...
@@ -42,8 +42,9 @@
...
@@ -42,8 +42,9 @@
</select>
</select>
<insert
id=
"insertProject"
>
<insert
id=
"insertProject"
>
INSERT INTO project (start_time, end_time, `describe`, project_name,visible_people, create_user_id)
INSERT INTO project (start_time, end_time, `describe`, project_name, visible_people, create_user_id,
VALUES (#{startTime}, #{endTime}, #{describe}, #{projectName},#{visiblePeople},#{userId})
project_leader)
VALUES (#{startTime}, #{endTime}, #{describe}, #{projectName}, #{visiblePeople}, #{userId}, #{projectLeader})
</insert>
</insert>
<update
id=
"updateProject"
>
<update
id=
"updateProject"
>
...
...
src/main/resources/com/ruzhoukj/sms/dao/UserDao.xml
View file @
0f6d1fe6
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
name,
name,
departments,
departments,
create_time as createTime,
create_time as createTime,
email
email,
phone
FROM
FROM
user
user
WHERE
WHERE
...
...
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