From 6c823dd44dbde79f008001a2a11e7bf9bc6bf8cc Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期三, 04 十二月 2024 18:15:44 +0800 Subject: [PATCH] fix:合伙人列表操作日志 --- src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java | 38 +++++++++++++++++++++++++++++++++----- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java b/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java index 4574f21..1ef776d 100644 --- a/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java +++ b/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java @@ -5,15 +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.CreateFlowerCommentBatchDTO; -import com.mzl.flower.dto.request.comment.CreateFlowerCommentDTO; -import com.mzl.flower.dto.request.comment.QueryFlowerCommentDTO; -import com.mzl.flower.dto.request.comment.UpdateFlowerCommentDTO; +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; @@ -38,6 +39,9 @@ @Autowired private FlowerCommentService flowerCommentService; + + @Autowired + private OrderService orderService; @PostMapping("") @ApiOperation(value = "新增", notes = "新增") @@ -73,6 +77,7 @@ } @DeleteMapping("/{id}") + @OperationLog(value = "评价删除",type = "flower_comment") @ApiOperation(value = "删除", notes = "删除") public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) { @@ -81,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}") @@ -120,6 +128,26 @@ return returnData(R.SUCCESS.getCode(), flowerCommentService.getSupplierStatis(id)); } + @PutMapping("/show/{id}") + @ApiOperation(value = "显示/隐藏", notes = "显示/隐藏") + public ResponseEntity<ReturnDataDTO> updateShow(@PathVariable String id,@Validated @RequestBody ShowFlowerCommentDTO dto) { + + // 手动设置id值 + dto.setId(id); + flowerCommentService.updateShowFlowerComment(dto); + return returnData(R.SUCCESS.getCode(), null); + } + + @PutMapping("/replay/{id}") + @ApiOperation(value = "评论回复", notes = "评论回复") + public ResponseEntity<ReturnDataDTO> updateReplay(@PathVariable String id,@Validated @RequestBody ReplayFlowerCommentDTO dto) { + + // 手动设置id值 + dto.setId(id); + flowerCommentService.updateReplayFlowerComment(dto); + return returnData(R.SUCCESS.getCode(), null); + } + private void valid(CreateFlowerCommentDTO dto){ } -- Gitblit v1.9.3