|
|
@ -26,6 +26,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
|
|
@ -365,12 +366,34 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
//3.4级联 todo
|
|
|
|
//3.4级联
|
|
|
|
if(ProjectItemTypeEnum.CASCADER.getValue().equals(currentType)){ |
|
|
|
//目前cascaderExpandStruct 没啥用
|
|
|
|
CascaderExpandStruct cascaderExpandStruct = JSON.parseObject(item.getExpand(), CascaderExpandStruct.class); |
|
|
|
//共选择了多少次,每道题相加
|
|
|
|
int totalCount = 0; |
|
|
|
Map<String, Integer> resMap = new HashMap<>(); |
|
|
|
for (PrUserProjectResultEntity res : resultList) { |
|
|
|
JSONObject originalData = JSON.parseObject(res.getOriginalData()); |
|
|
|
List<CascaderDTO> dtoList = JSON.parseArray(originalData.get(key).toString(), CascaderDTO.class); |
|
|
|
if(CollectionUtils.isEmpty(dtoList)){ |
|
|
|
log.info(String.format("当前userId:%s,没有填写本题itemId:%s",res.getUserId(),key)); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
for (CascaderDTO cascaderDTO : dtoList) { |
|
|
|
if (null != cascaderDTO && !CollectionUtils.isEmpty(cascaderDTO.getLabels())) { |
|
|
|
totalCount += 1; |
|
|
|
String pathName = StringUtils.join(cascaderDTO.getLabels(), StringUtils.isNotBlank(cascaderExpandStruct.getSeparator()) ? cascaderExpandStruct.getSeparator() : StrConstant.HYPHEN); |
|
|
|
Integer count = resMap.get(pathName); |
|
|
|
resMap.put(pathName, count == null ? 1 : count + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
detail.put("totalCount", totalCount); |
|
|
|
detail.put("profile", resMap); |
|
|
|
item.setDetail(detail); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|