| | |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type, Integer language) throws Exception { |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | | content = content.toLowerCase(); |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | | List<String> list = Arrays.asList(content.split(" ")); |
| | | for(SensitiveWords s : sensitiveWords){ |
| | | List<String> str = new ArrayList<>(); |
| | | String lowerCase = s.getContent().toLowerCase(); |
| | | for (String s1 : list) { |
| | | if(lowerCase.equals(s1.toLowerCase())){ |
| | | str.add("***"); |
| | | }else{ |
| | | str.add(s1); |
| | | } |
| | | } |
| | | list = str; |
| | | for(SensitiveWords s : sensitiveWords) { |
| | | content = content.replaceAll(s.getContent().toLowerCase(), "***"); |
| | | } |
| | | content = list.stream().collect(Collectors.joining(" ")); |
| | | } |
| | | reassign.setRemark(content); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | |
| | | type = null == type ? 2 : type;//现目前微信只支持小程序支付 |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | | content = content.toLowerCase(); |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | | List<String> list = Arrays.asList(content.split(" ")); |
| | | for(SensitiveWords s : sensitiveWords){ |
| | | List<String> str = new ArrayList<>(); |
| | | String lowerCase = s.getContent().toLowerCase(); |
| | | for (String s1 : list) { |
| | | if(lowerCase.equals(s1.toLowerCase())){ |
| | | str.add("***"); |
| | | }else{ |
| | | str.add(s1); |
| | | } |
| | | } |
| | | list = str; |
| | | for(SensitiveWords s : sensitiveWords) { |
| | | content = content.replaceAll(s.getContent().toLowerCase(), "***"); |
| | | } |
| | | content = list.stream().collect(Collectors.joining(" ")); |
| | | } |
| | | reassign.setRemark(content); |
| | | ResultUtil resultUtil = ResultUtil.success(); |