|
@@ -1,8 +1,10 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.entity.ServiceInfo;
|
|
|
+import com.diagbot.enums.ServiceTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.ServiceInfoServiceImpl;
|
|
@@ -21,9 +23,10 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class ServiceInfoFacade extends ServiceInfoServiceImpl {
|
|
|
/**
|
|
|
- * @Description: 新建服务端
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/18 16:31
|
|
|
+ * 新建服务端
|
|
|
+ *
|
|
|
+ * @param serviceSaveVO
|
|
|
+ * @return
|
|
|
*/
|
|
|
public ServiceInfo createService(ServiceSaveVO serviceSaveVO) {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
@@ -39,9 +42,10 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description: 修改服务端
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/18 16:31
|
|
|
+ * 修改服务端
|
|
|
+ *
|
|
|
+ * @param serviceInfo
|
|
|
+ * @return
|
|
|
*/
|
|
|
public Boolean updateService(ServiceInfo serviceInfo) {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
@@ -56,26 +60,37 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description: 获取当前登录用户服务列表
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/18 16:31
|
|
|
+ * 获取当前登录用户服务列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
*/
|
|
|
public List<ServiceInfo> getServiceListByCurrentUser() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
- List<ServiceInfo> list = this.getListByUserId(userId);
|
|
|
+ QueryWrapper<ServiceInfo> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ //服务端类型(1:用户建立,2:系统生成)
|
|
|
+ qw.eq("type", ServiceTypeEnum.User_Create.getKey());
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ List<ServiceInfo> list = this.list(qw);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description: 获取当前登录用户服务分页列表
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/19 14:05
|
|
|
+ * 获取当前登录用户服务分页列表
|
|
|
+ *
|
|
|
+ * @param page
|
|
|
+ * @return
|
|
|
*/
|
|
|
public IPage<ServiceInfo> getServiceListPageByCurrentUser(Page<ServiceInfo> page) {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
ServiceInfo serviceInfoVO = new ServiceInfo();
|
|
|
serviceInfoVO.setUserId(userId);
|
|
|
- IPage<ServiceInfo> pagelist = this.selectServiceListPage(page, serviceInfoVO);
|
|
|
+ serviceInfoVO.setType(ServiceTypeEnum.User_Create.getKey());
|
|
|
+ QueryWrapper<ServiceInfo> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ qw.eq("type", ServiceTypeEnum.User_Create.getKey());
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ IPage<ServiceInfo> pagelist = this.page(page, qw);
|
|
|
return pagelist;
|
|
|
}
|
|
|
}
|