Browse Source

【我的家庭】迁出家庭成员

master
HAHA 3 years ago
parent
commit
d519a2b340
  1. 136
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MoveOutMemberFormDTO.java
  2. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java
  3. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java
  4. 43
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  5. 59
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java
  6. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java
  7. 20
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml
  8. 21
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

136
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MoveOutMemberFormDTO.java

@ -0,0 +1,136 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class MoveOutMemberFormDTO implements Serializable {
private static final long serialVersionUID = 7059338517023959372L;
/**
* 客户id
*/
private String customerId;
/**
* 居民信息ID
*/
private String icResiUserId;
/**
* 居民所在网格ID
*/
private String gridId;
/**
* 迁出到网格名 迁出类型为in时必填
*/
private String gridName;
/**
* 迁出到小区名 迁出类型为in时必填
*/
private String villageName;
/**
* 迁出到楼栋名 迁出类型为in时必填
*/
private String buildName;
/**
* 迁出到单元名 迁出类型为in时必填
*/
private String unitName;
/**
* 迁出到房屋名 迁出类型为in时必填
*/
private String homeName;
/**
* 外迁详细地址 迁出类型为out时必填
*/
private String xxdz;
/**
* 迁出类型 迁出客户外out 迁出客户内in
*/
private String submitType;
/**
* 迁出原因
*/
private String deleteReason;
/**
* 组织id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 房屋ID
*/
private String houseId;
/**
* 名字
*/
private String allName;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 现居住地
*/
private String xjzd;
/**
* 民族
*/
private String mz;
/**
* 与户主关系
*/
private String yhzgx;
}

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

@ -11,6 +11,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.dto.form.MoveOutMemberFormDTO;
import com.epmet.dto.form.RegisterAndBindFormDTO;
import com.epmet.dto.result.HomeInfoResultDTO;
import com.epmet.dto.result.HomeUserBriefResultDTO;
@ -80,15 +81,16 @@ public class MyHomeController {
// return icResiUserConfirmService.editMember(dto);
// }
//
/**
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:10
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:10
* @params [dto]
*/
@PostMapping("delMember")
public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setSubmitType(HomeMemberOperationEnum.DELETE.getCode());
@ -96,44 +98,43 @@ public class MyHomeController {
}
/**
* @return com.epmet.commons.tools.utils.Result
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:50
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("addMember")
public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserService.addMember(dto);
}
/**
* @return com.epmet.commons.tools.utils.Result
* @describe: 修改家庭成员
* @author wangtong
* @date 2022/6/1 15:27
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("editMember")
public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserService.editMember(dto);
}
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:14
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:14
* @params [dto]
*/
@PostMapping("getMemberDetail")
public Result<IcResiUserConfirmDTO> getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto){
public Result<IcResiUserConfirmDTO> getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserConfirmService.getMemberDetail(dto);
@ -161,4 +162,21 @@ public class MyHomeController {
HomeInfoResultDTO result = myHomeService.getHomeInfo(tokenDto);
return new Result<HomeInfoResultDTO>().ok(result);
}
/**
* 我的家庭迁出家庭成员
*
* @param form
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result
* @author LZN
* @date 2022/6/10 11:06
*/
@PostMapping("/moveOutMember")
public Result moveOutMember(@RequestBody MoveOutMemberFormDTO form, @LoginUser TokenDto tokenDto) {
form.setCustomerId(tokenDto.getCustomerId());
icResiUserConfirmService.moveOutMember(form);
return new Result();
}
}

38
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java

