Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QLNS_N01
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Hiếu
QLNS_N01
Commits
d9bb1f9b
Commit
d9bb1f9b
authored
Jun 05, 2019
by
Phạm Duy Phi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
5df49b2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
src/main/java/com/itsol/quantrivanphong/manage/leaveform/business/LeaveFormBusiness.java
...vanphong/manage/leaveform/business/LeaveFormBusiness.java
+2
-2
src/main/java/com/itsol/quantrivanphong/manage/leaveform/controller/LeaveFormController.java
...hong/manage/leaveform/controller/LeaveFormController.java
+3
-3
src/main/java/com/itsol/quantrivanphong/manage/timesheet/controller/TimeSheetController.java
...hong/manage/timesheet/controller/TimeSheetController.java
+2
-2
No files found.
src/main/java/com/itsol/quantrivanphong/manage/leaveform/business/LeaveFormBusiness.java
View file @
d9bb1f9b
...
...
@@ -26,10 +26,10 @@ public class LeaveFormBusiness {
return
leaveFormRepository
.
findAll
();
}
public
String
insertLeaveForm
(
LeaveFormDTO
leaveFormDTO
)
{
public
String
insertLeaveForm
(
int
employee_Id
,
LeaveFormDTO
leaveFormDTO
)
{
String
message
;
Employee
employee
=
employeeRepository
.
findEmployeeById
(
leaveFormDTO
.
getEmployee_id
()
);
Employee
employee
=
employeeRepository
.
findEmployeeById
(
employee_Id
);
LeaveType
leaveType
=
leaveTypeRepository
.
findLeaveTypeById
(
leaveFormDTO
.
getLeave_type_id
());
if
(
employee
!=
null
)
{
...
...
src/main/java/com/itsol/quantrivanphong/manage/leaveform/controller/LeaveFormController.java
View file @
d9bb1f9b
...
...
@@ -22,14 +22,14 @@ public class LeaveFormController {
return
ResponseEntity
.
ok
(
leaveFormBusiness
.
findAll
());
}
@PostMapping
(
path
=
"/
insert
"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
insertLeaveForm
(
@
RequestBody
LeaveFormDTO
leaveFormDTO
)
{
@PostMapping
(
path
=
"/
{employee_Id}/leavetype/{leavetype_Id}/leaveform
"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
insertLeaveForm
(
@
PathVariable
int
employee_Id
,
@Valid
@RequestBody
LeaveFormDTO
leaveFormDTO
,
@PathVariable
int
leavetype_Id
)
{
String
message
;
try
{
if
(
leaveFormDTO
.
getTitle
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tiêu đề không được để trống"
);
if
(
leaveFormDTO
.
getContent
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Nội dung không được để trống"
);
message
=
leaveFormBusiness
.
insertLeaveForm
(
leaveFormDTO
);
message
=
leaveFormBusiness
.
insertLeaveForm
(
employee_Id
,
leaveFormDTO
,
leavetype_Id
);
}
catch
(
InputException
e
)
{
message
=
e
.
getMessage
();
}
...
...
src/main/java/com/itsol/quantrivanphong/manage/timesheet/controller/TimeSheetController.java
View file @
d9bb1f9b
...
...
@@ -35,7 +35,7 @@ public class TimeSheetController {
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
deleteTimeSheet
(
employee_Id
,
timesheet_Id
));
}
@GetMapping
(
path
=
"/
eproject/leaveform
"
)
@GetMapping
(
path
=
"/
timesheet
"
)
public
List
<
TimeSheet
>
showAllTimeSheet
()
{
return
timeSheetBusiness
.
findAll
();
}
...
...
@@ -62,7 +62,7 @@ public class TimeSheetController {
// return ResponseEntity.ok(message);
// }
@GetMapping
(
"/{employee_Id}/
show
"
)
@GetMapping
(
"/{employee_Id}/
timesheet
"
)
public
ResponseEntity
<
List
<
TimeSheet
>>
showTimeSheetById
(
@PathVariable
int
employee_Id
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
findTimeSheetById
(
employee_Id
));
}
...
...
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