// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // package com.liruilong.hros.controller.statistics; import com.liruilong.hros.model.datas.DataModel; import com.liruilong.hros.service.EmployeeService; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping({"/statistics/personnel"}) public class PersonnelController { @Autowired EmployeeService employeeService; public PersonnelController() { } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/Position"}) public List<DataModel> DataViewPosition() { return this.employeeService.dataViewPosition(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/JobLevel"}) public List<DataModel> DataViewJobLevel() { return this.employeeService.dataViewJobLevel(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/Department"}) public List<DataModel> DataViewDepartment() { return this.employeeService.dataViewDepartment(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/tiptopdegree"}) public List<DataModel> DataViewtiptopdegree() { return this.employeeService.dataViewtiptopdegree(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/school"}) public List<DataModel> DataViewschool() { return this.employeeService.dataViewschool(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/nation"}) public List<DataModel> DataViewNation() { return this.employeeService.dataViewNation(); } @Scheduled( cron = "0 0 3 * * ?" ) @GetMapping({"/politicsstatus"}) public List<DataModel> DataViewPoliticsstatus() { return this.employeeService.dataViewPoliticsstatus(); } }

时间: 2024-03-18 13:43:26 浏览: 25
这是一段Java代码,是一个名为PersonnelController的类,它位于com.liruilong.hros.controller.statistics包中。该类有七个公共方法,分别为DataViewPosition、DataViewJobLevel、DataViewDepartment、DataViewtiptopdegree、DataViewschool、DataViewNation和DataViewPoliticsstatus。这些方法都使用了@GetMapping注释,它们将在指定时间(cron表达式中指定)调用,并返回一个List<DataModel>对象。该类还使用了@Autowired注释,以注入一个名为employeeService的EmployeeService对象。另外,该类还使用了@Scheduled注释,以指定每个方法的调用时间。
相关问题

// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // package Servlet; import Service.impl.UserServiceImpl; import domain.User; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @WebServlet({"/userListServlet"}) public class userListServlet extends HttpServlet { public userListServlet() { } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); UserServiceImpl service = new UserServiceImpl(); List<User> users = service.findAll(); request.setAttribute("users", users); request.getRequestDispatcher("/list.jsp").forward(request, response); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } }

这是一个 Servlet,用于处理用户请求并返回用户列表。该 Servlet 使用了 UserServiceImpl 类的实现来获取用户列表,并将其存储在 request 对象中,最后将请求转发到 list.jsp 页面。其中,doPost() 方法处理 POST 请求,doGet() 方法处理 GET 请求。该 Servlet 的 URL 映射为 "/userListServlet"。

// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // package com.baomidou.mybatisplus.core.toolkit; import java.lang.reflect.Array; import java.util.Collection; import java.util.Map; public class ObjectUtils { public ObjectUtils() { } public static boolean isNull(Object... objs) { Object[] var1 = objs; int var2 = objs.length; for(int var3 = 0; var3 < var2; ++var3) { Object obj = var1[var3]; if (isEmpty(obj)) { return true; } } return false; } public static boolean isNotNull(Object... obj) { return !isNull(obj); } public static boolean isNotEmpty(Object obj) { return !isEmpty(obj); } public static boolean isEmpty(Object obj) { if (obj == null) { return true; } else if (obj.getClass().isArray()) { return Array.getLength(obj) == 0; } else if (obj instanceof CharSequence) { return ((CharSequence)obj).length() == 0; } else if (obj instanceof Collection) { return ((Collection)obj).isEmpty(); } else { return obj instanceof Map ? ((Map)obj).isEmpty() : false; } } }

这是一个对象工具类,其中包含了一些常用的判断对象是否为空的方法。主要有以下几个方法: - `isNull(Object... objs)`: 判断传入的多个对象是否有为空的情况,只要有一个为空就返回`true`,否则返回`false`。 - `isNotNull(Object... obj)`: 判断传入的多个对象是否都不为空,只要有一个为空就返回`false`,否则返回`true`。 - `isNotEmpty(Object obj)`: 判断传入的对象是否不为空,如果对象不为空就返回`true`,否则返回`false`。 - `isEmpty(Object obj)`: 判断传入的对象是否为空,根据对象的不同类型进行不同的判断。如果对象为null,返回`true`;如果对象是数组类型,判断数组长度是否为0;如果对象是CharSequence类型(如String),判断字符序列长度是否为0;如果对象是Collection类型,判断集合是否为空;如果对象是Map类型,判断Map是否为空。以上情况均不满足,则返回`false`。 这些方法可以方便地判断对象是否为空,提供了一些常用的判断逻辑。

