直连对账TG/FD全流程日志----评审

前言

托管外包直连对账大致逻辑:外包做账生成估值表后,将发送报文到对账平台,由对账平台将信息转发到托管端。托管端负责核对外包发送过来的估值表,将核对后的信息发送到对账平台,发送完后把状态同步到托管端,进一步由对账平台转发到外包。

1、托管直连对账

1.1 直连对账节点

1、插表记录--》2、查询自动任务--》3、查询主表数据(或核对)--》4、校验是否满足发送条件--》5、发送并等待结果返回自动估值服务。

1.1.1 插表记录

自动估值进度做账到直连对账节点,首先会插一条记录到表Ts_AutoReconRecord中,插入成功后会打印日志:

/**
log.info(">>>doDirectReconTg insert one record:taskId={},mainId={},fundId={},businessDate={},userCode={}",
            requestId, mainId, fundId, businessDate, userCode);
*/

1.1.2 查询自动任务

查询自动任务是来区分手工、自动转人工、自动。不同情况的业务逻辑处理也不一样。

/**
log.info(">>>{}调用autoCheckDataAndHandleValuate接口,查询到自动估值任务[{}],",methodInvocation,valuateProgress);

# 没有查询到也会打印日志:
log.info(">>>{}调用autoCheckDataAndHandleValuate接口<<<未查询到主表数据,产品ID:{},业务日期:{},任务编号:{}",
              methodInvocation,autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(),autoReconRecord.getTaskId());
*/

1.1.3 查询主表数据(或核对)

手工和自动转人工的自动任务需要先核对在查主表数据,自动的直接查询主表数据即可。查询完会打印日志: (1)手工和自动转人工 核对完成后,会打印日志:

/**
log.info("对账结果zldzCheckOpReturnInfo:数据为:{}", JSON.toJSONString(returnMap));
## 进一步校验核对结果是一致还是不一致
# 1、一致
log.info(">>>autoCheckDataAndHandleValuate<<<核对一致,产品ID:{},业务日期:{},任务编号:{}",autoReconRecord.getFundId(),
                autoReconRecord.getBusinessDate(),autoReconRecord.getTaskId());
# 2、不一致
log.info(">>>autoCheckDataAndHandleValuate<<<核对不一致,产品ID:{},业务日期:{},任务编号:{}",autoReconRecord.getFundId(),
                autoReconRecord.getBusinessDate(),autoReconRecord.getTaskId());
*/

进一步,查询主表数据。

1.1.4 校验是否满足发送条件

查询到主表数据后,若没有查询到主表数:

/**
log.info(">>>autoCheckDataAndHandleValuate<<<未查询到主表数据,产品ID:{},业务日期:{},任务编号:{}",autoReconRecord.getFundId(),      autoReconRecord.getBusinessDate(),autoReconRecord.getTaskId());
*/

校验是否满足发送条件,主要是根据fundId 和一个系统参数:CWSZ_ZLDZFSJGJYFA 来查询接口getGZSystemParameterByFundId来判断的,查询到的结果会打印日志:

/**
log.info(">>>getGZSystemParameterByFundId search end,fundId={},businessDate={}systemCode={}",fundId, businessDate,systemCode);

# 针对不满足发送条件的情况,会有日志打印:
log.info(">>>checkCompareDifferent,fundId={},businessDate={},校验有无核对项不一致的检查结果,result={}",fundId,businessDate, result);
*/

1.1.5 发送并等待结果返回自动估值服务。

1、一致且不满足发送条件:

/**
log.info(">>>autoCheckDataAndHandleValuate,fundId={},businessDate={},核对一致但不满足发送条件,等待下一次循环处理",autoReconRecord.getFundId(), autoReconRecord.getBusinessDate());
*/

2、一致且满足发送条件:

/**
1、发送之前会打印具体要送的信息:
log.info(">>>autoCheckDataAndHandleValuate直连对账查询到主表数据,对账结果一致,开始发送<<<,具体数据:[{}]",sendElecCheckDto);

2、发送完毕后每个30s去查询一下主表数据,如果主表状态为 已发送,则发消息给自动估值进行一下节点若5分钟后还未发送成功,等待下一次处理并且会打印日志。每隔30会打印:
log.info(">>>sendElecCheckMainTg接口调用后,每个30秒查询主表信息,第{}次查询,主表数据发送状态为:{}",i,elecCheckMain.getOperationStatus());

3、若主表数据已更新为已发送的状态,且发送给自动估值服务,进行下一节点:
log.info(">>>>>>doDirectReconTg end {}<<<<<< fundId: {}, businessDate: {}, result: {}, taskId: {}, mainId: {}, type: {}", message, autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(),result, autoReconRecord.getTaskId(), autoReconRecord.getMainId(), autoReconRecord.getReportType());

4、5分钟还未更新成 已发送  的状态:
log.info(">>>>handReconDataAndResponseToValuate,fundId={},businessDate={}经过5分钟的发送时间,主表操作状态未更新为已发送,不能进行下一节点跑账,等待定时任务一下次处理",autoReconRecord.getFundId(),autoReconRecord.getBusinessDate());

*/

3、不一致

/**
满足发送条件就发送,满足就不发送。然后给自动估值服务发送消息,进行下一节点。前后会打印日志:
log.info(">>>autoCheckDataAndHandleValuate直连对账查询到主表数据,对账结果不一致,具体数据:[{}]",directReconRecordVo);

log.info(">>>>>>doDirectReconTg {}<<<<<< fundId: {}, businessDate: {}, result: {}, taskId: {}, mainId: {}, type: {}",message, autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(), result, autoReconRecord.getTaskId(),autoReconRecord.getMainId(), autoReconRecord.getReportType());
*/

