瀏覽代碼

完善棒三工作台跟上若工作台的参数过滤导出

lingpeng.li 1 月之前
父節點
當前提交
0b356df1b3

+ 32 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/controller/RollClubOneController.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.billet.rollClubOne.controller;
 package org.jeecg.modules.billet.rollClubOne.controller;
 
 
 
 
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,13 +18,19 @@ import org.jeecg.modules.billet.rollClubOne.service.IRollClubOneService;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.storageBill.dto.StorageCenterQueryDTO;
 import org.jeecg.modules.billet.storageBill.dto.StorageCenterQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.StorageCenterExportRow;
 import org.jeecg.modules.billet.storageBill.vo.StorageCenterInvoicingVO;
 import org.jeecg.modules.billet.storageBill.vo.StorageCenterInvoicingVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -204,6 +211,31 @@ public class RollClubOneController {
 	}
 	}
 
 
 
 
+	@ApiOperation(value = "导出储运中心车次信息", notes = "导出储运中心车次信息")
+	@PostMapping("/exportOneXls")
+	public void exportOneXls(HttpServletResponse response, RollClubOneQueryDTO queryDTO) throws IOException {
+
+		List<RollClubOneVO> rollClubOneVOS = rollClubOneService.rollClubOneList(queryDTO);
+
+		// 数据处理
+		List<StorageCenterExportRow> exportList = rollClubOneService.buildExportData(rollClubOneVOS);
+
+		// 按出厂日期倒序排序
+		exportList.sort(Comparator.comparing(StorageCenterExportRow::getFactoryDate, Comparator.nullsLast(Comparator.reverseOrder())));
+
+		// 设置响应
+		response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+		response.setCharacterEncoding("utf-8");
+		String fileName = URLEncoder.encode("棒一工作台装运打印信息", String.valueOf(StandardCharsets.UTF_8)).replaceAll("\\+", "%20");
+		response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
+
+		// 导出
+		EasyExcel.write(response.getOutputStream(), StorageCenterExportRow.class)
+				.sheet("装运打印信息")
+				.doWrite(exportList);
+	}
+
+
 
 
 
 
 }
 }

+ 3 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/service/IRollClubOneService.java

@@ -5,6 +5,7 @@ import org.jeecg.modules.billet.rollClubOne.dto.RollClubOneQueryDTO;
 import org.jeecg.modules.billet.rollClubOne.entity.RollClubOne;
 import org.jeecg.modules.billet.rollClubOne.entity.RollClubOne;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
+import org.jeecg.modules.billet.storageBill.vo.StorageCenterExportRow;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -21,4 +22,6 @@ public interface IRollClubOneService extends IService<RollClubOne> {
     DestinationStatistics queryOnDutyByCcmNo(String ccmNo, String changeShiftId);
     DestinationStatistics queryOnDutyByCcmNo(String ccmNo, String changeShiftId);
 
 
     List<RollClubOneVO> rollClubOneList(RollClubOneQueryDTO queryDTO);
     List<RollClubOneVO> rollClubOneList(RollClubOneQueryDTO queryDTO);
+
+    List<StorageCenterExportRow> buildExportData(List<RollClubOneVO> records);
 }
 }

+ 69 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/service/impl/RollClubOneServiceImpl.java

@@ -10,6 +10,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
+import org.jeecg.common.util.SpringContextUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
@@ -30,13 +31,17 @@ import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneHeatVO;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollClubOne.vo.RollClubOneVO;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatisticsDetails;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatisticsDetails;
+import org.jeecg.modules.billet.storageBill.vo.StorageCenterExportRow;
+import org.jeecg.modules.carUnit.entity.SysDict;
 import org.jeecg.modules.carUnit.service.ISysDictService;
 import org.jeecg.modules.carUnit.service.ISysDictService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
@@ -402,6 +407,70 @@ public class RollClubOneServiceImpl extends ServiceImpl<RollClubOneMapper, RollC
         return resultList;
         return resultList;
     }
     }
 
 
