ソースを参照

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/yc/education/controller/admin/ProviderAdminController.java
wuzhiqiang 5 年 前
コミット
e241f53ab1

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

@@ -76,7 +76,7 @@ public class AuthCouponController extends BaseController {
                     innerVo.setMoney(authCoupon.getMoney( ));
                     innerVo.setMoneyTips("满300元可用");
                     innerVo.setName("附近养车网专项优惠券");
-                    innerVo.setNameTips("仅限认证 开通商城使用");
+                    innerVo.setNameTips("仅限商家认证时使用");
                     SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.FORMAT_YYYY_MM_DD);
                     innerVo.setValidity("有效期至 " + sdf.format(authCoupon.getPassDate( )));
                     innerVo.setIsUse(authCoupon.getIsUse( ));

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

@@ -359,8 +359,8 @@ public class DealerSearchController extends BaseController {
 
 
             Provider provider = getProviderInfo(token);
-            if(provider != null){
-                vo.setId(provider.getId());
+            if (provider != null) {
+                vo.setId(provider.getId( ));
             }
             //1 设置区域
             //获取省市县
@@ -405,9 +405,9 @@ public class DealerSearchController extends BaseController {
             Integer pageSize = CommonCons.PAGE_SIZE;        //每页显示数量
 
             List< ConditionDTO > searchDealerList;
-            searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, null, null, offset, pageSize,userinfo.getLongitude( ),userinfo.getLatitude());
+            searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
             //计算距离
-            listInner(vo, searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), null,null);
             //end
             //--
             //返回用户 认证信息
@@ -426,12 +426,12 @@ public class DealerSearchController extends BaseController {
     }
 
     //计算商家距离
-    private void listInner(Object obj,List<ConditionDTO> list,String sort,String dis,Integer offset,Integer pageSize,String longitude,String latitude){
+    private void listInner(Object obj, List< ConditionDTO > list, String sort, String dis, Integer offset, Integer pageSize, String longitude, String latitude, String searchName,String paramType) {
         //如果按当前市 没有查询到数据 ,就默认查全国范围 搜索最近的15条数据显示
-        if(CollectionUtils.isEmpty(list)) {
-            list = iSearchDealerService.listSearchDealer(null, null, null, null, null, offset, pageSize,longitude,latitude);
+        if (CollectionUtils.isEmpty(list)) {
+            list = iSearchDealerService.listSearchDealer(null, null, null, searchName, paramType, offset, pageSize, longitude, latitude);
         }
-        if(obj instanceof DealerSearchShowVo){
+        if (obj instanceof DealerSearchShowVo) {
             DealerSearchShowVo vo = (DealerSearchShowVo) obj;
             //计算距离
             List< DealerSearchShowVo.InnerDealerSearch > listInner = new ArrayList<>( );
@@ -450,7 +450,7 @@ public class DealerSearchController extends BaseController {
                     if (listMainBusiness != null) {
                         innerProvider.setMainBusinessArr(listMainBusiness.toArray( ));
                     }
-                    String format = String.format("%.0f", provider.getDistance() * 1000);
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
                     innerProvider.setDistance(format);
                     listInner.add(innerProvider);
                 }
@@ -465,10 +465,10 @@ public class DealerSearchController extends BaseController {
                     innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
                 }
             }
-            vo.setProvider(listInner.toArray());
+            vo.setProvider(listInner.toArray( ));
         }
 
-        if(obj instanceof  ConditionVo){
+        if (obj instanceof ConditionVo) {
             ConditionVo vo = (ConditionVo) obj;
             //计算距离
             List< ConditionVo.innerProvider > listInner = new ArrayList<>( );
@@ -484,7 +484,7 @@ public class DealerSearchController extends BaseController {
                     innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
                     innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
                     innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
-                    String format = String.format("%.0f", provider.getDistance() * 1000);
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
                     innerProvider.setDistance(format);
                     listInner.add(innerProvider);
                 }
@@ -512,6 +512,179 @@ public class DealerSearchController extends BaseController {
         }
 
 
+        if (obj instanceof ClickAllCarVo) {
+            ClickAllCarVo vo = (ClickAllCarVo) obj;
+            //计算距离
+            List< ClickAllCarVo.InnerClickAllCar > listInner = new ArrayList<>( );
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (ConditionDTO provider : list) {
+                    ClickAllCarVo.InnerClickAllCar innerProvider = vo.new InnerClickAllCar( );
+                    innerProvider.setId(provider.getId( ) + "");                 //主键id
+                    innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
+                    innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
+                    innerProvider.setName(provider.getName( ));                  //商店名称
+                    innerProvider.setMainBusiness(provider.getMainBusiness( ));
+                    innerProvider.setStreet(provider.getStreet( ));               //地址
+                    innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
+                    innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
+                    innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
+                    innerProvider.setDistance(format);
+                    listInner.add(innerProvider);
+                }
+            }
+            Collections.sort(listInner, vo.new InnerClickAllCar( ));
+
+            for (ClickAllCarVo.InnerClickAllCar innerProvider : listInner) {
+                double distance = Double.parseDouble(innerProvider.getDistance( ));
+                if (distance >= 1000) {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance / 1000) + "km");
+                } else {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
+                }
+            }
+            vo.setProvider(listInner.toArray( ));
+        }
+
+
+        if (obj instanceof ClickCommonVo) {
+            ClickCommonVo vo = (ClickCommonVo) obj;
+            //计算距离
+            List< ClickCommonVo.InnerProvder > listInner = new ArrayList<>( );
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (ConditionDTO provider : list) {
+                    ClickCommonVo.InnerProvder innerProvider = vo.new InnerProvder( );
+                    innerProvider.setId(provider.getId( ) + "");                 //主键id
+                    innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
+                    innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
+                    innerProvider.setName(provider.getName( ));                  //商店名称
+                    innerProvider.setMainBusiness(provider.getMainBusiness( ));
+                    innerProvider.setStreet(provider.getStreet( ));               //地址
+                    innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
+                    innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
+                    innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
+                    innerProvider.setDistance(format);
+                    listInner.add(innerProvider);
+                }
+            }
+            Collections.sort(listInner, vo.new InnerProvder( ));
+
+            for (ClickCommonVo.InnerProvder innerProvider : listInner) {
+                double distance = Double.parseDouble(innerProvider.getDistance( ));
+                if (distance >= 1000) {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance / 1000) + "km");
+                } else {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
+                }
+            }
+            vo.setProvider(listInner.toArray( ));
+        }
+
+        if (obj instanceof ClickCommercialVo) {
+            ClickCommercialVo vo = (ClickCommercialVo) obj;
+            //计算距离
+            List< ClickCommercialVo.InnerProvider > listInner = new ArrayList<>( );
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (ConditionDTO provider : list) {
+                    ClickCommercialVo.InnerProvider innerProvider = vo.new InnerProvider( );
+                    innerProvider.setId(provider.getId( ) + "");                 //主键id
+                    innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
+                    innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
+                    innerProvider.setName(provider.getName( ));                  //商店名称
+                    innerProvider.setMainBusiness(provider.getMainBusiness( ));
+                    innerProvider.setStreet(provider.getStreet( ));               //地址
+                    innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
+                    innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
+                    innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
+                    innerProvider.setDistance(format);
+                    listInner.add(innerProvider);
+                }
+            }
+            Collections.sort(listInner, vo.new InnerProvider( ));
+
+            for (ClickCommercialVo.InnerProvider innerProvider : listInner) {
+                double distance = Double.parseDouble(innerProvider.getDistance( ));
+                if (distance >= 1000) {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance / 1000) + "km");
+                } else {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
+                }
+            }
+            vo.setProvider(listInner.toArray( ));
+        }
+
+
+
+
+        if (obj instanceof ServiceCategoryVo) {
+            ServiceCategoryVo vo = (ServiceCategoryVo) obj;
+            //计算距离
+            List< ServiceCategoryVo.InnerClickAllCar > listInner = new ArrayList<>( );
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (ConditionDTO provider : list) {
+                    ServiceCategoryVo.InnerClickAllCar innerProvider = vo.new InnerClickAllCar( );
+                    innerProvider.setId(provider.getId( ) + "");                 //主键id
+                    innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
+                    innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
+                    innerProvider.setName(provider.getName( ));                  //商店名称
+                    innerProvider.setMainBusiness(provider.getMainBusiness( ));
+                    innerProvider.setStreet(provider.getStreet( ));               //地址
+                    innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
+                    innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
+                    innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
+                    innerProvider.setDistance(format);
+                    listInner.add(innerProvider);
+                }
+            }
+            Collections.sort(listInner, vo.new InnerClickAllCar( ));
+            for (ServiceCategoryVo.InnerClickAllCar innerProvider : listInner) {
+                double distance = Double.parseDouble(innerProvider.getDistance( ));
+                if (distance >= 1000) {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance / 1000) + "km");
+                } else {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
+                }
+            }
+            vo.setProvider(listInner.toArray( ));
+        }
+
+
+        if (obj instanceof ClickAllCarVo) {
+            ClickAllCarVo vo = (ClickAllCarVo) obj;
+            //计算距离
+            List< ClickAllCarVo.InnerClickAllCar > listInner = new ArrayList<>( );
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (ConditionDTO provider : list) {
+                    ClickAllCarVo.InnerClickAllCar innerProvider = vo.new InnerClickAllCar( );
+                    innerProvider.setId(provider.getId( ) + "");                 //主键id
+                    innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
+                    innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
+                    innerProvider.setName(provider.getName( ));                  //商店名称
+                    innerProvider.setMainBusiness(provider.getMainBusiness( ));
+                    innerProvider.setStreet(provider.getStreet( ));               //地址
+                    innerProvider.setIsHot(provider.getIsHot( ));                //是否推荐 1是
+                    innerProvider.setStatus(provider.getStatus( ));              //是否认证 1是
+                    innerProvider.setMainBusinessArr(commonService.getListMainBusiness(provider.getpMainBusiness( )).toArray( ));
+                    String format = String.format("%.0f", provider.getDistance( ) * 1000);
+                    innerProvider.setDistance(format);
+                    listInner.add(innerProvider);
+                }
+            }
+            Collections.sort(listInner, vo.new InnerClickAllCar( ));
+
+            for (ClickAllCarVo.InnerClickAllCar innerProvider : listInner) {
+                double distance = Double.parseDouble(innerProvider.getDistance( ));
+                if (distance >= 1000) {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance / 1000) + "km");
+                } else {
+                    innerProvider.setDistance("距您" + String.format("%.0f", distance) + "m");
+                }
+            }
+            vo.setProvider(listInner.toArray( ));
+        }
 
         //--end
     }
