package com.fjhx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjhx.entity.StockJournal;
import com.fjhx.mapper.StockJournalMapper;
import com.fjhx.service.StockJournalService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 * 出入库流水记录 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2022-08-10
 */
@Service
public class StockJournalServiceImpl extends ServiceImpl<StockJournalMapper, StockJournal> implements StockJournalService {

    @Override
    public void add(Integer type, Integer detailsType, Long goodsId, Long warehouseId, BigDecimal changeQuantity, String remarks) {
        StockJournal stockJournal = new StockJournal();
        stockJournal.setType(type);
        stockJournal.setDetailsType(detailsType);
        stockJournal.setGoodsId(goodsId);
        stockJournal.setWarehouseId(warehouseId);
        stockJournal.setChangeQuantity(changeQuantity);
        stockJournal.setRemarks(remarks);
        save(stockJournal);
    }

}
