From 72c06d5800d3a99dbd7002a6946be749d9264b15 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 26 六月 2025 10:44:26 +0800 Subject: [PATCH] 1 --- src/main/java/com/zy/asrs/service/impl/CommandInfoServiceImpl.java | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/CommandInfoServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/CommandInfoServiceImpl.java index ab8300c..e57c059 100644 --- a/src/main/java/com/zy/asrs/service/impl/CommandInfoServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/CommandInfoServiceImpl.java @@ -1,12 +1,12 @@ package com.zy.asrs.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.zy.asrs.entity.CommandInfo; import com.zy.asrs.entity.CommandInfoLog; import com.zy.asrs.mapper.CommandInfoMapper; -import com.zy.asrs.entity.CommandInfo; import com.zy.asrs.service.CommandInfoLogService; import com.zy.asrs.service.CommandInfoService; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -49,4 +49,20 @@ } return count; } + + @Override + public boolean saveToHistory(Integer id) { + CommandInfo commandInfo = this.baseMapper.selectById(id); + String jsonString = JSON.toJSONString(commandInfo); + CommandInfoLog commandInfoLog = JSON.parseObject(jsonString, CommandInfoLog.class); + commandInfoLog.setId(null); + boolean result1 = commandInfoLogService.insert(commandInfoLog); + Integer result2 = this.baseMapper.deleteById(id); + return result1 && result2 > 0; + } + + @Override + public List<CommandInfo> selectCompleteManualCommand() { + return this.baseMapper.selectCompleteManualCommand(); + } } -- Gitblit v1.9.1