KKSU
2023-11-24 0122f61044683af26a0462431260be389e6d17ad
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java
@@ -271,12 +271,35 @@
        return new FebsResponse().success();
    }
    public static void main(String[] args) {
        DateTime dateTime = DateUtil.parseTime("15:00:00");
        DateTime dateTime2 = DateUtil.parseTime("19:00:00");
        DateTime dateTime1 = DateUtil.parseTime(DateUtil.formatTime(DateUtil.date()));
        System.out.println(dateTime);
        System.out.println(dateTime1);
        System.out.println(dateTime1.compareTo(dateTime));
        System.out.println(dateTime1.compareTo(dateTime2));
        System.out.println(dateTime1.compareTo(dateTime) >= 0 && dateTime1.compareTo(dateTime2) <= 0);
    }
    @Override
    public FebsResponse orderList(ApiOrderListDto apiOrderListDto) {
        Long memberId = LoginUserUtil.getLoginUser().getId();
        List<ApiOrderListVo> objects = new ArrayList<>();
        Integer orderType = apiOrderListDto.getOrderType();
        apiOrderListDto.setMemberId(memberId);
        DateTime nowTime = DateUtil.parseTime(DateUtil.formatTime(DateUtil.date()));
        DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.YU_YUE_START_TIME.getType(),
                DataDictionaryEnum.YU_YUE_START_TIME.getCode()
        );
        DateTime startTime = DateUtil.parseTime(startTimeDic.getValue());
        DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.YU_YUE_END_TIME.getType(),
                DataDictionaryEnum.YU_YUE_END_TIME.getCode()
        );
        DateTime endTime = DateUtil.parseTime(endTimeDic.getValue());
        if(nowTime.compareTo(startTime) >= 0 && nowTime.compareTo(endTime) <= 0){
        //买单
        if(2 == orderType){
            IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize());
@@ -297,6 +320,7 @@
                }
            }
        }
        }
        return new FebsResponse().success().data(objects);
    }