译文原文问题(返回文件有名称重复,数据优化)
This commit is contained in:
+2
-2
@@ -428,8 +428,8 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|判断原文译文")
|
||||
@GetMapping("/emptyFileAnewStorage")
|
||||
public ResponseMessage emptyFileAnewStorage (){
|
||||
return sarBussionessStandEOService.emptyFileAnewStorage();
|
||||
public ResponseMessage emptyFileAnewStorage (String type){
|
||||
return sarBussionessStandEOService.emptyFileAnewStorage(type);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|老系统附件重复问题")
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
|
||||
void checkFileByEncrypt();
|
||||
|
||||
ResponseMessage emptyFileAnewStorage();
|
||||
ResponseMessage emptyFileAnewStorage(String type);
|
||||
|
||||
ResponseMessage<SarBussionessStand> importSarBussionessStandFile(MultipartFile file);
|
||||
|
||||
|
||||
+147
-144
@@ -2753,173 +2753,176 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
//att_file_01——att_file_10表,记录附件对应存储位置
|
||||
//
|
||||
@Override
|
||||
public ResponseMessage emptyFileAnewStorage() {
|
||||
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
public ResponseMessage emptyFileAnewStorage(String type) {
|
||||
//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> oldArr1 = new ArrayList();
|
||||
//记录同一数据下文件名重复的
|
||||
List<AttFileEO> fileEOArrayList= new ArrayList<>();
|
||||
|
||||
//海外国内的文件数据处理 处理逻辑对比 文件的名称 一致的情况下 则看老数据库 是否有对应的分类 原文 译文
|
||||
for (OldSystem SarStandardsInfo: SarStandardsInfoList){
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
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) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if(attFileEOS.isEmpty()) {
|
||||
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(), SarStandardsInfo.getBuildId());
|
||||
if (theSame.equals("1")) {
|
||||
//证明找到文件名称一致的了
|
||||
OldSystem sortSign = sarStandardsInfoDao.loreDepotSort(oldSystem.getSortId());
|
||||
//原文译文 进行判断
|
||||
if (sortSign.getSortSign().contains("译")) {
|
||||
if (StringUtils.isNotBlank(yi)) {
|
||||
yi = "," + fileId;
|
||||
if(type.equals("海外")) {
|
||||
List<OldSystem> SarStandardsInfoList = sarStandardsInfoDao.selectListInfo();
|
||||
for (OldSystem SarStandardsInfo : SarStandardsInfoList) {
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
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) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if (attFileEOS.isEmpty()) {
|
||||
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(), 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 {
|
||||
yi = fileId;
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
if (StringUtils.isNotBlank(yuan)) {
|
||||
yuan = "," + fileId;
|
||||
} else {
|
||||
yuan = fileId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
fileEO.setResId("h-"+SarStandardsInfo.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//企业的文件数据处理
|
||||
for (OldSystem sarBussionessStand : SarBussionessStandList){
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
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) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if(attFileEOS.isEmpty()) {
|
||||
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(), 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;
|
||||
}
|
||||
|
||||
}
|
||||
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) {
|
||||
fileEO.setResId("h-" + SarStandardsInfo.getStandId());
|
||||
fileEOArrayList.add(fileEO);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//海外 国内
|
||||
for(OldSystem data : oldArr) {
|
||||
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);
|
||||
logger.info("海外国内修改成功");
|
||||
}
|
||||
|
||||
// 企业
|
||||
for(OldSystem data : oldArr1) {
|
||||
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);
|
||||
logger.info("企业修改成功");
|
||||
}
|
||||
//海外 国内
|
||||
for(OldSystem data : oldArr) {
|
||||
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());
|
||||
if(type.equals("企业")){
|
||||
List<OldSystem> SarBussionessStandList = sarBussionessStandEODao.selectListInfo();
|
||||
//企业的文件数据处理
|
||||
for (OldSystem sarBussionessStand : SarBussionessStandList){
|
||||
for (OldSystem oldSystem : oldSystemInfoList) {
|
||||
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) {
|
||||
// 判断 新系统中的文件是否有名称是一样的 如果有 则跳过 进行记录 没有则 往下走
|
||||
List<AttFileEO> attFileEOS = newFileNameRepetition(asList);
|
||||
if(attFileEOS.isEmpty()) {
|
||||
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(), 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 企业
|
||||
for(OldSystem data : oldArr1) {
|
||||
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);
|
||||
logger.info("企业修改成功");
|
||||
}
|
||||
sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
logger.info("海外国内修改成功");
|
||||
}
|
||||
return Result.success(fileEOArrayList);
|
||||
}
|
||||
|
||||
+2
@@ -1233,5 +1233,7 @@
|
||||
att.FBGBUSS as 'fileId'
|
||||
from sar_bussioness_stand std
|
||||
left JOIN sar_buss_stand_attr_info att on std.id = att.STAND_ID
|
||||
where std.BUILD_ID is not null
|
||||
and att.FBGBUSS is not null
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+2
@@ -1903,6 +1903,8 @@
|
||||
att.FBGBJBD as 'fileId'
|
||||
from sar_standards_info std
|
||||
left JOIN sar_stand_attr_info att on std.id = att.STAND_ID
|
||||
where std.BUILD_ID is not null
|
||||
and att.FBGBJBD is not null
|
||||
</select>
|
||||
|
||||
<select id="OldSystemFile" resultType="com.adc.da.slrs.sarBussionessStand.entity.OldSystem">
|
||||
|
||||
Reference in New Issue
Block a user