译文原文问题(返回文件有名称重复,代码优化)
This commit is contained in:
+3
@@ -47,4 +47,7 @@ public interface SarBussStandAttrInfoDao extends BaseMapper<SarBussStandAttrInfo
|
||||
|
||||
void updateFSQR(@Param("id") String id,@Param("time") String time);
|
||||
|
||||
void updateByIdInfo(@Param("id")String id,@Param("fbgbuss") String fbgbuss,@Param("translation") String translation);
|
||||
|
||||
String selectInfoStandId(@Param("standId") String standId);
|
||||
}
|
||||
|
||||
+414
-90
@@ -2761,9 +2761,279 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
Set<AttFileEO> fileEOArrayList= new HashSet<>();
|
||||
//海外国内的文件数据处理 处理逻辑对比 文件的名称 一致的情况下 则看老数据库 是否有对应的分类 原文 译文
|
||||
if(type.equals("海外")) {
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo("FOREIGN");
|
||||
for (OldSystem SarStandardsInfo : SarStandardsInfoList) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
if (StringUtils.isNotBlank(SarStandardsInfo.getBuildId())) {
|
||||
if(SarStandardsInfo.getBuildId().contains(",")){
|
||||
String[] buildIdArr = SarStandardsInfo.getBuildId().split(",");
|
||||
List<String> buildIdList = Arrays.asList(buildIdArr);
|
||||
if(!buildIdList.isEmpty()){
|
||||
for (String bid: buildIdList){
|
||||
List<OldSystem> OldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(bid);
|
||||
OldSystem oldSystem =OldSystem1.get(0);
|
||||
if (oldSystem.getLoreDocId().equals(bid)) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if (StringUtils.isNotBlank(SarStandardsInfo.getFileId())) {
|
||||
if(SarStandardsInfo.getFileId().contains(",")) {
|
||||
String[] fileIdArr = SarStandardsInfo.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if (asList.size() > 0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(),bid);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO : attFileEOS) {
|
||||
fileEO.setResId("h-" + SarStandardsInfo.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = SarStandardsInfo.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), bid);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yi = SarStandardsInfo.getFileId();
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yuan = SarStandardsInfo.getFileId();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
List<OldSystem> OldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(SarStandardsInfo.getBuildId());
|
||||
OldSystem oldSystem =OldSystem1.get(0);
|
||||
if (oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if (StringUtils.isNotBlank(SarStandardsInfo.getFileId())) {
|
||||
if(SarStandardsInfo.getFileId().contains(",")) {
|
||||
String[] fileIdArr = SarStandardsInfo.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if (asList.size() > 0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), SarStandardsInfo.getBuildId());
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO : attFileEOS) {
|
||||
fileEO.setResId("h-" + SarStandardsInfo.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = SarStandardsInfo.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), SarStandardsInfo.getBuildId());
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yi = SarStandardsInfo.getFileId();
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yuan = SarStandardsInfo.getFileId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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 data : oldArr) {
|
||||
SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
|
||||
String id = sarStandAttrInfoEODao.selectInfoStandId(data.getStandId());
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sarStandAttrInfo.setId(id);
|
||||
sarStandAttrInfo.setFbgbjbd(data.getOriginal());
|
||||
sarStandAttrInfo.setTranslation(data.getTranslation());
|
||||
}
|
||||
sarStandAttrInfoEODao.updateByIdInfo(id,sarStandAttrInfo.getFbgbjbd(),sarStandAttrInfo.getTranslation());
|
||||
logger.info("海外修改成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(type.equals("国内")) {
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo("INLAND");
|
||||
for (OldSystem SarStandardsInfo : SarStandardsInfoList) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
if (StringUtils.isNotBlank(SarStandardsInfo.getBuildId())) {
|
||||
if(SarStandardsInfo.getBuildId().contains(",")){
|
||||
String[] buildIdArr = SarStandardsInfo.getBuildId().split(",");
|
||||
List<String> buildIdList = Arrays.asList(buildIdArr);
|
||||
if(!buildIdList.isEmpty()){
|
||||
for (String bid: buildIdList){
|
||||
List<OldSystem> OldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(bid);
|
||||
OldSystem oldSystem =OldSystem1.get(0);
|
||||
if (oldSystem.getLoreDocId().equals(bid)) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if (StringUtils.isNotBlank(SarStandardsInfo.getFileId())) {
|
||||
if(SarStandardsInfo.getFileId().contains(",")) {
|
||||
String[] fileIdArr = SarStandardsInfo.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if (asList.size() > 0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(),bid);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO : attFileEOS) {
|
||||
fileEO.setResId("h-" + SarStandardsInfo.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = SarStandardsInfo.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), bid);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yi = SarStandardsInfo.getFileId();
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + SarStandardsInfo.getFileId();
|
||||
} else {
|
||||
yuan = SarStandardsInfo.getFileId();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
List<OldSystem> OldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(SarStandardsInfo.getBuildId());
|
||||
OldSystem oldSystem =OldSystem1.get(0);
|
||||
if (oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())) {
|
||||
@@ -2776,9 +3046,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
@@ -2804,16 +3071,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO : attFileEOS) {
|
||||
@@ -2823,10 +3080,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
}else {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = SarStandardsInfo.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
@@ -2847,110 +3100,179 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
} else {
|
||||
yuan = SarStandardsInfo.getFileId();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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 data : oldArr) {
|
||||
SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
|
||||
String id = sarStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
String id = sarStandAttrInfoEODao.selectInfoStandId(data.getStandId());
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sarStandAttrInfo.setId(id);
|
||||
sarStandAttrInfo.setFbgbjbd(data.getOriginal());
|
||||
sarStandAttrInfo.setTranslation(data.getTranslation());
|
||||
}
|
||||
sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
logger.info("海外国内修改成功");
|
||||
sarStandAttrInfoEODao.updateByIdInfo(id,sarStandAttrInfo.getFbgbjbd(),sarStandAttrInfo.getTranslation());
|
||||
logger.info("国内修改成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(type.equals("企业")){
|
||||
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
//企业的文件数据处理
|
||||
for (OldSystem sarBussionessStand: SarBussionessStandList){
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
// 通过 关联id 去查询这条数据 查询到 即当前数据
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){
|
||||
List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(sarBussionessStand.getBuildId());
|
||||
OldSystem oldSystem =oldSystem1.get(0);
|
||||
if(oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getFileId())){
|
||||
if(sarBussionessStand.getFileId().contains(",")){
|
||||
String[] fileIdArr = sarBussionessStand.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if(asList.size()>0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if(attFileEOS.isEmpty()) {
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
for (String fileId : asList) {
|
||||
if(sarBussionessStand.getBuildId().contains(",")){
|
||||
String[] buildIdArr = sarBussionessStand.getBuildId().split(",");
|
||||
List<String> buildIdList = Arrays.asList(buildIdArr);
|
||||
if(!buildIdList.isEmpty()){
|
||||
for (String bId: buildIdList){
|
||||
List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(bId);
|
||||
OldSystem oldSystem =oldSystem1.get(0);
|
||||
if(oldSystem.getLoreDocId().equals(bId)) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getFileId())){
|
||||
if(sarBussionessStand.getFileId().contains(",")){
|
||||
String[] fileIdArr = sarBussionessStand.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if(asList.size()>0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if(attFileEOS.isEmpty()) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(),bId);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO:attFileEOS) {
|
||||
//记录重复 此id企业或者海外的id
|
||||
fileEO.setResId("q-"+sarBussionessStand.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
String id = sarBussionessStand.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), sarBussionessStand.getBuildId());
|
||||
String theSame = isTheSame(byId.getOldFileName(), bId);
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
yi = "," + sarBussionessStand.getFileId();
|
||||
} else {
|
||||
yi = fileId;
|
||||
yi = sarBussionessStand.getFileId();
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
yuan = "," + sarBussionessStand.getFileId();
|
||||
} else {
|
||||
yuan = fileId;
|
||||
yuan = sarBussionessStand.getFileId();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
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());
|
||||
oldArr1.add(old);
|
||||
}
|
||||
}else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO:attFileEOS) {
|
||||
//记录重复 此id企业或者海外的id
|
||||
fileEO.setResId("q-"+sarBussionessStand.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
String yi = "";
|
||||
String yuan = "";
|
||||
OldSystem old = new OldSystem();
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
}
|
||||
}
|
||||
}else {
|
||||
List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(sarBussionessStand.getBuildId());
|
||||
OldSystem oldSystem = oldSystem1.get(0);
|
||||
if (oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())) {
|
||||
//通过,号分割文件,通过id去查询文件 获取文件名称
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getFileId())) {
|
||||
if (sarBussionessStand.getFileId().contains(",")) {
|
||||
String[] fileIdArr = sarBussionessStand.getFileId().split(",");
|
||||
List<String> asList = Arrays.asList(fileIdArr);
|
||||
if (asList.size() > 0) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
for (String fileId : asList) {
|
||||
//循环调用每一个 文件 获取文件名称
|
||||
String id = fileId;
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), sarBussionessStand.getBuildId());
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
} else {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//记录 同一条数据名称一样的
|
||||
for (AttFileEO fileEO : attFileEOS) {
|
||||
//记录重复 此id企业或者海外的id
|
||||
fileEO.setResId("q-" + sarBussionessStand.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
String id = sarBussionessStand.getFileId();
|
||||
AttFileEO byId = attFileEOService.getFileInfo(id);
|
||||
String theSame = isTheSame(byId.getOldFileName(), sarBussionessStand.getBuildId());
|
||||
@@ -2973,31 +3295,33 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
|
||||
}
|
||||
}
|
||||
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());
|
||||
oldArr1.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());
|
||||
oldArr1.add(old);
|
||||
}
|
||||
}
|
||||
// 企业
|
||||
for(OldSystem data : oldArr1) {
|
||||
SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo();
|
||||
String id = sarBussStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId());
|
||||
String id = sarBussStandAttrInfoEODao.selectInfoStandId(data.getStandId());
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sarBussStandAttrInfo.setId(id);
|
||||
sarBussStandAttrInfo.setFbgbuss(data.getOriginal());
|
||||
sarBussStandAttrInfo.setTranslation(data.getTranslation());
|
||||
}
|
||||
sarBussStandAttrInfoEODao.updateById(sarBussStandAttrInfo);
|
||||
sarBussStandAttrInfoEODao.updateByIdInfo(id,sarBussStandAttrInfo.getFbgbuss(),sarBussStandAttrInfo.getTranslation());
|
||||
logger.info("企业修改成功");
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -41,4 +41,8 @@ public interface SarStandAttrInfoDao extends BaseMapper<SarStandAttrInfo> {
|
||||
String selectFieldValByStandId(@Param("field") String field, @Param("standId") String standId);
|
||||
|
||||
List<SelectionResult> selectFieldValByContainsVal(@Param("field") String field, @Param("value") String value, @Param("standIds") List<String> standIds);
|
||||
|
||||
void updateByIdInfo(@Param("id")String id,@Param("fbgbjbd") String fbgbuss,@Param("translation") String translation);
|
||||
|
||||
String selectInfoStandId(@Param("standId")String standId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<DSarStandardDTO> dealWithDS(@Param("type") String standType, @Param("status")List<String> strings);
|
||||
|
||||
List<OldSystem> selectListInfo();
|
||||
List<OldSystem> selectListInfo(@Param("type") String type);
|
||||
|
||||
List<OldSystem> OldSystemFile(@Param("loreDocId") String loreDocId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user