lxw
2023-08-15 160e150009b51a39fa95d9462c3798ba28d51a09
src/main/java/com/whyc/service/WorkflowMainService.java
@@ -135,6 +135,13 @@
    public Response<PageInfo<WorkflowMain>> ownListPage(int userId, int type, int status, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<WorkflowMain> mains = getOwnListByUserAndType(userId,type,status);
        if(type == 1) {
            for (WorkflowMain main : mains) {
                Integer id = main.getId();
                List<BattDischargePlanTemp> tempList = tempService.getListByMainId(id);
                main.setTempList(tempList);
            }
        }
        PageInfo<WorkflowMain> pageInfo = new PageInfo<>(mains);
        return new Response<PageInfo<WorkflowMain>>().set(1,pageInfo);
    }
@@ -157,11 +164,39 @@
    public Response<PageInfo<WorkflowMain>> getReceivedListPage(int type, int status, UserInf user, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<WorkflowMain> mains = getReceivedListByUserAndType(user,type,status);
        if (type == 1) {
            for (WorkflowMain main : mains) {
                Integer id = main.getId();
                List<BattDischargePlanTemp> tempList = tempService.getListByMainId(id);
                main.setTempList(tempList);
            }
        }
        PageInfo<WorkflowMain> pageInfo = new PageInfo<>(mains);
        return new Response<PageInfo<WorkflowMain>>().set(1,pageInfo);
        return new Response<PageInfo<WorkflowMain>>().set(1, pageInfo);
    }
    private List<WorkflowMain> getReceivedListByUserAndType(UserInf user, int type, int status) {
        return mapper.getReceivedListByUserAndType(user,type,status);
        return mapper.getReceivedListByUserAndType(user, type, status);
    }
    public WorkflowMain getOne(Integer mainId) {
        return mapper.selectById(mainId);
    }
    //查询表单编号
    public int getMaxId() {
        Integer id = mapper.getMaxId();
        if (id == null) {
            id = 1;
        } else {
            id = id + 1;
        }
        return id;
    }
    //插入主表带指定主键id不要自增
    public void addWorkMain(WorkflowMain main) {
        mapper.addWorkMain(main);
    }
}