Merge remote-tracking branch 'origin/czks1.0' into czks1.0
commit
6de19888a1
|
@ -64,8 +64,7 @@ public class AppEightWorkCfdController extends BaseController {
|
|||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
// pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.controller.filemanager;
|
||||
|
||||
import com.zcloud.aspect.DockAnnotation;
|
||||
import net.sf.json.JSONArray;
|
||||
|
||||
import java.io.Console;
|
||||
|
@ -53,6 +54,7 @@ public class MfolderController extends BaseController {
|
|||
@RequestMapping(value="/add")
|
||||
@RequiresPermissions("mfolder:add")
|
||||
@ResponseBody
|
||||
@DockAnnotation(isAdd = true)
|
||||
public Object add() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -68,6 +70,7 @@ public class MfolderController extends BaseController {
|
|||
pd.put("SHARE", "no");
|
||||
mfolderService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
map.put("pd", pd);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,7 @@ import org.springframework.stereotype.Component;
|
|||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Component
|
||||
@RocketMQMessageListener(consumerGroup = "${mq.group.info}",
|
||||
topic = "${mq.topic.info}",
|
||||
selectorType = SelectorType.TAG)
|
||||
@RocketMQMessageListener(consumerGroup = "${mq.group.info}", topic = "${mq.topic.info}", selectorType = SelectorType.TAG)
|
||||
public class MqListener implements RocketMQListener<String> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -150,7 +150,7 @@ public class PhotoController extends BaseController {
|
|||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String USERNAME = Jurisdiction.getUsername();//用户名
|
||||
String userphoto = "uploadFiles/photo/"+USERNAME+"_photo.jpg";
|
||||
String userphoto = "/uploadFiles/photo/"+USERNAME+"_photo.jpg";
|
||||
String imgData = pd.getString("PHOTODATA").replace("data:image/jpeg;base64,", "");
|
||||
String pathimg = PathUtil.getProjectpath()+userphoto;
|
||||
ImageAnd64Binary.generateImage(imgData, pathimg);
|
||||
|
|
|
@ -23,15 +23,15 @@ public class Const {
|
|||
public static final String SHOWCOUNT = "showCount"; //每页条数
|
||||
|
||||
public static final String basePath = "/mnt/qask/file/";
|
||||
public static final String FILEPATHFILE = "/uploadFiles/file/"; //文件上传路径
|
||||
public static final String FILEPATHHEADPHONE = "/uploadFiles/headPhone/"; //用户头像
|
||||
public static final String BIFILEPATHFILE = "/uploadFiles/Bfile/"; //文件上传路径
|
||||
public static final String FILEPATHIMG = "/uploadFiles/imgs/"; //图片上传路径
|
||||
public static final String FILEPATHDZJM = "/uploadFiles/dzjm/"; //图片上传路径
|
||||
public static final String FILEPATHYHTP = "/uploadFiles/yhtp/"; //图片上传路径
|
||||
public static final String FILEPATHAITP = "/uploadFiles/aitp/"; //图片上传路径
|
||||
public static final String FILEPATHFXSST = "/uploadFiles/fxsst/"; //图片上传路径 风险四色图
|
||||
public static final String FILEPATHSTUDYVIDEO = "/uploadFiles/studyVideo/"; //学习园地-学习视频文件
|
||||
public static final String FILEPATHFILE = "/uploadFiles/czks/file/"; //文件上传路径
|
||||
public static final String FILEPATHHEADPHONE = "/uploadFiles/czks/headPhone/"; //用户头像
|
||||
public static final String BIFILEPATHFILE = "/uploadFiles/czks/Bfile/"; //文件上传路径
|
||||
public static final String FILEPATHIMG = "/uploadFiles/czks/imgs/"; //图片上传路径
|
||||
public static final String FILEPATHDZJM = "/uploadFiles/czks/dzjm/"; //图片上传路径
|
||||
public static final String FILEPATHYHTP = "/uploadFiles/czks/yhtp/"; //图片上传路径
|
||||
public static final String FILEPATHAITP = "/uploadFiles/czks/aitp/"; //图片上传路径
|
||||
public static final String FILEPATHFXSST = "/uploadFiles/czks/fxsst/"; //图片上传路径 风险四色图
|
||||
public static final String FILEPATHSTUDYVIDEO = "/uploadFiles/czks/studyVideo/"; //学习园地-学习视频文件
|
||||
|
||||
public static final String FILEACTIVITI = "/uploadFiles/activitiFile/"; //工作流生成XML和PNG目录
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Configurable;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -17,6 +18,8 @@ import com.jcraft.jsch.Session;
|
|||
import com.jcraft.jsch.SftpATTRS;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
public class Smb {
|
||||
|
||||
|
@ -27,24 +30,30 @@ public class Smb {
|
|||
public static String password;
|
||||
public static String basePath;
|
||||
|
||||
@Resource
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
@Value("${smb.host}")
|
||||
public void setHostPath(String hostProperties){
|
||||
public void setHostPath(String hostProperties) {
|
||||
host = hostProperties;
|
||||
}
|
||||
|
||||
@Value("${smb.port}")
|
||||
public void setPortPath(Integer portProperties){
|
||||
public void setPortPath(Integer portProperties) {
|
||||
port = portProperties;
|
||||
}
|
||||
|
||||
@Value("${smb.user}")
|
||||
public void setUserPath(String userProperties){
|
||||
public void setUserPath(String userProperties) {
|
||||
user = userProperties;
|
||||
}
|
||||
|
||||
@Value("${smb.password}")
|
||||
public void setPasswordPath(String passwordProperties){
|
||||
public void setPasswordPath(String passwordProperties) {
|
||||
password = passwordProperties;
|
||||
}
|
||||
|
||||
@Value("${smb.basePath}")
|
||||
public void setBasePath(String basePathProperties){
|
||||
public void setBasePath(String basePathProperties) {
|
||||
basePath = basePathProperties;
|
||||
}
|
||||
|
||||
|
@ -132,6 +141,141 @@ public class Smb {
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* bus_imgfiles表
|
||||
* IMGFILES_ID,FOREIGN_KEY,TYPE
|
||||
* 这三个值必须要传,所以用到Smb.sshSftp
|
||||
* */
|
||||
public static void sshSftp(MultipartFile file, String fileName, String path,String IMGFILES_ID,String FOREIGN_KEY,String TYPE) throws Exception {
|
||||
Session session = null;
|
||||
Channel channel = null;
|
||||
JSch jsch = new JSch();
|
||||
if (port <= 0) {
|
||||
// 连接服务器,采用默认端口
|
||||
session = jsch.getSession(user, host);
|
||||
} else {
|
||||
// 采用指定的端口连接服务器
|
||||
session = jsch.getSession(user, host, port);
|
||||
}
|
||||
|
||||
// 如果服务器连接不上,则抛出异常
|
||||
if (session == null) {
|
||||
throw new Exception("session is null");
|
||||
}
|
||||
// 设置登陆主机的密码
|
||||
session.setPassword(password);
|
||||
// 设置第一次登陆的时候提示,可选值:(ask | yes | no)
|
||||
session.setConfig("StrictHostKeyChecking", "no");
|
||||
// 设置登陆超时时间
|
||||
session.connect(30000);
|
||||
OutputStream outstream = null;
|
||||
|
||||
try {
|
||||
// 创建sftp通信通道
|
||||
channel = (Channel) session.openChannel("sftp");
|
||||
channel.connect(1000);
|
||||
ChannelSftp sftp = (ChannelSftp) channel;
|
||||
// 进入服务器指定的文件夹
|
||||
// File dir = new File(basePath+"/"+path);
|
||||
// dir.setWritable(true, false);
|
||||
// if(!dir.exists()){
|
||||
// dir.mkdirs();
|
||||
// }
|
||||
createDir(basePath + path, sftp);
|
||||
sftp.cd(basePath + path);
|
||||
// 列出服务器指定的文件列表
|
||||
// Vector v = sftp.ls("*");
|
||||
// for(int i=0;i<v.size();i++){
|
||||
// System.out.println(v.get(i));
|
||||
// }
|
||||
// 以下代码实现从本地上传一个文件到服务器,如果要实现下载,对换以下流就可以了
|
||||
|
||||
sftp.put(file.getInputStream(), fileName);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关流操作
|
||||
if (outstream != null) {
|
||||
outstream.flush();
|
||||
outstream.close();
|
||||
}
|
||||
if (session != null) {
|
||||
session.disconnect();
|
||||
}
|
||||
if (channel != null) {
|
||||
channel.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* bus_imgfiles表
|
||||
* IMGFILES_ID,FOREIGN_KEY,TYPE
|
||||
* 这三个值必须要传,所以用到Smb.sshSftp
|
||||
* */
|
||||
public static void sshSftpForInput(InputStream fileI, String fileName, String path,String IMGFILES_ID,String FOREIGN_KEY,String TYPE) throws Exception {
|
||||
Session session = null;
|
||||
Channel channel = null;
|
||||
JSch jsch = new JSch();
|
||||
if (port <= 0) {
|
||||
// 连接服务器,采用默认端口
|
||||
session = jsch.getSession(user, host);
|
||||
} else {
|
||||
// 采用指定的端口连接服务器
|
||||
session = jsch.getSession(user, host, port);
|
||||
}
|
||||
|
||||
// 如果服务器连接不上,则抛出异常
|
||||
if (session == null) {
|
||||
throw new Exception("session is null");
|
||||
}
|
||||
// 设置登陆主机的密码
|
||||
session.setPassword(password);
|
||||
// 设置第一次登陆的时候提示,可选值:(ask | yes | no)
|
||||
session.setConfig("StrictHostKeyChecking", "no");
|
||||
// 设置登陆超时时间
|
||||
session.connect(30000);
|
||||
OutputStream outstream = null;
|
||||
|
||||
try {
|
||||
// 创建sftp通信通道
|
||||
channel = (Channel) session.openChannel("sftp");
|
||||
channel.connect(1000);
|
||||
ChannelSftp sftp = (ChannelSftp) channel;
|
||||
// 进入服务器指定的文件夹
|
||||
// File dir = new File(basePath+"/"+path);
|
||||
// dir.setWritable(true, false);
|
||||
// if(!dir.exists()){
|
||||
// dir.mkdirs();
|
||||
// }
|
||||
createDir(basePath + path, sftp);
|
||||
sftp.cd(basePath + path);
|
||||
// 列出服务器指定的文件列表
|
||||
// Vector v = sftp.ls("*");
|
||||
// for(int i=0;i<v.size();i++){
|
||||
// System.out.println(v.get(i));
|
||||
// }
|
||||
// 以下代码实现从本地上传一个文件到服务器,如果要实现下载,对换以下流就可以了
|
||||
|
||||
sftp.put(fileI, fileName);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关流操作
|
||||
if (outstream != null) {
|
||||
outstream.flush();
|
||||
outstream.close();
|
||||
}
|
||||
if (session != null) {
|
||||
session.disconnect();
|
||||
}
|
||||
if (channel != null) {
|
||||
channel.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void sshSftpForInput(InputStream fileI, String fileName, String path) throws Exception {
|
||||
Session session = null;
|
||||
|
@ -196,6 +340,7 @@ public class Smb {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static void createDir(String createpath, ChannelSftp sftp) {
|
||||
try {
|
||||
if (isDirExist(createpath, sftp)) {
|
||||
|
@ -278,7 +423,7 @@ public class Smb {
|
|||
System.out.println("4、" + directoryFile + " 删除的文件.....");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
// 切断远程连接
|
||||
channelSftp.exit();
|
||||
|
|
|
@ -60,7 +60,7 @@ gwj-baseimgpath=https://qgqy.qhdsafety.com/file/
|
|||
gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/
|
||||
|
||||
#mq ???????????
|
||||
rocketmq.name-server=192.168.0.31:9876
|
||||
rocketmq.name-server=192.168.0.79:9876
|
||||
rocketmq.producer.group=libmiddle
|
||||
rocketmq.producer.send-message-timeout=3000
|
||||
rocketmq.producer.compress-message-body-threshold=4096
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
spring.application.name=qa-prevention-gwj
|
||||
spring.application.name=qa-prevention-czks
|
||||
server.port=8191
|
||||
|
||||
#??
|
||||
|
|
Loading…
Reference in New Issue