liujie
2 天以前 294bf52b9e5d844efd17901082d4a1a195572037
诊所erp
11个文件已修改
109 ■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpClinicWarehousingMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpGoodsMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpSupplierWarehousingBatch.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpInventoryQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/OutboundGoodsDetailVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/PageInventoryListVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpClinicWarehousingMapper.java
@@ -24,7 +24,7 @@
    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);
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpGoodsMapper.java
@@ -37,5 +37,7 @@
    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);
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpSupplierWarehousingBatch.java
@@ -54,6 +54,7 @@
    @TableField("expiry_date")
    private LocalDateTime expiryDate;
    @TableField(exist = false)
    private String goodsId;
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpInventoryQuery.java
@@ -18,4 +18,7 @@
    @ApiModelProperty(value = "操作时间  2022-02-02 - 2023-06-06")
    private String time;
    @ApiModelProperty(value = "盘点单号")
    private String inventoryNumber;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java
@@ -183,6 +183,40 @@
                    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);
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -415,6 +415,7 @@
        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());
@@ -429,7 +430,7 @@
            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());
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
@@ -464,6 +464,41 @@
                    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);
ruoyi-system/src/main/java/com/ruoyi/system/vo/OutboundGoodsDetailVo.java
@@ -31,6 +31,9 @@
    @ApiModelProperty(value = "订单号")
    private String orderNumber;
    @ApiModelProperty(value = "出库原因")
    private String outboundReason;
    @ApiModelProperty(value = "出库商品")
    private List<OutboundGoodsDetailNextVo> list;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/PageInventoryListVo.java
@@ -16,6 +16,9 @@
    @ApiModelProperty(value = "盘点id")
    private String id;
    @ApiModelProperty(value = "盘点单号")
    private String inventoryNumber;
    @ApiModelProperty(value = "仓库名称")
ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml
@@ -27,12 +27,14 @@
        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},'%')
@@ -53,7 +55,7 @@
        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
@@ -147,7 +149,7 @@
    <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>
@@ -157,7 +159,7 @@
        <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
ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml
@@ -178,11 +178,11 @@
        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}
@@ -262,11 +262,11 @@
        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
@@ -283,5 +283,8 @@
        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>