Commit fc64ceb4 authored by wanghao's avatar wanghao

1 上料支持 手动 和 自动

parent 1e2e8666
...@@ -21,7 +21,7 @@ import com.zehong.common.core.page.TableDataInfo; ...@@ -21,7 +21,7 @@ import com.zehong.common.core.page.TableDataInfo;
/** /**
* 机械臂指令Controller * 机械臂指令Controller
* *
* @author zehong * @author zehong
* @date 2025-08-04 * @date 2025-08-04
*/ */
...@@ -89,6 +89,14 @@ public class RobotArmCommandController extends BaseController ...@@ -89,6 +89,14 @@ public class RobotArmCommandController extends BaseController
return AjaxResult.success("发送成功"); return AjaxResult.success("发送成功");
} }
/**
* 发送指令
*/
@PostMapping("/addManualCommand")
public AjaxResult addManualCommand(@RequestBody RobotArmCommand robotArmCommand) {
return toAjax(robotArmCommandService.addManualCommand(robotArmCommand));
}
/** /**
* 新增机械臂指令 * 新增机械臂指令
*/ */
......
...@@ -7,15 +7,15 @@ import com.zehong.system.domain.RobotArmCommand; ...@@ -7,15 +7,15 @@ import com.zehong.system.domain.RobotArmCommand;
/** /**
* 机械臂指令Service接口 * 机械臂指令Service接口
* *
* @author zehong * @author zehong
* @date 2025-08-04 * @date 2025-08-04
*/ */
public interface IRobotArmCommandService public interface IRobotArmCommandService
{ {
/** /**
* 查询机械臂指令 * 查询机械臂指令
* *
* @param robotArmCommandId 机械臂指令ID * @param robotArmCommandId 机械臂指令ID
* @return 机械臂指令 * @return 机械臂指令
*/ */
...@@ -23,7 +23,7 @@ public interface IRobotArmCommandService ...@@ -23,7 +23,7 @@ public interface IRobotArmCommandService
/** /**
* 查询机械臂指令列表 * 查询机械臂指令列表
* *
* @param robotArmCommand 机械臂指令 * @param robotArmCommand 机械臂指令
* @return 机械臂指令集合 * @return 机械臂指令集合
*/ */
...@@ -37,12 +37,20 @@ public interface IRobotArmCommandService ...@@ -37,12 +37,20 @@ public interface IRobotArmCommandService
/** /**
* 新增机械臂指令 * 新增机械臂指令
* *
* @param robotArmCommand 机械臂指令 * @param robotArmCommand 机械臂指令
* @return 结果 * @return 结果
*/ */
public int insertRobotArmCommand(RobotArmCommand robotArmCommand); public int insertRobotArmCommand(RobotArmCommand robotArmCommand);
/**
* 新增机械臂指令-手动模式
*
* @param robotArmCommand 机械臂指令
* @return 结果
*/
public int addManualCommand(RobotArmCommand robotArmCommand);
public void powerOnCommand(Long commandId); public void powerOnCommand(Long commandId);
/** /**
...@@ -53,7 +61,7 @@ public interface IRobotArmCommandService ...@@ -53,7 +61,7 @@ public interface IRobotArmCommandService
public AjaxResult sureCompletedCommand(Long commandId); public AjaxResult sureCompletedCommand(Long commandId);
/** /**
* 修改机械臂指令 * 修改机械臂指令
* *
* @param robotArmCommand 机械臂指令 * @param robotArmCommand 机械臂指令
* @return 结果 * @return 结果
*/ */
...@@ -63,7 +71,7 @@ public interface IRobotArmCommandService ...@@ -63,7 +71,7 @@ public interface IRobotArmCommandService
/** /**
* 批量删除机械臂指令 * 批量删除机械臂指令
* *
* @param robotArmCommandIds 需要删除的机械臂指令ID * @param robotArmCommandIds 需要删除的机械臂指令ID
* @return 结果 * @return 结果
*/ */
...@@ -71,7 +79,7 @@ public interface IRobotArmCommandService ...@@ -71,7 +79,7 @@ public interface IRobotArmCommandService
/** /**
* 删除机械臂指令信息 * 删除机械臂指令信息
* *
* @param robotArmCommandId 机械臂指令ID * @param robotArmCommandId 机械臂指令ID
* @return 结果 * @return 结果
*/ */
......
...@@ -446,6 +446,56 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService ...@@ -446,6 +446,56 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
return robotArmCommandMapper.insertRobotArmCommand(robotArmCommand); return robotArmCommandMapper.insertRobotArmCommand(robotArmCommand);
} }
@Override
@Transactional
public int addManualCommand(RobotArmCommand robotArmCommand) {
robotArmCommand.setCreateTime(DateUtils.getNowDate());
if(StringUtils.isBlank(robotArmCommand.getTrayCode()) || StringUtils.isBlank(robotArmCommand.getStoreyCode())) {
throw new RuntimeException("托盘编号和层编号不能为空");
}
TTrayInfo tTrayInfo = tTrayInfoMapper.selectTTrayInfoByCode(robotArmCommand.getTrayCode());
if(tTrayInfo == null) {
throw new RuntimeException("托盘不存在");
}
// 看看 此托盘绑定了数据了吗?
int i1 = palletDeviceBindingMapper.countByTrayId(tTrayInfo.getfTrayId());
if(i1 == 0) {
throw new RuntimeException("托盘未绑定设备");
}
// 20251104 上料 不需要看托盘状态了
// 20251210 上料 又需要看托盘状态了
if(!"4".equals(tTrayInfo.getfStatus())) {
throw new RuntimeException("托盘状态异常,请联系管理员");
}
TStoreyInfo tStoreyInfo = storeyInfoMapper.selectTStoreyInfoByCode(robotArmCommand.getStoreyCode());
if(tStoreyInfo == null) {
throw new RuntimeException("层不存在");
}
robotArmCommand.setStatus("1");
robotArmCommand.setStoreyCode(tStoreyInfo.getfStoreyCode());
robotArmCommand.setCommand(tStoreyInfo.getFeedingCommand());
tTrayInfo.setfStoreyCode(tStoreyInfo.getfStoreyCode());
tTrayInfo.setfBindingTime(new Date());
tTrayInfoMapper.updateTTrayInfo(tTrayInfo);
tStoreyInfo.setfStatus("1");
storeyInfoMapper.updateStatusByCode(tStoreyInfo);
// 20260108 新加的把绑定层编号设置到实时数据上
palletDeviceBindingMapper.updateStoreCodeByTrayId(tTrayInfo.getfTrayId(), tStoreyInfo.getfStoreyCode());
int i = robotArmCommandMapper.insertRobotArmCommand(robotArmCommand);
notifyCommandsUpdate();
return i;
}
/** /**
* 新增机械臂指令 * 新增机械臂指令
* *
......
...@@ -26,6 +26,14 @@ export function addCommand(data) { ...@@ -26,6 +26,14 @@ export function addCommand(data) {
}) })
} }
export function addManualCommand(data) {
return request({
url: '/robotArm/command/addManualCommand',
method: 'post',
data: data
})
}
// 新增机械臂指令 // 新增机械臂指令
export function insertBlankingRobotArmCommand(data) { export function insertBlankingRobotArmCommand(data) {
return request({ return request({
......
...@@ -65,7 +65,7 @@ import RealTimeData from './components/RealTimeData' ...@@ -65,7 +65,7 @@ import RealTimeData from './components/RealTimeData'
import TrayBinding from "@/views/screen/components/TrayBinding"; import TrayBinding from "@/views/screen/components/TrayBinding";
import TrayInformation from "@/views/screen/components/TrayInformation"; import TrayInformation from "@/views/screen/components/TrayInformation";
import RoboticArm from './components/RoboticArm.vue'; import RoboticArm from './components/ManualAutoSwitchRoboticArm.vue';
export default { export default {
components: { components: {
AgingCabinetBoard, AgingCabinetBoard,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment