Commit 1d5b4513 by 林永健

feat(strategy): 支持园区店关联查询和场景参数传递

1 parent 268d9afe
...@@ -80,8 +80,21 @@ public class MerchantStaffController { ...@@ -80,8 +80,21 @@ public class MerchantStaffController {
private void checkStaffExist(StrategyStaffRequest request) { private void checkStaffExist(StrategyStaffRequest request) {
RpcAssert.assertNotNull(request.getMerchantId(), DefaultErrorEnum.SERVER_ERROR, "门店号不能为空"); RpcAssert.assertNotNull(request.getMerchantId(), DefaultErrorEnum.SERVER_ERROR, "门店号不能为空");
RpcAssert.assertNotNull(request.getStaffPhone(), DefaultErrorEnum.SERVER_ERROR, "手机号不能为空"); RpcAssert.assertNotNull(request.getStaffPhone(), DefaultErrorEnum.SERVER_ERROR, "手机号不能为空");
// 查询园区店
int scene = request.getScene() == null ? 0 : request.getScene();
RpcResponse<MerchantListDTO> yqMerchantInfo = sceneMerchantRefRemote.getYqMerchantInfo(request.getMerchantId(), scene);
if (yqMerchantInfo.isFailed() || yqMerchantInfo.getResult() == null) {
log.error("查询4s店关联的园区店失败,merchantId:{}, scene:{}, response:{}", request.getMerchantId(), request.getScene(), yqMerchantInfo);
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "查询4s店关联的园区店失败");
}
Integer yqMerchantId = yqMerchantInfo.getResult().getMerchantId();
log.info("查询4s店关联的园区店成功,merchantId:{}, scene:{}", yqMerchantId, scene);
request.setYqMerchantId(yqMerchantId);
// 查询手机号员工是否已存在
MerchantStaffListRequest staffQuery = new MerchantStaffListRequest(); MerchantStaffListRequest staffQuery = new MerchantStaffListRequest();
staffQuery.setMerchantIds(Lists.newArrayList(request.getMerchantId())); staffQuery.setMerchantIds(Lists.newArrayList(request.getYqMerchantId()));
staffQuery.setStaffPhone(request.getStaffPhone()); staffQuery.setStaffPhone(request.getStaffPhone());
staffQuery.setStatusList(Lists.newArrayList(0, 2)); staffQuery.setStatusList(Lists.newArrayList(0, 2));
log.info("查询员工列表参数:{}", staffQuery); log.info("查询员工列表参数:{}", staffQuery);
...@@ -110,15 +123,8 @@ public class MerchantStaffController { ...@@ -110,15 +123,8 @@ public class MerchantStaffController {
staffRequest.setStaffLabel(request.getStaffLabel()); staffRequest.setStaffLabel(request.getStaffLabel());
staffRequest.setStaffBusinessType(0); staffRequest.setStaffBusinessType(0);
// 查询园区店 // 针对园区店
RpcResponse<MerchantListDTO> yqMerchantInfo = sceneMerchantRefRemote.getYqMerchantInfo(request.getMerchantId(), 0); Integer merchantId = request.getYqMerchantId();
if (yqMerchantInfo.isFailed() || yqMerchantInfo.getResult() == null) {
log.error("查询4s店关联的园区店失败,merchantId:{}, response:{}", request.getMerchantId(), yqMerchantInfo);
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "查询4s店关联的园区店失败");
}
Integer merchantId = yqMerchantInfo.getResult().getMerchantId();
log.info("查询4s店关联的园区店成功,merchantId:{}", merchantId);
// 查询商户主键 // 查询商户主键
RpcResponse<MerchantBaseInfoResponse> merchantRes = merchantRemote.findMerchantBaseInfo(merchantId); RpcResponse<MerchantBaseInfoResponse> merchantRes = merchantRemote.findMerchantBaseInfo(merchantId);
......
...@@ -18,6 +18,9 @@ public class StrategyStaffRequest extends AbstractRopRequest implements Serializ ...@@ -18,6 +18,9 @@ public class StrategyStaffRequest extends AbstractRopRequest implements Serializ
@ApiModelProperty(notes = "门店号") @ApiModelProperty(notes = "门店号")
private Integer merchantId; private Integer merchantId;
@ApiModelProperty(notes = "园区店门店号")
private Integer yqMerchantId;
@ApiModelProperty(notes = "员工编号") @ApiModelProperty(notes = "员工编号")
private String staffUuid; private String staffUuid;
...@@ -30,4 +33,7 @@ public class StrategyStaffRequest extends AbstractRopRequest implements Serializ ...@@ -30,4 +33,7 @@ public class StrategyStaffRequest extends AbstractRopRequest implements Serializ
@ApiModelProperty(notes = "员工标签:0: 会员权益 1:精品升级 2:膨胀金活动 3:售后众筹 4:次新车转化 7: 二手车") @ApiModelProperty(notes = "员工标签:0: 会员权益 1:精品升级 2:膨胀金活动 3:售后众筹 4:次新车转化 7: 二手车")
private String staffLabel; private String staffLabel;
@ApiModelProperty(notes = "场景:0:延保权益 1:轻改")
private Integer scene;
} }
...@@ -15,7 +15,7 @@ public class MerchantStaffControllerTest extends BaseControllerTest { ...@@ -15,7 +15,7 @@ public class MerchantStaffControllerTest extends BaseControllerTest {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
params.add("v", "1.0.0"); params.add("v", "1.0.0");
params.add("method", "dj.api.strategy.merchant.staff.add"); params.add("method", "dj.api.strategy.merchant.staff.add");
params.add("merchantId", "44209880"); params.add("merchantId", "44190245");
params.add("staffPhone", "17875511832"); params.add("staffPhone", "17875511832");
params.add("staffName", "林永健test002"); params.add("staffName", "林永健test002");
params.add("staffLabel", "0"); params.add("staffLabel", "0");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!