1;算法参数导致获取手机号403

2;表格数据页空数据处理
This commit is contained in:
wangshuai 2024-07-28 23:43:44 +08:00
parent 0452fc3071
commit 6bf1204632
4 changed files with 38 additions and 28 deletions

View File

@ -77,6 +77,10 @@ public class BusStoreDayHistoryInfoController extends BaseController
if (storeInfo != null) { if (storeInfo != null) {
int totalComments = 0; int totalComments = 0;
BigDecimal totamMoney = new BigDecimal("0"); BigDecimal totamMoney = new BigDecimal("0");
BigDecimal d = new BigDecimal("0");
if (storeInfo.getPrice() != null){
d = storeInfo.getPrice();
}
while (dateFormat.parse(startTime).getTime() <= dateFormat.parse(expEndTime).getTime()){ while (dateFormat.parse(startTime).getTime() <= dateFormat.parse(expEndTime).getTime()){
BusStoreExcelInfo excelInfo = new BusStoreExcelInfo(); BusStoreExcelInfo excelInfo = new BusStoreExcelInfo();
excelInfo.setOrderDate(startTime); excelInfo.setOrderDate(startTime);
@ -92,18 +96,15 @@ public class BusStoreDayHistoryInfoController extends BaseController
if (data != null){ if (data != null){
excelInfo.setCommentsNumber(data.getLastPositiveReviewsNum()); excelInfo.setCommentsNumber(data.getLastPositiveReviewsNum());
totalComments += data.getLastPositiveReviewsNum(); totalComments += data.getLastPositiveReviewsNum();
excelInfo.setPrice(d.toString());
BigDecimal money = d.multiply(new BigDecimal(data.getLastPositiveReviewsNum()));
excelInfo.setMoney(money.toString());
totamMoney = totamMoney.add(money);
}else{ }else{
excelInfo.setCommentsNumber(0); excelInfo.setCommentsNumber(0);
excelInfo.setPrice(d.toString());
excelInfo.setMoney("0");
} }
BigDecimal d = new BigDecimal("0");
if (storeInfo.getPrice() != null){
d = storeInfo.getPrice();
}
excelInfo.setPrice(d.toString());
BigDecimal money = d.multiply(new BigDecimal(data.getLastPositiveReviewsNum()));
excelInfo.setMoney(money.toString());
totamMoney = totamMoney.add(money);
list.add(excelInfo); list.add(excelInfo);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();

View File

@ -120,9 +120,10 @@ public class MeituanController {
iMeituanService.priPhoneInfo(list, cookie); iMeituanService.priPhoneInfo(list, cookie);
} }
@ApiOperation("getMtgsig")
@GetMapping("/getMtgsig") @GetMapping("/getMtgsig")
public String mtgsig(String orderId,String regionId,String regionVersion) { public String mtgsig(String orderId,String regionId,String regionVersion,String dfpid) {
return iMeituanService.mtgsigInfo(orderId,regionId,regionVersion); return iMeituanService.mtgsigInfo(orderId,regionId,regionVersion,dfpid);
} }

View File

@ -51,7 +51,7 @@ public interface IMeituanService {
* @param regionVersion * @param regionVersion
* @return * @return
*/ */
String mtgsigInfo(String orderId,String regionId,String regionVersion); String mtgsigInfo(String orderId,String regionId,String regionVersion,String dfpid);
String getStoreName(String cookie); String getStoreName(String cookie);

View File

@ -451,6 +451,9 @@ public class MeituanServiceImpl implements IMeituanService {
if (completeTime.contains("约今日")){ if (completeTime.contains("约今日")){
completeTime = completeTime.replaceAll("约今日 ",""); completeTime = completeTime.replaceAll("约今日 ","");
} }
if (completeTime.contains("明日")){
completeTime = completeTime.replaceAll("明日 ","");
}
orderInfo.setCompleteTime(completeTime); orderInfo.setCompleteTime(completeTime);
orderInfo.setOrderStatus(statusDesc); orderInfo.setOrderStatus(statusDesc);
@ -523,7 +526,7 @@ public class MeituanServiceImpl implements IMeituanService {
params.put("yodaReady", "h5"); params.put("yodaReady", "h5");
params.put("csecplatform", 4); params.put("csecplatform", 4);
params.put("csecversion", "2.4.0"); params.put("csecversion", "2.4.0");
params.put("mtgsig", mtgsigInfo(wmOrderViewId,valueFromCookie("region_id", cookie),valueFromCookie("region_version", cookie))); params.put("mtgsig", mtgsigInfo(wmOrderViewId,valueFromCookie("region_id", cookie),valueFromCookie("region_version", cookie),valueFromCookie("WEBDFPID",cookie)));
url = appendParams(url, params); url = appendParams(url, params);
HttpGet request = new HttpGet(url); HttpGet request = new HttpGet(url);
request.setHeader("Cookie",cookie); request.setHeader("Cookie",cookie);
@ -552,7 +555,7 @@ public class MeituanServiceImpl implements IMeituanService {
params.put("yodaReady", "h5"); params.put("yodaReady", "h5");
params.put("csecplatform", 4); params.put("csecplatform", 4);
params.put("csecversion", "2.4.0"); params.put("csecversion", "2.4.0");
params.put("mtgsig", mtgsigInfo("",valueFromCookie("region_id", cookie),valueFromCookie("region_version", cookie))); params.put("mtgsig", mtgsigInfo("",valueFromCookie("region_id", cookie),valueFromCookie("region_version", cookie),valueFromCookie("WEBDFPID",cookie)));
url = appendParams(url, params); url = appendParams(url, params);
MultipartEntityBuilder builder = MultipartEntityBuilder.create(); MultipartEntityBuilder builder = MultipartEntityBuilder.create();
@ -672,11 +675,13 @@ public class MeituanServiceImpl implements IMeituanService {
params.put("yodaReady", "h5"); params.put("yodaReady", "h5");
params.put("csecplatform", 4); params.put("csecplatform", 4);
params.put("csecversion", "2.4.0"); params.put("csecversion", "2.4.0");
String mtgsig = mtgsigInfo(orderInfo.getOrderNo(), regionId, regionVersion); String mtgsig = mtgsigInfo(orderInfo.getOrderNo(), regionId, regionVersion,valueFromCookie("WEBDFPID",cookie));
System.out.println(mtgsig);
System.out.println(orderInfo.toString());
params.put("mtgsig", mtgsig); params.put("mtgsig", mtgsig);
url = appendParams(url, params); url = appendParams(url, params);
MultipartEntityBuilder builder = MultipartEntityBuilder.create(); MultipartEntityBuilder builder = MultipartEntityBuilder.create();
// builder.addTextBody("searchItem","3801144621770927987"); builder.addTextBody("wmPoiId",orderInfo.getStoreCode());
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
HttpEntity entity = builder.build(); HttpEntity entity = builder.build();
httpPost.setEntity(entity); httpPost.setEntity(entity);
@ -684,16 +689,18 @@ public class MeituanServiceImpl implements IMeituanService {
CloseableHttpClient client = proxyHttpClient(); CloseableHttpClient client = proxyHttpClient();
String resp = null; String code = null;
JSONObject jsonObject = new JSONObject();
try { try {
HttpResponse response = client.execute(httpPost); HttpResponse response = client.execute(httpPost);
HttpEntity responseEntity = response.getEntity(); HttpEntity responseEntity = response.getEntity();
resp = EntityUtils.toString(responseEntity); String resp = EntityUtils.toString(responseEntity);
jsonObject = JSONObject.parseObject(resp);
code = jsonObject.getString(("code"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
continue;
} }
JSONObject jsonObject = JSONObject.parseObject(resp);
String code = jsonObject.getString(("code"));
if ("0".equals(code)) { if ("0".equals(code)) {
JSONArray array = jsonObject.getJSONArray("wmOrderList"); JSONArray array = jsonObject.getJSONArray("wmOrderList");
@ -759,7 +766,7 @@ public class MeituanServiceImpl implements IMeituanService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String mtgsigInfo(String orderId, String regionId, String regionVersion) { public String mtgsigInfo(String orderId, String regionId, String regionVersion,String dfpid) {
CloseableHttpClient httpClient = proxyHttpClient(); CloseableHttpClient httpClient = proxyHttpClient();
String url = "http://43.140.224.18:12000/get_mtgsig"; String url = "http://43.140.224.18:12000/get_mtgsig";
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
@ -767,15 +774,16 @@ public class MeituanServiceImpl implements IMeituanService {
Map<String, Object> subUrlParams = new LinkedHashMap<>(); Map<String, Object> subUrlParams = new LinkedHashMap<>();
subUrlParams.put("url", "https://e.waimai.meituan.com/v2/order/history/r/search/ajax?"); subUrlParams.put("url", "https://e.waimai.meituan.com/v2/order/history/r/search/ajax?");
subUrlParams.put("searchItem", orderId); // subUrlParams.put("searchItem", orderId);
subUrlParams.put("region_id", regionId); // subUrlParams.put("region_id", regionId);
subUrlParams.put("region_version", regionVersion); // subUrlParams.put("region_version", regionVersion);
subUrlParams.put("yodaReady", "h5"); // subUrlParams.put("yodaReady", "h5");
subUrlParams.put("csecplatform", 4); // subUrlParams.put("csecplatform", 4);
subUrlParams.put("csecversion", "2.4.0"); // subUrlParams.put("csecversion", "2.4.0");
subUrlParams.put("data", ""); subUrlParams.put("data", "");
subUrlParams.put("dfpid", "x528894270u555uvyz734vu21zz348v08095w0y4y68979584766w00y"); subUrlParams.put("dfpid", dfpid.split("-")[0]);
subUrlParams.put("method", "post");
String urlParam = ""; String urlParam = "";
for (Map.Entry<String, Object> stringObjectEntry : subUrlParams.entrySet()) { for (Map.Entry<String, Object> stringObjectEntry : subUrlParams.entrySet()) {