|
@@ -64,6 +64,43 @@ public class ProductModuleServiceImpl implements ProductModuleService {
|
|
|
return bigTypeList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据分类ID获取二三级分类
|
|
|
+ * bigTypeID 一级分类ID
|
|
|
+ * source 请求来源:www,crm
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public BigtypeVo getClassifyByTypeId(String domain, Integer typeId, Integer idType, String source) {
|
|
|
+ Integer bigTypeID = 0;
|
|
|
+ if (idType == 1) {
|
|
|
+ bigTypeID = typeId;
|
|
|
+ } else if (idType == 2 ) {
|
|
|
+ bigTypeID = productModuleDao.getBigTypeIdBySmallTypeId(typeId);
|
|
|
+ } else if (idType == 3 ) {
|
|
|
+ bigTypeID = productModuleDao.getBigTypeIdByTinyTypeId(typeId);
|
|
|
+ }
|
|
|
+ BigtypeVo bigType = productModuleDao.getBigTypeByBigTypeId(bigTypeID);
|
|
|
+ List<SmalltypeVo> smallTypeList = productModuleDao.getSmallType(bigTypeID,source);
|
|
|
+ for (SmalltypeVo smallType : smallTypeList) {
|
|
|
+ String caiMeiImage = ProductUtils.getImageURL("caiMeiImage", null, 0, domain);
|
|
|
+ smallType.setWwwIcon(StringUtils.isEmpty(smallType.getWwwIcon())?caiMeiImage:smallType.getWwwIcon());
|
|
|
+ smallType.setCrmIcon(StringUtils.isEmpty(smallType.getCrmIcon())?caiMeiImage:smallType.getCrmIcon());
|
|
|
+ List<TinytypeVo> tinytypeList = productModuleDao.getTinytype(smallType.getSmallTypeID(), source);
|
|
|
+ if (!CollectionUtils.isEmpty(tinytypeList)) {
|
|
|
+ for (TinytypeVo tinyType : tinytypeList) {
|
|
|
+ tinyType.setWwwIcon(StringUtils.isEmpty(tinyType.getWwwIcon())?caiMeiImage:tinyType.getWwwIcon());
|
|
|
+ tinyType.setCrmIcon(StringUtils.isEmpty(tinyType.getCrmIcon())?caiMeiImage:tinyType.getCrmIcon());
|
|
|
+ }
|
|
|
+ smallType.setTinytypeList(tinytypeList);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(smallTypeList)) {
|
|
|
+ bigType.setSmalltypeList(smallTypeList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return bigType;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据一级分类ID获取二三级分类
|
|
|
* bigTypeID 一级分类ID
|