提交源码

master
CaesarBao 11 months ago
parent 42cfd198dd
commit bb7f8e4577

@ -0,0 +1,174 @@
package com.ruoyi.web.controller.nanjing;
import com.ruoyi.common.annotation.Log;
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.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.nanjing.domain.BaseRepairinfoRecord;
import com.ruoyi.nanjing.domain.ProRpList;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITBdProductinfoService;
import com.ruoyi.nanjing.service.ITBdProducttypeService;
import com.ruoyi.nanjing.service.ReworkService;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*
* @author limy
* @date 2021-02-2
*/
@Controller
@RequestMapping("/nanjing/Rework")
public class Rework extends BaseController
{
private String prefix = "nanjing/Rework";
@Autowired
private ITBdProductinfoService tBdProductinfoService;
@Autowired
private ITBdProducttypeService itBdProducttypeService;
@Autowired
private ReworkService reworkService;
@RequiresPermissions("nanjing:ProRpList:view")
@GetMapping()
public String ProRpList(ModelMap map)
{
List<TBdProductinfo> tBdProductinfoList = tBdProductinfoService.selectTBdProductinfoList(new TBdProductinfo());
map.addAttribute("list",tBdProductinfoList);
return prefix + "/Rework";
}
/**
*
*/
@RequiresPermissions("nanjing:ProRpList:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ProRpList proRpList)
{
startPage();
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<ProRpList> list = null;
return getDataTable(list);
}
// @PostMapping("/getData")
// @ResponseBody
// public TableDataInfo getData(ProRpList proRpList)
// {
//// startPage();
// List<ProRpList> list = new ArrayList<ProRpList>();
// List<ProRpList> list2 = new ArrayList<ProRpList>();
// List<ProRpList> list3 = 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","");
// map.put("semiBarcode",proRpList.getSemiBarcode());
// list = itBdProducttypeService.selectProLists(map);
// if (proRpList.getState().equals("0")){
// list2 = list;
// }
// else if (proRpList.getState().equals("1")){
// System.out.println("state===1");
// int j = 0;
//// System.out.println(list.size());
// for (int i=0;i<list.size();i++){
// ProRpList proRpList1 = list.get(i);
// if (proRpList1.getNGStation()!=null){
// list2.add(j,proRpList1);
// j++;
// }
// }
// }
// else if (proRpList.getState().equals("2")){
//// System.out.println("state====2");
// int j=0;
//// System.out.println(list.size());
// for (int i=0;i<list.size();i++){
// ProRpList proRpList1 = list.get(i);
//// System.out.println(proRpList1.getIsDis());
// if (proRpList1.getRestartStation()!=null){
// list2.add(j,proRpList1);
// j++;
// }
// }
// }
// else if (proRpList.getState().equals("3")){
// int j = 0;
// for (int i=0;i<list.size();i++){
// ProRpList proRpList1 = list.get(i);
// if (proRpList1.getIsDis().equals("Y")){
// list2.add(j,proRpList1);
// j++;
// }
// }
// }
// else {
// System.out.println(proRpList.getState());
// System.out.println("?????????????????????????????????????");
// }
// return getDataTable(list2);
// }
/**
*
*/
@RequiresPermissions("nanjing:ProRpList:export")
@Log(title = "时段统计", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ProRpList proRpList)
{
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<ProRpList> list = itBdProducttypeService.selectProLists(map);
ExcelUtil<ProRpList> util = new ExcelUtil<ProRpList>(ProRpList.class);
return util.exportExcel(list, "ProRpList");
}
/**
*
* */
@PostMapping("/selectRework")
@ResponseBody
public TableDataInfo selectRework(ProRpList proRpList){
startPage();
List<BaseRepairinfoRecord> list = new ArrayList<>();
list = reworkService.selectRework(proRpList.getBeginTime(),proRpList.getEndTime());
return getDataTable(list);
}
}

@ -0,0 +1,117 @@
package com.ruoyi.web.controller.nanjing;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.nanjing.domain.QSAnalysis;
import com.ruoyi.nanjing.domain.QsStation;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITBdProductinfoService;
import com.ruoyi.nanjing.service.ITBdProducttypeService;
import com.ruoyi.nanjing.service.ITBdSubstationService;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Stream;
@Controller
@RequestMapping("/nanjing/StatisticAnalysis")
public class StatisticAnalysisProductController extends BaseController {
private String prefix = "nanjing/Statistic";
@Autowired
private ITBdSubstationService substationService;
@Autowired
private ITBdProducttypeService producttypeService;
@Autowired
private ITBdProductinfoService productinfoService;
@RequiresPermissions("nanjing:StatisticAnalysis:view")
@GetMapping()
public String stationProduct(ModelMap map)
{
List<TBdProductinfo> tBdProductinfoList = productinfoService.selectTBdProductinfoList(new TBdProductinfo());
map.addAttribute("list",tBdProductinfoList);
return prefix + "/StatisticAnalysis";
}
@RequiresPermissions("nanjing:StatisticAnalysis:list")
@PostMapping("/list")
@ResponseBody
public List<QsStation> list(QsStation qsStation)
{
List<QsStation> qsProducts = producttypeService.selectStationQs(qsStation);
return qsProducts;
}
@PostMapping("/listAll")
@ResponseBody
public List<QsStation> listAll(String begin,String end)
{
Map map = new HashMap<String,Object>();
map.put("begin",begin);
map.put("end",end);
map.put("productId","");
map.put("productType","");
List<QsStation> qsStations = producttypeService.selectAllQs(map);
return qsStations;
}
/**
*
*
* @param start
* @param end
* @return
* @throws Exception
*/
public static List<String> getBetweenDate(String start, String end) {
List<String> list = new ArrayList<>();
LocalDate startDate = LocalDate.parse(start);
LocalDate endDate = LocalDate.parse(end);
long distance = ChronoUnit.DAYS.between(startDate, endDate);
if (distance < 1) {
return list;
}
Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString()));
return list;
}
@PostMapping("/nodeClick")
@ResponseBody
public AjaxResult nodeClick(String begin, String end, String node, String productid)
{
Map map = new HashMap<String,Object>();
List<String> days = getBetweenDate(begin,end);
List<QSAnalysis> QSAnalysisList = new ArrayList<>();
for (int i = 0; i < days.size(); i++) {
map.put("begin", days.get(i) +" 00:00:00");
map.put("end",days.get(i)+" 23:59:59");
map.put("stationId",node);
map.put("stationType",1);
List<QsStation> qsStations = producttypeService.selectNodeQs(map);
QSAnalysis QSAnalysis = new QSAnalysis();
QSAnalysis.setDate(days.get(i));
QSAnalysis.setAllRate(Float.parseFloat(qsStations.get(0).getAllRate().replace("%","")));
QSAnalysisList.add(QSAnalysis);
}
// map.put("begin",begin);
// map.put("end",end);
// map.put("stationId",node);
// map.put("stationType",1);
// List<QsStation> qsStations = producttypeService.selectNodeQs(map);
// QsStation qsStation = qsStations.get(0);
// qsStation.setStationCode(substationService.selectSubNameCode(node));
// qsStation.setStationName(substationService.selectSubName(node));
return AjaxResult.success(QSAnalysisList);
}
}

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('返修信息查询')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li class="select-time">
<label class="is-required">时间区间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime" required/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" required/>
</li>
<li>
<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>-->
<!-- <a class="btn btn-info btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:ProRpList:export"><i class="fa fa-download"></i> 导出</a>-->
</li>
</ul>
</div>
</form>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-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 prefix = ctx + "nanjing/Rework";
$(function() {
var options = {
url: prefix + "/selectRework",
exportUrl: prefix + "/export",
modalName: "BaseRepairinfoRecord",
pagination:true,
showExport: true,//工具栏上显示导出按钮
exportOptions: {
ignoreColumn: false //忽略第一列和最后一列
},
pageSize:10,
columns: [
{
checkbox: true
},
{
field:'id',
title:'id'
},
// {
// field: 'barcode',
// title: '系统条码'
// },
{
field: 'productBarcode',
title: '机种码'
},
// {
// field: 'semiBarcode',
// title: '产品条码'
// },
{
field: 'reStartStation',
title: '重启工位',
formatter:function (value, row, index){
if (value==1){
return "S100电机壳压销";
}
else if(value==2){
return "S110电机壳压销2";
}else if(value==3){
return "S110定子放入电机机壳后上线";
}else if(value==4){
return "10轴承压入电机壳底部";
}else if(value==5){
return "S200前盖轴承轴封挡圈压入";
}else if(value==6){
return "S210前盖压销";
}else if(value==7){
return "S220曲轴压入转子";
}else if(value==8){
return "S230曲轴组件和前盖轴承装配";
}else if(value==9){
return "S240转子充磁";
}else if(value==10){
return "20前盖组件放入电池壳";
}else if(value==11){
return "S300静盘正反面压销";
}else if(value==12){
return "S320动静盘组件高度测量";
}else if(value==13){
return "30动静盘组件安装";
}else if(value==14){
return "40机盘背面和机壳端面高度测量";
}else if(value==15){
return "50后盖安装和螺栓预拧";
}else if(value==16){
return "60后盖螺栓紧固";
}else if(value==17){
return "70后盖螺栓测量";
}else if(value==18){
return "100玻璃接线柱高度测量";
}else if(value==19){
return "110玻璃接线柱螺栓紧固";
}else if(value==20){
return "120裸机绝缘耐压检测";
}else if(value==21){
return "130法兰安装、抽真空、充氦气";
}else if(value==22){
return "140氦气检漏";
}else if(value==23){
return "150氦气回收";
}else if(value==24){
return "160导热硅脂喷涂";
}else if(value==25){
return "180控制器螺栓紧固";
}else if(value==26){
return "190控制器检漏";
}else if(value==27){
return "200整机翻转";
}else if(value==28){
return "210整机称重、注油";
}else if(value==29){
return "220整机绝缘测试和法兰安装";
}else if(value==30){
return "230_1性能测试高速";
}else if(value==31){
return "230_2性能测试低速";
}else if(value==32){
return "250整机补油";
}else if(value==33){
return "260密封塞安装、抽真空充氦气";
}else if(value==34){
return "270铭牌打印";
}else if(value==35){
return "S300静盘正反面压销-2";
}else if(value==36){
return "S110定子放入电机壳加热";
}
}
},
// {
// field: 'currentStation',
// title: '当前工位'
// },
{
field: 'recordTime',
title: '返修时间'
},
// {
// field: 'restartStation',
// title: '重启工位'
// },
// {
// field: 'finishFlag',
// title: '完成标志'
// },
// {
// field: 'namePlateInfo',
// title: '标签Y/N'
// },
// {
// field: 'isDis',
// title: '返修Y/N'
// },
// {
// field: 'beginTime',
// title: '开始时间'
// },
// {
// field: 'endTime',
// title: '结束时间'
// },
]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,290 @@
<!DOCTYPE html>
<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 :: layout-latest-css" />
<th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
<div class="ui-layout-west">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 工位名称
</div>
<div class="box-tools pull-right">
<!-- <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="工位信息"><i class="fa fa-edit"></i></a>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新工位"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<input type="hidden" id="stationId" name="stationId">
<input type="hidden" id="parentId" name="parentId">
<div class="select-list">
<ul>
<li class="select-time">
<label>时间区间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime" required/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" required/>
</li>
<!-- <li>-->
<!-- <label>机种类型:</label>-->
<!-- <select name="productId" id="product">-->
<!-- <option value="ALL">所有</option>-->
<!-- <option th:each="ls:${list}" th:value="${ls.productID}" th:text="${ls.productName}"></option>-->
<!-- </select>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="searchAll()"><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>-->
<!-- <a class="btn btn-info btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:QsProduct:export"><i class="fa fa-download"></i> 导出</a>-->
</li>
</ul>
</div>
</form>
</div>
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-table"></table>-->
<!-- </div>-->
<div class="col-sm-12 select-table table-striped" style="height: 700px">
<div id="voltage" style="width: 100%;height:50%;"></div>
<!-- <div id="electricity" style="width: 100%;height:50%;"></div>-->
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/StatisticAnalysis";
var timedata=[];
var IAdata=[];
$(function() {
var panehHidden = false;
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({ initClosed: panehHidden, west__size: 185 });
queryDeptTree();
});
function searchAll(){
// console.log("点击查询按钮事件执行...");
var url = ctx + "nanjing/StatisticAnalysis/nodeClick";
// queryList(url);
$('#bootstrap-table').bootstrapTable('destroy');
$('#bootstrap-table').bootstrapTable({
method:"post",
url: url,
pagination: true,
search: true,
contentType : "application/x-www-form-urlencoded",
queryParams: {
begin:$('#startTime').val(),
end:$('#endTime').val(),
node:$('#stationId').val(),
productid:$('#product').val()
},
modalName: "工位合格率统计",
columns: [
{
field: 'stationCode',
title: '工位代码'
},
{
field: 'stationName',
title: '工位名称'
},
{
field: 'inputNum',
title: '总数量'
},
{
field: 'okNum',
title: '合格数量'
},
{
field:'ero',
title:'异常数量'
},
{
field: 'allRate',
title: '合格率',
}
]
})
}
function getdata(id) {
$('#voltage').bootstrapTable('destroy');
var formData = new FormData();
formData.append("node",id);
formData.append("begin",$('#startTime').val());
formData.append("end",$('#endTime').val());
$.ajax({
url: prefix + "/nodeClick",
type: 'post',
cache: false,
data: formData,
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
console.log(result);
result.data.forEach(function(e){
console.log(e.fluxData);
timedata.push(e.date);
IAdata.push(e.allRate);
});
design();
}
});
}
function queryDeptTree()
{
//console.log("1111加载树执行。。。。。。");
var url = ctx + "nanjing/SubStation/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
//console.log("1111点击节点工位ID"+treeNode.id);
$("#stationId").val(treeNode.id);
$("#parentId").val(treeNode.pId);
getdata(treeNode.id);
}
}
function design() {
//电压
var voltageChart = echarts.init(document.getElementById("voltage"));
//电压图表
var voltageOption = {
toolbox: {
show : true,
feature : {
mark : {show: true},
restore : {show: true},
saveAsImage : {show: true}
}
},
title : {
text: '合格率曲线分析'
},
tooltip : {
trigger: 'axis'
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, {
start: 0,
end: 10,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
color:['#f52200','#1f9e08','#095bf1'],
legend: {
data:['工位合格率']
},
grid:{
x:40,
x2:40,
y2:24
},
calculable : true,
xAxis : [
{
type : 'category',
boundaryGap : false,
data : timedata
}
],
yAxis : [
{
type : 'value',
axisLabel : {
formatter: '{value}%'
}
}
],
series : [
{
name:'合格率',
type:'line',
data:IAdata,
lineStyle:{
color:'#f52200'
}
},
]
};
voltageChart.clear();
voltageChart.setOption(voltageOption,true);
$(window).resize(voltageChart.resize);
timedata.splice(0,timedata.length);
IAdata.splice(0,IAdata.length);
}
/* 工位信息 */
function dept() {
var url = ctx + "nanjing/SubStation/list";
$.modal.openTab("工位信息", url);
}
$('#btnExpand').click(function() {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function() {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function() {
queryDeptTree();
});
</script>
</body>
</html>

@ -0,0 +1,25 @@
package com.ruoyi.nanjing.domain;
import com.ruoyi.common.core.domain.BaseEntity;
public class QSAnalysis extends BaseEntity {
private static final long serialVersionUID = 1L;
private String date;
private float allRate;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public float getAllRate() {
return allRate;
}
public void setAllRate(float allRate) {
this.allRate = allRate;
}
}

BIN
test

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save