package com.skr.mdm.service.impl.reload.handler;

import com.skr.mdm.annotation.MdmReloadHandler;
import com.skr.mdm.bean.so.ReloadSO;
import com.skr.mdm.dao.ContentInformDao;
import com.skr.mdm.service.impl.reload.ReloadHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author nfq
 * @date 2022/06/10 14:53
 */
@MdmReloadHandler
@Slf4j
public class ContentInformReloadHandler implements ReloadHandler {

    @Autowired
    private ContentInformDao contentInformDao;

    @Override
    public void doHandler(ReloadSO reloadSO, Integer equipmentId) {
        try {
            reloadSO.setNoticeList(contentInformDao.listReloadSO(equipmentId, 1));
            reloadSO.setForceNoticeList(contentInformDao.listReloadSO(equipmentId, 2));
        } catch (Exception e) {
            log.error("卸载重装通知异常：" + equipmentId, e);
        }
    }
}
