Commit c5db221a authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改代码扫描测试账号遗留问题,修改环境配置表增加字段,同时修改对应代码增加字段,修改获取当前配置接口逻辑,完成接口冒烟测试;
2.修改天气数据抽取定时任务,修改定时任务配置,将两小时抽取数据改完半小时抽取数据;
3.修改代码扫描硬编码问题,修改第三方环境配置表,增加字段保存第三方接口认证配置信息,修改代码添加对应字段同时修改代码逻辑,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent a65eda7e
...@@ -246,7 +246,7 @@ public class LoginService { ...@@ -246,7 +246,7 @@ public class LoginService {
* @param context 上下文 * @param context 上下文
* @return {@link GetConfigOilFieldOutput } * @return {@link GetConfigOilFieldOutput }
*/ */
public GetConfigOilFieldOutput getCurrentConfig(XContext context) { private GetConfigOilFieldOutput getCurrentConfig(XContext context) {
IConfigOilFieldCloudService bean = context.getBean(IConfigOilFieldCloudService.class); IConfigOilFieldCloudService bean = context.getBean(IConfigOilFieldCloudService.class);
XSingleResult<GetConfigOilFieldOutput> currentConfig = bean.getCurrentConfig(context); XSingleResult<GetConfigOilFieldOutput> currentConfig = bean.getCurrentConfig(context);
currentConfig.throwIfFail(); currentConfig.throwIfFail();
......
...@@ -37,4 +37,7 @@ public class GetConfigOilFieldOutput { ...@@ -37,4 +37,7 @@ public class GetConfigOilFieldOutput {
@XText("演示日期") @XText("演示日期")
private Date demoDate; private Date demoDate;
@XText("第三方接口认证配置(JsonString)")
private String thirdPartyAuthConfig;
} }
...@@ -59,4 +59,8 @@ public class ConfigOilFieldEnt implements Serializable { ...@@ -59,4 +59,8 @@ public class ConfigOilFieldEnt implements Serializable {
@XText("演示日期") @XText("演示日期")
@TableField @TableField
private Date demoDate; private Date demoDate;
@XText("第三方接口认证配置(JsonString)")
@TableField
private String thirdPartyAuthConfig;
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ import java.util.Date; ...@@ -15,6 +15,7 @@ import java.util.Date;
*/ */
@Data @Data
public class ConfigOilFieldView implements Serializable { public class ConfigOilFieldView implements Serializable {
@XText("ID") @XText("ID")
@TableField @TableField
private Long id; private Long id;
...@@ -54,4 +55,8 @@ public class ConfigOilFieldView implements Serializable { ...@@ -54,4 +55,8 @@ public class ConfigOilFieldView implements Serializable {
@XText("演示日期") @XText("演示日期")
@TableField @TableField
private Date demoDate; private Date demoDate;
@XText("第三方接口认证配置(JsonString)")
@TableField
private String thirdPartyAuthConfig;
} }
\ No newline at end of file
...@@ -37,4 +37,7 @@ public class GetConfigOilFieldOutput { ...@@ -37,4 +37,7 @@ public class GetConfigOilFieldOutput {
@XText("演示日期") @XText("演示日期")
private Date demoDate; private Date demoDate;
@XText("第三方接口认证配置(JsonString)")
private String thirdPartyAuthConfig;
} }
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="simulate_user" property="simulateUser" jdbcType="VARCHAR"/> <result column="simulate_user" property="simulateUser" jdbcType="VARCHAR"/>
<result column="is_demo" property="isDemo" jdbcType="TINYINT"/> <result column="is_demo" property="isDemo" jdbcType="TINYINT"/>
<result column="demo_date" property="demoDate" jdbcType="VARCHAR"/> <result column="demo_date" property="demoDate" jdbcType="VARCHAR"/>
<result column="third_party_auth_config" property="thirdPartyAuthConfig" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -24,7 +25,8 @@ ...@@ -24,7 +25,8 @@
auth_key, auth_key,
simulate_user, simulate_user,
is_demo, is_demo,
demo_date demo_date,
third_party_auth_config
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select select
......
...@@ -9,6 +9,7 @@ import cn.hutool.core.text.CharSequenceUtil; ...@@ -9,6 +9,7 @@ import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import pps.cloud.base.service.BasePhotovoltaicPlantCloudService; import pps.cloud.base.service.BasePhotovoltaicPlantCloudService;
import pps.cloud.base.service.IBasePowerLineCloudService; import pps.cloud.base.service.IBasePowerLineCloudService;
...@@ -450,11 +451,16 @@ public class ServiceUtil { ...@@ -450,11 +451,16 @@ public class ServiceUtil {
* @return {@link String} * @return {@link String}
*/ */
private static String getCqToken(XContext context) { private static String getCqToken(XContext context) {
GetConfigOilFieldOutput currentConfig = getCurrentConfig(context);
if (ObjectUtil.isNull(currentConfig) || CharSequenceUtil.isBlank(currentConfig.getThirdPartyAuthConfig())) {
throw new XServiceException("缺少认证配置");
}
Map<String, String> param = JSON.parseObject(currentConfig.getThirdPartyAuthConfig(),
new TypeReference<Map<String, String>>() {
}
);
String url = XStartup.getCurrent().getProperty("third-party.chang-qing.url"); String url = XStartup.getCurrent().getProperty("third-party.chang-qing.url");
url += ThirdPartyApiConstant.CQ_TOKEN; url += ThirdPartyApiConstant.CQ_TOKEN;
Map<String, String> param = new HashMap<>(4);
param.put("UserAccount", "PvGroup");
param.put("UserPassWord", "PvGroup@147369");
String result = XHttpUtils.postAsForm(url, param); String result = XHttpUtils.postAsForm(url, param);
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
String token = jsonObject.getString("token"); String token = jsonObject.getString("token");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment