package com.mvc.service.taizhang;

import com.mvc.dao.StateChangeLogMapper;
import com.mvc.entity.StateChangeLog;
import com.mvc.model.StateChangeLogModel;
import com.mvc.utils.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StateChangeLogService {

    @Autowired
    private StateChangeLogMapper stateChangeLogMapper;

    public StateChangeLogModel saveStateChangeLog(StateChangeLogModel model) {
        model.setStateChangeId(StringUtil.getUuid());
        StateChangeLog log = new StateChangeLog();
        BeanUtils.copyProperties(model,log);
        int insert = stateChangeLogMapper.insert(log);
        model.setId(log.getId());
        return model;
    }
}
