Compare commits

...

2 Commits

Author SHA1 Message Date
暴炳林 ceea1c72ea no message 2025-03-05 16:29:43 +08:00
暴炳林 c568abe996 no message 2025-02-20 15:41:40 +08:00
8 changed files with 648 additions and 273 deletions

View File

@ -16,15 +16,14 @@
<el-button type="success" @click="rest"></el-button>&nbsp;&nbsp;
</el-form>
</div>
<div class="table-title">命中率</div>
<el-table
v-loading="this.tableloding"
:data="rqMzList"
id="educe-table1"
id="educe-table0"
ref="tableData"
border
style="width: 100%;">
<el-table-column prop="workstation" label="工作站" width="180"></el-table-column>
<el-table-column prop="workstation" label="工作站/命中率" width="180"></el-table-column>
<el-table-column prop="g201.mz" label="201" width="50"></el-table-column>
<el-table-column prop="g202.mz" label="202" width="50"></el-table-column>
<el-table-column prop="g203.mz" label="203" width="50"></el-table-column>
@ -42,15 +41,64 @@
<el-table-column prop="g215.mz" label="215" width="50"></el-table-column>
<el-table-column prop="total.mz" label="平均值" width="60"></el-table-column>
</el-table>
<div class="table-title">箱子流通数</div>
<el-table
v-loading="this.tableloding"
:data="rqLtList"
:data="rqMzList"
id="educe-table1"
ref="tableData"
border
style="width: 100%;">
<el-table-column prop="workstation" label="工作站/任务行数" width="180"></el-table-column>
<el-table-column prop="g201.taskCount" label="201" width="50"></el-table-column>
<el-table-column prop="g202.taskCount" label="202" width="50"></el-table-column>
<el-table-column prop="g203.taskCount" label="203" width="50"></el-table-column>
<el-table-column prop="g204.taskCount" label="204" width="50"></el-table-column>
<el-table-column prop="g205.taskCount" label="205" width="50"></el-table-column>
<el-table-column prop="g206.taskCount" label="206" width="50"></el-table-column>
<el-table-column prop="g207.taskCount" label="207" width="50"></el-table-column>
<el-table-column prop="g208.taskCount" label="208" width="50"></el-table-column>
<el-table-column prop="g209.taskCount" label="209" width="50"></el-table-column>
<el-table-column prop="g210.taskCount" label="210" width="50"></el-table-column>
<el-table-column prop="g211.taskCount" label="211" width="50"></el-table-column>
<el-table-column prop="g212.taskCount" label="212" width="50"></el-table-column>
<el-table-column prop="g213.taskCount" label="213" width="50"></el-table-column>
<el-table-column prop="g214.taskCount" label="214" width="50"></el-table-column>
<el-table-column prop="g215.taskCount" label="215" width="50"></el-table-column>
<el-table-column prop="total.taskCount" label="汇总" width="60"></el-table-column>
</el-table>
<el-table
v-loading="this.tableloding"
:data="rqMzList"
id="educe-table2"
ref="tableData"
border
style="width: 100%;">
<el-table-column prop="workstation" label="工作站" width="180"></el-table-column>
<el-table-column prop="workstation" label="工作站/容器流通次数" width="180"></el-table-column>
<el-table-column prop="g201.lxCount" label="201" width="50"></el-table-column>
<el-table-column prop="g202.lxCount" label="202" width="50"></el-table-column>
<el-table-column prop="g203.lxCount" label="203" width="50"></el-table-column>
<el-table-column prop="g204.lxCount" label="204" width="50"></el-table-column>
<el-table-column prop="g205.lxCount" label="205" width="50"></el-table-column>
<el-table-column prop="g206.lxCount" label="206" width="50"></el-table-column>
<el-table-column prop="g207.lxCount" label="207" width="50"></el-table-column>
<el-table-column prop="g208.lxCount" label="208" width="50"></el-table-column>
<el-table-column prop="g209.lxCount" label="209" width="50"></el-table-column>
<el-table-column prop="g210.lxCount" label="210" width="50"></el-table-column>
<el-table-column prop="g211.lxCount" label="211" width="50"></el-table-column>
<el-table-column prop="g212.lxCount" label="212" width="50"></el-table-column>
<el-table-column prop="g213.lxCount" label="213" width="50"></el-table-column>
<el-table-column prop="g214.lxCount" label="214" width="50"></el-table-column>
<el-table-column prop="g215.lxCount" label="215" width="50"></el-table-column>
<el-table-column prop="total.lxCount" label="汇总" width="60"></el-table-column>
</el-table>
<el-table
v-loading="this.tableloding"
:data="rqLtList"
id="educe-table3"
ref="tableData"
border
style="width: 100%;">
<el-table-column prop="workstation" label="工作站/子任务总数" width="180"></el-table-column>
<el-table-column prop="g201" label="201" width="50"></el-table-column>
<el-table-column prop="g202" label="202" width="50"></el-table-column>
<el-table-column prop="g203" label="203" width="50"></el-table-column>
@ -67,20 +115,211 @@
<el-table-column prop="g214" label="214" width="50"></el-table-column>
<el-table-column prop="g215" label="215" width="50"></el-table-column>
<el-table-column prop="total" label="汇总" width="60"></el-table-column>
<el-table-column prop="lxCount" label="容器数" width="60"></el-table-column>
</el-table>
<div class="table-title" v-if="true">
<div class="table-title" v-if="true">
<el-table
v-loading="this.tableloding"
:height="150"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
id="educe-table4"
ref="tableData"
show-summary
style="width: 100%;">
<el-table-column
fixed
label="容器/现有逻辑"
v-if="true"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.rqh }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="201"
prop="g201"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g201 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="202"
v-if="true"
prop="g202"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g202 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="203"
prop="g203"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g203 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="204"
prop="g204"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g204 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="205"
prop="g205"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g205 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="206"
v-if="true"
prop="g206"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g206 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="207"
prop="g207"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g207 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="208"
prop="g208"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g208 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="209"
prop="g209"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g209 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="210"
prop="g210"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g210 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="211"
prop="g211"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g211 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="212"
prop="g212"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g212 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="213"
prop="g213"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g213 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="214"
prop="g214"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g214 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="215"
prop="g215"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g215 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="汇总"
v-if="true"
prop="count"
width="80">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.count }}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[ 50, 100, 200,500]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<el-table
v-loading="this.tableloding"
:height="MaxHeight"
:height="150"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
id="educe-table3"
ref="tableData"
border
:data="tableData1"
id="educe-table5"
ref="tableData1"
show-summary
style="width: 100%;">
<el-table-column
fixed
label="容器"
label="容器/新逻辑"
v-if="true"
width="180">
<template slot-scope="scope">
@ -90,6 +329,7 @@
<el-table-column
fixed
label="201"
prop="g201"
v-if="true"
width="50">
<template slot-scope="scope">
@ -100,6 +340,7 @@
fixed
label="202"
v-if="true"
prop="g202"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g202 }}</span>
@ -108,6 +349,7 @@
<el-table-column
fixed
label="203"
prop="g203"
v-if="true"
width="50">
<template slot-scope="scope">
@ -117,6 +359,7 @@
<el-table-column
fixed
label="204"
prop="g204"
v-if="true"
width="50">
<template slot-scope="scope">
@ -126,6 +369,7 @@
<el-table-column
fixed
label="205"
prop="g205"
v-if="true"
width="50">
<template slot-scope="scope">
@ -136,6 +380,7 @@
fixed
label="206"
v-if="true"
prop="g206"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g206 }}</span>
@ -144,6 +389,7 @@
<el-table-column
fixed
label="207"
prop="g207"
v-if="true"
width="50">
<template slot-scope="scope">
@ -153,6 +399,7 @@
<el-table-column
fixed
label="208"
prop="g208"
v-if="true"
width="50">
<template slot-scope="scope">
@ -162,6 +409,7 @@
<el-table-column
fixed
label="209"
prop="g209"
v-if="true"
width="50">
<template slot-scope="scope">
@ -171,6 +419,7 @@
<el-table-column
fixed
label="210"
prop="g210"
v-if="true"
width="50">
<template slot-scope="scope">
@ -180,6 +429,7 @@
<el-table-column
fixed
label="211"
prop="g211"
v-if="true"
width="50">
<template slot-scope="scope">
@ -189,6 +439,7 @@
<el-table-column
fixed
label="212"
prop="g212"
v-if="true"
width="50">
<template slot-scope="scope">
@ -198,6 +449,7 @@
<el-table-column
fixed
label="213"
prop="g213"
v-if="true"
width="50">
<template slot-scope="scope">
@ -207,6 +459,7 @@
<el-table-column
fixed
label="214"
prop="g214"
v-if="true"
width="50">
<template slot-scope="scope">
@ -216,12 +469,23 @@
<el-table-column
fixed
label="215"
prop="g215"
v-if="true"
width="50">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.g215 }}</span>
</template>
</el-table-column>
<el-table-column
fixed
label="汇总"
v-if="true"
prop="count"
width="80">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.count }}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@ -232,7 +496,6 @@
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</div>
</template>
@ -276,6 +539,7 @@ export default {
tableloding: false,
isShow:false,//
tableData: [],
tableData1: [],
pageSize: 50,
spanArr: [], //
pos: 0, //
@ -354,40 +618,15 @@ export default {
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
console.log('rqList:', res.data.rqList);
console.log('rqeList:', res.data.rqeList);
this.tableData = res.data.rqList
this.tableData1 = res.data.rqeList
this.total = this.tableData.length
this.pageSize=this.tableData.length
this.rqLtList=res.data.rqLtList
this.rqMzList=res.data.rqMzList
console.log(this.rqMzList)
/*const rqLtMap=res.data.rqLtMap
/!* 获取新逻辑数据*!/
const rqLtMapNew=rqLtMap.NEW
/!* 添加汇总*!/
rqLtMapNew.push(rqLtMapNew.reduce((acc, current) => acc + current, 0));
/!* 添加表头*!/
rqLtMapNew.unshift("头物料+容器逻辑");
const propertyKeys = ['workstation', '201', '202', '203', '204', '205', '206', '207', '208', '209', '210', '211', 'total'];
const newObj = {};
for (let i = 0; i < propertyKeys.length; i++) {
newObj[propertyKeys[i]] = rqLtMapNew[i];
}
this.rqLtList[1]=newObj;
/!* 获取旧逻辑数据*!/
const rqLtMapOLD=rqLtMap.OLD
/!* 添加汇总*!/
rqLtMapOLD.push(rqLtMapOLD.reduce((acc, current) => acc + current, 0));
/!* 添加表头*!/
rqLtMapOLD.unshift("现有逻辑");
const oldObj = {};
for (let i = 0; i < propertyKeys.length; i++) {
oldObj[propertyKeys[i]] = rqLtMapOLD[i];
}
this.rqLtList[0]=oldObj;
console.log(this.rqLtList)*/
} else {
this.$message.error('获取数据失败');
}
@ -405,40 +644,59 @@ export default {
down(){
this.exportToExcel();
},
// excelExcel
exportToExcel() {
const XLSX = require('xlsx');
const FileSaver = require('file-saver'); // file-saver
console.log('XLSX', XLSX, FileSaver);
const FileSaver = require('file-saver');
this.$nextTick(() => {
const workbook = XLSX.utils.book_new();
// ID
const tableIds = ['#educe-table1', '#educe-table2', '#educe-table3'];
const sheetNames = ['Sheet1', 'Sheet2', 'Sheet3'];
const tableIds = ['#educe-table0', '#educe-table1', '#educe-table2', '#educe-table3', '#educe-table4', '#educe-table5'];
const sheetNames = ['命中率', '任务行数', '容器流通数', '箱子数', '数据详情-现有逻辑', '数据详情-新逻辑'];
tableIds.forEach((tableId, index) => {
const worksheet = XLSX.utils.table_to_sheet(document.querySelector(tableId), { raw: true });
XLSX.utils.book_append_sheet(workbook, worksheet, sheetNames[index]);
const tableElement = document.querySelector(tableId);
if (tableElement) {
//
const uniqueRows = [];
const rows = tableElement.querySelectorAll('tr');
rows.forEach(row => {
const rowData = Array.from(row.cells).map(cell => cell.textContent);
if (!uniqueRows.some(uniqueRow => uniqueRow.join('') === rowData.join(''))) {
uniqueRows.push(rowData);
}
});
//
const newTable = document.createElement('table');
uniqueRows.forEach(rowData => {
const row = document.createElement('tr');
rowData.forEach(cellData => {
const cell = document.createElement('td');
cell.textContent = cellData;
row.appendChild(cell);
});
newTable.appendChild(row);
});
const worksheet = XLSX.utils.table_to_sheet(newTable, { raw: true });
XLSX.utils.book_append_sheet(workbook, worksheet, sheetNames[index]);
} else {
console.warn(`表格元素 ${tableId} 未找到,跳过导出。`);
}
});
// excel
let fileName = '容器流通' + new Date().getTime() + '.xlsx';
const fileName = `容器流通_${new Date().getTime()}.xlsx`;
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
const wbout = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'array' });
try {
//
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), fileName);
} catch (e) {
if (typeof console !== 'undefined') {
console.log(e, wbout);
}
console.error('导出Excel文件失败:', e);
}
return wbout;
});
},
parseTime(time, cFormat) {
//
if (arguments.length === 0) {

View File

@ -0,0 +1,62 @@
<template>
<div class="div1">
<!-- 其他代码 -->
<el-table
v-loading="this.tableloding"
:data="rqMzList"
id="educe-table0"
ref="tableData"
border
style="width: 100%;">
<!-- 列配置 -->
</el-table>
<el-table
v-loading="this.tableloding"
:data="rqMzList"
id="educe-table1"
ref="tableData"
border
style="width: 100%;">
<!-- 列配置 -->
</el-table>
<el-table
v-loading="this.tableloding"
:data="rqMzList"
id="educe-table2"
ref="tableData"
border
style="width: 100%;">
<!-- 列配置 -->
</el-table>
<el-table
v-loading="this.tableloding"
:data="rqLtList"
id="educe-table3"
ref="tableData"
border
style="width: 100%;">
<!-- 列配置 -->
</el-table>
<el-table
v-loading="this.tableloding"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
id="educe-table4"
ref="tableData"
border
style="width: 100%; height: 150px">
<!-- 列配置 -->
</el-table>
<el-table
v-loading="this.tableloding"
:height="150"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData1"
id="educe-table5"
ref="tableData1"
style="width: 100%;">
<!-- 列配置 -->
</el-table>
<!-- 其他代码 -->
</div>
</template>

View File

@ -8,7 +8,7 @@ import VueRouter from "vue-router";
import router from "@/router/router";
import store from "@/store/store";
Vue.prototype.$axios=axios;
Vue.prototype.$httpUrl='http://127.0.0.1:8084';
Vue.prototype.$httpUrl='http://127.0.0.1:8083';
//Vue.prototype.$httpUrl='http://192.68.2.88:8081';
// Vue.prototype.$httpUrl='http://10.1.112.23:8083';
Vue.config.productionTip = false;

View File

@ -44,24 +44,29 @@ public class JianHuoXiaoLvController {
@Autowired
private QueryUtil queryUtil;
private static /* 基础sql数据查询*/
String sql=" select t.id,bt.NAME as '单据类型',pt.sourceType as '出库类型',pt.id as '任务号',t.BILLCODE as '子任务号', "
+" z.NAME as '库区',ptd.LINE_NUMBER as '拣货行' ,pt.UPDATE_TIME as '创建时间',t.dateBill3 as '生成合单任务时间', "
+" t.dateBill1 as '下发时间',t.OPERATE_TIME as '拣货时间',t.ARRIVAL_TIME as '清点时间',t.operator_Date as '合单时间', "
+" t.dateline as '交单时间', "
+" DATEDIFF(second, pt.UPDATE_TIME,t.dateBill1 )/60 as '创建-下发时间', "
+" DATEDIFF(second, t.dateBill1,t.OPERATE_TIME )/60 as '下发-拣货时间', "
+" DATEDIFF(second, t.OPERATE_TIME,t.operator_Date )/60 as '拣货-合单时间', "
+" DATEDIFF(second, t.operator_Date,t.dateline )/60 as '合单-交单时间', "
+" DATEDIFF(second, t.OPERATE_TIME,t.ARRIVAL_TIME )/60 as '拣货-清点时间', "
+" DATEDIFF(second, t.ARRIVAL_TIME,t.operator_Date )/60 as '清点-合单时间', "
+" DATEDIFF(second, t.OPERATE_TIME,t.dateline )/60 as '拣货-交单时间' "
+" from task t "
+" left join PICK_TICKET_DETAIL ptd on ptd.id=t.PICK_TICKET_DETAIL_ID "
+" left join PICK_TICKET pt on pt.id=ptd.PICK_TICKET_ID "
+" left join BILL_TYPE bt on bt.id=pt.BILL_TYPE_ID "
+" left join LOCATION loc on loc.id=t.SRC_LOC_ID "
+" left join [ZONE] z on z.id=loc.ZONE_ID "
+" where t.PLAN_QUANTITY>0 ";
String sql = " SELECT t.id,bt.NAME as '单据类型',pt.sourceType as '出库类型',pt.id as '任务号',t.BILLCODE as '子任务号', "
+ " z.NAME as '库区',ptd.LINE_NUMBER as '拣货行' , "
+ " CONVERT(VARCHAR(19), pt.UPDATE_TIME, 20) as '创建时间', "
+ " CONVERT(VARCHAR(19), t.dateBill3, 20) as '生成合单任务时间', "
+ " CONVERT(VARCHAR(19), t.dateBill1, 20) as '下发时间', "
+ " CONVERT(VARCHAR(19), t.OPERATE_TIME, 20) as '拣货时间', "
+ " CONVERT(VARCHAR(19), t.ARRIVAL_TIME, 20) as '清点时间', "
+ " CONVERT(VARCHAR(19), t.operator_Date, 20) as '合单时间', "
+ " CONVERT(VARCHAR(19), t.dateline, 20) as '交单时间', "
+ " DATEDIFF(second, pt.UPDATE_TIME,t.dateBill1 )/60 as '创建-下发时间', "
+ " DATEDIFF(second, t.dateBill1,t.OPERATE_TIME )/60 as '下发-拣货时间', "
+ " DATEDIFF(second, t.OPERATE_TIME,t.operator_Date )/60 as '拣货-合单时间', "
+ " DATEDIFF(second, t.operator_Date,t.dateline )/60 as '合单-交单时间', "
+ " DATEDIFF(second, t.OPERATE_TIME,t.ARRIVAL_TIME )/60 as '拣货-清点时间', "
+ " DATEDIFF(second, t.ARRIVAL_TIME,t.operator_Date )/60 as '清点-合单时间', "
+ " DATEDIFF(second, t.OPERATE_TIME,t.dateline )/60 as '拣货-交单时间' "
+ " FROM task t "
+ " LEFT JOIN PICK_TICKET_DETAIL ptd ON ptd.id = t.PICK_TICKET_DETAIL_ID "
+ " LEFT JOIN PICK_TICKET pt ON pt.id = ptd.PICK_TICKET_ID "
+ " LEFT JOIN BILL_TYPE bt ON bt.id = pt.BILL_TYPE_ID "
+ " LEFT JOIN LOCATION loc ON loc.id = t.SRC_LOC_ID "
+ " LEFT JOIN [ZONE] z ON z.id = loc.ZONE_ID "
+ " WHERE t.PLAN_QUANTITY > 0 ";
@PostMapping("/queryList")
public Result queryList(@RequestBody String json) {
/* 返回data设置*/

View File

@ -20,7 +20,9 @@ public class RQTaskModel implements Serializable{
private String oldGzz="";
// 容器
private String rqh;
// 物料
// 原子任务号
private String oldZrwh;
// 新子任务号
private String zrwh;
private String agvId;
}

View File

@ -59,13 +59,14 @@ public class RongQiController {
/* 基础sql数据查询*/
String sql=" SELECT "
+" MAX(t.id) as id, "
+" max(t.OLD_GZZ) old_gzz, "
+" max(t.OLD_GZZ) gzz, "
+" count(t.id) as ts, "
+" MAX(t.agvTask_ID) as agv_id, "
+" item.code AS liaohao, "
+" MAX ( t.END_REGION ) AS gzz, "
+" MAX ( t.END_REGION ) AS old_gzz, "
+" MAX ( s2.LP ) AS rqh, "
+" t.BILLCODE AS zrwh "
+" t.BILLCODE AS old_zrwh, "
+" MAX (t.OLD_ZRW) AS zrwh "
+" FROM "
+" task t "
+" LEFT JOIN PICK_TICKET_DETAIL ptd ON ptd.id= t.PICK_TICKET_DETAIL_ID "
@ -81,22 +82,12 @@ public class RongQiController {
+" 1 = 1 "
+" AND pt.BILL_TYPE_ID= 1094 "
+" AND wd.code= '"+wdCode+"' "
+" and t.PLAN_QUANTITY>0 "
+" AND t.WAVE_DOC_ID IS NOT NULL and z.id=1763 "
+" GROUP BY "
+" pt.code, "
+" t.agvTask_ID, "
+" t.BILLCODE, "
+" item.id, "
+" item.code, "
+" item.BE_MARK_WEIGHT, "
+" loc.id, "
+" loc.code, "
+" ik.PROP_C1, "
+" ik.PROP_C2, "
+" ik.PROP_C3, "
+" ik.PROP_D1, "
+" ik.PROP_D2, "
+" item.ISBOM "
+" item.code "
;
String sqlCount = "select count(t.id) as nums from (" + sql+") t";
/* 总条数*/
@ -119,7 +110,6 @@ public class RongQiController {
+ " ,id"
+" OFFSET "+ (pageNum-1) * pageSize +" ROWS "
+" FETCH NEXT "+pageSize+" ROWS ONLY; ";
/* 箱子流通数*/
List<RongQiLt> rqLtList=new ArrayList<>();
RongQiLt rongQiOLD=new RongQiLt();
@ -127,7 +117,7 @@ public class RongQiController {
rqLtList.add(rongQiOLD);
RongQiLt rongQiNEW=new RongQiLt();
rongQiNEW.setWorkstation("头物料+容器逻辑");
rongQiNEW.setWorkstation("逻辑");
rqLtList.add(rongQiNEW);
/* 工作站命中率*/
@ -139,24 +129,110 @@ public class RongQiController {
RongQiMz rqMzNEW=new RongQiMz();
rqMzNEW.setWorkstation("新逻辑");
rqMzList.add(rqMzNEW);
/* 详情数据*/
/* 详情数据-现有逻辑*/
List<RongQi> rqList = new ArrayList<>();
/* 详情数据-新逻辑*/
List<RongQi> rqeList = new ArrayList<>();
/* 查询所有数据*/
List<RQTaskModel> listAll = entityManager.createNativeQuery(sqlFy, RQTaskModel.class).getResultList();
/* 按容器分组*/
Map<String, List<RQTaskModel>> groupedByRqh = listAll.stream()
.collect(Collectors.groupingBy(RQTaskModel::getRqh));
/* 容器数汇总-一个*/
int gzzCount=groupedByRqh.size();
rqLtList.get(0).setTotal(gzzCount);
rqLtList.get(1).setTotal(gzzCount);
/* 按工作站分组后,按子任务号分组,计算每个工作站完成的子任务数量*/
/*for (int i = 0; i < 2; i++) {
RongQiLt rongQiLt = rqLtList.get(i);
Map<String, List<RQTaskModel>> groupedByGzz;
if (i==0){
groupedByGzz = listAll.stream()
.collect(Collectors.groupingBy(RQTaskModel::getOldGzz));
}else {
groupedByGzz = listAll.stream()
.collect(Collectors.groupingBy(RQTaskModel::getGzz));
}
for (String gzz : groupedByGzz.keySet()) {
List<RQTaskModel> listGzz=groupedByGzz.get(gzz);
Map<String, List<RQTaskModel>> groupedByZrwh;
if (i==0){
groupedByZrwh = listGzz.stream()
.collect(Collectors.groupingBy(RQTaskModel::getOldZrwh));
}else {
groupedByZrwh = listGzz.stream()
.collect(Collectors.groupingBy(RQTaskModel::getZrwh));
}
int zrw=groupedByZrwh.size();
switch (gzz){
case "201":
rongQiLt.setG201(zrw);
break;
case "202":
rongQiLt.setG202(zrw);
break;
case "203":
rongQiLt.setG203(zrw);
break;
case "204":
rongQiLt.setG204(zrw);
break;
case "205":
rongQiLt.setG205(zrw);
break;
case "206":
rongQiLt.setG206(zrw);
break;
case "207":
rongQiLt.setG207(zrw);
break;
case "208":
rongQiLt.setG208(zrw);
break;
case "209":
rongQiLt.setG209(zrw);
break;
case "210":
rongQiLt.setG210(zrw);
break;
case "211":
rongQiLt.setG211(zrw);
break;
case "212":
rongQiLt.setG212(zrw);
break;
case "213":
rongQiLt.setG213(zrw);
break;
case "214":
rongQiLt.setG214(zrw);
break;
case "215":
rongQiLt.setG215(zrw);
break;
default:
break;
}
}
rongQiLt.setTotal(rongQiLt.getG201()+rongQiLt.getG202()+rongQiLt.getG203()+rongQiLt.getG204()+rongQiLt.getG205()
+rongQiLt.getG206()+rongQiLt.getG207()+rongQiLt.getG208()+rongQiLt.getG209()
+rongQiLt.getG210()+rongQiLt.getG211()+rongQiLt.getG212()+rongQiLt.getG213()+rongQiLt.getG214()+rongQiLt.getG215());
}*/
for (String rqh : groupedByRqh.keySet()) {
RongQi rongQi=new RongQi();
rongQi.setRqh(rqh);
List<RQTaskModel> listRqh=groupedByRqh.get(rqh);
rongQi.setId(listRqh.get(0).getId());
Map<String, List<RQTaskModel>> groupedByGzz;
//i=1 新逻辑 i=0 原逻辑
for (int i = 0; i < 2; i++) {
RongQi rongQi=new RongQi();
rongQi.setRqh(rqh);
rongQi.setId(listRqh.get(0).getId());
if (i==0){
groupedByGzz = listRqh.stream()
groupedByGzz = listRqh.stream()
.filter(task -> task.getOldGzz() != null)
.collect(Collectors.groupingBy(RQTaskModel::getOldGzz));
@ -166,131 +242,107 @@ public class RongQiController {
.filter(task -> task.getGzz() != null)
.collect(Collectors.groupingBy(RQTaskModel::getGzz));
}
for (String gzz : groupedByGzz.keySet()) {
List<RQTaskModel> listGzz=groupedByGzz.get(gzz);
/* 按AgvId任务分组获取分组后的集合长度算出当前料箱到当前工作站的次数*/
Map<String, List<RQTaskModel>> groupedByAgvId = listGzz.stream()
.collect(Collectors.groupingBy(RQTaskModel::getAgvId));
/* 工作站搬运任务数*/
int gzzCount=groupedByAgvId.size();
/* 工作站拣货任务总行数*/
int taskCount=0;
for (RQTaskModel rqTaskModel : listGzz){
taskCount=taskCount+rqTaskModel.getTs();
}
/* 容器流通次数*/
// int g=groupedByAgvId.size();
int g=1;
//任务行数
int taskCount=listGzz.size();
RongQiMz rongQiMz=rqMzList.get(i);
switch (gzz){
case "201":
rongQi.setG201(taskCount);
rqLtList.get(i).setG201(rqLtList.get(i).getG201()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG201().setTaskCount(rongQiMz.getG201().getTaskCount()+taskCount);
rongQiMz.getG201().setLxCount(rongQiMz.getG201().getLxCount()+1);
rongQiMz.getG201().setLxCount(rongQiMz.getG201().getLxCount()+g);
break;
case "202":
rongQi.setG202(taskCount);
rqLtList.get(i).setG202(rqLtList.get(i).getG202()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG202().setTaskCount(rongQiMz.getG202().getTaskCount()+taskCount);
rongQiMz.getG202().setLxCount(rongQiMz.getG202().getLxCount()+1);
rongQiMz.getG202().setLxCount(rongQiMz.getG202().getLxCount()+g);
break;
case "203":
rongQi.setG203(taskCount);
rqLtList.get(i).setG203(rqLtList.get(i).getG203()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG203().setTaskCount(rongQiMz.getG203().getTaskCount()+taskCount);
rongQiMz.getG203().setLxCount(rongQiMz.getG203().getLxCount()+1);
rongQiMz.getG203().setLxCount(rongQiMz.getG203().getLxCount()+g);
break;
case "204":
rongQi.setG204(taskCount);
rqLtList.get(i).setG204(rqLtList.get(i).getG204()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG204().setTaskCount(rongQiMz.getG204().getTaskCount()+taskCount);
rongQiMz.getG204().setLxCount(rongQiMz.getG204().getLxCount()+1);
rongQiMz.getG204().setLxCount(rongQiMz.getG204().getLxCount()+g);
break;
case "205":
rongQi.setG205(taskCount);
rqLtList.get(i).setG205(rqLtList.get(i).getG205()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG205().setTaskCount(rongQiMz.getG205().getTaskCount()+taskCount);
rongQiMz.getG205().setLxCount(rongQiMz.getG205().getLxCount()+1);
rongQiMz.getG205().setLxCount(rongQiMz.getG205().getLxCount()+g);
break;
case "206":
rongQi.setG206(taskCount);
rqLtList.get(i).setG206(rqLtList.get(i).getG206()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG206().setTaskCount(rongQiMz.getG206().getTaskCount()+taskCount);
rongQiMz.getG206().setLxCount(rongQiMz.getG206().getLxCount()+1);
rongQiMz.getG206().setLxCount(rongQiMz.getG206().getLxCount()+g);
break;
case "207":
rongQi.setG207(taskCount);
rqLtList.get(i).setG207(rqLtList.get(i).getG207()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG207().setTaskCount(rongQiMz.getG207().getTaskCount()+taskCount);
rongQiMz.getG207().setLxCount(rongQiMz.getG207().getLxCount()+1);
rongQiMz.getG207().setLxCount(rongQiMz.getG207().getLxCount()+g);
break;
case "208":
rongQi.setG208(taskCount);
rqLtList.get(i).setG208(rqLtList.get(i).getG208()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG208().setTaskCount(rongQiMz.getG208().getTaskCount()+taskCount);
rongQiMz.getG208().setLxCount(rongQiMz.getG208().getLxCount()+1);
rongQiMz.getG208().setLxCount(rongQiMz.getG208().getLxCount()+g);
break;
case "209":
rongQi.setG209(taskCount);
rqLtList.get(i).setG209(rqLtList.get(i).getG209()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG209().setTaskCount(rongQiMz.getG209().getTaskCount()+taskCount);
rongQiMz.getG209().setLxCount(rongQiMz.getG209().getLxCount()+1);
rongQiMz.getG209().setLxCount(rongQiMz.getG209().getLxCount()+g);
break;
case "210":
rongQi.setG210(taskCount);
rqLtList.get(i).setG210(rqLtList.get(i).getG210()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG210().setTaskCount(rongQiMz.getG210().getTaskCount()+taskCount);
rongQiMz.getG210().setLxCount(rongQiMz.getG210().getLxCount()+1);
rongQiMz.getG210().setLxCount(rongQiMz.getG210().getLxCount()+g);
break;
case "211":
rongQi.setG211(taskCount);
rqLtList.get(i).setG211(rqLtList.get(i).getG211()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG211().setTaskCount(rongQiMz.getG211().getTaskCount()+taskCount);
rongQiMz.getG211().setLxCount(rongQiMz.getG211().getLxCount()+1);
rongQiMz.getG211().setLxCount(rongQiMz.getG211().getLxCount()+g);
break;
case "212":
rongQi.setG212(taskCount);
rqLtList.get(i).setG212(rqLtList.get(i).getG212()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG212().setTaskCount(rongQiMz.getG212().getTaskCount()+taskCount);
rongQiMz.getG212().setLxCount(rongQiMz.getG212().getLxCount()+1);
rongQiMz.getG212().setLxCount(rongQiMz.getG212().getLxCount()+g);
break;
case "213":
rongQi.setG213(taskCount);
rqLtList.get(i).setG213(rqLtList.get(i).getG213()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG213().setTaskCount(rongQiMz.getG213().getTaskCount()+taskCount);
rongQiMz.getG213().setLxCount(rongQiMz.getG213().getLxCount()+1);
rongQiMz.getG213().setLxCount(rongQiMz.getG213().getLxCount()+g);
break;
case "214":
rongQi.setG214(taskCount);
rqLtList.get(i).setG214(rqLtList.get(i).getG214()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG214().setTaskCount(rongQiMz.getG214().getTaskCount()+taskCount);
rongQiMz.getG214().setLxCount(rongQiMz.getG214().getLxCount()+1);
rongQiMz.getG214().setLxCount(rongQiMz.getG214().getLxCount()+g);
break;
case "215":
rongQi.setG215(taskCount);
rqLtList.get(i).setG215(rqLtList.get(i).getG215()+gzzCount);
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
rongQiMz.getG215().setTaskCount(rongQiMz.getG215().getTaskCount()+taskCount);
rongQiMz.getG215().setLxCount(rongQiMz.getG215().getLxCount()+1);
rongQiMz.getG215().setLxCount(rongQiMz.getG215().getLxCount()+g);
break;
default:
break;
}
}
rongQi.setCount(rongQi.getG201()+rongQi.getG202()+rongQi.getG203()+rongQi.getG204()+rongQi.getG205()+rongQi.getG206()+rongQi.getG207()+rongQi.getG208()+rongQi.getG209()
+rongQi.getG210()+rongQi.getG211()+rongQi.getG212()+rongQi.getG213()+rongQi.getG214()+rongQi.getG215());
if (i==0){
rqList.add(rongQi);
}else {
rqeList.add(rongQi);
}
}
rqList.add(rongQi);
}
// 使用 Comparator 进行排序
Collections.sort(rqList, new Comparator<RongQi>() {
@ -299,88 +351,116 @@ public class RongQiController {
return r1.getRqh().compareTo(r2.getRqh());
}
});
Collections.sort(rqeList, new Comparator<RongQi>() {
@Override
public int compare(RongQi r1, RongQi r2) {
return r1.getRqh().compareTo(r2.getRqh());
}
});
JSONObject jsonF=new JSONObject();
jsonF.accumulate("rqList", rqList);
jsonF.accumulate("rqeList", rqeList);
jsonF.accumulate("rqLtList", rqLtList);
for (int i = 0; i < rqMzList.size(); i++) {
double j=0;
RongQiMz rongQiMz=rqMzList.get(i);//工作站料箱数
if (rongQiMz.getG201().getLxCount()!=0){
j=j+1;
rongQiMz.getG201().setMz(Math.round(rongQiMz.getG201().getTaskCount()/rongQiMz.getG201().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG201().getLxCount());
}
if (rongQiMz.getG202().getLxCount()!=0) {
j=j+1;
rongQiMz.getG202().setMz(Math.round(rongQiMz.getG202().getTaskCount() / rongQiMz.getG202().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG202().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG202().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG202().getLxCount());
}
if (rongQiMz.getG203().getLxCount()!=0) {
j=j+1;
rongQiMz.getG203().setMz(Math.round(rongQiMz.getG203().getTaskCount() / rongQiMz.getG203().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG203().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG203().getLxCount());
}
if (rongQiMz.getG204().getLxCount()!=0) {
j=j+1;
rongQiMz.getG204().setMz(Math.round(rongQiMz.getG204().getTaskCount() / rongQiMz.getG204().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG204().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG204().getLxCount());
}
if (rongQiMz.getG205().getLxCount()!=0) {
j=j+1;
rongQiMz.getG205().setMz(Math.round(rongQiMz.getG205().getTaskCount() / rongQiMz.getG205().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG205().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG205().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG205().getLxCount());
}
if (rongQiMz.getG206().getLxCount()!=0) {
j=j+1;
rongQiMz.getG206().setMz(Math.round(rongQiMz.getG206().getTaskCount() / rongQiMz.getG206().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG206().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG206().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG206().getLxCount());
}
if (rongQiMz.getG207().getLxCount()!=0) {
j=j+1;
rongQiMz.getG207().setMz(Math.round(rongQiMz.getG207().getTaskCount() / rongQiMz.getG207().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG207().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG207().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG207().getLxCount());
}
if (rongQiMz.getG208().getLxCount()!=0) {
j=j+1;
rongQiMz.getG208().setMz(Math.round(rongQiMz.getG208().getTaskCount() / rongQiMz.getG208().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG208().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG208().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG208().getLxCount());
}
if (rongQiMz.getG209().getLxCount()!=0) {
j=j+1;
rongQiMz.getG209().setMz(Math.round(rongQiMz.getG209().getTaskCount() / rongQiMz.getG209().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG209().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG209().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG209().getLxCount());
}
if (rongQiMz.getG210().getLxCount()!=0) {
j=j+1;
rongQiMz.getG210().setMz(Math.round(rongQiMz.getG210().getTaskCount() / rongQiMz.getG210().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG210().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG210().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG210().getLxCount());
}
if (rongQiMz.getG211().getLxCount()!=0) {
j=j+1;
rongQiMz.getG211().setMz(Math.round(rongQiMz.getG211().getTaskCount() / rongQiMz.getG211().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG211().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG211().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG211().getLxCount());
}
if (rongQiMz.getG212().getLxCount()!=0) {
j=j+1;
rongQiMz.getG212().setMz(Math.round(rongQiMz.getG212().getTaskCount() / rongQiMz.getG212().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG212().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG212().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG212().getLxCount());
}
if (rongQiMz.getG213().getLxCount()!=0) {
j=j+1;
rongQiMz.getG213().setMz(Math.round(rongQiMz.getG213().getTaskCount() / rongQiMz.getG213().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG213().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG213().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG213().getLxCount());
}
if (rongQiMz.getG214().getLxCount()!=0) {
j=j+1;
rongQiMz.getG214().setMz(Math.round(rongQiMz.getG214().getTaskCount() / rongQiMz.getG214().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG214().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG214().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG214().getLxCount());
}
if (rongQiMz.getG215().getLxCount()!=0) {
j=j+1;
rongQiMz.getG215().setMz(Math.round(rongQiMz.getG215().getTaskCount() / rongQiMz.getG215().getLxCount() * 100) / 100.0);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG215().getMz());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG215().getTaskCount());
rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+rongQiMz.getG215().getLxCount());
}
if (rongQiMz.getTotal().getLxCount()!=0) {
rongQiMz.getTotal().setMz(Math.round(rongQiMz.getTotal().getTaskCount() / rongQiMz.getTotal().getLxCount() * 100) / 100.0);
double mz=rongQiMz.getG201().getMz()+rongQiMz.getG202().getMz()+rongQiMz.getG203().getMz()+rongQiMz.getG204().getMz() +rongQiMz.getG205().getMz()
+rongQiMz.getG206().getMz()+rongQiMz.getG207().getMz()+rongQiMz.getG208().getMz()+rongQiMz.getG209().getMz()+rongQiMz.getG210().getMz()
+rongQiMz.getG211().getMz()+rongQiMz.getG212().getMz()+rongQiMz.getG213().getMz()+rongQiMz.getG214().getMz()+rongQiMz.getG215().getMz();
/** 计算所有工作站命中率不为0的平均数*/
rongQiMz.getTotal().setMz(Math.round(mz / j * 100) / 100.0);
}
}
jsonF.accumulate("rqMzList", rqMzList);
@ -429,6 +509,7 @@ class RongQi implements Serializable{
private int g213=0;
private int g214=0;
private int g215=0;
private int count=0;
}
@Data
@Entity
@ -452,7 +533,10 @@ class RongQiLt implements Serializable{
private int g213=0;
private int g214=0;
private int g215=0;
// 汇总
private int total=0;
// 料箱数
private int lxCount=0;
}
@Data
@ -486,7 +570,7 @@ class RQMzModel implements Serializable {
private Long id;
/*任务行*/
private double taskCount=0;
/*料箱数*/
/*容器流通次数*/
private double lxCount=0;
/*命中率*/
private double mz=0;

View File

@ -28,72 +28,38 @@ public class KucunhuizongImpl implements Kucunhuizong {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sql="select Row_number() OVER(ORDER BY item.id,loc.id) as Row_Num,\n" +
"max(inv.id) as id,\n" +
"max(loc.code) as locCode,--库位号\n" +
"max(item.code) as itemCode,--料号\n" +
"max(item.name) as itemName,--描述\n" +
"max(inv.BAR_CODE) as barCode,--序列号\n" +
"max(inv.STATUS) as status,--状态\n" +
"max(inv.LOCATION_ID) as LOCATION_ID,--库位ID\n" +
"max(inv.ITEM_KEY_ID) as ITEM_KEY_ID,--料号属性ID\n" +
"sum(inv.QUANTITY) as quantity,\t--库存数量\n" +
"sum(inv.QUEUED_QUANTITY) as queuedQuantity,--占用数量\n" +
"max(ik.PROP_C1) as propC1,--批次号\n" +
"max(ik.PROP_C2) as propC2,--LOC\n" +
"max(ik.PROP_C3) as propC3,--特殊标记\n" +
"max(ik.PROP_C4) as propC4,--部门\n" +
"max(ik.PROP_C5) as propC5,--供应商编号\n" +
"max(ik.PROP_C6) as propC6,--申请人编号\n" +
"max(ik.PROP_C7) as propC7,--申请人\n" +
"max(ik.PROP_C8) as propC8,--暂存原因\n" +
"max(ik.PROP_C9) as propC9,--工厂\n" +
"max(inv.SOI) as soi,--入库单号\n" +
"max(ik.PROP_D1) prop_D1,--生产日期\n" +
"max(ik.PROP_D2) prop_D2,--到日期\n" +
"max(z.name) as kqName,--库区\n" +
"max(z.ID) as ZONE_ID,--库区ID\n" +
"\n" +
"case \n" +
"\twhen max(inv.coun_Plan) is null then 0\n" +
"\telse 1\n" +
"end as lock,--是否盘点\n" +
"case \n" +
"\twhen max(z.NAME) in('7#堆垛区','3#货架区','3#料箱区') \n" +
"then max(ls1.name) else max(ls.name) end as LSname,--AGV库位\n" +
"max(item.Be_SAP_Item) Be_SAP_Item, --是否SAP料号\n" +
"max(item.VOLUME) VOLUME,--体积\n" +
"max(item.BE_WEIGHT) BE_WEIGHT,--是否危化品\n" +
"max(item.SHIP_RULES) SHIP_RULES,--库存价值等级\n" +
"max(item.FEE_TYPE) FEE_TYPE,--OA料号\n" +
"max(item.SINGLE_ITEM) SINGLE_ITEM,--是否批号管理\n" +
"max(item.BE_MARK_WEIGHT) BE_MARK_WEIGHT,--是否序列号\n" +
"max(item.UNIT) UNIT,--单位\n" +
"max(item.STR_EXTEND1) STR_EXTEND1,--备注\n" +
"max(item.STR_EXTEND2) STR_EXTEND2,--币种\n" +
"max(item.STR_EXTEND3) STR_EXTEND3,--标准价\n" +
"max(item.STR_EXTEND4) STR_EXTEND4,--库存单位\n" +
"ISNULL(stock1.agvFlag, 0) agvFlag,--是否在GAV仓\n" +
"loc.id locId ,--库位id\n" +
"max(lts.NAME) as lts_name,--库位类型\n" +
"item.ISBOM validity,--是否有效期管理\n" +
"CONVERT(varchar(100), min(inv.STORAGE_DATE), 20) as storageDate,--库存日期\n" +
" max(inv.moveStatus) moveStatus,--工作站\n" +
"inv.statuss inv_status,--退料标记\n" +
"MAX(stock1.WEIGHT) as WEIGHT --重量\n" +
"\n" +
"from INVENTORY inv\n" +
"left join ZONE kq on kq.id=inv.warehouse_Area_ID \n" +
"left join LOCATION loc on loc.id=inv.LOCATION_ID\n" +
"left join LOCATIONS lts on lts.id=loc.LOCATIONS_ID\n" +
"left join STOCK stock1 on stock1.id=loc.stock\n" +
"left join LOCATION_STORAGE ls1 on ls1.ID=stock1.locationStorage_ID\n" +
"left join ZONE z on z.ID =loc.ZONE_ID\n" +
"left join ITEM_KEY ik on ik.id=inv.ITEM_KEY_ID\n" +
"left join ITEM item on item.id=ik.ITEM_ID\n" +
"left join STOCK stock on stock.ID=inv.LP\n" +
"left join LOCATION_STORAGE ls on ls.ID=stock.locationStorage_ID\n" +
"where 1=1 and inv.QUANTITY>0 and item.Be_SAP_Item=1 and lts.NAME in('存货','不良品') and inv.status in('已入库','整理中','冻结','质检中')";
String sql=" SELECT "
+" ROW_NUMBER() OVER (ORDER BY inventory.id ASC) AS Row_Num,"
+" inventory.id, "
+" inventory.locCode, "
+" inventory.itemCode, "
+" inventory.itemName, "
+" inventory.UNIT, "
+" inventory.status, "
+" inventory.statuss, "
+" inventory.quantity, "
+" inventory.queuedQuantity , "
+" inventory.LSname, "
+" inventory.weight, "
+" inventory.propC1, "
+" inventory.propC2, "
+" inventory.propC3, "
+" inventory.propC5, "
+" inventory.propC9, "
+" inventory.propD2, "
+" inventory.kqName, "
+" inventory.agvFlag, "
+" inventory.SINGLE_ITEM, "
+" inventory.validity, "
+" inventory.storageDate, "
+" inventory.invDes, "
+" inventory.propC7, "
+" inventory.lock "
+" FROM INVENTORY_VIEW inventory "
+" WHERE 1=1 "
+" and inventory.quantity>0 and inventory.Be_SAP_Item=1 "
+" and inventory.lts_name in('存货','不良品','数据虚拟库') "
+" and inventory.status not in('待上架','已出库','已合单','合单完成') ";
//库位号
if(kucunhuizong.locCode!=null){
@ -108,7 +74,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ str[i]+"'"+",");
}
}
sql+=" and loc.code in ("+sb.toString()+")";
sql+=" and inventory.locCode in ("+sb.toString()+")";
}
}
@ -125,14 +91,14 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ str[i]+"'"+",");
}
}
sql+=" and item.code in ("+sb.toString()+")";
sql+=" and inventory.itemCode in ("+sb.toString()+")";
}
}
//物料描述
if(kucunhuizong.itemName!=null){
if(!kucunhuizong.itemName.trim().equals("")){
sql+=" and item.name like "+"'%"+kucunhuizong.itemName.trim()+"%'";
sql+=" and inventory.itemName like "+"'%"+kucunhuizong.itemName.trim()+"%'";
}
}
@ -146,7 +112,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ kucunhuizong.propC2[i]+"'"+",");
}
}
sql+=" and ik.PROP_C2 in ("+sb.toString()+")";;
sql+=" and inventory.propC2 in ("+sb.toString()+")";;
}
//库存状态
@ -159,7 +125,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ kucunhuizong.status[i]+"'"+",");
}
}
sql+=" and inv.STATUS in ("+sb.toString()+")";;
sql+=" and inventory.status in ("+sb.toString()+")";;
}
//库区
@ -172,7 +138,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ kucunhuizong.kqName[i]+"'"+",");
}
}
sql+=" and z.name in ("+sb.toString()+")";;
sql+=" and z.kqName in ("+sb.toString()+")";;
}
//批次号
@ -188,14 +154,14 @@ public class KucunhuizongImpl implements Kucunhuizong {
sb.append("'"+ str[i]+"'"+",");
}
}
sql+=" and ik.PROP_C3 in ("+sb.toString()+")";
sql+=" and inventory.propC1 in ("+sb.toString()+")";
}
}
//特殊标记
if(kucunhuizong.propC3!=null){
if(!kucunhuizong.propC3.trim().equals("")){
sql+=" and item.name like "+"'%"+kucunhuizong.propC3.trim()+"%'";
sql+=" and inventory.propC3 like "+"'%"+kucunhuizong.propC3.trim()+"%'";
}
}
@ -203,23 +169,23 @@ public class KucunhuizongImpl implements Kucunhuizong {
if(kucunhuizong.storageDate!=null&&kucunhuizong.storageDate.length>0){
String startDate = simpleDateFormat.format(kucunhuizong.storageDate[0]);
String endDate = simpleDateFormat.format(kucunhuizong.storageDate[1]);
sql+=" and CONVERT(DATE, inv.STORAGE_DATE) between "+"'"+startDate+"'"+" and "+ "'"+endDate+"'";
sql+=" and CONVERT(DATE, inventory.storageDate) between "+"'"+startDate+"'"+" and "+ "'"+endDate+"'";
}
//供应商号
if(kucunhuizong.propC5!=null){
if(!kucunhuizong.propC5.trim().equals("")){
sql+=" and ik.PROP_C5 = "+"'"+kucunhuizong.propC5.trim()+"'";
sql+=" and inventory.propC5 = "+"'"+kucunhuizong.propC5.trim()+"'";
}
}
//是否盘点
if(kucunhuizong.coun_Plan!=null&& !kucunhuizong.coun_Plan.equals("")){
if (Integer.parseInt(kucunhuizong.coun_Plan)==0) {
sql+=" and inv.coun_Plan is null";
sql+=" and inventory.lock is null";
}else {
sql+=" and inv.coun_Plan is not null";
sql+=" and inventory.lock is not null";
}
}
@ -227,30 +193,28 @@ public class KucunhuizongImpl implements Kucunhuizong {
if(kucunhuizong.SINGLE_ITEM!=null&& !kucunhuizong.SINGLE_ITEM.equals("")){
if (Integer.parseInt(kucunhuizong.SINGLE_ITEM)==0) {
sql+=" and ik.PROP_C1 is null";
sql+=" and inventory.propC1 is null";
}else {
sql+=" and ik.PROP_C1 is not null";
sql+=" and inventory.propC1 is not null";
}
}
//是否有效期管理
if(kucunhuizong.validity!=null&& !kucunhuizong.validity.equals("")){
sql+=" and item.ISBOM = "+"'"+kucunhuizong.validity+"'";
sql+=" and inventory.validity = "+"'"+kucunhuizong.validity+"'";
}
//退料标记
if(kucunhuizong.statuss!=null&& !kucunhuizong.statuss.equals("")){
sql+=" and inv.statuss = "+"'"+kucunhuizong.statuss+"'";
sql+=" and inventory.statuss = "+"'"+kucunhuizong.statuss+"'";
}
String sqlCount = "select count(t.id) as nums from(" + sql+"\n " +
" group by item.id,loc.id,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,ik.PROP_C5,ik.PROP_C7,inv.STATUS,item.isBOM,inv.statuss,stock1.agvFlag"+") t";
String sqlFy = "select t.* from(" + sql+"\n " +
" group by item.id,loc.id,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,ik.PROP_C5,ik.PROP_C7,inv.STATUS,item.isBOM,inv.statuss,stock1.agvFlag"+") t";
String sqlCount = "select count(t.id) as nums from(" + sql+") t";
String sqlFy = "select t.* from(" + sql+") t";
sqlFy+= " WHERE Row_Num BETWEEN " + (pageNum-1) * pageSize + " AND " + (pageNum) * pageSize;

View File

@ -1,6 +1,6 @@
server:
address: 0.0.0.0
port: 8084
port: 8083
# url: jdbc:sqlserver://47.100.54.81:1433;DatabaseName=zwwms
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# username: super