|
|
|
@ -16,11 +16,18 @@
|
|
|
|
|
*/ |
|
|
|
|
package com.logpm.warehouse.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.google.common.eventbus.AllowConcurrentEvents; |
|
|
|
|
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseWarehousingDetailService; |
|
|
|
|
import com.logpm.warehouse.vo.WarehouseWarehousingEntryVO; |
|
|
|
|
import com.logpm.warehouse.excel.WarehouseWarehousingEntryExcel; |
|
|
|
|
import com.logpm.warehouse.mapper.WarehouseWarehousingEntryMapper; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseWarehousingEntryService; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -33,8 +40,10 @@ import java.util.List;
|
|
|
|
|
* @author BladeX |
|
|
|
|
* @since 2023-07-10 |
|
|
|
|
*/ |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@Service |
|
|
|
|
public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<WarehouseWarehousingEntryMapper, WarehouseWarehousingEntryEntity> implements IWarehouseWarehousingEntryService { |
|
|
|
|
private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<WarehouseWarehousingEntryVO> selectWarehouseWarehousingEntryPage(IPage<WarehouseWarehousingEntryVO> page, WarehouseWarehousingEntryVO warehouseWarehousingEntry) { |
|
|
|
@ -51,4 +60,26 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
return warehouseWarehousingEntryList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean saveOrUpdateOwn(WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO) { |
|
|
|
|
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList(); |
|
|
|
|
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity(); |
|
|
|
|
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry); |
|
|
|
|
if(ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())){ |
|
|
|
|
//修改
|
|
|
|
|
this.updateById(warehouseWarehousingEntry); |
|
|
|
|
}else{ |
|
|
|
|
//添加
|
|
|
|
|
warehouseWarehousingEntry.setSource("添加"); |
|
|
|
|
warehouseWarehousingEntry.setConditions("1"); |
|
|
|
|
this.save(warehouseWarehousingEntry); |
|
|
|
|
} |
|
|
|
|
//添加入库明细
|
|
|
|
|
list.forEach(i -> |
|
|
|
|
i.setWarehousingEntryId(warehouseWarehousingEntry.getId()) |
|
|
|
|
); |
|
|
|
|
warehouseWarehousingDetailService.saveBatch(list); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|