cloudroam
2024-12-04 2432594a4d11b47a503795349defa31872f85789
操作日志
已修改32个文件
已添加12个文件
921 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/base/BaseController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/base/ReturnDataInfoDTO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/base/annotation/OperationLog.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/base/aspect/OperationLogAspect.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/request/log/OperationRecordDTO.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/request/log/OperationRecordQueryDTO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/response/log/OperationRecordVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/entity/log/OperationRecord.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/entity/menber/Member.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerMarkupPlMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerParamItemMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerParamMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerTagMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/flower/FlowerZoneMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/log/OperationRecordMapper.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/payment/OrderItemSettlementMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/payment/OrderSettlementMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerMarkupPlService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerMarkupPsService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerParamService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerTagService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerZoneService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/log/OperationRecordService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/log/impl/OperationRecordServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/payment/OrderItemSettlementService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/payment/OrderService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/payment/OrderSettlementService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerController.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerMarkupPlController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerMarkupPsController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerParamController.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerTagController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/flower/FlowerZoneController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/log/OperationRecordController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/payment/OrderController.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/payment/SalesController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/payment/SettlementController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/log/OperationRecordMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/base/BaseController.java
@@ -1,5 +1,7 @@
package com.mzl.flower.base;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.entity.log.OperationRecord;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -16,4 +18,15 @@
    protected ResponseEntity<ReturnDataDTO<?>> returnData(String code, Object data) {
        return new ResponseEntity(new ReturnDataDTO(code, data, ""), HttpStatus.OK);
    }
    protected ResponseEntity<ReturnDataDTO<?>> returnData(String code, Object data, OperationRecord info) {
        return new ResponseEntity(new ReturnDataInfoDTO(code, data, "",info), HttpStatus.OK);
    }
    public OperationRecord getOperationRecord(String content) {
        OperationRecord operationRecord = new OperationRecord();
        operationRecord.setContent(content);
        operationRecord.create(SecurityUtils.getUserId());
        return operationRecord;
    }
}
src/main/java/com/mzl/flower/base/ReturnDataInfoDTO.java
对比新文件
@@ -0,0 +1,20 @@
package com.mzl.flower.base;
import com.mzl.flower.entity.log.OperationRecord;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnDataInfoDTO<T> implements java.io.Serializable {
    private String code;
    private T data;
    private String msg;
    private OperationRecord info;
}
src/main/java/com/mzl/flower/base/annotation/OperationLog.java
对比新文件
@@ -0,0 +1,23 @@
package com.mzl.flower.base.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface OperationLog {
/**
 * packageName com.mzl.flower.base.annotation
 * @author fanghaowei
 * @version version2.0
 * @className OperationLog
 * @date 2024/12/2
 * @description TODO
 */
String value() default "";
    // 填写具体操作,默认是空
    String type() default "";
}
src/main/java/com/mzl/flower/base/aspect/OperationLogAspect.java
对比新文件
@@ -0,0 +1,128 @@
package com.mzl.flower.base.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mzl.flower.base.ReturnDataInfoDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.mapper.log.OperationRecordMapper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Date;
import static com.mzl.flower.utils.IpUtil.getIpAddress;
@Aspect
@Component
public class OperationLogAspect {
    @Resource
    private OperationRecordMapper operationRecordMapper;
    //扫描使用这个注解的方法
    @Pointcut("@annotation(com.mzl.flower.base.annotation.OperationLog)")
    public void logPointCut() {
    }
    @Around("logPointCut()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        Date beginTime = new Date();
        String result = null;
        String status = null;
        //执行代码,都加try catch,即使出错也不能影响主进程
        OperationRecord operationRecord = null;
        try {
            Object obj = point.proceed();//放行请求的主进程并拿到返回值
            if (obj != null) {
                ResponseEntity<?> responseEntity = (ResponseEntity<?>) obj;
                Object body = responseEntity.getBody();
                // 将obj转换为String类型
                String jsonResponse = JSONObject.toJSONString(body);
                System.out.println(jsonResponse);
                // 创建ObjectMapper实例
                ObjectMapper objectMapper = new ObjectMapper();
                // 使用 TypeReference 指定泛型类型
                ReturnDataInfoDTO<Object> returnDataInfoDTO = JSON.parseObject(jsonResponse, new TypeReference<ReturnDataInfoDTO<Object>>() {});
                // 从 ReturnDataInfoDTO 对象中获取 OperationRecord 对象
                operationRecord = (OperationRecord) returnDataInfoDTO.getInfo();
                ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
                if (attributes != null) {
                    HttpServletRequest request = attributes.getRequest();
                    // 获取请求的IP地址
                    String ip = getIpAddress(request);
                    operationRecord.setIpAddress(ip);
                    System.out.println("ip"+ip);
                }
//                if (attributes != null) {
//                    HttpServletRequest request = attributes.getRequest();
//                    System.out.println(request.getRemoteAddr()); // 或者使用上面提到的方法获取真实IP地址
//                }
            }
            status = "success";
            return obj;
        } catch (Exception e) {//请求执行出错
            result = e.getMessage();
            status = "error";
            throw e;
        } finally {//无论成功失败,都保存下日志
            saveLog(point, beginTime, new Date(), result, status, operationRecord);
        }
    }
    //保存日志
    private void saveLog(ProceedingJoinPoint joinPoint, Date beginTime, Date endTime, String result, String status, OperationRecord operationRecord) {
        if (!ObjectUtils.isEmpty(operationRecord)) {
            try {
                MethodSignature signature = (MethodSignature) joinPoint.getSignature();
                Method method = signature.getMethod();
                OperationLog annotation = method.getAnnotation(OperationLog.class);
                operationRecord.setStatus(status);
                if (annotation != null) {
                    //注解上的描述
                    String type = annotation.type();
//                if (!StringUtils.isEmpty(type)) {
//                    String recordModule = operationRecordMapper.getCodeType("OPERATION_RECORD_MODULE", type);
//                    operationRecord.setModule(recordModule);
//                } else {
                    operationRecord.setModule(type);
//                }
                    operationRecord.setFunction(annotation.value());//注解类型
                }//记录入参
//            if (joinPoint.getArgs() != null) {
//                try {
//                    operationRecord.setContent(JSONObject.toJSONString(result));
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
                //如果注解类型是1(增删改)或者是2(查询)报错,记录返回值,如果是查询正常就不记录,有可能返回值太多
            } catch (Exception e) {
                e.printStackTrace();
            }
            //启动一个线程,执行报错日志,防止影响主请求
            new Thread(() -> {
                try {//保存数据到数据库
                    operationRecordMapper.insert(operationRecord);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }).start();
        }
    }
}
src/main/java/com/mzl/flower/dto/request/log/OperationRecordDTO.java
对比新文件
@@ -0,0 +1,24 @@
package com.mzl.flower.dto.request.log;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class OperationRecordDTO {
    @ApiModelProperty("操作模块(模块/页面)")
    private String module;
    @ApiModelProperty("具体功能(动作)")
    private String function;
    @ApiModelProperty("客户端IP地址")
    private String ipAddress;
    @ApiModelProperty("操作内容")
    private String content;
    @ApiModelProperty("用户id")
    private String userId;
}
src/main/java/com/mzl/flower/dto/request/log/OperationRecordQueryDTO.java
对比新文件
@@ -0,0 +1,39 @@
package com.mzl.flower.dto.request.log;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mzl.flower.base.annotation.DictTrans;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
@Data
public class OperationRecordQueryDTO {
    @ApiModelProperty("操作模块(模块/页面)")
    @DictTrans(target = "withdrawTypeName",codeType = "OPERATION_RECORD_MODULE")
    private String module;
    @ApiModelProperty("具体功能(动作)")
    private String function;
    @ApiModelProperty("客户端IP地址")
    private String ipAddress;
    @ApiModelProperty("操作内容")
    private String content;
    @ApiModelProperty(value = "开始日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate createDateBeginStr;
    @ApiModelProperty(value = "结束日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate createDateEndStr;
    @ApiModelProperty("用户名")
    private String createName;
}
src/main/java/com/mzl/flower/dto/response/log/OperationRecordVO.java
对比新文件
@@ -0,0 +1,39 @@
package com.mzl.flower.dto.response.log;
import com.mzl.flower.base.AbstractTransDTO;
import com.mzl.flower.base.annotation.DictTrans;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class OperationRecordVO extends AbstractTransDTO {
    private Long id;
    @ApiModelProperty("操作模块(模块/页面)")
    @DictTrans(target = "moduleName",codeType = "OPERATION_RECORD_MODULE")
    private String module;
    @ApiModelProperty("具体功能(动作)")
    private String function;
    @ApiModelProperty("客户端IP地址")
    private String ipAddress;
    @ApiModelProperty("操作内容")
    private String content;
    @ApiModelProperty("用户id")
    private String userId;
    @ApiModelProperty("操作人")
    private String createName;
    @ApiModelProperty("创建日期")
    private LocalDateTime createTime;
    private String moduleName;
}
src/main/java/com/mzl/flower/entity/log/OperationRecord.java
对比新文件
@@ -0,0 +1,34 @@
package com.mzl.flower.entity.log;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mzl.flower.base.BaseAutoEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author fanghaowei
 * @version version2.0
 * @className OperationRecord
 * @date 2024/12/02
 * @description 操作日志功能实体类
 */
@Data
@TableName("t_operation_record")
public class OperationRecord extends BaseAutoEntity {
    @ApiModelProperty("操作模块(模块/页面)")
    private String module;
    @ApiModelProperty("具体功能(动作)")
    private String function;
    @ApiModelProperty("客户端IP地址")
    private String ipAddress;
    @ApiModelProperty("操作内容")
    private String content;
    @ApiModelProperty("状态")
    private String status;
}
src/main/java/com/mzl/flower/entity/menber/Member.java
@@ -12,7 +12,7 @@
 * @version version2.0
 * @className Member
 * @date 2024/8/26
 * @description 会员管理功能实体类
 * @description 操作日志功能实体类
 */
@Data
@TableName("t_member")
src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java
@@ -7,6 +7,7 @@
import com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO;
import com.mzl.flower.entity.flower.FlowerCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
@@ -24,4 +25,8 @@
    List<FlowerCategoryDailyDTO> selectHomeCategoryDaily(Page page
            , @Param("partnerId") Long partnerId, @Param("day") LocalDate day);
    @Select("select * from t_flower_category where id = #{id}")
    FlowerCategory selectCategoryById(Long id);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerMapper.java
@@ -11,6 +11,7 @@
import com.mzl.flower.dto.response.flower.FlowerSupplierListDTO;
import com.mzl.flower.entity.flower.Flower;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -57,4 +58,16 @@
    List<Flower> getDeletdFlowByIds(@Param("list") List<Long> ids);
    void updateTypeRankNull(@Param("category") Long category, @Param("level") String level);
    @Select("select * from t_flower where id = #{id}")
    Flower selectFlowerById(Long id);
    @Select("<script>" +
            "SELECT * FROM t_flower WHERE id IN " +
            "<foreach item='id' collection='ids' open='(' separator=',' close=')'>" +
            "#{id}" +
            "</foreach>" +
            "</script>")
    List<Flower> selectFlowersByIds(@Param("ids") List<Long> ids);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerMarkupPlMapper.java
@@ -1,14 +1,13 @@
package com.mzl.flower.mapper.flower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.entity.flower.FlowerMarkupPl;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface FlowerMarkupPlMapper extends BaseMapper<FlowerMarkupPl> {
    @Select("select * from t_flower_markup_pl where id = #{id}")
    FlowerMarkupPl selectMarkupPlById(Long id);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerParamItemMapper.java
@@ -4,9 +4,13 @@
import com.mzl.flower.dto.request.flower.ParamTableColumn;
import com.mzl.flower.entity.flower.FlowerParamItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Repository
public interface FlowerParamItemMapper extends BaseMapper<FlowerParamItem> {
    void addTableColumn(@Param("tableName") String tableName, @Param("field") ParamTableColumn field);
    @Select("select * from t_flower_param_item where id = #{id}")
    FlowerParamItem selectFlowerParamItemById(Long id);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerParamMapper.java
@@ -6,6 +6,7 @@
import com.mzl.flower.dto.response.flower.FlowerParamListDTO;
import com.mzl.flower.entity.flower.FlowerParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -24,4 +25,7 @@
            , @Param("idColumn")String idColumn, @Param("idValue") Object idValue);
    Map getTableDataById(@Param("tableName") String tableName, @Param("id") Long id);
    @Select("select * from t_flower_param where id = #{id}")
    FlowerParam selectFlowerParamById(Long id);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerTagMapper.java
@@ -6,6 +6,7 @@
import com.mzl.flower.dto.response.flower.FlowerTagDTO;
import com.mzl.flower.entity.flower.FlowerTag;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -13,4 +14,8 @@
@Repository
public interface FlowerTagMapper extends BaseMapper<FlowerTag> {
    List<FlowerTagDTO> selectTagList(Page page, @Param("condition") FlowerTagQueryDTO dto);
    @Select("select * from t_flower_tag where id = #{id}")
    FlowerTag selectFlowerTagById(Long id);
}
src/main/java/com/mzl/flower/mapper/flower/FlowerZoneMapper.java
@@ -2,8 +2,13 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mzl.flower.entity.flower.FlowerZone;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Repository
public interface FlowerZoneMapper extends BaseMapper<FlowerZone> {
    @Select("select * from t_flower_zone where id = #{id}")
    FlowerZone selectFlowerZoneById(Long id);
}
src/main/java/com/mzl/flower/mapper/log/OperationRecordMapper.java
对比新文件
@@ -0,0 +1,31 @@
package com.mzl.flower.mapper.log;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.dto.request.log.OperationRecordQueryDTO;
import com.mzl.flower.dto.response.log.OperationRecordVO;
import com.mzl.flower.entity.log.OperationRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * @author fanghaowei
 * @version version2.0
 * @className MemberMapper
 * @date 2024/12/02
 * @description 操作日志功能mapper
 */
@SuppressWarnings("ALL")
@Repository
public interface OperationRecordMapper extends BaseMapper<OperationRecord> {
    @Select("select label from t_code_value where type_code = #{typeCode} and value = #{value} and deleted = '0' limit 1")
    String getCodeType(@Param("typeCode") String typeCode,@Param("value") String value);
    List<OperationRecordVO> queryPage(@Param("dto") OperationRecordQueryDTO dto, Page page);
}
src/main/java/com/mzl/flower/mapper/payment/OrderItemSettlementMapper.java
@@ -2,9 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mzl.flower.entity.payment.OrderItemSettlement;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Repository
public interface OrderItemSettlementMapper extends BaseMapper<OrderItemSettlement> {
    @Select("select * from t_order_item_settlement where id = #{id}")
    OrderItemSettlement selectOrderItemSettlementById(String id);
}
src/main/java/com/mzl/flower/mapper/payment/OrderSettlementMapper.java
@@ -6,6 +6,7 @@
import com.mzl.flower.dto.response.payment.OrderSettlementListDTO;
import com.mzl.flower.entity.payment.OrderSettlement;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
@@ -18,4 +19,7 @@
    List<OrderSettlementListDTO> selectSettlementListInfo(Page page, @Param("condition") OrderSettlementQueryDTO dto);
    BigDecimal getUserIncome(@Param("userId") String userId);
    @Select("select * from t_order_settlement where id = #{id}")
    OrderSettlement selectOrderSettlementById(String id);
}
src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java
@@ -236,4 +236,7 @@
        categoryMapper.deleteById(id);
    }
    public FlowerCategory selectCategoryById(Long id) {
        return categoryMapper.selectCategoryById(id);
    }
}
src/main/java/com/mzl/flower/service/flower/FlowerMarkupPlService.java
@@ -79,4 +79,7 @@
        markupPlMapper.deleteById(id);
    }
    public FlowerMarkupPl selectMarkupPlById(Long id) {
        return markupPlMapper.selectMarkupPlById(id);
    }
}
src/main/java/com/mzl/flower/service/flower/FlowerMarkupPsService.java
@@ -7,17 +7,22 @@
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.*;
import com.mzl.flower.entity.flower.*;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.partner.Partner;
import com.mzl.flower.mapper.flower.FlowerMarkupPsMapper;
import com.mzl.flower.mapper.flower.FlowerMarkupPsSpCgMapper;
import com.mzl.flower.mapper.flower.FlowerMarkupPsSpMapper;
import com.mzl.flower.mapper.log.OperationRecordMapper;
import com.mzl.flower.service.BaseService;
import com.mzl.flower.utils.IpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
@Slf4j
@@ -33,6 +38,9 @@
    @Autowired
    private FlowerMarkupPsSpMapper spMapper;
    @Autowired
    private OperationRecordMapper operationRecordMapper;
    public Long saveMarkupPs(FlowerMarkupPsSaveDTO dto){
        FlowerMarkupPs g = new FlowerMarkupPs();
@@ -66,7 +74,7 @@
        markupCacheClient.deleteAllPsSpCg(id);
    }
    public void saveMarkupSpCgBatch(FlowerMarkupPsSpCgBatchSaveDTO dto){
    public void saveMarkupSpCgBatch(FlowerMarkupPsSpCgBatchSaveDTO dto,HttpServletRequest request) throws IOException {
        List<Long> categoryIds = dto.getCategoryId();
        if(categoryIds == null || categoryIds.size() == 0){
            throw new ValidationException("分类列表不能为空");
@@ -77,26 +85,40 @@
            cg.setCategoryId(categoryId);
            saveMarkupSpCg(cg);
            saveMarkupSpCg(cg,request);
        }
    }
    public void saveMarkupSpCg(FlowerMarkupPsSpCgSaveDTO dto){
    public void saveMarkupSpCg(FlowerMarkupPsSpCgSaveDTO dto,HttpServletRequest request) throws IOException {
        Long cId = dto.getCategoryId();
        FlowerMarkupPsSpCg cg = spCgMapper.selectOne(new QueryWrapper<FlowerMarkupPsSpCg>()
                .eq("partner_id", dto.getPartnerId()).eq("category_id", cId));
        String content = "";
        OperationRecord operationRecord = new OperationRecord();
        if(cg == null){
            cg = new FlowerMarkupPsSpCg();
            BeanUtils.copyProperties(dto, cg);
            cg.setPartnerId(dto.getPartnerId());
            cg.create(SecurityUtils.getUserId());
            spCgMapper.insert(cg);
             content = "新增商品分类加价:商品分类Id:【" + cg.getCategoryId() + "】,A级:【"+cg.getLevelA()+"】,B级:【" + cg.getLevelB() + "】,C级:【" + cg.getLevelC() + "】" +
                    ",D级:【"+dto.getLevelD()+"】,E级:【" + cg.getLevelE() + "】,O级:【" + cg.getLevelO() + "】";
            operationRecord.setFunction("新增商品分类加价");
        } else {
            BeanUtils.copyProperties(dto, cg);
            cg.update(SecurityUtils.getUserId());
            spCgMapper.updateById(cg);
             content = "修改商品分类加价:id:【"+cg.getId()+"】,商品分类Id:【" + cg.getCategoryId() + "】,A级:【"+cg.getLevelA()+"】,B级:【" + cg.getLevelB() + "】,C级:【" + cg.getLevelC() + "】" +
                    ",D级:【"+dto.getLevelD()+"】,E级:【" + cg.getLevelE() + "】,O级:【" + cg.getLevelO() + "】";
            operationRecord.setFunction("修改商品分类加价");
        }
        markupCacheClient.addMarkupPsSpCg(dto.getPartnerId(), cId, cg);
        operationRecord.setContent(content);
        operationRecord.create(SecurityUtils.getUserId());
        operationRecord.setStatus("success");
        operationRecord.setModule("markup_s_p");
        operationRecord.setIpAddress(IpUtil.getIpAddress(request));
        operationRecordMapper.insert(operationRecord);
    }
    public FlowerMarkupPsSpCgDTO getMarkupSpCg(Long partnerId, Long categoryId){
@@ -125,9 +147,11 @@
        markupCacheClient.deleteMarkupPsSpCg(partnerId, categoryId);
    }
    public void saveMarkupSp(FlowerMarkupPsSpSaveDTO dto){
    public void saveMarkupSp(FlowerMarkupPsSpSaveDTO dto,HttpServletRequest request) throws IOException {
        FlowerMarkupPsSp sp = spMapper.selectOne(new QueryWrapper<FlowerMarkupPsSp>()
                .eq("partner_id", dto.getPartnerId()).eq("flower_id", dto.getFlowerId()));
        String content = "";
        OperationRecord operationRecord = new OperationRecord();
        if(sp == null){
            sp = new FlowerMarkupPsSp();
            sp.setFlowerId(dto.getFlowerId());
@@ -135,13 +159,23 @@
            sp.setPartnerId(dto.getPartnerId());
            sp.create(SecurityUtils.getUserId());
            spMapper.insert(sp);
            content = "新增商品加价:商品id:【" + dto.getFlowerId() + "】,合伙人id:【"+dto.getPartnerId()+"】,金额:【" + dto.getFee() + "】";
            operationRecord.setFunction("新增商品分类加价");
        } else {
            sp.setFee(dto.getFee());
            sp.update(SecurityUtils.getUserId());
            spMapper.updateById(sp);
            content = "修改商品加价:id:【"+sp.getId()+"】,商品id:【" + dto.getFlowerId() + "】,合伙人id:【"+dto.getPartnerId()+"】,金额:【" + dto.getFee() + "】";
        }
        markupCacheClient.addMarkupPsSp(dto.getPartnerId(), dto.getFlowerId(), sp);
        operationRecord.create(SecurityUtils.getUserId());
        operationRecord.setStatus("success");
        operationRecord.setModule("markup_s_p");
        operationRecord.setContent(content);
        operationRecord.setIpAddress(IpUtil.getIpAddress(request));
        operationRecordMapper.insert(operationRecord);
    }
    public FlowerMarkupSpDTO getMarkupSp(Long partnerId, Long flowerId){
src/main/java/com/mzl/flower/service/flower/FlowerParamService.java
@@ -264,4 +264,12 @@
        FlowerCategory c = categoryMapper.selectById(categoryId);
        return c.getParamId();
    }
    public FlowerParamItem selectFlowerParamItemById(Long id) {
        return paramItemMapper.selectFlowerParamItemById(id);
    }
    public FlowerParam selectFlowerParamById(Long id) {
        return paramMapper.selectFlowerParamById(id);
    }
}
src/main/java/com/mzl/flower/service/flower/FlowerService.java
@@ -910,5 +910,11 @@
        }
    }
    public Flower selectFlowerById(Long id) {
        return flowerMapper.selectFlowerById(id);
    }
    public List<Flower> selectFlowersByIds(List<Long> ids) {
        return flowerMapper.selectFlowersByIds(ids);
    }
}
src/main/java/com/mzl/flower/service/flower/FlowerTagService.java
@@ -70,4 +70,7 @@
        tagMapper.deleteById(id);
    }
    public FlowerTag selectFlowerTagById(Long id) {
        return tagMapper.selectFlowerTagById(id);
    }
}
src/main/java/com/mzl/flower/service/flower/FlowerZoneService.java
@@ -124,4 +124,8 @@
        fzp.setRank(dto.getRank());
        flowerZoneMapMapper.updateById(fzp);
    }
    public FlowerZone selectFlowerZoneById(Long id) {
        return flowerZoneMapper.selectFlowerZoneById(id);
    }
}
src/main/java/com/mzl/flower/service/log/OperationRecordService.java
对比新文件
@@ -0,0 +1,18 @@
package com.mzl.flower.service.log;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mzl.flower.dto.request.log.OperationRecordDTO;
import com.mzl.flower.dto.request.log.OperationRecordQueryDTO;
import com.mzl.flower.dto.response.log.OperationRecordVO;
import com.mzl.flower.entity.log.OperationRecord;
public interface OperationRecordService extends IService<OperationRecord> {
    void saveOperationRecord(OperationRecordDTO operationRecordDTO);
    Page<OperationRecordVO> queryPage(OperationRecordQueryDTO operationRecordQueryDTO, Page page);
}
src/main/java/com/mzl/flower/service/log/impl/OperationRecordServiceImpl.java
对比新文件
@@ -0,0 +1,59 @@
package com.mzl.flower.service.log.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.log.OperationRecordDTO;
import com.mzl.flower.dto.request.log.OperationRecordQueryDTO;
import com.mzl.flower.dto.request.menber.MemberDTO;
import com.mzl.flower.dto.request.menber.MemberQueryDTO;
import com.mzl.flower.dto.response.log.OperationRecordVO;
import com.mzl.flower.dto.response.member.MemberVO;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.menber.Member;
import com.mzl.flower.entity.system.User;
import com.mzl.flower.mapper.customer.CustomerMapper;
import com.mzl.flower.mapper.log.OperationRecordMapper;
import com.mzl.flower.mapper.member.MemberMapper;
import com.mzl.flower.service.log.OperationRecordService;
import com.mzl.flower.service.menber.MemberService;
import com.mzl.flower.service.system.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author fanghaowei
 * @version version2.0
 * @className OperationRecordServiceImpl
 * @date 2024/12/2
 * @description 操作日志功能逻辑层
 */