@@ -563,11 +736,11 @@ public class DealerSearchController extends BaseController {
             Integer pageSize = CommonCons.PAGE_SIZE;        //每页显示数量
 
             List< ConditionDTO > searchDealerList;
-            searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
 
 
             //计算距离
-            listInner(vo,searchDealerList,sort,dis,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            listInner(vo, searchDealerList, sort, dis, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), searchName,paramType);
             //--end
 
             //返回用户 认证信息
@@ -653,9 +826,9 @@ public class DealerSearchController extends BaseController {
 
 
             //商家信息
-            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, null, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
             //计算距离
-            listInner(vo,searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), searchName,null);
             //--end
             //返回用户 认证信息
             UserStatus status = commonService.getUserStatus(userinfo.getId( ));
@@ -743,9 +916,9 @@ public class DealerSearchController extends BaseController {
                 }
 
 
-                List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, name, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+                List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, name, paramType, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
                 //计算距离
-                listInner(vo,searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+                listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), name,paramType);
                 //--end
 
                 //返回用户 认证信息
@@ -800,9 +973,9 @@ public class DealerSearchController extends BaseController {
                 }
 
                 //商家信息
-                List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, name, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+                List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, name, paramType, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
                 //计算距离
-                listInner(vo,searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+                listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), name,paramType);
                 //--end
 
                 //返回用户 认证信息
@@ -876,9 +1049,9 @@ public class DealerSearchController extends BaseController {
             String district = map.get("district");
 
             //商家信息
-            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
             //计算距离
-            listInner(vo,searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), searchName,paramType);
             //--end
             //返回用户 认证信息
             UserStatus status = commonService.getUserStatus(userinfo.getId( ));
@@ -966,9 +1139,9 @@ public class DealerSearchController extends BaseController {
             String city = map.get("city");
             String district = map.get("district");
 
-            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            List< ConditionDTO > searchDealerList = iSearchDealerService.listSearchDealer(province, city, district, searchName, paramType, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ));
             //计算距离
-            listInner(vo,searchDealerList,null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());
+            listInner(vo, searchDealerList, null, null, offset, pageSize, userinfo.getLongitude( ), userinfo.getLatitude( ), searchName,paramType);
             //--end
             //返回用户 认证信息
             UserStatus status = commonService.getUserStatus(userinfo.getId( ));

+ 53 - 17
src/main/java/com/yc/education/controller/ProductController.java

