Commit a19001fdd33b6b2b391590a4b6df1312b025d609

Authored by Anchit Jindal
1 parent ec74ee75dd
Exists in master

new code added

app/views/fbo-admin/dashboard.controller.js
... ... @@ -89,7 +89,7 @@
89 89 toastr.success('Created Successfully', {
90 90 closeButton: true
91 91 })
92   - $scope.feature.accountId = result;
  92 + $scope.feature.accountId = result.id;
93 93 var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem
94 94 + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration="
95 95 + $scope.feature.posAccountingIntegration + "&posVeederRootIntegration=" + $scope.feature.posVeederRootIntegration
... ...
app/views/fbo-flight/flight.html
... ... @@ -84,7 +84,8 @@
84 84 <div class="col-lg-8">
85 85 <!-- <h2 ng-click="editName()" ng-show="showCompany" style="cursor: pointer;">Tellus Institute</h2> -->
86 86 <div style="margin-top: 20px;">
87   - <input type="text" style="width:50%; float: left;" placeholder="Enter Company Name" ng-model="user.companyName" class="form-control companyNameError" ng-keyup="companyNameValid()">
  87 + <input type="text" style="width:50%; float: left;" placeholder="Enter Company Name" ng-model="user.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameError">
  88 +
88 89 <span class="redAstrick" style="margin: 0 5px;">*</span>
89 90 <label class="customErrorMessage" ng-show="comnayNameInvalid" style="margin-top: 7px;">This field is required.</label>
90 91 <div class="clearfix"></div>
... ... @@ -308,7 +309,7 @@
308 309 <div class="col-lg-5">
309 310 <div class="ibox float-e-margins">
310 311 <div class="ibox-title">
311   - <h5>Account Authenticatio & Payment Method</h5>
  312 + <h5>Account Authentication & Payment Method</h5>
312 313  
313 314 </div>
314 315 <div class="ibox-content">
... ...
app/views/fbo-flight/flightDept.controller.js
... ... @@ -64,10 +64,11 @@
64 64 console.log($scope.user)
65 65 var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote;
66 66 FBOFlight.registerUser(formdata).then(function(result) {
67   - $scope.registerId = result;
  67 + $scope.registerId = result.id;
  68 + $scope.companyId = result.companyId;
68 69 $scope.data.accountId = $scope.registerId;
69   - $scope.aircraft.accountId = $scope.registerId;
70   - if($scope.aircraft.accountId == $scope.registerId){
  70 + $scope.aircraft.accountId = $scope.companyId;
  71 + if($scope.aircraft.accountId == $scope.companyId){
71 72 $scope.saveCompanyData();
72 73 }
73 74 toastr.success('Created Successfully', {
... ... @@ -148,6 +149,7 @@
148 149 $scope.addData = [];
149 150  
150 151 $scope.saveCompanyData = function(){
  152 + console.log('=========2========',$scope.aircraftDetails);
151 153 for(var i=0; i<$scope.aircraftDetails.length;i++){
152 154 $scope.addData.push({
153 155 'tail': $scope.aircraftDetails[i].tail,
... ... @@ -173,6 +175,13 @@
173 175 });
174 176  
175 177 }
  178 + getCompanyName();
  179 + function getCompanyName(){
  180 + $scope.showLoader = true;
  181 + FBOFlight.getCompanyName().then(function(result) {
  182 + $scope.compNameList = result;
  183 + })
  184 + }
176 185  
177 186 // getData();
178 187 // function getData(){
... ...
app/views/fbo-flight/flightDeptService.js
... ... @@ -92,6 +92,21 @@
92 92 })
93 93 return deferred.promise;
94 94 }
  95 +
  96 + this.getCompanyName = function() {
  97 + var deferred = $q.defer();
  98 + $http({
  99 + method : 'GET',
  100 + url : BE.url +'/company/searchName',
  101 + headers : {'Content-Type': 'application/json'},
  102 + })
  103 + .then(function (result){
  104 + deferred.resolve(result.data);
  105 + },function (result){
  106 + deferred.resolve(result.data);
  107 + })
  108 + return deferred.promise;
  109 + }
95 110 }
96 111  
97 112 })();
98 113 \ No newline at end of file
... ...
app/views/updateFBODept/updateFBODept.controller.js
... ... @@ -11,31 +11,40 @@
11 11 $scope.aircraft = {};
12 12 $scope.updateData = {};
13 13 var userProfileID = $stateParams.id;
  14 + $scope.companyId;
  15 +
