译文原文问题(返回文件有名称重复,代码优化)

This commit is contained in:
gaojiabao
2023-03-14 11:34:20 +08:00
parent f398caa0eb
commit cf570dbe6c
7 changed files with 446 additions and 91 deletions
@@ -47,4 +47,7 @@ public interface SarBussStandAttrInfoDao extends BaseMapper<SarBussStandAttrInfo
void updateFSQR(@Param("id") String id,@Param("time") String time); 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);
} }
@@ -2761,9 +2761,279 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
Set<AttFileEO> fileEOArrayList= new HashSet<>(); Set<AttFileEO> fileEOArrayList= new HashSet<>();
//海外国内的文件数据处理 处理逻辑对比 文件的名称 一致的情况下 则看老数据库 是否有对应的分类 原文 译文 //海外国内的文件数据处理 处理逻辑对比 文件的名称 一致的情况下 则看老数据库 是否有对应的分类 原文 译文
if(type.equals("海外")) { if(type.equals("海外")) {
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo(); List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo("FOREIGN");
for (OldSystem SarStandardsInfo : SarStandardsInfoList) { for (OldSystem SarStandardsInfo : SarStandardsInfoList) {
String yi = "";
String yuan = "";
OldSystem old = new OldSystem();
if (StringUtils.isNotBlank(SarStandardsInfo.getBuildId())) { 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()); List<OldSystem> OldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(SarStandardsInfo.getBuildId());
OldSystem oldSystem =OldSystem1.get(0); OldSystem oldSystem =OldSystem1.get(0);
if (oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())) { if (oldSystem.getLoreDocId().equals(SarStandardsInfo.getBuildId())) {
@@ -2776,9 +3046,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走 // 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
List<AttFileEO> attFileEOS = newFileNameRepetition(asList); List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
if (attFileEOS.isEmpty()) { if (attFileEOS.isEmpty()) {
String yi = "";
String yuan = "";
OldSystem old = new OldSystem();
for (String fileId : asList) { for (String fileId : asList) {
//循环调用每一个 文件 获取文件名称 //循环调用每一个 文件 获取文件名称
String id = fileId; 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 { } else {
//记录 同一条数据名称一样的 //记录 同一条数据名称一样的
for (AttFileEO fileEO : attFileEOS) { for (AttFileEO fileEO : attFileEOS) {
@@ -2823,10 +3080,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
} }
}else { }else {
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
String yi = "";
String yuan = "";
OldSystem old = new OldSystem();
//循环调用每一个 文件 获取文件名称 //循环调用每一个 文件 获取文件名称
String id = SarStandardsInfo.getFileId(); String id = SarStandardsInfo.getFileId();
AttFileEO byId = attFileEOService.getFileInfo(id); AttFileEO byId = attFileEOService.getFileInfo(id);
@@ -2847,110 +3100,179 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} else { } else {
yuan = SarStandardsInfo.getFileId(); 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) { for(OldSystem data : oldArr) {
SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo(); SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
String id = sarStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId()); String id = sarStandAttrInfoEODao.selectInfoStandId(data.getStandId());
if(StringUtils.isNotBlank(id)) { if(StringUtils.isNotBlank(id)) {
sarStandAttrInfo.setId(id); sarStandAttrInfo.setId(id);
sarStandAttrInfo.setFbgbjbd(data.getOriginal()); sarStandAttrInfo.setFbgbjbd(data.getOriginal());
sarStandAttrInfo.setTranslation(data.getTranslation()); sarStandAttrInfo.setTranslation(data.getTranslation());
} }
sarStandAttrInfoEODao.updateById(sarStandAttrInfo); sarStandAttrInfoEODao.updateByIdInfo(id,sarStandAttrInfo.getFbgbjbd(),sarStandAttrInfo.getTranslation());
logger.info("海外国内修改成功"); logger.info("国内修改成功");
} }
} }
if(type.equals("企业")){ if(type.equals("企业")){
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo(); List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
//企业的文件数据处理 //企业的文件数据处理
for (OldSystem sarBussionessStand: SarBussionessStandList){ for (OldSystem sarBussionessStand: SarBussionessStandList){
String yi = "";
String yuan = "";
OldSystem old = new OldSystem();
// 通过 关联id 去查询这条数据 查询到 即当前数据 // 通过 关联id 去查询这条数据 查询到 即当前数据
if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){ if(StringUtils.isNotBlank(sarBussionessStand.getBuildId())){
List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(sarBussionessStand.getBuildId()); if(sarBussionessStand.getBuildId().contains(",")){
OldSystem oldSystem =oldSystem1.get(0); String[] buildIdArr = sarBussionessStand.getBuildId().split(",");
if(oldSystem.getLoreDocId().equals(sarBussionessStand.getBuildId())) { List<String> buildIdList = Arrays.asList(buildIdArr);
//通过,号分割文件,通过id去查询文件 获取文件名称 if(!buildIdList.isEmpty()){
if(StringUtils.isNotBlank(sarBussionessStand.getFileId())){ for (String bId: buildIdList){
if(sarBussionessStand.getFileId().contains(",")){ List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(bId);
String[] fileIdArr = sarBussionessStand.getFileId().split(","); OldSystem oldSystem =oldSystem1.get(0);
List<String> asList = Arrays.asList(fileIdArr); if(oldSystem.getLoreDocId().equals(bId)) {
if(asList.size()>0) { //通过,号分割文件,通过id去查询文件 获取文件名称
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走 if(StringUtils.isNotBlank(sarBussionessStand.getFileId())){
List<AttFileEO> attFileEOS = newFileNameRepetition(asList); if(sarBussionessStand.getFileId().contains(",")){
if(attFileEOS.isEmpty()) { String[] fileIdArr = sarBussionessStand.getFileId().split(",");
String yi = ""; List<String> asList = Arrays.asList(fileIdArr);
String yuan = ""; if(asList.size()>0) {
OldSystem old = new OldSystem(); // 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
for (String fileId : asList) { 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); AttFileEO byId = attFileEOService.getFileInfo(id);
String theSame = isTheSame(byId.getOldFileName(), sarBussionessStand.getBuildId()); String theSame = isTheSame(byId.getOldFileName(), bId);
if (theSame.equals("1")) { if (theSame.equals("1")) {
//证明找到文件名称一致的了 //证明找到文件名称一致的了
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId()); OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
//原文译文 进行判断 //原文译文 进行判断
if (sortSign.getSortSign().contains("译")) { if (sortSign.getSortSign().contains("译")) {
if (StringUtils.isNotBlank(yi)) { if (StringUtils.isNotBlank(yi)) {
yi = "," + fileId; yi = "," + sarBussionessStand.getFileId();
} else { } else {
yi = fileId; yi = sarBussionessStand.getFileId();
} }
} else { } else {
if (StringUtils.isNotBlank(yuan)) { if (StringUtils.isNotBlank(yuan)) {
yuan = "," + fileId; yuan = "," + sarBussionessStand.getFileId();
} else { } 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 = ""; }else {
String yuan = ""; List<OldSystem> oldSystem1 = sarStandardsInfoDao.selectOldSystemInfoByBuidId(sarBussionessStand.getBuildId());
OldSystem old = new OldSystem(); 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(); String id = sarBussionessStand.getFileId();
AttFileEO byId = attFileEOService.getFileInfo(id); AttFileEO byId = attFileEOService.getFileInfo(id);
String theSame = isTheSame(byId.getOldFileName(), sarBussionessStand.getBuildId()); 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) { for(OldSystem data : oldArr1) {
SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo(); SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo();
String id = sarBussStandAttrInfoEODao.selectFieldValByStandId("id", data.getStandId()); String id = sarBussStandAttrInfoEODao.selectInfoStandId(data.getStandId());
if(StringUtils.isNotBlank(id)) { if(StringUtils.isNotBlank(id)) {
sarBussStandAttrInfo.setId(id); sarBussStandAttrInfo.setId(id);
sarBussStandAttrInfo.setFbgbuss(data.getOriginal()); sarBussStandAttrInfo.setFbgbuss(data.getOriginal());
sarBussStandAttrInfo.setTranslation(data.getTranslation()); sarBussStandAttrInfo.setTranslation(data.getTranslation());
} }
sarBussStandAttrInfoEODao.updateById(sarBussStandAttrInfo); sarBussStandAttrInfoEODao.updateByIdInfo(id,sarBussStandAttrInfo.getFbgbuss(),sarBussStandAttrInfo.getTranslation());
logger.info("企业修改成功"); logger.info("企业修改成功");
} }
} }
@@ -41,4 +41,8 @@ public interface SarStandAttrInfoDao extends BaseMapper<SarStandAttrInfo> {
String selectFieldValByStandId(@Param("field") String field, @Param("standId") String standId); 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); 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);
} }
@@ -100,7 +100,7 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
List<DSarStandardDTO> dealWithDS(@Param("type") String standType, @Param("status")List<String> strings); 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); List<OldSystem> OldSystemFile(@Param("loreDocId") String loreDocId);
@@ -241,4 +241,15 @@
</if> </if>
</select> </select>
<update id="updateByIdInfo" >
update SAR_STAND_ATTR_INFO set FBGBJBD = #{fbgbjbd}, TRANSLATION = #{translation}
where stand_id = #{standId}
</update>
<select id="selectInfoStandId" resultType="java.lang.String" parameterType="java.lang.String">
SELECT id
FROM SAR_STAND_ATTR_INFO
WHERE stand_id = #{standId} and valid_flag=0
</select>
</mapper> </mapper>
@@ -167,5 +167,15 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateByIdInfo">
update SAR_BUSS_STAND_ATTR_INFO set FBGBUSS = #{fbgbuss}, TRANSLATION = #{translation}
where ID = #{id}
</update>
<!-- 查询字段及对应数据-->
<select id="selectInfoStandId" resultType="java.lang.String" parameterType="java.lang.String">
SELECT id
FROM SAR_BUSS_STAND_ATTR_INFO
WHERE valid_flag=0 and stand_id = #{standId}
</select>
</mapper> </mapper>
@@ -1898,6 +1898,9 @@
left JOIN sar_stand_attr_info att on std.id = att.STAND_ID left JOIN sar_stand_attr_info att on std.id = att.STAND_ID
where std.BUILD_ID is not null where std.BUILD_ID is not null
and att.FBGBJBD is not null and att.FBGBJBD is not null
<if test="type != null">
and std.STAND_TYPE = #{type}
</if>
</select> </select>
<select id="OldSystemFile" resultType="com.adc.da.slrs.sarBussionessStand.entity.OldSystem"> <select id="OldSystemFile" resultType="com.adc.da.slrs.sarBussionessStand.entity.OldSystem">