Commit 47d88e40 by gechengyang

提交最新代码

parent 70df2811
...@@ -192,11 +192,11 @@ public class CpdController { ...@@ -192,11 +192,11 @@ public class CpdController {
for (Pts pts : ptsList) { for (Pts pts : ptsList) {
String ptsinr = cntService.counter("PTS"); String ptsinr = cntService.counter("PTS");
pts.setInr(ptsinr); pts.setInr(ptsinr);
if (pts.getRol().equals("PYE") && tempAdrInrIsNull) { if (pts.getRol() != null && pts.getRol().equals("PYE") && tempAdrInrIsNull) {
pts.setPtainr(pyePtaInr); pts.setPtainr(pyePtaInr);
pts.setPtyinr(pyePtyInr); pts.setPtyinr(pyePtyInr);
} }
trnService.save(trn); ptsService.save(pts);
} }
// 最大CBE CBB // 最大CBE CBB
...@@ -250,6 +250,7 @@ public class CpdController { ...@@ -250,6 +250,7 @@ public class CpdController {
} catch (Exception e) { } catch (Exception e) {
log.error("save cpd error:", e); log.error("save cpd error:", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return ResultUtil.result(ErrorCodes.ERROR, "save error", null);
} }
return ResultUtil.result(ErrorCodes.SUCCESS, "sucess", null); return ResultUtil.result(ErrorCodes.SUCCESS, "sucess", null);
......
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Adr; import com.brilliance.remit.db.model.Adr;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface AdrService { public interface AdrService {
public boolean save(Adr adr); public boolean save(Adr adr) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Bch; import com.brilliance.remit.db.model.Bch;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:09 created at time 2018-12-21 16:59:58
**/ **/
public interface BchService { public interface BchService {
public boolean save(Bch bch); public boolean save(Bch bch) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Cbb; import com.brilliance.remit.db.model.Cbb;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface CbbService { public interface CbbService {
public boolean save(Cbb cbb); public boolean save(Cbb cbb) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Cbe; import com.brilliance.remit.db.model.Cbe;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface CbeService { public interface CbeService {
public boolean save(Cbe cbe); public boolean save(Cbe cbe) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Cpd; import com.brilliance.remit.db.model.Cpd;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface CpdService { public interface CpdService {
public boolean save(Cpd cpd); public boolean save(Cpd cpd) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Cpt; import com.brilliance.remit.db.model.Cpt;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface CptService { public interface CptService {
public boolean save(Cpt cpt); public boolean save(Cpt cpt) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Fep; import com.brilliance.remit.db.model.Fep;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-21 09:25:17 created at time 2018-12-21 16:59:58
**/ **/
public interface FepService { public interface FepService {
public boolean save(Fep fep); public boolean save(Fep fep) throws Exception;
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Gle; import com.brilliance.remit.db.model.Gle;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-21 09:33:08 created at time 2018-12-21 16:59:57
**/ **/
public interface GleService { public interface GleService {
public boolean save(Gle gle); public boolean save(Gle gle) throws Exception;
} }
...@@ -4,12 +4,12 @@ import com.brilliance.remit.db.model.Cpdgrp; ...@@ -4,12 +4,12 @@ import com.brilliance.remit.db.model.Cpdgrp;
import com.brilliance.remit.db.model.Pta; import com.brilliance.remit.db.model.Pta;
/** /**
* This java was generated by Auto Generator. created at time 2018-12-18 * This java was generated by Auto Generator. created at time 2018-12-21
* 22:06:10 * 16:59:58
**/ **/
public interface PtaService { public interface PtaService {
public boolean save(Pta pta); public boolean save(Pta pta) throws Exception;
public Cpdgrp custormerInfo(String extkey); public Cpdgrp custormerInfo(String extkey);
......
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Pts; import com.brilliance.remit.db.model.Pts;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface PtsService { public interface PtsService {
public boolean save(Pts pts); public boolean save(Pts pts) throws Exception;
} }
...@@ -5,12 +5,13 @@ import java.util.List; ...@@ -5,12 +5,13 @@ import java.util.List;
import com.brilliance.remit.db.model.Pty; import com.brilliance.remit.db.model.Pty;
/** /**
* This java was generated by Auto Generator. created at time 2018-12-18 * This java was generated by Auto Generator. created at time 2018-12-21
* 22:06:10 * 16:59:58
**/ **/
public interface PtyService { public interface PtyService {
public boolean save(Pty pty); public boolean save(Pty pty) throws Exception;
public List<Pty> ptyInfos(String extkey, String ptytyp); public List<Pty> ptyInfos(String extkey, String ptytyp);
} }
...@@ -2,10 +2,10 @@ package com.brilliance.remit.service; ...@@ -2,10 +2,10 @@ package com.brilliance.remit.service;
import com.brilliance.remit.db.model.Trn; import com.brilliance.remit.db.model.Trn;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
public interface TrnService { public interface TrnService {
public boolean save(Trn trn); public boolean save(Trn trn) throws Exception;
} }
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.AdrMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.AdrMapper;
import com.brilliance.remit.db.model.Adr; import com.brilliance.remit.db.model.Adr;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("adrService") @Service("adrService")
...@@ -27,7 +27,7 @@ public class AdrServiceImp implements AdrService { ...@@ -27,7 +27,7 @@ public class AdrServiceImp implements AdrService {
private static Log log = LogFactory.getLog(AdrServiceImp.class); private static Log log = LogFactory.getLog(AdrServiceImp.class);
@Override @Override
public boolean save(Adr adr) { public boolean save(Adr adr) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class AdrServiceImp implements AdrService { ...@@ -38,7 +38,7 @@ public class AdrServiceImp implements AdrService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.BchMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.BchMapper;
import com.brilliance.remit.db.model.Bch; import com.brilliance.remit.db.model.Bch;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("bchService") @Service("bchService")
...@@ -27,7 +27,7 @@ public class BchServiceImp implements BchService { ...@@ -27,7 +27,7 @@ public class BchServiceImp implements BchService {
private static Log log = LogFactory.getLog(BchServiceImp.class); private static Log log = LogFactory.getLog(BchServiceImp.class);
@Override @Override
public boolean save(Bch bch) { public boolean save(Bch bch) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class BchServiceImp implements BchService { ...@@ -38,7 +38,7 @@ public class BchServiceImp implements BchService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CbbMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CbbMapper;
import com.brilliance.remit.db.model.Cbb; import com.brilliance.remit.db.model.Cbb;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("cbbService") @Service("cbbService")
...@@ -27,7 +27,7 @@ public class CbbServiceImp implements CbbService { ...@@ -27,7 +27,7 @@ public class CbbServiceImp implements CbbService {
private static Log log = LogFactory.getLog(CbbServiceImp.class); private static Log log = LogFactory.getLog(CbbServiceImp.class);
@Override @Override
public boolean save(Cbb cbb) { public boolean save(Cbb cbb) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class CbbServiceImp implements CbbService { ...@@ -38,7 +38,7 @@ public class CbbServiceImp implements CbbService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CbeMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CbeMapper;
import com.brilliance.remit.db.model.Cbe; import com.brilliance.remit.db.model.Cbe;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("cbeService") @Service("cbeService")
...@@ -27,7 +27,7 @@ public class CbeServiceImp implements CbeService { ...@@ -27,7 +27,7 @@ public class CbeServiceImp implements CbeService {
private static Log log = LogFactory.getLog(CbeServiceImp.class); private static Log log = LogFactory.getLog(CbeServiceImp.class);
@Override @Override
public boolean save(Cbe cbe) { public boolean save(Cbe cbe) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class CbeServiceImp implements CbeService { ...@@ -38,7 +38,7 @@ public class CbeServiceImp implements CbeService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -2,9 +2,14 @@ package com.brilliance.remit.service.imp; ...@@ -2,9 +2,14 @@ package com.brilliance.remit.service.imp;
import java.math.BigDecimal; import java.math.BigDecimal;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import com.brilliance.remit.common.util.DbUtil;
import com.brilliance.remit.db.dao.CouMapper; import com.brilliance.remit.db.dao.CouMapper;
import com.brilliance.remit.db.model.Cou; import com.brilliance.remit.db.model.Cou;
import com.brilliance.remit.service.CntService; import com.brilliance.remit.service.CntService;
...@@ -14,21 +19,31 @@ public class CntServiceImpl implements CntService { ...@@ -14,21 +19,31 @@ public class CntServiceImpl implements CntService {
@Autowired @Autowired
private CouMapper couMapper; private CouMapper couMapper;
@Resource(name = "txManager")
private DataSourceTransactionManager transactionManager;
@Override @Override
public synchronized String counter(String nam) { public synchronized String counter(String nam) {
Cou cnt = couMapper.selectByPrimaryKey(nam); // 事务操作
if (cnt == null) { TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
cnt = new Cou(); try {
cnt.setCounam(nam); Cou cnt = couMapper.selectByPrimaryKey(nam);
cnt.setCoustp(new BigDecimal(1)); if (cnt == null) {
cnt.setCouval(new BigDecimal(1)); cnt = new Cou();
couMapper.insert(cnt); cnt.setCounam(nam);
} else { cnt.setCoustp(new BigDecimal(1));
cnt.setCouval(new BigDecimal(cnt.getCouval().intValue() + 1)); cnt.setCouval(new BigDecimal(1));
couMapper.updateByPrimaryKey(cnt); couMapper.insert(cnt);
} else {
cnt.setCouval(new BigDecimal(cnt.getCouval().intValue() + 1));
couMapper.updateByPrimaryKey(cnt);
}
transactionManager.commit(status);
return String.format("%08d", cnt.getCouval().intValue());
} catch (Exception e) {
transactionManager.rollback(status);
} }
return String.format("%08d", cnt.getCouval().intValue()); return "";
} }
} }
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CpdMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CpdMapper;
import com.brilliance.remit.db.model.Cpd; import com.brilliance.remit.db.model.Cpd;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("cpdService") @Service("cpdService")
...@@ -27,7 +27,7 @@ public class CpdServiceImp implements CpdService { ...@@ -27,7 +27,7 @@ public class CpdServiceImp implements CpdService {
private static Log log = LogFactory.getLog(CpdServiceImp.class); private static Log log = LogFactory.getLog(CpdServiceImp.class);
@Override @Override
public boolean save(Cpd cpd) { public boolean save(Cpd cpd) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class CpdServiceImp implements CpdService { ...@@ -38,7 +38,7 @@ public class CpdServiceImp implements CpdService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CptMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.CptMapper;
import com.brilliance.remit.db.model.Cpt; import com.brilliance.remit.db.model.Cpt;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("cptService") @Service("cptService")
...@@ -27,7 +27,7 @@ public class CptServiceImp implements CptService { ...@@ -27,7 +27,7 @@ public class CptServiceImp implements CptService {
private static Log log = LogFactory.getLog(CptServiceImp.class); private static Log log = LogFactory.getLog(CptServiceImp.class);
@Override @Override
public boolean save(Cpt cpt) { public boolean save(Cpt cpt) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class CptServiceImp implements CptService { ...@@ -38,7 +38,7 @@ public class CptServiceImp implements CptService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.FepMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.FepMapper;
import com.brilliance.remit.db.model.Fep; import com.brilliance.remit.db.model.Fep;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-21 09:25:18 created at time 2018-12-21 16:59:58
**/ **/
@Service("fepService") @Service("fepService")
...@@ -27,7 +27,7 @@ public class FepServiceImp implements FepService { ...@@ -27,7 +27,7 @@ public class FepServiceImp implements FepService {
private static Log log = LogFactory.getLog(FepServiceImp.class); private static Log log = LogFactory.getLog(FepServiceImp.class);
@Override @Override
public boolean save(Fep fep) { public boolean save(Fep fep) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class FepServiceImp implements FepService { ...@@ -38,7 +38,7 @@ public class FepServiceImp implements FepService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.GleMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.GleMapper;
import com.brilliance.remit.db.model.Gle; import com.brilliance.remit.db.model.Gle;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-21 09:33:08 created at time 2018-12-21 16:59:58
**/ **/
@Service("gleService") @Service("gleService")
...@@ -27,7 +27,7 @@ public class GleServiceImp implements GleService { ...@@ -27,7 +27,7 @@ public class GleServiceImp implements GleService {
private static Log log = LogFactory.getLog(GleServiceImp.class); private static Log log = LogFactory.getLog(GleServiceImp.class);
@Override @Override
public boolean save(Gle gle) { public boolean save(Gle gle) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class GleServiceImp implements GleService { ...@@ -38,7 +38,7 @@ public class GleServiceImp implements GleService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -20,8 +20,8 @@ import com.brilliance.remit.db.model.Pty; ...@@ -20,8 +20,8 @@ import com.brilliance.remit.db.model.Pty;
import com.brilliance.remit.service.PtaService; import com.brilliance.remit.service.PtaService;
/** /**
* This java was generated by Auto Generator. created at time 2018-12-18 * This java was generated by Auto Generator. created at time 2018-12-21
* 22:06:10 * 16:59:58
**/ **/
@Service("ptaService") @Service("ptaService")
...@@ -38,7 +38,7 @@ public class PtaServiceImp implements PtaService { ...@@ -38,7 +38,7 @@ public class PtaServiceImp implements PtaService {
private static Log log = LogFactory.getLog(PtaServiceImp.class); private static Log log = LogFactory.getLog(PtaServiceImp.class);
@Override @Override
public boolean save(Pta pta) { public boolean save(Pta pta) throws Exception {
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -49,7 +49,7 @@ public class PtaServiceImp implements PtaService { ...@@ -49,7 +49,7 @@ public class PtaServiceImp implements PtaService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.PtsMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.PtsMapper;
import com.brilliance.remit.db.model.Pts; import com.brilliance.remit.db.model.Pts;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("ptsService") @Service("ptsService")
...@@ -27,7 +27,7 @@ public class PtsServiceImp implements PtsService { ...@@ -27,7 +27,7 @@ public class PtsServiceImp implements PtsService {
private static Log log = LogFactory.getLog(PtsServiceImp.class); private static Log log = LogFactory.getLog(PtsServiceImp.class);
@Override @Override
public boolean save(Pts pts) { public boolean save(Pts pts) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class PtsServiceImp implements PtsService { ...@@ -38,7 +38,7 @@ public class PtsServiceImp implements PtsService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -17,8 +17,8 @@ import com.brilliance.remit.db.model.Pty; ...@@ -17,8 +17,8 @@ import com.brilliance.remit.db.model.Pty;
import com.brilliance.remit.service.PtyService; import com.brilliance.remit.service.PtyService;
/** /**
* This java was generated by Auto Generator. created at time 2018-12-18 * This java was generated by Auto Generator. created at time 2018-12-21
* 22:06:10 * 16:59:58
**/ **/
@Service("ptyService") @Service("ptyService")
...@@ -31,7 +31,7 @@ public class PtyServiceImp implements PtyService { ...@@ -31,7 +31,7 @@ public class PtyServiceImp implements PtyService {
private static Log log = LogFactory.getLog(PtyServiceImp.class); private static Log log = LogFactory.getLog(PtyServiceImp.class);
@Override @Override
public boolean save(Pty pty) { public boolean save(Pty pty) throws Exception {
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -42,7 +42,7 @@ public class PtyServiceImp implements PtyService { ...@@ -42,7 +42,7 @@ public class PtyServiceImp implements PtyService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.TrnMapper; ...@@ -14,7 +14,7 @@ import com.brilliance.remit.db.dao.TrnMapper;
import com.brilliance.remit.db.model.Trn; import com.brilliance.remit.db.model.Trn;
/** /**
This java was generated by Auto Generator. This java was generated by Auto Generator.
created at time 2018-12-18 22:06:10 created at time 2018-12-21 16:59:58
**/ **/
@Service("trnService") @Service("trnService")
...@@ -27,7 +27,7 @@ public class TrnServiceImp implements TrnService { ...@@ -27,7 +27,7 @@ public class TrnServiceImp implements TrnService {
private static Log log = LogFactory.getLog(TrnServiceImp.class); private static Log log = LogFactory.getLog(TrnServiceImp.class);
@Override @Override
public boolean save(Trn trn) { public boolean save(Trn trn) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class TrnServiceImp implements TrnService { ...@@ -38,7 +38,7 @@ public class TrnServiceImp implements TrnService {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -6,6 +6,6 @@ import com.brilliance.remit.db.model.${entity.name}; ...@@ -6,6 +6,6 @@ import com.brilliance.remit.db.model.${entity.name};
**/ **/
public interface ${entity.name}Service { public interface ${entity.name}Service {
public boolean save(${entity.name} ${entity.lowerName}); public boolean save(${entity.name} ${entity.lowerName}) throws Exception;
} }
...@@ -27,7 +27,7 @@ public class ${entity.name}ServiceImp implements ${entity.name}Service { ...@@ -27,7 +27,7 @@ public class ${entity.name}ServiceImp implements ${entity.name}Service {
private static Log log = LogFactory.getLog(${entity.name}ServiceImp.class); private static Log log = LogFactory.getLog(${entity.name}ServiceImp.class);
@Override @Override
public boolean save(${entity.name} ${entity.lowerName}) { public boolean save(${entity.name} ${entity.lowerName}) throws Exception{
// 事务操作 // 事务操作
TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition()); TransactionStatus status = transactionManager.getTransaction(DbUtil.getDbDefinition());
try { try {
...@@ -38,7 +38,7 @@ public class ${entity.name}ServiceImp implements ${entity.name}Service { ...@@ -38,7 +38,7 @@ public class ${entity.name}ServiceImp implements ${entity.name}Service {
} catch (Exception e) { } catch (Exception e) {
log.error("error", e); log.error("error", e);
transactionManager.rollback(status); transactionManager.rollback(status);
return false; throw new Exception("error", e);
} }
} }
......
...@@ -21,12 +21,17 @@ public class Genarate { ...@@ -21,12 +21,17 @@ public class Genarate {
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("gle");
list.add("fep");
/* list.add("bch");
* list.add("bch"); list.add("cpd"); list.add("cpt"); list.add("trn"); list.add("cpd");
* list.add("pts"); list.add("cbb"); list.add("cbe"); list.add("pty"); list.add("cpt");
* list.add("pta"); list.add("adr"); list.add("trn");
*/ 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);
......
...@@ -17,6 +17,8 @@ import com.brilliance.remit.db.model.Cbe; ...@@ -17,6 +17,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;
...@@ -161,6 +163,15 @@ public class HttpTest { ...@@ -161,6 +163,15 @@ public class HttpTest {
cpdgrp.setNomcbe(new Cbe()); cpdgrp.setNomcbe(new Cbe());
cpdgrp.setNomcbb(new Cbb()); cpdgrp.setNomcbb(new Cbb());
List<Fep> fepList = new ArrayList<Fep>();
fepList.add(new Fep());
cpdgrp.setFepList(fepList);
List<Gle> gleList = new ArrayList<Gle>();
gleList.add(new Gle());
cpdgrp.setGleList(gleList);
String str = new Gson().toJson(cpdgrp); String str = new Gson().toJson(cpdgrp);
Cpdgrp cpdgrp2 = new Gson().fromJson(str, Cpdgrp.class); Cpdgrp cpdgrp2 = new Gson().fromJson(str, Cpdgrp.class);
System.out.println("save info=" + str); System.out.println("save info=" + str);
......
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