فهرست منبع

分页查询开通信息接口合并

wangfeng 6 سال پیش
والد
کامیت
e3b5707765

+ 9 - 0
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -17,6 +17,7 @@ import com.diagbot.dto.GetConsoleOpenedDTO;
 import com.diagbot.dto.OpenUpOnTrialDTO;
 import com.diagbot.dto.ProductServiceDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.UserAndProdutDTO;
 import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.ProductService;
 import com.diagbot.entity.ServiceInfo;
@@ -177,4 +178,12 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         }
         return RespDTO.onSuc(res);
     }
+    /**
+     * 
+     * @param userIds
+     * @return
+     */
+    public List<UserAndProdutDTO> getInformationAvailableByUserIds(List<Long> userIds){
+    	return getInformationAvailableByUserIds(userIds);
+    }
 }

+ 8 - 0
diagbotman-service/src/main/java/com/diagbot/mapper/OpenedProductsMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.dto.GetConsoleOnTrialDTO;
 import com.diagbot.dto.GetConsoleOpenedDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.UserAndProdutDTO;
 import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.OpenedProductsIndex;
@@ -107,4 +108,11 @@ public interface OpenedProductsMapper extends BaseMapper<OpenedProducts> {
      * @Date: 20:23 2018/9/20
      */
     public List<OpenedProducts> getOpendById(OpenedProducts openedProducts);
+    
+    /**
+     * 
+     * @param List<long> userIds
+     * @return 
+     */
+    public List<UserAndProdutDTO> getInformationAvailableByUserIds(List<Long> userIds);
 }

+ 6 - 0
diagbotman-service/src/main/java/com/diagbot/service/OpenedProductsService.java

@@ -69,5 +69,11 @@ public interface OpenedProductsService extends IService<OpenedProducts> {
      * @Date: 20:23 2018/9/20
      */
     public List<OpenedProducts> getOpendById(OpenedProducts openedProducts);
+    /**
+     * 
+     * @param List<long> userIds
+     * @return 
+     */
+    public List<UserAndProdutDTO> getInformationAvailableByUserIds(List<Long> userIds);
 
 }

+ 5 - 0
diagbotman-service/src/main/java/com/diagbot/service/impl/OpenedProductsServiceImpl.java

@@ -3,6 +3,7 @@ package com.diagbot.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.UserAndProdutDTO;
 import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.OpenedProductsIndex;
@@ -82,4 +83,8 @@ public class OpenedProductsServiceImpl extends ServiceImpl<OpenedProductsMapper,
     public List<OpenedProducts> getOpendById(OpenedProducts openedProducts) {
         return baseMapper.getOpendById(openedProducts);
     }
+    @Override
+    public List<UserAndProdutDTO> getInformationAvailableByUserIds(List<Long> userIds){
+    	return openedProductsMapper.getInformationAvailableByUserIds(userIds);
+    }
 }

+ 2 - 3
diagbotman-service/src/main/java/com/diagbot/web/ProductOrderController.java

@@ -150,9 +150,8 @@ public class ProductOrderController {
     @PostMapping("/getInformationAvailableAll")
     @SysLogger("getInformationAvailableAll")
     @ApiIgnore
-    public RespDTO<List<UserAndProdutDTO>>  getInformationAvailableByUserIds(){
-		OpenedProducts openedProducts =new OpenedProducts();
-    	List<UserAndProdutDTO> UserAndProdutData = openedProductsFacade.getInformationAvailableByUserId(openedProducts);
+    public RespDTO<List<UserAndProdutDTO>>  getInformationAvailableByUserIds(List<Long> userIds){
+    	List<UserAndProdutDTO> UserAndProdutData = openedProductsFacade.getInformationAvailableByUserIds(userIds);
     	return RespDTO.onSuc(UserAndProdutData);
     }
 }

+ 17 - 0
diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml

@@ -189,4 +189,21 @@
             and a.product_id =#{productId}
         </if>
     </select>
+    <select id="getInformationAvailableByUserIds" resultType="com.diagbot.dto.UserAndProdutDTO">
+        SELECT
+        a.id as Id,
+        a.product_id as productId,
+        a.user_id as userId,
+        a.start_time as startTime,
+        a.end_time as endTime,
+        a.service_status as serviceStatus,
+        a.access_type as accessType,
+        a.charge_type as chargeType,
+        b.name as productName
+        FROM diag_opened_products a JOIN diag_lantone_product b
+        ON a.product_id=b.id
+        WHERE
+        a.is_deleted = "N"
+        AND a.user_id in(#{userId})
+    </select>
 </mapper>

+ 1 - 1
user-service/src/main/java/com/diagbot/client/DiagbotmanService.java

@@ -19,6 +19,6 @@ import com.diagbot.dto.UserAndProdutUDTO;
 public interface DiagbotmanService {
 	
 	@PostMapping(value = "/productOrder/getInformationAvailableAll")
-	public RespDTO<List<UserAndProdutUDTO>> getInformationAvailableAll();
+	public RespDTO<List<UserAndProdutUDTO>> getInformationAvailableAll(List<Long> userIds);
 
 }

+ 2 - 2
user-service/src/main/java/com/diagbot/client/hystrix/DiagbotmanServiceHystrix.java

@@ -21,8 +21,8 @@ import lombok.extern.slf4j.Slf4j;
 public class DiagbotmanServiceHystrix implements DiagbotmanService {
 	
 	@Override
-	public RespDTO<List<UserAndProdutUDTO>> getInformationAvailableAll(){
-		 log.error("【hystrix】调用{}异常","getInformationAvailableByUserId");
+	public RespDTO<List<UserAndProdutUDTO>> getInformationAvailableAll(List<Long> userIds){
+		 log.error("【hystrix】调用{}异常","getInformationAvailableAll");
 	        return null;
 	}
 

+ 5 - 2
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -688,9 +688,12 @@ public class UserFacade extends UserServiceImpl {
          IPage<UserInfoDTO> user = selectUserInfoListPage(page, userInfo);
          List<UserInfoDTO> userData = user.getRecords();
          List<Long> userIds = new ArrayList<>();
-//         for ()
+         for (UserInfoDTO userInfoDTO: userData){
+        	 Long userInfoId = userInfoDTO.getUserId();
+        	 userIds.add(userInfoId);
+         }
 
-         RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanService.getInformationAvailableAll();
+         RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanService.getInformationAvailableAll(userIds);
 
          if(InformationData == null || !"0".equals(InformationData.code) ) {
              throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,