Browse Source

新增家庭成员添加更新信息-添加调动记录

feature/teamB_zz_wgh
Jackwang 3 years ago
parent
commit
cd9eaf8951
  1. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java
  2. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java
  3. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java

@ -27,6 +27,8 @@ public class IcResiUserConfirmSubmitDTO implements Serializable {
*/
private String customerId;
private String staffId;
/**
* 组织Id
*/

4
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java

@ -119,9 +119,11 @@ public class MyHomeController {
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("addWorkMember")
public Result addWorkMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
public Result addWorkMember(@LoginUser TokenDto tokenDto,@RequestBody IcResiUserConfirmSubmitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setStaffId(tokenDto.getUserId());
return icResiUserService.addWorkMember(dto);
}

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

@ -2366,7 +2366,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), houseInfo.getCustomerId());
if (null != userDTO && null != userDTO.getIdCard()) {
//覆盖原有的家庭成员信息
//覆盖原有的家庭成员信息,并且添加成员变更记录
return updateOldMemberInfo(houseInfo.getCustomerId(),dto);
}
@ -2378,14 +2378,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private Result updateOldMemberInfo(String customerId, IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity userEntity = baseDao.selectResiUserEntityByIdCard(dto.getIdCard(), customerId);
userEntity.setCustomerId(dto.getCustomerId());
userEntity.setAgencyId(dto.getAgencyId());
userEntity.setPids(dto.getPids());
userEntity.setGridId(dto.getGridId());
userEntity.setVillageId(dto.getVillageId());
userEntity.setBuildId(dto.getBuildId());
userEntity.setUnitId(dto.getUnitId());
userEntity.setHomeId(dto.getHomeId());
//在添加调动记录的时候调整
// userEntity.setCustomerId(dto.getCustomerId());
// userEntity.setAgencyId(dto.getAgencyId());
// userEntity.setPids(dto.getPids());
// userEntity.setGridId(dto.getGridId());
// userEntity.setVillageId(dto.getVillageId());
// userEntity.setBuildId(dto.getBuildId());
// userEntity.setUnitId(dto.getUnitId());
// userEntity.setHomeId(dto.getHomeId());
userEntity.setName(dto.getName());
userEntity.setIdCard(dto.getIdCard());
@ -2397,6 +2398,22 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
userEntity.setHjszd(dto.getHjszd());
userEntity.setXjzd(dto.getXjzd());
userEntity.setUpdatedTime(new java.util.Date());
//添加人员调动记录
IcResiUserTransferFormDTO formDTO = new IcResiUserTransferFormDTO();
formDTO.setIcUserId(userEntity.getId());
formDTO.setType("in");//客户内
formDTO.setNewAgencyId(dto.getAgencyId());
formDTO.setNewGridId(dto.getGridId());
formDTO.setNewNeighborHoodId(dto.getVillageId());
formDTO.setNewBuildingId(dto.getBuildId());
formDTO.setNewBuildingUnitId(dto.getUnitId());
formDTO.setNewHouseId(dto.getHomeId());
formDTO.setTransferTime(new java.util.Date());
formDTO.setRemark("更换房屋");
formDTO.setReason("更换房屋");
formDTO.setOrigin(IcResiUserConstant.CHANGE);
icUserTransferRecordService.add(formDTO);
//更新家庭成员信息
baseDao.updateById(userEntity);
return new Result().ok("新增成功");
}

Loading…
Cancel
Save