Commit c2ba1016 authored by Phạm Duy Phi's avatar Phạm Duy Phi

no message

parent 6faa8f1a
...@@ -135,4 +135,8 @@ public class LeaveFormBusiness { ...@@ -135,4 +135,8 @@ public class LeaveFormBusiness {
public LeaveForm showLeaveFormById(int id) { public LeaveForm showLeaveFormById(int id) {
return leaveFormRepository.findLeaveFormById(id); return leaveFormRepository.findLeaveFormById(id);
} }
public List<LeaveType> getLeaveTypeList() {
return leaveTypeRepository.findAll();
}
} }
package com.itsol.quantrivanphong.report.leaveform.controller; package com.itsol.quantrivanphong.report.leaveform.controller;
import com.itsol.quantrivanphong.exception.InputException; import com.itsol.quantrivanphong.exception.InputException;
import com.itsol.quantrivanphong.model.LeaveType;
import com.itsol.quantrivanphong.report.leaveform.business.LeaveFormBusiness; 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.*;
...@@ -76,4 +76,9 @@ public class LeaveFormController { ...@@ -76,4 +76,9 @@ public class LeaveFormController {
public ResponseEntity<LeaveForm> showLeaveFormById(@PathVariable int id) { public ResponseEntity<LeaveForm> showLeaveFormById(@PathVariable int id) {
return ResponseEntity.ok(leaveFormBusiness.showLeaveFormById(id)); return ResponseEntity.ok(leaveFormBusiness.showLeaveFormById(id));
} }
@GetMapping(path = "/leaveType/getAll")
public ResponseEntity<List<LeaveType>> getAllLeaveType() {
return ResponseEntity.ok(leaveFormBusiness.getLeaveTypeList());
}
} }
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<script src="common/js/jquery.dataTables.js"></script> <script src="common/js/jquery.dataTables.js"></script>
<script src="common/js/dataTables.bootstrap4.js"></script> <script src="common/js/dataTables.bootstrap4.js"></script>
<!-- Custom scripts for all pages--> <!-- Custom scripts for all pages-->
<script src="common/js/sb-admin.min.js"></script>\ <script src="common/js/sb-admin.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-sanitize.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-sanitize.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.3.3.js"></script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.3.3.js"></script>
......
...@@ -46,14 +46,18 @@ ...@@ -46,14 +46,18 @@
<tr> <tr>
<td><label>Employee Id</label></td> <td><label>Employee Id</label></td>
<td> <td>
<input type="text" maxlength="10" value="" ng-model="lfdto.employeeId" style="width: 100%;"/> <input type="text" maxlength="10" value="" ng-model="lfdto.employeeId"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label>Leave Type Id</label></td> <td><label>Leave Type Id</label></td>
<td> <td>
<input type="text" maxlength="10" value="" ng-model="lfdto.leaveTypeId" style="width: 100%;"/> <!-- <input type="text" maxlength="10" value="" ng-model="lfdto.leaveTypeId" style="width: 100%;"/>-->
<select ng-model="lfdto.leaveTypeId">
<option value="">Select Leave Type</option>
<option ng-repeat="lf in leaveTypeList" value="{{lf.id}}">{{lf.name}}</option>
</select>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -33,6 +33,16 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http ...@@ -33,6 +33,16 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
console.log(response) console.log(response)
}); });
//get all leave type
$http({
method : 'GET',
url : "http://localhost:8080/employee/leaveType/getAll"
}).then(function successCallback(response) {
console.log(response);
$scope.leaveTypeList=response.data;
}, function errorCallback(response) {
console.log(response)
});
//delete leave form //delete leave form
$scope.delete = function (lf) { $scope.delete = function (lf) {
$http({ $http({
......
...@@ -56,8 +56,9 @@ ...@@ -56,8 +56,9 @@
<!-- <input type="text" maxlength="10" value="" ng-model="tsdto.eprojectId" style="width: 100%;"/>--> <!-- <input type="text" maxlength="10" value="" ng-model="tsdto.eprojectId" style="width: 100%;"/>-->
<!-- </td>--> <!-- </td>-->
<td> <td>
<select ng-repeat="ep in eProjectList"> <select ng-model="tsdto.eprojectId">
<option value="ahihi">{{ep.project.name}}</option> <option value="">Select Project</option>
<option ng-repeat="ep in eProjectList" value="{{ep.id}}">{{ep.project.name}}</option>
</select> </select>
</td> </td>
</tr> </tr>
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
<tr> <tr>
<td><label>Employee Id</label></td> <td><label>Employee Id</label></td>
<td> <td>
<input type="text" maxlength="10" value="" ng-model="tsdto.employeeId" style="width: 100%;"/> <input type="text" maxlength="10" value="" ng-model="tsdto.employeeId"/>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -56,8 +56,9 @@ ...@@ -56,8 +56,9 @@
<!-- <input type="text" maxlength="10" value="" ng-model="tsdto.eprojectId" style="width: 100%;"/>--> <!-- <input type="text" maxlength="10" value="" ng-model="tsdto.eprojectId" style="width: 100%;"/>-->
<!-- </td>--> <!-- </td>-->
<td> <td>
<select ng-repeat="ep in eProjectList"> <select ng-model="tsdto.eprojectId">
<option value="ahihi">{{ep.project.name}}</option> <option value="">Select Project</option>
<option ng-repeat="ep in eProjectList" value="{{ep.id}}">{{ep.project.name}}</option>
</select> </select>
</td> </td>
</tr> </tr>
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
<tr> <tr>
<td><label>Employee Id</label></td> <td><label>Employee Id</label></td>
<td> <td>
<input type="text" maxlength="10" value="" ng-model="tsdto.employeeId" style="width: 100%;"/> <input type="text" maxlength="10" value="" ng-model="tsdto.employeeId"/>
</td> </td>
</tr> </tr>
<tr> <tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment