|
@@ -672,14 +672,14 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
// Date startDate = df1.parse(date1.toString());
|
|
// Date startDate = df1.parse(date1.toString());
|
|
Date endDate2 = calendar.getTime();
|
|
Date endDate2 = calendar.getTime();
|
|
// Date endDate = df1.parse(date2.toString());
|
|
// Date endDate = df1.parse(date2.toString());
|
|
- SimpleDateFormat dateSdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
- SimpleDateFormat dateSdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
+// SimpleDateFormat dateSdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+// SimpleDateFormat dateSdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat dateSdf2 = new SimpleDateFormat("yyyy年MM月dd+HH时mm分ss秒");
|
|
SimpleDateFormat dateSdf2 = new SimpleDateFormat("yyyy年MM月dd+HH时mm分ss秒");
|
|
- String startDate = dateSdf.format(startDate1);
|
|
|
|
- String endDate = dateSdf.format(endDate2);
|
|
|
|
|
|
+// String startDate = dateSdf.format(startDate1);
|
|
|
|
+// String endDate = dateSdf.format(endDate2);
|
|
List<MouldOperationDynamics> mouldOperationDynamics = new ArrayList<>();
|
|
List<MouldOperationDynamics> mouldOperationDynamics = new ArrayList<>();
|
|
if (userVO.getStartTime() != null && userVO.getEndTime() != null) {
|
|
if (userVO.getStartTime() != null && userVO.getEndTime() != null) {
|
|
- mouldOperationDynamics = mouldOperationDynamicsMapper.selectOperationDynamicsList(startDate, endDate, userVO);
|
|
|
|
|
|
+ mouldOperationDynamics = mouldOperationDynamicsMapper.selectOperationDynamicsList(userVO);
|
|
}
|
|
}
|
|
for (MouldOperationDynamics dynamic : mouldOperationDynamics) {
|
|
for (MouldOperationDynamics dynamic : mouldOperationDynamics) {
|
|
List<String> rowList = new ArrayList<String>();
|
|
List<String> rowList = new ArrayList<String>();
|
|
@@ -702,13 +702,13 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
rowList.add("模具报废");
|
|
rowList.add("模具报废");
|
|
}
|
|
}
|
|
//下载时间
|
|
//下载时间
|
|
-
|
|
|
|
rowList.add(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(dynamic.getIndate())
|
|
rowList.add(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(dynamic.getIndate())
|
|
);
|
|
);
|
|
list.add(rowList);
|
|
list.add(rowList);
|
|
}
|
|
}
|
|
Mould mould = mouldMapper.selectById(userVO.getMouldId());
|
|
Mould mould = mouldMapper.selectById(userVO.getMouldId());
|
|
- msg.data = ExcelUtil.exportGeneralExcelByTitleAndList(response, mould.getModelNo() + mould.getModelName() + dateSdf2.format(new Date()), list, downloadPath);
|
|
|
|
|
|
+ String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, mould.getModelNo() + mould.getModelName() + dateSdf2.format(new Date()), list, downloadPath);
|
|
|
|
+ msg.data = fileUrl;
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -734,15 +734,14 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
- public void download(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath){
|
|
|
|
|
|
+ public String download(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath){
|
|
//响应头的设置
|
|
//响应头的设置
|
|
- response.reset();
|
|
|
|
|
|
+// response.reset();
|
|
response.setCharacterEncoding("utf-8");
|
|
response.setCharacterEncoding("utf-8");
|
|
response.setContentType("multipart/form-data");
|
|
response.setContentType("multipart/form-data");
|
|
-
|
|
|
|
//设置压缩包的名字
|
|
//设置压缩包的名字
|
|
//解决不同浏览器压缩包名字含有中文时乱码的问题
|
|
//解决不同浏览器压缩包名字含有中文时乱码的问题
|
|
- String downloadName = vo.getModelNo() + vo.getModelName()+".zip";
|
|
|
|
|
|
+ String downloadName = vo.getModelNo() +".zip";
|
|
String agent = request.getHeader("USER-AGENT");
|
|
String agent = request.getHeader("USER-AGENT");
|
|
try {
|
|
try {
|
|
if (agent.contains("MSIE")||agent.contains("Trident")) {
|
|
if (agent.contains("MSIE")||agent.contains("Trident")) {
|
|
@@ -754,7 +753,6 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
response.setHeader("Content-Disposition", "attachment;fileName=\"" + downloadName + "\"");
|
|
response.setHeader("Content-Disposition", "attachment;fileName=\"" + downloadName + "\"");
|
|
-
|
|
|
|
//设置压缩流:直接写入response,实现边压缩边下载
|
|
//设置压缩流:直接写入response,实现边压缩边下载
|
|
ZipOutputStream zipos = null;
|
|
ZipOutputStream zipos = null;
|
|
try {
|
|
try {
|
|
@@ -795,7 +793,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath) throws IOException {
|
|
public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath) throws IOException {
|