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
5c69f55e
Commit
5c69f55e
authored
Jun 14, 2019
by
Phạm Duy Phi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a98ad627
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
81 additions
and
125 deletions
+81
-125
src/main/java/com/itsol/quantrivanphong/report/leaveform/controller/LeaveFormController.java
...hong/report/leaveform/controller/LeaveFormController.java
+9
-9
src/main/java/com/itsol/quantrivanphong/report/leaveform/controller/Notification.java
...trivanphong/report/leaveform/controller/Notification.java
+13
-0
src/main/java/com/itsol/quantrivanphong/report/timesheet/business/TimeSheetBusiness.java
...vanphong/report/timesheet/business/TimeSheetBusiness.java
+1
-17
src/main/java/com/itsol/quantrivanphong/report/timesheet/controller/TimeSheetController.java
...hong/report/timesheet/controller/TimeSheetController.java
+7
-20
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
...phong/report/timesheet/repository/EProjectRepository.java
+4
-3
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/TimeSheetRepository.java
...hong/report/timesheet/repository/TimeSheetRepository.java
+0
-9
src/main/resources/application.properties
src/main/resources/application.properties
+0
-5
src/main/resources/public/index.html
src/main/resources/public/index.html
+1
-9
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+12
-17
src/main/resources/public/pages/leaveform/leaveForm.html
src/main/resources/public/pages/leaveform/leaveForm.html
+3
-3
src/main/resources/public/pages/leaveform/leaveFormController.js
...n/resources/public/pages/leaveform/leaveFormController.js
+12
-6
src/main/resources/public/pages/leaveform/leaveFormDetailController.js
...urces/public/pages/leaveform/leaveFormDetailController.js
+4
-2
src/main/resources/public/pages/timesheet/index.html
src/main/resources/public/pages/timesheet/index.html
+0
-17
src/main/resources/public/pages/timesheet/timeSheetDetail.html
...ain/resources/public/pages/timesheet/timeSheetDetail.html
+1
-1
src/main/resources/public/pages/timesheet/timeSheetDetailController.js
...urces/public/pages/timesheet/timeSheetDetailController.js
+4
-2
src/main/resources/public/pages/timesheet/timesheetController.js
...n/resources/public/pages/timesheet/timesheetController.js
+10
-5
No files found.
src/main/java/com/itsol/quantrivanphong/report/leaveform/controller/LeaveFormController.java
View file @
5c69f55e
...
@@ -5,6 +5,7 @@ import com.itsol.quantrivanphong.report.leaveform.business.LeaveFormBusiness;
...
@@ -5,6 +5,7 @@ import com.itsol.quantrivanphong.report.leaveform.business.LeaveFormBusiness;
import
com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO
;
import
com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO
;
import
com.itsol.quantrivanphong.model.LeaveForm
;
import
com.itsol.quantrivanphong.model.LeaveForm
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -22,9 +23,8 @@ public class LeaveFormController {
...
@@ -22,9 +23,8 @@ public class LeaveFormController {
}
}
@PostMapping
(
path
=
"/leaveform/add"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
@PostMapping
(
path
=
"/leaveform/add"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
addLeaveForm
(
@RequestBody
LeaveFormDTO
leaveFormDTO
)
{
public
ResponseEntity
addLeaveForm
(
@RequestBody
LeaveFormDTO
leaveFormDTO
)
{
String
message
;
String
message
;
try
{
try
{
if
(
leaveFormDTO
.
getTitle
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tiêu đề không được để trống"
);
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"
);
if
(
leaveFormDTO
.
getContent
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Nội dung không được để trống"
);
...
@@ -33,16 +33,16 @@ public class LeaveFormController {
...
@@ -33,16 +33,16 @@ public class LeaveFormController {
message
=
e
.
getMessage
();
message
=
e
.
getMessage
();
}
}
return
ResponseEntity
.
ok
(
message
);
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
)
);
}
}
@DeleteMapping
(
"/leaveform/delete/{leaveformId}"
)
@DeleteMapping
(
"/leaveform/delete/{leaveformId}"
)
public
ResponseEntity
<
String
>
deleteLeaveForm
(
@PathVariable
int
leaveformId
)
{
public
ResponseEntity
deleteLeaveForm
(
@PathVariable
int
leaveformId
)
{
return
ResponseEntity
.
ok
(
leaveFormBusiness
.
deleteLeaveForm
(
leaveformId
));
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
leaveFormBusiness
.
deleteLeaveForm
(
leaveformId
)
));
}
}
@PostMapping
(
path
=
"/leaveform/update"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
@PostMapping
(
path
=
"/leaveform/update"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
updateLeaveForm
(
@RequestBody
LeaveFormDTO
leaveFormDTO
)
{
public
ResponseEntity
updateLeaveForm
(
@RequestBody
LeaveFormDTO
leaveFormDTO
)
{
String
message
;
String
message
;
try
{
try
{
...
@@ -53,14 +53,14 @@ public class LeaveFormController {
...
@@ -53,14 +53,14 @@ public class LeaveFormController {
message
=
e
.
getMessage
();
message
=
e
.
getMessage
();
}
}
return
ResponseEntity
.
ok
(
message
);
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
)
);
}
}
@PostMapping
(
path
=
"/leaveform/{leaveformId}/status"
)
@PostMapping
(
path
=
"/leaveform/{leaveformId}/status"
)
public
ResponseEntity
<
String
>
updateLeaveFormStatus
(
@PathVariable
int
leaveformId
)
{
public
ResponseEntity
updateLeaveFormStatus
(
@PathVariable
int
leaveformId
)
{
String
message
;
String
message
;
message
=
leaveFormBusiness
.
updateLeaveFormStatus
(
leaveformId
);
message
=
leaveFormBusiness
.
updateLeaveFormStatus
(
leaveformId
);
return
ResponseEntity
.
ok
(
message
);
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
)
);
}
}
@GetMapping
(
"/leaveform/show/{employeeId}"
)
@GetMapping
(
"/leaveform/show/{employeeId}"
)
...
...
src/main/java/com/itsol/quantrivanphong/report/leaveform/controller/Notification.java
0 → 100644
View file @
5c69f55e
package
com.itsol.quantrivanphong.report.leaveform.controller
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
Notification
{
private
int
status
;
private
String
view
;
}
src/main/java/com/itsol/quantrivanphong/report/timesheet/business/TimeSheetBusiness.java
View file @
5c69f55e
...
@@ -21,11 +21,7 @@ public class TimeSheetBusiness {
...
@@ -21,11 +21,7 @@ public class TimeSheetBusiness {
EProjectRepository
eProjectRepository
;
EProjectRepository
eProjectRepository
;
@Autowired
@Autowired
EmployeeRepository
employeeRepository
;
EmployeeRepository
employeeRepository
;
<<<<<<<
HEAD
public
String
insertTimeSheet
(
TimeSheetDTO
timeSheetDTO
)
{
=======
public
String
addTimeSheet
(
TimeSheetDTO
timeSheetDTO
)
{
public
String
addTimeSheet
(
TimeSheetDTO
timeSheetDTO
)
{
>>>>>>>
master
String
message
;
String
message
;
Employee
employee
=
employeeRepository
.
findEmployeeById
(
timeSheetDTO
.
getEmployeeId
());
Employee
employee
=
employeeRepository
.
findEmployeeById
(
timeSheetDTO
.
getEmployeeId
());
Eproject
eproject
=
eProjectRepository
.
findEprojectByIdAndEmployee
(
timeSheetDTO
.
getEprojectId
(),
employee
);
Eproject
eproject
=
eProjectRepository
.
findEprojectByIdAndEmployee
(
timeSheetDTO
.
getEprojectId
(),
employee
);
...
@@ -38,7 +34,7 @@ public class TimeSheetBusiness {
...
@@ -38,7 +34,7 @@ public class TimeSheetBusiness {
timeSheet1
.
setContent
(
timeSheetDTO
.
getContent
());
timeSheet1
.
setContent
(
timeSheetDTO
.
getContent
());
timeSheet1
.
setNote
(
timeSheetDTO
.
getNote
());
timeSheet1
.
setNote
(
timeSheetDTO
.
getNote
());
timeSheet1
.
setEproject
(
eproject
);
timeSheet1
.
setEproject
(
eproject
);
timeSheet1
.
setChecked
(
""
);
timeSheet1
.
setChecked
(
"
unapproved
"
);
timeSheet1
.
setStatus
(
true
);
timeSheet1
.
setStatus
(
true
);
TimeSheet
timeSheet
=
timeSheetRepository
.
save
(
timeSheet1
);
TimeSheet
timeSheet
=
timeSheetRepository
.
save
(
timeSheet1
);
...
@@ -53,17 +49,6 @@ public class TimeSheetBusiness {
...
@@ -53,17 +49,6 @@ public class TimeSheetBusiness {
return
message
;
return
message
;
}
}
<<<<<<<
HEAD
public
String
deleteTimeSheet
(
int
timesheetId
)
{
String
message
;
// Employee employee = employeeRepository.findEmployeeById(timeSheetDTO.getEmployeeId());
// Eproject eproject = eProjectRepository.findEprojectByEmployee(employee);
// TimeSheet timeSheet = timeSheetRepository.findTimeSheetByEprojectAndId(eproject, timeSheetDTO.getId());
TimeSheet
timeSheet
=
timeSheetRepository
.
findTimeSheetById
(
timesheetId
);
if
(
timeSheet
!=
null
)
{
timeSheetRepository
.
delete
(
timeSheet
);
if
(
timeSheetRepository
.
findTimeSheetById
(
timesheetId
)
==
null
)
{
=======
public
String
deleteTimeSheet
(
int
timeSheetId
)
{
public
String
deleteTimeSheet
(
int
timeSheetId
)
{
String
message
;
String
message
;
// Employee employee = employeeRepository.findEmployeeById(employee_Id);
// Employee employee = employeeRepository.findEmployeeById(employee_Id);
...
@@ -72,7 +57,6 @@ public class TimeSheetBusiness {
...
@@ -72,7 +57,6 @@ public class TimeSheetBusiness {
if
(
timeSheet
!=
null
)
{
if
(
timeSheet
!=
null
)
{
timeSheetRepository
.
delete
(
timeSheet
);
timeSheetRepository
.
delete
(
timeSheet
);
if
(
timeSheetRepository
.
findTimeSheetById
(
timeSheetId
)
==
null
)
{
if
(
timeSheetRepository
.
findTimeSheetById
(
timeSheetId
)
==
null
)
{
>>>>>>>
master
message
=
"Delete success"
;
message
=
"Delete success"
;
}
else
{
}
else
{
message
=
"Delete failed"
;
message
=
"Delete failed"
;
...
...
src/main/java/com/itsol/quantrivanphong/report/timesheet/controller/TimeSheetController.java
View file @
5c69f55e
...
@@ -2,6 +2,7 @@ package com.itsol.quantrivanphong.report.timesheet.controller;
...
@@ -2,6 +2,7 @@ package com.itsol.quantrivanphong.report.timesheet.controller;
import
com.itsol.quantrivanphong.exception.InputException
;
import
com.itsol.quantrivanphong.exception.InputException
;
import
com.itsol.quantrivanphong.model.TimeSheet
;
import
com.itsol.quantrivanphong.model.TimeSheet
;
import
com.itsol.quantrivanphong.report.leaveform.controller.Notification
;
import
com.itsol.quantrivanphong.report.timesheet.business.TimeSheetBusiness
;
import
com.itsol.quantrivanphong.report.timesheet.business.TimeSheetBusiness
;
import
com.itsol.quantrivanphong.report.timesheet.dto.TimeSheetDTO
;
import
com.itsol.quantrivanphong.report.timesheet.dto.TimeSheetDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -15,26 +16,18 @@ import java.util.List;
...
@@ -15,26 +16,18 @@ import java.util.List;
public
class
TimeSheetController
{
public
class
TimeSheetController
{
@Autowired
@Autowired
TimeSheetBusiness
timeSheetBusiness
;
TimeSheetBusiness
timeSheetBusiness
;
<<<<<<<
HEAD
@PostMapping
(
path
=
"/timesheet"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
=======
@PostMapping
(
path
=
"/timesheet/add"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
@PostMapping
(
path
=
"/timesheet/add"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
>>>>>>>
master
public
ResponseEntity
addTimeSheet
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
public
ResponseEntity
<
String
>
addTimeSheet
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
String
message
;
String
message
;
try
{
try
{
if
(
timeSheetDTO
.
getTitle
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tiêu đề không được để trống"
);
if
(
timeSheetDTO
.
getTitle
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tiêu đề không được để trống"
);
if
(
timeSheetDTO
.
getContent
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Nội dung không được để trống"
);
if
(
timeSheetDTO
.
getContent
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Nội dung không được để trống"
);
<<<<<<<
HEAD
message
=
timeSheetBusiness
.
insertTimeSheet
(
timeSheetDTO
);
=======
message
=
timeSheetBusiness
.
addTimeSheet
(
timeSheetDTO
);
message
=
timeSheetBusiness
.
addTimeSheet
(
timeSheetDTO
);
>>>>>>>
master
}
catch
(
InputException
e
)
{
}
catch
(
InputException
e
)
{
message
=
e
.
getMessage
();
message
=
e
.
getMessage
();
}
}
return
ResponseEntity
.
ok
(
message
);
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
)
);
}
}
// @PostMapping(path = "/timesheet", consumes = "application/json", produces = "application/json")
// @PostMapping(path = "/timesheet", consumes = "application/json", produces = "application/json")
// public ResponseEntity<String> insertTimeSheet(@RequestBody TimeSheetDTO timeSheetDTO) {
// public ResponseEntity<String> insertTimeSheet(@RequestBody TimeSheetDTO timeSheetDTO) {
...
@@ -51,8 +44,8 @@ public class TimeSheetController {
...
@@ -51,8 +44,8 @@ public class TimeSheetController {
// }
// }
@DeleteMapping
(
"/timesheet/delete/{timesheetId}"
)
@DeleteMapping
(
"/timesheet/delete/{timesheetId}"
)
public
ResponseEntity
<
String
>
deleteTimeSheet
(
@PathVariable
int
timesheetId
)
{
public
ResponseEntity
deleteTimeSheet
(
@PathVariable
int
timesheetId
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
deleteTimeSheet
(
timesheetId
));
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
timeSheetBusiness
.
deleteTimeSheet
(
timesheetId
)
));
}
}
@GetMapping
(
path
=
"/timesheet/show"
)
@GetMapping
(
path
=
"/timesheet/show"
)
...
@@ -61,7 +54,7 @@ public class TimeSheetController {
...
@@ -61,7 +54,7 @@ public class TimeSheetController {
}
}
@PostMapping
(
path
=
"/timesheet/update"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
@PostMapping
(
path
=
"/timesheet/update"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
updateTimeSheet
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
public
ResponseEntity
updateTimeSheet
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
String
message
;
String
message
;
try
{
try
{
...
@@ -72,7 +65,7 @@ public class TimeSheetController {
...
@@ -72,7 +65,7 @@ public class TimeSheetController {
message
=
e
.
getMessage
();
message
=
e
.
getMessage
();
}
}
return
ResponseEntity
.
ok
(
message
);
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
)
);
}
}
// @PostMapping(path = "/update-status", consumes = "application/json", produces = "application/json")
// @PostMapping(path = "/update-status", consumes = "application/json", produces = "application/json")
...
@@ -82,11 +75,6 @@ public class TimeSheetController {
...
@@ -82,11 +75,6 @@ public class TimeSheetController {
// return ResponseEntity.ok(message);
// return ResponseEntity.ok(message);
// }
// }
<<<<<<<
HEAD
@GetMapping
(
"/timesheet/show/{employee_Id}"
)
public
ResponseEntity
<
List
<
TimeSheet
>>
showTimeSheetById
(
@PathVariable
int
employee_Id
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
findTimeSheetById
(
employee_Id
));
=======
@GetMapping
(
"/timesheet/show/{employeeId}"
)
@GetMapping
(
"/timesheet/show/{employeeId}"
)
public
ResponseEntity
<
List
<
TimeSheet
>>
showTimeSheetByEmployeeId
(
@PathVariable
int
employeeId
)
{
public
ResponseEntity
<
List
<
TimeSheet
>>
showTimeSheetByEmployeeId
(
@PathVariable
int
employeeId
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
findTimeSheetByEmployeeId
(
employeeId
));
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
findTimeSheetByEmployeeId
(
employeeId
));
...
@@ -101,6 +89,5 @@ public class TimeSheetController {
...
@@ -101,6 +89,5 @@ public class TimeSheetController {
@PostMapping
(
path
=
"/timesheet/update/check"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
@PostMapping
(
path
=
"/timesheet/update/check"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
<
String
>
updateCheck
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
public
ResponseEntity
<
String
>
updateCheck
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
updateCheck
(
timeSheetDTO
));
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
updateCheck
(
timeSheetDTO
));
>>>>>>>
master
}
}
}
}
\ No newline at end of file
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
View file @
5c69f55e
...
@@ -8,14 +8,15 @@ import org.springframework.data.jpa.repository.Query;
...
@@ -8,14 +8,15 @@ import org.springframework.data.jpa.repository.Query;
import
java.util.List
;
import
java.util.List
;
public
interface
EProjectRepository
extends
JpaRepository
<
Eproject
,
Integer
>
{
public
interface
EProjectRepository
extends
JpaRepository
<
Eproject
,
Integer
>
{
//--------------------------------- Phi ----------------------------------------//
// Eproject findEprojectById(int id);
// Eproject findEprojectById(int id);
Eproject
findEprojectByEmployee
(
Employee
employee
);
Eproject
findEprojectByEmployee
(
Employee
employee
);
Eproject
findEprojectByIdAndEmployee
(
int
eProject_Id
,
Employee
employee
);
Eproject
findEprojectByIdAndEmployee
(
int
eProject_Id
,
Employee
employee
);
//--------------------------------- Phi ----------------------------------------//
//======================================================================================================
//======================================================================================================
// Hieunv
// Hieunv
...
...
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/TimeSheetRepository.java
View file @
5c69f55e
...
@@ -11,10 +11,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -11,10 +11,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.List
;
import
java.util.List
;
public
interface
TimeSheetRepository
extends
JpaRepository
<
TimeSheet
,
Integer
>
{
public
interface
TimeSheetRepository
extends
JpaRepository
<
TimeSheet
,
Integer
>
{
<<<<<<<
HEAD
//------------------------------------ Phi ---------------------------------//
=======
>>>>>>>
master
TimeSheet
findTimeSheetById
(
int
id
);
TimeSheet
findTimeSheetById
(
int
id
);
// @Query("select ts from TimeSheet ts order by ts.createdAt desc")
// @Query("select ts from TimeSheet ts order by ts.createdAt desc")
...
@@ -35,12 +31,7 @@ public interface TimeSheetRepository extends JpaRepository<TimeSheet, Integer> {
...
@@ -35,12 +31,7 @@ public interface TimeSheetRepository extends JpaRepository<TimeSheet, Integer> {
@Query
(
"select ts from TimeSheet ts where ts.eproject = ?1"
)
@Query
(
"select ts from TimeSheet ts where ts.eproject = ?1"
)
List
<
TimeSheet
>
showTimeSheetByEproject
(
Eproject
eproject
);
List
<
TimeSheet
>
showTimeSheetByEproject
(
Eproject
eproject
);
<<<<<<<
HEAD
TimeSheet
findTimeSheetByEprojectAndId
(
Eproject
eproject
,
int
timeSheet_Id
);
//------------------------------------ Phi ---------------------------------//
=======
TimeSheet
findTimeSheetByEprojectAndId
(
Eproject
eproject
,
int
timeSheetId
);
TimeSheet
findTimeSheetByEprojectAndId
(
Eproject
eproject
,
int
timeSheetId
);
>>>>>>>
master
//==================================================================================================================
//==================================================================================================================
...
...
src/main/resources/application.properties
View file @
5c69f55e
...
@@ -5,13 +5,8 @@
...
@@ -5,13 +5,8 @@
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://localhost:3306/quantrivanphong
spring.datasource.url
=
jdbc:mysql://localhost:3306/quantrivanphong
spring.datasource.username
=
root
spring.datasource.username
=
root
<<<<<<<
HEAD
spring.datasource.password
=
ahihi123
spring.datasource.password
=
ahihi123
=======
spring.datasource.password
=
ahihi123
>>>>>>>
master
# ===============================
# ===============================
# JPA / HIBERNATE
# JPA / HIBERNATE
# ===============================
# ===============================
...
...
src/main/resources/public/index.html
View file @
5c69f55e
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<script
src=
"js/jquery-3.2.1.min.js"
></script>
<script
src=
"js/jquery-3.2.1.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/angular.js"
></script>
<script
src=
"js/angular.js"
></script>
<script
src=
"js/angular-route.js"
></script>
<script
src=
"js/angular-ui-router.min.js"
></script>
<script
src=
"js/angular-ui-router.min.js"
></script>
<script
src=
"js/app.js"
></script>
<script
src=
"js/app.js"
></script>
...
@@ -30,7 +31,6 @@
...
@@ -30,7 +31,6 @@
<script
src=
"pages/leaveform/leaveFormDetailController.js"
></script>
<script
src=
"pages/leaveform/leaveFormDetailController.js"
></script>
<script
src=
"pages/timesheet/timeSheetDetailController.js"
></script>
<script
src=
"pages/timesheet/timeSheetDetailController.js"
></script>
<!-- <script src="js/angular-resource.js"></script>-->
<!-- <script src="js/angular-resource.js"></script>-->
<script>
<script>
function
showAddTimeSheetFunction
()
{
function
showAddTimeSheetFunction
()
{
const
x
=
document
.
getElementById
(
"
addDivTS
"
);
const
x
=
document
.
getElementById
(
"
addDivTS
"
);
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
}
}
}
}
</script>
</script>
<script>
<script>
function
showAddLeaveFormFunction
()
{
function
showAddLeaveFormFunction
()
{
const
x
=
document
.
getElementById
(
"
addDivLF
"
);
const
x
=
document
.
getElementById
(
"
addDivLF
"
);
...
@@ -58,14 +57,8 @@
...
@@ -58,14 +57,8 @@
}
}
}
}
</script>
</script>
</head>
</head>
<body
ng-app=
"myApp"
>
<body
ng-app=
"myApp"
>
<
<<<<<<
HEAD
<
div
class=
"container"
>
=======
>>>>>>> master
<div
ui-view=
"layout"
>
<div
ui-view=
"layout"
>
<div
style=
"margin-left:5px;margin-top:10px"
ng-controller=
"timeSheetController"
>
<div
style=
"margin-left:5px;margin-top:10px"
ng-controller=
"timeSheetController"
>
...
@@ -73,6 +66,5 @@
...
@@ -73,6 +66,5 @@
</div>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/resources/public/js/app.js
View file @
5c69f55e
/**
/**
*
*
*/
*/
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
,
'
ngRoute
'
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
$locationProvider
.
hashPrefix
(
''
);
$locationProvider
.
hashPrefix
(
''
);
$urlRouterProvider
.
otherwise
(
"
/employees
"
);
$urlRouterProvider
.
otherwise
(
"
/employees
"
);
...
@@ -126,11 +126,19 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
...
@@ -126,11 +126,19 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
// }
// }
// }
// }
// })
// })
.
state
(
"
gioithieu
"
,
{
parent
:
'
app
'
,
url
:
"
/gioithieu
"
,
views
:{
"
content
"
:{
templateUrl
:
"
pages/gioithieu/gioithieu.htm
"
,
controller
:
"
gioithieuController
"
}
}
})
});
});
<<<<<<<
HEAD
// .state("lienhe", {
// .state("lienhe", {
// parent: 'app',
// parent: 'app',
// url: "/lienhe",
// url: "/lienhe",
...
@@ -142,19 +150,7 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
...
@@ -142,19 +150,7 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
// }
// }
// })
// })
.
state
(
"
gioithieu
"
,
{
parent
:
'
app
'
,
url
:
"
/gioithieu
"
,
views
:{
"
content
"
:{
templateUrl
:
"
pages/gioithieu/gioithieu.htm
"
,
controller
:
"
gioithieuController
"
}
}
})
});
=======
// myApp.directive('ngConfirmClick', [ function() {
// myApp.directive('ngConfirmClick', [ function() {
// return {
// return {
// link : function(scope, element, attr) {
// link : function(scope, element, attr) {
...
@@ -168,4 +164,3 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
...
@@ -168,4 +164,3 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
// }
// }
// };
// };
// } ])
// } ])
>>>>>>>
master
src/main/resources/public/pages/leaveform/leaveForm.html
View file @
5c69f55e
...
@@ -116,9 +116,9 @@
...
@@ -116,9 +116,9 @@
<td>
{{lf.status}}
</td>
<td>
{{lf.status}}
</td>
<td><a
ui-sref=
"leaveFormDetail({id: lf.id})"
>
Xem
</a></td>
<td><a
ui-sref=
"leaveFormDetail({id: lf.id})"
>
Xem
</a></td>
<td><a
href=
"
/#/leaveform
"
ng-click=
"getLf(lf);"
onclick=
"document.getElementById('updateDivLF').style.display = 'block'"
>
Sửa
</a></td>
<td><a
href=
"
#
"
ng-click=
"getLf(lf);"
onclick=
"document.getElementById('updateDivLF').style.display = 'block'"
>
Sửa
</a></td>
<td><a
href=
"/#/leaveform"
ng-click=
"delete(lf
);"
>
Xoá
</a></td>
<td><a
ui-sref=
"leaveForm"
ng-click=
"delete(lf); leaveFormController.reloadDataTable(
);"
>
Xoá
</a></td>
<td><a
href=
"
/#/leaveform
"
ng-click=
"updateStatus(lf)"
>
Duyệt
</a></td>
<td><a
href=
"
#
"
ng-click=
"updateStatus(lf)"
>
Duyệt
</a></td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
src/main/resources/public/pages/leaveform/leaveFormController.js
View file @
5c69f55e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$state
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$
route
,
$
state
)
{
console
.
log
(
"
Leave Form controller
"
);
console
.
log
(
"
Leave Form controller
"
);
$scope
.
lf
=
{
$scope
.
lf
=
{
...
@@ -41,8 +41,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -41,8 +41,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
url
:
"
http://localhost:8080/employee/leaveform/delete/
"
+
lf
.
id
url
:
"
http://localhost:8080/employee/leaveform/delete/
"
+
lf
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
};
};
...
@@ -56,9 +58,9 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -56,9 +58,9 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
$state
.
reload
();
// $window.location.reload();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
...
@@ -79,8 +81,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -79,8 +81,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
data
:
$scope
.
lfdto
data
:
$scope
.
lfdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
...
@@ -92,8 +96,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -92,8 +96,10 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
// data: $scope.lfdto
// data: $scope.lfdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
});
});
\ No newline at end of file
src/main/resources/public/pages/leaveform/leaveFormDetailController.js
View file @
5c69f55e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormDetailController
"
,
function
(
$scope
,
$http
,
$stateParams
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormDetailController
"
,
function
(
$scope
,
$http
,
$stateParams
,
$state
)
{
console
.
log
(
"
Leave Form Detail Controller
"
);
console
.
log
(
"
Leave Form Detail Controller
"
);
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
...
@@ -21,8 +21,10 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
...
@@ -21,8 +21,10 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
url
:
"
http://localhost:8080/employee/leaveform/
"
+
id
+
"
/status
"
,
url
:
"
http://localhost:8080/employee/leaveform/
"
+
id
+
"
/status
"
,
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
});
});
\ No newline at end of file
src/main/resources/public/pages/timesheet/index.html
deleted
100644 → 0
View file @
a98ad627
<!DOCTYPE html>
<html
lang=
"en"
ng-app =
"quantrivanphong"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Report
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<script
src=
"//unpkg.com/@uirouter/angularjs/release/angular-ui-router.min.js"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity=
"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin=
"anonymous"
></script>
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity=
"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin=
"anonymous"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.7.8/angular.min.js"
></script>
<script
src=
"app.js"
></script>
</head>
<body>
<div
ng-view
></div>
</body>
</html>
\ No newline at end of file
src/main/resources/public/pages/timesheet/timeSheetDetail.html
View file @
5c69f55e
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<br><br>
<br><br>
<div>
<div>
<tr>
<tr>
<h3>
Nhận xét
</h3>
<h3>
Trạng thái
</h3>
<td>
{{timeSheetDetail.checked}}
</td>
<td>
{{timeSheetDetail.checked}}
</td>
</tr>
</tr>
</div>
</div>
...
...
src/main/resources/public/pages/timesheet/timeSheetDetailController.js
View file @
5c69f55e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetDetailController
"
,
function
(
$scope
,
$http
,
$stateParams
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetDetailController
"
,
function
(
$scope
,
$http
,
$stateParams
,
$state
)
{
console
.
log
(
"
Time Sheet Detail Controller
"
);
console
.
log
(
"
Time Sheet Detail Controller
"
);
$scope
.
tsd
=
{
$scope
.
tsd
=
{
...
@@ -30,8 +30,10 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
...
@@ -30,8 +30,10 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
data
:
$scope
.
tsd
data
:
$scope
.
tsd
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
});
});
\ No newline at end of file
src/main/resources/public/pages/timesheet/timesheetController.js
View file @
5c69f55e
/*
/*
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$state
)
{
console
.
log
(
"
Time Sheet controller
"
);
console
.
log
(
"
Time Sheet controller
"
);
$scope
.
ts
=
{
$scope
.
ts
=
{
...
@@ -40,9 +40,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -40,9 +40,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
url
:
"
http://localhost:8080/eproject/timesheet/delete/
"
+
ts
.
id
url
:
"
http://localhost:8080/eproject/timesheet/delete/
"
+
ts
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$s
cope
.
config
.
timeSheets
=
response
.
data
;
$s
tate
.
reload
()
;
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
};
};
...
@@ -56,8 +57,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -56,8 +57,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
...
@@ -79,8 +82,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -79,8 +82,10 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$state
.
reload
();
});
});
}
}
}).
directive
(
'
pgnTable
'
,
[
'
$compile
'
,
function
(
$compile
)
{
}).
directive
(
'
pgnTable
'
,
[
'
$compile
'
,
function
(
$compile
)
{
...
...
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