"...src/main/resources/git@gitlab.scsmile.cn:zxf/appbuild.git" did not exist on "c8bfd8dd112d923e6de11030e4a7f34497e00a8c"
Commit aaaed4e7 authored by 赵啸非's avatar 赵啸非

修改排队统计更新与组合查询

parent 26834802
package com.mortals.xhx.module.ph.service.impl; package com.mortals.xhx.module.ph.service.impl;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
...@@ -62,7 +63,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -62,7 +63,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
List<PhQueueEntity> phQueueEntities = phQueueService.find(phQueueQuery); List<PhQueueEntity> phQueueEntities = phQueueService.find(phQueueQuery);
// log.info("更新站点排队统计数据,站点ID:{},站点名称:{},日期:{},排队数量:{}", entity.getSiteId(), entity.getSiteName(), currentDate, phQueueEntities.size()); // log.info("更新站点排队统计数据,站点ID:{},站点名称:{},日期:{},排队数量:{}", entity.getSiteId(), entity.getSiteName(), currentDate, phQueueEntities.size());
/* updateSitePhCount(entity, phQueueEntities); updateSitePhCount(entity, phQueueEntities);
//部门 //部门
updateSiteSectionNamePhCount(currentDate, entity, phQueueEntities); updateSiteSectionNamePhCount(currentDate, entity, phQueueEntities);
...@@ -71,7 +72,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -71,7 +72,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
//业务 //业务
updateSiteBussinessPhCount(currentDate, entity, phQueueEntities); updateSiteBussinessPhCount(currentDate, entity, phQueueEntities);
//窗口 //窗口
updateSiteWindowPhCount(currentDate, entity, phQueueEntities);*/ updateSiteWindowPhCount(currentDate, entity, phQueueEntities);
//组合条件更新 //组合条件更新
updateSiteConditionPhCount(entity, phQueueEntities); updateSiteConditionPhCount(entity, phQueueEntities);
return Rest.ok(); return Rest.ok();
...@@ -217,8 +218,9 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -217,8 +218,9 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getSectionName())); .collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getSectionName()));
List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> { List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> {
String vals = item.getKey(); String vals = item.getKey();
String[] split = vals.split("&");
if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null; String[] split = StrUtil.splitToArray(vals,"&");
if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null;
Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D); Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size()); // log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
PhQueueStatQuery phQueueStatQuery = getPhQueueStatQuery(entity); PhQueueStatQuery phQueueStatQuery = getPhQueueStatQuery(entity);
...@@ -238,7 +240,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -238,7 +240,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getWindowFromnum())); .collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getWindowFromnum()));
List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> { List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> {
String vals = item.getKey(); String vals = item.getKey();
String[] split = vals.split("&"); String[] split = StrUtil.splitToArray(vals,"&");
if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null; if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null;
Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D); Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size()); // log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
...@@ -259,7 +261,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -259,7 +261,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.collect(Collectors.groupingBy(x -> x.getSectionName() + "&" + x.getWindowFromnum())); .collect(Collectors.groupingBy(x -> x.getSectionName() + "&" + x.getWindowFromnum()));
List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> { List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> {
String vals = item.getKey(); String vals = item.getKey();
String[] split = vals.split("&"); String[] split = StrUtil.splitToArray(vals,"&");
if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null; if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1])) return null;
Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D); Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D);
// log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size()); // log.info("更新站点排队统计数据,站点名称:{},日期:{},窗口:{},排队数量:{}", entity.getSiteName(), currentDate,window, phQueueEntities.size());
...@@ -279,7 +281,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -279,7 +281,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
.collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getSectionName() + "&" + x.getWindowFromnum())); .collect(Collectors.groupingBy(x -> x.getBusiness() + "&" + x.getSectionName() + "&" + x.getWindowFromnum()));
List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> { List<PhQueueStatEntity> saveAndUpdatelist = businessAndSectionCollect.entrySet().parallelStream().map(item -> {
String vals = item.getKey(); String vals = item.getKey();
String[] split = vals.split("&"); String[] split = StrUtil.splitToArray(vals,"&");
if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1]) || ObjectUtils.isEmpty(split[2])) if (ObjectUtils.isEmpty(split[0]) || ObjectUtils.isEmpty(split[1]) || ObjectUtils.isEmpty(split[2]))
return null; return null;
Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D); Double intAvg = item.getValue().parallelStream().mapToInt(e -> e.getWaitTime()).average().orElse(0D);
...@@ -335,10 +337,6 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -335,10 +337,6 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
private void saveUpdatePhqueueStatList(List<PhQueueStatEntity> saveAndUpdatelist) { private void saveUpdatePhqueueStatList(List<PhQueueStatEntity> saveAndUpdatelist) {
try {
if (!ObjectUtils.isEmpty(saveAndUpdatelist)) { if (!ObjectUtils.isEmpty(saveAndUpdatelist)) {
Map<Boolean, List<PhQueueStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity())); Map<Boolean, List<PhQueueStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity()));
...@@ -355,9 +353,22 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -355,9 +353,22 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
} }
} }
} catch (Exception e) { }
log.error("异常,e");
} public static void main(String[] args) {
String str="adbc&&";
List<String> split = StrUtil.split(str, "&");
String[] strings = StrUtil.splitToArray(str, "&");
System.out.println(split.get(0));
System.out.println(split.get(1));
System.out.println(strings[0]);
System.out.println(strings[1]);
System.out.println(strings[2]);
} }
} }
\ No newline at end of file
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