@Service
@Transactional
@RequiredArgsConstructor
public class OperationRecordServiceImpl extends ServiceImpl<OperationRecordMapper, OperationRecord> implements OperationRecordService {
    private final OperationRecordMapper operationRecordMapper;
    @Override
    public void saveOperationRecord(OperationRecordDTO operationRecordDTO) {
    }
    @Override
    public Page<OperationRecordVO> queryPage(OperationRecordQueryDTO operationRecordQueryDTO, Page page) {
        List<OperationRecordVO> list = operationRecordMapper.queryPage(operationRecordQueryDTO, page);
        page.setRecords(list);
        return page;
    }
}
src/main/java/com/mzl/flower/service/payment/OrderItemSettlementService.java
@@ -260,4 +260,8 @@
        return fee;
    }
    public OrderItemSettlement selectOrderItemSettlementById(String id) {
        return orderItemSettlementMapper.selectOrderItemSettlementById(id);
    }
}
src/main/java/com/mzl/flower/service/payment/OrderService.java
@@ -1818,4 +1818,8 @@
            orderMapper.updatePaymentCreateDate(order);
        });
    }
    public Order getOrderInfoById(String id) {
        return orderMapper.selectById(id);
    }
}
src/main/java/com/mzl/flower/service/payment/OrderSettlementService.java
@@ -950,4 +950,8 @@
        }
    }
    public OrderSettlement selectOrderSettlementById(String id) {
        return settlementMapper.selectOrderSettlementById(id);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java
@@ -1,14 +1,16 @@
package com.mzl.flower.web.flower;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.FlowerCategoryCreateDTO;
import com.mzl.flower.dto.request.flower.FlowerCategoryQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerCategoryUpdateDTO;
import com.mzl.flower.dto.response.flower.FlowerCategoryDTO;
import com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO;
import com.mzl.flower.entity.flower.FlowerCategory;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerCategoryService;
import com.mzl.flower.service.flower.FlowerService;
import io.swagger.annotations.Api;
@@ -18,6 +20,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -38,17 +41,33 @@
    private FlowerService flowerService;
    @PostMapping("/tree/new")
    @OperationLog(value = "新增商品分类",type = "flower_category")
    @ApiOperation(value = "新增商品分类")
    public ResponseEntity<ReturnDataDTO> addCategory(@RequestBody FlowerCategoryCreateDTO dto) {
        return returnData(R.SUCCESS.getCode(), categoryService.addCategory(dto));
        String content = "";
        if (StringUtils.isEmpty(dto.getParentId())) {
            content = "新增商品分类:分类名称:【" + dto.getName() + "】,等级:【" + dto.getLevelLimit() + "】";
        } else {
            content = "新增商品分类:上级分类id:【" + dto.getParentId() + "】分类名称:【" + dto.getName() + "】,等级:【" + dto.getLevelLimit() + "】";
        }
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), categoryService.addCategory(dto), operationRecord);
    }
    @PostMapping("/tree/edit")
    @OperationLog(value = "编辑商品分类",type = "flower_category")
    @ApiOperation(value = "编辑商品分类")
    public ResponseEntity<ReturnDataDTO> updateCategory(@RequestBody FlowerCategoryUpdateDTO dto) {
        Long category = categoryService.updateCategory(dto);
        flowerService.updateCategoryInfo(category);
        return returnData(R.SUCCESS.getCode(), category);
        String content = "";
        if (StringUtils.isEmpty(dto.getParentId())) {
            content = "编辑商品分类:分类名称:【" + dto.getName() + "】,等级:【" + dto.getLevelLimit() + "】";
        } else {
            content = "编辑商品分类:上级分类id:【" + dto.getParentId() + "】分类名称:【" + dto.getName() + "】,等级:【" + dto.getLevelLimit() + "】";
        }
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), category, operationRecord);
    }
    @GetMapping("/tree/view")
