| | |
| | | private TErpSupplierWarehousingBatchMapper erpSupplierWarehousingBatchMapper; |
| | | |
| | | @Resource |
| | | private TErpClinicWarehousingBatchMapper erpClinicWarehousingBatchMapper; |
| | | |
| | | @Resource |
| | | private TErpSupplierWarehousingMapper erpSupplierWarehousingMapper; |
| | | |
| | | @Resource |
| | | private TErpClinicOutboundGoodsMapper erpClinicOutboundGoodsMapper; |
| | | |
| | | @Resource |
| | | private TErpSupplierOutboundGoodsMapper erpSupplierOutboundGoodsMapper; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private TCrmClinicMapper crmClinicMapper; |
| | |
| | | |
| | | String warehousingBatchId = tErpMaintenanceReminder.getWarehousingBatchId(); |
| | | if(warehousingBatchId != null){ |
| | | TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = erpSupplierWarehousingBatchMapper.selectById(warehousingBatchId); |
| | | tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); |
| | | TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierWarehousingBatch.getWarehousingId()); |
| | | if(tErpSupplierWarehousing!=null){ |
| | | String goodsId = tErpSupplierWarehousing.getGoodsId(); |
| | | if(goodsId != null){ |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName()); |
| | | tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber()); |
| | | tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode()); |
| | | String packingUnitId = goods.getPackingUnitId(); |
| | | if(packingUnitId != null){ |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId); |
| | | tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | | if(tErpMaintenanceReminder.getMaintenanceType()==2){ |
| | | TErpClinicWarehousingBatch tErpSupplierWarehousingBatch = erpClinicWarehousingBatchMapper.selectById(warehousingBatchId); |
| | | tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); |
| | | String goodsId = tErpSupplierWarehousingBatch.getGoodsId(); |
| | | if(goodsId != null){ |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName()); |
| | | tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber()); |
| | | tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode()); |
| | | String packingUnitId = goods.getPackingUnitId(); |
| | | if(packingUnitId != null){ |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId); |
| | | tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | | } |
| | | } |
| | | List<TErpClinicOutboundGoods> tErpSupplierOutboundGoods = erpClinicOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpClinicOutboundGoods>().eq(TErpClinicOutboundGoods::getWarehousingBatchId, warehousingBatchId)); |
| | | int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpClinicOutboundGoods::getOutboundCount).sum(); |
| | | tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum); |
| | | }else { |
| | | TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = erpSupplierWarehousingBatchMapper.selectById(warehousingBatchId); |
| | | tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); |
| | | TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierWarehousingBatch.getWarehousingId()); |
| | | if(tErpSupplierWarehousing!=null){ |
| | | String goodsId = tErpSupplierWarehousing.getGoodsId(); |
| | | if(goodsId != null){ |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName()); |
| | | tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber()); |
| | | tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode()); |
| | | String packingUnitId = goods.getPackingUnitId(); |
| | | if(packingUnitId != null){ |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId); |
| | | tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | | } |
| | | } |
| | | } |
| | | List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, warehousingBatchId)); |
| | | int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum(); |
| | | tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum); |
| | | } |
| | | List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, warehousingBatchId)); |
| | | int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum(); |
| | | tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum); |
| | | |
| | | |
| | | } |
| | | return tErpMaintenanceReminderDetailVo; |