提交 07d12064 编写于 作者: sq3536's avatar sq3536

job

上级 6e70c295
......@@ -44,17 +44,20 @@ public class JobsServiceImpl implements IJobsService {
@Override
public boolean registry(RegistryParam registryParam) {
JobsRegistry jobsRegistry = jobsRegistryService.getOne(Wrappers.<JobsRegistry>lambdaQuery().eq(JobsRegistry::getApp, registryParam.getApp())
.eq(JobsRegistry::getAddress, registryParam.getAddress()),false);
if(jobsRegistry==null)
jobsRegistry=new JobsRegistry();
JobsRegistry jobsRegistry = new JobsRegistry();
jobsRegistry.setApp(registryParam.getApp());
jobsRegistry.setAddress(registryParam.getAddress());
jobsRegistry.setStatus(registryParam.getRegisterStatusEnum().getValue());
jobsRegistry.setUpdateTime(BigInteger.valueOf(JobsClock.currentTimeMillis()));
return jobsRegistryService.save(jobsRegistry);
int ret = jobsRegistryService.getBaseMapper().update(jobsRegistry,
Wrappers.<JobsRegistry>lambdaQuery().eq(JobsRegistry::getApp, registryParam.getApp())
.eq(JobsRegistry::getAddress, registryParam.getAddress()));
if (ret < 1) {
ret = jobsRegistryService.getBaseMapper().insert(jobsRegistry);
}
return ret > 0;
}
......@@ -105,17 +108,13 @@ public class JobsServiceImpl implements IJobsService {
@Override
public boolean removeApp(RegistryParam registryParam) {
JobsRegistry jobsRegistry = jobsRegistryService.getOne(Wrappers.<JobsRegistry>lambdaQuery().eq(JobsRegistry::getApp, registryParam.getApp())
.eq(JobsRegistry::getAddress, registryParam.getAddress()),false);
if(jobsRegistry==null)
jobsRegistry=new JobsRegistry();
JobsRegistry jobsRegistry = new JobsRegistry();
jobsRegistry.setApp(registryParam.getApp());
jobsRegistry.setAddress(registryParam.getAddress());
jobsRegistry.setStatus(registryParam.getRegisterStatusEnum().getValue());
return jobsRegistryService.getBaseMapper().updateById(jobsRegistry)>0;
return jobsRegistryService.getBaseMapper().update(jobsRegistry,Wrappers.<JobsRegistry>lambdaQuery().eq(JobsRegistry::getApp, registryParam.getApp())
.eq(JobsRegistry::getAddress, registryParam.getAddress()))>0;
}
@Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册