1; 历史数据

This commit is contained in:
wangshuai 2024-08-01 23:44:13 +08:00
parent 6b99484fd4
commit 003b9e6f3a
3 changed files with 52 additions and 2 deletions

View File

@ -163,6 +163,56 @@ public class BusStoreInfoController extends BaseController {
return rspData;
}
@ApiOperation("查询店铺信息列表")
@GetMapping("/listHistory")
public TableDataInfo listHistory(ReqBusStoreInfo reqBusStoreInfo) {//new RespBusStoreInfo(busStoreInfo1)
startPage();
BusStoreInfo busStoreInfo = new BusStoreInfo();
BeanUtils.copyProperties(reqBusStoreInfo, busStoreInfo);
LoginUser user = SecurityUtils.getLoginUser();
if (!"admin".equals(user.getUsername())) {
busStoreInfo.setBindUser(user.getUsername());
}
List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(busStoreInfo);
TableDataInfo rspData = getDataTable(list);
List<RespBusStoreInfo> tableList = list.stream()
.map(busStoreInfo1 -> {
RespBusStoreInfo info = new RespBusStoreInfo(busStoreInfo1);
BusStoreDayInfo busStoreDayInfo = new BusStoreDayInfo();
busStoreDayInfo.setStoreId(info.getId());
List<BusStoreDayInfo> ll = busStoreDayInfoService.selectBusStoreDayInfoList(busStoreDayInfo);
int a = ll.get(0).getLastPositiveReviewsNum();//todo 好评-五星
int b = ll.get(0).getLastReturnVisitNum();
info.setLastOrderNum(ll.get(0).getLastOrderNum());
info.setLastReturnVisitNum(b);
info.setLastPositiveReviewsNum(a);
info.setLastFiveStarReviewsNum(ll.get(0).getLastFiveStarReviewsNum());
// String date = LocalDateTime.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// List<BusReturnVisitInfo> llll = iBusReturnVisitInfoService.selectBusReturnVisitInfoListByDate(busStoreInfo1.getStoreCode(),date);
// info.setLastReturnVisitNum(llll.size());
info.setScore(ll.get(0).getScore());
if (a != 0 && b != 0) {
info.setLastReturnVisitRate(getRate(a,b));
} else {
info.setLastReturnVisitRate("0");
}
String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<BusReturnVisitInfo> lll = iBusReturnVisitInfoService.selectBusReturnVisitInfoListByDate(busStoreInfo1.getStoreCode(),today);
info.setTodayReturnVisitNum(lll.size());
BusStoreConfigInfo busStoreConfigInfo = new BusStoreConfigInfo();
busStoreConfigInfo.setStoreCode(busStoreInfo1.getStoreCode());
List<BusStoreConfigInfo> list1 = iBusStoreConfigInfoService.selectBusStoreConfigInfoList(busStoreConfigInfo);
if(list1.size() == 1){
info.setReturnVisitUserRange(list1.get(0).getMinOrderNum()+"~"+list1.get(0).getMaxOrderNum());
}
return info;
})
.collect(Collectors.toList());
// tableList.forEach(System.out::println);
rspData.setRows(tableList);
return rspData;
}
@ApiOperation("查询店铺信息列表")
// @PreAuthorize("@ss.hasPermi('business:store:list')")
@GetMapping("/getMtUrl")

View File

@ -137,7 +137,7 @@ public class SecurityConfig
.antMatchers(HttpMethod.POST,"/mt/cookies").permitAll()
.antMatchers("/test/**").permitAll()
.antMatchers("/eleme/message_receive").permitAll()
.antMatchers(HttpMethod.GET,"/mt/getReturnInfo").permitAll()
// .antMatchers(HttpMethod.GET,"/mt/getReturnInfo").permitAll()
.antMatchers("/common/**").permitAll()
// .antMatchers("/mt/**").permitAll()
// .antMatchers("/ai/**").permitAll()

View File

@ -718,7 +718,7 @@ public class MeituanServiceImpl implements IMeituanService {
url = appendParams(url, params);
HttpGet request = new HttpGet(url);
request.setHeader("Cookie",cookie);
request.setHeader("Host","waimaieapp.meituan.com");
request.setHeader("Accept-Encoding","gzip, deflate, br");
request.setHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36");
String result = null;
try {