店铺评分、好评信息

This commit is contained in:
wangshuai 2024-07-04 10:41:52 +08:00
parent 83182686ad
commit 9cdc2838bb
4 changed files with 78 additions and 39 deletions

View File

@ -8,6 +8,7 @@ import com.ruoyi.business.domain.PriPhoneInfo;
import com.ruoyi.business.domain.SysCookie;
import com.ruoyi.business.service.IBusCookieService;
import com.ruoyi.business.service.IBusStoreInfoService;
import com.ruoyi.business.service.IMeituanService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.HttpClientUtilT;
import org.apache.http.HttpEntity;
@ -38,6 +39,8 @@ public class MeituanController {
@Autowired
private IBusCookieService cookieService;
@Autowired
private IMeituanService iMeituanService;
/**
* 获取cookies
* @param cookie
@ -131,25 +134,26 @@ public class MeituanController {
*/
@GetMapping("/getComments")
public R comments() {
String result = iMeituanService.getComments();
//commScore=1 好评commScore=0 全部即订单量五星好评取返回结果orderCommentScore=5
String url = "https://waimaieapp.meituan.com/gw/customer/comment/list";
Map<String,Object> params = new HashMap<>();
params.put("ignoreSetRouterProxy",true);
params.put("acctId","196975850");
params.put("wmPoiId","21737990");
params.put("token","08Y-B6R3RJh0vWW3sunjIls8g5ks282V0XDqw0_8uK2I*");
params.put("appType",3);
params.put("commScore",1);
params.put("commType",-1);
params.put("hasContent",-1);
params.put("periodType",4);
params.put("beginTime",1719676800);
params.put("endTime",1719676800);
params.put("onlyAuditNotPass",0);
params.put("pageNum",1);
params.put("pageSize",10);
params.put("source",1);
String result = HttpClientUtilT.doGet(url,null,params);
// String url = "https://waimaieapp.meituan.com/gw/customer/comment/list";
// Map<String,Object> params = new HashMap<>();
// params.put("ignoreSetRouterProxy",true);
// params.put("acctId","196975850");
// params.put("wmPoiId","21737990");
// params.put("token","08Y-B6R3RJh0vWW3sunjIls8g5ks282V0XDqw0_8uK2I*");
// params.put("appType",3);
// params.put("commScore",1);
// params.put("commType",-1);
// params.put("hasContent",-1);
// params.put("periodType",4);
// params.put("beginTime",1719676800);
// params.put("endTime",1719676800);
// params.put("onlyAuditNotPass",0);
// params.put("pageNum",1);
// params.put("pageSize",10);
// params.put("source",1);
// String result = HttpClientUtilT.doGet(url,null,params);
return R.ok(result);
}
@ -159,15 +163,7 @@ public class MeituanController {
*/
@GetMapping("/getScore")
public R score() {
String url = "https://waimaieapp.meituan.com/gw/customer/comment/scores";
Map<String,Object> params = new HashMap<>();
params.put("ignoreSetRouterProxy",true);
params.put("acctId","196975850");
params.put("wmPoiId","21737990");
params.put("token","08Y-B6R3RJh0vWW3sunjIls8g5ks282V0XDqw0_8uK2I*");
params.put("appType",3);
params.put("source",1);
String result = HttpClientUtilT.doGet(url,null,params);
String result = iMeituanService.getScore();
return R.ok(result);
}

View File

@ -2,4 +2,6 @@ package com.ruoyi.business.service;
public interface IMeituanService {
String getComments();
String getScore();
}

View File

@ -28,15 +28,49 @@ public class MeituanServiceImpl implements IMeituanService {
return "ok";
}
// 获取订单数和好评45星
@Override
public String getScore() {
BusStoreInfo busStoreInfo = new BusStoreInfo();
busStoreInfo.setGrantStatus("1");
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
for(BusStoreInfo store: busStoreInfoList){
getScoreOne(store);
}
return "ok";
}
/**
* 获取评分
* @return
*/
private Boolean getScoreOne(BusStoreInfo store) {
String url = "https://waimaieapp.meituan.com/gw/customer/comment/scores";
Map<String,Object> params = new HashMap<>();
params.put("ignoreSetRouterProxy",true);
params.put("acctId",valueFromCookie("acctId",store.getStoreCookie()));
params.put("wmPoiId",valueFromCookie("wmPoiId",store.getStoreCookie()));
params.put("token",valueFromCookie("token",store.getStoreCookie()));
params.put("appType",3);
params.put("source",1);
String result = HttpClientUtilT.doGet(url,null,params);
System.out.println(result);//落库
return true;
}
/**
* 获取订单数和好评45星
* @return
*/
private Boolean getCommentsOne(BusStoreInfo store){
//commScore=1 好评commScore=0 全部即订单量五星好评取返回结果orderCommentScore=5
String url = "https://waimaieapp.meituan.com/gw/customer/comment/list";
Map<String,Object> params = new HashMap<>();
params.put("ignoreSetRouterProxy",true);
params.put("acctId","196975850");
params.put("wmPoiId","18277065");
params.put("token","0G5G-OOR2Q2APHeiU6dvlB6W2TBBirC_1c6zb_K2HG8I*");
params.put("acctId",
valueFromCookie("acctId",store.getStoreCookie()));
params.put("wmPoiId",
valueFromCookie("wmPoiId",store.getStoreCookie()));
params.put("token",valueFromCookie("token",store.getStoreCookie()));
params.put("appType",3);
params.put("commScore",1);
params.put("commType",-1);
@ -49,7 +83,14 @@ public class MeituanServiceImpl implements IMeituanService {
params.put("pageSize",10);
params.put("source",1);
String result = HttpClientUtilT.doGet(url,null,params);
System.out.println(result);
System.out.println(result);//落库
return true;
}
// 解析Cookie
private String valueFromCookie(String key,String text) {
String s = text.substring(text.indexOf(key), text.length());
String value = s.substring(s.indexOf("=")+1,s.indexOf(";"));
return value;
}
}

View File

@ -184,7 +184,7 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width =120>
<!-- <template slot-scope="scope" v-if="scope.row.roleId !== 1"> -->
<!-- <template slot-scope="scope" v-if="scope.row.id !== 1"> -->
<el-button
size="mini"
type="text"
@ -192,13 +192,16 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>配置</el-button>
<template slot-scope="scope" v-if="scope.row.selfDeliveryStatus == 1">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
v-hasPermi="['system:role:edit']"
>自配送</el-button>
</template>
<template slot-scope="scope" v-if="scope.row.returnVisitStatus !== 1">
<el-button
size="mini"
type="text"
@ -206,6 +209,7 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button>
</template>
<el-button
size="mini"
type="text"
@ -356,11 +360,7 @@ export default {
},
getListSale() {
listSale(this.queryParams).then(response => {
console.log(response);
this.saleList = response.data;
// this.roleList = response.rows;
// this.total = response.total;
// this.loading = false;
}
);
},