更新wip-退火 缺少实际库区选择,重新占据库位能力
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS aps_quick_sheet (
|
||||||
|
quick_sheet_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
plan_date DATE NOT NULL COMMENT '计划日期',
|
||||||
|
line_id BIGINT NULL COMMENT '产线ID',
|
||||||
|
line_name VARCHAR(120) NULL COMMENT '产线名称',
|
||||||
|
plan_code VARCHAR(60) NOT NULL COMMENT '计划号',
|
||||||
|
order_code VARCHAR(80) NULL COMMENT '订单号',
|
||||||
|
customer_name VARCHAR(120) NULL COMMENT '客户',
|
||||||
|
salesman VARCHAR(60) NULL COMMENT '业务员',
|
||||||
|
product_name VARCHAR(120) NULL COMMENT '产品',
|
||||||
|
raw_material_id VARCHAR(64) NULL COMMENT '原料钢卷',
|
||||||
|
raw_coil_nos VARCHAR(255) NULL COMMENT '原料卷号',
|
||||||
|
raw_location VARCHAR(120) NULL COMMENT '钢卷位置',
|
||||||
|
raw_packaging VARCHAR(120) NULL COMMENT '包装要求',
|
||||||
|
raw_edge_req VARCHAR(120) NULL COMMENT '切边要求',
|
||||||
|
raw_coating_type VARCHAR(120) NULL COMMENT '镀层种类',
|
||||||
|
raw_net_weight DECIMAL(18, 3) NULL COMMENT '原料净重',
|
||||||
|
plan_qty DECIMAL(18, 3) NULL COMMENT '计划数量',
|
||||||
|
start_time DATETIME NULL COMMENT '开始时间',
|
||||||
|
end_time DATETIME NULL COMMENT '结束时间',
|
||||||
|
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
|
create_by VARCHAR(64) NULL,
|
||||||
|
update_by VARCHAR(64) NULL,
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
INDEX idx_aps_quick_sheet_plan_date (plan_date),
|
||||||
|
INDEX idx_aps_quick_sheet_line_id (line_id)
|
||||||
|
) COMMENT = '快速排产表(Excel样式)';
|
||||||
47
klp-admin/src/main/resources/db/migration/V9__anneal_wip.sql
Normal file
47
klp-admin/src/main/resources/db/migration/V9__anneal_wip.sql
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS wms_furnace (
|
||||||
|
furnace_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
furnace_code VARCHAR(50) NOT NULL COMMENT '炉编号',
|
||||||
|
furnace_name VARCHAR(100) NOT NULL COMMENT '名称',
|
||||||
|
busy_flag TINYINT DEFAULT 0 COMMENT '是否忙碌(0否1是)',
|
||||||
|
status TINYINT DEFAULT 1 COMMENT '状态(0停用1启用)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
|
create_by VARCHAR(64) NULL,
|
||||||
|
update_by VARCHAR(64) NULL,
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
UNIQUE KEY uk_wms_furnace_code (furnace_code)
|
||||||
|
) COMMENT = '退火炉信息表';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS wms_furnace_plan (
|
||||||
|
plan_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
plan_no VARCHAR(60) NOT NULL COMMENT '计划号',
|
||||||
|
plan_start_time DATETIME NULL COMMENT '计划开始时间',
|
||||||
|
actual_start_time DATETIME NULL COMMENT '实际开始时间',
|
||||||
|
end_time DATETIME NULL COMMENT '结束时间',
|
||||||
|
target_furnace_id BIGINT NOT NULL COMMENT '目标炉子ID',
|
||||||
|
status TINYINT DEFAULT 0 COMMENT '计划状态(0草稿 1已下发 2执行中 3已完成 4已取消)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
|
create_by VARCHAR(64) NULL,
|
||||||
|
update_by VARCHAR(64) NULL,
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
UNIQUE KEY uk_wms_furnace_plan_no (plan_no),
|
||||||
|
INDEX idx_wms_furnace_plan_furnace (target_furnace_id),
|
||||||
|
INDEX idx_wms_furnace_plan_status (status)
|
||||||
|
) COMMENT = '退火计划表';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS wms_furnace_plan_coil (
|
||||||
|
plan_coil_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
plan_id BIGINT NOT NULL COMMENT '计划ID',
|
||||||
|
coil_id BIGINT NOT NULL COMMENT '钢卷ID',
|
||||||
|
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
|
create_by VARCHAR(64) NULL,
|
||||||
|
update_by VARCHAR(64) NULL,
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
UNIQUE KEY uk_wms_furnace_plan_coil (plan_id, coil_id),
|
||||||
|
INDEX idx_wms_furnace_plan_coil_plan (plan_id),
|
||||||
|
INDEX idx_wms_furnace_plan_coil_coil (coil_id)
|
||||||
|
) COMMENT = '退火计划钢卷关系表';
|
||||||
62
klp-ui/src/api/wms/annealFurnace.js
Normal file
62
klp-ui/src/api/wms/annealFurnace.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询退火炉列表
|
||||||
|
export function listAnnealFurnace(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询退火炉详情
|
||||||
|
export function getAnnealFurnace(furnaceId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/' + furnaceId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增退火炉
|
||||||
|
export function addAnnealFurnace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改退火炉
|
||||||
|
export function updateAnnealFurnace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/edit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 启用停用
|
||||||
|
export function changeAnnealFurnaceStatus(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/status',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 置忙/置闲
|
||||||
|
export function changeAnnealFurnaceBusy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/busy',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除退火炉
|
||||||
|
export function delAnnealFurnace(furnaceId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/furnace/' + furnaceId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
9
klp-ui/src/api/wms/annealOverview.js
Normal file
9
klp-ui/src/api/wms/annealOverview.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询退火总览信息
|
||||||
|
export function getAnnealOverview() {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/overview',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
10
klp-ui/src/api/wms/annealPerformance.js
Normal file
10
klp-ui/src/api/wms/annealPerformance.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询炉火实绩
|
||||||
|
export function getAnnealPerformance(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/performance',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
98
klp-ui/src/api/wms/annealPlan.js
Normal file
98
klp-ui/src/api/wms/annealPlan.js
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询退火计划列表
|
||||||
|
export function listAnnealPlan(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询退火计划详情
|
||||||
|
export function getAnnealPlan(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/' + planId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增退火计划
|
||||||
|
export function addAnnealPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改退火计划
|
||||||
|
export function updateAnnealPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/edit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除退火计划
|
||||||
|
export function delAnnealPlan(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/' + planId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新计划状态
|
||||||
|
export function changeAnnealPlanStatus(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/status',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 入炉
|
||||||
|
export function inFurnace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/in-furnace',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 完成退火
|
||||||
|
export function completeAnnealPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/complete',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询计划钢卷列表
|
||||||
|
export function listAnnealPlanCoils(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/coil/list',
|
||||||
|
method: 'get',
|
||||||
|
params: { planId }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 绑定钢卷
|
||||||
|
export function bindAnnealPlanCoils(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/coil/bind',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解绑钢卷
|
||||||
|
export function unbindAnnealPlanCoil(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/plan/coil/unbind',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
1
klp-ui/src/assets/icons/svg/furnace.svg
Normal file
1
klp-ui/src/assets/icons/svg/furnace.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1773478276971" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13723" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M630.568421 619.789474h-239.831579c-10.778947 0-18.863158 8.084211-18.863158 18.863158s8.084211 18.863158 18.863158 18.863157h239.831579c10.778947 0 18.863158-8.084211 18.863158-18.863157s-8.084211-18.863158-18.863158-18.863158z" fill="#101010" p-id="13724"></path><path d="M986.273684 714.105263l-78.147368-164.378947c-5.389474-13.473684-18.863158-21.557895-32.336842-21.557895H808.421053V115.873684c0-16.168421-13.473684-29.642105-29.642106-29.642105h-99.705263c-18.863158 0-32.336842 13.473684-32.336842 32.336842v24.252632h-48.505263v-24.252632c0-18.863158-13.473684-32.336842-32.336842-32.336842h-102.4c-18.863158 0-32.336842 13.473684-32.336842 32.336842v24.252632h-48.505263v-24.252632c0-18.863158-13.473684-32.336842-32.336843-32.336842H247.915789c-16.168421 0-29.642105 13.473684-29.642105 29.642105v414.989474H150.905263c-13.473684 0-26.947368 8.084211-32.336842 21.557895l-78.147368 164.378947c-2.694737 5.389474-2.694737 10.778947-2.694737 16.168421v177.852632c0 16.168421 13.473684 29.642105 29.642105 29.642105h164.378947c10.778947 0 21.557895-5.389474 29.642106-13.473684l37.726315-45.810527h431.157895l37.726316 48.505264c8.084211 8.084211 16.168421 13.473684 29.642105 13.473684h164.378948c16.168421 0 29.642105-13.473684 29.642105-29.642106v-177.852631c-2.694737-10.778947-2.694737-16.168421-5.389474-21.557895zM512 840.757895h-158.989474l21.557895-88.926316h269.473684l24.252632 88.926316H512z m137.431579-129.347369H369.178947l-97.010526-142.821052H749.136842l-99.705263 142.821052zM256 123.957895h86.231579v24.252631c0 18.863158 13.473684 32.336842 32.336842 32.336842h59.284211c18.863158 0 32.336842-13.473684 32.336842-32.336842v-24.252631h91.621052v24.252631c0 18.863158 13.473684 32.336842 32.336842 32.336842h59.284211c18.863158 0 32.336842-13.473684 32.336842-32.336842v-24.252631h86.231579v406.905263h-512V123.957895z m8.084211 730.273684l-37.726316 45.810526H72.757895v-169.768421l78.147368-161.68421h75.452632l113.178947 167.073684-26.947368 105.094737h-18.863158c-10.778947 0-21.557895 2.694737-29.642105 13.473684z m687.157894 45.810526h-153.6l-37.726316-48.505263c-8.084211-8.084211-16.168421-13.473684-29.642105-13.473684h-24.252631l-29.642106-105.094737 118.568421-167.073684h78.147369l78.147368 164.378947v169.768421z" fill="#101010" p-id="13725"></path><path d="M563.2 476.968421c24.252632-21.557895 32.336842-53.894737 29.642105-78.147368-2.694737-13.473684-8.084211-21.557895-18.863158-24.252632-8.084211-2.694737-16.168421 0-21.557894 2.694737l-2.694737 2.694737c-2.694737 2.694737-8.084211 8.084211-10.778948 8.08421 0 0 0-2.694737 2.694737-8.08421l2.694737-2.694737c5.389474-10.778947 18.863158-48.505263-32.336842-75.452632-5.389474-2.694737-10.778947-2.694737-16.168421 0-5.389474 2.694737-8.084211 8.084211-10.778947 13.473685 0 5.389474-2.694737 13.473684-2.694737 16.168421-2.694737 2.694737-10.778947 13.473684-16.168421 21.557894-10.778947 10.778947-18.863158 21.557895-24.252632 29.642106-8.084211 10.778947-10.778947 40.421053 0 64.673684 5.389474 16.168421 21.557895 35.031579 53.894737 43.115789 8.084211 2.694737 13.473684 2.694737 18.863158 2.694737 16.168421 2.694737 35.031579-2.694737 48.505263-16.168421z m-61.978947-18.863158c-13.473684-2.694737-21.557895-10.778947-26.947369-18.863158-5.389474-13.473684-2.694737-29.642105 0-32.336842 2.694737-5.389474 13.473684-16.168421 18.863158-24.252631 10.778947-13.473684 16.168421-18.863158 18.863158-24.252632 0 2.694737 0 5.389474-2.694737 8.084211v2.694736c-5.389474 10.778947-10.778947 21.557895-5.389474 40.421053 0 2.694737 2.694737 2.694737 2.694737 5.389474 10.778947 13.473684 24.252632 18.863158 32.336842 18.863158 5.389474 0 10.778947 0 13.473685-2.694737-2.694737 8.084211-8.084211 16.168421-13.473685 21.557894-10.778947 5.389474-24.252632 8.084211-37.726315 5.389474z" fill="#101010" p-id="13726"></path><path d="M417.684211 458.105263h-37.726316v-185.936842h264.08421V458.105263h-37.726316c-10.778947 0-18.863158 8.084211-18.863157 18.863158s8.084211 18.863158 18.863157 18.863158H646.736842c18.863158 0 35.031579-16.168421 35.031579-35.031579V269.473684c0-18.863158-16.168421-35.031579-35.031579-35.031579H377.263158c-18.863158 0-35.031579 16.168421-35.031579 35.031579v194.021053c0 18.863158 16.168421 35.031579 35.031579 35.031579h40.421053c10.778947 0 18.863158-8.084211 18.863157-18.863158s-8.084211-21.557895-18.863157-21.557895z" fill="#101010" p-id="13727"></path></svg>
|
||||||
|
After Width: | Height: | Size: 4.6 KiB |
267
klp-ui/src/views/wms/anneal/furnace/index.vue
Normal file
267
klp-ui/src/views/wms/anneal/furnace/index.vue
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
|
<el-form-item label="炉编号" prop="furnaceCode">
|
||||||
|
<el-input v-model="queryParams.furnaceCode" placeholder="请输入炉编号" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称" prop="furnaceName">
|
||||||
|
<el-input v-model="queryParams.furnaceName" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
||||||
|
<el-option label="启用" :value="1" />
|
||||||
|
<el-option label="停用" :value="0" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="忙碌" prop="busyFlag">
|
||||||
|
<el-select v-model="queryParams.busyFlag" placeholder="请选择" clearable>
|
||||||
|
<el-option label="空闲" :value="0" />
|
||||||
|
<el-option label="忙碌" :value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<KLPTable v-loading="loading" :data="furnaceList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="炉编号" align="center" prop="furnaceCode" />
|
||||||
|
<el-table-column label="名称" align="center" prop="furnaceName" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.status === 1" type="success">启用</el-tag>
|
||||||
|
<el-tag v-else type="info">停用</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="忙碌" align="center" prop="busyFlag">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.busyFlag === 1" type="warning">忙碌</el-tag>
|
||||||
|
<el-tag v-else type="success">空闲</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-setting" @click="handleToggleStatus(scope.row)">
|
||||||
|
{{ scope.row.status === 1 ? '停用' : '启用' }}
|
||||||
|
</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-time" @click="handleToggleBusy(scope.row)">
|
||||||
|
{{ scope.row.busyFlag === 1 ? '置闲' : '置忙' }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</KLPTable>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="炉编号" prop="furnaceCode">
|
||||||
|
<el-input v-model="form.furnaceCode" placeholder="请输入炉编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称" prop="furnaceName">
|
||||||
|
<el-input v-model="form.furnaceName" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio :label="1">启用</el-radio>
|
||||||
|
<el-radio :label="0">停用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="忙碌" prop="busyFlag">
|
||||||
|
<el-radio-group v-model="form.busyFlag">
|
||||||
|
<el-radio :label="1">忙碌</el-radio>
|
||||||
|
<el-radio :label="0">空闲</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listAnnealFurnace, getAnnealFurnace, addAnnealFurnace, updateAnnealFurnace, delAnnealFurnace, changeAnnealFurnaceStatus, changeAnnealFurnaceBusy } from "@/api/wms/annealFurnace";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AnnealFurnace",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
buttonLoading: false,
|
||||||
|
loading: true,
|
||||||
|
ids: [],
|
||||||
|
single: true,
|
||||||
|
multiple: true,
|
||||||
|
showSearch: true,
|
||||||
|
total: 0,
|
||||||
|
furnaceList: [],
|
||||||
|
title: "",
|
||||||
|
open: false,
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
furnaceCode: undefined,
|
||||||
|
furnaceName: undefined,
|
||||||
|
status: undefined,
|
||||||
|
busyFlag: undefined,
|
||||||
|
},
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
furnaceCode: [{ required: true, message: "炉编号不能为空", trigger: "blur" }],
|
||||||
|
furnaceName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listAnnealFurnace(this.queryParams).then(response => {
|
||||||
|
this.furnaceList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
furnaceId: undefined,
|
||||||
|
furnaceCode: undefined,
|
||||||
|
furnaceName: undefined,
|
||||||
|
status: 1,
|
||||||
|
busyFlag: 0,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.furnaceId);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加退火炉";
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.loading = true;
|
||||||
|
this.reset();
|
||||||
|
const furnaceId = row.furnaceId || this.ids;
|
||||||
|
getAnnealFurnace(furnaceId).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.form = response.data;
|
||||||
|
if (this.form.status === null || this.form.status === undefined) {
|
||||||
|
this.form.status = 1;
|
||||||
|
}
|
||||||
|
if (this.form.busyFlag === null || this.form.busyFlag === undefined) {
|
||||||
|
this.form.busyFlag = 0;
|
||||||
|
}
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改退火炉";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.furnaceId != null) {
|
||||||
|
updateAnnealFurnace(this.form).then(() => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAnnealFurnace(this.form).then(() => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.furnaceId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除炉子编号为"' + ids + '"的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delAnnealFurnace(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async handleToggleStatus(row) {
|
||||||
|
await this.$confirm(`确定${row.status === 1 ? '停用' : '启用'}该炉子吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.loading = true;
|
||||||
|
await changeAnnealFurnaceStatus({
|
||||||
|
furnaceId: row.furnaceId,
|
||||||
|
status: row.status === 1 ? 0 : 1
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
async handleToggleBusy(row) {
|
||||||
|
await this.$confirm(`确定${row.busyFlag === 1 ? '置闲' : '置忙'}该炉子吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.loading = true;
|
||||||
|
await changeAnnealFurnaceBusy({
|
||||||
|
furnaceId: row.furnaceId,
|
||||||
|
busyFlag: row.busyFlag === 1 ? 0 : 1
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
336
klp-ui/src/views/wms/anneal/overview/index.vue
Normal file
336
klp-ui/src/views/wms/anneal/overview/index.vue
Normal file
@@ -0,0 +1,336 @@
|
|||||||
|
·<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="12" class="summary-row">
|
||||||
|
<el-col :xs="24" :sm="12" :md="6">
|
||||||
|
<div class="summary-card">
|
||||||
|
<div class="summary-title">当前计划数</div>
|
||||||
|
<div class="summary-value">{{ overview.totalPlanCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="6">
|
||||||
|
<div class="summary-card">
|
||||||
|
<div class="summary-title">退火炉(忙碌/全部)</div>
|
||||||
|
<div class="summary-value">{{ overview.furnaceBusyCount || 0 }}/{{ overview.furnaceTotal || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="6">
|
||||||
|
<div class="summary-card">
|
||||||
|
<div class="summary-title">待退火钢卷</div>
|
||||||
|
<div class="summary-value">{{ overview.pendingCoilCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="6">
|
||||||
|
<div class="summary-card">
|
||||||
|
<div class="summary-title">今日已完成</div>
|
||||||
|
<div class="summary-value">
|
||||||
|
计划 {{ overview.todayDonePlanCount || 0 }} | 钢卷 {{ overview.todayDoneCoilCount || 0 }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="panel">
|
||||||
|
<div slot="header" class="panel-title">退火炉状态</div>
|
||||||
|
<div class="furnace-grid">
|
||||||
|
<div v-for="item in overview.furnaces" :key="item.furnaceId" class="furnace-card">
|
||||||
|
<div class="furnace-header">
|
||||||
|
<svg-icon icon-class="furnace" :class="item.busyFlag === 1 ? 'furnace-busy' : 'furnace-idle'" />
|
||||||
|
<div>
|
||||||
|
<div class="furnace-name">{{ item.furnaceName }}</div>
|
||||||
|
<div class="furnace-code">{{ item.furnaceCode }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="furnace-body">
|
||||||
|
<div class="furnace-line">状态:<span :class="item.busyFlag === 1 ? 'busy-text' : 'idle-text'">{{ item.busyFlag === 1 ? '忙碌' : '空闲' }}</span></div>
|
||||||
|
<div v-if="item.busyFlag === 1" class="furnace-line">
|
||||||
|
计划:{{ item.currentPlanNo || '-' }}
|
||||||
|
</div>
|
||||||
|
<div v-if="item.busyFlag === 1" class="furnace-line">
|
||||||
|
当前钢卷:{{ item.coilCount || 0 }}
|
||||||
|
</div>
|
||||||
|
<div v-if="item.busyFlag === 1" class="furnace-line">
|
||||||
|
预计剩余:{{ formatCountdown(item.planEndTime) }}
|
||||||
|
</div>
|
||||||
|
<div v-else class="furnace-line">待入炉计划:{{ planQueueCount(item.furnaceId) }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="panel">
|
||||||
|
<div slot="header" class="panel-title">计划队列</div>
|
||||||
|
<el-table :data="overview.planQueue" v-loading="loading">
|
||||||
|
<el-table-column label="计划号" prop="planNo" align="center" />
|
||||||
|
<el-table-column label="目标炉子" prop="targetFurnaceName" align="center" />
|
||||||
|
<el-table-column label="状态" prop="status" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusTag(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="计划时间" prop="planStartTime" align="center" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="钢卷数" prop="coilCount" align="center" />
|
||||||
|
<el-table-column label="操作" align="center" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-if="scope.row.status === 0" size="mini" type="primary" @click="handleInFurnace(scope.row)">入炉</el-button>
|
||||||
|
<el-button v-if="scope.row.status === 2" size="mini" type="success" @click="openCompleteDialog(scope.row)">完成</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog title="完成退火" :visible.sync="completeOpen" width="720px" append-to-body>
|
||||||
|
<div class="complete-tip">请为每条钢卷分配实际库位,未分配将无法完成。</div>
|
||||||
|
<el-table :data="completeCoils" v-loading="completeLoading" height="360px">
|
||||||
|
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
|
||||||
|
<el-table-column label="实际库位" align="center" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.actualWarehouseId" placeholder="请选择" filterable>
|
||||||
|
<el-option v-for="item in actualWarehouseOptions" :key="item.actualWarehouseId" :label="item.name" :value="item.actualWarehouseId" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitComplete">确 定</el-button>
|
||||||
|
<el-button @click="completeOpen = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAnnealOverview } from "@/api/wms/annealOverview";
|
||||||
|
import { inFurnace, completeAnnealPlan, listAnnealPlanCoils } from "@/api/wms/annealPlan";
|
||||||
|
import { listActualWarehouse } from "@/api/wms/actualWarehouse";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AnnealOverview",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
overview: {
|
||||||
|
furnaces: [],
|
||||||
|
planQueue: []
|
||||||
|
},
|
||||||
|
timer: null,
|
||||||
|
completeOpen: false,
|
||||||
|
completeLoading: false,
|
||||||
|
completeCoils: [],
|
||||||
|
completePlanId: null,
|
||||||
|
actualWarehouseOptions: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchOverview();
|
||||||
|
this.startTimer();
|
||||||
|
this.loadActualWarehouses();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.stopTimer();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchOverview() {
|
||||||
|
this.loading = true;
|
||||||
|
getAnnealOverview().then(response => {
|
||||||
|
this.overview = response.data || { furnaces: [], planQueue: [] };
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
startTimer() {
|
||||||
|
this.stopTimer();
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.$forceUpdate();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
stopTimer() {
|
||||||
|
if (this.timer) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
this.timer = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadActualWarehouses() {
|
||||||
|
listActualWarehouse({ pageNum: 1, pageSize: 999, actualWarehouseType: 2, isEnabled: 1 }).then(response => {
|
||||||
|
this.actualWarehouseOptions = response.rows || [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openCompleteDialog(row) {
|
||||||
|
this.completePlanId = row.planId;
|
||||||
|
this.completeOpen = true;
|
||||||
|
this.completeLoading = true;
|
||||||
|
listAnnealPlanCoils(row.planId).then(response => {
|
||||||
|
this.completeCoils = (response.data || []).map(item => ({
|
||||||
|
coilId: item.coilId,
|
||||||
|
enterCoilNo: item.enterCoilNo,
|
||||||
|
actualWarehouseId: null
|
||||||
|
}));
|
||||||
|
this.completeLoading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.completeLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitComplete() {
|
||||||
|
const missing = this.completeCoils.filter(item => !item.actualWarehouseId);
|
||||||
|
if (missing.length > 0) {
|
||||||
|
this.$message.warning('请先为所有钢卷分配实际库位');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.completeLoading = true;
|
||||||
|
completeAnnealPlan({
|
||||||
|
planId: this.completePlanId,
|
||||||
|
locations: this.completeCoils.map(item => ({
|
||||||
|
coilId: item.coilId,
|
||||||
|
actualWarehouseId: item.actualWarehouseId
|
||||||
|
}))
|
||||||
|
}).then(() => {
|
||||||
|
this.$message.success('已完成');
|
||||||
|
this.completeOpen = false;
|
||||||
|
this.fetchOverview();
|
||||||
|
}).finally(() => {
|
||||||
|
this.completeLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
planQueueCount(furnaceId) {
|
||||||
|
if (!this.overview.planQueue) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return this.overview.planQueue.filter(item => item.targetFurnaceId === furnaceId && item.status !== 2).length;
|
||||||
|
},
|
||||||
|
statusLabel(status) {
|
||||||
|
const map = { 0: '草稿', 1: '已下发', 2: '执行中', 3: '已完成', 4: '已取消' };
|
||||||
|
return map[status] || '-';
|
||||||
|
},
|
||||||
|
statusTag(status) {
|
||||||
|
const map = { 0: 'info', 1: 'warning', 2: 'success', 3: 'success', 4: 'danger' };
|
||||||
|
return map[status] || 'info';
|
||||||
|
},
|
||||||
|
formatCountdown(endTime) {
|
||||||
|
if (!endTime) return '-';
|
||||||
|
const end = new Date(endTime).getTime();
|
||||||
|
const now = Date.now();
|
||||||
|
let diff = Math.max(0, end - now);
|
||||||
|
const hours = Math.floor(diff / (1000 * 60 * 60));
|
||||||
|
diff %= 1000 * 60 * 60;
|
||||||
|
const minutes = Math.floor(diff / (1000 * 60));
|
||||||
|
diff %= 1000 * 60;
|
||||||
|
const seconds = Math.floor(diff / 1000);
|
||||||
|
return `${hours}小时${minutes}分${seconds}秒`;
|
||||||
|
},
|
||||||
|
handleInFurnace(row) {
|
||||||
|
const furnace = this.overview.furnaces.find(item => item.furnaceId === row.targetFurnaceId);
|
||||||
|
if (furnace && furnace.busyFlag === 1) {
|
||||||
|
this.$message.warning(`炉子正忙:计划${furnace.currentPlanNo || ''},钢卷${furnace.coilCount || 0}卷`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm('确定入炉该计划吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
return inFurnace({ planId: row.planId });
|
||||||
|
}).then(() => {
|
||||||
|
this.$message.success('入炉成功');
|
||||||
|
this.fetchOverview();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.summary-row {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.summary-card {
|
||||||
|
border: 1px solid #f0f2f5;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
height: 90px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.summary-title {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
.summary-value {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
.panel {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border: 1px solid #f0f2f5;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.panel-title {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
.furnace-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.furnace-card {
|
||||||
|
border: 1px solid #f0f2f5;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.furnace-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.furnace-name {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
.furnace-code {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
.furnace-body {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
.furnace-line {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.furnace-idle {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
.furnace-busy {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
.busy-text {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
.idle-text {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
:deep(.el-table th),
|
||||||
|
:deep(.el-table td) {
|
||||||
|
border-bottom: 1px solid #f0f2f5;
|
||||||
|
}
|
||||||
|
:deep(.el-table::before) {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
border-bottom: 1px solid #f0f2f5;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
106
klp-ui/src/views/wms/anneal/performance/index.vue
Normal file
106
klp-ui/src/views/wms/anneal/performance/index.vue
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container" v-loading="loading">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="90px">
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="目标炉" prop="targetFurnaceId">
|
||||||
|
<el-select v-model="queryParams.targetFurnaceId" placeholder="请选择" clearable filterable>
|
||||||
|
<el-option v-for="item in furnaceOptions" :key="item.furnaceId" :label="item.furnaceName" :value="item.furnaceId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计划号" prop="planNo">
|
||||||
|
<el-input v-model="queryParams.planNo" placeholder="请输入计划号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||||
|
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-descriptions title="统计信息" :column="3" class="summary-block" border>
|
||||||
|
<el-descriptions-item label="计划数量">{{ summary.planCount || 0 }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="钢卷数量">{{ summary.coilCount || 0 }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="总重量">{{ summary.totalWeight || 0 }} t</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-table :data="detailList" border height="calc(100vh - 330px)">
|
||||||
|
<el-table-column label="计划号" prop="planNo" align="center" />
|
||||||
|
<el-table-column label="目标炉" prop="targetFurnaceName" align="center" />
|
||||||
|
<el-table-column label="开始时间" prop="actualStartTime" align="center" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.actualStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="结束时间" prop="endTime" align="center" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
|
||||||
|
<el-table-column label="当前钢卷号" prop="currentCoilNo" align="center" />
|
||||||
|
<el-table-column label="重量(t)" prop="netWeight" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAnnealPerformance } from "@/api/wms/annealPerformance";
|
||||||
|
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AnnealPerformance",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
queryParams: {
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
targetFurnaceId: undefined,
|
||||||
|
planNo: undefined,
|
||||||
|
enterCoilNo: undefined,
|
||||||
|
},
|
||||||
|
summary: {},
|
||||||
|
detailList: [],
|
||||||
|
furnaceOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.loadFurnaces();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadFurnaces() {
|
||||||
|
listAnnealFurnace({ pageNum: 1, pageSize: 999, status: 1 }).then(response => {
|
||||||
|
this.furnaceOptions = response.rows || [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.loading = true;
|
||||||
|
getAnnealPerformance(this.queryParams).then(response => {
|
||||||
|
const data = response.data || {};
|
||||||
|
this.summary = data.summary || {};
|
||||||
|
this.detailList = data.details || [];
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.summary-block {
|
||||||
|
margin: 12px 0 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
610
klp-ui/src/views/wms/anneal/plan/index.vue
Normal file
610
klp-ui/src/views/wms/anneal/plan/index.vue
Normal file
@@ -0,0 +1,610 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||||
|
<el-form-item label="计划号" prop="planNo">
|
||||||
|
<el-input v-model="queryParams.planNo" placeholder="请输入计划号" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="目标炉" prop="targetFurnaceId">
|
||||||
|
<el-select v-model="queryParams.targetFurnaceId" placeholder="请选择" clearable filterable>
|
||||||
|
<el-option v-for="item in furnaceOptions" :key="item.furnaceId" :label="item.furnaceName" :value="item.furnaceId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
||||||
|
<el-option label="未开始" :value="0" />
|
||||||
|
<el-option label="进行中" :value="2" />
|
||||||
|
<el-option label="已完成" :value="3" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<KLPTable v-loading="loading" :data="planList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="计划号" align="center" prop="planNo" />
|
||||||
|
<el-table-column label="计划时间" align="center" prop="planStartTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="目标炉" align="center" prop="targetFurnaceName" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusTag(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开始时间" align="center" prop="actualStartTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.actualStartTime || scope.row.planStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="结束时间" align="center" prop="endTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(scope.row)">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(scope.row)">删除</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-s-operation" @click.stop="openStatusDialog(scope.row)">状态</el-button>
|
||||||
|
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-s-flag" @click.stop="handleInFurnace(scope.row)">入炉</el-button>
|
||||||
|
<el-button v-if="scope.row.status === 2" size="mini" type="text" icon="el-icon-check" @click.stop="handleComplete(scope.row)">完成</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</KLPTable>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="mt16">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card shadow="never" class="panel-card">
|
||||||
|
<div slot="header" class="panel-header">
|
||||||
|
<span>领料列表</span>
|
||||||
|
<el-button size="mini" icon="el-icon-refresh" @click="getMaterialCoils">刷新</el-button>
|
||||||
|
</div>
|
||||||
|
<el-form :model="materialQueryParams" ref="materialQueryForm" size="small" :inline="true" class="mb8">
|
||||||
|
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||||
|
<el-input v-model="materialQueryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable style="width: 160px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="当前钢卷号" prop="currentCoilNo">
|
||||||
|
<el-input v-model="materialQueryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable style="width: 160px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div v-loading="materialLoading" class="material-grid">
|
||||||
|
<div v-if="materialList.length === 0" class="empty-tip">
|
||||||
|
<el-empty description="暂无待领物料" />
|
||||||
|
</div>
|
||||||
|
<div v-for="item in materialList" :key="item.coilId" class="material-card">
|
||||||
|
<div class="material-header">
|
||||||
|
<div>
|
||||||
|
<div class="material-title">{{ item.currentCoilNo || '-' }}</div>
|
||||||
|
<div class="material-sub">入场:{{ item.enterCoilNo || '-' }}</div>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" size="mini" @click="handleAddToPlan(item)" :disabled="!currentPlan.planId || currentPlan.status === 2">加入计划</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="material-body">
|
||||||
|
<div class="material-row">厂家:{{ item.supplierCoilNo || '-' }}</div>
|
||||||
|
<div class="material-row">库位:{{ item.actualWarehouseName || '-' }}</div>
|
||||||
|
<div class="material-row">重量:{{ item.netWeight || '-' }}t</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<pagination v-show="materialTotal > 0" :total="materialTotal" :page.sync="materialQueryParams.pageNum"
|
||||||
|
:limit.sync="materialQueryParams.pageSize" @pagination="getMaterialCoils" />
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card shadow="never" class="panel-card">
|
||||||
|
<div slot="header" class="panel-header">
|
||||||
|
<span>退火计划</span>
|
||||||
|
<div>
|
||||||
|
<el-button size="mini" icon="el-icon-refresh" @click="loadPlanCoils" :disabled="!currentPlan.planId">刷新</el-button>
|
||||||
|
<el-button size="mini" type="success" icon="el-icon-check" :disabled="!currentPlan.planId || currentPlan.status !== 2" @click="openCompleteDialog">完成退火</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="!currentPlan.planId" class="empty-tip">
|
||||||
|
<el-empty description="请点击上方选择一个计划" />
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div class="plan-summary">
|
||||||
|
<div>计划号:{{ currentPlan.planNo }}</div>
|
||||||
|
<div>目标炉:{{ currentPlan.targetFurnaceName || '-' }}</div>
|
||||||
|
<div>状态:{{ statusLabel(currentPlan.status) }}</div>
|
||||||
|
</div>
|
||||||
|
<el-table :data="coilList" v-loading="coilLoading" class="light-table">
|
||||||
|
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际库位" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.actualWarehouseId" placeholder="选择库位" clearable size="mini" filterable>
|
||||||
|
<el-option v-for="item in actualWarehouseOptions" :key="item.actualWarehouseId" :label="item.actualWarehouseName" :value="item.actualWarehouseId" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)" :disabled="currentPlan.status === 2">解绑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="520px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||||
|
<el-form-item label="计划号" prop="planNo">
|
||||||
|
<el-input v-model="form.planNo" placeholder="请输入计划号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计划开始" prop="planStartTime">
|
||||||
|
<el-date-picker clearable v-model="form.planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择计划时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="目标炉" prop="targetFurnaceId">
|
||||||
|
<el-select v-model="form.targetFurnaceId" placeholder="请选择" filterable>
|
||||||
|
<el-option v-for="item in furnaceOptions" :key="item.furnaceId" :label="item.furnaceName" :value="item.furnaceId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="form.status" placeholder="请选择">
|
||||||
|
<el-option label="草稿" :value="0" />
|
||||||
|
<el-option label="已下发" :value="1" />
|
||||||
|
<el-option label="执行中" :value="2" />
|
||||||
|
<el-option label="已完成" :value="3" />
|
||||||
|
<el-option label="已取消" :value="4" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="更新状态" :visible.sync="statusOpen" width="360px" append-to-body>
|
||||||
|
<el-form label-width="90px">
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select v-model="statusForm.status" placeholder="请选择">
|
||||||
|
<el-option label="未开始" :value="0" />
|
||||||
|
<el-option label="进行中" :value="2" />
|
||||||
|
<el-option label="已完成" :value="3" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitStatus">确 定</el-button>
|
||||||
|
<el-button @click="statusOpen = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listAnnealPlan, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
||||||
|
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||||
|
import { listMaterialCoil } from "@/api/wms/coil";
|
||||||
|
import { listActualWarehouse } from "@/api/wms/actualWarehouse";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AnnealPlan",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
buttonLoading: false,
|
||||||
|
loading: true,
|
||||||
|
coilLoading: false,
|
||||||
|
ids: [],
|
||||||
|
single: true,
|
||||||
|
multiple: true,
|
||||||
|
showSearch: true,
|
||||||
|
total: 0,
|
||||||
|
planList: [],
|
||||||
|
furnaceOptions: [],
|
||||||
|
title: "",
|
||||||
|
open: false,
|
||||||
|
statusOpen: false,
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
planNo: undefined,
|
||||||
|
targetFurnaceId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
},
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
planNo: [{ required: true, message: "计划号不能为空", trigger: "blur" }],
|
||||||
|
targetFurnaceId: [{ required: true, message: "目标炉子不能为空", trigger: "change" }],
|
||||||
|
},
|
||||||
|
currentPlan: {},
|
||||||
|
coilList: [],
|
||||||
|
materialLoading: false,
|
||||||
|
materialTotal: 0,
|
||||||
|
materialList: [],
|
||||||
|
materialQueryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
enterCoilNo: undefined,
|
||||||
|
currentCoilNo: undefined,
|
||||||
|
status: 0,
|
||||||
|
dataType: 1,
|
||||||
|
},
|
||||||
|
actualWarehouseOptions: [],
|
||||||
|
statusForm: {
|
||||||
|
planId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.loadFurnaces();
|
||||||
|
this.getMaterialCoils();
|
||||||
|
this.loadActualWarehouses();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listAnnealPlan(this.queryParams).then(response => {
|
||||||
|
this.planList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadFurnaces() {
|
||||||
|
listAnnealFurnace({ pageNum: 1, pageSize: 999, status: 1 }).then(response => {
|
||||||
|
this.furnaceOptions = response.rows || [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleRowClick(row) {
|
||||||
|
this.currentPlan = row;
|
||||||
|
this.loadPlanCoils();
|
||||||
|
},
|
||||||
|
getMaterialCoils() {
|
||||||
|
this.materialLoading = true;
|
||||||
|
listMaterialCoil(this.materialQueryParams).then(response => {
|
||||||
|
this.materialList = response.rows || [];
|
||||||
|
this.materialTotal = response.total || 0;
|
||||||
|
this.materialLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleMaterialQuery() {
|
||||||
|
this.materialQueryParams.pageNum = 1;
|
||||||
|
this.getMaterialCoils();
|
||||||
|
},
|
||||||
|
resetMaterialQuery() {
|
||||||
|
this.resetForm("materialQueryForm");
|
||||||
|
this.resetMaterialForm();
|
||||||
|
this.handleMaterialQuery();
|
||||||
|
},
|
||||||
|
loadActualWarehouses() {
|
||||||
|
listActualWarehouse({ pageNum: 1, pageSize: 999, actualWarehouseType: 2, isEnabled: 1 }).then(response => {
|
||||||
|
this.actualWarehouseOptions = response.rows || [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openCompleteDialog() {
|
||||||
|
if (!this.currentPlan.planId) {
|
||||||
|
this.$message.warning('请先选择计划');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.currentPlan.status !== 2) {
|
||||||
|
this.$message.warning('计划未进行中,无法完成');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm('完成计划前请为每条钢卷选择实际库位,确认继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.handleComplete(this.currentPlan);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleAddToPlan(item) {
|
||||||
|
if (!this.currentPlan.planId) {
|
||||||
|
this.$message.warning('请先选择计划');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.currentPlan.status === 2) {
|
||||||
|
this.$message.warning('当前计划进行中,无法再领料');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.coilLoading = true;
|
||||||
|
bindAnnealPlanCoils({
|
||||||
|
planId: this.currentPlan.planId,
|
||||||
|
coilId: item.coilId
|
||||||
|
}).then(() => {
|
||||||
|
this.$message.success('已加入计划');
|
||||||
|
this.loadPlanCoils();
|
||||||
|
}).finally(() => {
|
||||||
|
this.coilLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadPlanCoils() {
|
||||||
|
if (!this.currentPlan.planId) {
|
||||||
|
this.coilList = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.coilLoading = true;
|
||||||
|
listAnnealPlanCoils(this.currentPlan.planId).then(response => {
|
||||||
|
this.coilList = response.data || [];
|
||||||
|
this.coilLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
planId: undefined,
|
||||||
|
planNo: undefined,
|
||||||
|
planStartTime: undefined,
|
||||||
|
targetFurnaceId: undefined,
|
||||||
|
status: 0,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
resetMaterialForm() {
|
||||||
|
this.materialQueryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
enterCoilNo: undefined,
|
||||||
|
currentCoilNo: undefined,
|
||||||
|
status: 0,
|
||||||
|
dataType: 1,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.planId);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加退火计划";
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.loading = true;
|
||||||
|
this.reset();
|
||||||
|
const planId = row.planId || this.ids;
|
||||||
|
getAnnealPlan(planId).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改退火计划";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.planId != null) {
|
||||||
|
updateAnnealPlan(this.form).then(() => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAnnealPlan(this.form).then(() => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.planId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除计划编号为"' + ids + '"的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delAnnealPlan(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openStatusDialog(row) {
|
||||||
|
this.statusForm = {
|
||||||
|
planId: row.planId,
|
||||||
|
status: row.status,
|
||||||
|
};
|
||||||
|
this.statusOpen = true;
|
||||||
|
},
|
||||||
|
submitStatus() {
|
||||||
|
changeAnnealPlanStatus(this.statusForm).then(() => {
|
||||||
|
this.$modal.msgSuccess("状态已更新");
|
||||||
|
this.statusOpen = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async handleInFurnace(row) {
|
||||||
|
await this.$confirm('确定执行入炉操作吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.loading = true;
|
||||||
|
await inFurnace({ planId: row.planId });
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
if (this.currentPlan.planId === row.planId) {
|
||||||
|
this.loadPlanCoils();
|
||||||
|
}
|
||||||
|
this.$message.success('已入炉');
|
||||||
|
},
|
||||||
|
async handleComplete(row) {
|
||||||
|
const locations = (this.coilList || []).map(item => ({
|
||||||
|
coilId: item.coilId,
|
||||||
|
actualWarehouseId: item.actualWarehouseId
|
||||||
|
}));
|
||||||
|
const missing = locations.filter(item => !item.actualWarehouseId);
|
||||||
|
if (missing.length > 0) {
|
||||||
|
this.$message.warning('请先为所有钢卷分配实际库位');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
await completeAnnealPlan({
|
||||||
|
planId: row.planId,
|
||||||
|
locations: locations
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.loadPlanCoils();
|
||||||
|
this.$message.success('已完成');
|
||||||
|
},
|
||||||
|
handleUnbind(row) {
|
||||||
|
this.$confirm('确定解绑该钢卷吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
return unbindAnnealPlanCoil({
|
||||||
|
planId: this.currentPlan.planId,
|
||||||
|
coilId: row.coilId
|
||||||
|
});
|
||||||
|
}).then(() => {
|
||||||
|
this.$message.success('解绑成功');
|
||||||
|
this.loadPlanCoils();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
statusLabel(status) {
|
||||||
|
if (status === 2) {
|
||||||
|
return '进行中';
|
||||||
|
}
|
||||||
|
if (status === 3) {
|
||||||
|
return '已完成';
|
||||||
|
}
|
||||||
|
return '未开始';
|
||||||
|
},
|
||||||
|
statusTag(status) {
|
||||||
|
if (status === 2) {
|
||||||
|
return 'success';
|
||||||
|
}
|
||||||
|
if (status === 3) {
|
||||||
|
return 'info';
|
||||||
|
}
|
||||||
|
return 'warning';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.mt16 {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
.empty-tip {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.panel-card {
|
||||||
|
border: 1px solid #f0f2f5;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
.panel-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.material-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
min-height: 120px;
|
||||||
|
}
|
||||||
|
.material-card {
|
||||||
|
border: 1px solid #e9ecf2;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.material-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.material-title {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
.material-sub {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
.material-body {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #606266;
|
||||||
|
display: grid;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.material-row {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.plan-summary {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(120px, 1fr));
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #606266;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
border-bottom: 1px solid #f0f2f5;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
:deep(.el-table th),
|
||||||
|
:deep(.el-table td) {
|
||||||
|
border-bottom: 1px solid #f0f2f5;
|
||||||
|
}
|
||||||
|
:deep(.el-table::before) {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealOverviewVo;
|
||||||
|
import com.klp.service.IWmsAnnealOverviewService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/anneal/overview")
|
||||||
|
public class WmsAnnealOverviewController {
|
||||||
|
|
||||||
|
private final IWmsAnnealOverviewService overviewService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总览数据
|
||||||
|
*/
|
||||||
|
@GetMapping
|
||||||
|
public R<WmsAnnealOverviewVo> getOverview() {
|
||||||
|
return R.ok(overviewService.queryOverview());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
||||||
|
import com.klp.service.IWmsAnnealPerformanceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/anneal/performance")
|
||||||
|
public class WmsAnnealPerformanceController {
|
||||||
|
|
||||||
|
private final IWmsAnnealPerformanceService performanceService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public R<WmsAnnealPerformanceVo> getPerformance(WmsAnnealPerformanceBo bo) {
|
||||||
|
return R.ok(performanceService.queryPerformance(bo));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import com.klp.common.annotation.Log;
|
||||||
|
import com.klp.common.annotation.RepeatSubmit;
|
||||||
|
import com.klp.common.core.controller.BaseController;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import com.klp.common.enums.BusinessType;
|
||||||
|
import com.klp.domain.bo.WmsFurnaceBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnaceBusyBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnaceStatusBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnaceVo;
|
||||||
|
import com.klp.service.IWmsFurnaceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉管理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/anneal/furnace")
|
||||||
|
public class WmsFurnaceController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsFurnaceService iWmsFurnaceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询炉子列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsFurnaceVo> list(WmsFurnaceBo bo, PageQuery pageQuery) {
|
||||||
|
return iWmsFurnaceService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取炉子详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/{furnaceId}")
|
||||||
|
public R<WmsFurnaceVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long furnaceId) {
|
||||||
|
return R.ok(iWmsFurnaceService.queryById(furnaceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增炉子
|
||||||
|
*/
|
||||||
|
@Log(title = "退火炉", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsFurnaceBo bo) {
|
||||||
|
return toAjax(iWmsFurnaceService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改炉子
|
||||||
|
*/
|
||||||
|
@Log(title = "退火炉", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsFurnaceBo bo) {
|
||||||
|
return toAjax(iWmsFurnaceService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用停用
|
||||||
|
*/
|
||||||
|
@Log(title = "退火炉", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/status")
|
||||||
|
public R<Void> changeStatus(@Validated @RequestBody WmsFurnaceStatusBo bo) {
|
||||||
|
return toAjax(iWmsFurnaceService.updateStatus(bo.getFurnaceId(), bo.getStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置忙/置闲
|
||||||
|
*/
|
||||||
|
@Log(title = "退火炉", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/busy")
|
||||||
|
public R<Void> changeBusy(@Validated @RequestBody WmsFurnaceBusyBo bo) {
|
||||||
|
return toAjax(iWmsFurnaceService.updateBusy(bo.getFurnaceId(), bo.getBusyFlag()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除炉子
|
||||||
|
*/
|
||||||
|
@Log(title = "退火炉", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{furnaceIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] furnaceIds) {
|
||||||
|
return toAjax(iWmsFurnaceService.deleteWithValidByIds(Arrays.asList(furnaceIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import com.klp.common.annotation.Log;
|
||||||
|
import com.klp.common.annotation.RepeatSubmit;
|
||||||
|
import com.klp.common.core.controller.BaseController;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import com.klp.common.enums.BusinessType;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanCoilBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanInFurnaceBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanLocationBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanStatusBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanCoilVo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanVo;
|
||||||
|
import com.klp.service.IWmsFurnacePlanService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/anneal/plan")
|
||||||
|
public class WmsFurnacePlanController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsFurnacePlanService iWmsFurnacePlanService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退火计划列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsFurnacePlanVo> list(WmsFurnacePlanBo bo, PageQuery pageQuery) {
|
||||||
|
return iWmsFurnacePlanService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退火计划详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/{planId}")
|
||||||
|
public R<WmsFurnacePlanVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long planId) {
|
||||||
|
return R.ok(iWmsFurnacePlanService.queryById(planId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增退火计划
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsFurnacePlanBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改退火计划
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsFurnacePlanBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新计划状态
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/status")
|
||||||
|
public R<Void> changeStatus(@Validated @RequestBody WmsFurnacePlanStatusBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.updateStatus(bo.getPlanId(), bo.getStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入炉
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/in-furnace")
|
||||||
|
public R<Void> inFurnace(@Validated @RequestBody WmsFurnacePlanInFurnaceBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.inFurnace(bo.getPlanId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成退火
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PutMapping("/complete")
|
||||||
|
public R<Void> complete(@Validated @RequestBody WmsFurnacePlanLocationBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.completePlan(bo.getPlanId(), bo.getLocations()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除退火计划
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{planIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] planIds) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计划钢卷列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/coil/list")
|
||||||
|
public R<List<WmsFurnacePlanCoilVo>> listCoils(@NotNull(message = "计划ID不能为空") @RequestParam Long planId) {
|
||||||
|
return R.ok(iWmsFurnacePlanService.queryPlanCoils(planId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定钢卷
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划钢卷", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/coil/bind")
|
||||||
|
public R<Void> bindCoils(@Validated(AddGroup.class) @RequestBody WmsFurnacePlanCoilBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.bindPlanCoils(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解绑钢卷
|
||||||
|
*/
|
||||||
|
@Log(title = "退火计划钢卷", businessType = BusinessType.DELETE)
|
||||||
|
@RepeatSubmit
|
||||||
|
@DeleteMapping("/coil/unbind")
|
||||||
|
public R<Void> unbindCoil(@Validated @RequestBody WmsFurnacePlanCoilBo bo) {
|
||||||
|
return toAjax(iWmsFurnacePlanService.unbindPlanCoil(bo));
|
||||||
|
}
|
||||||
|
}
|
||||||
59
klp-wms/src/main/java/com/klp/domain/WmsFurnace.java
Normal file
59
klp-wms/src/main/java/com/klp/domain/WmsFurnace.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
package com.klp.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉信息表对象 wms_furnace
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_furnace")
|
||||||
|
public class WmsFurnace extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉子ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "furnace_id")
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉编号
|
||||||
|
*/
|
||||||
|
private String furnaceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String furnaceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否忙碌(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer busyFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0=停用,1=启用)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
71
klp-wms/src/main/java/com/klp/domain/WmsFurnacePlan.java
Normal file
71
klp-wms/src/main/java/com/klp/domain/WmsFurnacePlan.java
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package com.klp.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划对象 wms_furnace_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_furnace_plan")
|
||||||
|
public class WmsFurnacePlan extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "plan_id")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划号
|
||||||
|
*/
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际开始时间
|
||||||
|
*/
|
||||||
|
private Date actualStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标炉子ID
|
||||||
|
*/
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(0草稿 1已下发 2执行中 3已完成 4已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
44
klp-wms/src/main/java/com/klp/domain/WmsFurnacePlanCoil.java
Normal file
44
klp-wms/src/main/java/com/klp/domain/WmsFurnacePlanCoil.java
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package com.klp.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷关系对象 wms_furnace_plan_coil
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_furnace_plan_coil")
|
||||||
|
public class WmsFurnacePlanCoil extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划钢卷ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "plan_coil_id")
|
||||||
|
private Long planCoilId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划ID
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷ID
|
||||||
|
*/
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩查询业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPerformanceBo {
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
private String enterCoilNo;
|
||||||
|
}
|
||||||
57
klp-wms/src/main/java/com/klp/domain/bo/WmsFurnaceBo.java
Normal file
57
klp-wms/src/main/java/com/klp/domain/bo/WmsFurnaceBo.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉业务对象 wms_furnace
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsFurnaceBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉子ID
|
||||||
|
*/
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉编号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "炉编号不能为空")
|
||||||
|
private String furnaceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "名称不能为空")
|
||||||
|
private String furnaceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否忙碌(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer busyFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0=停用,1=启用)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量操作ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空", groups = {com.klp.common.core.validate.EditGroup.class})
|
||||||
|
private Long[] furnaceIds;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉忙碌状态更新业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnaceBusyBo {
|
||||||
|
|
||||||
|
@NotNull(message = "炉子ID不能为空")
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
@NotNull(message = "忙碌状态不能为空")
|
||||||
|
private Integer busyFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划业务对象 wms_furnace_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsFurnacePlanBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划ID
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "计划号不能为空")
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date actualStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标炉子ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "目标炉子不能为空")
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(0草稿 1已下发 2执行中 3已完成 4已取消)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷关系业务对象 wms_furnace_plan_coil
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsFurnacePlanCoilBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划钢卷ID
|
||||||
|
*/
|
||||||
|
private Long planCoilId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "计划ID不能为空")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷ID
|
||||||
|
*/
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷ID列表(逗号分隔)
|
||||||
|
*/
|
||||||
|
private String coilIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入场钢卷号(逗号分隔)
|
||||||
|
*/
|
||||||
|
private String enterCoilNos;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前钢卷号(逗号分隔)
|
||||||
|
*/
|
||||||
|
private String currentCoilNos;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划入炉业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnacePlanInFurnaceBo {
|
||||||
|
|
||||||
|
@NotNull(message = "计划ID不能为空")
|
||||||
|
private Long planId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划库位分配业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnacePlanLocationBo {
|
||||||
|
|
||||||
|
@NotNull(message = "计划ID不能为空")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@NotEmpty(message = "库位分配不能为空")
|
||||||
|
private List<WmsFurnacePlanLocationItemBo> locations;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷库位分配项
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnacePlanLocationItemBo {
|
||||||
|
|
||||||
|
@NotNull(message = "钢卷ID不能为空")
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
@NotNull(message = "实际库位不能为空")
|
||||||
|
private Long actualWarehouseId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划状态更新业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnacePlanStatusBo {
|
||||||
|
|
||||||
|
@NotNull(message = "计划ID不能为空")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@NotNull(message = "状态不能为空")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉启用状态更新业务对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsFurnaceStatusBo {
|
||||||
|
|
||||||
|
@NotNull(message = "炉子ID不能为空")
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
@NotNull(message = "状态不能为空")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉总览信息
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealFurnaceOverviewVo {
|
||||||
|
|
||||||
|
private Long furnaceId;
|
||||||
|
private String furnaceCode;
|
||||||
|
private String furnaceName;
|
||||||
|
private Integer busyFlag;
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正在执行的计划
|
||||||
|
*/
|
||||||
|
private WmsFurnacePlanVo runningPlan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前炉内钢卷
|
||||||
|
*/
|
||||||
|
private List<WmsFurnacePlanCoilVo> runningCoils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间(用于倒计时)
|
||||||
|
*/
|
||||||
|
private Date planEndTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览统计信息
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealOverviewStatsVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前计划数
|
||||||
|
*/
|
||||||
|
private Long planCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉子总数
|
||||||
|
*/
|
||||||
|
private Long furnaceTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉子忙碌数
|
||||||
|
*/
|
||||||
|
private Long furnaceBusy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待退火钢卷数
|
||||||
|
*/
|
||||||
|
private Long pendingCoilCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日已完成计划数
|
||||||
|
*/
|
||||||
|
private Long todayFinishedPlanCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日已完成钢卷数
|
||||||
|
*/
|
||||||
|
private Long todayFinishedCoilCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷关系视图对象 wms_furnace_plan_coil
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsFurnacePlanCoilVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划钢卷ID")
|
||||||
|
private Long planCoilId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划ID")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "钢卷ID")
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "入场钢卷号")
|
||||||
|
private String enterCoilNo;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划视图对象 wms_furnace_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsFurnacePlanVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划ID")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划号")
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划开始时间")
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "实际开始时间")
|
||||||
|
private Date actualStartTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "目标炉子ID")
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "目标炉子名称")
|
||||||
|
private String targetFurnaceName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "计划状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private List<Long> coilIds;
|
||||||
|
}
|
||||||
39
klp-wms/src/main/java/com/klp/domain/vo/WmsFurnaceVo.java
Normal file
39
klp-wms/src/main/java/com/klp/domain/vo/WmsFurnaceVo.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉视图对象 wms_furnace
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsFurnaceVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "炉子ID")
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "炉编号")
|
||||||
|
private String furnaceCode;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "名称")
|
||||||
|
private String furnaceName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "是否忙碌")
|
||||||
|
private Integer busyFlag;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉状态视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealFurnaceStatusVo {
|
||||||
|
|
||||||
|
private Long furnaceId;
|
||||||
|
|
||||||
|
private String furnaceCode;
|
||||||
|
|
||||||
|
private String furnaceName;
|
||||||
|
|
||||||
|
private Integer busyFlag;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Long currentPlanId;
|
||||||
|
|
||||||
|
private String currentPlanNo;
|
||||||
|
|
||||||
|
private Date planEndTime;
|
||||||
|
|
||||||
|
private Long coilCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealOverviewVo {
|
||||||
|
|
||||||
|
private Long totalPlanCount;
|
||||||
|
|
||||||
|
private Long furnaceTotal;
|
||||||
|
|
||||||
|
private Long furnaceBusyCount;
|
||||||
|
|
||||||
|
private Long pendingCoilCount;
|
||||||
|
|
||||||
|
private Long todayDonePlanCount;
|
||||||
|
|
||||||
|
private Long todayDoneCoilCount;
|
||||||
|
|
||||||
|
private List<WmsAnnealFurnaceStatusVo> furnaces;
|
||||||
|
|
||||||
|
private List<WmsAnnealPlanQueueVo> planQueue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩明细视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPerformanceDetailVo {
|
||||||
|
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
private String targetFurnaceName;
|
||||||
|
|
||||||
|
private Date actualStartTime;
|
||||||
|
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
private String enterCoilNo;
|
||||||
|
|
||||||
|
private String currentCoilNo;
|
||||||
|
|
||||||
|
private BigDecimal netWeight;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩统计视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPerformanceSummaryVo {
|
||||||
|
|
||||||
|
private Long planCount;
|
||||||
|
|
||||||
|
private Long coilCount;
|
||||||
|
|
||||||
|
private BigDecimal totalWeight;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩返回视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPerformanceVo {
|
||||||
|
|
||||||
|
private WmsAnnealPerformanceSummaryVo summary;
|
||||||
|
|
||||||
|
private List<WmsAnnealPerformanceDetailVo> details;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.klp.domain.vo.anneal;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划队列视图对象
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPlanQueueVo {
|
||||||
|
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
private Long targetFurnaceId;
|
||||||
|
|
||||||
|
private String targetFurnaceName;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
private Date actualStartTime;
|
||||||
|
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
private Long coilCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealFurnaceStatusVo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPlanQueueVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsAnnealOverviewMapper {
|
||||||
|
|
||||||
|
Long selectTotalPlanCount();
|
||||||
|
|
||||||
|
Long selectFurnaceTotal();
|
||||||
|
|
||||||
|
Long selectFurnaceBusyCount();
|
||||||
|
|
||||||
|
Long selectPendingCoilCount();
|
||||||
|
|
||||||
|
Long selectTodayDonePlanCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
|
||||||
|
|
||||||
|
Long selectTodayDoneCoilCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
|
||||||
|
|
||||||
|
List<WmsAnnealFurnaceStatusVo> selectFurnaceStatusList();
|
||||||
|
|
||||||
|
List<WmsAnnealPlanQueueVo> selectPlanQueueList();
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceDetailVo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceSummaryVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩Mapper
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsAnnealPerformanceMapper {
|
||||||
|
|
||||||
|
WmsAnnealPerformanceSummaryVo selectSummary(WmsAnnealPerformanceBo bo);
|
||||||
|
|
||||||
|
List<WmsAnnealPerformanceDetailVo> selectDetails(WmsAnnealPerformanceBo bo);
|
||||||
|
}
|
||||||
14
klp-wms/src/main/java/com/klp/mapper/WmsFurnaceMapper.java
Normal file
14
klp-wms/src/main/java/com/klp/mapper/WmsFurnaceMapper.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsFurnace;
|
||||||
|
import com.klp.domain.vo.WmsFurnaceVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsFurnaceMapper extends BaseMapperPlus<WmsFurnaceMapper, WmsFurnace, WmsFurnaceVo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsFurnacePlanCoil;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanCoilVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷关系Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsFurnacePlanCoilMapper extends BaseMapperPlus<WmsFurnacePlanCoilMapper, WmsFurnacePlanCoil, WmsFurnacePlanCoilVo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsFurnacePlan;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsFurnacePlanMapper extends BaseMapperPlus<WmsFurnacePlanMapper, WmsFurnacePlan, WmsFurnacePlanVo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealOverviewVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface IWmsAnnealOverviewService {
|
||||||
|
|
||||||
|
WmsAnnealOverviewVo queryOverview();
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface IWmsAnnealPerformanceService {
|
||||||
|
|
||||||
|
WmsAnnealPerformanceVo queryPerformance(WmsAnnealPerformanceBo bo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanCoilBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanCoilVo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface IWmsFurnacePlanService {
|
||||||
|
|
||||||
|
WmsFurnacePlanVo queryById(Long planId);
|
||||||
|
|
||||||
|
TableDataInfo<WmsFurnacePlanVo> queryPageList(WmsFurnacePlanBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<WmsFurnacePlanVo> queryList(WmsFurnacePlanBo bo);
|
||||||
|
|
||||||
|
Boolean insertByBo(WmsFurnacePlanBo bo);
|
||||||
|
|
||||||
|
Boolean updateByBo(WmsFurnacePlanBo bo);
|
||||||
|
|
||||||
|
Boolean updateStatus(Long planId, Integer status);
|
||||||
|
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
List<WmsFurnacePlanCoilVo> queryPlanCoils(Long planId);
|
||||||
|
|
||||||
|
Boolean bindPlanCoils(WmsFurnacePlanCoilBo bo);
|
||||||
|
|
||||||
|
Boolean unbindPlanCoil(WmsFurnacePlanCoilBo bo);
|
||||||
|
|
||||||
|
Boolean inFurnace(Long planId);
|
||||||
|
|
||||||
|
Boolean completePlan(Long planId, List<com.klp.domain.bo.WmsFurnacePlanLocationItemBo> locations);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.domain.bo.WmsFurnaceBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnaceVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface IWmsFurnaceService {
|
||||||
|
|
||||||
|
WmsFurnaceVo queryById(Long furnaceId);
|
||||||
|
|
||||||
|
TableDataInfo<WmsFurnaceVo> queryPageList(WmsFurnaceBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<WmsFurnaceVo> queryList(WmsFurnaceBo bo);
|
||||||
|
|
||||||
|
Boolean insertByBo(WmsFurnaceBo bo);
|
||||||
|
|
||||||
|
Boolean updateByBo(WmsFurnaceBo bo);
|
||||||
|
|
||||||
|
Boolean updateStatus(Long furnaceId, Integer status);
|
||||||
|
|
||||||
|
Boolean updateBusy(Long furnaceId, Integer busyFlag);
|
||||||
|
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealOverviewVo;
|
||||||
|
import com.klp.mapper.WmsAnnealOverviewMapper;
|
||||||
|
import com.klp.service.IWmsAnnealOverviewService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火总览Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsAnnealOverviewServiceImpl implements IWmsAnnealOverviewService {
|
||||||
|
|
||||||
|
private final WmsAnnealOverviewMapper overviewMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsAnnealOverviewVo queryOverview() {
|
||||||
|
WmsAnnealOverviewVo vo = new WmsAnnealOverviewVo();
|
||||||
|
vo.setTotalPlanCount(overviewMapper.selectTotalPlanCount());
|
||||||
|
vo.setFurnaceTotal(overviewMapper.selectFurnaceTotal());
|
||||||
|
vo.setFurnaceBusyCount(overviewMapper.selectFurnaceBusyCount());
|
||||||
|
vo.setPendingCoilCount(overviewMapper.selectPendingCoilCount());
|
||||||
|
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
Date dayStart = Date.from(today.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
|
Date dayEnd = Date.from(today.plusDays(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
|
vo.setTodayDonePlanCount(overviewMapper.selectTodayDonePlanCount(dayStart, dayEnd));
|
||||||
|
vo.setTodayDoneCoilCount(overviewMapper.selectTodayDoneCoilCount(dayStart, dayEnd));
|
||||||
|
vo.setFurnaces(overviewMapper.selectFurnaceStatusList());
|
||||||
|
vo.setPlanQueue(overviewMapper.selectPlanQueueList());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceDetailVo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceSummaryVo;
|
||||||
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
||||||
|
import com.klp.mapper.WmsAnnealPerformanceMapper;
|
||||||
|
import com.klp.service.IWmsAnnealPerformanceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉火实绩Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceService {
|
||||||
|
|
||||||
|
private final WmsAnnealPerformanceMapper performanceMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsAnnealPerformanceVo queryPerformance(WmsAnnealPerformanceBo bo) {
|
||||||
|
WmsAnnealPerformanceSummaryVo summary = performanceMapper.selectSummary(bo);
|
||||||
|
List<WmsAnnealPerformanceDetailVo> details = performanceMapper.selectDetails(bo);
|
||||||
|
WmsAnnealPerformanceVo vo = new WmsAnnealPerformanceVo();
|
||||||
|
vo.setSummary(summary);
|
||||||
|
vo.setDetails(details);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,431 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.exception.ServiceException;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import com.klp.domain.WmsFurnace;
|
||||||
|
import com.klp.domain.WmsFurnacePlan;
|
||||||
|
import com.klp.domain.WmsFurnacePlanCoil;
|
||||||
|
import com.klp.domain.WmsMaterialCoil;
|
||||||
|
import com.klp.domain.WmsActualWarehouse;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanBo;
|
||||||
|
import com.klp.domain.bo.WmsFurnacePlanCoilBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanCoilVo;
|
||||||
|
import com.klp.domain.vo.WmsFurnacePlanVo;
|
||||||
|
import com.klp.mapper.WmsActualWarehouseMapper;
|
||||||
|
import com.klp.mapper.WmsFurnaceMapper;
|
||||||
|
import com.klp.mapper.WmsFurnacePlanCoilMapper;
|
||||||
|
import com.klp.mapper.WmsFurnacePlanMapper;
|
||||||
|
import com.klp.mapper.WmsMaterialCoilMapper;
|
||||||
|
import com.klp.service.IWmsFurnacePlanService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsFurnacePlanServiceImpl implements IWmsFurnacePlanService {
|
||||||
|
|
||||||
|
private final WmsFurnacePlanMapper baseMapper;
|
||||||
|
private final WmsFurnacePlanCoilMapper planCoilMapper;
|
||||||
|
private final WmsFurnaceMapper furnaceMapper;
|
||||||
|
private final WmsMaterialCoilMapper materialCoilMapper;
|
||||||
|
private final WmsActualWarehouseMapper actualWarehouseMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsFurnacePlanVo queryById(Long planId) {
|
||||||
|
WmsFurnacePlanVo plan = baseMapper.selectVoById(planId);
|
||||||
|
if (plan != null) {
|
||||||
|
plan.setCoilIds(queryPlanCoils(planId).stream()
|
||||||
|
.map(WmsFurnacePlanCoilVo::getCoilId)
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
fillFurnaceNames(java.util.Collections.singletonList(plan));
|
||||||
|
}
|
||||||
|
return plan;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsFurnacePlanVo> queryPageList(WmsFurnacePlanBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsFurnacePlan> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsFurnacePlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
fillFurnaceNames(result.getRecords());
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsFurnacePlanVo> queryList(WmsFurnacePlanBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsFurnacePlan> lqw = buildQueryWrapper(bo);
|
||||||
|
List<WmsFurnacePlanVo> list = baseMapper.selectVoList(lqw);
|
||||||
|
fillFurnaceNames(list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsFurnacePlan> buildQueryWrapper(WmsFurnacePlanBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsFurnacePlan> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getPlanNo()), WmsFurnacePlan::getPlanNo, bo.getPlanNo());
|
||||||
|
lqw.eq(bo.getTargetFurnaceId() != null, WmsFurnacePlan::getTargetFurnaceId, bo.getTargetFurnaceId());
|
||||||
|
lqw.eq(bo.getStatus() != null, WmsFurnacePlan::getStatus, bo.getStatus());
|
||||||
|
lqw.ge(bo.getPlanStartTime() != null, WmsFurnacePlan::getPlanStartTime, bo.getPlanStartTime());
|
||||||
|
lqw.orderByDesc(WmsFurnacePlan::getPlanStartTime);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillFurnaceNames(List<WmsFurnacePlanVo> plans) {
|
||||||
|
if (plans == null || plans.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<Long> furnaceIds = plans.stream()
|
||||||
|
.map(WmsFurnacePlanVo::getTargetFurnaceId)
|
||||||
|
.filter(id -> id != null)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (furnaceIds.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<WmsFurnace> furnaces = furnaceMapper.selectBatchIds(furnaceIds);
|
||||||
|
java.util.Map<Long, String> nameMap = furnaces.stream()
|
||||||
|
.collect(Collectors.toMap(WmsFurnace::getFurnaceId, WmsFurnace::getFurnaceName, (a, b) -> a));
|
||||||
|
plans.forEach(plan -> {
|
||||||
|
if (plan.getTargetFurnaceId() != null) {
|
||||||
|
plan.setTargetFurnaceName(nameMap.get(plan.getTargetFurnaceId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsFurnacePlanBo bo) {
|
||||||
|
WmsFurnacePlan add = BeanUtil.toBean(bo, WmsFurnacePlan.class);
|
||||||
|
validEntityBeforeSave(add, true);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setPlanId(add.getPlanId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsFurnacePlanBo bo) {
|
||||||
|
WmsFurnacePlan update = BeanUtil.toBean(bo, WmsFurnacePlan.class);
|
||||||
|
validEntityBeforeSave(update, false);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsFurnacePlan entity, boolean isNew) {
|
||||||
|
LambdaQueryWrapper<WmsFurnacePlan> planNoQuery = Wrappers.lambdaQuery();
|
||||||
|
planNoQuery.eq(WmsFurnacePlan::getPlanNo, entity.getPlanNo());
|
||||||
|
if (!isNew) {
|
||||||
|
planNoQuery.ne(WmsFurnacePlan::getPlanId, entity.getPlanId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(planNoQuery) > 0) {
|
||||||
|
throw new ServiceException("计划号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
WmsFurnace furnace = furnaceMapper.selectById(entity.getTargetFurnaceId());
|
||||||
|
if (furnace == null || furnace.getDelFlag() != null && furnace.getDelFlag() == 1) {
|
||||||
|
throw new ServiceException("目标炉子不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateStatus(Long planId, Integer status) {
|
||||||
|
WmsFurnacePlan plan = baseMapper.selectById(planId);
|
||||||
|
if (plan == null) {
|
||||||
|
throw new ServiceException("计划不存在");
|
||||||
|
}
|
||||||
|
WmsFurnacePlan update = new WmsFurnacePlan();
|
||||||
|
update.setPlanId(planId);
|
||||||
|
update.setStatus(status);
|
||||||
|
boolean updated = baseMapper.updateById(update) > 0;
|
||||||
|
if (updated && plan.getTargetFurnaceId() != null) {
|
||||||
|
if (status != null && (status == 2)) {
|
||||||
|
updateFurnaceBusy(plan.getTargetFurnaceId(), 1);
|
||||||
|
}
|
||||||
|
if (status != null && (status == 3 || status == 4)) {
|
||||||
|
updateFurnaceBusy(plan.getTargetFurnaceId(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (isValid && ids != null && !ids.isEmpty()) {
|
||||||
|
for (Long planId : ids) {
|
||||||
|
if (planCoilMapper.selectCount(Wrappers.<WmsFurnacePlanCoil>lambdaQuery()
|
||||||
|
.eq(WmsFurnacePlanCoil::getPlanId, planId)) > 0) {
|
||||||
|
throw new ServiceException("计划下存在钢卷,请先解绑");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsFurnacePlanCoilVo> queryPlanCoils(Long planId) {
|
||||||
|
List<WmsFurnacePlanCoilVo> list = planCoilMapper.selectVoList(Wrappers.<WmsFurnacePlanCoil>lambdaQuery()
|
||||||
|
.eq(WmsFurnacePlanCoil::getPlanId, planId));
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
List<Long> coilIds = list.stream()
|
||||||
|
.map(WmsFurnacePlanCoilVo::getCoilId)
|
||||||
|
.filter(id -> id != null)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (coilIds.isEmpty()) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
java.util.Map<Long, String> enterNoMap = materialCoilMapper.selectBatchIds(coilIds).stream()
|
||||||
|
.collect(Collectors.toMap(WmsMaterialCoil::getCoilId, WmsMaterialCoil::getEnterCoilNo, (a, b) -> a));
|
||||||
|
list.forEach(item -> item.setEnterCoilNo(enterNoMap.get(item.getCoilId())));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean bindPlanCoils(WmsFurnacePlanCoilBo bo) {
|
||||||
|
if (bo.getPlanId() == null) {
|
||||||
|
throw new ServiceException("计划ID不能为空");
|
||||||
|
}
|
||||||
|
List<Long> coilIds = parseCoilIds(bo);
|
||||||
|
if (coilIds.isEmpty()) {
|
||||||
|
throw new ServiceException("请至少选择一条钢卷");
|
||||||
|
}
|
||||||
|
WmsFurnacePlan plan = ensurePlanExist(bo.getPlanId());
|
||||||
|
if (plan.getStatus() != null && plan.getStatus() == 2) {
|
||||||
|
throw new ServiceException("计划进行中,无法再领料");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Long coilId : coilIds) {
|
||||||
|
if (planCoilMapper.selectCount(Wrappers.<WmsFurnacePlanCoil>lambdaQuery()
|
||||||
|
.eq(WmsFurnacePlanCoil::getPlanId, bo.getPlanId())
|
||||||
|
.eq(WmsFurnacePlanCoil::getCoilId, coilId)) > 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
WmsFurnacePlanCoil entity = new WmsFurnacePlanCoil();
|
||||||
|
entity.setPlanId(bo.getPlanId());
|
||||||
|
entity.setCoilId(coilId);
|
||||||
|
planCoilMapper.insert(entity);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean unbindPlanCoil(WmsFurnacePlanCoilBo bo) {
|
||||||
|
if (bo.getPlanId() == null || bo.getCoilId() == null) {
|
||||||
|
throw new ServiceException("计划ID和钢卷ID不能为空");
|
||||||
|
}
|
||||||
|
return planCoilMapper.delete(Wrappers.<WmsFurnacePlanCoil>lambdaQuery()
|
||||||
|
.eq(WmsFurnacePlanCoil::getPlanId, bo.getPlanId())
|
||||||
|
.eq(WmsFurnacePlanCoil::getCoilId, bo.getCoilId())) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean inFurnace(Long planId) {
|
||||||
|
WmsFurnacePlan plan = baseMapper.selectById(planId);
|
||||||
|
if (plan == null) {
|
||||||
|
throw new ServiceException("计划不存在");
|
||||||
|
}
|
||||||
|
if (plan.getActualStartTime() != null) {
|
||||||
|
throw new ServiceException("计划已入炉");
|
||||||
|
}
|
||||||
|
if (planCoilMapper.selectCount(Wrappers.<WmsFurnacePlanCoil>lambdaQuery()
|
||||||
|
.eq(WmsFurnacePlanCoil::getPlanId, planId)) <= 0) {
|
||||||
|
throw new ServiceException("计划未绑定钢卷");
|
||||||
|
}
|
||||||
|
|
||||||
|
Date now = new Date();
|
||||||
|
Date endTime = new Date(now.getTime() + 48L * 60 * 60 * 1000);
|
||||||
|
|
||||||
|
WmsFurnacePlan update = new WmsFurnacePlan();
|
||||||
|
update.setPlanId(planId);
|
||||||
|
update.setActualStartTime(now);
|
||||||
|
update.setEndTime(endTime);
|
||||||
|
update.setStatus(2);
|
||||||
|
baseMapper.updateById(update);
|
||||||
|
|
||||||
|
updateFurnaceBusy(plan.getTargetFurnaceId(), 1);
|
||||||
|
|
||||||
|
List<WmsFurnacePlanCoilVo> coils = queryPlanCoils(planId);
|
||||||
|
for (WmsFurnacePlanCoilVo coil : coils) {
|
||||||
|
releaseActualWarehouse(coil.getCoilId());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean completePlan(Long planId, List<com.klp.domain.bo.WmsFurnacePlanLocationItemBo> locations) {
|
||||||
|
WmsFurnacePlan plan = baseMapper.selectById(planId);
|
||||||
|
if (plan == null) {
|
||||||
|
throw new ServiceException("计划不存在");
|
||||||
|
}
|
||||||
|
if (plan.getStatus() == null || plan.getStatus() != 2) {
|
||||||
|
throw new ServiceException("计划未进行中,无法完成");
|
||||||
|
}
|
||||||
|
List<WmsFurnacePlanCoilVo> coils = queryPlanCoils(planId);
|
||||||
|
if (coils == null || coils.isEmpty()) {
|
||||||
|
throw new ServiceException("计划未绑定钢卷");
|
||||||
|
}
|
||||||
|
if (locations == null || locations.isEmpty()) {
|
||||||
|
throw new ServiceException("请先分配实际库位");
|
||||||
|
}
|
||||||
|
java.util.Map<Long, Long> locationMap = locations.stream()
|
||||||
|
.collect(Collectors.toMap(com.klp.domain.bo.WmsFurnacePlanLocationItemBo::getCoilId,
|
||||||
|
com.klp.domain.bo.WmsFurnacePlanLocationItemBo::getActualWarehouseId, (a, b) -> a));
|
||||||
|
for (WmsFurnacePlanCoilVo coil : coils) {
|
||||||
|
Long targetLocation = locationMap.get(coil.getCoilId());
|
||||||
|
if (targetLocation == null) {
|
||||||
|
throw new ServiceException("钢卷" + coil.getEnterCoilNo() + "未分配库位");
|
||||||
|
}
|
||||||
|
occupyActualWarehouse(coil.getCoilId(), targetLocation);
|
||||||
|
}
|
||||||
|
Date now = new Date();
|
||||||
|
WmsFurnacePlan update = new WmsFurnacePlan();
|
||||||
|
update.setPlanId(planId);
|
||||||
|
update.setStatus(3);
|
||||||
|
update.setEndTime(now);
|
||||||
|
baseMapper.updateById(update);
|
||||||
|
updateFurnaceBusy(plan.getTargetFurnaceId(), 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void releaseActualWarehouse(Long coilId) {
|
||||||
|
WmsMaterialCoil coil = materialCoilMapper.selectById(coilId);
|
||||||
|
if (coil == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Long actualWarehouseId = coil.getActualWarehouseId();
|
||||||
|
if (actualWarehouseId != null) {
|
||||||
|
WmsActualWarehouse warehouse = new WmsActualWarehouse();
|
||||||
|
warehouse.setActualWarehouseId(actualWarehouseId);
|
||||||
|
warehouse.setIsEnabled(1);
|
||||||
|
actualWarehouseMapper.updateById(warehouse);
|
||||||
|
}
|
||||||
|
WmsMaterialCoil updateCoil = new WmsMaterialCoil();
|
||||||
|
updateCoil.setCoilId(coilId);
|
||||||
|
updateCoil.setActualWarehouseId(null);
|
||||||
|
materialCoilMapper.updateById(updateCoil);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void occupyActualWarehouse(Long coilId, Long actualWarehouseId) {
|
||||||
|
if (actualWarehouseId == null) {
|
||||||
|
throw new ServiceException("实际库位不能为空");
|
||||||
|
}
|
||||||
|
WmsActualWarehouse warehouse = actualWarehouseMapper.selectById(actualWarehouseId);
|
||||||
|
if (warehouse == null || warehouse.getDelFlag() != null && warehouse.getDelFlag() == 1) {
|
||||||
|
throw new ServiceException("实际库位不存在");
|
||||||
|
}
|
||||||
|
if (warehouse.getIsEnabled() != null && warehouse.getIsEnabled() == 0) {
|
||||||
|
throw new ServiceException("实际库位已被占用");
|
||||||
|
}
|
||||||
|
WmsActualWarehouse updateWarehouse = new WmsActualWarehouse();
|
||||||
|
updateWarehouse.setActualWarehouseId(actualWarehouseId);
|
||||||
|
updateWarehouse.setIsEnabled(0);
|
||||||
|
actualWarehouseMapper.updateById(updateWarehouse);
|
||||||
|
|
||||||
|
WmsMaterialCoil updateCoil = new WmsMaterialCoil();
|
||||||
|
updateCoil.setCoilId(coilId);
|
||||||
|
updateCoil.setActualWarehouseId(actualWarehouseId);
|
||||||
|
materialCoilMapper.updateById(updateCoil);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> parseCoilIds(WmsFurnacePlanCoilBo bo) {
|
||||||
|
List<Long> coilIds = new ArrayList<>();
|
||||||
|
if (bo.getCoilId() != null) {
|
||||||
|
coilIds.add(bo.getCoilId());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(bo.getCoilIds())) {
|
||||||
|
String[] parts = bo.getCoilIds().split(",");
|
||||||
|
for (String part : parts) {
|
||||||
|
if (StringUtils.isNotBlank(part)) {
|
||||||
|
coilIds.add(Long.parseLong(part.trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(bo.getEnterCoilNos())) {
|
||||||
|
coilIds.addAll(resolveCoilIdsByEnterNos(bo.getEnterCoilNos()));
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(bo.getCurrentCoilNos())) {
|
||||||
|
coilIds.addAll(resolveCoilIdsByCurrentNos(bo.getCurrentCoilNos()));
|
||||||
|
}
|
||||||
|
return coilIds.stream().distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> resolveCoilIdsByEnterNos(String enterCoilNos) {
|
||||||
|
List<String> nos = splitCommaValues(enterCoilNos);
|
||||||
|
if (nos.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return materialCoilMapper.selectList(Wrappers.<WmsMaterialCoil>lambdaQuery()
|
||||||
|
.in(WmsMaterialCoil::getEnterCoilNo, nos)
|
||||||
|
.eq(WmsMaterialCoil::getDelFlag, 0))
|
||||||
|
.stream()
|
||||||
|
.map(WmsMaterialCoil::getCoilId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> resolveCoilIdsByCurrentNos(String currentCoilNos) {
|
||||||
|
List<String> nos = splitCommaValues(currentCoilNos);
|
||||||
|
if (nos.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return materialCoilMapper.selectList(Wrappers.<WmsMaterialCoil>lambdaQuery()
|
||||||
|
.in(WmsMaterialCoil::getCurrentCoilNo, nos)
|
||||||
|
.eq(WmsMaterialCoil::getDelFlag, 0))
|
||||||
|
.stream()
|
||||||
|
.map(WmsMaterialCoil::getCoilId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> splitCommaValues(String values) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
if (StringUtils.isBlank(values)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String[] parts = values.split(",");
|
||||||
|
for (String part : parts) {
|
||||||
|
if (StringUtils.isNotBlank(part)) {
|
||||||
|
result.add(part.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WmsFurnacePlan ensurePlanExist(Long planId) {
|
||||||
|
WmsFurnacePlan plan = baseMapper.selectById(planId);
|
||||||
|
if (plan == null) {
|
||||||
|
throw new ServiceException("计划不存在");
|
||||||
|
}
|
||||||
|
return plan;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFurnaceBusy(Long furnaceId, Integer busyFlag) {
|
||||||
|
if (furnaceId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WmsFurnace update = new WmsFurnace();
|
||||||
|
update.setFurnaceId(furnaceId);
|
||||||
|
update.setBusyFlag(busyFlag);
|
||||||
|
furnaceMapper.updateById(update);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.exception.ServiceException;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import com.klp.domain.WmsFurnace;
|
||||||
|
import com.klp.domain.bo.WmsFurnaceBo;
|
||||||
|
import com.klp.domain.vo.WmsFurnaceVo;
|
||||||
|
import com.klp.mapper.WmsFurnaceMapper;
|
||||||
|
import com.klp.service.IWmsFurnaceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火炉Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsFurnaceServiceImpl implements IWmsFurnaceService {
|
||||||
|
|
||||||
|
private final WmsFurnaceMapper baseMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsFurnaceVo queryById(Long furnaceId) {
|
||||||
|
return baseMapper.selectVoById(furnaceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsFurnaceVo> queryPageList(WmsFurnaceBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsFurnace> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsFurnaceVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsFurnaceVo> queryList(WmsFurnaceBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsFurnace> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsFurnace> buildQueryWrapper(WmsFurnaceBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsFurnace> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getFurnaceCode()), WmsFurnace::getFurnaceCode, bo.getFurnaceCode());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getFurnaceName()), WmsFurnace::getFurnaceName, bo.getFurnaceName());
|
||||||
|
lqw.eq(bo.getStatus() != null, WmsFurnace::getStatus, bo.getStatus());
|
||||||
|
lqw.eq(bo.getBusyFlag() != null, WmsFurnace::getBusyFlag, bo.getBusyFlag());
|
||||||
|
lqw.orderByAsc(WmsFurnace::getFurnaceCode);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsFurnaceBo bo) {
|
||||||
|
WmsFurnace add = BeanUtil.toBean(bo, WmsFurnace.class);
|
||||||
|
validEntityBeforeSave(add, true);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setFurnaceId(add.getFurnaceId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsFurnaceBo bo) {
|
||||||
|
WmsFurnace update = BeanUtil.toBean(bo, WmsFurnace.class);
|
||||||
|
validEntityBeforeSave(update, false);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsFurnace entity, boolean isNew) {
|
||||||
|
LambdaQueryWrapper<WmsFurnace> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(WmsFurnace::getFurnaceCode, entity.getFurnaceCode());
|
||||||
|
if (!isNew) {
|
||||||
|
lqw.ne(WmsFurnace::getFurnaceId, entity.getFurnaceId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(lqw) > 0) {
|
||||||
|
throw new ServiceException("炉编号已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateStatus(Long furnaceId, Integer status) {
|
||||||
|
WmsFurnace update = new WmsFurnace();
|
||||||
|
update.setFurnaceId(furnaceId);
|
||||||
|
update.setStatus(status);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateBusy(Long furnaceId, Integer busyFlag) {
|
||||||
|
WmsFurnace update = new WmsFurnace();
|
||||||
|
update.setFurnaceId(furnaceId);
|
||||||
|
update.setBusyFlag(busyFlag);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (isValid && ids != null && !ids.isEmpty()) {
|
||||||
|
// 暂无额外校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.klp.mapper.WmsAnnealOverviewMapper">
|
||||||
|
|
||||||
|
<select id="selectTotalPlanCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace_plan
|
||||||
|
WHERE del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFurnaceTotal" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace
|
||||||
|
WHERE del_flag = 0 AND status = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFurnaceBusyCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace
|
||||||
|
WHERE del_flag = 0 AND status = 1 AND busy_flag = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPendingCoilCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace_plan_coil pc
|
||||||
|
INNER JOIN wms_furnace_plan p ON p.plan_id = pc.plan_id AND p.del_flag = 0
|
||||||
|
WHERE pc.del_flag = 0 AND p.status IN (0, 1)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTodayDonePlanCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace_plan
|
||||||
|
WHERE del_flag = 0 AND status = 3
|
||||||
|
AND end_time >= #{dayStart} AND end_time < #{dayEnd}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTodayDoneCoilCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM wms_furnace_plan_coil pc
|
||||||
|
INNER JOIN wms_furnace_plan p ON p.plan_id = pc.plan_id AND p.del_flag = 0
|
||||||
|
WHERE pc.del_flag = 0 AND p.status = 3
|
||||||
|
AND p.end_time >= #{dayStart} AND p.end_time < #{dayEnd}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFurnaceStatusList" resultType="com.klp.domain.vo.anneal.WmsAnnealFurnaceStatusVo">
|
||||||
|
SELECT f.furnace_id AS furnaceId,
|
||||||
|
f.furnace_code AS furnaceCode,
|
||||||
|
f.furnace_name AS furnaceName,
|
||||||
|
f.busy_flag AS busyFlag,
|
||||||
|
f.status AS status,
|
||||||
|
p.plan_id AS currentPlanId,
|
||||||
|
p.plan_no AS currentPlanNo,
|
||||||
|
p.end_time AS planEndTime,
|
||||||
|
COALESCE(pc.coil_count, 0) AS coilCount
|
||||||
|
FROM wms_furnace f
|
||||||
|
LEFT JOIN wms_furnace_plan p
|
||||||
|
ON p.target_furnace_id = f.furnace_id
|
||||||
|
AND p.del_flag = 0
|
||||||
|
AND p.status = 2
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT plan_id, COUNT(1) AS coil_count
|
||||||
|
FROM wms_furnace_plan_coil
|
||||||
|
WHERE del_flag = 0
|
||||||
|
GROUP BY plan_id
|
||||||
|
) pc ON pc.plan_id = p.plan_id
|
||||||
|
WHERE f.del_flag = 0
|
||||||
|
ORDER BY f.furnace_code
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPlanQueueList" resultType="com.klp.domain.vo.anneal.WmsAnnealPlanQueueVo">
|
||||||
|
SELECT p.plan_id AS planId,
|
||||||
|
p.plan_no AS planNo,
|
||||||
|
p.target_furnace_id AS targetFurnaceId,
|
||||||
|
f.furnace_name AS targetFurnaceName,
|
||||||
|
p.status AS status,
|
||||||
|
p.plan_start_time AS planStartTime,
|
||||||
|
p.actual_start_time AS actualStartTime,
|
||||||
|
p.end_time AS endTime,
|
||||||
|
COALESCE(pc.coil_count, 0) AS coilCount
|
||||||
|
FROM wms_furnace_plan p
|
||||||
|
LEFT JOIN wms_furnace f ON f.furnace_id = p.target_furnace_id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT plan_id, COUNT(1) AS coil_count
|
||||||
|
FROM wms_furnace_plan_coil
|
||||||
|
WHERE del_flag = 0
|
||||||
|
GROUP BY plan_id
|
||||||
|
) pc ON pc.plan_id = p.plan_id
|
||||||
|
WHERE p.del_flag = 0
|
||||||
|
ORDER BY p.status ASC, p.plan_start_time ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.klp.mapper.WmsAnnealPerformanceMapper">
|
||||||
|
|
||||||
|
<sql id="AnnealPerformanceWhere">
|
||||||
|
<where>
|
||||||
|
p.del_flag = 0
|
||||||
|
<if test="startTime != null">
|
||||||
|
AND p.actual_start_time <![CDATA[>=]]> #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
AND p.actual_start_time <![CDATA[<=]]> #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="targetFurnaceId != null">
|
||||||
|
AND p.target_furnace_id = #{targetFurnaceId}
|
||||||
|
</if>
|
||||||
|
<if test="planNo != null and planNo != ''">
|
||||||
|
AND p.plan_no LIKE CONCAT('%', #{planNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="enterCoilNo != null and enterCoilNo != ''">
|
||||||
|
AND mc.enter_coil_no LIKE CONCAT('%', #{enterCoilNo}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSummary" resultType="com.klp.domain.vo.anneal.WmsAnnealPerformanceSummaryVo">
|
||||||
|
SELECT COUNT(DISTINCT p.plan_id) AS plan_count,
|
||||||
|
COUNT(mc.coil_id) AS coil_count,
|
||||||
|
COALESCE(SUM(mc.net_weight), 0) AS total_weight
|
||||||
|
FROM wms_furnace_plan p
|
||||||
|
INNER JOIN wms_furnace_plan_coil pc ON pc.plan_id = p.plan_id AND pc.del_flag = 0
|
||||||
|
INNER JOIN wms_material_coil mc ON mc.coil_id = pc.coil_id AND mc.del_flag = 0
|
||||||
|
<include refid="AnnealPerformanceWhere" />
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetails" resultType="com.klp.domain.vo.anneal.WmsAnnealPerformanceDetailVo">
|
||||||
|
SELECT p.plan_id AS planId,
|
||||||
|
p.plan_no AS planNo,
|
||||||
|
p.target_furnace_id AS targetFurnaceId,
|
||||||
|
f.furnace_name AS targetFurnaceName,
|
||||||
|
p.actual_start_time AS actualStartTime,
|
||||||
|
p.end_time AS endTime,
|
||||||
|
mc.coil_id AS coilId,
|
||||||
|
mc.enter_coil_no AS enterCoilNo,
|
||||||
|
mc.current_coil_no AS currentCoilNo,
|
||||||
|
mc.net_weight AS netWeight
|
||||||
|
FROM wms_furnace_plan p
|
||||||
|
INNER JOIN wms_furnace_plan_coil pc ON pc.plan_id = p.plan_id AND pc.del_flag = 0
|
||||||
|
INNER JOIN wms_material_coil mc ON mc.coil_id = pc.coil_id AND mc.del_flag = 0
|
||||||
|
LEFT JOIN wms_furnace f ON f.furnace_id = p.target_furnace_id
|
||||||
|
<include refid="AnnealPerformanceWhere" />
|
||||||
|
ORDER BY p.actual_start_time DESC, p.plan_no DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
46
klp-wms/src/main/resources/mapper/WmsFurnacePlanMapper.xml
Normal file
46
klp-wms/src/main/resources/mapper/WmsFurnacePlanMapper.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.klp.mapper.WmsFurnacePlanMapper">
|
||||||
|
|
||||||
|
<resultMap id="WmsFurnacePlanVoMap" type="com.klp.domain.vo.WmsFurnacePlanVo">
|
||||||
|
<id column="plan_id" property="planId" />
|
||||||
|
<result column="plan_no" property="planNo" />
|
||||||
|
<result column="plan_start_time" property="planStartTime" />
|
||||||
|
<result column="actual_start_time" property="actualStartTime" />
|
||||||
|
<result column="end_time" property="endTime" />
|
||||||
|
<result column="target_furnace_id" property="targetFurnaceId" />
|
||||||
|
<result column="status" property="status" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="target_furnace_name" property="targetFurnaceName" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectVoPage" resultMap="WmsFurnacePlanVoMap">
|
||||||
|
SELECT p.plan_id,
|
||||||
|
p.plan_no,
|
||||||
|
p.plan_start_time,
|
||||||
|
p.actual_start_time,
|
||||||
|
p.end_time,
|
||||||
|
p.target_furnace_id,
|
||||||
|
p.status,
|
||||||
|
p.remark,
|
||||||
|
p.create_time
|
||||||
|
FROM wms_furnace_plan p
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectVoList" resultMap="WmsFurnacePlanVoMap">
|
||||||
|
SELECT p.plan_id,
|
||||||
|
p.plan_no,
|
||||||
|
p.plan_start_time,
|
||||||
|
p.actual_start_time,
|
||||||
|
p.end_time,
|
||||||
|
p.target_furnace_id,
|
||||||
|
p.status,
|
||||||
|
p.remark,
|
||||||
|
p.create_time
|
||||||
|
FROM wms_furnace_plan p
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user