Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
-- 冷轧涂镀数智运营 - 规程主表
|
||||||
|
CREATE TABLE wms_process_spec (
|
||||||
|
spec_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
spec_code VARCHAR(64) NOT NULL COMMENT '规程编号',
|
||||||
|
spec_name VARCHAR(200) NOT NULL COMMENT '规程名称',
|
||||||
|
spec_type VARCHAR(32) NOT NULL DEFAULT 'PROCESS' COMMENT '类型(PROCESS=工艺规程,STANDARD=标准)',
|
||||||
|
line_id BIGINT NOT NULL COMMENT '产线ID',
|
||||||
|
product_type VARCHAR(100) NULL COMMENT '产品类型',
|
||||||
|
is_enabled TINYINT NOT NULL DEFAULT 1 COMMENT '是否启用(0否1是)',
|
||||||
|
create_by VARCHAR(64) NULL COMMENT '创建人',
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
update_by VARCHAR(64) NULL COMMENT '更新人',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
del_flag TINYINT NOT NULL DEFAULT 0 COMMENT '删除标志(0正常2删除,与全局逻辑删除配置一致)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (spec_id),
|
||||||
|
UNIQUE KEY uk_wms_process_spec_code (spec_code),
|
||||||
|
KEY idx_wms_process_spec_line (line_id),
|
||||||
|
KEY idx_wms_process_spec_type (spec_type)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='规程主表';
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
-- 规程版本表
|
||||||
|
CREATE TABLE wms_process_spec_version (
|
||||||
|
version_id BIGINT NOT NULL COMMENT '主键',
|
||||||
|
spec_id BIGINT NOT NULL COMMENT '规程主表ID',
|
||||||
|
version_code VARCHAR(64) NOT NULL COMMENT '版本号',
|
||||||
|
is_active TINYINT NOT NULL DEFAULT 0 COMMENT '是否当前生效(0否1是)',
|
||||||
|
status VARCHAR(32) NOT NULL DEFAULT 'DRAFT' COMMENT '状态(DRAFT草稿/PUBLISHED已发布/OBSOLETE作废等)',
|
||||||
|
create_by VARCHAR(64) NULL COMMENT '创建人',
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
update_by VARCHAR(64) NULL COMMENT '更新人',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
del_flag TINYINT NOT NULL DEFAULT 0 COMMENT '删除标志(0正常2删除)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (version_id),
|
||||||
|
UNIQUE KEY uk_spec_version_code (spec_id, version_code),
|
||||||
|
KEY idx_spec_version_spec (spec_id),
|
||||||
|
KEY idx_spec_version_active (spec_id, is_active)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='规程版本表';
|
||||||
|
|
||||||
|
-- 方案点位表
|
||||||
|
CREATE TABLE wms_process_plan (
|
||||||
|
plan_id BIGINT NOT NULL COMMENT '主键',
|
||||||
|
version_id BIGINT NOT NULL COMMENT '规程版本ID',
|
||||||
|
segment_type VARCHAR(32) NOT NULL COMMENT '段类型(INLET/PROCESS/OUTLET)',
|
||||||
|
segment_name VARCHAR(100) NULL COMMENT '段名称',
|
||||||
|
point_name VARCHAR(200) NOT NULL COMMENT '点位名称',
|
||||||
|
point_code VARCHAR(64) NOT NULL COMMENT '点位编码',
|
||||||
|
sort_order INT NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
create_by VARCHAR(64) NULL COMMENT '创建人',
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
update_by VARCHAR(64) NULL COMMENT '更新人',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
del_flag TINYINT NOT NULL DEFAULT 0 COMMENT '删除标志(0正常2删除)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (plan_id),
|
||||||
|
UNIQUE KEY uk_plan_version_point_code (version_id, point_code),
|
||||||
|
KEY idx_plan_version (version_id),
|
||||||
|
KEY idx_plan_sort (version_id, sort_order)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='方案点位表';
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
-- 方案参数表
|
||||||
|
CREATE TABLE wms_process_plan_param (
|
||||||
|
param_id BIGINT NOT NULL COMMENT '主键',
|
||||||
|
plan_id BIGINT NOT NULL COMMENT '方案点位ID',
|
||||||
|
param_code VARCHAR(64) NOT NULL COMMENT '参数编码',
|
||||||
|
param_name VARCHAR(200) NOT NULL COMMENT '参数名称',
|
||||||
|
target_value DECIMAL(24, 6) NULL COMMENT '设定值',
|
||||||
|
lower_limit DECIMAL(24, 6) NULL COMMENT '下限',
|
||||||
|
upper_limit DECIMAL(24, 6) NULL COMMENT '上限',
|
||||||
|
unit VARCHAR(32) NULL COMMENT '单位',
|
||||||
|
create_by VARCHAR(64) NULL COMMENT '创建人',
|
||||||
|
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
update_by VARCHAR(64) NULL COMMENT '更新人',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
del_flag TINYINT NOT NULL DEFAULT 0 COMMENT '删除标志(0正常2删除)',
|
||||||
|
remark VARCHAR(500) NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (param_id),
|
||||||
|
UNIQUE KEY uk_plan_param_code (plan_id, param_code),
|
||||||
|
KEY idx_plan_param_plan (plan_id)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='方案参数表';
|
||||||
39
klp-ui/src/api/wms/processPlan.js
Normal file
39
klp-ui/src/api/wms/processPlan.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function listProcessPlan(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlan/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProcessPlan(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlan/' + planId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addProcessPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlan',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlan',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delProcessPlan(planId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlan/' + planId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
39
klp-ui/src/api/wms/processPlanParam.js
Normal file
39
klp-ui/src/api/wms/processPlanParam.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function listProcessPlanParam(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlanParam/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProcessPlanParam(paramId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlanParam/' + paramId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addProcessPlanParam(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlanParam',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessPlanParam(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlanParam',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delProcessPlanParam(paramId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processPlanParam/' + paramId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
44
klp-ui/src/api/wms/processSpec.js
Normal file
44
klp-ui/src/api/wms/processSpec.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询规程主表列表
|
||||||
|
export function listProcessSpec(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpec/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询规程主表详细
|
||||||
|
export function getProcessSpec(specId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpec/' + specId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增规程主表
|
||||||
|
export function addProcessSpec(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpec',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改规程主表
|
||||||
|
export function updateProcessSpec(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpec',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除规程主表
|
||||||
|
export function delProcessSpec(specId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpec/' + specId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
46
klp-ui/src/api/wms/processSpecVersion.js
Normal file
46
klp-ui/src/api/wms/processSpecVersion.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function listProcessSpecVersion(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProcessSpecVersion(versionId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion/' + versionId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addProcessSpecVersion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessSpecVersion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function activateProcessSpecVersion(versionId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion/activate/' + versionId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delProcessSpecVersion(versionId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/processSpecVersion/' + versionId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
322
klp-ui/src/views/wms/processSpec/index.vue
Normal file
322
klp-ui/src/views/wms/processSpec/index.vue
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
|
||||||
|
<el-form-item label="规程编号" prop="specCode">
|
||||||
|
<el-input v-model="queryParams.specCode" placeholder="规程编号" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规程名称" prop="specName">
|
||||||
|
<el-input v-model="queryParams.specName" placeholder="规程名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规程类型" prop="specType">
|
||||||
|
<el-select v-model="queryParams.specType" placeholder="全部" clearable>
|
||||||
|
<el-option v-for="item in specTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产线" prop="lineId">
|
||||||
|
<el-select v-model="queryParams.lineId" placeholder="全部" clearable filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="line in lineOptions"
|
||||||
|
:key="line.lineId"
|
||||||
|
:label="formatLineOption(line)"
|
||||||
|
:value="line.lineId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品类型" prop="productType">
|
||||||
|
<el-input v-model="queryParams.productType" placeholder="产品类型" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用" prop="isEnabled">
|
||||||
|
<el-select v-model="queryParams.isEnabled" placeholder="全部" clearable>
|
||||||
|
<el-option label="启用" :value="1" />
|
||||||
|
<el-option label="禁用" :value="0" />
|
||||||
|
</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>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<KLPTable v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="规程编号" align="center" prop="specCode" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column label="规程名称" align="center" prop="specName" min-width="140" show-overflow-tooltip />
|
||||||
|
<el-table-column label="规程类型" align="center" prop="specType" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ formatSpecType(scope.row.specType) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产线" align="center" min-width="160" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ getLineName(scope.row.lineId) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品类型" align="center" prop="productType" min-width="100" show-overflow-tooltip />
|
||||||
|
<el-table-column label="是否启用" align="center" prop="isEnabled" width="90">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.common_swicth" :value="scope.row.isEnabled" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
||||||
|
<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-document" @click="goVersionManage(scope.row)">版本与方案</el-button>
|
||||||
|
<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>
|
||||||
|
</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="560px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="规程编号" prop="specCode">
|
||||||
|
<el-input v-model="form.specCode" placeholder="唯一编号" maxlength="64" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规程名称" prop="specName">
|
||||||
|
<el-input v-model="form.specName" placeholder="规程名称" maxlength="200" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规程类型" prop="specType">
|
||||||
|
<el-select v-model="form.specType" placeholder="请选择">
|
||||||
|
<el-option v-for="item in specTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产线" prop="lineId">
|
||||||
|
<el-select v-model="form.lineId" placeholder="请选择产线" filterable style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="line in lineOptions"
|
||||||
|
:key="line.lineId"
|
||||||
|
:label="formatLineOption(line)"
|
||||||
|
:value="line.lineId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品类型" prop="productType">
|
||||||
|
<el-input v-model="form.productType" placeholder="可选" maxlength="100" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用" prop="isEnabled">
|
||||||
|
<el-radio-group v-model="form.isEnabled">
|
||||||
|
<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="备注" maxlength="500" show-word-limit rows="2" />
|
||||||
|
</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 { listProcessSpec, getProcessSpec, delProcessSpec, updateProcessSpec, addProcessSpec } from '@/api/wms/processSpec'
|
||||||
|
import { listProductionLine } from '@/api/wms/productionLine'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProcessSpec',
|
||||||
|
dicts: ['common_swicth'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
buttonLoading: false,
|
||||||
|
loading: true,
|
||||||
|
ids: [],
|
||||||
|
single: true,
|
||||||
|
multiple: true,
|
||||||
|
showSearch: true,
|
||||||
|
total: 0,
|
||||||
|
dataList: [],
|
||||||
|
title: '',
|
||||||
|
open: false,
|
||||||
|
lineOptions: [],
|
||||||
|
specTypeOptions: [
|
||||||
|
{ label: '工艺规程', value: 'PROCESS' },
|
||||||
|
{ label: '标准', value: 'STANDARD' }
|
||||||
|
],
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
specCode: undefined,
|
||||||
|
specName: undefined,
|
||||||
|
specType: undefined,
|
||||||
|
lineId: undefined,
|
||||||
|
productType: undefined,
|
||||||
|
isEnabled: undefined
|
||||||
|
},
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
specCode: [{ required: true, message: '规程编号不能为空', trigger: 'blur' }],
|
||||||
|
specName: [{ required: true, message: '规程名称不能为空', trigger: 'blur' }],
|
||||||
|
specType: [{ required: true, message: '规程类型不能为空', trigger: 'change' }],
|
||||||
|
lineId: [{ required: true, message: '产线不能为空', trigger: 'change' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.loadLineOptions()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatSpecType(value) {
|
||||||
|
const hit = this.specTypeOptions.find((x) => x.value === value)
|
||||||
|
return hit ? hit.label : value
|
||||||
|
},
|
||||||
|
formatLineOption(line) {
|
||||||
|
if (!line) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return line.lineCode ? `${line.lineName}(${line.lineCode})` : line.lineName
|
||||||
|
},
|
||||||
|
getLineName(lineId) {
|
||||||
|
if (lineId == null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
const hit = this.lineOptions.find((o) => o.lineId === lineId)
|
||||||
|
return hit ? this.formatLineOption(hit) : lineId
|
||||||
|
},
|
||||||
|
loadLineOptions() {
|
||||||
|
listProductionLine({ pageNum: 1, pageSize: 500 }).then((res) => {
|
||||||
|
this.lineOptions = res.rows || []
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('加载产线列表失败', err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listProcessSpec(this.queryParams).then((response) => {
|
||||||
|
this.dataList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('加载规程列表失败', err)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
specId: undefined,
|
||||||
|
specCode: undefined,
|
||||||
|
specName: undefined,
|
||||||
|
specType: 'PROCESS',
|
||||||
|
lineId: undefined,
|
||||||
|
productType: undefined,
|
||||||
|
isEnabled: 1,
|
||||||
|
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.specId)
|
||||||
|
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 specId = row.specId || this.ids
|
||||||
|
getProcessSpec(specId).then((response) => {
|
||||||
|
this.loading = false
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改规程'
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('获取规程详情失败', err)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.buttonLoading = true
|
||||||
|
const req = this.form.specId != null ? updateProcessSpec(this.form) : addProcessSpec(this.form)
|
||||||
|
req.then(() => {
|
||||||
|
this.$modal.msgSuccess(this.form.specId != null ? '修改成功' : '新增成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('保存规程失败', err)
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
const specIds = row.specId || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除选中的规程数据?').then(() => {
|
||||||
|
this.loading = true
|
||||||
|
return delProcessSpec(specIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
}).catch(() => {}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
this.download('wms/processSpec/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `processSpec_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
goVersionManage(row) {
|
||||||
|
const specId = row.specId
|
||||||
|
if (specId == null || specId === '') {
|
||||||
|
this.$modal.msgWarning('无法获取规程ID,请刷新列表后重试')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 固定落在「…/processSpec/version」,避免列表为 …/processSpec/list 时拼成 …/list/version 导致路由不匹配、query 丢失
|
||||||
|
const pathCurrent = this.$route.path.replace(/\/$/, '')
|
||||||
|
const m = pathCurrent.match(/^(.*\/processSpec)(?:\/.*)?$/)
|
||||||
|
const base = m ? m[1] : pathCurrent
|
||||||
|
this.$router.push({
|
||||||
|
path: `${base}/version`,
|
||||||
|
query: { specId: String(specId) }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
541
klp-ui/src/views/wms/processSpec/versionManage.vue
Normal file
541
klp-ui/src/views/wms/processSpec/versionManage.vue
Normal file
@@ -0,0 +1,541 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container" v-loading="pageLoading">
|
||||||
|
<el-page-header v-if="specInfo.specId" @back="goBack" :content="'规程版本与方案 — ' + (specInfo.specName || '') + '(' + (specInfo.specCode || '') + ')'" />
|
||||||
|
<el-card v-else shadow="never" class="mb8">
|
||||||
|
<div slot="header">请选择规程</div>
|
||||||
|
<p class="text-muted mb8" style="color: #909399; font-size: 13px">从「规程管理」列表进入时会自动带上规程;从菜单直接进入时请先选择规程。</p>
|
||||||
|
<el-form inline size="small" @submit.native.prevent>
|
||||||
|
<el-form-item label="规程">
|
||||||
|
<el-select
|
||||||
|
v-model="specPickerId"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
placeholder="请选择规程"
|
||||||
|
style="min-width: 280px"
|
||||||
|
:loading="specPickerLoading"
|
||||||
|
>
|
||||||
|
<el-option v-for="s in specPickerOptions" :key="s.specId" :label="(s.specCode || '') + ' — ' + (s.specName || '')" :value="String(s.specId)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" :disabled="!specPickerId" @click="applySpecPicker">进入维护</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<template v-if="specInfo.specId">
|
||||||
|
<el-card shadow="never" class="mb8">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>规程版本</span>
|
||||||
|
<el-button style="float: right; padding: 3px 10px" type="primary" size="mini" icon="el-icon-plus" @click="openVersionDialog()">新建版本</el-button>
|
||||||
|
</div>
|
||||||
|
<KLPTable
|
||||||
|
:data="versionList"
|
||||||
|
highlight-current-row
|
||||||
|
@row-click="onVersionRowClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="版本号" prop="versionCode" min-width="120" align="center" />
|
||||||
|
<el-table-column label="是否生效" prop="isActive" width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.isActive === 1" type="success" size="mini">生效</el-tag>
|
||||||
|
<span v-else>否</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" prop="status" width="120" align="center" />
|
||||||
|
<el-table-column label="创建时间" prop="createTime" width="170" align="center" />
|
||||||
|
<el-table-column label="操作" width="220" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" @click.stop="activateVersion(scope.row)">设为生效</el-button>
|
||||||
|
<el-button type="text" size="mini" @click.stop="openVersionDialog(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="mini" @click.stop="removeVersion(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</KLPTable>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" v-if="selectedVersion">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>方案点位(版本 {{ selectedVersion.versionCode }})</span>
|
||||||
|
<el-button style="float: right; padding: 3px 10px" type="primary" size="mini" icon="el-icon-plus" @click="openPlanDialog()">新建方案点位</el-button>
|
||||||
|
</div>
|
||||||
|
<KLPTable
|
||||||
|
v-loading="planLoading"
|
||||||
|
:data="planList"
|
||||||
|
highlight-current-row
|
||||||
|
@row-click="onPlanRowClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="段类型" prop="segmentType" width="110" align="center" />
|
||||||
|
<el-table-column label="段名称" prop="segmentName" min-width="100" show-overflow-tooltip align="center" />
|
||||||
|
<el-table-column label="点位名称" prop="pointName" min-width="120" show-overflow-tooltip align="center" />
|
||||||
|
<el-table-column label="点位编码" prop="pointCode" min-width="120" align="center" />
|
||||||
|
<el-table-column label="排序" prop="sortOrder" width="80" align="center" />
|
||||||
|
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" @click.stop="openPlanDialog(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="mini" @click.stop="removePlan(scope.row)">删除</el-button>
|
||||||
|
<el-button type="text" size="mini" @click.stop="onPlanRowClick(scope.row)">维护参数</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</KLPTable>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" v-if="selectedVersion && selectedPlan" class="mb8">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>方案参数({{ selectedPlan.pointName || selectedPlan.pointCode }})</span>
|
||||||
|
<el-button style="float: right; padding: 3px 10px" type="primary" size="mini" icon="el-icon-plus" @click="openParamDialog()">新建参数</el-button>
|
||||||
|
</div>
|
||||||
|
<KLPTable v-loading="paramLoading" :data="paramList">
|
||||||
|
<el-table-column label="参数编码" prop="paramCode" min-width="100" align="center" />
|
||||||
|
<el-table-column label="参数名称" prop="paramName" min-width="120" show-overflow-tooltip align="center" />
|
||||||
|
<el-table-column label="设定值" prop="targetValue" width="100" align="center" />
|
||||||
|
<el-table-column label="下限" prop="lowerLimit" width="90" align="center" />
|
||||||
|
<el-table-column label="上限" prop="upperLimit" width="90" align="center" />
|
||||||
|
<el-table-column label="单位" prop="unit" width="80" align="center" />
|
||||||
|
<el-table-column label="操作" width="140" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" @click="openParamDialog(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="mini" @click="removeParam(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</KLPTable>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card v-if="specInfo.specId && !selectedVersion" shadow="never" class="mb8">
|
||||||
|
<el-empty description="请在上方选择一个规程版本以维护方案点位" />
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 版本 -->
|
||||||
|
<el-dialog :title="versionTitle" :visible.sync="versionOpen" width="520px" append-to-body @close="versionForm = {}">
|
||||||
|
<el-form ref="versionFormRef" :model="versionForm" :rules="versionRules" label-width="100px">
|
||||||
|
<el-form-item label="版本号" prop="versionCode">
|
||||||
|
<el-input v-model="versionForm.versionCode" maxlength="64" placeholder="如 V1.0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="versionForm.status" placeholder="请选择" style="width: 100%">
|
||||||
|
<el-option v-for="s in statusOptions" :key="s" :label="s" :value="s" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保存后生效" prop="isActive">
|
||||||
|
<el-switch v-model="versionForm.isActive" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="versionForm.remark" type="textarea" rows="2" maxlength="500" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="versionSubmitLoading" type="primary" @click="submitVersion">确 定</el-button>
|
||||||
|
<el-button @click="versionOpen = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 方案点位 -->
|
||||||
|
<el-dialog :title="planTitle" :visible.sync="planOpen" width="560px" append-to-body @close="planForm = {}">
|
||||||
|
<el-form ref="planFormRef" :model="planForm" :rules="planRules" label-width="100px">
|
||||||
|
<el-form-item label="段类型" prop="segmentType">
|
||||||
|
<el-select v-model="planForm.segmentType" placeholder="请选择" style="width: 100%">
|
||||||
|
<el-option v-for="s in segmentOptions" :key="s.value" :label="s.label" :value="s.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="段名称" prop="segmentName">
|
||||||
|
<el-input v-model="planForm.segmentName" maxlength="100" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位名称" prop="pointName">
|
||||||
|
<el-input v-model="planForm.pointName" maxlength="200" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位编码" prop="pointCode">
|
||||||
|
<el-input v-model="planForm.pointCode" maxlength="64" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sortOrder">
|
||||||
|
<el-input-number v-model="planForm.sortOrder" :min="0" :max="999999" controls-position="right" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="planForm.remark" type="textarea" rows="2" maxlength="500" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="planSubmitLoading" type="primary" @click="submitPlan">确 定</el-button>
|
||||||
|
<el-button @click="planOpen = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 方案参数 -->
|
||||||
|
<el-dialog :title="paramTitle" :visible.sync="paramOpen" width="560px" append-to-body @close="paramForm = {}">
|
||||||
|
<el-form ref="paramFormRef" :model="paramForm" :rules="paramRules" label-width="100px">
|
||||||
|
<el-form-item label="参数编码" prop="paramCode">
|
||||||
|
<el-input v-model="paramForm.paramCode" maxlength="64" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参数名称" prop="paramName">
|
||||||
|
<el-input v-model="paramForm.paramName" maxlength="200" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设定值" prop="targetValue">
|
||||||
|
<el-input v-model="paramForm.targetValue" placeholder="数值" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下限" prop="lowerLimit">
|
||||||
|
<el-input v-model="paramForm.lowerLimit" placeholder="数值" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上限" prop="upperLimit">
|
||||||
|
<el-input v-model="paramForm.upperLimit" placeholder="数值" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单位" prop="unit">
|
||||||
|
<el-input v-model="paramForm.unit" maxlength="32" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="paramForm.remark" type="textarea" rows="2" maxlength="500" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="paramSubmitLoading" type="primary" @click="submitParam">确 定</el-button>
|
||||||
|
<el-button @click="paramOpen = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getProcessSpec, listProcessSpec } from '@/api/wms/processSpec'
|
||||||
|
import {
|
||||||
|
listProcessSpecVersion,
|
||||||
|
addProcessSpecVersion,
|
||||||
|
updateProcessSpecVersion,
|
||||||
|
delProcessSpecVersion,
|
||||||
|
activateProcessSpecVersion
|
||||||
|
} from '@/api/wms/processSpecVersion'
|
||||||
|
import { listProcessPlan, addProcessPlan, updateProcessPlan, delProcessPlan } from '@/api/wms/processPlan'
|
||||||
|
import { listProcessPlanParam, addProcessPlanParam, updateProcessPlanParam, delProcessPlanParam } from '@/api/wms/processPlanParam'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProcessSpecVersionManage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageLoading: false,
|
||||||
|
specId: undefined,
|
||||||
|
specInfo: {},
|
||||||
|
versionList: [],
|
||||||
|
selectedVersion: null,
|
||||||
|
planList: [],
|
||||||
|
planLoading: false,
|
||||||
|
selectedPlan: null,
|
||||||
|
paramList: [],
|
||||||
|
paramLoading: false,
|
||||||
|
statusOptions: ['DRAFT', 'PUBLISHED', 'OBSOLETE'],
|
||||||
|
segmentOptions: [
|
||||||
|
{ label: '入口', value: 'INLET' },
|
||||||
|
{ label: '过程', value: 'PROCESS' },
|
||||||
|
{ label: '出口', value: 'OUTLET' }
|
||||||
|
],
|
||||||
|
versionOpen: false,
|
||||||
|
versionTitle: '',
|
||||||
|
versionSubmitLoading: false,
|
||||||
|
versionForm: {},
|
||||||
|
versionRules: {
|
||||||
|
versionCode: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
||||||
|
},
|
||||||
|
planOpen: false,
|
||||||
|
planTitle: '',
|
||||||
|
planSubmitLoading: false,
|
||||||
|
planForm: {},
|
||||||
|
planRules: {
|
||||||
|
segmentType: [{ required: true, message: '段类型不能为空', trigger: 'change' }],
|
||||||
|
pointName: [{ required: true, message: '点位名称不能为空', trigger: 'blur' }],
|
||||||
|
pointCode: [{ required: true, message: '点位编码不能为空', trigger: 'blur' }],
|
||||||
|
sortOrder: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
specPickerId: '',
|
||||||
|
specPickerOptions: [],
|
||||||
|
specPickerLoading: false,
|
||||||
|
paramOpen: false,
|
||||||
|
paramTitle: '',
|
||||||
|
paramSubmitLoading: false,
|
||||||
|
paramForm: {},
|
||||||
|
paramRules: {
|
||||||
|
paramCode: [{ required: true, message: '参数编码不能为空', trigger: 'blur' }],
|
||||||
|
paramName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$route': {
|
||||||
|
immediate: true,
|
||||||
|
handler() {
|
||||||
|
this.syncSpecIdFromRoute()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
syncSpecIdFromRoute() {
|
||||||
|
const raw = this.$route.query.specId
|
||||||
|
if (raw != null && raw !== '') {
|
||||||
|
this.specId = String(raw)
|
||||||
|
} else {
|
||||||
|
this.specId = undefined
|
||||||
|
}
|
||||||
|
this.initPage()
|
||||||
|
},
|
||||||
|
loadSpecPickerOptions() {
|
||||||
|
this.specPickerLoading = true
|
||||||
|
listProcessSpec({ pageNum: 1, pageSize: 500 })
|
||||||
|
.then((res) => {
|
||||||
|
this.specPickerOptions = res.rows || []
|
||||||
|
})
|
||||||
|
.catch((e) => console.error('加载规程列表失败', e))
|
||||||
|
.finally(() => {
|
||||||
|
this.specPickerLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
applySpecPicker() {
|
||||||
|
if (!this.specPickerId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$router.replace({
|
||||||
|
path: this.$route.path,
|
||||||
|
query: { ...this.$route.query, specId: this.specPickerId }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
this.$router.go(-1)
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
if (!this.specId) {
|
||||||
|
this.specInfo = {}
|
||||||
|
if (this.specPickerOptions.length === 0) {
|
||||||
|
this.loadSpecPickerOptions()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.pageLoading = true
|
||||||
|
getProcessSpec(this.specId)
|
||||||
|
.then((res) => {
|
||||||
|
this.specInfo = res.data || {}
|
||||||
|
return listProcessSpecVersion({ specId: this.specId, pageNum: 1, pageSize: 200 })
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.versionList = res.rows || []
|
||||||
|
this.selectedVersion = null
|
||||||
|
this.planList = []
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('加载规程版本失败', e)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.pageLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onVersionRowClick(row) {
|
||||||
|
this.selectedVersion = row
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
this.loadPlans(row.versionId)
|
||||||
|
},
|
||||||
|
onPlanRowClick(row) {
|
||||||
|
this.selectedPlan = row
|
||||||
|
this.loadParams(row.planId)
|
||||||
|
},
|
||||||
|
loadPlans(versionId) {
|
||||||
|
if (!versionId) {
|
||||||
|
this.planList = []
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
this.planLoading = true
|
||||||
|
listProcessPlan({ versionId, pageNum: 1, pageSize: 500 })
|
||||||
|
.then((res) => {
|
||||||
|
this.planList = res.rows || []
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('加载方案点位失败', e)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.planLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadParams(planId) {
|
||||||
|
if (!planId) {
|
||||||
|
this.paramList = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.paramLoading = true
|
||||||
|
listProcessPlanParam({ planId, pageNum: 1, pageSize: 500 })
|
||||||
|
.then((res) => {
|
||||||
|
this.paramList = res.rows || []
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('加载方案参数失败', e)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.paramLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openVersionDialog(row) {
|
||||||
|
this.versionForm = row
|
||||||
|
? { ...row }
|
||||||
|
: {
|
||||||
|
specId: this.specId,
|
||||||
|
versionCode: undefined,
|
||||||
|
status: 'DRAFT',
|
||||||
|
isActive: 0,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
this.versionTitle = row ? '编辑版本' : '新建版本'
|
||||||
|
this.versionOpen = true
|
||||||
|
this.$nextTick(() => this.$refs.versionFormRef && this.$refs.versionFormRef.clearValidate())
|
||||||
|
},
|
||||||
|
submitVersion() {
|
||||||
|
this.$refs.versionFormRef.validate((ok) => {
|
||||||
|
if (!ok) return
|
||||||
|
this.versionSubmitLoading = true
|
||||||
|
const req = this.versionForm.versionId
|
||||||
|
? updateProcessSpecVersion({ ...this.versionForm, specId: this.specId })
|
||||||
|
: addProcessSpecVersion({ ...this.versionForm, specId: this.specId })
|
||||||
|
req
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess('保存成功')
|
||||||
|
this.versionOpen = false
|
||||||
|
this.initPage()
|
||||||
|
})
|
||||||
|
.catch((e) => console.error('保存版本失败', e))
|
||||||
|
.finally(() => {
|
||||||
|
this.versionSubmitLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
activateVersion(row) {
|
||||||
|
this.$modal.confirm('确认将版本「' + row.versionCode + '」设为当前生效版本?').then(() => {
|
||||||
|
return activateProcessSpecVersion(row.versionId)
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess('已生效')
|
||||||
|
this.initPage()
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
removeVersion(row) {
|
||||||
|
this.$modal.confirm('确认删除版本「' + row.versionCode + '」及其下方案点位?').then(() => {
|
||||||
|
return delProcessSpecVersion(row.versionId)
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
this.selectedVersion = null
|
||||||
|
this.planList = []
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
this.initPage()
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
openPlanDialog(row) {
|
||||||
|
if (!this.selectedVersion) {
|
||||||
|
this.$modal.msgWarning('请先选择一个规程版本')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.planForm = row
|
||||||
|
? { ...row }
|
||||||
|
: {
|
||||||
|
versionId: this.selectedVersion.versionId,
|
||||||
|
segmentType: 'PROCESS',
|
||||||
|
segmentName: undefined,
|
||||||
|
pointName: undefined,
|
||||||
|
pointCode: undefined,
|
||||||
|
sortOrder: 0,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
this.planTitle = row ? '编辑方案点位' : '新建方案点位'
|
||||||
|
this.planOpen = true
|
||||||
|
this.$nextTick(() => this.$refs.planFormRef && this.$refs.planFormRef.clearValidate())
|
||||||
|
},
|
||||||
|
submitPlan() {
|
||||||
|
this.$refs.planFormRef.validate((ok) => {
|
||||||
|
if (!ok) return
|
||||||
|
this.planSubmitLoading = true
|
||||||
|
const req = this.planForm.planId ? updateProcessPlan(this.planForm) : addProcessPlan(this.planForm)
|
||||||
|
req
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess('保存成功')
|
||||||
|
this.planOpen = false
|
||||||
|
this.loadPlans(this.selectedVersion.versionId)
|
||||||
|
})
|
||||||
|
.catch((e) => console.error('保存方案点位失败', e))
|
||||||
|
.finally(() => {
|
||||||
|
this.planSubmitLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removePlan(row) {
|
||||||
|
this.$modal.confirm('确认删除该方案点位?').then(() => {
|
||||||
|
return delProcessPlan(row.planId)
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
if (this.selectedPlan && this.selectedPlan.planId === row.planId) {
|
||||||
|
this.selectedPlan = null
|
||||||
|
this.paramList = []
|
||||||
|
}
|
||||||
|
this.loadPlans(this.selectedVersion.versionId)
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
openParamDialog(row) {
|
||||||
|
if (!this.selectedPlan) {
|
||||||
|
this.$modal.msgWarning('请先在上方方案点位表格中选中一行')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.paramForm = row
|
||||||
|
? { ...row }
|
||||||
|
: {
|
||||||
|
planId: this.selectedPlan.planId,
|
||||||
|
paramCode: undefined,
|
||||||
|
paramName: undefined,
|
||||||
|
targetValue: undefined,
|
||||||
|
lowerLimit: undefined,
|
||||||
|
upperLimit: undefined,
|
||||||
|
unit: undefined,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
this.paramTitle = row ? '编辑方案参数' : '新建方案参数'
|
||||||
|
this.paramOpen = true
|
||||||
|
this.$nextTick(() => this.$refs.paramFormRef && this.$refs.paramFormRef.clearValidate())
|
||||||
|
},
|
||||||
|
parseDecimal(val) {
|
||||||
|
if (val === undefined || val === null || val === '') {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const n = Number(val)
|
||||||
|
return Number.isFinite(n) ? n : undefined
|
||||||
|
},
|
||||||
|
buildParamPayload() {
|
||||||
|
return {
|
||||||
|
...this.paramForm,
|
||||||
|
targetValue: this.parseDecimal(this.paramForm.targetValue),
|
||||||
|
lowerLimit: this.parseDecimal(this.paramForm.lowerLimit),
|
||||||
|
upperLimit: this.parseDecimal(this.paramForm.upperLimit)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitParam() {
|
||||||
|
this.$refs.paramFormRef.validate((ok) => {
|
||||||
|
if (!ok) return
|
||||||
|
this.paramSubmitLoading = true
|
||||||
|
const payload = this.buildParamPayload()
|
||||||
|
const req = payload.paramId ? updateProcessPlanParam(payload) : addProcessPlanParam(payload)
|
||||||
|
req
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess('保存成功')
|
||||||
|
this.paramOpen = false
|
||||||
|
this.loadParams(this.selectedPlan.planId)
|
||||||
|
})
|
||||||
|
.catch((e) => console.error('保存方案参数失败', e))
|
||||||
|
.finally(() => {
|
||||||
|
this.paramSubmitLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeParam(row) {
|
||||||
|
this.$modal.confirm('确认删除该方案参数?').then(() => {
|
||||||
|
return delProcessPlanParam(row.paramId)
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
this.loadParams(this.selectedPlan.planId)
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
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.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanVo;
|
||||||
|
import com.klp.service.IWmsProcessPlanService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/processPlan")
|
||||||
|
public class WmsProcessPlanController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsProcessPlanService wmsProcessPlanService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsProcessPlanVo> list(WmsProcessPlanBo bo, PageQuery pageQuery) {
|
||||||
|
return wmsProcessPlanService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案点位", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsProcessPlanBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsProcessPlanVo> list = wmsProcessPlanService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "方案点位", WmsProcessPlanVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{planId}")
|
||||||
|
public R<WmsProcessPlanVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long planId) {
|
||||||
|
return R.ok(wmsProcessPlanService.queryById(planId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案点位", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessPlanBo bo) {
|
||||||
|
return toAjax(wmsProcessPlanService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案点位", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessPlanBo bo) {
|
||||||
|
return toAjax(wmsProcessPlanService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案点位", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{planIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] planIds) {
|
||||||
|
return toAjax(wmsProcessPlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
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.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanParamBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanParamVo;
|
||||||
|
import com.klp.service.IWmsProcessPlanParamService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/processPlanParam")
|
||||||
|
public class WmsProcessPlanParamController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsProcessPlanParamService wmsProcessPlanParamService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsProcessPlanParamVo> list(WmsProcessPlanParamBo bo, PageQuery pageQuery) {
|
||||||
|
return wmsProcessPlanParamService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案参数", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsProcessPlanParamBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsProcessPlanParamVo> list = wmsProcessPlanParamService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "方案参数", WmsProcessPlanParamVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{paramId}")
|
||||||
|
public R<WmsProcessPlanParamVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long paramId) {
|
||||||
|
return R.ok(wmsProcessPlanParamService.queryById(paramId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案参数", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessPlanParamBo bo) {
|
||||||
|
return toAjax(wmsProcessPlanParamService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案参数", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessPlanParamBo bo) {
|
||||||
|
return toAjax(wmsProcessPlanParamService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "方案参数", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{paramIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] paramIds) {
|
||||||
|
return toAjax(wmsProcessPlanParamService.deleteWithValidByIds(Arrays.asList(paramIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
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.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.domain.bo.WmsProcessSpecBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVo;
|
||||||
|
import com.klp.service.IWmsProcessSpecService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/processSpec")
|
||||||
|
public class WmsProcessSpecController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsProcessSpecService wmsProcessSpecService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规程主表列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsProcessSpecVo> list(WmsProcessSpecBo bo, PageQuery pageQuery) {
|
||||||
|
return wmsProcessSpecService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出规程主表列表
|
||||||
|
*/
|
||||||
|
@Log(title = "规程主表", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsProcessSpecBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsProcessSpecVo> list = wmsProcessSpecService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "规程主表", WmsProcessSpecVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取规程主表详细信息
|
||||||
|
*
|
||||||
|
* @param specId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{specId}")
|
||||||
|
public R<WmsProcessSpecVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long specId) {
|
||||||
|
return R.ok(wmsProcessSpecService.queryById(specId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规程主表
|
||||||
|
*/
|
||||||
|
@Log(title = "规程主表", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessSpecBo bo) {
|
||||||
|
return toAjax(wmsProcessSpecService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规程主表
|
||||||
|
*/
|
||||||
|
@Log(title = "规程主表", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessSpecBo bo) {
|
||||||
|
return toAjax(wmsProcessSpecService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规程主表
|
||||||
|
*
|
||||||
|
* @param specIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "规程主表", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{specIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] specIds) {
|
||||||
|
return toAjax(wmsProcessSpecService.deleteWithValidByIds(Arrays.asList(specIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
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.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.domain.bo.WmsProcessSpecVersionBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVersionVo;
|
||||||
|
import com.klp.service.IWmsProcessSpecVersionService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/processSpecVersion")
|
||||||
|
public class WmsProcessSpecVersionController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsProcessSpecVersionService wmsProcessSpecVersionService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsProcessSpecVersionVo> list(WmsProcessSpecVersionBo bo, PageQuery pageQuery) {
|
||||||
|
return wmsProcessSpecVersionService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "规程版本", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsProcessSpecVersionBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsProcessSpecVersionVo> list = wmsProcessSpecVersionService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "规程版本", WmsProcessSpecVersionVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{versionId}")
|
||||||
|
public R<WmsProcessSpecVersionVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long versionId) {
|
||||||
|
return R.ok(wmsProcessSpecVersionService.queryById(versionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "规程版本", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessSpecVersionBo bo) {
|
||||||
|
return toAjax(wmsProcessSpecVersionService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "规程版本", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessSpecVersionBo bo) {
|
||||||
|
return toAjax(wmsProcessSpecVersionService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设为当前生效版本(同规程下仅一条生效)
|
||||||
|
*/
|
||||||
|
@Log(title = "规程版本生效", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/activate/{versionId}")
|
||||||
|
public R<Void> activate(@NotNull(message = "主键不能为空") @PathVariable Long versionId) {
|
||||||
|
return toAjax(wmsProcessSpecVersionService.activateVersion(versionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "规程版本", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{versionIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] versionIds) {
|
||||||
|
return toAjax(wmsProcessSpecVersionService.deleteWithValidByIds(Arrays.asList(versionIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
59
klp-wms/src/main/java/com/klp/domain/WmsProcessPlan.java
Normal file
59
klp-wms/src/main/java/com/klp/domain/WmsProcessPlan.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_process_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_process_plan")
|
||||||
|
public class WmsProcessPlan extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "plan_id")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本ID
|
||||||
|
*/
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 段类型(INLET/PROCESS/OUTLET)
|
||||||
|
*/
|
||||||
|
private String segmentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 段名称
|
||||||
|
*/
|
||||||
|
private String segmentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位名称
|
||||||
|
*/
|
||||||
|
private String pointName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位编码
|
||||||
|
*/
|
||||||
|
private String pointCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
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.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数对象 wms_process_plan_param
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_process_plan_param")
|
||||||
|
public class WmsProcessPlanParam extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "param_id")
|
||||||
|
private Long paramId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位ID
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数编码
|
||||||
|
*/
|
||||||
|
private String paramCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
private String paramName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设定值
|
||||||
|
*/
|
||||||
|
private BigDecimal targetValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限
|
||||||
|
*/
|
||||||
|
private BigDecimal lowerLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限
|
||||||
|
*/
|
||||||
|
private BigDecimal upperLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
68
klp-wms/src/main/java/com/klp/domain/WmsProcessSpec.java
Normal file
68
klp-wms/src/main/java/com/klp/domain/WmsProcessSpec.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
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_process_spec
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_process_spec")
|
||||||
|
public class WmsProcessSpec extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "spec_id")
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程编号
|
||||||
|
*/
|
||||||
|
private String specCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程名称
|
||||||
|
*/
|
||||||
|
private String specName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(PROCESS/STANDARD)
|
||||||
|
*/
|
||||||
|
private String specType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线ID
|
||||||
|
*/
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品类型
|
||||||
|
*/
|
||||||
|
private String productType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer isEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,2=删除,与全局 logicDeleteValue 一致)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
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_process_spec_version
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_process_spec_version")
|
||||||
|
public class WmsProcessSpecVersion extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "version_id")
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表ID
|
||||||
|
*/
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号
|
||||||
|
*/
|
||||||
|
private String versionCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否当前生效(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer isActive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位业务对象 wms_process_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsProcessPlanBo extends BaseEntity {
|
||||||
|
|
||||||
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@NotNull(message = "版本不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
@NotBlank(message = "段类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String segmentType;
|
||||||
|
|
||||||
|
private String segmentName;
|
||||||
|
|
||||||
|
@NotBlank(message = "点位名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String pointName;
|
||||||
|
|
||||||
|
@NotBlank(message = "点位编码不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String pointCode;
|
||||||
|
|
||||||
|
@NotNull(message = "排序不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数业务对象 wms_process_plan_param
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsProcessPlanParamBo extends BaseEntity {
|
||||||
|
|
||||||
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
|
private Long paramId;
|
||||||
|
|
||||||
|
@NotNull(message = "方案点位不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@NotBlank(message = "参数编码不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String paramCode;
|
||||||
|
|
||||||
|
@NotBlank(message = "参数名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String paramName;
|
||||||
|
|
||||||
|
private BigDecimal targetValue;
|
||||||
|
|
||||||
|
private BigDecimal lowerLimit;
|
||||||
|
|
||||||
|
private BigDecimal upperLimit;
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表业务对象 wms_process_spec
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsProcessSpecBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程编号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "规程编号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String specCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "规程名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String specName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(PROCESS/STANDARD)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "规程类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String specType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "产线不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品类型
|
||||||
|
*/
|
||||||
|
private String productType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer isEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本业务对象 wms_process_spec_version
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsProcessSpecVersionBo extends BaseEntity {
|
||||||
|
|
||||||
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
@NotNull(message = "规程不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
@NotBlank(message = "版本号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private String versionCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否当前生效(0=否,1=是)
|
||||||
|
*/
|
||||||
|
private Integer isActive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数视图对象 wms_process_plan_param
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsProcessPlanParamVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "参数ID")
|
||||||
|
private Long paramId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "方案点位ID")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "参数编码")
|
||||||
|
private String paramCode;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "参数名称")
|
||||||
|
private String paramName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "设定值")
|
||||||
|
private BigDecimal targetValue;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "下限")
|
||||||
|
private BigDecimal lowerLimit;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "上限")
|
||||||
|
private BigDecimal upperLimit;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位视图对象 wms_process_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsProcessPlanVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "方案点位ID")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "版本ID")
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "段类型")
|
||||||
|
private String segmentType;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "段名称")
|
||||||
|
private String segmentName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "点位名称")
|
||||||
|
private String pointName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "点位编码")
|
||||||
|
private String pointCode;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "排序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本视图对象 wms_process_spec_version
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsProcessSpecVersionVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "版本ID")
|
||||||
|
private Long versionId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "规程ID")
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "版本号")
|
||||||
|
private String versionCode;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "是否生效")
|
||||||
|
private Integer isActive;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表视图对象 wms_process_spec
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsProcessSpecVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long specId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "规程编号")
|
||||||
|
private String specCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "规程名称")
|
||||||
|
private String specName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(PROCESS/STANDARD)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "规程类型")
|
||||||
|
private String specType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "产线ID")
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "产品类型")
|
||||||
|
private String productType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用(0=否,1=是)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否启用")
|
||||||
|
private Integer isEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsProcessPlan;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位Mapper
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface WmsProcessPlanMapper extends BaseMapperPlus<WmsProcessPlanMapper, WmsProcessPlan, WmsProcessPlanVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsProcessPlanParam;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanParamVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数Mapper
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface WmsProcessPlanParamMapper extends BaseMapperPlus<WmsProcessPlanParamMapper, WmsProcessPlanParam, WmsProcessPlanParamVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsProcessSpec;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface WmsProcessSpecMapper extends BaseMapperPlus<WmsProcessSpecMapper, WmsProcessSpec, WmsProcessSpecVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.klp.domain.WmsProcessSpecVersion;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVersionVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本Mapper
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface WmsProcessSpecVersionMapper extends BaseMapperPlus<WmsProcessSpecVersionMapper, WmsProcessSpecVersion, WmsProcessSpecVersionVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanParamBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanParamVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数Service
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface IWmsProcessPlanParamService {
|
||||||
|
|
||||||
|
WmsProcessPlanParamVo queryById(Long paramId);
|
||||||
|
|
||||||
|
TableDataInfo<WmsProcessPlanParamVo> queryPageList(WmsProcessPlanParamBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<WmsProcessPlanParamVo> queryList(WmsProcessPlanParamBo bo);
|
||||||
|
|
||||||
|
Boolean insertByBo(WmsProcessPlanParamBo bo);
|
||||||
|
|
||||||
|
Boolean updateByBo(WmsProcessPlanParamBo bo);
|
||||||
|
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位Service
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface IWmsProcessPlanService {
|
||||||
|
|
||||||
|
WmsProcessPlanVo queryById(Long planId);
|
||||||
|
|
||||||
|
TableDataInfo<WmsProcessPlanVo> queryPageList(WmsProcessPlanBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<WmsProcessPlanVo> queryList(WmsProcessPlanBo bo);
|
||||||
|
|
||||||
|
Boolean insertByBo(WmsProcessPlanBo bo);
|
||||||
|
|
||||||
|
Boolean updateByBo(WmsProcessPlanBo bo);
|
||||||
|
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.domain.bo.WmsProcessSpecBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface IWmsProcessSpecService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规程主表
|
||||||
|
*/
|
||||||
|
WmsProcessSpecVo queryById(Long specId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规程主表分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<WmsProcessSpecVo> queryPageList(WmsProcessSpecBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规程主表列表
|
||||||
|
*/
|
||||||
|
List<WmsProcessSpecVo> queryList(WmsProcessSpecBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规程主表
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(WmsProcessSpecBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规程主表
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(WmsProcessSpecBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除规程主表
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -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.WmsProcessSpecVersionBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVersionVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本Service
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
public interface IWmsProcessSpecVersionService {
|
||||||
|
|
||||||
|
WmsProcessSpecVersionVo queryById(Long versionId);
|
||||||
|
|
||||||
|
TableDataInfo<WmsProcessSpecVersionVo> queryPageList(WmsProcessSpecVersionBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<WmsProcessSpecVersionVo> queryList(WmsProcessSpecVersionBo bo);
|
||||||
|
|
||||||
|
Boolean insertByBo(WmsProcessSpecVersionBo bo);
|
||||||
|
|
||||||
|
Boolean updateByBo(WmsProcessSpecVersionBo bo);
|
||||||
|
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将指定版本设为当前规程下唯一生效版本
|
||||||
|
*/
|
||||||
|
Boolean activateVersion(Long versionId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
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.WmsProcessPlan;
|
||||||
|
import com.klp.domain.WmsProcessPlanParam;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanParamBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanParamVo;
|
||||||
|
import com.klp.mapper.WmsProcessPlanMapper;
|
||||||
|
import com.klp.mapper.WmsProcessPlanParamMapper;
|
||||||
|
import com.klp.service.IWmsProcessPlanParamService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案参数Service实现
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsProcessPlanParamServiceImpl implements IWmsProcessPlanParamService {
|
||||||
|
|
||||||
|
private final WmsProcessPlanParamMapper baseMapper;
|
||||||
|
private final WmsProcessPlanMapper wmsProcessPlanMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsProcessPlanParamVo queryById(Long paramId) {
|
||||||
|
return baseMapper.selectVoById(paramId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsProcessPlanParamVo> queryPageList(WmsProcessPlanParamBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlanParam> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsProcessPlanParamVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsProcessPlanParamVo> queryList(WmsProcessPlanParamBo bo) {
|
||||||
|
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsProcessPlanParam> buildQueryWrapper(WmsProcessPlanParamBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlanParam> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getPlanId() != null, WmsProcessPlanParam::getPlanId, bo.getPlanId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getParamCode()), WmsProcessPlanParam::getParamCode, bo.getParamCode());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getParamName()), WmsProcessPlanParam::getParamName, bo.getParamName());
|
||||||
|
lqw.orderByAsc(WmsProcessPlanParam::getParamId);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsProcessPlanParamBo bo) {
|
||||||
|
WmsProcessPlan plan = wmsProcessPlanMapper.selectById(bo.getPlanId());
|
||||||
|
if (plan == null) {
|
||||||
|
throw new ServiceException("方案点位不存在");
|
||||||
|
}
|
||||||
|
WmsProcessPlanParam add = BeanUtil.toBean(bo, WmsProcessPlanParam.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setParamId(add.getParamId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsProcessPlanParamBo bo) {
|
||||||
|
WmsProcessPlanParam update = BeanUtil.toBean(bo, WmsProcessPlanParam.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsProcessPlanParam entity) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlanParam> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(WmsProcessPlanParam::getPlanId, entity.getPlanId());
|
||||||
|
lqw.eq(WmsProcessPlanParam::getParamCode, entity.getParamCode());
|
||||||
|
if (entity.getParamId() != null) {
|
||||||
|
lqw.ne(WmsProcessPlanParam::getParamId, entity.getParamId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(lqw) > 0) {
|
||||||
|
throw new ServiceException("同一方案点位下参数编码已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
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.WmsProcessPlan;
|
||||||
|
import com.klp.domain.WmsProcessPlanParam;
|
||||||
|
import com.klp.domain.WmsProcessSpecVersion;
|
||||||
|
import com.klp.domain.bo.WmsProcessPlanBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessPlanVo;
|
||||||
|
import com.klp.mapper.WmsProcessPlanMapper;
|
||||||
|
import com.klp.mapper.WmsProcessPlanParamMapper;
|
||||||
|
import com.klp.mapper.WmsProcessSpecVersionMapper;
|
||||||
|
import com.klp.service.IWmsProcessPlanService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案点位Service实现
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsProcessPlanServiceImpl implements IWmsProcessPlanService {
|
||||||
|
|
||||||
|
private final WmsProcessPlanMapper baseMapper;
|
||||||
|
private final WmsProcessSpecVersionMapper wmsProcessSpecVersionMapper;
|
||||||
|
private final WmsProcessPlanParamMapper wmsProcessPlanParamMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsProcessPlanVo queryById(Long planId) {
|
||||||
|
return baseMapper.selectVoById(planId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsProcessPlanVo> queryPageList(WmsProcessPlanBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlan> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsProcessPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsProcessPlanVo> queryList(WmsProcessPlanBo bo) {
|
||||||
|
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsProcessPlan> buildQueryWrapper(WmsProcessPlanBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlan> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getVersionId() != null, WmsProcessPlan::getVersionId, bo.getVersionId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSegmentType()), WmsProcessPlan::getSegmentType, bo.getSegmentType());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getPointName()), WmsProcessPlan::getPointName, bo.getPointName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPointCode()), WmsProcessPlan::getPointCode, bo.getPointCode());
|
||||||
|
lqw.orderByAsc(WmsProcessPlan::getSortOrder).orderByAsc(WmsProcessPlan::getPlanId);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsProcessPlanBo bo) {
|
||||||
|
WmsProcessSpecVersion ver = wmsProcessSpecVersionMapper.selectById(bo.getVersionId());
|
||||||
|
if (ver == null) {
|
||||||
|
throw new ServiceException("规程版本不存在");
|
||||||
|
}
|
||||||
|
WmsProcessPlan add = BeanUtil.toBean(bo, WmsProcessPlan.class);
|
||||||
|
if (add.getSortOrder() == null) {
|
||||||
|
add.setSortOrder(0);
|
||||||
|
}
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setPlanId(add.getPlanId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsProcessPlanBo bo) {
|
||||||
|
WmsProcessPlan update = BeanUtil.toBean(bo, WmsProcessPlan.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsProcessPlan entity) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlan> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(WmsProcessPlan::getVersionId, entity.getVersionId());
|
||||||
|
lqw.eq(WmsProcessPlan::getPointCode, entity.getPointCode());
|
||||||
|
if (entity.getPlanId() != null) {
|
||||||
|
lqw.ne(WmsProcessPlan::getPlanId, entity.getPlanId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(lqw) > 0) {
|
||||||
|
throw new ServiceException("同一版本下点位编码已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (Boolean.TRUE.equals(isValid)) {
|
||||||
|
// 可扩展业务校验
|
||||||
|
}
|
||||||
|
for (Long planId : ids) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlanParam> pq = Wrappers.lambdaQuery();
|
||||||
|
pq.eq(WmsProcessPlanParam::getPlanId, planId);
|
||||||
|
wmsProcessPlanParamMapper.delete(pq);
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
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.WmsProcessSpec;
|
||||||
|
import com.klp.domain.WmsProcessSpecVersion;
|
||||||
|
import com.klp.domain.bo.WmsProcessSpecBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVo;
|
||||||
|
import com.klp.mapper.WmsProcessSpecMapper;
|
||||||
|
import com.klp.mapper.WmsProcessSpecVersionMapper;
|
||||||
|
import com.klp.service.IWmsProcessSpecService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程主表Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsProcessSpecServiceImpl implements IWmsProcessSpecService {
|
||||||
|
|
||||||
|
private final WmsProcessSpecMapper baseMapper;
|
||||||
|
private final WmsProcessSpecVersionMapper wmsProcessSpecVersionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsProcessSpecVo queryById(Long specId) {
|
||||||
|
return baseMapper.selectVoById(specId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsProcessSpecVo> queryPageList(WmsProcessSpecBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpec> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsProcessSpecVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsProcessSpecVo> queryList(WmsProcessSpecBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpec> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsProcessSpec> buildQueryWrapper(WmsProcessSpecBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpec> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSpecCode()), WmsProcessSpec::getSpecCode, bo.getSpecCode());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getSpecName()), WmsProcessSpec::getSpecName, bo.getSpecName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSpecType()), WmsProcessSpec::getSpecType, bo.getSpecType());
|
||||||
|
lqw.eq(bo.getLineId() != null, WmsProcessSpec::getLineId, bo.getLineId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getProductType()), WmsProcessSpec::getProductType, bo.getProductType());
|
||||||
|
lqw.eq(bo.getIsEnabled() != null, WmsProcessSpec::getIsEnabled, bo.getIsEnabled());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsProcessSpecBo bo) {
|
||||||
|
WmsProcessSpec add = BeanUtil.toBean(bo, WmsProcessSpec.class);
|
||||||
|
if (add.getIsEnabled() == null) {
|
||||||
|
add.setIsEnabled(1);
|
||||||
|
}
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setSpecId(add.getSpecId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsProcessSpecBo bo) {
|
||||||
|
WmsProcessSpec update = BeanUtil.toBean(bo, WmsProcessSpec.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsProcessSpec entity) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpec> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(WmsProcessSpec::getSpecCode, entity.getSpecCode());
|
||||||
|
if (entity.getSpecId() != null) {
|
||||||
|
lqw.ne(WmsProcessSpec::getSpecId, entity.getSpecId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(lqw) > 0) {
|
||||||
|
throw new ServiceException("规程编号已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (Boolean.TRUE.equals(isValid)) {
|
||||||
|
for (Long specId : ids) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpecVersion> vq = Wrappers.lambdaQuery();
|
||||||
|
vq.eq(WmsProcessSpecVersion::getSpecId, specId);
|
||||||
|
if (wmsProcessSpecVersionMapper.selectCount(vq) > 0) {
|
||||||
|
throw new ServiceException("规程下存在版本数据,请先删除版本及方案");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
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.WmsProcessSpec;
|
||||||
|
import com.klp.domain.WmsProcessPlan;
|
||||||
|
import com.klp.domain.WmsProcessPlanParam;
|
||||||
|
import com.klp.domain.WmsProcessSpecVersion;
|
||||||
|
import com.klp.domain.bo.WmsProcessSpecVersionBo;
|
||||||
|
import com.klp.domain.vo.WmsProcessSpecVersionVo;
|
||||||
|
import com.klp.mapper.WmsProcessPlanMapper;
|
||||||
|
import com.klp.mapper.WmsProcessPlanParamMapper;
|
||||||
|
import com.klp.mapper.WmsProcessSpecMapper;
|
||||||
|
import com.klp.mapper.WmsProcessSpecVersionMapper;
|
||||||
|
import com.klp.service.IWmsProcessSpecVersionService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规程版本Service实现
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsProcessSpecVersionServiceImpl implements IWmsProcessSpecVersionService {
|
||||||
|
|
||||||
|
private final WmsProcessSpecVersionMapper baseMapper;
|
||||||
|
private final WmsProcessSpecMapper wmsProcessSpecMapper;
|
||||||
|
private final WmsProcessPlanMapper wmsProcessPlanMapper;
|
||||||
|
private final WmsProcessPlanParamMapper wmsProcessPlanParamMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WmsProcessSpecVersionVo queryById(Long versionId) {
|
||||||
|
return baseMapper.selectVoById(versionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsProcessSpecVersionVo> queryPageList(WmsProcessSpecVersionBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpecVersion> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsProcessSpecVersionVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsProcessSpecVersionVo> queryList(WmsProcessSpecVersionBo bo) {
|
||||||
|
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsProcessSpecVersion> buildQueryWrapper(WmsProcessSpecVersionBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpecVersion> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getSpecId() != null, WmsProcessSpecVersion::getSpecId, bo.getSpecId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getVersionCode()), WmsProcessSpecVersion::getVersionCode, bo.getVersionCode());
|
||||||
|
lqw.eq(bo.getIsActive() != null, WmsProcessSpecVersion::getIsActive, bo.getIsActive());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), WmsProcessSpecVersion::getStatus, bo.getStatus());
|
||||||
|
lqw.orderByDesc(WmsProcessSpecVersion::getCreateTime);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean insertByBo(WmsProcessSpecVersionBo bo) {
|
||||||
|
WmsProcessSpec spec = wmsProcessSpecMapper.selectById(bo.getSpecId());
|
||||||
|
if (spec == null) {
|
||||||
|
throw new ServiceException("规程不存在");
|
||||||
|
}
|
||||||
|
WmsProcessSpecVersion add = BeanUtil.toBean(bo, WmsProcessSpecVersion.class);
|
||||||
|
if (add.getIsActive() == null) {
|
||||||
|
add.setIsActive(0);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(add.getStatus())) {
|
||||||
|
add.setStatus("DRAFT");
|
||||||
|
}
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean ok = baseMapper.insert(add) > 0;
|
||||||
|
if (ok) {
|
||||||
|
bo.setVersionId(add.getVersionId());
|
||||||
|
if (Integer.valueOf(1).equals(add.getIsActive())) {
|
||||||
|
activateVersion(add.getVersionId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean updateByBo(WmsProcessSpecVersionBo bo) {
|
||||||
|
WmsProcessSpecVersion exist = baseMapper.selectById(bo.getVersionId());
|
||||||
|
if (exist == null) {
|
||||||
|
throw new ServiceException("版本不存在");
|
||||||
|
}
|
||||||
|
WmsProcessSpecVersion update = BeanUtil.toBean(bo, WmsProcessSpecVersion.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
boolean ok = baseMapper.updateById(update) > 0;
|
||||||
|
if (ok && Integer.valueOf(1).equals(update.getIsActive())) {
|
||||||
|
activateVersion(update.getVersionId());
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validEntityBeforeSave(WmsProcessSpecVersion entity) {
|
||||||
|
LambdaQueryWrapper<WmsProcessSpecVersion> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(WmsProcessSpecVersion::getSpecId, entity.getSpecId());
|
||||||
|
lqw.eq(WmsProcessSpecVersion::getVersionCode, entity.getVersionCode());
|
||||||
|
if (entity.getVersionId() != null) {
|
||||||
|
lqw.ne(WmsProcessSpecVersion::getVersionId, entity.getVersionId());
|
||||||
|
}
|
||||||
|
if (baseMapper.selectCount(lqw) > 0) {
|
||||||
|
throw new ServiceException("同一规程下版本号已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean activateVersion(Long versionId) {
|
||||||
|
WmsProcessSpecVersion v = baseMapper.selectById(versionId);
|
||||||
|
if (v == null) {
|
||||||
|
throw new ServiceException("版本不存在");
|
||||||
|
}
|
||||||
|
LambdaUpdateWrapper<WmsProcessSpecVersion> clear = Wrappers.lambdaUpdate();
|
||||||
|
clear.eq(WmsProcessSpecVersion::getSpecId, v.getSpecId());
|
||||||
|
clear.set(WmsProcessSpecVersion::getIsActive, 0);
|
||||||
|
baseMapper.update(null, clear);
|
||||||
|
|
||||||
|
WmsProcessSpecVersion one = new WmsProcessSpecVersion();
|
||||||
|
one.setVersionId(versionId);
|
||||||
|
one.setIsActive(1);
|
||||||
|
return baseMapper.updateById(one) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
for (Long versionId : ids) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlan> pq = Wrappers.lambdaQuery();
|
||||||
|
pq.eq(WmsProcessPlan::getVersionId, versionId);
|
||||||
|
List<WmsProcessPlan> plans = wmsProcessPlanMapper.selectList(pq);
|
||||||
|
for (WmsProcessPlan plan : plans) {
|
||||||
|
LambdaQueryWrapper<WmsProcessPlanParam> pr = Wrappers.lambdaQuery();
|
||||||
|
pr.eq(WmsProcessPlanParam::getPlanId, plan.getPlanId());
|
||||||
|
wmsProcessPlanParamMapper.delete(pr);
|
||||||
|
}
|
||||||
|
wmsProcessPlanMapper.delete(pq);
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?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.WmsProcessPlanMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsProcessPlan" id="WmsProcessPlanResult">
|
||||||
|
<result property="planId" column="plan_id"/>
|
||||||
|
<result property="versionId" column="version_id"/>
|
||||||
|
<result property="segmentType" column="segment_type"/>
|
||||||
|
<result property="segmentName" column="segment_name"/>
|
||||||
|
<result property="pointName" column="point_name"/>
|
||||||
|
<result property="pointCode" column="point_code"/>
|
||||||
|
<result property="sortOrder" column="sort_order"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?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.WmsProcessPlanParamMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsProcessPlanParam" id="WmsProcessPlanParamResult">
|
||||||
|
<result property="paramId" column="param_id"/>
|
||||||
|
<result property="planId" column="plan_id"/>
|
||||||
|
<result property="paramCode" column="param_code"/>
|
||||||
|
<result property="paramName" column="param_name"/>
|
||||||
|
<result property="targetValue" column="target_value"/>
|
||||||
|
<result property="lowerLimit" column="lower_limit"/>
|
||||||
|
<result property="upperLimit" column="upper_limit"/>
|
||||||
|
<result property="unit" column="unit"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?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.WmsProcessSpecMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsProcessSpec" id="WmsProcessSpecResult">
|
||||||
|
<result property="specId" column="spec_id"/>
|
||||||
|
<result property="specCode" column="spec_code"/>
|
||||||
|
<result property="specName" column="spec_name"/>
|
||||||
|
<result property="specType" column="spec_type"/>
|
||||||
|
<result property="lineId" column="line_id"/>
|
||||||
|
<result property="productType" column="product_type"/>
|
||||||
|
<result property="isEnabled" column="is_enabled"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?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.WmsProcessSpecVersionMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsProcessSpecVersion" id="WmsProcessSpecVersionResult">
|
||||||
|
<result property="versionId" column="version_id"/>
|
||||||
|
<result property="specId" column="spec_id"/>
|
||||||
|
<result property="versionCode" column="version_code"/>
|
||||||
|
<result property="isActive" column="is_active"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user