当前位置:网站首页>JeeSite New Report
JeeSite New Report
2022-08-05 04:13:00 【victor-gx】
JeeSite新建报表
一、新建报表
在jeesite
Database 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碰撞,并且效率较高.
边栏推荐
- 浅析主流跨端技术方案
- The most comprehensive exam questions for software testing engineers in 2022
- How to discover a valuable GameFi?
- C++ core programming
- Based on holding YOLOv5 custom implementation of FacePose YOLO structure interpretation, YOLO data format conversion, YOLO process modification"
- 小程序_动态设置tabBar主题皮肤
- [CISCN2019 South China Division]Web11
- 【树莓派】树莓派调光
- Mysql的redo log详解
- Summary of common methods of arrays
猜你喜欢
机器学习概述
C++ core programming
将故事写成我们
Spark基础【介绍、入门WordCount案例】
动力小帆船制作方法简单,电动小帆船制作方法
MySql index learning and use; (I think it is detailed enough)
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?
UE4 为子弹蓝图添加声音和粒子效果
In the WebView page of the UI automation test App, the processing method when the search bar has no search button
bytebuffer internal structure
随机推荐
bytebuffer internal structure
AUTOCAD——标注关联
BI业务分析思维:现金流量风控分析(二)信用、流动和投资风险
Cron(Crontab)--use/tutorial/example
DNS被劫持如何处理?
Index Mysql in order to optimize paper 02 】 【 10 kinds of circumstances and the principle of failure
日志导致线程Block的这些坑,你不得不防
DEJA_VU3D - Cesium功能集 之 057-百度地图纠偏
cross domain solution
The test salary is so high?20K just graduated
Redis key basic commands
Is the NPDP certificate high in gold content?Compared to PMP?
[CISCN2019 华东南赛区]Web11
Solana NFT开发指南
bytebuffer use demo
App快速开发建设心得:小程序+自定义插件的重要性
There are several common event handling methods in Swing?How to listen for events?
Mathematics - Properties of Summation Symbols
Machine Learning Overview
狗仔队:表面编辑多视点图像处理