Commit ff8c0826 authored by wei's avatar wei 🎱

预警分页

parent a1d4936a
......@@ -4,6 +4,7 @@ import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
import com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO;
import com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import java.util.List;
......@@ -17,7 +18,7 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
ExtSupplierManageVO startWorkflow(Long id);
List<SupplierEarlyWarningVO> earlyWarning(SearchQueryCondition searchQueryCondition, int warningDay);
DxPageImpl earlyWarning(SearchQueryCondition searchQueryCondition, int warningDay);
List<SupplierEarlyWarningVO> exportEarlyWarningData(SearchQueryCondition searchQueryCondition, int warningDay);
}
......@@ -11,6 +11,7 @@ import com.yonde.dcs.plan.core.service.ExtSupplierManageService;
import com.yonde.dcs.plan.entity.po.ExtSupplierManage;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j;
......@@ -55,21 +56,24 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
}
@Override
public List<SupplierEarlyWarningVO> earlyWarning(SearchQueryCondition searchQueryCondition, int warningDay) {
public DxPageImpl earlyWarning(SearchQueryCondition searchQueryCondition, int warningDay) {
List<SupplierEarlyWarningVO> list = Lists.newArrayList();
LocalDate warningDate = LocalDate.now().minusDays(warningDay);
List<ExtSupplierManageLinkVO> extSupplierManageLinkVOS = this.recursionSupplierManageLinks(searchQueryCondition, warningDate.toString());
for (ExtSupplierManageLinkVO extSupplierManageLinkVO : extSupplierManageLinkVOS) {
DxPageImpl dxPage = this.recursionSupplierManageLinks(searchQueryCondition, warningDate.toString());
List<ExtSupplierManageLinkVO> content = dxPage.getContent();
for (ExtSupplierManageLinkVO extSupplierManageLinkVO : content) {
ExtSupplierManageVO source = extSupplierManageLinkVO.getSource();
ExtQualificationsVO target = extSupplierManageLinkVO.getTarget();
list.add(this.buildSupplierEarlyWarningVO(source, target));
}
return list;
dxPage.setContent(list);
return dxPage;
}
@Override
public List<SupplierEarlyWarningVO> exportEarlyWarningData(SearchQueryCondition searchQueryCondition, int warningDay) {
return earlyWarning(searchQueryCondition, warningDay);
DxPageImpl dxPage = this.earlyWarning(searchQueryCondition, warningDay);
return dxPage.getContent();
}
private SupplierEarlyWarningVO buildSupplierEarlyWarningVO(ExtSupplierManageVO source, ExtQualificationsVO target) {
......@@ -82,7 +86,7 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
return supplierEarlyWarningVO;
}
private List<ExtSupplierManageLinkVO> recursionSupplierManageLinks(SearchQueryCondition searchQueryCondition, String warningDate) {
private DxPageImpl recursionSupplierManageLinks(SearchQueryCondition searchQueryCondition, String warningDate) {
/*SearchQueryCondition condition = SearchQueryCondition.builder().searchItems(
SearchItems.of(
SearchItems.BooleanOperator.AND,
......@@ -93,8 +97,8 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
SearchItem searchItem = new SearchItem("target.certificateTime", SearchItem.Operator.GT, warningDate);
searchQueryCondition.getSearchItems().getItems().add(searchItem);
List<ExtSupplierManageLinkVO> content = extSupplierManageLinkService.findRecursion(searchQueryCondition).getContent();
return content;
DxPageImpl recursion = extSupplierManageLinkService.findRecursion(searchQueryCondition);
return recursion;
}
}
......
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