提交源码

master
baogq 2 years ago
parent af9bd4eb48
commit e6dcd1141f

@ -1,23 +1,10 @@
package com.ruoyi.web.controller.nanjing;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mysql.cj.xdevapi.JsonArray;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.nanjing.domain.ReportData;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITBdProducttypeService;
import com.ruoyi.web.controller.common.DemoData;
import org.apache.catalina.User;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.xssf.usermodel.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -27,14 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@RequestMapping("/nanjing/reportData")
@ -60,12 +40,49 @@ public class ReportDataController extends BaseController {
map.put("end", end);
map.put("barcode", barcode);
List<Map<String,Object>> reportDataList = producttypeService.selectReport(map);
//查temp1表
// List<Map<String,Object>> reportDataList = producttypeService.selectReport();
//lmap--临时map用来存放判断的key
Map<String,Object> lmap = new HashMap<String,Object>();
//valueList--最终返回数据的集合
List<Map<String, Object>> valueList = new ArrayList<>();
//valueMap--存放在valueList中的map
Map<String,Object> valueMap = new LinkedHashMap<>();
//循环遍历拿到查询的数据
for(Map<String , Object> map1 : reportDataList){
return getDataTable(reportDataList);
String parameaning = map1.get("parameaning").toString();
String value = map1.get("value").toString();
String beginTime = "";
if(map1.containsKey("begintime")){
beginTime = map1.get("begintime").toString();
}
// else{
// beginTime = "";
// }
//String beginTime = map1.get("begintime").toString();
String stationName = map1.get("Barcode").toString();
//判断条件,来实现行转列
if (!lmap.containsKey(stationName+beginTime)){
valueMap = new LinkedHashMap<String,Object>();
valueMap.put("Barcode",stationName);
valueMap.put("begintime",beginTime);
valueMap.put(parameaning,value);
valueList.add(valueMap);
//需要的条件用作keyvalueMap做value带入else语句情况下
lmap.put(stationName+beginTime,valueMap);
} else {
valueMap = (Map<String, Object>) lmap.get(stationName+beginTime);
valueMap.put(parameaning,value);
}
}
return getDataTable(valueList);
}
// @PostMapping("/export")
// @ResponseBody
// public AjaxResult export(String begin, String end, String barcode){
@ -178,4 +195,6 @@ public class ReportDataController extends BaseController {
// return ajaxResult.success(targetFile);
// }
}

