根據sku條碼:"SBS+3.0切邊"查詢商品,找不到。明明系統中存在該商品。
UnitSkuVO unitSkuVO = skuApi.selectSku(detailInfo.getUnitName(), detailInfo.getSkuCode(), customerId.toString());
@GetMapping("/api/selectSku")
UnitSkuVO selectSku(@RequestParam(name = "unit",defaultValue = "") String unit,
@RequestParam(name = "skuCode",defaultValue = "") String skuCode,
@RequestParam(name = "customerId",defaultValue = "0") String customerId) throws Exception;
查sql日誌發現,調用feign接口後,“SBS+3.0切邊”變成了“SBS 3.0切邊”。加號變成了空格。
修改:不使用get方式,使用post,請求參數放在body裏面。
@PostMapping("/api/selectSku")
UnitSkuVO selectSku(@RequestBody UnitSkuDTO dto) throws Exception;
UnitSkuDTO dto = new UnitSkuDTO();
dto.setUnit(detailInfo.getUnitName());
dto.setSkuCode(detailInfo.getSkuCode());
dto.setCustomerId(null == customerId ? 0L : customerId);
UnitSkuVO unitSkuVO = skuApi.selectSku(dto);
這樣就可以了。