fix: 修改优化当流程归档或者编辑数据时,将标准文件表中的数据清空导致之前同步老系统的数据全部被删除,导致下次同步的时候直接又同步一次
This commit is contained in:
+3
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarBussionessStand.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.search.entity.SarBussionessStandEO;
|
||||
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||
@@ -46,5 +47,7 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
boolean checkIsShow(SarBussionessStandEOPage page) throws Exception;
|
||||
|
||||
List<SarBussionessStand> getSarBussionStandPageQd(SarBussionessStandEOPage page) throws Exception;
|
||||
|
||||
void convertDocAllQB(List<SarBussStandFile> list);
|
||||
}
|
||||
|
||||
|
||||
+39
-9
@@ -42,6 +42,7 @@ import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||
@@ -299,7 +300,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
// writeWarnings(sarBussionessStandEO);
|
||||
// 处理属性表信息
|
||||
if (StringUtils.isNotBlank(sarBussionessStandEO.getSarStandAttrEOStr())) {
|
||||
createStandAttrInfo(sarBussionessStandEO);
|
||||
createStandAttrInfo(sarBussionessStandEO,false);
|
||||
}
|
||||
// 增加关联事件
|
||||
String sortName = sysInfoEOService.getDicNamesByCodes(sarBussionessStandEO.getStandSort(),"JKSADFH564S");
|
||||
@@ -599,8 +600,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
|
||||
sarBussStandValEODao.deleteDataByStandId(standId);
|
||||
|
||||
//删除文件详情表数据
|
||||
sarBussStandFileEODao.deleteByStandId(standId);
|
||||
// //删除文件详情表数据
|
||||
// sarBussStandFileEODao.deleteByStandId(standId);
|
||||
SarBussStandFile sarBussStandFileEO = new SarBussStandFile();
|
||||
sarBussStandFileEO.setStandId(standId);
|
||||
sarBussStandFileEO.setIdList(null);
|
||||
@@ -615,7 +616,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
}
|
||||
createStandAttrInfo(sarBussionessStandEO);
|
||||
createStandAttrInfo(sarBussionessStandEO,true);
|
||||
//修改收藏分享编号名称
|
||||
updateCollectAndShare(sarBussionessStandEO);
|
||||
|
||||
@@ -989,7 +990,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
* @Param: [sarStandardsInfoEO]
|
||||
* @Return: void
|
||||
*/
|
||||
public void createStandAttrInfo (SarBussionessStand sarBussionessStandEO) throws Exception {
|
||||
public void createStandAttrInfo (SarBussionessStand sarBussionessStandEO,boolean upFlag) throws Exception {
|
||||
String sarStandAttrEOStr = sarBussionessStandEO.getSarStandAttrEOStr();
|
||||
String mustFields = FieldConvertUtil.mustFields;
|
||||
String mustValues = FieldConvertUtil.mustValues(sarBussionessStandEO.getId());
|
||||
@@ -1038,7 +1039,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
// 多选项处理
|
||||
createStandVal(sarBussionessStandEO.getId(),selectionMap);
|
||||
// 文件处理
|
||||
createStandFile(sarBussionessStandEO.getId(),fileMap);
|
||||
createStandFile(sarBussionessStandEO.getId(),fileMap,upFlag);
|
||||
// 多时间处理
|
||||
// createStandPutTime(sarBussionessStandEO.getId(),multiTimeMap);
|
||||
}
|
||||
@@ -1085,7 +1086,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
* @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<SarBussStandFile> standFileList = new ArrayList<>();
|
||||
for (Map.Entry<String,String> entry : fileMap.entrySet()) {
|
||||
@@ -1094,7 +1095,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<AttFileEO> fileList = attFileEOService.getMultiFileInfos(value);
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
createStandFileAppend(standId,field,fileList,standFileList);
|
||||
createStandFileAppend(standId,field,fileList,standFileList,upFlag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1104,8 +1105,20 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
|
||||
public void createStandFileAppend (String standId,String field,List<AttFileEO> fileList,List<SarBussStandFile> standFileList) throws Exception {
|
||||
public void createStandFileAppend (String standId,String field,List<AttFileEO> fileList,List<SarBussStandFile> standFileList,boolean upFlag) throws Exception {
|
||||
for (AttFileEO fileInfo : fileList) {
|
||||
//TODO 20220727 此处为兼容老系统数据 将编辑去掉了先删除再添加的操作
|
||||
if(upFlag){
|
||||
QueryWrapper<SarBussStandFile> 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 = sarBussStandFileEODao.selectCount(fileQueryWrapper);
|
||||
if(fileExist>0){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
SarBussStandFile sarStandFileEO = new SarBussStandFile();
|
||||
sarStandFileEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
sarStandFileEO.setCreationTime(new Date());
|
||||
@@ -1737,4 +1750,21 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
public List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage){
|
||||
return this.baseMapper.queryByList(sarBussionessStandEOPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertDocAllQB(List<SarBussStandFile> list) {
|
||||
try{
|
||||
for(SarBussStandFile sarStandFile : list){
|
||||
logger.error("QB++++++++++++++++:" + sarStandFile.getStandId());
|
||||
AttFileEO temp = attFileEOService.getFileInfo(sarStandFile.getAttId());
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>(),true);
|
||||
sarStandFile.setPassword("1");
|
||||
sarBussStandFileEODao.updateById(sarStandFile);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user