提交 4320d4cf authored 作者: aiqingguo's avatar aiqingguo

承运同步

上级 833fb0a5
...@@ -12,4 +12,6 @@ public interface TransportService { ...@@ -12,4 +12,6 @@ public interface TransportService {
void ownerPersonalSync(OwnerPersonalSyncParam param); void ownerPersonalSync(OwnerPersonalSyncParam param);
boolean ownerPersonalSync(String mobile);
} }
...@@ -41,4 +41,11 @@ public class TransportServiceImpl implements TransportService { ...@@ -41,4 +41,11 @@ public class TransportServiceImpl implements TransportService {
} }
@Override
public boolean ownerPersonalSync(String mobile) {
return Optional.ofNullable(transportFeignService.ownerExistCheck(mobile))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData() == 1;
}
} }
...@@ -5,10 +5,13 @@ import com.clx.performance.param.feign.transport.OwnerPersonalSyncParam; ...@@ -5,10 +5,13 @@ import com.clx.performance.param.feign.transport.OwnerPersonalSyncParam;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam; import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import javax.validation.constraints.NotBlank;
@FeignClient(name = "transport-service-yitu", url = "${transport-service.host}") @FeignClient(name = "transport-service-yitu", url = "${transport-service.host}")
public interface TransportFeignService { public interface TransportFeignService {
...@@ -30,4 +33,11 @@ public interface TransportFeignService { ...@@ -30,4 +33,11 @@ public interface TransportFeignService {
@RequestMapping(value = "/ownerPersonalSync", method = RequestMethod.POST) @RequestMapping(value = "/ownerPersonalSync", method = RequestMethod.POST)
Result ownerPersonalSync(@RequestBody OwnerPersonalSyncParam param); Result ownerPersonalSync(@RequestBody OwnerPersonalSyncParam param);
/**
* 检测货主是否注册
* @return 1存在 2不存在
*/
@RequestMapping(value = "/ownerExistCheck", method = RequestMethod.POST)
Result<Integer> ownerExistCheck(@Validated @NotBlank(message = "手机不能为空") String mobile);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论