自动化立体仓库 - WCS系统
#
Junjie
2025-03-20 f32968b7eca070814080dc60237ad340f558c8d2
#
1个文件已添加
4个文件已修改
89 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/OpenController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/ShuttleGatherResult.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/basShuttle/basShuttle.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/admin/basShuttle/basShuttle.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -3,7 +3,7 @@
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;
@@ -355,6 +355,31 @@
        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");
src/main/java/com/zy/asrs/domain/ShuttleGatherResult.java
New file
@@ -0,0 +1,14 @@
package com.zy.asrs.domain;
import lombok.Data;
@Data
public class ShuttleGatherResult {
    private Integer shuttleNo;
    private String idleLoc;
    private Boolean result;
}
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -1,7 +1,9 @@
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;
@@ -295,6 +297,29 @@
    }
    /**
     * 小车集合
     */
    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: 大于或等于最大数量
     */
src/main/webapp/static/js/basShuttle/basShuttle.js
@@ -100,6 +100,28 @@
            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=[];
src/main/webapp/views/admin/basShuttle/basShuttle.html
@@ -47,6 +47,7 @@
        <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>