forked from rongchao/epmet-cloud-rizhao
65 changed files with 1473 additions and 110 deletions
@ -0,0 +1,39 @@ |
|||
package com.epmet.resi.mine.dto.from; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 党员认证页面初始化参数 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 11:17 |
|||
*/ |
|||
@Data |
|||
public class PartyMemberInitFromDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
@NotBlank(message = "客户id不能为空") |
|||
private String customerId; |
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
@NotBlank(message = "网格id不能为空") |
|||
private String gridId; |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
/** |
|||
* 访问来源 |
|||
*/ |
|||
@NotBlank(message = "访问来源") |
|||
private String visitFrom; |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.resi.mine.dto.from; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 16:45 |
|||
*/ |
|||
@Data |
|||
public class VerificationCodeFromDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空") |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 行为记录表ID |
|||
*/ |
|||
@NotBlank(message = "行为记录表ID不能为空") |
|||
private String visitId; |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.epmet.resi.mine.dto.result; |
|||
|
|||
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 党员认证页面初始化返回结果 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 11:05 |
|||
*/ |
|||
@Data |
|||
public class PartyMemberInitResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 提交状态 0:未提交,1:已提交 |
|||
*/ |
|||
private String submitStatus; |
|||
|
|||
/** |
|||
* 党员认证行为记录表ID |
|||
*/ |
|||
private String visitId; |
|||
/** |
|||
* 党员认证信息 |
|||
*/ |
|||
private PartymemberInfoDTO partyMemberInfo; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.modules.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.fallback.PartyMemberConfirmFeignClientFallBack; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 16:03 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = PartyMemberConfirmFeignClientFallBack.class) |
|||
public interface PartyMemberConfirmFeignClient { |
|||
@PostMapping("/resi/partymember/confirm/init") |
|||
Result<PartyMemberInitResultDTO> init(@RequestBody PartyMemberInitFromDTO fromDto); |
|||
|
|||
@PostMapping("/resi/partymember/confirm/getverificationcode") |
|||
Result getVerificationCode(@RequestBody VerificationCodeFromDTO fromDto); |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.modules.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.fallback.ResiPartymemberFeignClientFallBack; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
|
|||
/** |
|||
* @Description 居民端陌生人导览 调用epmet-user服务 |
|||
* @Author sun |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class) |
|||
public interface ResiPartymemberFeignClient { |
|||
|
|||
/** |
|||
* @return com.epmet.dto.result.ResiWarmheartedResultDTO |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
**/ |
|||
@PostMapping(value = "resi/partymember/resiwarmheartedapply/init") |
|||
Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO); |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.modules.feign.fallback; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.ModuleUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.PartyMemberConfirmFeignClient; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 16:04 |
|||
*/ |
|||
@Component |
|||
public class PartyMemberConfirmFeignClientFallBack implements PartyMemberConfirmFeignClient { |
|||
@Override |
|||
public Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "init", fromDto); |
|||
} |
|||
|
|||
@Override |
|||
public Result getVerificationCode(VerificationCodeFromDTO fromDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getVerificationCode", fromDto); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.modules.feign.fallback; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.ModuleUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.ResiPartymemberFeignClient; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Description 居民端-陌生人导览 调用epmet-user服务 |
|||
* @Author sun |
|||
* @Date 2020/3/16 |
|||
*/ |
|||
@Component |
|||
public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient { |
|||
|
|||
/** |
|||
* @return com.epmet.dto.result.ResiWarmheartedResultDTO |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
* @Date 2020/3/30 |
|||
**/ |
|||
@Override |
|||
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "init", formDTO); |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.epmet.modules.partymember.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.partymember.service.PartyMemberService; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
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 zhaoqifeng |
|||
* @date 2020/3/30 16:11 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("partymemberbaseinfo") |
|||
public class PartyMemberController { |
|||
|
|||
@Autowired |
|||
private PartyMemberService partyMemberService; |
|||
|
|||
/** |
|||
* 党员认证页面初始化 |
|||
* |
|||
* @param fromDto param |
|||
* @return Result<PartyMemberInitResultDto> |
|||
*/ |
|||
@PostMapping("init") |
|||
public Result<PartyMemberInitResultDTO> init(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberInitFromDTO fromDto) { |
|||
fromDto.setUserId(tokenDto.getUserId()); |
|||
return partyMemberService.init(fromDto); |
|||
} |
|||
|
|||
/** |
|||
* 党员认证页获取手机验证码 |
|||
* |
|||
* @param fromDto 参数 |
|||
* @return Result<PartyMemberInitResultDto> |
|||
* @date 2020/3/30 13:50 |
|||
*/ |
|||
@PostMapping("getverificationcode") |
|||
public Result getVerificationCode(@LoginUser TokenDto tokenDto, @RequestBody VerificationCodeFromDTO fromDto) { |
|||
return partyMemberService.getVerificationCode(tokenDto, fromDto); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.epmet.modules.partymember.service; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
|
|||
/** |
|||
* 党员认证 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 11:00 |
|||
*/ |
|||
public interface PartyMemberService { |
|||
/** |
|||
* 党员认证页面初始化 |
|||
* |
|||
* @param fromDto param |
|||
* @return Result<PartyMemberInitResultDto> |
|||
*/ |
|||
Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto); |
|||
|
|||
/** |
|||
* 获取手机验证码 |
|||
* |
|||
* @param tokenDto token |
|||
* @param fromDTO 参数 |
|||
* @return Result |
|||
*/ |
|||
Result getVerificationCode(TokenDto tokenDto, VerificationCodeFromDTO fromDTO); |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.modules.partymember.service.impl; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.PartyMemberConfirmFeignClient; |
|||
import com.epmet.modules.partymember.service.PartyMemberService; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 党员认证页面初始化 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 11:01 |
|||
*/ |
|||
@Service |
|||
public class PartyMemberServiceImpl implements PartyMemberService { |
|||
|
|||
@Autowired |
|||
PartyMemberConfirmFeignClient partyMemberConfirmFeignClient; |
|||
|
|||
@Override |
|||
public Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto) { |
|||
return partyMemberConfirmFeignClient.init(fromDto); |
|||
} |
|||
|
|||
@Override |
|||
public Result getVerificationCode(TokenDto tokenDto, VerificationCodeFromDTO fromDTO) { |
|||
fromDTO.setUserId(tokenDto.getUserId()); |
|||
return partyMemberConfirmFeignClient.getVerificationCode(fromDTO); |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.epmet.modules.warmhearted.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.warmhearted.service.ResiWarmheartedService; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
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; |
|||
|
|||
/** |
|||
* @Description 居民端热心居民申请接口入口 |
|||
* @Author sun |
|||
* @since v1.0.0 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("warmhearted") |
|||
public class ResiWarmheartedController { |
|||
@Autowired |
|||
private ResiWarmheartedService resiWarmheartedService; |
|||
|
|||
/** |
|||
* @param |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
**/ |
|||
@PostMapping("init") |
|||
public Result<ResiWarmheartedResultDTO> init(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { |
|||
return resiWarmheartedService.init(tokenDTO, resiWarmheartedFormDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请-提交申请数据 |
|||
**/ |
|||
@PostMapping("submit") |
|||
public Result<ResiWarmheartedResultDTO> submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { |
|||
return resiWarmheartedService.init(tokenDTO, resiWarmheartedFormDTO); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.modules.warmhearted.service; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
|
|||
/** |
|||
* @Description 居民端居民注册信息service |
|||
* @Author sun |
|||
*/ |
|||
public interface ResiWarmheartedService { |
|||
|
|||
|
|||
/** |
|||
* 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
* |
|||
* @param |
|||
* @return void |
|||
* @author sun |
|||
*/ |
|||
Result<ResiWarmheartedResultDTO> init(TokenDto tokenDTO, ResiWarmheartedFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.modules.warmhearted.service.impl; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.ResiPartymemberFeignClient; |
|||
import com.epmet.modules.utils.ModuleConstant; |
|||
import com.epmet.modules.warmhearted.service.ResiWarmheartedService; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Description 居民端居民注册信息service |
|||
* @Author sun |
|||
* @Date 2020/3/30 |
|||
*/ |
|||
@Service |
|||
public class ResiWarmheartedServiceImpl implements ResiWarmheartedService { |
|||
|
|||
@Autowired |
|||
private ResiPartymemberFeignClient resiPartymemberFeignClient; |
|||
|
|||
@Override |
|||
public Result<ResiWarmheartedResultDTO> init(TokenDto tokenDTO, ResiWarmheartedFormDTO formDTO) { |
|||
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) { |
|||
return new Result<ResiWarmheartedResultDTO>().error(ModuleConstant.USER_NOT_NULL); |
|||
} |
|||
formDTO.setUserId(tokenDTO.getUserId()); |
|||
return resiPartymemberFeignClient.init(formDTO); |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.resi.partymember.dto.warmhearted.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 居民端-居民注册页面初始化-居民访问记录表新增数据-配置入参 |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class ResiWarmheartedFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id CUSTOMER.id |
|||
*/ |
|||
@NotBlank(message = "客户ID不能为空") |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
@NotBlank(message = "网格ID不能为空") |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 访问来源 指的是用户点的那个功能进入到的注册页面,就是一个功能模块的Id(value:feature+action) |
|||
*/ |
|||
@NotBlank(message = "访问来源不能为空") |
|||
private String visitFrom; |
|||
|
|||
/** |
|||
* 用户Id |
|||
*/ |
|||
@NotBlank(message = "用户ID不能为空") |
|||
private String userId; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.resi.partymember.dto.warmhearted.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据-配置入参 |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class ResiWarmheartedResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 是否已申请热心居民 0:否, 1:是 |
|||
*/ |
|||
private String isApplied; |
|||
|
|||
/** |
|||
* 热心居民申请访问记录表(resi_warmhearted_visit)Id |
|||
*/ |
|||
private String resiWarmheartedVisitId; |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 15:24 |
|||
*/ |
|||
public interface PartyMemberConstant { |
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
String OPERATE_INITIALIZE = "initialize"; |
|||
|
|||
/** |
|||
* 获取验证码 |
|||
*/ |
|||
String OPERATE_OPERATE_SMS_CODE = "sms_code"; |
|||
|
|||
/** |
|||
* 自动认证成功 |
|||
*/ |
|||
String OPERATE_AUTO_SUCCESS = "auto_success"; |
|||
|
|||
/** |
|||
* 自动认证失败 |
|||
*/ |
|||
String OPERATE_AUTO_FAILED = "auto_failed"; |
|||
|
|||
/** |
|||
* 信息补充 |
|||
*/ |
|||
String OPERATE_EXTRA = "auto_extra"; |
|||
|
|||
/** |
|||
* 未提交 |
|||
*/ |
|||
String NOT_SUBMITTED = "0"; |
|||
|
|||
/** |
|||
* 已提交 |
|||
*/ |
|||
String SUBMITTED = "1"; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.modules.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.UserResiInfoDTO; |
|||
import com.epmet.dto.form.UserResiInfoFormDTO; |
|||
import com.epmet.modules.feign.fallback.UserResiInfoFeignClientFallBack; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 14:51 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = UserResiInfoFeignClientFallBack.class) |
|||
public interface UserResiInfoFeignClient { |
|||
|
|||
/** |
|||
* 查询用户注册信息 |
|||
* @param userResiInfoFormDTO 参数 |
|||
* @return Result<UserResiInfoDTO> |
|||
*/ |
|||
@PostMapping("/epmetuser/userresiinfo/getUserResiInfoDTO") |
|||
Result<UserResiInfoDTO> getUserResiInfoDTO(@RequestBody UserResiInfoFormDTO userResiInfoFormDTO); |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.modules.feign.fallback; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.ModuleUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.UserResiInfoDTO; |
|||
import com.epmet.dto.form.UserResiInfoFormDTO; |
|||
import com.epmet.modules.feign.UserResiInfoFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/30 14:53 |
|||
*/ |
|||
@Component |
|||
public class UserResiInfoFeignClientFallBack implements UserResiInfoFeignClient { |
|||
@Override |
|||
public Result<UserResiInfoDTO> getUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserResiInfoDTO", userResiInfoFormDTO); |
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.epmet.modules.partymember.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.partymember.service.PartyMemberConfirmService; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
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 zhaoqifeng |
|||
* @date 2020/3/30 13:49 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("confirm") |
|||
public class PartyMemberConfirmController { |
|||
|
|||
@Autowired |
|||
private PartyMemberConfirmService partyMemberConfirmService; |
|||
|
|||
/** |
|||
* 党员认证页面初始化 |
|||
* |
|||
* @param fromDto 参数 |
|||
* @return Result<PartyMemberInitResultDto> |
|||
* @date 2020/3/30 13:50 |
|||
*/ |
|||
@PostMapping("init") |
|||
public Result<PartyMemberInitResultDTO> init(@RequestBody PartyMemberInitFromDTO fromDto) { |
|||
return partyMemberConfirmService.init(fromDto); |
|||
} |
|||
|
|||
/** |
|||
* 党员认证页获取手机验证码 |
|||
* |
|||
* @param fromDto 参数 |
|||
* @return Result<PartyMemberInitResultDto> |
|||
* @date 2020/3/30 13:50 |
|||
*/ |
|||
@PostMapping("getverificationcode") |
|||
public Result getVerificationCode(@RequestBody VerificationCodeFromDTO fromDto) { |
|||
return partyMemberConfirmService.getVerificationCode(fromDto); |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.modules.partymember.service; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
|
|||
/** |
|||
* |
|||
* 党员认证 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 13:58 |
|||
*/ |
|||
public interface PartyMemberConfirmService { |
|||
|
|||
/** |
|||
* |
|||
* 党员认证页面初始化 |
|||
* |
|||
* @param fromDto 参数 |
|||
* @return Result<PartyMemberInitResultDto> |
|||
*/ |
|||
Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto); |
|||
|
|||
/** |
|||
* 获取手机验证码 |
|||
* @param fromDTO 参数 |
|||
* @return Result |
|||
*/ |
|||
Result getVerificationCode( VerificationCodeFromDTO fromDTO); |
|||
|
|||
} |
@ -0,0 +1,112 @@ |
|||
package com.epmet.modules.partymember.service.impl; |
|||
|
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.constant.PartyMemberConstant; |
|||
import com.epmet.dto.UserResiInfoDTO; |
|||
import com.epmet.dto.form.UserResiInfoFormDTO; |
|||
import com.epmet.modules.feign.UserResiInfoFeignClient; |
|||
import com.epmet.modules.partymember.entity.PartymemberInfoEntity; |
|||
import com.epmet.modules.partymember.entity.PartymemberVisitEntity; |
|||
import com.epmet.modules.partymember.redis.PartymemberInfoRedis; |
|||
import com.epmet.modules.partymember.service.PartyMemberConfirmService; |
|||
import com.epmet.modules.partymember.service.PartymemberInfoService; |
|||
import com.epmet.modules.partymember.service.PartymemberVisitService; |
|||
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; |
|||
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; |
|||
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; |
|||
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员认证 |
|||
* |
|||
* @author zhaoqifeng |
|||
* @date 2020/3/30 14:01 |
|||
*/ |
|||
@Service |
|||
public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService { |
|||
|
|||
@Autowired |
|||
private UserResiInfoFeignClient userResiInfoFeignClient; |
|||
@Autowired |
|||
private PartymemberInfoService partymemberInfoService; |
|||
@Autowired |
|||
private PartymemberVisitService partymemberVisitService; |
|||
@Autowired |
|||
private PartymemberInfoRedis partyMemberInfoRedis; |
|||
|
|||
@Override |
|||
public Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto) { |
|||
|
|||
PartyMemberInitResultDTO result = new PartyMemberInitResultDTO(); |
|||
// 获取党员认证信息,判断是否提交认证
|
|||
PartymemberInfoDTO partyMemberInfoParam = new PartymemberInfoDTO(); |
|||
partyMemberInfoParam.setCustomerId(fromDto.getCustomerId()); |
|||
partyMemberInfoParam.setGridId(fromDto.getGridId()); |
|||
partyMemberInfoParam.setUserId(fromDto.getUserId()); |
|||
PartymemberInfoDTO partyMemberInfoResult = partymemberInfoService.getPartyMemberInfo(partyMemberInfoParam); |
|||
// 若已提交,获取提交的党员信息
|
|||
if (null != partyMemberInfoResult) { |
|||
result.setSubmitStatus(PartyMemberConstant.SUBMITTED); |
|||
result.setPartyMemberInfo(partyMemberInfoResult); |
|||
return new Result<PartyMemberInitResultDTO>().ok(result); |
|||
} else { |
|||
// 若没有提交,获取注册居民信息,判断是否已注册居民
|
|||
result.setSubmitStatus(PartyMemberConstant.NOT_SUBMITTED); |
|||
|
|||
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); |
|||
userResiInfoFormDTO.setCustomerId(fromDto.getCustomerId()); |
|||
userResiInfoFormDTO.setUserId(fromDto.getUserId()); |
|||
Result<UserResiInfoDTO> userResiInfoResult = userResiInfoFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); |
|||
result.setPartyMemberInfo(ConvertUtils.sourceToTarget(userResiInfoResult.getData(), PartymemberInfoDTO.class)); |
|||
} |
|||
|
|||
// 将访问行为存入热心居民申请行为记录表
|
|||
PartymemberVisitEntity partymemberVisitEntity = new PartymemberVisitEntity(); |
|||
partymemberVisitEntity.setCustomerId(fromDto.getCustomerId()); |
|||
partymemberVisitEntity.setGridId(fromDto.getGridId()); |
|||
partymemberVisitEntity.setUserId(fromDto.getUserId()); |
|||
partymemberVisitEntity.setOperateVisit(PartyMemberConstant.OPERATE_INITIALIZE); |
|||
partymemberVisitEntity.setVisitFrom(fromDto.getVisitFrom()); |
|||
partymemberVisitEntity.setVisitTime(new Date()); |
|||
partymemberVisitService.insert(partymemberVisitEntity); |
|||
|
|||
result.setVisitId(partymemberVisitEntity.getId()); |
|||
|
|||
return new Result<PartyMemberInitResultDTO>().ok(result); |
|||
} |
|||
|
|||
@Override |
|||
public Result getVerificationCode(VerificationCodeFromDTO fromDTO) { |
|||
Result result = new Result(); |
|||
//手机是否可用
|
|||
PartymemberInfoEntity partyMemberInfoParam= new PartymemberInfoEntity(); |
|||
partyMemberInfoParam.setMobile(fromDTO.getMobile()); |
|||
PartymemberInfoDTO partyMemberInfoResult = partymemberInfoService.getPartyMemberInfoByMobile(partyMemberInfoParam); |
|||
if (null != partyMemberInfoResult) { |
|||
//TODO
|
|||
result.setCode(0); |
|||
result.setMsg(""); |
|||
return result; |
|||
} |
|||
|
|||
//TODO 生成短信验证码
|
|||
String code = "0000"; |
|||
|
|||
//将验证码存入Redis
|
|||
partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), code); |
|||
|
|||
//将访问记录更新到热心居民申请行为记录表
|
|||
PartymemberVisitEntity partymemberVisitEntity = new PartymemberVisitEntity(); |
|||
partymemberVisitEntity.setId(fromDTO.getVisitId()); |
|||
partymemberVisitEntity.setVisitTime(new Date()); |
|||
partymemberVisitEntity.setOperateVisit(PartyMemberConstant.OPERATE_OPERATE_SMS_CODE); |
|||
partymemberVisitService.updateById(partymemberVisitEntity); |
|||
|
|||
return result; |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.epmet.modules.warmhearted.constant; |
|||
|
|||
/** |
|||
* 常量 |
|||
* @author sun |
|||
* @since 1.0.0 |
|||
*/ |
|||
public interface ResiWarmheartedVisitConstant { |
|||
|
|||
/** |
|||
* 最后一次操作行为-初始化 |
|||
*/ |
|||
String INITIALIZE = "initialize"; |
|||
|
|||
/** |
|||
* 最后一次操作行为-提交成功 |
|||
*/ |
|||
String SUCCESS = "success"; |
|||
|
|||
/** |
|||
* 最后一次操作行为-提交失败 |
|||
*/ |
|||
String FAILD="faild"; |
|||
} |
Loading…
Reference in new issue