mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	售后日志优化
This commit is contained in:
		| @@ -1,26 +1,29 @@ | ||||
| package cn.iocoder.yudao.module.trade.enums.aftersale; | ||||
|  | ||||
| import lombok.Getter; | ||||
| import lombok.RequiredArgsConstructor; | ||||
|  | ||||
| /** | ||||
|  * 售后操作类型的枚举 | ||||
|  * | ||||
|  * @author 陈賝 | ||||
|  * @since 2023/6/13 13:53 | ||||
|  */ | ||||
| // TODO @chenchen:可以 lombok 简化构造方法,和 get 方法 | ||||
| @RequiredArgsConstructor | ||||
| @Getter | ||||
| public enum AfterSaleOperateTypeEnum { | ||||
|  | ||||
|     /** | ||||
|      * 用户申请 | ||||
|      */ | ||||
|     APPLY("用户申请"), | ||||
|     APPLY(0, "用户申请"), | ||||
|     ; | ||||
|  | ||||
|     // 类型 | ||||
|     private final Integer type; | ||||
|     // 描述 | ||||
|     private final String description; | ||||
|  | ||||
|     AfterSaleOperateTypeEnum(String description) { | ||||
|         this.description = description; | ||||
|     } | ||||
|  | ||||
|     public String description() { | ||||
|         return description; | ||||
|     } | ||||
|   | ||||
| @@ -49,7 +49,6 @@ public class TradeAfterSaleLogDO extends BaseDO { | ||||
|      * 关联 {@link TradeAfterSaleDO#getId()} | ||||
|      */ | ||||
|     private Long afterSaleId; | ||||
|     // todo @CHENCHEN: 改成 Integer 哈;主要未来改文案,不好洗 log 存的字段; | ||||
|     /** | ||||
|      * 操作类型 | ||||
|      * | ||||
|   | ||||
| @@ -4,15 +4,14 @@ import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.aop.AfterSaleLo | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| 
 | ||||
| // TODO @chenchen:改成 aftersale 好点哈; | ||||
| /** | ||||
|  * trade 模块的 afterSaleLog 组件的 Configuration | ||||
|  * trade 模块的 afterSale 组件的 Configuration | ||||
|  * | ||||
|  * @author 陈賝 | ||||
|  * @since 2023/6/18 11:09 | ||||
|  */ | ||||
| @Configuration(proxyBeanMethods = false) | ||||
| public class AfterSaleLogConfiguration { | ||||
| public class AfterSaleConfiguration { | ||||
| 
 | ||||
|     @Bean | ||||
|     public AfterSaleLogAspect afterSaleLogAspect() { | ||||
| @@ -31,12 +31,13 @@ import static java.util.Arrays.asList; | ||||
| @Aspect | ||||
| public class AfterSaleLogAspect { | ||||
|  | ||||
|     private final static String OPERATE_TYPE = "operateType"; | ||||
|     private final static String ID = "id"; | ||||
|     private final static String CONTENT = "content"; | ||||
|  | ||||
|     @Resource | ||||
|     private AfterSaleLogService afterSaleLogService; | ||||
|  | ||||
|     // TODO chenchen: 这个分 3 行把; | ||||
|     private final static String OPERATE_TYPE = "operateType", ID = "id", CONTENT = "content"; | ||||
|  | ||||
|     /** | ||||
|      * 切面存入日志 | ||||
|      */ | ||||
|   | ||||
| @@ -398,14 +398,6 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa | ||||
|         this.createLog(logDTO); | ||||
|     } | ||||
|  | ||||
|     // TODO @CHENCHEN:这个注释,写在接口就好了,补充重复写哈;@date 应该是 @since | ||||
|     /** | ||||
|      * 日志记录 | ||||
|      * | ||||
|      * @param logDTO 日志记录 | ||||
|      * @author 陈賝 | ||||
|      * @date 2023/6/12 14:18 | ||||
|      */ | ||||
|     @Override | ||||
|     @Async | ||||
|     public void createLog(TradeAfterSaleLogCreateReqDTO logDTO) { | ||||
| @@ -417,8 +409,7 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa | ||||
|                     .setOperateType(logDTO.getOperateType()) | ||||
|                     .setContent(logDTO.getContent()); | ||||
|             tradeAfterSaleLogMapper.insert(afterSaleLog); | ||||
|        // TODO @CHENCHEN:代码排版哈;空格要正确 | ||||
|         }catch (Exception exception){ | ||||
|         } catch (Exception exception) { | ||||
|             log.error("[createLog][request({}) 日志记录错误]", toJsonString(logDTO), exception); | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 chenchen
					chenchen