Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public CompasResponse UploadClaim(String filePath) {
- try
- {
- ArrayList<Claim>list = getClaimsExcel(filePath);
- if (uploadClaims(list))
- {
- return new CompasResponse(200, "Uploaded Successfully");
- } else {
- return new CompasResponse(201, "Oops! No Records to upload");
- }
- }
- catch(IOException e) { e.printStackTrace(); return new CompasResponse(201, "Error. Could not process uploaded document."); }
- }
- $scope.uploadClaim = function()
- {
- console.log('uploading: ', $scope.myFile);
- uploadclaimSvc.saveFile($scope.myFile, $scope.orgId).success(function(response){
- if (response.respCode == 200) {
- logger.logSuccess("Great! The service information was saved successfully.")
- } else {
- logger.logWarning(response.respMessage);
- }
- });
- }
- }]);
- uploadclaimApp.service('uploadclaimSvc', function($http){
- this.saveFile = function (file,orgId) {
- console.log("uploading file...");
- var fd = new FormData();
- fd.append('file', file);
- fd.append('orgId',orgId);
- return $http({
- url: '/compas/rest/transaction/uploadclaim',
- method: 'POST',
- transformRequest: angular.identity,
- headers: { 'Content-Type': undefined },
- data: fd
- });
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement