18516761980
2025-05-26 cf1e457065ca87ad3a1e7758e72f5f1718ec9ab1
Merge remote-tracking branch 'origin/hcddwcs-gdfs' into hcddwcs-gdfs
16个文件已修改
1146 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/OpenController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/RgvController.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/BasCircularShuttle.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMast.java 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 680 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/MainProcess.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/command/RgvCommand.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/RgvThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/controller/LicenseCreatorController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/license.lic 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BasCircularShuttleMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/images/favicon.ico 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/images/zy-logo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 121 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -13,6 +13,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by vincent on 2024/10/16
@@ -57,6 +58,35 @@
    }
    /**
     * 添加出库单
     */
    @PostMapping("/task/cs/down/default/v2")
    @AppAuth(memo = "WCS任务下发")
    public synchronized R wcsTaskDistribution2(@RequestHeader(required = false) String appkey,
                                              @RequestBody List<WcsTaskDistributionParam> param1,
                                              HttpServletRequest request) {
        auth(appkey, param1, request);
        for (WcsTaskDistributionParam param:param1){
            if (Cools.isEmpty(param)) {
                return R.parse(BaseRes.PARAM);
            }
            if (Cools.isEmpty(param.getTaskNo())) {
                return R.error("工作号[taskNo]不能为空");
            }
            if (Cools.isEmpty(param.getStartSta()) || param.getStartSta$()==0) {
                return R.error("起点[startSta]不能为空");
            }
            if (Cools.isEmpty(param.getEndSta())  || param.getEndSta$()==0) {
                return R.error("终点[endSta]不能为空");
            }
//        openService.wcsTaskDistribution(param);
             openService.wcsTaskDistribution(param);
        }
        return R.ok();
    }
    /**
     * 数据同步
     */
    @PostMapping("/status/cs/default/v1")
src/main/java/com/zy/asrs/controller/RgvController.java
@@ -36,13 +36,11 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.rmi.CORBA.Util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * RGV接口
@@ -353,7 +351,7 @@
//            ringThroughParam.setIndex(i);
//            double[] doubles = Utils.RingThroughXY2(perimeter, NumUtils.GetRandomIntInRange(183));
//            double[] doubles = Utils.RingThroughXYRgv(perimeter, perimeter-rgvProtocol.RgvPos.doubleValue());
            double[] doubles = Utils.getRgvPos(perimeter, rgvProtocol.RgvPos.doubleValue());
            double[] doubles = Utils.getRgvPosNew(perimeter, rgvProtocol.RgvPos.doubleValue());
//            double[] doubles = Utils.RingThroughXY2(183.0, 100*i );
            ringThroughParam.setValueX(doubles[0]-2.94);
@@ -372,11 +370,17 @@
        List<RingThroughParam> result = new ArrayList<>();
        List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<>());
        for (BasDevpPosition basDevpPosition : basDevpPositions){
            if (basDevpPosition.getDevNo() == 134){
                continue;
            }
            RingThroughParam ringThroughParam = new RingThroughParam();
            ringThroughParam.setIndex(basDevpPosition.getDevNo());
            double[] doubles = Utils.RingThroughXYSta(perimeter, perimeter-basDevpPosition.getPlcPosition());
            ringThroughParam.setValueX(doubles[0]>50? doubles[0]+6:doubles[0]-1);
            ringThroughParam.setValueY(doubles[1]>50? doubles[1]+6:doubles[1]-1);
//            double[] doubles = Utils.RingThroughXYSta(perimeter, perimeter-basDevpPosition.getPlcPosition());
//            ringThroughParam.setValueX(doubles[0]>50? doubles[0]+6:doubles[0]-1);
//            ringThroughParam.setValueY(doubles[1]>50? doubles[1]+6:doubles[1]-1);
            double[] doubles = Utils.getRgvPosNew(basDevpPosition.getDevNo(),perimeter, basDevpPosition.getPlcPosition());
            ringThroughParam.setValueX(doubles[0]);
            ringThroughParam.setValueY(doubles[1]);
            result.add(ringThroughParam);
        }
        return R.ok().add(result);
@@ -472,4 +476,31 @@
        return R.ok().add(result);
    }
    @PostMapping("/disable/rgv/status")
//    @ManagerAuth(memo = "修改RGV状态")
    public R rgvDisableStatus(@RequestParam Integer rgvNo,
                              @RequestParam Integer status){
        log.info("/disable/rgv/status===》修改RGV状态!!!rgvNo:{},status:{},data:{}",rgvNo,status,new Date());
        BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_no", rgvNo));
        if (basCircularShuttle == null){
            return R.error().add("未找到此RGV,异常!!!");
        }
        basCircularShuttle.setStatus(status);
        basCircularShuttleService.updateById(basCircularShuttle);
        return R.ok();
    }
    @PostMapping("/disable/task/delete")
