| | |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpClinicWarehousingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.*; |
| | |
| | | @Resource |
| | | private TErpGoodsTypeMapper erpGoodsTypeMapper; |
| | | |
| | | @Resource |
| | | private TErpMaintenanceReminderMapper erpMaintenanceReminderMapper; |
| | | |
| | | @Resource |
| | | private TCrmSupplierMapper crmSupplierMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | TErpClinicWarehousing tErpSupplierWarehousing = erpClinicWarehousingMapper.selectById(tErpSupplierInventoryGood.getWarehousingId()); |
| | | String goodsId = tErpSupplierInventoryGood.getGoodsId(); |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | |
| | | if(goods.getGoodsSource()==1){ |
| | | TCrmSupplier supplier = crmSupplierMapper.selectById(goods.getSupplierClinicId()); |
| | | if(supplier!=null){ |
| | | inventoryDetailVo.setSupplierName(supplier.getSupplierName()); |
| | | } |
| | | }else { |
| | | inventoryDetailVo.setSupplierName(goods.getSupplierName()); |
| | | } |
| | | |
| | | inventoryDetailVo.setGoodsName(goods.getGoodsName()); |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId()); |
| | | inventoryDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | |
| | | TErpClinicWarehousing tErpSupplierWarehousing = erpClinicWarehousingMapper.selectById(warehousingId); |
| | | String goodsId = tErpSupplierInventoryGood.getGoodsId(); |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | if(goods.getGoodsSource()==1){ |
| | | TCrmSupplier supplier = crmSupplierMapper.selectById(goods.getSupplierClinicId()); |
| | | if(supplier!=null){ |
| | | inventoryDetailVo.setSupplierName(supplier.getSupplierName()); |
| | | } |
| | | }else { |
| | | inventoryDetailVo.setSupplierName(goods.getSupplierName()); |
| | | } |
| | | |
| | | inventoryDetailVo.setGoodsName(goods.getGoodsName()); |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId()); |
| | | inventoryDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | |
| | | tErpClinicWarehousingBatch.setPurchaseCount(dto.getPurchaseCount()); |
| | | erpClinicWarehousingBatchMapper.insert(tErpClinicWarehousingBatch); |
| | | |
| | | |
| | | if(goods.getMaintenanceInterval()!=null){ |
| | | TErpMaintenanceReminder tErpMaintenanceReminder = new TErpMaintenanceReminder(); |
| | | tErpMaintenanceReminder.setClinicSupplierId(supplierClinicId); |
| | | tErpMaintenanceReminder.setMaintenanceType(2); |
| | | tErpMaintenanceReminder.setWarehousingBatchId(tErpClinicWarehousingBatch.getId()); |
| | | Integer day = Integer.valueOf(goods.getMaintenanceInterval()); |
| | | // 当前时间+day天 |
| | | LocalDateTime time1 = LocalDateTime.now().plusDays(day); |
| | | tErpMaintenanceReminder.setMaintenanceTime(time1); |
| | | erpMaintenanceReminderMapper.insert(tErpMaintenanceReminder); |
| | | } |
| | | |
| | | |
| | | totalPrice = totalPrice.add(dto.getSalesAmount().multiply(new BigDecimal(dto.getPurchaseCount()))); |
| | | } |
| | | tErpClinicWarehousing.setTotalPrice(totalPrice); |