Redeem vor 1 Jahr
Ursprung
Commit
0fbae6ba9d

+ 1 - 1
pom.xml

@@ -6,7 +6,7 @@
 
     <groupId>org.example</groupId>
     <artifactId>dil-wms-api</artifactId>
-    <version>1.11</version>
+    <version>1.12</version>
 
     <parent>
         <groupId>org.springframework.boot</groupId>

+ 12 - 0
src/main/java/com/steerinfo/dil/model/ReceiveSendReport.java

@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 public class ReceiveSendReport {
@@ -60,6 +61,17 @@ public class ReceiveSendReport {
     @ExcelProperty(value = "库存重量", index = 16)
     private BigDecimal materialWeight;
 
+    @ExcelProperty(value = "日期",index = 17)
+    private String excelDate;
+
+    public String getExcelDate() {
+        return excelDate;
+    }
+
+    public void setExcelDate(String excelDate) {
+        this.excelDate = excelDate;
+    }
+
     public String getCompanyName() {
         return companyName;
     }

+ 4 - 6
src/main/java/com/steerinfo/dil/service/impl/OyeResultServiceImpl.java

@@ -550,12 +550,8 @@ public class OyeResultServiceImpl implements IOyeResultService {
     public void reportToExcel() {
         try {
             Calendar calendar = Calendar.getInstance();
-            int year = calendar.get(Calendar.YEAR);
-            int month = calendar.get(Calendar.MONTH) + 1;
-            int day = calendar.get(Calendar.DAY_OF_MONTH);
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd");
             String dateStr = simpleDateFormat.format(calendar.getTime());
-            //实现写操作
             //1.设置写入文件夹地址和excel文件名称
             String filename = "/shared/" + dateStr + ".xlsx";
             //2.调用easyexcel里的方法实现写操作
@@ -566,7 +562,9 @@ public class OyeResultServiceImpl implements IOyeResultService {
             SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             DataChange.queryDataByDateTime(null,null,map,sdfDateTime);
             List<Map<String,Object>> mapList = oyeRealtimeInventoryMapper.receiveSendReport(map);
+            String excelDate = sdfDateTime.format(new Date());
             for(Map<String,Object> mapVal : mapList) {
+                mapVal.put("excelDate",excelDate);
                 JSONObject jsonObject = new JSONObject(mapVal);
                 String mapValToString = jsonObject.toString();
                 ReceiveSendReport receiveSendReport = JSON.parseObject(mapValToString,ReceiveSendReport.class);
@@ -578,7 +576,7 @@ public class OyeResultServiceImpl implements IOyeResultService {
         }
     }
 
-    @Scheduled(cron = "0 40 10 * * ?")
+    @Scheduled(cron = "59 59 23 * * ?")
     public synchronized void dsExportExcel() {
         reportToExcel();
     }