package com.yeejoin.amos.boot.module.jg.biz.service.impl;

import com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.service.IBizDataChangeHandleStrategy;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BizDataChangeServiceImpl {

    /**
     * 变更保存
     * @param applyNo 单据编号
     * @param bizType 业务类型
     * @param model   单个维护、批量维护
     * @param changeData 变化后的数据
     */
    public void save(String applyNo,
                     String bizType,
                     IBizDataChangeHandleStrategy.ModelType model,
                     Map<String, List<Map<String, Object>>> changeData) {
        IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType);
        handleStrategy.doSave(applyNo, model, changeData);
    }
}
