|
|
@ -376,6 +376,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
Map<String, Integer> resMap = new HashMap<>(); |
|
|
|
for (PrUserProjectResultEntity res : resultList) { |
|
|
|
JSONObject originalData = JSON.parseObject(res.getOriginalData()); |
|
|
|
if(originalData.containsKey(key)){ |
|
|
|
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)); |
|
|
@ -390,7 +391,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
resMap.put(pathName, count == null ? 1 : count + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
detail.put("totalCount", totalCount); |
|
|
|
detail.put("profile", resMap); |
|
|
@ -543,8 +544,34 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
* @date 2021/9/22 1:37 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<List<String>> queryItemResDetail(ItemResDetailFormDTO formDTO) { |
|
|
|
//todo
|
|
|
|
return null; |
|
|
|
public List<String> queryItemResDetail(ItemResDetailFormDTO formDTO) { |
|
|
|
List<PrUserProjectResultEntity> resultList=baseDao.selectResults(formDTO.getProjectKey()); |
|
|
|
if(CollectionUtils.isEmpty(resultList)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
List<String> stringList=new ArrayList<>(); |
|
|
|
String key="field".concat(formDTO.getFormItemId()); |
|
|
|
for(PrUserProjectResultEntity res:resultList){ |
|
|
|
JSONObject originalData = JSON.parseObject(res.getOriginalData()); |
|
|
|
if(ProjectItemTypeEnum.INPUT.getValue().equals(formDTO.getType()) |
|
|
|
||ProjectItemTypeEnum.TEXTAREA.getValue().equals(formDTO.getType()) |
|
|
|
||ProjectItemTypeEnum.TIME.getValue().equals(formDTO.getType()) |
|
|
|
||ProjectItemTypeEnum.DATE.getValue().equals(formDTO.getType())){ |
|
|
|
if(originalData.containsKey(key)){ |
|
|
|
stringList.add((String) originalData.get(key)); |
|
|
|
continue; |
|
|
|
} |
|
|
|
}else if(ProjectItemTypeEnum.TIME_RANGE.getValue().equals(formDTO.getType()) |
|
|
|
||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(formDTO.getType())){ |
|
|
|
if(originalData.containsKey(key)){ |
|
|
|
List<String> originalList= (List<String>) originalData.get(key); |
|
|
|
if(!CollectionUtils.isEmpty(originalList)){ |
|
|
|
String rangeStr=StringUtils.join(originalList,StrConstant.COMMA); |
|
|
|
stringList.add(rangeStr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return stringList; |
|
|
|
} |
|
|
|
} |