Commit cae43939 authored by wangqiang's avatar wangqiang

修改查询所有行动项是否已完成

parent a9402e84
...@@ -9,6 +9,7 @@ import com.yonde.dcs.plan.core.service.ExtActionItemService; ...@@ -9,6 +9,7 @@ import com.yonde.dcs.plan.core.service.ExtActionItemService;
import com.yonde.dcs.plan.core.service.ExtQuarterlyReportService; import com.yonde.dcs.plan.core.service.ExtQuarterlyReportService;
import com.yonde.dcs.plan.entity.po.ExtActionItem; import com.yonde.dcs.plan.entity.po.ExtActionItem;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.ApiResult; import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
...@@ -48,21 +49,22 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA ...@@ -48,21 +49,22 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA
Boolean allActionItemIsCompleteFlag = false; Boolean allActionItemIsCompleteFlag = false;
//根据行动项id查询季报id //根据行动项id查询季报
SearchQueryCondition searchQRById = SearchUtil.buildQueryWithOpenAttr("id", SearchQueryCondition query = SearchQueryCondition.builder()
SearchItem.Operator.EQ, .openProp(SearchQueryCondition.builder().name("extQuarterlyReport")
extActionItemVO.getExtQuarterlyReport().getId(), .openProp(SearchQueryCondition.builder().name("extActionItems").build()).build())
"extActionItems" .searchItems(SearchItems.builder()
); .item(new SearchItem("id", SearchItem.Operator.EQ, extActionItemVO.getId(), null))
ExtQuarterlyReportVO extQuarterlyReportVO = (ExtQuarterlyReportVO) extQuarterlyReportService.findOne(searchQRById); .build()).build();
for (ExtActionItemVO actionItem : extQuarterlyReportVO.getExtActionItems()){ ExtActionItemVO extActionItemVOForDB = this.findRecursion(query).getContent().get(0);
for (ExtActionItemVO actionItem : extActionItemVOForDB.getExtQuarterlyReport().getExtActionItems()){
if(!actionItem.getState().equals(Constants.COMPLETE)){ if(!actionItem.getState().equals(Constants.COMPLETE)){
break; break;
} }
allActionItemIsCompleteFlag = true; allActionItemIsCompleteFlag = true;
} }
if(allActionItemIsCompleteFlag){ if(allActionItemIsCompleteFlag){
extQuarterlyReportService.changeStatus(extQuarterlyReportVO.getId(),Constants.PENDING_REVIEW,true); extQuarterlyReportService.changeStatus(extActionItemVOForDB.getExtQuarterlyReport().getId(),Constants.PENDING_REVIEW,true);
} }
return ApiResult.SUCCESS; return ApiResult.SUCCESS;
} }
......
...@@ -158,7 +158,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple ...@@ -158,7 +158,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
*/ */
private void extFindFileIds(List<Long> fileIds, List<ObjFileLinkVO> objFileLinks, String fileType) { private void extFindFileIds(List<Long> fileIds, List<ObjFileLinkVO> objFileLinks, String fileType) {
if (!CollectionUtils.isEmpty(objFileLinks)) { if (!CollectionUtils.isEmpty(objFileLinks)) {
//遍历取文件id //遍历取主内容的文件id
//List<ObjFileLinkVO> objFileLinkVOs = objFileLinks.stream().filter(n -> n.getContentType().equals(fileType)).collect(Collectors.toList());
objFileLinks.stream().forEach(o -> {fileIds.add(o.getTargetId());}); objFileLinks.stream().forEach(o -> {fileIds.add(o.getTargetId());});
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment