自动化立体仓库 - WCS系统
tqs
2022-10-12 e828d99f25ba6736cdb0c31128aa4d976348bcb3
src/main/java/com/zy/core/netty/handle/PackageServerHandler.java
@@ -44,10 +44,18 @@
            case HEARTBEAT:
                ChannelCache.setChannel(String.valueOf(fire3030.getNo()), ctx.channel());
                Constant.errorMap.remove(fire3030.getNo());
                LocMastService locMastService2 = SpringUtils.getBean(LocMastService.class);
                LocMast locMast2 = locMastService2.selectOne(new EntityWrapper<LocMast>().eq("loc_no","0101804"));
                if(null != locMast2) {
                    locMast2.setChannel(10000);
                    locMast2.setModiTime(new Date());
                    locMastService2.update(locMast2, new EntityWrapper<LocMast>().eq("loc_no", "0101804"));
                }
                break;
            case FIRE_ALARM:
                //消防IO点编号
                String fireNo = fire3030.getNo().toString() + fire3030.getLoop().toString() + fire3030.getPartNo().toString();
//                String fireNo = fire3030.getNo().toString() + fire3030.getLoop().toString() + fire3030.getPartNo().toString();
                String fireNo =fire3030.getPartNo().toString();  //0100201 对应  30 31   0200201 对应 34 35
                String fireTime = "20" + fire3030.getYear() + "-" + fire3030.getMonth() + "-" + fire3030.getDay()
                        + " " + fire3030.getHour() + ":" + fire3030.getMinute() + ":" + fire3030.getSeconds();
                Date dt = DateUtils.convert(fireTime);
@@ -103,6 +111,26 @@
    /**************************************** 测试专用 *****************************************/
    public static void main(String[] args){
        byte[] rfidBytes = new byte[]{(byte)0xA0, 0x13, 0x01, (byte)0x8A, (byte)0xB6, 0x30, 0x00,
                0x38, 0x30, 0x33, 0x34, 0x35, 0x36, 0x37, (byte)0x38, 0x28, (byte)0xC3, (byte)0x81, 0x2D, (byte)0xB0, 0x2F };
        if(rfidBytes.length > 15) {
            byte[] dataBytes = new byte[8];
            dataBytes[0] = rfidBytes[7];
            dataBytes[1] = rfidBytes[8];
            dataBytes[2] = rfidBytes[9];
            dataBytes[3] = rfidBytes[10];
            dataBytes[4] = rfidBytes[11];
            dataBytes[5] = rfidBytes[12];
            dataBytes[6] = rfidBytes[13];
            dataBytes[7] = rfidBytes[14];
            String str = new String(dataBytes);
            String barcode = new String(rfidBytes,7,8);
            System.out.println(str);
        }
        String aa= "ILY0127 0001";
        byte[] byteAa = aa.getBytes();
        byte[] bytes = new byte[]{(byte)0x82, 0x38, 0x30, 0x32, 0x34, 0x30, 0x38, 0x39, 0x3B, 0x30, 0x31, 0x31, 0x31,
                                    0x30, 0x33, 0x30, 0x38, 0x31, 0x30, 0x30, 0x34, 0x30, 0x38, 0x38, 0x30, (byte)0x83};
        Fire_3030 fire3030 = new Fire_3030().readFromBytes(bytes);
@@ -111,6 +139,5 @@
        //消防IO点编号
        String fireNo = fire3030.getNo().toString() + fire3030.getLoop().toString() + fire3030.getPartNo().toString();
        System.out.println(fireNo);
        String aa="";
    }
}