Cui Zhi Feng
2024-09-13 f6137d2b84e7249548b2efd8d32db6e814eef3d2
src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
@@ -238,6 +238,18 @@
        return deliveryOrderItemMapper.selectDoItemList(id);
    }
    public List<DeliveryOrderItemDTO> getSupplierDeliveryOrderItems(PostQueryDTO dto){
        List<String> idList = dto.getIds();
        List<DeliveryOrderItemDTO> ls = new ArrayList<>();
        if(idList != null && idList.size() > 0){
            for(String id : idList){
                ls.add(getSupplierDeliveryOrderItem(id));
            }
        }
        return ls;
    }
    public DeliveryOrderItemDTO getSupplierDeliveryOrderItem(String id) {
        DeliveryOrderItemDTO dto = new DeliveryOrderItemDTO();
@@ -382,6 +394,10 @@
        );
        if (count == 0) {
            Order o = orderMapper.selectById(orderId);
            if(!Constants.ORDER_STATUS_BACKEND.COLLECTION.name().equals(o.getStatus())){
                log.warn("非待集货状态,不可设置待发货");
                return;
            }
            o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.SEND.name());
            o.update(SecurityUtils.getUserId());
            orderMapper.updateById(o);
@@ -463,17 +479,19 @@
        return dto;
    }
    public List<StationStatisticDTO> statisticStationList(String name, LocalDateTime startDate, LocalDateTime endDate) {
    public List<StationStatisticDTO> statisticStationList(String name, LocalDateTime startDate
            , LocalDateTime endDate, String status) {
        String userId = SecurityUtils.getUserId();
        LambdaQueryWrapper<Station> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.like(Station::getUserIds, userId);
        lambdaQueryWrapper.like(Station::getUserIds, "%" + userId + "%");
        lambdaQueryWrapper.eq(Station::getType, "0");
        boolean hasZc = stationMapper.selectCount(lambdaQueryWrapper)>0;//当前用户是否有总仓权限,总仓能查看到所有集货站的数据
        boolean hasZc = stationMapper.selectCount(lambdaQueryWrapper) > 0;//当前用户是否有总仓权限,总仓能查看到所有集货站的数据
        List<String> statusList = splitParam(status);
        if(hasZc){
            List<StationStatisticDTO> stationStatisticDTOS = deliveryOrderMapper.statisticStationList(startDate, endDate,name,null);
            List<StationStatisticDTO> stationStatisticDTOS = deliveryOrderMapper.statisticStationList(startDate, endDate,name,null, statusList);
            return stationStatisticDTOS;
        }else{
            List<StationStatisticDTO> stationStatisticDTOS = deliveryOrderMapper.statisticStationList(startDate, endDate,name,userId);
            List<StationStatisticDTO> stationStatisticDTOS = deliveryOrderMapper.statisticStationList(startDate, endDate, name, userId, statusList);
            return stationStatisticDTOS;
        }
    }