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
5a3250a9
Commit
5a3250a9
authored
Jun 17, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new page
parent
8b8c4034
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
182 additions
and
104 deletions
+182
-104
src/main/java/com/itsol/quantrivanphong/model/LeaveType.java
src/main/java/com/itsol/quantrivanphong/model/LeaveType.java
+2
-0
src/main/java/com/itsol/quantrivanphong/report/leaveform/business/LeaveFormBusiness.java
...vanphong/report/leaveform/business/LeaveFormBusiness.java
+1
-1
src/main/java/com/itsol/quantrivanphong/report/leavetype/business/LeaveTypeBusiness.java
...vanphong/report/leavetype/business/LeaveTypeBusiness.java
+69
-0
src/main/java/com/itsol/quantrivanphong/report/leavetype/controller/LeaveTypeController.java
...hong/report/leavetype/controller/LeaveTypeController.java
+58
-0
src/main/java/com/itsol/quantrivanphong/report/leavetype/dto/LeaveTypeDTO.java
...ol/quantrivanphong/report/leavetype/dto/LeaveTypeDTO.java
+15
-0
src/main/java/com/itsol/quantrivanphong/report/leavetype/repository/LeaveTypeRepository.java
...hong/report/leavetype/repository/LeaveTypeRepository.java
+14
-0
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
...phong/report/timesheet/repository/EProjectRepository.java
+2
-2
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+1
-1
src/main/resources/public/pages/leaveform/leaveFormController.js
...n/resources/public/pages/leaveform/leaveFormController.js
+6
-6
src/main/resources/public/pages/leaveform/leaveFormDetail.html
...ain/resources/public/pages/leaveform/leaveFormDetail.html
+1
-1
src/main/resources/public/pages/leaveform/leaveFormDetailController.js
...urces/public/pages/leaveform/leaveFormDetailController.js
+2
-2
src/main/resources/public/pages/timesheet/timeSheetController.js
...n/resources/public/pages/timesheet/timeSheetController.js
+6
-86
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
+2
-2
src/main/resources/public/pages/timesheet/timesheet.html
src/main/resources/public/pages/timesheet/timesheet.html
+2
-2
No files found.
src/main/java/com/itsol/quantrivanphong/model/LeaveType.java
View file @
5a3250a9
...
@@ -2,6 +2,7 @@ package com.itsol.quantrivanphong.model;
...
@@ -2,6 +2,7 @@ package com.itsol.quantrivanphong.model;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
...
@@ -14,6 +15,7 @@ import java.util.List;
...
@@ -14,6 +15,7 @@ import java.util.List;
@NoArgsConstructor
@NoArgsConstructor
@Entity
@Entity
@Table
(
name
=
"leave_type"
)
@Table
(
name
=
"leave_type"
)
@Builder
public
class
LeaveType
{
public
class
LeaveType
{
@Id
@Id
...
...
src/main/java/com/itsol/quantrivanphong/report/leaveform/business/LeaveFormBusiness.java
View file @
5a3250a9
...
@@ -6,7 +6,7 @@ import com.itsol.quantrivanphong.model.LeaveForm;
...
@@ -6,7 +6,7 @@ import com.itsol.quantrivanphong.model.LeaveForm;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO
;
import
com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO
;
import
com.itsol.quantrivanphong.report.leaveform.repository.LeaveFormRepository
;
import
com.itsol.quantrivanphong.report.leaveform.repository.LeaveFormRepository
;
import
com.itsol.quantrivanphong.report.leave
form
.repository.LeaveTypeRepository
;
import
com.itsol.quantrivanphong.report.leave
type
.repository.LeaveTypeRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
src/main/java/com/itsol/quantrivanphong/report/leavetype/business/LeaveTypeBusiness.java
0 → 100644
View file @
5a3250a9
package
com.itsol.quantrivanphong.report.leavetype.business
;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
com.itsol.quantrivanphong.report.leavetype.dto.LeaveTypeDTO
;
import
com.itsol.quantrivanphong.report.leavetype.repository.LeaveTypeRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
public
class
LeaveTypeBusiness
{
@Autowired
LeaveTypeRepository
leaveTypeRepository
;
public
String
addLeaveType
(
LeaveTypeDTO
leaveTypeDTO
)
{
String
message
;
LeaveType
leaveType
=
leaveTypeRepository
.
save
(
LeaveType
.
builder
()
.
name
(
leaveTypeDTO
.
getName
())
.
descriptions
(
leaveTypeDTO
.
getDescriptions
())
.
status
(
true
)
.
build
());
if
(
leaveType
!=
null
)
{
message
=
"Insert leave type success"
;
}
else
{
message
=
"Insert leave type failed"
;
}
return
message
;
}
@Transactional
public
String
deleteLeaveType
(
int
leaveTypeId
)
{
String
message
;
LeaveType
leaveType
=
leaveTypeRepository
.
findLeaveTypeById
(
leaveTypeId
);
if
(
leaveType
!=
null
)
{
leaveTypeRepository
.
delete
(
leaveType
);
if
(
leaveTypeRepository
.
findLeaveTypeById
(
leaveTypeId
)
!=
null
)
{
message
=
"Delete failed!"
;
}
else
{
message
=
"Delete success!"
;
}
}
else
{
message
=
"Leave Form does not exist"
;
}
return
message
;
}
@Transactional
public
String
updateLeaveType
(
LeaveTypeDTO
leaveTypeDTO
)
{
String
message
;
LeaveType
leaveType
=
leaveTypeRepository
.
findLeaveTypeById
(
leaveTypeDTO
.
getId
());
if
(
leaveType
!=
null
)
{
int
i
=
leaveTypeRepository
.
updateLeaveType
(
leaveTypeDTO
.
getName
(),
leaveTypeDTO
.
getDescriptions
(),
leaveTypeDTO
.
getId
());
if
(
i
==
1
)
{
message
=
"Update success"
;
}
else
{
message
=
"Update failed"
;
}
}
else
{
message
=
"Leave Type does not exist"
;
}
return
message
;
}
public
List
<
LeaveType
>
getLeaveTypeList
()
{
return
leaveTypeRepository
.
findAll
();
}
}
src/main/java/com/itsol/quantrivanphong/report/leavetype/controller/LeaveTypeController.java
0 → 100644
View file @
5a3250a9
package
com.itsol.quantrivanphong.report.leavetype.controller
;
import
com.itsol.quantrivanphong.exception.InputException
;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
com.itsol.quantrivanphong.report.leaveform.controller.Notification
;
import
com.itsol.quantrivanphong.report.leavetype.business.LeaveTypeBusiness
;
import
com.itsol.quantrivanphong.report.leavetype.dto.LeaveTypeDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
path
=
"/leavetype"
)
public
class
LeaveTypeController
{
@Autowired
LeaveTypeBusiness
leaveTypeBusiness
;
@PostMapping
(
path
=
"/add"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
addLeaveForm
(
@RequestBody
LeaveTypeDTO
leaveTypeDTO
)
{
String
message
;
try
{
if
(
leaveTypeDTO
.
getName
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tên không được để trống"
);
if
(
leaveTypeDTO
.
getDescriptions
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Mô tả không được để trống"
);
message
=
leaveTypeBusiness
.
addLeaveType
(
leaveTypeDTO
);
}
catch
(
InputException
e
)
{
message
=
e
.
getMessage
();
}
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
));
}
@DeleteMapping
(
"/delete/{leaveTypeId}"
)
public
ResponseEntity
deleteLeaveForm
(
@PathVariable
int
leaveTypeId
)
{
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
leaveTypeBusiness
.
deleteLeaveType
(
leaveTypeId
)));
}
@PostMapping
(
path
=
"/update"
,
consumes
=
"application/json"
,
produces
=
"application/json"
)
public
ResponseEntity
updateLeaveForm
(
@RequestBody
LeaveTypeDTO
leaveTypeDTO
)
{
String
message
;
try
{
if
(
leaveTypeDTO
.
getName
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Tiêu đề không được để trống"
);
if
(
leaveTypeDTO
.
getDescriptions
().
trim
().
equals
(
""
))
throw
new
InputException
(
"Nội dung không được để trống"
);
message
=
leaveTypeBusiness
.
updateLeaveType
(
leaveTypeDTO
);
}
catch
(
InputException
e
)
{
message
=
e
.
getMessage
();
}
return
ResponseEntity
.
ok
(
new
Notification
(
200
,
message
));
}
@GetMapping
(
path
=
"/getAll"
)
public
ResponseEntity
<
List
<
LeaveType
>>
getAllLeaveType
()
{
return
ResponseEntity
.
ok
(
leaveTypeBusiness
.
getLeaveTypeList
());
}
}
src/main/java/com/itsol/quantrivanphong/report/leavetype/dto/LeaveTypeDTO.java
0 → 100644
View file @
5a3250a9
package
com.itsol.quantrivanphong.report.leavetype.dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LeaveTypeDTO
{
private
int
id
;
private
String
name
;
private
String
descriptions
;
private
boolean
status
;
}
src/main/java/com/itsol/quantrivanphong/report/leave
form
/repository/LeaveTypeRepository.java
→
src/main/java/com/itsol/quantrivanphong/report/leave
type
/repository/LeaveTypeRepository.java
View file @
5a3250a9
package
com.itsol.quantrivanphong.report.leave
form
.repository
;
package
com.itsol.quantrivanphong.report.leave
type
.repository
;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
com.itsol.quantrivanphong.model.LeaveType
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
public
interface
LeaveTypeRepository
extends
JpaRepository
<
LeaveType
,
Integer
>
{
public
interface
LeaveTypeRepository
extends
JpaRepository
<
LeaveType
,
Integer
>
{
LeaveType
findLeaveTypeById
(
int
id
);
LeaveType
findLeaveTypeById
(
int
id
);
@Modifying
@Query
(
"update LeaveType lt set lt.name = ?1, lt.descriptions = ?2 where lt.id = ?3"
)
int
updateLeaveType
(
String
name
,
String
descriptions
,
int
id
);
}
}
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
View file @
5a3250a9
...
@@ -8,10 +8,10 @@ import org.springframework.data.jpa.repository.Query;
...
@@ -8,10 +8,10 @@ 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
>
{
//
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
eProjectId
,
Employee
employee
);
...
...
src/main/resources/public/js/app.js
View file @
5a3250a9
...
@@ -101,7 +101,7 @@ angular.module("myApp", ["ngAnimate","ngResource", "ui.router", "ui.bootstrap"])
...
@@ -101,7 +101,7 @@ angular.module("myApp", ["ngAnimate","ngResource", "ui.router", "ui.bootstrap"])
url
:
"
/timesheetDetail/:id
"
,
url
:
"
/timesheetDetail/:id
"
,
views
:{
views
:{
"
content
"
:{
"
content
"
:{
templateUrl
:
"
page/timesheet/timeSheetDetail.html
"
,
templateUrl
:
"
page
s
/timesheet/timeSheetDetail.html
"
,
controller
:
"
timeSheetDetailController
"
controller
:
"
timeSheetDetailController
"
}
}
}
}
...
...
src/main/resources/public/pages/leaveform/leaveFormController.js
View file @
5a3250a9
...
@@ -25,7 +25,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -25,7 +25,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
//get all leave form
//get all leave form
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/employee/leaveform/show
"
url
:
"
http://localhost:808
1
/employee/leaveform/show
"
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
leaveForms
=
response
.
data
;
$scope
.
leaveForms
=
response
.
data
;
...
@@ -36,7 +36,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -36,7 +36,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
//get all leave type
//get all leave type
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/employee/leaveType/getAll
"
url
:
"
http://localhost:808
1
/employee/leaveType/getAll
"
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
leaveTypeList
=
response
.
data
;
$scope
.
leaveTypeList
=
response
.
data
;
...
@@ -47,7 +47,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -47,7 +47,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
$scope
.
delete
=
function
(
lf
)
{
$scope
.
delete
=
function
(
lf
)
{
$http
({
$http
({
method
:
'
DELETE
'
,
method
:
'
DELETE
'
,
url
:
"
http://localhost:808
0
/employee/leaveform/delete/
"
+
lf
.
id
url
:
"
http://localhost:808
1
/employee/leaveform/delete/
"
+
lf
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
$state
.
reload
();
...
@@ -62,7 +62,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -62,7 +62,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
console
.
log
(
$scope
.
lfdto
);
console
.
log
(
$scope
.
lfdto
);
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0/timesheet
/leaveform/add
"
,
url
:
"
http://localhost:808
1/employee
/leaveform/add
"
,
data
:
$scope
.
lfdto
data
:
$scope
.
lfdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -86,7 +86,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -86,7 +86,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
function
update
(){
function
update
(){
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0/timesheet
/leaveform/update
"
,
url
:
"
http://localhost:808
1/employee
/leaveform/update
"
,
data
:
$scope
.
lfdto
data
:
$scope
.
lfdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -101,7 +101,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -101,7 +101,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
function
updateStatus
(
lf
){
function
updateStatus
(
lf
){
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0/timesheet
/leaveform/
"
+
lf
.
id
+
"
/status
"
,
url
:
"
http://localhost:808
1/employee
/leaveform/
"
+
lf
.
id
+
"
/status
"
,
// data: $scope.lfdto
// data: $scope.lfdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
...
src/main/resources/public/pages/leaveform/leaveFormDetail.html
View file @
5a3250a9
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div>
<div>
<tr>
<tr>
<!-- <input type="submit" name="submit" value="Duyệt" ui-sref="leaveForm" ng-click="updateStatus(leaveFormDetail.id)"/>-->
<!-- <input type="submit" name="submit" value="Duyệt" ui-sref="leaveForm" ng-click="updateStatus(leaveFormDetail.id)"/>-->
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"leave
F
orm"
/>
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"leave
f
orm"
/>
</tr>
</tr>
</div>
</div>
<br><br>
<br><br>
...
...
src/main/resources/public/pages/leaveform/leaveFormDetailController.js
View file @
5a3250a9
...
@@ -5,7 +5,7 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
...
@@ -5,7 +5,7 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
console
.
log
(
"
Leave Form Detail Controller
"
);
console
.
log
(
"
Leave Form Detail Controller
"
);
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0/timesheet
/leaveform/
"
+
$stateParams
.
id
url
:
"
http://localhost:808
1/employee
/leaveform/
"
+
$stateParams
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
leaveFormDetail
=
response
.
data
;
$scope
.
leaveFormDetail
=
response
.
data
;
...
@@ -17,7 +17,7 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
...
@@ -17,7 +17,7 @@ angular.module("myApp").controller("leaveFormDetailController", function($scope,
function
updateStatus
(
id
){
function
updateStatus
(
id
){
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0/timesheet
/leaveform/
"
+
id
+
"
/status
"
,
url
:
"
http://localhost:808
1/employee
/leaveform/
"
+
id
+
"
/status
"
,
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
$state
.
reload
();
...
...
src/main/resources/public/pages/timesheet/timeSheetController.js
View file @
5a3250a9
/*
/*
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$window
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$state
)
{
console
.
log
(
"
Time Sheet controller
"
);
console
.
log
(
"
Time Sheet controller
"
);
$scope
.
ts
=
{
$scope
.
ts
=
{
...
@@ -22,7 +22,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -22,7 +22,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
//function getAllTimesheet(){
//function getAllTimesheet(){
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/show
"
url
:
"
http://localhost:808
1
/eproject/timesheet/show
"
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
myTimeSheets
=
response
.
data
;
$scope
.
myTimeSheets
=
response
.
data
;
...
@@ -34,7 +34,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -34,7 +34,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
//get all eproject
//get all eproject
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/eproject/getAll
"
url
:
"
http://localhost:808
1
/eproject/getAll
"
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
eProjectList
=
response
.
data
;
$scope
.
eProjectList
=
response
.
data
;
...
@@ -45,7 +45,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -45,7 +45,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
$scope
.
delete
=
function
(
ts
)
{
$scope
.
delete
=
function
(
ts
)
{
$http
({
$http
({
method
:
'
DELETE
'
,
method
:
'
DELETE
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/delete/
"
+
ts
.
id
url
:
"
http://localhost:808
1
/eproject/timesheet/delete/
"
+
ts
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
$state
.
reload
();
...
@@ -62,7 +62,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -62,7 +62,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
console
.
log
(
$scope
.
tsdto
);
console
.
log
(
$scope
.
tsdto
);
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/add
"
,
url
:
"
http://localhost:808
1
/eproject/timesheet/add
"
,
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -89,7 +89,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -89,7 +89,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
$http
({
$http
({
headers
:
"
content-type: application/json
"
,
headers
:
"
content-type: application/json
"
,
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/update
"
,
url
:
"
http://localhost:808
1
/eproject/timesheet/update
"
,
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -99,84 +99,4 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -99,84 +99,4 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
$state
.
reload
();
$state
.
reload
();
});
});
}
}
// $scope.myTimeSheets = [];
// $scope.save = save;
// $scope.currentPage = 1;
// $scope.timesheetPerPage = 3;
// $scope.maxSize = 5;
// this.myTimeSheets = $scope.myTimeSheets;
// $scope.numOfPage = numOfPage;
// $scope.dataHasLoaded = false;
// $scope.makeTimesheet = function () {
// $scope.myTimeSheets = [];
// for (let i = 1; i <=50 ; i++) {
// $scope.myTimeSheets.push( {text : 'ts'+ i , done:false});
// }
//
// };
// $scope.makeTimesheet();
// $scope.getAllTimesheet = getAllTimesheet;
// //$scope.getTotalTimesheet = getTotalTimesheet;
// getAllTimesheet();
// $scope.pageChangedIndex = pageChangedIndex;
// function pageChangedIndex() {
// console.log($scope.currentPage);
// }
// function numOfPage() {
// return Math.ceil($scope.myTimeSheets.length/ $scope.timesheetPerPage);
//
// }
});
});
// }).directive('pgnTable', ['$compile', function ($compile) {
// return {
// restrict: 'EA',
// templateUrl: 'pages/timesheet/timeSheet.html',
// replace: true,
// scope: {
// pages: "=pgnTable"
// },
// controller: function ($scope) {
// $scope.currentPage=1;
// $scope.numLimit=5;
// $scope.start = 0;
// $scope.$watch("pages",function(newVal){
// if(newVal){
// $scope.pages=Math.ceil($scope.pages.length/$scope.numLimit);
// }
// });
// $scope.hideNext=function(){
// if(($scope.start + $scope.numLimit) < $scope.pages.length){
// return false;
// }
// else
// return true;
// };
// $scope.hidePrev=function(){
// if($scope.start===0){
// return true;
// }
// else
// return false;
// };
// $scope.nextPage=function(){
// console.log("next pages");
// $scope.currentPage++;
// $scope.start=$scope.start+ $scope.numLimit;
// console.log( $scope.start)
// };
// $scope.PrevPage=function(){
// if($scope.currentPage>1){
// $scope.currentPage--;
// }
// console.log("next pages");
// $scope.start=$scope.start - $scope.numLimit;
// console.log( $scope.start)
// };
// },
// compile: function(elem) {
// return function(ielem, $scope) {
// $compile(ielem)($scope);
// };
// }
// };
src/main/resources/public/pages/timesheet/timeSheetDetail.html
View file @
5a3250a9
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<tr>
<tr>
<input
type=
"text"
name=
"check"
placeholder=
"Nhận xét"
ng-model=
"check"
/>
<input
type=
"text"
name=
"check"
placeholder=
"Nhận xét"
ng-model=
"check"
/>
<input
type=
"submit"
name=
"submit"
value=
"Xác nhận"
ng-click=
"updateCheck(timeSheetDetail.id, check);"
ui-sref=
"leaveFormDetail"
/>
<input
type=
"submit"
name=
"submit"
value=
"Xác nhận"
ng-click=
"updateCheck(timeSheetDetail.id, check);"
ui-sref=
"leaveFormDetail"
/>
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"time
S
heet"
/>
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"time
s
heet"
/>
</tr>
</tr>
</div>
</div>
<br><br>
<br><br>
...
...
src/main/resources/public/pages/timesheet/timeSheetDetailController.js
View file @
5a3250a9
...
@@ -11,7 +11,7 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
...
@@ -11,7 +11,7 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/
"
+
$stateParams
.
id
url
:
"
http://localhost:808
1
/eproject/timesheet/
"
+
$stateParams
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
timeSheetDetail
=
response
.
data
;
$scope
.
timeSheetDetail
=
response
.
data
;
...
@@ -25,7 +25,7 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
...
@@ -25,7 +25,7 @@ angular.module("myApp").controller("timeSheetDetailController", function($scope,
$http
({
$http
({
headers
:
{
"
Content-Type
"
:
"
application/json
"
},
headers
:
{
"
Content-Type
"
:
"
application/json
"
},
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:808
0
/eproject/timesheet/update/check
"
,
url
:
"
http://localhost:808
1
/eproject/timesheet/update/check
"
,
data
:
$scope
.
tsd
data
:
$scope
.
tsd
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
...
src/main/resources/public/pages/timesheet/timesheet.html
View file @
5a3250a9
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<th>
Title
</th>
<th>
Title
</th>
<th>
Content
</th>
<th>
Content
</th>
<th>
Note
</th>
<th>
Note
</th>
<th>
Employee
</th>
<th>
Project
</th>
<th>
Create at
</th>
<th>
Create at
</th>
<th
colspan=
"3"
></th>
<th
colspan=
"3"
></th>
</tr>
</tr>
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.updatedAt}}
</td>
<td>
{{ts.updatedAt}}
</td>
<td><a
ui-sref=
"time
S
heetDetail({id: ts.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i></a></td>
<td><a
ui-sref=
"time
s
heetDetail({id: ts.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i></a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
class=
"edit"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Edit"
>

</i></a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
class=
"edit"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Edit"
>

</i></a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"delete(ts);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i></a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"delete(ts);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i></a></td>
</tr>
</tr>
...
...
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