#
vincentlu
2025-04-01 6166c4551aa61019413713e8f2ce1aa626dec971
#
5个文件已修改
1个文件已添加
247 ■■■■■ 已修改文件
version/db/jbly/20250401/dual.sql 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-common/src/main/java/com/zy/acs/common/enums/AgvDirectionType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MapService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Sta.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/enums/ActionTypeType.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
version/db/jbly/20250401/dual.sql
New file
@@ -0,0 +1,12 @@
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (15, 'IDLE', '空闲', 1, 0, 2, 41, '2023-06-09 02:11:08', 41, '2023-06-09 02:11:38', '');
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (16, 'STOCK', '有货', 1, 0, 2, 41, '2023-06-09 02:11:20', 41, '2023-06-18 15:20:31', '');
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (17, 'PAKIN', '放货预约', 1, 0, null, 41, '2023-06-18 15:20:58', 41, '2023-06-18 15:20:58', '');
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (18, 'PAKOUT', '取货预约', 1, 0, null, 41, '2023-06-18 15:21:08', 41, '2023-06-18 15:21:08', '');
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (19, 'DISABLED', '禁用', 1, 0, null, 41, '2023-06-18 15:21:29', 41, '2023-06-18 15:21:29', '');
INSERT INTO man_sta_sts (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (20, 'OTHER', '其他', 1, 0, null, 41, '2023-06-21 21:17:06', 41, '2023-06-21 21:17:06', '');
alter table man_sta
    add angle varchar(255) null comment '作业角度' after offset;
INSERT INTO man_action_type (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (26, 'ReadyTakeFromConveyorSta', '准备从输送线取货', 1, 0, null, 41, '2023-06-09 19:41:10', 41, '2023-06-09 19:41:10', null);
INSERT INTO man_action_type (id, uuid, name, status, deleted, tenant_id, create_by, create_time, update_by, update_time, memo) VALUES (27, 'ReadyReleaseToConveyorSta', '准备往输送线放货', 1, 0, null, 41, '2023-06-09 19:41:10', 41, '2023-06-09 19:41:10', null);
zy-acs-common/src/main/java/com/zy/acs/common/enums/AgvDirectionType.java
@@ -4,6 +4,7 @@
    LEFT(1),
    RIGHT(2),
    FORWARD(0),
    ;
    public int val;
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -866,28 +866,11 @@
                        // 检验方向
                        if (!lastDirection.equals(workDirection)) {
                            throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整");
                            // turn
//                            actionList.add(new Action(
//                                    null,    // 编号
//                                    task.getBusId(),    // 总线
//                                    task.getId(),    // 任务
//                                    null,    // 动作号
//                                    null,    // 优先级
//                                    ActionTypeType.TurnCorner.desc,    // 名称
//                                    mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
//                                    lastCode.getData(),    // 地面码
//                                    String.valueOf(workDirection),   // 动作参数
//                                    ActionTypeType.TurnCorner.val(),    // 动作类型
//                                    actionPrepareSts,    // 动作进度
//                                    agvId,    // AGV
//                                    now    // 工作时间
//                            ));
//                            lastDirection = workDirection;
                        }
                        // 货架取货
                        Loc oriLoc = locService.getById(task.getOriLoc());
                        // 计算左右方向
                        agvDirectionType = mapService.calculateAgvWorkDirection(oriLoc, lastCode);
                        agvDirectionType = mapService.calculateAgvWorkDirectionByShelf(oriLoc, lastCode);
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
@@ -925,23 +908,6 @@
                        // 检验方向
                        if (!lastDirection.equals(workDirection)) {
                            throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整");
//                            // turn
//                            actionList.add(new Action(
//                                    null,    // 编号
//                                    task.getBusId(),    // 总线
//                                    task.getId(),    // 任务
//                                    null,    // 动作号
//                                    null,    // 优先级
//                                    ActionTypeType.TurnCorner.desc,    // 名称
//                                    mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
//                                    lastCode.getData(),    // 地面码
//                                    String.valueOf(workDirection),   // 动作参数
//                                    ActionTypeType.TurnCorner.val(),    // 动作类型
//                                    actionPrepareSts,    // 动作进度
//                                    agvId,    // AGV
//                                    now    // 工作时间
//                            ));
//                            lastDirection = workDirection;
                        }
                        // 暂存点取货货
                        actionList.add(new Action(
@@ -963,7 +929,7 @@
                        // 货架放货
                        Loc destLoc = locService.getById(task.getDestLoc());
                        // 计算左右方向
                        agvDirectionType = mapService.calculateAgvWorkDirection(destLoc, lastCode);
                        agvDirectionType = mapService.calculateAgvWorkDirectionByShelf(destLoc, lastCode);
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
@@ -981,8 +947,128 @@
                        ));
                        break;
                    case ORI_STA:
                        // 站点取货
                        Sta oriSta = staService.getById(task.getOriSta());
                        Double oriStaWorkDirection = mapService.getStaAngle(oriSta, workDirection);
                        // 检验方向
                        if (!lastDirection.equals(oriStaWorkDirection)) {
                            if (!lastCode.getCornerBool()) {
                                throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整");
                            }
                            // turn
                            actionList.add(new Action(
                                    null,    // 编号
                                    task.getBusId(),    // 总线
                                    task.getId(),    // 任务
                                    null,    // 动作号
                                    null,    // 优先级
                                    ActionTypeType.TurnCorner.desc,    // 名称
                                    mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
                                    lastCode.getData(),    // 地面码
                                    String.valueOf(oriStaWorkDirection),   // 动作参数
                                    ActionTypeType.TurnCorner.val(),    // 动作类型
                                    actionPrepareSts,    // 动作进度
                                    agvId,    // AGV
                                    now    // 工作时间
                            ));
                            lastDirection = oriStaWorkDirection;
                        }
                        // 计算货叉工作方向
                        agvDirectionType = mapService.calculateAgvWorkDirectionByStation(oriSta, lastCode);
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
                                task.getId(),    // 任务
                                null,    // 动作号
                                null,    // 优先级
                                ActionTypeType.ReadyTakeFromShelvesLoc.desc,    // 名称
                                (double) agvDirectionType.val,    // 属性值
                                lastCode.getData(),    // 地面码
                                String.valueOf(oriSta.getOffset()),   // 动作参数
                                ActionTypeType.ReadyTakeFromShelvesLoc.val(),    // 动作类型
                                actionPrepareSts,    // 动作进度
                                agvId,    // AGV
                                now    // 工作时间
                        ));
                        // 暂存点放货
                        assert backpackType != null;
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
                                task.getId(),    // 任务
                                null,    // 动作号
                                null,    // 优先级
                                ActionTypeType.ReadyReleaseToAgvSite.desc,    // 名称
                                (double) backpackType.lev,    // 属性值
                                lastCode.getData(),    // 地面码
                                String.valueOf(backpackType.height),   // 动作参数
                                ActionTypeType.ReadyReleaseToAgvSite.val(),    // 动作类型
                                actionPrepareSts,    // 动作进度
                                agvId,    // AGV
                                now    // 工作时间
                        ));
                        break;
                    case DEST_STA:
                        // 站点放货
                        Sta destSta = staService.getById(task.getDestSta());
                        Double destStaWorkDirection = mapService.getStaAngle(destSta, workDirection);
                        // 检验方向
                        if (!lastDirection.equals(destStaWorkDirection)) {
                            if (!lastCode.getCornerBool()) {
                                throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整");
                            }
                            // turn
                            actionList.add(new Action(
                                    null,    // 编号
                                    task.getBusId(),    // 总线
                                    task.getId(),    // 任务
                                    null,    // 动作号
                                    null,    // 优先级
                                    ActionTypeType.TurnCorner.desc,    // 名称
                                    mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
                                    lastCode.getData(),    // 地面码
                                    String.valueOf(destStaWorkDirection),   // 动作参数
                                    ActionTypeType.TurnCorner.val(),    // 动作类型
                                    actionPrepareSts,    // 动作进度
                                    agvId,    // AGV
                                    now    // 工作时间
                            ));
                            lastDirection = destStaWorkDirection;
                        }
                        // 暂存点取货
                        assert backpackType != null;
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
                                task.getId(),    // 任务
                                null,    // 动作号
                                null,    // 优先级
                                ActionTypeType.ReadyTakeFromAgvSite.desc,    // 名称
                                (double) backpackType.lev,    // 属性值
                                lastCode.getData(),    // 地面码
                                String.valueOf(backpackType.height),   // 动作参数
                                ActionTypeType.ReadyTakeFromAgvSite.val(),    // 动作类型
                                actionPrepareSts,    // 动作进度
                                agvId,    // AGV
                                now    // 工作时间
                        ));
                        // 计算货叉工作方向
                        agvDirectionType = mapService.calculateAgvWorkDirectionByStation(destSta, lastCode);
                        actionList.add(new Action(
                                null,    // 编号
                                task.getBusId(),    // 总线
                                task.getId(),    // 任务
                                null,    // 动作号
                                null,    // 优先级
                                ActionTypeType.ReadyReleaseToShelvesLoc.desc,    // 名称
                                (double) agvDirectionType.val,    // 属性值
                                lastCode.getData(),    // 地面码
                                String.valueOf(destSta.getOffset()),   // 动作参数
                                ActionTypeType.ReadyReleaseToShelvesLoc.val(),    // 动作类型
                                actionPrepareSts,    // 动作进度
                                agvId,    // AGV
                                now    // 工作时间
                        ));
                        break;
                    case TO_CHARGE:
                        // 检验方向
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MapService.java
@@ -12,6 +12,7 @@
import com.zy.acs.manager.manager.entity.Code;
import com.zy.acs.manager.manager.entity.Loc;
import com.zy.acs.manager.manager.entity.Segment;
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.service.ActionService;
import com.zy.acs.manager.manager.service.CodeService;
import com.zy.acs.manager.system.service.ConfigService;
@@ -154,7 +155,7 @@
    }
    // 坐标货架阈值 todo:luxiaotao
    public AgvDirectionType calculateAgvWorkDirection(Loc loc, Code code) {
    public AgvDirectionType calculateAgvWorkDirectionByShelf(Loc loc, Code code) {
        Integer compDirect = loc.getCompDirect();
        AgvDirectionType agvDirectionType = null;
        if (compDirect == 0) {
@@ -166,6 +167,19 @@
        return agvDirectionType;
    }
    public Double getStaAngle(Sta sta, Double workDirection) {
        if (null == sta) {
            return null;
        }
        if (Cools.isEmpty(sta.getAngle())) {
            return workDirection;
        }
        return Double.parseDouble(sta.getAngle());
    }
    public AgvDirectionType calculateAgvWorkDirectionByStation(Sta sta, Code code) {
        return AgvDirectionType.FORWARD;
    }
    public double calculateDistance(double x1, double y1, double x2, double y2) {
        double deltaX = x2 - x1;
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Sta.java
@@ -71,6 +71,12 @@
    private Double offset;
    /**
     * 作业角度
     */
    @ApiModelProperty(value= "作业角度")
    private String angle;
    /**
     * 自动
     */
    @ApiModelProperty(value= "自动")
@@ -153,56 +159,6 @@
     */
    @ApiModelProperty(value= "备注")
    private String memo;
    public Sta() {}
    public Sta(String uuid,Long zoneId,String staNo,String name,Long staType,Long code,Double offset,String autoing,String loading,String inEnable,String outEnable,String zpallet,Long staSts,Integer status,Integer deleted,Long tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.uuid = uuid;
        this.zoneId = zoneId;
        this.staNo = staNo;
        this.name = name;
        this.staType = staType;
        this.code = code;
        this.offset = offset;
        this.autoing = autoing;
        this.loading = loading;
        this.inEnable = inEnable;
        this.outEnable = outEnable;
        this.zpallet = zpallet;
        this.staSts = staSts;
        this.status = status;
        this.deleted = deleted;
        this.tenantId = tenantId;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
    }
//    Sta sta = new Sta(
//            null,    // 编号
//            null,    // 库区
//            null,    // 站号
//            null,    // 名称
//            null,    // 站类型[非空]
//            null,    // 条码
//            null,    // 偏移量
//            null,    // 自动
//            null,    // 有物
//            null,    // 可入
//            null,    // 可出
//            null,    // 托盘码
//            null,    // 站状态
//            null,    // 状态[非空]
//            null,    // 是否删除[非空]
//            null,    // 租户
//            null,    // 添加人员
//            null,    // 添加时间[非空]
//            null,    // 修改人员
//            null,    // 修改时间
//            null    // 备注
//    );
    public String getZoneId$(){
        ZoneService service = SpringUtils.getBean(ZoneService.class);
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/enums/ActionTypeType.java
@@ -16,8 +16,10 @@
    StraightAheadUnturnable("巷道直行前进"), // 巷道直行前进
    StraightAheadTurnable("直行前进"), //     直行前进
    ReadyTakeFromShelvesLoc("准备从货架取货"), //     准备从货架取货
    ReadyTakeFromConveyorSta("准备从输送线取货"), // 准备从输送线取货
    ReadyTakeFromAgvSite("准备从AGV暂存货位取货"), // 准备从AGV暂存货位取货
    ReadyReleaseToShelvesLoc("准备从货架放货"), //     准备从货架放货
    ReadyReleaseToShelvesLoc("准备往货架放货"), //     准备从货架放货
    ReadyReleaseToConveyorSta("准备往输送线放货"), //     准备往输送线放货
    ReadyReleaseToAgvSite("准备往AGV暂存货位放货"), // 准备往AGV暂存货位放货
    FinishPath("整个路径结束"), //     整个路径结束
    DockingCharge("对接充电桩"), //     对接充电桩