瀏覽代碼

返回结果优化

Zhaops 6 年之前
父節點
當前提交
91e4b5c118
共有 1 個文件被更改,包括 13 次插入3 次删除
  1. 13 3
      diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

+ 13 - 3
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import ch.qos.logback.core.pattern.ConverterUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.UserServiceClient;
@@ -30,6 +31,7 @@ import org.springframework.stereotype.Component;
 
 import java.lang.reflect.Array;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -115,8 +117,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public List<LantoneProductWrapper> opendedProductByCurrentUser() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         List<LantoneProductWrapper> list = this.opendedProductByUserId(userId);
-        List<Long> list1 = new ArrayList<>();
-        RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
+        List<Long> userIdList = new ArrayList<>();
+        userIdList.add(userId);
+        RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
         if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "获取用户机构信息失败");
@@ -131,12 +134,19 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             for (int i = 0; i < accessType.length; i++) {
                 accessTypeArray[i] = AccessTypeEnum.getName(Integer.parseInt(accessType[i]));
             }
-            for (int i = 0; i < accessType.length; i++) {
+            for (int i = 0; i < chargeType.length; i++) {
                 chargeTypeArray[i] = AccessTypeEnum.getName(Integer.parseInt(chargeType[i]));
             }
 
             product.setAccessTypeArray(accessTypeArray);
             product.setChargeTypeArray(chargeTypeArray);
+
+            String[] serviceIds = product.getServiceIds().split(",|,");
+            Long[] services = new Long[serviceIds.length];
+            for (int i = 0; i < serviceIds.length; i++) {
+                services[i] = Long.parseLong(serviceIds[i]);
+            }
+            product.setServices(services);
         }
         return list;
     }