提交 019f4d5b 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

cql只是异步保存,打印日志调整

上级 3ecc0511
......@@ -39,6 +39,9 @@ public class ExecResultRepository {
@Value("${ibiz.deleteInvalidResultData:true}")
private boolean deleteInvalidResultData;
@Value("${ibiz.saveAsyncResultData:false}")
private boolean saveAsync;
public ExecResultRepository(MappingManager mappingManager) {
createTable(mappingManager.getSession());
......@@ -96,12 +99,19 @@ public class ExecResultRepository {
execResult2.setDomainsfield(execResult.getDomainsfield());
execResult2.setTimefield(execResult.getTimefield());
try{
if(saveAsync){
mapper.saveAsync(execResult);
}else{
mapper.save(execResult);
}
}catch(Exception ex){
ex.printStackTrace();
}
try{
try{if(saveAsync){
mapper2.saveAsync(execResult2);
}else{
mapper2.save(execResult2);
}
}catch(Exception ex){
ex.printStackTrace();
}
......
......@@ -161,7 +161,6 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
protected IExecLogService ruExecLogService;
public ExecLog processAll(BaseRequest msg)
{
ExecLog execlog=new ExecLog();
execlog.setId(msg.getId());
execlog.setRunBody(msg.toString());
......@@ -185,13 +184,11 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
try
{
log.info("Service process start:{}", msg);
for (ModelObj modelObj : msg.getDatas())
{
try
{
count++;
modelObj.set("BATCH",msg.getBatch());
modelObj.set(Tag_EngineId, msg.getEngineId());
......@@ -207,7 +204,7 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
resultsMQMsg.setKeyValueField(modelObj.getRowKey());
resultsMQMsg.setRules(msg.getRuleIds());
Object saveResults = modelObj.get(Tag_SaveResults);
if(saveResults != null && saveResults instanceof List){
if(saveResults instanceof List){
resultsMQMsg.setDatas((List<ExecResult>)saveResults);
// defaultMQProducerService.sendToMQ(resultsMQMsg, "default");
}
......@@ -226,18 +223,9 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
strErrorInfo.append(e.getCause().getMessage());
strErrorInfo.append("\r\n");
}
}
}
}
}
catch(Exception e)
{
......@@ -250,7 +238,6 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
strErrorInfo.append("\r\n");
}
execlog.setRetCode(1);
execlog.setCnt(count);
if (errorcount == 0)
......@@ -278,13 +265,9 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
}
log.info(new StringBuilder().append("Service成功,process successfully:").append(msg.toString()).toString());
log.info("Service成功,process successfully:{}", msg);
strErrorInfo.append("Service成功,process successfully\r\n");
execlog.setCnt(count);
execlog.setSucc(count-errorcount);
if(execlog.getCnt()==0)
......
......@@ -478,7 +478,7 @@ public class BaseEntityServiceImpl implements BaseEntityService
}
// }
log.info(new StringBuilder().append("Service,Process ").append(rulesFired).append(" rules for record.\n").toString());
// log.info(new StringBuilder().append("Service,Process ").append(rulesFired).append(" rules for record.\n").toString());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册