maven web 部门模块的 实现 攻略 创建部门对象

50 篇文章 0 订阅
10 篇文章 0 订阅

部门模块的 controller层

先要分析 企业的部门结构
分清企业部门的层级结构
董事会—》一级部门—》二级部门—》基层

部门模块 属于系统功能,要在system包 就是系统包的意思
进行开发

部门对象

   private String id;
    //部门名称
    private String deptName;
    //父类id
    private String parentId;
    //部门状况
    private Integer state;
//父类
    private Dept parent;

在一个部门中牵涉到的信息有
部门id、 String id
部门名称、String deptName
上级部门、String parentId
状态、Integer state 这主要用来做隐形的逻辑,显示部门的情况是:解散、合并、新建等。
Dept parent; 上级部门 在部门对象中存在自关联,用次对象做他的上级部门的成员变量名。

这里也要找到页面的代码看看部门对象的成员是否与页面的
数据列表中的数据 个数、名称 是否能对应得上

<!--数据列表-->
                <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                    <thead>
                    <tr>
                        <th class="" style="padding-right:0px;">
                            <input type="checkbox" name="selid" onclick="checkAll('id',this)">
                        </th>
                        <th class="sorting">部门名称</th>
                        <th class="sorting">所属部门</th>
                        <th class="sorting">状态</th>
                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${page.list}" var="dept">
                        <tr>
                            <td><input type="checkbox" name="id" value="${dept.id }"/></td>
                            <td>${dept.deptName }</td>
                            <td>${dept.parent.deptName }</td>
                            <td>${dept.state ==0?'未启用':'使用中'}</td>
                            <th class="text-center">
                                <button type="button" class="btn bg-olive btn-xs" onclick='location.href="${ctx}/system/dept?operation=toEdit&id=${dept.id}"'>编辑</button>
                            </th>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>

接下来 配置这个部门对象的映射文件,就是建立起对象成员变量名称与数据库的数据表列中的字段名,的关联关系。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

普希托夫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值