优化
This commit is contained in:
		@ -33,6 +33,8 @@ import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
import static com.ruoyi.common.constant.Constants.WGZ;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APP务工者Service业务层处理
 | 
			
		||||
@ -173,11 +175,20 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
        WgzAppPersonalBasicInformationRes wgzAppPersonalBasicInformationRes = new WgzAppPersonalBasicInformationRes();
 | 
			
		||||
        BeanUtils.copyProperties(wgzUser,wgzAppPersonalBasicInformationRes);
 | 
			
		||||
		wgzAppPersonalBasicInformationRes.setAge(DataUtil.calculateAge(wgzAppPersonalBasicInformationRes.getBirthdate()));
 | 
			
		||||
		//3、字典类型转换
 | 
			
		||||
		List<SysDictData> typeOfWork = dictTypeService.selectDictDataByType("type_of_work");
 | 
			
		||||
		List<String> split = Arrays.asList(wgzAppPersonalBasicInformationRes.getTypeOfWork().split(","));
 | 
			
		||||
		String typeOfWorkName = typeOfWork.stream().filter(dictData -> split.contains(dictData.getDictValue())).map(SysDictData::getDictLabel)
 | 
			
		||||
			.collect(Collectors.joining(","));
 | 
			
		||||
		wgzAppPersonalBasicInformationRes.setTypeOfWorkName(typeOfWorkName);
 | 
			
		||||
		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(",");
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		typeOfWorkName.deleteCharAt(typeOfWorkName.length() - 1);
 | 
			
		||||
		wgzAppPersonalBasicInformationRes.setTypeOfWorkName(typeOfWorkName.toString());
 | 
			
		||||
		return wgzAppPersonalBasicInformationRes;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -192,10 +203,19 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
		if (update == 0){
 | 
			
		||||
			throw new RuntimeException("当前用户不存在!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//2、新增附件
 | 
			
		||||
		List<Annex> annex = req.getAnnex();
 | 
			
		||||
		List<AnnexDTO> annexDTOS = new ArrayList<>();
 | 
			
		||||
		BeanUtils.copyProperties(annex, annexDTOS);
 | 
			
		||||
		for (Annex data : annex) {
 | 
			
		||||
			AnnexDTO dto = new AnnexDTO();
 | 
			
		||||
			BeanUtils.copyProperties(data, dto);
 | 
			
		||||
			dto.setUserId(req.getUserId()).setUserType(WGZ);
 | 
			
		||||
//				setAnnexType(data.getAnnexType()).
 | 
			
		||||
//				setAnnexName(data.getAnnexName()).
 | 
			
		||||
//				setAnnexUrl(data.getAnnexUrl());
 | 
			
		||||
			annexDTOS.add(dto);
 | 
			
		||||
		}
 | 
			
		||||
		iAnnexService.insertBatch(annexDTOS);
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user