1; 店铺页面营销量改为H评量 提示信息修改

2; 集成私密代理方法配置 待引入
This commit is contained in:
wangshuai 2024-07-29 15:47:42 +08:00
parent a1c5a69e25
commit feb470136f
7 changed files with 145 additions and 14 deletions

View File

@ -95,9 +95,9 @@ token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
secret: abcdefghijklmnopqrstuvwxyzws
# 令牌有效期默认30分钟
expireTime: 30
expireTime: 120
# MyBatis配置
mybatis:
@ -154,6 +154,15 @@ clientIP:
accountsecretKey: 2xib03rq8uqh15x230ea9emjasiu3exv
secretId: ohrruf71orkzv9l9enhi
secretKey: bp4iyx52tc9oe46hj0lriyux2m6hpzvu
getdpsAddr: https://dps.kdlapi.com/api/getdps
getdpsvalidtime: https://dps.kdlapi.com/api/getdpsvalidtime
checkdpsvalid: https://dps.kdlapi.com/api/checkdpsvalid
accountSM: d1353713811
pwdSM: btqffqim
accountSecretIdSM: ol1ydp86g518q4y607xe
accountsecretKeySM: 6vwfgvti51u2njgntamc1f23lqq7kave
secretIdSM: uadb4a2pwopd613sxr89
secretKeySM: 2xib03rq8uqh15x230ea9emjasiu3exv
eleme:
isSandbox: false

View File

