优化
This commit is contained in:
		@ -174,21 +174,24 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
        //2、copy数据返回
 | 
			
		||||
        WgzAppPersonalBasicInformationRes wgzAppPersonalBasicInformationRes = new WgzAppPersonalBasicInformationRes();
 | 
			
		||||
        BeanUtils.copyProperties(wgzUser,wgzAppPersonalBasicInformationRes);
 | 
			
		||||
		wgzAppPersonalBasicInformationRes.setAge(DataUtil.calculateAge(wgzAppPersonalBasicInformationRes.getBirthdate()));
 | 
			
		||||
		//3、字典类型转换
 | 
			
		||||
		List<SysDictData> typeOfWork = dictTypeService.selectDictDataByType("type_of_work");
 | 
			
		||||
		System.out.println("??         "+typeOfWork.toString());
 | 
			
		||||
		String[] split = wgzAppPersonalBasicInformationRes.getTypeOfWork().split(",");
 | 
			
		||||
		StringBuilder typeOfWorkName = new StringBuilder();
 | 
			
		||||
		for (SysDictData sysDictData : typeOfWork) {
 | 
			
		||||
			for (String s : split) {
 | 
			
		||||
				if (sysDictData.getDictValue().equals(s)){
 | 
			
		||||
					typeOfWorkName.append(sysDictData.getDictLabel()).append(",");
 | 
			
		||||
		if (wgzAppPersonalBasicInformationRes.getBirthdate() != null){
 | 
			
		||||
			wgzAppPersonalBasicInformationRes.setAge(DataUtil.calculateAge(String.valueOf(wgzAppPersonalBasicInformationRes.getBirthdate())));
 | 
			
		||||
		}
 | 
			
		||||
		if (wgzAppPersonalBasicInformationRes.getTypeOfWork() != null){
 | 
			
		||||
			//3、字典类型转换
 | 
			
		||||
			List<SysDictData> typeOfWork = dictTypeService.selectDictDataByType("type_of_work");
 | 
			
		||||
			String[] split = wgzAppPersonalBasicInformationRes.getTypeOfWork().split(",");
 | 
			
		||||
			StringBuilder typeOfWorkName = new StringBuilder();
 | 
			
		||||
			for (SysDictData sysDictData : typeOfWork) {
 | 
			
		||||
				for (String s : split) {
 | 
			
		||||
					if (sysDictData.getDictValue().equals(s)){
 | 
			
		||||
						typeOfWorkName.append(sysDictData.getDictLabel()).append(",");
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			typeOfWorkName.deleteCharAt(typeOfWorkName.length() - 1);
 | 
			
		||||
			wgzAppPersonalBasicInformationRes.setTypeOfWorkName(typeOfWorkName.toString());
 | 
			
		||||
		}
 | 
			
		||||
		typeOfWorkName.deleteCharAt(typeOfWorkName.length() - 1);
 | 
			
		||||
		wgzAppPersonalBasicInformationRes.setTypeOfWorkName(typeOfWorkName.toString());
 | 
			
		||||
		return wgzAppPersonalBasicInformationRes;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -199,6 +202,8 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
		//1、对指定用户进行实名认证
 | 
			
		||||
		WgzUser user = new WgzUser();
 | 
			
		||||
		BeanUtils.copyProperties(req, user);
 | 
			
		||||
		System.out.println("1??????????      "+req.getTypeOfWork());
 | 
			
		||||
		System.out.println("2??????????      "+user.getTypeOfWork());
 | 
			
		||||
		int update = baseMapper.update(user, new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getUserId, req.getUserId()));
 | 
			
		||||
		if (update == 0){
 | 
			
		||||
			throw new RuntimeException("当前用户不存在!");
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user