@ -15,11 +15,37 @@ import org.apache.ibatis.annotations.Param;
public interface IcResiUserConfirmDao extends BaseDao<IcResiUserConfirmEntity> {
/**
* @describe: 根据icResiUserId查询
* @author wangtong
* @date 2022/6/1 16:01
* @params [icResiUserId]
* @return com.epmet.entity.IcResiUserConfirmEntity
*/
* @return com.epmet.entity.IcResiUserConfirmEntity
* @describe: 根据icResiUserId查询
* @author wangtong
* @date 2022/6/1 16:01
* @params [icResiUserId]
*/
IcResiUserConfirmEntity selectByIcResiUserId(@Param("icResiUserId") String icResiUserId);
/**
* 我的家庭迁出家庭成员 根据身份证号查询是否已提交
*
* @param idCard
* @param customerId
* @param submitType
* @return int
* @author LZN
* @date 2022/6/10 11:04
*/
int selectByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId,
@Param("submitType") String submitType);
/**
* 我的家庭迁出家庭成员 先删后添
*
* @param idCard
* @param customerId
* @param submitType
* @return void
* @author LZN
* @date 2022/6/10 11:04
*/
void deleteByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId,
@Param("submitType") String submitType);
}

43
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -23,6 +23,7 @@ import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.EpidemicPreventionFormDTO;
import com.epmet.dto.form.MoveOutMemberFormDTO;
import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.*;
@ -66,7 +67,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("staffOrgPath") String staffOrgPath,
@Param("resultTableName") String resultTableName,
@Param("keyword") String keyword,
@Param("groupByTables")Set<String> groupByTables);
@Param("groupByTables") Set<String> groupByTables);
/**
* 查询主表
@ -132,10 +133,10 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<SearchByNameResultDTO> searchByName(@Param("name") String name,
@Param("columnName") String columnName,
@Param("level")String level,
@Param("id")String id,
@Param("level") String level,
@Param("id") String id,
@Param("agencyId") String agencyId,
@Param("pageNo") Integer pageNo,@Param("customerId") String customerId);
@Param("pageNo") Integer pageNo, @Param("customerId") String customerId);
Set<String> selectUserDemandCode(String icResiUserId);
@ -163,11 +164,12 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
/**
* desc:根据身份证号获取居民信息
*
* @param idCard
* @param customerId
* @return
*/
IcResiUserDTO getResiUserByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
IcResiUserDTO getResiUserByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId);
/**
* @param agencyId
@ -274,7 +276,8 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
Map<String, BigDecimal> getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName,
@Param("columnList") List<String> columnList, @Param("id") String id, @Param("level") String level);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns")List<String> columns);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns") List<String> columns);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
@ -305,6 +308,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
/**
* desc:根据维度获取居民信息表的数据[正常状态的居民]
*
* @param formDTO
* @return
*/
@ -319,10 +323,11 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<String> listUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId);
List<String> getAllUserIds(@Param("idCard") String idCard, @Param("customerId")String customerId);
List<String> getAllUserIds(@Param("idCard") String idCard, @Param("customerId") String customerId);
/**
* 获取客户下志愿者信息
*
* @Param customerId
* @Return {@link List< IcVolunteerPolyDTO>}
* @Author zhaoqifeng
@ -331,11 +336,23 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<IcVolunteerPolyDTO> getVolunteerList(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:16
* @params [icResiUserId]
* @return com.epmet.dto.IcResiUserConfirmDTO
*/
* @return com.epmet.dto.IcResiUserConfirmDTO
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:16
* @params [icResiUserId]
*/
IcResiUserConfirmDTO selectMemberDetail(@Param("icResiUserId") String icResiUserId);
/**
* 我的家庭迁出家庭成员 查询缺失字段
*
* @param icResiUserId
* @param customerId
* @return com.epmet.dto.form.MoveOutMemberFormDTO
* @author LZN
* @date 2022/6/10 11:03
*/
MoveOutMemberFormDTO moveOutMember(@Param("icResiUserId") String icResiUserId,
@Param("customerId") String customerId);
}

