Skip to content

Commit

Permalink
update for spring batch module
Browse files Browse the repository at this point in the history
  • Loading branch information
i0712326 committed Mar 23, 2015
1 parent 2bec5cd commit 0eaa748
Show file tree
Hide file tree
Showing 46 changed files with 1,090,216 additions and 606 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/BcnxWebService/batch/batch_configure.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="JobModelElement" type\="job">\r\n<structure end\="2424" endstart\="2412" start\="1940" startend\="1992"/>\r\n<bounds height\="118" width\="84" x\="15" y\="17"/>\r\n</element>\r\n</graph>
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/BcnxWebService/batch/batchContext.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="JobModelElement" type\="job">\r\n<structure end\="1735" endstart\="1723" start\="1451" startend\="1472"/>\r\n<bounds height\="118" width\="84" x\="15" y\="17"/>\r\n</element>\r\n</graph>
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/BcnxWebService/batch/batch_configure.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="JobModelElement" type\="job">\r\n<structure end\="2328" endstart\="2316" start\="1346" startend\="1367"/>\r\n<bounds height\="418" width\="164" x\="15" y\="17"/>\r\n</element>\r\n</graph>
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/BcnxWebService/webapp/WEB-INF/quartz/batch_context.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph/>
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/batch\:/BcnxWebService/webapp/WEB-INF/quartz/batch_job_context.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="JobModelElement" type\="job">\r\n<structure end\="2290" endstart\="2278" start\="1308" startend\="1329"/>\r\n<bounds height\="418" width\="164" x\="15" y\="17"/>\r\n</element>\r\n</graph>
eclipse.preferences.version=1
8 changes: 2 additions & 6 deletions BcnxWebService/.springBeans
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@
<config>webapp/WEB-INF/card_type_context.xml</config>
<config>webapp/WEB-INF/reasoncode_context.xml</config>
<config>configure/cardProc_context.xml</config>
<config>webapp/WEB-INF/quartz/batchJobTxn.xml</config>
<config>webapp/WEB-INF/quartz/batch_scheduler.xml</config>
<config>webapp/WEB-INF/quartz/batchJobSettle.xml</config>
<config>webapp/WEB-INF/quartz/batch_context.xml</config>
<config>webapp/WEB-INF/quartz/batchReportGen.xml</config>
<config>webapp/WEB-INF/quartz/batchUpdateDisp.xml</config>
<config>batch/batch_configure.xml</config>
<config>webapp/WEB-INF/quartz/batch_job_context.xml</config>
<config>webapp/WEB-INF/quartz/batch_job_scheduler.xml</config>
</configs>
<autoconfigs>
</autoconfigs>
Expand Down
103 changes: 76 additions & 27 deletions BcnxWebService/batch/batch_configure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,35 @@
<import resource="bcnxSettle_context.xml"/>
<import resource="bin_context.xml"/>
<import resource="bcnx_context.xml"/>
<bean id="taskLet0" class="com.bcnx.web.app.service.batch.BcnxTxnFetchItem">
<property name="fileTransfer" ref="fileTransfer"/>
<property name="bcnxSettleService" ref="bcnxSettleService"/>
</bean>
<bean id="itemReader" class="com.bcnx.web.app.service.batch.BcnxTxnReaderItem" />
<bean id="itemProcessor" class="com.bcnx.web.app.service.batch.BcnxTxnProcessItem">
<property name="binService" ref="binService"/>
</bean>
<bean id="itemWriter" class="com.bcnx.web.app.service.batch.BcnxTxnWirteItem">
<property name="bcnxTxnService" ref="bcnxTxnService"/>
</bean>
<bean id="cleanUp" class="com.bcnx.web.app.service.batch.CleanUpTasklet"/>
<batch:job id="job1" job-repository="jobRepository">
<!-- <batch:step id="step0" next="step1">
<batch:tasklet ref="taskLet0"/>
</batch:step> -->
<batch:step id="step1">
<batch:tasklet>
<batch:chunk reader="itemReader"
processor="itemProcessor" writer="itemWriter"
commit-interval="50">
</batch:chunk>
</batch:tasklet>
</batch:step>
<!-- <batch:step id="last">
<batch:tasklet ref="cleanUp"/>
</batch:step> -->
<import resource="quartz/batch_context.xml"/>
<!-- batch job -->
<batch:job id="job1">
<!-- router audit process -->
<batch:step id="bcnxTxnFetchStep" next="bcnxTxnReadStep">
<batch:tasklet ref="bcnxTxnFileFetch"/>
</batch:step>
<batch:step id="bcnxTxnReadStep" next="bcnxTxnDeleteStep">
<batch:tasklet ref="bcnxTxnRead"/>
</batch:step>
<batch:step id="bcnxTxnDeleteStep" next="bcnxSetteFetchStep">
<batch:tasklet ref="bcnxTxnFileDelete"/>
</batch:step>
<!-- verify log process -->
<batch:step id="bcnxSetteFetchStep" next="bcnxSettleReadStep">
<batch:tasklet ref="bcnxSettleFileFetch"/>
</batch:step>
<batch:step id="bcnxSettleReadStep" next="bcnxSettleDeleteStep">
<batch:tasklet ref="bcnxSettleRead"/>
</batch:step>
<batch:step id="bcnxSettleDeleteStep" next="netSettlementStep">
<batch:tasklet ref="bcnxSettleFileDelete"/>
</batch:step>
<!-- report generator -->
<batch:step id="netSettlementStep">
<batch:tasklet ref="netSettlement"/>
</batch:step>
</batch:job>

