Commit 1fc7f9b8 by 穆龙飞

modify:修改配置查询接口

parent 225e5103
......@@ -54,5 +54,5 @@ public interface FlowRpcSupplierSendService {
* @return
*/
@PostMapping("/api/initiateProject/quote/listSupplierQuoteInfoBySupplierIds.json")
AjaxResponse<List<SupplierGoodsInfoRsp>> SupplierGoodsInfoBySupplier(@RequestBody SupplierGoodsInfoReq req);
AjaxResponse<List<SupplierGoodsInfoRsp>> supplierGoodsInfoBySupplier(@RequestBody SupplierGoodsInfoReq req);
}
package com.netease.mail.yanxuan.change.web.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.netease.mail.yanxuan.change.biz.config.AppConfig;
import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.common.bean.ResponseCodeEnum;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierGoodsInfoReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierGoodsInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierInfoRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author WangJiaXiang
......@@ -32,13 +31,16 @@ public class SupplierController {
private FlowRpcSupplierService rpcSupplierService;
@Autowired
private FlowRpcSupplierSendService flowRpcSupplierSendService;
@Autowired
private AppConfig appConfig;
@GetMapping("/query/supplier/infos")
public AjaxResponse<List<SupplierInfoRsp>> querySupplierInfos(
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "uid", required = false) String uid,
@RequestParam(name = "fuzzySearchText") String fuzzySearchText) {
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "uid", required = false) String uid,
@RequestParam(name = "fuzzySearchText") String fuzzySearchText) {
if (name == null) {
name = appConfig.getSearchName();
}
......@@ -46,13 +48,20 @@ public class SupplierController {
uid = appConfig.getSearchUid();
}
AjaxResponse<List<SupplierInfoRsp>> supplierInfo = rpcSupplierService.getSupplierInfo(name, uid,
fuzzySearchText);
fuzzySearchText);
if (ResponseCodeEnum.SUCCESS.getCode() == (supplierInfo.getCode())) {
return supplierInfo;
}
log.error("[querySupplierInfos] querySupplierInfos failed, name={},uid={},fuzzySearchText={}, errMsg={}", name,
uid, fuzzySearchText, JSON.toJSONString(supplierInfo));
uid, fuzzySearchText, JSON.toJSONString(supplierInfo));
return null;
}
@GetMapping("/query/supplier/item")
public AjaxResponse<List<SupplierGoodsInfoRsp>> querySupplier(@RequestParam String supplier) {
SupplierGoodsInfoReq supplierGoodsInfoReq = new SupplierGoodsInfoReq();
supplierGoodsInfoReq.setSupplierIds(supplier);
return flowRpcSupplierSendService.supplierGoodsInfoBySupplier(supplierGoodsInfoReq);
}
}
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