diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java index 7cd5acf0..564654cf 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java @@ -155,11 +155,12 @@ public class SupplierController extends BaseController { try { String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null; Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null; + Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null; String type = "UserCustomer"; Long userId = userService.getUserId(request); //获取权限信息 String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); - List supplierList = supplierService.findBySelectCus(key, organId); + List supplierList = supplierService.findBySelectCus(key, organId, limit); JSONArray dataArray = new JSONArray(); if (null != supplierList) { boolean customerFlag = systemConfigService.getCustomerFlag(); @@ -193,7 +194,8 @@ public class SupplierController extends BaseController { try { String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null; Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null; - List supplierList = supplierService.findBySelectSup(key, organId); + Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null; + List supplierList = supplierService.findBySelectSup(key, organId, limit); JSONArray dataArray = new JSONArray(); if (null != supplierList) { for (Supplier supplier : supplierList) { @@ -224,9 +226,10 @@ public class SupplierController extends BaseController { try { String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null; Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null; + Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null; JSONArray dataArray = new JSONArray(); //1、获取供应商信息 - List supplierList = supplierService.findBySelectSup(key, organId); + List supplierList = supplierService.findBySelectSup(key, organId, limit); if (null != supplierList) { for (Supplier supplier : supplierList) { JSONObject item = new JSONObject(); @@ -239,7 +242,7 @@ public class SupplierController extends BaseController { String type = "UserCustomer"; Long userId = userService.getUserId(request); String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); - List customerList = supplierService.findBySelectCus(key, organId); + List customerList = supplierService.findBySelectCus(key, organId, limit); if (null != customerList) { boolean customerFlag = systemConfigService.getCustomerFlag(); for (Supplier supplier : customerList) { @@ -272,7 +275,8 @@ public class SupplierController extends BaseController { try { String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null; Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null; - List supplierList = supplierService.findBySelectRetail(key, organId); + Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null; + List supplierList = supplierService.findBySelectRetail(key, organId, limit); JSONArray dataArray = new JSONArray(); if (null != supplierList) { for (Supplier supplier : supplierList) { diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java index 5f8f98a1..d142df50 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java @@ -34,7 +34,8 @@ public interface SupplierMapperEx { List findByTypeAndKey( @Param("type") String type, - @Param("key") String key); + @Param("key") String key, + @Param("limit") Integer limit); Supplier getInfoById( @Param("id") Long id); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/SupplierService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/SupplierService.java index dc4c031d..73037544 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/SupplierService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/SupplierService.java @@ -288,10 +288,10 @@ public class SupplierService { } } - public List findBySelectCus(String key, Long organId)throws Exception { + public List findBySelectCus(String key, Long organId, Integer limit)throws Exception { List list=null; try{ - list = supplierMapperEx.findByTypeAndKey("客户", key); + list = supplierMapperEx.findByTypeAndKey("客户", key, limit); if(organId!=null) { list = addOrganToList(list, organId); } @@ -301,10 +301,10 @@ public class SupplierService { return list; } - public List findBySelectSup(String key, Long organId)throws Exception { + public List findBySelectSup(String key, Long organId, Integer limit)throws Exception { List list=null; try{ - list = supplierMapperEx.findByTypeAndKey("供应商", key); + list = supplierMapperEx.findByTypeAndKey("供应商", key, limit); if(organId!=null) { list = addOrganToList(list, organId); } @@ -314,10 +314,10 @@ public class SupplierService { return list; } - public List findBySelectRetail(String key, Long organId)throws Exception { + public List findBySelectRetail(String key, Long organId, Integer limit)throws Exception { List list=null; try{ - list = supplierMapperEx.findByTypeAndKey("会员", key); + list = supplierMapperEx.findByTypeAndKey("会员", key, limit); if(organId!=null) { list = addOrganToList(list, organId); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml index 7988c926..2c3b8375 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml @@ -92,7 +92,9 @@ and ifnull(delete_flag,'0') !='1' order by sort asc, id desc - limit 0,1000 + + limit 0, 500 +