Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StationParaInfoController.java
master
yangwl 4 years ago
commit 5be0bb2e68

@ -18,7 +18,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.*; import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Controller @Controller
@RequestMapping("/nanjing/selectStationPara") @RequestMapping("/nanjing/selectStationPara")
@ -29,7 +32,6 @@ public class StationParaInfoController extends BaseController {
@Autowired @Autowired
private ITBdSubstationService substationService; private ITBdSubstationService substationService;
@RequiresPermissions("nanjing:StationPara:view") @RequiresPermissions("nanjing:StationPara:view")
@GetMapping() @GetMapping()
public String ProRpList(ModelMap map) { public String ProRpList(ModelMap map) {
@ -54,14 +56,7 @@ public class StationParaInfoController extends BaseController {
map.put("Barcode", ""); map.put("Barcode", "");
map.put("SemiBarcode", semiBarcode); map.put("SemiBarcode", semiBarcode);
map.put("StateID", ""); map.put("StateID", "");
List<Map<String,Object>> list=tracestateService.selectStationPara(map); List<Map<String, Object>> list = tracestateService.selectStationPara(map);
// List<Map<String, Object>> list = tracestateService.selectStationPara(map);
// Map newMAP=new HashMap();
// for(Map map1 : list){
// if (map1.containsKey("产品码")){
// newMAP.put("产品码",map1.get("产品码"));
// }
// }
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
if (list.get(i).containsKey("产品码")) { if (list.get(i).containsKey("产品码")) {
continue; continue;
@ -72,27 +67,6 @@ public class StationParaInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
// public static void main(String[] args) {
// List<Map<String,Object>> maps=new ArrayList<>();
// Map map=new HashMap();
// map.put("测试","1552");
// map.put("测试2","58146");
// map.put("产品码","58533");
// maps.add(map);
// Map newMAP=new HashMap();
// List<Map<String,Object>> newListMap=new ArrayList<>();
// for (Map map1 : maps){
// if (map1.containsKey("产品码")){
// newMAP.put("产品码",map1.get("产品码"));
// }else {
// newMAP.put();
// }
// newListMap.add(newMAP);
// }
// System.out.println(maps);
// }
// @RequiresPermissions("nanjing:StationPara:export") // @RequiresPermissions("nanjing:StationPara:export")
// @Log(title = "产品码查询", businessType = BusinessType.EXPORT) // @Log(title = "产品码查询", businessType = BusinessType.EXPORT)

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.nanjing; package com.ruoyi.web.controller.nanjing;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
@ -78,9 +79,20 @@ public class TBdProductinfoController extends BaseController
public String add(ModelMap map) public String add(ModelMap map)
{ {
List<TBdProductinfo> list = tBdProductinfoService.selectTBdProductinfo(); List<TBdProductinfo> list = tBdProductinfoService.selectTBdProductinfo();
int max = Convert.toInt(list.get(0).getProductID()); int max;
list.get(0).setProductID(max+1L); if(list.size()==0){
map.addAttribute("pt",list); max=0;
List<TBdProductinfo> 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"; return prefix + "/add";
} }

@ -1,8 +1,10 @@
package com.ruoyi.web.controller.nanjing; package com.ruoyi.web.controller.nanjing;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -77,10 +79,20 @@ public class TBdProducttypeController extends BaseController
public String add(ModelMap map) public String add(ModelMap map)
{ {
List<TBdProducttype> list = tBdProducttypeService.selectTBdProducttype(); List<TBdProducttype> list = tBdProducttypeService.selectTBdProducttype();
int max = Convert.toInt(list.get(0).getProductTypeID()); int max ;
String oper = max + 1+""; if(list.size()==0){
list.get(0).setProductTypeID(oper); max = 0;
map.addAttribute("pt",list); List<TBdProducttype> 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"; return prefix + "/add";
} }

@ -1,9 +1,6 @@
package com.ruoyi.web.controller.nanjing; package com.ruoyi.web.controller.nanjing;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
@ -108,17 +105,36 @@ public class TBdSubstationController extends BaseController
{ {
//工位序号+ //工位序号+
List<TBdSubstation> list = tBdSubstationService.selectStationcode(); List<TBdSubstation> list = tBdSubstationService.selectStationcode();
int max = Convert.toInt(list.get(0).getStationID()); int max;
list.get(0).setStationID(max+1L); if(list.size()==0){
max = 0;
List<TBdSubstation> 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+ //排序id+
List<TBdSubstation> list1 = tBdSubstationService.selectOrderid(); List<TBdSubstation> list1 = tBdSubstationService.selectOrderid();
int max1 = Convert.toInt(list.get(0).getOrderID()); int max1;
list.get(0).setOrderID(max1+1L); if(list1.size()==0){
max1 = 0;
List<TBdSubstation> 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<TBdLinetype> linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype()); List<TBdLinetype> linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype());
List<TBdStationtype> stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype()); List<TBdStationtype> stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype());
map.addAttribute("si",list);
map.addAttribute("oi",list);
map.addAttribute("linename",linetypes); map.addAttribute("linename",linetypes);
map.addAttribute("stationtype",stationtypes); map.addAttribute("stationtype",stationtypes);
return prefix + "/add"; return prefix + "/add";

@ -66,15 +66,24 @@
success: function (json) { success: function (json) {
console.log(json); console.log(json);
var columnsArray1 = []; 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({field : "序号",title : "序号",colspan: 1,rowspan: 1});
columnsArray1.push({ columnsArray1.push({field : "产品码",title : "产品码",colspan: 1,rowspan: 1});
"title": property, columnsArray1.push({field : "状态",title : "状态",colspan: 1,rowspan: 1});
"field": property, columnsArray1.push({field : "记录时间",title : "记录时间",colspan: 1,rowspan: 1});
switchable: true 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!='状态'&&property!='工位名称') {
columnsArray1.push({
"title": property,
"field": property,
switchable: true
});
}
}
} }
// console.log(json); // console.log(json);
// var arrlength=[]; // var arrlength=[];
// json.rows.forEach(function (value) { // json.rows.forEach(function (value) {
@ -137,7 +146,7 @@
toolbar: "#toolbar", toolbar: "#toolbar",
singleSelect: false, singleSelect: false,
clickToSelect: true, clickToSelect: true,
sortName: "记录时间", sortName: "序号",
sortOrder: "desc", sortOrder: "desc",
pageSize: 50, pageSize: 50,
pageNumber: 1, pageNumber: 1,

Loading…
Cancel
Save