|
@@ -130,9 +130,37 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
|
|
|
|
|
|
@Override
|
|
|
public Page<PurchaseVo> getPageByWdly(PurchaseSelectDto dto) {
|
|
|
- Page<PurchaseVo> page = getPage(dto);
|
|
|
+ IWrapper<Purchase> wrapper = getWrapper();
|
|
|
+
|
|
|
+ //过滤维多利亚数据
|
|
|
+ wrapper.isNotNull("p.victoriatourist_json");
|
|
|
+
|
|
|
+ wrapper.orderByDesc("p", Purchase::getCreateTime);
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getPurchaseStatus())) {
|
|
|
+ wrapper.eq("p", Purchase::getPurchaseStatus, dto.getPurchaseStatus());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getArrivalStatus())) {
|
|
|
+ wrapper.eq("p", Purchase::getArrivalStatus, dto.getArrivalStatus());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getPayStatus())) {
|
|
|
+ wrapper.eq("p", Purchase::getPayStatus, dto.getPayStatus());
|
|
|
+ }
|
|
|
+ wrapper.eq("p", Purchase::getCode, dto.getKeyword());//根据采购单号关键字搜索
|
|
|
+ Page<PurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<PurchaseVo> list = page.getRecords();
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ List<Long> supplyIds = list.stream().map(PurchaseVo::getSupplyId).collect(Collectors.toList());
|
|
|
+ List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
|
|
|
+ Map<Long, List<SupplierInfo>> supplyMap = supplierInfoList.stream().distinct().collect(Collectors.groupingBy(SupplierInfo::getId));
|
|
|
+ if (MapUtils.isNotEmpty(supplyMap)) {
|
|
|
+ for (PurchaseVo p : list) {
|
|
|
+ List<SupplierInfo> supplys = supplyMap.getOrDefault(p.getSupplyId(), null);
|
|
|
+ p.setSupplyName(supplys == null ? null : supplys.get(0).getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //-------------------------------------------------
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
//维多利亚 赋值收货仓库名称
|
|
|
List<Long> wids = new ArrayList<>();
|
|
|
for (PurchaseVo purchaseVo : list) {
|