src/main/java/com/zy/asrs/controller/TVController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/domain/dto/WrkDetl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/thread/impl/NormalLedThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/TVController.java
@@ -10,7 +10,6 @@ import com.zy.asrs.domain.dto.AxisBean; import com.zy.asrs.domain.dto.WorkChartAxis; import com.zy.asrs.domain.dto.LocChartPie; import com.zy.asrs.domain.dto.WrkDetl; import com.zy.asrs.entity.BasDevp; import com.zy.asrs.entity.BasShuttle; import com.zy.asrs.entity.BasShuttleErr; @@ -26,11 +25,14 @@ import com.zy.common.utils.HttpHandler; import com.zy.core.cache.SlaveConnection; import com.zy.core.enums.SlaveType; import com.zy.core.model.LedSlave; import com.zy.core.model.ShuttleSlave; import com.zy.core.model.command.LedCommand; import com.zy.core.model.protocol.ShuttleProtocol; import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.LedThread; import com.zy.core.thread.ShuttleThread; import com.zy.core.thread.impl.NormalLedThread; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; @@ -223,7 +225,17 @@ */ @GetMapping("/led") public R monitorLed(@RequestParam("ledId") Integer ledId) { BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId)); int dev_no = 1012; if (ledId == 1) { dev_no = 1012; } else if (ledId == 2) { dev_no = 1014; } else if (ledId == 3) { dev_no = 1022; } else if (ledId == 4) { dev_no = 1025; } BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", dev_no)); if (Cools.isEmpty(basDevp)) { return R.ok(); } @@ -308,22 +320,48 @@ */ @GetMapping("/led/error") public R monitorLedError(@RequestParam("ledId") Integer ledId) { BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId)); if (Cools.isEmpty(basDevp)) { return R.ok(); String errorMsg = ""; for (LedSlave slave : slaveProperties.getLed()) { if (slave.getId() == ledId) { NormalLedThread ledThread = (NormalLedThread) SlaveConnection.get(SlaveType.Led, slave.getId()); if (null != ledThread) { errorMsg = ledThread.getErrorMsg().toString(); } } } if (Cools.isEmpty(basDevp.getArea())) { return R.ok(); } if (basDevp.getLoading().equals("N")) { basDevp.setArea(""); basDevpService.updateById(basDevp); return R.ok(); } String errorMsg = basDevp.getArea(); return R.ok().add(errorMsg); } /** * 异常通知 */ // @GetMapping("/led/error") // public R monitorLedError(@RequestParam("ledId") Integer ledId) { // int dev_no = 1012; // if (ledId == 1) { // dev_no = 1012; // } else if (ledId == 2) { // dev_no = 1014; // } else if (ledId == 3) { // dev_no = 1022; // } else if (ledId == 4) { // dev_no = 1025; // } // BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", dev_no)); // if (Cools.isEmpty(basDevp)) { // return R.ok(); // } // if (Cools.isEmpty(basDevp.getArea())) { // return R.ok(); // } // if (basDevp.getLoading().equals("N")) { // basDevp.setArea(""); // basDevpService.updateById(basDevp); // return R.ok(); // } // String errorMsg = basDevp.getArea(); // // return R.ok().add(errorMsg); // } /** * 设备异常通知 src/main/java/com/zy/asrs/domain/dto/WrkDetl.java
File was deleted src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -34,6 +34,7 @@ import com.zy.core.model.protocol.StaProtocol; import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.DevpThread; import com.zy.core.thread.LedThread; import com.zy.core.thread.LiftThread; import com.zy.core.thread.ShuttleThread; import com.zy.core.thread.impl.FyDevpThread; @@ -177,12 +178,55 @@ staProtocol = staProtocol.clone(); } Short workNo = staProtocol.getWorkNo(); // // led 异常显示 // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); // if (ledThread != null) { // ledThread.error(errMsg); // } // 尺寸检测异常 boolean back = false; LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); String errMsg = ""; if (staProtocol.isFrontErr()) { errMsg = "前超限"; back = true; } if (!back && staProtocol.isBackErr()) { errMsg = "后超限"; back = true; } if (!back && staProtocol.isHighErr()) { errMsg = "高超限"; back = true; } if (!back && staProtocol.isLeftErr()) { errMsg = "左超限"; back = true; } if (!back && staProtocol.isRightErr()) { errMsg = "右超限"; back = true; } if (!back && staProtocol.isWeightErr()) { errMsg = "超重"; back = true; } if (!back && staProtocol.isBarcodeErr()) { errMsg = "扫码失败"; log.error("物料码扫码失败"); back = true; } // 退回 if (back) { if (!staProtocol.isLoading()) { continue; } if (!staProtocol.isPakMk()) { continue; } // led 异常显示 if (ledThread != null) { MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); } } if (ledThread != null) { ledThread.error(errMsg); } // 判断是否满足入库条件 if (staProtocol.isAutoing() && staProtocol.isLoading() && isInEnable(devpThread, inSta.getStaNo()) && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) && staProtocol.isPakMk()) { String barcode = staProtocol.getBarcode(); src/main/java/com/zy/core/thread/impl/NormalLedThread.java
@@ -8,12 +8,14 @@ import com.zy.core.model.Task; import com.zy.core.model.command.LedCommand; import com.zy.core.thread.LedThread; import lombok.Data; import lombok.extern.slf4j.Slf4j; import java.util.HashSet; import java.util.List; import java.util.Set; @Data @Slf4j @SuppressWarnings("all") public class NormalLedThread implements LedThread, Runnable { src/main/resources/application.yml
@@ -116,25 +116,25 @@ # LED1 led[0]: id: 1 ip: 192.168.10.62 ip: 192.168.10.160 port: 5005 devpPlcId: ${wcs-slave.devp[0].id} # LED2 led[1]: id: 2 ip: 192.168.10.63 ip: 192.168.10.161 port: 5005 devpPlcId: ${wcs-slave.devp[0].id} # LED3 led[2]: id: 3 ip: 192.168.10.64 ip: 192.168.10.162 port: 5005 devpPlcId: ${wcs-slave.devp[0].id} # LED4 led[3]: id: 4 ip: 192.168.10.65 ip: 192.168.10.163 port: 5005 devpPlcId: ${wcs-slave.devp[0].id}