Commit 5c3c720a authored by 赵啸非's avatar 赵啸非

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

parent f1f69523
......@@ -25,6 +25,7 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.pj.model.PjEvaluateStatEntity;
import com.mortals.xhx.module.pj.service.PjEvaluateStatService;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -63,9 +64,9 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
PjEvaluateStatQuery pjEvaluateStatQuery = new PjEvaluateStatQuery();
pjEvaluateStatQuery.setSiteId((Long) siteId);
List<PjEvaluateStatEntity> pjEvaluateStatEntities = this.service.find(pjEvaluateStatQuery, context);
Map<String, String> sectionNameMap = pjEvaluateStatEntities.stream().filter(f -> !ObjectUtils.isEmpty(f.getSectionName())).collect(Collectors.toMap(PjEvaluateStatEntity::getSectionName, PjEvaluateStatEntity::getSectionName, (k1, k2) -> k2));
Map<String, String> hallNameMap = pjEvaluateStatEntities.stream().filter(f -> !ObjectUtils.isEmpty(f.getHallName())).collect(Collectors.toMap(PjEvaluateStatEntity::getHallName, PjEvaluateStatEntity::getHallName, (k1, k2) -> k2));
Map<String, String> windowFromnumMap = pjEvaluateStatEntities.stream().filter(f -> !ObjectUtils.isEmpty(f.getWindowFromnum())).collect(Collectors.toMap(PjEvaluateStatEntity::getWindowFromnum, PjEvaluateStatEntity::getWindowFromnum, (k1, k2) -> k2));
Map<String, String> sectionNameMap = pjEvaluateStatEntities.parallelStream().filter(f -> !ObjectUtils.isEmpty(f.getSectionName())).collect(Collectors.toMap(PjEvaluateStatEntity::getSectionName, PjEvaluateStatEntity::getSectionName, (k1, k2) -> k2));
Map<String, String> hallNameMap = pjEvaluateStatEntities.parallelStream().filter(f -> !ObjectUtils.isEmpty(f.getHallName())).collect(Collectors.toMap(PjEvaluateStatEntity::getHallName, PjEvaluateStatEntity::getHallName, (k1, k2) -> k2));
Map<String, String> windowFromnumMap = pjEvaluateStatEntities.parallelStream().filter(f -> !ObjectUtils.isEmpty(f.getWindowFromnum())).collect(Collectors.toMap(PjEvaluateStatEntity::getWindowFromnum, PjEvaluateStatEntity::getWindowFromnum, (k1, k2) -> k2));
this.addDict(model, "sectionNameList", sectionNameMap);
this.addDict(model, "hallNameList", hallNameMap);
......@@ -79,13 +80,11 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
@Override
protected void doListBefore(PjEvaluateStatEntity query, Map<String, Object> model, Context context) throws AppException {
if (ObjectUtils.isEmpty(query.getHallName())) query.setHallName("");
if (ObjectUtils.isEmpty(query.getSectionName())) query.setSectionName("");
if (ObjectUtils.isEmpty(query.getPjOption())) query.setPjOption("");
if (ObjectUtils.isEmpty(query.getWindowFromnum())) query.setWindowFromnum("");
if (ObjectUtils.isEmpty(query.getHallName())&&ObjectUtils.isEmpty(query.getHallNameList())&&ObjectUtils.isEmpty(query.getHallNameNotList())) query.setHallNameList(Arrays.asList(""));
if (ObjectUtils.isEmpty(query.getSectionName())&&ObjectUtils.isEmpty(query.getSectionNameList())&&ObjectUtils.isEmpty(query.getSectionNameNotList())) query.setSectionNameList(Arrays.asList(""));
if (ObjectUtils.isEmpty(query.getPjOption())&&ObjectUtils.isEmpty(query.getPjOptionList())&&ObjectUtils.isEmpty(query.getPjOptionNotList())) query.setPjOptionList(Arrays.asList(""));
if (ObjectUtils.isEmpty(query.getWindowFromnum())&&ObjectUtils.isEmpty(query.getWindowFromnumList())&&ObjectUtils.isEmpty(query.getWindowFromnumNotList())) query.setWindowFromnumList(Arrays.asList(""));
//年月日
//根据查询条件自动添加分组字段
addGroup(query);
......
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