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

add log

parent 455e7f5d
......@@ -2043,13 +2043,12 @@ public class DataImportService extends BaseService {
log.setFileType(EnumEbsExtractType.getNameByCode(type));
log.setPeriodStatus("EBS抽取");
log.setOperator(operator);
log.setId(idService.nextId());
try {
if (StringUtils.isEmpty(org.getEnterpriseAccountCode())) {
log.setId(idService.nextId());
log.setImportResult(false);
log.setErrorMsg(String.format(EnumApiCodeMsg.CALLFAILED.getMsg(), ErrorMessageCN.NoLedgerID));
}else if(StringUtils.isEmpty(org.getCode())) {
log.setId(idService.nextId());
log.setImportResult(false);
log.setErrorMsg(String.format(EnumApiCodeMsg.CALLFAILED.getMsg(), ErrorMessageCN.NoCompanyCode));
}
......@@ -2101,11 +2100,11 @@ public class DataImportService extends BaseService {
default:
break;
}
logger.info("EBS response: " + response);
if (StringUtils.isNotEmpty(response)) {
EbsCallResp resp = JSON.parseObject(response, EbsCallResp.class);
long taskId = Long.valueOf(resp.getTaskId());
if (taskId == -1) {
log.setId(idService.nextId());
log.setImportResult(false);
log.setErrorMsg(String.format(EnumApiCodeMsg.CALLFAILED.getMsg(), resp.getTaskDesc()));
} else {
......@@ -2120,7 +2119,6 @@ public class DataImportService extends BaseService {
dataImportLogMapper.insertSelective(log);
} catch (Exception e) {
logger.error(String.format(EnumApiCodeMsg.CALLFAILED.getMsg(), e.getMessage()), e);
log.setId(idService.nextId());
log.setImportResult(false);
log.setErrorMsg(String.format(EnumApiCodeMsg.CALLFAILED.getMsg(), e.getMessage()));
dataImportLogMapper.insertSelective(log);
......
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