Commit c442cabe authored by tianyiming's avatar tianyiming

两个规定-通过组id查询组及组内人员信息接口优化

parent 1c709d65
...@@ -29,4 +29,6 @@ public interface IDataDictionaryService { ...@@ -29,4 +29,6 @@ public interface IDataDictionaryService {
List<DataDictionary> getByParent(String parent); List<DataDictionary> getByParent(String parent);
List<DataDictionary> getByTypeAndDesc(String type, String group); List<DataDictionary> getByTypeAndDesc(String type, String group);
DataDictionary getByExtend(String groupId, String type);
} }
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.*; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collection; import java.util.Collection;
...@@ -184,4 +185,13 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -184,4 +185,13 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
wrapper.likeRight(DataDictionary::getTypeDesc,typeDesc); wrapper.likeRight(DataDictionary::getTypeDesc,typeDesc);
return this.list(wrapper); return this.list(wrapper);
} }
@Override
public DataDictionary getByExtend(String groupId, String type) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DataDictionary::getExtend, groupId);
wrapper.likeRight(DataDictionary::getType, type);
DataDictionary dataDictionary = dataDictionaryMapper.selectOne(wrapper);
return ObjectUtils.isEmpty(dataDictionary) ? new DataDictionary() : dataDictionary;
}
} }
package com.yeejoin.amos.boot.module.tcm.biz.service.impl; package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
import cn.hutool.json.ObjectMapper;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -11,7 +10,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; ...@@ -11,7 +10,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
...@@ -22,8 +20,6 @@ import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper; ...@@ -22,8 +20,6 @@ import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService;
import com.yeejoin.amos.boot.module.tcm.api.vo.TzsUserInfoVo; import com.yeejoin.amos.boot.module.tcm.api.vo.TzsUserInfoVo;
import com.yeejoin.amos.boot.module.tcm.api.vo.TzsUserQualificationsVo;
import com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
...@@ -68,8 +64,11 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -68,8 +64,11 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
private final String USER_ROLE = "QYRYJS"; private final String USER_ROLE = "QYRYJS";
//企业人员用户组 //企业人员用户组
private final String ROLE_GROUP = "QYRYYHZ"; private final String ROLE_GROUP = "QYRYYHZ";
//两个规定用户组-对应企业人员的人员类型 //两个规定用户组-对应企业人员的人员类型前缀
private final String QYRYGW = "QYRYGW"; private final String QYRYGW = "QYRYGW";
//两个规定用户组-对应企业人员的人员类型前缀
private final String QYRYGW_NAME = "两员配备-企业人员类型";
//平台用户锁定状态 //平台用户锁定状态
private final String UNLOCK = "UNLOCK"; private final String UNLOCK = "UNLOCK";
private final String LOCK = "LOCK"; private final String LOCK = "LOCK";
...@@ -102,7 +101,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -102,7 +101,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
} }
LambdaQueryWrapper<DataDictionary> lambda = new QueryWrapper<DataDictionary>().lambda(); LambdaQueryWrapper<DataDictionary> lambda = new QueryWrapper<DataDictionary>().lambda();
lambda.in(DataDictionary::getSequenceNbr, dictIds); lambda.in(DataDictionary::getSequenceNbr, dictIds);
List<DataDictionary> dataDictionaries = iDataDictionaryService.getByTypeAndDesc("QYRYGW","两员配备"); List<DataDictionary> dataDictionaries = iDataDictionaryService.getByTypeAndDesc(QYRYGW, QYRYGW_NAME);
List<DataDictionary> postDataList = dataDictionaries.stream().filter(d -> dictIds.stream().anyMatch(id -> id.toString().equals(d.getSequenceNbr().toString()))).collect(Collectors.toList()); List<DataDictionary> postDataList = dataDictionaries.stream().filter(d -> dictIds.stream().anyMatch(id -> id.toString().equals(d.getSequenceNbr().toString()))).collect(Collectors.toList());
return postDataList.stream().map(DataDictionary::getName).collect(Collectors.joining(",")); return postDataList.stream().map(DataDictionary::getName).collect(Collectors.joining(","));
} }
...@@ -435,12 +434,13 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -435,12 +434,13 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
public List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId) { public List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId) {
List<GroupAndPersonInfoDto> result = new ArrayList<>(); List<GroupAndPersonInfoDto> result = new ArrayList<>();
List<AgencyUserModel> agencyUserModelList = Privilege.groupUserClient.queryForList(groupId).getResult(); List<AgencyUserModel> agencyUserModelList = Privilege.groupUserClient.queryForList(groupId).getResult();
DataDictionary dataDictionary = iDataDictionaryService.getByExtend(groupId.toString(), QYRYGW);
if (!ObjectUtils.isEmpty(agencyUserModelList) && agencyUserModelList.size() > 0) { if (!ObjectUtils.isEmpty(agencyUserModelList) && agencyUserModelList.size() > 0) {
for (AgencyUserModel agencyUserModel : agencyUserModelList) { for (AgencyUserModel agencyUserModel : agencyUserModelList) {
GroupAndPersonInfoDto groupAndPersonInfoDto = tzsUserInfoMapper.getUnitInfoByUserId(agencyUserModel.getUserId()); GroupAndPersonInfoDto groupAndPersonInfoDto = tzsUserInfoMapper.getUnitInfoByUserId(agencyUserModel.getUserId());
if (!ObjectUtils.isEmpty(groupAndPersonInfoDto)) { if (!ObjectUtils.isEmpty(groupAndPersonInfoDto)) {
groupAndPersonInfoDto.setGroupId(groupId); groupAndPersonInfoDto.setGroupId(groupId);
String groupName = Privilege.groupClient.seleteOne(groupId).getResult().getGroupName(); String groupName = ObjectUtils.isEmpty(dataDictionary) ? null : dataDictionary.getName();
groupAndPersonInfoDto.setGroupName(groupName); groupAndPersonInfoDto.setGroupName(groupName);
groupAndPersonInfoDto.setUserId(agencyUserModel.getUserId()); groupAndPersonInfoDto.setUserId(agencyUserModel.getUserId());
groupAndPersonInfoDto.setUserName(agencyUserModel.getRealName()); groupAndPersonInfoDto.setUserName(agencyUserModel.getRealName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment