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

ibiz4j 发布系统代码 [ibiz-notify,通知消息]

上级 0276d578
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("MsgBodyServiceImpl") @Service("MsgBodyServiceImpl")
public class MsgBodyServiceImpl extends ServiceImpl<MsgBodyMapper, MsgBody> implements IMsgBodyService { public class MsgBodyServiceImpl extends ServiceImpl<MsgBodyMapper, MsgBody> implements IMsgBodyService {
@Autowired
@Lazy
IMsgBodyService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class MsgBodyServiceImpl extends ServiceImpl<MsgBodyMapper, MsgBody> impl ...@@ -133,21 +136,49 @@ public class MsgBodyServiceImpl extends ServiceImpl<MsgBodyMapper, MsgBody> impl
if (null == et) { if (null == et) {
return false; return false;
} else { } else {
return checkKey(et) ? this.update(et) : this.create(et); return checkKey(et) ? proxyService.update(et) : proxyService.create(et);
} }
} }
@Override @Override
@Transactional @Transactional
public boolean saveBatch(Collection<MsgBody> list) { public boolean saveBatch(Collection<MsgBody> list) {
saveOrUpdateBatch(list,batchSize); List<MsgBody> create = new ArrayList<>();
List<MsgBody> update = new ArrayList<>();
for (MsgBody et : list) {
if (ObjectUtils.isEmpty(et.getMsgId()) || ObjectUtils.isEmpty(getById(et.getMsgId()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
return true; return true;
} }
@Override @Override
@Transactional @Transactional
public void saveBatch(List<MsgBody> list) { public void saveBatch(List<MsgBody> list) {
saveOrUpdateBatch(list,batchSize); List<MsgBody> create = new ArrayList<>();
List<MsgBody> update = new ArrayList<>();
for (MsgBody et : list) {
if (ObjectUtils.isEmpty(et.getMsgId()) || ObjectUtils.isEmpty(getById(et.getMsgId()))) {
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 MsgOpenAccessServiceImpl extends ServiceImpl<MsgOpenAccessMapper, M ...@@ -51,6 +51,9 @@ public class MsgOpenAccessServiceImpl extends ServiceImpl<MsgOpenAccessMapper, M
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.core.notify.service.IMsgTemplateService msgtemplateService; protected cn.ibizlab.core.notify.service.IMsgTemplateService msgtemplateService;
@Autowired
@Lazy
IMsgOpenAccessService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -136,21 +139,49 @@ public class MsgOpenAccessServiceImpl extends ServiceImpl<MsgOpenAccessMapper, M ...@@ -136,21 +139,49 @@ public class MsgOpenAccessServiceImpl extends ServiceImpl<MsgOpenAccessMapper, M
if (null == et) { if (null == et) {
return false; return false;
} else { } else {
return checkKey(et) ? this.update(et) : this.create(et); return checkKey(et) ? proxyService.update(et) : proxyService.create(et);
} }
} }
@Override @Override
@Transactional @Transactional
public boolean saveBatch(Collection<MsgOpenAccess> list) { public boolean saveBatch(Collection<MsgOpenAccess> list) {
saveOrUpdateBatch(list,batchSize); List<MsgOpenAccess> create = new ArrayList<>();
List<MsgOpenAccess> update = new ArrayList<>();
for (MsgOpenAccess 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; return true;
} }
@Override @Override
@Transactional @Transactional
public void saveBatch(List<MsgOpenAccess> list) { public void saveBatch(List<MsgOpenAccess> list) {
saveOrUpdateBatch(list,batchSize); List<MsgOpenAccess> create = new ArrayList<>();
List<MsgOpenAccess> update = new ArrayList<>();
for (MsgOpenAccess 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 MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe ...@@ -51,6 +51,9 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.core.notify.service.IMsgOpenAccessService msgopenaccessService; protected cn.ibizlab.core.notify.service.IMsgOpenAccessService msgopenaccessService;
@Autowired
@Lazy
IMsgTemplateService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -141,7 +144,7 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe ...@@ -141,7 +144,7 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe
if (null == et) { if (null == et) {
return false; return false;
} else { } 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 MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe ...@@ -149,7 +152,21 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe
@Transactional @Transactional
public boolean saveBatch(Collection<MsgTemplate> list) { public boolean saveBatch(Collection<MsgTemplate> list) {
list.forEach(item->fillParentData(item)); list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); List<MsgTemplate> create = new ArrayList<>();
List<MsgTemplate> update = new ArrayList<>();
for (MsgTemplate et : list) {
if (ObjectUtils.isEmpty(et.getTid()) || ObjectUtils.isEmpty(getById(et.getTid()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
return true; return true;
} }
...@@ -157,7 +174,21 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe ...@@ -157,7 +174,21 @@ public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTe
@Transactional @Transactional
public void saveBatch(List<MsgTemplate> list) { public void saveBatch(List<MsgTemplate> list) {
list.forEach(item->fillParentData(item)); list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); List<MsgTemplate> create = new ArrayList<>();
List<MsgTemplate> update = new ArrayList<>();
for (MsgTemplate et : list) {
if (ObjectUtils.isEmpty(et.getTid()) || ObjectUtils.isEmpty(getById(et.getTid()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
} }
......
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("MsgUserAccountServiceImpl") @Service("MsgUserAccountServiceImpl")
public class MsgUserAccountServiceImpl extends ServiceImpl<MsgUserAccountMapper, MsgUserAccount> implements IMsgUserAccountService { public class MsgUserAccountServiceImpl extends ServiceImpl<MsgUserAccountMapper, MsgUserAccount> implements IMsgUserAccountService {
@Autowired
@Lazy
IMsgUserAccountService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class MsgUserAccountServiceImpl extends ServiceImpl<MsgUserAccountMapper, ...@@ -133,21 +136,49 @@ public class MsgUserAccountServiceImpl extends ServiceImpl<MsgUserAccountMapper,
if (null == et) { if (null == et) {
return false; return false;
} else { } else {
return checkKey(et) ? this.update(et) : this.create(et); return checkKey(et) ? proxyService.update(et) : proxyService.create(et);
} }
} }
@Override @Override
@Transactional @Transactional
public boolean saveBatch(Collection<MsgUserAccount> list) { public boolean saveBatch(Collection<MsgUserAccount> list) {
saveOrUpdateBatch(list,batchSize); List<MsgUserAccount> create = new ArrayList<>();
List<MsgUserAccount> update = new ArrayList<>();
for (MsgUserAccount 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; return true;
} }
@Override @Override
@Transactional @Transactional
public void saveBatch(List<MsgUserAccount> list) { public void saveBatch(List<MsgUserAccount> list) {
saveOrUpdateBatch(list,batchSize); List<MsgUserAccount> create = new ArrayList<>();
List<MsgUserAccount> update = new ArrayList<>();
for (MsgUserAccount 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);
}
} }
......
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
<mybatis-plus.version>3.3.1</mybatis-plus.version> <mybatis-plus.version>3.3.1</mybatis-plus.version>
<mybatis-plus-dynamic-datasource.version>3.0.0</mybatis-plus-dynamic-datasource.version> <mybatis-plus-dynamic-datasource.version>3.0.0</mybatis-plus-dynamic-datasource.version>
<!-- Liquibase -->
<liquibase.version>3.6.3</liquibase.version>
<!-- Swagger2 --> <!-- Swagger2 -->
<springfox-swagger.version>2.9.2</springfox-swagger.version> <springfox-swagger.version>2.9.2</springfox-swagger.version>
...@@ -60,7 +57,7 @@ ...@@ -60,7 +57,7 @@
<jsonwebtoken-jjwt.version>0.9.1</jsonwebtoken-jjwt.version> <jsonwebtoken-jjwt.version>0.9.1</jsonwebtoken-jjwt.version>
<!--Liquibase数据库版本更新工具--> <!--Liquibase数据库版本更新工具-->
<liquibase.version>3.8.7</liquibase.version> <liquibase.version>3.9.0</liquibase.version>
<!--H2内存数据库--> <!--H2内存数据库-->
<h2.version>1.4.200</h2.version> <h2.version>1.4.200</h2.version>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册