Commit 8ff3192f authored by neo's avatar neo

[DEV] fixed error msg and add trancaction

parent a3cc9785
...@@ -92,11 +92,13 @@ public class ReportGeneratorImpl { ...@@ -92,11 +92,13 @@ public class ReportGeneratorImpl {
for (int i = 0; i < workbook.getNumberOfSheets(); i++) { for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i); Sheet sheet = workbook.getSheetAt(i);
String code = sheet.getSheetName(); String code = sheet.getSheetName();
logger.info("-------------------------------------Begin Job [{}]------------------------------------------------------",code);
job.setCurrentStep(code); job.setCurrentStep(code);
Optional<PeriodTemplate> periodTemplate = resources.getPeriodTemplates().stream()
.filter(a -> a.getCode().equals(code))
.findFirst();
try { try {
Optional<PeriodTemplate> periodTemplate = resources.getPeriodTemplates().stream()
.filter(a -> a.getCode().equals(code))
.findFirst();
Long templateId; Long templateId;
if (periodTemplate.isPresent()) { if (periodTemplate.isPresent()) {
...@@ -387,10 +389,12 @@ public class ReportGeneratorImpl { ...@@ -387,10 +389,12 @@ public class ReportGeneratorImpl {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
job.setStatus(WrapPeriodJobDto.STATUS_ERROR); job.setStatus(WrapPeriodJobDto.STATUS_ERROR);
job.setErrorMsg("cacals report for code " + code + " failed"); job.setErrorMsg("cacals report for code " + code + " failed with msg "+e.getMessage());
} finally { } finally {
periodJobMapper.updateByPrimaryKey(job); periodJobMapper.updateByPrimaryKey(job);
} }
logger.info("-------------------------------------End Job [{}]------------------------------------------------------",code);
} }
} }
......
...@@ -495,7 +495,7 @@ public class ReportServiceImpl { ...@@ -495,7 +495,7 @@ public class ReportServiceImpl {
} catch (Exception e) { } catch (Exception e) {
genJob.setStatus(WrapPeriodJobDto.STATUS_ERROR); genJob.setStatus(WrapPeriodJobDto.STATUS_ERROR);
genJob.setErrorMsg("Sever error"); genJob.setErrorMsg("Sever error "+e.getMessage());
periodJobMapper.updateByPrimaryKey(genJob); periodJobMapper.updateByPrimaryKey(genJob);
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -2540,7 +2540,7 @@ ...@@ -2540,7 +2540,7 @@
$scope.commitApprove = function(){ $scope.commitApprove = function(){
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.month).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.month).success(function(result){
if(result&&result=='committed'){ if(result&&result=='committed'){
SweetAlert.error($translate.instant('报表提审中或审核通过')); SweetAlert.error('报表提审中或审核已通过!');
}else{ }else{
SweetAlert.swal({ SweetAlert.swal({
title: "warning!", title: "warning!",
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
return $q.when(data); return $q.when(data);
},function (data) { },function (data) {
if(data.status==412){ if(data.status==412){
SweetAlert.error($translate.instant('报表提审中或审核通过')); SweetAlert.error('报表提审中或审核已通过!');
}else{ }else{
logInfo.UpdateState = $translate.instant('ManualInputFail'); logInfo.UpdateState = $translate.instant('ManualInputFail');
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
......
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
} }
}).error(function (data,status,config,statusText) { }).error(function (data,status,config,statusText) {
if(status==412){ if(status==412){
SweetAlert.error('报表提审中或审核通过'); SweetAlert.error('报表提审中或审核已通过!');
} }
}); });
......
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