*
lsh
2025-02-14 83def9d705c2883cc3a50f7ffeff5596b43fe437
*
2个文件已修改
29 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MonitorController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MonitorController.java
@@ -17,9 +17,11 @@
import com.zy.core.model.LedSlave;
import com.zy.core.model.command.LedCommand;
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.LedThread;
import com.zy.core.thread.SiemensDevpThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -47,12 +49,25 @@
     */
    @PostMapping("/barcode/two")
    public R barcodeTwo(@RequestParam Integer palletizingNo) {
        Date now = new Date();
        String barcode = "";
        for (DevpSlave devp : slaveProperties.getDevp()) {
            // 遍历入库口
            for (DevpSlave.Sta inSta : devp.getDriveSta()) {
                if (inSta.getStaNo().equals(palletizingNo)){
                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2);
                    StaProtocol staProtocol = devpThread.getStation().get(inSta);
                    if (staProtocol == null) {
                        continue;
                    } else {
                        staProtocol = staProtocol.clone();
                    }
                    if (!staProtocol.isAutoing() || !staProtocol.isLoading() || staProtocol.getWorkNo() != 0 || !staProtocol.isPakMk()){
                        return R.error("未就绪!!!");
                    }
                    // 获取条码扫描仪信息
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                    if (barcodeThread == null) {
@@ -71,10 +86,6 @@
                }
            }
        }
        Date now = new Date();
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(now);
        return R.ok(
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4662,14 +4662,19 @@
                    staProtocol = staProtocol.clone();
                }
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() == 0){
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() == 0 && staProtocol.isPakMk()){
                    RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign("armNo"+staNo);
                    if (!Cools.isEmpty(rgvOneSign) && rgvOneSign.getRgvOneSign() == 1){
                        int workNo = commonService.getWorkNo(6);
                        StaProtocol staProtocolnew = new StaProtocol();
                        staProtocolnew.setSiteId(staNo);
                        staProtocolnew.setWorkNo(workNo);
                        staProtocolnew.setStaNo(staNo==215? 217:221);
                        boolean result1 = MessageQueue.offer(SlaveType.Devp, 2, new Task(3, staProtocolnew));
                        devpThread.setPakMk(staProtocolnew.getSiteId(), false);
                        boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocolnew));
                        if (!result2) {
                            log.error("发布命令至输送线队列失败!!! [plc编号:{}]", 2);
@@ -4677,6 +4682,9 @@
                        if (!staProtocol.isLoading()){
                            updateRgvOneSign("armNo"+staNo,0);
                        }
                        boolean result3 = MessageQueue.offer(SlaveType.Devp, 2, new Task(4, staProtocolnew));
                    }
                }
            }catch (Exception e){