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

ibiz4j 发布系统代码 [ibiz-task,任务调度]

上级 450ad6fe
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("JobsInfoServiceImpl") @Service("JobsInfoServiceImpl")
public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> implements IJobsInfoService { public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> implements IJobsInfoService {
@Autowired
@Lazy
IJobsInfoService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -149,21 +152,49 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i ...@@ -149,21 +152,49 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
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<JobsInfo> list) { public boolean saveBatch(Collection<JobsInfo> list) {
saveOrUpdateBatch(list,batchSize); List<JobsInfo> create = new ArrayList<>();
List<JobsInfo> update = new ArrayList<>();
for (JobsInfo 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<JobsInfo> list) { public void saveBatch(List<JobsInfo> list) {
saveOrUpdateBatch(list,batchSize); List<JobsInfo> create = new ArrayList<>();
List<JobsInfo> update = new ArrayList<>();
for (JobsInfo 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);
}
} }
@Override @Override
......
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("JobsLockServiceImpl") @Service("JobsLockServiceImpl")
public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> implements IJobsLockService { public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> implements IJobsLockService {
@Autowired
@Lazy
IJobsLockService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i ...@@ -133,21 +136,49 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
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<JobsLock> list) { public boolean saveBatch(Collection<JobsLock> list) {
saveOrUpdateBatch(list,batchSize); List<JobsLock> create = new ArrayList<>();
List<JobsLock> update = new ArrayList<>();
for (JobsLock 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<JobsLock> list) { public void saveBatch(List<JobsLock> list) {
saveOrUpdateBatch(list,batchSize); List<JobsLock> create = new ArrayList<>();
List<JobsLock> update = new ArrayList<>();
for (JobsLock 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);
}
} }
......
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("JobsLogServiceImpl") @Service("JobsLogServiceImpl")
public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> implements IJobsLogService { public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> implements IJobsLogService {
@Autowired
@Lazy
IJobsLogService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl ...@@ -133,21 +136,49 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> 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<JobsLog> list) { public boolean saveBatch(Collection<JobsLog> list) {
saveOrUpdateBatch(list,batchSize); List<JobsLog> create = new ArrayList<>();
List<JobsLog> update = new ArrayList<>();
for (JobsLog 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<JobsLog> list) { public void saveBatch(List<JobsLog> list) {
saveOrUpdateBatch(list,batchSize); List<JobsLog> create = new ArrayList<>();
List<JobsLog> update = new ArrayList<>();
for (JobsLog 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);
}
} }
......
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("JobsRegistryServiceImpl") @Service("JobsRegistryServiceImpl")
public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, JobsRegistry> implements IJobsRegistryService { public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, JobsRegistry> implements IJobsRegistryService {
@Autowired
@Lazy
IJobsRegistryService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job ...@@ -133,21 +136,49 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
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<JobsRegistry> list) { public boolean saveBatch(Collection<JobsRegistry> list) {
saveOrUpdateBatch(list,batchSize); List<JobsRegistry> create = new ArrayList<>();
List<JobsRegistry> update = new ArrayList<>();
for (JobsRegistry 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<JobsRegistry> list) { public void saveBatch(List<JobsRegistry> list) {
saveOrUpdateBatch(list,batchSize); List<JobsRegistry> create = new ArrayList<>();
List<JobsRegistry> update = new ArrayList<>();
for (JobsRegistry 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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册