|
@@ -1,7 +1,14 @@
|
|
package io.renren.modules.generator.service.impl;
|
|
package io.renren.modules.generator.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
+import io.renren.modules.generator.dao.ApplicationVoDao;
|
|
|
|
+import io.renren.modules.generator.entity.ApplicationsEntity_Vo;
|
|
|
|
+import io.renren.modules.generator.service.EdgenodesService;
|
|
|
|
+import lombok.Data;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -16,7 +23,12 @@ import io.renren.modules.generator.service.ApplicationsService;
|
|
|
|
|
|
@Service("applicationsService")
|
|
@Service("applicationsService")
|
|
public class ApplicationsServiceImpl extends ServiceImpl<ApplicationsDao, ApplicationsEntity> implements ApplicationsService {
|
|
public class ApplicationsServiceImpl extends ServiceImpl<ApplicationsDao, ApplicationsEntity> implements ApplicationsService {
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ApplicationVoDao applicationVoDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ ApplicationsDao applicationsDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ EdgenodesService edgenodesService;
|
|
@Override
|
|
@Override
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
String applicationName=(String) params.get("applicationName");
|
|
String applicationName=(String) params.get("applicationName");
|
|
@@ -31,4 +43,42 @@ public class ApplicationsServiceImpl extends ServiceImpl<ApplicationsDao, Applic
|
|
return new PageUtils(page);
|
|
return new PageUtils(page);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public PageUtils queryPageOnUse(Map<String, Object> params) {
|
|
|
|
+ String applicationName=(String) params.get("applicationName");
|
|
|
|
+ String deployDeviceIdString=(String) params.get("deployDeviceId");
|
|
|
|
+ int deployDeviceId=0;
|
|
|
|
+ if (deployDeviceIdString!=null&&deployDeviceIdString.length()>0){
|
|
|
|
+ deployDeviceId=Integer.valueOf(deployDeviceIdString);
|
|
|
|
+ }
|
|
|
|
+ int pageSize = Integer.valueOf((String) params.get("limit"));
|
|
|
|
+ int pageIndex = Integer.valueOf((String) params.get("page"));
|
|
|
|
+
|
|
|
|
+ List<ApplicationsEntity_Vo> appsInfo;
|
|
|
|
+ List<ApplicationsEntity_Vo> appsAllInfo;
|
|
|
|
+ appsInfo=applicationVoDao.getAppInfo(new QueryWrapper<ApplicationsEntity_Vo>()
|
|
|
|
+ .like(StringUtils.isNotBlank(applicationName),"application_name",applicationName)
|
|
|
|
+ .eq(deployDeviceIdString!=null&&deployDeviceIdString.length()>0,"deploy_device_id",deployDeviceId)
|
|
|
|
+ .last("limit " + (pageIndex - 1) * pageSize + "," + pageSize + ";")
|
|
|
|
+ );
|
|
|
|
+ appsAllInfo=applicationVoDao.getAppInfo(new QueryWrapper<ApplicationsEntity_Vo>()
|
|
|
|
+ .like(StringUtils.isNotBlank(applicationName),"application_name",applicationName)
|
|
|
|
+ .eq(deployDeviceIdString!=null&&deployDeviceIdString.length()>0,"deploy_device_id",deployDeviceId));
|
|
|
|
+ for (ApplicationsEntity_Vo vo:appsInfo){
|
|
|
|
+ if (vo.getDeployDeviceId()==0){
|
|
|
|
+ vo.setDeployDeviceName("中心云");
|
|
|
|
+ }else {
|
|
|
|
+ vo.setDeployDeviceName(edgenodesService.getById(vo.getDeployDeviceId()).getEdgenodesName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return new PageUtils(appsInfo,appsAllInfo.size(),pageSize,pageIndex);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int selectByDeployDeviceId(Integer deployDeviceId) {
|
|
|
|
+ return applicationsDao.selectByDeployDeviceId(deployDeviceId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|