Merge remote-tracking branch 'origin/main'

This commit is contained in:
Lenovo 2024-08-08 17:05:04 +08:00
commit 6e543514ef
3 changed files with 25 additions and 23 deletions

View File

@ -66,9 +66,9 @@ public class AsyncTaskImpl {
public void clearStoreKey(){ public void clearStoreKey(){
LocalDate localDate = LocalDate.now(); LocalDate localDate = LocalDate.now();
LocalDate prevDay = localDate.minusDays(1); LocalDate prevDay = localDate.minusDays(2);
BusStoreInfo busStoreInfo = new BusStoreInfo(); BusStoreInfo busStoreInfo = new BusStoreInfo();
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo); List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoListA(busStoreInfo);
for (BusStoreInfo storeInfo : busStoreInfoList) { for (BusStoreInfo storeInfo : busStoreInfoList) {
try { try {
String oldKey = storeInfo.getStoreCode() + "-" + prevDay; String oldKey = storeInfo.getStoreCode() + "-" + prevDay;

View File

@ -229,7 +229,7 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
}else if(ll.size() ==1){ }else if(ll.size() ==1){
busStoreConfigInfo.setId(ll.get(0).getId()); busStoreConfigInfo.setId(ll.get(0).getId());
if(StringUtils.isEmpty(busStoreConfigInfo.getMarketingChannels())){ if(StringUtils.isEmpty(busStoreConfigInfo.getMarketingChannels())){
throw new ServiceException("操作异常"); throw new ServiceException("请选择营销渠道");
} }
if(!busStoreConfigInfo.getMarketingChannels().equals(ll.get(0).getMarketingChannels())){ if(!busStoreConfigInfo.getMarketingChannels().equals(ll.get(0).getMarketingChannels())){
BusMarketOperationInfo busMarketOperationInfo = new BusMarketOperationInfo(); BusMarketOperationInfo busMarketOperationInfo = new BusMarketOperationInfo();

View File

@ -136,12 +136,13 @@ public class MeituanServiceImpl implements IMeituanService {
storeInfo.setSelfDeliveryStatus("1");// 1 正常 2 自配送 3 删除 storeInfo.setSelfDeliveryStatus("1");// 1 正常 2 自配送 3 删除
storeInfo.setMarketingChannels(sysDictDataMapper.selectDictLabel("bus_default_channel","default_channel")); storeInfo.setMarketingChannels(sysDictDataMapper.selectDictLabel("bus_default_channel","default_channel"));
busStoreInfoService.insertBusStoreInfo(storeInfo); busStoreInfoService.insertBusStoreInfo(storeInfo);
Long storeId = storeInfo.getId();
BusStoreDayInfo busStoreDayInfo = new BusStoreDayInfo(); BusStoreDayInfo busStoreDayInfo = new BusStoreDayInfo();
busStoreDayInfo.setStoreId(storeInfo.getId()); busStoreDayInfo.setStoreId(storeId);
busStoreDayInfo.setCreateTime(date); busStoreDayInfo.setCreateTime(date);
busStoreDayInfoMapper.insertBusStoreDayInfo(busStoreDayInfo); busStoreDayInfoMapper.insertBusStoreDayInfo(busStoreDayInfo);
BusStoreConfigInfo busStoreConfigInfo = new BusStoreConfigInfo(); BusStoreConfigInfo busStoreConfigInfo = new BusStoreConfigInfo();
busStoreConfigInfo.setStoreId(storeInfo.getId()); busStoreConfigInfo.setStoreId(storeId);
busStoreConfigInfo.setStoreCode(valueFromCookie("wmPoiId", cookie.getCookie())); busStoreConfigInfo.setStoreCode(valueFromCookie("wmPoiId", cookie.getCookie()));
busStoreConfigInfo.setStoreName(storeInfo.getStoreName()); busStoreConfigInfo.setStoreName(storeInfo.getStoreName());
busStoreConfigInfo.setQuotaStatus("2"); busStoreConfigInfo.setQuotaStatus("2");
@ -192,7 +193,11 @@ public class MeituanServiceImpl implements IMeituanService {
storeInfo.setUpdateUser(cookie.getUserName()); storeInfo.setUpdateUser(cookie.getUserName());
storeInfo.setStoreAccount(cookie.getAccount()); storeInfo.setStoreAccount(cookie.getAccount());
storeInfo.setStorePassword(cookie.getPassword()); storeInfo.setStorePassword(cookie.getPassword());
storeInfo.setStoreName(cookie.getWmPoiName()); String name = getStoreName(cookie.getCookie(),getUrl);
if(StringUtils.isEmpty(name)){
name = getStoreNameApi(cookie.getCookie(),getUrl);
}
storeInfo.setStoreName(name);
storeInfo.setStoreCookie(cookie.getCookie()); storeInfo.setStoreCookie(cookie.getCookie());
storeInfo.setBindTime(date); storeInfo.setBindTime(date);
storeInfo.setGrantStatus("1");//授权登录状态 storeInfo.setGrantStatus("1");//授权登录状态
@ -269,6 +274,12 @@ public class MeituanServiceImpl implements IMeituanService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String getComment(Long id) { public String getComment(Long id) {
BusStoreInfo store = busStoreInfoMapper.selectBusStoreInfoById(id); BusStoreInfo store = busStoreInfoMapper.selectBusStoreInfoById(id);
String name = getStoreName(store.getStoreCookie(),"");
if(StringUtils.isEmpty(name)){
name = getStoreNameApi(store.getStoreCookie(),"");
}
store.setStoreName(name);
busStoreInfoMapper.updateBusStoreInfo(store);
Boolean flag1 = getScoreOne(store); Boolean flag1 = getScoreOne(store);
if (!flag1) { if (!flag1) {
log.error("获取评分信息返回错误..."); log.error("获取评分信息返回错误...");
@ -367,10 +378,6 @@ public class MeituanServiceImpl implements IMeituanService {
temp.setLastOrderNum(Integer.valueOf(total)); temp.setLastOrderNum(Integer.valueOf(total));
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant())); temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.updateBusStoreDayInfo(temp); busStoreDayInfoService.updateBusStoreDayInfo(temp);
} else {
dayInfo.setLastOrderNum(Integer.valueOf(total));
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
} }
} }
} else if ("1001".equals(code)) { } else if ("1001".equals(code)) {
@ -749,19 +756,18 @@ public class MeituanServiceImpl implements IMeituanService {
HttpGet request = new HttpGet(url); HttpGet request = new HttpGet(url);
request.setHeader("Cookie",cookie); request.setHeader("Cookie",cookie);
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"); 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; String info = null;
try { try {
result = EntityUtils.toString(client.execute(request).getEntity()); String result = EntityUtils.toString(client.execute(request).getEntity());
JSONObject jsonObject = JSONObject.parseObject(result);
String code = jsonObject.getString(("code"));
if ("0".equals(code)) {
JSONArray data = jsonObject.getJSONArray("data");
info = data.getJSONObject(0).getString("timeLine");
}
} catch (Exception e) { } catch (Exception e) {
log.error("*********订单送达时间解析异常*********"); log.error("*********订单送达时间解析异常*********");
} }
JSONObject jsonObject = JSONObject.parseObject(result);
String code = jsonObject.getString(("code"));
String info = null;
if ("0".equals(code)) {
JSONArray data = jsonObject.getJSONArray("data");
info = data.getJSONObject(0).getString("timeLine");
}
return info; return info;
} }
@ -974,10 +980,6 @@ public class MeituanServiceImpl implements IMeituanService {
temp.setScore(poiScore); temp.setScore(poiScore);
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant())); temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.updateBusStoreDayInfo(temp); busStoreDayInfoService.updateBusStoreDayInfo(temp);
} else {
dayInfo.setScore(poiScore);
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
} }
} }
}else if ("1001".equals(jsonObject.getString("code"))) { }else if ("1001".equals(jsonObject.getString("code"))) {