Commit 8ff3192f authored by neo's avatar neo

[DEV] fixed error msg and add trancaction

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