Browse Source

201910251855

caolong 5 years ago
parent
commit
bd27ad2ca9

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

@@ -558,7 +558,7 @@ public class DealerSearchController extends BaseController {
     /**
      * 点击单车件/全车件
      *
-     * @param name 单件/全车件
+     * @param name 单件/全车件
      * @return
      */
     @RequestMapping(value = "/click_single_car", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
@@ -567,7 +567,7 @@ public class DealerSearchController extends BaseController {
         if (StringUtils.isBlank(name)) return new ApiMessage<>(false, AppConst.FAIL_CODE, "参数不能为空!");
         UserInfo userinfo = getUserInfo(token);
         try {
-            if ("单件".equals(name)) {
+            if ("单件".equals(name)) {
                 ServiceCategoryVo vo = new ServiceCategoryVo( );
                 ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(name, CommonCons.STORE_TYPE_TWO);
                 List< ServiceCategory > serviceCategories = iServiceCategoryService.listAllSecondServiceById(serviceCategory.getId( ), CommonCons.STORE_TYPE_TWO);

+ 26 - 14
src/main/java/com/yc/education/controller/ProductController.java

@@ -92,35 +92,35 @@ public class ProductController extends BaseController {
     @RequestMapping(value = "get_product", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
     public ApiMessage<Object> getProduct(String id) {
         if (StringUtils.isBlank(id)) return new ApiMessage<>(false, "400", "id不能为空!");
-
+        //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
         Long Id = Long.valueOf(id);
         try {
             Product product = productService.getOne(Id);
             Provider provider = getProviderInfo(product.getStoreId());
             if (StringUtils.isNotBlank(provider.getParamType())) {
                 ArrayList<String> list = new ArrayList<>();
-                if (Objects.equals("1", provider.getParamType())) {
+                if (Objects.equals("1", provider.getParamType()) || Objects.equals("5", provider.getParamType())) {
                     //单项件
                     product.setArr(list.toArray());
                 }
-                if (Objects.equals("2", provider.getParamType())) {
+                if (Objects.equals("3", provider.getParamType())) {
                     //用品改装
                     ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(product.getfName(), CommonCons.STORE_TYPE_TWO);
                     List<ServiceCategory> serviceCategories = iServiceCategoryService.listAllSecondServiceById(serviceCategory.getId(), CommonCons.STORE_TYPE_TWO);
                     product.setArr(serviceCategories.toArray());
                 }
-                if (Objects.equals("3", provider.getParamType())) {
+                if (Objects.equals("4", provider.getParamType())) {
                     //汽保设备与工具
                     ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(product.getfName(), CommonCons.STORE_TYPE_TWO);
                     List<ServiceCategory> serviceCategories = iServiceCategoryService.listAllSecondServiceById(serviceCategory.getId(), CommonCons.STORE_TYPE_TWO);
                     product.setArr(serviceCategories.toArray());
                 }
-                if (Objects.equals("4", provider.getParamType())) {
+                if (Objects.equals("2", provider.getParamType())) {
                     //全车件
                     List<CarSedan> carSedanList = iCarSedanService.listCarSedanByCountry();
                     product.setArr(carSedanList.toArray());
                 }
-                if (Objects.equals("5", provider.getParamType())) {
+                if (Objects.equals("6", provider.getParamType())) {
                     //商用车
                     List<CarCommercial> carCommercialList = iCarCommerialService.listCarCommercialByCategory();
                     product.setArr(carCommercialList.toArray());
@@ -143,20 +143,32 @@ public class ProductController extends BaseController {
     @RequestMapping(value = "click_continue", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
     public ApiMessage<Object> clickSaveReturnString(String token) {
         if (StringUtils.isBlank(token)) return new ApiMessage<>(false, "400", "token不能为空!");
-
+        //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
         try {
             Provider provider = getProviderInfo(token);
             ClickContinueProductVo vo = new ClickContinueProductVo();
             if (StringUtils.isNotBlank(provider.getParamType())) {
                 ArrayList< ProductNameVo > list = new ArrayList<>();
 
-
                 if (Objects.equals("1", provider.getParamType())) {
                     //单项件
-                    vo.setfName("单项件");
+                    vo.setfName("汽车配件");
+                    ProductNameVo productNameVo = new ProductNameVo( );
+                    productNameVo.setName("单项件");
+                    list.add(productNameVo);
                     vo.setArr(list.toArray());
                 }
-                if (Objects.equals("2", provider.getParamType())) {
+
+                if (Objects.equals("5", provider.getParamType())) {
+                    //单项件
+                    vo.setfName("商用车");
+                    ProductNameVo productNameVo = new ProductNameVo( );
+                    productNameVo.setName("单项件");
+                    list.add(productNameVo);
+                    vo.setArr(list.toArray());
+                }
+
+                if (Objects.equals("3", provider.getParamType())) {
                     //用品改装
                     String name = "用品改装";
                     ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(name, CommonCons.STORE_TYPE_TWO);
@@ -170,7 +182,7 @@ public class ProductController extends BaseController {
                     }
                     vo.setArr(list.toArray());
                 }
-                if (Objects.equals("3", provider.getParamType())) {
+                if (Objects.equals("4", provider.getParamType())) {
                     //汽保设备与工具
                     String name = "汽保设备与工具";
                     ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(name, CommonCons.STORE_TYPE_TWO);
@@ -183,10 +195,10 @@ public class ProductController extends BaseController {
                     }
                     vo.setArr(list.toArray());
                 }
-                if (Objects.equals("4", provider.getParamType())) {
+                if (Objects.equals("2", provider.getParamType())) {
                     //全车件
                     List<CarSedan> carSedanList = iCarSedanService.listCarSedanByCountry();
-                    vo.setfName("全车件");
+                    vo.setfName("汽车配件");
                     for (CarSedan carSedan : carSedanList) {
                         ProductNameVo pvo = new ProductNameVo( );
                         pvo.setName(carSedan.getCountry());
@@ -194,7 +206,7 @@ public class ProductController extends BaseController {
                     }
                     vo.setArr(list.toArray());
                 }
-                if (Objects.equals("5", provider.getParamType())) {
+                if (Objects.equals("6", provider.getParamType())) {
                     //商用车
                     List<CarCommercial> carCommercialList = iCarCommerialService.listCarCommercialByCategory();
                     vo.setfName("商用车");

+ 11 - 8
src/main/java/com/yc/education/controller/ProviderSearchController.java

@@ -211,20 +211,23 @@ public class ProviderSearchController extends BaseController {
                     ServiceCategory serviceCategory1 = serviceCategoryMapper.listAllSecondServiceByName(bigSearchName, CommonCons.STORE_TYPE_ONE);
                     List< ServiceCategory > serviceCategoriesTwo = serviceCategoryMapper.listAllSecondService(1, serviceCategory1.getId( ) + "", null);
                     if (CollectionUtils.isNotEmpty(serviceCategoriesTwo)) {
-                        boolean istrue = false;
+                   //     boolean istrue = false;
                         for (int i = 0; i < serviceCategoriesTwo.size( ); i++) {
                             serviceCategoriesTwo.get(i).setIds("y" + serviceCategoriesTwo.get(i).getId( ));
-                            if (serviceCategoriesTwo.get(i).getName( ).equals(searchName)) {
+/*                            if (serviceCategoriesTwo.get(i).getName( ).equals(searchName)) {
                                 serviceCategoriesTwo.remove(i);
                                 i--;
                                 istrue = true;
-                            }
-                        }
-                        if (istrue) {
-                            ServiceCategory serviceCategory = new ServiceCategory( );
-                            serviceCategory.setName(searchName);
-                            serviceCategoriesTwo.add(0, serviceCategory);
+                            }*/
                         }
+                        ServiceCategory serviceCategory = new ServiceCategory( );
+                        serviceCategory.setName("全部");
+                        serviceCategoriesTwo.add(0, serviceCategory);
+/*                       if (istrue) {
+                            ServiceCategory serviceCategorys = new ServiceCategory( );
+                            serviceCategorys.setName(searchName);
+                            serviceCategoriesTwo.add(1, serviceCategorys);
+                        }*/
 
                         conditionVo.setCategoryTwo(serviceCategoriesTwo.toArray( ));             //设置二级分类
                     }

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

@@ -55,16 +55,20 @@ public class ServiceCategoryController extends BaseController {
     private ISearchProviderService iSearchProviderService;
 
     /**
-     * @param name 单件/全车件/商用车/汽车用品
+     * @param name 单件/全车件/商用车/汽车用品
      * @return
      */
     @RequestMapping(value = "/type", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
     public ApiMessage< Object > getType(String name) {
-        ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(name, CommonCons.STORE_TYPE_TWO);
-
+        //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+        String sName = name;
+        if("汽车配件(单项件)".equals(name) || "商用车(单项件)".equals(name)){
+            sName = "单项件";
+        }
+        ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(sName, CommonCons.STORE_TYPE_TWO);
         try {
-            //单向件两层 , 其他三层
-            if ("用品改装".equals(name) || "汽保设备与工具".equals(name) || "单向件".equals(name)) {
+            //单件两层 , 其他三层
+            if ("用品改装".equals(name) || "汽保设备与工具".equals(name) || "单项件".equals(sName) || "单项件".equals(sName)) {
 
                 ThreeLayersVo tvo = new ThreeLayersVo( );
                 tvo.setName(name);
@@ -102,7 +106,7 @@ public class ServiceCategoryController extends BaseController {
                 return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, tvo);
             }
 
-            if ("全车件".equals(name)) {
+            if ("汽车配件(全车件)".equals(name)) {
                 CarSedanVo vo = new CarSedanVo( );
                 List< CarSedan > carSedans = iCarSedanService.listCarSedanByCountry( );
                 if (CollectionUtils.isNotEmpty(carSedans)) {
@@ -140,7 +144,7 @@ public class ServiceCategoryController extends BaseController {
                 return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
             }
 
-            if ("商用车".equals(name)) {
+            if ("商用车(全车件)".equals(name)) {
                 CarCommercialVo vo = new CarCommercialVo( );
                 List< CarCommercial > carCommercials = iCarCommerialService.listCarCommercialByCategory( );
                 if (CollectionUtils.isNotEmpty(carCommercials)) {

+ 24 - 0
src/main/java/com/yc/education/interceptor/Listen.java

@@ -0,0 +1,24 @@
+package com.yc.education.interceptor;
+
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ProjectName: nvrnetwork
+ * @Package: com.yc.education.interceptor
+ * @ClassName: Listen
+ * @Author: Jzdsh
+ * @Description:
+ * @Date: 2019/10/25 18:24
+ * @Version: 1.0
+ */
+@Component
+public class Listen {
+
+    @Scheduled(cron="*/5 * * * * ?")   //每5分钟执行一次
+    public void myTest1() {
+        System.out.println("定时器执行.................................." );
+    }
+
+    
+}

+ 110 - 59
src/main/java/com/yc/education/service/impl/ProviderServiceImpl.java

@@ -125,6 +125,23 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
         // 类型 lc 2019.10.11
         provider.setParamType(paramType);
 
+
+        if (Objects.equals(CommonCons.STORE_TYPE_ONE, provider.getRoleType( ))) {
+            if (Objects.equals("1", paramType)) {
+                provider.setCompanyType("快修连锁店"); //企业类型 (以下都是默认值)
+                provider.setIntelligence("三类"); // 经营资质
+                provider.setMainBrand("各种车型"); //主营品牌
+            } else if (Objects.equals("2", paramType)) {
+                provider.setCompanyType("综合修理厂"); //企业类型
+                provider.setIntelligence("二类"); // 经营资质
+            } else if (Objects.equals("3", paramType)) {
+                provider.setCompanyType("专项修理"); //企业类型
+                provider.setIntelligence("二类"); // 经营资质
+                provider.setMainBrand("专营车型"); //主营品牌
+            }
+
+        }
+
         providerMapper.insertUseGeneratedKeys(provider);
 
         //服务商的时候
@@ -136,7 +153,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             }
             // 4s 店
             if ("3".equals(paramType)) {
-                fourS_save(provider.getId(),providerVo.getMianBusiness(),providerVo.getpMainBusiness());
+                fourS_save(provider.getId( ), providerVo.getMianBusiness( ), providerVo.getpMainBusiness( ));
             }
 
         }
@@ -144,63 +161,62 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
 
         //当是经销商的时候   添加经销商搜索
         if (Objects.equals(CommonCons.STORE_TYPE_TWO, provider.getRoleType( ))) {
-
             // 先把 自己 信息删除一下
             searchDealerMapper.deleteByStoreId(provider.getId( ));
 
-            // 1 代表是 普通类型
-            if ("1".equals(paramType) || "2".equals(paramType) || "3".equals(paramType)) {
+            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+            if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
                 saveSearchDealer(providerVo.getParamType( ), provider.getId( ), providerVo.getMianBusiness( ));
             }
-            //  4 代表全车件
-            if ("4".equals(paramType)) {
+            //  2 代表全车件
+            if ("2".equals(paramType)) {
                 saveAllCar(provider.getId( ), providerVo.getMianBusiness( ));
             }
-            // 5 代表商务车
-            if ("5".equals(paramType)) {
+            // 6 代表商务车
+            if ("6".equals(paramType)) {
                 saveCommercial(provider.getId( ), providerVo.getMianBusiness( ));
             }
         }
     }
 
-    private void fourS_save(Long storeId,String brand, String mainBusiness) {
-        if(StringUtils.isBlank(mainBusiness) || StringUtils.isBlank(brand)) return;
+    private void fourS_save(Long storeId, String brand, String mainBusiness) {
+        if (StringUtils.isBlank(mainBusiness) || StringUtils.isBlank(brand)) return;
         String[] split = mainBusiness.split(",");
         String[] split1 = brand.split(",");
         ArrayList< SearchProvider > spList = new ArrayList<>( );
 
         int i = 0;
         for (String factory : split) {
-            List<BrandFourS> brandFourSList = brandFourSMapper.listAllByFactoryAndBrand(split1[i],factory);
-            if(CollectionUtils.isNotEmpty(brandFourSList)){
+            List< BrandFourS > brandFourSList = brandFourSMapper.listAllByFactoryAndBrand(split1[i], factory);
+            if (CollectionUtils.isNotEmpty(brandFourSList)) {
                 for (BrandFourS brandFourS : brandFourSList) {
                     SearchProvider sp = new SearchProvider( );
                     sp.setLevel("1");
-                    sp.setpName(brandFourS.getBrand());
-                    sp.setName(brandFourS.getFactory());
+                    sp.setpName(brandFourS.getBrand( ));
+                    sp.setName(brandFourS.getFactory( ));
                     sp.setStoreId(storeId);
                     sp.setType("3");
                     spList.add(sp);
 
                     SearchProvider sp1 = new SearchProvider( );
                     sp1.setLevel("2");
-                    sp1.setpName(brandFourS.getBrand());
-                    sp1.setName(brandFourS.getBrand());
+                    sp1.setpName(brandFourS.getBrand( ));
+                    sp1.setName(brandFourS.getBrand( ));
                     sp1.setStoreId(storeId);
                     sp1.setType("3");
                     spList.add(sp1);
 
                     SearchProvider sp2 = new SearchProvider( );
                     sp2.setLevel("3");
-                    sp2.setpName(brandFourS.getBrand());
-                    sp2.setName(brandFourS.getCategory());
+                    sp2.setpName(brandFourS.getBrand( ));
+                    sp2.setName(brandFourS.getCategory( ));
                     sp2.setStoreId(storeId);
                     sp2.setType("3");
                     spList.add(sp2);
 
                     SearchProvider sp3 = new SearchProvider( );
                     sp3.setLevel("4");
-                    sp3.setpName(brandFourS.getBrand());
+                    sp3.setpName(brandFourS.getBrand( ));
                     sp3.setName("4S店");
                     sp3.setStoreId(storeId);
                     sp3.setType("3");
@@ -227,9 +243,9 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             if (pMains.length > 0) {
                 for (String main : pMains) {
                     String role = CommonCons.STORE_TYPE_ONE;
-                    if("道路救援".equals(main)) role = "3";
+                    if ("道路救援".equals(main)) role = "3";
                     ServiceCategory categoryList = serviceCategoryService.listAllSecondServiceByName(main, role);
-                    if(categoryList !=null){
+                    if (categoryList != null) {
                         List< String > namesList = serviceCategoryService.listAllNameByPid(categoryList.getId( ));
                         if (mainList != null && mainList.size( ) > 0) {
                             for (String name : mainList) {
@@ -423,25 +439,30 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
                 int count1 = productMapper.selectCountByExample(example);   // 优势产品个数
                 provider.setServiceItem(String.valueOf(count1).concat("条"));
 
+                //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
                 if (Objects.equals("1", provider.getParamType( ))) {
                     //单项件
-                    provider.setMainName("单向件");
+                    provider.setMainName("汽车配件(单项件)");
                 }
                 if (Objects.equals("2", provider.getParamType( ))) {
                     //用品改装
-                    provider.setMainName("用品改装");
+                    provider.setMainName("汽车配件(全车件)");
                 }
                 if (Objects.equals("3", provider.getParamType( ))) {
                     //汽保设备与工具
-                    provider.setMainName("汽保设备与工具");
+                    provider.setMainName("用品改装");
                 }
                 if (Objects.equals("4", provider.getParamType( ))) {
                     //全车件
-                    provider.setMainName("全车件");
+                    provider.setMainName("汽保设备与工具");
                 }
                 if (Objects.equals("5", provider.getParamType( ))) {
                     //商用车
-                    provider.setMainName("商用车");
+                    provider.setMainName("商用车(单项件)");
+                }
+                if (Objects.equals("6", provider.getParamType( ))) {
+                    //商用车
+                    provider.setMainName("商用车(全车件)");
                 }
             }
             // 增加 //营业时间范围 "周一至周五  7:00 - 17:00"
@@ -484,23 +505,23 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
 
         Provider provider = getProviderByUserId(token);
         //2019.9.6      lc add
-        if (providerVo.getName( ) != null) {
+        if (StringUtils.isNotBlank(providerVo.getName( ))) {
             provider.setName(providerVo.getName( )); //店铺名称
         }
         //2019.9.6      lc add
-        if (providerVo.getCompanyName( ) != null) {        //企业名称
+        if (StringUtils.isNotBlank(providerVo.getCompanyName( ))) {        //企业名称
             provider.setCompanyName(providerVo.getCompanyName( ));
         }
 
         String address = "";
-        if (providerVo.getCity( ) != null) {           //城市 省市县
+        if (StringUtils.isNotBlank(providerVo.getCity( ))) {           //城市 省市县
             String[] split = providerVo.getCity( ).split(",+");
             provider.setProvince(split[0]);         //省
             provider.setCity(split[1]);             //市
             provider.setDistrict(split[2]);         //县
             address = providerVo.getCity( ).replace(",", "");
         }
-        if (providerVo.getStree( ) != null) {          //街道
+        if (StringUtils.isNotBlank(providerVo.getStree( ))) {          //街道
             provider.setStree(providerVo.getStree( ));
             address += providerVo.getStree( );
         }
@@ -517,60 +538,90 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
                 provider.setLatitude(0 + "");     //默认
             }
         }
-        if (providerVo.getTelphone( ) != null) {       //商户电话
+        if (StringUtils.isNotBlank(providerVo.getTelphone( ))) {       //商户电话
             provider.setTelphone(providerVo.getTelphone( ));
         }
-        if (providerVo.getBusinessSdate( ) != null) {       //营业开始日期  周一-周五/周六 周日
+        if (StringUtils.isNotBlank(providerVo.getBusinessSdate( ))) {       //营业开始日期  周一-周五/周六 周日
             provider.setBusinessSdate(providerVo.getBusinessSdate( ));
         }
-        if (providerVo.getBusinessEdate( ) != null) {       //营业结束日期  周一-周五/周六 周日
+        if (StringUtils.isNotBlank(providerVo.getBusinessEdate( ))) {       //营业结束日期  周一-周五/周六 周日
             provider.setBusinessEdate(providerVo.getBusinessEdate( ));
         }
-        if (providerVo.getBusinessStime( ) != null) {      //营业起始时间
+        if (StringUtils.isNotBlank(providerVo.getBusinessStime( ))) {      //营业起始时间
             provider.setBusinessStime(providerVo.getBusinessStime( ));
         }
-        if (providerVo.getBusinessEtime( ) != null) {       //营业截止时间
+        if (StringUtils.isNotBlank(providerVo.getBusinessEtime( ))) {       //营业截止时间
             provider.setBusinessEtime(providerVo.getBusinessEtime( ));
         }
         if (providerVo.getBrandId( ) != null) {      //品牌id
             provider.setBrandId(providerVo.getBrandId( ));
         }
-        if (providerVo.getBrandName( ) != null) {      //品牌名称
+        if (StringUtils.isNotBlank(providerVo.getBrandName( ))) {      //品牌名称
             provider.setBrandName(providerVo.getBrandName( ));
         }
 
-        if (providerVo.getBusinessIntroduce( ) != null) {          //业务介绍
+        if (StringUtils.isNotBlank(providerVo.getBusinessIntroduce( ))) {          //业务介绍
             provider.setBusinessIntroduce(providerVo.getBusinessIntroduce( ));
         }
 
-        if (providerVo.getMianBusiness( ) != null) {              //主营业务
+        if (StringUtils.isNotBlank(providerVo.getMianBusiness( ))) {              //主营业务
             provider.setMianBusiness(providerVo.getMianBusiness( ));
         }
 
-        if(providerVo.getpMainBusiness() != null){
-            provider.setpMainBusiness(providerVo.getpMainBusiness());
-            if("3".equals(provider.getParamType())){
-                provider.setMianBusiness(providerVo.getpMainBusiness());
-            }
+        if (StringUtils.isNotBlank(providerVo.getpMainBusiness( ))) {
+            provider.setpMainBusiness(providerVo.getpMainBusiness( ));
         }
 
-        if (providerVo.getBrandName( ) != null) {                 //加入品牌  "杰冠网络"
+        if (StringUtils.isNotBlank(providerVo.getBrandName( ))) {                 //加入品牌  "杰冠网络"
             provider.setBrandName(providerVo.getBrandName( ));
         }
+
+        if (StringUtils.isNotBlank(providerVo.getCompanyType( ))) {
+            provider.setCompanyType(providerVo.getCompanyType( ));       // 企业类型
+        }
+
+        if (StringUtils.isNotBlank(providerVo.getMainBrand( ))) {
+            provider.setMainBrand(providerVo.getMainBrand( ));           // 主营品牌
+        }
+        if (StringUtils.isNotBlank(providerVo.getIntelligence( ))) {
+            provider.setIntelligence(providerVo.getIntelligence( ));         //经营资质
+        }
+        String paramType = provider.getParamType( );
+
         provider.setModifiedDate(new Date( ));
         Example example = new Example(Provider.class);
         example.createCriteria( ).andEqualTo("id", provider.getId( ));
 
-        if(providerVo.getpMainBusiness() != null && !"3".equals(provider.getParamType())){
-            // 先把 自己 信息删除一下
-            searchProviderMapper.deleteByStoreId(provider.getId( ));
-            providerSave(provider.getId(),providerVo.getpMainBusiness(),providerVo.getMianBusiness(),provider.getParamType());
-        }
-        if(providerVo.getpMainBusiness() != null && "3".equals(provider.getParamType())){
-            searchProviderMapper.deleteByStoreId(provider.getId( ));
-            fourS_save(provider.getId(),providerVo.getMianBusiness(),providerVo.getpMainBusiness());
+        if (CommonCons.STORE_TYPE_ONE.equals(provider.getRoleType( ))) {
+            if (providerVo.getpMainBusiness( ) != null && !"3".equals(paramType)) {
+                // 先删后增
+                searchProviderMapper.deleteByStoreId(provider.getId( ));
+                providerSave(provider.getId( ), providerVo.getpMainBusiness( ), providerVo.getMianBusiness( ), paramType);
+            }
+            if (providerVo.getpMainBusiness( ) != null && "3".equals(paramType)) {
+                searchProviderMapper.deleteByStoreId(provider.getId( ));
+                fourS_save(provider.getId( ), providerVo.getMianBusiness( ), providerVo.getpMainBusiness( ));
+            }
         }
 
+        //当是经销商的时候   添加经销商搜索
+        if (Objects.equals(CommonCons.STORE_TYPE_TWO, provider.getRoleType( ))) {
+            // 先把 自己 信息删除一下
+            searchDealerMapper.deleteByStoreId(provider.getId( ));
+
+            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+            if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
+                saveSearchDealer(providerVo.getParamType( ), provider.getId( ), providerVo.getMianBusiness( ));
+            }
+            //  2 代表全车件
+            if ("2".equals(paramType)) {
+                saveAllCar(provider.getId( ), providerVo.getMianBusiness( ));
+            }
+            // 6 代表商务车(全车件)
+            if ("6".equals(paramType)) {
+                saveCommercial(provider.getId( ), providerVo.getMianBusiness( ));
+            }
+        }
         return providerMapper.updateByExampleSelective(provider, example);
     }
 
@@ -770,16 +821,16 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
         if (StringUtils.isNotBlank(paramType) && StringUtils.isNotBlank(mainBusiness)) {
             searchDealerMapper.deleteByStoreId(provider.getId( ));
 
-            // 1 单项件   2 汽车改装  3 气保设备与工具
-            if (Objects.equals("1", paramType) || Objects.equals("2", paramType) || Objects.equals("3", paramType)) {
-                saveSearchDealer(paramType, provider.getId( ), provider.getMianBusiness( ));
+            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+            if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
+                saveSearchDealer(provider.getParamType( ), provider.getId( ), provider.getMianBusiness( ));
             }
-            // 4 全车件
-            if (Objects.equals("4", paramType)) {
+            //  2 代表全车件
+            if ("2".equals(paramType)) {
                 saveAllCar(provider.getId( ), provider.getMianBusiness( ));
             }
-            // 5商用
-            if (Objects.equals("5", paramType)) {
+            // 6 代表商务
+            if ("6".equals(paramType)) {
                 saveCommercial(provider.getId( ), provider.getMianBusiness( ));
             }
         }

+ 1 - 1
src/main/resources/mapper/ProviderMapper.xml

@@ -67,7 +67,7 @@
             a.id = b.store_id and a.role_type = 1 and a.user_id is not null
             and (a.province= #{province} and a.city= #{city} and a.district=#{district}
             <if test="searchName != null and searchName != ''">
-                and b.name = #{searchName}
+                and b.name like CONCAT('%',#{searchName},'%')
             </if>
             <if test="paramType != null and paramType != ''">
                 and b.type = #{paramType}

+ 18 - 1
src/main/resources/mybatis-servlet.xml

@@ -5,12 +5,16 @@
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns="http://www.springframework.org/schema/beans"
+       xmlns:task="http://www.springframework.org/schema/task"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans.xsd 
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc.xsd  
        http://www.springframework.org/schema/context 
-       http://www.springframework.org/schema/context/spring-context.xsd">
+       http://www.springframework.org/schema/context/spring-context.xsd
+       http://www.springframework.org/schema/task
+       http://www.springframework.org/schema/task/spring-task-4.1.xsd">
+
     <mvc:default-servlet-handler/>
 
     <!--RequestMappingHandlerAdapter-->
@@ -123,4 +127,17 @@
         <property name="maxUploadSize" value="10000000000"/>
     </bean>
 
+
+
+
+    <!-- 定时器 -->
+
+    <!-- task任务注解扫描包(定时器开关) -->
+    <task:annotation-driven/> <!-- 用定时器注解 -->
+
+    <!-- 扫描位置是 -->
+    <context:annotation-config/>
+    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
+    <context:component-scan base-package="com.yc.education.interceptor"/>
+
 </beans>