package com.jwipc.spe.logic.impl;

import com.jwipc.spe.convert.QmRectifiedMeasuresConvert;
import com.jwipc.spe.dto.QmRectifiedMeasuresDTO;
import com.jwipc.spe.logic.QmNoticeOrderLogic;
import com.jwipc.spe.logic.QmRectifiedMeasuresLogic;
import com.jwipc.spe.model.po.QmRectifiedMeasuresPO;
import com.jwipc.spe.service.IQmRectifiedMeasuresService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author Al
 * @create 2024-03-18 15:45
 */
@Service
@RequiredArgsConstructor
public class QmRectifiedMeasuresLogicImpl implements QmRectifiedMeasuresLogic {
    private final QmRectifiedMeasuresConvert qmRectifiedMeasuresConvert;
    private final IQmRectifiedMeasuresService qmRectifiedMeasuresService;
    //根据noticeOrderId查询数据
    @Override
    public QmRectifiedMeasuresDTO getByNoticeOrderId(Long id) {
        if (id != null) {
            Long noticeOrderId = id;
            QmRectifiedMeasuresPO qmRectifiedMeasuresPO = qmRectifiedMeasuresService.getDataByNoticeOrderId(noticeOrderId);
            return qmRectifiedMeasuresConvert.po2DTO(qmRectifiedMeasuresPO);
        }else{
            return new QmRectifiedMeasuresDTO();
        }
    }
}
