Commit f1f69523 authored by 赵啸非's avatar 赵啸非

修改评价统计更新与组合查询

parent af286ae6
...@@ -6,15 +6,11 @@ import com.mortals.framework.exception.AppException; ...@@ -6,15 +6,11 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.xhx.common.code.TimeUnitEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.ph.model.PhQueueEntity; import com.mortals.xhx.module.ph.model.PhQueueEntity;
import com.mortals.xhx.module.ph.model.PhQueueQuery; import com.mortals.xhx.module.ph.model.PhQueueQuery;
import com.mortals.xhx.module.ph.model.PhQueueStatQuery; import com.mortals.xhx.module.ph.model.PhQueueStatQuery;
import com.mortals.xhx.module.ph.service.PhQueueService; import com.mortals.xhx.module.ph.service.PhQueueService;
import com.mortals.xhx.module.pj.model.PjEvaluateEntity;
import com.mortals.xhx.module.pj.model.PjEvaluateStatEntity;
import com.mortals.xhx.module.pj.model.PjEvaluateStatQuery;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -110,7 +106,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -110,7 +106,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
...@@ -129,7 +125,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -129,7 +125,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setHallName(hallName); phQueueStatEntity.setHallName(hallName);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
...@@ -147,7 +143,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -147,7 +143,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setBusiness(bussiness); phQueueStatEntity.setBusiness(bussiness);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
private void updateSiteWindowPhCount(String currentDate, PhQueueStatEntity entity, List<PhQueueEntity> phQueueEntities) { private void updateSiteWindowPhCount(String currentDate, PhQueueStatEntity entity, List<PhQueueEntity> phQueueEntities) {
...@@ -165,7 +161,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -165,7 +161,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setWindowFromnum(window); phQueueStatEntity.setWindowFromnum(window);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
...@@ -231,7 +227,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -231,7 +227,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setSectionName(split[1]); phQueueStatEntity.setSectionName(split[1]);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
...@@ -252,7 +248,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -252,7 +248,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setWindowFromnum(split[1]); phQueueStatEntity.setWindowFromnum(split[1]);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
...@@ -273,7 +269,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -273,7 +269,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setWindowFromnum(split[1]); phQueueStatEntity.setWindowFromnum(split[1]);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
private void updateBusinessAndSectionNameAndWindow(PhQueueStatEntity entity, List<PhQueueEntity> phQueueEntities) { private void updateBusinessAndSectionNameAndWindow(PhQueueStatEntity entity, List<PhQueueEntity> phQueueEntities) {
...@@ -296,10 +292,10 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -296,10 +292,10 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
phQueueStatEntity.setWindowFromnum(split[2]); phQueueStatEntity.setWindowFromnum(split[2]);
return phQueueStatEntity; return phQueueStatEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
saveUpdatePhqueueStatList(saveAndUpdatelist); saveUpdatePjStatList(saveAndUpdatelist);
} }
private static PhQueueStatQuery getPhQueueStatQuery(PhQueueStatEntity entity) { private PhQueueStatQuery getPhQueueStatQuery(PhQueueStatEntity entity) {
PhQueueStatQuery phQueueStatQuery = new PhQueueStatQuery().siteId(entity.getSiteId()) PhQueueStatQuery phQueueStatQuery = new PhQueueStatQuery().siteId(entity.getSiteId())
.year(entity.getYear()) .year(entity.getYear())
.month(entity.getMonth()) .month(entity.getMonth())
...@@ -336,19 +332,18 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -336,19 +332,18 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
} }
private void saveUpdatePhqueueStatList(List<PhQueueStatEntity> saveAndUpdatelist) { private void saveUpdatePjStatList(List<PhQueueStatEntity> saveAndUpdatelist) {
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()));
log.info("新增站点排队部门统计数据,数量:{}", saveUpdateCollect.get(true).size()); log.info("新增站点评价统计数据,数量:{}", saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) {
//新增列表 //新增列表
this.save(saveUpdateCollect.get(true)); this.save(saveUpdateCollect.get(true));
} }
log.info("更新站点排队部门统计数据,数量:{}", saveUpdateCollect.get(true).size()); log.info("更新站点评价统计数据,数量:{}", saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) {
//更新列表 //更新列表
this.update(saveUpdateCollect.get(true)); this.update(saveUpdateCollect.get(true));
} }
......
...@@ -6,6 +6,9 @@ import com.mortals.framework.model.PageInfo; ...@@ -6,6 +6,9 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.xhx.common.code.TimeUnitEnum; import com.mortals.xhx.common.code.TimeUnitEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.ph.model.PhQueueEntity;
import com.mortals.xhx.module.ph.model.PhQueueStatEntity;
import com.mortals.xhx.module.ph.model.PhQueueStatQuery;
import com.mortals.xhx.module.pj.model.PjEvaluateEntity; import com.mortals.xhx.module.pj.model.PjEvaluateEntity;
import com.mortals.xhx.module.pj.model.PjEvaluateQuery; import com.mortals.xhx.module.pj.model.PjEvaluateQuery;
import com.mortals.xhx.module.pj.model.PjEvaluateStatQuery; import com.mortals.xhx.module.pj.model.PjEvaluateStatQuery;
...@@ -81,6 +84,8 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat ...@@ -81,6 +84,8 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat
updateSiteOptionPjCount(currentDate, entity, pjEvaluateEntities); updateSiteOptionPjCount(currentDate, entity, pjEvaluateEntities);
return Rest.ok(); return Rest.ok();
} }
...@@ -122,170 +127,92 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat ...@@ -122,170 +127,92 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat
private void updateSiteSectionNamePjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) { private void updateSiteSectionNamePjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) {
Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getSectionName(), Collectors.counting())); Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getSectionName(), Collectors.counting()));
collect.entrySet().stream().forEach(item -> { List<PjEvaluateStatEntity> saveAndUpdatelist = collect.entrySet().stream().map(item -> {
String sectionName = item.getKey(); String sectionName = item.getKey();
if (ObjectUtils.isEmpty(sectionName)) return; if (ObjectUtils.isEmpty(sectionName)) return null;
Long value = item.getValue();
log.info("更新站点评价统计数据,站点名称:{},日期:{},部门:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getSectionName(), pjEvaluateEntities.size()); PjEvaluateStatQuery pjEvaluateStatQuery = getPhQueueStatQuery(entity);
PjEvaluateStatEntity pjEvaluateStatEntity = this.selectOne(new PjEvaluateStatQuery() pjEvaluateStatQuery.setSectionName(sectionName);
.siteId(entity.getSiteId()) PjEvaluateStatEntity pjEvaluateStatEntity = getPjEvaluateStatEntity(entity, item.getValue(), pjEvaluateStatQuery);
.sectionName(sectionName) pjEvaluateStatEntity.setSectionName(sectionName);
.year(entity.getYear()) return pjEvaluateStatEntity;
.month(entity.getMonth()) }).filter(f -> f != null).collect(Collectors.toList());
.day(entity.getDay())); saveUpdatePhqueueStatList(saveAndUpdatelist);
if (ObjectUtils.isEmpty(pjEvaluateStatEntity)) {
//统计当前站点新增所有评价数量
pjEvaluateStatEntity = new PjEvaluateStatEntity();
pjEvaluateStatEntity.initAttrValue();
pjEvaluateStatEntity.setSiteId(entity.getSiteId());
pjEvaluateStatEntity.setSiteCode(entity.getSiteCode());
pjEvaluateStatEntity.setSiteName(entity.getSiteName());
pjEvaluateStatEntity.setSectionName(sectionName);
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setCreateTime(new Date());
pjEvaluateStatEntity.setCreateUserId(1L);
this.save(pjEvaluateStatEntity);
} else {
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setUpdateTime(new Date());
pjEvaluateStatEntity.setUpdateUserId(1L);
this.update(pjEvaluateStatEntity);
}
});
} }
private void updateSiteHallPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) { private void updateSiteHallPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) {
Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getHallName(), Collectors.counting())); Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getHallName(), Collectors.counting()));
collect.entrySet().stream().forEach(item -> { List<PjEvaluateStatEntity> saveAndUpdatelist = collect.entrySet().stream().map(item -> {
String hallName = item.getKey(); String hallName = item.getKey();
if (ObjectUtils.isEmpty(hallName)) return null;
if (ObjectUtils.isEmpty(hallName)) return; //log.info("更新站点评价统计数据,站点名称:{},日期:{},部门:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getSectionName(), pjEvaluateEntities.size());
PjEvaluateStatQuery pjEvaluateStatQuery = getPhQueueStatQuery(entity);
Long value = item.getValue(); pjEvaluateStatQuery.setHallName(hallName);
log.info("更新站点评价统计数据,站点名称:{},日期:{},部门:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getSectionName(), pjEvaluateEntities.size()); PjEvaluateStatEntity pjEvaluateStatEntity = getPjEvaluateStatEntity(entity, item.getValue(), pjEvaluateStatQuery);
PjEvaluateStatEntity pjEvaluateStatEntity = this.selectOne(new PjEvaluateStatQuery() pjEvaluateStatEntity.setHallName(hallName);
.siteId(entity.getSiteId()) return pjEvaluateStatEntity;
.hallName(hallName) }).filter(f -> f != null).collect(Collectors.toList());
.year(entity.getYear()) saveUpdatePhqueueStatList(saveAndUpdatelist);
.month(entity.getMonth())
.day(entity.getDay()));
if (ObjectUtils.isEmpty(pjEvaluateStatEntity)) {
//统计当前站点新增所有评价数量
pjEvaluateStatEntity = new PjEvaluateStatEntity();
pjEvaluateStatEntity.initAttrValue();
pjEvaluateStatEntity.setSiteId(entity.getSiteId());
pjEvaluateStatEntity.setSiteCode(entity.getSiteCode());
pjEvaluateStatEntity.setSiteName(entity.getSiteName());
pjEvaluateStatEntity.setHallName(hallName);
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setCreateTime(new Date());
pjEvaluateStatEntity.setCreateUserId(1L);
this.save(pjEvaluateStatEntity);
} else {
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setUpdateTime(new Date());
pjEvaluateStatEntity.setUpdateUserId(1L);
this.update(pjEvaluateStatEntity);
}
});
} }
private void updateSiteWindowPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) { private void updateSiteWindowPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) {
Map<String, Long> collect = pjEvaluateEntities.parallelStream().collect(Collectors.groupingBy(x -> x.getWindowFromnum(), Collectors.counting()));
Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getWindowFromnum(), Collectors.counting())); List<PjEvaluateStatEntity> saveAndUpdatelist = collect.entrySet().parallelStream().map(item -> {
collect.entrySet().stream().forEach(item -> {
String windowFromnum = item.getKey(); String windowFromnum = item.getKey();
if (ObjectUtils.isEmpty(windowFromnum)) return; if (ObjectUtils.isEmpty(windowFromnum)) return null;
Long value = item.getValue(); PjEvaluateStatQuery pjEvaluateStatQuery = getPhQueueStatQuery(entity);
log.info("更新站点评价统计数据,站点名称:{},日期:{},窗口:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getWindowFromnum(), pjEvaluateEntities.size()); pjEvaluateStatQuery.setWindowFromnum(windowFromnum);
PjEvaluateStatEntity pjEvaluateStatEntity = this.selectOne(new PjEvaluateStatQuery() PjEvaluateStatEntity pjEvaluateStatEntity = getPjEvaluateStatEntity(entity, item.getValue(), pjEvaluateStatQuery);
.siteId(entity.getSiteId()) pjEvaluateStatEntity.setWindowFromnum(windowFromnum);
.windowFromnum(windowFromnum) return pjEvaluateStatEntity;
.year(entity.getYear()) }).filter(f -> f != null).collect(Collectors.toList());
.month(entity.getMonth()) saveUpdatePhqueueStatList(saveAndUpdatelist);
.day(entity.getDay()));
if (ObjectUtils.isEmpty(pjEvaluateStatEntity)) {
//统计当前站点新增所有评价数量
pjEvaluateStatEntity = new PjEvaluateStatEntity();
pjEvaluateStatEntity.initAttrValue();
pjEvaluateStatEntity.setSiteId(entity.getSiteId());
pjEvaluateStatEntity.setSiteCode(entity.getSiteCode());
pjEvaluateStatEntity.setSiteName(entity.getSiteName());
pjEvaluateStatEntity.setWindowFromnum(windowFromnum);
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setCreateTime(new Date());
pjEvaluateStatEntity.setCreateUserId(1L);
this.save(pjEvaluateStatEntity);
} else {
pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setYear(entity.getYear());
pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setUpdateTime(new Date());
pjEvaluateStatEntity.setUpdateUserId(1L);
this.update(pjEvaluateStatEntity);
}
});
} }
private void updateSiteOptionPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) { private void updateSiteOptionPjCount(String currentDate, PjEvaluateStatEntity entity, List<PjEvaluateEntity> pjEvaluateEntities) {
Map<String, Long> collect = pjEvaluateEntities.parallelStream().collect(Collectors.groupingBy(x -> x.getPjOption(), Collectors.counting()));
Map<String, Long> collect = pjEvaluateEntities.stream().collect(Collectors.groupingBy(x -> x.getPjOption(), Collectors.counting())); List<PjEvaluateStatEntity> saveAndUpdatelist = collect.entrySet().parallelStream().map(item -> {
collect.entrySet().stream().forEach(item -> {
String pjOption = item.getKey(); String pjOption = item.getKey();
if (ObjectUtils.isEmpty(pjOption)) return; if (ObjectUtils.isEmpty(pjOption)) return null;
Long value = item.getValue(); Long value = item.getValue();
log.info("更新站点评价统计数据,站点名称:{},日期:{},窗口:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getWindowFromnum(), pjEvaluateEntities.size()); //log.info("更新站点评价统计数据,站点名称:{},日期:{},窗口:{},评价数量:{}", entity.getSiteName(), currentDate, entity.getWindowFromnum(), pjEvaluateEntities.size());
PjEvaluateStatEntity pjEvaluateStatEntity = this.selectOne(new PjEvaluateStatQuery() PjEvaluateStatQuery pjEvaluateStatQuery = getPhQueueStatQuery(entity);
.siteId(entity.getSiteId()) pjEvaluateStatQuery.setPjOption(pjOption);
.pjOption(pjOption) PjEvaluateStatEntity pjEvaluateStatEntity = getPjEvaluateStatEntity(entity, value, pjEvaluateStatQuery);
.year(entity.getYear()) pjEvaluateStatEntity.setPjOption(pjOption);
.month(entity.getMonth()) return pjEvaluateStatEntity;
.day(entity.getDay())); }).filter(f -> f != null).collect(Collectors.toList());
if (ObjectUtils.isEmpty(pjEvaluateStatEntity)) { saveUpdatePhqueueStatList(saveAndUpdatelist);
//统计当前站点新增所有评价数量
pjEvaluateStatEntity = new PjEvaluateStatEntity(); }
pjEvaluateStatEntity.initAttrValue();
pjEvaluateStatEntity.setSiteId(entity.getSiteId()); private PjEvaluateStatEntity getPjEvaluateStatEntity(PjEvaluateStatEntity entity, Long value, PjEvaluateStatQuery phQueueStatQuery) {
pjEvaluateStatEntity.setSiteCode(entity.getSiteCode()); PjEvaluateStatEntity pjEvaluateStatEntity = this.selectOne(phQueueStatQuery);
pjEvaluateStatEntity.setSiteName(entity.getSiteName()); if (ObjectUtils.isEmpty(pjEvaluateStatEntity)) {
pjEvaluateStatEntity.setPjOption(pjOption); //统计当前站点新增所有评价数量
pjEvaluateStatEntity.setPjCount(value.intValue()); pjEvaluateStatEntity = new PjEvaluateStatEntity();
pjEvaluateStatEntity.setYear(entity.getYear()); pjEvaluateStatEntity.initAttrValue();
pjEvaluateStatEntity.setMonth(entity.getMonth()); pjEvaluateStatEntity.setSiteId(entity.getSiteId());
pjEvaluateStatEntity.setDay(entity.getDay()); pjEvaluateStatEntity.setSiteCode(entity.getSiteCode());
pjEvaluateStatEntity.setCreateTime(new Date()); pjEvaluateStatEntity.setSiteName(entity.getSiteName());
pjEvaluateStatEntity.setCreateUserId(1L); pjEvaluateStatEntity.setPjCount(value.intValue());
this.save(pjEvaluateStatEntity); pjEvaluateStatEntity.setYear(entity.getYear());
} else { pjEvaluateStatEntity.setMonth(entity.getMonth());
pjEvaluateStatEntity.setPjCount(value.intValue()); pjEvaluateStatEntity.setDay(entity.getDay());
pjEvaluateStatEntity.setYear(entity.getYear()); pjEvaluateStatEntity.setCreateTime(new Date());
pjEvaluateStatEntity.setMonth(entity.getMonth()); pjEvaluateStatEntity.setCreateUserId(1L);
pjEvaluateStatEntity.setDay(entity.getDay()); } else {
pjEvaluateStatEntity.setUpdateTime(new Date()); pjEvaluateStatEntity.setPjCount(value.intValue());
pjEvaluateStatEntity.setUpdateUserId(1L); pjEvaluateStatEntity.setYear(entity.getYear());
this.update(pjEvaluateStatEntity); pjEvaluateStatEntity.setMonth(entity.getMonth());
} pjEvaluateStatEntity.setDay(entity.getDay());
}); pjEvaluateStatEntity.setUpdateTime(new Date());
pjEvaluateStatEntity.setUpdateUserId(1L);
}
return pjEvaluateStatEntity;
} }
...@@ -303,4 +230,33 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat ...@@ -303,4 +230,33 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat
} }
return this.getDao().getStatList(query, pageInfo); return this.getDao().getStatList(query, pageInfo);
} }
private PjEvaluateStatQuery getPhQueueStatQuery(PjEvaluateStatEntity entity) {
PjEvaluateStatQuery pjEvaluateStatQuery = new PjEvaluateStatQuery().siteId(entity.getSiteId())
.year(entity.getYear())
.month(entity.getMonth())
.day(entity.getDay());
return pjEvaluateStatQuery;
}
private void saveUpdatePhqueueStatList(List<PjEvaluateStatEntity> saveAndUpdatelist) {
if (!ObjectUtils.isEmpty(saveAndUpdatelist)) {
Map<Boolean, List<PjEvaluateStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity()));
log.info("新增站点排队部门统计数据,数量:{}", saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) {
//新增列表
this.save(saveUpdateCollect.get(true));
}
log.info("更新站点排队部门统计数据,数量:{}", saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) {
//更新列表
this.update(saveUpdateCollect.get(true));
}
}
}
} }
\ No newline at end of file
...@@ -28,6 +28,39 @@ Content-Type: application/json ...@@ -28,6 +28,39 @@ Content-Type: application/json
"size": 10 "size": 10
} }
###排队叫号汇总统计列表2
POST {{baseUrl}}/ph/queue/stat/interlist
Content-Type: application/json
{
"timeStart": "2024-06-24",
"timeEnd": "2024-06-24",
"siteId": 1,
"businessList": ["交通违法处理"],
"sectionNameList": ["市公安局"],
"groupList": ["year","month","day","business","sectionName"],
"page": 1,
"size": 10
}
###排队叫号汇总统计列表3
POST {{baseUrl}}/ph/queue/stat/interlist
Content-Type: application/json
{
"siteId": 1,
"month": 6,
"year": 2024,
"businessList": ["交通违法处理"],
"sectionNameList": ["市公安局"],
"groupList": ["year","month","business","sectionName"],
"page": 1,
"size": 10
}
###排队叫号汇总统计更新与保存 ###排队叫号汇总统计更新与保存
......
...@@ -56,8 +56,8 @@ POST {{baseUrl}}/ph/queue/stat/stat ...@@ -56,8 +56,8 @@ POST {{baseUrl}}/ph/queue/stat/stat
Content-Type: application/json Content-Type: application/json
{ {
"taketimeStart": "2024-06-24", "taketimeStart": "2024-06-01",
"taketimeEnd": "2024-06-24" "taketimeEnd": "2024-07-15"
} }
......
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