## 户籍变更不需要处理手续费(181);
This commit is contained in:
parent
dd0be2e72a
commit
ce3b963322
|
@ -1,6 +1,5 @@
|
||||||
package com.hzs.member.self.controller.api;
|
package com.hzs.member.self.controller.api;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import com.hzs.common.core.annotation.RepeatSubmitSimple;
|
import com.hzs.common.core.annotation.RepeatSubmitSimple;
|
||||||
import com.hzs.common.core.constant.MagicNumberConstants;
|
import com.hzs.common.core.constant.MagicNumberConstants;
|
||||||
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
||||||
|
@ -14,11 +13,7 @@ import com.hzs.common.domain.member.ext.CuMemberExt;
|
||||||
import com.hzs.common.domain.member.self.CuSelfServiceLog;
|
import com.hzs.common.domain.member.self.CuSelfServiceLog;
|
||||||
import com.hzs.common.security.utils.SecurityUtils;
|
import com.hzs.common.security.utils.SecurityUtils;
|
||||||
import com.hzs.common.util.TransactionUtils;
|
import com.hzs.common.util.TransactionUtils;
|
||||||
import com.hzs.member.account.dto.BusinessCommissionDTO;
|
|
||||||
import com.hzs.member.account.dto.MemberAmountDTO;
|
|
||||||
import com.hzs.member.account.dto.MemberBalanceDTO;
|
|
||||||
import com.hzs.member.account.service.ICuMemberAuthenticationService;
|
import com.hzs.member.account.service.ICuMemberAuthenticationService;
|
||||||
import com.hzs.member.account.service.ICuMemberTradeService;
|
|
||||||
import com.hzs.member.account.vo.CuMemberAuthenticationVO;
|
import com.hzs.member.account.vo.CuMemberAuthenticationVO;
|
||||||
import com.hzs.member.base.service.ICuMemberService;
|
import com.hzs.member.base.service.ICuMemberService;
|
||||||
import com.hzs.member.self.service.ICuSelfServiceLogService;
|
import com.hzs.member.self.service.ICuSelfServiceLogService;
|
||||||
|
@ -26,30 +21,16 @@ import com.hzs.member.self.vo.DomicileChangeVO;
|
||||||
import com.hzs.member.sms.service.impl.ApiSmsServiceImpl;
|
import com.hzs.member.sms.service.impl.ApiSmsServiceImpl;
|
||||||
import com.hzs.system.config.IServiceChargeServiceApi;
|
import com.hzs.system.config.IServiceChargeServiceApi;
|
||||||
import com.hzs.system.config.dto.ServiceChargeDTO;
|
import com.hzs.system.config.dto.ServiceChargeDTO;
|
||||||
import com.hzs.system.sys.IApprovalServiceApi;
|
|
||||||
import com.hzs.system.sys.dto.ApprovalInfoDTO;
|
|
||||||
import com.hzs.system.sys.dto.ApprovalItemInfoDTO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变理户籍
|
* 变理户籍
|
||||||
*
|
|
||||||
* @Description:
|
|
||||||
* @Author: ljc
|
|
||||||
* @Time: 2023/4/18 10:07
|
|
||||||
* @Classname: ApiDomicileChangeController
|
|
||||||
* @Package_name: com.hzs.member.self.controller.api
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequestMapping("/api/change-domicile")
|
@RequestMapping("/api/change-domicile")
|
||||||
|
@ -57,25 +38,16 @@ import java.util.stream.Collectors;
|
||||||
public class ApiDomicileChangeController extends BaseController {
|
public class ApiDomicileChangeController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICuMemberAuthenticationService cuMemberAuthenticationService;
|
private ICuMemberAuthenticationService iCuMemberAuthenticationService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICuMemberService cuMemberService;
|
private ICuMemberService iCuMemberService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApiSmsServiceImpl apiSmsService;
|
private ApiSmsServiceImpl apiSmsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICuMemberTradeService cuMemberTradeService;
|
private ICuSelfServiceLogService iCuSelfServiceLogService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICuSelfServiceLogService serviceLogService;
|
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IServiceChargeServiceApi serviceChargeServiceApi;
|
IServiceChargeServiceApi iServiceChargeServiceApi;
|
||||||
|
|
||||||
@DubboReference
|
|
||||||
IApprovalServiceApi iApprovalServiceApi;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询可申请信息
|
* 查询可申请信息
|
||||||
|
@ -85,7 +57,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
@GetMapping("/application-info-list")
|
@GetMapping("/application-info-list")
|
||||||
public AjaxResult applicationInformation() {
|
public AjaxResult applicationInformation() {
|
||||||
Long pkMember = SecurityUtils.getUserId();
|
Long pkMember = SecurityUtils.getUserId();
|
||||||
CuMemberExt member = cuMemberService.getMemberById(pkMember);
|
CuMemberExt member = iCuMemberService.getMemberById(pkMember);
|
||||||
DomicileChangeVO domicileChangeVO = DomicileChangeVO.builder().memberCode(member.getMemberCode())
|
DomicileChangeVO domicileChangeVO = DomicileChangeVO.builder().memberCode(member.getMemberCode())
|
||||||
.memberName(member.getMemberName()).phone(member.getPhone())
|
.memberName(member.getMemberName()).phone(member.getPhone())
|
||||||
.changeNum(MagicNumberConstants.CHANGE_NUM).build();
|
.changeNum(MagicNumberConstants.CHANGE_NUM).build();
|
||||||
|
@ -95,7 +67,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
|
|
||||||
@GetMapping("/application-info-detail")
|
@GetMapping("/application-info-detail")
|
||||||
public AjaxResult applicationInformationDetail() {
|
public AjaxResult applicationInformationDetail() {
|
||||||
return AjaxResult.success(serviceLogService.selectDomicileChangeByPkMember(SecurityUtils.getUserId(), EApprovalBusiness.DOMICILE_CHANGE.getValue(), SecurityUtils.getPkCountry()));
|
return AjaxResult.success(iCuSelfServiceLogService.selectDomicileChangeByPkMember(SecurityUtils.getUserId(), EApprovalBusiness.DOMICILE_CHANGE.getValue(), SecurityUtils.getPkCountry()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +79,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
public AjaxResult appliedInformation() {
|
public AjaxResult appliedInformation() {
|
||||||
DomicileChangeVO domicileChangeVO = DomicileChangeVO.builder().pkMember(SecurityUtils.getUserId())
|
DomicileChangeVO domicileChangeVO = DomicileChangeVO.builder().pkMember(SecurityUtils.getUserId())
|
||||||
.pkCountry(SecurityUtils.getPkCountry()).editType(EApprovalBusiness.DOMICILE_CHANGE.getValue()).build();
|
.pkCountry(SecurityUtils.getPkCountry()).editType(EApprovalBusiness.DOMICILE_CHANGE.getValue()).build();
|
||||||
List<DomicileChangeVO> domicileChangeVOList = (List<DomicileChangeVO>) serviceLogService.selectSelfServiceByPkMember(domicileChangeVO)[1];
|
List<DomicileChangeVO> domicileChangeVOList = (List<DomicileChangeVO>) iCuSelfServiceLogService.selectSelfServiceByPkMember(domicileChangeVO)[1];
|
||||||
return AjaxResult.success(domicileChangeVOList);
|
return AjaxResult.success(domicileChangeVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +91,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/show-index-domicile")
|
@GetMapping("/show-index-domicile")
|
||||||
public AjaxResult showIndexDomicile() {
|
public AjaxResult showIndexDomicile() {
|
||||||
return AjaxResult.success(serviceLogService.showIndexDomicile(SecurityUtils.getPkCountry(), SecurityUtils.getUserId()));
|
return AjaxResult.success(iCuSelfServiceLogService.showIndexDomicile(SecurityUtils.getPkCountry(), SecurityUtils.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,21 +131,15 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
if (!existApprovalData.equals(AjaxResult.success())) {
|
if (!existApprovalData.equals(AjaxResult.success())) {
|
||||||
return existApprovalData;
|
return existApprovalData;
|
||||||
}
|
}
|
||||||
//余额是否充足
|
|
||||||
AjaxResult accountBalance = isAccountBalance(domicileChangeVO);
|
|
||||||
if (!accountBalance.equals(AjaxResult.success())) {
|
|
||||||
return accountBalance;
|
|
||||||
}
|
|
||||||
//验证码校验
|
//验证码校验
|
||||||
String key = ESmsTemplate.VERIFICATION.getCache() + pkMember;
|
String key = ESmsTemplate.VERIFICATION.getCache() + pkMember;
|
||||||
String message = apiSmsService.checkSms(key, domicileChangeVO.getVerificationCode());
|
String message = apiSmsService.checkSms(key, domicileChangeVO.getVerificationCode());
|
||||||
if (null != message) {
|
if (null != message) {
|
||||||
return AjaxResult.error(message);
|
return AjaxResult.error(message);
|
||||||
}
|
}
|
||||||
return toAjax(serviceLogService.saveChangeDomicile(domicileChangeVO));
|
return toAjax(iCuSelfServiceLogService.saveChangeDomicile(domicileChangeVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示户籍变更信息
|
* 显示户籍变更信息
|
||||||
*
|
*
|
||||||
|
@ -185,10 +151,10 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
String idFront = null;
|
String idFront = null;
|
||||||
Long pkMember = SecurityUtils.getUserId();
|
Long pkMember = SecurityUtils.getUserId();
|
||||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||||
CuMemberExt member = cuMemberService.getMemberById(pkMember);
|
CuMemberExt member = iCuMemberService.getMemberById(pkMember);
|
||||||
//查询实名认证信息原证件图
|
//查询实名认证信息原证件图
|
||||||
CuMemberAuthenticationVO authenticationVO = CuMemberAuthenticationVO.builder().pkCountry(pkCountry).pkMember(pkMember).build();
|
CuMemberAuthenticationVO authenticationVO = CuMemberAuthenticationVO.builder().pkCountry(pkCountry).pkMember(pkMember).build();
|
||||||
CuMemberAuthenticationVO cuMemberAuthenticationVO = cuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(authenticationVO);
|
CuMemberAuthenticationVO cuMemberAuthenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(authenticationVO);
|
||||||
if (null != cuMemberAuthenticationVO) {
|
if (null != cuMemberAuthenticationVO) {
|
||||||
idBack = cuMemberAuthenticationVO.getIdBack();
|
idBack = cuMemberAuthenticationVO.getIdBack();
|
||||||
idFront = cuMemberAuthenticationVO.getIdFront();
|
idFront = cuMemberAuthenticationVO.getIdFront();
|
||||||
|
@ -212,7 +178,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
cuSelfServiceLog.setPkCountry(domicileChangeVO.getPkCountry());
|
cuSelfServiceLog.setPkCountry(domicileChangeVO.getPkCountry());
|
||||||
cuSelfServiceLog.setEditType(EApprovalBusiness.DOMICILE_CHANGE.getValue());
|
cuSelfServiceLog.setEditType(EApprovalBusiness.DOMICILE_CHANGE.getValue());
|
||||||
cuSelfServiceLog.setPkMember(domicileChangeVO.getPkMember());
|
cuSelfServiceLog.setPkMember(domicileChangeVO.getPkMember());
|
||||||
Integer check = serviceLogService.checkSelfService(cuSelfServiceLog);
|
Integer check = iCuSelfServiceLogService.checkSelfService(cuSelfServiceLog);
|
||||||
if (check > 0) {
|
if (check > 0) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_UPDATE_CODE_REPEAT));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_UPDATE_CODE_REPEAT));
|
||||||
}
|
}
|
||||||
|
@ -231,43 +197,7 @@ public class ApiDomicileChangeController extends BaseController {
|
||||||
serviceChargeDTO.setType(EApprovalBusiness.DOMICILE_CHANGE.getValue());
|
serviceChargeDTO.setType(EApprovalBusiness.DOMICILE_CHANGE.getValue());
|
||||||
serviceChargeDTO.setPkCountry(pkCountry);
|
serviceChargeDTO.setPkCountry(pkCountry);
|
||||||
serviceChargeDTO.setQuantity(MagicNumberConstants.CHANGE_NUM);
|
serviceChargeDTO.setQuantity(MagicNumberConstants.CHANGE_NUM);
|
||||||
return serviceChargeServiceApi.getServiceChargeByType(serviceChargeDTO).getData();
|
return iServiceChargeServiceApi.getServiceChargeByType(serviceChargeDTO).getData();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询余额是否充足
|
|
||||||
*
|
|
||||||
* @param domicileChangeVO 户籍变更信息
|
|
||||||
* @return AjaxResult
|
|
||||||
*/
|
|
||||||
private AjaxResult isAccountBalance(DomicileChangeVO domicileChangeVO) {
|
|
||||||
List<MemberAmountDTO> memberAmountDTOList = new ArrayList<>();
|
|
||||||
memberAmountDTOList.add(MemberAmountDTO.builder().pkMember(domicileChangeVO.getPkMember()).tradeAmount(domicileChangeVO.getAmount()).build());
|
|
||||||
BusinessCommissionDTO businessCommissionDTO = BusinessCommissionDTO.builder().pkAccount(domicileChangeVO.getPkAccount()).memberAmountDTOList(memberAmountDTOList).build();
|
|
||||||
List<MemberBalanceDTO> memberBalanceList = cuMemberTradeService.selectBalanceNotEnoughMember(businessCommissionDTO);
|
|
||||||
if (CollectionUtil.isNotEmpty(memberBalanceList)) {
|
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_BALANCE_INSUFFICIENT));
|
|
||||||
}
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否配置审批人信息
|
|
||||||
*
|
|
||||||
* @param pkCountry 国家ID
|
|
||||||
* @return AjaxResult
|
|
||||||
*/
|
|
||||||
private AjaxResult isConfigApprovalInfo(Integer pkCountry, DomicileChangeVO domicileChangeVO) {
|
|
||||||
Map<Integer, ApprovalInfoDTO> approvalInfoMap = iApprovalServiceApi.queryApprovalInfo(Collections.singletonList(EApprovalBusiness.DOMICILE_CHANGE.getValue()), pkCountry).getData();
|
|
||||||
// 根据审批业务类型判断是否配置审批流程
|
|
||||||
ApprovalInfoDTO approvalInfo = approvalInfoMap.get(EApprovalBusiness.DOMICILE_CHANGE.getValue());
|
|
||||||
if (null == approvalInfo || CollectionUtil.isEmpty(approvalInfo.getItemList())) {
|
|
||||||
log.error("{} 提交认证失败,未配置审批流程", EApprovalBusiness.DOMICILE_CHANGE.getLabel());
|
|
||||||
return AjaxResult.error("提交认证失败,请联系客服");
|
|
||||||
}
|
|
||||||
List<Long> userList = approvalInfo.getItemList().stream().map(ApprovalItemInfoDTO::getPkUser).collect(Collectors.toList());
|
|
||||||
domicileChangeVO.setUserIdList(userList);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue