当前位置:网站首页>JeeSite New Report
JeeSite New Report
2022-08-05 04:13:00 【victor-gx】
JeeSite新建报表
一、新建报表
在jeesiteDatabase new reportreport_ over_under_data
CREATE TABLE report_ over_under_data(
id VARCHAR(64) NOT NULL COMMENT '主键' ,
stat_month VARCHAR(10) COMMENT '日期' ,
report_number VARCHAR(10) COMMENT '报表' ,
remarks TEXT COMMENT '备注说明' ,
status VARCHAR(32) NOT NULL COMMENT '状态' ,
create_by VARCHAR(32) COMMENT '创建人' ,
create_date DATETIME COMMENT '创建时间' ,
update_by VARCHAR(32) COMMENT '更新人' ,
update_date DATETIME COMMENT '更新时间' ,
PRIMARY KEY (id)
) COMMENT = ' ';
二、生成代码
启动jeesite项目,Log in as a super administrator user,系统管理 ——> 研发工具 ——> 代码生成工具

点击右上角新增,Select the report you just createdreport_ over_under_data,后点击下一步


Enter the following in the table,点击保存并生成代码

此时在IDEA中,进入如下目录 web -> src -> main -> java -> com -> jeesite -> modules ,modules下会多一个report的文件夹,This folder is stored in java类,再进入 web -> src -> main -> resources -> mappings -> modules,modulesThere will be one more nextreport的文件夹,This folder is stored in xml文件,再进入 web -> src -> main -> resources -> views-> modules,modulesThere will be one more nextreport的文件夹,This folder is stored in html文件.


三、添加菜单选项
Log in as a super administrator user,系统管理 -> 系统设置 -> 菜单管理

点击右上角新增,Enter the following content


链接内容,在新建的report文件下的web文件夹中的ReportOverUnderDataController类中

The permission ID is also in this class

Try to choose the default weight or the second-level administrator for the menu weight,If System Administrator is selected,Then the second-level administrator will not have the permission to change,Also select super administrator,Neither system administrators nor secondary administrators will be granted permissions.
After setting, click Save.
然后重启项目.Log in to the super admin user again,You will see the menu we just created

四、测试功能
增
After selecting the data report,点击右上角新增,输入相关内容后,点击保存


After saving, it will return to the data report interface,At this point our data is added successfully

删
Click the delete button on the right,The data will also be deleted at this time,But we go back to the database to check,数据并没有被删除


But we'll find out nowstatus的数值为1,但我们将status的数值改为0,回到浏览器刷新页面,数据又回来了.
Because the deletion of the page is not really a physical deletion,只是逻辑删除,This is beneficial to data recovery.
status数值为0表示正常,status数值为1表示删除,status数值为2表示停用
物理删除:真实删除,将对应数据从数据库中删除,之后查询不到此条被删除的数据
逻辑删除:假删除,将对应数据中代表是否被删除字段的状态修改为“被删除状态”,之后在数据库中仍旧能看到此条数据记录
使用场景:可以进行数据恢复
改
Click the small green pen button on the right,Save after changing data



查
We are adding a set of data,Click on query in the upper right corner,Enter what we want to query,点击查询


我们再将test的status数值改为1,将test1的status数值改为2,再次查询test与test1


此时test1可查,test不可查.
正常、Disable check,Delete unchecked.
五、Add disable button
将reportOverUnderDataList.html中第70-73Change the line to the following,
<% if(hasPermi('report:reportOverUnderData:edit')){ %>
actions.push('<a href="${ctx}/report/reportOverUnderData/form?id='+row.id+'" class="btnList" title="${text("编辑数据报表")}"><i class="fa fa-pencil"></i></a> ');
<% } %>
<% if(hasPermi('report:reportOverUnderData:edit')){ %>
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/report/reportOverUnderData/disable?id='+row.id+'" class="btnList" title="${text("Disable data reporting")}" data-confirm="${text("Are you sure you want to deactivate this report?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
actions.push('<a href="${ctx}/report/reportOverUnderData/enable?id='+row.id+'" class="btnList" title="${text("Enable data reporting")}" data-confirm="${text("Are you sure you want to enable this report?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
}
<% } %>
<% if(hasPermi('report:reportOverUnderData:edit')){ %>
actions.push('<a href="${ctx}/report/reportOverUnderData/delete?id='+row.id+'" class="btnList" title="${text("Delete data report")}" data-confirm="${text("Are you sure you want to delete this data report?")}"><i class="fa fa-trash-o"></i></a> ');
<% } %>
在ReportOverUnderDataController.java中添加如下代码
/** * Deactivate reporting */
@RequiresPermissions("report:reportOverUnderData:edit")
@RequestMapping(value = "disable")
@ResponseBody
public String disable(ReportOverUnderData reportOverUnderData, HttpServletRequest request, HttpServletResponse response, Model model) {
reportOverUnderData.setStatus(ReportOverUnderData.STATUS_DISABLE);
reportOverUnderDataService.updateStatus(reportOverUnderData);
return renderResult(Global.TRUE, text("Deactivate reporting''{0}''成功", reportOverUnderData.getReportNumber()));
}
/** * Enable reporting */
@RequiresPermissions("report:reportOverUnderData:edit")
@RequestMapping(value = "enable")
@ResponseBody
public String enable(ReportOverUnderData reportOverUnderData, HttpServletRequest request, HttpServletResponse response, Model model) {
reportOverUnderData.setStatus(ReportOverUnderData.STATUS_NORMAL);
reportOverUnderDataService.updateStatus(reportOverUnderData);
return renderResult(Global.TRUE, text("Enable reporting''{0}''成功", reportOverUnderData.getReportNumber()));
}
重启项目
Test deactivation


六、雪花算法
回到数据库,We found dataid并不是递增的,It's a bunch of random data,The data here is not random,而是mybatisplus使用了雪花算法
核心思想:
长度共64bit(一个long型).
首先是一个符号位,1bit标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0.
41bit时间截(毫秒级),存储的是时间截的差值(当前时间截 - 开始时间截),结果约等于69.73年.
10bit作为机器的ID(5个bit是数据中心,5个bit的机器ID,可以部署在1024个节点).
12bit作为毫秒内的流水号(意味着每个节点在每毫秒可以产生 4096 个 ID).

- 优点:整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞,并且效率较高.
边栏推荐
- Paparazzi: Surface Editing by way of Multi-View Image Processing
- UE4 通过重叠事件开启门
- cross domain solution
- Redis key基本命令
- Mathematics - Properties of Summation Symbols
- 【8.1】代码源 - 【第二大数字和】【石子游戏 III】【平衡二叉树】
- 4T硬盘剩余很多提示“No space left on device“磁盘空间不足
- Growth-based checkerboard corner detection method
- UE4 通过互动(键盘按键)开门
- Bytebuffer put flip compact clear method demonstration
猜你喜欢

creo怎么测量点到面的距离

小程序_动态设置tabBar主题皮肤

UI自动化测试 App的WebView页面中,当搜索栏无搜索按钮时处理方法

A 35-year-old software testing engineer with a monthly salary of less than 2W, resigns and is afraid of not finding a job, what should he do?
![[BSidesCF 2019] Kookie](/img/29/19e7c244feb86b37ab32a53aa11f25.png)
[BSidesCF 2019] Kookie

【Mysql进阶优化篇02】索引失效的10种情况及原理

MySql index learning and use; (I think it is detailed enough)

No regrets, the appium automation environment is perfectly built

Static method to get configuration file data

多列属性column元素的可见性:display、visibility、opacity、垂直对齐方式:vertical-align、z-index 越大越显示在上层
随机推荐
特征预处理
C++ core programming
iMedicalLIS listener (2)
How to discover a valuable GameFi?
Machine Learning Overview
[BJDCTF2020]EasySearch
Mathematics - Properties of Summation Symbols
小程序_动态设置tabBar主题皮肤
Summary of common methods of arrays
[极客大挑战 2019]FinalSQL
四位数显表头设计
UE4 后期处理体积 (角色受到伤害场景颜色变淡案例)
[8.1] Code Source - [The Second Largest Number Sum] [Stone Game III] [Balanced Binary Tree]
【Mysql进阶优化篇02】索引失效的10种情况及原理
Is the NPDP certificate high in gold content?Compared to PMP?
flink读取mongodb数据源
[BJDCTF2020] EasySearch
Feature preprocessing
UE4 opens doors with overlapping events
DEJA_VU3D - Cesium功能集 之 058-高德地图纠偏