pref: 优化售后日志,状态显示

This commit is contained in:
paulGao 2022-10-13 11:56:16 +08:00
parent 0ba493d71d
commit 6c87de7a97
3 changed files with 13 additions and 1 deletions

View File

@ -27,4 +27,11 @@ public @interface AfterSaleLogPoint {
*/
String sn();
/**
*
* @return 售后状态
*/
String serviceStatus() default "";
}

View File

@ -1,5 +1,6 @@
package cn.lili.modules.order.aftersale.aop;
import cn.hutool.core.text.CharSequenceUtil;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.security.enums.UserEnums;
@ -7,6 +8,7 @@ import cn.lili.common.utils.SpelUtil;
import cn.lili.common.utils.ThreadPoolUtil;
import cn.lili.modules.order.aftersale.entity.dos.AfterSaleLog;
import cn.lili.modules.order.aftersale.service.AfterSaleLogService;
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
@ -67,6 +69,9 @@ public class AfterSaleOperationLogAspect {
AfterSaleLogPoint afterSaleLogPoint = signature.getMethod().getAnnotation(AfterSaleLogPoint.class);
String description = SpelUtil.compileParams(joinPoint, rvt, afterSaleLogPoint.description());
String sn = SpelUtil.compileParams(joinPoint, rvt, afterSaleLogPoint.sn());
if (CharSequenceUtil.isNotEmpty(afterSaleLogPoint.serviceStatus())) {
description += AfterSaleStatusEnum.valueOf(SpelUtil.compileParams(joinPoint, rvt, afterSaleLogPoint.serviceStatus())).description();
}
result.put("description", description);
result.put("sn", sn);
return result;

View File

@ -179,7 +179,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
return addAfterSale(afterSaleDTO);
}
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'审核售后:售后编号['+#afterSaleSn+']'+ #serviceStatus")
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'审核售后:售后编号['+#afterSaleSn+']' ", serviceStatus = "#serviceStatus")
@SystemLogPoint(description = "售后-审核售后", customerLog = "'审核售后:售后编号['+#afterSaleSn+']'+ #serviceStatus")
@Transactional(rollbackFor = Exception.class)
@Override