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

ibiz4j 发布系统代码 [ibz-wf,统一工作流]

上级 eabd981f
...@@ -51,6 +51,9 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl ...@@ -51,6 +51,9 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.core.workflow.service.IWFMemberService wfmemberService; protected cn.ibizlab.core.workflow.service.IWFMemberService wfmemberService;
@Autowired
@Lazy
IWFGroupService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -140,21 +143,49 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl ...@@ -140,21 +143,49 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> 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<WFGroup> list) { public boolean saveBatch(Collection<WFGroup> list) {
saveOrUpdateBatch(list,batchSize); List<WFGroup> create = new ArrayList<>();
List<WFGroup> update = new ArrayList<>();
for (WFGroup 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<WFGroup> list) { public void saveBatch(List<WFGroup> list) {
saveOrUpdateBatch(list,batchSize); List<WFGroup> create = new ArrayList<>();
List<WFGroup> update = new ArrayList<>();
for (WFGroup 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);
}
} }
......
...@@ -54,6 +54,9 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -54,6 +54,9 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.core.workflow.service.IWFUserService wfuserService; protected cn.ibizlab.core.workflow.service.IWFUserService wfuserService;
@Autowired
@Lazy
IWFMemberService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -144,7 +147,7 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -144,7 +147,7 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> 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);
} }
} }
...@@ -152,7 +155,21 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -152,7 +155,21 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
@Transactional @Transactional
public boolean saveBatch(Collection<WFMember> list) { public boolean saveBatch(Collection<WFMember> list) {
list.forEach(item->fillParentData(item)); list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); List<WFMember> create = new ArrayList<>();
List<WFMember> update = new ArrayList<>();
for (WFMember et : list) {
if (ObjectUtils.isEmpty(et.getMemberid()) || ObjectUtils.isEmpty(getById(et.getMemberid()))) {
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;
} }
...@@ -160,7 +177,21 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -160,7 +177,21 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
@Transactional @Transactional
public void saveBatch(List<WFMember> list) { public void saveBatch(List<WFMember> list) {
list.forEach(item->fillParentData(item)); list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); List<WFMember> create = new ArrayList<>();
List<WFMember> update = new ArrayList<>();
for (WFMember et : list) {
if (ObjectUtils.isEmpty(et.getMemberid()) || ObjectUtils.isEmpty(getById(et.getMemberid()))) {
create.add(et);
} else {
update.add(et);
}
}
if (create.size() > 0) {
proxyService.createBatch(create);
}
if (update.size() > 0) {
proxyService.updateBatch(update);
}
} }
...@@ -173,9 +204,6 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -173,9 +204,6 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
this.remove(new QueryWrapper<WFMember>().eq("groupid",id)); this.remove(new QueryWrapper<WFMember>().eq("groupid",id));
} }
@Autowired
@Lazy
IWFMemberService proxyService;
@Override @Override
public void saveByGroupid(String id,List<WFMember> list) { public void saveByGroupid(String id,List<WFMember> list) {
if(list==null) if(list==null)
......
...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils; ...@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("WFProcessDefinitionServiceImpl") @Service("WFProcessDefinitionServiceImpl")
public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinitionMapper, WFProcessDefinition> implements IWFProcessDefinitionService { public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinitionMapper, WFProcessDefinition> implements IWFProcessDefinitionService {
@Autowired
@Lazy
IWFProcessDefinitionService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit ...@@ -133,21 +136,49 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
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<WFProcessDefinition> list) { public boolean saveBatch(Collection<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize); List<WFProcessDefinition> create = new ArrayList<>();
List<WFProcessDefinition> update = new ArrayList<>();
for (WFProcessDefinition et : list) {
if (ObjectUtils.isEmpty(et.getDefinitionkey()) || ObjectUtils.isEmpty(getById(et.getDefinitionkey()))) {
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<WFProcessDefinition> list) { public void saveBatch(List<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize); List<WFProcessDefinition> create = new ArrayList<>();
List<WFProcessDefinition> update = new ArrayList<>();
for (WFProcessDefinition et : list) {
if (ObjectUtils.isEmpty(et.getDefinitionkey()) || ObjectUtils.isEmpty(getById(et.getDefinitionkey()))) {
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("WFSystemServiceImpl") @Service("WFSystemServiceImpl")
public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> implements IWFSystemService { public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> implements IWFSystemService {
@Autowired
@Lazy
IWFSystemService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -133,21 +136,49 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i ...@@ -133,21 +136,49 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> 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<WFSystem> list) { public boolean saveBatch(Collection<WFSystem> list) {
saveOrUpdateBatch(list,batchSize); List<WFSystem> create = new ArrayList<>();
List<WFSystem> update = new ArrayList<>();
for (WFSystem et : list) {
if (ObjectUtils.isEmpty(et.getPssystemid()) || ObjectUtils.isEmpty(getById(et.getPssystemid()))) {
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<WFSystem> list) { public void saveBatch(List<WFSystem> list) {
saveOrUpdateBatch(list,batchSize); List<WFSystem> create = new ArrayList<>();
List<WFSystem> update = new ArrayList<>();
for (WFSystem et : list) {
if (ObjectUtils.isEmpty(et.getPssystemid()) || ObjectUtils.isEmpty(getById(et.getPssystemid()))) {
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 WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme ...@@ -51,6 +51,9 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.core.workflow.service.IWFMemberService wfmemberService; protected cn.ibizlab.core.workflow.service.IWFMemberService wfmemberService;
@Autowired
@Lazy
IWFUserService proxyService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -136,21 +139,49 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme ...@@ -136,21 +139,49 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
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<WFUser> list) { public boolean saveBatch(Collection<WFUser> list) {
saveOrUpdateBatch(list,batchSize); List<WFUser> create = new ArrayList<>();
List<WFUser> update = new ArrayList<>();
for (WFUser 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<WFUser> list) { public void saveBatch(List<WFUser> list) {
saveOrUpdateBatch(list,batchSize); List<WFUser> create = new ArrayList<>();
List<WFUser> update = new ArrayList<>();
for (WFUser 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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册