Commit 24ce3d65 by jx-art

角色关联查询,解析

parent 3d52af49
...@@ -14,7 +14,7 @@ public interface FlowRpcSupplierInfoService { ...@@ -14,7 +14,7 @@ public interface FlowRpcSupplierInfoService {
/** /**
* 查询供应商关联角色 * 查询供应商关联角色
*/ */
AjaxResponse<List<SupplierUserRsp>> querySupplierRelatedUser(SupplierRelatedUserReq req); List<SupplierUserRsp> querySupplierRelatedUser(SupplierRelatedUserReq req);
......
package com.netease.mail.yanxuan.change.integration.flow.supplier.impl; package com.netease.mail.yanxuan.change.integration.flow.supplier.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierInfoService; import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierInfoService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq; import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp; import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
...@@ -28,15 +30,12 @@ public class FlowRpcSupplierInfoServiceImpl implements FlowRpcSupplierInfoServic ...@@ -28,15 +30,12 @@ public class FlowRpcSupplierInfoServiceImpl implements FlowRpcSupplierInfoServic
Logger logger = LoggerFactory.getLogger(FlowRpcSupplierInfoServiceImpl.class); Logger logger = LoggerFactory.getLogger(FlowRpcSupplierInfoServiceImpl.class);
@Override @Override
public AjaxResponse<List<SupplierUserRsp>> querySupplierRelatedUser(SupplierRelatedUserReq req) { public List<SupplierUserRsp> querySupplierRelatedUser(SupplierRelatedUserReq req) {
String url = "http://127.0.0.1:8550/proxy/test-v1.yanxuan-supplier-ms.service.mailsaas/api/supplier/batchGetSupplierRelatedUser.json"; String url = "http://127.0.0.1:8550/proxy/test-v1.yanxuan-supplier-ms.service.mailsaas/api/supplier/batchGetSupplierRelatedUser.json";
HashMap<String, Object> params = new HashMap<>(); JSONObject supplierUserRsp = rpcTemplate.postJson(url, JSON.toJSONString(req),500,new RpcObjectHandler<>(JSONObject.class));
params.put("searchType",req.getSearchType()); Object data = supplierUserRsp.get("data");
params.put("supplierIdList",req.getSupplierIdList()); List<SupplierUserRsp> objects = JSONArray.parseArray(data.toString(), SupplierUserRsp.class);
String s = JSON.toJSONString(req); logger.error("请求返回结果"+objects);
logger.error(s); return objects;
Object supplierUserRsp = rpcTemplate.postJson(url, s,500,new RpcObjectHandler<>(Object.class));
logger.error("请求返回结果"+supplierUserRsp.toString());
return null;
} }
} }
...@@ -14,7 +14,7 @@ public class SupplierUserRsp { ...@@ -14,7 +14,7 @@ public class SupplierUserRsp {
/** /**
* 供应商ID * 供应商ID
*/ */
private Integer supplierId; private String supplierId;
/** /**
* 角色ID(1-采购 2-计划 3-SQE 4-商品开发) 以及名称 * 角色ID(1-采购 2-计划 3-SQE 4-商品开发) 以及名称
......
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
*/ */
package com.netease.mail.yanxuan.change.web.controller; package com.netease.mail.yanxuan.change.web.controller;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService;
import com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierInfoService; import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierInfoService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq; import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp; import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -82,7 +83,7 @@ public class TestController { ...@@ -82,7 +83,7 @@ public class TestController {
private FlowRpcSupplierInfoService supplierInfoService; private FlowRpcSupplierInfoService supplierInfoService;
@PostMapping("/test") @PostMapping("/test")
public AjaxResponse<List<SupplierUserRsp>> test(@RequestBody SupplierRelatedUserReq req) { public List<SupplierUserRsp> test(@RequestBody SupplierRelatedUserReq req) {
return supplierInfoService.querySupplierRelatedUser(req); return supplierInfoService.querySupplierRelatedUser(req);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment