|
@@ -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();
|
|
|
}
|