Cui Zhi Feng
2024-09-26 a3926611d150bca95386aab191f795ddad739c27
获取商品详情列表-使用订单商品id
已修改3个文件
32 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
@@ -257,13 +257,33 @@
        return ls;
    }
    public List<DeliveryOrderItemDTO> getSupplierDeliveryOrderItemsByItemId(PostQueryDTO dto){
        List<String> idList = dto.getIds();
        List<DeliveryOrderItemDTO> ls = new ArrayList<>();
        if(idList != null && idList.size() > 0){
            for(String id : idList){
                DeliveryOrderItem item = deliveryOrderItemMapper.selectOne(new QueryWrapper<DeliveryOrderItem>()
                        .eq("order_item_id", id));
                ls.add(getSupplierDeliveryOrderItem(item));
            }
        }
        return ls;
    }
    public DeliveryOrderItemDTO getSupplierDeliveryOrderItem(String id) {
        DeliveryOrderItem item = deliveryOrderItemMapper.selectById(id);
        return getSupplierDeliveryOrderItem(item);
    }
    public DeliveryOrderItemDTO getSupplierDeliveryOrderItem(DeliveryOrderItem item) {
        DeliveryOrderItemDTO dto = new DeliveryOrderItemDTO();
        Supplier s = getCurrentSupplier();
        dto.setSupplierName(s.getName());
        DeliveryOrderItem item = deliveryOrderItemMapper.selectById(id);
        Order d = orderMapper.selectById(item.getOrderId());
        dto.setOrderNo(d.getOrderNo());
        dto.setWarehouseName(d.getWarehouseName());
src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java
@@ -343,7 +343,7 @@
        }
        BigDecimal feeSupplier = getAmount(dto.getFeeSupplier());
        BigDecimal supplierTotal = oi.getSupplierPrice().multiply(new BigDecimal(sl.getNum()));//申请数量的供应商价格
        BigDecimal supplierTotal = getAmount(oi.getSupplierPrice()).multiply(new BigDecimal(sl.getNum()));//申请数量的供应商价格
        //1.输入不能大于商品申请数量"供应商上架价格
        if(feeSupplier.doubleValue() > supplierTotal.doubleValue()){
            throw new ValidationException("供应商扣款金额不能大于商品申请数量的供应商售价");
@@ -352,7 +352,7 @@
        BigDecimal feePartner = getAmount(dto.getFeePartner());
        //合伙人输入框限制:
        //1.输入金额不能大于输入金额申请数量"加价
        BigDecimal partnerTotal = oi.getMarkupPartner().multiply(new BigDecimal(sl.getNum()));//申请数量的合伙人加价
        BigDecimal partnerTotal = getAmount(oi.getMarkupPartner()).multiply(new BigDecimal(sl.getNum()));//申请数量的合伙人加价
        if(feePartner.doubleValue() > partnerTotal.doubleValue()){
            throw new ValidationException("合伙人扣款金额不能大于商品申请数量的合伙人加价");
        }
src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java
@@ -118,6 +118,12 @@
        return returnData(R.SUCCESS.getCode(), deliveryOrderService.getSupplierDeliveryOrderItems(dto));
    }
    @PostMapping("/list/items/views/new")
    @ApiOperation(value = "获取商品详情列表-使用订单商品id")
    public ResponseEntity<ReturnDataDTO<List<DeliveryOrderItemDTO>>> getSupplierDeliveryOrderItemsByItemId(@RequestBody PostQueryDTO dto){
        return returnData(R.SUCCESS.getCode(), deliveryOrderService.getSupplierDeliveryOrderItemsByItemId(dto));
    }
    @PostMapping("/list/arrive")
    @ApiOperation(value = "确认入位")
    public ResponseEntity<ReturnDataDTO> arrived(@RequestBody DeliveryOrderArriveDTO dto) {