给供应商客户接口增加分页开关

This commit is contained in:
jishenghua
2025-09-27 23:32:03 +08:00
parent 7199be6333
commit e64c16a4cb
4 changed files with 20 additions and 13 deletions

View File

@@ -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<Supplier> supplierList = supplierService.findBySelectCus(key, organId);
List<Supplier> 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<Supplier> supplierList = supplierService.findBySelectSup(key, organId);
Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null;
List<Supplier> 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<Supplier> supplierList = supplierService.findBySelectSup(key, organId);
List<Supplier> 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<Supplier> customerList = supplierService.findBySelectCus(key, organId);
List<Supplier> 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<Supplier> supplierList = supplierService.findBySelectRetail(key, organId);
Integer limit = jsonObject.get("limit")!=null ? jsonObject.getInteger("limit") : null;
List<Supplier> supplierList = supplierService.findBySelectRetail(key, organId, limit);
JSONArray dataArray = new JSONArray();
if (null != supplierList) {
for (Supplier supplier : supplierList) {

View File

@@ -34,7 +34,8 @@ public interface SupplierMapperEx {
List<Supplier> findByTypeAndKey(
@Param("type") String type,
@Param("key") String key);
@Param("key") String key,
@Param("limit") Integer limit);
Supplier getInfoById(
@Param("id") Long id);

View File

@@ -288,10 +288,10 @@ public class SupplierService {
}
}
public List<Supplier> findBySelectCus(String key, Long organId)throws Exception {
public List<Supplier> findBySelectCus(String key, Long organId, Integer limit)throws Exception {
List<Supplier> 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<Supplier> findBySelectSup(String key, Long organId)throws Exception {
public List<Supplier> findBySelectSup(String key, Long organId, Integer limit)throws Exception {
List<Supplier> 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<Supplier> findBySelectRetail(String key, Long organId)throws Exception {
public List<Supplier> findBySelectRetail(String key, Long organId, Integer limit)throws Exception {
List<Supplier> list=null;
try{
list = supplierMapperEx.findByTypeAndKey("会员", key);
list = supplierMapperEx.findByTypeAndKey("会员", key, limit);
if(organId!=null) {
list = addOrganToList(list, organId);
}