package com.shkj.wms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shkj.common.core.domain.Result;
import com.shkj.wms.domain.BaseBarcodesIn;
import com.shkj.wms.domain.BusinBillbody;
import com.shkj.wms.mapper.BusinBillbodyMapper;
import com.shkj.wms.service.IBusinBillbodyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;

/**
 * 出入库单Service业务层处理
 *
 * @author zjx
 * @date 2023-04-07
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class BusinBillbodyServiceImpl extends ServiceImpl<BusinBillbodyMapper, BusinBillbody> implements IBusinBillbodyService {
    @Autowired
    private BusinBillbodyMapper businBillbodyMapper;

   /* @Override
    public boolean saveBatch(Collection<BusinBillbody> entityList) {
        return this.saveBatch(entityList);
    }*/

    @Override
    public Result<Boolean> insertBusinBillbodIn(BaseBarcodesIn baseBarcodesIn, String transId) {
        BusinBillbody body =new BusinBillbody();
      //  body.setTransId(transId);
        body.setLineId(1);
        body.setGoodsNo(baseBarcodesIn.getGoodsNo());
        body.setQrCode(baseBarcodesIn.getQrCode());
        body.setQty(1);
        body.setUseQty(1);
        this.save(body);
        return Result.ok();
    }


}
