package com.consum.base.service;
|
|
import com.consum.base.core.utils.IdUtil;
|
import com.consum.model.po.LWhFormInventoryGoods;
|
import com.walker.jdbc.service.BaseServiceImpl;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @Description 盘点单物品
|
* @Author 卢庆阳
|
* @Date 2023/10/31
|
*/
|
@Slf4j
|
@Service
|
public class LWhFormInventoryGoodsServiceImpl extends BaseServiceImpl {
|
|
/**
|
* @Description 根据盘点单id查询盘点单物品
|
* @Author 卢庆阳
|
* @Date 2023/10/31
|
* @return
|
*/
|
public List<LWhFormInventoryGoods> getByInventoryId(Long id) {
|
LWhFormInventoryGoods inventoryGoods = new LWhFormInventoryGoods();
|
inventoryGoods.setWhFormInventoryId(id);
|
return this.select(inventoryGoods);
|
}
|
|
/**
|
* @Description 新增盘点单物品记录
|
* @Author 卢庆阳
|
* @Date 2023/10/31
|
* @return
|
*/
|
public int add(List<Map<String, Object>> list, Long warehouseId) {
|
List<LWhFormInventoryGoods> inventoryGoodsList = new ArrayList<>();
|
for (Map<String, Object> map : list) {
|
LWhFormInventoryGoods inventoryGoods = new LWhFormInventoryGoods();
|
inventoryGoods.setId(IdUtil.generateId());
|
inventoryGoods.setWhFormInventoryId(warehouseId);
|
inventoryGoods.setBaseGoodsTemplateId((Long) map.get("id"));
|
inventoryGoods.setGoodsTemplateName((String) map.get("goodsname"));
|
inventoryGoods.setUnit((String) map.get("unit"));
|
inventoryGoods.setBaseGoodsModelsId((Long) map.get("modelsid"));
|
inventoryGoods.setBaseGoodsModelsName((String) map.get("goodsTemplateId"));
|
inventoryGoods.setInitCounts((Integer) map.get("endcount"));
|
|
inventoryGoodsList.add(inventoryGoods);
|
}
|
return this.insert(inventoryGoodsList);
|
}
|
|
/**
|
* @Description 根据盘点单id删除盘点单物品
|
* @Author 卢庆阳
|
* @Date 2023/10/31
|
*/
|
public void delByFormInventoryId(Long id) {
|
|
}
|
}
|