<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
<property name="dataSource" ref="dataSource" />
Expand All @@ -67,4 +68,52 @@
<jdbc:script location="org/springframework/batch/core/schema-drop-mysql.sql" />
<jdbc:script location="org/springframework/batch/core/schema-mysql.sql" />
</jdbc:initialize-database>

<bean id="bcnxTxnFileFetch"
class="com.bcnx.web.app.service.batch.BcnxFileFetch"
parent="batchTemplate" scope="prototype">
<property name="fileTransfer" ref="fileTransfer"/>
<property name="expression" value="router.audit.*"/>
<property name="localPath" value="D:/output/src/bcnxTxn"/>
</bean>

<bean id="bcnxSettleFileFetch"
class="com.bcnx.web.app.service.batch.BcnxFileFetch"
parent="batchTemplate" scope="prototype">
<property name="fileTransfer" ref="fileTransfer"/>
<property name="expression" value="verify.log.*"/>
<property name="localPath" value="D:/output/src/bcnxSettle"/>
</bean>

<bean id="bcnxTxnRead"
class="com.bcnx.web.app.service.batch.BcnxTxnRead">
<property name="resourcePath" value="D:/output/src/bcnxTxn"/>
<property name="bcnxTxnAuditor" ref="bcnxTxnAuditor"/>
</bean>
<bean id="batchTemplate"
class="com.bcnx.web.app.service.batch.BatchTemplate">
<property name="fileTransfer" ref="fileTransfer"/>
<property name="bcnxSettleService" ref="bcnxSettleService"/>
<property name="bcnxTxnService" ref="bcnxTxnService"/>
</bean>
<bean id="bcnxTxnFileDelete"
class="com.bcnx.web.app.service.batch.BcnxFileDelete">
<property name="resourcePath" value="D:/output/src/bcnxTxn"/>
</bean>
<bean id="bcnxSettleFileDelete"
class="com.bcnx.web.app.service.batch.BcnxFileDelete">
<property name="resourcePath" value="D:/output/src/bcnxSettle"/>
</bean>
<bean id="bcnxSettleRead"
class="com.bcnx.web.app.service.batch.BcnxSettleRead"
parent="batchTemplate">
<property name="resourcePath" value="D:/output/src/bcnxSettle"/>
<property name="bcnxSettleAuditor" ref="bcnxSettleAuditor"/>
</bean>

<bean id="netSettlement"
class="com.bcnx.web.app.service.batch.NetSettlementTask">
<property name="netSettlementReport" ref="netSettlementReport"/>
</bean>

</beans>
2 changes: 1 addition & 1 deletion BcnxWebService/configure/datasource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- <jee:jndi-lookup id="dataSource" jndi-name="jdbc/bcnx"/> -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3307/bcnx"/>
<property name="url" value="jdbc:mysql://localhost:3307/test"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
Expand Down
19 changes: 19 additions & 0 deletions BcnxWebService/configure/settleBcnx_context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
<import resource="datasource.xml"/>
<import resource="member_context.xml"/>
<import resource="bcnxSettle_context.xml"/>
<import resource="cardProc_context.xml"/>
<import resource="dispute_context.xml"/>
<bean id="bcnxSettleFee" class="com.bcnx.web.app.service.report.BcnxSettleFeeImp">
<property name="cardProcService" ref="cardProcService"/>
</bean>
<bean id="settlementReportService" class="com.bcnx.web.app.service.report.SettlementReportServiceImp">
<property name="bcnxSettleService" ref="bcnxSettleService"/>
<property name="disputeTxnService" ref="disputeTxnService"/>
<property name="memberService" ref="memberService"/>
<property name="bcnxSettleFee" ref="bcnxSettleFee"/>
</bean>
<bean id="netSettlementReport" class="com.bcnx.web.app.service.report.NetSettlementReportImp">
<property name="settlementReportService" ref="settlementReportService"/>
<property name="memberService" ref="memberService"/>
<property name="settleBcnxService" ref="settleBcnxService"/>
<property name="path" value="D:\\output\\Reports"/>
</bean>
<bean id="settleBcnxDao" class="com.bcnx.web.app.service.dao.SettleBcnxDaoImp">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
Expand Down
Loading

0 comments on commit 0eaa748

Please sign in to comment.