Commit fc64ceb4 authored by wanghao's avatar wanghao

1 上料支持 手动 和 自动

parent 1e2e8666
...@@ -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));
}
/** /**
* 新增机械臂指令 * 新增机械臂指令
*/ */
......
...@@ -43,6 +43,14 @@ public interface IRobotArmCommandService ...@@ -43,6 +43,14 @@ public interface IRobotArmCommandService
*/ */
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);
/** /**
......
...@@ -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