|
|
@@ -14,8 +14,12 @@ import org.dromara.physical.domain.bo.PhysicalProductBo;
|
|
|
import org.dromara.physical.domain.bo.PhysicalProductImageBo;
|
|
|
import org.dromara.physical.domain.vo.PhysicalProductImageVo;
|
|
|
import org.dromara.physical.domain.vo.PhysicalProductVo;
|
|
|
+import org.dromara.physical.domain.vo.PhysicalStoreVo;
|
|
|
+import org.dromara.physical.domain.vo.PhysicalTagVo;
|
|
|
import org.dromara.physical.mapper.PhysicalProductMapper;
|
|
|
import org.dromara.physical.service.IPhysicalProductService;
|
|
|
+import org.dromara.physical.service.IPhysicalStoreService;
|
|
|
+import org.dromara.physical.service.IPhysicalTagService;
|
|
|
import org.dromara.system.service.ISysOssService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -37,6 +41,8 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
|
|
|
private final PhysicalProductMapper baseMapper;
|
|
|
private final PhysicalProductImageServiceImpl physicalProductImageService;
|
|
|
private final ISysOssService ossService;
|
|
|
+ private final IPhysicalStoreService iPhysicalStoreService;
|
|
|
+ private final IPhysicalTagService physicalTagService;
|
|
|
/**
|
|
|
* 查询商品
|
|
|
*
|
|
|
@@ -66,6 +72,19 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
|
|
|
public TableDataInfo<PhysicalProductVo> queryPageList(PhysicalProductBo bo, PageQuery pageQuery) {
|
|
|
LambdaQueryWrapper<PhysicalProduct> lqw = buildQueryWrapper(bo);
|
|
|
Page<PhysicalProductVo> result = baseMapper.selectPhysicalProductPage(pageQuery.build(), lqw);
|
|
|
+ List<PhysicalProductVo> physicalProductVoList = result.getRecords();
|
|
|
+ for (PhysicalProductVo physicalProductVo : physicalProductVoList) {
|
|
|
+ Long storeId = physicalProductVo.getStoreId();
|
|
|
+ PhysicalStoreVo physicalStoreVo = iPhysicalStoreService.queryById(storeId);
|
|
|
+ if(physicalStoreVo!=null){
|
|
|
+ physicalProductVo.setStoreName(physicalStoreVo.getName());
|
|
|
+ }
|
|
|
+ PhysicalTagVo physicalTagVo = physicalTagService.queryById(physicalProductVo.getTypeId());
|
|
|
+ if(physicalTagVo!=null){
|
|
|
+ physicalProductVo.setTypeName(physicalTagVo.getServiceName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
|
|
|
|
@@ -78,7 +97,18 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
|
|
|
@Override
|
|
|
public List<PhysicalProductVo> queryList(PhysicalProductBo bo) {
|
|
|
LambdaQueryWrapper<PhysicalProduct> lqw = buildQueryWrapper(bo);
|
|
|
- return baseMapper.selectPhysicalProductList(lqw);
|
|
|
+ List<PhysicalProductVo> physicalProductVoList = baseMapper.selectPhysicalProductList(lqw);
|
|
|
+ for (PhysicalProductVo physicalProductVo : physicalProductVoList) {
|
|
|
+ PhysicalStoreVo physicalStoreVo = iPhysicalStoreService.queryById(physicalProductVo.getStoreId());
|
|
|
+ if(physicalStoreVo!=null){
|
|
|
+ physicalProductVo.setStoreName(physicalStoreVo.getName());
|
|
|
+ }
|
|
|
+ PhysicalTagVo physicalTagVo = physicalTagService.queryById(physicalProductVo.getTypeId());
|
|
|
+ if(physicalTagVo!=null){
|
|
|
+ physicalProductVo.setTypeName(physicalTagVo.getServiceName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return physicalProductVoList;
|
|
|
}
|
|
|
|
|
|
private LambdaQueryWrapper<PhysicalProduct> buildQueryWrapper(PhysicalProductBo bo) {
|