|  |  |  | 
|---|
|  |  |  | import com.mzl.flower.base.ReturnDataDTO; | 
|---|
|  |  |  | import com.mzl.flower.config.exception.ValidationException; | 
|---|
|  |  |  | import com.mzl.flower.dto.request.flower.FlowerMarkupSpQueryDTO; | 
|---|
|  |  |  | import com.mzl.flower.dto.request.flower.FlowerMarkupSpSaveBatchDTO; | 
|---|
|  |  |  | import com.mzl.flower.dto.request.flower.FlowerMarkupSpSaveDTO; | 
|---|
|  |  |  | import com.mzl.flower.dto.response.flower.FlowerMarkupSpDTO; | 
|---|
|  |  |  | import com.mzl.flower.dto.response.flower.FlowerMarkupSpListDTO; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/list") | 
|---|
|  |  |  | @ApiOperation(value = "获取商品加价列表") | 
|---|
|  |  |  | public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpList(Page page, FlowerMarkupSpQueryDTO dto){ | 
|---|
|  |  |  | public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpList(Page page | 
|---|
|  |  |  | , FlowerMarkupSpQueryDTO dto){ | 
|---|
|  |  |  | Partner s = spService.getCurrentPartner(); | 
|---|
|  |  |  | if(s == null){ | 
|---|
|  |  |  | throw new ValidationException("未找到当前合伙人信息"); | 
|---|
|  |  |  | 
|---|
|  |  |  | return returnData(R.SUCCESS.getCode(), null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/flower/list") | 
|---|
|  |  |  | @ApiOperation(value = "获取加价商品加列表") | 
|---|
|  |  |  | public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpFlowerList(Page page | 
|---|
|  |  |  | , FlowerMarkupSpQueryDTO dto){ | 
|---|
|  |  |  | Partner s = spService.getCurrentPartner(); | 
|---|
|  |  |  | if(s == null){ | 
|---|
|  |  |  | throw new ValidationException("未找到当前合伙人信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | dto.setPartnerId(s.getId()); | 
|---|
|  |  |  | return returnData(R.SUCCESS.getCode(), spService.selectMarkupSpFlowerList(page, dto)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/flower/list/save") | 
|---|
|  |  |  | @ApiOperation(value = "批量新增商品加价") | 
|---|
|  |  |  | public ResponseEntity<ReturnDataDTO> saveMarkupSpBatch(@RequestBody FlowerMarkupSpSaveBatchDTO dto) { | 
|---|
|  |  |  | Partner s = spService.getCurrentPartner(); | 
|---|
|  |  |  | if(s == null){ | 
|---|
|  |  |  | throw new ValidationException("未找到当前合伙人信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | dto.setPartnerId(s.getId()); | 
|---|
|  |  |  | spService.saveMarkupSpBatch(dto); | 
|---|
|  |  |  | return returnData(R.SUCCESS.getCode(), null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|