INTCO-MES
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<url>http://www.ruoyi.</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<parent>
|
||||
@ -63,26 +63,26 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- spring security 安全认证 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- redis 缓存操作 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- pool 对象池 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@ -96,13 +96,24 @@
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
<groupId>net.sourceforge.jtds</groupId>
|
||||
<artifactId>jtds</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<!-- SpringBoot集成mybatis框架 -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>${mybatis.spring.boot.starter.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
@ -129,14 +140,14 @@
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--文件上传工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>${commons.fileupload.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 解析客户端操作系统、浏览器等 -->
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
@ -156,14 +167,14 @@
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--Token生成与解析-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>${jwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- swagger2-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
@ -180,44 +191,44 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- swagger2-UI-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna-platform</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
@ -231,7 +242,7 @@
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 定时任务 -->
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
@ -284,4 +295,4 @@
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
139
ruoyi/src/main/java/com/ruoyi/db/mssql/DB_48102_Test.java
Normal file
139
ruoyi/src/main/java/com/ruoyi/db/mssql/DB_48102_Test.java
Normal file
@ -0,0 +1,139 @@
|
||||
package com.ruoyi.db.mssql;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DB_48102_Test {
|
||||
|
||||
private static final String IP = "192.168.48.102";
|
||||
private static final String DBName = "ERPDATA";
|
||||
private static final String USER = "sa";
|
||||
private static final String PWD = "park$1299";
|
||||
|
||||
/** 创建数据库对象 */
|
||||
private static Connection getSQLConnection() {
|
||||
Connection con = null;
|
||||
try {
|
||||
Class.forName("net.sourceforge.jtds.jdbc.Driver");
|
||||
// 加上 useunicode=true;characterEncoding=UTF-8 防止中文乱码
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:jtds:sqlserver://" + IP + ":1433/" + DBName + ";useunicode=true;characterEncoding=UTF-8",
|
||||
USER, PWD);
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("==连接数据库失败===");
|
||||
}
|
||||
// System.out.println("==连接数据库成功===");
|
||||
return con;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetChangeMouldTimeList() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tLine,\n" +
|
||||
"\tLEFT ( MouldingStyleCode, charindex( '-', MouldingStyleCode ) - 1 ) as Mould,MouldingStyleCode,\n" +
|
||||
"\tStartTime,\n" +
|
||||
"\tEndTime ,\n" +
|
||||
"\tDATEDIFF( minute,starttime, endtime) as ChangeMouldTime\n" +
|
||||
"FROM\n" +
|
||||
"\t[dbo].[MouldingDisplayBoard] \n" +
|
||||
"WHERE\n" +
|
||||
"\tChangeMould = 1 and \tDATEDIFF( minute,starttime, endtime) > 20\n" +
|
||||
"\torder by starttime desc \n";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("Line",rs.getString("Line"));
|
||||
map.put("Mould",rs.getString("Mould"));
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("StartTime",rs.getString("StartTime"));
|
||||
map.put("EndTime",rs.getString("EndTime"));
|
||||
map.put("ChangeMouldTime",rs.getString("ChangeMouldTime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGet_avg_changemouldtime_date_range(String fstarttime, String fendtime) {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT AVG\r\n" +
|
||||
" (\r\n" +
|
||||
" DATEDIFF( MINUTE, StartTime, EndTime )) AS avgchangemouldtime \r\n" +
|
||||
"FROM\r\n" +
|
||||
" dbo.MouldingDisplayBoard \r\n" +
|
||||
"WHERE\r\n" +
|
||||
"\tChangeMould = 1 and \tDATEDIFF( minute,starttime, endtime) > 20\n" +
|
||||
" AND Deleted = 0 \r\n" +
|
||||
" AND StartTime > '" + fstarttime + "' \r\n" +
|
||||
" AND endtime < '" + fendtime + "'";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("avgchangemouldtime",rs.getString("avgchangemouldtime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String JsonTest() {
|
||||
StringBuilder jsonpath = new StringBuilder();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * from [chen_12个月_A版本BOM销售额] FOR JSON PATH";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
jsonpath.append(rs.getString(1));
|
||||
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return jsonpath.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,298 @@
|
||||
package com.ruoyi.db.mssql;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DB_Ajax_DashBoard_48102 {
|
||||
|
||||
private static final String IP = "192.168.48.102";
|
||||
private static final String DBName = "ERPDATA";
|
||||
private static final String USER = "sa";
|
||||
private static final String PWD = "park$1299";
|
||||
|
||||
/** 创建数据库对象 */
|
||||
private static Connection getSQLConnection() {
|
||||
Connection con = null;
|
||||
try {
|
||||
Class.forName("net.sourceforge.jtds.jdbc.Driver");
|
||||
// 加上 useunicode=true;characterEncoding=UTF-8 防止中文乱码
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:jtds:sqlserver://" + IP + ":1433/" + DBName + ";useunicode=true;characterEncoding=UTF-8",
|
||||
USER, PWD);
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("==连接数据库失败===");
|
||||
}
|
||||
// System.out.println("==连接数据库成功===");
|
||||
return con;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetCurrentTimeGroup() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * FROM [dbo].[V_chen_Dashboard_当前] order by line";
|
||||
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("line",rs.getString("line"));
|
||||
map.put("Moulds",rs.getString("Moulds"));
|
||||
map.put("Person",rs.getString("Person"));
|
||||
map.put("NormalCapacity",rs.getString("NormalCapacity"));
|
||||
map.put("currentspeed",rs.getString("currentspeed"));
|
||||
map.put("FinishedQuantity",rs.getString("FinishedQuantity"));
|
||||
map.put("GroupTime",rs.getString("GroupTime"));
|
||||
map.put("GroupChangeMouldTime",rs.getString("GroupChangeMouldTime"));
|
||||
map.put("CurrentYield",rs.getString("CurrentYield"));
|
||||
map.put("CapacityStandardObtainedRate",rs.getString("CapacityStandardObtainedRate"));
|
||||
map.put("AvgDensity",rs.getString("AvgDensity"));
|
||||
map.put("MouldAndChangeMouldTime",rs.getString("MouldAndChangeMouldTime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
public static List<HashMap<String,String>> DoGetLastDay() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * FROM V_chen_Dashboard_当天";
|
||||
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
|
||||
|
||||
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("line",rs.getString("line"));
|
||||
map.put("Moulds",rs.getString("Moulds"));
|
||||
map.put("sumbox",rs.getString("sumbox"));
|
||||
map.put("sum_box_meter",rs.getString("sum_box_meter"));
|
||||
map.put("sum_device_meter",rs.getString("sum_device_meter"));
|
||||
map.put("avg_density",rs.getString("avg_density"));
|
||||
map.put("avg_currentcapacity",rs.getString("avg_currentcapacity"));
|
||||
map.put("avg_normalcapacity",rs.getString("avg_normalcapacity"));
|
||||
map.put("lastchangemouldtime",rs.getString("lastchangemouldtime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
public static List<HashMap<String,String>> DoGet30Day() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * FROM V_chen_Dashboard_当月";
|
||||
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
|
||||
|
||||
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("line",rs.getString("line"));
|
||||
map.put("Moulds",rs.getString("Moulds"));
|
||||
map.put("sumbox",rs.getString("sumbox"));
|
||||
map.put("sum_box_meter",rs.getString("sum_box_meter"));
|
||||
map.put("sum_device_meter",rs.getString("sum_device_meter"));
|
||||
map.put("avg_density",rs.getString("avg_density"));
|
||||
map.put("avg_currentcapacity",rs.getString("avg_currentcapacity"));
|
||||
map.put("avg_normalcapacity",rs.getString("avg_normalcapacity"));
|
||||
map.put("lastchangemouldtime",rs.getString("lastchangemouldtime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetDateRange(String fstarttime, String fendtime) {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "DECLARE @FStartTime DATETIME\r\n" +
|
||||
"DECLARE @FEndTime DATETIME\r\n" +
|
||||
"\r\n" +
|
||||
"set @FStartTime='" + fstarttime + "'\r\n" +
|
||||
"set @FEndTime='" + fendtime + "'\r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
"SELECT\r\n" +
|
||||
" db1.line,\r\n" +
|
||||
" AVG ( avg_density ) AS avg_density,\r\n" +
|
||||
" SUM ( sumbox ) AS sumbox,\r\n" +
|
||||
" MAX ( db2.sum1 ) AS sum_box_meter,\r\n" +
|
||||
" MAX ( db2.sum0 ) AS sum_device_meter,\r\n" +
|
||||
" dbo.chen_cal_line_time_mould ( MIN ( db1.StartTime ), MAX ( db1.EndTime ), db1.Line ) AS Moulds,\r\n" +
|
||||
" SUM ( currentcap * ( boxmeter / db2.sum1 )) AS avg_currentcapacity,\r\n" +
|
||||
" SUM ( db1.NormalCapacity* ( boxmeter / db2.sum1 )) AS avg_normalcapacity,\r\n" +
|
||||
" SUM ( boxmeter / db2.sum1 ) AS 校验字段 ,\r\n" +
|
||||
" avg(db4.ChangeMouldTime) as lastchangemouldtime\r\n" +
|
||||
"FROM \r\n" +
|
||||
" (SELECT\r\n" +
|
||||
" dbo.chen_cal_line_difftime( db3.StartTime, db3.EndTime, db3.line, db3.EndTime) as difftime,\r\n" +
|
||||
" db3.Quantity as Quantity,\r\n" +
|
||||
" db3.StartTime as StartTime,\r\n" +
|
||||
" db3.EndTime as EndTime,\r\n" +
|
||||
" db3.line as line,\r\n" +
|
||||
" db3.Length as Length ,\r\n" +
|
||||
" db3.NumberOfEveryKit as NumberOfEveryKit,\r\n" +
|
||||
" db3.MouldingStyleCode as MouldingStyleCode,\r\n" +
|
||||
" db3.SoCode as SoCode,\r\n" +
|
||||
" dbo.chen_cal_line_time_mould ( db3.StartTime, db3.EndTime, Line ) AS Moulds,\r\n" +
|
||||
" dbo.chen_cal_line_time_density ( db3.StartTime, db3.EndTime, Line ) AS avg_density,\r\n" +
|
||||
" \r\n" +
|
||||
" dbo.chen_cal_line_meter ( db3.StartTime, db3.EndTime, Line, @FEndTime ) / dbo.chen_cal_line_difftime( db3.StartTime, db3.EndTime, db3.line, db3.EndTime) * 60 * 60 * 12 AS currentcap,\r\n" +
|
||||
" NormalCapacity,\r\n" +
|
||||
" db3.sumbox AS sumbox,\r\n" +
|
||||
" dbo.chen_cal_line_meter ( db3.StartTime, db3.EndTime, Line, @FEndTime ) AS meter,\r\n" +
|
||||
" (db3.Length * db3.NumberOfEveryKit * db3.sumbox) AS boxmeter\r\n" +
|
||||
" \r\n" +
|
||||
"FROM\r\n" +
|
||||
" (\r\n" +
|
||||
" SELECT\r\n" +
|
||||
" db2.id,\r\n" +
|
||||
" db2.line,\r\n" +
|
||||
" SUM ( db1.Quantity ) AS sumbox,\r\n" +
|
||||
" MIN ( db1.OperateTime ) AS minop,\r\n" +
|
||||
" MAX ( db1.OperateTime ) AS maxop,\r\n" +
|
||||
" MAX (db2.Quantity) as Quantity, \r\n" +
|
||||
" MAX (db2.Length) as Length,\r\n" +
|
||||
" MAX (db2.NumberOfEveryKit) as NumberOfEveryKit,\r\n" +
|
||||
" MAX (db2.MouldingStyleCode) as MouldingStyleCode,\r\n" +
|
||||
" MAX (db2.SoCode) as SoCode, MAX (db2.NormalCapacity) as NormalCapacity,\r\n" +
|
||||
" ( CASE WHEN MIN ( db2.StartTime ) < @FStartTime THEN @FStartTime ELSE MIN ( db2.StartTime ) END ) AS StartTime,\r\n" +
|
||||
" ( CASE WHEN MIN ( db2.EndTime ) IS NULL THEN (dbo.chen_cal_line_op_lasttime(MIN ( db2.EndTime ),db2.line,@FEndTime)) ELSE ( CASE WHEN MIN ( db2.EndTime ) > @FEndTime THEN @FEndTime ELSE MIN ( db2.EndTime ) END ) END ) AS EndTime FROM\r\n" +
|
||||
" [dbo].[MouldingDisplayBoardOperation] AS db1\r\n" +
|
||||
" INNER JOIN MouldingDisplayBoard AS db2 ON db2.id = db1.DisplayBoardId \r\n" +
|
||||
" WHERE\r\n" +
|
||||
" db1.OperateTime >= @FStartTime \r\n" +
|
||||
" AND db1.OperateTime <= @FEndTime \r\n" +
|
||||
" GROUP BY\r\n" +
|
||||
" db2.id,\r\n" +
|
||||
" db2.line \r\n" +
|
||||
" ) AS db3) AS db1\r\n" +
|
||||
" INNER JOIN ( SELECT line, SUM ( meter ) AS sum0, SUM ( boxmeter ) AS sum1 FROM (SELECT\r\n" +
|
||||
" dbo.chen_cal_line_difftime( db3.StartTime, db3.EndTime, db3.line, db3.EndTime) as difftime,\r\n" +
|
||||
" db3.Quantity as Quantity,\r\n" +
|
||||
" db3.StartTime as StartTime,\r\n" +
|
||||
" db3.EndTime as EndTime,\r\n" +
|
||||
" db3.line as line,\r\n" +
|
||||
" db3.Length as Length ,\r\n" +
|
||||
" db3.NumberOfEveryKit as NumberOfEveryKit,\r\n" +
|
||||
" db3.MouldingStyleCode as MouldingStyleCode,\r\n" +
|
||||
" db3.SoCode as SoCode,\r\n" +
|
||||
" dbo.chen_cal_line_time_mould ( db3.StartTime, db3.EndTime, Line ) AS Moulds,\r\n" +
|
||||
" dbo.chen_cal_line_time_density ( db3.StartTime, db3.EndTime, Line ) AS avg_density,\r\n" +
|
||||
" \r\n" +
|
||||
" dbo.chen_cal_line_meter ( db3.StartTime, db3.EndTime, Line, @FEndTime ) / dbo.chen_cal_line_difftime( db3.StartTime, db3.EndTime, db3.line, db3.EndTime) * 60 * 60 * 12 AS currentcap,\r\n" +
|
||||
" NormalCapacity,\r\n" +
|
||||
" db3.sumbox AS sumbox,\r\n" +
|
||||
" dbo.chen_cal_line_meter ( db3.StartTime, db3.EndTime, Line, @FEndTime ) AS meter,\r\n" +
|
||||
" (db3.Length * db3.NumberOfEveryKit * db3.sumbox) AS boxmeter\r\n" +
|
||||
" \r\n" +
|
||||
"FROM\r\n" +
|
||||
" (\r\n" +
|
||||
" SELECT\r\n" +
|
||||
" db2.id,\r\n" +
|
||||
" db2.line,\r\n" +
|
||||
" SUM ( db1.Quantity ) AS sumbox,\r\n" +
|
||||
" MIN ( db1.OperateTime ) AS minop,\r\n" +
|
||||
" MAX ( db1.OperateTime ) AS maxop,\r\n" +
|
||||
" MAX (db2.Quantity) as Quantity, \r\n" +
|
||||
" MAX (db2.Length) as Length,\r\n" +
|
||||
" MAX (db2.NumberOfEveryKit) as NumberOfEveryKit,\r\n" +
|
||||
" MAX (db2.MouldingStyleCode) as MouldingStyleCode,\r\n" +
|
||||
" MAX (db2.SoCode) as SoCode, MAX (db2.NormalCapacity) as NormalCapacity,\r\n" +
|
||||
" ( CASE WHEN MIN ( db2.StartTime ) < @FStartTime THEN @FStartTime ELSE MIN ( db2.StartTime ) END ) AS StartTime,\r\n" +
|
||||
" ( CASE WHEN MIN ( db2.EndTime ) IS NULL THEN (dbo.chen_cal_line_op_lasttime(MIN ( db2.EndTime ),db2.line,@FEndTime)) ELSE ( CASE WHEN MIN ( db2.EndTime ) > @FEndTime THEN @FEndTime ELSE MIN ( db2.EndTime ) END ) END ) AS EndTime FROM\r\n" +
|
||||
" [dbo].[MouldingDisplayBoardOperation] AS db1\r\n" +
|
||||
" INNER JOIN MouldingDisplayBoard AS db2 ON db2.id = db1.DisplayBoardId \r\n" +
|
||||
" WHERE\r\n" +
|
||||
" db1.OperateTime >= @FStartTime \r\n" +
|
||||
" AND db1.OperateTime <= @FEndTime \r\n" +
|
||||
" GROUP BY\r\n" +
|
||||
" db2.id,\r\n" +
|
||||
" db2.line \r\n" +
|
||||
" ) AS db3) AS db3 GROUP BY line ) AS db2 ON db2.line = db1.line\r\n" +
|
||||
" LEFT JOIN (SELECT Line,id,DATEDIFF(MINUTE,StartTime,EndTime) as ChangeMouldTime FROM MouldingDisplayBoard WHERE id IN (SELECT MAX (id) AS id FROM MouldingDisplayBoard WHERE ChangeMould=1 GROUP BY Line)) as db4 on db4.line = db1.line\r\n" +
|
||||
"\r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" db1.line";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
|
||||
|
||||
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("line",rs.getString("line"));
|
||||
map.put("Moulds",rs.getString("Moulds"));
|
||||
map.put("sumbox",rs.getString("sumbox"));
|
||||
map.put("sum_box_meter",rs.getString("sum_box_meter"));
|
||||
map.put("sum_device_meter",rs.getString("sum_device_meter"));
|
||||
map.put("avg_density",rs.getString("avg_density"));
|
||||
map.put("avg_currentcapacity",rs.getString("avg_currentcapacity"));
|
||||
map.put("avg_normalcapacity",rs.getString("avg_normalcapacity"));
|
||||
map.put("lastchangemouldtime",rs.getString("lastchangemouldtime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.ruoyi.db.mssql;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DB_Ajax_DashBoard_ChangeMouldTime_48102 {
|
||||
|
||||
private static final String IP = "192.168.48.102";
|
||||
private static final String DBName = "ERPDATA";
|
||||
private static final String USER = "sa";
|
||||
private static final String PWD = "park$1299";
|
||||
|
||||
/** 创建数据库对象 */
|
||||
private static Connection getSQLConnection() {
|
||||
Connection con = null;
|
||||
try {
|
||||
Class.forName("net.sourceforge.jtds.jdbc.Driver");
|
||||
// 加上 useunicode=true;characterEncoding=UTF-8 防止中文乱码
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:jtds:sqlserver://" + IP + ":1433/" + DBName + ";useunicode=true;characterEncoding=UTF-8",
|
||||
USER, PWD);
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("==连接数据库失败===");
|
||||
}
|
||||
// System.out.println("==连接数据库成功===");
|
||||
return con;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetChangeMouldTimeList() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tLine,\n" +
|
||||
"\tLEFT ( MouldingStyleCode, charindex( '-', MouldingStyleCode ) - 1 ) as Mould,MouldingStyleCode,\n" +
|
||||
"\tStartTime,\n" +
|
||||
"\tEndTime ,\n" +
|
||||
"\tDATEDIFF( minute,starttime, endtime) as ChangeMouldTime\n" +
|
||||
"FROM\n" +
|
||||
"\t[dbo].[MouldingDisplayBoard] \n" +
|
||||
"WHERE\n" +
|
||||
"\tChangeMould = 1 and \tDATEDIFF( minute,starttime, endtime) > 20\n" +
|
||||
"\torder by starttime desc \n";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("Line",rs.getString("Line"));
|
||||
map.put("Mould",rs.getString("Mould"));
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("StartTime",rs.getString("StartTime"));
|
||||
map.put("EndTime",rs.getString("EndTime"));
|
||||
map.put("ChangeMouldTime",rs.getString("ChangeMouldTime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGet_avg_changemouldtime_date_range(String fstarttime, String fendtime) {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT AVG\r\n" +
|
||||
" (\r\n" +
|
||||
" DATEDIFF( MINUTE, StartTime, EndTime )) AS avgchangemouldtime \r\n" +
|
||||
"FROM\r\n" +
|
||||
" dbo.MouldingDisplayBoard \r\n" +
|
||||
"WHERE\r\n" +
|
||||
"\tChangeMould = 1 and \tDATEDIFF( minute,starttime, endtime) > 20\n" +
|
||||
" AND Deleted = 0 \r\n" +
|
||||
" AND StartTime > '" + fstarttime + "' \r\n" +
|
||||
" AND endtime < '" + fendtime + "'";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("avgchangemouldtime",rs.getString("avgchangemouldtime"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetGroupDensityListMap() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" line AS line,\r\n" +
|
||||
" AVG ( Density ) AS density \r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > dbo.GetWorkShiftStartDate ( GETDATE( ) ) \r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" line \r\n" +
|
||||
"ORDER BY\r\n" +
|
||||
" convert(int,REPLACE( line, '#', '' ) )";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("density",rs.getString("density"));
|
||||
map.put("time",rs.getString("line"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
}
|
@ -0,0 +1,245 @@
|
||||
package com.ruoyi.db.mssql;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DB_Ajax_DashBoard_Density_48102 {
|
||||
|
||||
private static final String IP = "192.168.48.102";
|
||||
private static final String DBName = "ERPDATA";
|
||||
private static final String USER = "sa";
|
||||
private static final String PWD = "park$1299";
|
||||
|
||||
/** 创建数据库对象 */
|
||||
private static Connection getSQLConnection() {
|
||||
Connection con = null;
|
||||
try {
|
||||
Class.forName("net.sourceforge.jtds.jdbc.Driver");
|
||||
// 加上 useunicode=true;characterEncoding=UTF-8 防止中文乱码
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:jtds:sqlserver://" + IP + ":1433/" + DBName + ";useunicode=true;characterEncoding=UTF-8",
|
||||
USER, PWD);
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("==连接数据库失败===");
|
||||
}
|
||||
// System.out.println("==连接数据库成功===");
|
||||
return con;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
public static List<String> DoGet72hdensity() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" ProductDate+TIME as time,\r\n" +
|
||||
" AVG ( Density ) as density\r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > GETDATE( ) - 3\r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" ProductDate,\r\n" +
|
||||
"TIME ORDER BY MAX(CreatedOn)";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
list.add("{time:\"" + rs.getString("time") + "\",density:\"" + rs.getString("density")
|
||||
+ "\"}");
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public static List<String> DoGetgroupdensity() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" line AS line,\r\n" +
|
||||
" AVG ( Density ) AS density \r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > dbo.GetWorkShiftStartDate ( GETDATE( ) ) \r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" line \r\n" +
|
||||
"ORDER BY\r\n" +
|
||||
" convert(int,REPLACE( line, '#', '' ) )";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
list.add("{line:\"" + rs.getString("line") + "\",density:\"" + rs.getString("density")
|
||||
+ "\"}");
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public static List<String> DoGet30ddensity() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" ProductDate as time,\r\n" +
|
||||
" AVG ( Density ) as density\r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > GETDATE( ) - 30\r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" ProductDate ORDER BY MAX(CreatedOn)";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
list.add("{time:\"" + rs.getString("time") + "\",density:\"" + rs.getString("density")
|
||||
+ "\"}");
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGet30dDensityListMap() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" ProductDate as time,\r\n" +
|
||||
" AVG ( Density ) as density\r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > GETDATE( ) - 30\r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" ProductDate ORDER BY MAX(CreatedOn)";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("density",rs.getString("density"));
|
||||
map.put("time",rs.getString("time"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGet72hDensityListMap() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" ProductDate+TIME as time,\r\n" +
|
||||
" AVG ( Density ) as density\r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > GETDATE( ) - 3\r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" ProductDate,\r\n" +
|
||||
"TIME ORDER BY MAX(CreatedOn)";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("density",rs.getString("density"));
|
||||
map.put("time",rs.getString("time"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetGroupDensityListMap() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\r\n" +
|
||||
" line AS line,\r\n" +
|
||||
" AVG ( Density ) AS density \r\n" +
|
||||
"FROM\r\n" +
|
||||
" [dbo].[MouldingRealTimeDensity] \r\n" +
|
||||
"WHERE\r\n" +
|
||||
" CreatedOn > dbo.GetWorkShiftStartDate ( GETDATE( ) ) \r\n" +
|
||||
"GROUP BY\r\n" +
|
||||
" line \r\n" +
|
||||
"ORDER BY\r\n" +
|
||||
" convert(int,REPLACE( line, '#', '' ) )";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("density",rs.getString("density"));
|
||||
map.put("time",rs.getString("line"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
}
|
@ -0,0 +1,452 @@
|
||||
package com.ruoyi.db.mssql;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class DB_Ajax_DashBoard_Technologist_48102 {
|
||||
|
||||
private static final String IP = "192.168.48.102";
|
||||
private static final String DBName = "ERPDATA";
|
||||
private static final String USER = "sa";
|
||||
private static final String PWD = "park$1299";
|
||||
|
||||
/** 创建数据库对象 */
|
||||
private static Connection getSQLConnection() {
|
||||
Connection con = null;
|
||||
try {
|
||||
Class.forName("net.sourceforge.jtds.jdbc.Driver");
|
||||
// 加上 useunicode=true;characterEncoding=UTF-8 防止中文乱码
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:jtds:sqlserver://" + IP + ":1433/" + DBName + ";useunicode=true;characterEncoding=UTF-8",
|
||||
USER, PWD);
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("==连接数据库失败===");
|
||||
}
|
||||
// System.out.println("==连接数据库成功===");
|
||||
return con;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetSampleConfirmation() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\t内外销,\n" +
|
||||
"\tSUM ( CASE WHEN 客户是否下单 = '是' THEN 1 ELSE 0 END ) AS 下单数,\n" +
|
||||
"\tCOUNT (内外销) AS 打样数 \n" +
|
||||
"FROM\n" +
|
||||
"\t[dbo].[chen_打样分析汇总] \n" +
|
||||
"GROUP BY\n" +
|
||||
"\t内外销;";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("NWX",rs.getString("内外销"));
|
||||
map.put("ConfirmationNum",rs.getString("下单数"));
|
||||
map.put("SampleNum",rs.getString("打样数"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
public static List<HashMap<String,String>> DoGetBestOEM() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT TOP\n" +
|
||||
"\t20 MouldingStyleCode,\n" +
|
||||
"\t[折算人民币价税合计] AS CNY \n" +
|
||||
"FROM\n" +
|
||||
"\t[chen_12个月_A版本BOM销售额] \n" +
|
||||
"WHERE\n" +
|
||||
"\ttagname = 'OEM' \n" +
|
||||
"ORDER BY\n" +
|
||||
"\t折算人民币价税合计 DESC";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("CNY",rs.getString("CNY"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
public static List<HashMap<String,String>> DoGetBestODM() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT TOP\n" +
|
||||
"\t20 MouldingStyleCode,\n" +
|
||||
"\t[折算人民币价税合计] AS CNY \n" +
|
||||
"FROM\n" +
|
||||
"\t[chen_12个月_A版本BOM销售额] \n" +
|
||||
"WHERE\n" +
|
||||
"\ttagname = 'ODM' \n" +
|
||||
"ORDER BY\n" +
|
||||
"\t折算人民币价税合计 DESC";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("CNY",rs.getString("CNY"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已完成订单交期
|
||||
* 根据工艺员共计数量
|
||||
*/
|
||||
public static List<HashMap<String,String>> DoFinishedSampleAvgDay() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tTechnologist,\n" +
|
||||
"\tCOUNT(id) as num,\n" +
|
||||
"\tAVG (\n" +
|
||||
"\tCAST ( [分解天数] AS FLOAT )) AS avg_f,\n" +
|
||||
"\tAVG ( CAST ( [交期天数] AS FLOAT ) ) AS avg_j \n" +
|
||||
"FROM\n" +
|
||||
"\t[dbo].[chen_打样分析汇总] \n" +
|
||||
"WHERE\n" +
|
||||
"\tStatus = 3 \n" +
|
||||
"GROUP BY\n" +
|
||||
"\tTechnologist";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("Technologist",rs.getString("Technologist"));
|
||||
map.put("avg_f",rs.getString("avg_f"));
|
||||
map.put("num",rs.getString("num"));
|
||||
map.put("avg_j",rs.getString("avg_j"));
|
||||
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 未完成打样交期
|
||||
* 根据工艺员共计数量
|
||||
*/
|
||||
public static List<HashMap<String,String>> DoUnFinishedSampleAvgDay() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tTechnologist,\n" +
|
||||
"\tCOUNT ( id ) AS num,\n" +
|
||||
"\tSUM ( CASE WHEN use_date >= 15 THEN 1 ELSE 0 END ) as day15num,\n" +
|
||||
"\tAVG(use_date) as avg_use_date\n" +
|
||||
"\tFROM\n" +
|
||||
"\t\t( SELECT Technologist, id, DATEDIFF( DAY, [经理审核时间], GETDATE()) AS use_date FROM [dbo].[chen_打样分析汇总] WHERE ( Status = 2 OR Status = 1 ) AND [经理审核时间] IS NOT NULL ) AS db0 \n" +
|
||||
"GROUP BY\n" +
|
||||
"\tTechnologist";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("Technologist",rs.getString("Technologist"));
|
||||
map.put("day15num",rs.getString("day15num"));
|
||||
map.put("num",rs.getString("num"));
|
||||
map.put("avg_use_date",rs.getString("avg_use_date"));
|
||||
|
||||
|
||||
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
*/
|
||||
public static List<HashMap<String,String>> DayFinishedSampleOrder() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"dbo.[chen_打样分析汇总].Technologist,\n" +
|
||||
"dbo.[chen_打样分析汇总].SalesMan,\n" +
|
||||
"dbo.[chen_打样分析汇总].MouldingStyleCode,\n" +
|
||||
"dbo.[chen_打样分析汇总].[折算人民币价税合计] as CNY\n" +
|
||||
"\n" +
|
||||
"FROM\n" +
|
||||
"dbo.[chen_打样分析汇总]\n" +
|
||||
"WHERE\n" +
|
||||
"dbo.[chen_打样分析汇总].CreatedOn >= dbo.GetWorkShiftStartDate ( GETDATE( ) - 1 ) AND\n" +
|
||||
"dbo.[chen_打样分析汇总].CreatedOn <= dbo.GetWorkShiftStartDate ( GETDATE( ) )\n";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("Technologist",rs.getString("Technologist"));
|
||||
map.put("SalesMan",rs.getString("SalesMan"));
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("CNY",rs.getString("CNY"));
|
||||
|
||||
|
||||
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新开模
|
||||
*
|
||||
*/
|
||||
public static List<HashMap<String,String>> DayNewMould() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"dbo.MouldManufacture.MouldCode,\n" +
|
||||
"CASE dbo.MouldManufacture.ManufactureType\n" +
|
||||
"\tWHEN 1 THEN N'新开模'\n" +
|
||||
"\tELSE N'修模'\n" +
|
||||
"END as new_or_fix\n" +
|
||||
",\n" +
|
||||
"BD_User.UserName\n" +
|
||||
"FROM\n" +
|
||||
"dbo.MouldManufacture\n" +
|
||||
"INNER JOIN BD_User on dbo.MouldManufacture.CreatedBy = BD_User.UserId\n" +
|
||||
"WHERE\n" +
|
||||
"dbo.MouldManufacture.CreatedOn >= dbo.GetWorkShiftStartDate ( GETDATE( ) - 1 ) AND\n" +
|
||||
"dbo.MouldManufacture.CreatedOn <= dbo.GetWorkShiftStartDate ( GETDATE( ) ) AND\n" +
|
||||
"dbo.MouldManufacture.Status <> -1\n";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("UserName",rs.getString("UserName"));
|
||||
map.put("new_or_fix",rs.getString("new_or_fix"));
|
||||
map.put("MouldCode",rs.getString("MouldCode"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打样完成
|
||||
*
|
||||
*/
|
||||
public static List<HashMap<String,String>> DayFinishedSample() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tdbo.[chen_打样分析汇总].MouldingStyleCode,\n" +
|
||||
"\tdbo.[chen_打样分析汇总].Technologist,\n" +
|
||||
"\tdbo.[chen_打样分析汇总].FinishedDensity,\n" +
|
||||
"\tdbo.[chen_打样分析汇总].FinishedSpeed,\n" +
|
||||
"\tdbo.[chen_打样分析汇总].FinishedBy,\n" +
|
||||
"\tdbo.[chen_打样分析汇总].[交期天数] as UseDay\n" +
|
||||
"FROM\n" +
|
||||
"\tdbo.[chen_打样分析汇总] \n" +
|
||||
"WHERE\n" +
|
||||
"\tdbo.[chen_打样分析汇总].FinishedOn >= dbo.GetWorkShiftStartDate ( GETDATE( ) - 1 ) \n" +
|
||||
"\tAND dbo.[chen_打样分析汇总].FinishedOn <= dbo.GetWorkShiftStartDate ( GETDATE( ) )";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("Technologist",rs.getString("Technologist"));
|
||||
map.put("FinishedDensity",rs.getString("FinishedDensity"));
|
||||
map.put("FinishedSpeed",rs.getString("FinishedSpeed"));
|
||||
map.put("FinishedBy",rs.getString("FinishedBy"));
|
||||
map.put("UseDay",rs.getString("UseDay"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM完成
|
||||
*
|
||||
*/
|
||||
public static List<HashMap<String,String>> DayFinishedBOM() {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"dbo.MouldingTechnicalForm.MouldingStyleCode,\n" +
|
||||
"dbo.MouldingTechnicalForm.Maker\n" +
|
||||
"\n" +
|
||||
"FROM\n" +
|
||||
"dbo.MouldingTechnicalForm\n" +
|
||||
"WHERE\n" +
|
||||
"dbo.MouldingTechnicalForm.ModifiedOn >= dbo.GetWorkShiftStartDate ( GETDATE( ) - 1 ) AND\n" +
|
||||
"dbo.MouldingTechnicalForm.ModifiedOn <= dbo.GetWorkShiftStartDate ( GETDATE( ) )";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("MouldingStyleCode",rs.getString("MouldingStyleCode"));
|
||||
map.put("Maker",rs.getString("Maker"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
public static String All() {
|
||||
StringBuilder jsonpath = new StringBuilder();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * from [chen_打样分析汇总] order by CreatedOn desc FOR JSON PATH";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
jsonpath.append(rs.getString(1));
|
||||
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return jsonpath.toString();
|
||||
}
|
||||
|
||||
|
||||
public static String AllDataDataRange(String fDateStart,String fDateEnd) {
|
||||
StringBuilder jsonpath = new StringBuilder();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT * from [chen_打样分析汇总] where CreatedOn >= '"+fDateStart+"' and CreatedOn <= '"+fDateEnd+"' order by CreatedOn desc FOR JSON PATH";
|
||||
Statement stmt = conn.createStatement();//
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
jsonpath.append(rs.getString(1));
|
||||
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return jsonpath.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
Application Version: ${ruoyi.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
// o8888888o //
|
||||
// 88" . "88 //
|
||||
// (| ^_^ |) //
|
||||
// O\ = /O //
|
||||
// ____/`---'\____ //
|
||||
// .' \\| |// `. //
|
||||
// / \\||| : |||// \ //
|
||||
// / _||||| -:- |||||- \ //
|
||||
// | | \\\ - /// | | //
|
||||
// | \_| ''\---/'' | | //
|
||||
// \ .-\__ `-` ___/-. / //
|
||||
// ___`. .' /--.--\ `. . ___ //
|
||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
||||
// `=---=' //
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||
// 佛祖保佑 永不宕机 永无BUG //
|
||||
////////////////////////////////////////////////////////////////////
|
@ -0,0 +1,35 @@
|
||||
package com.ruoyi.project.fx_changemouldtime.controller;
|
||||
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_ChangeMouldTime_48102;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fx_changemouldtime")
|
||||
public class ChangeMouldTimeController extends BaseController
|
||||
{
|
||||
// @PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult get30Day() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_ChangeMouldTime_48102.DoGetChangeMouldTimeList());
|
||||
}
|
||||
|
||||
@GetMapping("/rangetimeavg/{fDateStart}/{fDateEnd}")
|
||||
public AjaxResult getRangeTimeAvg(@PathVariable String fDateStart, @PathVariable String fDateEnd) throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_ChangeMouldTime_48102.DoGet_avg_changemouldtime_date_range(fDateStart,fDateEnd));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
Application Version: ${ruoyi.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
// o8888888o //
|
||||
// 88" . "88 //
|
||||
// (| ^_^ |) //
|
||||
// O\ = /O //
|
||||
// ____/`---'\____ //
|
||||
// .' \\| |// `. //
|
||||
// / \\||| : |||// \ //
|
||||
// / _||||| -:- |||||- \ //
|
||||
// | | \\\ - /// | | //
|
||||
// | \_| ''\---/'' | | //
|
||||
// \ .-\__ `-` ___/-. / //
|
||||
// ___`. .' /--.--\ `. . ___ //
|
||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
||||
// `=---=' //
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||
// 佛祖保佑 永不宕机 永无BUG //
|
||||
////////////////////////////////////////////////////////////////////
|
@ -0,0 +1,47 @@
|
||||
package com.ruoyi.project.fx_dashboard.controller;
|
||||
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_48102;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fx_dashboard")
|
||||
public class DashBoardController extends BaseController
|
||||
{
|
||||
// @PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping("/30day")
|
||||
public AjaxResult get30Day() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_48102.DoGet30Day());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/lastday")
|
||||
public AjaxResult getLastDay() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_48102.DoGetLastDay());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/group")
|
||||
public AjaxResult getGroup() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_48102.DoGetCurrentTimeGroup());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/daterange/{fDateStart}/{fDateEnd}")
|
||||
public AjaxResult getDateRange(@PathVariable String fDateStart, @PathVariable String fDateEnd) throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_48102.DoGetDateRange(fDateStart,fDateEnd));
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.ruoyi.project.fx_density.controller;
|
||||
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_Density_48102;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fx_density")
|
||||
public class DensityController extends BaseController
|
||||
{
|
||||
// @PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping("/30day")
|
||||
public AjaxResult get30Day() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Density_48102.DoGet30dDensityListMap());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/72h")
|
||||
public AjaxResult get72h() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Density_48102.DoGet72hDensityListMap());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/group")
|
||||
public AjaxResult getGroup() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Density_48102.DoGetGroupDensityListMap());
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
Application Version: ${ruoyi.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
// o8888888o //
|
||||
// 88" . "88 //
|
||||
// (| ^_^ |) //
|
||||
// O\ = /O //
|
||||
// ____/`---'\____ //
|
||||
// .' \\| |// `. //
|
||||
// / \\||| : |||// \ //
|
||||
// / _||||| -:- |||||- \ //
|
||||
// | | \\\ - /// | | //
|
||||
// | \_| ''\---/'' | | //
|
||||
// \ .-\__ `-` ___/-. / //
|
||||
// ___`. .' /--.--\ `. . ___ //
|
||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
||||
// `=---=' //
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||
// 佛祖保佑 永不宕机 永无BUG //
|
||||
////////////////////////////////////////////////////////////////////
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.project.fx_technologist.controller;
|
||||
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_Technologist_48102;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fx_technologist")
|
||||
public class TechnologistController extends BaseController
|
||||
{
|
||||
// @PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping("/getConfirmation")
|
||||
public AjaxResult getConfirmation() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DoGetSampleConfirmation());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getBestOEM")
|
||||
public AjaxResult getBestOEM() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DoGetBestOEM());
|
||||
}
|
||||
|
||||
@GetMapping("/getBestODM")
|
||||
public AjaxResult getBestODM() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DoGetBestODM());
|
||||
}
|
||||
|
||||
@GetMapping("/getFinishedSampleAvgDay")
|
||||
public AjaxResult getFinishedSampleAvgDay() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DoFinishedSampleAvgDay());
|
||||
}
|
||||
|
||||
@GetMapping("/getUnFinishedSampleAvgDay")
|
||||
public AjaxResult getUnFinishedSampleAvgDay() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DoUnFinishedSampleAvgDay());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*日报
|
||||
*/
|
||||
@GetMapping("/DayFinishedSampleOrder")
|
||||
public AjaxResult DayFinishedSampleOrder() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DayFinishedSampleOrder());
|
||||
}
|
||||
|
||||
@GetMapping("/DayNewMould")
|
||||
public AjaxResult DayNewMould() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DayNewMould());
|
||||
}
|
||||
|
||||
@GetMapping("/DayFinishedSample")
|
||||
public AjaxResult DayFinishedSample() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DayFinishedSample());
|
||||
}
|
||||
|
||||
@GetMapping("/DayFinishedBOM")
|
||||
public AjaxResult DayFinishedBOM() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.DayFinishedBOM());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/All")
|
||||
public AjaxResult ALL() throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.All());
|
||||
}
|
||||
|
||||
@GetMapping("/AllDataDataRange/{fDateStart}/{fDateEnd}")
|
||||
public AjaxResult getDateRange(@PathVariable String fDateStart, @PathVariable String fDateEnd) throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.AllDataDataRange(fDateStart,fDateEnd));
|
||||
}
|
||||
|
||||
}
|
@ -6,16 +6,16 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.48.32:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: js*168
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
@ -35,7 +35,7 @@ spring:
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
@ -43,8 +43,8 @@ spring:
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username:
|
||||
login-password:
|
||||
login-username:
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
@ -54,4 +54,4 @@ spring:
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
multi-statement-allow: true
|
||||
|
@ -1,15 +1,15 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
name: Intco
|
||||
# 版本
|
||||
version: 2.3.0
|
||||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
copyrightYear: 2020
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
demoEnabled: false
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
profile: /home/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
|
||||
@ -40,7 +40,7 @@ spring:
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
profiles:
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
@ -61,7 +61,7 @@ spring:
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 密码
|
||||
password:
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@ -83,7 +83,7 @@ token:
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
@ -94,11 +94,11 @@ mybatis:
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
@ -108,16 +108,16 @@ swagger:
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice/*
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
|
||||
# 代码生成
|
||||
gen:
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
@ -125,4 +125,4 @@ gen:
|
||||
# 自动去除表前缀,默认是true
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
tablePrefix: sys_
|
||||
tablePrefix: sys_
|
||||
|
Reference in New Issue
Block a user