陶杰
2024-09-12 10215da99ee763cf72897c747f82efd4f9a513ad
src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
@@ -354,7 +354,7 @@
        );
        if (items != null && items.size() > 0) {
            for (OrderItem i : items) {
                i.setStatus(Constants.CHECK_OPERATE.ok.name());
                i.setStatus(Constants.ORDER_ITEM_STATUS.ok.name());
                i.setCheckTime(LocalDateTime.now());
                orderItemMapper.updateById(i);
            }
@@ -399,12 +399,14 @@
            }
            Integer orderCountToday = deliveryOrderMapper.selectCount(new QueryWrapper<DeliveryOrder>()
                    .eq("deleted", 0)
                    .eq("supplier_id", supplierId)
                    .gt("create_time", startDate)
                    .le("create_time", endDate));
            dto.setOrderCountToday(orderCountToday == null ? 0 : orderCountToday);
            Integer orderCountYesterday = deliveryOrderMapper.selectCount(new QueryWrapper<DeliveryOrder>()
                    .eq("deleted", 0)
                    .eq("supplier_id", supplierId)
                    .gt("create_time", startDate.plusDays(-1))
                    .le("create_time", endDate.plusDays(-1)));
@@ -412,13 +414,16 @@
            LocalDateTime ffPm = LocalDate.now().withDayOfMonth(1).atTime(17, 0, 0).plusDays(-1);
            Integer orderCountMonth = deliveryOrderMapper.selectCount(new QueryWrapper<DeliveryOrder>()
                    .eq("deleted", 0)
                    .eq("supplier_id", supplierId)
                    .gt("create_time", ffPm));
            dto.setOrderCountMonth(orderCountMonth == null ? 0 : orderCountMonth);
            BigDecimal salesRate = new BigDecimal(0);
            Integer orderTotal = deliveryOrderMapper.selectCount(new QueryWrapper<DeliveryOrder>()
                    .eq("supplier_id", supplierId));
                    .eq("deleted", 0)
                    .eq("supplier_id", supplierId)
            );
            Integer salesCount = orderItemSalesMapper.getSupplierSalesCount(supplierId);
            if (orderTotal != null && orderTotal > 0) {
                BigDecimal rate = new BigDecimal(salesCount).divide(new BigDecimal(orderTotal), 2, RoundingMode.HALF_UP);
@@ -463,6 +468,7 @@
    //////////////////////////////////////////////////////////////新接口
    public Page<DeliveryOrderList4CheckDTO> selectSupplierDoList4Check(Page page, DeliveryOrderStationQueryDTO dto) {
        dto.setStatusList(splitParam(dto.getStatus()));
        List<DeliveryOrderList4CheckDTO> ls = deliveryOrderMapper.selectSupplierDoList4Check(page, dto);
        page.setRecords(ls);
@@ -473,6 +479,7 @@
        if(dto.getSupplierId() == null){
            throw new ValidationException("供应商id不能为空");
        }
        dto.setStatusList(splitParam(dto.getStatus()));
        List<DeliveryOrder4CheckDTO> ls = deliveryOrderMapper.selectSupplierDoInfo4Check(page, dto);
        if(ls != null && ls.size() > 0){
@@ -609,7 +616,7 @@
        }
        BigDecimal deduct = new BigDecimal(0);
        BigDecimal realPrice = oi.getRealPrice()==null?new BigDecimal(0):oi.getRealPrice();
        BigDecimal realPrice = getAmount(oi.getRealPrice());
        if(Constants.CHECK_TYPE.replace.name().equals(dto.getType())){
            deduct = oi.getSupplierPrice().multiply(new BigDecimal(dto.getNum()));
        } else if(Constants.CHECK_TYPE.lack.name().equals(dto.getType())){