Merge remote-tracking branch 'origin/czks1.0' into czks1.0

pull/14/head
songwenxuan 2023-12-18 16:58:26 +08:00
commit 6de19888a1
8 changed files with 203 additions and 58 deletions

View File

@ -64,8 +64,7 @@ public class AppEightWorkCfdController extends BaseController {
public Object list(Page page) throws Exception{ public Object list(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = this.getPageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
// pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.filemanager; package com.zcloud.controller.filemanager;
import com.zcloud.aspect.DockAnnotation;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import java.io.Console; import java.io.Console;
@ -53,6 +54,7 @@ public class MfolderController extends BaseController {
@RequestMapping(value="/add") @RequestMapping(value="/add")
@RequiresPermissions("mfolder:add") @RequiresPermissions("mfolder:add")
@ResponseBody @ResponseBody
@DockAnnotation(isAdd = true)
public Object add() throws Exception{ public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
@ -68,6 +70,7 @@ public class MfolderController extends BaseController {
pd.put("SHARE", "no"); pd.put("SHARE", "no");
mfolderService.save(pd); mfolderService.save(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("pd", pd);
return map; return map;
} }

View File

@ -13,9 +13,7 @@ import org.springframework.stereotype.Component;
* www.zcloudchina.com * www.zcloudchina.com
*/ */
@Component @Component
@RocketMQMessageListener(consumerGroup = "${mq.group.info}", @RocketMQMessageListener(consumerGroup = "${mq.group.info}", topic = "${mq.topic.info}", selectorType = SelectorType.TAG)
topic = "${mq.topic.info}",
selectorType = SelectorType.TAG)
public class MqListener implements RocketMQListener<String> { public class MqListener implements RocketMQListener<String> {
@Override @Override

View File

@ -150,7 +150,7 @@ public class PhotoController extends BaseController {
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
String USERNAME = Jurisdiction.getUsername();//用户名 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 imgData = pd.getString("PHOTODATA").replace("data:image/jpeg;base64,", "");
String pathimg = PathUtil.getProjectpath()+userphoto; String pathimg = PathUtil.getProjectpath()+userphoto;
ImageAnd64Binary.generateImage(imgData, pathimg); ImageAnd64Binary.generateImage(imgData, pathimg);

View File

@ -23,15 +23,15 @@ public class Const {
public static final String SHOWCOUNT = "showCount"; //每页条数 public static final String SHOWCOUNT = "showCount"; //每页条数
public static final String basePath = "/mnt/qask/file/"; public static final String basePath = "/mnt/qask/file/";
public static final String FILEPATHFILE = "/uploadFiles/file/"; //文件上传路径 public static final String FILEPATHFILE = "/uploadFiles/czks/file/"; //文件上传路径
public static final String FILEPATHHEADPHONE = "/uploadFiles/headPhone/"; //用户头像 public static final String FILEPATHHEADPHONE = "/uploadFiles/czks/headPhone/"; //用户头像
public static final String BIFILEPATHFILE = "/uploadFiles/Bfile/"; //文件上传路径 public static final String BIFILEPATHFILE = "/uploadFiles/czks/Bfile/"; //文件上传路径
public static final String FILEPATHIMG = "/uploadFiles/imgs/"; //图片上传路径 public static final String FILEPATHIMG = "/uploadFiles/czks/imgs/"; //图片上传路径
public static final String FILEPATHDZJM = "/uploadFiles/dzjm/"; //图片上传路径 public static final String FILEPATHDZJM = "/uploadFiles/czks/dzjm/"; //图片上传路径
public static final String FILEPATHYHTP = "/uploadFiles/yhtp/"; //图片上传路径 public static final String FILEPATHYHTP = "/uploadFiles/czks/yhtp/"; //图片上传路径
public static final String FILEPATHAITP = "/uploadFiles/aitp/"; //图片上传路径 public static final String FILEPATHAITP = "/uploadFiles/czks/aitp/"; //图片上传路径
public static final String FILEPATHFXSST = "/uploadFiles/fxsst/"; //图片上传路径 风险四色图 public static final String FILEPATHFXSST = "/uploadFiles/czks/fxsst/"; //图片上传路径 风险四色图
public static final String FILEPATHSTUDYVIDEO = "/uploadFiles/studyVideo/"; //学习园地-学习视频文件 public static final String FILEPATHSTUDYVIDEO = "/uploadFiles/czks/studyVideo/"; //学习园地-学习视频文件
public static final String FILEACTIVITI = "/uploadFiles/activitiFile/"; //工作流生成XML和PNG目录 public static final String FILEACTIVITI = "/uploadFiles/activitiFile/"; //工作流生成XML和PNG目录

View File

@ -4,6 +4,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Vector; import java.util.Vector;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Configurable; import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -17,6 +18,8 @@ import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS; import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException; import com.jcraft.jsch.SftpException;
import javax.annotation.Resource;
@Configuration @Configuration
public class Smb { public class Smb {
@ -27,24 +30,30 @@ public class Smb {
public static String password; public static String password;
public static String basePath; public static String basePath;
@Resource
private RocketMQTemplate rocketMQTemplate;
@Value("${smb.host}") @Value("${smb.host}")
public void setHostPath(String hostProperties){ public void setHostPath(String hostProperties) {
host = hostProperties; host = hostProperties;
} }
@Value("${smb.port}") @Value("${smb.port}")
public void setPortPath(Integer portProperties){ public void setPortPath(Integer portProperties) {
port = portProperties; port = portProperties;
} }
@Value("${smb.user}") @Value("${smb.user}")
public void setUserPath(String userProperties){ public void setUserPath(String userProperties) {
user = userProperties; user = userProperties;
} }
@Value("${smb.password}") @Value("${smb.password}")
public void setPasswordPath(String passwordProperties){ public void setPasswordPath(String passwordProperties) {
password = passwordProperties; password = passwordProperties;
} }
@Value("${smb.basePath}") @Value("${smb.basePath}")
public void setBasePath(String basePathProperties){ public void setBasePath(String basePathProperties) {
basePath = basePathProperties; basePath = basePathProperties;
} }
@ -132,6 +141,141 @@ public class Smb {
} }
} }
} }
/*
* bus_imgfiles
* IMGFILES_IDFOREIGN_KEYTYPE
* 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_IDFOREIGN_KEYTYPE
* 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 { public static void sshSftpForInput(InputStream fileI, String fileName, String path) throws Exception {
Session session = null; Session session = null;
@ -196,6 +340,7 @@ public class Smb {
} }
} }
public static void createDir(String createpath, ChannelSftp sftp) { public static void createDir(String createpath, ChannelSftp sftp) {
try { try {
if (isDirExist(createpath, sftp)) { if (isDirExist(createpath, sftp)) {
@ -278,7 +423,7 @@ public class Smb {
System.out.println("4、" + directoryFile + " 删除的文件....."); System.out.println("4、" + directoryFile + " 删除的文件.....");
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e);
} }
// 切断远程连接 // 切断远程连接
channelSftp.exit(); channelSftp.exit();

View File

@ -60,7 +60,7 @@ gwj-baseimgpath=https://qgqy.qhdsafety.com/file/
gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/ gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/
#mq ??????????? #mq ???????????
rocketmq.name-server=192.168.0.31:9876 rocketmq.name-server=192.168.0.79:9876
rocketmq.producer.group=libmiddle rocketmq.producer.group=libmiddle
rocketmq.producer.send-message-timeout=3000 rocketmq.producer.send-message-timeout=3000
rocketmq.producer.compress-message-body-threshold=4096 rocketmq.producer.compress-message-body-threshold=4096

View File

@ -1,4 +1,4 @@
spring.application.name=qa-prevention-gwj spring.application.name=qa-prevention-czks
server.port=8191 server.port=8191
#?? #??