59
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.dto.form.MoveOutMemberFormDTO;
import com.epmet.entity.IcResiUserConfirmEntity;
import java.util.List;
@ -80,39 +81,39 @@ public interface IcResiUserConfirmService extends BaseService<IcResiUserConfirmE
void delete(String[] ids);
/**
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:30
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:30
* @params [dto]
*/
Result editMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:50
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:50
* @params [dto]
*/
Result addMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:11
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:11
* @params [dto]
*/
Result delMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:15
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:15
* @params [dto]
*/
Result<IcResiUserConfirmDTO> getMemberDetail(IcResiUserConfirmGetDTO dto);
/**
@ -124,4 +125,14 @@ public interface IcResiUserConfirmService extends BaseService<IcResiUserConfirmE
* @Date 2022/6/1 17:27
*/
void confirm(IcResiUserConfirmDTO dto);
/**
* 我的家庭迁出家庭成员
*
* @param form
* @return void
* @author LZN
* @date 2022/6/10 11:06
*/
void moveOutMember(MoveOutMemberFormDTO form);
}

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

@ -13,6 +13,7 @@ import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.dto.form.MoveOutMemberFormDTO;
import com.epmet.entity.IcResiUserConfirmEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.redis.IcResiUserConfirmRedis;
@ -41,6 +42,9 @@ public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConf
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcResiUserConfirmDao icResiUserConfirmDao;
@Override
public PageData<IcResiUserConfirmDTO> page(Map<String, Object> params) {
IPage<IcResiUserConfirmEntity> page = baseDao.selectPage(
@ -175,4 +179,24 @@ public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConf
}
}
/**
* 我的家庭迁出家庭成员
*
* @param form
* @return void
* @author LZN
* @date 2022/6/10 11:03
*/
@Override
public void moveOutMember(MoveOutMemberFormDTO form) {
form = icResiUserDao.moveOutMember(form.getIcResiUserId(), form.getCustomerId());
form.setSurname(form.getAllName().substring(0, 1));
form.setName(form.getAllName().substring(1));
if (icResiUserConfirmDao.selectByIdCard(form.getIdCard(), form.getCustomerId(), form.getSubmitType()) > 0) {
icResiUserConfirmDao.deleteByIdCard(form.getIdCard(), form.getCustomerId(), form.getSubmitType());
}
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(form, IcResiUserConfirmEntity.class);
icResiUserConfirmDao.insert(entity);
}
}

20
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml

@ -34,11 +34,31 @@
<result property="deleteReason" column="DELETE_REASON"/>
<result property="operationDescribe" column="OPERATION_DESCRIBE"/>
</resultMap>
<delete id="deleteByIdCard">
delete from ic_resi_user_confirm
where
id_card = #{idCard}
AND customer_id = #{customerId}
AND CONFIRM_RESULT = '0'
AND SUBMIT_TYPE = #{submitType}
</delete>
<select id="selectByIcResiUserId" resultType="com.epmet.entity.IcResiUserConfirmEntity">
select * from ic_resi_user_confirm
where IC_RESI_USER_ID=#{icResiUserId}
and del_flag='0'
</select>
<select id="selectByIdCard" resultType="java.lang.Integer">
SELECT
count(*)
FROM
ic_resi_user_confirm
WHERE
ID_CARD = #{idCard}
AND CUSTOMER_ID = #{customerId}
AND del_flag = '0'
AND CONFIRM_RESULT = '0'
AND SUBMIT_TYPE = #{submitType}
</select>
</mapper>

21
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1075,5 +1075,26 @@
where DEL_FLAG='0'
and id=#{icResiUserId}
</select>
<select id="moveOutMember" resultType="com.epmet.dto.form.MoveOutMemberFormDTO">
SELECT
AGENCY_ID,
PIDS,
HOME_ID,
NAME as allName,
MOBILE,
GENDER,
ID_CARD,
BIRTHDAY,
HJSZD,
XJZD,
mz,
YHZGX
FROM
ic_resi_user
WHERE
id = #{icResiUserId}
AND customer_id = #{customerId}
AND DEL_FLAG = '0'
</select>
</mapper>

Loading…
Cancel
Save