更新分页

This commit is contained in:
2023-01-28 19:51:31 +08:00
parent 33ac8957fb
commit 58473c78c6
6 changed files with 77 additions and 52 deletions

View File

@@ -55,6 +55,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author ldjun
@@ -104,6 +105,13 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
param.put("opc_id", whereJson.get("opc_id"));
}
JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(param).pageQuery(WqlUtil.getHttpContext(page), "update_time desc");
JSONArray jsonArray = json.getJSONArray("content");
List<Object> objects = jsonArray.toJavaList(Object.class);
Integer currentPageNumber = page.getPageNumber() + 1;
Integer pageMaxSize = page.getPageSize();
List<Object> protocolList = objects.stream().skip((currentPageNumber - 1) * pageMaxSize).limit(pageMaxSize).collect(Collectors.toList());
json.put("content",protocolList);
json.put("totalElements",jsonArray.size());
return json;
}

View File

@@ -53,6 +53,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @author ldjun
@@ -122,8 +123,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
map.put("is_over", is_over);
}
Integer currentPageNumber = page.getPageNumber() + 1;
Integer pageMaxSize = page.getPageSize();
final JSONObject jo = WQL.getWO("QINST_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
JSONArray jsonArray = jo.getJSONArray("content");
List<Instruction> instructions = jsonArray.toJavaList(Instruction.class);
List<Instruction> instDtoList = instructions.stream().skip((currentPageNumber - 1) * pageMaxSize).limit(pageMaxSize).collect(Collectors.toList());
jo.put("content",instDtoList);
jo.put("totalElements",jsonArray.size());
return jo;
}

View File

@@ -45,6 +45,7 @@
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
PAGEQUERY
SELECT

View File

@@ -55,6 +55,7 @@ import java.io.IOException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @author ldjun
@@ -175,8 +176,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
}
taskList.add(task);
}
Integer currentPageNumber = page.getPageNumber() + 1;
Integer pageMaxSize = page.getPageSize();
List<TaskDto> taskDtoList = taskList.stream().skip((currentPageNumber - 1) * pageMaxSize).limit(pageMaxSize).collect(Collectors.toList());
JSONObject jo = new JSONObject();
jo.put("content", taskList);
jo.put("content", taskDtoList);
jo.put("totalElements", taskList.size());
return jo;
}

View File

@@ -113,6 +113,8 @@
<el-table-column prop="opc_code" label="OpcServer" />
<el-table-column prop="plc_code" label="OpcPlc" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
@@ -125,10 +127,11 @@ import { get } from '@/api/system/dictDetail'
import { selectOpcList } from '@/api/acs/device/opc'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import pagination from '@crud/Pagination'
export default {
name: 'Protocol',
components: { crudOperation, rrOperation },
components: { crudOperation, rrOperation, pagination },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({

View File

@@ -169,6 +169,7 @@
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
@@ -178,6 +179,7 @@ import crudInstruction from '@/api/acs/instruction/instruction'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import { getDicts } from '@/api/system/dict'
import pagination from '@crud/Pagination'
const defaultForm = {
instruction_id: null,
@@ -218,7 +220,7 @@ const defaultForm = {
export default {
dicts: ['task_status'],
name: 'Instruction',
components: { crudOperation },
components: { crudOperation, pagination },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({