| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.dto.WarehousingGoodsDto; |
| | | import com.ruoyi.system.dto.WarehousingGoodsNextDto; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | |
| | | pageInfo.setRecords( list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void warehousingGoods(List<WarehousingGoodsDto> dtos, SysUser user) { |
| | | for (WarehousingGoodsDto dto : dtos) { |
| | | TErpSupplierWarehousing tErpSupplierWarehousing = new TErpSupplierWarehousing(); |
| | | tErpSupplierWarehousing.setSupplierId(user.getUserId().toString()); |
| | | tErpSupplierWarehousing.setWarehouseId(dto.getWarehouseId()); |
| | | tErpSupplierWarehousing.setGoodsId(dto.getGoodsId()); |
| | | TErpGoods goods = erpGoodsMapper.selectById(dto.getGoodsId()); |
| | | tErpSupplierWarehousing.setGoodsName(goods.getGoodsName()); |
| | | tErpSupplierWarehousing.setGoodsCount(tErpSupplierWarehousing.getGoodsCount()); |
| | | tErpSupplierWarehousing.setUnitAmount(tErpSupplierWarehousing.getUnitAmount()); |
| | | tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousing.getTotalPrice()); |
| | | erpSupplierWarehousingMapper.insert(tErpSupplierWarehousing); |
| | | List<WarehousingGoodsNextDto> warehousingGoodsNextDtos = dto.getWarehousingGoodsNextDtos(); |
| | | for (WarehousingGoodsNextDto warehousingGoodsNextDto : warehousingGoodsNextDtos) { |
| | | TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = new TErpSupplierWarehousingBatch(); |
| | | tErpSupplierWarehousingBatch.setWarehousingId(tErpSupplierWarehousing.getId()); |
| | | tErpSupplierWarehousingBatch.setWarehousingNumber(warehousingGoodsNextDto.getWarehousingNum()); |
| | | tErpSupplierWarehousingBatch.setBatchNumber(warehousingGoodsNextDto.getBatchNumber()); |
| | | tErpSupplierWarehousingBatch.setProductionDate(warehousingGoodsNextDto.getProductionDate().atStartOfDay()); |
| | | tErpSupplierWarehousingBatch.setExpiryDate(warehousingGoodsNextDto.getExpiryDate().atStartOfDay()); |
| | | erpSupplierWarehousingBatchMapper.insert(tErpSupplierWarehousingBatch); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |