英译
This commit is contained in:
+1
-6
@@ -426,16 +426,11 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|清空附件 重新挂靠")
|
||||
@ApiOperation(value = "|SarBussionessStand|判断原文译文")
|
||||
@GetMapping("/emptyFileAnewStorage")
|
||||
public ResponseMessage emptyFileAnewStorage (){
|
||||
return sarBussionessStandEOService.emptyFileAnewStorage();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|远程文件下载")
|
||||
@GetMapping("/downloadFile")
|
||||
public ResponseMessage downloadFile (){
|
||||
return sarBussionessStandEOService.downloadFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ public class OldSystem {
|
||||
|
||||
private String buildId;
|
||||
|
||||
private String fileId;
|
||||
|
||||
|
||||
// 需要组合的数据
|
||||
private String attFileId;
|
||||
|
||||
-1
@@ -60,6 +60,5 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
|
||||
ResponseMessage<SarBussionessStand> importSarBussionessStandFile(MultipartFile file);
|
||||
|
||||
ResponseMessage downloadFile();
|
||||
}
|
||||
|
||||
|
||||
+296
-163
@@ -80,6 +80,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
|
||||
import lombok.SneakyThrows;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -104,10 +105,16 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.net.ssl.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.sql.Clob;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -2746,149 +2753,299 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
//att_file_01——att_file_10表,记录附件对应存储位置
|
||||
//
|
||||
|
||||
//当前 问题 仅仅对比文件名称 文件名称不一致的 则XX
|
||||
:
|
||||
*/
|
||||
// @Override
|
||||
// public ResponseMessage emptyFileAnewStorage() {
|
||||
// //1 查询 新系统的所有数据 其中包含为 国内 海外 获取到 DUILD_Id 字段用来对比
|
||||
// List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
// List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
// // 获取 kmpro_addon34 表的 lore_doc_id
|
||||
// List<OldSystem> oldSystemInfoList = sarStandardsInfoDao.selectOldSystemInfo();
|
||||
// //组合数据
|
||||
// List<OldSystem> oldArr = new ArrayList();
|
||||
// List<OldSystem> oldInfoArr = new ArrayList();
|
||||
// //文件id
|
||||
// List<String> fileIdList = new ArrayList<>();
|
||||
// //文件路径
|
||||
// List<String> fileSrcList = new ArrayList<>();
|
||||
// //国内海外
|
||||
// for (OldSystem oldSystem: oldSystemInfoList){
|
||||
// for (OldSystem SarStandardsInfo: SarStandardsInfoList){
|
||||
// //lore_doc_id 与 DUILD_Id
|
||||
// if(StringUtils.isNotBlank(SarStandardsInfo.getBuildId())){
|
||||
// if(oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())){
|
||||
// //查询文件是否是多个 是否存在
|
||||
// List<OldSystem> fileList = sarStandardsInfoDao.OldSystemFile(oldSystem.getLoreDocId());
|
||||
// if(!fileList.isEmpty()){
|
||||
// if(fileList.size()==1){
|
||||
// //判断文件是否存在 重新存入文件 获取id 存入att 表
|
||||
// OldSystem old = new OldSystem();
|
||||
// File file = new File(fileList.get(0).getFileSrc());
|
||||
// AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
// //文件id 和数据id
|
||||
// if(attFileVo != null) {
|
||||
// fileIdList.add(attFileVo.getId());
|
||||
// fileSrcList.add(fileList.get(0).getFileSrc());
|
||||
// old.setStandId(SarStandardsInfo.getStandId());
|
||||
// old.setSortSign(SarStandardsInfo.getSortSign());
|
||||
// //判断存入原本版本 还是译文版本
|
||||
// if (SarStandardsInfo.getSortSign().contains("译")) {
|
||||
// old.setTranslation(attFileVo.getId());
|
||||
// } else {
|
||||
// old.setOriginal(attFileVo.getId());
|
||||
// }
|
||||
// oldArr.add(old);
|
||||
// }
|
||||
// }else {
|
||||
// String yuan = "";
|
||||
// String yi = "";
|
||||
// OldSystem old = new OldSystem();
|
||||
// //每一个文件 都是一个英文版 或者译文版
|
||||
// // 如果每一个文件是 那我必然不能 这样子拼接
|
||||
// // 应该是先判断他是 英文版 还是译文版 然后再 去拼接
|
||||
// for (OldSystem src:fileList){
|
||||
// File file = new File(src.getFileSrc());
|
||||
// AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
// if(attFileVo != null) {
|
||||
// if (SarStandardsInfo.getSortSign().contains("译")) {
|
||||
// if (StringUtils.isNotBlank(yi)) {
|
||||
// yi = "," + attFileVo.getId();
|
||||
// } else {
|
||||
// yi = attFileVo.getId();
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(yi)) {
|
||||
// old.setTranslation(yi);
|
||||
// }
|
||||
// } else {
|
||||
// if (StringUtils.isNotBlank(yuan)) {
|
||||
// yuan = "," + attFileVo.getId();
|
||||
// } else {
|
||||
// yuan = attFileVo.getId();
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(yuan)) {
|
||||
// old.setOriginal(yuan);
|
||||
// }
|
||||
// }
|
||||
// fileSrcList.add(src.getFileSrc());
|
||||
// fileIdList.add(attFileVo.getId());
|
||||
// }
|
||||
// }
|
||||
// old.setStandId(SarStandardsInfo.getStandId());
|
||||
// oldArr.add(old);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 企业
|
||||
// for (OldSystem oldSystem: oldSystemInfoList){
|
||||
// for (OldSystem sarBussionessStand: SarBussionessStandList){
|
||||
// //lore_doc_id 与 DUILD_Id
|
||||
// if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){
|
||||
// if(oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())){
|
||||
// //查询文件是否是多个 是否存在
|
||||
// List<OldSystem> fileList = sarStandardsInfoDao.OldSystemFile(oldSystem.getLoreDocId());
|
||||
// if(!fileList.isEmpty()){
|
||||
// if(fileList.size()==1){
|
||||
// //判断文件是否存在 重新存入文件 获取id 存入att 表
|
||||
// OldSystem old = new OldSystem();
|
||||
// File file = new File(fileList.get(0).getFileSrc());
|
||||
// AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
// //文件id 和数据id
|
||||
// if(attFileVo != null) {
|
||||
// fileIdList.add(attFileVo.getId());
|
||||
// fileSrcList.add(fileList.get(0).getFileSrc());
|
||||
// old.setStandId(sarBussionessStand.getStandId());
|
||||
// old.setSortSign(sarBussionessStand.getSortSign());
|
||||
// //判断存入原本版本 还是译文版本
|
||||
// if (sarBussionessStand.getSortSign().contains("译")) {
|
||||
// old.setTranslation(attFileVo.getId());
|
||||
// } else {
|
||||
// old.setOriginal(attFileVo.getId());
|
||||
// }
|
||||
// oldInfoArr.add(old);
|
||||
// }
|
||||
// }else {
|
||||
// String yuan = "";
|
||||
// String yi = "";
|
||||
// OldSystem old = new OldSystem();
|
||||
// for (OldSystem src:fileList) {
|
||||
// File file = new File(src.getFileSrc());
|
||||
// AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
// if (attFileVo != null) {
|
||||
// if (sarBussionessStand.getSortSign().contains("译")) {
|
||||
// if (StringUtils.isNotBlank(yi)) {
|
||||
// yi = "," + attFileVo.getId();
|
||||
// } else {
|
||||
// yi = attFileVo.getId();
|
||||
// }
|
||||
// old.setTranslation(yi);
|
||||
// } else {
|
||||
// if (StringUtils.isNotBlank(yuan)) {
|
||||
// yuan = "," + attFileVo.getId();
|
||||
// } else {
|
||||
// yuan = attFileVo.getId();
|
||||
// }
|
||||
// old.setOriginal(yuan);
|
||||
// }
|
||||
// fileSrcList.add(src.getFileSrc());
|
||||
// fileIdList.add(attFileVo.getId());
|
||||
// }
|
||||
// }
|
||||
// old.setStandId(sarBussionessStand.getStandId());
|
||||
// oldInfoArr.add(old);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 获取完整数据以后 数据库 增加字段, 然后区分是否是译文 原文 然后 进行保存 通过 id 可以找到对应的数据
|
||||
// // 企业
|
||||
// for(OldSystem data : oldInfoArr) {
|
||||
// SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo();
|
||||
// String id = sarBussStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
// if(StringUtils.isNotBlank(id)) {
|
||||
// sarBussStandAttrInfo.setId(id);
|
||||
// sarBussStandAttrInfo.setFbgbuss(data.getOriginal());
|
||||
// sarBussStandAttrInfo.setTranslation(data.getTranslation());
|
||||
// }
|
||||
// sarBussStandAttrInfoEODao.updateById(sarBussStandAttrInfo);
|
||||
// }
|
||||
// //海外 国内
|
||||
// for(OldSystem data : oldInfoArr) {
|
||||
// SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
|
||||
// String id = sarStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
// if(StringUtils.isNotBlank(id)) {
|
||||
// sarStandAttrInfo.setId(id);
|
||||
// sarStandAttrInfo.setFbgbjbd(data.getOriginal());
|
||||
// sarStandAttrInfo.setTranslation(data.getTranslation());
|
||||
// }
|
||||
// sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
// }
|
||||
// return Result.success();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ResponseMessage emptyFileAnewStorage() {
|
||||
//1 查询 新系统的所有数据 其中包含为 国内 海外 获取到 DUILD_Id 字段用来对比
|
||||
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
// 获取 kmpro_addon34 表的 lore_doc_id
|
||||
List<OldSystem> oldSystemInfoList = sarStandardsInfoDao.selectOldSystemInfo();
|
||||
//组合数据
|
||||
List<OldSystem> oldArr = new ArrayList();
|
||||
List<OldSystem> oldInfoArr = new ArrayList();
|
||||
//文件id
|
||||
List<String> fileIdList = new ArrayList<>();
|
||||
//文件路径
|
||||
List<String> fileSrcList = new ArrayList<>();
|
||||
//国内海外
|
||||
for (OldSystem oldSystem: oldSystemInfoList){
|
||||
for (OldSystem SarStandardsInfo: SarStandardsInfoList){
|
||||
//lore_doc_id 与 DUILD_Id
|
||||
if(StringUtils.isNotBlank(SarStandardsInfo.getBuildId())){
|
||||
if(oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())){
|
||||
//查询文件是否是多个 是否存在
|
||||
List<OldSystem> fileList = sarStandardsInfoDao.OldSystemFile(oldSystem.getLoreDocId());
|
||||
if(!fileList.isEmpty()){
|
||||
if(fileList.size()==1){
|
||||
//判断文件是否存在 重新存入文件 获取id 存入att 表
|
||||
OldSystem old = new OldSystem();
|
||||
File file = new File(fileList.get(0).getFileSrc());
|
||||
AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
//文件id 和数据id
|
||||
if(attFileVo != null) {
|
||||
fileIdList.add(attFileVo.getId());
|
||||
fileSrcList.add(fileList.get(0).getFileSrc());
|
||||
old.setStandId(SarStandardsInfo.getStandId());
|
||||
old.setSortSign(SarStandardsInfo.getSortSign());
|
||||
//判断存入原本版本 还是译文版本
|
||||
if (SarStandardsInfo.getSortSign().contains("译")) {
|
||||
old.setTranslation(attFileVo.getId());
|
||||
} else {
|
||||
old.setOriginal(attFileVo.getId());
|
||||
}
|
||||
oldArr.add(old);
|
||||
}
|
||||
}else {
|
||||
String yuan = "";
|
||||
String yi = "";
|
||||
OldSystem old = new OldSystem();
|
||||
//每一个文件 都是一个英文版 或者译文版
|
||||
// 如果每一个文件是 那我必然不能 这样子拼接
|
||||
// 应该是先判断他是 英文版 还是译文版 然后再 去拼接
|
||||
for (OldSystem src:fileList){
|
||||
File file = new File(src.getFileSrc());
|
||||
AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
if(attFileVo != null) {
|
||||
if (SarStandardsInfo.getSortSign().contains("译")) {
|
||||
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
// 获取 kmpro_addon34 表的 lore_doc_id
|
||||
List<OldSystem> oldSystemInfoList = sarStandardsInfoDao.selectOldSystemInfo();
|
||||
|
||||
//获取所有的文件表信息
|
||||
List<OldSystem> loreAttacheList = sarStandardsInfoDao.selectOldSystemFile();
|
||||
|
||||
//数据组合
|
||||
List<OldSystem> oldArr = new ArrayList();
|
||||
List<OldSystem> oldArr1 = new ArrayList();
|
||||
|
||||
//海外国内的文件数据处理 处理逻辑对比 文件的名称 一致的情况下 则看老数据库 是否有对应的分类 原文 译文
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
for (OldSystem SarStandardsInfo: SarStandardsInfoList){
|
||||
if(StringUtils.isNotBlank(SarStandardsInfo.getBuildId())){
|
||||
if(oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if(StringUtils.isNotBlank(SarStandardsInfo.getFileId())){
|
||||
String[] fileIdArr = SarStandardsInfo.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if(asList.size()>0) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), loreAttacheList);
|
||||
if(theSame.equals("1")){
|
||||
//证明找到文件名称一致的了
|
||||
//获取到 lode 表 id
|
||||
//原文译文 进行判断
|
||||
if (oldSystem.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + attFileVo.getId();
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = attFileVo.getId();
|
||||
}
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
old.setTranslation(yi);
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + attFileVo.getId();
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = attFileVo.getId();
|
||||
}
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
old.setOriginal(yuan);
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
fileSrcList.add(src.getFileSrc());
|
||||
fileIdList.add(attFileVo.getId());
|
||||
}
|
||||
}
|
||||
old.setStandId(SarStandardsInfo.getStandId());
|
||||
oldArr.add(old);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 企业
|
||||
for (OldSystem oldSystem: oldSystemInfoList){
|
||||
for (OldSystem sarBussionessStand: SarBussionessStandList){
|
||||
//lore_doc_id 与 DUILD_Id
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){
|
||||
if(oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())){
|
||||
//查询文件是否是多个 是否存在
|
||||
List<OldSystem> fileList = sarStandardsInfoDao.OldSystemFile(oldSystem.getLoreDocId());
|
||||
if(!fileList.isEmpty()){
|
||||
if(fileList.size()==1){
|
||||
//判断文件是否存在 重新存入文件 获取id 存入att 表
|
||||
OldSystem old = new OldSystem();
|
||||
File file = new File(fileList.get(0).getFileSrc());
|
||||
AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
//文件id 和数据id
|
||||
if(attFileVo != null) {
|
||||
fileIdList.add(attFileVo.getId());
|
||||
fileSrcList.add(fileList.get(0).getFileSrc());
|
||||
old.setStandId(sarBussionessStand.getStandId());
|
||||
old.setSortSign(sarBussionessStand.getSortSign());
|
||||
//判断存入原本版本 还是译文版本
|
||||
if (sarBussionessStand.getSortSign().contains("译")) {
|
||||
old.setTranslation(attFileVo.getId());
|
||||
} else {
|
||||
old.setOriginal(attFileVo.getId());
|
||||
}
|
||||
oldInfoArr.add(old);
|
||||
}
|
||||
}else {
|
||||
String yuan = "";
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
old.setTranslation(yi);
|
||||
}
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
old.setOriginal(yuan);
|
||||
}
|
||||
if(StringUtils.isNotBlank(yi) || StringUtils.isNotBlank(yuan)){
|
||||
old.setStandId(SarStandardsInfo.getStandId());
|
||||
oldArr.add(old);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//企业的文件数据处理
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
for (OldSystem sarBussionessStand : SarBussionessStandList){
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){
|
||||
if(oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getFileId())){
|
||||
String[] fileIdArr = sarBussionessStand.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if(asList.size()>0) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
for (OldSystem src:fileList) {
|
||||
File file = new File(src.getFileSrc());
|
||||
AttFileVo attFileVo = attFileEOService.saveFileInfo(file);
|
||||
if (attFileVo != null) {
|
||||
if (sarBussionessStand.getSortSign().contains("译")) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), loreAttacheList);
|
||||
if(theSame.equals("1")){
|
||||
//证明找到文件名称一致的了
|
||||
//原文译文 进行判断
|
||||
if (oldSystem.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + attFileVo.getId();
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = attFileVo.getId();
|
||||
yi = fileId;
|
||||
}
|
||||
old.setTranslation(yi);
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + attFileVo.getId();
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = attFileVo.getId();
|
||||
yuan = fileId;
|
||||
}
|
||||
old.setOriginal(yuan);
|
||||
|
||||
}
|
||||
fileSrcList.add(src.getFileSrc());
|
||||
fileIdList.add(attFileVo.getId());
|
||||
}
|
||||
}
|
||||
old.setStandId(sarBussionessStand.getStandId());
|
||||
oldInfoArr.add(old);
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
old.setTranslation(yi);
|
||||
}
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
old.setOriginal(yuan);
|
||||
}
|
||||
if(StringUtils.isNotBlank(yi) || StringUtils.isNotBlank(yuan)){
|
||||
old.setStandId(sarBussionessStand.getStandId());
|
||||
oldArr.add(old);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2896,9 +3053,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
|
||||
// 获取完整数据以后 数据库 增加字段, 然后区分是否是译文 原文 然后 进行保存 通过 id 可以找到对应的数据
|
||||
// 企业
|
||||
for(OldSystem data : oldInfoArr) {
|
||||
for(OldSystem data : oldArr1) {
|
||||
SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo();
|
||||
String id = sarBussStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
@@ -2906,10 +3062,11 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
sarBussStandAttrInfo.setFbgbuss(data.getOriginal());
|
||||
sarBussStandAttrInfo.setTranslation(data.getTranslation());
|
||||
}
|
||||
sarBussStandAttrInfoEODao.updateById(sarBussStandAttrInfo);
|
||||
//sarBussStandAttrInfoEODao.updateById(sarBussStandAttrInfo);
|
||||
logger.info("企业修改成功");
|
||||
}
|
||||
//海外 国内
|
||||
for(OldSystem data : oldInfoArr) {
|
||||
for(OldSystem data : oldArr) {
|
||||
SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
|
||||
String id = sarStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
@@ -2917,52 +3074,28 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
sarStandAttrInfo.setFbgbjbd(data.getOriginal());
|
||||
sarStandAttrInfo.setTranslation(data.getTranslation());
|
||||
}
|
||||
sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
//sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
logger.info("海外国内修改成功");
|
||||
}
|
||||
//文件删除
|
||||
// for (String s : fileSrcList){
|
||||
// File file = new File(s);
|
||||
// file.delete();
|
||||
// }
|
||||
return Result.success();
|
||||
}
|
||||
@Override
|
||||
public ResponseMessage downloadFile() {
|
||||
//查询
|
||||
//List<OldSystem> oldSystems = sarStandardsInfoDao.selectOldSystemFile();
|
||||
//for (OldSystem src : oldSystems){
|
||||
String i = saveFile("");
|
||||
if(i.equals("-1")){
|
||||
return Result.error();
|
||||
}
|
||||
//}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
public String saveFile(String src) {
|
||||
//主服务 G:\kmpro_futian\htdocs\UploadFile
|
||||
// 测试服务 E:\kmpro_futian\htdocs\UploadFile
|
||||
// 本地服务
|
||||
String filePath = "https:10.0.3.21/E://srcul";
|
||||
//String filePath = "https:10.0.11.1//E://kmpro_futian/htdocs/";
|
||||
src = "全球标准法规系统需求(1)(1).docx";
|
||||
try {
|
||||
URL url = new URL(filePath);
|
||||
File file = new File(filePath,src);
|
||||
try {
|
||||
FileUtils.copyURLToFile(url,file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("文件下载错误");
|
||||
return "-1";
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("文件下载错误");
|
||||
return "-1";
|
||||
public String isTheSame (String oldFileName,List<OldSystem> loreAttacheList){
|
||||
if(loreAttacheList.size()>0){
|
||||
for (OldSystem src : loreAttacheList) {
|
||||
if(StringUtils.isNotBlank(src.getFileSrc())){
|
||||
// 通过 / 去分割 / 的最后一位
|
||||
String[] split = src.getFileSrc().split("/");
|
||||
List<String> asList = Arrays.asList(split);
|
||||
//集合的最后一个就是名称
|
||||
int size = asList.size();
|
||||
String s = asList.get(size-1);
|
||||
if (s.equals(oldFileName)){
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "1";
|
||||
return "-1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.keepsoft.devbase.core.util;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import javax.net.ssl.*;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
/**
|
||||
* 此工具类用来解决,请求https时,ssl证书的问题
|
||||
*/
|
||||
public class SslUtils {
|
||||
|
||||
private static void trustAllHttpsCertificates() throws Exception {
|
||||
TrustManager[] trustAllCerts = new TrustManager[1];
|
||||
TrustManager tm = new miTM();
|
||||
trustAllCerts[0] = tm;
|
||||
SSLContext sc = SSLContext.getInstance("SSL");
|
||||
sc.init(null, trustAllCerts, null);
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略HTTPS请求的SSL证书,必须在openConnection之前调用
|
||||
* @throws Exception
|
||||
*/
|
||||
@SneakyThrows
|
||||
public static void ignoreSsl() {
|
||||
HostnameVerifier hv = new HostnameVerifier() {
|
||||
public boolean verify(String urlHostName, SSLSession session) {
|
||||
System.out.println("Warning: URL Host: " + urlHostName + " vs. " + session.getPeerHost());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
trustAllHttpsCertificates();
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(hv);
|
||||
}
|
||||
|
||||
static class miTM implements TrustManager, X509TrustManager {
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
public boolean isServerTrusted(X509Certificate[] certs) {
|
||||
return true;
|
||||
}
|
||||
public boolean isClientTrusted(X509Certificate[] certs) {
|
||||
return true;
|
||||
}
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType)
|
||||
throws CertificateException {
|
||||
return;
|
||||
}
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType)
|
||||
throws CertificateException {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+2
-1
@@ -1229,7 +1229,8 @@
|
||||
SELECT
|
||||
std.id as 'standId',
|
||||
std.BUILD_ID as 'buildId',
|
||||
att.id as 'attfid'
|
||||
att.id as 'attfid',
|
||||
att.FBGBUSS as 'fileId'
|
||||
from sar_bussioness_stand std
|
||||
left JOIN sar_buss_stand_attr_info att on std.id = att.STAND_ID
|
||||
</select>
|
||||
|
||||
+6
-6
@@ -1891,20 +1891,20 @@
|
||||
<select id="selectOldSystemInfo" resultType="com.adc.da.slrs.sarBussionessStand.entity.OldSystem">
|
||||
SELECT
|
||||
km.lore_doc_id as 'loreDocId',
|
||||
lo.Sign as 'fileSign',
|
||||
km.sort_id as 'sortId',
|
||||
lo.Src as 'fileSrc',
|
||||
so.id as 'sortId',
|
||||
so.Sign as 'sortSign'
|
||||
ld.Sign as 'sortSign'
|
||||
from kmpro_addon34 km
|
||||
left JOIN lore_attache lo on km.lore_doc_id = lo.LoreDocID
|
||||
left JOIN lore_depot_sort so on km.sort_id = so.id
|
||||
left JOIN lore_attache lo on km.lore_doc_id = lo.id
|
||||
left JOIN lore_depot_sort ld on km.sort_id = ld.id
|
||||
</select>
|
||||
|
||||
<select id="selectListInfo" resultType="com.adc.da.slrs.sarBussionessStand.entity.OldSystem">
|
||||
SELECT
|
||||
std.id as 'standId',
|
||||
std.BUILD_ID as 'buildId',
|
||||
att.id as 'attfid'
|
||||
att.id as 'attfid',
|
||||
att.FBGBJBD as 'fileId'
|
||||
from sar_standards_info std
|
||||
left JOIN sar_stand_attr_info att on std.id = att.STAND_ID
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user