Commit 7256fc0f authored by KeYong's avatar KeYong

Merge branch 'develop_dl_bugfix' of…

Merge branch 'develop_dl_bugfix' of http://36.40.66.175:5000/station/YeeAmosFireAutoSysRoot into develop_dl_bugfix # Conflicts: # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/FileUtils.java # YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_rectification.xml
parents e5e55dca 619349ea
package com.yeejoin.amos.fas.core.common.request; package com.yeejoin.amos.fas.core.common.request;
import java.security.SecureRandom;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition; import java.text.ParsePosition;
...@@ -1071,8 +1072,10 @@ public class DateUtil { ...@@ -1071,8 +1072,10 @@ public class DateUtil {
{ {
; ;
} }
long day = (date.getTime() - mydate.getTime()) / (24 * 60 * 60 * 1000); if (null != date && null != mydate) {
return day; return (date.getTime() - mydate.getTime()) / (24 * 60 * 60 * 1000);
}
return 0;
} }
/** /**
...@@ -1115,7 +1118,7 @@ public class DateUtil { ...@@ -1115,7 +1118,7 @@ public class DateUtil {
*/ */
private static String getRandom(int i) private static String getRandom(int i)
{ {
Random jjj = new Random(); SecureRandom jjj = new SecureRandom();
// int suiJiShu = jjj.nextInt(9); // int suiJiShu = jjj.nextInt(9);
if (i == 0) return ""; if (i == 0) return "";
String jj = ""; String jj = "";
......
...@@ -117,9 +117,17 @@ public class FileController extends BaseController { ...@@ -117,9 +117,17 @@ public class FileController extends BaseController {
ResponseUtils.renderText(response, "File not exists!"); ResponseUtils.renderText(response, "File not exists!");
return; return;
} }
FileInputStream fis = new FileInputStream(file); FileInputStream fis = null;
ResponseUtils.downFileByInputStream(file.getName(), fis, response, open); try {
IOUtils.closeQuietly(fis); fis = new FileInputStream(file);
ResponseUtils.downFileByInputStream(file.getName(), fis, response, open);
} catch (IOException e) {
} finally {
if (null != fis) {
fis.close();
}
}
} }
@Permission @Permission
...@@ -228,14 +236,40 @@ public class FileController extends BaseController { ...@@ -228,14 +236,40 @@ public class FileController extends BaseController {
} }
String htmlContent = (String) processData.get("html"); String htmlContent = (String) processData.get("html");
FileOutputStream fileOutputStream = null;
OutputStreamWriter outputStreamWriter = null;
Writer writer = null;
try { try {
Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(htmlFileName), "UTF-8")); fileOutputStream = new FileOutputStream(htmlFileName);
outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF-8");
writer = new BufferedWriter(outputStreamWriter);
writer.write(htmlContent); writer.write(htmlContent);
writer.flush(); writer.flush();
writer.close(); writer.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} finally {
try {
if (null != writer) {
writer.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (null != outputStreamWriter) {
outputStreamWriter.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (null != fileOutputStream) {
fileOutputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
} }
String filePath = obj.getString("file"); String filePath = obj.getString("file");
processData.put("html", "/" + filePath.substring(0, filePath.lastIndexOf(".")) + ".html"); processData.put("html", "/" + filePath.substring(0, filePath.lastIndexOf(".")) + ".html");
......
...@@ -69,6 +69,8 @@ public class PlanVisual3dController extends BaseController { ...@@ -69,6 +69,8 @@ public class PlanVisual3dController extends BaseController {
if (testPlan != null) { if (testPlan != null) {
String path = testPlan.getFilePath(); String path = testPlan.getFilePath();
if (path != null && !"".equals(path)) { if (path != null && !"".equals(path)) {
FileInputStream inputStream = null;
InputStream fis = null;
try { try {
// path是指欲下载的文件的路径。 // path是指欲下载的文件的路径。
File file = new File(fileUploadDir + path); File file = new File(fileUploadDir + path);
...@@ -79,26 +81,40 @@ public class PlanVisual3dController extends BaseController { ...@@ -79,26 +81,40 @@ public class PlanVisual3dController extends BaseController {
String ext = filename.substring(filename.lastIndexOf(".") + 1).toUpperCase(); String ext = filename.substring(filename.lastIndexOf(".") + 1).toUpperCase();
// 以流的形式下载文件。 // 以流的形式下载文件。
InputStream fis = new BufferedInputStream(new FileInputStream(fileUploadDir + path)); inputStream = new FileInputStream(fileUploadDir + path);
byte[] buffer = new byte[fis.available()]; if (null != inputStream) {
fis.read(buffer); fis = new BufferedInputStream(inputStream);
fis.close();
// 清空response byte[] buffer = new byte[fis.available()];
fis.read(buffer);
// 清空response
// response.reset(); // response.reset();
// 设置response的Header // 设置response的Header
response.addHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes())); response.addHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes()));
response.addHeader("Content-Length", "" + file.length()); response.addHeader("Content-Length", "" + file.length());
response.setContentType("application/x-download"); response.setContentType("application/x-download");
OutputStream toClient = new BufferedOutputStream(response.getOutputStream()); OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
toClient.write(buffer); toClient.write(buffer);
toClient.flush(); toClient.flush();
toClient.close(); toClient.close();
}
} else { } else {
response.setStatus(404); response.setStatus(404);
} }
} catch (IOException ex) { } catch (IOException ex) {
ex.printStackTrace(); ex.printStackTrace();
} finally {
try {
if (null != inputStream) {
inputStream.close();
}
if (null != fis) {
fis.close();
}
} catch (IOException e) {
e.printStackTrace();
}
} }
} }
} else { } else {
......
...@@ -35,6 +35,8 @@ public class WeatherController extends BaseController { ...@@ -35,6 +35,8 @@ public class WeatherController extends BaseController {
String result = ""; String result = "";
BufferedReader in = null; BufferedReader in = null;
BufferedReader responseReader = null;
InputStreamReader res = null;
try { try {
String urlNameString = weatherUrl + address; String urlNameString = weatherUrl + address;
URL realUrl = new URL(urlNameString); URL realUrl = new URL(urlNameString);
...@@ -55,12 +57,13 @@ public class WeatherController extends BaseController { ...@@ -55,12 +57,13 @@ public class WeatherController extends BaseController {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
String readLine = new String(); String readLine = new String();
GZIPInputStream gZipS=new GZIPInputStream(connection.getInputStream()); GZIPInputStream gZipS=new GZIPInputStream(connection.getInputStream());
InputStreamReader res = new InputStreamReader(gZipS,"UTF-8"); res = new InputStreamReader(gZipS,"UTF-8");
BufferedReader responseReader = new BufferedReader(res); responseReader = new BufferedReader(res);
while ((readLine = responseReader.readLine()) != null) { while ((readLine = responseReader.readLine()) != null) {
sb.append(readLine); sb.append(readLine);
} }
responseReader.close();
result = sb.toString(); result = sb.toString();
System.out.println(result); System.out.println(result);
...@@ -75,6 +78,12 @@ public class WeatherController extends BaseController { ...@@ -75,6 +78,12 @@ public class WeatherController extends BaseController {
if (in != null) { if (in != null) {
in.close(); in.close();
} }
if (null != responseReader) {
responseReader.close();
}
if (null != res) {
res.close();
}
} catch (Exception e2) { } catch (Exception e2) {
e2.printStackTrace(); e2.printStackTrace();
} }
......
...@@ -161,9 +161,9 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen ...@@ -161,9 +161,9 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
} }
} }
} }
if (!CollectionUtils.isEmpty(map)) { if (null != map &&!CollectionUtils.isEmpty(map)) {
Integer total = Integer.parseInt(map.get("total").toString()); Integer total = Integer.parseInt(map.getOrDefault("total", 0).toString());
Integer count = Integer.parseInt(map.get("count").toString()); Integer count = Integer.parseInt(map.getOrDefault("count", 0).toString());
if (SqlKeyWordEnum.AND.getKey().equalsIgnoreCase(type)) { if (SqlKeyWordEnum.AND.getKey().equalsIgnoreCase(type)) {
return total.equals(count); return total.equals(count);
} else if (SqlKeyWordEnum.OR.getKey().equalsIgnoreCase(type)) { } else if (SqlKeyWordEnum.OR.getKey().equalsIgnoreCase(type)) {
......
...@@ -325,7 +325,7 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -325,7 +325,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
if(date.isPresent()){ if(date.isPresent()){
equipment2=date.get(); equipment2=date.get();
} }
equipment.setCreateDate(equipment2.getCreateDate()); equipment.setCreateDate(null != equipment2 ? equipment2.getCreateDate() : new Date());
} }
preplanPictureDao.saveAndFlush(pp); preplanPictureDao.saveAndFlush(pp);
...@@ -369,8 +369,7 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -369,8 +369,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
if(date.isPresent()){ if(date.isPresent()){
equipment2=date.get(); equipment2=date.get();
} }
equipment.setCreateDate(null != equipment2 && null != equipment2.getCreateDate() ? equipment2.getCreateDate() : new Date());
equipment.setCreateDate(equipment2.getCreateDate() == null ? new Date() : equipment2.getCreateDate());
} }
} else { } else {
equipment = save(equipment); equipment = save(equipment);
...@@ -382,7 +381,7 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -382,7 +381,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
equipment2=date.get(); equipment2=date.get();
} }
equipment.setCreateDate(equipment2.getCreateDate() == null ? new Date() : equipment2.getCreateDate()); equipment.setCreateDate(null != equipment2 && null != equipment2.getCreateDate() ? equipment2.getCreateDate() : new Date());
} }
Long equipmentId = Long.valueOf(equipment.getId()); Long equipmentId = Long.valueOf(equipment.getId());
for (int i = 0; i < imgs.length; i++) { for (int i = 0; i < imgs.length; i++) {
......
...@@ -210,13 +210,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -210,13 +210,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource.setStatus(FasConstant.RISK_SOURCE_STATUS_NORMAL); riskSource.setStatus(FasConstant.RISK_SOURCE_STATUS_NORMAL);
riskSource.setCreateDate(new Date()); riskSource.setCreateDate(new Date());
} else {// 更新 } else {// 更新
riskSource.setCreateDate(oldRiskSource.getCreateDate()); if (null != oldRiskSource) {
riskSource.setFmeaList(oldRiskSource.getFmeaList()); riskSource.setCreateDate(oldRiskSource.getCreateDate());
riskSource.setIncrement(oldRiskSource.getIncrement()); riskSource.setFmeaList(oldRiskSource.getFmeaList());
riskSource.setRpn(oldRiskSource.getRpn()); riskSource.setIncrement(oldRiskSource.getIncrement());
riskSource.setRpnChangeLogList(oldRiskSource.getRpnChangeLogList()); riskSource.setRpn(oldRiskSource.getRpn());
riskSource.setRpni(oldRiskSource.getRpni()); riskSource.setRpnChangeLogList(oldRiskSource.getRpnChangeLogList());
riskSource.setStatus(oldRiskSource.getStatus()); riskSource.setRpni(oldRiskSource.getRpni());
riskSource.setStatus(oldRiskSource.getStatus());
}
} }
iRiskSourceDao.saveAndFlush(riskSource); iRiskSourceDao.saveAndFlush(riskSource);
return riskSource; return riskSource;
......
...@@ -267,13 +267,15 @@ public class FileHelper { ...@@ -267,13 +267,15 @@ public class FileHelper {
public static void writeFile(String content, String path) { public static void writeFile(String content, String path) {
OutputStream fos = null; OutputStream fos = null;
BufferedWriter bw = null; BufferedWriter bw = null;
OutputStreamWriter outputStreamWriter = null;
try { try {
File file = new File(path); File file = new File(path);
if (!file.getParentFile().exists()) { if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs(); file.getParentFile().mkdirs();
} }
fos = new FileOutputStream(file); fos = new FileOutputStream(file);
bw = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8")); outputStreamWriter = new OutputStreamWriter(fos, "UTF-8");
bw = new BufferedWriter(outputStreamWriter);
bw.write(content); bw.write(content);
} catch (FileNotFoundException fnfe) { } catch (FileNotFoundException fnfe) {
fnfe.printStackTrace(); fnfe.printStackTrace();
...@@ -281,11 +283,17 @@ public class FileHelper { ...@@ -281,11 +283,17 @@ public class FileHelper {
ioe.printStackTrace(); ioe.printStackTrace();
} finally { } finally {
try { try {
if (bw != null) { if (null != bw) {
bw.close(); bw.close();
} }
} catch (IOException ioException) { if (null != fos) {
System.err.println(ioException.getMessage()); fos.close();
}
if (null != outputStreamWriter) {
outputStreamWriter.close();
}
} catch (IOException e) {
e.printStackTrace();
} }
} }
} }
...@@ -377,9 +385,12 @@ public class FileHelper { ...@@ -377,9 +385,12 @@ public class FileHelper {
// 以GB2312读取文件 // 以GB2312读取文件
BufferedReader br = null; BufferedReader br = null;
BufferedWriter bw = null; BufferedWriter bw = null;
FileWriter fileWriter = null;
try { try {
br = new BufferedReader(new FileReader(htmFile)); FileReader fileReader = new FileReader(htmFile);
bw = new BufferedWriter(new FileWriter(new File(outPutFile))); br = new BufferedReader(fileReader);
fileWriter = new FileWriter(new File(outPutFile));
bw = new BufferedWriter(fileWriter);
String result = null; String result = null;
while (null != (result = br.readLine())) { while (null != (result = br.readLine())) {
if (!"".equals(result.trim())) { if (!"".equals(result.trim())) {
...@@ -393,11 +404,22 @@ public class FileHelper { ...@@ -393,11 +404,22 @@ public class FileHelper {
if (null != br) { if (null != br) {
br.close(); br.close();
} }
} catch (Exception e) {
e.printStackTrace();
}
try {
if (null != bw) { if (null != bw) {
bw.close(); bw.close();
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
}
try {
if (null != fileWriter) {
fileWriter.close();
}
} catch (Exception e) {
e.printStackTrace();
} }
} }
...@@ -578,37 +600,27 @@ public class FileHelper { ...@@ -578,37 +600,27 @@ public class FileHelper {
} }
public static void nioTransferCopy(File source, File target) { public static void nioTransferCopy(File source, File target) {
FileChannel in = null; try (
FileChannel out = null; FileInputStream inStream = new FileInputStream(source);
FileInputStream inStream = null; FileOutputStream outStream = new FileOutputStream(target);
FileOutputStream outStream = null; FileChannel in = inStream.getChannel();
try { FileChannel out = outStream.getChannel();
inStream = new FileInputStream(source); ) {
outStream = new FileOutputStream(target);
in = inStream.getChannel();
out = outStream.getChannel();
in.transferTo(0, in.size(), out); in.transferTo(0, in.size(), out);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} finally {
close(inStream);
close(in);
close(outStream);
close(out);
} }
} }
private static boolean nioBufferCopy(File source, File target) { private static boolean nioBufferCopy(File source, File target) {
FileChannel in = null;
FileChannel out = null; try (
FileInputStream inStream = null; FileInputStream inStream = new FileInputStream(source);
FileOutputStream outStream = null; FileOutputStream outStream = new FileOutputStream(target);
try { FileChannel in = inStream.getChannel();
inStream = new FileInputStream(source); FileChannel out = outStream.getChannel();
outStream = new FileOutputStream(target); ) {
in = inStream.getChannel();
out = outStream.getChannel();
ByteBuffer buffer = ByteBuffer.allocate(4096); ByteBuffer buffer = ByteBuffer.allocate(4096);
while (in.read(buffer) != -1) { while (in.read(buffer) != -1) {
buffer.flip(); buffer.flip();
...@@ -618,22 +630,16 @@ public class FileHelper { ...@@ -618,22 +630,16 @@ public class FileHelper {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return false; return false;
} finally {
close(inStream);
close(in);
close(outStream);
close(out);
} }
return true; return true;
} }
public static void customBufferStreamCopy(File source, File target) { public static void customBufferStreamCopy(File source, File target) {
InputStream fis = null; try (
OutputStream fos = null; InputStream fis = new FileInputStream(source);
try { OutputStream fos = new FileOutputStream(target);
fis = new FileInputStream(source); ) {
fos = new FileOutputStream(target);
byte[] buf = new byte[4096]; byte[] buf = new byte[4096];
int i; int i;
while ((i = fis.read(buf)) != -1) { while ((i = fis.read(buf)) != -1) {
...@@ -641,9 +647,6 @@ public class FileHelper { ...@@ -641,9 +647,6 @@ public class FileHelper {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
close(fis);
close(fos);
} }
} }
...@@ -1190,36 +1193,28 @@ public class FileHelper { ...@@ -1190,36 +1193,28 @@ public class FileHelper {
* @Title: getExcel * @Title: getExcel
* @Description: 下载指定路径的Excel文件 * @Description: 下载指定路径的Excel文件
*/ */
public static void getExcel(String url, String fileName, HttpServletResponse response, HttpServletRequest request) { public static void getExcel(String url, String fileName, HttpServletResponse response, HttpServletRequest request) throws UnsupportedEncodingException {
//1.设置文件ContentType类型,这样设置,会自动判断下载文件类型
try { response.setContentType("multipart/form-data");
//1.设置文件ContentType类型,这样设置,会自动判断下载文件类型 //2.设置文件头:最后一个参数是设置下载文件名
response.setContentType("multipart/form-data"); response.setHeader("Content-disposition", "attachment; filename=\""
+ encodeChineseDownloadFileName(request, fileName + ".xls") + "\"");
//2.设置文件头:最后一个参数是设置下载文件名 // response.setHeader("Content-Disposition", "attachment;filename="
response.setHeader("Content-disposition", "attachment; filename=\""
+ encodeChineseDownloadFileName(request, fileName + ".xls") + "\"");
// response.setHeader("Content-Disposition", "attachment;filename="
// + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + ".xls"); //中文文件名 // + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + ".xls"); //中文文件名
//通过文件路径获得File对象 //通过文件路径获得File对象
File file = new File(url); try (
FileInputStream in = new FileInputStream(new File(url));
FileInputStream in = new FileInputStream(file); //3.通过response获取OutputStream对象(out)
//3.通过response获取OutputStream对象(out) OutputStream out = new BufferedOutputStream(response.getOutputStream());
OutputStream out = new BufferedOutputStream(response.getOutputStream()); ) {
int b = 0; int b = 0;
byte[] buffer = new byte[2048]; byte[] buffer = new byte[2048];
while ((b = in.read(buffer)) != -1) { while ((b = in.read(buffer)) != -1) {
out.write(buffer, 0, b); //4.写到输出流(out)中 out.write(buffer, 0, b); //4.写到输出流(out)中
} }
in.close();
out.flush(); out.flush();
out.close();
} catch (IOException e) { } catch (IOException e) {
log.error("下载Excel模板异常", e); log.error("下载Excel模板异常", e);
} }
......
package com.yeejoin.amos.fas.business.util;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* 文件下载 工具类
*
* @author 郑嘉伟
* @since 2020-08-05
*/
public class FileUtils {
private static final Logger logger = LogManager.getLogger(FileUtils.class);
/**
* 获取压缩好zip——>设置消息头——>输出
* @param response
* @param list
* @param ipUrl
* @throws IOException
*/
public static void downloadZIP(HttpServletResponse response, List<String> list, String ipUrl) throws IOException {
//构建zip
String zipname = "单据相关附件.zip";
String zippath = fileToZip(list, zipname, ipUrl);
OutputStream out = null;
BufferedInputStream br = null;
try {
String fileName = new String(zipname.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
br = new BufferedInputStream(Files.newInputStream(Paths.get(zippath)));
byte[] buf = new byte[1024];
int len = 0;
response.reset();
response.setHeader("Content-Type", "application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Access-Control-Expose-Headers", "access_token");
response.setHeader("Access-Control-Allow-Origin", "*");
response.setContentType("application/zip");
out = response.getOutputStream();
while ((len = br.read(buf)) > 0) {
out.write(buf, 0, len);
out.flush();
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (null != br) {
br.close();
}
if (null != out) {
out.close();
}
}
}
/**
* 通过文件服务器——>获取流——>输出——>压缩
*
* @param list
* @param fileName
* @return
*/
public static String fileToZip(List<String> list, String fileName, String ipUrl) {
if (StringUtils.isBlank(fileName)) {
throw new RuntimeException("文件名不能为空");
}
fileName = FilenameUtils.normalize(fileName);
// 临时目录
String tmpdir = System.getProperty("java.io.tmpdir");
if (StringUtils.isNotBlank(tmpdir) && !tmpdir.endsWith(File.separator)) {
tmpdir += File.separator;
} else if (StringUtils.isBlank(tmpdir)){
tmpdir = "";
}
String path = FilenameUtils.normalize(tmpdir + fileName);
File zipFile = new File(path);
zipFile.deleteOnExit();
try {
zipFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
try (
FileOutputStream fos = new FileOutputStream(zipFile);
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fos);
ZipOutputStream zos = new ZipOutputStream(bufferedOutputStream);
) {
byte[] bufs = new byte[1024 * 10];
for (String a : list) {
try (
InputStream fis = getInputStreamFromURL(ipUrl + a)
) {
assert fis != null;
try (BufferedInputStream bis = new BufferedInputStream(fis, 1024 * 10)
) {
String subFileName = new File(ipUrl + a).getName();
//创建ZIP实体,并添加进压缩包
ZipEntry zipEntry = new ZipEntry(subFileName);
zos.putNextEntry(zipEntry);
int read = 0;
while ((read = bis.read(bufs, 0, 1024 * 10)) != -1) {
zos.write(bufs, 0, read);
}
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}
System.out.println("压缩成功");
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return path;
}
/**
* 从URL中读取图片,转换成流形式.
*
* @param destUrl
* @return
*/
public static InputStream getInputStreamFromURL(String destUrl) {
HttpURLConnection httpUrl = null;
URL url = null;
InputStream in = null;
try {
url = new URL(destUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
in = httpUrl.getInputStream();
return in;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.util; package com.yeejoin.amos.fas.business.util;
import java.security.SecureRandom;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Random; import java.util.Random;
...@@ -12,7 +13,7 @@ public class RandomUtil { ...@@ -12,7 +13,7 @@ public class RandomUtil {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String newDate = sdf.format(new Date()); String newDate = sdf.format(new Date());
String result = ""; String result = "";
Random random = new Random(); SecureRandom random = new SecureRandom();
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
result += random.nextInt(10); result += random.nextInt(10);
} }
......
...@@ -26,7 +26,7 @@ public class SSLClient extends DefaultHttpClient { ...@@ -26,7 +26,7 @@ public class SSLClient extends DefaultHttpClient {
public SSLClient() throws Exception { public SSLClient() throws Exception {
super(); super();
//传输协议需要根据自己的判断 //传输协议需要根据自己的判断
SSLContext ctx = SSLContext.getInstance("TLS"); SSLContext ctx = SSLContext.getInstance("TLSv1.2");
X509TrustManager tm = new X509TrustManager() { X509TrustManager tm = new X509TrustManager() {
@Override @Override
public void checkClientTrusted(X509Certificate[] chain, public void checkClientTrusted(X509Certificate[] chain,
......
...@@ -401,9 +401,11 @@ public static Time formatStrToTime(String strDate){ ...@@ -401,9 +401,11 @@ public static Time formatStrToTime(String strDate){
d = format.parse(str); d = format.parse(str);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
Time date = new Time(d.getTime()); if (null != d) {
return date; return new Time(d.getTime());
}
return null;
} }
/** /**
......
...@@ -26,10 +26,15 @@ public class FileUtil { ...@@ -26,10 +26,15 @@ public class FileUtil {
if (!targetFile.exists()) { if (!targetFile.exists()) {
targetFile.mkdirs(); targetFile.mkdirs();
} }
FileOutputStream out = new FileOutputStream(filePath + fileName); try (
out.write(file); FileOutputStream out = new FileOutputStream(filePath + fileName);
out.flush(); ) {
out.close(); out.write(file);
out.flush();
} catch (IOException e) {
e.printStackTrace();
}
} }
/** /**
......
...@@ -41,19 +41,11 @@ public class MyImageExtractor implements IImageExtractor { ...@@ -41,19 +41,11 @@ public class MyImageExtractor implements IImageExtractor {
imagePath = s1 + pre + s2; imagePath = s1 + pre + s2;
File imageFile = new File(baseDir, imagePath); File imageFile = new File(baseDir, imagePath);
imageFile.getParentFile().mkdirs(); imageFile.getParentFile().mkdirs();
InputStream in = null; try (
OutputStream out = null; InputStream in = new ByteArrayInputStream(imageData);
try { OutputStream out = new FileOutputStream(imageFile);
in = new ByteArrayInputStream(imageData); ) {
out = new FileOutputStream(imageFile);
IOUtils.copy(in, out); IOUtils.copy(in, out);
} finally {
if (in != null) {
IOUtils.closeQuietly(in);
}
if (out != null) {
IOUtils.closeQuietly(out);
}
} }
} }
......
...@@ -17,7 +17,7 @@ import java.io.*; ...@@ -17,7 +17,7 @@ import java.io.*;
/** /**
* 文档转换工具 * 文档转换工具
* *
* @date * @date
* @author nihuanshan * @author nihuanshan
* *
...@@ -27,11 +27,11 @@ public class WordConverterUtils { ...@@ -27,11 +27,11 @@ public class WordConverterUtils {
/** /**
* 图片存储相对文档路径 * 图片存储相对文档路径
*/ */
private static String imgPath = "\\image\\"; private static String imgPath = File.separator + "image" + File.separator;
/** /**
* word文档转html文档 * word文档转html文档
* *
* @author: nihuanshan * @author: nihuanshan
* @date: 2018年12月6日 下午2:55:32 * @date: 2018年12月6日 下午2:55:32
* @param srcFile 原文档 * @param srcFile 原文档
...@@ -51,7 +51,7 @@ public class WordConverterUtils { ...@@ -51,7 +51,7 @@ public class WordConverterUtils {
} }
} }
} }
/** /**
* word转html字符串 * word转html字符串
* @param srcFile * @param srcFile
...@@ -70,7 +70,7 @@ public class WordConverterUtils { ...@@ -70,7 +70,7 @@ public class WordConverterUtils {
/** /**
* .doc文档转换成html * .doc文档转换成html
* *
* @author: nihuanshan * @author: nihuanshan
* @date: 2018年12月6日 下午2:53:43 * @date: 2018年12月6日 下午2:53:43
* @param srcFile * @param srcFile
...@@ -78,7 +78,10 @@ public class WordConverterUtils { ...@@ -78,7 +78,10 @@ public class WordConverterUtils {
* @param readUrl html中img标签的图片存储路径 * @param readUrl html中img标签的图片存储路径
*/ */
private static void docToHtml(File srcFile, File targetFile, String readUrl) { private static void docToHtml(File srcFile, File targetFile, String readUrl) {
try { try (
FileInputStream inputStream = new FileInputStream(srcFile);
HWPFDocument wordDocument = new HWPFDocument(inputStream);
) {
String imagePathStr = srcFile.getParentFile().getAbsolutePath() + imgPath; String imagePathStr = srcFile.getParentFile().getAbsolutePath() + imgPath;
File imagePath = new File(imagePathStr); File imagePath = new File(imagePathStr);
if (!imagePath.exists()) { if (!imagePath.exists()) {
...@@ -86,13 +89,14 @@ public class WordConverterUtils { ...@@ -86,13 +89,14 @@ public class WordConverterUtils {
} }
String srcName = srcFile.getName(); String srcName = srcFile.getName();
String suffix = srcName.substring(0, srcName.lastIndexOf(".")) + "_"; String suffix = srcName.substring(0, srcName.lastIndexOf(".")) + "_";
HWPFDocument wordDocument = new HWPFDocument(new FileInputStream(srcFile));
org.w3c.dom.Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); org.w3c.dom.Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(document); WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(document);
String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs")); String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs"));
wordToHtmlConverter.setPicturesManager((content, pictureType, name, width, height) -> { wordToHtmlConverter.setPicturesManager((content, pictureType, name, width, height) -> {
try { try (
FileOutputStream out = new FileOutputStream(imagePathStr + suffix + name); FileOutputStream out = new FileOutputStream(imagePathStr + suffix + name);
) {
out.write(content); out.write(content);
return uri + suffix + name; return uri + suffix + name;
} catch (Exception e) { } catch (Exception e) {
...@@ -116,7 +120,7 @@ public class WordConverterUtils { ...@@ -116,7 +120,7 @@ public class WordConverterUtils {
} }
} }
/** /**
* doc转htmlString * doc转htmlString
* @param srcFile * @param srcFile
...@@ -124,7 +128,10 @@ public class WordConverterUtils { ...@@ -124,7 +128,10 @@ public class WordConverterUtils {
* @return * @return
*/ */
private static String docToHtmlString(File srcFile, String readUrl) { private static String docToHtmlString(File srcFile, String readUrl) {
try { try (
FileInputStream inputStream = new FileInputStream(srcFile);
HWPFDocument wordDocument = new HWPFDocument(inputStream);
) {
String imagePathStr = srcFile.getParentFile().getAbsolutePath() + imgPath; String imagePathStr = srcFile.getParentFile().getAbsolutePath() + imgPath;
File imagePath = new File(imagePathStr); File imagePath = new File(imagePathStr);
if (!imagePath.exists()) { if (!imagePath.exists()) {
...@@ -132,7 +139,6 @@ public class WordConverterUtils { ...@@ -132,7 +139,6 @@ public class WordConverterUtils {
} }
String srcName = srcFile.getName(); String srcName = srcFile.getName();
String suffix = srcName.substring(0, srcName.lastIndexOf(".")) + "_"; String suffix = srcName.substring(0, srcName.lastIndexOf(".")) + "_";
HWPFDocument wordDocument = new HWPFDocument(new FileInputStream(srcFile));
org.w3c.dom.Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); org.w3c.dom.Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(document); WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(document);
String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs")); String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs"));
...@@ -159,7 +165,7 @@ public class WordConverterUtils { ...@@ -159,7 +165,7 @@ public class WordConverterUtils {
serializer.setOutputProperty(OutputKeys.METHOD, "html"); serializer.setOutputProperty(OutputKeys.METHOD, "html");
serializer.transform(domSource, streamResult); serializer.transform(domSource, streamResult);
return stringWriter.toString(); return stringWriter.toString();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -183,34 +189,26 @@ public class WordConverterUtils { ...@@ -183,34 +189,26 @@ public class WordConverterUtils {
} }
String temp = srcFile.getName(); String temp = srcFile.getName();
String suffix = temp.substring(0, temp.lastIndexOf(".")) + "_"; String suffix = temp.substring(0, temp.lastIndexOf(".")) + "_";
OutputStreamWriter outputStreamWriter = null; try (
try { FileInputStream inputStream = new FileInputStream(srcFile);
XWPFDocument document = new XWPFDocument(new FileInputStream(srcFile)); XWPFDocument document = new XWPFDocument(inputStream);
FileOutputStream fileOutputStream = new FileOutputStream(targetFile);
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, "utf-8");
) {
XHTMLOptions options = XHTMLOptions.create(); XHTMLOptions options = XHTMLOptions.create();
options.setExtractor(new MyImageExtractor(imagePath, suffix)); options.setExtractor(new MyImageExtractor(imagePath, suffix));
String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs")); String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs"));
System.out.println("uri :" + uri); System.out.println("uri :" + uri);
options.URIResolver(new MyURIResolver(uri)); options.URIResolver(new MyURIResolver(uri));
outputStreamWriter = new OutputStreamWriter(new FileOutputStream(targetFile), "utf-8");
XHTMLConverter xhtmlConverter = (XHTMLConverter) XHTMLConverter.getInstance(); XHTMLConverter xhtmlConverter = (XHTMLConverter) XHTMLConverter.getInstance();
xhtmlConverter.convert(document, outputStreamWriter, options); xhtmlConverter.convert(document, outputStreamWriter, options);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
try {
if (outputStreamWriter != null) {
outputStreamWriter.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
} }
} }
/** /**
*docx转htmlString *docx转htmlString
* @param srcFile * @param srcFile
* @param readUrl * @param readUrl
* @return * @return
...@@ -223,9 +221,11 @@ public class WordConverterUtils { ...@@ -223,9 +221,11 @@ public class WordConverterUtils {
} }
String temp = srcFile.getName(); String temp = srcFile.getName();
String suffix = temp.substring(0, temp.lastIndexOf(".")) + "_"; String suffix = temp.substring(0, temp.lastIndexOf(".")) + "_";
OutputStreamWriter outputStreamWriter = null; try (
try { FileInputStream inputStream = new FileInputStream(srcFile);
XWPFDocument document = new XWPFDocument(new FileInputStream(srcFile)); XWPFDocument document = new XWPFDocument(inputStream);
)
{
XHTMLOptions options = XHTMLOptions.create(); XHTMLOptions options = XHTMLOptions.create();
options.setExtractor(new MyImageExtractor(imagePath, suffix)); options.setExtractor(new MyImageExtractor(imagePath, suffix));
String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs")); String uri = readUrl + imagePathStr.substring(imagePathStr.indexOf("docs"));
...@@ -237,15 +237,6 @@ public class WordConverterUtils { ...@@ -237,15 +237,6 @@ public class WordConverterUtils {
return stringWriter.toString(); return stringWriter.toString();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
try {
if (outputStreamWriter != null) {
outputStreamWriter.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
} }
return null; return null;
......
...@@ -19,6 +19,7 @@ import org.springframework.cloud.netflix.hystrix.EnableHystrix; ...@@ -19,6 +19,7 @@ import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
...@@ -35,7 +36,7 @@ import com.yeejoin.amos.filter.CrossDomainFilter; ...@@ -35,7 +36,7 @@ import com.yeejoin.amos.filter.CrossDomainFilter;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
* *
* <pre> * <pre>
* 服务启动类 * 服务启动类
* </pre> * </pre>
...@@ -70,13 +71,15 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware { ...@@ -70,13 +71,15 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware {
*/ */
public static void main(String[] args) { public static void main(String[] args) {
log.info("start Service.........."); log.info("start Service..........");
try { ApplicationContext context = SpringApplication.run(YeeAmosFireAutoSysStart.class, args);
SpringApplication application = new SpringApplication(YeeAmosFireAutoSysStart.class); Environment env = context.getEnvironment();
Environment environment = application.run(args).getEnvironment(); String appName = env.getProperty("spring.application.name");
log.info("SwaggerUI: http://" + InetAddress.getLocalHost().getHostAddress() + ":" + environment.getProperty("server.port") + environment.getProperty("server.servlet.context-path") + "/swagger-ui.html"); log.info(
} catch (Exception e) { "\n----------------------------------------------------------\n\t"
System.out.println("error occur when run server! " + e); + "Application {} is running!\n"
} + "----------------------------------------------------------\n"
, appName
);
} }
/** /**
...@@ -90,7 +93,7 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware { ...@@ -90,7 +93,7 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware {
} }
/** /**
* *
* <pre> * <pre>
* 跨域处理的FilterBean * 跨域处理的FilterBean
* </pre> * </pre>
......
#DB properties: #DB properties:
spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3_pyh_0510?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3_pyh_0510?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=ENC(ymcOoS7xaghkc/E5jSK3Yi9Zz42LWTls9jVGpYgsRTqLxPpXfqkIXAtXHwCSPOcw)
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000 spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10 spring.datasource.hikari.maximum-pool-size = 10
...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1 ...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1
#\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528 #\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528
amos.system.user.user-name=fas_autosys amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560 amos.system.user.password=ENC(QDC3/GhtV5hj5GLxaVkYd1Sk3gFSlW1BWS7ieC2+FL56U9U9LV9BpcMBrhk7xFWM)
#\u5E94\u7528product appkey #\u5E94\u7528product appkey
amos.system.user.app-key=studio_normalapp_3056965 amos.system.user.app-key=studio_normalapp_3056965
...@@ -29,7 +29,7 @@ eureka.instance.status-page-url-path=/actuator/info ...@@ -29,7 +29,7 @@ eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=a1234560 spring.security.user.password=ENC(QDC3/GhtV5hj5GLxaVkYd1Sk3gFSlW1BWS7ieC2+FL56U9U9LV9BpcMBrhk7xFWM)
...@@ -40,7 +40,7 @@ spring.security.user.password=a1234560 ...@@ -40,7 +40,7 @@ spring.security.user.password=a1234560
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.11.201 spring.redis.host=172.16.11.201
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=ENC(u0Z/KZ7xhkx8sQj+mpBpE3EQJwCWR8JeRZSFQwnetsc4Bhswn2dDiqmUFGSiUM2x)
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
...@@ -58,7 +58,7 @@ emqx.clean-session=true ...@@ -58,7 +58,7 @@ emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.201:1883 emqx.broker=tcp://172.16.11.201:1883
emqx.client-user-name=admin emqx.client-user-name=admin
emqx.client-password=public emqx.client-password=ENC(IWhwMSgko6moJ+JDuh5cq41ixOfhyyiaoRiOCw5Iv3f+YAO8Ib5KpWattlT6h57p)
emqx.max-inflight=1000 emqx.max-inflight=1000
riskSourceService riskSourceService
#\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740 #\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
......
#DB properties: #DB properties:
spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=ENC(HauNTLfKmT6iwEk9dxFRUucZvEzc7S648Wflgrom3lCGmm1YP0dnKds7jUF74fkH)
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000 spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10 spring.datasource.hikari.maximum-pool-size = 10
...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1 ...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1
#\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528 #\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528
amos.system.user.user-name=fas_autosys amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560 amos.system.user.password=ENC(dkh6A2t7bFXQHO1uR7R49d6p2nxEHjbxxEh1Rvzc88iAjx6OVRN7eh8hA0XmZecg)
#\u5E94\u7528product appkey #\u5E94\u7528product appkey
amos.system.user.app-key=studio_normalapp_3056965 amos.system.user.app-key=studio_normalapp_3056965
...@@ -27,7 +27,7 @@ eureka.instance.prefer-ip-address=true ...@@ -27,7 +27,7 @@ eureka.instance.prefer-ip-address=true
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.11.201 spring.redis.host=172.16.11.201
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=ENC(hb6Rn2N41E6vFwxZuwNhPHzZb5+ZvrbxBUjYPOiST8VYm3Ri1n5lH3bxADVZOs4m)
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
...@@ -45,7 +45,7 @@ emqx.clean-session=true ...@@ -45,7 +45,7 @@ emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.201:1883 emqx.broker=tcp://172.16.11.201:1883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=ENC(vlnMOpNNk7wWAcVgqh/C61LOajZY3f1XOFZEqcJ774SdtZeKnOCoNL3u4idRVr+S)
#\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740 #\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
file.downLoad.url=http://172.16.11.201:9000/ file.downLoad.url=http://172.16.11.201:9000/
......
#DB properties: #DB properties:
spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=ENC(+tRgnqfLe7fs+SbrhFCw1DlfsKfZcqVeJL1Qy/hnvD44o2xcLwZ+wyszup80n57p)
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000 spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10 spring.datasource.hikari.maximum-pool-size = 10
...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1 ...@@ -10,7 +10,7 @@ spring.datasource.validationQuery = SELECT 1
#\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528 #\u7CFB\u7EDF\u670D\u52A1\u8D26\u53F7\uFF0C\u7528\u6237\u540E\u7AEF\u670D\u52A1\u8C03\u7528
amos.system.user.user-name=fas_autosys amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560 amos.system.user.password=ENC(IrXh5LXTKhcu0kC90lBN4nMLIhrTVxPcCOL2BsM3UVXn9yitiDZHQ8p4O1c3BS4z)
#\u5E94\u7528product appkey #\u5E94\u7528product appkey
amos.system.user.app-key=studio_normalapp_3056965 amos.system.user.app-key=studio_normalapp_3056965
...@@ -27,7 +27,7 @@ eureka.instance.prefer-ip-address=true ...@@ -27,7 +27,7 @@ eureka.instance.prefer-ip-address=true
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.11.201 spring.redis.host=172.16.11.201
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=ENC(OflloIPxMWWfgucq8aru16+lhCH0aZq9bmlW6zjjjDSiGy/yCE9HFu3Fe1D/6bpi)
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
...@@ -45,7 +45,7 @@ emqx.clean-session=true ...@@ -45,7 +45,7 @@ emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.201:1883 emqx.broker=tcp://172.16.11.201:1883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=ENC(JcSMTcnJjJsR/wlfW4MqxYnTVVxymsc7iZN3l+gRadRsplNeScSxFa3gbCv30oDt)
#\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740 #\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
file.downLoad.url=http://172.16.11.201:9000/ file.downLoad.url=http://172.16.11.201:9000/
......
...@@ -4,7 +4,7 @@ server.port = 8085 ...@@ -4,7 +4,7 @@ server.port = 8085
#environment #environment
spring.profiles.active=dev spring.profiles.active=dev
#spring.freemarker.cache=false #spring.freemarker.cache=false
spring.devtools.restart.enabled=true spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=WEB-INF/** spring.devtools.restart.exclude=WEB-INF/**
...@@ -91,7 +91,7 @@ data.type.fireMonitor=3103 ...@@ -91,7 +91,7 @@ data.type.fireMonitor=3103
outSystem.fegin.name=unKnow outSystem.fegin.name=unKnow
outSystem.user.password=a1234560 outSystem.user.password=ENC(69BvVP221DPXcNRGhdAMYCm3nPJMSCDutwnqJoH+jfXDt5NXvvi9ajv0qFSpBtIg)
privilege.fegin.name=AMOS-API-PRIVILEGE privilege.fegin.name=AMOS-API-PRIVILEGE
#\u9884\u6848\u6307\u6807\u914D\u7F6E #\u9884\u6848\u6307\u6807\u914D\u7F6E
......
...@@ -25,7 +25,7 @@ CREATE TABLE `s_company` ( ...@@ -25,7 +25,7 @@ CREATE TABLE `s_company` (
UNIQUE KEY `comp_code` (`comp_code`) USING BTREE, UNIQUE KEY `comp_code` (`comp_code`) USING BTREE,
UNIQUE KEY `comp_code_2` (`comp_code`) USING BTREE, UNIQUE KEY `comp_code_2` (`comp_code`) USING BTREE,
KEY `FK__s_company__s_site_id__38495279` (`site_id`) USING BTREE KEY `FK__s_company__s_site_id__38495279` (`site_id`) USING BTREE
) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root:admin_1234@172.16.11.33:3306/safety-precontrol_security_60/s_company'; ) ENGINE=FEDERATED DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `s_department`; DROP TABLE IF EXISTS `s_department`;
CREATE TABLE `s_department` ( CREATE TABLE `s_department` (
...@@ -42,7 +42,7 @@ CREATE TABLE `s_department` ( ...@@ -42,7 +42,7 @@ CREATE TABLE `s_department` (
`is_delete` bit(1) NOT NULL COMMENT '是否删除:0表示未删除,1表示已删除', `is_delete` bit(1) NOT NULL COMMENT '是否删除:0表示未删除,1表示已删除',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `FK__s_departm__compa__74794A92` (`company_id`) USING BTREE KEY `FK__s_departm__compa__74794A92` (`company_id`) USING BTREE
) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root:admin_1234@172.16.11.33:3306/safety-precontrol_security_60/s_department'; ) ENGINE=FEDERATED DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `s_user`; DROP TABLE IF EXISTS `s_user`;
CREATE TABLE `s_user` ( CREATE TABLE `s_user` (
...@@ -73,6 +73,6 @@ CREATE TABLE `s_user` ( ...@@ -73,6 +73,6 @@ CREATE TABLE `s_user` (
KEY `FK__s_user__departme__7D0E9093` (`department_id`) USING BTREE, KEY `FK__s_user__departme__7D0E9093` (`department_id`) USING BTREE,
KEY `FK__s_user__role_id__7E02B4CC` (`role_id`) USING BTREE, KEY `FK__s_user__role_id__7E02B4CC` (`role_id`) USING BTREE,
KEY `FK__s_user__company___7C1A6C5A` (`company_id`) USING BTREE KEY `FK__s_user__company___7C1A6C5A` (`company_id`) USING BTREE
) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root:admin_1234@172.16.11.33:3306/safety-precontrol_security_60/s_user'; ) ENGINE=FEDERATED DEFAULT CHARSET=utf8;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
UPDATE UPDATE
contingency_plan_instance contingency_plan_instance
SET SET
runstate = ${runStatus} runstate = #{runStatus}
<if test="content != null and content != ''"> <if test="content != null and content != ''">
, content = #{content} , content = #{content}
</if> </if>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
UPDATE UPDATE
contingency_plan_instance contingency_plan_instance
SET SET
runstate = ${runStatus} runstate = #{runStatus}
<if test="content != null and content != ''"> <if test="content != null and content != ''">
, content = #{content} , content = #{content}
</if> </if>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
m.batch_no = #{batchNo} m.batch_no = #{batchNo}
</if> </if>
<if test="stepIndex != null"> <if test="stepIndex != null">
AND m.step_index = ${stepIndex} AND m.step_index = #{stepIndex}
</if> </if>
</where> </where>
ORDER BY ORDER BY
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
m.batch_no = #{batchNo} m.batch_no = #{batchNo}
</if> </if>
<if test="stepIndex != null"> <if test="stepIndex != null">
AND m.step_index = ${stepIndex} AND m.step_index = #{stepIndex}
</if> </if>
<if test="indexUpdateTime != null"> <if test="indexUpdateTime != null">
AND m.index_create_time = #{indexUpdateTime} AND m.index_create_time = #{indexUpdateTime}
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
WHERE WHERE
1=1 1=1
<if test="time!=null"> <if test="time!=null">
and TO_DAYS(m.time) = TO_DAYS('${time}') and TO_DAYS(m.time) = TO_DAYS(#{time})
</if> </if>
<if test="type!=null"> <if test="type!=null">
AND m.type = '${type}' AND m.type = #{type}
</if> </if>
<if test="title!=null"> <if test="title!=null">
AND m.title LIKE '%${title}%' AND m.title LIKE CONCAT('%',#{title},'%')
</if> </if>
<if test="orgCode!=null"> <if test="orgCode!=null">
AND ( AND (
m.org_code = '${orgCode}' m.org_code = #{orgCode}
OR m.org_code LIKE '${orgCode}*%' OR m.org_code LIKE CONCAT('%',#{orgCode},'*%')
) )
</if> </if>
</select> </select>
...@@ -39,22 +39,22 @@ ...@@ -39,22 +39,22 @@
WHERE WHERE
1=1 1=1
<if test="time!=null"> <if test="time!=null">
and TO_DAYS(m.time) = TO_DAYS('${time}') and TO_DAYS(m.time) = TO_DAYS('#{time}')
</if> </if>
<if test="type!=null"> <if test="type!=null">
AND m.type = '${type}' AND m.type = #{type}
</if> </if>
<if test="title!=null"> <if test="title!=null">
AND m.title LIKE '%${title}%' AND m.title LIKE CONCAT('%',#{title},'%')
</if> </if>
<if test="orgCode!=null"> <if test="orgCode!=null">
AND ( AND (
m.org_code = '${orgCode}' m.org_code = #{orgCode}
OR m.org_code LIKE '${orgCode}*%' OR m.org_code LIKE CONCAT('%',#{orgCode},'%')
) )
</if> </if>
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</select> </select>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<!-- FROM--> <!-- FROM-->
<!-- f_fire_station fs--> <!-- f_fire_station fs-->
<!-- WHERE--> <!-- WHERE-->
<!-- fs.id = ${id}--> <!-- fs.id = #{id}-->
<!-- </select>--> <!-- </select>-->
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<!-- f_fire_station_equipment fs--> <!-- f_fire_station_equipment fs-->
<!-- JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id--> <!-- JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id-->
<!-- WHERE--> <!-- WHERE-->
<!-- fs.fire_station_id = ${fireStationId}--> <!-- fs.fire_station_id = #{fireStationId}-->
<!-- </select>--> <!-- </select>-->
<!-- <select id="queryForFireEqumntPage" resultType="java.util.Map">--> <!-- <select id="queryForFireEqumntPage" resultType="java.util.Map">-->
<!-- SELECT--> <!-- SELECT-->
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
<!-- left join f_fire_equipment f ON fs.fire_equipment_id = f.id--> <!-- left join f_fire_equipment f ON fs.fire_equipment_id = f.id-->
<!-- left join f_risk_source frs on frs.id = f.risk_source_id--> <!-- left join f_risk_source frs on frs.id = f.risk_source_id-->
<!-- WHERE--> <!-- WHERE-->
<!-- fs.fire_station_id = ${fireStationId}--> <!-- fs.fire_station_id = #{fireStationId}-->
<!-- and f.id is not null--> <!-- and f.id is not null-->
<!-- LIMIT ${start}, ${length};--> <!-- LIMIT #{start}, #{length};-->
<!-- </select>--> <!-- </select>-->
<!-- <select id="queryCountForPage" resultType="long">--> <!-- <select id="queryCountForPage" resultType="long">-->
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
<!-- WHERE--> <!-- WHERE-->
<!-- 1=1--> <!-- 1=1-->
<!-- <if test="name!=null">--> <!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')--> <!-- AND (fs.name LIKE '%#{name}%' or fs.`code` LIKE '%#{name}%')-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="code!=null">--> <!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'--> <!-- AND fs.`code` LIKE '%#{code}%'-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="type!=null">--> <!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%';--> <!-- AND fs.`type` LIKE '%#{type}%';-->
<!-- </if>--> <!-- </if>-->
<!-- </select>--> <!-- </select>-->
<!-- <select id="queryForPage" resultType="java.util.Map">--> <!-- <select id="queryForPage" resultType="java.util.Map">-->
...@@ -85,15 +85,15 @@ ...@@ -85,15 +85,15 @@
<!-- 1=1--> <!-- 1=1-->
<!-- <if test="name!=null">--> <!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')--> <!-- AND (fs.name LIKE '%#{name}%' or fs.`code` LIKE '%#{name}%')-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="code!=null">--> <!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'--> <!-- AND fs.`code` LIKE '%#{code}%'-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="type!=null">--> <!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%'--> <!-- AND fs.`type` LIKE '%#{type}%'-->
<!-- </if>--> <!-- </if>-->
<!-- LIMIT ${start},${length} ;--> <!-- LIMIT #{start},#{length} ;-->
<!-- </select>--> <!-- </select>-->
...@@ -126,14 +126,14 @@ ...@@ -126,14 +126,14 @@
a.instance_id a.instance_id
) s ) s
<if test="name!=null"> <if test="name!=null">
AND s.name LIKE '%${name}%' AND s.name LIKE CONCAT('%',#{name},'%')
</if> </if>
<if test="code!=null"> <if test="code!=null">
AND s.`code` LIKE '%${code}%' AND s.`code` LIKE CONCAT('%',#{code},'%')
</if> </if>
<if test="type!=null"> <if test="type!=null">
AND s.`type` LIKE '%${type}%'; AND s.`type` LIKE CONCAT('%',#{type},'%');
</if> </if>
</select> </select>
......
...@@ -139,10 +139,10 @@ ...@@ -139,10 +139,10 @@
) d ) d
<where> <where>
<if test="fireEquipmentName!=null"> <if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%' AND d.fireEquipmentName LIKE CONCAT('%',#{fireEquipmentName},'%')
</if> </if>
<if test="equipmentName!=null"> <if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%' AND d.equipmentName LIKE CONCAT('%',#{equipmentName},'%')
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND d.update_date &gt;= #{startTime} AND d.update_date &gt;= #{startTime}
...@@ -194,10 +194,10 @@ ...@@ -194,10 +194,10 @@
) d ) d
<where> <where>
<if test="fireEquipmentName!=null"> <if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%' AND d.fireEquipmentName LIKE CONCAT('%',#{fireEquipmentName},'%')
</if> </if>
<if test="equipmentName!=null"> <if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%' AND d.equipmentName LIKE CONCAT('%',#{equipmentName},'%')
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND d.create_date &gt;= #{startTime} AND d.create_date &gt;= #{startTime}
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
</if> </if>
</where> </where>
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT #{start},#{length}
</select> </select>
...@@ -218,14 +218,14 @@ ...@@ -218,14 +218,14 @@
<!-- where--> <!-- where-->
<!-- 1=1--> <!-- 1=1-->
<!-- <if test="equipClassify!=null">--> <!-- <if test="equipClassify!=null">-->
<!-- and fe.equip_classify in ( ${equipClassify} )--> <!-- and fe.equip_classify in ( #{equipClassify} )-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="code!=null">--> <!-- <if test="code!=null">-->
<!-- and fe.`code` like '%${code}%'--> <!-- and fe.`code` like '%#{code}%'-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="name!=null">--> <!-- <if test="name!=null">-->
<!-- and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')--> <!-- and (fe.`name` like '%#{name}%' or fe.`code` like '%#{name}%')-->
<!-- </if>--> <!-- </if>-->
<!-- &lt;!&ndash; 筛选未绑定的配套设施--> <!-- &lt;!&ndash; 筛选未绑定的配套设施-->
<!-- &ndash;&gt;--> <!-- &ndash;&gt;-->
...@@ -258,14 +258,14 @@ ...@@ -258,14 +258,14 @@
<!-- where 1=1) tmp--> <!-- where 1=1) tmp-->
<!-- <where>--> <!-- <where>-->
<!-- <if test="equipClassify!=null">--> <!-- <if test="equipClassify!=null">-->
<!-- and tmp.equip_classify in ( ${equipClassify} )--> <!-- and tmp.equip_classify in ( #{equipClassify} )-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="code!=null">--> <!-- <if test="code!=null">-->
<!-- and tmp.`code` like '%${code}%'--> <!-- and tmp.`code` like '%#{code}%'-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="name!=null">--> <!-- <if test="name!=null">-->
<!-- and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')--> <!-- and (tmp.`name` like '%#{name}%' or tmp.`code` like '%#{name}%')-->
<!-- </if>--> <!-- </if>-->
<!-- &lt;!&ndash; 筛选未绑定的配套设施--> <!-- &lt;!&ndash; 筛选未绑定的配套设施-->
<!-- &ndash;&gt;--> <!-- &ndash;&gt;-->
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<!-- AND tmp.bindStation is not true--> <!-- AND tmp.bindStation is not true-->
<!-- </if>--> <!-- </if>-->
<!-- </where>--> <!-- </where>-->
<!-- LIMIT ${start},${length}--> <!-- LIMIT #{start},#{length}-->
<!-- </select>--> <!-- </select>-->
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
<!-- FROM--> <!-- FROM-->
<!-- f_fire_station_equipment se--> <!-- f_fire_station_equipment se-->
<!-- WHERE--> <!-- WHERE-->
<!-- se.fire_station_id = ${fireStationId}--> <!-- se.fire_station_id = #{fireStationId}-->
<!-- AND se.fire_equipment_id = fe.id--> <!-- AND se.fire_equipment_id = fe.id-->
<!-- )--> <!-- )-->
<!-- </select>--> <!-- </select>-->
...@@ -507,12 +507,12 @@ ...@@ -507,12 +507,12 @@
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
JOIN f_fire_equipment fe ON efe.fire_equipment_id = fe.id JOIN f_fire_equipment fe ON efe.fire_equipment_id = fe.id
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = #{equipmentId}
<if test="fname != null"> <if test="fname != null">
AND fe.`name` like '%${fname}%' AND fe.`name` like CONCAT('%',#{fname},'%')
</if> </if>
<if test="length > 0"> <if test="length > 0">
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</if> </if>
</select> </select>
...@@ -525,9 +525,9 @@ ...@@ -525,9 +525,9 @@
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
JOIN wl_equipment_specific fe ON efe.fire_equipment_id = fe.id JOIN wl_equipment_specific fe ON efe.fire_equipment_id = fe.id
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = #{equipmentId}
<if test="fname != null"> <if test="fname != null">
AND fe.`name` like '%${fname}%' AND fe.`name` like CONCAT('%',#{fname},'%')
</if> </if>
</select> </select>
......
...@@ -149,7 +149,6 @@ ...@@ -149,7 +149,6 @@
<!-- HANDLE_STATE =#{doneResult} ,--> <!-- HANDLE_STATE =#{doneResult} ,-->
<!-- FILE_PATH =#{filePath}--> <!-- FILE_PATH =#{filePath}-->
<!-- where SEQUENCE_NBR = #{req}--> <!-- where SEQUENCE_NBR = #{req}-->
<!-- </update>--> <!-- </update>-->
<!-- <update id="updateDanger">--> <!-- <update id="updateDanger">-->
<!-- UPDATE--> <!-- UPDATE-->
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
FROM FROM
f_fmea f f_fmea f
WHERE WHERE
f.risk_source_id = ${riskSourceId}; f.risk_source_id = #{riskSourceId};
</select> </select>
<select id="getById" resultType="com.yeejoin.amos.fas.dao.entity.Fmea"> <select id="getById" resultType="com.yeejoin.amos.fas.dao.entity.Fmea">
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
WHERE WHERE
1=1 1=1
<if test="fireEquipmentId != null"> <if test="fireEquipmentId != null">
and t.fire_equipment_id = ${fireEquipmentId} and t.fire_equipment_id = #{fireEquipmentId}
</if> </if>
<if test="equipmentId != null"> <if test="equipmentId != null">
AND t.equipment_id = ${equipmentId}; AND t.equipment_id = #{equipmentId};
</if> </if>
</select> </select>
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
FROM FROM
f_equipment_fire_equipment t f_equipment_fire_equipment t
WHERE WHERE
t.fire_equipment_id = ${fireEquipmentId} t.fire_equipment_id = #{fireEquipmentId}
AND t.equipment_id = ${equipmentId}; AND t.equipment_id = #{equipmentId};
</select> </select>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
WHERE WHERE
efe.fire_equipment_id = ${fireEquipmentId} efe.fire_equipment_id = #{fireEquipmentId}
) )
LIMIT 0,1 ; LIMIT 0,1 ;
</select> </select>
...@@ -81,11 +81,11 @@ ...@@ -81,11 +81,11 @@
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = #{equipmentId}
AND efe.fire_equipment_id = fe.id AND efe.fire_equipment_id = fe.id
) )
<if test="start != -1 and length != -1"> <if test="start != -1 and length != -1">
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</if> </if>
</select> </select>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = #{equipmentId}
AND efe.fire_equipment_id = fe.id AND efe.fire_equipment_id = fe.id
) )
</select>--> </select>-->
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
WHERE WHERE
efe.equipment_id =${equipmentId} efe.equipment_id =#{equipmentId}
and f.id = efe.fire_equipment_id and f.id = efe.fire_equipment_id
) )
</select> </select>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
WHERE WHERE
efe.fire_equipment_id = ${fireEquipmentId} efe.fire_equipment_id = #{fireEquipmentId}
AND efe.equipment_id = fe.id AND efe.equipment_id = fe.id
) )
</select> </select>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
ORDER BY ORDER BY
a.id a.id
<if test="start != -1 and length != -1"> <if test="start != -1 and length != -1">
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</if> </if>
</select> </select>
...@@ -103,6 +103,6 @@ ...@@ -103,6 +103,6 @@
FROM FROM
f_equipment f_equipment
WHERE WHERE
id = ${id} id = #{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
FROM FROM
f_preplan_picture p f_preplan_picture p
WHERE WHERE
p.equipment_id = ${equipmentId} p.equipment_id = #{equipmentId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
f_rpn_change_log cl f_rpn_change_log cl
WHERE WHERE
cl.type = 0 cl.type = 0
and cl.create_date BETWEEN '${startTime}' and '${endTime}' and cl.create_date BETWEEN #{startTime} and #{endTime}
)d )d
</select> </select>
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
<!-- FROM--> <!-- FROM-->
<!-- f_risk_source_equipment se--> <!-- f_risk_source_equipment se-->
<!-- WHERE--> <!-- WHERE-->
<!-- se.fire_equipment_id = ${fireEquipmentId}--> <!-- se.fire_equipment_id = #{fireEquipmentId}-->
<!-- AND se.risk_source_id = rs.id--> <!-- AND se.risk_source_id = rs.id-->
<!-- )--> <!-- )-->
<!-- </select>--> <!-- </select>-->
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
<!-- FROM--> <!-- FROM-->
<!-- f_risk_source_point_inputitem pi--> <!-- f_risk_source_point_inputitem pi-->
<!-- WHERE--> <!-- WHERE-->
<!-- pi.point_id = ${pointId}--> <!-- pi.point_id = #{pointId}-->
<!-- AND rs.id = pi.risk_source_id--> <!-- AND rs.id = pi.risk_source_id-->
<!-- )--> <!-- )-->
<!-- </select>--> <!-- </select>-->
...@@ -526,7 +526,7 @@ ...@@ -526,7 +526,7 @@
FROM FROM
f_risk_source rs f_risk_source rs
WHERE WHERE
rs.id = ${riskSourceId}; rs.id = #{riskSourceId};
</select> </select>
<select id="queryForRiskSourceRpni" resultType="map"> <select id="queryForRiskSourceRpni" resultType="map">
...@@ -535,7 +535,7 @@ ...@@ -535,7 +535,7 @@
FROM FROM
f_risk_source rs f_risk_source rs
WHERE WHERE
rs.parent_id = ${parentId}; rs.parent_id = #{parentId};
</select> </select>
<select id="queryForUnqualified" resultType="map"> <select id="queryForUnqualified" resultType="map">
...@@ -638,7 +638,7 @@ ...@@ -638,7 +638,7 @@
f_fmea ff f_fmea ff
JOIN f_risk_factor rf ON ff.risk_factors_id = rf.id JOIN f_risk_factor rf ON ff.risk_factors_id = rf.id
WHERE WHERE
rf.id = ${factorId} rf.id = #{factorId}
) )
</select> </select>
<!-- <select id="queryContingencyWater" resultType="com.yeejoin.amos.fas.business.vo.FormInstanceVo">--> <!-- <select id="queryContingencyWater" resultType="com.yeejoin.amos.fas.business.vo.FormInstanceVo">-->
...@@ -734,8 +734,8 @@ ...@@ -734,8 +734,8 @@
INNER JOIN p_point_inputitem ppi ON ppi.ID = ffpi.point_inputitem_id) ffpi INNER JOIN p_point_inputitem ppi ON ppi.ID = ffpi.point_inputitem_id) ffpi
ON ffpi.fmea_id = ff.id ON ffpi.fmea_id = ff.id
WHERE WHERE
ffpi.point_id = ${pointId} ffpi.point_id = #{pointId}
# EXISTS ( SELECT 1 FROM f_risk_source_point_inputitem frspi WHERE frspi.risk_source_id = frs.id AND frspi.point_id = ${pointId} ) # EXISTS ( SELECT 1 FROM f_risk_source_point_inputitem frspi WHERE frspi.risk_source_id = frs.id AND frspi.point_id = #{pointId} )
# EXISTS ( SELECT # EXISTS ( SELECT
# 1 # 1
# FROM # FROM
...@@ -744,7 +744,7 @@ ...@@ -744,7 +744,7 @@
# LEFT JOIN p_point_inputitem ppi on ppi.id = fpi.point_inputitem_id # LEFT JOIN p_point_inputitem ppi on ppi.id = fpi.point_inputitem_id
# WHERE # WHERE
# f.risk_source_id = frs.id # f.risk_source_id = frs.id
# AND ppi.point_id = ${pointId} # AND ppi.point_id = #{pointId}
# ) # )
</select> </select>
......
...@@ -612,8 +612,8 @@ ...@@ -612,8 +612,8 @@
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
( (
tmp.code LIKE '%${inputText}%' tmp.code LIKE '%#{inputText}%'
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE '%#{inputText}%'
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
...@@ -1070,8 +1070,8 @@ ...@@ -1070,8 +1070,8 @@
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE CONCAT('%',#{inputText},'%')
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE CONCAT('%',#{inputText},'%')
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
...@@ -1081,7 +1081,7 @@ ...@@ -1081,7 +1081,7 @@
AND tmp.riskSourceId = #{riskSourceId} AND tmp.riskSourceId = #{riskSourceId}
</if> </if>
</where> </where>
LIMIT ${start},${length} LIMIT #{start},#{length}
</select> </select>
<select id="retrieve3AllCount" resultType="long"> <select id="retrieve3AllCount" resultType="long">
SELECT count(1) FROM ( SELECT count(1) FROM (
...@@ -1277,8 +1277,8 @@ ...@@ -1277,8 +1277,8 @@
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE CONCAT('%',#{inputText},'%')
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE CONCAT('%',#{inputText},'%')
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
...@@ -1486,8 +1486,8 @@ ...@@ -1486,8 +1486,8 @@
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE '%#{inputText}%'
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE '%#{inputText}%'
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
...@@ -1500,7 +1500,7 @@ ...@@ -1500,7 +1500,7 @@
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') ) AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if> </if>
</where> </where>
LIMIT ${start},${length} LIMIT #{start},#{length}
</select> </select>
<select id="getPlanAlarmInfo" resultType="com.yeejoin.amos.fas.business.bo.FirePlanAlarmBo"> <select id="getPlanAlarmInfo" resultType="com.yeejoin.amos.fas.business.bo.FirePlanAlarmBo">
SELECT SELECT
......
...@@ -214,6 +214,11 @@ ...@@ -214,6 +214,11 @@
<artifactId>easypoi-annotation</artifactId> <artifactId>easypoi-annotation</artifactId>
<version>3.0.3</version> <version>3.0.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment