提交 67b40f8f 编写于 作者: O o2null

Merge branch 'fix/cms重复刷新权限的问题' into 'wrdp'

[内容管理]修复cms文档重复刷新权限的问题

See merge request o2oa/o2oa!2403
...@@ -25,14 +25,14 @@ import com.x.cms.core.entity.Review; ...@@ -25,14 +25,14 @@ import com.x.cms.core.entity.Review;
* 批处理操作执行 * 批处理操作执行
*/ */
public class CmsBatchOperationProcessService { public class CmsBatchOperationProcessService {
public static String OPT_OBJ_DOCUMENT = "DOCUMENT"; public static String OPT_OBJ_DOCUMENT = "DOCUMENT";
public static String OPT_OBJ_CATEGORY = "CATEGORY"; public static String OPT_OBJ_CATEGORY = "CATEGORY";
public static String OPT_OBJ_APPINFO = "APPINFO"; public static String OPT_OBJ_APPINFO = "APPINFO";
public static String OPT_TYPE_PERMISSION = "PERMISSION"; public static String OPT_TYPE_PERMISSION = "PERMISSION";
public static String OPT_TYPE_UPDATENAME = "UPDATENAME"; public static String OPT_TYPE_UPDATENAME = "UPDATENAME";
public static String OPT_TYPE_DELETE = "DELETE"; public static String OPT_TYPE_DELETE = "DELETE";
private static Logger logger = LoggerFactory.getLogger( CmsBatchOperationProcessService.class ); private static Logger logger = LoggerFactory.getLogger( CmsBatchOperationProcessService.class );
private DocumentInfoService documentInfoService = new DocumentInfoService(); private DocumentInfoService documentInfoService = new DocumentInfoService();
private ReviewService reviewService = new ReviewService(); private ReviewService reviewService = new ReviewService();
...@@ -40,7 +40,7 @@ public class CmsBatchOperationProcessService { ...@@ -40,7 +40,7 @@ public class CmsBatchOperationProcessService {
* 批处理操作执行 * 批处理操作执行
* @param cmsBatchOperation * @param cmsBatchOperation
* @return * @return
* @throws Exception * @throws Exception
*/ */
public String process( CmsBatchOperation cmsBatchOperation ) throws Exception { public String process( CmsBatchOperation cmsBatchOperation ) throws Exception {
logger.debug( "process -> Cms processing batch operation: " + cmsBatchOperation.toString() ); logger.debug( "process -> Cms processing batch operation: " + cmsBatchOperation.toString() );
...@@ -53,11 +53,11 @@ public class CmsBatchOperationProcessService { ...@@ -53,11 +53,11 @@ public class CmsBatchOperationProcessService {
emc.check( cmsBatchOperation, CheckPersistType.all ); emc.check( cmsBatchOperation, CheckPersistType.all );
emc.commit(); emc.commit();
logger.debug( "process -> cms change batch operation running......: " ); logger.debug( "process -> cms change batch operation running......: " );
} }
} catch (Exception e) { } catch (Exception e) {
throw e; throw e;
} }
if( "DOCUMENT".equalsIgnoreCase( cmsBatchOperation.getObjType() )) { if( "DOCUMENT".equalsIgnoreCase( cmsBatchOperation.getObjType() )) {
if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {//文档处理 if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {//文档处理
//将categoryName是旧分类名称的所有文档的分类和栏目相关的信息更新掉,最后删除当前的批处理信息 //将categoryName是旧分类名称的所有文档的分类和栏目相关的信息更新掉,最后删除当前的批处理信息
...@@ -75,7 +75,7 @@ public class CmsBatchOperationProcessService { ...@@ -75,7 +75,7 @@ public class CmsBatchOperationProcessService {
} }
}else if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) { }else if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {
//分类修改权限 //分类修改权限
refreshDocumentReviewInCagetory( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() ); refreshDocumentReviewInCagetory( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() );
}else if( "DELETE".equalsIgnoreCase( cmsBatchOperation.getOptType() )) { }else if( "DELETE".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {
//删除文档,并且修改分类所属的栏目中的分类数量和文档数量 //删除文档,并且修改分类所属的栏目中的分类数量和文档数量
deleteDocumentInCategory( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() ); deleteDocumentInCategory( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() );
...@@ -89,7 +89,7 @@ public class CmsBatchOperationProcessService { ...@@ -89,7 +89,7 @@ public class CmsBatchOperationProcessService {
} }
}else if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) { }else if( "PERMISSION".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {
//栏目修改权限 //栏目修改权限
refreshDocumentReviewInAppInfo( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() ); refreshDocumentReviewInAppInfo( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() );
}else if( "DELETE".equalsIgnoreCase( cmsBatchOperation.getOptType() )) { }else if( "DELETE".equalsIgnoreCase( cmsBatchOperation.getOptType() )) {
//删除分类以及文档,并且修改分类所属的栏目中的分类数量和文档数量 //删除分类以及文档,并且修改分类所属的栏目中的分类数量和文档数量
deleteDocumentInApp( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() ); deleteDocumentInApp( cmsBatchOperation.getId(), cmsBatchOperation.getBundle() );
...@@ -130,12 +130,12 @@ public class CmsBatchOperationProcessService { ...@@ -130,12 +130,12 @@ public class CmsBatchOperationProcessService {
document.setAppAlias( appInfo.getAppName() ); document.setAppAlias( appInfo.getAppName() );
} }
emc.check( document, CheckPersistType.all ); emc.check( document, CheckPersistType.all );
emc.commit(); emc.commit();
cmsBatchOperationPersistService.addOperation( cmsBatchOperationPersistService.addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT, CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "栏目权限变更引起文档Review变更:ID=" + document.getId() ); CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "栏目权限变更引起文档Review变更:ID=" + document.getId() );
} }
} }
ids = null; ids = null;
documentList = null; documentList = null;
...@@ -164,7 +164,7 @@ public class CmsBatchOperationProcessService { ...@@ -164,7 +164,7 @@ public class CmsBatchOperationProcessService {
Long count = business.getDocumentFactory().countByCategoryId(categoryId); Long count = business.getDocumentFactory().countByCategoryId(categoryId);
Long maxTimes = count/maxQueryCount + 2; Long maxTimes = count/maxQueryCount + 2;
logger.info( "refreshDocumentReviewInCagetory -> There are : " + count + " documents need to refresh review, maxTimes=" + maxTimes ); logger.info( "refreshDocumentReviewInCagetory -> There are : " + count + " documents need to refresh review, maxTimes=" + maxTimes );
for( int i=0; i<=maxTimes; i++ ) { for( int i=0; i<=maxTimes; i++ ) {
ids = business.getDocumentFactory().listReviewedIdsByCategoryId(categoryId, maxQueryCount ); ids = business.getDocumentFactory().listReviewedIdsByCategoryId(categoryId, maxQueryCount );
if(ListTools.isNotEmpty( ids )) { if(ListTools.isNotEmpty( ids )) {
...@@ -177,13 +177,13 @@ public class CmsBatchOperationProcessService { ...@@ -177,13 +177,13 @@ public class CmsBatchOperationProcessService {
document.setReviewed( false ); document.setReviewed( false );
emc.check( document, CheckPersistType.all ); emc.check( document, CheckPersistType.all );
emc.commit(); emc.commit();
logger.info( "refreshDocumentReviewInCagetory -> Send docment permission operation to queue[queueBatchOperation], document:" + document.getTitle() ); logger.info( "refreshDocumentReviewInCagetory -> Send docment permission operation to queue[queueBatchOperation], document:" + document.getTitle() );
cmsBatchOperationPersistService.addOperation( cmsBatchOperationPersistService.addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT, CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "分类权限变更引起文档Review变更:ID=" + document.getId() ); CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "分类权限变更引起文档Review变更:ID=" + document.getId() );
} }
} }
ids = null; ids = null;
documentList = null; documentList = null;
...@@ -200,7 +200,7 @@ public class CmsBatchOperationProcessService { ...@@ -200,7 +200,7 @@ public class CmsBatchOperationProcessService {
} }
private void deleteDocumentReview(String id, String docId) throws Exception { private void deleteDocumentReview(String id, String docId) throws Exception {
CmsBatchOperation cmsBatchOperation = null; CmsBatchOperation cmsBatchOperation = null;
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
cmsBatchOperation = emc.find( id, CmsBatchOperation.class ); cmsBatchOperation = emc.find( id, CmsBatchOperation.class );
logger.info( "deleteDocumentReview -> delete all reviews for document: " + docId ); logger.info( "deleteDocumentReview -> delete all reviews for document: " + docId );
...@@ -223,16 +223,16 @@ public class CmsBatchOperationProcessService { ...@@ -223,16 +223,16 @@ public class CmsBatchOperationProcessService {
* 全部删除,然后再重新插入Review记录 * 全部删除,然后再重新插入Review记录
* @param id * @param id
* @param docId * @param docId
* @throws Exception * @throws Exception
*/ */
private void refreshDocumentReview( String id, String docId ) throws Exception { private void refreshDocumentReview( String id, String docId ) throws Exception {
CmsBatchOperation cmsBatchOperation = null; CmsBatchOperation cmsBatchOperation = null;
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
cmsBatchOperation = emc.find( id, CmsBatchOperation.class ); cmsBatchOperation = emc.find( id, CmsBatchOperation.class );
reviewService.refreshDocumentReview( emc, docId ); reviewService.refreshDocumentReview( emc, docId );
/*Document document = emc.find( docId, Document.class ); Document document = emc.find( docId, Document.class );
if( document != null ) { if( document != null ) {
emc.beginTransaction( Document.class ); emc.beginTransaction( Document.class );
document.setReviewed( true ); document.setReviewed( true );
...@@ -261,8 +261,8 @@ public class CmsBatchOperationProcessService { ...@@ -261,8 +261,8 @@ public class CmsBatchOperationProcessService {
emc.check( document, CheckPersistType.all ); emc.check( document, CheckPersistType.all );
emc.commit(); emc.commit();
}*/ }
if( cmsBatchOperation != null ) { if( cmsBatchOperation != null ) {
emc.beginTransaction( CmsBatchOperation.class ); emc.beginTransaction( CmsBatchOperation.class );
emc.remove( cmsBatchOperation, CheckRemoveType.all ); emc.remove( cmsBatchOperation, CheckRemoveType.all );
...@@ -330,7 +330,7 @@ public class CmsBatchOperationProcessService { ...@@ -330,7 +330,7 @@ public class CmsBatchOperationProcessService {
* 将栏目下所有的文档删除,最后删除当前的批处理信息 * 将栏目下所有的文档删除,最后删除当前的批处理信息
* @param id * @param id
* @param bundle * @param bundle
* @throws Exception * @throws Exception
*/ */
private void deleteDocumentInApp(String id, String bundle) throws Exception { private void deleteDocumentInApp(String id, String bundle) throws Exception {
Long docCount = 0L; Long docCount = 0L;
...@@ -341,12 +341,12 @@ public class CmsBatchOperationProcessService { ...@@ -341,12 +341,12 @@ public class CmsBatchOperationProcessService {
List<String> categoryIds = null; List<String> categoryIds = null;
CmsBatchOperation cmsBatchOperation = null; CmsBatchOperation cmsBatchOperation = null;
CategoryInfo categoryInfo = null; CategoryInfo categoryInfo = null;
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
Business business = new Business(emc); Business business = new Business(emc);
cmsBatchOperation = emc.find( id, CmsBatchOperation.class ); cmsBatchOperation = emc.find( id, CmsBatchOperation.class );
categoryIds = business.getCategoryInfoFactory().listByAppId( bundle ); categoryIds = business.getCategoryInfoFactory().listByAppId( bundle );
if( ListTools.isNotEmpty( categoryIds )) { if( ListTools.isNotEmpty( categoryIds )) {
for( String categoryId : categoryIds ) { for( String categoryId : categoryIds ) {
categoryInfo = emc.find( categoryId, CategoryInfo.class ); categoryInfo = emc.find( categoryId, CategoryInfo.class );
...@@ -356,19 +356,19 @@ public class CmsBatchOperationProcessService { ...@@ -356,19 +356,19 @@ public class CmsBatchOperationProcessService {
logger.info( "deleteDocumentInApp -> Cms processing batch operation: remove category: " + categoryInfo.getId() + ", alias: " + categoryInfo.getCategoryAlias() ); logger.info( "deleteDocumentInApp -> Cms processing batch operation: remove category: " + categoryInfo.getId() + ", alias: " + categoryInfo.getCategoryAlias() );
emc.commit(); emc.commit();
} }
//将该目录下所有的文档删除 //将该目录下所有的文档删除
docCount = business.getDocumentFactory().countByCategoryId( categoryId ); docCount = business.getDocumentFactory().countByCategoryId( categoryId );
if( docCount > 0 ) { if( docCount > 0 ) {
totalWhileCount = (int) (docCount/queryMaxCount) + 1; totalWhileCount = (int) (docCount/queryMaxCount) + 1;
if( totalWhileCount > 0 ) { if( totalWhileCount > 0 ) {
while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {//查询1000个文档进行操作 while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {//查询1000个文档进行操作
document_ids = business.getDocumentFactory().listByCategoryId( bundle, queryMaxCount ); document_ids = business.getDocumentFactory().listByCategoryId( bundle, queryMaxCount );
for( String docId : document_ids ){ for( String docId : document_ids ){
try { try {
documentInfoService.delete( emc, docId ); documentInfoService.delete( emc, docId );
new CmsBatchOperationPersistService().addOperation( new CmsBatchOperationPersistService().addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT, CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_DELETE, id, id, "栏目删除引起文档删除:ID=" + id ); CmsBatchOperationProcessService.OPT_TYPE_DELETE, id, id, "栏目删除引起文档删除:ID=" + id );
logger.info( "deleteDocumentInApp -> cms processing batch operation: remove document("+ currenteWhileCount +"/" + totalWhileCount + "): " + docId ); logger.info( "deleteDocumentInApp -> cms processing batch operation: remove document("+ currenteWhileCount +"/" + totalWhileCount + "): " + docId );
}catch( Exception e ) { }catch( Exception e ) {
...@@ -403,7 +403,7 @@ public class CmsBatchOperationProcessService { ...@@ -403,7 +403,7 @@ public class CmsBatchOperationProcessService {
* @param id * @param id
* @param bundle * @param bundle
* @param oldInfo * @param oldInfo
* @throws Exception * @throws Exception
*/ */
private void changeAppNameInCategory( String id, String bundle, String oldName ) throws Exception { private void changeAppNameInCategory( String id, String bundle, String oldName ) throws Exception {
Long docCount = 0L; Long docCount = 0L;
...@@ -415,7 +415,7 @@ public class CmsBatchOperationProcessService { ...@@ -415,7 +415,7 @@ public class CmsBatchOperationProcessService {
AppInfo appInfo = null; AppInfo appInfo = null;
CategoryInfo categoryInfo = null; CategoryInfo categoryInfo = null;
CmsBatchOperation cmsBatchOperation = null; CmsBatchOperation cmsBatchOperation = null;
//先查询该栏目下的所有分类信息列表 //先查询该栏目下的所有分类信息列表
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
Business business = new Business(emc); Business business = new Business(emc);
...@@ -432,7 +432,7 @@ public class CmsBatchOperationProcessService { ...@@ -432,7 +432,7 @@ public class CmsBatchOperationProcessService {
categoryInfo.setAppName( appInfo.getAppName() ); categoryInfo.setAppName( appInfo.getAppName() );
if( StringUtils.isEmpty( categoryInfo.getCategoryAlias() )) { if( StringUtils.isEmpty( categoryInfo.getCategoryAlias() )) {
categoryInfo.setCategoryAlias( appInfo.getAppName() + "-" + categoryInfo.getCategoryName() ); categoryInfo.setCategoryAlias( appInfo.getAppName() + "-" + categoryInfo.getCategoryName() );
} }
emc.beginTransaction( CategoryInfo.class ); emc.beginTransaction( CategoryInfo.class );
emc.check( categoryInfo, CheckPersistType.all ); emc.check( categoryInfo, CheckPersistType.all );
logger.info( "changeAppNameInCategory -> cms processing batch operation: change category: " + categoryInfo.getId() + ", app_name: " + oldName + " -> " + categoryInfo.getAppName() ); logger.info( "changeAppNameInCategory -> cms processing batch operation: change category: " + categoryInfo.getId() + ", app_name: " + oldName + " -> " + categoryInfo.getAppName() );
...@@ -445,7 +445,7 @@ public class CmsBatchOperationProcessService { ...@@ -445,7 +445,7 @@ public class CmsBatchOperationProcessService {
if( totalWhileCount > 0 ) { if( totalWhileCount > 0 ) {
while( docCount > 0 && currenteWhileCount <= totalWhileCount ) { while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {
//查询1000个文档进行操作 //查询1000个文档进行操作
document_ids = business.getDocumentFactory().listByCategoryIdAndNotEqualAppName( categoryInfo.getId(), appInfo.getAppName(), queryMaxCount ); document_ids = business.getDocumentFactory().listByCategoryIdAndNotEqualAppName( categoryInfo.getId(), appInfo.getAppName(), queryMaxCount );
changeDocumentInfoWithCategory( emc, document_ids, categoryInfo ); changeDocumentInfoWithCategory( emc, document_ids, categoryInfo );
logger.info( "changeAppNameInCategory -> cms processing batch operation: update app and category info for document, batch("+ currenteWhileCount +"/" + totalWhileCount + ") " ); logger.info( "changeAppNameInCategory -> cms processing batch operation: update app and category info for document, batch("+ currenteWhileCount +"/" + totalWhileCount + ") " );
//当前循环次数+1 //当前循环次数+1
...@@ -472,7 +472,7 @@ public class CmsBatchOperationProcessService { ...@@ -472,7 +472,7 @@ public class CmsBatchOperationProcessService {
* 将分类下所有的文档删除,最后删除当前的批处理信息 * 将分类下所有的文档删除,最后删除当前的批处理信息
* @param id * @param id
* @param bundle * @param bundle
* @throws Exception * @throws Exception
*/ */
private void deleteDocumentInCategory( String id, String bundle ) throws Exception { private void deleteDocumentInCategory( String id, String bundle ) throws Exception {
Long docCount = 0L; Long docCount = 0L;
...@@ -482,31 +482,31 @@ public class CmsBatchOperationProcessService { ...@@ -482,31 +482,31 @@ public class CmsBatchOperationProcessService {
List<String> document_ids = null; List<String> document_ids = null;
CmsBatchOperation cmsBatchOperation = null; CmsBatchOperation cmsBatchOperation = null;
CategoryInfo categoryInfo = null; CategoryInfo categoryInfo = null;
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
Business business = new Business(emc); Business business = new Business(emc);
cmsBatchOperation = emc.find( id, CmsBatchOperation.class ); cmsBatchOperation = emc.find( id, CmsBatchOperation.class );
categoryInfo = emc.find( bundle, CategoryInfo.class ); categoryInfo = emc.find( bundle, CategoryInfo.class );
if( categoryInfo != null ) { if( categoryInfo != null ) {
emc.beginTransaction( CategoryInfo.class ); emc.beginTransaction( CategoryInfo.class );
emc.remove( categoryInfo, CheckRemoveType.all ); emc.remove( categoryInfo, CheckRemoveType.all );
logger.info( "deleteDocumentInCategory -> cms processing batch operation: remove category, id:"+ bundle ); logger.info( "deleteDocumentInCategory -> cms processing batch operation: remove category, id:"+ bundle );
emc.commit(); emc.commit();
} }
//将该目录下所有的文档删除 //将该目录下所有的文档删除
docCount = business.getDocumentFactory().countByCategoryId( bundle ); docCount = business.getDocumentFactory().countByCategoryId( bundle );
if( docCount > 0 ) { if( docCount > 0 ) {
totalWhileCount = (int) (docCount/queryMaxCount) + 1; totalWhileCount = (int) (docCount/queryMaxCount) + 1;
if( totalWhileCount > 0 ) { if( totalWhileCount > 0 ) {
while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {//查询1000个文档进行操作 while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {//查询1000个文档进行操作
document_ids = business.getDocumentFactory().listByCategoryId( bundle, queryMaxCount ); document_ids = business.getDocumentFactory().listByCategoryId( bundle, queryMaxCount );
for( String docId : document_ids ){ for( String docId : document_ids ){
try { try {
documentInfoService.delete( emc, docId ); documentInfoService.delete( emc, docId );
new CmsBatchOperationPersistService().addOperation( new CmsBatchOperationPersistService().addOperation(
CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT, CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
CmsBatchOperationProcessService.OPT_TYPE_DELETE, id, id, "分类删除引起文档删除:ID=" + id ); CmsBatchOperationProcessService.OPT_TYPE_DELETE, id, id, "分类删除引起文档删除:ID=" + id );
logger.info( "deleteDocumentInCategory -> cms processing batch operation: remove document("+ currenteWhileCount +"/" + totalWhileCount + "): " + docId ); logger.info( "deleteDocumentInCategory -> cms processing batch operation: remove document("+ currenteWhileCount +"/" + totalWhileCount + "): " + docId );
}catch( Exception e ) { }catch( Exception e ) {
...@@ -519,7 +519,7 @@ public class CmsBatchOperationProcessService { ...@@ -519,7 +519,7 @@ public class CmsBatchOperationProcessService {
docCount = business.getDocumentFactory().countByCategoryId( categoryInfo.getId() ); docCount = business.getDocumentFactory().countByCategoryId( categoryInfo.getId() );
} }
} }
} }
if( cmsBatchOperation != null ) { if( cmsBatchOperation != null ) {
emc.beginTransaction( CmsBatchOperation.class ); emc.beginTransaction( CmsBatchOperation.class );
emc.remove( cmsBatchOperation, CheckRemoveType.all ); emc.remove( cmsBatchOperation, CheckRemoveType.all );
...@@ -538,7 +538,7 @@ public class CmsBatchOperationProcessService { ...@@ -538,7 +538,7 @@ public class CmsBatchOperationProcessService {
* @param id 批处理信息ID * @param id 批处理信息ID
* @param bundle 绑定的分类信息ID * @param bundle 绑定的分类信息ID
* @param oldName 分类使用的旧名称 * @param oldName 分类使用的旧名称
* @throws Exception * @throws Exception
*/ */
private void changeCategoryNameInDocument( String id, String bundle, String oldName ) throws Exception { private void changeCategoryNameInDocument( String id, String bundle, String oldName ) throws Exception {
Long docCount = 0L; Long docCount = 0L;
...@@ -560,8 +560,8 @@ public class CmsBatchOperationProcessService { ...@@ -560,8 +560,8 @@ public class CmsBatchOperationProcessService {
if( totalWhileCount > 0 ) { if( totalWhileCount > 0 ) {
while( docCount > 0 && currenteWhileCount <= totalWhileCount ) { while( docCount > 0 && currenteWhileCount <= totalWhileCount ) {
//查询1000个文档进行操作 //查询1000个文档进行操作
document_ids = business.getDocumentFactory().listByCategoryIdAndCategoryName(bundle, categoryInfo.getCategoryName(), queryMaxCount ); document_ids = business.getDocumentFactory().listByCategoryIdAndCategoryName(bundle, categoryInfo.getCategoryName(), queryMaxCount );
changeDocumentInfoWithCategory( emc, document_ids, categoryInfo ); changeDocumentInfoWithCategory( emc, document_ids, categoryInfo );
logger.info( "changeCategoryNameInDocument -> cms processing batch operation: update app and category info for document, batch("+ currenteWhileCount +"/" + totalWhileCount + ") " ); logger.info( "changeCategoryNameInDocument -> cms processing batch operation: update app and category info for document, batch("+ currenteWhileCount +"/" + totalWhileCount + ") " );
//当前循环次数+1 //当前循环次数+1
currenteWhileCount ++; currenteWhileCount ++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册