Commit 7e7cd834 authored by neo's avatar neo

[DEV] add approval exception deal

parent 01a9a69e
...@@ -452,12 +452,6 @@ public class ReportServiceImpl { ...@@ -452,12 +452,6 @@ public class ReportServiceImpl {
public OperationResultDto generateData(String projectId, EnumServiceType serviceType, Boolean isMergeManualData, public OperationResultDto generateData(String projectId, EnumServiceType serviceType, Boolean isMergeManualData,
Integer periodParam, Integer reportType, Optional<String> generator) { Integer periodParam, Integer reportType, Optional<String> generator) {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
try {
if (serviceType.equals(EnumServiceType.VAT) && (periodParam == null || periodParam <= 0)) {
operationResultDto.setResultMsg("PeriodRequiredForVAT");
return operationResultDto;
}
MyAsserts.assertEq(serviceType, EnumServiceType.VAT, new NotFoundException()); MyAsserts.assertEq(serviceType, EnumServiceType.VAT, new NotFoundException());
PeriodJobExample example = new PeriodJobExample(); PeriodJobExample example = new PeriodJobExample();
example.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(periodParam) example.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(periodParam)
...@@ -466,6 +460,11 @@ public class ReportServiceImpl { ...@@ -466,6 +460,11 @@ public class ReportServiceImpl {
String status = periodApprovalMapper.getStatusByProjectIdAndPeriod(projectId, periodParam); String status = periodApprovalMapper.getStatusByProjectIdAndPeriod(projectId, periodParam);
MyAsserts.assertTrue(status == null || status.equals(Constant.APPROVAL_DISAGREED), Exceptions.REPORT_IN_PROCESS_OR_AGREED_EXCEPTION); MyAsserts.assertTrue(status == null || status.equals(Constant.APPROVAL_DISAGREED), Exceptions.REPORT_IN_PROCESS_OR_AGREED_EXCEPTION);
try {
if (serviceType.equals(EnumServiceType.VAT) && (periodParam == null || periodParam <= 0)) {
operationResultDto.setResultMsg("PeriodRequiredForVAT");
return operationResultDto;
}
List<Template> templates = getTemplatesByProjectId(projectId); List<Template> templates = getTemplatesByProjectId(projectId);
......
...@@ -2539,7 +2539,7 @@ ...@@ -2539,7 +2539,7 @@
}; };
$scope.commitApprove = function(){ $scope.commitApprove = function(){
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.month).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.month).success(function(result){
if(result&&result=='committed'){ if(result&&result=='committed'){
SweetAlert.swal({ SweetAlert.swal({
title: "warning!", title: "warning!",
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
}, },
approvalStatus:function(projectId,period){ approvalStatus:function(projectId,period){
return $http.get('/approval/'+projectId+'/'+period,apiConfig.createVat({ignoreLoadingBar: true})) return $http.get('/approval/status/'+projectId+'/'+period,apiConfig.createVat({ignoreLoadingBar: true}))
} }
}; };
}]); }]);
\ No newline at end of file
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
},1000); },1000);
} }
}).error(function () { }).error(function (data) {
$log.debug("generate all report may be some error"); $log.debug("generate all report may be some error");
// taskError(_this); // taskError(_this);
}); });
......
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