This commit is contained in:
大米 2024-02-22 18:15:48 +08:00
parent 1fb18011fa
commit b091706e98
1 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import com.google.common.base.Joiner;
import com.nflg.product.bomnew.pojo.query.ReverseReportQuery;
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO;
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -16,6 +17,8 @@ import java.util.stream.Collectors;
*/
@Service
public class ReverseReportService {
//原始BOM
private static String oBomIndexPrefix="oBom";
private static String eBomIndexPrefix="EBom";
@ -118,4 +121,22 @@ public class ReverseReportService {
}
}
}
/**
* 创建原始BOM-反查索引
* @param parent
* @param bomDetail
*/
private void createOBomIndex(BomOriginalListVO parent , List<BomOriginalListVO> bomDetail){
List<BomOriginalListVO> bomParents = bomDetail.stream().filter(u -> u.getBomRowId()>0).collect(Collectors.toList());
bomParents.add(parent);
for (BomOriginalListVO parentEnt :bomParents) {
List<BomOriginalListVO> parentEntChild = bomDetail.stream().filter(u -> u.getParentRowId().equals(parentEnt.getBomRowId())).collect(Collectors.toList());
for (BomOriginalListVO child :parentEntChild) {
String key= joiner.join(oBomIndexPrefix, child.getDrawingNo());
String value=joiner.join(oBomIndexPrefix , parentEnt.getDrawingNo() );
redisService.addSet(key,value);
}
}
}
}