From db2a0a7a592c21b3ceabec90cc4b8890c79ae4c9 Mon Sep 17 00:00:00 2001 From: Limy <1353020654@qq.com> Date: Fri, 12 Mar 2021 11:22:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update=20=E6=95=B0=E6=8D=AE=E8=A1=A8?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E8=87=AA?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nanjing/TBdProductinfoController.java | 18 +++++++-- .../nanjing/TBdProducttypeController.java | 20 ++++++++-- .../nanjing/TBdSubstationController.java | 38 +++++++++++++------ .../src/main/resources/application-druid.yml | 4 +- 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProductinfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProductinfoController.java index 0b7470ab..3c9213d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProductinfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProductinfoController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.nanjing; +import java.util.ArrayList; import java.util.List; import com.ruoyi.common.core.text.Convert; @@ -78,9 +79,20 @@ public class TBdProductinfoController extends BaseController public String add(ModelMap map) { List list = tBdProductinfoService.selectTBdProductinfo(); - int max = Convert.toInt(list.get(0).getProductID()); - list.get(0).setProductID(max+1L); - map.addAttribute("pt",list); + int max; + if(list.size()==0){ + max=0; + List list1 = new ArrayList<>(); + TBdProductinfo tBdProductinfo = new TBdProductinfo(); + tBdProductinfo.setProductID(max+1L); + list1.add(tBdProductinfo); + map.addAttribute("pt",list1); + } + else{ + max = Convert.toInt(list.get(0).getProductID()); + list.get(0).setProductID(max+1L); + map.addAttribute("pt",list); + } return prefix + "/add"; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java index abd3a622..8cabeb40 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java @@ -1,8 +1,10 @@ package com.ruoyi.web.controller.nanjing; +import java.util.ArrayList; import java.util.List; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.nanjing.domain.TBdProductinfo; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -77,10 +79,20 @@ public class TBdProducttypeController extends BaseController public String add(ModelMap map) { List list = tBdProducttypeService.selectTBdProducttype(); - int max = Convert.toInt(list.get(0).getProductTypeID()); - String oper = max + 1+""; - list.get(0).setProductTypeID(oper); - map.addAttribute("pt",list); + int max ; + if(list.size()==0){ + max = 0; + List list1 = new ArrayList<>(); + TBdProducttype tBdProducttype = new TBdProducttype(); + tBdProducttype.setProductTypeID(max+1L+""); + map.addAttribute("pt",list1); + }else{ + max = Convert.toInt(list.get(0).getProductTypeID()); + String oper = max + 1+""; + list.get(0).setProductTypeID(oper); + map.addAttribute("pt",list); + } + return prefix + "/add"; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdSubstationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdSubstationController.java index 871bfc7b..f2a230de 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdSubstationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdSubstationController.java @@ -1,9 +1,6 @@ package com.ruoyi.web.controller.nanjing; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.core.text.Convert; @@ -108,17 +105,36 @@ public class TBdSubstationController extends BaseController { //工位序号+ List list = tBdSubstationService.selectStationcode(); - int max = Convert.toInt(list.get(0).getStationID()); - list.get(0).setStationID(max+1L); + int max; + if(list.size()==0){ + max = 0; + List lists = new ArrayList<>(); + TBdSubstation tBdSubstation = new TBdSubstation(); + tBdSubstation.setStationID(max+1L); + lists.add(tBdSubstation); + map.addAttribute("si",lists); + }else{ + max = Convert.toInt(list.get(0).getStationID()); + list.get(0).setStationID(max+1L); + map.addAttribute("si",list); + } //排序id+ List list1 = tBdSubstationService.selectOrderid(); - int max1 = Convert.toInt(list.get(0).getOrderID()); - list.get(0).setOrderID(max1+1L); - + int max1; + if(list1.size()==0){ + max1 = 0; + List list2 = new ArrayList<>(); + TBdSubstation tBdSubstation = new TBdSubstation(); + tBdSubstation.setOrderID(max1+1L); + list2.add(tBdSubstation); + map.addAttribute("oi",list2); + }else{ + max1 = Convert.toInt(list.get(0).getOrderID()); + list1.get(0).setOrderID(max1+1L); + map.addAttribute("oi",list1); + } List linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype()); List stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype()); - map.addAttribute("si",list); - map.addAttribute("oi",list); map.addAttribute("linename",linetypes); map.addAttribute("stationtype",stationtypes); return prefix + "/add"; diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index e19abc6f..c454cbd1 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:sqlserver://121.36.58.109:1433;SelectMethod=cursor;DatabaseName=SecondNanjing + url: jdbc:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=FYATJ username: sa - password: haiwei@123 + password: 123456 # 从库数据源 slave: # 从数据源开关/默认关闭 From 9ce3b5a53d8abeee2070c47fd76629a68c6a366f Mon Sep 17 00:00:00 2001 From: Limy <1353020654@qq.com> Date: Fri, 12 Mar 2021 14:00:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update=20=E5=B7=A5=E4=BD=8D=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=9F=A5=E8=AF=A2-=E5=AD=97=E6=AE=B5=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-druid.yml | 4 ++-- .../StationParaInfo/StationParaInfo.html | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index c454cbd1..e19abc6f 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=FYATJ + url: jdbc:sqlserver://121.36.58.109:1433;SelectMethod=cursor;DatabaseName=SecondNanjing username: sa - password: 123456 + password: haiwei@123 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html b/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html index 5b1165fb..9b6f5a86 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html @@ -66,15 +66,23 @@ success: function (json) { console.log(json); var columnsArray1 = []; - for (var i = 0; i < (Object.keys(json.rows[0])).length; i++) {//Object.keys(obj) 获取key名称 - var property = (Object.keys(json.rows[0]))[i]; - columnsArray1.push({ - "title": property, - "field": property, - switchable: true - }); - } + columnsArray1.push({field : "序号",title : "序号",colspan: 1,rowspan: 1}); + columnsArray1.push({field : "产品码",title : "产品码",colspan: 1,rowspan: 1}); + columnsArray1.push({field : "状态",title : "状态",colspan: 1,rowspan: 1}); + columnsArray1.push({field : "记录时间",title : "记录时间",colspan: 1,rowspan: 1}); + if(json.total>0) { + for (var i = 0; i < (Object.keys(json.rows[0])).length; i++) {//Object.keys(obj) 获取key名称 + var property = (Object.keys(json.rows[0]))[i]; + if(property!='产品码'&&property!='记录时间'&&property!='序号'&&property!='状态') { + columnsArray1.push({ + "title": property, + "field": property, + switchable: true + }); + } + } + } // console.log(json); // var arrlength=[]; // json.rows.forEach(function (value) { From 0596a7b79ff2233576cb5820bb9b5bf9007a850b Mon Sep 17 00:00:00 2001 From: Limy <1353020654@qq.com> Date: Fri, 12 Mar 2021 15:36:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?update=20=E5=B7=A5=E4=BD=8D=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=9F=A5=E8=AF=A2-=E5=85=A8=E9=83=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/nanjing/StationParaInfoController.java | 1 + .../templates/nanjing/StationParaInfo/StationParaInfo.html | 7 ++++--- .../main/resources/mapper/nanjing/TSyTracestateMapper.xml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StationParaInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StationParaInfoController.java index 3c330721..f6f74b30 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StationParaInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StationParaInfoController.java @@ -21,6 +21,7 @@ import java.io.*; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; @Controller @RequestMapping("/nanjing/selectStationPara") diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html b/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html index 9b6f5a86..cdb228be 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/StationParaInfo/StationParaInfo.html @@ -66,15 +66,16 @@ success: function (json) { console.log(json); var columnsArray1 = []; - + // columnsArray1.push({field : "序号",title : "序号",colspan: 1,rowspan: 1}); columnsArray1.push({field : "产品码",title : "产品码",colspan: 1,rowspan: 1}); columnsArray1.push({field : "状态",title : "状态",colspan: 1,rowspan: 1}); columnsArray1.push({field : "记录时间",title : "记录时间",colspan: 1,rowspan: 1}); + columnsArray1.push({field : "工位名称",title : "工位名称",colspan: 1,rowspan: 1}); if(json.total>0) { for (var i = 0; i < (Object.keys(json.rows[0])).length; i++) {//Object.keys(obj) 获取key名称 var property = (Object.keys(json.rows[0]))[i]; - if(property!='产品码'&&property!='记录时间'&&property!='序号'&&property!='状态') { + if(property!='产品码'&&property!='记录时间'&&property!='序号'&&property!='状态'&&property!='工位名称') { columnsArray1.push({ "title": property, "field": property, @@ -145,7 +146,7 @@ toolbar: "#toolbar", singleSelect: false, clickToSelect: true, - sortName: "记录时间", + sortName: "序号", sortOrder: "desc", pageSize: 50, pageNumber: 1, diff --git a/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml b/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml index e4bf4536..42a33038 100644 --- a/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml @@ -121,7 +121,7 @@ ) } - { call pro_SelectSemiStationParaData (