fix: 修改优化当流程归档或者编辑数据时,将标准文件表中的数据清空导致之前同步老系统的数据全部被删除,导致下次同步的时候直接又同步一次
This commit is contained in:
+1
-1
@@ -895,7 +895,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
}
|
||||
List<SarBussStandFile> list = sarBussStandFileService.list(qw);
|
||||
logger.error("doc轉換共多少:"+list.size());
|
||||
sarStandardsInfoEOService.convertDocAllQB(list);
|
||||
iSarBussionessStandService.convertDocAllQB(list);
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -69,5 +69,5 @@ public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
|
||||
void convertDocAll(List<SarStandFile> list);
|
||||
|
||||
void convertDocAllQB(List<SarBussStandFile> list);
|
||||
|
||||
}
|
||||
|
||||
+23
-30
@@ -530,36 +530,17 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
attFileEO.setId(sarStandFile.getAttId());
|
||||
AttFileEO temp = attFileEODao.selectFileInfoById(attFileEO);
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>());
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>(),true);
|
||||
sarStandFile.setPassword("1");
|
||||
sarStandFileService.updateById(sarStandFile);
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ISarStandFileService sarStandFileService;
|
||||
@Autowired
|
||||
private ISarBussStandFileService sarBussStandFileService;
|
||||
|
||||
@Override
|
||||
public void convertDocAllQB(List<SarBussStandFile> list) {
|
||||
try{
|
||||
for(SarBussStandFile sarStandFile : list){
|
||||
logger.error("QB++++++++++++++++:" + sarStandFile.getStandId());
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
attFileEO.setId(sarStandFile.getAttId());
|
||||
AttFileEO temp = attFileEODao.selectFileInfoById(attFileEO);
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>());
|
||||
sarStandFile.setPassword("1");
|
||||
sarBussStandFileService.updateById(sarStandFile);
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String convertStandCodeHandle(String standCode) {
|
||||
if (StringUtils.isNotBlank(standCode)) {
|
||||
@@ -1248,7 +1229,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
// writeWarnings(sarStandardsInfoEO);
|
||||
// 处理属性表信息
|
||||
if (StringUtils.isNotBlank(sarStandardsInfoEO.getSarStandAttrEOStr())) {
|
||||
createStandAttrInfo(sarStandardsInfoEO);
|
||||
createStandAttrInfo(sarStandardsInfoEO,false);
|
||||
}
|
||||
|
||||
// 根据引用标准修改其他被引用标准
|
||||
@@ -1302,7 +1283,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
* @Param: [sarStandardsInfoEO]
|
||||
* @Return: void
|
||||
*/
|
||||
public void createStandAttrInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception {
|
||||
public void createStandAttrInfo(SarStandardsInfo sarStandardsInfoEO,boolean upFlag) throws Exception {
|
||||
String sarStandAttrEOStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||
String mustFields = FieldConvertUtil.mustFields;
|
||||
String mustValues = FieldConvertUtil.mustValues(sarStandardsInfoEO.getId());
|
||||
@@ -1370,7 +1351,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
// 多选项处理
|
||||
createStandVal(sarStandardsInfoEO.getId(), selectionMap);
|
||||
// 文件处理
|
||||
createStandFile(sarStandardsInfoEO.getId(), fileMap);
|
||||
createStandFile(sarStandardsInfoEO.getId(), fileMap,upFlag);
|
||||
// 多时间处理
|
||||
createStandPutTime(sarStandardsInfoEO.getId(), multiTimeMap);
|
||||
}
|
||||
@@ -1417,7 +1398,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
* @Param: [standId, fileMap]
|
||||
* @Return: void
|
||||
*/
|
||||
public void createStandFile(String standId, Map<String, String> fileMap) throws Exception {
|
||||
public void createStandFile(String standId, Map<String, String> fileMap,boolean upFlag) throws Exception {
|
||||
if (fileMap != null && fileMap.size() > 0) {
|
||||
List<SarStandFile> standFileList = new ArrayList<>();
|
||||
List<AttFileEO> fileList = new ArrayList<>();
|
||||
@@ -1427,7 +1408,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
fileList = attFileEOService.getMultiFileInfos(value);
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
createStandFileAppend(standId, field, fileList, standFileList);
|
||||
createStandFileAppend(standId, field, fileList, standFileList,upFlag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1437,8 +1418,20 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
}
|
||||
|
||||
public void createStandFileAppend(String standId, String field, List<AttFileEO> fileList, List<SarStandFile> standFileList) throws Exception {
|
||||
public void createStandFileAppend(String standId, String field, List<AttFileEO> fileList, List<SarStandFile> standFileList,boolean upFlag) throws Exception {
|
||||
for (AttFileEO fileInfo : fileList) {
|
||||
//TODO 20220727 此处为兼容老系统数据 将编辑去掉了先删除再添加的操作
|
||||
if(upFlag){
|
||||
QueryWrapper<SarStandFile> fileQueryWrapper = new QueryWrapper<>();
|
||||
fileQueryWrapper.eq("STAND_ID",standId);
|
||||
fileQueryWrapper.eq("VALID_FLAG","0");
|
||||
fileQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
||||
fileQueryWrapper.eq("ATT_ID",fileInfo.getId());
|
||||
int fileExist = sarStandFileService.count(fileQueryWrapper);
|
||||
if(fileExist>0){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
SarStandFile sarStandFileEO = new SarStandFile();
|
||||
sarStandFileEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
sarStandFileEO.setCreationTime(new Date());
|
||||
@@ -1909,8 +1902,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
int result = dao.updateById(sarStandardsInfoEO);
|
||||
//先删除标准关联表,然后插入数据
|
||||
sarStandValEODao.deleteDataByStandid(standId);
|
||||
//删除文件详情表数据
|
||||
sarStandFileEODao.deleteByStandId(standId);
|
||||
// //删除文件详情表数据
|
||||
// sarStandFileEODao.deleteByStandId(standId);
|
||||
SarStandFile sarStandFileEO = new SarStandFile();
|
||||
sarStandFileEO.setStandId(sarStandardsInfoEO.getId());
|
||||
Map map = (Map) JSONObject.fromObject(sarStandardsInfoEO.getSarStandAttrEOStr());
|
||||
@@ -1929,7 +1922,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
sarStandPutTimeEODao.deleteByStandId(standId);
|
||||
// 修改属性表数据
|
||||
sarStandAttrInfoEODao.deleteStandAttrByStandId(standId);
|
||||
createStandAttrInfo(sarStandardsInfoEO);
|
||||
createStandAttrInfo(sarStandardsInfoEO,true);
|
||||
/**
|
||||
* 编辑体系目录 当代替的标准号在我的收藏中时,此条标准也需要在我的收藏中
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user