14 16 UpdateAllFBODept.getALlFBOData(userProfileID).then(function(result) {
15   - console.log(result)
16   - $scope.user = result;
17   - $scope.aircraft.accountId = result.account.id;
18   - $scope.user.userTypeId = result.userType.id;
19   - UpdateAllFBODept.getNotes(userProfileID).then(function(response) {
20   - $scope.user.clientNote = response[0].notes
21   - $scope.user.userNoteId = response[0].id;
  17 + console.log(result)
  18 + $scope.user = result;
  19 + // $scope.aircraft.accountId = result.account.id;
  20 + $scope.user.userTypeId = result.userType.id;
  21 + UpdateAllFBODept.getNotes(userProfileID).then(function(response) {
  22 + $scope.user.clientNote = response[0].notes
  23 + $scope.user.userNoteId = response[0].id;
  24 + })
  25 + // $scope.feature = result.accountFeatureControl;
  26 + // console.log($scope.feature,"dsdsdsds")
  27 + if($scope.user.account.user.status == 'ACTIVE'){
  28 + $scope.status = true;
  29 + }else {
  30 + $scope.status = false;
  31 + }
22 32 })
23   - // $scope.feature = result.accountFeatureControl;
24   - // console.log($scope.feature,"dsdsdsds")
25   - if($scope.user.account.user.status == 'ACTIVE'){
26   - $scope.status = true;
27   - }else {
28   - $scope.status = false;
29   - }
  33 +
  34 + UpdateAllFBODept.getAssociatedCompany(userProfileID).then(function(result) {
  35 + console.log('=======q===',result)
  36 + $scope.companyId = result.id;
  37 + getCrafts(result.id);
  38 + $scope.aircraft.accountId = result.id;
30 39 })
31 40  
32   - getCrafts();
33   - function getCrafts(){
34   - UpdateAllFBODept.getAircrafts(userProfileID).then(function(response) {
  41 +
  42 + function getCrafts(id){
  43 + UpdateAllFBODept.getAircrafts(id).then(function(response) {
35 44 $scope.getCraftList = response;
36 45 for(var i=0;i<$scope.getCraftList.length;i++){
37   - $scope.getCraftList[i].sizeId = $scope.getCraftList[i].userAircraftSize.id;
38   - $scope.getCraftList[i].size = $scope.getCraftList[i].userAircraftSize.size;
  46 + $scope.getCraftList[i].sizeId = $scope.getCraftList[i].compAircraftSize.id;
  47 + $scope.getCraftList[i].size = $scope.getCraftList[i].compAircraftSize.size;
39 48 }
40 49 })
41 50 }
... ... @@ -160,15 +169,29 @@
160 169 })
161 170 }
162 171  
163   - $scope.aircraftData = {};
164   - $scope.aircraftData.aircraftList = [];
  172 +
  173 +
165 174 $scope.addAircraft = function(){
  175 + $scope.aircraftListData = {};
  176 + $scope.addData = [];
  177 + $scope.aircraftListData.aircraftList= [];
  178 +
  179 + $scope.addData.push({
  180 + 'tail': $scope.aircraft.tail,
  181 + 'make': $scope.aircraft.make,
  182 + 'model': $scope.aircraft.model,
  183 + 'sizeId' : $scope.aircraft.sizeId
  184 + });
  185 + console.log('$scope.addData',$scope.addData);
  186 +
  187 + $scope.aircraftListData.aircraftList = $scope.addData;
  188 + $scope.aircraftListData.accountId = $scope.companyId;
166 189 console.log($scope.aircraft)
167   - $scope.aircraftData.aircraftList.push($scope.aircraft);
  190 + //$scope.aircraftData.aircraftList.push($scope.aircraft);
168 191  
169   - FBOFlight.addAircraft($scope.aircraftData).then(function(result) {
  192 + FBOFlight.addAircraft($scope.aircraftListData).then(function(result) {
170 193 $('#myModal4').modal('hide');
171   - getCrafts();
  194 + getCrafts($scope.companyId);
172 195 $scope.resetData();
173 196 toastr.success('Created Successfully', {
174 197 closeButton: true
... ... @@ -190,8 +213,8 @@
190 213 $scope.update = function(airdata){
191 214 $("#myModal5").modal('show');
192 215 $scope.aircraft = airdata;
193   - console.log($scope.aircraft)
194   - $scope.aircraft.accountId = $scope.user.account.id;
  216 + console.log('--------$scope.companyId---',$scope.companyId);
  217 + $scope.aircraft.accountId = $scope.companyId;
195 218  
196 219 FBOFlight.getModal($scope.aircraft.make).then(function(result) {
197 220 $scope.aircraftModalList = result;
... ... @@ -213,7 +236,7 @@
213 236 $scope.updateAircraftData.model = updateAircraft.model;
214 237 $scope.updateAircraftData.sizeId = updateAircraft.sizeId;
215 238 $scope.updateAircraftData.tail = updateAircraft.tail;
216   - $scope.updateAircraftData.accountId = updateAircraft.accountId;
  239 + $scope.updateAircraftData.accountId = $scope.companyId;
217 240 console.log($scope.updateAircraftData)
218 241  
219 242 $scope.updatecraftData.aircraftList.push($scope.updateAircraftData);
... ... @@ -222,7 +245,7 @@
222 245 UpdateAllFBODept.updateAircraft($scope.updatecraftData).then(function(result) {
223 246 $('#myModal5').modal('hide');
224 247 $scope.resetData();
225   - getCrafts();
  248 + getCrafts($scope.companyId);
226 249 toastr.success('Updated Successfully', {
227 250 closeButton: true
228 251 })
... ... @@ -241,14 +264,14 @@
241 264 toastr.success(''+result.success+'', {
242 265 closeButton: true
243 266 })
244   - getCrafts();
  267 + getCrafts($scope.companyId);
245 268 })
246 269 }
247 270  
248 271 $scope.resetData = function() {
249 272 $scope.aircraft = {};
250   - $scope.aircraft.accountId = $scope.user.account.id;
251   - $scope.aircraftData.aircraftList = [];
  273 + $scope.aircraft.accountId = $scope.companyId;
  274 + $scope.aircraftListData.aircraftList = [];
252 275 getData();
253 276 }
254 277  
... ...
app/views/updateFBODept/updateFBODept.service.js
... ... @@ -19,6 +19,20 @@
19 19 })
20 20 return deferred.promise;
21 21 }
  22 +
  23 + this.getAssociatedCompany = function(id) {
  24 +
  25 + var deferred = $q.defer();
  26 + $http({
  27 + method : 'GET',
  28 + url : BE.url +'/account/user/getFlightDeptCompany/'+id,
  29 + headers : {'Content-Type': 'application/json'},
  30 + })
  31 + .success(function(result) {
  32 + deferred.resolve(result);
  33 + })
  34 + return deferred.promise;
  35 + }
22 36  
23 37 this.getNotes = function(id) {
24 38  
... ...