Commit cae43939 authored by wangqiang's avatar wangqiang

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

parent a9402e84
......@@ -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.entity.po.ExtActionItem;
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.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
......@@ -48,21 +49,22 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA
Boolean allActionItemIsCompleteFlag = false;
//根据行动项id查询季报id
SearchQueryCondition searchQRById = SearchUtil.buildQueryWithOpenAttr("id",
SearchItem.Operator.EQ,
extActionItemVO.getExtQuarterlyReport().getId(),
"extActionItems"
);
ExtQuarterlyReportVO extQuarterlyReportVO = (ExtQuarterlyReportVO) extQuarterlyReportService.findOne(searchQRById);
for (ExtActionItemVO actionItem : extQuarterlyReportVO.getExtActionItems()){
//根据行动项id查询季报
SearchQueryCondition query = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("extQuarterlyReport")
.openProp(SearchQueryCondition.builder().name("extActionItems").build()).build())
.searchItems(SearchItems.builder()
.item(new SearchItem("id", SearchItem.Operator.EQ, extActionItemVO.getId(), null))
.build()).build();
ExtActionItemVO extActionItemVOForDB = this.findRecursion(query).getContent().get(0);
for (ExtActionItemVO actionItem : extActionItemVOForDB.getExtQuarterlyReport().getExtActionItems()){
if(!actionItem.getState().equals(Constants.COMPLETE)){
break;
}
allActionItemIsCompleteFlag = true;
}
if(allActionItemIsCompleteFlag){
extQuarterlyReportService.changeStatus(extQuarterlyReportVO.getId(),Constants.PENDING_REVIEW,true);
extQuarterlyReportService.changeStatus(extActionItemVOForDB.getExtQuarterlyReport().getId(),Constants.PENDING_REVIEW,true);
}
return ApiResult.SUCCESS;
}
......
......@@ -158,7 +158,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
*/
private void extFindFileIds(List<Long> fileIds, List<ObjFileLinkVO> objFileLinks, String fileType) {
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());});
}
}
......
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