cloudroam
2024-12-04 6c823dd44dbde79f008001a2a11e7bf9bc6bf8cc
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")
@@ -28,9 +33,12 @@
    private FlowerMarkupPsService psService;
    @PostMapping("/list/new")
    @OperationLog(value = "新增合伙人配置", type = "markup_s_p")
    @ApiOperation(value = "新增合伙人配置")
    public ResponseEntity<ReturnDataDTO> saveMarkupPs(@RequestBody FlowerMarkupPsSaveDTO dto) {
        return returnData(R.SUCCESS.getCode(), psService.saveMarkupPs(dto));
        String content = "新增合伙人配置:合伙人id:【" + dto.getPartnerId() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), psService.saveMarkupPs(dto), operationRecord);
    }
    @GetMapping("/list")
@@ -40,26 +48,33 @@
    }
    @GetMapping("/list/delete")
    @OperationLog(value = "删除合伙人配置", type = "markup_s_p")
    @ApiOperation(value = "删除合伙人配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupPs(Long id){
        psService.deleteMarkupPs(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除合伙人配置id:【" + id+ "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @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 +96,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 +104,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);
    }
@@ -115,6 +133,7 @@
    }
    @GetMapping("/sp/list/delete")
    @OperationLog(value = "删除商品加价", type = "markup_s_p")
    @ApiOperation(value = "删除商品加价")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
@@ -122,6 +141,8 @@
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupSp(Long partnerId, Long flowerId){
        psService.deleteMarkupSp(partnerId, flowerId);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除商品加价:合伙人id:【" + partnerId + "】,商品id:【"+flowerId+"】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null,operationRecord);
    }
}