package com.xiaoniu.subsystem.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoniu.common.core.constant.Constants;
import com.xiaoniu.subsystem.business.domain.WaitDone;
import com.xiaoniu.subsystem.business.domain.dto.AddWaitDoneDTO;
import com.xiaoniu.subsystem.business.mapper.WaitDoneMapper;
import com.xiaoniu.subsystem.business.service.IWaitDoneService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.Date;

import static com.xiaoniu.common.security.utils.SecurityUtils.getUnitId;

/**
 * <p>
 * 待办管理表 服务实现类
 * </p>
 *
 * @author haoxuyang
 * @since 2024-12-03 01:56:51
 */
@Service
public class WaitDoneServiceImpl extends ServiceImpl<WaitDoneMapper, WaitDone> implements IWaitDoneService {

    @Override
    public boolean insertWaitDone(AddWaitDoneDTO dto) {
        WaitDone waitDone = new WaitDone();
        BeanUtils.copyProperties(dto, waitDone);
        waitDone.setCreateDept(getUnitId());
        waitDone.setIsDeleted(Constants.ZERO);
        waitDone.setStatus(Constants.ZERO);
        int count = baseMapper.insert(waitDone);
        return count > 0;
    }
}
