| | |
| | | return dto; |
| | | } |
| | | |
| | | public OrderItemCheckNumDTO getOtherCheck(String itemId, String type){ |
| | | public OrderItemCheckNumDTO getOtherCheck(String itemId, String type, boolean isSupplier){ |
| | | OrderItemCheck c = orderItemCheckMapper.selectOne(new QueryWrapper<OrderItemCheck>() |
| | | .eq("type", type) |
| | | .eq("order_item_id", itemId) |
| | |
| | | BeanUtils.copyProperties(c, dto); |
| | | User user = userMapper.selectById(c.getCreateBy()); |
| | | dto.setCreateName(user.getNickName()); |
| | | |
| | | if(Constants.CHECK_TYPE.lack.name().equals(c.getType()) && isSupplier){ |
| | | OrderItem oi = orderItemMapper.selectById(itemId); |
| | | BigDecimal lackFeeSupplier = oi.getSupplierPrice().multiply(new BigDecimal(c.getNum())); |
| | | dto.setDeductAmount(lackFeeSupplier); |
| | | } |
| | | } |
| | | |
| | | return dto; |
对比新文件 |
| | |
| | | package com.mzl.flower.web.customer; |
| | | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.constant.Constants; |
| | | import com.mzl.flower.dto.response.payment.*; |
| | | import com.mzl.flower.service.payment.DeliveryOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/customer/delivery") |
| | | @Api(value = "配送管理-花店", tags = "配送管理-花店") |
| | | @Validated |
| | | @Slf4j |
| | | public class DeliveryCustomerController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DeliveryOrderService deliveryOrderService; |
| | | |
| | | @GetMapping("/mine/list/check/info/reduce") |
| | | @ApiOperation(value = "降级操作详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderItemId", value = "订单商品id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckReduceDTO>> getReduceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getReduceCheck(orderItemId)); |
| | | } |
| | | |
| | | @GetMapping("/mine/list/check/info/lack") |
| | | @ApiOperation(value = "缺货操作详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderItemId", value = "订单商品id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getLackCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.lack.name(), false)); |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "补货操作详情") |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getReplaceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.replace.name())); |
| | | , Constants.CHECK_TYPE.replace.name(), false)); |
| | | } |
| | | |
| | | @GetMapping("/check/info/lack") |
| | | @ApiOperation(value = "缺货操作详情") |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getLackCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.lack.name())); |
| | | , Constants.CHECK_TYPE.lack.name(), false)); |
| | | } |
| | | |
| | | @PostMapping("/check/info/do/reduce") |
| | |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getReplaceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.replace.name())); |
| | | , Constants.CHECK_TYPE.replace.name(), false)); |
| | | } |
| | | |
| | | @GetMapping("/list/check/info/lack") |
| | |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getLackCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.lack.name())); |
| | | , Constants.CHECK_TYPE.lack.name(), false)); |
| | | } |
| | | |
| | | @GetMapping("/list/check/info/agree") |
| | |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getReplaceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.replace.name())); |
| | | , Constants.CHECK_TYPE.replace.name(), true)); |
| | | } |
| | | |
| | | @GetMapping("/mine/list/check/info/lack") |
| | |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getLackCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.lack.name())); |
| | | , Constants.CHECK_TYPE.lack.name(), true)); |
| | | } |
| | | } |