Browse Source

201910122043

luokuan 5 years ago
parent
commit
84f7c0c9c9

+ 0 - 19
src/main/java/com/yc/education/controller/DealerSearchController.java

@@ -1192,23 +1192,4 @@ public class DealerSearchController extends BaseController {
         return new ApiMessage<>(false, AppConst.FAIL_CODE, AppConst.FAIL_MSG);
     }
 
-
-    /**
-     * 集合转字符串 用逗号隔开
-     *
-     * @param list
-     * @return
-     */
-    private String listChangeString(List<SearchDealer> list) {
-        if (CollectionUtils.isEmpty(list)) return "";
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < list.size(); i++) {
-            if (i < list.size() - 1) {
-                sb.append(list.get(i).getName()).append(",");
-            } else {
-                sb.append(list.get(i).getName());
-            }
-        }
-        return sb.toString();
-    }
 }

+ 39 - 2
src/main/java/com/yc/education/controller/ProviderSearchController.java

@@ -83,6 +83,9 @@ public class ProviderSearchController extends BaseController {
     @Autowired
     private WIBrowseRecordService wiBrowseRecordService;
 
+    @Autowired
+    private ISearchDealerService iSearchDealerService;
+
     /**
      * 车主/服务商 主界面
      * 展示首页信息
@@ -293,6 +296,7 @@ public class ProviderSearchController extends BaseController {
         Long StoreId = Long.valueOf(id);
         ProviderDetailVo pVo = new ProviderDetailVo();
 
+/*
         String token_urlss = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx4d4838ebec29b8c4&secret=4fd6ca38a1261f96cbc0314c5675b95d";
         JSONObject access_tokenss = CommonUtil.httpsRequestToJsonObject(token_urlss, "GET", null);
         System.err.println(access_tokenss);
@@ -300,6 +304,7 @@ public class ProviderSearchController extends BaseController {
         System.out.println(access_token1);
 
         String path = CommonUtil.getminiqrQr(access_token1.toString(), "a=" + StoreId, "picture/qrCode");
+*/
 
 
         try {
@@ -363,7 +368,20 @@ public class ProviderSearchController extends BaseController {
             pVo.setBusinessTime("今日营业时间:" + provider.getBusinessStime() + "-" + provider.getBusinessEtime());
             pVo.setIntroduce(provider.getBusinessIntroduce());  //业务介绍
             // pVo.setMainBusiness(provider.getMianBusiness());    //主营业务
-            pVo.setMainBusiness(providerSearchService.mainBussinessParent(provider.getMianBusiness()));  //显示父级主营业务
+            if("1".equals(roleType)){
+                pVo.setMainBusiness(providerSearchService.mainBussinessParent(provider.getMianBusiness()));  //显示父级主营业务
+            }
+            if("2".equals(roleType)){
+
+                if (Objects.equals("1", provider.getParamType()) || Objects.equals("2", provider.getParamType()) || Objects.equals("3", provider.getParamType())) {
+                    List<SearchDealer> list = iSearchDealerService.listLevelGroupName(provider.getId(), "4");
+                    pVo.setMainBusiness(listChangeString(list));
+                }
+                if (Objects.equals("4", provider.getParamType()) || Objects.equals("5", provider.getParamType())) {
+                    List<SearchDealer> list = iSearchDealerService.listLevelGroupName(provider.getId(), "3");
+                    pVo.setMainBusiness(listChangeString(list));
+                }
+            }
             pVo.setName(provider.getName());        //店铺名称
             pVo.setStatus(provider.getStatus());        //是否认证 0否1是
             pVo.setPv(provider.getPv() + "");    //浏览量
@@ -449,7 +467,7 @@ public class ProviderSearchController extends BaseController {
             //前他分店数量
             //品牌库
             BrandSearchVo brandSearchVo = new BrandSearchVo();
-            if (provider.getBrandId() != null) {
+            if (provider.getBrandId() != null && 0 != provider.getBrandId()) {
                 Brand brand = brandService.selectByPrimaryKey(Integer.valueOf(provider.getBrandId()));
                 BrandSearchVo.InnerShowBrand innerShowBrand = brandSearchVo.new InnerShowBrand();
                 innerShowBrand.setId(brand.getId() == null ? "" : brand.getId() + "");
@@ -1252,4 +1270,23 @@ public class ProviderSearchController extends BaseController {
         return activityVo;
     }
 
+    /**
+     * 集合转字符串 用逗号隔开
+     *
+     * @param list
+     * @return
+     */
+    private String listChangeString(List<SearchDealer> list) {
+        if (CollectionUtils.isEmpty(list)) return "";
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < list.size(); i++) {
+            if (i < list.size() - 1) {
+                sb.append(list.get(i).getName()).append(",");
+            } else {
+                sb.append(list.get(i).getName());
+            }
+        }
+        return sb.toString();
+    }
+
 }

+ 1 - 1
src/main/java/com/yc/education/controller/ServiceCategoryController.java

@@ -69,7 +69,7 @@ public class ServiceCategoryController {
 
         try {
             //单向件两层 , 其他三层
-            if ("汽车用品".equals(name) || "汽保设备与工具".equals(name) || "单向件".equals(name)) {
+            if ("用品改装".equals(name) || "汽保设备与工具".equals(name) || "单向件".equals(name)) {
 
                 ThreeLayersVo tvo = new ThreeLayersVo();
                 tvo.setName(name);

+ 19 - 0
src/main/java/com/yc/education/service/impl/ProviderServiceImpl.java

@@ -173,6 +173,16 @@ public class ProviderServiceImpl extends BaseService<Provider> implements IProvi
         String[] split = mainBusiness.split(",+");
         for (String s : split) {
             CarSedan carSedan = iCarSedanService.getCarSedan(null, s);
+
+            SearchDealer searchDealer0 = new SearchDealer();
+            searchDealer0.setServiceId(null);
+            searchDealer0.setStoreId(storeId);
+            searchDealer0.setLevel("4");
+            searchDealer0.setType("4");
+            searchDealer0.setName("汽车配件");
+            list.add(searchDealer0);
+
+
             SearchDealer searchDealer = new SearchDealer();
             searchDealer.setServiceId(null);
             searchDealer.setStoreId(storeId);
@@ -212,6 +222,14 @@ public class ProviderServiceImpl extends BaseService<Provider> implements IProvi
         for (String s : split) {
             CarCommercial carCommercial = iCarCommerialService.getCarCommercial(null, s);
 
+            SearchDealer searchDealer0 = new SearchDealer();
+            searchDealer0.setServiceId(null);
+            searchDealer0.setStoreId(storeId);
+            searchDealer0.setLevel("4");
+            searchDealer0.setType("5");
+            searchDealer0.setName("商用车");
+            list.add(searchDealer0);
+
             SearchDealer searchDealer = new SearchDealer();
             searchDealer.setServiceId(null);
             searchDealer.setStoreId(storeId);
@@ -234,6 +252,7 @@ public class ProviderServiceImpl extends BaseService<Provider> implements IProvi
             searchDealer2.setLevel("1");
             searchDealer2.setType("5");
             searchDealer2.setName(carCommercial.getEnginetype());
+
             list.add(searchDealer2);
 
             searchDealerMapper.insertList(list);