@ -64,14 +64,14 @@ public class StatisticStProductController extends BaseController {
@PostMapping("/nodeClick")
@ResponseBody
public List<QsStation> nodeClick(String begin,String end,String node)
public List<QsStation> nodeClick(String begin,String end,String node,String productid)
{
Map map = new HashMap<String,Object>();
map.put("begin",begin);
map.put("end",end);
map.put("stationId",node);
map.put("stationType",1);
map.put("productId","ALL");
map.put("productId",productid);
List<QsStation> qsStations = producttypeService.selectNodeQs(map);
return qsStations;
}

@ -1,6 +1,10 @@
package com.ruoyi.web.controller.nanjing;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.utils.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -47,11 +51,11 @@ public class TBdLinetypeController extends BaseController
@RequiresPermissions("nanjing:LineType:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TBdLinetype tBdLinetype)
public List<TBdLinetype>list(TBdLinetype tBdLinetype)
{
startPage();
List<TBdLinetype> list = tBdLinetypeService.selectTBdLinetypeList(tBdLinetype);
return getDataTable(list);
return list;
}
/**
@ -71,9 +75,15 @@ public class TBdLinetypeController extends BaseController
/**
* 线
*/
@GetMapping("/add")
public String add()
@GetMapping( value = { "/add/{LineID}", "/add/" })
public String add(@PathVariable(value = "LineID",required = false)String LineID, ModelMap mmap)
{
TBdLinetype TBdLinetype = null;
if(StringUtils.isNotNull(LineID)){
TBdLinetype = tBdLinetypeService.selectTBdLinetypeById(Long.parseLong(LineID));
mmap.put("TBdLinetype", TBdLinetype);
}
return prefix + "/add";
}
@ -86,6 +96,9 @@ public class TBdLinetypeController extends BaseController
@ResponseBody
public AjaxResult addSave(TBdLinetype tBdLinetype)
{
if(StringUtils.isNull(tBdLinetype.getPID())){
tBdLinetype.setPID(0L);
}
return toAjax(tBdLinetypeService.insertTBdLinetype(tBdLinetype));
}
@ -109,18 +122,36 @@ public class TBdLinetypeController extends BaseController
@ResponseBody
public AjaxResult editSave(TBdLinetype tBdLinetype)
{
if(StringUtils.isNull(tBdLinetype.getPID())){
tBdLinetype.setPID(0L);
}
return toAjax(tBdLinetypeService.updateTBdLinetype(tBdLinetype));
}
@RequiresPermissions("nanjing:LineType:remove")
@Log(title = "主支线管理", businessType = BusinessType.DELETE)
@GetMapping("/remove/{LineID}")
@ResponseBody
public AjaxResult remove(@PathVariable("LineID") Long LineID)
{
return toAjax(tBdLinetypeService.deleteTBdLinetypeById(LineID));
}
/**
* 线
*
*/
@RequiresPermissions("nanjing:LineType:remove")
@Log(title = "主支线管理", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@GetMapping("/treeData")
@ResponseBody
public AjaxResult remove(String ids)
public List<Ztree> treeData()
{
List<Ztree> ztrees = tBdLinetypeService.selectBaseMonitorInfoTree();
return ztrees;
}
@GetMapping( value = {"/selectLineTree/{lineId}", "/selectLineTree/"})
public String selectMenuTree(@PathVariable(value = "lineId", required = false) String lineId, ModelMap mmap)
{
return toAjax(tBdLinetypeService.deleteTBdLinetypeByIds(ids));
if(StringUtils.isNotNull(lineId) ){
mmap.put("TBdLinetype", tBdLinetypeService.selectTBdLinetypeById(Long.parseLong(lineId)));
}
return prefix + "/tree";
}
}

@ -6,12 +6,12 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=FYATJ
# url: jdbc:sqlserver://121.36.58.109:1433;SelectMethod=cursor;DatabaseName=FYATJ
# username: sa
# password: haiwei@123
url: jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=JYD_shengjie
username: sa
password: Mesnac123
# url: jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=FYATJ
# username: sa
# password: Mesnac123
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -17,7 +17,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为80
port: 4935
port: 9080
servlet:
# 应用的访问路径
context-path: /

@ -3,16 +3,16 @@ html {
}
body.signin {
height:auto;
background:url(../img/login-background.jpg) no-repeat center fixed;
background:url(../img/login.jpg) no-repeat center fixed;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
color:rgba(255,255,255,.95)
background-size:cover
}
.signinpanel {
width:750px;
margin:10% auto 0
margin:10% auto 0;
color:rgba(255,255,255,.95)
}
.signinpanel .logopanel {
float:none;
@ -62,7 +62,7 @@ body.signin {
@media screen and (max-width:768px) {
.signinpanel,.signuppanel {
margin:0 auto;
width:420px!important;
width:380px!important;
padding:20px
}
.signinpanel form {

@ -1 +1 @@
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}.form-control,.form-control:focus,.has-error .form-control:focus,.has-success .form-control:focus,.has-warning .form-control:focus,.navbar-collapse,.navbar-form,.navbar-form-custom .form-control:focus,.navbar-form-custom .form-control:hover,.open .btn.dropdown-toggle,.panel,.popover,.progress,.progress-bar{box-shadow:none}.form-control{border-radius:1px!important;padding:6px 12px!important;height:34px!important}.form-control:focus{border-color:#1ab394!important}
html{height:100%}body.signin{height:auto;background:url(../img/login.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover}.signinpanel{width:750px;margin:10% auto 0;color:rgba(255,255,255,.95)}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:380px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}.form-control,.form-control:focus,.has-error .form-control:focus,.has-success .form-control:focus,.has-warning .form-control:focus,.navbar-collapse,.navbar-form,.navbar-form-custom .form-control:focus,.navbar-form-custom .form-control:hover,.open .btn.dropdown-toggle,.panel,.popover,.progress,.progress-bar{box-shadow:none}.form-control{border-radius:1px!important;padding:6px 12px!important;height:34px!important}.form-control:focus{border-color:#1ab394!important}

@ -729,6 +729,15 @@ var table = {
alertWarning: function(content) {
$.modal.alert(content, modal_status.WARNING);
},
// 获取iframe页的DOM
getChildFrame: function (index) {
if($.common.isEmpty(index)){
var index = parent.layer.getFrameIndex(window.name);
return parent.layer.getChildFrame('body', index);
} else {
return top.layer.getChildFrame('body', index);
}
},
// 关闭窗体
close: function () {
var index = parent.layer.getFrameIndex(window.name);
@ -1424,14 +1433,14 @@ var table = {
return false;
}
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].level == 0) {
$.modal.msgError("不能选择根节点(" + nodes[i].name + "");
return false;
}
if (nodes[i].isParent) {
$.modal.msgError("不能选择父节点(" + nodes[i].name + "");
return false;
}
// if (nodes[i].level == 0) {
// $.modal.msgError("不能选择根节点(" + nodes[i].name + "");
// return false;
// }
// if (nodes[i].isParent) {
// $.modal.msgError("不能选择父节点(" + nodes[i].name + "");
// return false;
// }
}
return true;
},

@ -22,7 +22,7 @@
</select>
</li>
<li>
<a class="btn btn-success btn-rounded btn-sm" onclick="$.operate.add()" shiro:hasPermission="nanjing:LineType:add"><i class="fa fa-plus"></i> 添加</a>
<!-- <a class="btn btn-success btn-rounded btn-sm" onclick="$.operate.add()" shiro:hasPermission="nanjing:LineType:add"><i class="fa fa-plus"></i> 添加</a>-->
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;查询全部</a>
</li>
@ -30,59 +30,52 @@
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- -->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="nanjing:LineType:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="nanjing:LineType:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:LineType:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- </div>-->
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add(0)" shiro:hasPermission="nanjing:LineType:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="nanjing:LineType:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<table id="bootstrap-tree-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-export-js" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('nanjing:LineType:add')}]];
var editFlag = [[${@permission.hasPermi('nanjing:LineType:edit')}]];
var removeFlag = [[${@permission.hasPermi('nanjing:LineType:remove')}]];
var prefix = ctx + "nanjing/LineType";
var datas = [[${@dict.getType('LineType')}]];
$(function() {
var options = {
code: "lineID",
parentCode: "pid",
uniqueId: "lineID",
url: prefix + "/list",
createUrl: prefix + "/add",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
removeUrl: prefix + "/remove/{id}",
exportUrl: prefix + "/export",
modalName: "主支线管理",
search: false,
showExport: true,//工具栏上显示导出按钮
exportOptions: {
ignoreColumn: [-1, 5] //忽略最后一列
setOrderBy: 'lineID',
columns: [{
field: 'selectItem',
radio: true
},
columns: [
// {
// checkbox: true
// },
{
title:'序号',
formatter: function (value, row, index) {
return index+1;
}
},
{
field: 'lineID',
title: '编号',
// sortName:'LineId'
// sortable:true
},
{
field: 'lineTypeName',
@ -105,13 +98,14 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.lineID + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.lineID + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.lineID + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
$.treeTable.init(options);
});
</script>
</body>

@ -6,7 +6,18 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-LineType-add">
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">主线编号:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="PID" type="hidden" th:value="${TBdLinetype?.LineID}"/>
<input class="form-control" type="text" onclick="selectMonitorInfoTree()" id="treeName" readonly="true" th:value="${TBdLinetype?.LineTypeName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">线路名称:</label>
<div class="col-sm-8">
<input name="LineTypeName" class="form-control" type="text">
@ -31,15 +42,34 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/LineType"
$("#form-LineType-add").validate({
focusCleanup: true
});
/*测控点信息-新增-选择父节点信息树*/
function selectMonitorInfoTree() {
var options = {
title: '测控点信息选择',
width: "380",
url: prefix + "/selectLineTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-LineType-add').serialize());
}
}
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowParents(tree)) {
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
}
</script>
</body>
</html>

@ -6,6 +6,16 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-LineType-edit" th:object="${tBdLinetype}">
<div class="form-group">
<label class="col-sm-3 control-label">所属主线:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="PID" type="hidden" th:field="*{PID}" />
<input class="form-control" type="text" onclick="selectMonitorInfoTree()" id="treeName" readonly="true" th:field="*{parentName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<input name="LineID" th:field="*{LineID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">线路名称:</label>
@ -40,6 +50,25 @@
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-LineType-edit').serialize());
}
}
/*测控点信息-编辑-选择父节点信息树*/
function selectMonitorInfoTree() {
var options = {
title: '测控点信息选择',
width: "380",
url: prefix + "/selectLineTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowParents(tree)) { var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
}
</script>
</body>

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('测控点信息树选择')" />
<th:block th:include="include :: ztree-css" />
</head>
<style>
body{height:auto;font-family: "Microsoft YaHei";}
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${baseMonitorInfo?.monitorId}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${baseMonitorInfo?.monitorName}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label>
</div>
<div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div>
<div class="treeExpandCollapse">
<a href="#" onclick="$.tree.expand()">展开</a> /
<a href="#" onclick="$.tree.collapse()">折叠</a>
</div>
<div id="tree" class="ztree treeselect"></div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
$(function() {
var url = ctx + "nanjing/LineType/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
});
function zOnClick(event, treeId, treeNode) {
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}
</script>
</body>
</html>

@ -39,6 +39,7 @@
function searc() {
var formData = new FormData();
formData.append("semiBarcode",$("#semiBarcode").val());
$.modal.loading("数据加载中......");
$.ajax({
type: "post",
url: prefix + "/paraAllShow",
@ -50,8 +51,6 @@
contentType: false,
modalName: "产品码查询",
success: function (json) {
console.log(json);
var columnsArray2 = [];
columnsArray2.push({field : "semiBarcode",title : "产品码",colspan: 1,rowspan: 1});
columnsArray2.push({field : "部件码",title : "部件码",colspan: 1,rowspan: 1});
@ -123,6 +122,7 @@
// exportDataType: 'all',
columns: columnsArray2
});
$.modal.closeLoading();
},
error: function () {
alert("查询失败!");

@ -39,6 +39,10 @@
<script th:inline="javascript">
var stateDatas = [[${@dict.getType('is_not_yx')}]];
function searchpara(){
// if ($('#barcode').val()==null||$('#barcode').val()==''){
// $.modal.msgWarning("产品条码为空!")
// return
// }
// console.log("点击查询按钮事件执行...");
// //方式1行转列
@ -46,6 +50,7 @@
formData.append("begin",$('#beginTime').val());
formData.append("end",$('#endTime').val());
formData.append("barcode",$('#barcode').val());
$.modal.loading("数据加载中......");
$.ajax({
type: "post",
url: ctx + "nanjing/reportData/report",
@ -59,12 +64,13 @@
console.log(json)
var columnsArray = [];
columnsArray.push({field : "Barcode",title : "产品条码",colspan: 1,rowspan: 1});
//columnsArray.push({field : "begintime",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];
console.log(property)
if(property!='Barcode' && property!="ProductBarcode"){
if(property!='Barcode' && property!="ProductBarcode" && property!='begintime'){
columnsArray.push({
"title": property,
"field": property,
@ -79,15 +85,14 @@
}
// coulmnsData.push(columnsArray);
// coulmnsData.push(columns);
console.log(columnsArray);
$('#bootstrap-table').bootstrapTable('destroy').bootstrapTable({
id: "bootstrap-table",
data:json,
toolbar: "#toolbar",
singleSelect: false,
// clickToSelect: true,
sortName: "barcode",
sortOrder: "desc",
sortName: "begintime",
sortOrder: "asc",
pageSize: 15,
pageNumber: 1,
pageList: "[10, 15,25, 50, 100, All]",
@ -107,11 +112,16 @@
columns: columnsArray
});
// columnsArray.push();
$.modal.closeLoading();
},
error: function () {
alert("错误");
}
});
}
);
// 方式2 不进行行转列
// var url = ctx + "nanjing/reportData/report";
// $('#bootstrap-table').bootstrapTable('destroy');

@ -74,7 +74,7 @@
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});

@ -188,7 +188,8 @@
{
begin:$('#startTime').val(),
end:$('#endTime').val(),
node:$('#stationId').val()
node:$('#stationId').val(),
productid:$('#product').val()
},
modalName: "工位合格率统计",
columns: [

@ -19,7 +19,7 @@
<li>
<label>机种类型:</label>
<select name="productType" th:with="type=${@dict.getType('productType')}">
<option value="">全部</option>
<option value="all">全部</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>

@ -59,12 +59,22 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">线路类型:</label>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">线路类型:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="LineID" class="form-control">-->
<!-- <option th:each="st:${linename}" th:value="${st.LineID}" th:text="${st.LineTypeName}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">所属线路:</label>
<div class="col-sm-8">
<select name="LineID" class="form-control">
<option th:each="st:${linename}" th:value="${st.LineID}" th:text="${st.LineTypeName}"></option>
</select>
<div class="input-group">
<input id="treeId" name="LineID" type="hidden" th:value="${TBdLinetype?.LineID}"/>
<input class="form-control" type="text" onclick="selectMonitorInfoTree()" id="treeName" readonly="true" th:value="${TBdLinetype?.LineTypeName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
</form>
@ -73,6 +83,7 @@
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/SubStation"
var LineType = ctx + "nanjing/LineType"
$("#form-SubStation-add").validate({
focusCleanup: true
});
@ -104,6 +115,25 @@
function fillTableName() {
$('#tableName').val("T_RP_StationPara_"+$('#stationCode').val().toString().trim());
}
/*测控点信息-新增-选择父节点信息树*/
function selectMonitorInfoTree() {
var options = {
title: '测控点信息选择',
width: "380",
url: LineType + "/selectLineTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowParents(tree)) {
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
}
</script>
</body>
</html>

@ -178,10 +178,13 @@
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowParents(tree)) {
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
}
</script>
</body>

@ -4,7 +4,7 @@ import java.io.Serializable;
/**
* Ztree
*
*
* @author ruoyi
*/
public class Ztree implements Serializable
@ -12,10 +12,10 @@ public class Ztree implements Serializable
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
private String id;
/** 节点父ID */
private Long pId;
private String pId;
/** 节点名称 */
private String name;
@ -32,22 +32,22 @@ public class Ztree implements Serializable
/** 是否能勾选 */
private boolean nocheck = false;
public Long getId()
public String getId()
{
return id;
}
public void setId(Long id)
public void setId(String id)
{
this.id = id;
}
public Long getpId()
public String getpId()
{
return pId;
}
public void setpId(Long pId)
public void setpId(String pId)
{
this.pId = pId;
}

@ -1,5 +1,6 @@
package com.ruoyi.nanjing.domain;
import com.ruoyi.common.core.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -11,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author limy
* @date 2021-01-22
*/
public class TBdLinetype extends BaseEntity
public class TBdLinetype extends TreeEntity
{
private static final long serialVersionUID = 1L;
@ -30,50 +31,58 @@ public class TBdLinetype extends BaseEntity
@Excel(name = "条码前缀")
private String BarcodeHead;
public void setLineID(Long LineID)
{
this.LineID = LineID;
}
@Excel(name = "主线")
private Long PID;
public Long getLineID()
{
public Long getLineID() {
return LineID;
}
public void setLineTypeName(String LineTypeName)
{
this.LineTypeName = LineTypeName;
public void setLineID(Long lineID) {
LineID = lineID;
}
public String getLineTypeName()
{
public String getLineTypeName() {
return LineTypeName;
}
public void setLineTypeFlag(String LineTypeFlag)
{
this.LineTypeFlag = LineTypeFlag;
public void setLineTypeName(String lineTypeName) {
LineTypeName = lineTypeName;
}
public String getLineTypeFlag()
{
public String getLineTypeFlag() {
return LineTypeFlag;
}
public void setBarcodeHead(String BarcodeHead)
{
this.BarcodeHead = BarcodeHead;
public void setLineTypeFlag(String lineTypeFlag) {
LineTypeFlag = lineTypeFlag;
}
public String getBarcodeHead()
{
public String getBarcodeHead() {
return BarcodeHead;
}
public void setBarcodeHead(String barcodeHead) {
BarcodeHead = barcodeHead;
}
public Long getPID() {
return PID;
}
public void setPID(Long PID) {
this.PID = PID;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("LineID", getLineID())
.append("LineID", getLineID())
.append("LineTypeName", getLineTypeName())
.append("LineTypeFlag", getLineTypeFlag())
.append("BarcodeHead", getBarcodeHead())
.toString();
}
}

@ -1,5 +1,6 @@
package com.ruoyi.nanjing.mapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -28,6 +29,7 @@ public interface TBdProducttypeMapper
List<QtProduct> selectQtProductList(Map map);
List<QsProduct> selectQsProductList(Map map);
List<QsProduct> selectQ1ProductList(Map map);

@ -1,6 +1,8 @@
package com.ruoyi.nanjing.service;
import java.util.List;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.nanjing.domain.TBdLinetype;
/**
@ -58,4 +60,11 @@ public interface ITBdLinetypeService
* @return
*/
public int deleteTBdLinetypeById(Long LineID);
/**
*
*
* @return
*/
public List<Ztree> selectBaseMonitorInfoTree();
}

@ -40,5 +40,7 @@ public interface ITBdProducttypeService
List<QsStation> selectNodeQs(Map map);
// List<Map<String,Object>> selectReport(Map map);
List<Map<String,Object>> selectReport(Map map);
}

@ -1,6 +1,9 @@
package com.ruoyi.nanjing.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.core.domain.Ztree;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.nanjing.mapper.TBdLinetypeMapper;
@ -91,4 +94,25 @@ public class TBdLinetypeServiceImpl implements ITBdLinetypeService
{
return tBdLinetypeMapper.deleteTBdLinetypeById(LineID);
}
/**
*
*
* @return
*/
@Override
public List<Ztree> selectBaseMonitorInfoTree()
{
List<TBdLinetype> baseMonitorInfoList = tBdLinetypeMapper.selectTBdLinetypeList(new TBdLinetype());
List<Ztree> ztrees = new ArrayList<Ztree>();
for (TBdLinetype baseMonitorInfo : baseMonitorInfoList)
{
Ztree ztree = new Ztree();
ztree.setId(baseMonitorInfo.getLineID().toString());
ztree.setpId(baseMonitorInfo.getPID().toString());
ztree.setName(baseMonitorInfo.getLineTypeName());
ztree.setTitle(baseMonitorInfo.getLineTypeName());
ztrees.add(ztree);
}
return ztrees;
}
}

@ -144,8 +144,8 @@ public class TBdSubstationServiceImpl implements ITBdSubstationService
{
Ztree ztree = new Ztree();
ztree.setId(substation1.getStationID());
ztree.setpId(substation1.getParentId());
ztree.setId(substation1.getStationID().toString());
ztree.setpId(substation1.getParentId().toString());
ztree.setName(substation1.getStationName());
ztree.setTitle(substation1.getStationName());
if (isCheck)

@ -134,8 +134,8 @@ public class SysDeptServiceImpl implements ISysDeptService
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
{
Ztree ztree = new Ztree();
ztree.setId(dept.getDeptId());
ztree.setpId(dept.getParentId());
ztree.setId(dept.getDeptId().toString());
ztree.setpId(dept.getParentId().toString());
ztree.setName(dept.getDeptName());
ztree.setTitle(dept.getDeptName());
if (isCheck)

@ -222,7 +222,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
if (UserConstants.DICT_NORMAL.equals(dict.getStatus()))
{
Ztree ztree = new Ztree();
ztree.setId(dict.getDictId());
ztree.setId(dict.getDictId().toString());
ztree.setName(transDictName(dict));
ztree.setTitle(dict.getDictType());
ztrees.add(ztree);

@ -204,8 +204,8 @@ public class SysMenuServiceImpl implements ISysMenuService
for (SysMenu menu : menuList)
{
Ztree ztree = new Ztree();
ztree.setId(menu.getMenuId());
ztree.setpId(menu.getParentId());
ztree.setId(menu.getMenuId().toString());
ztree.setpId(menu.getParentId().toString());
ztree.setName(transMenuName(menu, permsFlag));
ztree.setTitle(menu.getMenuName());
if (isCheck)

@ -9,10 +9,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="LineTypeName" column="LineTypeName" />
<result property="LineTypeFlag" column="LineTypeFlag" />
<result property="BarcodeHead" column="BarcodeHead" />
<result property="PID" column="PID" />
<result property="parentName" column="parentName" />
</resultMap>
<sql id="selectTBdLinetypeVo">
select LineID, LineTypeName, LineTypeFlag, BarcodeHead from T_BD_LineType
select LineID, LineTypeName, LineTypeFlag, BarcodeHead,PID from T_BD_LineType
</sql>
<select id="selectTBdLinetypeList" parameterType="TBdLinetype" resultMap="TBdLinetypeResult">
@ -21,14 +23,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LineTypeName != null and LineTypeName != ''"> and LineTypeName like ('%' + #{LineTypeName} + '%')</if>
<if test="LineTypeFlag != null and LineTypeFlag != ''"> and LineTypeFlag = #{LineTypeFlag}</if>
</where>
order by LineID desc
order by LineID asc
</select>
<select id="selectTBdLinetypeById" parameterType="Long" resultMap="TBdLinetypeResult">
<include refid="selectTBdLinetypeVo"/>
where LineID = #{LineID}
select t.LineID,t.LineTypeName,t.LineTypeFlag,t.BarcodeHead, p.LineTypeName as parentName,t.pid from dbo.T_BD_LineType t
left join dbo.T_BD_LineType p on p.LineID = t.pid
where t.LineID = #{LineID}
</select>
<insert id="insertTBdLinetype" parameterType="TBdLinetype">
insert into T_BD_LineType
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -36,12 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LineTypeName != null">LineTypeName,</if>
<if test="LineTypeFlag != null">LineTypeFlag,</if>
<if test="BarcodeHead != null">BarcodeHead,</if>
<if test="PID != null">PID,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="LineID != null">#{LineID},</if>
<if test="LineTypeName != null">#{LineTypeName},</if>
<if test="LineTypeFlag != null">#{LineTypeFlag},</if>
<if test="BarcodeHead != null">#{BarcodeHead},</if>
<if test="PID != null">#{PID},</if>
</trim>
</insert>
@ -51,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LineTypeName != null">LineTypeName = #{LineTypeName},</if>
<if test="LineTypeFlag != null">LineTypeFlag = #{LineTypeFlag},</if>
<if test="BarcodeHead != null">BarcodeHead = #{BarcodeHead},</if>
<if test="PID != null">PID = #{PID},</if>
</trim>
where LineID = #{LineID}
</update>

@ -130,8 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
{
call pro_StationQStatistic
(
#{beginTime,mode=IN,jdbcType=DATE},
#{endTime,mode=IN,jdbcType=DATE},
#{begin,mode=IN,jdbcType=DATE},
#{end,mode=IN,jdbcType=DATE},
#{stationType,mode=IN,jdbcType=VARCHAR},
#{stationId,mode=IN,jdbcType=VARCHAR},
#{productId,mode=IN,jdbcType=VARCHAR}
@ -152,14 +152,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectReport" parameterType="map" statementType="CALLABLE" resultType="java.util.LinkedHashMap">
{
call testrow
(
#{begin,mode=IN,jdbcType=DATE},
#{end,mode=IN,jdbcType=DATE},
#{barcode,mode=IN,jdbcType=VARCHAR}
)
}
{
call begin_date5
(
#{begin,mode=IN,jdbcType=DATE},
#{end,mode=IN,jdbcType=DATE},
#{barcode,mode=IN,jdbcType=VARCHAR}
)
}
</select>

Loading…
Cancel
Save