|
|
|
@ -25,6 +25,7 @@ import org.jeecg.modules.demo.base.service.IZyClothsModularService; |
|
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
|
|
|
|
import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; |
|
|
|
|
import org.jeecg.modules.zystylemodule.entity.NewStyleModule; |
|
|
|
|
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; |
|
|
|
|
import org.jeecg.modules.zystylemodule.service.INewZyStyleModuleService; |
|
|
|
@ -121,25 +122,9 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
newSeMo.setTypeName(typeById.getTypeName()); |
|
|
|
|
listNewStyleModules.add(newSeMo); |
|
|
|
|
} |
|
|
|
|
Page page = new Page(); |
|
|
|
|
int size = listNewStyleModules.size(); |
|
|
|
|
if (pageSize > size && size!=0) { |
|
|
|
|
pageSize = size; |
|
|
|
|
} |
|
|
|
|
// 求出最大页数,防止currentPage越界
|
|
|
|
|
int maxPage = size % pageSize == 0 ? size / pageSize : size / pageSize + 1; |
|
|
|
|
if (pageNo > maxPage) { |
|
|
|
|
pageNo = maxPage; |
|
|
|
|
} |
|
|
|
|
// 当前页第一条数据的下标
|
|
|
|
|
int curIdx = pageNo > 1 ? (pageNo - 1) * pageSize : 0; |
|
|
|
|
List pageList = new ArrayList(); |
|
|
|
|
// 将当前页的数据放进pageList
|
|
|
|
|
for (int i = 0; i < pageSize && curIdx + i < size; i++) { |
|
|
|
|
pageList.add(listNewStyleModules.get(curIdx + i)); |
|
|
|
|
} |
|
|
|
|
page.setCurrent(pageNo).setSize(pageSize).setTotal(listNewStyleModules.size()).setRecords(pageList); |
|
|
|
|
return Result.OK(page); |
|
|
|
|
IPage<NewStyleModule> pageList = new Page<>(pageNo, pageSize, list.size()); |
|
|
|
|
pageList.setRecords(listNewStyleModules); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|