| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.domain.ShuttleGatherResult; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.entity.ApiLog; |
| | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/shuttleGather") |
| | | @OpenApiLog(memo = "小车集合") |
| | | public R shuttleGather() { |
| | | List<ShuttleGatherResult> shuttleGather = shuttleDispatchUtils.shuttleGather(); |
| | | |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "获取指定库位信息" |
| | | , "/getLocInformation" |
| | | , null |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(shuttleGather) |
| | | , null |
| | | , null |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | |
| | | return R.ok().add(shuttleGather); |
| | | } |
| | | |
| | | @GetMapping("/test") |
| | | public R test() { |
| | | notifyUtils.notify("task", 1, "9999", "W9999", NotifyMsgType.SHUTTLE_MOVING, "data"); |
New file |
| | |
| | | package com.zy.asrs.domain; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ShuttleGatherResult { |
| | | |
| | | private Integer shuttleNo; |
| | | |
| | | private String idleLoc; |
| | | |
| | | private Boolean result; |
| | | |
| | | } |
| | |
| | | package com.zy.core.dispatcher; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.ShuttleGatherResult; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 小车集合 |
| | | */ |
| | | public List<ShuttleGatherResult> shuttleGather() { |
| | | List<BasShuttle> basShuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().eq("status", 1)); |
| | | List<ShuttleGatherResult> list = new ArrayList<>(); |
| | | for (BasShuttle basShuttle : basShuttles) { |
| | | String idleLoc = basShuttle.getIdleLoc(); |
| | | if(Cools.isEmpty(idleLoc)) { |
| | | continue; |
| | | } |
| | | |
| | | boolean result = shuttleMoveGenerate(null, idleLoc, basShuttle.getShuttleNo()); |
| | | |
| | | ShuttleGatherResult gatherResult = new ShuttleGatherResult(); |
| | | gatherResult.setShuttleNo(basShuttle.getShuttleNo()); |
| | | gatherResult.setIdleLoc(idleLoc); |
| | | gatherResult.setResult(result); |
| | | list.add(gatherResult); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 检测目标楼层车数量是否小于允许的最大数量 |
| | | * true: 小于最大数量 false: 大于或等于最大数量 |
| | | */ |
| | |
| | | case 'oneUpdateCharge': |
| | | showUpdateCharge(); |
| | | break; |
| | | case 'shuttleGather': |
| | | admin.confirm('确定集合全部小车吗?', {shadeClose: true}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/openapi/shuttleGather", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType:'json', |
| | | 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" id="btn-add" lay-event="addData">新增</button> |
| | | <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-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |