新增三级钢卷数据查询配置
This commit is contained in:
@@ -16,6 +16,11 @@ spring:
|
|||||||
url:
|
url:
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
|
# 三级 klp-oa 主库(用于查询 WMS 钢卷数据)
|
||||||
|
klp:
|
||||||
|
url: jdbc:mysql://140.143.206.120:13306/klp-oa-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
|
||||||
|
username: klp
|
||||||
|
password: KeLunPu@123
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
# 最小连接池数量
|
# 最小连接池数量
|
||||||
|
|||||||
@@ -15,5 +15,10 @@ public enum DataSourceType
|
|||||||
/**
|
/**
|
||||||
* 从库
|
* 从库
|
||||||
*/
|
*/
|
||||||
SLAVE
|
SLAVE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三级 klp-oa 主库
|
||||||
|
*/
|
||||||
|
KLP
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ public class DruidConfig
|
|||||||
return druidProperties.dataSource(dataSource);
|
return druidProperties.dataSource(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConfigurationProperties("spring.datasource.druid.klp")
|
||||||
|
public DataSource klpDataSource(DruidProperties druidProperties)
|
||||||
|
{
|
||||||
|
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||||
|
return druidProperties.dataSource(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
@Bean(name = "dynamicDataSource")
|
@Bean(name = "dynamicDataSource")
|
||||||
@Primary
|
@Primary
|
||||||
public DynamicDataSource dataSource(DataSource masterDataSource)
|
public DynamicDataSource dataSource(DataSource masterDataSource)
|
||||||
@@ -56,6 +64,7 @@ public class DruidConfig
|
|||||||
Map<Object, Object> targetDataSources = new HashMap<>();
|
Map<Object, Object> targetDataSources = new HashMap<>();
|
||||||
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||||
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||||
|
setDataSource(targetDataSources, DataSourceType.KLP.name(), "klpDataSource");
|
||||||
return new DynamicDataSource(masterDataSource, targetDataSources);
|
return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,13 @@
|
|||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="钢卷编号" prop="inMatNo">
|
<el-form-item label="钢卷编号" prop="inMatNo">
|
||||||
<el-input v-model="form.inMatNo" :disabled="!isNew" />
|
<el-input v-model="form.inMatNo" :disabled="!isNew"
|
||||||
|
@keyup.enter.native="isNew && queryKlpCoil()"
|
||||||
|
@blur="isNew && queryKlpCoil()"
|
||||||
|
placeholder="回车从三级查询钢卷数据">
|
||||||
|
<el-button slot="append" icon="el-icon-search"
|
||||||
|
:loading="coilQuerying" @click="queryKlpCoil" v-if="isNew" />
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -323,6 +329,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listPlan, addPlan, updatePlan, delPlan, moveUpPlan, moveDownPlan, finishPlan } from '@/api/mill/plan'
|
import { listPlan, addPlan, updatePlan, delPlan, moveUpPlan, moveDownPlan, finishPlan } from '@/api/mill/plan'
|
||||||
import { listAllRecipe, getRecipeDetail, addRecipe } from '@/api/mill/recipe'
|
import { listAllRecipe, getRecipeDetail, addRecipe } from '@/api/mill/recipe'
|
||||||
|
import request from '@/utils/request'
|
||||||
|
const queryKlpCoilByNo = (coilNo) => request({ url: '/mill/klpCoil/queryByCoilNo', method: 'get', params: { coilNo } })
|
||||||
|
|
||||||
const emptyForm = () => ({
|
const emptyForm = () => ({
|
||||||
planId: null, planNo: '', inMatNo: '', alloyNo: '', recipeId: null, recipeNo: '',
|
planId: null, planNo: '', inMatNo: '', alloyNo: '', recipeId: null, recipeNo: '',
|
||||||
@@ -366,6 +374,7 @@ export default {
|
|||||||
// 选择方案对话框
|
// 选择方案对话框
|
||||||
selectRecipeVisible: false,
|
selectRecipeVisible: false,
|
||||||
selectRecipeId: null,
|
selectRecipeId: null,
|
||||||
|
coilQuerying: false,
|
||||||
|
|
||||||
// 保存为方案对话框
|
// 保存为方案对话框
|
||||||
saveAsRecipeVisible: false,
|
saveAsRecipeVisible: false,
|
||||||
@@ -568,6 +577,24 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ── 从三级 WMS 查询钢卷数据 ──
|
||||||
|
queryKlpCoil() {
|
||||||
|
const coilNo = (this.form.inMatNo || '').trim()
|
||||||
|
if (!coilNo) return
|
||||||
|
this.coilQuerying = true
|
||||||
|
queryKlpCoilByNo(coilNo).then(res => {
|
||||||
|
const c = res && res.data
|
||||||
|
if (!c) { this.$message.info('三级 WMS 中未找到该钢卷号'); return }
|
||||||
|
if (c.actualThickness && !this.form.inMatThick) this.form.inMatThick = c.actualThickness
|
||||||
|
if (c.actualWidth && !this.form.inMatWidth) this.form.inMatWidth = String(c.actualWidth)
|
||||||
|
if (c.netWeight && !this.form.inMatWeight) this.form.inMatWeight = String(c.netWeight)
|
||||||
|
if (c.length && !this.form.inMatLength) this.form.inMatLength = String(c.length)
|
||||||
|
this.$message.success('已从三级 WMS 自动填入钢卷数据')
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.warning('三级 WMS 查询失败,请手动填写')
|
||||||
|
}).finally(() => { this.coilQuerying = false })
|
||||||
|
},
|
||||||
|
|
||||||
// ── 钢卷 CRUD ──
|
// ── 钢卷 CRUD ──
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.isNew = true
|
this.isNew = true
|
||||||
|
|||||||
Reference in New Issue
Block a user