Browse Source

更新更新人员头像的dto

dev
zhangyuan 3 years ago
parent
commit
8218e6381e
  1. 59
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java
  2. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

59
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java

@ -1,9 +1,9 @@
package com.epmet.dto.form;
import com.epmet.dto.IcResiUserAttachmentDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
/**
@ -19,68 +19,13 @@ public class RentTenantFormDTO implements Serializable {
/**
* 头像
*/
private String img;
private List<IcResiUserAttachmentDTO> images;
/**
* customerId
*/
private String customerId;
/**
* gridId
*/
private String gridId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/

24
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -402,23 +402,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
@Transactional(rollbackFor = Exception.class)
public String rentUpdate(RentTenantFormDTO formDTO) {
String resiUserId;
String resiUserId = "";
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(formDTO.getIdCard(), formDTO.getCustomerId());
if (null != userDTO && null != userDTO.getIdCard()) {
GridInfoResultDTO deptInfo = govOrgFeignClient.queryGridInfo(formDTO.getGridId()).getData();
// 没有该居民,新增一个居民
IcResiUserEntity entity = new IcResiUserEntity();
insert(entity);
resiUserId = entity.getId();
} else {
if (null != userDTO) {
resiUserId = userDTO.getId();
// 插入附件头像(只有一张)
formDTO.getImages().forEach(item -> {
item.setUserId(userDTO.getId());
});
formDTO.getImages().forEach(item -> {
icResiUserAttachmentService.save(item);
});
}
// 插入附件头像
IcResiUserAttachmentDTO dto = new IcResiUserAttachmentDTO();
dto.setUserId(resiUserId);
dto.setAttachmentUrl(formDTO.getImg());
icResiUserAttachmentService.save(dto);
return resiUserId;
}

Loading…
Cancel
Save