提交 bc177e9b 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ ibiz-pay,支付]

上级 b25ca2e7
......@@ -51,6 +51,9 @@ public class PayOpenAccessServiceImpl extends ServiceImpl<PayOpenAccessMapper, P
@Autowired
@Lazy
protected cn.ibizlab.core.pay.service.IPayTradeService paytradeService;
@Autowired
@Lazy
IPayOpenAccessService proxyService;
protected int batchSize = 500;
......@@ -136,21 +139,49 @@ public class PayOpenAccessServiceImpl extends ServiceImpl<PayOpenAccessMapper, P
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
return checkKey(et) ? proxyService.update(et) : proxyService.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<PayOpenAccess> list) {
saveOrUpdateBatch(list,batchSize);
List<PayOpenAccess> create = new ArrayList<>();
List<PayOpenAccess> update = new ArrayList<>();
for (PayOpenAccess et : list) {
if (ObjectUtils.isEmpty(et.getId()) || ObjectUtils.isEmpty(getById(et.getId()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
return true;
}
@Override
@Transactional
public void saveBatch(List<PayOpenAccess> list) {
saveOrUpdateBatch(list,batchSize);
List<PayOpenAccess> create = new ArrayList<>();
List<PayOpenAccess> update = new ArrayList<>();
for (PayOpenAccess et : list) {
if (ObjectUtils.isEmpty(et.getId()) || ObjectUtils.isEmpty(getById(et.getId()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
}
......
......@@ -51,6 +51,9 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
@Autowired
@Lazy
protected cn.ibizlab.core.pay.service.IPayOpenAccessService payopenaccessService;
@Autowired
@Lazy
IPayTradeService proxyService;
protected int batchSize = 500;
......@@ -141,7 +144,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
return checkKey(et) ? proxyService.update(et) : proxyService.create(et);
}
}
......@@ -149,7 +152,21 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
@Transactional
public boolean saveBatch(Collection<PayTrade> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
List<PayTrade> create = new ArrayList<>();
List<PayTrade> update = new ArrayList<>();
for (PayTrade et : list) {
if (ObjectUtils.isEmpty(et.getTradeId()) || ObjectUtils.isEmpty(getById(et.getTradeId()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
return true;
}
......@@ -157,7 +174,21 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
@Transactional
public void saveBatch(List<PayTrade> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
List<PayTrade> create = new ArrayList<>();
List<PayTrade> update = new ArrayList<>();
for (PayTrade et : list) {
if (ObjectUtils.isEmpty(et.getTradeId()) || ObjectUtils.isEmpty(getById(et.getTradeId()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
}
......
......@@ -31,9 +31,6 @@
<mybatis-plus.version>3.3.1</mybatis-plus.version>
<mybatis-plus-dynamic-datasource.version>3.0.0</mybatis-plus-dynamic-datasource.version>
<!-- Liquibase -->
<liquibase.version>3.6.3</liquibase.version>
<!-- Swagger2 -->
<springfox-swagger.version>2.9.2</springfox-swagger.version>
......@@ -60,7 +57,7 @@
<jsonwebtoken-jjwt.version>0.9.1</jsonwebtoken-jjwt.version>
<!--Liquibase数据库版本更新工具-->
<liquibase.version>3.8.7</liquibase.version>
<liquibase.version>3.9.0</liquibase.version>
<!--H2内存数据库-->
<h2.version>1.4.200</h2.version>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册