//    @ManagerAuth(memo = "删除任务")
    public R taskDisabledelete(@RequestParam Long wrkNo){
        log.info("/disable/task/delete===》删除任务!!!wrkNo:{},data:{}",wrkNo,new Date());
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkNo));
        if (Cools.isEmpty(wrkMast)){
            return R.error().add("未找到此任务,异常!!!");
        }
        wrkMastService.deleteById(wrkMast);
        return R.ok();
    }
}
src/main/java/com/zy/asrs/entity/BasCircularShuttle.java
@@ -36,6 +36,11 @@
    @ApiModelProperty(value= "0:正常,1:禁用")
    private Integer status;
    @ApiModelProperty(value= "")
    @TableField("rgv_some")
    private int rgvSome = 1;
    public BasCircularShuttle() {}
    public BasCircularShuttle(Integer rgvId,Integer rgvNo,Integer status) {
src/main/java/com/zy/asrs/entity/WrkMast.java
@@ -496,4 +496,190 @@
        }
    }
    public Integer getStaNoCs(int[] autoZ){
        switch (staNo){
            case 114:
            case 115:
            case 116:
            case 117:
            case 118:
                return 102;
            case 120:
            case 121:
            case 122:
                return 104;
            case 124:
            case 125:
            case 126:
                return 106;
            case 128:
            case 129:
            case 130:
                return 108;
            case 133:
                return 111;
            case 102:
                switch (autoZ[0]){
                    case 0:
                        autoZ[0]++;
                        return 114;
                    case 1:
                        autoZ[0]++;
                        return 115;
                    case 2:
                        autoZ[0]++;
                        return 116;
                    case 3:
                        autoZ[0]++;
                        return 117;
                    default:
                        autoZ[0] = 0;
                        return 118;//117
                }
            case 104:
                switch (autoZ[1]){
                    case 0:
                        autoZ[1]++;
                        return 120;
                    case 1:
                        autoZ[1]++;
                        return 121;
                    default:
                        autoZ[1] = 0;
                        return 122;//121
                }
            case 106:
                switch (autoZ[2]){
                    case 0:
                        autoZ[2]++;
                        return 124;
                    case 1:
                        autoZ[2]++;
                        return 125;
                    default:
                        autoZ[2] = 0;
                        return 126;//125
                }
            case 108:
                switch (autoZ[3]){
                    case 0:
                        autoZ[3]++;
                        return 128;
                    case 1:
                        autoZ[3]++;
                        return 129;
                    default:
                        autoZ[3] = 0;
                        return 130;
                }
            case 111:
                return 133;
        }
        return 0;
    }
    public Integer getStaNoCs(){
        switch (staNo){
            case 114:
                return 102;
            case 120:
                return 104;
            case 124:
                return 106;
            case 128:
                return 108;
            case 133:
                return 111;
            case 102:
                return 114;
            case 104:
                return 120;
            case 106:
                return 124;
            case 108:
                return 128;
            case 111:
                return 133;
        }
        return 0;
    }
    public Integer getSourceNoCs(int[] autoZ){
        switch (sourceStaNo){
            case 101:
                switch (autoZ[4]){
                    case 0:
                        autoZ[4]++;
                        return 112;
                    default:
                        autoZ[4] = 0;
                        return 113;
                }
            case 103:
                return 119;
            case 105:
                return 123;
            case 107:
                return 127;
            case 109:
            case 110:
            case 111:
                switch (autoZ[5]){
                    case 0:
                        autoZ[5]++;
                        return 131;
                    default:
                        autoZ[5] = 0;
                        return 132;
                }
            case 112:
            case 113:
                return 101;
            case 119:
                return 103;
            case 123:
                return 105;
            case 127:
                return 107;
            case 131:
            case 132:
                switch (autoZ[6]){
                    case 0:
                        autoZ[6]++;
                        return 109;
                    case 1:
                        autoZ[6]++;
                        return 110;
                    default:
                        autoZ[6] = 0;
                        return 111;
                }
        }
        return 0;
    }
    public Integer getSourceNoCs(){
        switch (sourceStaNo){
            case 101:
                return 112;
            case 103:
                return 119;
            case 105:
                return 123;
            case 107:
                return 127;
            case 109:
                return 131;
            case 112:
                return 101;
            case 119:
                return 103;
            case 123:
                return 105;
            case 127:
                return 107;
            case 131:
                return 109;
        }
        return 0;
    }
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -16,6 +16,7 @@
import com.zy.asrs.utils.SortTheExecutionOfTheCarUtil;
import com.zy.asrs.utils.TimeCalculatorUtils;
import com.zy.common.CodeRes;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
@@ -54,6 +55,8 @@
    private BasCircularShuttleService basCircularShuttleService;
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private CommonService commonService;
    @Value("${constant-parameters.perimeter}")
    private Long perimeter;
@@ -65,12 +68,23 @@
    private Long rgvCount;
    @Value("${constant-parameters.rgvDate}")
    private Double rgvDate;
    @Value("${wms.url}")
    private String wmsUrl;
    @Value("${wms.reportOutPath}")
    private String wmsOutPath;
    @Value("${wms.reportSwitch}")
    private boolean reportSwitch;
    @Value("${wms.reportSwitchAuto}")
    private boolean reportSwitchAuto;
    /*
    * 验证许可证是否有效
    * */
    public synchronized boolean licenseVerify() {
        try{
//            if (true) {
//                return true;
//            }
            return new LicenseVerify().verify();
        } catch (Exception e){
            log.info("许可证验证失败!!异常:{}",e.getMessage());
@@ -123,7 +137,7 @@
                log.info("更新小车排序信息异常={}", rgvNo);
                return;
            }
            List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().orderBy("rgv_id", true));
            List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().eq("status", 0).orderBy("rgv_id", true));
            if (basCircularShuttleList.get(0).getRgvNo().equals(rgvNo)) {
                return;
            }
