package com.mvc.service.aihcxd;

import com.mvc.model.TAireadModel;
import com.mvc.service.biz.TMaintenanceRecordsService;
import com.mvc.utils.StoreBlockingQueue;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class IdenThread implements Runnable {

    @Resource
    public WmIdenService wmIdenService;

    @Resource
    private TMaintenanceRecordsService tMaintenanceRecordsService;

    @Override
    public void run() {
        while (true) {
            try {
                TAireadModel model = StoreBlockingQueue.tAireadQueue.take();

                Thread.sleep(100);//增加休眠观察服务侧识别是否稳定 2024-03-20 guozhao
                wmIdenService.getIdenResult(model);

                //生成维护记录
                tMaintenanceRecordsService.generateRecordByTAiRead(model);

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
