| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.core.News; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.ThreadHandler; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.io.DataInputStream; |
| | | import java.io.DataOutputStream; |
| | |
| | | private DataInputStream dataInputStream; |
| | | public Integer connCount = 0; |
| | | |
| | | @Autowired |
| | | private AgvBasDevpService agvBasDevpService; |
| | | |
| | | public BarcodeThread(Slave slave) { |
| | | this.slave = slave; |
| | | } |
| | |
| | | this.barcode.append(barcode); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | News.info("{}号条码器,检索数据:{}", slave.getId(), this.barcode); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("time", DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmss_F)); |
| | | jsonObject.put("barcode", barcode); |
| | |
| | | OutputQueue.BARCODE.poll(); |
| | | } |
| | | OutputQueue.BARCODE.offer(jsonObject); |
| | | |
| | | String devNo = slave.getId() == 13 ? "310-1" : slave.getId() == 15 ? "312-2" : slave.getId() == 17 ? "314-1" : slave.getId() == 19 ? "316-1" : null; |
| | | if(!Cools.isEmpty(devNo)){ |
| | | agvBasDevpService.updateBarcode(devNo,barcode); |
| | | } |
| | | } |
| | | } |
| | | |