Procházet zdrojové kódy

可试用产品修改1

rgb před 6 roky
rodič
revize
3ec9554f23

+ 25 - 0
diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOnTrialDTO.java

@@ -33,6 +33,11 @@ public class GetConsoleOnTrialDTO implements Serializable {
      * 接入模式信息
      */
     private String accessTypeMsg;
+    
+    /**
+     * 产品停用状态
+     */
+    private Integer serviceStatus;
 
     /**
      * 是否已试用
@@ -44,6 +49,26 @@ public class GetConsoleOnTrialDTO implements Serializable {
      */
     private String trialUrl;
 
+    /**
+     * 
+     */
+    private String appKeyId;
+    
+    /**
+     * 
+     */
+    private String appKeySecret;
+    
+    /**
+     * token状态
+     */
+    private Integer tokenStatus;
+    
+    /**
+     * token状态信息
+     */
+    private String tokenStatusMsg;
+    
     /**
      * 开通日期
      */

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

@@ -83,24 +83,50 @@
     </select>
 
     <select id="getConsoleOnTrial" parameterType="long"
-            resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
-    	SELECT
-			a.id as id,
-			a.name as name,
-			a.access_type as accessType,
-			case when d.id is null then 'N' else 'Y' end as isUsed,
-			a.trial_url as trialUrl,
-			DATE_FORMAT(d.starting_date,'%Y-%m-%d') as startingDate,
-			DATE_FORMAT(d.expiring_date,'%Y-%m-%d') as expiringDate
-		FROM diag_lantone_product a LEFT JOIN diag_product_service b on a.id=b.product_id
-		JOIN diag_service_info c on b.service_id=c.id
-		JOIN diag_service_token d on b.id=d.product_service_id
-		where a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and d.is_deleted='N'
-		and a.trial_status=1
-		and c.type=2
-		and c.user_id=#{userId}
-		and a.id not in (SELECT product_id FROM diag_opened_products where user_id=#{userId})
-    </select>
+		resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
+		SELECT
+		a.id as id,
+		a.name as name,
+		a.service_status as serviceStatus,
+		a.access_type as accessType,
+		a.trial_url as trialUrl,
+		b.app_key_id as appKeyId,
+		b.app_key_secret as appKeySecret,
+		b.`STATUS` as tokenStatus,
+		DATE_FORMAT(b.starting_date,'%Y-%m-%d') as expiringDate,
+		DATE_FORMAT(b.expiring_date,'%Y-%m-%d') as expiringDate
+		FROM
+		diag_lantone_product a
+		LEFT JOIN (
+		SELECT
+		b.product_id,
+		c.app_key_id,
+		c.app_key_secret,
+		c.`status`,
+		c.starting_date,
+		c.expiring_date
+		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 = 2
+		AND c.type = 3
+		) b ON a.id = b.product_id
+		WHERE
+		a.is_deleted = 'N' and a.trial_status=1
+		AND a.id NOT IN (
+		SELECT
+		product_id
+		FROM
+		diag_opened_products
+		WHERE
+		user_id = #{userId})
+	</select>
 
     <select id="getConsoleOnTrialCount" parameterType="long" resultType="int">
     	SELECT