修改app显示问题
This commit is contained in:
parent
425fb04628
commit
683ddfa634
@ -78,7 +78,7 @@ public class BasePopulationInfoAppController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("getbasepopulationinfobyid/{basePopulationInfoId}")
|
||||
public BasePopulationInfoDTO getBasePopulationInfoById(@RequestHeader("token") String token, @PathVariable("basePopulationInfoId") String basePopulationInfoId) throws SearchException {
|
||||
return basePopulationInfoService.getBasePopulationInfoById(basePopulationInfoId);
|
||||
return basePopulationInfoService.getBasePopulationInfoByIdForApp(basePopulationInfoId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员信息基础表列表", notes = "人员信息基础表列表接口")
|
||||
|
@ -165,4 +165,6 @@ public interface IBasePopulationInfoService {
|
||||
* @param dataObj
|
||||
*/
|
||||
void saveBasePopulationInfoImport(Map<String, Object> dataObj);
|
||||
|
||||
BasePopulationInfoDTO getBasePopulationInfoByIdForApp(String basePopulationInfoId);
|
||||
}
|
@ -192,12 +192,100 @@ public class BasePopulationInfoServiceImpl extends AbstractService implements IB
|
||||
|
||||
@Override
|
||||
public BasePopulationInfoDTO getBasePopulationInfoById(String basePopulationInfoId) throws SearchException {
|
||||
Map<String, Object> params = super.getHashMap(1);
|
||||
params.put("basePopulationInfoId", basePopulationInfoId);
|
||||
BasePopulationInfoDTO dto = basePopulationInfoDao.getBasePopulationInfo(params);
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasePopulationInfoDTO getBasePopulationInfoByIdForApp(String basePopulationInfoId) {
|
||||
Map<String, Object> params = super.getHashMap(1);
|
||||
params.put("basePopulationInfoId", basePopulationInfoId);
|
||||
BasePopulationInfoDTO dto = basePopulationInfoDao.getBasePopulationInfo(params);
|
||||
if(dto != null){
|
||||
DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender());
|
||||
dto.setGender(dictDto.getDictionaryName());
|
||||
//查询数据字典用于比对字典数据值
|
||||
List<Map<String, Object>> dicList = basePopulationInfoDao.listDictionaryAll();
|
||||
for(Map<String, Object> dicItem :dicList){
|
||||
String dicId = dicItem.get("dictionary_id").toString();
|
||||
//性别
|
||||
if(dicId.equals(dto.getGender())){
|
||||
dto.setGender(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//民族
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getNation())){
|
||||
dto.setNation(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//籍贯
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getNativePlace())){
|
||||
dto.setNativePlace(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//政治面貌
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getPoliticalStatus())){
|
||||
dto.setPoliticalStatus(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//婚姻状况
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getMaritalStatus())){
|
||||
dto.setMaritalStatus(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//学历
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getEducation())){
|
||||
dto.setEducation(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//宗教信仰
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getReligion())){
|
||||
dto.setReligion(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//职业类别
|
||||
if(dicItem.get("dictionary_id").toString().equals(dto.getOccupationCategory())){
|
||||
dto.setOccupationCategory(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
}
|
||||
//处理籍贯
|
||||
String[] nativePlaceStr = dto.getNativePlace().split("&");
|
||||
if(nativePlaceStr.length > 0 && !"".equals(nativePlaceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < nativePlaceStr.length; i++){
|
||||
if(i + 1 == nativePlaceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
dto.setNativePlace(str);
|
||||
}
|
||||
//处理户籍地
|
||||
String[] registeredResidenceStr = dto.getRegisteredResidence().split("&");
|
||||
if(registeredResidenceStr.length > 0 && !"".equals(registeredResidenceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < registeredResidenceStr.length; i++){
|
||||
if(i + 1 == registeredResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
dto.setRegisteredResidence(str);
|
||||
}
|
||||
//处理现住地
|
||||
String[] currentResidenceStr = dto.getCurrentResidence().split("&");
|
||||
if(currentResidenceStr.length > 0 && !"".equals(currentResidenceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < currentResidenceStr.length; i++){
|
||||
if(i + 1 == currentResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(currentResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
dto.setCurrentResidence(str);
|
||||
}
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
@ -252,38 +340,47 @@ public class BasePopulationInfoServiceImpl extends AbstractService implements IB
|
||||
//处理籍贯
|
||||
String[] nativePlaceStr = item.getNativePlace().split("&");
|
||||
if(nativePlaceStr.length > 0 && !"".equals(nativePlaceStr[0])){
|
||||
String nativePlace = "";
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[0]);
|
||||
nativePlace += areaById.getAreaName() + "-";
|
||||
DataAreaDTO areaById1 = dataAreaService.getAreaById(nativePlaceStr[1]);
|
||||
nativePlace += areaById1.getAreaName() + "-";
|
||||
DataAreaDTO areaById2 = dataAreaService.getAreaById(nativePlaceStr[2]);
|
||||
nativePlace += areaById2.getAreaName();
|
||||
item.setNativePlace(nativePlace);
|
||||
String str = "";
|
||||
for(int i = 0 ; i < nativePlaceStr.length; i++){
|
||||
if(i + 1 == nativePlaceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
item.setNativePlace(str);
|
||||
}
|
||||
//处理户籍地
|
||||
String[] registeredResidenceStr = item.getRegisteredResidence().split("&");
|
||||
if(registeredResidenceStr.length > 0 && !"".equals(registeredResidenceStr[0])){
|
||||
String registeredResidence = "";
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[0]);
|
||||
registeredResidence += areaById.getAreaName() + "-";
|
||||
DataAreaDTO areaById1 = dataAreaService.getAreaById(registeredResidenceStr[1]);
|
||||
registeredResidence += areaById1.getAreaName() + "-";
|
||||
DataAreaDTO areaById2 = dataAreaService.getAreaById(registeredResidenceStr[2]);
|
||||
registeredResidence += areaById2.getAreaName();
|
||||
item.setRegisteredResidence(registeredResidence);
|
||||
String str = "";
|
||||
for(int i = 0 ; i < registeredResidenceStr.length; i++){
|
||||
if(i + 1 == registeredResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
item.setRegisteredResidence(str);
|
||||
}
|
||||
//处理现住地
|
||||
String[] currentResidenceStr = item.getCurrentResidence().split("&");
|
||||
if(currentResidenceStr.length > 0 && !"".equals(currentResidenceStr[0])){
|
||||
String currentResidence = "";
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(currentResidenceStr[0]);
|
||||
currentResidence += areaById.getAreaName() + "-";
|
||||
DataAreaDTO areaById1 = dataAreaService.getAreaById(currentResidenceStr[1]);
|
||||
currentResidence += areaById1.getAreaName() + "-";
|
||||
DataAreaDTO areaById2 = dataAreaService.getAreaById(currentResidenceStr[2]);
|
||||
currentResidence += areaById2.getAreaName();
|
||||
item.setCurrentResidence(currentResidence);
|
||||
String str = "";
|
||||
for(int i = 0 ; i < currentResidenceStr.length; i++){
|
||||
if(i + 1 == currentResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(currentResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
item.setCurrentResidence(str);
|
||||
}
|
||||
}
|
||||
PageInfo<BasePopulationInfoDTO> pageInfo = new PageInfo<>(basePopulationInfoDTOs);
|
||||
@ -307,9 +404,87 @@ public class BasePopulationInfoServiceImpl extends AbstractService implements IB
|
||||
if(populationInfoDTO == null){
|
||||
return new BasePopulationInfoDTO();
|
||||
}
|
||||
if(!"".equals(populationInfoDTO.getGender())){
|
||||
DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(populationInfoDTO.getGender());
|
||||
populationInfoDTO.setGender(dictDto == null ? "" : dictDto.getDictionaryName());
|
||||
//查询数据字典用于比对字典数据值
|
||||
List<Map<String, Object>> dicList = basePopulationInfoDao.listDictionaryAll();
|
||||
for(Map<String, Object> dicItem :dicList){
|
||||
String dicId = dicItem.get("dictionary_id").toString();
|
||||
//性别
|
||||
if(dicId.equals(populationInfoDTO.getGender())){
|
||||
populationInfoDTO.setGender(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//民族
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getNation())){
|
||||
populationInfoDTO.setNation(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//籍贯
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getNativePlace())){
|
||||
populationInfoDTO.setNativePlace(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//政治面貌
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getPoliticalStatus())){
|
||||
populationInfoDTO.setPoliticalStatus(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//婚姻状况
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getMaritalStatus())){
|
||||
populationInfoDTO.setMaritalStatus(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//学历
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getEducation())){
|
||||
populationInfoDTO.setEducation(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//宗教信仰
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getReligion())){
|
||||
populationInfoDTO.setReligion(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
//职业类别
|
||||
if(dicItem.get("dictionary_id").toString().equals(populationInfoDTO.getOccupationCategory())){
|
||||
populationInfoDTO.setOccupationCategory(dicItem.get("dictionary_name").toString());
|
||||
}
|
||||
}
|
||||
//处理籍贯
|
||||
String[] nativePlaceStr = populationInfoDTO.getNativePlace().split("&");
|
||||
if(nativePlaceStr.length > 0 && !"".equals(nativePlaceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < nativePlaceStr.length; i++){
|
||||
if(i + 1 == nativePlaceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(nativePlaceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
populationInfoDTO.setNativePlace(str);
|
||||
}
|
||||
//处理户籍地
|
||||
String[] registeredResidenceStr = populationInfoDTO.getRegisteredResidence().split("&");
|
||||
if(registeredResidenceStr.length > 0 && !"".equals(registeredResidenceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < registeredResidenceStr.length; i++){
|
||||
if(i + 1 == registeredResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
populationInfoDTO.setRegisteredResidence(str);
|
||||
}
|
||||
//处理现住地
|
||||
String[] currentResidenceStr = populationInfoDTO.getCurrentResidence().split("&");
|
||||
if(currentResidenceStr.length > 0 && !"".equals(currentResidenceStr[0])){
|
||||
String str = "";
|
||||
for(int i = 0 ; i < currentResidenceStr.length; i++){
|
||||
if(i + 1 == currentResidenceStr.length){
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(currentResidenceStr[i]);
|
||||
str += areaById.getAreaName();
|
||||
} else {
|
||||
DataAreaDTO areaById = dataAreaService.getAreaById(registeredResidenceStr[i]);
|
||||
str += areaById.getAreaName() + "-";
|
||||
}
|
||||
}
|
||||
populationInfoDTO.setCurrentResidence(str);
|
||||
}
|
||||
return populationInfoDTO;
|
||||
}
|
||||
|
@ -226,6 +226,7 @@
|
||||
<if test="idCardNumber != null and idCardNumber != ''">
|
||||
AND t1.id_card_number = #{idCardNumber}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<!-- 人员信息基础表列表 -->
|
||||
|
Loading…
Reference in New Issue
Block a user