Commit 70df2811 by gechengyang

提交gle、fep相关代码

parent 8ba9cc41
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<property name="enableSubPackages" value="false" /> <property name="enableSubPackages" value="false" />
</javaClientGenerator> </javaClientGenerator>
<!-- 指定数据库表 --> <!-- 指定数据库表 -->
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="CPD" delimitIdentifiers="true" delimitAllColumns="true"> <!-- <table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="CPD" delimitIdentifiers="true" delimitAllColumns="true">
</table> </table>
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="CPT" delimitIdentifiers="true" delimitAllColumns="true"> <table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="CPT" delimitIdentifiers="true" delimitAllColumns="true">
</table> </table>
...@@ -56,13 +56,15 @@ ...@@ -56,13 +56,15 @@
</table> </table>
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="COU" delimitIdentifiers="true" delimitAllColumns="true"> <table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="COU" delimitIdentifiers="true" delimitAllColumns="true">
<!-- <property name="useActualColumnNames" value="true" /> --> <property name="useActualColumnNames" value="true" />
</table> </table>
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="USR" delimitIdentifiers="true" delimitAllColumns="true"> <table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="USR" delimitIdentifiers="true" delimitAllColumns="true">
</table> -->
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="GLE" delimitIdentifiers="true" delimitAllColumns="true">
</table> </table>
<table enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" tableName="TST" delimitIdentifiers="true" delimitAllColumns="true">
</table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
\ No newline at end of file
...@@ -27,6 +27,8 @@ import com.brilliance.remit.db.model.Cbe; ...@@ -27,6 +27,8 @@ import com.brilliance.remit.db.model.Cbe;
import com.brilliance.remit.db.model.Cpd; import com.brilliance.remit.db.model.Cpd;
import com.brilliance.remit.db.model.Cpdgrp; import com.brilliance.remit.db.model.Cpdgrp;
import com.brilliance.remit.db.model.Cpt; import com.brilliance.remit.db.model.Cpt;
import com.brilliance.remit.db.model.Fep;
import com.brilliance.remit.db.model.Gle;
import com.brilliance.remit.db.model.Pta; import com.brilliance.remit.db.model.Pta;
import com.brilliance.remit.db.model.Pts; import com.brilliance.remit.db.model.Pts;
import com.brilliance.remit.db.model.Pty; import com.brilliance.remit.db.model.Pty;
...@@ -38,6 +40,8 @@ import com.brilliance.remit.service.CbeService; ...@@ -38,6 +40,8 @@ import com.brilliance.remit.service.CbeService;
import com.brilliance.remit.service.CntService; import com.brilliance.remit.service.CntService;
import com.brilliance.remit.service.CpdService; import com.brilliance.remit.service.CpdService;
import com.brilliance.remit.service.CptService; import com.brilliance.remit.service.CptService;
import com.brilliance.remit.service.FepService;
import com.brilliance.remit.service.GleService;
import com.brilliance.remit.service.PtaService; import com.brilliance.remit.service.PtaService;
import com.brilliance.remit.service.PtsService; import com.brilliance.remit.service.PtsService;
import com.brilliance.remit.service.PtyService; import com.brilliance.remit.service.PtyService;
...@@ -70,6 +74,10 @@ public class CpdController { ...@@ -70,6 +74,10 @@ public class CpdController {
private AdrService adrService; private AdrService adrService;
@Autowired @Autowired
private PtaService ptaService; private PtaService ptaService;
@Autowired
private FepService fepService;
@Autowired
private GleService gleService;
private static final Log log = LogFactory.getLog(CpdController.class); private static final Log log = LogFactory.getLog(CpdController.class);
@Resource(name = "txManager") @Resource(name = "txManager")
...@@ -217,6 +225,25 @@ public class CpdController { ...@@ -217,6 +225,25 @@ public class CpdController {
nomcbb.setCbeinr(nomcbeinr); nomcbb.setCbeinr(nomcbeinr);
cbbService.save(nomcbb); cbbService.save(nomcbb);
// FEP
List<Fep> fepList = cpdgrp.getFepList();
for (Fep fep : fepList) {
String fepinr = cntService.counter("FEP");
fep.setInr(fepinr);
fep.setObjinr(cpdinr);
fep.setRelobjinr(fepinr);
fepService.save(fep);
}
// GLE
List<Gle> gleList = cpdgrp.getGleList();
for (Gle gle : gleList) {
String gleinr = cntService.counter("GLE");
gle.setInr(gleinr);
gle.setObjinr(cpdinr);
gleService.save(gle);
}
transactionManager.commit(status); transactionManager.commit(status);
log.info("end cpd save....."); log.info("end cpd save.....");
......
package com.brilliance.remit.db.dao;
import com.brilliance.remit.db.model.Fep;
public interface FepMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int deleteByPrimaryKey(String inr);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int insert(Fep record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int insertSelective(Fep record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
Fep selectByPrimaryKey(String inr);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int updateByPrimaryKeySelective(Fep record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int updateByPrimaryKeyWithBLOBs(Fep record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FEP
*
* @mbggenerated Fri Dec 21 09:22:49 CST 2018
*/
int updateByPrimaryKey(Fep record);
}
\ No newline at end of file
package com.brilliance.remit.db.dao;
import com.brilliance.remit.db.model.Gle;
public interface GleMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
int deleteByPrimaryKey(String inr);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
int insert(Gle record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
int insertSelective(Gle record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
Gle selectByPrimaryKey(String inr);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
int updateByPrimaryKeySelective(Gle record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table GLE
*
* @mbggenerated Fri Dec 21 09:32:57 CST 2018
*/
int updateByPrimaryKey(Gle record);
}
\ No newline at end of file
...@@ -24,6 +24,8 @@ public class Cpdgrp implements Serializable { ...@@ -24,6 +24,8 @@ public class Cpdgrp implements Serializable {
private Cbb maxcbb;// 余额 private Cbb maxcbb;// 余额
private Cbe nomcbe;// 变动余额 private Cbe nomcbe;// 变动余额
private Cbb nomcbb;// 余额 private Cbb nomcbb;// 余额
private List<Gle> gleList; // 會計分录
private List<Fep> fepList;// 费用明细
public Cpd getCpd() { public Cpd getCpd() {
return cpd; return cpd;
...@@ -113,4 +115,20 @@ public class Cpdgrp implements Serializable { ...@@ -113,4 +115,20 @@ public class Cpdgrp implements Serializable {
this.pta = pta; this.pta = pta;
} }
public List<Gle> getGleList() {
return gleList;
}
public List<Fep> getFepList() {
return fepList;
}
public void setGleList(List<Gle> gleList) {
this.gleList = gleList;
}
public void setFepList(List<Fep> fepList) {
this.fepList = fepList;
}
} }
package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Fep;
/**
This java was generated by Auto Generator.
created at time 2018-12-21 09:25:17
**/
public interface FepService {
public boolean save(Fep fep);
}
package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Gle;
/**
This java was generated by Auto Generator.
created at time 2018-12-21 09:33:08
**/
public interface GleService {
public boolean save(Gle gle);
}
package com.brilliance.remit.service.imp;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import com.brilliance.remit.common.util.DbUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.brilliance.remit.service.FepService;
import com.brilliance.remit.db.dao.FepMapper;
import com.brilliance.remit.db.model.Fep;
/**
This java was generated by Auto Generator.
created at time 2018-12-21 09:25:18
**/
@Service("fepService")
public class FepServiceImp implements FepService {
@Autowired
private FepMapper fepMapper;
@Resource(name = "txManager")
private DataSourceTransactionManager transactionManager;
private static Log log = LogFactory.getLog(FepServiceImp.class);
@Override
public boolean save(Fep fep) {
// 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try {
// you can do business hanle herer
fepMapper.insert(fep);
transactionManager.commit(status);
return true;
} catch (Exception e) {
log.error("error", e);
transactionManager.rollback(status);
return false;
}
}
}
package com.brilliance.remit.service.imp;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import com.brilliance.remit.common.util.DbUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.brilliance.remit.service.GleService;
import com.brilliance.remit.db.dao.GleMapper;
import com.brilliance.remit.db.model.Gle;
/**
This java was generated by Auto Generator.
created at time 2018-12-21 09:33:08
**/
@Service("gleService")
public class GleServiceImp implements GleService {
@Autowired
private GleMapper gleMapper;
@Resource(name = "txManager")
private DataSourceTransactionManager transactionManager;
private static Log log = LogFactory.getLog(GleServiceImp.class);
@Override
public boolean save(Gle gle) {
// 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try {
// you can do business hanle herer
gleMapper.insert(gle);
transactionManager.commit(status);
return true;
} catch (Exception e) {
log.error("error", e);
transactionManager.rollback(status);
return false;
}
}
}
...@@ -45,3 +45,118 @@ BCHINR CHAR(8), ...@@ -45,3 +45,118 @@ BCHINR CHAR(8),
PRIMARY KEY (INR) PRIMARY KEY (INR)
); );
CREATE TABLE GLE (INR CHARACTER(8),
OBJTYP CHARACTER(6),
OBJINR CHARACTER(8),
TRNINR CHARACTER(8),
ACT CHARACTER(34),
DBTCDT CHARACTER(1),
CUR CHARACTER(3),
AMT DECIMAL(18,3),
SYSCUR CHARACTER(3),
SYSAMT DECIMAL(18,3),
VALDAT TIMESTAMP, BUCDAT TIMESTAMP, TXT1 CHARACTER(40),
TXT2 CHARACTER(40),
TXT3 CHARACTER(40),
PRN CHARACTER(4),
EXPSES CHARACTER(8),
EXPFLG CHARACTER(1),
TRNMAN CHARACTER(2),
CLIEXTKEY CHARACTER(12),
TRMTYP CHARACTER(30),
ACTTRNCOD CHARACTER(12),
FCTSGN CHARACTER(6),
PRTFLG CHARACTER(1),
RAT DECIMAL(12,6),
FINFLG CHARACTER(6),
DSP CHARACTER(12),
TSYREF CHARACTER(35),
SETTYP CHARACTER(3),
TRDTYP CHARACTER(3),
DOCREF CHARACTER(6),
CSHFLG CHARACTER(1),
QZREF CHARACTER(16),
QZDAT CHARACTER(8),
TRDPPT CHARACTER(1),
TXCODE CHARACTER(6),
CUSNAM CHARACTER(80),
SFKBANK CHARACTER(80),
SFKNAM CHARACTER(80),
SFKACT CHARACTER(34),
SFKCTY CHARACTER(3),
DELTYP CHARACTER(6),
TRANTYP CHARACTER(6),
CORTYP CHARACTER(4),
GLETYP CHARACTER(2),
PRIMARY KEY (INR)
);
CREATE TABLE FEP
(
INR CHARACTER(8),
FEECOD CHARACTER(6),
OBJTYP CHARACTER(6),
OBJINR CHARACTER(8),
RELOBJTYP CHARACTER(6),
RELOBJINR CHARACTER(8),
EXTKEY CHARACTER(20),
NAM CHARACTER(45),
RELCUR CHARACTER(3),
RELAMT DECIMAL(18,3),
DAT1 TIMESTAMP, DAT2 TIMESTAMP, MODFLG CHARACTER(1),
UNT DECIMAL(5,0),
UNTAMT DECIMAL(18,3),
RATCAL DECIMAL(14,6),
RAT DECIMAL(14,6),
MINMAXFLG CHARACTER(1),
CUR CHARACTER(3),
AMT DECIMAL(18,3),
XRFCUR CHARACTER(3),
XRFAMT DECIMAL(18,3),
FEEACC CHARACTER(34),
INFDETSTM VARCHAR(1620),
PTYINR CHARACTER(8),
SRCTRNINR CHARACTER(8),
SRCDAT TIMESTAMP, RPLTRNINR CHARACTER(8),
RPLDAT TIMESTAMP, DONTRNINR CHARACTER(8),
DONDAT TIMESTAMP, ADVTRNINR CHARACTER(8),
PREDBTFEPINR CHARACTER(8),
ADVDAT TIMESTAMP, ACRINR CHARACTER(8),
SEPINR CHARACTER(8),
ROL CHARACTER(3),
RELAMTMAN DECIMAL(18,3),
FECUSE LONG VARCHAR, BEOFZDM CHARACTER(8),
BEOFESNM CHARACTER(30),
BEOCCY CHARACTER(3),
BEOPACCT CHARACTER(32),
BEOSHAMT DECIMAL(18,3),
BEOCHATP CHARACTER(2),
BEOORAMT DECIMAL(18,3),
BEODIAMT DECIMAL(18,3),
BEOTZFS CHARACTER(1),
BEORDATE CHARACTER(8),
BEOFPRUT CHARACTER(1),
BEOFPRLT CHARACTER(2),
BEOFPRSQ CHARACTER(1),
BEOFPDAY CHARACTER(3),
BEORETFG CHARACTER(1),
BEORDAYS CHARACTER(2),
BEODELFG CHARACTER(1),
BEOAADJN CHARACTER(6),
BEOUADJN CHARACTER(6),
BEORACCT CHARACTER(32),
BEOACMCD CHARACTER(4),
BEOABRNO CHARACTER(6),
BEOFCSID CHARACTER(16),
BEOTXACT CHARACTER(32),
BEOINART CHARACTER(12),
BEORACNM CHARACTER(100),
SRC CHARACTER(1),
SRCINIFRM CHARACTER(6),
DSP CHARACTER(1),
PRIMARY KEY (INR)
);
...@@ -20,17 +20,13 @@ public class Genarate { ...@@ -20,17 +20,13 @@ public class Genarate {
public static void main(String[] args) throws FileNotFoundException, IOException { public static void main(String[] args) throws FileNotFoundException, IOException {
String rootPath = "G:/work/cbpp/remit"; String rootPath = "G:/work/cbpp/remit";
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
list.add("gle");
list.add("bch"); /*
list.add("cpd"); * list.add("bch"); list.add("cpd"); list.add("cpt"); list.add("trn");
list.add("cpt"); * list.add("pts"); list.add("cbb"); list.add("cbe"); list.add("pty");
list.add("trn"); * list.add("pta"); list.add("adr");
list.add("pts"); */
list.add("cbb");
list.add("cbe");
list.add("pty");
list.add("pta");
list.add("adr");
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
String name = list.get(i); String name = list.get(i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment