|
@@ -3,11 +3,16 @@ package com.iotechn.unimall.admin.api.gubi.impl;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.iotechn.unimall.admin.api.gubi.IGubiTypeThreeService;
|
|
|
+import com.iotechn.unimall.data.domain.gubi.GubiTypeInfo;
|
|
|
+import com.iotechn.unimall.data.domain.gubi.GubiTypeSecond;
|
|
|
import com.iotechn.unimall.data.domain.gubi.GubiTypeThree;
|
|
|
+import com.iotechn.unimall.data.mapper.gubi.GubiTypeInfoMapper;
|
|
|
+import com.iotechn.unimall.data.mapper.gubi.GubiTypeSecondMapper;
|
|
|
import com.iotechn.unimall.data.mapper.gubi.GubiTypeThreeMapper;
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
@@ -30,7 +35,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
public class GubiTypeThreeServiceImpl implements IGubiTypeThreeService {
|
|
|
@Autowired
|
|
|
private GubiTypeThreeMapper gubiTypeThreeMapper;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private GubiTypeInfoMapper gubiTypeInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private GubiTypeSecondMapper gubiTypeSecondMapper;
|
|
|
@Override
|
|
|
public Boolean add(GubiTypeThree gubiTypeThree, Long adminId) throws ServiceException {
|
|
|
Date now = new Date();
|
|
@@ -109,6 +117,17 @@ public class GubiTypeThreeServiceImpl implements IGubiTypeThreeService {
|
|
|
wrapper.eq("delete_flag", 0);
|
|
|
wrapper.orderBy("postion");
|
|
|
List<GubiTypeThree> list = gubiTypeThreeMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
|
|
|
+ if(!CollectionUtils.isEmpty(list)){
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ List<GubiTypeSecond> gubiTypeSeconds = gubiTypeSecondMapper.selectList(new EntityWrapper<GubiTypeSecond>()
|
|
|
+ .eq("id",list.get(i).getSecondId()));
|
|
|
+ List<GubiTypeInfo> gubiTypeInfos = gubiTypeInfoMapper.selectList(new EntityWrapper<GubiTypeInfo>()
|
|
|
+ .eq("id",gubiTypeSeconds.get(0).getTypeId()));
|
|
|
+ list.get(i).setStrFlag(gubiTypeInfos.get(0).getTypeName()+"/"+gubiTypeSeconds.get(0).getSecondName()+"/"+list.get(i).getTypeId());
|
|
|
+ list.get(i).setIdstr(gubiTypeInfos.get(0).getId()+"/"+gubiTypeSeconds.get(0).getId()+"/"+list.get(i).getId());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
Integer count = gubiTypeThreeMapper.selectCount(wrapper);
|
|
|
return new Page<GubiTypeThree>(list, page, limit, count);
|
|
|
}
|