| | |
| | | List<PageInventoryListVo> pageInventoryList(@Param("pageInfo") PageInfo<PageInventoryListVo> pageInfo, @Param("query") TErpInventoryQuery query, @Param("user") SysUser user, @Param("sTime") String sTime, @Param("eTime") String eTime, @Param("supplierClinicId") String supplierClinicId); |
| | | |
| | | |
| | | PageInfo<ValidityPeriodWarningVo> validityPeriodWarning(@Param("pageInfo") PageInfo<ValidityPeriodWarningVo> pageInfo, @Param("query") ValidityPeriodWarningQuery query, @Param("user") SysUser user, @Param("nineMonthLater") LocalDateTime nineMonthLater, @Param("supplierClinicId") String supplierClinicId); |
| | | PageInfo<ValidityPeriodWarningVo> validityPeriodWarning(@Param("pageInfo") PageInfo<ValidityPeriodWarningVo> pageInfo, @Param("query") ValidityPeriodWarningQuery query, @Param("user") SysUser user, @Param("time") LocalDateTime nineMonthLater, @Param("supplierClinicId") String supplierClinicId); |
| | | |
| | | |
| | | List<TErpGoodsVO> pageList(@Param("query") TErpGoodsQuery query, @Param("pageInfo") PageInfo<TErpGoodsVO> pageInfo, @Param("user") SysUser user); |
| | |
| | | List<TErpGoodsInventoryVO> pageInventoryGoodsPageList1(@Param("query") TErpGoodsInventoryQuery query, @Param("pageInfo") PageInfo<TErpGoodsInventoryVO> pageInfo, @Param("user") SysUser user, @Param("supplierClinicId") String supplierClinicId, @Param("endDate") Date endDate); |
| | | |
| | | |
| | | TErpGoods getGoodsById(@Param("goodsId") String goodsId); |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("expiry_date") |
| | | private LocalDateTime expiryDate; |
| | | |
| | | @TableField(exist = false) |
| | | private String goodsId; |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "操作时间 2022-02-02 - 2023-06-06") |
| | | private String time; |
| | | |
| | | @ApiModelProperty(value = "盘点单号") |
| | | private String inventoryNumber; |
| | | |
| | | } |
| | |
| | | inventoryDetailVo.setInventoryCount(tErpSupplierInventoryGood.getInventoryCount()); |
| | | inventoryDetailVo.setInventoryType(tErpSupplierInventoryGood.getInventoryType()); |
| | | inventoryDetailVo.setDamagedCount(tErpSupplierInventoryGood.getDamagedCount()); |
| | | }else { |
| | | TErpClinicOutbound tErpSupplierOutbound = erpClinicOutboundMapper.selectById(tErpSupplierInventoryGood.getWarehousingId()); |
| | | List<TErpClinicOutboundGoods> tErpSupplierOutboundGoods = erpClinicOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpClinicOutboundGoods>().eq(TErpClinicOutboundGoods::getOutboundId, tErpSupplierOutbound.getId())); |
| | | for (TErpClinicOutboundGoods tErpSupplierOutboundGood : tErpSupplierOutboundGoods) { |
| | | String warehousingId = tErpSupplierOutboundGood.getWarehousingId(); |
| | | TErpClinicWarehousing tErpSupplierWarehousing = erpClinicWarehousingMapper.selectById(warehousingId); |
| | | String goodsId = tErpSupplierInventoryGood.getGoodsId(); |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | inventoryDetailVo.setGoodsName(goods.getGoodsName()); |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId()); |
| | | inventoryDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | | inventoryDetailVo.setWarehouseNo(tErpSupplierWarehousing.getWarehouseNo()); |
| | | TErpClinicOutboundGoods outboundGoods = erpClinicOutboundGoodsMapper.selectById(tErpSupplierInventoryGood.getWarehousingBatchId()); |
| | | |
| | | TErpClinicWarehousingBatch tErpSupplierWarehousingBatch = erpClinicWarehousingBatchMapper.selectById(outboundGoods.getWarehousingBatchId()); |
| | | inventoryDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); |
| | | |
| | | |
| | | List<TErpClinicWarehousingBatch> tErpSupplierWarehousingBatches = erpClinicWarehousingBatchMapper.selectList(new LambdaQueryWrapper<TErpClinicWarehousingBatch>().eq(TErpClinicWarehousingBatch::getBatchNumber, tErpSupplierWarehousingBatch.getBatchNumber())); |
| | | int sum = tErpSupplierWarehousingBatches.stream().mapToInt(TErpClinicWarehousingBatch::getWarehousingNumber).sum(); |
| | | List<String> collect = tErpSupplierWarehousingBatches.stream().map(TErpClinicWarehousingBatch::getId).collect(Collectors.toList()); |
| | | if(!collect.isEmpty()){ |
| | | List<TErpClinicOutboundGoods> tErpSupplierOutboundGoods1 = erpClinicOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpClinicOutboundGoods>().eq(TErpClinicOutboundGoods::getWarehousingBatchId, collect)); |
| | | int sum1 = tErpSupplierOutboundGoods1.stream().mapToInt(TErpClinicOutboundGoods::getOutboundCount).sum(); |
| | | sum = sum-sum1; |
| | | } |
| | | |
| | | // sum = 剩余库存 |
| | | inventoryDetailVo.setNowCount(sum); |
| | | inventoryDetailVo.setInventoryCount(tErpSupplierInventoryGood.getInventoryCount()); |
| | | inventoryDetailVo.setInventoryType(tErpSupplierInventoryGood.getInventoryType()); |
| | | inventoryDetailVo.setDamagedCount(tErpSupplierInventoryGood.getDamagedCount()); |
| | | } |
| | | |
| | | } |
| | | inventoryDetailVos.add(inventoryDetailVo); |
| | | |
| | |
| | | outboundGoodsDetailVo.setCreateBy(tErpClinicOutbound.getCreateBy()); |
| | | outboundGoodsDetailVo.setOutboundType(tErpClinicOutbound.getOutboundType()); |
| | | outboundGoodsDetailVo.setOrderNumber(tErpClinicOutbound.getOrderNumber()); |
| | | outboundGoodsDetailVo.setOutboundReason(tErpClinicOutbound.getOutboundReason()); |
| | | if(tErpClinicOutbound.getOutboundType()==6){ |
| | | TErpClinicInventory tErpClinicInventory = erpClinicInventoryMapper.selectById(tErpClinicOutbound.getInventoryId()); |
| | | outboundGoodsDetailVo.setInventoryNumber(tErpClinicInventory.getInventoryNumber()); |
| | |
| | | outboundGoodsDetailNextVo.setWarehouseNo(tErpClinicWarehousing.getWarehouseNo()); |
| | | |
| | | outboundGoodsDetailNextVo.setGoodsId(outboundGoods.getGoodsId()); |
| | | TErpGoods goods = erpGoodsMapper.selectById(outboundGoods.getGoodsId()); |
| | | TErpGoods goods = erpGoodsMapper.getGoodsById(outboundGoods.getGoodsId()); |
| | | outboundGoodsDetailNextVo.setGoodsName(goods.getGoodsName()); |
| | | |
| | | outboundGoodsDetailNextVo.setTypeId(goods.getTypeId()); |
| | |
| | | inventoryDetailVo.setInventoryCount(tErpSupplierInventoryGood.getInventoryCount()); |
| | | inventoryDetailVo.setInventoryType(tErpSupplierInventoryGood.getInventoryType()); |
| | | inventoryDetailVo.setDamagedCount(tErpSupplierInventoryGood.getDamagedCount()); |
| | | }else { |
| | | TErpSupplierOutbound tErpSupplierOutbound = erpSupplierOutboundMapper.selectById(tErpSupplierInventoryGood.getWarehousingId()); |
| | | List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getOutboundId, tErpSupplierOutbound.getId())); |
| | | for (TErpSupplierOutboundGoods tErpSupplierOutboundGood : tErpSupplierOutboundGoods) { |
| | | String warehousingId = tErpSupplierOutboundGood.getWarehousingId(); |
| | | TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(warehousingId); |
| | | String goodsId = tErpSupplierWarehousing.getGoodsId(); |
| | | TErpGoods goods = erpGoodsMapper.selectById(goodsId); |
| | | inventoryDetailVo.setGoodsName(goods.getGoodsName()); |
| | | TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId()); |
| | | inventoryDetailVo.setUnitName(tErpGoodsUnit.getUnitName()); |
| | | inventoryDetailVo.setWarehouseNo(tErpSupplierWarehousing.getWarehouseNo()); |
| | | |
| | | TErpSupplierOutboundGoods tErpSupplierOutboundGoods2 = erpSupplierOutboundGoodsMapper.selectById(tErpSupplierInventoryGood.getWarehousingBatchId()); |
| | | |
| | | TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = erpSupplierWarehousingBatchMapper.selectById(tErpSupplierOutboundGoods2.getWarehousingBatchId()); |
| | | inventoryDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); |
| | | |
| | | |
| | | List<TErpSupplierWarehousingBatch> tErpSupplierWarehousingBatches = erpSupplierWarehousingBatchMapper.selectList(new LambdaQueryWrapper<TErpSupplierWarehousingBatch>().eq(TErpSupplierWarehousingBatch::getBatchNumber, tErpSupplierWarehousingBatch.getBatchNumber())); |
| | | int sum = tErpSupplierWarehousingBatches.stream().mapToInt(TErpSupplierWarehousingBatch::getWarehousingNumber).sum(); |
| | | List<String> collect = tErpSupplierWarehousingBatches.stream().map(TErpSupplierWarehousingBatch::getId).collect(Collectors.toList()); |
| | | if(!collect.isEmpty()){ |
| | | List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods1 = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, collect)); |
| | | int sum1 = tErpSupplierOutboundGoods1.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum(); |
| | | sum = sum-sum1; |
| | | } |
| | | |
| | | // sum = 剩余库存 |
| | | inventoryDetailVo.setNowCount(sum); |
| | | inventoryDetailVo.setInventoryCount(tErpSupplierInventoryGood.getInventoryCount()); |
| | | inventoryDetailVo.setInventoryType(tErpSupplierInventoryGood.getInventoryType()); |
| | | inventoryDetailVo.setDamagedCount(tErpSupplierInventoryGood.getDamagedCount()); |
| | | } |
| | | |
| | | } |
| | | inventoryDetailVos.add(inventoryDetailVo); |
| | | |
| | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty(value = "出库原因") |
| | | private String outboundReason; |
| | | |
| | | @ApiModelProperty(value = "出库商品") |
| | | private List<OutboundGoodsDetailNextVo> list; |
| | | } |
| | |
| | | @ApiModelProperty(value = "盘点id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "盘点单号") |
| | | private String inventoryNumber; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "仓库名称") |
| | |
| | | id, procurement_id, clinic_id, goods_id, goods_name, supplier_name, quasi_number, sales_amount, purchase_count, total_price, warehousing_type, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageInventoryList" resultType="com.ruoyi.system.vo.PageInventoryListVo"> |
| | | select t1.id,t1.create_time,t2.user_name createBy,t3.warehouse_name |
| | | select t1.id,t1.create_time,t2.user_name createBy,t1.inventory_number |
| | | from t_erp_clinic_inventory t1 left join sys_user t2 on t1.create_id = t2.user_id |
| | | left join t_crm_warehouse t3 on t1.warehouse_id =t3.id |
| | | where t1.disabled = 0 |
| | | <if test="user.roleType !=null and user.roleType ==5"> |
| | | and t1.clinic_id = #{supplierClinicId} |
| | | </if> |
| | | <if test="query.inventoryNumber !=null and query.inventoryNumber !=''"> |
| | | and t1.inventory_number like concat('%',#{query.inventoryNumber},'%') |
| | | </if> |
| | | <if test="query.createBy != null and query.createBy != ''"> |
| | | and t2.user_name like concat('%',#{query.createBy},'%') |
| | |
| | | from t_erp_clinic_warehousing_batch t1 |
| | | left join t_erp_clinic_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_clinic_outbound_goods t3 on t3.warehousing_batch_id = t1.id |
| | | LEFT JOIN t_erp_goods t4 on t2.goods_id = t4.id |
| | | LEFT JOIN t_erp_goods t4 on t1.goods_id = t4.id |
| | | left join t_erp_goods_type t5 on t4.type_id = t5.id |
| | | left join t_erp_goods_unit t6 on t4.packing_unit_id = t6.id |
| | | where #{time} > t1.expiry_date |
| | |
| | | <select id="outboundPageList" resultType="com.ruoyi.system.vo.TErpClinicOutboundPageListVO"> |
| | | select t1.id,t1.outbound_number,t1.order_number,t1.total_money allTotalPrice,t1.create_time ,t1.outbound_type,t2.user_name,t1.type_num |
| | | from t_erp_clinic_outbound t1 left join sys_user t2 on t1.create_by = t2.user_id |
| | | where t1.disabled = 0 and t1.clinic_id = #{query.supplierClinicId} |
| | | where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId} |
| | | <if test="query.outboundNumber != null and query.outboundNumber != ''"> |
| | | and t1.outbound_number like concat('%',#{query.outboundNumber},'%') |
| | | </if> |
| | |
| | | <if test="query.userName != null and query.userName !=''"> |
| | | and t2.user_name like concat('%',#{query.userName},'%') |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="query.type != null"> |
| | | and t1.outbound_type = #{query.type} |
| | | </if> |
| | | order by t1.create_time desc |
| | |
| | | t1.warehousing_number, |
| | | t2.create_time, |
| | | t1.warehousing_number - coalesce(sum(t5.outbound_count),0) as num, |
| | | t2.unit_amount as sales_amount, |
| | | t1.unit_amount as sales_amount, |
| | | t1.expiry_date |
| | | from t_erp_clinic_warehousing_batch t1 |
| | | LEFT JOIN t_erp_clinic_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_goods t3 on t2.goods_id = t3.id |
| | | LEFT JOIN t_erp_goods t3 on t1.goods_id = t3.id |
| | | LEFT JOIN t_crm_supplier t4 on t3.supplier_clinic_id = t4.id |
| | | LEFT JOIN t_erp_clinic_outbound_goods t5 on t5.warehousing_batch_id =t1.id |
| | | where t2.disabled = 0 and t2.clinic_id =#{supplierClinicId} |
| | |
| | | t1.warehousing_number, |
| | | t2.create_time, |
| | | t1.warehousing_number - coalesce(sum(t5.outbound_count),0) as num, |
| | | t2.unit_amount as sales_amount, |
| | | t1.unit_amount as sales_amount, |
| | | t1.expiry_date |
| | | from t_erp_clinic_warehousing_batch t1 |
| | | LEFT JOIN t_erp_clinic_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_goods t3 on t2.goods_id = t3.id |
| | | LEFT JOIN t_erp_goods t3 on t1.goods_id = t3.id |
| | | LEFT JOIN t_crm_supplier t4 on t3.supplier_clinic_id = t4.id |
| | | LEFT JOIN t_erp_supplier_outbound_goods t5 on t5.warehousing_batch_id =t1.id |
| | | where t2.disabled = 0 |
| | |
| | | where (o.warehousing_number -o.outbound_count) >0 |
| | | order by o.create_time desc |
| | | </select> |
| | | <select id="getGoodsById" resultType="com.ruoyi.system.model.TErpGoods"> |
| | | select <include refid="Base_Column_List"/> from t_erp_goods where id = #{goodsId} |
| | | </select> |
| | | |
| | | </mapper> |