高处作业迁移补充
parent
c8e4eb4972
commit
42ea8d5208
|
@ -9,6 +9,7 @@ import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -41,6 +42,9 @@ import com.zcloud.service.bus.RiskWarningService;
|
||||||
@RequestMapping("/riskwarning")
|
@RequestMapping("/riskwarning")
|
||||||
public class RiskWarningController extends BaseController {
|
public class RiskWarningController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RiskWarningService riskwarningService;
|
private RiskWarningService riskwarningService;
|
||||||
|
|
||||||
|
@ -197,7 +201,7 @@ public class RiskWarningController extends BaseController {
|
||||||
pd = riskwarningService.findById(pd);
|
pd = riskwarningService.findById(pd);
|
||||||
String FILEPATH = pd.get("FILEPATH").toString();
|
String FILEPATH = pd.get("FILEPATH").toString();
|
||||||
System.out.println(FILEPATH.length());
|
System.out.println(FILEPATH.length());
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?28:61, FILEPATH.length()));
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?28:61, FILEPATH.length()));
|
||||||
}
|
}
|
||||||
/**导出到excel
|
/**导出到excel
|
||||||
* @param
|
* @param
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -38,6 +39,9 @@ import com.zcloud.util.Tools;
|
||||||
@RequestMapping("/video")
|
@RequestMapping("/video")
|
||||||
public class VideoController extends BaseController {
|
public class VideoController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoService videoService;
|
private VideoService videoService;
|
||||||
|
|
||||||
|
@ -74,8 +78,8 @@ public class VideoController extends BaseController {
|
||||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||||
//Smb.1sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
//Smb.1sshSftp(file, fileName,Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||||
//pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
//pd.put("FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||||
Smb.sshSftp(file, fileName,Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
Smb.sshSftp(file, fileName,fileUrl + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||||
pd.put("FILEPATH", Const.HTTPFILEURL + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
pd.put("FILEPATH", fileUrl + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
videoService.save(pd);
|
videoService.save(pd);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.zcloud.service.emergency.EmergencyDrillAttachmentService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -27,6 +28,9 @@ import java.util.*;
|
||||||
@RequestMapping("/emergencydrillattachment")
|
@RequestMapping("/emergencydrillattachment")
|
||||||
public class EmergencyDrillAttachmentController extends BaseController {
|
public class EmergencyDrillAttachmentController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmergencyDrillAttachmentService emergencydrillattachmentService;
|
private EmergencyDrillAttachmentService emergencydrillattachmentService;
|
||||||
|
|
||||||
|
@ -256,7 +260,7 @@ public class EmergencyDrillAttachmentController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.zcloud.service.emergency.EmergencyDrillReportService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -27,6 +28,9 @@ import java.util.*;
|
||||||
@RequestMapping("/emergencydrillreport")
|
@RequestMapping("/emergencydrillreport")
|
||||||
public class EmergencyDrillReportController extends BaseController {
|
public class EmergencyDrillReportController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmergencyDrillReportService emergencydrillreportService;
|
private EmergencyDrillReportService emergencydrillreportService;
|
||||||
|
|
||||||
|
@ -258,7 +262,7 @@ public class EmergencyDrillReportController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.zcloud.service.emergency.EmergencyPlanService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -27,6 +28,9 @@ import java.util.*;
|
||||||
@RequestMapping("/emergencyplan")
|
@RequestMapping("/emergencyplan")
|
||||||
public class EmergencyPlanController extends BaseController {
|
public class EmergencyPlanController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmergencyPlanService emergencyplanService;
|
private EmergencyPlanService emergencyplanService;
|
||||||
|
|
||||||
|
@ -283,7 +287,7 @@ public class EmergencyPlanController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -43,6 +44,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@RequestMapping("/mfolder")
|
@RequestMapping("/mfolder")
|
||||||
public class MfolderController extends BaseController {
|
public class MfolderController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MfolderService mfolderService;
|
private MfolderService mfolderService;
|
||||||
|
|
||||||
|
@ -441,7 +445,7 @@ public class MfolderController extends BaseController {
|
||||||
pd = mfolderService.findById(pd);
|
pd = mfolderService.findById(pd);
|
||||||
String FILEPATH = pd.getString("FILEPATH");
|
String FILEPATH = pd.getString("FILEPATH");
|
||||||
// String fileName = pd.getString("NAME");
|
// String fileName = pd.getString("NAME");
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new NofileException("=========要下载的文件已经没有了=========");
|
throw new NofileException("=========要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -40,6 +41,9 @@ import net.sf.json.JSONArray;
|
||||||
@RequestMapping("/mfolderStipulate")
|
@RequestMapping("/mfolderStipulate")
|
||||||
public class MfolderStipulateController extends BaseController {
|
public class MfolderStipulateController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MfolderStipulateService mfolderService;
|
private MfolderStipulateService mfolderService;
|
||||||
|
|
||||||
|
@ -426,7 +430,7 @@ public class MfolderStipulateController extends BaseController {
|
||||||
pd = mfolderService.findById(pd);
|
pd = mfolderService.findById(pd);
|
||||||
String FILEPATH = pd.getString("FILEPATH");
|
String FILEPATH = pd.getString("FILEPATH");
|
||||||
// String fileName = pd.getString("NAME");
|
// String fileName = pd.getString("NAME");
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILEPATH.substring(FILEPATH.length()<85?27:60, FILEPATH.length()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new NofileStiException("=========要下载的文件已经没有了=========");
|
throw new NofileStiException("=========要下载的文件已经没有了=========");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.apache.shiro.session.Session;
|
import org.apache.shiro.session.Session;
|
||||||
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAAdapter;
|
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAAdapter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
@ -45,6 +46,9 @@ import java.util.stream.Collectors;
|
||||||
@RequestMapping("/safetyenvironmental")
|
@RequestMapping("/safetyenvironmental")
|
||||||
public class SafetyEnvironmentalController extends BaseController {
|
public class SafetyEnvironmentalController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SafetyEnvironmentalService safetyenvironmentalService;
|
private SafetyEnvironmentalService safetyenvironmentalService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -653,7 +657,7 @@ public class SafetyEnvironmentalController extends BaseController {
|
||||||
String FILEPATH = pd.getString("INSPECTED_EXPLAIN_FILEPATH");
|
String FILEPATH = pd.getString("INSPECTED_EXPLAIN_FILEPATH");
|
||||||
String FILENAME = pd.getString("INSPECTED_EXPLAIN_FILENAME");
|
String FILENAME = pd.getString("INSPECTED_EXPLAIN_FILENAME");
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
@ -674,7 +678,7 @@ public class SafetyEnvironmentalController extends BaseController {
|
||||||
String FILEPATH = pd.getString("INSPECTED_EXPLAIN_FILEPATH");
|
String FILEPATH = pd.getString("INSPECTED_EXPLAIN_FILEPATH");
|
||||||
String FILENAME = pd.getString("INSPECTED_EXPLAIN_FILENAME");
|
String FILENAME = pd.getString("INSPECTED_EXPLAIN_FILENAME");
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.zcloud.service.majordangersource.MajorDangerSourceLogService;
|
||||||
import com.zcloud.service.majordangersource.MonitoringDeviceDisableService;
|
import com.zcloud.service.majordangersource.MonitoringDeviceDisableService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -35,6 +36,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
@RequestMapping("/majordangersource")
|
@RequestMapping("/majordangersource")
|
||||||
public class MajorDangerSourceController extends BaseController {
|
public class MajorDangerSourceController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MajorDangerSourceService majordangersourceService;
|
private MajorDangerSourceService majordangersourceService;
|
||||||
|
|
||||||
|
@ -352,7 +356,7 @@ public class MajorDangerSourceController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.zcloud.service.majordangersource.MajorDangerSourceLogService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
@ -25,6 +26,9 @@ import java.util.*;
|
||||||
@RequestMapping("/majordangersourcelog")
|
@RequestMapping("/majordangersourcelog")
|
||||||
public class MajorDangerSourceLogController extends BaseController {
|
public class MajorDangerSourceLogController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MajorDangerSourceLogService majorDangerSourceLogService;
|
private MajorDangerSourceLogService majorDangerSourceLogService;
|
||||||
|
|
||||||
|
@ -267,7 +271,7 @@ public class MajorDangerSourceLogController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.zcloud.service.tzsb.SpecialEquipmentService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -31,6 +32,9 @@ import java.util.*;
|
||||||
@RequestMapping("/specialequipment")
|
@RequestMapping("/specialequipment")
|
||||||
public class SpecialEquipmentController extends BaseController {
|
public class SpecialEquipmentController extends BaseController {
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SpecialEquipmentService specialequipmentService;
|
private SpecialEquipmentService specialequipmentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -488,7 +492,7 @@ public class SpecialEquipmentController extends BaseController {
|
||||||
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
// FileDownload.fileDownload(response, PathUtil.getProjectpath() + FILEPATH, FILENAME);
|
||||||
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
//// FileDownload.mfFileDownload(response, this.getRequest().getScheme() + "://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort() + FILEPATH, FILENAME); //不好用
|
||||||
//服务器
|
//服务器
|
||||||
FileDownload.mfFileDownload(response, Const.HTTPFILEURL + FILEPATH, FILENAME);
|
FileDownload.mfFileDownload(response, fileUrl + FILEPATH, FILENAME);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
throw new Exception("=========文件下载异常:可能要下载的文件已经没有了=========");
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.shiro.session.Session;
|
import org.apache.shiro.session.Session;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.servlet.view.document.AbstractXlsView;
|
import org.springframework.web.servlet.view.document.AbstractXlsView;
|
||||||
|
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
@ -31,6 +32,9 @@ import net.coobird.thumbnailator.Thumbnails;
|
||||||
*/
|
*/
|
||||||
public class HiddenExcelImgToSessionView extends AbstractXlsView{
|
public class HiddenExcelImgToSessionView extends AbstractXlsView{
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void buildExcelDocument(Map<String, Object> model,
|
protected void buildExcelDocument(Map<String, Object> model,
|
||||||
Workbook workbook, HttpServletRequest request,
|
Workbook workbook, HttpServletRequest request,
|
||||||
|
@ -38,7 +42,7 @@ public class HiddenExcelImgToSessionView extends AbstractXlsView{
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
String proPath = PathUtil.getProjectpath();
|
String proPath = PathUtil.getProjectpath();
|
||||||
Session session = Jurisdiction.getSession();
|
Session session = Jurisdiction.getSession();
|
||||||
String beji = Const.HTTPFILEURL;
|
String beji = fileUrl;
|
||||||
//beji =beji.replaceAll("\\\\", "/");
|
//beji =beji.replaceAll("\\\\", "/");
|
||||||
// String beji = "https://qgqy.qhdsafety.com/file/";
|
// String beji = "https://qgqy.qhdsafety.com/file/";
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.servlet.view.document.AbstractXlsView;
|
import org.springframework.web.servlet.view.document.AbstractXlsView;
|
||||||
|
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
@ -37,13 +38,16 @@ import com.zcloud.entity.PageData;
|
||||||
*/
|
*/
|
||||||
public class HiddenExcelImgView extends AbstractXlsView{
|
public class HiddenExcelImgView extends AbstractXlsView{
|
||||||
|
|
||||||
|
@Value("${http.file.url}")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void buildExcelDocument(Map<String, Object> model,
|
protected void buildExcelDocument(Map<String, Object> model,
|
||||||
Workbook workbook, HttpServletRequest request,
|
Workbook workbook, HttpServletRequest request,
|
||||||
HttpServletResponse response) throws Exception {
|
HttpServletResponse response) throws Exception {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
String proPath = PathUtil.getProjectpath();
|
String proPath = PathUtil.getProjectpath();
|
||||||
String beji = Const.HTTPFILEURL;
|
String beji = fileUrl;
|
||||||
//beji =beji.replaceAll("\\\\", "/");
|
//beji =beji.replaceAll("\\\\", "/");
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
|
Loading…
Reference in New Issue