| | |
| | | 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); |
| | | //买单 |
| | | if(2 == orderType){ |
| | | IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageBuy = mallProductBuyMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageBuy.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageBuy.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | 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()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageBuy = mallProductBuyMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageBuy.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageBuy.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //卖单 |
| | | if(1 == orderType){ |
| | | IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageSell = mallProductSellMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageSell.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageSell.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | //卖单 |
| | | if(1 == orderType){ |
| | | IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageSell = mallProductSellMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageSell.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageSell.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | } |
| | | } |
| | | } |
| | | } |