Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -96,6 +96,11 @@ public class OperLogEvent implements Serializable {
|
||||
*/
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
* 页面路由
|
||||
*/
|
||||
private String operPage;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
|
||||
@@ -72,6 +72,8 @@ public class LogAspect {
|
||||
String ip = ServletUtils.getClientIP();
|
||||
operLog.setOperIp(ip);
|
||||
operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
|
||||
// 从请求头获取前端页面路由
|
||||
operLog.setOperPage(StringUtils.substring(ServletUtils.getRequest().getHeader("X-Page-Route"), 0, 255));
|
||||
operLog.setOperName(LoginHelper.getUsername());
|
||||
|
||||
if (e != null) {
|
||||
|
||||
@@ -133,6 +133,12 @@ public class SysOperLog implements Serializable {
|
||||
@ExcelProperty(value = "操作时间")
|
||||
private Date operTime;
|
||||
|
||||
/**
|
||||
* 页面路由
|
||||
*/
|
||||
@ExcelProperty(value = "页面路由")
|
||||
private String operPage;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<result property="operName" column="oper_name"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="operUrl" column="oper_url"/>
|
||||
<result property="operPage" column="oper_page"/>
|
||||
<result property="operIp" column="oper_ip"/>
|
||||
<result property="operLocation" column="oper_location"/>
|
||||
<result property="operParam" column="oper_param"/>
|
||||
|
||||
26
klp-ui/src/api/l2/mill.js
Normal file
26
klp-ui/src/api/l2/mill.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/millRequest'
|
||||
|
||||
// 当前卷 + 下一卷:L2真实数据 与 我们模型预测数据,四组一起返回
|
||||
export function getLatestMillData() {
|
||||
return request({
|
||||
url: '/latest',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 单次预测(静态/序贯两种模式,见klp-ml-mill/api.py PredictRequest)
|
||||
export function predictMill(data) {
|
||||
return request({
|
||||
url: '/predict',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 服务健康检查 + 数据库摘要
|
||||
export function getMillHealth() {
|
||||
return request({
|
||||
url: '/health',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delInspectionMain(mainId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量新增检验主及明细,并更新申请单detailIds
|
||||
export function batchInsertMainWithDetails(data) {
|
||||
return request({
|
||||
url: '/wms/inspectionMain/batchInsertWithDetails',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,3 +42,12 @@ export function delInspectionTensileDetail(detailId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量插入明细并更新申请单detailIds
|
||||
export function batchInsertTensileDetails(data) {
|
||||
return request({
|
||||
url: '/wms/inspectionTensileDetail/batchInsertDetails',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
41
klp-ui/src/utils/millRequest.js
Normal file
41
klp-ui/src/utils/millRequest.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import axios from 'axios'
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
// 酸轧六机架轧制模型服务(klp-ml-mill FastAPI)专用请求实例。
|
||||
// 这是一套独立的 Python 服务,不走若依后端的 {code,msg,data} 包装协议,
|
||||
// 直接返回业务 JSON,所以单独起一个 axios 实例,不复用 utils/request.js 的响应拦截逻辑。
|
||||
const service = axios.create({
|
||||
baseURL: '/mill-api',
|
||||
timeout: 60000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
// 临时鉴权Key,服务端在请求头 X-API-Key 校验(见 klp-ml-mill/api.py)。
|
||||
// 值不写死在代码里,从 VUE_APP_MILL_API_KEY 读(见 klp-ui/.env.local,未入库)。
|
||||
'X-API-Key': process.env.VUE_APP_MILL_API_KEY || ''
|
||||
}
|
||||
})
|
||||
|
||||
if (!process.env.VUE_APP_MILL_API_KEY) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[millRequest] 未配置 VUE_APP_MILL_API_KEY,模型服务接口会被拒绝(401)。'
|
||||
+ '请在 klp-ui/.env.local 里设置该变量。')
|
||||
}
|
||||
|
||||
service.interceptors.response.use(
|
||||
res => res.data,
|
||||
error => {
|
||||
let message = error.message || '请求失败'
|
||||
if (error.response) {
|
||||
const detail = error.response.data && error.response.data.detail
|
||||
message = detail || `模型服务接口异常(${error.response.status})`
|
||||
} else if (message === 'Network Error') {
|
||||
message = '无法连接模型服务(klp-ml-mill),请确认服务是否已启动'
|
||||
} else if (message.includes('timeout')) {
|
||||
message = '模型服务请求超时'
|
||||
}
|
||||
Message({ message, type: 'error', duration: 5000 })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
||||
@@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode'
|
||||
import { tansParams, blobValidate } from "@/utils/klp";
|
||||
import cache from '@/plugins/cache'
|
||||
import { saveAs } from 'file-saver'
|
||||
import router from '@/router'
|
||||
|
||||
let downloadLoadingInstance;
|
||||
// 是否显示重新登录
|
||||
@@ -85,6 +86,10 @@ service.interceptors.request.use(config => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 将当前页面路由放入请求头,供后端操作日志记录
|
||||
if (router.currentRoute && router.currentRoute.path) {
|
||||
config.headers['X-Page-Route'] = router.currentRoute.path
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
|
||||
<script>
|
||||
import { listInspectionMain, addInspectionMain, updateInspectionMain, delInspectionMain } from '@/api/mes/qc/inspectionMain'
|
||||
import { listInspectionDetail, addInspectionDetail, updateInspectionDetail } from '@/api/mes/qc/inspectionDetail'
|
||||
import { listInspectionDetail } from '@/api/mes/qc/inspectionDetail'
|
||||
import { listInspectionItemTemplate, getInfoByInspectionItem } from '@/api/mes/qc/inspectionItemTemplate'
|
||||
|
||||
export default {
|
||||
@@ -391,36 +391,28 @@ export default {
|
||||
|
||||
handleSaveMain(row) {
|
||||
row._saving = true
|
||||
const detailList = this.checkItems.map(checkItem => {
|
||||
const itemData = row._items[checkItem.itemName]
|
||||
if (!itemData || (!itemData.itemValue && !itemData.detailId)) return null
|
||||
return {
|
||||
detailId: itemData.detailId,
|
||||
mainId: row.mainId,
|
||||
itemName: itemData.itemName,
|
||||
itemValue: itemData.itemValue || '',
|
||||
itemUnit: itemData.itemUnit || '',
|
||||
upperLimit: itemData.upperLimit,
|
||||
lowerLimit: itemData.lowerLimit,
|
||||
rangeDesc: itemData.rangeDesc || ''
|
||||
}
|
||||
}).filter(Boolean)
|
||||
updateInspectionMain({
|
||||
mainId: row.mainId,
|
||||
sampleName: row.sampleName,
|
||||
sampleNo: row.sampleNo,
|
||||
batchNo: row.batchNo,
|
||||
inspectionDate: row.inspectionDate,
|
||||
remark: row.remark
|
||||
}).then(() => {
|
||||
const items = this.checkItems.map(checkItem => {
|
||||
const itemData = row._items[checkItem.itemName]
|
||||
return itemData || { itemName: checkItem.itemName }
|
||||
})
|
||||
const promises = items.map(item => {
|
||||
const data = {
|
||||
mainId: row.mainId,
|
||||
itemName: item.itemName,
|
||||
itemValue: item.itemValue,
|
||||
itemUnit: item.itemUnit,
|
||||
upperLimit: item.upperLimit,
|
||||
lowerLimit: item.lowerLimit
|
||||
}
|
||||
if (item.detailId) {
|
||||
data.detailId = item.detailId
|
||||
return updateInspectionDetail(data)
|
||||
} else if (item.itemValue) {
|
||||
return addInspectionDetail(data)
|
||||
}
|
||||
return Promise.resolve()
|
||||
})
|
||||
return Promise.all(promises)
|
||||
remark: row.remark,
|
||||
detailList: detailList
|
||||
}).then(() => {
|
||||
this.$message.success('保存成功')
|
||||
return listInspectionDetail({ mainId: row.mainId, pageNum: 1, pageSize: 9999 })
|
||||
|
||||
@@ -519,7 +519,7 @@
|
||||
|
||||
<script>
|
||||
import { listInspectionTensile, getInspectionTensile, addInspectionTensile, updateInspectionTensile } from '@/api/mes/qc/inspectionTensile'
|
||||
import { listInspectionTensileDetail, addInspectionTensileDetail, updateInspectionTensileDetail, delInspectionTensileDetail } from '@/api/mes/qc/inspectionTensileDetail'
|
||||
import { listInspectionTensileDetail, addInspectionTensileDetail, updateInspectionTensileDetail, delInspectionTensileDetail, batchInsertTensileDetails } from '@/api/mes/qc/inspectionTensileDetail'
|
||||
import { listMaterialCoil } from '@/api/wms/coil'
|
||||
import { listChemicalItem } from '@/api/mes/qc/chemicalItem'
|
||||
import { listPhysicalItem } from '@/api/mes/qc/physicalItem'
|
||||
@@ -765,16 +765,12 @@ export default {
|
||||
this.$message.warning('请选择钢卷')
|
||||
return
|
||||
}
|
||||
|
||||
let successCount = 0
|
||||
let failCount = 0
|
||||
this.detailLoading = true
|
||||
|
||||
for (let index = 0; index < coils.length; index++) {
|
||||
const coil = coils[index]
|
||||
const detailList = []
|
||||
for (const coil of coils) {
|
||||
try {
|
||||
const data = await this.fetchLatestChemAndPhys(coil.enterCoilNo)
|
||||
addInspectionTensileDetail({
|
||||
detailList.push({
|
||||
testMainId: this.currentTestId,
|
||||
steelCoilNo: coil.currentCoilNo,
|
||||
material: coil.material,
|
||||
@@ -782,21 +778,27 @@ export default {
|
||||
rawMaterialNo: coil.enterCoilNo,
|
||||
...data
|
||||
})
|
||||
successCount++
|
||||
} catch {
|
||||
failCount++
|
||||
// skip failed coil
|
||||
}
|
||||
}
|
||||
|
||||
this.batchAddDialogVisible = false
|
||||
if (failCount === 0) {
|
||||
this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`)
|
||||
} else if (successCount === 0) {
|
||||
if (detailList.length === 0) {
|
||||
this.detailLoading = false
|
||||
this.$message.error('批量新增失败,请稍后重试')
|
||||
return
|
||||
}
|
||||
updateInspectionTensile({
|
||||
testId: this.currentTestId,
|
||||
detailList: detailList
|
||||
}).then(() => {
|
||||
this.$message.success(`批量新增成功,共新增 ${detailList.length} 条明细`)
|
||||
}).catch(() => {
|
||||
this.$message.error('批量新增失败')
|
||||
} else {
|
||||
this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.batchAddDialogVisible = false
|
||||
this.detailLoading = false
|
||||
this.getDetailList()
|
||||
})
|
||||
},
|
||||
|
||||
// 保存明细
|
||||
|
||||
113
klp-ui/src/views/micro/pages/acid/components/CoilInfoCard.vue
Normal file
113
klp-ui/src/views/micro/pages/acid/components/CoilInfoCard.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="coil-info-card">
|
||||
<div class="card-title">
|
||||
<span>{{ title }}</span>
|
||||
<span v-if="coil" class="status-text">{{ statusText }}</span>
|
||||
</div>
|
||||
<div v-if="!coil" class="empty-tip">暂无数据</div>
|
||||
<div v-else class="info-list">
|
||||
<div class="info-row">
|
||||
<span class="info-label">钢卷号</span>
|
||||
<span class="info-value">{{ coil.coilid || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">钢种</span>
|
||||
<span class="info-value">{{ coil.spec.grade }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">来料厚度</span>
|
||||
<span class="info-value">{{ coil.spec.entry_thick }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">成品厚度</span>
|
||||
<span class="info-value">{{ coil.spec.exit_thick }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">宽度</span>
|
||||
<span class="info-value">{{ coil.spec.width }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">压下率</span>
|
||||
<span class="info-value">{{ reductionPct }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const STATUS_TEXT = {
|
||||
PRODUCING: '正在轧',
|
||||
READY: '设定值已生成',
|
||||
ONLINE: '排队待轧',
|
||||
PRODUCT: '已轧完',
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'CoilInfoCard',
|
||||
props: {
|
||||
title: { type: String, required: true },
|
||||
coil: { type: Object, default: null },
|
||||
},
|
||||
computed: {
|
||||
statusText() {
|
||||
return STATUS_TEXT[this.coil.status] || this.coil.status || ''
|
||||
},
|
||||
reductionPct() {
|
||||
const s = this.coil && this.coil.spec
|
||||
if (!s || !s.entry_thick) return '-'
|
||||
return (((s.entry_thick - s.exit_thick) / s.entry_thick) * 100).toFixed(1)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coil-info-card {
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
padding: 12px 14px;
|
||||
|
||||
& + & {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
|
||||
.status-text {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
color: #c0c4cc;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
|
||||
.info-label {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
145
klp-ui/src/views/micro/pages/acid/components/CoilModelTable.vue
Normal file
145
klp-ui/src/views/micro/pages/acid/components/CoilModelTable.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="coil-model-table">
|
||||
<div class="section-title">{{ title }}</div>
|
||||
|
||||
<div v-if="!coil" class="empty-tip">暂无数据</div>
|
||||
|
||||
<template v-else>
|
||||
<div v-if="coil.l2_note" class="note-line">赛迪:{{ coil.l2_note }}</div>
|
||||
<div v-if="coil.ours_note" class="note-line">FAD:{{ coil.ours_note }}</div>
|
||||
|
||||
<el-table :data="rows" size="mini" border :row-class-name="rowClassName">
|
||||
<el-table-column label="机架" prop="standLabel" width="64" align="center" fixed />
|
||||
<el-table-column
|
||||
v-for="col in columns"
|
||||
:key="col.field"
|
||||
:label="col.label"
|
||||
align="center"
|
||||
>
|
||||
<template slot="header">
|
||||
<div>{{ col.label }}</div>
|
||||
<div class="col-unit">{{ col.unit }}</div>
|
||||
</template>
|
||||
<el-table-column label="赛迪" align="right" min-width="66">
|
||||
<template slot-scope="{ row }">{{ row.idle ? '-' : col.fmt(row.l2[col.field]) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="FAD" align="right" min-width="66">
|
||||
<template slot-scope="{ row }">
|
||||
<span class="fad-value">{{ row.idle ? '-' : col.fmt(row.ours[col.field]) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
function fmtNum(v, digits) {
|
||||
if (v === null || v === undefined || v === '') return '-'
|
||||
const n = Number(v)
|
||||
return Number.isNaN(n) ? '-' : n.toFixed(digits)
|
||||
}
|
||||
|
||||
// 与 klp-ml-mill/predict.py 的 TABLE_COLUMNS 保持一致
|
||||
const COLUMNS = [
|
||||
{ label: '入口厚度', unit: 'mm', field: 'setup_enthick', fmt: v => fmtNum(v, 3) },
|
||||
{ label: '压下率', unit: '%', field: 'setup_reduct', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '轧辊速度', unit: 'm/min', field: 'calc_stand_spd', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '前滑', unit: '%', field: 'meas_slip', fmt: v => fmtNum(v, 2) },
|
||||
{ label: '轧制力', unit: 'kN', field: 'calc_force', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '辊缝', unit: 'mm', field: 'calc_gap_run', fmt: v => fmtNum(v, 2) },
|
||||
{ label: '工作辊弯辊', unit: 'kN', field: 'mea_wr_bend', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '中间辊弯辊', unit: 'kN', field: 'mea_ir_bend', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '张应力', unit: 'MPa', field: 'setup_extension_stress', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '出口张力', unit: 'kN', field: 'setup_extension_force', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '负荷', unit: '%', field: 'calc_power_ratio', fmt: v => fmtNum(v, 0) },
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'CoilModelTable',
|
||||
props: {
|
||||
title: { type: String, required: true },
|
||||
coil: { type: Object, default: null },
|
||||
},
|
||||
data() {
|
||||
return { columns: COLUMNS }
|
||||
},
|
||||
computed: {
|
||||
// 6机架,每行同时带赛迪(L2实测)和FAD(我们预测)两组值,交给嵌套表头对比展示;
|
||||
// 空过机架(真正关闭的机架,不是"没数据")单独一行,不展示任何预测值。
|
||||
rows() {
|
||||
if (!this.coil) return []
|
||||
const l2 = this.coil.l2 || {}
|
||||
const ours = (this.coil.ours && this.coil.ours.predictions) || {}
|
||||
const out = []
|
||||
for (let sid = 0; sid < 6; sid++) {
|
||||
const oursStand = ours['stand' + sid] || {}
|
||||
const active = oursStand.active !== false
|
||||
if (!active) {
|
||||
out.push({ standLabel: '机架' + (sid + 1), idle: true })
|
||||
continue
|
||||
}
|
||||
const oursFlat = {}
|
||||
COLUMNS.forEach(c => {
|
||||
const e = oursStand[c.field]
|
||||
oursFlat[c.field] = e && typeof e === 'object' ? e.value : null
|
||||
})
|
||||
out.push({
|
||||
standLabel: '机架' + (sid + 1), idle: false,
|
||||
l2: l2[sid] || {},
|
||||
ours: oursFlat,
|
||||
})
|
||||
}
|
||||
return out
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
rowClassName({ row }) {
|
||||
return row.idle ? 'idle-row' : ''
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coil-model-table {
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
color: #c0c4cc;
|
||||
font-size: 13px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
.note-line {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.col-unit {
|
||||
font-size: 11px;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.fad-value {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
::v-deep .el-table .idle-row {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,10 @@
|
||||
<i class="el-icon-s-tools"></i>
|
||||
<span slot="title">规程</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="model">
|
||||
<i class="el-icon-cpu"></i>
|
||||
<span slot="title">模型</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="performance">
|
||||
<i class="el-icon-date"></i>
|
||||
<span slot="title">计划</span>
|
||||
@@ -39,7 +43,7 @@
|
||||
<span slot="title">实绩</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="rollConfig">
|
||||
<i class="el-icon-s-tools"></i>
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">配辊</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="rollHistory">
|
||||
@@ -54,10 +58,6 @@
|
||||
<i class="el-icon-alarm-clock"></i>
|
||||
<span slot="title">app</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="model">
|
||||
<i class="el-icon-coin"></i>
|
||||
<span slot="title">模型</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden;">
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
AcidTiming,
|
||||
TrackingView,
|
||||
ProcessSpec,
|
||||
Model,
|
||||
Model
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -166,6 +166,7 @@ export default {
|
||||
color: #606266;
|
||||
padding: 0 20px;
|
||||
font-size: 14px;
|
||||
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: #ecf5ff;
|
||||
@@ -176,11 +177,13 @@ export default {
|
||||
background-color: #ecf5ff;
|
||||
color: #409eff;
|
||||
border-right: 3px solid #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 18px;
|
||||
margin-right: 8px;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,14 @@ module.exports = {
|
||||
['^' + '/zinc-api']: '/api'
|
||||
}
|
||||
},
|
||||
// 酸轧六机架轧制模型服务(klp-ml-mill FastAPI),/predict /latest /sync /retrain /health
|
||||
'/mill-api': {
|
||||
target: `http://117.72.159.31:10001`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + '/mill-api']: ''
|
||||
}
|
||||
},
|
||||
// 直接代理WebSocket相关路径
|
||||
'/websocket': {
|
||||
target: `http://localhost:8080`,
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.klp.controller;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.klp.domain.bo.BatchInspectionMainBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -96,4 +97,14 @@ public class WmsInspectionMainController extends BaseController {
|
||||
@PathVariable Long[] mainIds) {
|
||||
return toAjax(iWmsInspectionMainService.deleteWithValidByIds(Arrays.asList(mainIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增检验主及明细,更新申请单detailIds为主键列表
|
||||
*/
|
||||
@Log(title = "批量新增检验主", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/batchInsertWithDetails")
|
||||
public R<Void> batchInsertWithDetails(@RequestBody BatchInspectionMainBo batchBo) {
|
||||
return toAjax(iWmsInspectionMainService.batchInsertWithDetails(
|
||||
batchBo.getMasterId(), batchBo.getApplicationId(), batchBo.getBoList()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.klp.controller;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.klp.domain.bo.BatchInspectionTensileBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -19,7 +20,9 @@ import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsInspectionTensileDetailVo;
|
||||
import com.klp.domain.bo.WmsInspectionTensileDetailBo;
|
||||
import com.klp.domain.bo.WmsInspectionTensileBo;
|
||||
import com.klp.service.IWmsInspectionTensileDetailService;
|
||||
import com.klp.service.IWmsInspectionTensileService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
@@ -96,4 +99,14 @@ public class WmsInspectionTensileDetailController extends BaseController {
|
||||
@PathVariable String[] detailIds) {
|
||||
return toAjax(iWmsInspectionTensileDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量插入明细并更新申请单detailIds
|
||||
*/
|
||||
@Log(title = "批量插入拉伸试验明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/batchInsertDetails")
|
||||
public R<Void> batchInsertDetails(@RequestBody BatchInspectionTensileBo bo) {
|
||||
return toAjax(iWmsInspectionTensileDetailService.batchInsertDetails(
|
||||
bo.getMasterId(), bo.getApplicationId(), bo.getDetailList()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BatchInspectionMainBo {
|
||||
private Long masterId;
|
||||
private Long applicationId;
|
||||
private List<WmsInspectionMainBo> boList;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BatchInspectionTensileBo {
|
||||
private Long masterId;
|
||||
private Long applicationId;
|
||||
private List<WmsInspectionTensileDetailBo> detailList;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -74,5 +75,10 @@ public class WmsInspectionMainBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 检验项目明细列表
|
||||
*/
|
||||
private List<WmsInspectionDetailBo> detailList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
@@ -265,4 +267,9 @@ public class WmsInspectionTensileDetailBo extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 试验样品明细列表
|
||||
*/
|
||||
private List<WmsInspectionTensileDetailBo> detailList;
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,9 @@ public interface IWmsInspectionMainService {
|
||||
* 校验并批量删除检验主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量新增检验主及明细,并更新申请单detailIds为主键列表
|
||||
*/
|
||||
Boolean batchInsertWithDetails(Long masterId, Long applicationId, List<WmsInspectionMainBo> boList);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,6 @@ public interface IWmsInspectionTensileDetailService {
|
||||
* 校验并批量删除金属材料室温拉伸试验样品明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
|
||||
Boolean batchInsertDetails(Long masterId, Long applicationId, List<WmsInspectionTensileDetailBo> detailList);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,19 @@ package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsInspectionApplication;
|
||||
import com.klp.mapper.WmsInspectionApplicationMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.WmsInspectionMainBo;
|
||||
import com.klp.domain.bo.WmsInspectionDetailBo;
|
||||
import com.klp.domain.vo.WmsInspectionMainVo;
|
||||
import com.klp.domain.vo.WmsInspectionDetailVo;
|
||||
import com.klp.domain.WmsInspectionMain;
|
||||
@@ -19,6 +23,7 @@ import com.klp.mapper.WmsInspectionMainMapper;
|
||||
import com.klp.mapper.WmsInspectionDetailMapper;
|
||||
import com.klp.service.IWmsInspectionMainService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -37,6 +42,7 @@ public class WmsInspectionMainServiceImpl implements IWmsInspectionMainService {
|
||||
|
||||
private final WmsInspectionMainMapper baseMapper;
|
||||
private final WmsInspectionDetailMapper detailMapper;
|
||||
private final WmsInspectionApplicationMapper applicationMapper;
|
||||
|
||||
/**
|
||||
* 查询检验主
|
||||
@@ -107,6 +113,15 @@ public class WmsInspectionMainServiceImpl implements IWmsInspectionMainService {
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMainId(add.getMainId());
|
||||
if (CollUtil.isNotEmpty(bo.getDetailList())) {
|
||||
List<WmsInspectionDetail> detailEntities = new ArrayList<>();
|
||||
for (WmsInspectionDetailBo detailBo : bo.getDetailList()) {
|
||||
detailBo.setMainId(add.getMainId());
|
||||
detailBo.setDetailId(null);
|
||||
detailEntities.add(BeanUtil.toBean(detailBo, WmsInspectionDetail.class));
|
||||
}
|
||||
detailMapper.insertBatch(detailEntities);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
@@ -118,7 +133,61 @@ public class WmsInspectionMainServiceImpl implements IWmsInspectionMainService {
|
||||
public Boolean updateByBo(WmsInspectionMainBo bo) {
|
||||
WmsInspectionMain update = BeanUtil.toBean(bo, WmsInspectionMain.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
boolean flag = baseMapper.updateById(update) > 0;
|
||||
if (flag && CollUtil.isNotEmpty(bo.getDetailList())) {
|
||||
for (WmsInspectionDetailBo detailBo : bo.getDetailList()) {
|
||||
detailBo.setMainId(bo.getMainId());
|
||||
WmsInspectionDetail detail = BeanUtil.toBean(detailBo, WmsInspectionDetail.class);
|
||||
if (detailBo.getDetailId() != null) {
|
||||
detailMapper.updateById(detail);
|
||||
} else {
|
||||
detail.setDetailId(null);
|
||||
detailMapper.insert(detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增检验主及明细,并更新申请单detailIds为主键列表
|
||||
*/
|
||||
@Override
|
||||
public Boolean batchInsertWithDetails(Long masterId, Long applicationId, List<WmsInspectionMainBo> boList) {
|
||||
if (CollUtil.isEmpty(boList)) {
|
||||
return false;
|
||||
}
|
||||
List<Long> mainIds = new ArrayList<>();
|
||||
for (WmsInspectionMainBo bo : boList) {
|
||||
WmsInspectionMain add = BeanUtil.toBean(bo, WmsInspectionMain.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (!flag) {
|
||||
return false;
|
||||
}
|
||||
bo.setMainId(add.getMainId());
|
||||
mainIds.add(add.getMainId());
|
||||
if (CollUtil.isNotEmpty(bo.getDetailList())) {
|
||||
List<WmsInspectionDetail> detailEntities = new ArrayList<>();
|
||||
for (WmsInspectionDetailBo detailBo : bo.getDetailList()) {
|
||||
detailBo.setMainId(add.getMainId());
|
||||
detailBo.setDetailId(null);
|
||||
detailEntities.add(BeanUtil.toBean(detailBo, WmsInspectionDetail.class));
|
||||
}
|
||||
detailMapper.insertBatch(detailEntities);
|
||||
}
|
||||
}
|
||||
if (masterId != null && applicationId != null) {
|
||||
String detailIds = mainIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
applicationMapper.update(null,
|
||||
new LambdaUpdateWrapper<WmsInspectionApplication>()
|
||||
.eq(WmsInspectionApplication::getMainId, masterId)
|
||||
.eq(WmsInspectionApplication::getApplicationId, applicationId)
|
||||
// 同时还要修改状态字段为6
|
||||
.set(WmsInspectionApplication::getFlowStatus, 6)
|
||||
.set(WmsInspectionApplication::getDetailIds, detailIds));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsInspectionApplication;
|
||||
import com.klp.mapper.WmsInspectionApplicationMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.WmsInspectionTensileDetailBo;
|
||||
@@ -15,9 +19,11 @@ import com.klp.domain.WmsInspectionTensileDetail;
|
||||
import com.klp.mapper.WmsInspectionTensileDetailMapper;
|
||||
import com.klp.service.IWmsInspectionTensileDetailService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 金属材料室温拉伸试验样品明细Service业务层处理
|
||||
@@ -31,6 +37,8 @@ public class WmsInspectionTensileDetailServiceImpl implements IWmsInspectionTens
|
||||
|
||||
private final WmsInspectionTensileDetailMapper baseMapper;
|
||||
|
||||
private final WmsInspectionApplicationMapper applicationMapper;
|
||||
|
||||
/**
|
||||
* 查询金属材料室温拉伸试验样品明细
|
||||
*/
|
||||
@@ -151,4 +159,35 @@ public class WmsInspectionTensileDetailServiceImpl implements IWmsInspectionTens
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量插入明细并更新申请单detailIds
|
||||
*/
|
||||
@Override
|
||||
public Boolean batchInsertDetails(Long masterId, Long applicationId, List<WmsInspectionTensileDetailBo> detailList) {
|
||||
if (CollUtil.isEmpty(detailList)) {
|
||||
return false;
|
||||
}
|
||||
List<WmsInspectionTensileDetail> details = new ArrayList<>();
|
||||
for (WmsInspectionTensileDetailBo bo : detailList) {
|
||||
bo.setDetailId(null);
|
||||
details.add(BeanUtil.toBean(bo, WmsInspectionTensileDetail.class));
|
||||
}
|
||||
boolean flag = baseMapper.insertBatch(details);
|
||||
if (flag && masterId != null && applicationId != null) {
|
||||
String detailIds = details.stream()
|
||||
.map(WmsInspectionTensileDetail::getDetailId)
|
||||
.collect(Collectors.joining(","));
|
||||
applicationMapper.update(null,
|
||||
new LambdaUpdateWrapper<WmsInspectionApplication>()
|
||||
.eq(WmsInspectionApplication::getMainId, masterId)
|
||||
.eq(WmsInspectionApplication::getApplicationId, applicationId)
|
||||
// 同时还要把状态字段改成6
|
||||
.set(WmsInspectionApplication::getFlowStatus, 6)
|
||||
.set(WmsInspectionApplication::getDetailIds, detailIds));
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -81,6 +81,15 @@ http {
|
||||
proxy_pass http://server/;
|
||||
}
|
||||
|
||||
# 酸轧六机架轧制模型服务(klp-ml-mill FastAPI)
|
||||
location /mill-api/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://117.72.159.31:10001/;
|
||||
}
|
||||
|
||||
# https 会拦截内链所有的 http 请求 造成功能无法使用
|
||||
# 解决方案1 将 admin 服务 也配置成 https
|
||||
# 解决方案2 将菜单配置为外链访问 走独立页面 http 访问
|
||||
|
||||
Reference in New Issue
Block a user