+
+    @Override
+    public List<StorageCenterExportRow> buildExportData(List<RollClubOneVO> records) {
+        List<StorageCenterExportRow> rows = new ArrayList<>();
+
+        for (RollClubOneVO vo : records) {
+            Integer ccmNo = Optional.ofNullable(vo.getHeatNoDetails())
+                    .flatMap(list -> list.stream().findFirst())
+                    .map(RollClubOneVO.HeatNoDetail::getCcmNo)
+                    .orElse(null);
+
+            RollClubOneHeatVO invoicing = vo.getStorageCenterHeatNoInvoicing();
+            if (invoicing == null) continue;
+
+            // 棒一 rollClubOneDetails
+            if (invoicing.getRollClubOneDetails() != null && invoicing.getRollClubOneDetails() != null) {
+                for (RollClubOneHeatVO.RollSendDetail detail : invoicing.getRollClubOneDetails().getRollSendDetails()) {
+                    StorageCenterExportRow row = ontherConvert(detail, ccmNo, "棒一");
+                    row.setBrand(vo.getStorageCenterHeatNoInvoicing().getRollClubOneDetails().getBrandNum());
+
+                    String heatNo = Optional.ofNullable(vo.getHeatNoDetails())
+                            .filter(list -> !list.isEmpty())
+                            .map(list -> list.get(0).getHeatNo())
+                            .orElse("");
+
+                    row.setHeatNo(heatNo);
+                    rows.add(row);
+                }
+            }
+        }
+
+        return rows;
+    }
+
+
+    private static StorageCenterExportRow ontherConvert(RollClubOneHeatVO.RollSendDetail detail, Integer ccmNo, String endpoint) {
+        StorageCenterExportRow row = new StorageCenterExportRow();
+
+        row.setEndPoint(endpoint);
+        row.setLicensePlate("辊道");
+        row.setAmount(detail.getAmount());
+        row.setTotalWeight(detail.getWeight());
+        row.setCcmNo(ccmNo);
+        row.setWeightPerPiece(calcWeightPerPiece(detail.getWeight(), detail.getAmount()));
+        BigDecimal result = BigDecimal.valueOf(detail.getSize()).divide(BigDecimal.valueOf(1000));
+        if (result != null) {
+            row.setSize("170*170*" + result.toPlainString());
+        }
+        row.setSpec(detail.getSpec());
+        if (detail != null && detail.getCreateTime() != null) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            row.setFactoryDate(sdf.format(detail.getCreateTime()));
+        } else {
+            row.setFactoryDate("");
+        }
+
+        return row;
+    }
+
+    private static BigDecimal calcWeightPerPiece(BigDecimal total, Integer amount) {
+        if (total == null || amount == null || amount == 0) return BigDecimal.ZERO;
+        return total.divide(BigDecimal.valueOf(amount), 4, RoundingMode.HALF_UP);
+    }
+
     /**
     /**
      * 从Redis中获取班组班别
      * 从Redis中获取班组班别
      *
      *

+ 65 - 15
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/controller/RollClubThreeDetailsController.java

@@ -21,6 +21,9 @@ import org.jeecg.common.util.SpringContextUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+import org.jeecg.modules.billet.billetOriginalProductRecord.entity.BilletOriginalProductRecord;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
@@ -48,6 +51,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
+import java.time.ZoneId;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -69,6 +73,8 @@ public class RollClubThreeDetailsController extends JeecgController<RollClubThre
     private ISysDictService sysDictService;
     private ISysDictService sysDictService;
     @Autowired
     @Autowired
     private BilletRulerConfigMapper billetRulerConfigMapper;
     private BilletRulerConfigMapper billetRulerConfigMapper;
+    @Autowired
+    private IBilletHotsendChangeShiftService billetHotsendChangeShiftService;
 
 
     /**
     /**
      * 分页列表查询
      * 分页列表查询
@@ -240,22 +246,66 @@ public class RollClubThreeDetailsController extends JeecgController<RollClubThre
             if (oConvertUtils.isNotEmpty(storageBillPrint.getLicensePlate())) {
             if (oConvertUtils.isNotEmpty(storageBillPrint.getLicensePlate())) {
                 queryWrapper.eq("license_plate", storageBillPrint.getLicensePlate());
                 queryWrapper.eq("license_plate", storageBillPrint.getLicensePlate());
             }
             }
-            if (oConvertUtils.isNotEmpty(storageBillPrint.getDestination())) {
-                queryWrapper.eq("destination", storageBillPrint.getDestination());
+
+            queryWrapper.eq("destination", "棒三");
+
+            Date finalStartTime = null;
+            Date finalEndTime = null;
+
+            boolean hasQueryDate = storageBillPrint.getQueryDate() != null;
+            boolean hasChangeShiftId = oConvertUtils.isNotEmpty(storageBillPrint.getChangeShiftId());
+            boolean hasRange = storageBillPrint.getStartTime() != null || storageBillPrint.getEndTime() != null;
+
+            // 校验:只能传一个
+            int count = (hasQueryDate ? 1 : 0) + (hasChangeShiftId ? 1 : 0) + (hasRange ? 1 : 0);
+            if (count > 1) {
+                log.warn("参数冲突:queryDate、changeShiftId、startTime/endTime 只能传一个");
+            }
+
+            // 处理 queryDate:某一天
+            if (hasQueryDate) {
+                Date queryDate = storageBillPrint.getQueryDate();
+                // 当天 0 点
+                finalStartTime = Date.from(queryDate.toInstant().atZone(ZoneId.systemDefault())
+                        .toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
+                // 第二天 0 点减 1 毫秒 = 当天 23:59:59.999
+                finalEndTime = Date.from(queryDate.toInstant().atZone(ZoneId.systemDefault())
+                        .toLocalDate().plusDays(1).atStartOfDay(ZoneId.systemDefault()).minusNanos(1).toInstant());
+                // 处理交班记录
+            } else if (hasChangeShiftId) {
+                LambdaQueryWrapper<BilletHotsendChangeShift> shiftWrapper = new LambdaQueryWrapper<>();
+                shiftWrapper.eq(BilletHotsendChangeShift::getId, storageBillPrint.getChangeShiftId());
+                BilletHotsendChangeShift shift = billetHotsendChangeShiftService.getOne(shiftWrapper);
+                if (shift != null) {
+                    finalStartTime = shift.getCreateTime();
+                    finalEndTime = shift.getChangeShiftTime() != null ? shift.getChangeShiftTime() : new Date();
+                    if (StringUtils.isNotBlank(shift.getShift()) && StringUtils.isNotBlank(shift.getShiftGroup())) {
+                        String combinedClass = shift.getShift() + "/" + shift.getShiftGroup();
+                        queryWrapper.eq("classes", combinedClass);
+                    }
+
+                }
+
+                // 处理时间范围
+            } else if (hasRange) {
+                finalStartTime = storageBillPrint.getStartTime();
+                finalEndTime = storageBillPrint.getEndTime();
+            }
+
+            // 校验时间区间是否合法
+            if (finalStartTime != null && finalEndTime != null && finalStartTime.after(finalEndTime)) {
+                log.warn("无效时间区间:start={}, end={}", finalStartTime, finalEndTime);
+            }
+
+            // 应用到 wrapper 上
+            if (finalStartTime != null) {
+                queryWrapper.ge("arrival_time", finalStartTime);
+            }
+            if (finalEndTime != null) {
+                queryWrapper.le("arrival_time", finalEndTime);
             }
             }
-            // 开始时间
-            Date startTime = storageBillPrint.getArrivalTime();
-            // 结束时间
-            Date endTime = storageBillPrint.getCreateTime();
-
-            log.info("查询时间范围:startTime={}, endTime={}", startTime, endTime);
-
-            // 修改时间范围查询条件为 >= startTime 且 <= endTime
-            queryWrapper.ge("arrival_time", startTime)  // 大于等于开始时间
-                    .le("arrival_time", endTime);   // 小于等于结束时间
-            // Step.2 获取导出数据
-            // 打印完整的查询条件
-            log.info("最终查询条件:{}", queryWrapper.getSqlSegment());
+            //
+            queryWrapper.orderByDesc("arrival_time");
             List<StorageBillPrint> exportList = storageBillPrintService.list(queryWrapper);
             List<StorageBillPrint> exportList = storageBillPrintService.list(queryWrapper);
 
 
             // 用于存储拆分后的新数据
             // 用于存储拆分后的新数据

+ 63 - 15
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/controller/RollOutShippDetailsController.java

@@ -21,6 +21,8 @@ import org.jeecg.common.util.SpringContextUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletRulerConfig;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
 import org.jeecg.modules.actualControl.billetActual.billetActual.mapper.BilletRulerConfigMapper;
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
@@ -46,6 +48,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
+import java.time.ZoneId;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -67,6 +70,8 @@ public class RollOutShippDetailsController extends JeecgController<RollOutShippD
 	private ISysDictService sysDictService;
 	private ISysDictService sysDictService;
 	@Autowired
 	@Autowired
 	private BilletRulerConfigMapper billetRulerConfigMapper;
 	private BilletRulerConfigMapper billetRulerConfigMapper;
+	@Autowired
+	private IBilletHotsendChangeShiftService billetHotsendChangeShiftService;
 	
 	
 	/**
 	/**
 	 * 分页列表查询
 	 * 分页列表查询
@@ -236,22 +241,65 @@ public class RollOutShippDetailsController extends JeecgController<RollOutShippD
 			if (oConvertUtils.isNotEmpty(storageBillPrint.getLicensePlate())) {
 			if (oConvertUtils.isNotEmpty(storageBillPrint.getLicensePlate())) {
 				queryWrapper.eq("license_plate", storageBillPrint.getLicensePlate());
 				queryWrapper.eq("license_plate", storageBillPrint.getLicensePlate());
 			}
 			}
-			if (oConvertUtils.isNotEmpty(storageBillPrint.getDestination())) {
-				queryWrapper.eq("destination", storageBillPrint.getDestination());
+
+			queryWrapper.eq("destination", "上若");
+
+			Date finalStartTime = null;
+			Date finalEndTime = null;
+
+			boolean hasQueryDate = storageBillPrint.getQueryDate() != null;
+			boolean hasChangeShiftId = oConvertUtils.isNotEmpty(storageBillPrint.getChangeShiftId());
+			boolean hasRange = storageBillPrint.getStartTime() != null || storageBillPrint.getEndTime() != null;
+
+			// 校验:只能传一个
+			int count = (hasQueryDate ? 1 : 0) + (hasChangeShiftId ? 1 : 0) + (hasRange ? 1 : 0);
+			if (count > 1) {
+				log.warn("参数冲突:queryDate、changeShiftId、startTime/endTime 只能传一个");
+			}
+
+			// 处理 queryDate:某一天
+			if (hasQueryDate) {
+				Date queryDate = storageBillPrint.getQueryDate();
+				// 当天 0 点
+				finalStartTime = Date.from(queryDate.toInstant().atZone(ZoneId.systemDefault())
+						.toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
+				// 第二天 0 点减 1 毫秒 = 当天 23:59:59.999
+				finalEndTime = Date.from(queryDate.toInstant().atZone(ZoneId.systemDefault())
+						.toLocalDate().plusDays(1).atStartOfDay(ZoneId.systemDefault()).minusNanos(1).toInstant());
+				// 处理交班记录
+			} else if (hasChangeShiftId) {
+				LambdaQueryWrapper<BilletHotsendChangeShift> shiftWrapper = new LambdaQueryWrapper<>();
+				shiftWrapper.eq(BilletHotsendChangeShift::getId, storageBillPrint.getChangeShiftId());
+				BilletHotsendChangeShift shift = billetHotsendChangeShiftService.getOne(shiftWrapper);
+				if (shift != null) {
+					finalStartTime = shift.getCreateTime();
+					finalEndTime = shift.getChangeShiftTime() != null ? shift.getChangeShiftTime() : new Date();
+					if (StringUtils.isNotBlank(shift.getShift()) && StringUtils.isNotBlank(shift.getShiftGroup())) {
+						String combinedClass = shift.getShift() + "/" + shift.getShiftGroup();
+						queryWrapper.eq("classes", combinedClass);
+					}
+
+				}
+				// 处理时间范围
+			} else if (hasRange) {
+				finalStartTime = storageBillPrint.getStartTime();
+				finalEndTime = storageBillPrint.getEndTime();
+			}
+
+			// 校验时间区间是否合法
+			if (finalStartTime != null && finalEndTime != null && finalStartTime.after(finalEndTime)) {
+				log.warn("无效时间区间:start={}, end={}", finalStartTime, finalEndTime);
+			}
+
+			// 应用到 wrapper 上
+			if (finalStartTime != null) {
+				queryWrapper.ge("arrival_time", finalStartTime);
+			}
+			if (finalEndTime != null) {
+				queryWrapper.le("arrival_time", finalEndTime);
 			}
 			}
-			// 开始时间
-			Date startTime = storageBillPrint.getArrivalTime();
-			// 结束时间
-			Date endTime = storageBillPrint.getCreateTime();
-
-			log.info("查询时间范围:startTime={}, endTime={}", startTime, endTime);
-
-			// 修改时间范围查询条件为 >= startTime 且 <= endTime
-			queryWrapper.ge("arrival_time", startTime)  // 大于等于开始时间
-					.le("arrival_time", endTime);   // 小于等于结束时间
-			// Step.2 获取导出数据
-			// 打印完整的查询条件
-			log.info("最终查询条件:{}", queryWrapper.getSqlSegment());
+
+			queryWrapper.orderByDesc("arrival_time");
 			List<StorageBillPrint> exportList = storageBillPrintService.list(queryWrapper);
 			List<StorageBillPrint> exportList = storageBillPrintService.list(queryWrapper);
 
 
 			// 用于存储拆分后的新数据
 			// 用于存储拆分后的新数据

+ 26 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/StorageBillPrint.java

@@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecgframework.poi.excel.annotation.ExcelIgnore;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -173,4 +174,29 @@ public class StorageBillPrint implements Serializable {
     @Excel(name = "备注", width = 15)
     @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     @ApiModelProperty(value = "备注")
     private String remark;
     private String remark;
+
+    /**
+     * 时间(某一天)
+     */
+    @ExcelIgnore
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date queryDate;
+
+    /**
+     * 交班记录id
+     */
+    @ExcelIgnore
+    @TableField(exist = false)
+    private String changeShiftId;
+
+    @ExcelIgnore
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    @ExcelIgnore
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
 }
 }