From 8d4fbe30290172b55d7ae9876de45acdc1f9703b Mon Sep 17 00:00:00 2001 From: ICEC <414933307@qq.com> Date: Tue, 14 Jul 2020 16:44:34 +0800 Subject: [PATCH] no commit message --- ruoyi-ui/src/api/dashboard/fx_technologist.js | 4 +- .../fx_sample_best_selling_by_use.vue | 24 ++--- .../DB_Ajax_DashBoard_Technologist_48102.java | 94 +++++++++---------- .../controller/TechnologistController.java | 12 +-- 4 files changed, 67 insertions(+), 67 deletions(-) diff --git a/ruoyi-ui/src/api/dashboard/fx_technologist.js b/ruoyi-ui/src/api/dashboard/fx_technologist.js index f6e4edd52..92fd6ba13 100644 --- a/ruoyi-ui/src/api/dashboard/fx_technologist.js +++ b/ruoyi-ui/src/api/dashboard/fx_technologist.js @@ -93,9 +93,9 @@ export function getBestHunsha() { } -export function getBestTijiaoxian() { +export function getBestJiancai() { return request({ - url: '/fx_technologist/getBestTijiaoxian', + url: '/fx_technologist/getBestJiancai', method: 'get' }) } diff --git a/ruoyi-ui/src/views/fx_technologist/fx_sample_best_selling_by_use.vue b/ruoyi-ui/src/views/fx_technologist/fx_sample_best_selling_by_use.vue index 920d54b80..1431d6d74 100644 --- a/ruoyi-ui/src/views/fx_technologist/fx_sample_best_selling_by_use.vue +++ b/ruoyi-ui/src/views/fx_technologist/fx_sample_best_selling_by_use.vue @@ -7,11 +7,11 @@
-

婚纱框爆款

+

婚纱框畅销款

@@ -41,11 +41,11 @@
-

踢脚线爆款

+

建材畅销款

@@ -75,11 +75,11 @@
-

画框爆款

+

画框畅销款

@@ -112,8 +112,10 @@ require('echarts/theme/macarons') // echarts theme import resize from '../dashboard/mixins/resize' - import {getBestOEM} from '@/api/dashboard/fx_technologist' - import {getBestODM} from '@/api/dashboard/fx_technologist' + import {getBestJiancai} from '@/api/dashboard/fx_technologist' + import {getBestHunsha} from '@/api/dashboard/fx_technologist' + import {getBestHuakuang} from '@/api/dashboard/fx_technologist' + const lineChartData = { @@ -128,7 +130,7 @@ return { tableData婚纱框: [], tableData画框: [], - tableData踢脚线: [] + tableData建材: [] } }, @@ -159,13 +161,13 @@ } }) - getBestTijiaoxian().then(response => { + getBestJiancai().then(response => { for (var i = 0; i < response.data.length; i++) { - this.tableData踢脚线.push({ + this.tableData建材.push({ MouldingStyleCode: response.data[i].MouldingStyleCode, CNY: ((response.data[i].CNY)*1).toFixed(2), Area: response.data[i].Area, diff --git a/ruoyi/src/main/java/com/ruoyi/db/mssql/DB_Ajax_DashBoard_Technologist_48102.java b/ruoyi/src/main/java/com/ruoyi/db/mssql/DB_Ajax_DashBoard_Technologist_48102.java index 416490d00..6de4ee5e5 100644 --- a/ruoyi/src/main/java/com/ruoyi/db/mssql/DB_Ajax_DashBoard_Technologist_48102.java +++ b/ruoyi/src/main/java/com/ruoyi/db/mssql/DB_Ajax_DashBoard_Technologist_48102.java @@ -450,17 +450,28 @@ public class DB_Ajax_DashBoard_Technologist_48102 { - public static List> getBestHuakuang() { +//除了 画框 婚纱框 相框 镜框 + + public static List> getBestByProductionLine(String ProductionLine) { List> hashMapList = new ArrayList<>(); try { Connection conn = getSQLConnection(); - String sql = "SELECT TOP\n" + - "\t20 MouldingStyleCode,\n" + - "\t[折算人民币价税合计] AS CNY \n" + + String sql = "SELECT DISTINCT TOP\n" + + "\t20 chen_12个月_A版本BOM销售额.MouldingStyleCode,\n" + + "\t[折算人民币价税合计] AS CNY,\n" + + "\tMouldingSampleMakingMasterSchedule.ProductionLine ,\n" + + "\t(SELECT TOP\n" + + "\t1 SHCountry \n" + "FROM\n" + - "\t[chen_12个月_A版本BOM销售额] \n" + + "\tMouldingDataStatistics \n" + + "WHERE MouldingCode = reverse(substring(reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode),charindex('-',reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode)) +1,500)) \n" + + "GROUP BY SHCountry\n" + + "ORDER BY sum(SHMouldingSaleLength) ) as Area\n" + + "FROM\n" + + "\t[chen_12个月_A版本BOM销售额]\n" + + "\tLEFT JOIN MouldingSampleMakingMasterSchedule ON MouldingSampleMakingMasterSchedule.MouldingStyleCode = chen_12个月_A版本BOM销售额.MouldingStyleCode \n" + "WHERE\n" + - "\ttagname = 'OEM' \n" + + "\tMouldingSampleMakingMasterSchedule.ProductionLine = '"+ProductionLine+"' \n" + "ORDER BY\n" + "\t折算人民币价税合计 DESC"; Statement stmt = conn.createStatement();// @@ -471,6 +482,7 @@ public class DB_Ajax_DashBoard_Technologist_48102 { HashMap map = new HashMap<>(); map.put("MouldingStyleCode",rs.getString("MouldingStyleCode")); map.put("CNY",rs.getString("CNY")); + map.put("Area",rs.getString("Area")); hashMapList.add(map); } @@ -485,17 +497,38 @@ public class DB_Ajax_DashBoard_Technologist_48102 { } - public static List> getBestTijiaoxian() { + +//除了 画框 婚纱框 相框 镜框 + + public static List> getBestByProductionLine_Jiancai( ) { List> hashMapList = new ArrayList<>(); try { Connection conn = getSQLConnection(); - String sql = "SELECT TOP\n" + - "\t20 MouldingStyleCode,\n" + - "\t[折算人民币价税合计] AS CNY \n" + + String sql = "SELECT DISTINCT TOP\n" + + "\t20 chen_12个月_A版本BOM销售额.MouldingStyleCode,\n" + + "\t[折算人民币价税合计] AS CNY,\n" + + "\tMouldingSampleMakingMasterSchedule.ProductionLine ,\n" + + "\t(SELECT TOP\n" + + "\t1 SHCountry \n" + "FROM\n" + - "\t[chen_12个月_A版本BOM销售额] \n" + + "\tMouldingDataStatistics \n" + + "WHERE MouldingCode = reverse(substring(reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode),charindex('-',reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode)) +1,500)) \n" + + "GROUP BY SHCountry\n" + + "ORDER BY sum(SHMouldingSaleLength) ) as Area,\n" + + "\t(SELECT TOP\n" + + "\t1 SDCountry \n" + + "FROM\n" + + "\tMouldingDataStatistics \n" + + "WHERE MouldingCode = reverse(substring(reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode),charindex('-',reverse(chen_12个月_A版本BOM销售额.MouldingStyleCode)) +1,500)) \n" + + "GROUP BY SDCountry\n" + + "ORDER BY sum(SDMouldingSaleLength) ) as Area2\n" + + "FROM\n" + + "\t[chen_12个月_A版本BOM销售额]\n" + + "\tLEFT JOIN MouldingSampleMakingMasterSchedule ON MouldingSampleMakingMasterSchedule.MouldingStyleCode = chen_12个月_A版本BOM销售额.MouldingStyleCode \n" + "WHERE\n" + - "\ttagname = 'OEM' \n" + + "\tSUBSTRING(chen_12个月_A版本BOM销售额.MouldingStyleCode,1,1) = 'J'\n" + + "\n" + + "\n" + "ORDER BY\n" + "\t折算人民币价税合计 DESC"; Statement stmt = conn.createStatement();// @@ -506,6 +539,7 @@ public class DB_Ajax_DashBoard_Technologist_48102 { HashMap map = new HashMap<>(); map.put("MouldingStyleCode",rs.getString("MouldingStyleCode")); map.put("CNY",rs.getString("CNY")); + map.put("Area",rs.getString("Area")); hashMapList.add(map); } @@ -520,42 +554,6 @@ public class DB_Ajax_DashBoard_Technologist_48102 { } - public static List> getBestHunsha() { - List> 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 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; - } - - - diff --git a/ruoyi/src/main/java/com/ruoyi/project/fx_technologist/controller/TechnologistController.java b/ruoyi/src/main/java/com/ruoyi/project/fx_technologist/controller/TechnologistController.java index 8dcea664b..3e54dc5f5 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/fx_technologist/controller/TechnologistController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/fx_technologist/controller/TechnologistController.java @@ -92,22 +92,22 @@ public class TechnologistController extends BaseController - @GetMapping("/getBestOEM") + @GetMapping("/getBestHuakuang") public AjaxResult getBestHuakuang() throws Exception { - return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestHuakuang()); + return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestByProductionLine("画框")); } - @GetMapping("/getBestODM") + @GetMapping("/getBestJiancai") public AjaxResult getBestTijiaoxian() throws Exception { - return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestTijiaoxian()); + return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestByProductionLine_Jiancai()); } - @GetMapping("/getBestODM") + @GetMapping("/getBestHunsha") public AjaxResult getBestHunsha() throws Exception { - return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestHunsha()); + return AjaxResult.success(DB_Ajax_DashBoard_Technologist_48102.getBestByProductionLine("婚纱框")); }