liujie
2025-10-27 44942c987afba6cb40445e269051c61eabd3ab22
修改bug
6个文件已修改
74 ■■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/InventoryDetailVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java
@@ -221,7 +221,7 @@
                        inventoryDetailVo.setGoodsName(goods.getGoodsName());
                        TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId());
                        if(tErpGoodsUnit!=null){
                        if (tErpGoodsUnit != null) {
                            inventoryDetailVo.setUnitName(tErpGoodsUnit.getUnitName());
                        }
                        inventoryDetailVo.setWarehouseNo(tErpSupplierWarehousing.getWarehouseNo());
@@ -250,6 +250,11 @@
                }
                inventoryDetailVos.add(inventoryDetailVo);
            }
            for (InventoryDetailVo inventoryDetailVo : inventoryDetailVos) {
                if(inventoryDetailVo.getNowCount().equals(inventoryDetailVo.getInventoryCount())){
                    inventoryDetailVo.setInventoryType(3);
                }
            }
            return inventoryDetailVos;
@@ -309,7 +314,7 @@
        if (!supplierIds.isEmpty()) {
            List<TCrmSupplier> supplierClinicList = crmSupplierMapper.selectBatchIds(supplierIds);
            for (TErpGoodsVO tErpGoodsVO : list) {
                supplierClinicList.stream().filter(t -> tErpGoodsVO.getGoodsSource()==1 && t.getId().equals(tErpGoodsVO.getSupplierClinicId())).findFirst().ifPresent(t -> tErpGoodsVO.setSupplierName(t.getSupplierName()));
                supplierClinicList.stream().filter(t -> tErpGoodsVO.getGoodsSource() == 1 && t.getId().equals(tErpGoodsVO.getSupplierClinicId())).findFirst().ifPresent(t -> tErpGoodsVO.setSupplierName(t.getSupplierName()));
            }
        }
        pageInfo.setRecords(list);
