|
@@ -14,6 +14,7 @@ import com.fs.common.BeanCopyUtils;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
+import com.fs.company.cache.ICompanyCacheService;
|
|
|
import com.fs.store.domain.*;
|
|
|
import com.fs.store.dto.ProductArrtDTO;
|
|
|
import com.fs.store.dto.ProductAttrCountDto;
|
|
@@ -54,6 +55,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
|
|
|
private FsStoreProductPackageMapper fsStoreProductPackageMapper;
|
|
|
@Autowired
|
|
|
private FsStoreProductGroupMapper fsStoreProductGroupMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICompanyCacheService companyCacheService;
|
|
|
/**
|
|
|
* 查询商品
|
|
|
*
|
|
@@ -130,12 +134,38 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
|
|
|
|
|
|
@Override
|
|
|
public List<FsStoreProductListVO> selectFsStoreProductListVO(FsStoreProduct fsStoreProduct) {
|
|
|
- return fsStoreProductMapper.selectFsStoreProductListVO(fsStoreProduct);
|
|
|
+ List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductListVO(fsStoreProduct);
|
|
|
+ List<String> companyNameList = new ArrayList<>();
|
|
|
+ for (FsStoreProductListVO item : fsStoreProductListVOS) {
|
|
|
+ if(StringUtils.isNotBlank(item.getCompanyIds())){
|
|
|
+ String[] split = item.getCompanyIds().split(",");
|
|
|
+
|
|
|
+ for (String companyId : split) {
|
|
|
+ String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId));
|
|
|
+ companyNameList.add(companyName);
|
|
|
+ }
|
|
|
+ item.setCompanyName(String.join(",",companyNameList));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fsStoreProductListVOS;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<FsStoreProductListVO> selectFsStoreProductBarCodeListVO(FsStoreProduct fsStoreProduct) {
|
|
|
- return fsStoreProductMapper.selectFsStoreProductBarCodeListVO(fsStoreProduct);
|
|
|
+ List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductBarCodeListVO(fsStoreProduct);
|
|
|
+ List<String> companyNameList = new ArrayList<>();
|
|
|
+ for (FsStoreProductListVO item : fsStoreProductListVOS) {
|
|
|
+ if(StringUtils.isNotBlank(item.getCompanyIds())){
|
|
|
+ String[] split = item.getCompanyIds().split(",");
|
|
|
+
|
|
|
+ for (String companyId : split) {
|
|
|
+ String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId));
|
|
|
+ companyNameList.add(companyName);
|
|
|
+ }
|
|
|
+ item.setCompanyName(String.join(",",companyNameList));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fsStoreProductListVOS;
|
|
|
}
|
|
|
|
|
|
@Override
|