| | |
| | | , null |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , JSON.toJSONString(shuttleGather) |
| | | , null |
| | | , null |
| | |
| | | )); |
| | | |
| | | return R.ok().add(shuttleGather); |
| | | } |
| | | |
| | | @PostMapping("/shuttleDemo") |
| | | @OpenApiLog(memo = "小车演示") |
| | | public R shuttleDemo(@RequestBody ShuttleDemoParam param) { |
| | | shuttleDispatchUtils.shuttleDemo(param); |
| | | |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "小车演示" |
| | | , "/shuttleDemo" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , null |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/queryTask") |
| | |
| | | , null |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , JSON.toJSONString(wrkMasts) |
| | | , null |
| | | , null |
New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ShuttleDemoParam { |
| | | |
| | | private List<Integer> shuttleNos; |
| | | |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.ShuttleGatherResult; |
| | | import com.zy.asrs.domain.param.ShuttleDemoParam; |
| | | import com.zy.asrs.domain.param.ShuttleGatherParam; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 小车演示 |
| | | */ |
| | | public void shuttleDemo(ShuttleDemoParam param) { |
| | | List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Shuttle)) |
| | | .in("device_no", param.getShuttleNos()) |
| | | ); |
| | | |
| | | for (DeviceConfig device : shuttleList) { |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); |
| | | if (shuttleThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | shuttleThread.enableDemo(param.getStatus() == 1); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检测目标楼层车数量是否小于允许的最大数量 |
| | | * true: 小于最大数量 false: 大于或等于最大数量 |
| | | */ |
| | |
| | | listenInit();//监听初始化事件 |
| | | readStatus(); |
| | | Thread.sleep(100); |
| | | |
| | | ShuttleAction shuttleAction = null; |
| | | try { |
| | | shuttleAction = SpringUtils.getBean(ShuttleAction.class); |
| | | }catch (Exception e){ |
| | | continue; |
| | | } |
| | | |
| | | if (shuttleAction == null) { |
| | | continue; |
| | | } |
| | | //演示模式 |
| | | shuttleAction.demo(deviceConfig.getDeviceNo()); |
| | | |
| | | // //小车空闲且有跑库程序 |
| | | // shuttleAction.moveLoc(deviceConfig.getDeviceNo()); |
| | | } catch (Exception e) { |
| | | log.error("ShuttleThread Fail", e); |
| | | } |
| | |
| | | //存在任务需要执行 |
| | | boolean result = shuttleAction.executeWork(deviceConfig.getDeviceNo(), taskNo); |
| | | } |
| | | |
| | | // //小车空闲且有跑库程序 |
| | | // shuttleAction.moveLoc(deviceConfig.getDeviceNo()); |
| | | |
| | | //演示模式 |
| | | shuttleAction.demo(deviceConfig.getDeviceNo()); |
| | | |
| | | Thread.sleep(200); |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | }); |
| | | executeThread.start(); |
| | | |
| | | //其他任务 |
| | | Thread otherThread = new Thread(() -> { |
| | | while (true) { |
| | | try { |
| | | saveLog();//保存数据 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | otherThread.start(); |
| | | // //其他任务 |
| | | // Thread otherThread = new Thread(() -> { |
| | | // while (true) { |
| | | // try { |
| | | // saveLog();//保存数据 |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // }); |
| | | // otherThread.start(); |
| | | } |
| | | |
| | | private void saveLog() { |
| | |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | | host: 192.168.4.77 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | database: 0 |
| | | # password: 123456 |
| | |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'shuttleStatus', align: 'center',title: '作业态'} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'idleLoc', align: 'center',title: '暂存库位'} |
| | | // ,{field: 'autoCharge', align: 'center',title: '自动充电'} |
| | | // ,{field: 'idleLoc', align: 'center',title: '暂存库位'} |
| | | ,{field: 'chargeLine', align: 'center',title: '电量线'} |
| | | ,{field: 'busyStatus$', align: 'center',title: '小车忙状态'} |
| | | ,{field: 'currentCode', align: 'center',title: '二维码'} |
| | | ,{field: 'batteryPower$', align: 'center',title: '电量'} |
| | | ,{field: 'batteryTemp$', align: 'center',title: '电池温度'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'liftNo', align: 'center',title: '提升机号'} |
| | | ,{field: 'pakMk$', align: 'center',title: '标记'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | |
| | | }); |
| | | }); |
| | | break; |
| | | case 'demoOpen': |
| | | shuttleNos = [] |
| | | checkStatus.map(function (d) { |
| | | shuttleNos.push(d.shuttleNo) |
| | | }) |
| | | |
| | | admin.confirm('确定开启演示模式吗?', {shadeClose: true}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/openapi/shuttleDemo", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType:'json', |
| | | data: JSON.stringify({ |
| | | shuttleNos: shuttleNos, |
| | | status: 1 |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | layer.msg("请求成功", {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | case 'demoClose': |
| | | shuttleNos = [] |
| | | checkStatus.map(function (d) { |
| | | shuttleNos.push(d.shuttleNo) |
| | | }) |
| | | |
| | | admin.confirm('确定关闭演示模式吗?', {shadeClose: true}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/openapi/shuttleDemo", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType:'json', |
| | | data: JSON.stringify({ |
| | | shuttleNos: shuttleNos, |
| | | status: 0 |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | layer.msg("请求成功", {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="oneUpdateCharge">一键修改电量线</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="shuttleGather">小车集合</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="demoOpen">演示-开</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="demoClose">演示-关</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | |
| | | <input class="layui-input" name="wrkNo" placeholder="请输入任务号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">暂存库位: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="idleLoc" placeholder="请输入暂存库位"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">自动充电: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="memo" placeholder="请输入备注"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">提升机号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="liftNo" placeholder="请输入提升机号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |