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

add log

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