|
|
|
@ -8,15 +8,17 @@ import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
import org.dromara.wms.domain.ErpProjectInfo;
|
|
|
|
import org.dromara.wms.domain.*;
|
|
|
|
import org.dromara.wms.domain.WmsBaseProduct;
|
|
|
|
|
|
|
|
import org.dromara.wms.domain.WmsSampleLedger;
|
|
|
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsSampleLedgerBo;
|
|
|
|
import org.dromara.wms.domain.bo.WmsSampleLedgerBo;
|
|
|
|
import org.dromara.wms.domain.vo.WmsSampleLedgerVo;
|
|
|
|
import org.dromara.wms.domain.vo.WmsSampleLedgerVo;
|
|
|
|
|
|
|
|
import org.dromara.wms.mapper.WmsInventoryDetailsMapper;
|
|
|
|
|
|
|
|
import org.dromara.wms.mapper.WmsInventoryLedgerMapper;
|
|
|
|
import org.dromara.wms.mapper.WmsSampleLedgerMapper;
|
|
|
|
import org.dromara.wms.mapper.WmsSampleLedgerMapper;
|
|
|
|
|
|
|
|
import org.dromara.wms.service.IWmsInventoryDetailsService;
|
|
|
|
import org.dromara.wms.service.IWmsSampleLedgerService;
|
|
|
|
import org.dromara.wms.service.IWmsSampleLedgerService;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
@ -32,6 +34,8 @@ import java.util.Map;
|
|
|
|
public class WmsSampleLedgerServiceImpl implements IWmsSampleLedgerService {
|
|
|
|
public class WmsSampleLedgerServiceImpl implements IWmsSampleLedgerService {
|
|
|
|
|
|
|
|
|
|
|
|
private final WmsSampleLedgerMapper baseMapper;
|
|
|
|
private final WmsSampleLedgerMapper baseMapper;
|
|
|
|
|
|
|
|
private final IWmsInventoryDetailsService inventoryDetailsService;
|
|
|
|
|
|
|
|
private final WmsInventoryLedgerMapper wmsInventoryLedgerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询样品管理
|
|
|
|
* 查询样品管理
|
|
|
|
@ -100,6 +104,24 @@ public class WmsSampleLedgerServiceImpl implements IWmsSampleLedgerService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Boolean insertByBo(List<WmsSampleLedger> bo) {
|
|
|
|
public Boolean insertByBo(List<WmsSampleLedger> bo) {
|
|
|
|
|
|
|
|
List<WmsInventoryLedger> wmsInventoryLedgers = new ArrayList<>(bo.size());
|
|
|
|
|
|
|
|
bo.forEach(item -> {
|
|
|
|
|
|
|
|
Long inventoryId = item.getInventoryDetailsId();
|
|
|
|
|
|
|
|
Double lentQty = item.getLentQty();
|
|
|
|
|
|
|
|
Double inventoryAmount = inventoryDetailsService.workUpdateInventory(inventoryId, lentQty);
|
|
|
|
|
|
|
|
//库存变动
|
|
|
|
|
|
|
|
WmsInventoryLedger wmsInventoryLedger = new WmsInventoryLedger();
|
|
|
|
|
|
|
|
wmsInventoryLedger.setWarehouseId(item.getWarehouseId());
|
|
|
|
|
|
|
|
wmsInventoryLedger.setBatchNumber(item.getBatchNumber());
|
|
|
|
|
|
|
|
wmsInventoryLedger.setMaterielId(item.getMaterielId());
|
|
|
|
|
|
|
|
wmsInventoryLedger.setChangeType("4");//变动类型
|
|
|
|
|
|
|
|
wmsInventoryLedger.setLedgerState("0");
|
|
|
|
|
|
|
|
wmsInventoryLedger.setChangeAmount(lentQty);
|
|
|
|
|
|
|
|
wmsInventoryLedger.setInventoryAmount(inventoryAmount);
|
|
|
|
|
|
|
|
wmsInventoryLedgers.add(wmsInventoryLedger);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wmsInventoryLedgerMapper.insert(wmsInventoryLedgers);
|
|
|
|
baseMapper.insert(bo);
|
|
|
|
baseMapper.insert(bo);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|