1.2 其他接口

  • listElecCheckMain 查询主表数据
  • listElecCheckMainHis 查询历史表接口
  • sendElecCheck 发送接口 更新估值数据状态为发送中
  • viewYebCheckResultDetail 看科目余额表对账结果数据
  • viewGzbCheckResultDetail 查看估值表对账结果数据
  • viewYebCheckInitDetail 查询管理人发送的余额表的原始报文
  • viewGzbCheckInitDetail 查询管理人发送的估值表的原始报文
  • zldzHandCheckOp 手工核对
  • zldzCheckOp 核对 都会在tgfacade服务日志打印:已查询主表数据为例:
/**
# 查询前打印入参:
log.info(">>>listElecCheckMain begin,input parameter:fundId={},startDate={},endDate={},reportType={}," +
          "operationStatus={},isConsistence={}", fundId, startDate, endDate, reportType, isConsistence);

## 查询后打印出参:
log.info(">>>listElecCheckMain end ,output parameter:returnCode={},returnStr={}",returnInfoVo.getReturnCode(),
          returnInfoVo.getReturnStr());
## 异常打印:
log.error(">>>listElecCheckM exception,fundId={},startDate={},endDate={},reportType={},operationStatus={}," +
          "isConsistence={}, exception message={}",fundId, startDate, endDate, reportType, operationStatus, isConsistence, e);
*/

2、外包直连对账

2.1 直连对账节点

1、生成对账数据--》2、先删后插对对账记录--》3、发送

2.1.1 生成对账数据

调用接口generateReconData生成对账数据:

/**
在方法doDirectRecon的入口会打印日志:
log.info(">>>doDirectRecon begin,input parameter:requestId={},fundId={},businessDate={},operator={},reportTypeList={}",requestId, fundId, businessDate, userCode,reportTypeList);

在generateReconData会打印入参,出参具体信息:

*/

2.1.2 先删后插对对账记录

/**
插入记录后会打印:
log.info(">>>doDirectRecon insert one record:fundId={},maiId={},taskId={},businessDate={},reportType={}," +
            "operator={}", fundId, mainId, requestId, businessDate, reportType);
*/

2.1.3 发送

发送前后日志打印:

/**
发送前:
log.info(">>>send start userCode={},mainId={},ip={},port={}",userCode, mainId, ip, port);
发送后:
log.info(">>>after send,invoke editReconRecord refresh directRecon status,responseData={}",responseData);
发送异常:
log.error("[电子对账]FaReconPlatformThread Exception >>> 发送对账请求失败, mainId: {}, exceptionMsg = [{}]", mainId, ex.getMessage(), ex);

*/

2.2 5分钟定时任务

发送完后,有定时任务会每隔5分钟查询主表数据。

/**
1、 查询到主表数据且 对账一致 ,然后发送消息给自动估值服务
log.info(">>>>>>autoQueryJob直联对账手工确认一致 {}<<<<<< fundId: {}, businessDate: {}, result: {}, taskId: {}, mainId: {}, type: {}", message, autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(), result, autoReconRecord.getTaskId(), autoReconRecord.getMainId(), autoReconRecord.getReportType());

2、查询到主表数据 对账不一致 有手工确认记录
log.info(">>>直联对账结果不一致,fundId={},businessDate={},查到有手工确认的记录,数据为:{}",       autoReconRecord.getFundId().toString(),autoReconRecord.getBusinessDate(), JSON.toJSONString(reconRecordVos));

3、查询到主表数据 对账不一致 没有手工确认记录
log.info(">>>>>>autoQueryJob,直连对账结果不一致 {}<<<<<< fundId: {}, businessDate: {}, result: {}, taskId: {}, mainId: {}, type: {}",message, autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(), result, autoReconRecord.getTaskId(), autoReconRecord.getMainId(), autoReconRecord.getReportType());

4、没有查到主表记录
log.info(">>>直联对账autoQueryJob,未查询的到数据,等待下一次处理");

5、经过2天没有查到对账结果
String message = String.format("经过%s分钟未查询到对账结果", minute);

log.info(">>>>>>autoQueryJob {}<<<<<< fundId: {}, businessDate: {}, result: {}, taskId: {}, mainId: {}, type: {}",message, autoReconRecord.getFundId(), autoReconRecord.getBusinessDate(), result, autoReconRecord.getTaskId(), autoReconRecord.getMainId(), autoReconRecord.getReportType());

*/

2.1 其他接口

  • listReconRecord 获取主表数据
  • getReconRecordHis 获取历史表数据
  • getValuationReconData 等

都会在26facade、30facade服务日志打印:已查询主表数据为例:

/**
# 查询前打印入参:
log.info(">>>listReconRecord begin,input parameter:listReconRecordDto:[{}]",listReconRecordDto);

## 查询后打印出参:
log.info(">>>listReconRecord end,output parameter:reconRecordVos.size={}",reconRecordVos.size());
## 异常打印:
log.error(">>>listReconRecord exception,fundIds={},businessDate={},exception info={}",     listReconRecordDto.getFundIds(),listReconRecordDto.getBusinessDate(), e);
*/
end
  • 作者:旭仔(联系作者)
  • 发表时间:2022-07-17 13:47
  • 版权声明:自由转载-非商用-非衍生-保持署名
  • 转载声明:如果是转载栈主转载的文章,请附上原文链接
  • 公众号转载:请在文末添加作者公众号二维码(公众号二维码见右边,欢迎关注)
  • 评论