| | |
| | | import com.ruoyi.system.service.TErpSupplierInventoryGoodsService; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) |
| | | public void inventoryGoods(InventoryDto dto, SysUser user) { |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId = null; |
| | |
| | | tErpSupplierWarehousing.setGoodsId(tErpSupplierWarehousing1.getGoodsId()); |
| | | tErpSupplierWarehousing.setGoodsName(erpGoods.getGoodsName()); |
| | | tErpSupplierWarehousing.setGoodsCount(inventoryGoodsDto.getInventoryCount() - inventoryGoodsDto.getNum()); |
| | | tErpSupplierWarehousing.setUnitAmount(erpGoods.getSalesAmount()); |
| | | tErpSupplierWarehousing.setTotalPrice(erpGoods.getSalesAmount().multiply(new BigDecimal(tErpSupplierWarehousing.getGoodsCount()))); |
| | | tErpSupplierWarehousing.setUnitAmount(tErpSupplierWarehousing1.getUnitAmount()); |
| | | tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousing1.getUnitAmount().multiply(new BigDecimal(tErpSupplierWarehousing.getGoodsCount()))); |
| | | // 当前年月日时分秒 |
| | | String time = DateUtils.dateTimeNow(); |
| | | tErpSupplierWarehousing.setWarehouseNo("G" + time); |
| | |
| | | tErpSupplierOutboundGoods.setWarehousingId(tErpSupplierWarehousing1.getId()); |
| | | tErpSupplierOutboundGoods.setWarehousingBatchId(tErpSupplierWarehousingBatch.getId()); |
| | | tErpSupplierOutboundGoods.setOutboundCount(count); |
| | | tErpSupplierOutboundGoods.setTotalPrice(erpGoods.getSalesAmount().multiply(new BigDecimal(count))); |
| | | tErpSupplierOutboundGoods.setTotalPrice(tErpSupplierWarehousing1.getUnitAmount().multiply(new BigDecimal(count))); |
| | | erpSupplierOutboundGoodsMapper.insert(tErpSupplierOutboundGoods); |
| | | |
| | | |