Commit 2557ad98 authored by wangqiang's avatar wangqiang

修改IED和采购计划查询计划是根据项目id和计划编号查询--》原只是根据编号查询

parent 80b58b81
......@@ -205,8 +205,17 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
}
public ExtIEDPlanVO getIEDPlanByFileNumber(String fileNumber) {
SearchItems iedPlanSearch = new SearchItems();
SearchItem fileNumberFilter = new SearchItem("fileNumber", SearchItem.Operator.EQ, fileNumber, (Object)null);
SearchItem projectIdFilter = new SearchItem("dxContextId", SearchItem.Operator.EQ, projectId, (Object)null);
iedPlanSearch.addItem(fileNumberFilter);
iedPlanSearch.addItem(projectIdFilter);
SearchQueryCondition searchQuery = SearchQueryCondition.builder().searchItems(iedPlanSearch).build();
//根据文件编号查询IED计划
DxPageImpl<ExtIEDPlanVO> IEDPlanPage = extIEDPlanService.findRecursion(SearchUtil.buildQuery("fileNumber", SearchItem.Operator.EQ, fileNumber));
// DxPageImpl<ExtIEDPlanVO> IEDPlanPage = extIEDPlanService.findRecursion(SearchUtil.buildQuery("fileNumber", SearchItem.Operator.EQ, fileNumber));
DxPageImpl<ExtIEDPlanVO> IEDPlanPage = extIEDPlanService.findRecursion(searchQuery);
if (!CollectionUtils.isEmpty(IEDPlanPage.getContent())) {
ExtIEDPlanVO extIEDPlanVOForDB = DxPageUtils.getFirst(IEDPlanPage);
return extIEDPlanVOForDB;
......
......@@ -12,6 +12,8 @@ import com.yonde.dcs.plan.core.service.ExtPuchasePlanAttributeService;
import com.yonde.dcs.plan.core.util.CommonUtils;
import com.yonde.dcs.plan.entity.po.ExtPuchasePlanAttribute;
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.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
......@@ -183,8 +185,17 @@ public class PurchasePlanExcelReadListenner extends AnalysisEventListener<ExtPuc
* @return
*/
public ExtPuchasePlanAttributeVO getPurchasePlanByPlanCode(String planCode){
SearchItems purchasePlanSearch = new SearchItems();
SearchItem planCodeFilter = new SearchItem("planCode", SearchItem.Operator.EQ, planCode, (Object)null);
SearchItem projectIdFilter = new SearchItem("dxContextId", SearchItem.Operator.EQ, projectId, (Object)null);
purchasePlanSearch.addItem(planCodeFilter);
purchasePlanSearch.addItem(projectIdFilter);
SearchQueryCondition searchQuery = SearchQueryCondition.builder().searchItems(purchasePlanSearch).build();
//根据计划编码获取数据库中采购计划数据
DxPageImpl<ExtPuchasePlanAttributeVO> dxPuchasePlanPage = extPuchasePlanAttributeService.findRecursion(SearchUtil.buildQuery("planCode", SearchItem.Operator.EQ, planCode));
//DxPageImpl<ExtPuchasePlanAttributeVO> dxPuchasePlanPage = extPuchasePlanAttributeService.findRecursion(SearchUtil.buildQuery("planCode", SearchItem.Operator.EQ, planCode));
DxPageImpl<ExtPuchasePlanAttributeVO> dxPuchasePlanPage = extPuchasePlanAttributeService.findRecursion(searchQuery);
if (!CollectionUtils.isEmpty(dxPuchasePlanPage.getContent())) {
ExtPuchasePlanAttributeVO extPurPlanForDB = DxPageUtils.getFirst(dxPuchasePlanPage);
return extPurPlanForDB;
......
......@@ -207,11 +207,12 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
DxDocumentVO dxDocumentVOForDB = extDxDocumentServiceFeign.saveRecursion(dxDocumentVO);
//保存文档与IED计划的关系
ExtIEDPlanDocLinkVO extIEDPlanDocLinkVO = new ExtIEDPlanDocLinkVO();
extIEDPlanDocLinkVO.setTargetId(dxDocumentVOForDB.getVersionId());
extIEDPlanDocLinkVO.setTargetId(dxDocumentVOForDB.getId());
extIEDPlanDocLinkVO.setSourceId(extIEDPlanVO.getId());
extIEDPlanDocLinkVO.setOperator(OperatorType.ADD);
extIEDPlanDocLinkService.saveRecursion(extIEDPlanDocLinkVO);
return ApiResult.SUCCESS;
}
......
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