@@ -269,7 +269,7 @@ public class ProductController extends BaseController {
                 p.setStoreId(provider.getId( )); //商家id
 
 
-                p.setfName(serviceCategoryByPid.getName()); // 一级父name
+                p.setfName(serviceCategoryByPid.getName( )); // 一级父name
                 p.setsName(product.getsName( )); //二级子name
                 p.setImg(product.getImg( )); //图片
                 p.setIntroduce(product.getIntroduce( )); //介绍
@@ -282,7 +282,7 @@ public class ProductController extends BaseController {
             } else {
                 //更新
                 Product p = productService.getOne(product.getId( ));
-                p.setfName(serviceCategoryByPid.getName()); // 一级父name
+                p.setfName(serviceCategoryByPid.getName( )); // 一级父name
                 p.setsName(product.getsName( )); //二级子name
                 p.setImg(product.getImg( )); //图片
                 p.setIntroduce(product.getIntroduce( )); //介绍
@@ -379,28 +379,64 @@ public class ProductController extends BaseController {
     }
 
 
+    /**
+     * 经销商 id
+     * @param storeId
+     * @param fName
+     * @return
+     */
     @RequestMapping(value = "showProductChoose", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
-    public ApiMessage<Object> showProductChoose(String token){
-        if (StringUtils.isBlank(token)) return new ApiMessage<>(true, AppConst.FAIL_CODE, "token不能为空");
+    public ApiMessage< Object > showProductChoose(Long storeId, String fName) {
+        if (storeId == null) return new ApiMessage<>(true, AppConst.FAIL_CODE, "storeId不能为空");
+        if (StringUtils.isBlank(fName)) fName = "全部";
         try {
-            Provider provider = getProviderInfo(token);
-            Long storeId = provider.getId( );
-            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
-            ProduceChooseVo vo = new ProduceChooseVo( );
-            List< SearchDealer > searchDealerList = iSearchDealerService.listLevelGroupPName(storeId, "1");
-            vo.setCategory(searchDealerList);
-            if (CollectionUtils.isNotEmpty(searchDealerList)) {
-                ArrayList< Object > list = new ArrayList<>( );
-                for (SearchDealer searchDealer : searchDealerList) {
+
+            if ("全部".equals(fName)) {
+                // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+                ProduceChooseVo vo = new ProduceChooseVo( );
+                List< SearchDealer > searchDealerList = iSearchDealerService.listLevelGroupPName(storeId, "1");
+                List< SearchDealer > sList = new ArrayList<>( );
+                sList.addAll(searchDealerList);
+                SearchDealer sd = new SearchDealer( );
+                sd.setpName("全部");
+                sd.setName("全部");
+                sList.add(0, sd);
+                vo.setCategory(sList);
+                if (CollectionUtils.isNotEmpty(searchDealerList)) {
+                    ArrayList< Object > list = new ArrayList<>( );
+                    for (SearchDealer searchDealer : searchDealerList) {
+                        ProduceChooseVo.Inner inner = vo.new Inner( );
+                        inner.setName(searchDealer.getpName( ));
+                        List< SearchDealer > searchDealers = iSearchDealerService.listLevelByPNameAndLevelGroupName(storeId, searchDealer.getpName( ), "1");
+                        inner.setArr(searchDealers.toArray( ));
+                        list.add(inner);
+                    }
+                    vo.setArr(list.toArray( ));
+                }
+                return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
+            } else {
+                // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+                ProduceChooseVo vo = new ProduceChooseVo( );
+                List< SearchDealer > searchDealerList = iSearchDealerService.listLevelGroupPName(storeId, "1");
+                List< SearchDealer > sList = new ArrayList<>( );
+                sList.addAll(searchDealerList);
+                SearchDealer sd = new SearchDealer( );
+                sd.setpName("全部");
+                sd.setName("全部");
+                sList.add(0, sd);
+                vo.setCategory(sList);
+                if (CollectionUtils.isNotEmpty(searchDealerList)) {
+                    ArrayList< Object > list = new ArrayList<>( );
                     ProduceChooseVo.Inner inner = vo.new Inner( );
-                    inner.setName(searchDealer.getpName( ));
-                    List< SearchDealer > searchDealers = iSearchDealerService.listLevelByPNameAndLevelGroupName(storeId, searchDealer.getpName( ), "1");
+                    inner.setName(fName);
+                    List< SearchDealer > searchDealers = iSearchDealerService.listLevelByPNameAndLevelGroupName(storeId, fName, "1");
                     inner.setArr(searchDealers.toArray( ));
                     list.add(inner);
+                    vo.setArr(list.toArray( ));
                 }
-                vo.setArr(list.toArray( ));
+                return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
             }
-            return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
+
         } catch (Exception e) {
             e.printStackTrace( );
         }

+ 83 - 20
src/main/java/com/yc/education/controller/ProviderSearchController.java

@@ -153,7 +153,6 @@ public class ProviderSearchController extends BaseController {
             }
 
 
-
             providerSearchVo.setRoleType(userinfo.getRole());
             //lc 2019.10.08
             //返回用户 认证信息
@@ -245,7 +244,28 @@ public class ProviderSearchController extends BaseController {
                 innerProvider.setImgLog(provider.getImgLog());              //公司log图
                 innerProvider.setCompanyName(provider.getCompanyName());    //公司/企业名称
                 innerProvider.setName(provider.getName());      //商店名称
-                innerProvider.setMainBusiness(provider.getpMainBusiness() == null?"":provider.getpMainBusiness()); //显示主营信息
+
+                //限制数量最多显示三个
+                if((provider.getpMainBusiness() != null)){
+                String ss = provider.getpMainBusiness( );
+                List< String > l = Arrays.asList(ss.split(","));
+
+                    if(l.size() > 3){
+                        List< String > list = l.subList(0, 3);
+                        StringBuilder sb = new StringBuilder( );
+                        for (int i = 0; i < list.size( ); i++) {
+                            if (i < list.size( ) - 1) {
+                                sb.append(list.get(i)).append(",");
+                            } else {
+                                sb.append(list.get(i));
+                            }
+                        }
+                        innerProvider.setMainBusiness(sb.toString());
+                    }else{
+                        innerProvider.setMainBusiness(provider.getpMainBusiness());
+                    }
+                }
+                //innerProvider.setMainBusiness(provider.getpMainBusiness() == null?"":provider.getpMainBusiness()); //显示主营信息
                 innerProvider.setStreet(provider.getStree());   //地址
                 innerProvider.setIsHot(provider.getIsHot());    //是否推荐 1是
                 innerProvider.setStatus(provider.getStatus());  //是否认证 1是
@@ -355,23 +375,12 @@ 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;
                         for (int i = 0; i < serviceCategoriesTwo.size( ); i++) {
                             serviceCategoriesTwo.get(i).setIds("y" + serviceCategoriesTwo.get(i).getId( ));
-/*                            if (serviceCategoriesTwo.get(i).getName( ).equals(searchName)) {
-                                serviceCategoriesTwo.remove(i);
-                                i--;
-                                istrue = true;
-                            }*/
                         }
                         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( ));             //设置二级分类
                     }
@@ -411,7 +420,7 @@ public class ProviderSearchController extends BaseController {
                 if ("4S店".equals(searchName)) paramType = "3";
                 providers = providerMapper.selectBySearchName(searchName, province, city, district, paramType, offset, pageSize,userinfo.getLongitude(),userinfo.getLatitude());  //搜索条件
                 if(CollectionUtils.isEmpty(providers)){
-                    providers = providerMapper.selectBySearchName(null, null, null, null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());  //搜索条件 区域信息
+                    providers = providerMapper.selectBySearchName(searchName, null, null, null,null,offset,pageSize,userinfo.getLongitude(),userinfo.getLatitude());  //搜索条件 区域信息
                 }
             }
 
@@ -422,7 +431,29 @@ public class ProviderSearchController extends BaseController {
                 innerProvider.setImgLog(provider.getImgLog( ));              //公司log图
                 innerProvider.setCompanyName(provider.getCompanyName( ));    //公司/企业名称
                 innerProvider.setName(provider.getName( ));      //商店名称
-                innerProvider.setMainBusiness(provider.getpMainBusiness( ) == null ? "" : provider.getpMainBusiness( )); //显示主营信息
+
+                //限制数量最多显示三个
+                if((provider.getpMainBusiness() != null)){
+                    String ss = provider.getpMainBusiness( );
+                    List< String > l = Arrays.asList(ss.split(","));
+
+                    if(l.size() > 3){
+                        List< String > list = l.subList(0, 3);
+                        StringBuilder sb = new StringBuilder( );
+                        for (int i = 0; i < list.size( ); i++) {
+                            if (i < list.size( ) - 1) {
+                                sb.append(list.get(i)).append(",");
+                            } else {
+                                sb.append(list.get(i));
+                            }
+                        }
+                        innerProvider.setMainBusiness(sb.toString());
+                    }else{
+                        innerProvider.setMainBusiness(provider.getpMainBusiness());
+                    }
+                }
+
+                //innerProvider.setMainBusiness(provider.getpMainBusiness( ) == null ? "" : provider.getpMainBusiness( )); //显示主营信息
                 innerProvider.setStreet(provider.getStree( ));   //地址
                 innerProvider.setIsHot(provider.getIsHot( ));    //是否推荐 1是
                 innerProvider.setStatus(provider.getStatus( ));  //是否认证 1是
@@ -483,6 +514,7 @@ public class ProviderSearchController extends BaseController {
 
             //2 小车 ,商用车
             ArrayList< String > typeList = new ArrayList<>( );
+            typeList.add("全部");
             typeList.add("小型车");
             typeList.add("商用车");
             vo.setType(typeList.toArray( ));
@@ -642,6 +674,7 @@ public class ProviderSearchController extends BaseController {
         Long StoreId = Long.valueOf(id);
         ProviderDetailVo pVo = new ProviderDetailVo( );
 
+        pVo.setStoreId(id);
 /*
         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);
@@ -711,19 +744,49 @@ public class ProviderSearchController extends BaseController {
             pVo.setBusinessTime("今日营业时间:" + provider.getBusinessStime( ) + "-" + provider.getBusinessEtime( ));
             pVo.setIntroduce(provider.getBusinessIntroduce( ));  //业务介绍
             if ("1".equals(roleType)) {
-                pVo.setMainBusiness(provider.getpMainBusiness( ) == null ? "" : provider.getpMainBusiness( )); //显示主营信息
+                String ss = provider.getpMainBusiness( );
+                List< String > l = Arrays.asList(ss.split(","));
+                if(l.size() > 3){
+                    List< String > list = l.subList(0, 3);
+                    StringBuilder sb = new StringBuilder( );
+                    for (int i = 0; i < list.size( ); i++) {
+                        if (i < list.size( ) - 1) {
+                            sb.append(list.get(i)).append(",");
+                        } else {
+                            sb.append(list.get(i));
+                        }
+                    }
+                    pVo.setMainBusiness(sb.toString());
+                }
+               // pVo.setMainBusiness(provider.getpMainBusiness( ) == null ? "" : provider.getpMainBusiness( )); //显示主营信息
             }
             if ("2".equals(roleType)) {
 
-                if (Objects.equals("1", provider.getParamType( )) || Objects.equals("2", provider.getParamType( )) || Objects.equals("3", provider.getParamType( ))) {
+/*                if (Objects.equals("1", provider.getParamType( )) || Objects.equals("2", provider.getParamType( )) || Objects.equals("3", provider.getParamType( ))) {
                     List< SearchDealer > list = iSearchDealerService.listLevelGroupName(provider.getId( ), "1");
-                    pVo.setMainBusiness(listChangeString(list));
+                    if(list.size() > 3){
+                        pVo.setMainBusiness(listChangeString( list.subList(0,3)));
+                    }else{
+                        pVo.setMainBusiness(listChangeString( list));
+                    }
+
                 }
                 if (Objects.equals("4", provider.getParamType( )) || Objects.equals("5", provider.getParamType( ))) {
                     List< SearchDealer > list = iSearchDealerService.listLevelGroupName(provider.getId( ), "2");
-                    pVo.setMainBusiness(listChangeString(list));
+                    if(list.size() > 3){
+                        pVo.setMainBusiness(listChangeString( list.subList(0,3)));
+                    }else{
+                        pVo.setMainBusiness(listChangeString( list));
+                    }
+                }*/
+
+                List< SearchDealer > list = iSearchDealerService.listLevelGroupName(provider.getId( ), "2");
+                if(list.size() > 3){
+                    pVo.setMainBusiness(listChangeString( list.subList(0,3)));
+                }else{
+                    pVo.setMainBusiness(listChangeString( list));
                 }
-                pVo.setMainBusiness(provider.getpMainBusiness( ));
+               //pVo.setMainBusiness(provider.getpMainBusiness( ));
             }
             //pVo.setMainBusiness(commonService.getListMainBusiness(provider));
             pVo.setName(provider.getName( ));        //店铺名称

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

@@ -58,12 +58,13 @@ public class ServiceCategoryController extends BaseController {
 
     /**
      * 经销商
-     * @param name 单项件/全车件/商用车/汽车用品
+     *
+     * @param name  单项件/全车件/商用车/汽车用品
      * @param token
      * @return
      */
     @RequestMapping(value = "/type", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
-    public ApiMessage< Object > getType(String name,String token) {
+    public ApiMessage< Object > getType(String name, String token) {
         //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
         String sName = name;
         try {
@@ -77,7 +78,7 @@ public class ServiceCategoryController extends BaseController {
                     ThreeLayersVo tvo = (ThreeLayersVo) CommonUtil.getSerialize(tbSerializes.get(0).getValue( ));
 
                     //这是修改返回的数据
-                    if(StringUtils.isNotBlank(token)){
+                    if (StringUtils.isNotBlank(token)) {
                         STypeVo svo = new STypeVo( );
                         List< ThreeLayersVo.InnerLayesO > layers = tvo.getLayers( );
                         Provider provider = getProviderInfo(token);
@@ -88,21 +89,21 @@ public class ServiceCategoryController extends BaseController {
                         for (String s : split) {
                             ServiceCategory serviceCategoryByName = serviceCategoryService.getServiceCategoryByName(s, CommonCons.STORE_TYPE_TWO);
                             STypeVo.InnerPM innerPM = svo.new InnerPM( );
-                            innerPM.setId(serviceCategoryByName.getId()+"");
+                            innerPM.setId(serviceCategoryByName.getId( ) + "");
                             innerPM.setName(s);
                             listpm.add(innerPM);
                         }
                         svo.setpMList(listpm);
 
                         String[] split1 = provider.getMianBusiness( ).split(";");
-                        int i=0;
+                        int i = 0;
                         ArrayList< Object > mList = new ArrayList<>( );
                         for (String s : split1) {
-                            STypeVo.InnerPM o = (STypeVo.InnerPM)listpm.get(i);
+                            STypeVo.InnerPM o = (STypeVo.InnerPM) listpm.get(i);
                             String[] split2 = s.split(",");
                             for (String s1 : split2) {
                                 STypeVo.InnerM innerM = svo.new InnerM( );
-                                innerM.setPid(o.getId());
+                                innerM.setPid(o.getId( ));
                                 innerM.setName(s1);
                                 mList.add(innerM);
                             }
@@ -115,14 +116,14 @@ public class ServiceCategoryController extends BaseController {
                         for (ThreeLayersVo.InnerLayesO layer : layers) {
                             List< ThreeLayersVo.InnerLayesT > innerTwo = layer.getInnerTwo( );
                             for (ThreeLayersVo.InnerLayesT innerLayesT : innerTwo) {
-                                if(mainList.contains(innerLayesT.getName())){
+                                if (mainList.contains(innerLayesT.getName( ))) {
                                     innerLayesT.setActive(1);
                                 }
                             }
                         }
                         HashMap< String, Object > map = new HashMap<>( );
-                        map.put("returnData",svo);
-                        map.put("serviceCategory",tvo);
+                        map.put("returnData", svo);
+                        map.put("serviceCategory", tvo);
                         return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, map);
                     }
                     //修改操作返回数据完!
@@ -167,7 +168,6 @@ public class ServiceCategoryController extends BaseController {
     }
 
 
-
     @RequestMapping(value = "/setType", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
     public ApiMessage< Object > setType(String name) {
         //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
@@ -189,7 +189,7 @@ public class ServiceCategoryController extends BaseController {
                         ThreeLayersVo.InnerLayesO innerOne = tvo.new InnerLayesO( );
                         innerOne.setId(category.getId( ) + "");
                         innerOne.setName(category.getName( ));
-                        innerOne.setActive(category.getActive());  //层级 打开关闭 判断用
+                        innerOne.setActive(category.getActive( ));  //层级 打开关闭 判断用
                         List< ServiceCategory > serviceCategories2 = serviceCategoryService.listServiceCategoryByPid(category.getId( ));
                         if (CollectionUtils.isNotEmpty(serviceCategories2)) {
                             ArrayList< ThreeLayersVo.InnerLayesT > list2 = new ArrayList<>( );
@@ -198,7 +198,7 @@ public class ServiceCategoryController extends BaseController {
                                 innerTwo.setId(category1.getId( ) + "");
                                 innerTwo.setName(category1.getName( ));
                                 innerTwo.setpId(category.getId( ) + "");
-                                innerTwo.setActive(category1.getActive());
+                                innerTwo.setActive(category1.getActive( ));
 
                                 List< ServiceCategory > serviceCategories3 = serviceCategoryService.listServiceCategoryByPid(category1.getId( ));
                                 if (CollectionUtils.isNotEmpty(serviceCategories3)) {
@@ -766,26 +766,58 @@ public class ServiceCategoryController extends BaseController {
 
     /**
      * 服务项目 详情显示
+     * @param storeId
+     * @param fName
+     * @return
      */
-    @RequestMapping(value = "showServiceItemChoose", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
-    public ApiMessage< Object > showServiceItemChoose(String token) {
-        if (StringUtils.isBlank(token)) return new ApiMessage<>(false, AppConst.FAIL_CODE, "token不为空");
-
+    @RequestMapping(value = "showServiceItemChoose", method = {RequestMethod.POST,RequestMethod.GET}, produces = {"application/json;charset=UTF-8"})
+    public ApiMessage< Object > showServiceItemChoose(Long storeId, String fName) {
+        if (storeId == null ) return new ApiMessage<>(false, AppConst.FAIL_CODE, "storeId不为空");
+        if(StringUtils.isBlank(fName)) fName = "全部";
         try {
-            //返回对象
-            ServiceCategoryVo vo = new ServiceCategoryVo( );
-            ArrayList< Object > list = new ArrayList<>( );
-
-            Provider provider = getProviderInfo(token);
-            List< String > bigType = iSearchProviderService.listBigType(provider.getId( ));
-            vo.setCategory(bigType); //首页显示
-            int i = 0;
-            for (String pName : bigType) {
-                i++;
+            if ("全部".equals(fName)) {
+                //返回对象
+                ServiceCategoryVo vo = new ServiceCategoryVo( );
+                ArrayList< Object > list = new ArrayList<>( );
+                List< String > bigType = iSearchProviderService.listBigType(storeId);
+                List<String > btype = new ArrayList<>();
+                btype.addAll(bigType);
+                btype.add(0, "全部");
+                vo.setCategory(btype); //首页显示
+                int i = 0;
+                for (String pName : bigType) {
+                    i++;
+                    ServiceCategoryVo.ContainItem containItem = vo.new ContainItem( );
+                    containItem.setTitle(pName);
+                    containItem.setId("y" + i);
+                    List< String > listTypebyName = iSearchProviderService.listTypeBypName(pName, storeId);
+
+                    ArrayList< Object > lst = new ArrayList<>( );
+                    if (CollectionUtils.isNotEmpty(listTypebyName)) {
+                        for (String name : listTypebyName) {
+                            ServiceCategoryVo.AllClass allClass = vo.new AllClass( );
+                            allClass.setId("y" + i);
+                            allClass.setTitle(name);
+                            lst.add(allClass);
+                        }
+                    }
+                    containItem.setArr(lst.toArray( ));
+                    list.add(containItem);
+                }
+                vo.setContain_rh_item_list(list.toArray( ));
+                return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
+            } else {
+                //返回对象
+                ServiceCategoryVo vo = new ServiceCategoryVo( );
+                ArrayList< Object > list = new ArrayList<>( );
+                List< String > bigType = iSearchProviderService.listBigType(storeId);
+                bigType.add(0, "全部");
+                vo.setCategory(bigType); //首页显示
+                int i = 0;
                 ServiceCategoryVo.ContainItem containItem = vo.new ContainItem( );
-                containItem.setTitle(pName);
+                containItem.setTitle(fName);
                 containItem.setId("y" + i);
-                List< String > listTypebyName = iSearchProviderService.listTypeBypName(pName, provider.getId( ));
+                List< String > listTypebyName = iSearchProviderService.listTypeBypName(fName, storeId);
 
                 ArrayList< Object > lst = new ArrayList<>( );
                 if (CollectionUtils.isNotEmpty(listTypebyName)) {
@@ -798,9 +830,11 @@ public class ServiceCategoryController extends BaseController {
                 }
                 containItem.setArr(lst.toArray( ));
                 list.add(containItem);
+                vo.setContain_rh_item_list(list.toArray( ));
+                return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
             }
-            vo.setContain_rh_item_list(list.toArray( ));
-            return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
+
+
         } catch (Exception e) {
             e.printStackTrace( );
         }
@@ -815,14 +849,14 @@ public class ServiceCategoryController extends BaseController {
      */
     @RequestMapping(value = "dealer_allCategory", method = {RequestMethod.GET, RequestMethod.POST}, produces = {"application/json;charset=UTF-8"})
     public ApiMessage< Object > dealerAllCategory(String name) {
-        if(StringUtils.isBlank(name)) name = "汽车配件";
+        if (StringUtils.isBlank(name)) name = "汽车配件";
         try {
             AllCategoryVo vo = new AllCategoryVo( );
             //添加品牌
             List< ServiceCategory > firstService = iServiceCategoryService.listAllFirstService(Integer.valueOf(CommonCons.STORE_TYPE_TWO));
             if (CollectionUtils.isNotEmpty(firstService)) vo.setCategory(firstService.toArray( ));
 
-            if("汽车配件".equals(name)) {
+            if ("汽车配件".equals(name)) {
                 // 添加系列
                 List< CarSedan > carSedanList = iCarSedanService.listCarSedanByCountry( );
                 if (CollectionUtils.isNotEmpty(carSedanList)) {
@@ -832,11 +866,11 @@ public class ServiceCategoryController extends BaseController {
                     vo.setAllCar(innerCar);
                 }
             }
-            if("商用车".equals(name)){
+            if ("商用车".equals(name)) {
                 List< CarCommercial > carCommercialList = iCarCommerialService.listCarCommercialByCategory( );
-                if(CollectionUtils.isNotEmpty(carCommercialList)){
+                if (CollectionUtils.isNotEmpty(carCommercialList)) {
                     for (CarCommercial carCommercial : carCommercialList) {
-                        carCommercial.setCountry(carCommercial.getCategory());
+                        carCommercial.setCountry(carCommercial.getCategory( ));
                     }
                     AllCategoryVo.InnerCar innerCar = vo.new InnerCar( );
                     innerCar.setName("全车件");
@@ -846,7 +880,7 @@ public class ServiceCategoryController extends BaseController {
             }
 
             String pname = name;
-            if("汽车配件".equals(name) || "商用车".equals(name)) pname = "单项件";
+            if ("汽车配件".equals(name) || "商用车".equals(name)) pname = "单项件";
 
             // 添加集合
             ServiceCategory serviceCategory = iServiceCategoryService.getServiceCategoryByName(pname, CommonCons.STORE_TYPE_TWO);
@@ -870,7 +904,7 @@ public class ServiceCategoryController extends BaseController {
                     vo.setAllList(innerList);
                 }
             }
-            return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG,vo);
+            return new ApiMessage<>(true, AppConst.SUCCESS_CODE, AppConst.SUCCESS_GET_MSG, vo);
         } catch (Exception e) {
             e.printStackTrace( );
         }

+ 3 - 3
src/main/java/com/yc/education/controller/WxLoginController.java

@@ -421,7 +421,7 @@ public class WxLoginController extends BaseController {
         }
         //短信日志
         smsLogService.save(userInfo, code);
-        Provider provider = providerService.getProviderByAuthPhone(phone);
+        Provider provider = providerService.getProviderByAuthPhone(phone,roleType);
         userInfo.setPhone(phone);
         userInfoService.update(userInfo);
         //lc  9.21 判断是否是领取店铺的操作
@@ -484,13 +484,13 @@ public class WxLoginController extends BaseController {
                 userBindingVo.setUserPhone(userInfo.getPhone( ));
             } else {
                 //1 存在店铺信息
-                Provider provider = providerService.getProviderByAuthPhone(phone);
+                Provider provider = providerService.getProviderByAuthPhone(phone,userInfo.getRole());
 
                 userBindingVo.setUserName(userInfo.getNickName( ));
                 userBindingVo.setUserPhone(userInfo.getPhone( ));
                 userBindingVo.setAddress(provider.getAddress( ));
                 userBindingVo.setCompanyName(provider.getCompanyName( ));
-                String mainBusiness = provider.getMianBusiness( );
+                String mainBusiness = provider.getpMainBusiness( );
 
                 if (StringUtils.isNotBlank(mainBusiness)) {
                     UserBindingVo.InnerMainBusiness innerMainBusiness = userBindingVo.new InnerMainBusiness( );

File diff suppressed because it is too large
+ 311 - 275
src/main/java/com/yc/education/controller/admin/ProviderAdminController.java


+ 256 - 189
src/main/java/com/yc/education/controller/admin/SupplierAdminController.java

@@ -4,9 +4,11 @@ import com.baidu.ueditor.ActionEnter;
 import com.baidu.ueditor.define.ActionMap;
 import com.baidu.ueditor.define.BaseState;
 import com.github.pagehelper.PageInfo;
+import com.yc.education.mapper.ProviderMapper;
 import com.yc.education.model.*;
 import com.yc.education.service.*;
 import com.yc.education.util.*;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
@@ -30,6 +32,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * @author wuzhiqiang
@@ -50,7 +53,7 @@ public class SupplierAdminController {
     private IBrandService iBrandService;
 
     @Autowired
-    private ISinglePartsTypeService  iSinglePartsTypeService;//单项件类别
+    private ISinglePartsTypeService iSinglePartsTypeService;//单项件类别
 
     @Autowired
     private ICarPartsSingleService iCarPartsSingleService;//单项件
@@ -59,13 +62,13 @@ public class SupplierAdminController {
     private ICarSedanService iCarSedanService;//车系
 
     @Autowired
-    private  ICarProductionsTypeService iCarProductionsTypeService;//汽车用品和汽保设备与工具
+    private ICarProductionsTypeService iCarProductionsTypeService;//汽车用品和汽保设备与工具
 
     @Autowired
     private ICarCommerialService iCarCommerialService;//商用车
 
     @Autowired
-    private  AdminsService adminsService;
+    private AdminsService adminsService;
 
     @Autowired
     private IAuthenticationService iAuthenticationService;
@@ -76,8 +79,12 @@ public class SupplierAdminController {
     @Autowired
     private IServiceCategoryService iServiceCategoryService;
 
+    @Autowired
+    private ProviderMapper providerMapper;
+
     /**
      * 供应商信息列表
+     *
      * @param company
      * @param brandId
      * @param status
@@ -88,139 +95,141 @@ public class SupplierAdminController {
      */
     @RequestMapping("supplierList.html")
     public ModelAndView listAllSupplierInfo(
-            @RequestParam(defaultValue = "") String isImport,
+            @RequestParam(defaultValue = "0") String isImport,
             @RequestParam(defaultValue = "") String company,
             @RequestParam(defaultValue = "") Integer brandId,
             @RequestParam(defaultValue = "") String status,
             @RequestParam(defaultValue = "") String isUse,
             @RequestParam(defaultValue = "1") Integer pageNum,
-            @RequestParam(defaultValue = "10") Integer pageSize){
+            @RequestParam(defaultValue = "10") Integer pageSize) {
 
-        ModelAndView mav = new ModelAndView();
+        ModelAndView mav = new ModelAndView( );
 
-        List<Provider> listAllSupplierInfo = iProviderService.listAllSupplierInfo(isImport,company,brandId,status,isUse,pageNum,pageSize);//多条件查询
+        List< Provider > listAllSupplierInfo = iProviderService.listAllSupplierInfo(isImport, company, brandId, status, isUse, pageNum, pageSize);//多条件查询
 
-        List<Authentication> listAllAuthentication  = iAuthenticationService.listAuthenticationInfoProvider("","","","",1,Integer.MAX_VALUE);
+        List< Authentication > listAllAuthentication = iAuthenticationService.listAuthenticationInfoProvider("", "", "", "", 1, Integer.MAX_VALUE);
 
-        List<Recommender> listAllRecommender  = iRecommenderService.listAllRecommender(1,Integer.MAX_VALUE);//查询所有推荐人信息
+        List< Recommender > listAllRecommender = iRecommenderService.listAllRecommender(1, Integer.MAX_VALUE);//查询所有推荐人信息
 
-        List<Provider> listAllCompanyName = iProviderService.listAllCompanyNames();
+        List< Provider > listAllCompanyName = iProviderService.listAllCompanyNames( );
 
-        List<Brand> listAllBrandInfo  = iBrandService.listAllBrandInfo();//查询所有品牌信息
+        List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
 
-        if (listAllSupplierInfo != null && listAllSupplierInfo.size()!=0) {
+        if (listAllSupplierInfo != null && listAllSupplierInfo.size( ) != 0) {
 
             for (Provider provider : listAllSupplierInfo) {
 
-                if (provider.getUserId() != null) {   /*如果userId不为空就查出用户昵称赋值给nickname*/
+                if (provider.getUserId( ) != null) {   /*如果userId不为空就查出用户昵称赋值给nickname*/
 
-                    UserInfo userInfo = iUserInfoService.selectByKey(provider.getUserId());
+                    UserInfo userInfo = iUserInfoService.selectByKey(provider.getUserId( ));
                     if (userInfo != null) {
-                        provider.setNickName(userInfo.getNickName());//设置用户昵称
+                        provider.setNickName(userInfo.getNickName( ));//设置用户昵称
                     }
                 } else {                           /*如果 userId查出为空 根据电话号码查出用户昵称 给nickname赋值 */
-                    UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone());
+                    UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone( ));
 
                     if (userInfo != null) {       /*判断根据电话号码查出的用户信息是否为空*/
-                        provider.setNickName(userInfo.getNickName());
+                        provider.setNickName(userInfo.getNickName( ));
                     }
                     /*provider.setUserId(userInfo.getId());*/
                 }
 
                 /*从认证表中获取认证时间*/
-                if (listAllAuthentication != null && listAllAuthentication.size() != 0) {
+                if (listAllAuthentication != null && listAllAuthentication.size( ) != 0) {
 
                     for (Authentication authentication : listAllAuthentication) {
 
-                        if (authentication.getStoreId().equals(provider.getId())) {
-                            provider.setAuTime(authentication.getCreateDate());//给认证时间赋值
+                        if (authentication.getStoreId( ).equals(provider.getId( ))) {
+                            provider.setAuTime(authentication.getCreateDate( ));//给认证时间赋值
                         }
                     }
                 }
                 /*从推荐人表中获取推荐人姓名,电话,城市*/
-                if (listAllRecommender != null && listAllRecommender.size() != 0) {
+                if (listAllRecommender != null && listAllRecommender.size( ) != 0) {
 
                     for (Recommender recommender : listAllRecommender) {
 
-                        if (recommender.getPhone().equals(provider.getReferrerPhone())) {
-                            provider.setReferTelphon(recommender.getPhone());//设置推荐人电话
-                            provider.setReferName(recommender.getName());//设置推荐人姓名
-                            provider.setReferCity(recommender.getCity());//设置推荐人城市
+                        if (recommender.getPhone( ).equals(provider.getReferrerPhone( ))) {
+                            provider.setReferTelphon(recommender.getPhone( ));//设置推荐人电话
+                            provider.setReferName(recommender.getName( ));//设置推荐人姓名
+                            provider.setReferCity(recommender.getCity( ));//设置推荐人城市
                         }
                     }
                 }
 
             }
         }
-        mav.addObject("pageInfo",new PageInfo<Provider>(listAllSupplierInfo));
-        mav.addObject("companyName",listAllCompanyName);//查询公司名称当条件
-        mav.addObject("brand",listAllBrandInfo);
-        mav.addObject("company",company);
-        mav.addObject("brandId",brandId);
-        mav.addObject("status",status);
-        mav.addObject("isUse",isUse);
-        mav.addObject("isImport",isImport);
-        mav.addObject("pageNum",pageNum);
-        mav.addObject("pageSize",pageSize);
+        mav.addObject("pageInfo", new PageInfo< Provider >(listAllSupplierInfo));
+        mav.addObject("companyName", listAllCompanyName);//查询公司名称当条件
+        mav.addObject("brand", listAllBrandInfo);
+        mav.addObject("company", company);
+        mav.addObject("brandId", brandId);
+        mav.addObject("status", status);
+        mav.addObject("isUse", isUse);
+        mav.addObject("isImport", isImport);
+        mav.addObject("pageNum", pageNum);
+        mav.addObject("pageSize", pageSize);
 
 
-        return  mav;
+        return mav;
 
     }
 
     /**
      * 添加  跳转
+     *
      * @return
      */
     @RequestMapping("supplierAdd.html")
-    public ModelAndView supplierAdd(){
+    public ModelAndView supplierAdd( ) {
 
-        ModelAndView mav = new ModelAndView();
+        ModelAndView mav = new ModelAndView( );
 
-        List<Brand> listAllBrandInfo  = iBrandService.listAllBrandInfo();//查询所有品牌信息
+        List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
 
-        mav.addObject("brand",listAllBrandInfo);
+        mav.addObject("brand", listAllBrandInfo);
         return mav;
     }
 
     /**
      * 添加  实现
+     *
      * @param provider
      * @param request
      * @return
      */
     @RequestMapping("supplierAdds.html")
-    public ModelAndView supplierAdd(Provider provider,HttpServletRequest request){
+    public ModelAndView supplierAdd(Provider provider, HttpServletRequest request) {
 
-        Integer  loginId =Integer.valueOf(request.getSession().getAttribute("loginId").toString());//获取后台登录人id
+        Integer loginId = Integer.valueOf(request.getSession( ).getAttribute("loginId").toString( ));//获取后台登录人id
 
         Admins admins = adminsService.selectByKey(loginId);//查询当前登录人的信息
 
-        String rootPath = request.getSession().getServletContext().getRealPath("/");
+        String rootPath = request.getSession( ).getServletContext( ).getRealPath("/");
 
-        String contextPath = request.getSession().getServletContext().getContextPath();
+        String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
         BaseState state = (BaseState) new ActionEnter(request, rootPath, contextPath, "admin")
                 .invoke(ActionMap.UPLOAD_FILE);
         provider.setImgLog(state.getInfo("url"));
 
-        provider.setEnterDate(new Date());//设置默认值
+        provider.setEnterDate(new Date( ));//设置默认值
         provider.setStatus("0");
         provider.setIsHot("0");
         provider.setPv(0);
-        provider.setCreateDate(new Date());
-        provider.setModifiedDate(new Date());
+        provider.setCreateDate(new Date( ));
+        provider.setModifiedDate(new Date( ));
         provider.setRoleType("2");
         provider.setIsUse("0");
         provider.setServiceItem("0");
         provider.setPhotos("0");
         provider.setIsLine("0");
         provider.setIsImport("1");
-        provider.setOperator(admins.getLoginname());
+        provider.setOperator(admins.getLoginname( ));
         provider.setImgLog(CommonCons.DEFAULT_STORE_LOGO);
         provider.setImgBanner(CommonCons.DEFAULT_STORE_BANNER);
 
         /*根据省市区三级联动的值,赋值给店铺地址*/
-        provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
+        provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
 
        /* Brand brand = iBrandService.selectByPrimaryKey(Integer.valueOf(provider.getBrandId()));//查询品牌信息
 
@@ -229,62 +238,83 @@ public class SupplierAdminController {
         }*/
 
         /*根据地址获取经纬度*/
-        provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
-        if(provider.getAddress() != null && !"".equals(provider.getAddress())){
+        provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
+        if (provider.getAddress( ) != null && !"".equals(provider.getAddress( ))) {
 
-            String str = MapUtils.getLongitudeLatitude(provider.getAddress());//根据地址获取经纬度字符串
-            if(!"".equals(str) && str != null){
+            String str = MapUtils.getLongitudeLatitude(provider.getAddress( ));//根据地址获取经纬度字符串
+            if (!"".equals(str) && str != null) {
                 String[] arr = str.split(",");//用逗号将字符串分开
                 provider.setLongitude(arr[0]);//赋值给经度
                 provider.setLatitude(arr[1]);//赋值给纬度
-            }else {
+            } else {
                 provider.setLatitude("0");
                 provider.setLongitude("0");
             }
         }
-        UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone());//根据电话号码查询用户信息
-        if(userInfo != null){
-            provider.setUserId(userInfo.getId());//将用户id赋值给userId
+        UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone( ));//根据电话号码查询用户信息
+        if (userInfo != null) {
+            provider.setUserId(userInfo.getId( ));//将用户id赋值给userId
         }
+        String paramType = provider.getParamType( );
+
+        int row = providerMapper.insertUseGeneratedKeys(provider);
 
-        int row = iProviderService.save(provider);
+        //当是经销商的时候   添加经销商搜索
+        new Thread(( ) -> {
+            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+            if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
+                iProviderService.saveSearchDealer(paramType, provider.getId(), provider.getpMainBusiness(), provider.getMianBusiness());
+            }
+            //  2 代表全车件
+            if ("2".equals(paramType)) {
+                iProviderService.saveAllCar(provider.getId(), provider.getMianBusiness());
+            }
+            // 6 代表商务车
+            if ("6".equals(paramType)) {
+                iProviderService.saveCommercial(provider.getId(), provider.getMianBusiness());
+            }
+        }).start( );
 
-        return ViewUtil.returnview(row,"supplierList.html","供应商列表");
+
+
+        return ViewUtil.returnview(row, "supplierList.html", "供应商列表");
     }
 
 
     /**
      * 修改  跳转
+     *
      * @param id
      * @return
      */
     @RequestMapping("supplierUpdate.html")
-    public ModelAndView supplierUpdate(Long id){
+    public ModelAndView supplierUpdate(Long id) {
 
-        ModelAndView mav = new ModelAndView();
+        ModelAndView mav = new ModelAndView( );
 
-        List<Brand> listAllBrandInfo  = iBrandService.listAllBrandInfo();//查询所有品牌信息
+        List< Brand > listAllBrandInfo = iBrandService.listAllBrandInfo( );//查询所有品牌信息
 
         Provider provider = iProviderService.selectByKey(id);
 
-        mav.addObject("brand",listAllBrandInfo);
-        mav.addObject("provider",provider);
+        mav.addObject("brand", listAllBrandInfo);
+        mav.addObject("provider", provider);
 
-        return  mav;
+        return mav;
     }
 
     /**
      * 修改 实现
+     *
      * @param provider
      * @param request
      * @return
      */
     @RequestMapping("supplierUpdates.html")
-    public ModelAndView toUpdates(Provider provider, HttpServletRequest request){
+    public ModelAndView toUpdates(Provider provider, HttpServletRequest request) {
 
-        String rootPath = request.getSession().getServletContext().getRealPath("/");
+        String rootPath = request.getSession( ).getServletContext( ).getRealPath("/");
 
-        String contextPath = request.getSession().getServletContext().getContextPath();
+        String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
         BaseState state = (BaseState) new ActionEnter(request, rootPath, contextPath, "admin")
                 .invoke(ActionMap.UPLOAD_FILE);
         provider.setImgLog(state.getInfo("url"));
@@ -295,70 +325,91 @@ public class SupplierAdminController {
         }*/
 
         /*根据地址获取经纬度*/
-        provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());
-        if(provider.getAddress() != null && !"".equals(provider.getAddress())){
+        provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));
+        if (provider.getAddress( ) != null && !"".equals(provider.getAddress( ))) {
 
-            String str = MapUtils.getLongitudeLatitude(provider.getAddress());//根据地址获取经纬度字符串
-            if(!"".equals(str) && str != null){
+            String str = MapUtils.getLongitudeLatitude(provider.getAddress( ));//根据地址获取经纬度字符串
+            if (!"".equals(str) && str != null) {
                 String[] arr = str.split(",");//用逗号将字符串分开
                 provider.setLongitude(arr[0]);//赋值给经度
                 provider.setLatitude(arr[1]);//赋值给纬度
-            }else {
+            } else {
                 provider.setLatitude("0");
                 provider.setLongitude("0");
             }
         }
-        provider.setAddress(provider.getProvince()+provider.getCity()+provider.getDistrict()+provider.getStree());//给address赋值
+        provider.setAddress(provider.getProvince( ) + provider.getCity( ) + provider.getDistrict( ) + provider.getStree( ));//给address赋值
 
         int row = iProviderService.updateNotNull(provider);
 
-        return ViewUtil.returnview(row,"supplierList.html?company="+provider.getCompanyName(),"供应商列表");
+        String paramType = provider.getParamType( );
+        //当是经销商的时候   添加经销商搜索
+        new Thread(( ) -> {
+            // 1,3,4,5 代表是 普通类型 1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
+            if ("1".equals(paramType) || "3".equals(paramType) || "4".equals(paramType) || "5".equals(paramType)) {
+                iProviderService.saveSearchDealer(paramType, provider.getId(), provider.getpMainBusiness(), provider.getMianBusiness());
+            }
+            //  2 代表全车件
+            if ("2".equals(paramType)) {
+                iProviderService.saveAllCar(provider.getId(), provider.getMianBusiness());
+            }
+            // 6 代表商务车
+            if ("6".equals(paramType)) {
+                iProviderService.saveCommercial(provider.getId(), provider.getMianBusiness());
+            }
+        }).start( );
+
+
+        return ViewUtil.returnview(row, "supplierList.html?company=" + provider.getCompanyName( ), "供应商列表");
 
     }
 
     /**
      * 删除
+     *
      * @param id
      * @return
      */
     @ResponseBody
     @RequestMapping("supplierDel.html")
-    public AjaxMessage<Object> supplierDel(String id){
+    public AjaxMessage< Object > supplierDel(String id) {
 
-        AjaxMessage am = new AjaxMessage();
+        AjaxMessage am = new AjaxMessage( );
 
-        String [] idlist  = id.split(",");
+        String[] idlist = id.split(",");
 
         int row = 0;
 
-        for (String string  : idlist){
+        for (String string : idlist) {
             row += iProviderService.delete(Long.valueOf(string));
         }
-        if (row > 0 ){
+        if (row > 0) {
             am.setIs(true);
             am.setMsg("  删除成功");
-        }else {
+        } else {
             am.setIs(false);
             am.setMsg("  删除失败");
         }
 
-        return  am;
+        return am;
     }
+
     /**
      * 删除全部后台录入信息
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("supplierDels.html")
-    public AjaxMessage<Object> supplierDels(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
+    public AjaxMessage< Object > supplierDels( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
 
-        int rows = iProviderService.deleteEvery();//删除全部后台录入信息
+        int rows = iProviderService.deleteEvery( );//删除全部后台录入信息
 
-        if (rows > 0){
+        if (rows > 0) {
             am.setIs(true);
             am.setMsg("删除成功");
-        }else {
+        } else {
             am.setIs(false);
             am.setMsg("删除失败");
         }
@@ -368,51 +419,56 @@ public class SupplierAdminController {
 
     /**
      * 商家状态修改(禁用, 启用)
+     *
      * @param id
      * @return
      */
     @RequestMapping("supplierLineUpdates.html")
-    public ModelAndView supplierLineUpdates (Long id){
+    public ModelAndView supplierLineUpdates(Long id) {
 
         Provider provider = iProviderService.selectByKey(id);
 
-        if ("0".equals(provider.getIsLine())){
+        if ("0".equals(provider.getIsLine( ))) {
             provider.setIsLine("1");
         } else {
             provider.setIsLine("0");
         }
 
         int row = iProviderService.updateNotNull(provider);
-        return ViewUtil.returnview(row,"supplierList.html","商家信息列表");
+        return ViewUtil.returnview(row, "supplierList.html", "商家信息列表");
     }
 
     /*    1 经销商信息添加   经营范围的选择实现     选中汽车配件后的经营范围*/
+
     /**
      * 查询单项件种类 (底盘件,发动机件等)
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("listSingleType.html")
-    public AjaxMessage<Object> listSingleType(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<ServiceCategory> listOneType  =iServiceCategoryService.listSingleKind();
-        if (listOneType != null || !"".equals(listOneType)){
+    public AjaxMessage< Object > listSingleType( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< ServiceCategory > listOneType = iServiceCategoryService.listSingleKind( );
+        if (listOneType != null || !"".equals(listOneType)) {
             am.setIs(true);
             am.setData(listOneType);
         }
         return am;
     }
+
     /**
      * 查询单项件种类下的服务名称
+     *
      * @param id
      * @return
      */
     @ResponseBody
     @RequestMapping("listServiceById.html")
-    public AjaxMessage<Object> listServiceById(String id){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<ServiceCategory> listServiceById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim()));
-        if (listServiceById != null && !"".equals(listServiceById)){
+    public AjaxMessage< Object > listServiceById(String id) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< ServiceCategory > listServiceById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim( )));
+        if (listServiceById != null && !"".equals(listServiceById)) {
             am.setIs(true);
             am.setData(listServiceById);
         }
@@ -422,31 +478,34 @@ public class SupplierAdminController {
     /**
      * 全车件下的信息
      * 查询国别(欧系,美系,韩系,国产等)
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("listCarTrain.html")
-    public AjaxMessage<Object> listCarTrain(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<CarSedan> listCarTrain = iCarSedanService.listCarSedanByCountry();
-        if (listCarTrain != null && !"".equals(listCarTrain)){
+    public AjaxMessage< Object > listCarTrain( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< CarSedan > listCarTrain = iCarSedanService.listCarSedanByCountry( );
+        if (listCarTrain != null && !"".equals(listCarTrain)) {
             am.setIs(true);
             am.setData(listCarTrain);
         }
         return am;
     }
+
     /**
      * 根据国别查询车型
+     *
      * @param type
      * @return
      */
     @ResponseBody
     @RequestMapping("listCarSedanBrand.html")
-    public AjaxMessage<Object> listCarSedanBrand(String type){
-        AjaxMessage<Object> am = new AjaxMessage<>();
+    public AjaxMessage< Object > listCarSedanBrand(String type) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
 
-        List<CarSedan>   listBrand = iCarSedanService.listCarSedanByBrand(type,"",1,Integer.MAX_VALUE);
-        if (listBrand != null && !"".equals(listBrand)){
+        List< CarSedan > listBrand = iCarSedanService.listCarSedanByBrand(type, "", 1, Integer.MAX_VALUE);
+        if (listBrand != null && !"".equals(listBrand)) {
             am.setIs(true);
             am.setData(listBrand);
         }
@@ -456,63 +515,70 @@ public class SupplierAdminController {
 
     /**
      * 查询汽车用品下的类别名称
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("carUseProduct.html")
-    public AjaxMessage<Object> carUseProduct(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<ServiceCategory> listCarUseType  =  iServiceCategoryService.listCarUseType();//查询汽车用品下的类别
-        if (listCarUseType != null && !"".equals(listCarUseType)){
+    public AjaxMessage< Object > carUseProduct( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< ServiceCategory > listCarUseType = iServiceCategoryService.listCarUseType( );//查询汽车用品下的类别
+        if (listCarUseType != null && !"".equals(listCarUseType)) {
             am.setIs(true);
             am.setData(listCarUseType);
         }
         return am;
     }
+
     /**
      * 跟据类别id查询父类id是此i的信息
+     *
      * @param id
      * @return
      */
     @ResponseBody
     @RequestMapping("listUseById.html")
-    public AjaxMessage<Object> listUseByType( String id){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<ServiceCategory> listUseById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim()));
-        if (listUseById != null && !"".equals(listUseById)){
+    public AjaxMessage< Object > listUseByType(String id) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< ServiceCategory > listUseById = iServiceCategoryService.listServiceCategoryByPid(Integer.valueOf(id.trim( )));
+        if (listUseById != null && !"".equals(listUseById)) {
             am.setIs(true);
             am.setData(listUseById);
         }
         return am;
     }
     /* 3  经销商信息添加   经营范围的选择实现     选中汽保设备与工具后的经营范围*/
+
     /**
      * 查询汽保设备与工具下的类别名称
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("carEquipmentTool.html")
-    public AjaxMessage<Object> carEquipmentTool(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<ServiceCategory> listCarcarEquipmentTool =  iServiceCategoryService.listCarEquipmentTool();//查询汽保设备与工具下的类别
-        if (listCarcarEquipmentTool != null && !"".equals(listCarcarEquipmentTool)){
+    public AjaxMessage< Object > carEquipmentTool( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< ServiceCategory > listCarcarEquipmentTool = iServiceCategoryService.listCarEquipmentTool( );//查询汽保设备与工具下的类别
+        if (listCarcarEquipmentTool != null && !"".equals(listCarcarEquipmentTool)) {
             am.setIs(true);
             am.setData(listCarcarEquipmentTool);
         }
         return am;
     }
     /* 4  经销商信息添加   经营范围的选择实现     选中商用车的经营范围*/
+
     /**
      * 全车件下的信息
      * 查询类别(客车,货车,自卸车,牵引车)
+     *
      * @return
      */
     @ResponseBody
     @RequestMapping("listCarCategory.html")
-    public AjaxMessage<Object> listCarCategory(){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<CarCommercial> listCarCategory = iCarCommerialService.listCarCommercialByCategory();
-        if (listCarCategory != null && !"".equals(listCarCategory)){
+    public AjaxMessage< Object > listCarCategory( ) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< CarCommercial > listCarCategory = iCarCommerialService.listCarCommercialByCategory( );
+        if (listCarCategory != null && !"".equals(listCarCategory)) {
             am.setIs(true);
             am.setData(listCarCategory);
         }
@@ -521,15 +587,16 @@ public class SupplierAdminController {
 
     /**
      * 根据车类查询品牌
+     *
      * @param type
      * @return
      */
     @ResponseBody
     @RequestMapping("listCarCommercialBrand.html")
-    public AjaxMessage<Object>  listCarCommercialBrand (String type){
-        AjaxMessage<Object> am = new AjaxMessage<>();
-        List<CarCommercial> listCarBrand = iCarCommerialService.listCarCommercialByBrand(type,"");
-        if (listCarBrand != null && !"".equals(listCarBrand)){
+    public AjaxMessage< Object > listCarCommercialBrand(String type) {
+        AjaxMessage< Object > am = new AjaxMessage<>( );
+        List< CarCommercial > listCarBrand = iCarCommerialService.listCarCommercialByBrand(type, "");
+        if (listCarBrand != null && !"".equals(listCarBrand)) {
             am.setIs(true);
             am.setData(listCarBrand);
         }
@@ -538,26 +605,27 @@ public class SupplierAdminController {
 
     /**
      * 跳转到数据导入界面
+     *
      * @return
      */
     @RequestMapping("supplierExcel.html")
-    public  ModelAndView providerExcel(){
-        return  new ModelAndView();
+    public ModelAndView providerExcel( ) {
+        return new ModelAndView( );
     }
 
     @ResponseBody
     @RequestMapping("supplierExcelIn.html")
-    public  AjaxMessage<Object> providerExcelIn(String url, HttpServletRequest request) throws IOException {
+    public AjaxMessage< Object > providerExcelIn(String url, HttpServletRequest request) throws IOException {
 
         System.err.println("url:" + url);
 
-        Date begindata = new Date();
+        Date begindata = new Date( );
 
-        String contextPath = request.getSession().getServletContext().getContextPath();
+        String contextPath = request.getSession( ).getServletContext( ).getContextPath( );
 
-        List<Provider> list = new ArrayList<Provider>();
+        List< Provider > list = new ArrayList< Provider >( );
 
-        if(url.endsWith(".xls")){
+        if (url.endsWith(".xls")) {
             //2003版本的excel,用.xls结尾
 
             InputStream is = new FileInputStream(url);
@@ -568,14 +636,14 @@ public class SupplierAdminController {
 
             HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
 
-            for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
+            for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum( ); rowNum++) {
                 HSSFRow hssfRow = (HSSFRow) hssfSheet.getRow(rowNum);
                 //获取表格数据
                 if (hssfRow != null) {
-                    Provider provider  = new Provider();
+                    Provider provider = new Provider( );
                     try {
                         provider.setCompanyName(String.valueOf(getValue(hssfRow.getCell(0))));
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         provider.setCompanyName("");  //出错默认为空
                     }
                     provider.setName(getValue(hssfRow.getCell(1)));
@@ -596,14 +664,14 @@ public class SupplierAdminController {
 
 
                     provider.setIsUse("1");
-                    provider.setEnterDate(new Date());
+                    provider.setEnterDate(new Date( ));
                     provider.setStatus("0");
                     provider.setIsHot("0");
                     provider.setPhotos("0张");
                     provider.setServiceItem("0条");
                     provider.setPv(0);
-                    provider.setCreateDate(new Date());
-                    provider.setModifiedDate(new Date());
+                    provider.setCreateDate(new Date( ));
+                    provider.setModifiedDate(new Date( ));
                     provider.setRoleType("2");
                     provider.setIsUse("0");
                     provider.setLatitude("0");
@@ -613,7 +681,7 @@ public class SupplierAdminController {
                     list.add(provider);
                 }
             }
-        }else{
+        } else {
             FileInputStream fis = new FileInputStream(url);
             //2007版本的excel,用.xlsx结尾
             Workbook wookbook = new XSSFWorkbook(fis);//得到工作簿
@@ -621,17 +689,16 @@ public class SupplierAdminController {
             //得到一个工作表
             Sheet sheet = wookbook.getSheetAt(0);
             //获得数据的总行数
-            int totalRowNum = sheet.getLastRowNum();
+            int totalRowNum = sheet.getLastRowNum( );
             //获得所有数据
-            for(int i = 1 ; i < totalRowNum ; i++)
-            {
+            for (int i = 1; i < totalRowNum; i++) {
                 //获得第i行对象
                 Row row = sheet.getRow(i);
                 //获取表格数据
-                Provider provider = new Provider();
+                Provider provider = new Provider( );
                 try {
-                    provider.setCompanyName(String.valueOf(getValue(row.getCell((short)0))));
-                }catch (Exception e){
+                    provider.setCompanyName(String.valueOf(getValue(row.getCell((short) 0))));
+                } catch (Exception e) {
                     provider.setCompanyName("");  //出错默认null
                 }
                 provider.setName(getValue(row.getCell(1)));
@@ -651,14 +718,14 @@ public class SupplierAdminController {
                 provider.setTelphone(getValue(row.getCell(14)));
 
 
-                provider.setEnterDate(new Date());
+                provider.setEnterDate(new Date( ));
                 provider.setStatus("0");
                 provider.setIsHot("0");
                 provider.setPhotos("0张");
                 provider.setServiceItem("0条");
                 provider.setPv(0);
-                provider.setCreateDate(new Date());
-                provider.setModifiedDate(new Date());
+                provider.setCreateDate(new Date( ));
+                provider.setModifiedDate(new Date( ));
                 provider.setRoleType("2");
                 provider.setIsUse("0");
                 provider.setLatitude("0");
@@ -669,87 +736,87 @@ public class SupplierAdminController {
             }
         }
         //批量导入数据
-        if(list.size()!=0){
-            for (int i = 0; i < list.size() / 400 + 1; i++) {
+        if (list.size( ) != 0) {
+            for (int i = 0; i < list.size( ) / 400 + 1; i++) {
                 int end = (i + 1) * 400;
-                if (end >= list.size()) {
-                    end = list.size();
+                if (end >= list.size( )) {
+                    end = list.size( );
                 }
-                List<Provider> serviceList = list.subList(i * 400, end);
-                if(serviceList != null && serviceList.size() > 0){
+                List< Provider > serviceList = list.subList(i * 400, end);
+                if (serviceList != null && serviceList.size( ) > 0) {
                     iProviderService.addByList(serviceList);
 
                 }
             }
         }
-        Date endtime = new Date();
-        System.err.println("耗时:"+(endtime.getTime()-begindata.getTime()));
-        AjaxMessage<Object> ajax = new AjaxMessage<>();
+        Date endtime = new Date( );
+        System.err.println("耗时:" + (endtime.getTime( ) - begindata.getTime( )));
+        AjaxMessage< Object > ajax = new AjaxMessage<>( );
         //删除重复的
-        List<String> repeatList = iProviderService.queryId();
+        List< String > repeatList = iProviderService.queryId( );
         iProviderService.deleteByRepeat(repeatList);
         return ajax;
 
 
     }
 
-    @SuppressWarnings({ "static-access" })
-    public static  String getValue(Cell cell) {
+    @SuppressWarnings({"static-access"})
+    public static String getValue(Cell cell) {
         String value = "";
-        if(null==cell){
+        if (null == cell) {
             return value;
         }
-        switch (cell.getCellType()) {
+        switch (cell.getCellType( )) {
             //数值型
             case Cell.CELL_TYPE_NUMERIC:
                 if (HSSFDateUtil.isCellDateFormatted(cell)) {// 处理日期格式、时间格式
                     SimpleDateFormat sdf = null;
-                    if (cell.getCellStyle().getDataFormat() == HSSFDataFormat
+                    if (cell.getCellStyle( ).getDataFormat( ) == HSSFDataFormat
                             .getBuiltinFormat("h:mm")) {
                         sdf = new SimpleDateFormat("HH:mm");
                     } else {// 日期
                         sdf = new SimpleDateFormat("yyyy/MM/dd");
                     }
-                    Date date = cell.getDateCellValue();
-                    value= sdf.format(date);
+                    Date date = cell.getDateCellValue( );
+                    value = sdf.format(date);
                     break;
-                }else{
+                } else {
 
-                    value = String.valueOf(cell.getNumericCellValue());
+                    value = String.valueOf(cell.getNumericCellValue( ));
 
-                    String isdouble[]=value.split("\\.");
-                    if(value.length()>3){
+                    String isdouble[] = value.split("\\.");
+                    if (value.length( ) > 3) {
                         DecimalFormat df = new DecimalFormat("0");
-                        String whatYourWant = df.format(cell.getNumericCellValue());
-                        value=whatYourWant;
-                    }else if(isdouble.length>1){
-                        if("0".equals(isdouble[1])){
+                        String whatYourWant = df.format(cell.getNumericCellValue( ));
+                        value = whatYourWant;
+                    } else if (isdouble.length > 1) {
+                        if ("0".equals(isdouble[1])) {
                             DecimalFormat df = new DecimalFormat("0");
-                            String whatYourWant = df.format(cell.getNumericCellValue());
-                            value=whatYourWant;
-                        }else{
+                            String whatYourWant = df.format(cell.getNumericCellValue( ));
+                            value = whatYourWant;
+                        } else {
                             double d = Double.valueOf(value);
-                            d=getdouble(d);
-                            value= Double.toString(d);
+                            d = getdouble(d);
+                            value = Double.toString(d);
                         }
                     }
                     break;
                 }
                 //字符串类型
             case Cell.CELL_TYPE_STRING:
-                value = cell.getStringCellValue().toString();
+                value = cell.getStringCellValue( ).toString( );
                 break;
             // 公式类型
             case Cell.CELL_TYPE_FORMULA:
                 //读公式计算值
-                value = String.valueOf(cell.getNumericCellValue());
+                value = String.valueOf(cell.getNumericCellValue( ));
                 if (value.equals("NaN")) {// 如果获取的数据值为非法值,则转换为获取字符串
-                    value = cell.getStringCellValue().toString();
+                    value = cell.getStringCellValue( ).toString( );
                 }
                 break;
             // 布尔类型
             case Cell.CELL_TYPE_BOOLEAN:
-                value = " "+ cell.getBooleanCellValue();
+                value = " " + cell.getBooleanCellValue( );
                 break;
             // 空值
             case Cell.CELL_TYPE_BLANK:
@@ -761,18 +828,18 @@ public class SupplierAdminController {
                 value = "";
                 break;
             default:
-                value = cell.getStringCellValue().toString();
+                value = cell.getStringCellValue( ).toString( );
         }
-        if("null".endsWith(value.trim())){
-            value="";
+        if ("null".endsWith(value.trim( ))) {
+            value = "";
         }
         return value;
     }
 
 
-    public static double getdouble(double d){
-        BigDecimal b   =   new   BigDecimal(d);
-        double   f1   =   b.setScale(1,   BigDecimal.ROUND_HALF_UP).doubleValue();
+    public static double getdouble(double d) {
+        BigDecimal b = new BigDecimal(d);
+        double f1 = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue( );
         return f1;
     }
 

+ 1 - 1
src/main/java/com/yc/education/mapper/ProviderMapper.java

@@ -91,7 +91,7 @@ public interface ProviderMapper extends MyMapper< Provider > {
      */
     Provider getProviderByUserId(@Param("userId") Long userId, @Param("roleType") String roleType);
 
-    Provider getProviderByAuthPhone(@Param("authPhone") String phone);
+    Provider getProviderByAuthPhone(@Param("authPhone") String phone,@Param("roleType") String roleType);
 
     /**
      * 后台

+ 18 - 0
src/main/java/com/yc/education/model/SearchDealer.java

@@ -1,6 +1,7 @@
 package com.yc.education.model;
 
 import javax.persistence.*;
+import java.util.Objects;
 
 @Table(name = "search_dealer")
 public class SearchDealer {
@@ -129,4 +130,21 @@ public class SearchDealer {
                 ", type='" + type + '\'' +
                 '}';
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass( ) != o.getClass( )) return false;
+        SearchDealer that = (SearchDealer) o;
+        return Objects.equals(storeId, that.storeId) &&
+                Objects.equals(pName, that.pName) &&
+                Objects.equals(name, that.name) &&
+                Objects.equals(level, that.level) &&
+                Objects.equals(type, that.type);
+    }
+
+    @Override
+    public int hashCode( ) {
+        return Objects.hash(storeId, pName, name, level, type);
+    }
 }

+ 19 - 0
src/main/java/com/yc/education/model/SearchProvider.java

@@ -1,6 +1,7 @@
 package com.yc.education.model;
 
 import javax.persistence.*;
+import java.util.Objects;
 
 @Table(name = "search_provider")
 public class SearchProvider {
@@ -145,4 +146,22 @@ public class SearchProvider {
     public void setType(String type) {
         this.type = type;
     }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass( ) != o.getClass( )) return false;
+        SearchProvider that = (SearchProvider) o;
+        return Objects.equals(storeId, that.storeId) &&
+                Objects.equals(pName, that.pName) &&
+                Objects.equals(name, that.name) &&
+                Objects.equals(level, that.level) &&
+                Objects.equals(type, that.type);
+    }
+
+    @Override
+    public int hashCode( ) {
+        return Objects.hash(storeId, pName, name, level, type);
+    }
 }

+ 1 - 1
src/main/java/com/yc/education/service/IProviderService.java

@@ -116,7 +116,7 @@ public interface IProviderService extends IService<Provider> {
 
     int  deleteByRepeat(List<String> repeatList);
 
-    Provider getProviderByAuthPhone(String phone);
+    Provider getProviderByAuthPhone(String phone,String roleType);
 
     int update_img(Provider provider);
 

+ 7 - 1
src/main/java/com/yc/education/service/impl/CommonServiceImpl.java

@@ -316,7 +316,13 @@ public class CommonServiceImpl implements ICommonService {
     public List getListMainBusiness(String pMainBusiness) {
         try {
             if (StringUtils.isNotBlank(pMainBusiness)) {
-                return Arrays.asList(pMainBusiness.split(","));
+                List< String > list = Arrays.asList(pMainBusiness.split(","));
+                //控制最多显示3个
+                if(list.size() > 3){
+                    return list.subList(0,3);
+                }else{
+                    return list;
+                }
             }
         } catch (Exception e) {
             log.error("CommonController > getAllTypeMainBusiness 错误!" + e);

+ 1 - 4
src/main/java/com/yc/education/service/impl/NoticeServiceImpl.java

@@ -38,16 +38,13 @@ public class NoticeServiceImpl implements INoticeService {
     @Override
     public void saveNotice(String roleType,Long id,String name, String province, String city, String district) {
         try {
-            String cj = "";
-            if(CommonCons.STORE_TYPE_ONE.equals(roleType)) cj="服务商";
-            if(CommonCons.STORE_TYPE_TWO.equals(roleType)) cj="经销商";
             Notice notice = new Notice( );
             notice.setStoreId(id);
             notice.setProvince(province);
             notice.setCity(city);
             notice.setDistrict(district);
             notice.setCreateDate(new Date());
-            notice.setTitle("恭贺"+name+cj+"入驻成功!");
+            notice.setTitle(name);
             noticeMapper.insertSelective(notice);
         } catch (Exception e) {
             e.printStackTrace( );

+ 27 - 14
src/main/java/com/yc/education/service/impl/ProviderServiceImpl.java

@@ -210,7 +210,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
         searchProviderMapper.deleteByStoreId(storeId);
         String[] split = mainBusiness.split(",");
         String[] split1 = brand.split(",");
-        ArrayList< SearchProvider > spList = new ArrayList<>( );
+        Set< SearchProvider > spList = new HashSet<>();
 
         int i = 0;
         for (String factory : split) {
@@ -253,7 +253,10 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             }
             i++;
         }
-        searchProviderMapper.insertList(spList);
+
+        List< SearchProvider > listSet = new ArrayList<>();
+        listSet.addAll(spList);
+        searchProviderMapper.insertList(listSet);
     }
 
     /**
@@ -269,7 +272,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
         if (StringUtils.isBlank(pMainBusiness) || StringUtils.isBlank(mainBusiness)) return;
         searchProviderMapper.deleteByStoreId(storeId);
         try {
-            ArrayList< SearchProvider > spList = new ArrayList<>( );
+            Set< SearchProvider > spList = new HashSet<>( );
             String[] pMains = pMainBusiness.split(",");
             String[] mains = mainBusiness.split(",");
             List< String > mainList = Arrays.asList(mains);
@@ -305,7 +308,9 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
                     spList.add(sp);
                 }
             }
-            searchProviderMapper.insertList(spList);
+            List< SearchProvider > listSet = new ArrayList<>( );
+            listSet.addAll(spList);
+            searchProviderMapper.insertList(listSet);
         } catch (Exception e) {
             e.printStackTrace( );
         }
@@ -327,9 +332,9 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             return;
         }
         searchDealerMapper.deleteByStoreId(storeId);
-        String pName = "";
+        String pName;
         //1汽配(单项件),2汽配(全车件) ,3用品改装,4汽保设备与工具,5商用车(单项件) 6商用车(全车件)
-        ArrayList< SearchDealer > list = new ArrayList<>( );
+        Set< SearchDealer > list = new HashSet<>( );
         String[] split = mainBusiness.split(";+");
         String[] split1 = pMainBusiness.split(",");
 
@@ -385,7 +390,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             psName = "用品改装";
         }
 
-        if ("3".equals(paramType)) {
+        if ("4".equals(paramType)) {
             name = "汽保设备与工具";
             psName = "汽保设备与工具";
         }
@@ -409,7 +414,9 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             list.add(searchDealer);
         }
         try {
-            searchDealerMapper.insertList(list);
+            ArrayList< SearchDealer > listSet = new ArrayList<>( );
+            listSet.addAll(list);
+            searchDealerMapper.insertList(listSet);
         } catch (Exception e) {
             e.printStackTrace( );
         }
@@ -431,7 +438,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
             List< String > brand = carSedanMapper.listBrandGroupByBrand( );
             List< String > factorys = carSedanMapper.listFactoryGroupByFactory( );
             List< String > series = carSedanMapper.listSeriesGroupBySeries( );
-            List< SearchDealer > list = new ArrayList<>( );
+            Set< SearchDealer > list = new HashSet<>( );
             for (String name : split) {
                 if (brand != null && brand.contains(name)) {
                     List< CarSedan > carSedanList = carSedanMapper.listCarSedanFactoryByBrand(name);
@@ -578,7 +585,10 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
                     list.add(searchDealer3);
                 }
             }
-            searchDealerMapper.insertList(list);
+
+            List< SearchDealer > listSet = new ArrayList<>( );
+            listSet.addAll(list);
+            searchDealerMapper.insertList(listSet);
         } catch (Exception e) {
             e.printStackTrace( );
         }
@@ -595,7 +605,7 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
         try {
             if (null == storeId || StringUtils.isBlank(mainBusiness)) return;
             searchDealerMapper.deleteByStoreId(storeId);
-            List< SearchDealer > list = new ArrayList<>( );
+            Set< SearchDealer > list = new HashSet<>( );
 
             List< String > brandList = carCommercialMapper.listBrandGroupByBrand( );
 
@@ -756,7 +766,10 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
                     }
                 }
             }
-            searchDealerMapper.insertList(list);
+            //去重
+            List< SearchDealer > listSet = new ArrayList<>( );
+            listSet.addAll(list);
+            searchDealerMapper.insertList(listSet);
         } catch (Exception e) {
             e.printStackTrace( );
         }
@@ -1073,9 +1086,9 @@ public class ProviderServiceImpl extends BaseService< Provider > implements IPro
     }
 
     @Override
-    public Provider getProviderByAuthPhone(String phone) {
+    public Provider getProviderByAuthPhone(String phone,String roleType) {
         try {
-            return providerMapper.getProviderByAuthPhone(phone);
+            return providerMapper.getProviderByAuthPhone(phone,roleType);
         } catch (Exception e) {
             e.printStackTrace( );
             return null;

+ 10 - 0
src/main/java/com/yc/education/vo/ProviderDetailVo.java

@@ -9,6 +9,8 @@ import com.yc.education.model.UserStatus;
  */
 public class ProviderDetailVo extends UserStatus {
 
+    private String storeId; //店铺id
+
     private String banner = ""; //封面图 banner
 
     private String name = "";    //公司名称
@@ -202,4 +204,12 @@ public class ProviderDetailVo extends UserStatus {
     public void setRoleType(String roleType) {
         this.roleType = roleType;
     }
+
+    public String getStoreId( ) {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
 }

+ 122 - 0
src/main/java/com/yc/education/vo/ServiceCategoryVo.java

@@ -2,6 +2,7 @@ package com.yc.education.vo;
 
 import com.yc.education.model.UserStatus;
 
+import java.util.Comparator;
 import java.util.List;
 
 /**
@@ -97,6 +98,127 @@ public class ServiceCategoryVo extends UserStatus {
         }
     }
 
+    public class InnerClickAllCar implements Comparator<ServiceCategoryVo.InnerClickAllCar> {
+        private String id;          //主键id
+        private String imgLog;      //log图
+        private String companyName; //公司名称
+        private String status;  //是否认证 1认证
+        private String isHot;    //是否推荐/热门
+        private String name;        //店铺名称
+        private String mainBusiness;    //主营业务
+        private String street;  //地址
+        private String distance;      //千米
+        private Object[] mainBusinessArr;
+
+        public String getCompanyName() {
+            return companyName;
+        }
+
+        public void setCompanyName(String companyName) {
+            this.companyName = companyName;
+        }
+
+        public String getStatus() {
+            return status;
+        }
+
+        public String getImgLog() {
+            return imgLog;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        public void setId(String id) {
+            this.id = id;
+        }
+
+        public void setImgLog(String imgLog) {
+            this.imgLog = imgLog;
+        }
+
+        public void setStatus(String status) {
+            this.status = status;
+        }
+
+        public String getIsHot() {
+            return isHot;
+        }
+
+        public void setIsHot(String isHot) {
+            this.isHot = isHot;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getMainBusiness() {
+            return mainBusiness;
+        }
+
+        public void setMainBusiness(String mainBusiness) {
+            this.mainBusiness = mainBusiness;
+        }
+
+        public String getStreet() {
+            return street;
+        }
+
+        public void setStreet(String street) {
+            this.street = street;
+        }
+
+        public String getDistance() {
+            return distance;
+        }
+
+        public void setDistance(String distance) {
+            this.distance = distance;
+        }
+
+        public Object[] getMainBusinessArr() {
+            return mainBusinessArr;
+        }
+
+        public void setMainBusinessArr(Object[] mainBusinessArr) {
+            this.mainBusinessArr = mainBusinessArr;
+        }
+
+        //自定义排序
+        @Override
+        public int compare(ServiceCategoryVo.InnerClickAllCar o1, ServiceCategoryVo.InnerClickAllCar o2) {
+            if (Integer.parseInt(o1.getIsHot()) > Integer.parseInt(o2.getIsHot())) {
+                return -1;
+            }
+            if (Integer.parseInt(o1.getIsHot()) < Integer.parseInt(o2.getIsHot())) {
+                return 1;
+            }
+
+            if (Integer.parseInt(o1.getStatus()) > Integer.parseInt(o2.getStatus())) {
+                return -1;
+            }
+
+            if (Integer.parseInt(o1.getStatus()) < Integer.parseInt(o2.getStatus())) {
+                return 1;
+            }
+            if (Integer.parseInt(o1.getDistance()) > Integer.parseInt(o2.getDistance())) {
+                return 1;
+            }
+            if (Integer.parseInt(o1.getDistance()) < Integer.parseInt(o2.getDistance())) {
+                return -1;
+            }
+            return 0;
+
+        }
+
+    }
+
     public Object[] getAll_class() {
         return all_class;
     }

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

@@ -14,6 +14,6 @@
   </resultMap>
 
   <select id="listAllPage" resultMap="BaseResultMap">
-    select * from notice order by top desc,sort desc,create_date desc limit 0,10
+    select  b.name title from provider b ,notice a where b.id = a.store_id order by a.top desc,a.sort desc,a.create_date desc limit 0,10
   </select>
 </mapper>

+ 3 - 0
src/main/resources/mapper/ProviderMapper.xml

@@ -232,6 +232,9 @@
             <if test="authPhone !=null and ''!= authPhone">
                 auth_phone = #{authPhone}
             </if>
+            <if test="roleType != null and roleType != ''">
+                and role_type = #{roleType}
+            </if>
 
         </where>
     </select>