forked from rongchao/epmet-cloud-rizhao
12 changed files with 472 additions and 1 deletions
@ -0,0 +1,104 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 收集居民信息入参 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCollectFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
public interface InternalShowGroup extends CustomerClientShowGroup { |
||||
|
} |
||||
|
|
||||
|
public interface ExternalShowGroup extends CustomerClientShowGroup { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 客户Id customer.id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 内部:internal;外部:external |
||||
|
*/ |
||||
|
@NotBlank(message = "兴德路社区:internal;其他社区:external", groups = AddUserInternalGroup.class) |
||||
|
private String origin; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID_后端接口赋值 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id_后端接口赋值 |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织的pid_后端接口赋值 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所属小区ID |
||||
|
*/ |
||||
|
@NotBlank(message = "小区不能为空", groups = InternalShowGroup.class) |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼宇Id |
||||
|
*/ |
||||
|
@NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class) |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 单元id |
||||
|
*/ |
||||
|
@NotBlank(message = "单元不能为空", groups = InternalShowGroup.class) |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 所属家庭Id |
||||
|
*/ |
||||
|
@NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class) |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 详细地址 |
||||
|
*/ |
||||
|
@NotBlank(message = "家庭地址不能为空", groups = {InternalShowGroup.class, ExternalShowGroup.class}) |
||||
|
private String address; |
||||
|
|
||||
|
/** |
||||
|
* 1自由0租住 |
||||
|
*/ |
||||
|
@NotNull(message = "房子属于自由还是组织?", groups = {InternalShowGroup.class, ExternalShowGroup.class}) |
||||
|
private Integer houserType; |
||||
|
|
||||
|
/** |
||||
|
* 户主姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "户主姓名不能为空", groups = {InternalShowGroup.class, ExternalShowGroup.class}) |
||||
|
private String houserHolerName; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员人数 |
||||
|
*/ |
||||
|
@NotNull(message = "居住成员人数不能为空", groups = {InternalShowGroup.class, ExternalShowGroup.class}) |
||||
|
private Integer totalResi; |
||||
|
|
||||
|
@Valid |
||||
|
@NotEmpty(message = "成员信息不能为空", groups = {InternalShowGroup.class, ExternalShowGroup.class}) |
||||
|
private List<IcResiCollectMemFormDTO> memberList; |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class IcResiCollectMemFormDTO implements Serializable { |
||||
|
/** |
||||
|
* 居住成员1姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1身份证号 |
||||
|
*/ |
||||
|
private String idNum; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1是否参加几轮全员核算检测,数字1-10 |
||||
|
*/ |
||||
|
private Integer hesuanCount; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; |
||||
|
*/ |
||||
|
private Integer ymjz; |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.form.IcResiCollectFormDTO; |
||||
|
import com.epmet.service.IcResiCollectService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icresicollect") |
||||
|
public class IcResiCollectController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCollectService icResiCollectService; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集_提交 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return |
||||
|
*/ |
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcResiCollectFormDTO formDTO) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.AddUserInternalGroup.class); |
||||
|
// 内部:internal;外部:external
|
||||
|
if ("internal".equals(formDTO.getOrigin())) { |
||||
|
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.InternalShowGroup.class); |
||||
|
} else if ("external".equals(formDTO.getOrigin())) { |
||||
|
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.ExternalShowGroup.class); |
||||
|
} |
||||
|
icResiCollectService.save(formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiCollectEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiCollectDao extends BaseDao<IcResiCollectEntity> { |
||||
|
|
||||
|
IcResiCollectEntity selectByAddress(String address); |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiMemberEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息成员表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiMemberDao extends BaseDao<IcResiMemberEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_collect") |
||||
|
public class IcResiCollectEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id customer.id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 内部:internal;外部:external |
||||
|
*/ |
||||
|
private String origin; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织的pids |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所属小区ID |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼宇Id |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 单元id |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 所属家庭Id |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 详细地址 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
/** |
||||
|
* 1自由0租住 |
||||
|
*/ |
||||
|
private Integer houserType; |
||||
|
|
||||
|
/** |
||||
|
* 户主姓名 |
||||
|
*/ |
||||
|
private String houserHolerName; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员人数 |
||||
|
*/ |
||||
|
private Integer totalResi; |
||||
|
|
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息成员表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_member") |
||||
|
public class IcResiMemberEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id customer.id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* ic_resi_colllect.id |
||||
|
*/ |
||||
|
private String icResiCollectId; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1身份证号 |
||||
|
*/ |
||||
|
private String idNum; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1是否参加几轮全员核算检测,数字1-10 |
||||
|
*/ |
||||
|
private Integer hesuanCount; |
||||
|
|
||||
|
/** |
||||
|
* 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; |
||||
|
*/ |
||||
|
private Integer ymjz; |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dto.form.IcResiCollectFormDTO; |
||||
|
import com.epmet.entity.IcResiCollectEntity; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
public interface IcResiCollectService extends BaseService<IcResiCollectEntity> { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-03-18 |
||||
|
*/ |
||||
|
void save(IcResiCollectFormDTO dto); |
||||
|
|
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dao.IcResiCollectDao; |
||||
|
import com.epmet.dto.IcNeighborHoodDTO; |
||||
|
import com.epmet.dto.form.IcResiCollectFormDTO; |
||||
|
import com.epmet.entity.IcResiCollectEntity; |
||||
|
import com.epmet.entity.IcResiMemberEntity; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.service.IcResiCollectService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息采集表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-03-18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, IcResiCollectEntity> implements IcResiCollectService { |
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcResiCollectFormDTO formDTO) { |
||||
|
IcResiCollectEntity origin=baseDao.selectByAddress(formDTO.getAddress()); |
||||
|
if(null==origin){ |
||||
|
//插入主表、成员表
|
||||
|
IcResiCollectEntity insert=ConvertUtils.sourceToTarget(formDTO,IcResiCollectEntity.class); |
||||
|
if("internal".equals(formDTO.getOrigin())){ |
||||
|
//查询楼栋个信息
|
||||
|
// IcNeighborHoodDTO neighborHoodDTO=query
|
||||
|
Result<IcNeighborHoodDTO> res= govOrgOpenFeignClient.getIcNeighbordhoodById(formDTO.getVillageId()); |
||||
|
if(!res.success()||null==res.getData()){ |
||||
|
// todo
|
||||
|
} |
||||
|
} |
||||
|
List<IcResiMemberEntity> memberList=ConvertUtils.sourceToTarget(formDTO.getMemberList(),IcResiMemberEntity.class); |
||||
|
|
||||
|
}else{ |
||||
|
//查询成员表
|
||||
|
|
||||
|
} |
||||
|
IcResiCollectEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcResiCollectDao"> |
||||
|
|
||||
|
<select id="selectByAddress" parameterType="java.lang.String"> |
||||
|
select c.id from ic_resi_collect c |
||||
|
where and c.address=#{address} |
||||
|
and c.DEL_FLAG='0' |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcResiMemberDao"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue