package com.css.txw.mhzc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.css.ggzc.framework.common.util.gy.GyUtils;
import com.css.ggzc.framework.common.util.object.BeanUtils;
import com.css.ggzc.framework.session.SessionUtils;
import com.css.txw.mhzc.mapper.TxwMhzcQyrzsqjlbMapper;
import com.css.txw.mhzc.pojo.domain.TxwMhzcQyrzsqjlbDO;
import com.css.txw.mhzc.pojo.vo.GetRegisterListReqVO;
import com.css.txw.mhzc.pojo.vo.RegisterCompanySqVO;
import com.css.txw.mhzc.service.TxwMhzcQyrzsqjlbService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
* @author AirlH
* @description 针对表【txw_mhzc_qyrzsqjlb(企业认证申请记录表)】的数据库操作Service实现
* @createDate 2025-09-12 14:27:18
*/
@Service
public class TxwMhzcQyrzsqjlbServiceImpl extends ServiceImpl<TxwMhzcQyrzsqjlbMapper, TxwMhzcQyrzsqjlbDO>
    implements TxwMhzcQyrzsqjlbService {

    @Resource
    private TxwMhzcQyrzsqjlbMapper qyrzsqjlbMapper;

    @Override
    public List<RegisterCompanySqVO> getRegisterList(GetRegisterListReqVO reqVO) {
        List<TxwMhzcQyrzsqjlbDO> registerList = qyrzsqjlbMapper.getRegisterList(reqVO);
        if (GyUtils.isNull(registerList)) return null;
        return BeanUtils.toBean(registerList,RegisterCompanySqVO.class);
    }

    @Override
    public List<RegisterCompanySqVO> getCurrentRegisterList() {
        List<TxwMhzcQyrzsqjlbDO> registerList = qyrzsqjlbMapper.getCurrentRegisterList(SessionUtils.getYhUuid());
        if (GyUtils.isNull(registerList)) return null;
        return BeanUtils.toBean(registerList,RegisterCompanySqVO.class);
    }

    @Override
    public String revokeSq(String uuid) {
        TxwMhzcQyrzsqjlbDO qyrzsqjlbDO = new TxwMhzcQyrzsqjlbDO();
        qyrzsqjlbDO.setUuid(uuid);
        qyrzsqjlbDO.setShjg1("5");
        qyrzsqjlbDO.setShsj(new Date());
        updateById(qyrzsqjlbDO);
        return "success";
    }
}




