|
|
|
@ -9,6 +9,7 @@ import com.bookstore.bookmall.product.entity.AttrAttrgroupRelationEntity;
|
|
|
|
|
import com.bookstore.bookmall.product.entity.AttrGroupEntity;
|
|
|
|
|
import com.bookstore.bookmall.product.entity.CategoryEntity;
|
|
|
|
|
import com.bookstore.bookmall.product.service.AttrAttrgroupRelationService;
|
|
|
|
|
import com.bookstore.bookmall.product.service.CategoryService;
|
|
|
|
|
import com.bookstore.bookmall.product.vo.AttrRespVo;
|
|
|
|
|
import com.bookstore.bookmall.product.vo.AttrVo;
|
|
|
|
|
import com.mysql.cj.util.StringUtils;
|
|
|
|
@ -43,6 +44,8 @@ public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements
|
|
|
|
|
CategoryDao categoryDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
AttrGroupDao attrGroupDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
CategoryService categoryService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
|
|
@ -112,6 +115,39 @@ public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements
|
|
|
|
|
return pageUtils;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public AttrRespVo getAttrInfo(Long attrId) {
|
|
|
|
|
// log.info("进入service");
|
|
|
|
|
// log.info("查询属性,attrId: {}", attrId);
|
|
|
|
|
AttrRespVo respVo = new AttrRespVo();
|
|
|
|
|
AttrEntity attrEntity = this.getById(attrId);
|
|
|
|
|
|
|
|
|
|
//设置分组id
|
|
|
|
|
BeanUtils.copyProperties(attrEntity, respVo);
|
|
|
|
|
// log.info("beanutilzhengchang");
|
|
|
|
|
AttrAttrgroupRelationEntity RelationEntity = RelationDao.selectOne(
|
|
|
|
|
new QueryWrapper<AttrAttrgroupRelationEntity>().eq("attr_id",attrId));
|
|
|
|
|
|
|
|
|
|
if (RelationEntity!=null) {
|
|
|
|
|
// log.info("查询属性,relation正常");
|
|
|
|
|
respVo.setAttrGroupId(RelationEntity.getAttrGroupId());
|
|
|
|
|
AttrGroupEntity attrGroupEntity = attrGroupDao.selectById(RelationEntity.getAttrGroupId());
|
|
|
|
|
if (attrGroupEntity!=null) {
|
|
|
|
|
respVo.setGroupName(attrGroupEntity.getAttrGroupName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// log.info("设置分组");
|
|
|
|
|
//设置分类信息
|
|
|
|
|
Long catelogId = attrEntity.getCatelogId();
|
|
|
|
|
Long[] catelogPath = categoryService.findCatelogPath(catelogId);
|
|
|
|
|
respVo.setCatelogPath(catelogPath);
|
|
|
|
|
CategoryEntity categoryEntity = categoryDao.selectById(catelogId);
|
|
|
|
|
if (categoryEntity != null) {
|
|
|
|
|
respVo.setCatelogName(categoryEntity.getName());
|
|
|
|
|
}
|
|
|
|
|
// log.info("设置分类");
|
|
|
|
|
return respVo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|