Commit 48b3c00342cb926d95298853edae3e00d1ff38e1

Authored by 房远帅
1 parent 9576c887

报表:导出格式修改

@@ -39,7 +39,7 @@ public class OrderDetailStatisticsModel implements ExcelModel { @@ -39,7 +39,7 @@ public class OrderDetailStatisticsModel implements ExcelModel {
39 * 订货日期 39 * 订货日期
40 */ 40 */
41 @ExcelProperty("订货日期") 41 @ExcelProperty("订货日期")
42 - @DateTimeFormat("yyyy-MM-dd") 42 + @DateTimeFormat("yyyy/MM/dd")
43 private Date orderDate1; 43 private Date orderDate1;
44 44
45 /** 45 /**
@@ -64,7 +64,7 @@ public class OrderDetailStatisticsModel implements ExcelModel { @@ -64,7 +64,7 @@ public class OrderDetailStatisticsModel implements ExcelModel {
64 * 订货日期 64 * 订货日期
65 */ 65 */
66 @ExcelProperty("订货日期") 66 @ExcelProperty("订货日期")
67 - @DateTimeFormat("yyyy-MM-dd") 67 + @DateTimeFormat("yyyy/MM/dd")
68 private Date orderDate; 68 private Date orderDate;
69 69
70 /** 70 /**
@@ -167,7 +167,7 @@ public class OrderDetailStatisticsModel implements ExcelModel { @@ -167,7 +167,7 @@ public class OrderDetailStatisticsModel implements ExcelModel {
167 * 发货日期 167 * 发货日期
168 */ 168 */
169 @ExcelProperty("发货日期") 169 @ExcelProperty("发货日期")
170 - @DateTimeFormat("yyyy-MM-dd") 170 + @DateTimeFormat("yyyy/MM/dd")
171 private Date deliveryDate; 171 private Date deliveryDate;
172 172
173 /** 173 /**
@@ -12,6 +12,9 @@ import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService; @@ -12,6 +12,9 @@ import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService;
12 import com.lframework.xingyun.sc.utils.CommonUtil; 12 import com.lframework.xingyun.sc.utils.CommonUtil;
13 import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo; 13 import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo;
14 14
  15 +import java.time.LocalDate;
  16 +import java.time.ZoneId;
  17 +import java.util.Date;
15 import java.util.List; 18 import java.util.List;
16 import java.util.stream.Collectors; 19 import java.util.stream.Collectors;
17 20
@@ -49,10 +52,35 @@ public class QualityOrderDetailReportExportTaskWorker implements @@ -49,10 +52,35 @@ public class QualityOrderDetailReportExportTaskWorker implements
49 data.getLengthTolPos() != null ? data.getLengthTolPos().doubleValue() : null, 52 data.getLengthTolPos() != null ? data.getLengthTolPos().doubleValue() : null,
50 data.getLengthTolNeg() != null ? data.getLengthTolNeg().doubleValue() : null); 53 data.getLengthTolNeg() != null ? data.getLengthTolNeg().doubleValue() : null);
51 54
52 - QualityOrderDetailStatisticsModel model = JsonUtil.parseObject(JsonUtil.toJsonString(data), QualityOrderDetailStatisticsModel.class); 55 + QualityOrderDetailStatisticsModel model = new QualityOrderDetailStatisticsModel();
  56 + model.setOrderNo(data.getOrderNo());
  57 + model.setWorkshopName(data.getWorkshopName());
  58 + model.setDeptName(data.getDeptName());
  59 + model.setRegionName(data.getRegionName());
  60 + model.setOrderingUnitName(data.getOrderingUnitName());
  61 + model.setIndustry(data.getIndustry());
  62 + model.setBrand(data.getBrand());
  63 + model.setThickness(data.getThickness());
  64 + model.setWidth(data.getWidth());
  65 + model.setLength(data.getLength());
  66 + model.setStatus(data.getStatus());
  67 + model.setQuantity(data.getQuantity());
  68 + model.setProductionProcess(data.getProductionProcess());
  69 + model.setPieceWeightHeader(data.getPieceWeightHeader());
  70 + model.setSurface(data.getSurface());
  71 + model.setTolerance(data.getTolerance());
  72 + model.setPerformance(data.getPerformance());
  73 + model.setPackaging(data.getPackaging());
  74 + model.setSpecialRequirements(data.getSpecialRequirements());
  75 + model.setRemarks(data.getRemarks());
  76 + model.setCustomerType(data.getCustomerType());
  77 + model.setContractType(data.getContractType());
  78 + model.setStockUpCompanyName(data.getStockUpCompanyName());
53 model.setThicknessTol(thicknessTol); 79 model.setThicknessTol(thicknessTol);
54 model.setWidthTol(widthTol); 80 model.setWidthTol(widthTol);
55 model.setLengthTol(lengthTol); 81 model.setLengthTol(lengthTol);
  82 + model.setOrderDate(toDate(data.getOrderDate()));
  83 + model.setDeliveryDate(toDate(data.getDeliveryDate()));
56 return model; 84 return model;
57 } 85 }
58 86
@@ -60,4 +88,11 @@ public class QualityOrderDetailReportExportTaskWorker implements @@ -60,4 +88,11 @@ public class QualityOrderDetailReportExportTaskWorker implements
60 public Class<QualityOrderDetailStatisticsModel> getModelClass() { 88 public Class<QualityOrderDetailStatisticsModel> getModelClass() {
61 return QualityOrderDetailStatisticsModel.class; 89 return QualityOrderDetailStatisticsModel.class;
62 } 90 }
  91 +
  92 + private static Date toDate(LocalDate date) {
  93 + if (date == null) {
  94 + return null;
  95 + }
  96 + return Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant());
  97 + }
63 } 98 }
1 package com.lframework.xingyun.sc.excel.statistics; 1 package com.lframework.xingyun.sc.excel.statistics;
2 2
3 import com.alibaba.excel.annotation.ExcelProperty; 3 import com.alibaba.excel.annotation.ExcelProperty;
  4 +import com.alibaba.excel.annotation.format.DateTimeFormat;
4 import com.lframework.starter.web.core.components.excel.ExcelModel; 5 import com.lframework.starter.web.core.components.excel.ExcelModel;
5 import lombok.Data; 6 import lombok.Data;
6 7
7 import java.math.BigDecimal; 8 import java.math.BigDecimal;
  9 +import java.util.Date;
8 10
9 /** 11 /**
10 * <p> 12 * <p>
@@ -25,7 +27,8 @@ public class QualityOrderDetailStatisticsModel implements ExcelModel { @@ -25,7 +27,8 @@ public class QualityOrderDetailStatisticsModel implements ExcelModel {
25 * 订货日期 27 * 订货日期
26 */ 28 */
27 @ExcelProperty("订货日期") 29 @ExcelProperty("订货日期")
28 - private String orderDate; 30 + @DateTimeFormat("yyyy/MM/dd")
  31 + private Date orderDate;
29 32
30 /** 33 /**
31 * 生产厂 34 * 生产厂
@@ -121,7 +124,8 @@ public class QualityOrderDetailStatisticsModel implements ExcelModel { @@ -121,7 +124,8 @@ public class QualityOrderDetailStatisticsModel implements ExcelModel {
121 * 发货日期 124 * 发货日期
122 */ 125 */
123 @ExcelProperty("发货日期") 126 @ExcelProperty("发货日期")
124 - private String deliveryDate; 127 + @DateTimeFormat("yyyy/MM/dd")
  128 + private Date deliveryDate;
125 129
126 /** 130 /**
127 * 工艺要求 131 * 工艺要求
@@ -24,7 +24,7 @@ public class StockInOrderDetailReportModel implements ExcelModel { @@ -24,7 +24,7 @@ public class StockInOrderDetailReportModel implements ExcelModel {
24 private String customerShortName; 24 private String customerShortName;
25 25
26 @ExcelProperty(value = "订货日期", index = 3) 26 @ExcelProperty(value = "订货日期", index = 3)
27 - @DateTimeFormat("yyyy-MM-dd") 27 + @DateTimeFormat("yyyy/MM/dd")
28 private Date orderDate; 28 private Date orderDate;
29 29
30 @ExcelProperty(value = "生产厂", index = 4) 30 @ExcelProperty(value = "生产厂", index = 4)
@@ -76,7 +76,7 @@ public class StockInOrderDetailReportModel implements ExcelModel { @@ -76,7 +76,7 @@ public class StockInOrderDetailReportModel implements ExcelModel {
76 private BigDecimal suggestedPrice; 76 private BigDecimal suggestedPrice;
77 77
78 @ExcelProperty(value = "交货日期", index = 20) 78 @ExcelProperty(value = "交货日期", index = 20)
79 - @DateTimeFormat("yyyy-MM-dd") 79 + @DateTimeFormat("yyyy/MM/dd")
80 private Date deliveryDate; 80 private Date deliveryDate;
81 81
82 @ExcelProperty(value = "超价协调价", index = 21) 82 @ExcelProperty(value = "超价协调价", index = 21)
@@ -15,7 +15,7 @@ import java.util.Date; @@ -15,7 +15,7 @@ import java.util.Date;
15 public class StockInboundOrderDetailReportModel implements ExcelModel { 15 public class StockInboundOrderDetailReportModel implements ExcelModel {
16 16
17 @ExcelProperty(value = "日期", index = 0) 17 @ExcelProperty(value = "日期", index = 0)
18 - @DateTimeFormat("yyyy-MM-dd") 18 + @DateTimeFormat("yyyy/MM/dd")
19 private Date date; 19 private Date date;
20 20
21 @ExcelProperty(value = "订单编号", index = 1) 21 @ExcelProperty(value = "订单编号", index = 1)
@@ -28,7 +28,7 @@ public class StockInboundOrderDetailReportModel implements ExcelModel { @@ -28,7 +28,7 @@ public class StockInboundOrderDetailReportModel implements ExcelModel {
28 private String customerShortName; 28 private String customerShortName;
29 29
30 @ExcelProperty(value = "订货日期", index = 4) 30 @ExcelProperty(value = "订货日期", index = 4)
31 - @DateTimeFormat("yyyy-MM-dd") 31 + @DateTimeFormat("yyyy/MM/dd")
32 private Date orderDate; 32 private Date orderDate;
33 33
34 @ExcelProperty(value = "生产厂", index = 5) 34 @ExcelProperty(value = "生产厂", index = 5)
@@ -80,7 +80,7 @@ public class StockInboundOrderDetailReportModel implements ExcelModel { @@ -80,7 +80,7 @@ public class StockInboundOrderDetailReportModel implements ExcelModel {
80 private BigDecimal suggestedPrice; 80 private BigDecimal suggestedPrice;
81 81
82 @ExcelProperty(value = "交货日期", index = 21) 82 @ExcelProperty(value = "交货日期", index = 21)
83 - @DateTimeFormat("yyyy-MM-dd") 83 + @DateTimeFormat("yyyy/MM/dd")
84 private Date deliveryDate; 84 private Date deliveryDate;
85 85
86 @ExcelProperty(value = "超价协调价", index = 22) 86 @ExcelProperty(value = "超价协调价", index = 22)