修改时段统计查询界面

master
CaesarBao 3 weeks ago
parent 503263875f
commit 8b093cdd65

@ -0,0 +1,132 @@
package com.ruoyi.web.controller.nanjing;
import java.util.List;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITBdProductinfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.nanjing.domain.BaseBarcodePrintinfo;
import com.ruoyi.nanjing.service.IBaseBarcodePrintinfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2024-05-24
*/
@Controller
@RequestMapping("/nanjing/PrintInfo")
public class BaseBarcodePrintinfoController extends BaseController
{
private String prefix = "nanjing/PrintInfo";
@Autowired
private ITBdProductinfoService tBdProductinfoService;
@Autowired
private IBaseBarcodePrintinfoService baseBarcodePrintinfoService;
@RequiresPermissions("nanjing:PrintInfo:view")
@GetMapping()
public String PrintInfo(ModelMap map)
{
List<TBdProductinfo> tBdProductinfoList = tBdProductinfoService.selectTBdProductinfoList(new TBdProductinfo());
map.addAttribute("list",tBdProductinfoList);
return prefix + "/PrintInfo";
}
/**
*
*/
@RequiresPermissions("nanjing:PrintInfo:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseBarcodePrintinfo baseBarcodePrintinfo)
{
startPage();
List<BaseBarcodePrintinfo> list = baseBarcodePrintinfoService.selectBaseBarcodePrintinfoList(baseBarcodePrintinfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("nanjing:PrintInfo:export")
@Log(title = "条码打印记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseBarcodePrintinfo baseBarcodePrintinfo)
{
List<BaseBarcodePrintinfo> list = baseBarcodePrintinfoService.selectBaseBarcodePrintinfoList(baseBarcodePrintinfo);
ExcelUtil<BaseBarcodePrintinfo> util = new ExcelUtil<BaseBarcodePrintinfo>(BaseBarcodePrintinfo.class);
return util.exportExcel(list, "PrintInfo");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("nanjing:PrintInfo:add")
@Log(title = "条码打印记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseBarcodePrintinfo baseBarcodePrintinfo)
{
return toAjax(baseBarcodePrintinfoService.insertBaseBarcodePrintinfo(baseBarcodePrintinfo));
}
/**
*
*/
@GetMapping("/edit/{ID}")
public String edit(@PathVariable("ID") String ID, ModelMap mmap)
{
BaseBarcodePrintinfo baseBarcodePrintinfo = baseBarcodePrintinfoService.selectBaseBarcodePrintinfoById(ID);
mmap.put("baseBarcodePrintinfo", baseBarcodePrintinfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("nanjing:PrintInfo:edit")
@Log(title = "条码打印记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseBarcodePrintinfo baseBarcodePrintinfo)
{
return toAjax(baseBarcodePrintinfoService.updateBaseBarcodePrintinfo(baseBarcodePrintinfo));
}
/**
*
*/
@RequiresPermissions("nanjing:PrintInfo:remove")
@Log(title = "条码打印记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(baseBarcodePrintinfoService.deleteBaseBarcodePrintinfoByIds(ids));
}
}

@ -38,6 +38,7 @@ public class SelectParaAllController extends BaseController {
{
return prefix + "/ParaAllShow";
}
@PostMapping("/paraAllShow")
@ResponseBody
public TableDataInfo list(HttpServletRequest request)
@ -55,6 +56,7 @@ public class SelectParaAllController extends BaseController {
}
// @RequiresPermissions("nanjing:ParaAllShow:export")
// @Log(title = "产品码查询", businessType = BusinessType.EXPORT)
// @PostMapping("/export")

@ -6,6 +6,7 @@ import com.ruoyi.common.core.text.Convert;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.nanjing.domain.ProRpList;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.domain.TSyTracestate;
import com.ruoyi.nanjing.service.ITBdProductinfoService;
import com.ruoyi.nanjing.service.ITBdProducttypeService;
import com.ruoyi.nanjing.service.ITSyTracestateService;
@ -45,7 +46,8 @@ public class SelectProRpListController extends BaseController
private ITBdProductinfoService tBdProductinfoService;
@Autowired
private ITBdProducttypeService itBdProducttypeService;
@Autowired
private ITSyTracestateService tracestateService;
@RequiresPermissions("nanjing:ProRpList:view")
@GetMapping()
public String ProRpList(ModelMap map)
@ -77,22 +79,23 @@ public class SelectProRpListController extends BaseController
@PostMapping("/getData")
@ResponseBody
public TableDataInfo getData(ProRpList proRpList)
public TableDataInfo getDataList(TSyTracestate TSyTracestate)
{
// startPage();
List<ProRpList> list = new ArrayList<ProRpList>();
if(proRpList.getBeginTime()==null||proRpList.getEndTime()==null)
{
return getDataTable(list);
}
Map map = new HashMap<String,Object>();
map.put("beginTime",proRpList.getBeginTime());
map.put("endTime",proRpList.getEndTime());
map.put("productId",proRpList.getProductID());
map.put("productType",proRpList.getProductType());
map.put("state",proRpList.getState());
map.put("semiBarcode",proRpList.getSemiBarcode());
list = itBdProducttypeService.selectProLists(map);
startPage();
List<TSyTracestate> list = tracestateService.selectTSyTracestateList(TSyTracestate);
return getDataTable(list);
}
@PostMapping("/selectAllPara")
@ResponseBody
public TableDataInfo selectAllPara(String semiBarcode)
{
startPage();
Map<String, Object> map = new HashMap<String,Object>();
map.put("beginTime",null);
map.put("endTime",null);
map.put("semiBarcode",semiBarcode);
List<List<HashMap<String,String>>> list = tracestateService.selectAllPara(map);
return getDataTable(list);
}
/**

@ -72,7 +72,7 @@ public class TBdSubstationController extends BaseController
@GetMapping("/shangyi")
@ResponseBody
public String shang(Integer value){
System.out.println(value);
//System.out.println(value);
return tBdSubstationService.selectshang(value);
}

@ -5,14 +5,14 @@ spring:
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
druid:
# 主库数据源
master:
url: jdbc:sqlserver://192.168.1.120:1433;SelectMethod=cursor;DatabaseName=ATJ_581_DB
username: sa
password: 123456
# master:
# url: jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=ATJ_581_DB
# url: jdbc:sqlserver://192.168.1.120:1433;SelectMethod=cursor;DatabaseName=ATJ_581_DB
# username: sa
# password: 123456
master:
url: jdbc:sqlserver://119.45.202.115:1433;SelectMethod=cursor;DatabaseName=ATJ_581_DB
username: sa
password: haiwei@123
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -44,8 +44,8 @@
<form id="signupForm" autocomplete="off">
<h4 class="no-margins">用户登录:</h4>
<!-- <p class="m-t-md">你若不离不弃,我必生死相依</p>-->
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="ATJ_U" />
<input type="password" name="password" class="form-control pword" placeholder="密码" value="123456" />
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin" />
<input type="password" name="password" class="form-control pword" placeholder="密码" value="admin123" />
<div class="row m-t" th:if="${captchaEnabled==true}">
<div class="col-xs-6">
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" />

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('时段统计查询')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -12,13 +13,13 @@
<ul>
<li class="select-time">
<label class="is-required">时间区间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime" required/>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[startTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" required/>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<label class="required">产品码:</label>
<input type="text" name="semiBarcode" id="semiBarcode" required/>
<input type="text" name="productBarcode" id="productBarcode" required/>
</li>
<li>
<label>机种信息:</label>
@ -34,13 +35,13 @@
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>类型:</label>
<select name="productType" th:with="type=${@dict.getType('productType')}">
<option value="">全部</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<!-- <li>-->
<!-- <label>类型:</label>-->
<!-- <select name="productType" th:with="type=${@dict.getType('productType')}">-->
<!-- <option value="">全部</option>-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>产品码:</label>-->
<!-- <input type="text" name="semiBarcode"/>-->
@ -56,10 +57,24 @@
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<div class="tabs-container" style="padding-top: 100px">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 工位数据</a>
</li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane active">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table1"></table>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-export-js" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/selectProRpList";
@ -68,15 +83,16 @@
url: prefix + "/getData",
exportUrl: prefix + "/export",
modalName: "ProRpList",
pagination:false,
//pagination:false,是否分页
showExport: true,//工具栏上显示导出按钮
exportOptions: {
ignoreColumn: false //忽略第一列和最后一列
},
pageSize:100,
onClickRow: onClickRow,
//pageSize:100,
columns: [
{
field: 'barcode',
field: 'productBarcode',
title: '系统条码'
},
{
@ -84,15 +100,15 @@
title: '机种名称'
},
{
field: 'semiBarcode_A',
field: 'semibarcodeA',
title: '前盖条码'
},
{
field: 'semiBarcode_B',
field: 'semibarcodeB',
title: '静盘条码'
},
{
field: 'semiBarcode_C',
field: 'semibarcodeC',
title: '后盖条码'
},
{
@ -104,21 +120,17 @@
title: '状态'
},
{
field: 'currentStation',
field: 'currentStationID',
title: '当前工位'
},
{
field: 'NGStation',
field: 'nGStationID',
title: 'NG工位'
},
{
field: 'finishFlag',
title: '完成标志'
},
{
field: 'namePlateInfo',
title: '标签Y/N'
},
{
field: 'isDis',
title: '返修Y/N'
@ -135,6 +147,66 @@
};
$.table.init(options);
});
function onClickRow(row, $element){
initTable(row.productBarcode);
}
function initTable(semiBarcode){
//先销毁表格,必须先销毁才能实现动态加载数据
$('#bootstrap-table1').bootstrapTable('destroy');
$.ajax({
type: "post",
url: prefix + "/selectAllPara?semiBarcode=" + semiBarcode,
//data: formData,
// contentType: "application/json;charset=utf-8",
dataType: "json",
json: 'callback',
// processData: false,
contentType: false,
modalName: "产品码查询",
success: function (json) {
var columnsArray2 = [];
columnsArray2.push({field : "semiBarcode",title : "产品码",colspan: 1,rowspan: 1});
columnsArray2.push({field : "部件码",title : "部件码",colspan: 1,rowspan: 1});
columnsArray2.push({field : "工位代码",title : "工位代码",colspan: 1,rowspan: 1});
columnsArray2.push({field : "工位名称",title : "工位名称",colspan: 1,rowspan: 1});
columnsArray2.push({field : "记录时间",title : "记录时间",colspan: 1,rowspan: 1});
columnsArray2.push({field : "参数名称",title : "参数名称",colspan: 1,rowspan: 1});
columnsArray2.push({field : "实测值",title : "实测值",colspan: 1,rowspan: 1});
columnsArray2.push({field : "最小值",title : "最小值",colspan: 1,rowspan: 1});
columnsArray2.push({field : "最大值",title : "最大值",colspan: 1,rowspan: 1});
columnsArray2.push({field : "参数状态",title : "参数状态",colspan: 1,rowspan: 1});
$('#bootstrap-table1').bootstrapTable('destroy').bootstrapTable({
id: "bootstrap-table1",
data:json.rows[0],
toolbar: "#toolbar",
singleSelect: false,
clickToSelect: true,
sortName: "insertTime",
sortOrder: "desc",
pageSize: 10,
pageNumber: 1,
pageList: "[10, 15,25, 50, All]",
showToggle: false,
showRefresh: false,
showExport:true,
showColumns: false,
search: false,
pagination: true,
exportOptions: {
ignoreColumn: false //忽略第一列和最后一列
},
// exportDataType: 'all',
columns: columnsArray2
});
$.modal.closeLoading();
},
error: function () {
alert("查询失败!");
}
});
}
</script>
</body>
</html>

@ -167,7 +167,7 @@
}]
};
$.table.init(options);
console.log(options)
//console.log(options)
});

@ -20,6 +20,8 @@ public class TSyTracestate extends BaseEntity
@Excel(name = "null")
private String barcode;
private String productName;
/** 产品ID */
@Excel(name = "产品ID")
private String productID;
@ -125,6 +127,15 @@ public class TSyTracestate extends BaseEntity
{
return barcode;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setProductID(String productID)
{
this.productID = productID;

@ -96,9 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
}
</select>
<!-- <select id="selectProLists" parameterType="map" resultMap="ProRpList">-->
<!-- select * from-->
<!-- </select>-->
<select id="selectQtProductList" parameterType="map" statementType="CALLABLE" resultMap="qtProduct">
{
call pro_StatisticOfProductQty

@ -15,7 +15,7 @@
<result property="semibarcodeA" column="SemiBarcode_A" />
<result property="semibarcodeB" column="SemiBarcode_B" />
<result property="semibarcodeC" column="SemiBarcode_C" />
<result property="productBarcode" column="ProductBarcode" />
<result property="productBarcode" column="productBarcode" />
<result property="semiBarcode2" column="SemiBarcode2" />
<result property="shellbarcode" column="shellbarcode" />
<result property="nameplateInfo" column="NameplateInfo" />
@ -26,10 +26,12 @@
<result property="disChecker" column="DisChecker" />
<result property="disTime" column="DisTime" />
<result property="state" column="State" />
<result property="currentStationID" column="CurrentStationID" />
<result property="nGStationID" column="NGStationID" />
<result property="currentStationID" column="currentStationID" />
<result property="nGStationID" column="nGStationID" />
<result property="finishFlag" column="FinishFlag" />
<result property="d9Remark" column="D9Remark" />
<result property="productName" column="productName" />
</resultMap>
<!-- <resultMap id="paraAll" type="com.ruoyi.nanjing.domain.ParaAllShow">-->
@ -85,7 +87,18 @@
<sql id="selectTSyTracestateVo">
select Barcode, ProductID, BeginTime, EndTime, ShiftID, GroupID, ShiftNo, SemiBarcode_A, SemiBarcode_B, SemiBarcode_C, ProductBarcode, SemiBarcode2, shellbarcode, NameplateInfo, MarkRecord, Attr1, Attr2, ISDis, DisChecker, DisTime, State, CurrentStationID, NGStationID, FinishFlag, D9Remark from T_SY_TraceState
</sql>
<sql id="selectTSyTracestateVo1">
select t1.productBarcode,
t2.ProductName,t1.SemiBarcode_A,t1.SemiBarcode_B,t1.SemiBarcode_C,t1.SemiBarcode2,case t1.isDis when 1 then ' Y' else 'N' end as isDis,
case t1.State when 1 then '合格' when 2 then '不合格' else '异常' end as state,
case t1.FinishFlag when 1 then '完成' else '未完成' end as FinishFlag,t3.StationName as currentStationID,
t4.StationName as nGStationID,
begintime ,Endtime
from T_SY_TraceState t1 left join T_BD_ProductInfo t2 on t1.ProductID=t2.ProductID
left join T_BD_SubStation t3 on t1.CurrentStationID=t3.StationID
left join T_BD_SubStation t4 on t1.NGStationID=t4.StationID
</sql>
<select id="getInfo" resultMap="col1">
select t1.Barcode as 系统条码,t5.ProductBarcode as 产品码,
t2.ProductName as 机种类型,case t1.isDis when 1 then ' Y' else 'N' end as '返修Y/N' ,
@ -100,8 +113,19 @@
where t5.ProductBarcode=#{semiCode,jdbcType = VARCHAR}
</select>
<select id="selectTSyTracestateList" parameterType="TSyTracestate" resultMap="TSyTracestateResult">
<include refid="selectTSyTracestateVo"/>
<include refid="selectTSyTracestateVo1"/>
<where>
<if test="productBarcode != null and productBarcode != '' "> and t1.ProductBarcode = #{productBarcode}</if>
<if test="productID != null and productID != '' "> and t1.productID = #{productID}</if>
<if test="state != null and state != ''"> and t1.State = #{state}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and datediff(dd,#{params.beginTime},t1.beginTime)>= 0
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and datediff(dd,t1.beginTime,#{params.endTime})>= 0
</if>
</where>
</select>

Loading…
Cancel
Save