增加日志埋点

This commit is contained in:
dxc
2022-01-27 13:55:55 +08:00
parent 13ab812733
commit 022c17a0fb
5 changed files with 39 additions and 2 deletions

View File

@ -5,6 +5,9 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.idempotent.annotation.Idempotent;
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.project.baseoperlog.aop.OperLog;
import com.chinaunicom.mall.ebtp.project.projectentrust.entity.ProjectEntrust;
import com.chinaunicom.mall.ebtp.project.projectentrust.entity.ProjectEntrustVO;
@ -211,6 +214,7 @@ public class ProjectEntrustController{
@Idempotent(expireTime = 10)
@ApiOperation("委托项目信息出始化")
@PostMapping("/initProjectEntrust")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.PROJECT_ENTRUST_INIT,operationType = EbtpLogType.INSERT,detail = "委托项目信息出始化")
public BaseResponse<Boolean> initProjectEntrust(@ApiParam(value = "实施项目编码", required = true) @RequestParam(name = "ebpProjectId") Long ebpProjectId) {
return BaseResponse.success(projectEntrustService.initProjectEntrust(String.valueOf(ebpProjectId)));
@ -240,6 +244,7 @@ public class ProjectEntrustController{
@OperLog("询价通知返回处理接口")
@ApiOperation("询价通知返回处理接口")
@PostMapping("/inquiryNotice")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.PROJECT_INQUIRY_UPDATE,operationType = EbtpLogType.UPDATE,detail = "询价通知返回处理接口")
public BaseResponse<Boolean> inquiryNotice(@ApiParam(value = "询价通知返回实体", required = true) @RequestBody InquiryNoticeVO inquiryNoticeVO){
return BaseResponse.success(inquiryService.inquiryNotice(inquiryNoticeVO));
@ -256,6 +261,7 @@ public class ProjectEntrustController{
@OperLog("初始化询价信息接口")
@ApiOperation("初始化询价信息接口")
@PostMapping("/initInquiryProjectEntrust")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.PROJECT_ENTRUST_INQUIRY_INIT,operationType = EbtpLogType.INSERT,detail = "初始化询价信息接口")
public BaseResponse<Boolean> initInquiryProjectEntrust(@ApiParam(value = "询价实体", required = true) @RequestBody @Valid InquiryVO inquiryVO){
return BaseResponse.success(inquiryService.initProjectEntrust(inquiryVO));

View File

@ -10,6 +10,9 @@ import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.mall.ebtp.project.baseoperlog.service.IBaseOperLogService;
@ -71,6 +74,9 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
@Resource
private PriceQueryApi priceQueryApi;
@Resource
private OperationLogService logService;
private static final String METHOD = "initProjectEntrust";
private static final String DESCRIPTION = "项目委托查询采购数据";
@ -182,6 +188,8 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
log.info("项目经理拒绝 询价项目招投标推送询价单是否可以发布访问参数:"+JsonUtils.objectToJson(inquiryVO));
BaseResponse response = priceQueryApi.updateInquiryAllowPublish(inquiryVO);
log.info("项目经理拒绝 询价项目招投标推送询价单是否可以发布返回参数:"+JsonUtils.objectToJson(inquiryVO));
logService.addOperationLog("项目经理拒绝 询价项目招投标推送询价单是否可以发布访问参数:{}" + JsonUtils.objectToJson(inquiryVO) + ",返回结果{}"+JsonUtils.objectToJson(response),response.isSuccess(),
EbtpLogBusinessModule.PROJECT_INQUIRY_UPDATE, EbtpLogType.UNKNOWN);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
}
@ -209,6 +217,10 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
log.info("询价项目招投标推送询价单是否可以发布访问参数:"+JsonUtils.objectToJson(inquiryVO));
BaseResponse response = priceQueryApi.updateInquiryAllowPublish(inquiryVO);
log.info("询价项目招投标推送询价单是否可以发布返回参数:"+JsonUtils.objectToJson(inquiryVO));
logService.addOperationLog("项目经理同意 询价项目招投标推送询价单是否可以发布访问参数:{}" + JsonUtils.objectToJson(inquiryVO) + ",返回结果{}"+JsonUtils.objectToJson(response),response.isSuccess(),
EbtpLogBusinessModule.PROJECT_INQUIRY_UPDATE, EbtpLogType.UNKNOWN);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
}else{
//初始化项目信息
@ -297,6 +309,9 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
//调用接口 拼装数据
baseOperLogService.addLog(METHOD,JsonUtils.objectToJson(baseResponse),DESCRIPTION,cacheUserService.getCacheUser(),"",true);
logService.addOperationLog(DESCRIPTION + "请求参数{}" +Long.parseLong(ebpProjectId) + ",返回结果{}"+JsonUtils.objectToJson(baseResponse),baseResponse.isSuccess(),
EbtpLogBusinessModule.PROJECT_ENTRUST_INIT, EbtpLogType.INSERT);
if(!baseResponse.isSuccess()){
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_ENTRUST_FIND_PUR_ERROR.throwException();

View File

@ -3,6 +3,9 @@ package com.chinaunicom.mall.ebtp.project.projectexception.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.project.baseoperlog.aop.OperLog;
import com.chinaunicom.mall.ebtp.project.projectexception.entity.ProjectException;
import com.chinaunicom.mall.ebtp.project.projectexception.entity.ProjectExceptionVO;
@ -140,6 +143,7 @@ public class ProjectExceptionController{
@OperLog("项目中心提供异常调用接口")
@ApiOperation("项目中心提供异常调用接口")
@PostMapping("initiateException")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.PROJECT_INVITATION_FAIL,operationType = EbtpLogType.UPDATE,detail = "项目中心提供异常调用接口")
public BaseResponse<Boolean> initiateException(
@ApiParam(value = "子项目ID", required = true) @RequestParam(name = "subprojectId") String subprojectId,
@ApiParam(value = "方案ID", required = true) @RequestParam(name = "projectPlanId") String projectPlanId,

View File

@ -13,6 +13,9 @@ import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.base.enums.ResponseEnum;
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.mall.ebtp.project.common.EbpProjectCommonUtil;
@ -94,6 +97,9 @@ public class ProjectExceptionServiceImpl extends BaseServiceImpl<ProjectExceptio
@Resource
private IDictProjectService projectService;
@Resource
private OperationLogService logService;
@Override
public IPage<ProjectExceptionVO> getPage(ProjectExceptionVO projectExceptionVO) {
@ -472,6 +478,8 @@ public class ProjectExceptionServiceImpl extends BaseServiceImpl<ProjectExceptio
RootContext.unbind();
BaseResponse baseResponse = mallPurpApi.projInvitationFail(failRequest);
log.info("访问用友失败接口返回结果"+ JsonUtils.objectToJson(baseResponse));
logService.addOperationLog("用友失败接口访问参数:{}" + JsonUtils.objectToJson(failRequest) + ",返回结果{}"+JsonUtils.objectToJson(baseResponse),baseResponse.isSuccess(),
EbtpLogBusinessModule.PROJECT_INVITATION_FAIL, EbtpLogType.UNKNOWN);
RootContext.bind(xid);
if(!baseResponse.isSuccess()){
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_INVITATION_FAIL_ERROR.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess());

View File

@ -12,9 +12,11 @@ import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.AttachmentDetail;
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.AttachmentEntity;
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageRequest;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.mall.ebtp.project.common.EbpProjectCommonUtil;
@ -69,7 +71,7 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl<ProjectReEva
private IProjectRecordService recordService;
@Resource
private IBaseCacheUserService cacheUserService;
private OperationLogService logService;
@Resource
private AttachmentClient attachmentClient;
@ -275,6 +277,8 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl<ProjectReEva
log.info("访问重新评审流程初始化接口参数:"+ JsonUtils.objectToJson(approve));
BaseResponse<ProjectReEvaluationTaskVO> response = wfapApi.start(approve);
log.info("访问重新评审流程初始化接口返回结果:"+ JsonUtils.objectToJson(response));
logService.addOperationLog("访重新评审流程初始化接口访问参数:{}" + JsonUtils.objectToJson(approve) + ",返回结果{}"+JsonUtils.objectToJson(response),response.isSuccess(),
EbtpLogBusinessModule.PROJECT_RE_EVALUATION_TASK, EbtpLogType.INSERT);
if(!response.isSuccess()){
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
}