| @@ -59,6 +59,9 @@ public class WxWiWideInfo implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="expiredTime",name="expiredTime") | @io.swagger.annotations.ApiModelProperty(value="expiredTime",name="expiredTime") | ||||
| private Date expiredTime; | private Date expiredTime; | ||||
| /*卖外迪信息类型列表,1,支持客流 2,支持wifi*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="capability",name="capability") | |||||
| private String capability; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -105,6 +108,14 @@ public class WxWiWideInfo implements Serializable { | |||||
| this.expiredTime = expiredTime; | this.expiredTime = expiredTime; | ||||
| } | } | ||||
| public String getCapability() { | |||||
| return capability; | |||||
| } | |||||
| public void setCapability(String capability) { | |||||
| this.capability = capability; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumWiWideInfoStatus { | |||||
| INVALID(0, "未开通"), | |||||
| VALID(1, "已开通") | |||||
| ; | |||||
| public static EnumWiWideInfoStatus getEnum(Integer code) { | |||||
| for (EnumWiWideInfoStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumWiWideInfoStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -673,6 +674,17 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | ||||
| } | } | ||||
| wiWideInfo = list.get(0); | wiWideInfo = list.get(0); | ||||
| List<Integer> cap = JSONArray.parseArray(wiWideInfo.getCapability(), Integer.class); | |||||
| Integer dataType; | |||||
| try { | |||||
| dataType = Integer.valueOf(params.get("dataType")); | |||||
| }catch (Exception e){ | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | |||||
| } | |||||
| if (cap == null || !cap.stream().anyMatch(c->c.equals(dataType))) { | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | |||||
| } | |||||
| String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params); | String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params); | ||||
| JSONObject result = JSONObject.parseObject(res); | JSONObject result = JSONObject.parseObject(res); | ||||
| if (result.getInteger("result") == 200){ | if (result.getInteger("result") == 200){ | ||||
| @@ -9,11 +9,11 @@ | |||||
| <result column="wiwide_url" jdbcType="VARCHAR" property="wiwideUrl"/> | <result column="wiwide_url" jdbcType="VARCHAR" property="wiwideUrl"/> | ||||
| <result column="token" jdbcType="VARCHAR" property="token"/> | <result column="token" jdbcType="VARCHAR" property="token"/> | ||||
| <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime"/> | <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime"/> | ||||
| <result column="capability" jdbcType="VARCHAR" property="capability"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`wiwide_id`,`wiwide_key`,`wiwide_url`, `token`,`expired_time` | |||||
| `id`,`tenant_id`,`wiwide_id`,`wiwide_key`,`wiwide_url`, `token`,`expired_time`,`capability` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||