相关推荐

// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.core; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class ConnDB { public Connection conn = null; public Statement stmt = null; public ResultSet rs = null; private static String propFileName = "/com/connDB.properties"; private static Properties prop = new Properties(); private static String dbClassName = "com.mysql.jdbc.Driver"; private static String dbUrl = "jdbc:mysql://127.0.0.1:3306/db_librarysys?user=root&password=aaaaaa&useUnicode=true"; public ConnDB() { try { InputStream in = this.getClass().getResourceAsStream(propFileName); prop.load(in); dbClassName = prop.getProperty("DB_CLASS_NAME"); dbUrl = prop.getProperty("DB_URL", dbUrl); } catch (Exception var2) { var2.printStackTrace(); } } public static Connection getConnection() { Connection conn = null; try { Class.forName(dbClassName).newInstance(); conn = DriverManager.getConnection(dbUrl); } catch (Exception var2) { var2.printStackTrace(); System.out.println("wgh:" + dbUrl); } if (conn == null) { System.err.println("警告: DbConnectionManager.getConnection() 获得数据库链接失败.\r\n\r\n链接类型:" + dbClassName + "\r\n链接位置1:" + dbUrl); } return conn; } public ResultSet executeQuery(String sql) { try { this.conn = getConnection(); this.stmt = this.conn.createStatement(1004, 1007); this.rs = this.stmt.executeQuery(sql); } catch (SQLException var3) { System.err.println(var3.getMessage()); } return this.rs; } public int executeUpdate(String sql) { boolean var2 = false; int result; try { this.conn = getConnection(); this.stmt = this.conn.createStatement(1004, 1007); result = this.stmt.executeUpdate(sql); } catch (SQLException var4) { result = 0; } return result; } public void close() { try { if (this.rs != null) { this.rs.close(); } if (this.stmt != null) { this.stmt.close(); } if (this.conn != null) { this.conn.close(); } } catch (Exception var2) { var2.printStackTrace(System.err); } } }

最新推荐

recommend-type

Maven 下载、安装、配置与使用教程

Maven 下载、安装、配置与使用教程。含maven程序 markdown文本,请使用vscode等代码编辑器查看!!!
recommend-type

起重机械维护保养工艺通则.docx

起重机械维护保养工艺通则.docx
recommend-type

起重机控制部分故障及排除方法表.docx

起重机控制部分故障及排除方法表.docx
recommend-type

试验材料留样期限统计表.docx

试验材料留样期限统计表.docx
recommend-type

龙门吊纠偏装置安装情况调查表.xlsx

龙门吊纠偏装置安装情况调查表.xlsx
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

优化MATLAB分段函数绘制:提升效率,绘制更快速

![优化MATLAB分段函数绘制:提升效率,绘制更快速](https://ucc.alicdn.com/pic/developer-ecology/666d2a4198c6409c9694db36397539c1.png?x-oss-process=image/resize,s_500,m_lfit) # 1. MATLAB分段函数绘制概述** 分段函数绘制是一种常用的技术,用于可视化不同区间内具有不同数学表达式的函数。在MATLAB中,分段函数可以通过使用if-else语句或switch-case语句来实现。 **绘制过程** MATLAB分段函数绘制的过程通常包括以下步骤: 1.
recommend-type

SDN如何实现简易防火墙

SDN可以通过控制器来实现简易防火墙。具体步骤如下: 1. 定义防火墙规则:在控制器上定义防火墙规则,例如禁止某些IP地址或端口访问,或者只允许来自特定IP地址或端口的流量通过。 2. 获取流量信息:SDN交换机会将流量信息发送给控制器。控制器可以根据防火墙规则对流量进行过滤。 3. 过滤流量:控制器根据防火墙规则对流量进行过滤,满足规则的流量可以通过,不满足规则的流量则被阻止。 4. 配置交换机:控制器根据防火墙规则配置交换机,只允许通过满足规则的流量,不满足规则的流量则被阻止。 需要注意的是,这种简易防火墙并不能完全保护网络安全,只能起到一定的防护作用,对于更严格的安全要求,需要
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。