Commit 5dbb535f9baf4f168040e523269e870bb5249a06

Authored by 张志伟
2 parents 61733fdb 595df60c

Merge remote-tracking branch 'origin/test'

fw-valhalla-rpc/src/main/java/cn/fw/valhalla/rpc/oop/OopService.java
... ... @@ -76,9 +76,10 @@ public class OopService extends AbsBaseRpcService {
76 76 * 根据车系ID获取车系信息
77 77 *
78 78 * @param seriesId 车系ID
  79 + * @param groupId 集团id
79 80 * @return 车系信息
80 81 */
81   - public SeriesDTO getSeriesById(final Long seriesId) {
  82 + public SeriesDTO getSeriesById(final Long seriesId, final Long groupId) {
82 83 if (seriesId == null) {
83 84 return null;
84 85 }
... ... @@ -88,7 +89,7 @@ public class OopService extends AbsBaseRpcService {
88 89 return seriesDTO;
89 90 }
90 91 try {
91   - final Message<CarSeriesInfoVo> msg = carSeriesApiService.getSeriesInfo(seriesId);
  92 + final Message<CarSeriesInfoVo> msg = carSeriesApiService.getSeriesInfo(groupId, seriesId);
92 93 log.info("carSeriesApiService.getSeriesInfo: msg.code={}, msg.result={}, msg.data={}", msg.getCode(), msg.getResult(), msg.getData());
93 94 if (msg.isSuccess() && !Objects.isNull(msg.getData())) {
94 95 final SeriesDTO series = new SeriesDTO();
... ... @@ -139,7 +140,7 @@ public class OopService extends AbsBaseRpcService {
139 140 * @return 门店信息
140 141 */
141 142 public ShopDTO shop(final Long shopId) {
142   - if (shopId == null || Long.valueOf(146L).equals(shopId)) {
  143 + if (shopId == null) {
143 144 return null;
144 145 }
145 146 String key = generateKey(OopTypeEnum.SHOP, shopId);
... ... @@ -312,7 +313,7 @@ public class OopService extends AbsBaseRpcService {
312 313 }).collect(Collectors.toList());
313 314 }
314 315  
315   - public SpecDTO spec(final Long specId) {
  316 + public SpecDTO spec(final Long specId, final Long groupId) {
316 317 if (Objects.isNull(specId)) {
317 318 return null;
318 319 }
... ... @@ -322,7 +323,7 @@ public class OopService extends AbsBaseRpcService {
322 323 return JSONObject.parseObject(json, SpecDTO.class);
323 324 }
324 325 try {
325   - Message<CarSpecInfoVo> msg = carSpecApiService.getSpecInfo(specId);
  326 + Message<CarSpecInfoVo> msg = carSpecApiService.getSpecInfo(groupId, specId);
326 327 log.info("carSpecApiService.getSpecInfo: msg.code={}, msg.result={}, msg.data={}", msg.getCode(), msg.getResult(), msg.getData());
327 328 if (msg.isSuccess() && !Objects.isNull(msg.getData())) {
328 329 final CarSpecInfoVo dto = msg.getData();
... ... @@ -398,12 +399,12 @@ public class OopService extends AbsBaseRpcService {
398 399 * @param brandId 品牌id
399 400 * @return 车系列表
400 401 */
401   - public List<CarSeriesInfoVo> getCarSeriesListByBrandId(final Long brandId) {
  402 + public List<CarSeriesInfoVo> getCarSeriesListByBrandId(final Long brandId, final Long groupId) {
402 403 if (Objects.isNull(brandId)) {
403 404 return Collections.emptyList();
404 405 }
405 406 try {
406   - final Message<List<CarSeriesInfoVo>> msg = carSeriesApiService.getSeriesInfoList(brandId);
  407 + final Message<List<CarSeriesInfoVo>> msg = carSeriesApiService.getSeriesInfoList(groupId, brandId);
407 408 log.info("调用OOP系统获取[根据品牌ID[{}]查询车系列表] 结果:[{}]", brandId, msg.getResult());
408 409 if (!msg.isSuccess() || CollectionUtils.isEmpty(msg.getData())) {
409 410 return Collections.emptyList();
... ...
fw-valhalla-rpc/src/main/java/cn/fw/valhalla/rpc/oop/dto/ShopDTO.java
... ... @@ -4,6 +4,7 @@ import lombok.Data;
4 4  
5 5 import java.io.Serializable;
6 6 import java.math.BigDecimal;
  7 +import java.util.List;
7 8  
8 9 /**
9 10 * 门店信息
... ... @@ -66,22 +67,18 @@ public class ShopDTO implements Serializable {
66 67 * 经度(百度坐标系)
67 68 */
68 69 private BigDecimal lng;
69   -
70 70 /**
71 71 * 纬度(百度坐标系)
72 72 */
73 73 private BigDecimal lat;
74   -
75 74 /**
76 75 * 门店地址
77 76 */
78 77 private String addr;
79   -
80 78 /**
81 79 * 门店地址所属城市区划编码
82 80 */
83 81 private String cityBh;
84   -
85 82 /**
86 83 * 负责人
87 84 */
... ... @@ -106,4 +103,18 @@ public class ShopDTO implements Serializable {
106 103 * 门店状态
107 104 */
108 105 private Integer status;
  106 +
  107 + /**
  108 + * 网络销售门店标记
  109 + */
  110 + private Integer onlineSalesTag;
  111 + /**
  112 + * 是否自有产权 1 是 0 否
  113 + */
  114 + private Boolean owned;
  115 + /**
  116 + * 门店开展业务集合
  117 + * {@link cn.fw.oop.sdk.enums.ShopBusinessTypeEnum}
  118 + */
  119 + private List<Integer> authBusinessList;
109 120 }
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AbstractCustomerService.java
... ... @@ -210,7 +210,7 @@ public abstract class AbstractCustomerService {
210 210 * @return
211 211 */
212 212 protected Long saveNewOne(Customer customer, CustomerBaseInfo baseInfo, boolean orderCar) {
213   - final SpecDTO spec = oopService.spec(customer.getSpecId());
  213 + final SpecDTO spec = oopService.spec(customer.getSpecId(), customer.getGroupId());
214 214 customer.setCarImage(Optional.ofNullable(spec).orElse(new SpecDTO()).getThumbnail());
215 215 final String plateNo = customer.getPlateNo();
216 216 final int count = customerService.count(Wrappers.<Customer>lambdaQuery()
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... ... @@ -880,7 +880,7 @@ public class CustomerBizService extends AbstractCustomerService {
880 880 customer.setUpdateTime(new Date());
881 881 customer.setYn(Boolean.TRUE);
882 882 customer.setTemporary(Boolean.FALSE);
883   - final SpecDTO spec = oopService.spec(customerParams.getSpecId());
  883 + final SpecDTO spec = oopService.spec(customerParams.getSpecId(), customerParams.getGroupId());
884 884 customer.setCarImage(Optional.ofNullable(spec).orElse(new SpecDTO()).getThumbnail());
885 885 customer.setShopId(casShopId);
886 886 Long cid = saveNewOne(customer, baseInfo, true);
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java
1 1 package cn.fw.valhalla.service.bus.follow.strategy;
2 2  
3 3 import cn.fw.oop.sdk.enums.BizTypeEnum;
  4 +import cn.fw.oop.sdk.enums.ShopBusinessTypeEnum;
4 5 import cn.fw.shirasawa.sdk.enums.BusinessTypeEnum;
5 6 import cn.fw.shirasawa.sdk.enums.DataTypeEnum;
6 7 import cn.fw.shirasawa.sdk.enums.TerminationReason;
... ... @@ -887,4 +888,15 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
887 888 }
888 889 }
889 890 }
  891 +
  892 + protected boolean isFollowShop(final Long shopId) {
  893 + ShopDTO shop = oopService.shop(shopId);
  894 + BV.notNull(shop, () -> "门店数据获取失败");
  895 + if (!CollectionUtils.isEmpty(shop.getAuthBusinessList())) {
  896 + Set<Integer> shopAuthSet = new HashSet<>(shop.getAuthBusinessList());
  897 + return !shopAuthSet.contains(ShopBusinessTypeEnum.BP.getCode()) || shopAuthSet.size() != 1;
  898 + }
  899 +
  900 + return true;
  901 + }
890 902 }
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java
... ... @@ -88,6 +88,13 @@ public class FMFollowStrategy extends AbstractFollowStrategy {
88 88 followClueService.removeById(followClue.getId());
89 89 return;
90 90 }
  91 + Long shopId = customer.getShopId();
  92 + boolean followShop = isFollowShop(shopId);
  93 + if (!followShop) {
  94 + followClueService.removeById(followClue.getId());
  95 + return;
  96 + }
  97 +
91 98 followClue.setPlateNo(customer.getPlateNo());
92 99 final ClueTask clueTask = super.createNewTask(followClue);
93 100 List<PostUserDTO> userByRole = userService.getUserByRole(clueTask.getFollowShop(), RoleCode.FWGW);
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java
... ... @@ -78,6 +78,11 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
78 78 followClueService.removeById(followClue.getId());
79 79 return;
80 80 }
  81 + boolean followShop = isFollowShop(customer.getShopId());
  82 + if (!followShop) {
  83 + followClueService.removeById(followClue.getId());
  84 + return;
  85 + }
81 86 followClue.setPlateNo(customer.getPlateNo());
82 87 final ClueTask clueTask = super.createNewTask(followClue);
83 88 List<PostUserDTO> userByRole = userService.getUserByRole(clueTask.getFollowShop(), RoleCode.FWGW);
... ...
... ... @@ -39,7 +39,7 @@
39 39 <mysql-connector-java.version>5.1.47</mysql-connector-java.version>
40 40 <HikariCP.version>3.3.1</HikariCP.version>
41 41 <!-- fw -->
42   - <fw-oop-sdk.version>3.0.0</fw-oop-sdk.version>
  42 + <fw-oop-sdk.version>4.0.0</fw-oop-sdk.version>
43 43 <fw-mkt-sdk.version>1.0</fw-mkt-sdk.version>
44 44 <fw-member-sdk.version>3.0.0</fw-member-sdk.version>
45 45 <fw-passport-sdk.version>3.0.0</fw-passport-sdk.version>
... ...