package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.Dksq;
import com.ruoyi.system.domain.DksqLcjl;
import com.ruoyi.system.mapper.DksqLcjlMapper;
import com.ruoyi.system.mapper.DksqMapper;
import com.ruoyi.system.service.IDkCommonServerce;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author: tjf
 * @Date: 2023/6/15 15:32
 * @Describe:
 */
public class DkCommonServerceImpl implements IDkCommonServerce {

    @Autowired
    private DksqMapper dksqMapper;
    @Autowired
    private DksqLcjlMapper dksqLcjlMapper;

    /**
     * 劳动局审核
     * @param dksq
     * @return
     */
    @Override
    public AjaxResult shenHe(Dksq dksq) {
        if (!"1".equals(dksq.getType())){
            return AjaxResult.error("当前项目异常");
        }
        dksq.setType("2");
        dksqMapper.updateDksq(dksq);
        //插入流程记录表
        DksqLcjl dksqLcjl = dksq.getDksqLcjl();
        dksqLcjlMapper.insertDksqLcjl(dksqLcjl);
        return AjaxResult.success();
    }
}
