增加根据名称获取供应商或者客户信息的接口
This commit is contained in:
@@ -508,4 +508,19 @@ public class SupplierController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getInfoByName")
|
||||
@ApiOperation(value = "根据名称获取信息")
|
||||
public String getInfoByName(@RequestParam("name") String name,
|
||||
@RequestParam("type") String type,
|
||||
HttpServletRequest request) throws Exception {
|
||||
Supplier supplier = supplierService.getInfoByName(name, type);
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
if(supplier != null) {
|
||||
objectMap.put("info", supplier);
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,4 +39,8 @@ public interface SupplierMapperEx {
|
||||
|
||||
Supplier getInfoById(
|
||||
@Param("id") Long id);
|
||||
|
||||
Supplier getInfoByName(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type);
|
||||
}
|
||||
@@ -700,4 +700,8 @@ public class SupplierService {
|
||||
public List<SupplierSimple> getAllCustomer() {
|
||||
return supplierMapperEx.getAllCustomer();
|
||||
}
|
||||
|
||||
public Supplier getInfoByName(String name, String type) {
|
||||
return supplierMapperEx.getInfoByName(name, type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user