package com.zcloud.service.bus.impl;

import com.zcloud.entity.PageData;
import com.zcloud.mapper.dsno2.corp.MaintenanceFlowMapper;
import com.zcloud.service.bus.MaintenanceFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 说明：企业流程日志
 * 作者：limingyu
 * 时间：2023-07-13
 */
@Service
@Transactional //开启事物
public class MaintenanceFlowServiceImpl implements MaintenanceFlowService {
    @Autowired
    private MaintenanceFlowMapper maintenanceFlowMapper;
    /**
     * 新增
     * @param flow
     */
    @Override
    public void save(PageData flow) throws Exception {
        maintenanceFlowMapper.save(flow);
    }

    /**
     * 实施提醒
     * @param pd
     * @return
     */
    @Override
    public List<PageData> implementationReminder(PageData pd)  throws Exception {
        return maintenanceFlowMapper.implementationReminder(pd);
    }

    /**
     * 更新实施提醒次数
     * @param pd2
     */
    @Override
    public void updateReminderCount(PageData pd2) throws Exception {
        maintenanceFlowMapper.updateReminderCount(pd2);
    }

    /**
     * 获取延期审批申请信息
     * @param pd
     */
    @Override
    public List<PageData> getApprovalInfo(PageData pd) throws Exception {
        return maintenanceFlowMapper.getApprovalInfo(pd);
    }

    /**
     * 获取验收报告信息
     * @param pd
     */
    @Override
    public PageData getAccReportInfo(PageData pd) throws Exception {
        return maintenanceFlowMapper.getAccReportInfo(pd);
    }

    /**
     * 存储验收报告照片
     * @param pd
     */
    @Override
    public void updateAccReport(PageData pd) throws Exception {
        maintenanceFlowMapper.updateAccReport(pd);
    }

    /**
     * 存储交付信息
     * @param pd
     */
    @Override
    public void deliveryConfirmation(PageData pd) throws Exception {
        maintenanceFlowMapper.deliverConfirmation(pd);
    }

    /**
     * 获取交付信息
     * @param pd
     * @return
     */
    @Override
    public List<PageData> getDeliveryInfo(PageData pd) throws Exception {
        return maintenanceFlowMapper.getDeliveryInfo(pd);
    }

    /**
     * 项目负责人管理-交付-确认交付
     * @throws Exception
     */
    @Override
    public void confirmedDelivery(PageData pd) throws Exception {
        maintenanceFlowMapper.confirmedDelivery(pd);
    }

    /**
     * 实施人员管理-延期申请确认
     * @throws Exception
     */
    @Override
    public void editApplyExtension(PageData pd) throws Exception {
        maintenanceFlowMapper.editApplyExtension(pd);
    }

    /**
     * 项目负责人管理-延期审批
     * @param pd
     */
    @Override
    public void updateApprovalInfo(PageData pd) throws Exception {
        maintenanceFlowMapper.updateApprovalInfo(pd);
    }
}
