| | |
| | | @Service |
| | | public class GetShowDictList { |
| | | @Autowired |
| | | private SysDictTypeService sysDictTypeService; |
| | | private SysDictTypeService sysDictTypeService; |
| | | |
| | | public String getShowDictList(String values, String DictTYpe) { |
| | | public String getShowDictList(String values, String DictTYpe, Boolean enter) { |
| | | List<DictDto> userDicts = sysDictTypeService.getUserDicts(); |
| | | DictDto testType1Dict = userDicts.stream() |
| | | .filter(c -> c.getDictType().equals(DictTYpe)) |
| | | .collect(Collectors.toList()).get(0); |
| | | values = "," + values + ","; |
| | | String result = ""; |
| | | int i = 0; |
| | | for (DictItemDto dictItemDto : ((DictLeafDto) testType1Dict).getDataList()) { |
| | | String value = dictItemDto.getDictValue(); |
| | | String desc = (values.contains("," + value + ",") ? "☑" : "□") + dictItemDto.getDictLabel(); |
| | | i++; |
| | | if (enter && i < ((DictLeafDto) testType1Dict).getDataList().size()) { |
| | | desc = desc + "\r\n"; |
| | | } |
| | | result = result + desc; |
| | | } |
| | | return result; |