@ -1,12 +1,13 @@
package com.ruoyi.common.config;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.sms.v20210111.SmsClient;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Data
@ -42,4 +43,124 @@ public class ProxyProperties {
@Value("${clientIP.secretKey}")
private String secretKey;
@Value("${clientIP.getdpsAddr}")
private String getdpsAddr;
@Value("${clientIP.getdpsvalidtime}")
private String getdpsvalidtime;
@Value("${clientIP.checkdpsvalid}")
private String checkdpsvalid;
@Value("${clientIP.accountSM}")
private String accountSM;
@Value("${clientIP.pwdSM}")
private String pwdSM;
@Value("${clientIP.accountSecretIdSM}")
private String accountSecretIdSM;
@Value("${clientIP.accountsecretKeySM}")
private String accountsecretKeySM;
@Value("${clientIP.secretIdSM}")
private String secretIdSM;
@Value("${clientIP.secretKeySM}")
private String secretKeySM;
private String getUrl() {
try {
// 请求参数
int num = 1; // 提取数量
String params = "?secret_id=" + secretIdSM + "&signature=" + secretKeySM + "&num=" + num;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpGet httpget = new HttpGet(getdpsAddr + params);
httpget.addHeader("Accept-Encoding", "gzip"); //使用gzip压缩传输数据让访问更快
System.out.println("Executing request " + httpget.getURI());
CloseableHttpResponse response = httpclient.execute(httpget);
try {
String ip = EntityUtils.toString(response.getEntity());
if (checkdpsvalid(ip) && getdpsvalidtime(ip)) {
return ip;
}
getUrl();
} finally {
response.close();
}
} finally {
httpclient.close();
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private Boolean getdpsvalidtime(String proxy) {
Boolean flag = false;
try {
// 请求参数
String params = "?secret_id=" + secretIdSM + "&proxy=" + proxy + "&signature=" + secretKeySM;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpGet httpget = new HttpGet(getdpsvalidtime + params);
httpget.addHeader("Accept-Encoding", "gzip"); //使用gzip压缩传输数据让访问更快
System.out.println("Executing request " + httpget.getURI());
CloseableHttpResponse response = httpclient.execute(httpget);
try {
String result = EntityUtils.toString(response.getEntity());
JSONObject jsonObject = JSONObject.parseObject(result);
String code = jsonObject.getString(("code"));
if ("0".equals(code)) {
int count = jsonObject.getJSONObject("data").getInteger(proxy);
if (count >= 0) {
System.out.println(jsonObject.getJSONObject("data").getInteger(proxy).toString());
return true;
}
}
} finally {
response.close();
}
} finally {
httpclient.close();
}
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
// GET https://dps.kdlapi.com/api/checkdpsvalid?secret_id=o1fjh1re9o28876h7c08
// &proxy=113.120.61.166:22989,123.163.183.200:18635
// &signature=oxf0n0g59h7wcdyvz2uo68ph2s
private Boolean checkdpsvalid(String proxy) {
Boolean flag = false;
try {
// 请求参数
String params = "?secret_id=" + secretIdSM + "&proxy=" + proxy + "&signature=" + secretKeySM;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpGet httpget = new HttpGet(checkdpsvalid + params);
httpget.addHeader("Accept-Encoding", "gzip"); //使用gzip压缩传输数据让访问更快
System.out.println("Executing request " + httpget.getURI());
CloseableHttpResponse response = httpclient.execute(httpget);
try {
String result = EntityUtils.toString(response.getEntity());
JSONObject jsonObject = JSONObject.parseObject(result);
String code = jsonObject.getString(("code"));
if ("0".equals(code)) {
flag = jsonObject.getJSONObject("data").getBooleanValue(proxy);
}
} finally {
response.close();
}
} finally {
httpclient.close();
}
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
}

View File

@ -459,7 +459,7 @@ export default {
'el-tooltip',
{
props: {
content: '昨日营销量与昨日单量比值', //
content: '昨日好评量与昨日回访量比值', //
placement: 'top' //
}
},

View File

@ -199,7 +199,7 @@
<el-table-column label="昨日好评量" prop="lastPositiveReviewsNum" align="center" width="85"/>
<el-table-column label="昨日五星量" prop="lastFiveStarReviewsNum" align="center" width="85"/>
<el-table-column label="昨日回访量" prop="lastReturnVisitNum" align="center" width="85"/>
<el-table-column label="昨日营销比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="昨日H评比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="今日回访量" prop="todayReturnVisitNum" align="center" width="85" />
<el-table-column label="评分" prop="score" align="center" width="55" />
<el-table-column label="归属" prop="saleBindId" align="center" :formatter="idToName" width="65" />
@ -509,7 +509,7 @@ export default {
'el-tooltip',
{
props: {
content: '昨日营销量与昨日单量比值', //
content: '昨日好评量与昨日回访量比值', //
placement: 'top' //
}
},

View File

@ -216,7 +216,7 @@
<el-table-column label="昨日好评量" prop="lastPositiveReviewsNum" align="center" width="85"/>
<el-table-column label="昨日五星量" prop="lastFiveStarReviewsNum" align="center" width="85"/>
<el-table-column label="昨日回访量" prop="lastReturnVisitNum" align="center" width="85"/>
<el-table-column label="昨日营销比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="昨日H评比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="今日回访量" prop="todayReturnVisitNum" align="center" width="85" />
<el-table-column label="评分" prop="score" align="center" width="55" />
<el-table-column label="归属" prop="saleBindId" align="center" :formatter="idToName" width="75" />
@ -582,7 +582,7 @@ export default {
'el-tooltip',
{
props: {
content: '昨日营销量与昨日单量比值', //
content: '昨日好评量与昨日回访量比值', //
placement: 'top' //
}
},

View File

@ -268,6 +268,7 @@ export default {
submitForm() {
if(this.formIds.length==0){
this.$modal.msgSuccess("请勾选数据!");
return
}
this.form.orderIds = this.formIds;
this.$refs["form"].validate(valid => {

View File

@ -191,7 +191,7 @@
<el-table-column label="昨日好评量" prop="lastPositiveReviewsNum" align="center" width="85"/>
<el-table-column label="昨日五星量" prop="lastFiveStarReviewsNum" align="center" width="85"/>
<el-table-column label="昨日回访量" prop="lastReturnVisitNum" align="center" width="85"/>
<el-table-column label="昨日营销比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="昨日H评比(%)" prop="lastReturnVisitRate" align="center" :render-header="renderPrice" width="120" />
<el-table-column label="今日回访量" prop="todayReturnVisitNum" align="center" width="85" />
<el-table-column label="评分" prop="score" align="center" width="55" />
<el-table-column label="归属" prop="saleBindId" align="center" :formatter="idToName" width="65" />
@ -493,7 +493,7 @@ export default {
'el-tooltip',
{
props: {
content: '昨日营销量与昨日单量比值', //
content: '昨日好评量与昨日回访量比值', //
placement: 'top' //
}
},