|
@@ -7,6 +7,7 @@ import com.sd.business.entity.bom.po.Bom;
|
|
|
import com.sd.business.entity.bom.po.BomSpec;
|
|
|
import com.sd.business.entity.department.po.Department;
|
|
|
import com.sd.business.entity.inventory.dto.InventoryBackupSelectDto;
|
|
|
+import com.sd.business.entity.inventory.dto.InventorySelectDto;
|
|
|
import com.sd.business.entity.inventory.po.Inventory;
|
|
|
import com.sd.business.entity.inventory.po.InventoryBackup;
|
|
|
import com.sd.business.entity.inventory.vo.InventoryBackupVo;
|
|
@@ -84,4 +85,29 @@ public class InventoryBackupServiceImpl extends ServiceImpl<InventoryBackupMappe
|
|
|
ExcelUtil.export(response, DateUtil.format(new Date(), "yyyy-MM-dd库存数据"), "库存数据", list, InventoryBackupVo.class);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Page<InventoryBackupVo> groupPage(InventorySelectDto dto) {
|
|
|
+
|
|
|
+ Page<InventoryBackupVo> page = Sql.create(InventoryBackupVo.class)
|
|
|
+ .select(InventoryBackup::getBackupDate)
|
|
|
+ .from(InventoryBackup.class)
|
|
|
+ .ge(InventoryBackup::getBackupDate, dto.getBeginTime())
|
|
|
+ .le(InventoryBackup::getBackupDate, dto.getEndTime())
|
|
|
+ .orderByDesc(InventoryBackup::getId)
|
|
|
+ .groupBy(InventoryBackup::getBackupDate)
|
|
|
+ .page(dto);
|
|
|
+
|
|
|
+ List<InventoryBackupVo> records = page.getRecords();
|
|
|
+ if (records.isEmpty()) {
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (InventoryBackupVo record : records) {
|
|
|
+ record.setBackupDateStr(DateUtil.format(record.getBackupDate(), "yyyy-MM-dd"));
|
|
|
+ record.setBackupDate(DateUtil.offsetDay(record.getBackupDate(), 1));
|
|
|
+ }
|
|
|
+
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
}
|