@@ -385,9 +390,9 @@
//        Map<String, List<clinicWarehouseGoodsDto>> collect = dtos.stream().collect(Collectors.groupingBy(clinicWarehouseGoodsDto::getSupplierId));
//        for (Map.Entry<String, List<clinicWarehouseGoodsDto>> stringListEntry : collect.entrySet()) {
        if(dtos.getStatus()==null || dtos.getStatus()!=1 ){
        if (dtos.getStatus() == null || dtos.getStatus() != 1) {
            // 草稿-》正式 移除所有草稿
            this.baseMapper.delete(new LambdaQueryWrapper<TErpClinicWarehousing>().eq(TErpClinicWarehousing::getClinicId,supplierClinicId).eq(TErpClinicWarehousing::getStatus,1));
            this.baseMapper.delete(new LambdaQueryWrapper<TErpClinicWarehousing>().eq(TErpClinicWarehousing::getClinicId, supplierClinicId).eq(TErpClinicWarehousing::getStatus, 1));
        }
@@ -396,9 +401,9 @@
        tErpClinicWarehousing.setCreateId(user.getUserId().toString());
        TErpClinicWarehousing last = this.getOne(new LambdaQueryWrapper<TErpClinicWarehousing>().orderByDesc(BaseModel::getCreateTime).orderByDesc(TErpClinicWarehousing::getWarehouseNo).last("LIMIT 1"));
        if(last==null){
            tErpClinicWarehousing.setWarehouseNo("G" + DateUtils.dateTimeNow()+"00001");
        }else{
        if (last == null) {
            tErpClinicWarehousing.setWarehouseNo("G" + DateUtils.dateTimeNow() + "00001");
        } else {
            String lastProcurementCode = last.getWarehouseNo();
            String datePart = "G" + DateUtils.dateTimeNow();
@@ -423,12 +428,10 @@
        tErpClinicWarehousing.setWarehousingType(2);
        try {
            this.save(tErpClinicWarehousing);
        }catch (Exception e){
        } catch (Exception e) {
            throw new RuntimeException("网络繁忙,请重试");
        }
        BigDecimal totalPrice = new BigDecimal(0);
        ArrayList<String> names = new ArrayList<>();
        for (clinicWarehouseGoodsDto dto : dtos.getDtos()) {
@@ -436,8 +439,12 @@
            tErpClinicWarehousingBatch.setWarehousingId(tErpClinicWarehousing.getId());
            tErpClinicWarehousingBatch.setWarehousingNumber(dto.getPurchaseCount());
            tErpClinicWarehousingBatch.setBatchNumber(dto.getBatchNumber());
            tErpClinicWarehousingBatch.setProductionDate(dto.getProductionDate().atStartOfDay());
            tErpClinicWarehousingBatch.setExpiryDate(dto.getExpiryDate().atStartOfDay());
            if(dto.getProductionDate()!= null){
                tErpClinicWarehousingBatch.setProductionDate(dto.getProductionDate().atStartOfDay());
            }
            if(dto.getExpiryDate()!=null){
                tErpClinicWarehousingBatch.setExpiryDate(dto.getExpiryDate().atStartOfDay());
            }
            tErpClinicWarehousingBatch.setGoodsId(dto.getId());
            TErpGoods goods = erpGoodsMapper.selectById(dto.getId());
            String supplierName = goods.getSupplierName();
@@ -453,7 +460,7 @@
            erpClinicWarehousingBatchMapper.insert(tErpClinicWarehousingBatch);
            if (goods.getMaintenanceInterval() != null && !goods.getMaintenanceInterval().isEmpty()) {
            if (goods.getMaintenanceInterval() != null && !goods.getMaintenanceInterval().isEmpty() && (dtos.getStatus()==null || dtos.getStatus() != 1)) {
                TErpMaintenanceReminder tErpMaintenanceReminder = new TErpMaintenanceReminder();
                tErpMaintenanceReminder.setClinicSupplierId(supplierClinicId);
                tErpMaintenanceReminder.setMaintenanceType(2);
@@ -465,13 +472,15 @@
                erpMaintenanceReminderMapper.insert(tErpMaintenanceReminder);
            }
            totalPrice = totalPrice.add(dto.getUnitAmount().multiply(new BigDecimal(dto.getPurchaseCount())));
            if(dto.getUnitAmount()!=null && dto.getPurchaseCount()!=null){
                totalPrice = totalPrice.add(dto.getUnitAmount().multiply(new BigDecimal(dto.getPurchaseCount())));
            }
        }
        tErpClinicWarehousing.setTotalPrice(totalPrice);
        String name = names.stream().collect(Collectors.joining(","));
        tErpClinicWarehousing.setSupplierName(name);
        this.updateById(tErpClinicWarehousing);
//        }
@@ -484,9 +493,9 @@
        tErpClinicOutbound.setClinicId(supplierClinicId);
        tErpClinicOutbound.setCreateId(user.getUserId().toString());
        TErpClinicOutbound last = erpClinicOutboundMapper.selectOne(new LambdaQueryWrapper<TErpClinicOutbound>().orderByDesc(BaseModel::getCreateTime).orderByDesc(TErpClinicOutbound::getOutboundNumber).last("limit 1"));
        if(last==null){
            tErpClinicOutbound.setOutboundNumber("G" + DateUtils.dateTimeNow()+"00001");
        }else{
        if (last == null) {
            tErpClinicOutbound.setOutboundNumber("G" + DateUtils.dateTimeNow() + "00001");
        } else {
            String lastProcurementCode = last.getOutboundNumber();
            String datePart = "G" + DateUtils.dateTimeNow();
@@ -513,7 +522,7 @@
        tErpClinicOutbound.setTypeNum(dto.getTypeNum());
        try {
            erpClinicOutboundMapper.insert(tErpClinicOutbound);
        }catch (Exception e){
        } catch (Exception e) {
            throw new RuntimeException("网络繁忙,请重试");
        }
@@ -527,9 +536,9 @@
            tErpClinicOutboundGoods1.setWarehousingId(tErpClinicWarehousingBatch.getWarehousingId());
            tErpClinicOutboundGoods1.setWarehousingBatchId(batchId);
            tErpClinicOutboundGoods1.setOutboundCount(outboundGoodsNextDto.getNum());
            if(tErpClinicWarehousingBatch.getUnitAmount()==null){
            if (tErpClinicWarehousingBatch.getUnitAmount() == null) {
                tErpClinicOutboundGoods1.setTotalPrice(tErpClinicWarehousingBatch.getSalesAmount().multiply(BigDecimal.valueOf(outboundGoodsNextDto.getNum())));
            }else {
            } else {
                tErpClinicOutboundGoods1.setTotalPrice(tErpClinicWarehousingBatch.getUnitAmount().multiply(BigDecimal.valueOf(outboundGoodsNextDto.getNum())));
            }
            tErpClinicOutboundGoods1.setGoodsId(tErpClinicWarehousingBatch.getGoodsId());
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -539,6 +539,7 @@
            supplierClinicId =crmClinic.getId();
        }
        TErpSupplierInventory tErpSupplierInventory = new TErpSupplierInventory();
        tErpSupplierInventory.setCreateBy(user.getNickName());
        TErpSupplierInventory last1 = erpSupplierInventoryMapper.selectOne(new LambdaQueryWrapper<TErpSupplierInventory>().orderByDesc(BaseModel::getCreateTime).orderByDesc(TErpSupplierInventory::getInventoryNumber).last("limit 1"));
        if(last1==null){
            tErpSupplierInventory.setInventoryNumber("P" + DateUtils.dateTimeNow()+"00001");
@@ -776,6 +777,7 @@
            supplierClinicId =crmClinic.getId();
        }
        TErpClinicInventory tErpSupplierInventory = new TErpClinicInventory();
        tErpSupplierInventory.setCreateBy(user.getNickName());
        TErpClinicInventory last = erpClinicInventoryMapper.selectOne(new LambdaQueryWrapper<TErpClinicInventory>().orderByDesc(BaseModel::getCreateTime).orderByDesc(TErpClinicInventory::getInventoryNumber).last("limit 1"));
        if(last==null){
            tErpSupplierInventory.setInventoryNumber("P" + DateUtils.dateTimeNow()+"00001");
@@ -824,7 +826,11 @@
//                tErpSupplierWarehousing.setGoodsName(erpGoods.getGoodsName());
//                tErpSupplierWarehousing.setPurchaseCount(inventoryGoodsDto.getInventoryCount() - inventoryGoodsDto.getNum());
//                tErpSupplierWarehousing.setUnitAmount(erpGoods.getSalesAmount());
                tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousingBatch.getUnitAmount().multiply(new BigDecimal(inventoryGoodsDto.getInventoryCount() - inventoryGoodsDto.getNum())));
                if(tErpSupplierWarehousingBatch.getUnitAmount()==null){
                    tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousingBatch.getSalesAmount().multiply(new BigDecimal(inventoryGoodsDto.getInventoryCount() - inventoryGoodsDto.getNum())));
                }else {
                    tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousingBatch.getUnitAmount().multiply(new BigDecimal(inventoryGoodsDto.getInventoryCount() - inventoryGoodsDto.getNum())));
                }
                // 当前年月日时分秒
                TErpClinicWarehousing last1 = erpClinicWarehousingMapper.selectOne(new LambdaQueryWrapper<TErpClinicWarehousing>().orderByDesc(BaseModel::getCreateTime).orderByDesc(TErpClinicWarehousing::getWarehouseNo).last("limit 1"));
                if(last1==null){
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
@@ -535,7 +535,11 @@
                inventoryDetailVos.add(inventoryDetailVo);
            }
            for (InventoryDetailVo inventoryDetailVo : inventoryDetailVos) {
                if(inventoryDetailVo.getNowCount().equals(inventoryDetailVo.getInventoryCount())){
                    inventoryDetailVo.setInventoryType(3);
                }
            }
            return inventoryDetailVos;
        }
ruoyi-system/src/main/java/com/ruoyi/system/vo/InventoryDetailVo.java
@@ -33,7 +33,7 @@
    @ApiModelProperty(value = "盘点数量")
    private Integer inventoryCount;
    @ApiModelProperty(value = "盘点类型 1=盘盈 2=盘亏")
    @ApiModelProperty(value = "盘点类型 1=盘盈 2=盘亏 3相同")
    private Integer inventoryType;
    @ApiModelProperty(value = "破损数量")
ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml
@@ -27,7 +27,7 @@
        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,t1.inventory_number
        select t1.id,t1.create_time,t1.create_by createBy,t1.inventory_number
        from t_erp_clinic_inventory t1 left join sys_user t2 on t1.create_id = t2.user_id
        where t1.disabled = 0
        <if test="user.roleType !=null and user.roleType ==5">
@@ -37,7 +37,7 @@
            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},'%')
            and t1.create_by like concat('%',#{query.createBy},'%')
        </if>
        <if test="sTime != null and eTime !=null ">
            and t1.create_time between #{sTime} and #{eTime}
ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml
@@ -413,6 +413,9 @@
        WHERE t1.`disabled` = 0
          AND (t1.goods_source = 1 AND t1.state = 1 AND t1.`disabled` = 0 AND t1.platform_commission_price IS NOT NULL)
          and (NOT FIND_IN_SET(#{clinicSupplierId}, t1.clinic_ids) or t1.clinic_ids is null)
        <if test="query.supplierName != null and query.supplierName != ''">
            and (t1.supplier_name like concat('%',#{query.supplierName},'%') or t2.supplier_name like concat('%',#{query.supplierName},'%'))
        </if>
        <if test="query.goodsName != null and query.goodsName != ''">
            and t1.goods_name like concat('%',#{query.goodsName},'%')
        </if>