检查直接继承AbstractBatchServiceVerify.java的所有子类配置的bean id是否包含字符串BatchVerify_...

echo off
setlocal enabledelayedexpansion&pushd %~dp0

rem 查找继承了AbstractBatchServiceVerify.java的子类
findstr /s /m /c:"extends AbstractBatchServiceVerify" *.java>AbstractBatchServiceVerify.txt

rem 将子类名称保存到temp.txt中
del /q temp.txt
for /f "delims=" %%i in (AbstractBatchServiceVerify.txt) do (
echo .%%~ni
)>>temp.txt

rem 在service.xml中查找配置子类的bean
findstr /s /n /l /g:temp.txt *.service.xml>AbstractBatchServiceVerify.txt

del /q result.txt

FOR /F "tokens=1,2 delims=:" %%i in (AbstractBatchServiceVerify.txt) do (
set isFound=false
echo %%i|findstr /c:"target">nul 2>nul&&set isFound=true
if !isFound!==false (
set /a pre=%%j-1
set /a current=%%j
set /a next=%%j+1
call ReadLine2.bat %%i !pre!|findstr /c:BatchVerify_>nul 2>nul || call ReadLine2.bat %%i !pre! !current! !next!>>result.txt
)
)


ReadLine2.bat 内容如下:
@echo off&SetLocal ENABLEDELAYEDEXPANSION
:::::::::::ReadLine2.Bat::::::::::::::::::

if "%1"=="" (goto --help) else (set file=%1)
if not exist %file% goto :eof
if "%2"=="" (
for /f "tokens=1* delims=:" %%a in ('findstr /n .* "%file%"') do echo/%%b
goto :eof
) else (
set args=%*
for %%a in (!args!) do (
if not "%%a"=="%1" (for /f "tokens=1* delims=:" %%b in ('findstr /n .* "%file%"') do (
if "%%b"=="%%a" echo/%%c)
)
)
)
goto :eof

:--help
echo/======================================
echo/本程序段需要带参数才能正常运行
echo/&echo/Usage:&echo/Call ReadLine2 ^<文件名^> ^<读取行号^>
echo/&echo/例如:Call ReadLine2 aa.txt 5 7 11 ,将读取aa.txt文件的第5,7,11行
echo/&echo/如果^<读取行号^>没有指定,将读取整个文件的内容
echo/======================================
goto :eof
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值