定时任务history时间id
This commit is contained in:
parent
4678f4624e
commit
32fb567a8c
|
@ -7,6 +7,7 @@ import com.ruoyi.business.service.IBusOrderInfoService;
|
||||||
import com.ruoyi.business.service.IMeituanService;
|
import com.ruoyi.business.service.IMeituanService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -36,13 +37,24 @@ public class MeituanController {
|
||||||
return iMeituanService.cookieInfo(cookie);
|
return iMeituanService.cookieInfo(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
一键同步
|
||||||
|
*/
|
||||||
@GetMapping("/refresh")
|
@GetMapping("/refresh")
|
||||||
public R refresh(){
|
public R refresh(){
|
||||||
iMeituanService.getComments(SecurityUtils.getUsername());
|
LoginUser user = SecurityUtils.getLoginUser();
|
||||||
|
if("admin".equals(user.getUsername())){
|
||||||
|
iMeituanService.getComments(null);
|
||||||
|
}else{
|
||||||
|
iMeituanService.getComments(user.getUsername());
|
||||||
|
}
|
||||||
iMeituanService.getReturnInfo(null);
|
iMeituanService.getReturnInfo(null);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
单个店铺同步
|
||||||
|
*/
|
||||||
@GetMapping("/getComment")
|
@GetMapping("/getComment")
|
||||||
public R getComment(Long id){
|
public R getComment(Long id){
|
||||||
iMeituanService.getComment(id);
|
iMeituanService.getComment(id);
|
||||||
|
@ -50,6 +62,9 @@ public class MeituanController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
店铺history
|
||||||
|
*/
|
||||||
@GetMapping("/getReturnInfo")
|
@GetMapping("/getReturnInfo")
|
||||||
public R getReturnInfo(){
|
public R getReturnInfo(){
|
||||||
iMeituanService.getReturnInfo(null);
|
iMeituanService.getReturnInfo(null);
|
||||||
|
|
|
@ -327,9 +327,11 @@ public class MeituanServiceImpl implements IMeituanService {
|
||||||
if (list1.size() > 0) {
|
if (list1.size() > 0) {
|
||||||
BusStoreDayInfo temp = list1.get(0);
|
BusStoreDayInfo temp = list1.get(0);
|
||||||
temp.setLastOrderNum(Integer.valueOf(total));
|
temp.setLastOrderNum(Integer.valueOf(total));
|
||||||
|
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoService.updateBusStoreDayInfo(temp);
|
busStoreDayInfoService.updateBusStoreDayInfo(temp);
|
||||||
} else {
|
} else {
|
||||||
dayInfo.setLastOrderNum(Integer.valueOf(total));
|
dayInfo.setLastOrderNum(Integer.valueOf(total));
|
||||||
|
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
|
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -708,9 +710,10 @@ public class MeituanServiceImpl implements IMeituanService {
|
||||||
} else {
|
} else {
|
||||||
busStoreDayInfo.setLastReturnVisitRate("0");
|
busStoreDayInfo.setLastReturnVisitRate("0");
|
||||||
}
|
}
|
||||||
|
busStoreDayInfo.setCreateTime(Date.from(date.atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoMapper.updateBusStoreDayInfo(busStoreDayInfo);
|
busStoreDayInfoMapper.updateBusStoreDayInfo(busStoreDayInfo);
|
||||||
|
|
||||||
List<BusStoreDayHistoryInfo> list2 = busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoListByDate(storeInfo.getId(),date.format(dateTimeFormatter));
|
List<BusStoreDayHistoryInfo> list2 = busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoListByDate(busStoreInfo.getId(),date.format(dateTimeFormatter));
|
||||||
if (list2.size() > 0){
|
if (list2.size() > 0){
|
||||||
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
|
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
|
||||||
BeanUtils.copyProperties(busStoreDayInfo, target);
|
BeanUtils.copyProperties(busStoreDayInfo, target);
|
||||||
|
@ -774,9 +777,11 @@ public class MeituanServiceImpl implements IMeituanService {
|
||||||
if (list1.size() > 0) {
|
if (list1.size() > 0) {
|
||||||
BusStoreDayInfo temp = list1.get(0);
|
BusStoreDayInfo temp = list1.get(0);
|
||||||
temp.setScore(poiScore);
|
temp.setScore(poiScore);
|
||||||
|
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoService.updateBusStoreDayInfo(temp);
|
busStoreDayInfoService.updateBusStoreDayInfo(temp);
|
||||||
} else {
|
} else {
|
||||||
dayInfo.setScore(poiScore);
|
dayInfo.setScore(poiScore);
|
||||||
|
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
|
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -841,6 +846,7 @@ public class MeituanServiceImpl implements IMeituanService {
|
||||||
int fourNum = array.getJSONObject(array.size()-1).getInteger("fourNum");
|
int fourNum = array.getJSONObject(array.size()-1).getInteger("fourNum");
|
||||||
busStoreDayInfo1.setLastFiveStarReviewsNum(fiveNum);
|
busStoreDayInfo1.setLastFiveStarReviewsNum(fiveNum);
|
||||||
busStoreDayInfo1.setLastPositiveReviewsNum(fiveNum + fourNum);
|
busStoreDayInfo1.setLastPositiveReviewsNum(fiveNum + fourNum);
|
||||||
|
busStoreDayInfo1.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
busStoreDayInfoService.updateBusStoreDayInfo(busStoreDayInfo1);
|
busStoreDayInfoService.updateBusStoreDayInfo(busStoreDayInfo1);
|
||||||
}
|
}
|
||||||
// System.out.println(jsonObject);//落库
|
// System.out.println(jsonObject);//落库
|
||||||
|
|
Loading…
Reference in New Issue