This commit is contained in:
2026-04-23 17:37:38 +08:00
parent 4aeb894ba9
commit 6c252fe4dd
16 changed files with 69 additions and 977 deletions

View File

@ -22,13 +22,13 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
@ -92,15 +92,9 @@ public class BaiDuAipSpeechController {
String type = request.getParameter("type");
String upfile_b64 = request.getParameter("upfile_b64");
BASE64Decoder decoder = new BASE64Decoder();
try {
//Base64解码
byte[] b = decoder.decodeBuffer(upfile_b64);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {//调整异常数据
b[i] += 256;
}
}
byte[] b = Base64.getMimeDecoder().decode(upfile_b64);
String imgFilePath = "D:\\audio\\recorder.mp3";
File fileUploadPath = new File("D:\\audio");
if (!fileUploadPath.exists()) {
@ -129,15 +123,9 @@ public class BaiDuAipSpeechController {
String type = request.getParameter("type");
String upfile_b64 = request.getParameter("upfile_b64");
BASE64Decoder decoder = new BASE64Decoder();
try {
//Base64解码
byte[] b = decoder.decodeBuffer(upfile_b64);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {//调整异常数据
b[i] += 256;
}
}
byte[] b = Base64.getMimeDecoder().decode(upfile_b64);
String imgFilePath = "D:\\audio\\recorder.mp3";
File fileUploadPath = new File("D:\\audio");
if (!fileUploadPath.exists()) {

View File

@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -41,6 +40,7 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.*;
import java.util.stream.Collectors;
@ -593,8 +593,7 @@ public class UserController {
in.read(data);
in.close();
//将二进制字节用base64编码以字符串方式存到数据库中
BASE64Encoder encoder = new BASE64Encoder();
String headPortrait = encoder.encode(data);
String headPortrait = Base64.getEncoder().encodeToString(data);
User cu = (User) request.getSession().getAttribute("cu");
UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId());
int res = 0;

View File

@ -18,7 +18,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource;
import javax.script.ScriptEngine;
@ -32,6 +31,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Base64;
import java.util.List;
@SuppressWarnings({"restriction", "unused"})
@ -719,12 +719,7 @@ public class WordAnalysisReportStructureController {
String id = strconts[0];
String img = strconts[2];
byte[] b2 = new BASE64Decoder().decodeBuffer(img);
for (int i = 0; i < b2.length; ++i) {
if (b2[i] < 0) {// 调整异常数据
b2[i] += 256;
}
}
byte[] b2 = Base64.getMimeDecoder().decode(img);
// 生成png图片
String contextPath = request.getContextPath().replace("/", "");
String filepathSever = request.getSession().getServletContext().getRealPath("");

View File

@ -69,4 +69,4 @@ public class MPointDao extends CommDaoImpl<MPoint>{
paramMap.put("mpointcode",mpointcode);
return this.getSqlSession().delete("scada.MPointMapper.updateLalarmmin", paramMap);
}
}
}

View File

@ -17,7 +17,6 @@ import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -25,6 +24,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -584,12 +584,7 @@ public class CameraService implements CommService<Camera> {
// System.out.println(imgData);
byte[] b = new BASE64Decoder().decodeBuffer(imgData);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {// 调整异常数据
b[i] += 256;
}
}
byte[] b = Base64.getMimeDecoder().decode(imgData);
InputStream in = new ByteArrayInputStream(b);
minioTemplate.makeBucket(nameSpace);
minioTemplate.putObject(nameSpace, rid + "_" + filePath + ".jpg", in, null, null, null, contentType);

View File

@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import java.io.*;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -19,6 +20,7 @@ import java.util.logging.Logger;
public class CameraCall {
private static HCNetSDK2 hcNetSDK = HCNetSDK2.INSTANCE;
private static org.slf4j.Logger logger = LoggerFactory.getLogger(CameraCall.class);
private static final Charset GBK = Charset.forName("GBK");
HCNetSDK2.NET_DVR_USER_LOGIN_INFO m_strLoginINFO = new HCNetSDK2.NET_DVR_USER_LOGIN_INFO();
//HCNetSDK2.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V40();
static HCNetSDK2.NET_DVR_DEVICEINFO_V30 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V30();
@ -493,17 +495,8 @@ public class CameraCall {
Pointer pPlateInfo = strPlateResult.getPointer();
pPlateInfo.write(0, pAlarmInfo.getByteArray(0, strPlateResult.size()), 0, strPlateResult.size());
strPlateResult.read();
try {
String srt3=new String(strPlateResult.struPlateInfo.sLicense,"GBK");
sAlarmType = sAlarmType + ":交通抓拍上传,车牌:"+ srt3;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String plateNo=new String(strPlateResult.struPlateInfo.sLicense, GBK);
sAlarmType = sAlarmType + ":交通抓拍上传,车牌:"+ plateNo;
//报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -539,17 +532,8 @@ public class CameraCall {
Pointer pItsPlateInfo = strItsPlateResult.getPointer();
pItsPlateInfo.write(0, pAlarmInfo.getByteArray(0, strItsPlateResult.size()), 0, strItsPlateResult.size());
strItsPlateResult.read();
try {
String srt3=new String(strItsPlateResult.struPlateInfo.sLicense,"GBK");
sAlarmType = sAlarmType + ",车辆类型:"+strItsPlateResult.byVehicleType + ",交通抓拍上传,车牌:"+ srt3;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String itsPlateNo=new String(strItsPlateResult.struPlateInfo.sLicense, GBK);
sAlarmType = sAlarmType + ",车辆类型:"+strItsPlateResult.byVehicleType + ",交通抓拍上传,车牌:"+ itsPlateNo;
//报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -626,19 +610,10 @@ public class CameraCall {
Pointer pItsParkVehicle = strItsParkVehicle.getPointer();
pItsParkVehicle.write(0, pAlarmInfo.getByteArray(0, strItsParkVehicle.size()), 0, strItsParkVehicle.size());
strItsParkVehicle.read();
try {
String srtParkingNo=new String(strItsParkVehicle.byParkingNo).trim(); //车位编号
String srtPlate=new String(strItsParkVehicle.struPlateInfo.sLicense,"GBK").trim(); //车牌号码
sAlarmType = sAlarmType + ",停产场数据,车位编号:"+ srtParkingNo + ",车位状态:"
+ strItsParkVehicle.byLocationStatus+ ",车牌:"+ srtPlate;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String srtParkingNo=new String(strItsParkVehicle.byParkingNo).trim(); //车位编号
String srtPlate2=new String(strItsParkVehicle.struPlateInfo.sLicense, GBK).trim(); //车牌号码
sAlarmType = sAlarmType + ",停产场数据,车位编号:"+ srtParkingNo + ",车位状态:"
+ strItsParkVehicle.byLocationStatus+ ",车牌:"+ srtPlate2;
//报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -679,15 +654,9 @@ public class CameraCall {
pTFSInfo.write(0, pAlarmInfo.getByteArray(0, strTFSAlarmInfo.size()), 0, strTFSAlarmInfo.size());
strTFSAlarmInfo.read();
try {
String srtPlate=new String(strTFSAlarmInfo.struPlateInfo.sLicense,"GBK").trim(); //车牌号码
sAlarmType = sAlarmType + ":交通取证报警信息,违章类型"+ strTFSAlarmInfo.dwIllegalType + ",车牌号码:" + srtPlate
+ ",车辆出入状态:" + strTFSAlarmInfo.struAIDInfo.byVehicleEnterState;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String srtPlate=new String(strTFSAlarmInfo.struPlateInfo.sLicense, GBK).trim(); //车牌号码
sAlarmType = sAlarmType + ":交通取证报警信息,违章类型:"+ strTFSAlarmInfo.dwIllegalType + ",车牌号码:" + srtPlate
+ ",车辆出入状态" + strTFSAlarmInfo.struAIDInfo.byVehicleEnterState;
//报警设备IP地址
sIP = new String(strTFSAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2);
@ -1045,7 +1014,7 @@ public class CameraCall {
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
break;
}
} catch (UnsupportedEncodingException ex) {
} catch (Exception ex) {
Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex);
}
return true;

View File

@ -8,11 +8,11 @@ import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams;
import sun.misc.BASE64Decoder;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.*;
/**
@ -129,16 +129,10 @@ public class UEditorUtil {
String base64Data = this.request.getParameter(fieldName);
this.fileName = this.getName("test.png");
this.url = savePath + "/" + this.fileName;
BASE64Decoder decoder = new BASE64Decoder();
try {
File outFile = new File(this.getPhysicalPath(this.url));
OutputStream ro = new FileOutputStream(outFile);
byte[] b = decoder.decodeBuffer(base64Data);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {
b[i] += 256;
}
}
byte[] b = Base64.getMimeDecoder().decode(base64Data);
ro.write(b);
ro.flush();
ro.close();

View File

@ -1,11 +1,11 @@
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SIPAIIS_WMS_HQAQ
url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=SIPAIIS_WMS_HQAQ
url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SIPAIIS_WMS_HQAQ
#url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=SIPAIIS_WMS_HQAQ
username=sa
password=P76XB3nm36aMkN6n
#scada-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=EIP_PRD_HQWS
scada-url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=EIP_PRD_HQWS
scada-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=EIP_PRD_HQWS
#scada-url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=EIP_PRD_HQWS
scada-username=sa
scada-password=P76XB3nm36aMkN6n

View File

@ -1,5 +1,11 @@
{
"properties": {
"id": {
"type": "keyword"
},
"mpointid": {
"type": "keyword"
},
"parmname": {
"type": "text",
"analyzer": "ik_smart",
@ -8,6 +14,9 @@
"mpointcode": {
"type": "keyword",
"normalizer": "my_normalizer"
},
"measuredt": {
"type": "date"
}
}
}
}

View File

@ -1,31 +1,29 @@
{
"settings": {
"analysis": {
"analyzer": {
"char_analyzer": {
"char_filter": [
"split_by_whitespace_filter"
],
"tokenizer": "whitespace"
}
},
"char_filter": {
"split_by_whitespace_filter": {
"type": "pattern_replace",
"pattern": "(.+?)",
"replacement": "$1 "
}
"analysis": {
"normalizer": {
"my_normalizer": {
"type": "custom",
"char_filter": [],
"filter": [
"lowercase",
"asciifolding"
]
}
}
},
"mappings": {
"like_search_type": {
"properties": {
"name": {
"type": "text",
"analyzer": "char_analyzer"
}
},
"analyzer": {
"char_analyzer": {
"char_filter": [
"split_by_whitespace_filter"
],
"tokenizer": "whitespace"
}
},
"char_filter": {
"split_by_whitespace_filter": {
"type": "pattern_replace",
"pattern": "(.+?)",
"replacement": "$1 "
}
}
}
}
}

View File

@ -1,9 +1,9 @@
#redis<69><73><EFBFBD><EFBFBD>
redis.host=122.51.194.184
# redis.host=127.0.0.1
# redis.host=122.51.194.184
redis.host=127.0.0.1
#<23><><EFBFBD><EFBFBD>single <20><>Ⱥcluster
redis.mode=single
redis.port=26739
redis.port=6379
# redis.port=6379
redis.password=Aa112211
redis.maxIdle=100
@ -22,6 +22,6 @@ defaultCacheExpireTime=3600
fep.local.cache.capacity =10000
#cluster
cluster1.host.port=122.51.194.184: 26739
#cluster1.host.port=127.0.0.1:6379

View File

@ -204,4 +204,4 @@ function GetLunarDay(solarYear, solarMonth, solarDay) {
e2c(solarYear, solarMonth, solarDay);
return GetcDateString();
}
}
}