@@ -163,6 +177,10 @@
            Integer rgvNo = 0;
            List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().orderBy("rgv_id", true));
            for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) {
                if (basCircularShuttle.getStatus() != 0){
                    sign = true;
                    continue;
                }
                RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basCircularShuttle.getRgvNo());
                RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
                if (rgvProtocol == null) {
@@ -273,6 +291,9 @@
                        break runRgv;
                    }
                    BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_id", rgvId));
                    if (basCircularShuttle.getStatus() != 0){
                        continue ;
                    }
                    RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basCircularShuttle.getRgvNo());
                    RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
                    if (rgvProtocol == null) {
@@ -313,6 +334,7 @@
                        rgvCommand.setSourceStaNo1(wrkMast.getSourceStaNo().shortValue());   //工位1起点
                        rgvCommand.setDestinationStaNo1(wrkMast.getStaNo().shortValue());   //工位1目标站点
                        rgvCommand.setCommand((short) 1);   //工位1任务确认
                        rgvCommand.setRgvSome(basCircularShuttle.getRgvSome()==1 ? (short) 1 : (short) 0);
                        if (!MessageQueue.offer(SlaveType.Rgv, rgvProtocol.getRgvNo(), new Task(2, rgvCommand))) {
                            //
                            log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand));
@@ -339,7 +361,7 @@
    }
    //任务完成
    public synchronized void rgvCompleteWrkMastSta() {
    public synchronized void rgvCompleteWrkMastSta(int[] autoZ) {
        try {
            for (RgvSlave rgvSlave : slaveProperties.getRgv()) {
                RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId());
@@ -376,15 +398,36 @@
                    wrkMast.setAppeTime(now);
                    try{
                        try{
                            RgvTaskReportingParam rgvTaskReportingParam = new RgvTaskReportingParam(wrkMast);
                            ReturnT<String> result = new PostMesDataUtils().postMesDataWcs("", "", rgvTaskReportingParam);
                            if (result.getCode()==200){
                            if (reportSwitch){
                                RgvTaskReportingParam rgvTaskReportingParam = new RgvTaskReportingParam(wrkMast);
                                ReturnT<String> result = new PostMesDataUtils().postMesDataWcs(wmsUrl, wmsOutPath, rgvTaskReportingParam);
                                if (result.getCode()==200){
                                    wrkMast.setWrkSts(4L);
                                    wrkMast.setAppeTime(now);
                                    wrkMastService.updateById(wrkMast);
                                    continue;
                                }else {
                                    log.error("工作号"+wrkMast.getWrkNo()+"任务完成信息上传处理失败");
                                }
                            } else {
                                //测试用
                                wrkMast.setWrkSts(4L);
                                wrkMast.setAppeTime(now);
                                wrkMastService.updateById(wrkMast);
                                if (reportSwitchAuto) {
                                    WrkMast wrkMast1 = new WrkMast();
                                    int workNo = commonService.getWorkNo(0);
                                    wrkMast1.setWrkNo((long) workNo);
                                    wrkMast1.setSourceStaNo(wrkMast.getSourceNoCs(autoZ));
                                    wrkMast1.setStaNo(wrkMast.getStaNoCs(autoZ));
                                    wrkMast1.setWrkSts(1L);
                                    wrkMast1.setIoType(1);
                                    wrkMast1.setModiTime(now);
                                    wrkMast1.setAppeTime(now);
                                    wrkMast1.setMemo("测试数据");
                                    wrkMastService.insert(wrkMast1);
                                }
                                continue;
                            }else {
                                log.error("工作号"+wrkMast.getWrkNo()+"任务完成信息上传处理失败");
                            }
                        } catch (Exception e){
                            log.error("工作号"+wrkMast.getWrkNo()+"任务完成信息上传处理失败,异常信息:"+e);
src/main/java/com/zy/asrs/utils/Utils.java
@@ -130,535 +130,165 @@
        return new double[]{x, y};
    }
    public static double[] getRgvPos(double a,double b) {
        // a 是总长度
        // b 是当前位置
        // 计算点的坐标
        double x = 0;
        double y = 0;
        if (b > 217480 && b <= 217980) {   // 133 站点 217730
            x = 110;
            y = 882;
        } else if (b > 217980 && b <= 227777) {
            x = 121;
            y = 882;
        } else if (b > 227777 &&  b <= 237574) {
            x = 132;
            y = 882;
        } else if (b > 237574 && b <= 247371) {
            x = 143;
            y = 882;
        } else if (b > 247371 && b <= 257168) {
            x = 154;
            y = 882;
        } else if (b > 257168 && b <= 257668) {  // 132 站点 257418
            x = 165;
            y = 882;
        } else if (b > 257668 && b <= 262455) {
            x = 176;
            y = 882;
        } else if (b > 262455 && b <= 267242) {
            x = 187;
            y = 882;
        } else if (b > 267242 && b <= 272029) {
            x = 198;
            y = 882;
        } else if (b > 272029 && b <= 276817) {
            x = 209;
            y = 882;
        } else if (b > 276817 && b <= 277317) {  // 131 站点 277067
            x = 220;
            y = 882;
        } else if (b > 277317 && b <= 284630) {
            x = 231;
            y = 882;
        } else if (b > 284630 && b <= 291943) {
            x = 242;
            y = 882;
        } else if (b > 291943 && b <= 299256) {
            x = 253;
            y = 882;
        } else if (b > 299256 && b <= 306570) {
            x = 264;
            y = 882;
        } else if (b > 306570 && b <= 307070) {  // 130 站点 306820
            x = 275;
            y = 882;
        } else if (b > 307070 && b <= 314399) {
            x = 286;
            y = 882;
        } else if (b > 314399 && b <= 321729) {
            x = 297;
            y = 882;
        } else if (b > 321729 && b <= 329058) {
            x = 308;
            y = 882;
        } else if (b > 329058 && b <= 336388) {
            x = 319;
            y = 882;
        } else if (b > 336388 && b <= 336888) {  // 129 站点 336638
            x = 330;
            y = 882;
        } else if (b > 336888 && b <= 344181) {
            x = 341;
            y = 882;
        } else if (b > 344181 && b <= 351474) {
            x = 352;
            y = 882;
        } else if (b > 257168 && b <= 358767) {
            x = 363;
            y = 882;
        } else if (b > 358767 && b <= 366061) {
            x = 374;
            y = 882;
        } else if (b > 366061 && b <= 366561) {  // 128 站点 366311
            x = 385;
            y = 882;
        } else if (b > 366561 && b <= 370134) {
            x = 396;
            y = 882;
        } else if (b > 370134 && b <= 373708) {
            x = 407;
            y = 882;
        } else if (b > 373708 && b <= 377282) {
            x = 418;
            y = 882;
        } else if (b > 377282 && b <= 380856) {
            x = 429;
            y = 882;
        } else if (b > 380856 && b <= 381356) {  // 127 站点 381106
            x = 440;
            y = 882;
        } else if (b > 381356 && b <= 385021) {
            x = 451;
            y = 882;
        } else if (b > 385021 && b <= 388687) {
            x = 462;
            y = 882;
        } else if (b > 388687 && b <= 392352) {
            x = 473;
            y = 882;
        } else if (b > 392352 && b <= 396018) {
            x = 484;
            y = 882;
        } else if (b > 396018 && b <= 396518) {  // 126 站点 396268
            x = 495;
            y = 882;
        } else if (b > 396518 && b <= 403768) {
            x = 506;
            y = 882;
        } else if (b > 403768 && b <= 411018) {
            x = 517;
            y = 882;
        } else if (b > 411018 && b <= 418268) {
            x = 528;
            y = 882;
        } else if (b > 418268 && b <= 425518) {
            x = 539;
            y = 882;
        } else if (b > 425518 && b <= 426018) {  // 125 站点 425768
            x = 550;
            y = 882;
        } else if (b > 426018 && b <= 433329) {
            x = 561;
            y = 882;
        } else if (b > 433329 && b <= 440641) {
            x = 572;
            y = 882;
        } else if (b > 440641 && b <= 447952) {
            x = 583;
            y = 882;
        } else if (b > 426018 && b <= 455264) {
            x = 594;
            y = 882;
        } else if (b > 455264 && b <= 455764) {  // 124 站点 455514
            x = 605;
            y = 882;
        } else if (b > 455764 && b <= 459352) {
            x = 616;
            y = 882;
        } else if (b > 459352 && b <= 462940) {
            x = 627;
            y = 882;
        } else if (b > 462940 && b <= 466528) {
            x = 638;
            y = 882;
        } else if (b > 466528 && b <= 470117) {
            x = 649;
            y = 882;
        } else if (b > 470117 && b <= 470617) {  // 123 站点 470367
            x = 660;
            y = 882;
        } else if (b > 470617 && b <= 474207) {
            x = 671;
            y = 882;
        } else if (b > 474207 && b <= 477797) {
            x = 682;
            y = 882;
        } else if (b > 477797 && b <= 481387) {
            x = 693;
            y = 882;
        } else if (b > 481387 && b <= 484977) {
            x = 704;
            y = 882;
        } else if (b > 484977 && b <= 485477) { // 122 站点 485227
            x = 715;
            y = 882;
        } else if (b > 485477 && b <= 492773) {
            x = 726;
            y = 882;
        } else if (b > 492773 && b <= 500069) {
            x = 737;
            y = 882;
        } else if (b > 500069 && b <= 507365) {
            x = 748;
            y = 882;
        } else if (b > 507365 && b <= 514662) {
            x = 759;
            y = 882;
        } else if (b > 514662 && b <= 515162) { // 121 站点 514912
            x = 770;
            y = 882;
        } else if (b > 515162 && b <= 522479) {
            x = 781;
            y = 882;
        } else if (b > 522479 && b <= 529797) {
            x = 792;
            y = 882;
        } else if (b > 529797 && b <= 537114) {
            x = 803;
            y = 882;
        } else if (b > 537114 && b <= 544432) {
            x = 814;
            y = 882;
        } else if (b > 544432 && b <= 544932) { // 120 站点 544682
            x = 825;
            y = 882;
        } else if (b > 544932 && b <= 548520) {
            x = 836;
            y = 882;
        } else if (b > 548520 && b <= 552108) {
            x = 847;
            y = 882;
        } else if (b > 552108 && b <= 555696) {
            x = 858;
            y = 882;
        } else if (b > 555696 && b <= 559284) {
            x = 869;
            y = 882;
        } else if (b > 559284 && b <= 559784) { // 119 站点 559534
            x = 880;
            y = 882;
        } else if (b > 559784 && b <= 563356) {
            x = 891;
            y = 882;
        } else if (b > 563356 && b <= 566928) {
            x = 908;
            y = 882;
        } else if (b > 566928 && b <= 570500) {
            x = 919;
            y = 882;
        } else if (b > 570500 && b <= 574073) {
            x = 930;
            y = 882;
        } else if (b > 574073 && b <= 574573) { // 118 站点 574323
            x = 941;
            y = 882;
        } else if (b > 574573 && b <= 581878) {
            x = 952;
            y = 882;
        } else if (b > 581878 && b <= 589183) {
            x = 963;
            y = 882;
        } else if (b > 589183 && b <= 596488) {
            x = 974;
            y = 882;
        } else if (b > 596488 && b <= 603793) {
            x = 985;
            y = 882;
        } else if (b > 603793 && b <= 604293) { // 117 站点 604043
            x = 996;
            y = 882;
        } else if (b > 604293 && b <= 611652) {
            x = 1007;
            y = 882;
        } else if (b > 611652 && b <= 619011) {
            x = 1018;
            y = 882;
        } else if (b > 619011 && b <= 626370) {
            x = 1029;
            y = 882;
        } else if (b > 626370 && b <= 633730) {
            x = 1;
            y = 882;
        } else if (b > 633730 && b <= 634230) { // 116 站点 633980
            x = 1040;
            y = 882;
        } else if (b > 634230 && b <= 641833) {
            x = 1050;
            y = 882;
        } else if (b > 641833 && b <= 649437) {
            x = 1060;
            y = 882;
        } else if (b > 649437 && b <= 657041) {
            x = 1070;
            y = 882;
        } else if (b > 657041 && b <= 664645) {
            x = 1080;
            y = 882;
        } else if (b > 664645 && b <= 672249) {
            x = 1090;
            y = 882;
        } else if (b > 672249 && b <= 679853) {
            x = 1100;
            y = 882;
        } else if (b > 679853 && b <= 680353) {   // 116 拐点 680103
            x = 1115;
            y = 882;
        } else if (b > 680353 && b <= 685447) {
            x = 1125;
            y = 882;
        } else if (b > 685447 && b <= 690542) {
            x = 1125;
            y = 880;
        } else if (b > 690542 && b <= 695637) {
            x = 1135;
            y = 878;
        } else if (b > 695637 && b <= 700731) {
            x = 1145;
            y = 877;
        } else if (b > 700731 && b <= 705826) {
            x = 1155;
            y = 875;
        } else if (b > 705826 && b <= 710921) {
            x = 1190;
            y = 855;
        } else if (b > 710921 && b <= 716015) {
            x = 1200;
            y = 840;
        } else if (b > 716015 && b <= 721110) {
            x = 1210;
            y = 820;
        } else if (b > 721110 && b <= 726205) {
            x = 1215;
            y = 800;
        } else if (b > 726205 && b <= 746783) {  // 115 拐点 731550
            x = 1215;
            y = 775;
        } else if (b > 746783 && b <= 750168) {
            x = 1215;
            y = 770;
        } else if (b > 750168 && b <= 753554) {
            x = 1215;
            y = 735;
        } else if (b > 753554 && b <= 756940) {
            x = 1215;
            y = 700;
        } else if (b > 756940 && b <= 760326) {
            x = 1215;
            y = 665;
        } else if (b > 760326 && b <= 763712) {
            x = 1215;
            y = 630;
        } else if (b > 763712 && b <= 767098) {
            x = 1215;
            y = 595;
        } else if (b > 767098 && b <= 770484) {
            x = 1215;
            y = 560;
        } else if (b > 770484 && b <= 773870) {
            x = 1215;
            y = 535;
        } else if (b > 773870 && b <= 774370) { // 115 站点 774120
            x = 1215;
            y = 520;
        } else if (b > 774370 && b <= 780052) {
            x = 1215;
            y = 502;
        } else if (b > 780052 && b <= 785735) {
            x = 1215;
            y = 484;
        } else if (b > 785735 && b <= 791417) {
            x = 1215;
            y = 466;
        } else if (b > 791417 && b <= 797100) {
            x = 1215;
            y = 448;
        } else if (b > 797100 && b <= 797600) { // 114 站点 797100
            x = 1215;
            y = 430;
        } else if (b > 797600 && b <= 815742) {
            x = 1215;
            y = 412;
        } else if (b > 815742 && b <= 833885) {
            x = 1215;
            y = 394;
        } else if (b > 833885 && b <= 852027) {
            x = 1215;
            y = 376;
        } else if (b > 852027 && b <= 870170) {
            x = 1215;
            y = 358;
        } else if (b > 870170 && b <= 870670) { // 113 站点 870420
            x = 1215;
            y = 340;
        } else if (b > 870670 && b <= 877815) {
            x = 1215;
            y = 322;
        } else if (b > 877815 && b <= 884960) {
            x = 1215;
            y = 304;
        } else if (b > 884960 && b <= 892105) {
            x = 1215;
            y = 286;
        } else if (b > 892105 && b <= 899250) {
            x = 1215;
            y = 268;
        } else if (b > 899250 && b <= 899750) { // 112 站点 899500
            x = 1215;
            y = 250;
        } else if (b > 899750 && b <= 914290) {
            x = 1215;
            y = 225;
        } else if (b > 914290 && b <= 928830) {
            x = 1215;
            y = 200;
        } else if (b > 928830 && b <= 943370) {
            x = 1215;
            y = 175;
        } else if (b > 943370 && b <= 957910) {
            x = 1215;
            y = 150;
        } else if (b > 972450 && b <= 972950) {  // 拐点
            x = 1215;
            y = 125;
        } else if (b > 972950 && b <= 1016193) {  // 顶点
            x = 1164;
            y = 80;
        } else if (b > 1016193 && b <= 1063563) { // 拐点
            x = 1115;
            y = 125;
        } else if (b > 1063563 && b <= 1064063) { // 111 站点 1063813
            x = 1115;
            y = 150;
        } else if (b > 1064063 && b <= 1077711) {
            x = 1115;
            y = 175;
        } else if (b > 1077711 && b <= 1078211) { // 110 站点 1077961
            x = 1115;
            y = 200;
        } else if (b > 1078211 && b <= 1104788) {
            x = 1115;
            y = 225;
        } else if (b > 1104788 && b <= 1105288) { // 109 站点 1105038
            x = 1115;
            y = 250;
        } else if (b > 1105288 && b <= 1119213) {
            x = 1115;
            y = 275;
        } else if (b > 1119213 && b <= 1119713) { // 108 站点 1119463
            x = 1115;
            y = 300;
        } else if (b > 1119713 && b <= 1145902) {
            x = 1115;
            y = 325;
        } else if (b > 1145902 && b <= 1146402) { // 107 站点 1146152
            x = 1115;
            y = 350;
        } else if (b > 1146402 && b <= 1160380) {
            x = 1115;
            y = 375;
        } else if (b > 1160380 && b <= 1160880) { // 106 站点 1160630
            x = 1115;
            y = 400;
        } else if (b > 1160880 && b <= 1187314) {
            x = 1115;
            y = 425;
        } else if (b > 1187314 && b <= 1188214) { // 105 站点 1187564
            x = 1115;
            y = 450;
        } else if (b > 1188214 && b <= 1201849) {
            x = 1115;
            y = 475;
        } else if (b > 1201849 && b <= 1202349) { // 104 站点 1202099
            x = 1115;
            y = 500;
        } else if (b > 1202349 && b <= 1228831) {
            x = 1115;
            y = 525;
        } else if (b > 1228831 && b <= 1229331) { // 103 站点 1229081
            x = 1115;
            y = 550;
        } else if (b > 1229331 && b <= 1243204) {
            x = 1115;
            y = 575;
        } else if (b > 1243204 && b <= 1243704) { // 102 站点 1243454
            x = 1115;
            y = 600;
        } else if (b > 1243704 && b <= 1269708) {
            x = 1115;
            y = 625;
        } else if (b > 1269708 && b <= 1284750) { // 101 站点 1269958
            x = 1115;
            y = 650;
        } else if (b > 1284750 && b <= 1285250) { // 101 拐点
            x = 1115;
            y = 720;
        } else if (b > 1285250 && b <= 1322829) { // 101 拐点
            x = 1100;
            y = 750;
        } else if (b > 1322829 && b <= 1737000){
            double unit = (1737000 - 1322829) / 100.0;
            double startX = 1090;
            double unitX = 7;
            y = 775;
            for (int i = 0; i < 100; i++) {
                if (b > 1322829 + i * unit && b <= 1322829 + (i + 1) * unit) {
                    x = startX - i * unitX;
                }
            }
        } else if (b >=  0 && b <= 134400){
            double unit = 134400 / 41.0;
            double startX = 390;
            double unitX = 8.17;
            y = 775;
            for (int i = 0; i < 41; i++) {
                if (b >= 0 + i * unit && b <= 0 + (i + 1) * unit) {
                    x = startX - i * unitX;
                }
            }
        } else if (b > 134400 && b <= 134900) {
            x = 25;
            y = 830;
        } else if (b > 134900 && b <= 196000) {
            x = 65;
            y = 882;
        } else if (b > 196000 && b <= 217480) {
            x = 83;
            y = 882;
    public static double[] getRgvPosNew(Integer devNo,double a, double b) {
        double[] rgvPosNew = getRgvPosNew(a, b);
        switch (devNo){
            case 101:
            case 102:
            case 103:
            case 104:
            case 105:
            case 106:
            case 107:
            case 108:
            case 109:
            case 110:
            case 111:
                rgvPosNew[0] = rgvPosNew[0] - 30;
                rgvPosNew[1] = rgvPosNew[1];
                break;
            case 112:
            case 113:
            case 114:
            case 115:
                rgvPosNew[0] = rgvPosNew[0] + 30;
                rgvPosNew[1] = rgvPosNew[1];
                break;
            case 116:
            case 117:
            case 118:
            case 119:
            case 120:
            case 121:
            case 122:
            case 123:
            case 124:
            case 125:
            case 126:
            case 127:
            case 128:
            case 129:
            case 130:
            case 131:
            case 132:
            case 133:
                rgvPosNew[0] = rgvPosNew[0];
                rgvPosNew[1] = rgvPosNew[1] + 30;
                break;
            case 134:
                rgvPosNew[0] = rgvPosNew[0];
                rgvPosNew[1] = rgvPosNew[1] - 30;
                break;
        }
        return rgvPosNew;
    }
    public static double[] getRgvPosNew(double a, double b) {
        // 定义区间及对应的几何参数(新增圆弧参数)
        // 结构:{start, end, 类型, 参数...}
        // 类型说明:0-直线,1-圆弧(需要圆心坐标)
        Object[][] intervals = {
                // 直线区间(0-134400)
                {0.0, 120000.0, 0, 390.0, 775.0, 25.0, 775.0},
//                // 弧线区间!!!直线区间!!!
                {120000.0, 127500.0, 0, 25.0, 775.0, 45.0, 822.0},
                // 弧线区间!!!直线区间!!!
                {127500.0, 134900.0, 0, 45.0, 822.0, 65.0, 882.0},
                // 直线区间
                {134900.0, 680103.0,0, 65.0, 882.0, 1115.0, 882.0},
//                // 弧线区间(拐点116-115),控制点假设为(1125, 882)
//                {680103, 731550, 1115, 882, 1215, 775, 1125, 882},
                // 圆弧区间(拐点116-115)新参数:圆心(1115,775)
                {680103.0, 731550.0, 2, 1115.0, 882.0, 1215.0, 775.0, 1115.0, 775.0}, // 修正终点坐标
                // 直线区间
                {731550.0, 972950.0,0, 1215.0, 775.0, 1215.0, 125.0},
                // 弧线区间(拐点112-顶点),控制点假设为(1215, 80)!!!直线区间!!!
                {972950.0, 1016193.0,0, 1215.0, 125.0, 1164.0, 80.0},
                // 弧线区间(拐点-顶点-111),控制点假设为(1164, 125)!!!直线区间!!!
                {1016193.0, 1063563.0,0, 1164.0, 80.0, 1115.0, 125.0},
                // 直线区间
                {1063563.0, 1315250.0,0, 1115.0, 150.0, 1115.0, 720.0},
                // 弧线区间(拐点101-转弯),控制点假设为(1115, 750)
                {1315250.0, 1322829.0,0, 1115.0, 720.0, 1100.0, 750.0},
                // 直线区间
                {1322829.0, 1737000.0,0, 1090.0, 775.0, 390.0, 775.0},
        };
        for (Object[] interval : intervals) {
            double start = (Double) interval[0];
            double end = (Double) interval[1];
            int type = (Integer) interval[2];
            if (b >= start && b <= end) {
                double t = (b - start) / (end - start);
                // 根据不同类型计算坐标
                switch (type) {
                    case 0: // 直线
                        return linearInterpolation(interval, t);
                    case 1: // 贝塞尔曲线
                        return bezierInterpolation(interval, t);
                    case 2: // 圆弧
                        return circularInterpolation(interval, t);
                }
            }
        }
        return new double[]{0, 0};
    }
        return new double[]{x, y};
    // 直线插值
    private static double[] linearInterpolation(Object[] interval, double t) {
        double x1 = (Double) interval[3];
        double y1 = (Double) interval[4];
        double x2 = (Double) interval[5];
        double y2 = (Double) interval[6];
        return new double[]{
                x1 + t * (x2 - x1),
                y1 + t * (y2 - y1)
        };
    }
    // 贝塞尔曲线插值
    private static double[] bezierInterpolation(Object[] interval, double t) {
        double x0 = (Double) interval[3];
        double y0 = (Double) interval[4];
        double x2 = (Double) interval[5];
        double y2 = (Double) interval[6];
        double cx = (Double) interval[7];
        double cy = (Double) interval[8];
        return new double[]{
                Math.pow(1-t, 2)*x0 + 2*(1-t)*t*cx + t*t*x2,
                Math.pow(1-t, 2)*y0 + 2*(1-t)*t*cy + t*t*y2
        };
    }
    // 圆弧插值(新增)
    private static double[] circularInterpolation(Object[] interval, double t) {
        // 参数解析
        double startX = (Double) interval[3];
        double startY = (Double) interval[4];
        double endX = (Double) interval[5];
        double endY = (Double) interval[6];
        double centerX = (Double) interval[7];
        double centerY = (Double) interval[8];
        // 计算起始角度和终止角度
        double startAngle = Math.atan2(startY - centerY, startX - centerX);
        double endAngle = Math.atan2(endY - centerY, endX - centerX);
        // 角度插值
        double currentAngle = startAngle + t * (endAngle - startAngle);
        double radius = Math.hypot(startX - centerX, startY - centerY);
        return new double[]{
                centerX + radius * Math.cos(currentAngle),
                centerY + radius * Math.sin(currentAngle)
        };
    }
}
src/main/java/com/zy/core/MainProcess.java
@@ -29,6 +29,7 @@
    private int j = 0;
    private int k = 0;
    private int l = 0;
    private int[] autoZ = new int[]{0,0,0,0,0,0,0};
    /**
     * =====>>  开始工作
@@ -63,7 +64,7 @@
                    // 任务下发
                    mainService.DevpTaskNoRun();
                    // 任务完成
                    mainService.rgvCompleteWrkMastSta();
                    mainService.rgvCompleteWrkMastSta(autoZ);
                    //更新位置信息
                    mainService.updateStePosition();
src/main/java/com/zy/core/model/command/RgvCommand.java
@@ -52,6 +52,9 @@
    // 工位2任务号
    private Short taskNo2 = 0;
    private Short rgvSome = 1;
    /**
     * 任务模式:
     * 0 = 无
src/main/java/com/zy/core/thread/RgvThread.java
@@ -216,9 +216,13 @@
        array[3] = command.getTaskMode1();//任务模式
        array[4] = command.getTaskNo1();
        OperateResult result = siemensNet.Write("DB24.0", array);
        if (command.getAckFinish1().equals((short)0)) {
//            Thread.sleep(100L);
            siemensNet.Write("DB24.10.7", command.getRgvSome() == 1);
            Thread.sleep(100L);
            result = siemensNet.Write("DB24.10.0", true);
        } else {
src/main/java/com/zy/system/controller/LicenseCreatorController.java
@@ -69,6 +69,9 @@
     */
    @RequestMapping(value = "/getLicenseDays")
    public R getLicenseDays() {
//        if (true){
//            return R.ok().add(Cools.add("day",0));
//        }
        LicenseVerify licenseVerify = new LicenseVerify();
        LicenseContent verifyInfo = licenseVerify.getVerifyInfo();
        if (verifyInfo == null) {
src/main/resources/application.yml
@@ -32,6 +32,12 @@
swagger:
  enable: false
wms:
  url: 172.17.196.200:8084
  reportOutPath: open/rcs/task/cs/up/UploadTask
  reportSwitch: true
  reportSwitchAuto: false
#License相关配置
license:
  subject: gdhmasrs
src/main/resources/license.lic
Binary files differ
src/main/resources/mapper/BasCircularShuttleMapper.xml
@@ -8,6 +8,7 @@
        <result column="rgv_id" property="rgvId" />
        <result column="rgv_no" property="rgvNo" />
        <result column="status" property="status" />
        <result column="rgv_some" property="rgvSome" />
    </resultMap>
src/main/webapp/static/images/favicon.ico

src/main/webapp/static/images/zy-logo.png

src/main/webapp/views/index.html
@@ -59,15 +59,15 @@
        }
        .station {
            position: absolute;
            width: 40px;
            height: 24px;
            /*border-radius: 50%;*/
            width: 20px;
            height: 14px;
            text-align: center;
            line-height: 24px;
            line-height: 1.5; /* 调整行高与字体大小的比值 */
            font-size: 10px; /* 设置更小的字体 */
            font-weight: bold;
            transition: transform 0.3s ease;
            background-color: #ab1839;
            transform: scale(1.2);
            transform: scale(1); /* 可选:如果不需要放大效果 */
        }
        .bus {
            font-size: 10px;
@@ -218,17 +218,17 @@
"
                      style="fill:none; stroke:blue; stroke-width:4;" />
            </svg>
            <div class="bus-station">
                <div v-for="(item,i) in devpPos1" class="bus-item-top" :style="'left:' + (75 + i * 15) + 'px'">{{item.dev_no}}</div>
            </div>
            <div class="bus-station" style="flex-direction: column">
                <div v-for="(item,i) in devpPos2" class="bus-item-left" :style="'top:' + (200 + i * 50) + 'px'">{{item.dev_no}}</div>
            </div>
            <div class="bus-station" style="flex-direction: column">
                <div v-for="(item,i) in devpPos3" class="bus-item-left2" :style="'top:' + (100 + i * 10) + 'px'">{{item.dev_no}}</div>
            </div>
            <!-- Stations on outer ring -->
<!--            <div v-for="station in tableDataDev" class="station" :style="{ top: station.valueX + '%', left: station.valueY + '%' }">{{ station.index }}</div>-->
<!--            <div class="bus-station">-->
<!--                <div v-for="(item,i) in devpPos1" class="bus-item-top" :style="'left:' + (75 + i * 15) + 'px'">{{item.dev_no}}</div>-->
<!--            </div>-->
<!--            <div class="bus-station" style="flex-direction: column">-->
<!--                <div v-for="(item,i) in devpPos2" class="bus-item-left" :style="'top:' + (200 + i * 50) + 'px'">{{item.dev_no}}</div>-->
<!--            </div>-->
<!--            <div class="bus-station" style="flex-direction: column">-->
<!--                <div v-for="(item,i) in devpPos3" class="bus-item-left2" :style="'top:' + (100 + i * 10) + 'px'">{{item.dev_no}}</div>-->
<!--            </div>-->
<!--             Stations on outer ring-->
            <div v-for="station in tableDataDev" class="station" :style="{ top: station.valueY + 'px', left: station.valueX + 'px' }">{{ station.index }}</div>
            <div>
                <el-switch
                        style="display: block"
@@ -294,11 +294,18 @@
                            prop="rgvSts"
                            label="RGV状态">
                    </el-table-column>
<!--                    <el-table-column-->
<!--                            prop=""-->
<!--                            label="操作">-->
<!--                        <el-button type="primary" icon="el-icon-edit" circle></el-button>-->
<!--                    </el-table-column>-->
                    <el-table-column
                            label="操作"
                            type="template">
                        <template slot-scope="scope">
                            <el-button
                                    type="danger"
                                    size="small"
                                    @click="taskDelete(scope.row)">
                                删除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
@@ -338,11 +345,18 @@
                            prop="status$"
                            label="状态">
                    </el-table-column>
<!--                    <el-table-column-->
<!--                            prop=""-->
<!--                            label="操作">-->
<!--                        <el-button type="primary" icon="el-icon-edit" circle></el-button>-->
<!--                    </el-table-column>-->
                    <el-table-column
                            label="操作"
                            type="template">
                        <template slot-scope="scope">
                            <el-button
                                    :type="scope.row.status === 0 ? 'primary' : 'danger'"
                                    size="small"
                                    @click="toggleStatus(scope.$index, scope.row)">
                                {{ scope.row.status === 0 ? '禁用' : '解除禁用' }}
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
@@ -444,6 +458,61 @@
                        }
                    }
                },
                taskDelete(row) {
                    let that = this;
                    that.$confirm('确认要删除该设备吗?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        $.ajax({
                            url: baseUrl + "/rgv/disable/task/delete",
                            headers: {'token': localStorage.getItem('token')},
                            method: 'POST',
                            data: {
                                wrkNo: row.wrkNo
                            },
                            success: function (res) {
                                if (res.code === 200) {
                                    that.$message.success('删除成功');
                                    // 删除当前行
                                    that.tableDataRight.splice(that.tableDataRight.indexOf(row), 1);
                                } else {
                                    that.$message.error('删除失败');
                                }
                            }
                        });
                    });
                },
                toggleStatus(index, row) {
                    let that = this;
                    const currentStatus = row.status;
                    const targetStatus = currentStatus === 0 ? 1 : 0;
                    that.$confirm(`确认要${currentStatus === 0 ? '禁用' : '启用'}该设备吗?`, '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        $.ajax({
                            url: baseUrl + "/rgv/disable/rgv/status",
                            headers: {'token': localStorage.getItem('token')},
                            method: 'POST',
                            data: {
                                rgvNo: row.rgvNo,
                                status: targetStatus
                            },
                            success: function (res) {
                                if (res.code === 200) {
                                    that.$message.success(`状态更新成功`);
                                    row.status$ = targetStatus; // 更新前端状态
                                } else {
                                    that.$message.error('状态更新失败');
                                }
                            }
                        });
                    });
                },
                handleChangeValueRight(val) {
                    console.log("33333"+val);