| | |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.dto.TOrderStockDTO; |
| | | import com.ruoyi.system.mapper.TOrderStockMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorQuery; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.query.TOrderStockQuery; |
| | | import com.ruoyi.system.service.TOrderStockGoodsService; |
| | | import com.ruoyi.system.service.TOrderStockService; |
| | | import com.ruoyi.system.vo.TDataGeneratorVO; |
| | | import com.ruoyi.system.vo.TOrderStockVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | switch (query.getTimeType()){ |
| | | case 1: |
| | | // 今日 |
| | | startTime = LocalDateTime.MIN; |
| | | endTime = LocalDateTime.MAX; |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now()); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | case 2: |
| | | // 昨日 |
| | | startTime = LocalDateTime.now().minusDays(1); |
| | | endTime = LocalDateTime.now().minusDays(1); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(1)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now().minusDays(1)); |
| | | break; |
| | | case 3: |
| | | // 近7天 |
| | | startTime = LocalDateTime.now().minusDays(7); |
| | | endTime = LocalDateTime.now(); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(7)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | case 4: |
| | | // 近30天 |
| | | startTime = LocalDateTime.now().minusDays(30); |
| | | endTime = LocalDateTime.now(); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(30)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | } |
| | | query.setStartTime(DateUtils.localDateTimeToDate(startTime)); |
| | |
| | | switch (query.getTimeType()){ |
| | | case 1: |
| | | // 今日 |
| | | startTime = LocalDateTime.MIN; |
| | | endTime = LocalDateTime.MAX; |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now()); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | case 2: |
| | | // 昨日 |
| | | startTime = LocalDateTime.now().minusDays(1); |
| | | endTime = LocalDateTime.now().minusDays(1); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(1)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now().minusDays(1)); |
| | | break; |
| | | case 3: |
| | | // 近7天 |
| | | startTime = LocalDateTime.now().minusDays(7); |
| | | endTime = LocalDateTime.now(); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(7)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | case 4: |
| | | // 近30天 |
| | | startTime = LocalDateTime.now().minusDays(30); |
| | | endTime = LocalDateTime.now(); |
| | | startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(30)); |
| | | endTime = DateUtils.getDayEnd(LocalDateTime.now()); |
| | | break; |
| | | } |
| | | query.setStartTime(DateUtils.localDateTimeToDate(startTime)); |