Commit 1f98f457 authored by 赵啸非's avatar 赵啸非

重新调整统计线程实现

parent cc86484b
......@@ -8,6 +8,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.code.AccessTypeEnum;
import com.mortals.xhx.common.code.StatTypeEnum;
......@@ -54,37 +55,31 @@ import static java.util.stream.Collectors.toCollection;
@Service("SiteStatTask")
public class SiteStatTaskImpl implements ITaskExcuteService {
@Autowired
private ISiteFeign siteFeign;
@Autowired
private PjEvaluateStatService pjEvaluateStatService;
@Autowired
private PhQueueStatService phQueueStatService;
@Autowired
private StatService statService;
@Autowired
private ICacheService cacheService;
@Autowired
private AccessService accessService;
@Autowired
private AccessStatLogService accessStatLogService;
@Override
public void excuteTask(ITask task) throws AppException {
log.info("站点评价统计任务");
//统计最近一周
statByDate();
//统计最近4天
Long compare = DataUtil.converStr2Long(task.getExcuteParam(), 4L);
statByDate(compare);
log.info("站点统计缓存任务");
//统计排号与评价 部门,等字典顺序记录次数
updateSiteCache();
}
private void statByDate() {
private void statByDate(Long compare) {
List<SitePdu> sitePduList = accessService.getStatSiteList();
Long compare =4L;
DateTime attendStart = DateUtil.offsetDay(new Date(), -compare.intValue());
for (SitePdu site : sitePduList) {
if (ObjectUtils.isEmpty(site.getId())) continue;
......
......@@ -47,7 +47,7 @@ POST {{baseUrl}}/pj/evaluate/stat/stat
Content-Type: application/json
{
"pjTimeStart": "2023-01-01",
"pjTimeStart": "2024-07-01",
"pjTimeEnd": "2024-07-29"
}
......@@ -56,7 +56,7 @@ POST {{baseUrl}}/ph/queue/stat/stat
Content-Type: application/json
{
"taketimeStart": "2023-01-01",
"taketimeStart": "2024-07-01",
"taketimeEnd": "2024-07-29"
}
......@@ -66,10 +66,19 @@ POST {{baseUrl}}/stat/stat
Content-Type: application/json
{
"createTimeStart": "2023-01-01",
"createTimeStart": "2024-07-01",
"createTimeEnd": "2024-07-29"
}
###所有
POST {{baseUrl}}/access/stat
Content-Type: application/json
{
"accessTimeStart": "2024-07-01",
"accessTimeEnd": "2024-07-29"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment