|
@@ -15,6 +15,7 @@ import com.cdf.service.IHotRelationService;
|
|
import com.cdf.service.IProductSourceService;
|
|
import com.cdf.service.IProductSourceService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.cdf.service.ISceneSourceDataService;
|
|
import com.cdf.service.ISceneSourceDataService;
|
|
|
|
+import com.cdf.util.MyStringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -51,13 +52,17 @@ public class ProductSourceServiceImpl extends ServiceImpl<IProductSourceMapper,
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Object getBySource(CdfProductListRequest param,ProductSource productSource) {
|
|
public Object getBySource(CdfProductListRequest param,ProductSource productSource) {
|
|
- if(StringUtils.isNotBlank(param.getKeyword()) && param.getKeyword().contains(",")){
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(param.getKeyword()) && (param.getKeyword().contains(",") || MyStringUtils.isCdfProductId(param.getKeyword()))) {
|
|
if(param.getPageNum() >1){
|
|
if(param.getPageNum() >1){
|
|
PageInfo pageInfo = PageInfo.PageInfo(param.getPageIndex(), 20L, 0L, new ArrayList<>());
|
|
PageInfo pageInfo = PageInfo.PageInfo(param.getPageIndex(), 20L, 0L, new ArrayList<>());
|
|
return pageInfo;
|
|
return pageInfo;
|
|
}
|
|
}
|
|
JSONArray ids = new JSONArray();
|
|
JSONArray ids = new JSONArray();
|
|
- ids.addAll(Arrays.asList(param.getKeyword().split(",")));
|
|
|
|
|
|
+ if(param.getKeyword().contains(",")){
|
|
|
|
+ ids.addAll(Arrays.asList(param.getKeyword().split(",")));
|
|
|
|
+ }else {
|
|
|
|
+ ids.add(param.getKeyword());
|
|
|
|
+ }
|
|
CdfProductListByIdsRequest idsRequest = new CdfProductListByIdsRequest(ids);
|
|
CdfProductListByIdsRequest idsRequest = new CdfProductListByIdsRequest(ids);
|
|
CdfProductListByIdsVo vos = cdfHKClient.getProductListByIds(productSource.getCdfHost(),productSource.getCdfMchId(),idsRequest);
|
|
CdfProductListByIdsVo vos = cdfHKClient.getProductListByIds(productSource.getCdfHost(),productSource.getCdfMchId(),idsRequest);
|
|
List<CdfProduct> productCardList = vos.getProductCardList();
|
|
List<CdfProduct> productCardList = vos.getProductCardList();
|