Commit eb43d736 by yelq

Merge all from rop-merchant scrm_v4.42.0_20240801

1 parent b9495268
......@@ -6,6 +6,7 @@ import cn.com.glsx.stoassistant.remote.MerchantStaffWithdrawalRemote;
import cn.com.glsx.stoassistant.remote.PlatformMerchantMissionRemote;
import cn.com.glsx.stoassistant.remote.PlatformMerchantStaffMissionRemote;
import com.glsx.biz.common.base.service.CarbrandService;
import com.glsx.biz.common.base.service.CartypeService;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
......@@ -105,4 +106,9 @@ public class DubboConfig {
return factory.builder(PlatformMerchantStaffMissionRemote.class).check(false).timeout(30000).version("1.0.0").build();
}
@Bean
public CartypeService getCartypeService(){
return factory.builder(CartypeService.class).check(false).version("2.2.0").timeout(30000).build();
}
}
......@@ -4,10 +4,12 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.request.DefaultRequest;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.car.CarTypeIdRequest;
import cn.com.glsx.merchants.response.AccountTypeResponse;
import cn.com.glsx.merchants.response.CarbrandResponse;
import cn.com.glsx.merchants.response.ChannelResponse;
import cn.com.glsx.merchants.service.MerchantCommonService;
import com.glsx.biz.common.base.entity.Cartype;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
......@@ -67,4 +69,15 @@ public class MerchantCommonController {
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.merchantCommon.getCarType", needInSession = NeedInSessionType.NO)
@ApiOperation("通过id获取车型信息")
public RopResponse<List<Cartype>> getCarTypeInfo(CarTypeIdRequest request){
try {
return RopResponse.success(merchantCommonService.getCarTypeInfo(request));
} catch (RpcServiceException e) {
log.info("=======MerchantCommonController__invoke__getCarTypeInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
}
package cn.com.glsx.merchants.request.car;
import com.rop.AbstractRopRequest;
import lombok.Data;
import java.util.List;
@Data
public class CarTypeIdRequest extends AbstractRopRequest {
/**
* 车型id集合
*/
private List<Integer> carTypeIdList;
}
......@@ -5,12 +5,16 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.merchants.convert.ConvertResponse;
import cn.com.glsx.merchants.model.response.MerchantChannelResponse;
import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.request.car.CarTypeIdRequest;
import cn.com.glsx.merchants.response.CarbrandResponse;
import cn.com.glsx.merchants.response.ChannelResponse;
import cn.com.glsx.merchants.response.MerchantTreeRopResponse;
import com.glsx.biz.common.base.entity.CarBrandSelected;
import com.glsx.biz.common.base.entity.Carbrand;
import com.glsx.biz.common.base.entity.Cartype;
import com.glsx.biz.common.base.service.CarbrandService;
import com.glsx.biz.common.base.service.CartypeService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -33,6 +37,9 @@ public class MerchantCommonService {
@Autowired
private MerchantRemote merchantRemote;
@Autowired
private CartypeService cartypeService;
public List<CarbrandResponse> getCarbrandTree() {
List<Carbrand> parentCarbrandList = carbrandService.getParentCarbrandList();
List<Carbrand> allList = carbrandService.getAllList();
......@@ -87,4 +94,10 @@ public class MerchantCommonService {
}
throw new RpcServiceException(allChannel.getException().getErrId(), allChannel.getMessage());
}
public List<Cartype> getCarTypeInfo(CarTypeIdRequest request){
List<Integer> carTypeIdList = request.getCarTypeIdList();
if (CollectionUtils.isEmpty(carTypeIdList)) return new ArrayList<>();
return cartypeService.getCarTypeInfoById(carTypeIdList);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!