| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import org.springblade.common.utils.DesensitizedUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * ftp 数据处理 |
| | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | |
| | | /** |
| | | * 初始化 |
| | | */ |
| | | @PostConstruct |
| | |
| | | handler = this; |
| | | handler.userService = this.userService; |
| | | handler.redisTemplate = this.redisTemplate; |
| | | } |
| | | |
| | | /** |
| | | * 获取保安员证编号位数 |
| | | * @param json |
| | | * @param uuid |
| | | * @return |
| | | */ |
| | | public static Result handlerSecurityNumberBit(String json, String uuid) { |
| | | Map map = JSON.parseObject(json, Map.class); |
| | | //获取结果 |
| | | Object o = map.get(uuid); |
| | | if (null== o || o.equals("")){ |
| | | return new Result(400,null,"uuid 不匹配",null); |
| | | }else { |
| | | //转换 |
| | | Result result = JSON.parseObject(o.toString(), Result.class); |
| | | //返回 |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读取数据 |
| | | * @param json |
| | | * @param uuid |
| | | * @return |
| | | */ |
| | | public static Result handlerList(String json, String uuid) { |
| | | Map map = JSON.parseObject(json, Map.class); |
| | | //获取结果 |
| | | Object o = map.get(uuid); |
| | | if (null== o || o.equals("")){ |
| | | return new Result(400,null,"uuid 不匹配",null); |
| | | }else { |
| | | //转换 |
| | | Result result = JSON.parseObject(o.toString(), Result.class); |
| | | //返回 |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | //取出后将 redis 删除 |
| | | handler.redisTemplate.delete(uuid); |
| | | //返回的user,需处理敏感数据 |
| | | User user1 = user; |
| | | User user1 = Objects.requireNonNull(BeanUtil.copy(user,User.class)); |
| | | //敏感数据处理 |
| | | user1.setCardid(DesensitizedUtil.desensitizedIdNumberBy4(user.getCardid())); |
| | | user1.setPhone(DesensitizedUtil.desensitizedPhoneNumber(user.getPhone())); |
| | |
| | | user1.setNativeplace(""); |
| | | user1.setEducation(""); |
| | | user1.setPoliticaloutlook(""); |
| | | user1.setMyPicture(""); |
| | | user1.setHeight(""); |
| | | user1.setRtime(null); |
| | | //返回 |
| | | return user1; |
| | | } |