@@ -73,33 +92,51 @@
    }
    @GetMapping("/tree/delete")
    @OperationLog(value = "删除商品分类",type = "flower_category")
    @ApiOperation(value = "删除商品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品分类id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteCategory(Long id){
        FlowerCategory flowerCategory = categoryService.selectCategoryById(id);
        categoryService.deleteCategory(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "";
        if (StringUtils.isEmpty(flowerCategory.getParentId())) {
            content = "删除商品分类id:【" + id + "】,分类名称:【" + flowerCategory.getName() + "】,等级:【" + flowerCategory.getLevelLimit() + "】";
        } else {
            content = "删除商品分类id:【" + id + "】,上级分类id:【" + flowerCategory.getParentId() + "】,分类名称:【" + flowerCategory.getName() + "】,等级:【" + flowerCategory.getLevelLimit() + "】";
        }
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/tree/shown")
    @OperationLog(value = "显示商品分类",type = "flower_category")
    @ApiOperation(value = "显示商品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品分类id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> showCategory(Long id){
        categoryService.setCategoryShown(id, true);
        return returnData(R.SUCCESS.getCode(), null);
        FlowerCategory flowerCategory = categoryService.selectCategoryById(id);
        String content = "显示商品分类id:【" + id + "】,分类名称:【" + flowerCategory.getName() + "】,等级:【" + flowerCategory.getLevelLimit() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/tree/hidden")
    @OperationLog(value = "隐藏商品分类",type = "flower_category")
    @ApiOperation(value = "隐藏商品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品分类id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> hideCategory(Long id){
        categoryService.setCategoryShown(id, false);
        return returnData(R.SUCCESS.getCode(), null);
        FlowerCategory flowerCategory = categoryService.selectCategoryById(id);
        String content = "隐藏商品分类id:【" + id + "】,分类名称:【" + flowerCategory.getName() + "】,等级:【" + flowerCategory.getLevelLimit() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerController.java
@@ -4,10 +4,13 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.request.flower.FlowerTagMultipleDTO;
import com.mzl.flower.dto.response.flower.*;
import com.mzl.flower.entity.flower.Flower;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerParamService;
import com.mzl.flower.service.flower.FlowerService;
import io.swagger.annotations.Api;
@@ -68,46 +71,65 @@
    @ApiOperation(value = "批量审核通过")
    public ResponseEntity<ReturnDataDTO> passFlowers(@RequestBody FlowerAuditMultipleDTO dto) {
        flowerService.auditFlowers(dto, Constants.FLOWER_STATUS.UP.name());
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量审核通过id是:【" + dto.getIds() + "】,审核意见为【" + dto.getAuditRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/reject/multi")
    @OperationLog(value = "批量审核驳回", type = "flower_list")
    @ApiOperation(value = "批量审核驳回")
    public ResponseEntity<ReturnDataDTO> rejectFlowers(@RequestBody FlowerAuditMultipleDTO dto) {
        flowerService.auditFlowers(dto, Constants.FLOWER_STATUS.REJECT.name());
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量审核驳回id:【" + dto.getIds() + "】,审核意见为:【" + dto.getAuditRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/tags")
    @OperationLog(value = "批量设置标签", type = "flower_list")
    @ApiOperation(value = "批量设置标签")
    public ResponseEntity<ReturnDataDTO> setFlowersTags(@RequestBody FlowerTagMultipleDTO dto) {
        flowerService.setFlowersTags(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量设置标签id:【" + dto.getIds() + "】,标签名称为:【" + dto.getTags() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/zones")
    @OperationLog(value = "批量设置专区", type = "flower_list")
    @ApiOperation(value = "批量设置专区")
    public ResponseEntity<ReturnDataDTO> setFlowerZone(@RequestBody FlowerZoneBatchDTO dto) {
        flowerService.setFlowerZone(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量设置专区id:【" + dto.getIds() + "】,专区id为:【" + dto.getZoneId() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/off")
    @OperationLog(value = "批量强制下架", type = "flower_list")
    @ApiOperation(value = "批量强制下架")
    public ResponseEntity<ReturnDataDTO> setFlowersForceOff(@RequestBody FlowerOffDTO dto) {
        flowerService.setFlowersForceOff(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量强制下架商品id:【" + dto.getIds() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/delete")
    @ApiOperation(value = "商品删除")
    @OperationLog(value = "商品删除", type = "flower_list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteFlower(Long id) {
        flowerService.deleteFlower(id);
        return returnData(R.SUCCESS.getCode(), null);
        Flower flower = flowerService.selectFlowerById(id);
        String content = "删除商品id:【" + id + "】,商品名称:【" + flower.getName() + "】,商品售价:【" + flower.getPrice() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/params")
    @ApiOperation(value = "获取分类参数列表")
@@ -125,17 +147,23 @@
    }
    @PostMapping("/list/recommend/set")
    @OperationLog(value = "批量设置推荐", type = "flower_list")
    @ApiOperation(value = "批量设置推荐")
    public ResponseEntity<ReturnDataDTO> setFlowerRecommend(@RequestBody FlowerRecommendMultipleDTO dto) {
        flowerService.setFlowerRecommend(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量设置推荐id:【" + dto.getIds() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/recommend/cancel")
    @OperationLog(value = "批量取消推荐", type = "flower_list")
    @ApiOperation(value = "批量取消推荐")
    public ResponseEntity<ReturnDataDTO> cancelFlowerRecommend(@RequestBody FlowerRecommendMultipleDTO dto) {
        flowerService.cancelFlowerRecommend(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量取消推荐id:【" + dto.getIds() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
@@ -168,9 +196,12 @@
    }
    @PostMapping("/list/limiteds")
    @ApiOperation(value = "批量设置标签")
    @OperationLog(value = "批量设置每人限购", type = "flower_list")
    @ApiOperation(value = "批量设置每人限购")
    public ResponseEntity<ReturnDataDTO> setFlowersLimited(@RequestBody FlowerLimitedDTO dto) {
        flowerService.setFlowersLimited(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "批量设置每人限购id:【" + dto.getIds() + "】,限购数量:【"+dto.getLimited()+"】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerMarkupPlController.java
@@ -4,8 +4,11 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.FlowerMarkupPlDTO;
import com.mzl.flower.entity.flower.FlowerMarkupPl;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerMarkupPlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -17,7 +20,6 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
@RestController
@RequestMapping("/api/flower/markup/pl")
@@ -30,19 +32,26 @@
    private FlowerMarkupPlService plService;
    @PostMapping("/list/new")
    @OperationLog(value = "新增平台区间加价", type = "markup_p_i")
    @ApiOperation(value = "新增平台区间加价")
    public ResponseEntity<ReturnDataDTO> addMarkupPl(@RequestBody FlowerMarkupPlCreateDTO dto) {
        Long id = plService.addMarkupPl(dto);
        plService.updateCache();
        return returnData(R.SUCCESS.getCode(), id);
        String content = "新增平台区间加价价格区间:【" + dto.getLowerPrice() + "】~【"+dto.getUpperPrice()+"】,加价:【" + dto.getFee() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), id, operationRecord);
    }
    @PostMapping("/list/edit")
    @OperationLog(value = "编辑平台区间加价", type = "markup_p_i")
    @ApiOperation(value = "编辑平台区间加价")
    public ResponseEntity<ReturnDataDTO> updateMarkupPl(@RequestBody FlowerMarkupPlUpdateDTO dto) {
        Long id = plService.updateMarkupPl(dto);
        plService.updateCache();
        return returnData(R.SUCCESS.getCode(), id);
        String content = "编辑平台区间加价id:【"+dto.getId()+"】,价格区间:【" + dto.getLowerPrice() + "】~【"+dto.getUpperPrice()+"】,加价:【" + dto.getFee() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), id, operationRecord);
    }
    @GetMapping("/list/view")
@@ -61,14 +70,18 @@
    }
    @GetMapping("/list/delete")
    @OperationLog(value = "删除平台区间加价", type = "markup_p_i")
    @ApiOperation(value = "删除平台区间加价")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "平台区间加价id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupPl(Long id){
        FlowerMarkupPl flowerMarkupPl = plService.selectMarkupPlById(id);
        plService.deleteMarkupPl(id);
        plService.updateCache();
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除平台区间加价:id:【" + id + "】,价格区间:【" + flowerMarkupPl.getLowerPrice() + "】~【" + flowerMarkupPl.getUpperPrice() + "】,加价:【" + flowerMarkupPl.getFee() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerMarkupPsController.java
@@ -4,8 +4,10 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.*;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerMarkupPsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -16,6 +18,9 @@
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@RestController
@RequestMapping("/api/flower/markup/ps")
@@ -50,16 +55,20 @@
    }
    @PostMapping("/spcg/list/save/batch")
    @OperationLog(value = "批量新增商品分类加价", type = "markup_s_p")
    @ApiOperation(value = "批量新增商品分类加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCgBatch(@RequestBody FlowerMarkupPsSpCgBatchSaveDTO dto) {
        psService.saveMarkupSpCgBatch(dto);
        return returnData(R.SUCCESS.getCode(), null);
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCgBatch(@RequestBody FlowerMarkupPsSpCgBatchSaveDTO dto, HttpServletRequest request) throws IOException {
        psService.saveMarkupSpCgBatch(dto,request);
        String content = "批量新增商品分类加价:商品分类Id:【" + dto.getCategoryId() + "】,A级:【"+dto.getLevelA()+"】,B级:【" + dto.getLevelB() + "】,C级:【" + dto.getLevelC() + "】" +
                ",D级:【"+dto.getLevelD()+"】,E级:【" + dto.getLevelE() + "】,O级:【" + dto.getLevelO() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null,operationRecord);
    }
    @PostMapping("/spcg/list/save")
    @ApiOperation(value = "新增商品分类加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCg(@RequestBody FlowerMarkupPsSpCgSaveDTO dto) {
        psService.saveMarkupSpCg(dto);
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCg(@RequestBody FlowerMarkupPsSpCgSaveDTO dto,HttpServletRequest request) throws IOException {
        psService.saveMarkupSpCg(dto,request);
        return returnData(R.SUCCESS.getCode(), null);
    }
@@ -81,6 +90,7 @@
    }
    @GetMapping("/spcg/list/delete")
    @OperationLog(value = "删除商品分类加价", type = "markup_s_p")
    @ApiOperation(value = "删除商品分类加价")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
@@ -88,13 +98,15 @@
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupSpCg(Long partnerId, Long categoryId){
        psService.deleteMarkupSpCg(partnerId, categoryId);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除商品分类加价:合伙人id:【" + partnerId + "】,商品分类id:【"+categoryId+"】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null,operationRecord);
    }
    @PostMapping("/sp/list/save")
    @ApiOperation(value = "新增商品加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSp(@RequestBody FlowerMarkupPsSpSaveDTO dto) {
        psService.saveMarkupSp(dto);
    public ResponseEntity<ReturnDataDTO> saveMarkupSp(@RequestBody FlowerMarkupPsSpSaveDTO dto,HttpServletRequest request) throws IOException {
        psService.saveMarkupSp(dto,request);
        return returnData(R.SUCCESS.getCode(), null);
    }
src/main/java/com/mzl/flower/web/flower/FlowerParamController.java
@@ -4,10 +4,14 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.FlowerParamDTO;
import com.mzl.flower.dto.response.flower.FlowerParamItemDTO;
import com.mzl.flower.dto.response.flower.FlowerParamListDTO;
import com.mzl.flower.entity.flower.FlowerParam;
import com.mzl.flower.entity.flower.FlowerParamItem;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -38,9 +42,14 @@
    }
    @PostMapping("/list/edit")
    @OperationLog(value = "编辑商品参数集", type = "flower_param")
    @ApiOperation(value = "编辑商品参数集")
    public ResponseEntity<ReturnDataDTO> updateParam(@RequestBody FlowerParamUpdateDTO dto) {
        return returnData(R.SUCCESS.getCode(), paramService.updateParam(dto));
        String content = "";
        content = "编辑商品参数集id:【" + dto.getId() + "】参数模板名称:【" + dto.getName() + "】,排序:【" + dto.getSortBy() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), paramService.updateParam(dto), operationRecord);
    }
    @GetMapping("/list/view")
@@ -59,13 +68,17 @@
    }
    @GetMapping("/list/delete")
    @OperationLog(value = "删除商品参数集", type = "flower_param")
    @ApiOperation(value = "删除商品参数集")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品参数集id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteParam(Long id){
        FlowerParam flowerParam = paramService.selectFlowerParamById(id);
        paramService.deleteParam(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除商品参数集:参数id:【" + id + "】,参数模板名称【" + flowerParam.getName() + "】,排序:【" + flowerParam.getSortBy() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/items")
@@ -87,24 +100,34 @@
    }
    @GetMapping("/list/items/delete")
    @OperationLog(value = "删除参数", type = "flower_param")
    @ApiOperation(value = "删除参数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "参数id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteParamItem(Long id){
    public ResponseEntity<ReturnDataDTO<?>> deleteParamItem(Long id) {
        FlowerParamItem flowerParamItem = paramService.selectFlowerParamItemById(id);
        paramService.deleteParamItem(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除参数:参数id:【" + flowerParamItem.getParamId() + "】,参数名称【" + flowerParamItem.getName() + "】,参数值:【" + flowerParamItem.getContent() + "】,排序:【" + flowerParamItem.getSortBy() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/list/items/new")
    @OperationLog(value = "新增参数", type = "flower_param")
    @ApiOperation(value = "新增参数")
    public ResponseEntity<ReturnDataDTO> addParamItem(@RequestBody FlowerParamItemCreateDTO dto) {
        return returnData(R.SUCCESS.getCode(), paramService.addParamItem(dto));
        String content = "新增参数:参数id:【" + dto.getParamId() + "】,参数名称【" + dto.getName() + "】,参数值:【" + dto.getContent() + "】,排序:【" + dto.getSortBy() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(),  paramService.addParamItem(dto), operationRecord);
    }
    @PostMapping("/list/items/edit")
    @OperationLog(value = "编辑参数", type = "flower_param")
    @ApiOperation(value = "编辑参数")
    public ResponseEntity<ReturnDataDTO> updateParamItem(@RequestBody FlowerParamItemUpdateDTO dto) {
        return returnData(R.SUCCESS.getCode(), paramService.updateParamItem(dto));
        String content = "编辑参数:参数id:【" + dto.getParamId() + "】,参数名称【" + dto.getName() + "】,参数值:【" + dto.getContent() + "】,排序:【" + dto.getSortBy() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(),  paramService.updateParamItem(dto), operationRecord);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerTagController.java
@@ -4,10 +4,13 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.FlowerTagCreateDTO;
import com.mzl.flower.dto.request.flower.FlowerTagQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerTagUpdateDTO;
import com.mzl.flower.dto.response.flower.FlowerTagDTO;
import com.mzl.flower.entity.flower.FlowerTag;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -33,15 +36,21 @@
    private FlowerTagService tagService;
    @PostMapping("/list/new")
    @OperationLog(value = "新增商品标签", type = "tag_list")
    @ApiOperation(value = "新增商品标签")
    public ResponseEntity<ReturnDataDTO> addTag(@RequestBody FlowerTagCreateDTO dto) {
        return returnData(R.SUCCESS.getCode(), tagService.addTag(dto));
        String content = "新增商品标签标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), tagService.addTag(dto), operationRecord);
    }
    @PostMapping("/list/edit")
    @OperationLog(value = "编辑商品标签", type = "tag_list")
    @ApiOperation(value = "编辑商品标签")
    public ResponseEntity<ReturnDataDTO> updateTag(@RequestBody FlowerTagUpdateDTO dto) {
        return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto));
        String content = "编辑商品标签id:【" + dto.getId() + "】标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto), operationRecord);
    }
    @GetMapping("/list/view")
@@ -60,13 +69,17 @@
    }
    @GetMapping("/list/delete")
    @OperationLog(value = "删除商品标签", type = "tag_list")
    @ApiOperation(value = "删除商品标签")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品标签id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteTag(Long id){
        FlowerTag flowerTag = tagService.selectFlowerTagById(id);
        tagService.deleteTag(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除商品标签id:【" + id + "】标签名称:【" + flowerTag.getName() + "】,标签说明:【" + flowerTag.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}
src/main/java/com/mzl/flower/web/flower/FlowerZoneController.java
@@ -4,11 +4,14 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.FlowerListDTO;
import com.mzl.flower.dto.response.flower.FlowerZoneDTO;
import com.mzl.flower.entity.flower.FlowerZone;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerService;
import com.mzl.flower.service.flower.FlowerZoneService;
import io.swagger.annotations.Api;
@@ -39,17 +42,23 @@
    }
    @PostMapping("/page/new")
    @OperationLog(value = "新增专区", type = "flower_zone")
    @ApiOperation(value = "新增专区")
    public ResponseEntity<ReturnDataDTO> addTag(@RequestBody FlowerZoneCreateDTO dto) {
        flowerZoneService.addZone(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "新增专区:专区标题:【" + dto.getName() + "】,专区图片:【" + dto.getBgUrl() + "】,排序:【" + dto.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/page/edit")
    @OperationLog(value = "编辑专区", type = "flower_zone")
    @ApiOperation(value = "编辑专区")
    public ResponseEntity<ReturnDataDTO> updateZone(@RequestBody FlowerZoneUpdateDTO dto) {
        flowerZoneService.updateZone(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "编辑专区:专区id:【"+dto.getId()+"】,专区标题:【" + dto.getName() + "】,专区图片:【" + dto.getBgUrl() + "】,排序:【" + dto.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/page/view")
@@ -68,13 +77,17 @@
    }
    @GetMapping("/page/delete")
    @OperationLog(value = "删除专区", type = "flower_zone")
    @ApiOperation(value = "删除专区")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "专区id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteZone(@NotNull(message = "id不能为空") Long id){
        FlowerZone flowerZone = flowerZoneService.selectFlowerZoneById(id);
        flowerZoneService.deleteZone(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除专区:专区id:【" + id + "】,专区标题:【" + flowerZone.getName() + "】,专区图片:【" + flowerZone.getBgUrl() + "】,排序:【" + flowerZone.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list")
src/main/java/com/mzl/flower/web/log/OperationRecordController.java
对比新文件
@@ -0,0 +1,40 @@
package com.mzl.flower.web.log;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.dto.request.log.OperationRecordQueryDTO;
import com.mzl.flower.dto.response.log.OperationRecordVO;
import com.mzl.flower.service.log.OperationRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author fanghaowei
 * @version version2.0
 * @className OperationRecordController
 * @date 2024/12/02
 * @description 操作日志功能开发
 */
@Api(value = "操作日志", tags = "操作日志")
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class OperationRecordController extends BaseController {
    private final OperationRecordService operationRecordService;
    @GetMapping("/operationRecord/list")
    @ApiOperation(value = "操作日志列表", httpMethod = "GET")
    public ResponseEntity<ReturnDataDTO<Page<OperationRecordVO>>> getOperationRecordList(Page page, OperationRecordQueryDTO dto) {
        return returnData(R.SUCCESS.getCode(), operationRecordService.queryPage(dto, page));
    }
}
src/main/java/com/mzl/flower/web/payment/OrderController.java
@@ -4,11 +4,14 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.payment.OrderAddressUpdateDTO;
import com.mzl.flower.dto.request.payment.OrderDeliveryNoDTO;
import com.mzl.flower.dto.request.payment.OrderQueryDTO;
import com.mzl.flower.dto.response.payment.*;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.payment.Order;
import com.mzl.flower.service.payment.DeliveryOrderService;
import com.mzl.flower.service.payment.OrderService;
import com.mzl.flower.service.payment.UserPaymentV3Service;
@@ -72,10 +75,14 @@
    }
    @PostMapping("/list/send")
    @OperationLog(value = "发货", type = "order_list")
    @ApiOperation(value = "没有合伙人的花店上传快递号发货")
    public ResponseEntity<ReturnDataDTO> saveDeliveryNo(@RequestBody OrderDeliveryNoDTO dto) {
        orderService.saveDeliveryNo(dto);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(dto.getId());
        String content = "订单发货id:【" + dto.getId() + "】,订单号:【" + orderInfoById.getOrderNo() + "】,快递号:【" + dto.getDeliveryNo() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/abnormal/details")
@@ -88,10 +95,14 @@
    }
    @GetMapping("/list/abnormal/process")
    @OperationLog(value = "异常订单处理", type = "order_list")
    @ApiOperation(value = "异常订单处理(不管有没有退款金额,建议都要处理)")
    public ResponseEntity<ReturnDataDTO> processLevelDown(String id) throws Exception {
        orderService.processAbnormalOrder(id);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(id);
        String content = "订单退款id:【" + id + "】,订单号:【" + orderInfoById.getOrderNo() + "】操作退款,降级打款记录id:【" + orderInfoById.getTransferId() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/check/info/reduce")
@@ -172,6 +183,7 @@
    }
    @GetMapping(value = "/refund")
    @OperationLog(value = "订单退款", type = "order_list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "订单id", required = true, dataType = "String", paramType = "query"),
    })
@@ -179,14 +191,21 @@
    public ResponseEntity<ReturnDataDTO> refundOrder(String id) {
        orderService.refundCheckAdmin(id);
        paymentV3Service.refundOrder(id);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(id);
        String content = "订单退款id:【" + id + "】,订单号:【" + orderInfoById.getOrderNo() + "】操作退款";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/page/update")
    @OperationLog(value = "订单修改", type = "order_list")
    @ApiOperation(value = "订单修改", notes = "订单修改")
    public ResponseEntity<ReturnDataDTO> operationUpdate(@Validated @RequestBody OrderAddressUpdateDTO dto) {
        orderService.operationUpdate(dto);
        return returnData(R.SUCCESS.getCode(),null);
        Order orderInfoById = orderService.getOrderInfoById(dto.getId());
        String content = "订单修改id:【" + dto.getId() + "】,订单号:【" + orderInfoById.getOrderNo() + "】,地区:【" + dto.getCustomerProvince() + dto.getCustomerCity() + dto.getCustomerRegion() + "】,详细地址:【" + dto.getCustomerAddress() + "】,联系方式:【" + dto.getCustomerTel() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/export")
src/main/java/com/mzl/flower/web/payment/SalesController.java
@@ -4,12 +4,15 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.payment.*;
import com.mzl.flower.dto.request.payment.OrderItemSalesAuditDTO;
import com.mzl.flower.dto.request.payment.OrderItemSalesQueryDTO;
import com.mzl.flower.dto.response.payment.OrderItemSalesNewDTO;
import com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO;
import com.mzl.flower.dto.response.payment.OrderStatusCountDTO;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.payment.OrderItem;
import com.mzl.flower.service.payment.OrderItemSalesService;
import com.mzl.flower.service.payment.OrderItemSettlementService;
@@ -22,7 +25,6 @@
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -69,17 +71,27 @@
    }
    @PostMapping("/audit/agree")
    @OperationLog(value = "审核售后单-通过", type = "sales_fee")
    @ApiOperation(value = "审核售后单-通过")
    public ResponseEntity<ReturnDataDTO> agree(@RequestBody OrderItemSalesAuditDTO dto) throws Exception {
        OrderItem oi = salesService.doAudit(dto, Constants.ORDER_SALES_STATUS.AGREED.name());
        orderItemSettlementService.saveItemSettlementInfo(oi, SecurityUtils.getUserId(), Constants.S_TYPE.SALES);
        return returnData(R.SUCCESS.getCode(), null);
//        OrderItemSettlement orderItemSettlement = orderItemSettlementService.selectOrderItemSettlementById(dto.getId());
        String content = "审核售后单-通过id:【" + dto.getId() + "】,供应商(元):【" + dto.getFeeSupplier() + "】,平台(元):【" + dto.getFeePlatform() + "】" + ",合伙人(元):【" + dto.getFeePartner() + "】" +
                ",打包(元):【" + dto.getFeePlatformPack() + "】,质检(元):【" + dto.getFeePlatformCheck() + "】,物流(元):【" + dto.getFeePlatformTransport() + "】" + "" +
                ",打包运费(元)(散户):【" + dto.getFeePackingTransport() + "】,平台回复:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/audit/reject")
    @OperationLog(value = "审核售后单-拒绝", type = "sales_fee")
    @ApiOperation(value = "审核售后单-拒绝")
    public ResponseEntity<ReturnDataDTO> reject(@RequestBody OrderItemSalesAuditDTO dto) throws Exception {
//        OrderItemSettlement orderItemSettlement = orderItemSettlementService.selectOrderItemSettlementById(dto.getId());
        salesService.doAudit(dto, Constants.ORDER_SALES_STATUS.REJECTED.name());
        return returnData(R.SUCCESS.getCode(), null);
        String content = "审核售后单-拒绝id:【" + dto.getId() + "】,平台回复:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}
src/main/java/com/mzl/flower/web/payment/SettlementController.java
@@ -4,9 +4,12 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.payment.OrderSettlementQueryDTO;
import com.mzl.flower.dto.response.payment.OrderSettlementDTO;
import com.mzl.flower.dto.response.payment.OrderSettlementListDTO;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.payment.OrderSettlement;
import com.mzl.flower.schedule.ScheduleService;
import com.mzl.flower.service.payment.OrderSettlementService;
import io.swagger.annotations.Api;
@@ -60,13 +63,17 @@
    }
    @GetMapping("/list/transfer")
    @OperationLog(value = "结算转账", type = "settlement_list")
    @ApiOperation(value = "结算转账")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "结算id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> doSettlementTransfer(String id){
        settlementService.doSettlementTransfer(id);
        return returnData(R.SUCCESS.getCode(), null);
        OrderSettlement settlement = settlementService.selectOrderSettlementById(id);
        String content = "结算转账:id:【" + id + "】,用户id【" + settlement.getUserId() + "】,结算金额:【" + settlement.getSettlementAmount() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/do")
src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java
@@ -5,12 +5,16 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.dto.request.comment.*;
import com.mzl.flower.dto.response.comment.FlowerCommentVO;
import com.mzl.flower.dto.response.coupon.CouponTemplatePointVO;
import com.mzl.flower.dto.response.coupon.CouponTemplateVO;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.payment.Order;
import com.mzl.flower.service.comment.FlowerCommentService;
import com.mzl.flower.service.payment.OrderService;
import com.mzl.flower.utils.ConverterUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -35,6 +39,9 @@
    @Autowired
    private FlowerCommentService flowerCommentService;
    @Autowired
    private OrderService orderService;
    @PostMapping("")
    @ApiOperation(value = "新增", notes = "新增")
@@ -70,6 +77,7 @@
    }
    @DeleteMapping("/{id}")
    @OperationLog(value = "评价删除",type = "flower_comment")
    @ApiOperation(value = "删除", notes = "删除")
    public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) {
@@ -78,7 +86,10 @@
            throw new ValidationException("评论不存在");
        }
        flowerCommentService.deleteFlowerComment(id);
        return returnData(R.SUCCESS.getCode(), null);
        Order order = orderService.getOrderInfoById(flowerCommentDO.getOrderId());
        String content = "评价删除id:【" + id + "】,订单编号【" + order.getOrderNo() + "】,供应商id:【" + flowerCommentDO.getSupplierId() + "】,评价内容:【" + flowerCommentDO.getComment() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/{id}")
src/main/resources/mapper/log/OperationRecordMapper.xml
对比新文件
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mzl.flower.mapper.log.OperationRecordMapper">
    <select id="queryPage" resultType="com.mzl.flower.dto.response.log.OperationRecordVO">
        select t.* , u.nick_name createName from t_operation_record t
        LEFT JOIN t_user u ON t.create_by = u.id
        where t.deleted= 0
        <if test="dto.createName != null and dto.createName != ''">
            and u.nick_name like concat('%', #{dto.createName}, '%')
        </if>
        <if test="dto.module != null and dto.module != ''">
            and t.module = #{dto.module}
        </if>
        <if test="dto.function != null and dto.function != ''">
            and t.function like concat('%', #{dto.function}, '%')
        </if>
        <if test="dto.content != null and dto.content != ''">
            and t.content like concat('%', #{dto.content}, '%')
        </if>
        <if test="dto.createDateBeginStr!=null ">
            AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &gt;= #{dto.createDateBeginStr}
        </if>
        <if test="dto.createDateEndStr!=null ">
            AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &lt;= #{dto.createDateEndStr}
        </if>
        order by t.create_time desc
    </select>
</mapper>