浏览代码

开通产品修改

rgb 6 年之前
父节点
当前提交
c7fa42d92b

+ 20 - 0
diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOpenedDTO.java

@@ -75,4 +75,24 @@ public class GetConsoleOpenedDTO implements Serializable {
      */
     private String url;
     
+    /**
+     * 
+     */
+    private String appKeyId;
+    
+    /**
+     * 
+     */
+    private String appKeySecret;
+    
+    /**
+     * 是否可以进入
+     */
+    private Integer isInto;
+    
+    /**
+     * 是否显示生成token
+     */
+    private Integer isCreateToken;
+    
 }

+ 13 - 1
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -69,7 +69,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
      * @return 所有已经开通的产品
      */
     public List<GetConsoleOpenedDTO> getConsoleOpened() {
-        Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
+    	Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         
         List<GetConsoleOpenedDTO> retList = baseMapper.getConsoleOpened(userId);
         for(GetConsoleOpenedDTO i : retList){
@@ -79,6 +79,18 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         	}
         	i.setAccessTypeMsg(accessTypeMsg);
         	i.setServiceStatusMsg(StatusEnum.getName(i.getServiceStatus()));
+        	
+        	if(i.getAccessType().indexOf("1")!=-1){
+        		i.setIsInto(1);
+        	}else{
+        		i.setIsInto(0);
+        		i.setUrl("");
+        	}
+        	if(i.getAccessType().replace("1", "").replace(",", "").length()>0){
+        		i.setIsCreateToken(1);
+        	}else{
+        		i.setIsCreateToken(0);
+        	}
         }
         
         return retList;

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

@@ -64,10 +64,28 @@
 			a.service_status as serviceStatus,
 			b.url as url,
 			b.access_type as accessType,
+			d.app_key_id as appKeyId,
+			d.app_key_secret as appKeySecret,
 			case when c.id is null then 0 else 1 end as renewalsStutas,
 			case when sysdate()>a.end_time then 0 else 1 end as isExpire
 		from diag_opened_products a join diag_lantone_product b on a.product_id=b.id
 		left join diag_user_renewals c on a.user_id=c.user_id and a.product_id=c.product_id and c.renewals_status=0 and c.cancel_renewals=0 and c.is_deleted='N'
+		left join 
+		(SELECT
+		b.product_id,
+		c.app_key_id,
+		c.app_key_secret
+		FROM
+		diag_service_info a
+		JOIN diag_product_service b ON a.id = b.service_id
+		JOIN diag_service_token c ON b.id = c.product_service_id
+		WHERE
+		a.is_deleted = 'N'
+		AND b.is_deleted = 'N'
+		AND c.is_deleted = 'N'
+		AND a.user_id = #{userId}
+		AND a.type = 1
+		AND c.type = 1) d on b.id=d.product_id
 		where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId}
     </select>