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