Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. @Override
  2. public CompasResponse UploadClaim(String filePath) {
  3. try
  4. {
  5. ArrayList<Claim>list = getClaimsExcel(filePath);
  6. if (uploadClaims(list))
  7. {
  8.  
  9. return new CompasResponse(200, "Uploaded Successfully");
  10. } else {
  11. return new CompasResponse(201, "Oops! No Records to upload");
  12. }
  13. }
  14. catch(IOException e) { e.printStackTrace(); return new CompasResponse(201, "Error. Could not process uploaded document."); }
  15.  
  16. }
  17.  
  18. $scope.uploadClaim = function()
  19. {
  20. console.log('uploading: ', $scope.myFile);
  21. uploadclaimSvc.saveFile($scope.myFile, $scope.orgId).success(function(response){
  22. if (response.respCode == 200) {
  23. logger.logSuccess("Great! The service information was saved successfully.")
  24. } else {
  25. logger.logWarning(response.respMessage);
  26. }
  27. });
  28. }
  29. }]);
  30.  
  31. uploadclaimApp.service('uploadclaimSvc', function($http){
  32. this.saveFile = function (file,orgId) {
  33. console.log("uploading file...");
  34. var fd = new FormData();
  35. fd.append('file', file);
  36. fd.append('orgId',orgId);
  37. return $http({
  38. url: '/compas/rest/transaction/uploadclaim',
  39. method: 'POST',
  40. transformRequest: angular.identity,
  41. headers: { 'Content-Type': undefined },
  42. data: fd
  43. });
  44. };
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement