diff --git a/klp-ui/src/api/wms/pendingAction.js b/klp-ui/src/api/wms/pendingAction.js index 78267d5e..00cb2f24 100644 --- a/klp-ui/src/api/wms/pendingAction.js +++ b/klp-ui/src/api/wms/pendingAction.js @@ -141,3 +141,12 @@ export function exportPendingAction(query) { }) } +/** + * 还原被删除的钢卷 + */ +export function restorePendingAction(actionId) { + return request({ + url: `/wms/coilPendingAction/restore/${actionId}`, + method: 'put' + }) +} diff --git a/klp-ui/src/views/wms/coil/docorrent.vue b/klp-ui/src/views/wms/coil/docorrent.vue index 721eec75..73d50b67 100644 --- a/klp-ui/src/views/wms/coil/docorrent.vue +++ b/klp-ui/src/views/wms/coil/docorrent.vue @@ -33,6 +33,9 @@ 刷新 + + 查看被删除操作 + @@ -59,12 +62,18 @@ - + @@ -120,7 +129,8 @@ --> @@ -185,8 +195,7 @@ @@ -201,7 +210,8 @@ import { addPendingAction, updatePendingAction, startProcess, - cancelAction + cancelAction, + restorePendingAction, } from '@/api/wms/pendingAction'; import CoilSelector from '@/components/CoilSelector'; import CoilNo from '@/components/KLPService/Renderer/CoilNo.vue'; @@ -219,6 +229,7 @@ export default { // 遮罩层 loading: true, buttonLoading: false, + rubbish: false, // 选中数组 ids: [], // 非单个禁用 @@ -293,9 +304,12 @@ export default { getList() { this.loading = true; this.buttonLoading = true; - listPendingAction(this.queryParams).then(response => { + const payload = { + ...this.queryParams, + includeDeleted: this.rubbish ? 2 : 0 + } + listPendingAction(payload).then(response => { console.log('response.rows', response.rows); - this.actionList = response.rows; this.total = response.total; this.buttonLoading = false; @@ -340,6 +354,27 @@ export default { this.resetForm('queryForm'); this.handleQuery(); }, + handleStatusChange(row) { + // console.log(row) + updatePendingAction(row).then(response => { + this.$message.success('操作状态更新成功'); + this.getList(); + }); + }, + /** 还原按钮操作 */ + handleRestore(row) { + const actionId = row.actionId; + this.$modal.confirm('是否确认还原该待操作记录?', '警告', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + restorePendingAction(actionId).then(response => { + this.$message.success('还原成功'); + this.getList(); + }); + }); + }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.actionId); diff --git a/klp-ui/src/views/wms/report/zha/day.vue b/klp-ui/src/views/wms/report/zha/day.vue index ff62288b..18d92ebc 100644 --- a/klp-ui/src/views/wms/report/zha/day.vue +++ b/klp-ui/src/views/wms/report/zha/day.vue @@ -318,7 +318,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -328,7 +328,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zha/month.vue b/klp-ui/src/views/wms/report/zha/month.vue index ee412008..6b9ee8bc 100644 --- a/klp-ui/src/views/wms/report/zha/month.vue +++ b/klp-ui/src/views/wms/report/zha/month.vue @@ -339,7 +339,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -349,7 +349,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zha/team.vue b/klp-ui/src/views/wms/report/zha/team.vue index 6368f11c..68df5f81 100644 --- a/klp-ui/src/views/wms/report/zha/team.vue +++ b/klp-ui/src/views/wms/report/zha/team.vue @@ -394,7 +394,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -404,7 +404,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zha/year.vue b/klp-ui/src/views/wms/report/zha/year.vue index ded030de..6b7bb09f 100644 --- a/klp-ui/src/views/wms/report/zha/year.vue +++ b/klp-ui/src/views/wms/report/zha/year.vue @@ -323,7 +323,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -333,7 +333,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zha_.vue b/klp-ui/src/views/wms/report/zha_.vue index 78397157..5fe60c5d 100644 --- a/klp-ui/src/views/wms/report/zha_.vue +++ b/klp-ui/src/views/wms/report/zha_.vue @@ -186,7 +186,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -196,7 +196,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zinc/day.vue b/klp-ui/src/views/wms/report/zinc/day.vue index 85d5561a..fdaedf5f 100644 --- a/klp-ui/src/views/wms/report/zinc/day.vue +++ b/klp-ui/src/views/wms/report/zinc/day.vue @@ -304,7 +304,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -314,7 +314,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zinc/month.vue b/klp-ui/src/views/wms/report/zinc/month.vue index 25e52932..164c2f20 100644 --- a/klp-ui/src/views/wms/report/zinc/month.vue +++ b/klp-ui/src/views/wms/report/zinc/month.vue @@ -325,7 +325,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -335,7 +335,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zinc/team.vue b/klp-ui/src/views/wms/report/zinc/team.vue index ed89929e..10ac7e00 100644 --- a/klp-ui/src/views/wms/report/zinc/team.vue +++ b/klp-ui/src/views/wms/report/zinc/team.vue @@ -381,7 +381,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -391,7 +391,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zinc/year.vue b/klp-ui/src/views/wms/report/zinc/year.vue index 315db76b..e0b362dd 100644 --- a/klp-ui/src/views/wms/report/zinc/year.vue +++ b/klp-ui/src/views/wms/report/zinc/year.vue @@ -307,7 +307,7 @@ export default { const res1 = await listPendingAction({ actionStatus: 2, actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -317,7 +317,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-ui/src/views/wms/report/zinc_.vue b/klp-ui/src/views/wms/report/zinc_.vue index 48f8a069..1f3eff84 100644 --- a/klp-ui/src/views/wms/report/zinc_.vue +++ b/klp-ui/src/views/wms/report/zinc_.vue @@ -186,7 +186,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -196,7 +196,7 @@ export default { warehouseId: this.queryParams.planId, // actionType: 401, actionType: 120, // 分条工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, diff --git a/klp-wms/src/main/java/com/klp/controller/WmsCoilPendingActionController.java b/klp-wms/src/main/java/com/klp/controller/WmsCoilPendingActionController.java index 887190ff..5720ae72 100644 --- a/klp-wms/src/main/java/com/klp/controller/WmsCoilPendingActionController.java +++ b/klp-wms/src/main/java/com/klp/controller/WmsCoilPendingActionController.java @@ -138,6 +138,15 @@ public class WmsCoilPendingActionController extends BaseController { return toAjax(iWmsCoilPendingActionService.cancelAction(actionId)); } + /** + * 还原操作(将已删除的记录恢复为正常状态) + */ + @Log(title = "钢卷待操作", businessType = BusinessType.UPDATE) + @PutMapping("/restore/{actionId}") + public R restoreAction(@PathVariable("actionId") Long actionId) { + return toAjax(iWmsCoilPendingActionService.restoreAction(actionId)); + } + /** * 计算理论节拍回归(默认近6个月),并返回散点+拟合线 */ diff --git a/klp-wms/src/main/java/com/klp/domain/WmsCoilPendingAction.java b/klp-wms/src/main/java/com/klp/domain/WmsCoilPendingAction.java index e43065c8..11031eda 100644 --- a/klp-wms/src/main/java/com/klp/domain/WmsCoilPendingAction.java +++ b/klp-wms/src/main/java/com/klp/domain/WmsCoilPendingAction.java @@ -94,7 +94,6 @@ public class WmsCoilPendingAction extends BaseEntity { /** * 删除标志(0=正常,1=已删除) */ - @TableLogic private Integer delFlag; /** diff --git a/klp-wms/src/main/java/com/klp/domain/vo/WmsCoilPendingActionVo.java b/klp-wms/src/main/java/com/klp/domain/vo/WmsCoilPendingActionVo.java index 7ed75456..39ba7a27 100644 --- a/klp-wms/src/main/java/com/klp/domain/vo/WmsCoilPendingActionVo.java +++ b/klp-wms/src/main/java/com/klp/domain/vo/WmsCoilPendingActionVo.java @@ -200,7 +200,6 @@ public class WmsCoilPendingActionVo extends BaseEntity implements Serializable { private String actualWarehouseName; - - + private Integer delFlag; } diff --git a/klp-wms/src/main/java/com/klp/service/IWmsCoilPendingActionService.java b/klp-wms/src/main/java/com/klp/service/IWmsCoilPendingActionService.java index 3a3f09d9..35ddf717 100644 --- a/klp-wms/src/main/java/com/klp/service/IWmsCoilPendingActionService.java +++ b/klp-wms/src/main/java/com/klp/service/IWmsCoilPendingActionService.java @@ -68,6 +68,11 @@ public interface IWmsCoilPendingActionService { */ Boolean cancelAction(Long actionId); + /** + * 还原操作(将已删除的记录恢复为正常状态) + */ + Boolean restoreAction(Long actionId); + /** * 计算理论节拍线性回归(默认近6个月),同时返回散点用于前端绘图并将结果缓存。 */ diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsCoilPendingActionServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsCoilPendingActionServiceImpl.java index 776a4431..d788ec03 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsCoilPendingActionServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsCoilPendingActionServiceImpl.java @@ -118,7 +118,7 @@ public class WmsCoilPendingActionServiceImpl implements IWmsCoilPendingActionSer // 包含已删除记录:不添加del_flag过滤,查询所有记录 } else if (bo.getIncludeDeleted() == 2) { // 仅查询已删除记录 - qw.eq("wcpa.del_flag", 1); + qw.eq("wcpa.del_flag", 2); } else { // 默认:仅查询正常记录 qw.eq("wcpa.del_flag", 0); @@ -281,6 +281,27 @@ public class WmsCoilPendingActionServiceImpl implements IWmsCoilPendingActionSer return baseMapper.updateById(action) > 0; } + /** + * 还原操作(将已删除的记录恢复为正常状态) + */ + @Override + public Boolean restoreAction(Long actionId) { + // 使用QueryWrapper查询,不受逻辑删除影响,检查记录是否存在且del_flag为2 + WmsCoilPendingAction oldAction = baseMapper.selectOne(new QueryWrapper() + .eq("action_id", actionId) + .eq("del_flag", 2) + .last("LIMIT 1")); + if (oldAction == null) { + throw new RuntimeException("待操作记录不存在或未被删除"); + } + + // 将del_flag改为0 + WmsCoilPendingAction action = new WmsCoilPendingAction(); + action.setActionId(actionId); + action.setDelFlag(0); // 恢复为正常状态 + return baseMapper.updateById(action) > 0; + } + @Override public TheoryCycleRegressionResultVo calcTheoryCycleRegression(Date startTime, Date endTime) { return calcTheoryCycleRegression(startTime, endTime, true, 2000); diff --git a/klp-wms/src/main/resources/mapper/klp/WmsCoilPendingActionMapper.xml b/klp-wms/src/main/resources/mapper/klp/WmsCoilPendingActionMapper.xml index 4ba01082..f2a8864c 100644 --- a/klp-wms/src/main/resources/mapper/klp/WmsCoilPendingActionMapper.xml +++ b/klp-wms/src/main/resources/mapper/klp/WmsCoilPendingActionMapper.xml @@ -43,6 +43,7 @@ wcpa.process_time as processTime, wcpa.complete_time as completeTime, wcpa.remark as remark, + wcpa.del_flag as delFlag, wcpa.create_time as createTime, wcpa.create_by as createBy, wcpa.update_time as updateTime,