Commit d58f1203 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 2c57c3e5 0c93b8e9
......@@ -18,6 +18,10 @@ public class MyAsserts {
if (!obj) throw exception;
}
public static void assertNull(Object obj,ApiException exception){
if(obj!=null)throw exception;
}
public static void assertFalse(boolean obj, ApiException exception) {
if (obj) throw exception;
}
......
......@@ -266,7 +266,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked());
cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
if (!cell.getCellStyle().getLocked() && hasKeyIn(cell)) {
if (!cell.getCellStyle().getLocked() && hasKeyIn(cell) && allowManual) {
cell.setCellValue(StringUtils.EMPTY);
addManualConfig(cellTemplate, template, cell, now, cellTemplateConfigList);
}
......@@ -402,7 +402,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? true : false);
cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
if (!cell.getCellStyle().getLocked() && hasKeyIn(cell)) {
if (!cell.getCellStyle().getLocked() && hasKeyIn(cell) && allowManual) {
cell.setCellValue(StringUtils.EMPTY);
addManualConfig(cellTemplate, template, cell, now, cellTemplateConfigList);
}
......
......@@ -94,6 +94,7 @@ public class ReportGeneratorImpl {
Sheet sheet = workbook.getSheetAt(i);
String code = sheet.getSheetName();
logger.info("-------------------------------------Begin Job [{}]------------------------------------------------------", code);
setStatus(job, STATUS_END);
setStatus(job,code,STATUS_BEGIN);
job.setCurrentStep(code);
periodJobMapper.updateByPrimaryKey(job);
......@@ -406,8 +407,6 @@ public class ReportGeneratorImpl {
}
}
}
setStatus(job,code,STATUS_END);
periodJobMapper.updateByPrimaryKey(job);
logger.info("-------------------------------------End Job [{}]------------------------------------------------------", code);
}
}
......
......@@ -277,9 +277,6 @@ public class ReportServiceImpl {
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
copyTemplateAndConfigFromAdmin(projectId, templates, period);
setStatus(job, STATUS_END);
periodJobMapper.updateByPrimaryKey(job);
}
private List<Template> getTemplatesByProjectId(String projectId) {
......@@ -481,10 +478,7 @@ public class ReportServiceImpl {
Integer periodParam, Integer reportType, Optional<String> generator) {
OperationResultDto operationResultDto = new OperationResultDto();
MyAsserts.assertEq(serviceType, EnumServiceType.VAT, new NotFoundException());
PeriodJobExample example = new PeriodJobExample();
example.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(periodParam)
.andStatusEqualTo(WrapPeriodJobDto.STATUS_BEGIN);
MyAsserts.assertEmpty(periodJobMapper.selectByExample(example), Exceptions.TASK_HAS_BEGINNING);
MyAsserts.assertNull(periodJobMapper.getRunningJob(projectId,periodParam), Exceptions.TASK_HAS_BEGINNING);
String status = periodApprovalMapper.getStatusByProjectIdAndPeriod(projectId, periodParam);
MyAsserts.assertTrue(status == null || status.equals(Constant.APPROVAL_DISAGREED), Exceptions.REPORT_IN_PROCESS_OR_AGREED_EXCEPTION);
......@@ -517,12 +511,13 @@ public class ReportServiceImpl {
evaluator.evaluateAll();
reportGenerator.updateWorkbookCaclsValueToDb(projectId, periodParam, workbook, resources, isMergeManualData, genJob);
setStatus(genJob,STATUS_END);
periodJobMapper.updateByPrimaryKey(genJob);
} catch (Exception e) {
setStatus(genJob, STATUS_ERROR);
e.printStackTrace();
genJob.setErrorMsg("Sever error "+e.getClass().getName());
periodJobMapper.updateByPrimaryKey(genJob);
}
}
}).start();
......
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