定时任务history时间id

This commit is contained in:
wangshuai 2024-07-21 15:56:21 +08:00
parent 4678f4624e
commit 32fb567a8c
2 changed files with 23 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import com.ruoyi.business.service.IBusOrderInfoService;
import com.ruoyi.business.service.IMeituanService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -36,13 +37,24 @@ public class MeituanController {
return iMeituanService.cookieInfo(cookie);
}
/*
一键同步
*/
@GetMapping("/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);
return R.ok();
}
/*
单个店铺同步
*/
@GetMapping("/getComment")
public R getComment(Long id){
iMeituanService.getComment(id);
@ -50,6 +62,9 @@ public class MeituanController {
return R.ok();
}
/*
店铺history
*/
@GetMapping("/getReturnInfo")
public R getReturnInfo(){
iMeituanService.getReturnInfo(null);

View File

@ -327,9 +327,11 @@ public class MeituanServiceImpl implements IMeituanService {
if (list1.size() > 0) {
BusStoreDayInfo temp = list1.get(0);
temp.setLastOrderNum(Integer.valueOf(total));
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.updateBusStoreDayInfo(temp);
} else {
dayInfo.setLastOrderNum(Integer.valueOf(total));
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
}
}
@ -708,9 +710,10 @@ public class MeituanServiceImpl implements IMeituanService {
} else {
busStoreDayInfo.setLastReturnVisitRate("0");
}
busStoreDayInfo.setCreateTime(Date.from(date.atZone(ZoneId.systemDefault()).toInstant()));
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){
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
BeanUtils.copyProperties(busStoreDayInfo, target);
@ -774,9 +777,11 @@ public class MeituanServiceImpl implements IMeituanService {
if (list1.size() > 0) {
BusStoreDayInfo temp = list1.get(0);
temp.setScore(poiScore);
temp.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.updateBusStoreDayInfo(temp);
} else {
dayInfo.setScore(poiScore);
dayInfo.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
}
}
@ -841,6 +846,7 @@ public class MeituanServiceImpl implements IMeituanService {
int fourNum = array.getJSONObject(array.size()-1).getInteger("fourNum");
busStoreDayInfo1.setLastFiveStarReviewsNum(fiveNum);
busStoreDayInfo1.setLastPositiveReviewsNum(fiveNum + fourNum);
busStoreDayInfo1.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant()));
busStoreDayInfoService.updateBusStoreDayInfo(busStoreDayInfo1);
}
// System.out.println(jsonObject);//落库