zyh
1 天以前 e98d4b1133ed058bfe1e6af75be9975aebfc32d8
src/main/java/com/zy/asrs/controller/SiteController.java
@@ -7,6 +7,7 @@
import com.zy.asrs.domain.vo.SiteTableVo;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.service.BasDevpService;
import com.zy.core.Slave;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
@@ -79,8 +80,9 @@
            vo.setPakMk(staProtocol.isPakMk()?"Y":"N");       // 入库标记
            vo.setEmptyMk(staProtocol.isEmptyMk()?"Y":"N");     // 空板信号
            vo.setStaNo(staProtocol.getStaNo());                // 目标站
//            vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() && staProtocol.isLow() ? "低" : "高");     //高低库位
            vo.setLocType1(devp.getDevNo()==102 ? "高" : "低");
            vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() && staProtocol.isLow() ? "低" : "高");     //高低库位
//            vo.setLocType1(staProtocol.isHigh() ? "高" : "低");
            vo.setEmptyOutType(staProtocol.isEmptyOutType() ? "Y" : "N");
        }
        return R.ok().add(list);
    }
@@ -168,6 +170,7 @@
    public R siteDetlUpdate(@RequestParam Integer siteId,
                            @RequestParam Short workNo,
                            @RequestParam Short staNo,
                            @RequestParam Short palletSize,
                            @RequestParam String pakMk){
        for (DevpSlave devp : slaveProperties.getDevp()) {
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
@@ -186,9 +189,13 @@
                    if (staNo != null) {
                        staProtocol.setStaNo(staNo);
                    }
                    if (palletSize != null) {
                        staProtocol.setPalletSize(palletSize);
                    }
                    if (pakMk != null) {
                        staProtocol.setPakMk(pakMk.equals("Y"));
                    }
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    if (result) {
                        return R.ok();
@@ -201,5 +208,19 @@
        return R.error("plc已掉线");
    }
    @GetMapping("/site/{siteId}")
    public R site(@PathVariable("siteId") Integer siteId){
        List<DevpSlave> devp = slaveProperties.getDevp();
        for (DevpSlave slave : devp) {
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, slave.getId());
            Map<Integer, StaProtocol> station = devpThread.getStation();
            StaProtocol staProtocol = station.get(siteId);
            if (staProtocol == null) {
                continue;
            }
            return R.ok().add(staProtocol);
        }
        return R.error();
    }
}