|
@@ -456,6 +456,39 @@ public class SparePartInfoServiceImpl extends BaseServiceImpl<SparePartInfoMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public SparePartInfoVO getSpareInfoVOById(String id) {
|
|
|
+ SparePartInfoVO vo = mapper.getSpareInfoVOById(id);
|
|
|
+ String finalName = "";
|
|
|
+ if (vo.getStoreId()!=null) {
|
|
|
+ List<String> names = new ArrayList<>();
|
|
|
+ names = getFinalStoreName(vo.getStoreId(), names);
|
|
|
+ if (names.size() == 3) {
|
|
|
+ finalName = names.get(2).replaceAll("\\s*","").replaceAll("[^(0-9)]","")
|
|
|
+ +"-"+names.get(1).replaceAll("\\s*","").replaceAll("[^(0-9)]","")
|
|
|
+ +"-"+names.get(0);
|
|
|
+ }else {
|
|
|
+ for (int i = names.size() - 1; i >= 0; i--) {
|
|
|
+ finalName = finalName + "-" + names.get(i);
|
|
|
+ finalName = finalName.substring(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setStoreName(finalName);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+ private List<String> getFinalStoreName(String id,List<String> names){
|
|
|
+ Store store = storeMapper.selectByPrimaryKey(id);
|
|
|
+ if (store!=null) {
|
|
|
+ names.add(store.getName());
|
|
|
+ if (store.getParentId() != null&&!store.getParentId().trim().equals("")) {
|
|
|
+ getFinalStoreName(store.getParentId(),names);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return names;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public AbstractPageResultBean<SparePartInfoVO> selectPageInfo2(SparePartInfoDTO record, int pageNum, int pageSize) {
|
|
|
|