查詢个人信息修改

master
Xusan 2024-05-21 17:17:57 +08:00
parent 124e64491d
commit f62addc846
3 changed files with 29 additions and 4 deletions

View File

@ -4,10 +4,12 @@ insert into "FXKH_TXL"."ORGANIZATION"("ID", "NAME") VALUES
('2','省防办' ),
('3','省防指成员单位' ),
('4','市、县防指、防办' ),
('5','主要湖泊及涉湖泵站' ),
('5','主要湖泊' ),
('6','重要提防' ),
('7','主要蓄滞洪区' ),
('8','大型水库大坝' );
('8','大型水库大坝' ),
('9','重点泵站' ),
('10','大中型涵闸' );
SET IDENTITY_INSERT FXKH_TXL.ORGANIZATION Off;
insert into "FXKH_TXL"."USERS"("USERNAME", "PASSWORD", "SALT", "ROLE", "AB_ID")

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.whdc.model.dto.AddressBootDto;
import com.whdc.model.entity.AbUdR;
import com.whdc.model.entity.AddressBook;
import com.whdc.model.entity.Organization;
import com.whdc.model.entity.User;
import com.whdc.model.enums.Role;
import com.whdc.model.enums.VersionsType;
@ -272,7 +273,16 @@ public class AddressBookController {
@GetMapping(value = "get/{id}")
public ResultJson get(@PathVariable("id") Integer id) {
return ResultJson.ok(service.getById(id));
AddressBook byId = service.getById(id);
if (byId != null){
if (StringUtils.isNotBlank(byId.getOrganization())){
Organization byId2 = organizationsService.getById(byId.getOrganization());
if (byId2 != null){
byId.setOname(byId2.getName());
}
}
}
return ResultJson.ok(byId);
}
@ApiOperation(value = "查询用户详情")
@ -283,7 +293,16 @@ public class AddressBookController {
return ResultJson.error("该用户不存在");
}
// return ResultJson.ok(JSON.parseObject(JSON.toJSONString(service.getById(byId.getAbId())).replaceAll("null","")));
return ResultJson.ok(service.getById(byId.getAbId()));
AddressBook byId1 = service.getById(byId.getAbId());
if (byId1 != null){
if (StringUtils.isNotBlank(byId1.getOrganization())){
Organization byId2 = organizationsService.getById(byId1.getOrganization());
if (byId2 != null){
byId1.setOname(byId2.getName());
}
}
}
return ResultJson.ok(byId1);
}
}

View File

@ -61,6 +61,10 @@ public class AddressBook extends Model<AddressBook> implements Serializable {
@ApiModelProperty(value = "组织")
private String organization;
@TableField(exist = false)
@ApiModelProperty(value = "组织名称")
private String oname;
@TableField("POSITION")
@ApiModelProperty(value = "职务")
private String position;