| | |
| | | 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; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/flower/markup/pl") |
| | |
| | | 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") |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |