Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -10,6 +10,8 @@ public class CommonConstants {
|
|||||||
|
|
||||||
public static final String REQUEST_ID = "requestId";
|
public static final String REQUEST_ID = "requestId";
|
||||||
|
|
||||||
|
public static final String MESSAGE_ID = "messageId";
|
||||||
|
|
||||||
public static final String ACCESS_TOKEN_KEY = "access_token";
|
public static final String ACCESS_TOKEN_KEY = "access_token";
|
||||||
|
|
||||||
public static final String REFRESH_TOKEN_KEY = "refresh_token";
|
public static final String REFRESH_TOKEN_KEY = "refresh_token";
|
||||||
|
|||||||
@@ -189,6 +189,11 @@ public class RedisConstant {
|
|||||||
|
|
||||||
public static final String STOREWORK_NOTICE_KEY = "storeWorkNoticeCache:{0}:{1}:{2}:{3}";
|
public static final String STOREWORK_NOTICE_KEY = "storeWorkNoticeCache:{0}:{1}:{2}:{3}";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冷静期内是否首次登录 冷静期首次登录 是-true 否-false
|
||||||
|
*/
|
||||||
|
public static final String COOLINGPERIOD_FIRSTLOGIN_KEY = "coolingPeriodFirstLoginCache:{0}";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 七天
|
* 七天
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public enum ErrorCodeEnum {
|
|||||||
IDENTITY_CARD_PARSE_FAIL(1021080, "身份证解析失败", null),
|
IDENTITY_CARD_PARSE_FAIL(1021080, "身份证解析失败", null),
|
||||||
PARAMS_REQUIRED(400002, "参数缺失!", null),
|
PARAMS_REQUIRED(400002, "参数缺失!", null),
|
||||||
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
||||||
|
PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
|
||||||
|
|
||||||
|
|
||||||
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: IDCardSideEnum
|
||||||
|
* @Description: 身份证正反面类型
|
||||||
|
* @date 2023-06-16 16:49
|
||||||
|
*/
|
||||||
|
public enum IDCardSideEnum {
|
||||||
|
|
||||||
|
FACE("face", "正面"),
|
||||||
|
BACK("back", "反面")
|
||||||
|
;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
IDCardSideEnum(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,4 +45,10 @@ public class HyPartnerBaseInfoDAO {
|
|||||||
return hyPartnerBaseInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
|
return hyPartnerBaseInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getLineIdByIdCard(String idCard){
|
||||||
|
if (StringUtils.isEmpty(idCard)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -61,4 +62,16 @@ public class RegionDAO {
|
|||||||
return ListUtils.emptyIfNull(regionList).stream().collect(Collectors.toMap(RegionDO::getRegionId, RegionDO::getName));
|
return ListUtils.emptyIfNull(regionList).stream().collect(Collectors.toMap(RegionDO::getRegionId, RegionDO::getName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取区域
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RegionDO getRegionInfoByRegionId(String regionId){
|
||||||
|
if(StringUtils.isBlank(regionId)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return regionMapper.getRegionInfoByRegionId(regionId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ public interface HyPartnerBaseInfoMapper {
|
|||||||
|
|
||||||
HyPartnerBaseInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
HyPartnerBaseInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
||||||
|
|
||||||
|
Long getLineIdByIdCard(@Param("idCard") String idCard);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -51,4 +51,11 @@ public interface RegionMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<RegionDO> getRegionBaseInfoList();
|
List<RegionDO> getRegionBaseInfoList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取区域信息
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
RegionDO getRegionInfoByRegionId(@Param("regionId") String regionId);
|
||||||
}
|
}
|
||||||
@@ -224,4 +224,11 @@
|
|||||||
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getLineIdByIdCard" resultType="java.lang.Long">
|
||||||
|
select
|
||||||
|
partner_line_id
|
||||||
|
from hy_partner_base_info
|
||||||
|
where id_card = #{idCard}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -13,10 +13,16 @@
|
|||||||
<result column="is_write_partner_know" jdbcType="TINYINT" property="isWritePartnerKnow" />
|
<result column="is_write_partner_know" jdbcType="TINYINT" property="isWritePartnerKnow" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
|
||||||
|
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
|
||||||
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
||||||
|
<result column="recommend_partner_id" jdbcType="VARCHAR" property="recommendPartnerId" />
|
||||||
|
<result column="recommend_partner_name" jdbcType="VARCHAR" property="recommendPartnerName" />
|
||||||
|
<result column="recommend_partner_mobile" jdbcType="VARCHAR" property="recommendPartnerMobile" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, partner_id, mobile, username, live_area, want_shop_area, accept_adjust_type,
|
id, partner_id, mobile, username, live_area, want_shop_area, accept_adjust_type,
|
||||||
invite_code, is_write_partner_know, create_time, update_time
|
invite_code, is_write_partner_know, create_time, update_time, shop_code, shop_name, shop_id, recommend_partner_id, recommend_partner_name, recommend_partner_mobile
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPartnerId" resultMap="BaseResultMap" >
|
<select id="selectByPartnerId" resultMap="BaseResultMap" >
|
||||||
select
|
select
|
||||||
|
|||||||
@@ -187,4 +187,13 @@
|
|||||||
where
|
where
|
||||||
deleted = 0
|
deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getRegionInfoByRegionId" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from
|
||||||
|
region
|
||||||
|
where
|
||||||
|
deleted = 0 and region_id= #{regionId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -227,4 +227,47 @@ public class SysDepartmentDTO {
|
|||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static RegionDO convertRegionDO(SysDepartmentDTO dept, Multimap<String, String> leaderDeptMap, RegionDO parentRegion){
|
||||||
|
RegionDO region = new RegionDO();
|
||||||
|
region.setRegionId(dept.getId());
|
||||||
|
region.setName(dept.getName());
|
||||||
|
region.setParentId(dept.getParentId());
|
||||||
|
region.setUnclassifiedFlag(CommonConstants.ZERO);
|
||||||
|
region.setLeaderUserId(dept.getLeaderUserId());
|
||||||
|
region.setOrderNum(dept.getDepartOrder());
|
||||||
|
region.setThirdDeptId(dept.getId());
|
||||||
|
region.setCreateTime(System.currentTimeMillis());
|
||||||
|
region.setUpdateTime(System.currentTimeMillis());
|
||||||
|
String regionPath = parentRegion.getRegionPath() + region.getRegionId() + CommonConstants.PATH_SPILT;
|
||||||
|
region.setRegionPath(regionPath);
|
||||||
|
region.setDeleted(Boolean.FALSE);
|
||||||
|
if(CollectionUtils.isNotEmpty(dept.getDeptManagerUseridList())){
|
||||||
|
for (String leader : dept.getDeptManagerUseridList()) {
|
||||||
|
leaderDeptMap.put(leader, dept.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RegionDO convertRegionDO(SysDepartmentDTO dept, Multimap<String, String> leaderDeptMap){
|
||||||
|
RegionDO region = new RegionDO();
|
||||||
|
region.setRegionId(dept.getId());
|
||||||
|
region.setName(dept.getName());
|
||||||
|
region.setParentId(dept.getParentId());
|
||||||
|
region.setUnclassifiedFlag(CommonConstants.ZERO);
|
||||||
|
region.setLeaderUserId(dept.getLeaderUserId());
|
||||||
|
region.setOrderNum(dept.getDepartOrder());
|
||||||
|
region.setThirdDeptId(dept.getId());
|
||||||
|
region.setCreateTime(System.currentTimeMillis());
|
||||||
|
region.setUpdateTime(System.currentTimeMillis());
|
||||||
|
region.setDeleted(Boolean.FALSE);
|
||||||
|
if(CollectionUtils.isNotEmpty(dept.getDeptManagerUseridList())){
|
||||||
|
for (String leader : dept.getDeptManagerUseridList()) {
|
||||||
|
leaderDeptMap.put(leader, dept.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return region;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,4 +50,22 @@ public class HyPartnerUserInfoDO implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
@ApiModelProperty("更新时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺编码")
|
||||||
|
private String shopCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺名称")
|
||||||
|
private String shopName;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺ID")
|
||||||
|
private String shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("推荐加盟商id")
|
||||||
|
private String recommendPartnerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("推荐加盟商姓名")
|
||||||
|
private String recommendPartnerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("推荐加盟商手机号")
|
||||||
|
private String recommendPartnerMobile;
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,10 @@ public class OpenAreaTreeVO {
|
|||||||
@ApiModelProperty("状态 open-开放 keyOpen-重点开放 notOpen-未开放 saturated-已饱和")
|
@ApiModelProperty("状态 open-开放 keyOpen-重点开放 notOpen-未开放 saturated-已饱和")
|
||||||
private String areaStatus;
|
private String areaStatus;
|
||||||
|
|
||||||
|
private String backgroundBanner;
|
||||||
|
|
||||||
|
private String detailBanner;
|
||||||
|
|
||||||
@ApiModelProperty("子区域")
|
@ApiModelProperty("子区域")
|
||||||
List<OpenAreaTreeVO> childNode;
|
List<OpenAreaTreeVO> childNode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ public class PartnerUserInfoVO {
|
|||||||
@ApiModelProperty("邀请码")
|
@ApiModelProperty("邀请码")
|
||||||
private String inviteCode;
|
private String inviteCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否填写加盟需知")
|
||||||
|
private Integer isWritePartnerKnow;
|
||||||
|
|
||||||
@ApiModelProperty("openid")
|
@ApiModelProperty("openid")
|
||||||
private String openid;
|
private String openid;
|
||||||
|
|
||||||
@@ -50,15 +53,17 @@ public class PartnerUserInfoVO {
|
|||||||
private String unionId;
|
private String unionId;
|
||||||
|
|
||||||
@ApiModelProperty("是否需要提交意向信息")
|
@ApiModelProperty("是否需要提交意向信息")
|
||||||
private Boolean isNeedSubmitWantInfo;
|
private Boolean needSubmitWantInfo;
|
||||||
|
|
||||||
public Boolean getNeedSubmitWantInfo() {
|
public Boolean getNeedSubmitWantInfo() {
|
||||||
if(StringUtils.isBlank(username)
|
if(StringUtils.isBlank(username)
|
||||||
|| StringUtils.isBlank(mobile)
|
|| StringUtils.isBlank(mobile)
|
||||||
|| StringUtils.isBlank(liveArea)
|
|| StringUtils.isBlank(liveArea)
|
||||||
|| StringUtils.isBlank(wantShopArea)){
|
|| StringUtils.isBlank(wantShopArea)
|
||||||
|
|| Objects.isNull(acceptAdjustType)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,26 @@
|
|||||||
package com.cool.store.handler;
|
package com.cool.store.handler;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.response.error.ErrorResponse;
|
import com.cool.store.response.error.ErrorResponse;
|
||||||
|
import com.cool.store.utils.UUIDUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.MDC;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
* @FileName: CustomExceptionHandler
|
* @FileName: CustomExceptionHandler
|
||||||
@@ -21,24 +32,41 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|||||||
public class CustomExceptionHandler {
|
public class CustomExceptionHandler {
|
||||||
|
|
||||||
@ExceptionHandler(value = ServiceException.class)
|
@ExceptionHandler(value = ServiceException.class)
|
||||||
public ResponseEntity<ErrorResponse> handleCustomException(ServiceException e) {
|
public void handleCustomException(ServiceException e, HttpServletResponse httpServletResponse) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
responseResult(httpServletResponse, responseResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = ApiException.class)
|
@ExceptionHandler(value = ApiException.class)
|
||||||
public ResponseEntity<ErrorResponse> handleCustomException(ApiException e) {
|
public void handleCustomException(ApiException e, HttpServletResponse httpServletResponse) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
responseResult(httpServletResponse, responseResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = Exception.class)
|
@ExceptionHandler(value = Exception.class)
|
||||||
public ResponseEntity<ErrorResponse> handleException(Exception e) {
|
public void handleException(Exception e, HttpServletResponse httpServletResponse) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
|
ResponseResult responseResult = new ResponseResult(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.INTERNAL_SERVER_ERROR);
|
responseResult(httpServletResponse, responseResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void responseResult(HttpServletResponse response, ResponseResult result) {
|
||||||
|
response.setCharacterEncoding("UTF-8");
|
||||||
|
response.setHeader("Content-type", "application/json;charset=UTF-8");
|
||||||
|
String requestId = MDC.get(CommonConstants.REQUEST_ID);
|
||||||
|
if(StringUtils.isBlank(requestId)){
|
||||||
|
requestId = UUIDUtils.get32UUID();
|
||||||
|
}
|
||||||
|
result.setRequestId(requestId);
|
||||||
|
result.setData(null);
|
||||||
|
try {
|
||||||
|
response.getWriter().write(JSONObject.toJSONString(result, SerializerFeature.WriteNullStringAsEmpty));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
log.error(ex.getMessage(),ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,28 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门详情
|
||||||
|
* @param deptId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SysDepartmentDTO getDepartmentDetail(String deptId){
|
||||||
|
String url = isvDomain + "/corp/getDepartmentDetail";
|
||||||
|
HashMap requestMap = new HashMap();
|
||||||
|
requestMap.put("deptId", deptId);
|
||||||
|
ResultDTO responseEntity = null;
|
||||||
|
try {
|
||||||
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
|
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), SysDepartmentDTO.class);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("调用isv出错{}", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public AuthScopeDTO getAuthScope(){
|
public AuthScopeDTO getAuthScope(){
|
||||||
String url = isvDomain + "/corp/getAuthScope";
|
String url = isvDomain + "/corp/getAuthScope";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
|
|||||||
@@ -45,10 +45,9 @@ public class RocketMqLogAspect {
|
|||||||
Object[] args = joinPoint.getArgs();
|
Object[] args = joinPoint.getArgs();
|
||||||
Message message = (Message)args[0];
|
Message message = (Message)args[0];
|
||||||
String traceId = message.getMsgID() + Constants.TOPIC_PARTITION_SEPARATOR + message.getReconsumeTimes();
|
String traceId = message.getMsgID() + Constants.TOPIC_PARTITION_SEPARATOR + message.getReconsumeTimes();
|
||||||
Map<String, String> context = MDC.getCopyOfContextMap();
|
String requestId = message.getUserProperties(CommonConstants.REQUEST_ID);
|
||||||
if(Objects.isNull(context)){
|
MDC.put(CommonConstants.REQUEST_ID, requestId);
|
||||||
MDC.put(CommonConstants.REQUEST_ID, traceId);
|
MDC.put(CommonConstants.MESSAGE_ID, traceId);
|
||||||
}
|
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
log.info("MDC mqBeforeLog", e);
|
log.info("MDC mqBeforeLog", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
||||||
|
import com.cool.store.enums.IDCardSideEnum;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
|
|
||||||
@@ -24,6 +25,6 @@ public interface AliyunService {
|
|||||||
* @param faceImageUrl
|
* @param faceImageUrl
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl) throws ApiException;
|
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ public interface HyPartnerBaseInfoService {
|
|||||||
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request);
|
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request);
|
||||||
|
|
||||||
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);
|
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);
|
||||||
|
|
||||||
|
Long getLineIdByIdCard(String idCard);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,5 +104,7 @@ public interface HyPartnerLineInfoService {
|
|||||||
*/
|
*/
|
||||||
PageInfo<PublicSeaLineListVo> publicSeaLineList(String userId,LineRequest lineRequest);
|
PageInfo<PublicSeaLineListVo> publicSeaLineList(String userId,LineRequest lineRequest);
|
||||||
|
|
||||||
|
PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.aliyun.ocr20191230.models.RecognizeIdentityCardResponseBody;
|
|||||||
import com.aliyun.teaopenapi.models.Config;
|
import com.aliyun.teaopenapi.models.Config;
|
||||||
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.IDCardSideEnum;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.service.AliyunService;
|
import com.cool.store.service.AliyunService;
|
||||||
@@ -23,6 +24,7 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +63,7 @@ public class AliyunServiceImpl implements AliyunService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl) throws ApiException {
|
public IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException {
|
||||||
//todo zcb ak sk替换
|
//todo zcb ak sk替换
|
||||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||||
.setAccessKeyId("LTAI5t9RaXvABZbHvoXjDFJ1")
|
.setAccessKeyId("LTAI5t9RaXvABZbHvoXjDFJ1")
|
||||||
@@ -74,11 +76,12 @@ public class AliyunServiceImpl implements AliyunService {
|
|||||||
InputStream inputStream = url.openConnection().getInputStream();
|
InputStream inputStream = url.openConnection().getInputStream();
|
||||||
com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest recognizeIdentityCardAdvanceRequest = new com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest()
|
com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest recognizeIdentityCardAdvanceRequest = new com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest()
|
||||||
.setImageURLObject(inputStream)
|
.setImageURLObject(inputStream)
|
||||||
.setSide("face");
|
.setSide(sideEnum.getCode());
|
||||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||||
RecognizeIdentityCardResponse idCardResponse = client.recognizeIdentityCardAdvance(recognizeIdentityCardAdvanceRequest, runtime);
|
RecognizeIdentityCardResponse idCardResponse = client.recognizeIdentityCardAdvance(recognizeIdentityCardAdvanceRequest, runtime);
|
||||||
log.info("身份证解析结果:{}", JSONObject.toJSONString(idCardResponse));
|
log.info("身份证解析结果:{}", JSONObject.toJSONString(idCardResponse));
|
||||||
RecognizeIdentityCardResponseBody.RecognizeIdentityCardResponseBodyDataFrontResult frontResult = Optional.ofNullable(idCardResponse).map(o -> o.getBody()).map(o -> o.data).map(o -> o.frontResult).orElse(null);
|
RecognizeIdentityCardResponseBody.RecognizeIdentityCardResponseBodyDataFrontResult frontResult = Optional.ofNullable(idCardResponse).map(o -> o.getBody()).map(o -> o.data).map(o -> o.frontResult).orElse(null);
|
||||||
|
if(Objects.nonNull(frontResult)){
|
||||||
String username = frontResult.name;
|
String username = frontResult.name;
|
||||||
String liveAddress = frontResult.address;
|
String liveAddress = frontResult.address;
|
||||||
String birthdate = frontResult.birthDate;
|
String birthdate = frontResult.birthDate;
|
||||||
@@ -91,6 +94,8 @@ public class AliyunServiceImpl implements AliyunService {
|
|||||||
IdentityCardInfoVO result = new IdentityCardInfoVO(username, liveAddress, birthdate, sex, idCard, nation);
|
IdentityCardInfoVO result = new IdentityCardInfoVO(username, liveAddress, birthdate, sex, idCard, nation);
|
||||||
log.info("身份证解析:{}", JSONObject.toJSONString(result));
|
log.info("身份证解析:{}", JSONObject.toJSONString(result));
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
} catch (com.aliyun.tea.TeaException e) {
|
} catch (com.aliyun.tea.TeaException e) {
|
||||||
log.error("身份证解析报错TeaException:{}", e);
|
log.error("身份证解析报错TeaException:{}", e);
|
||||||
throw new ApiException(e.getMessage());
|
throw new ApiException(e.getMessage());
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
@@ -9,6 +10,8 @@ import com.cool.store.dto.dept.DepartmentEventDTO;
|
|||||||
import com.cool.store.dto.enterprise.*;
|
import com.cool.store.dto.enterprise.*;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.DataSourceEnum;
|
import com.cool.store.enums.DataSourceEnum;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.http.ISVHttpRequest;
|
import com.cool.store.http.ISVHttpRequest;
|
||||||
import com.cool.store.service.EnterpriseSyncService;
|
import com.cool.store.service.EnterpriseSyncService;
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
@@ -209,16 +212,61 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deptUpdateEvent(DepartmentEventDTO param) {
|
public void deptUpdateEvent(DepartmentEventDTO param) {
|
||||||
|
SysDepartmentDTO departmentDetail = isvHttpRequest.getDepartmentDetail(param.getDepartmentId());
|
||||||
|
if(Objects.isNull(departmentDetail)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
log.info("部门变更:{}", JSONObject.toJSONString(param));
|
log.info("部门变更:{}", JSONObject.toJSONString(param));
|
||||||
switch (parseValue(param.getEventType())){
|
switch (parseValue(param.getEventType())){
|
||||||
case DEPARTMENT_CREATED:
|
case DEPARTMENT_CREATED:
|
||||||
|
RegionDO parentRegionInfo = regionDAO.getRegionInfoByRegionId(departmentDetail.getParentId());
|
||||||
|
if(Objects.isNull(parentRegionInfo)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARENT_NODE_NOT_EXIST);
|
||||||
|
}
|
||||||
|
Multimap<String, String> leaderDeptMap = ArrayListMultimap.create();
|
||||||
|
RegionDO region = SysDepartmentDTO.convertRegionDO(departmentDetail, leaderDeptMap, parentRegionInfo);
|
||||||
|
regionDAO.batchInsertOrUpdate(Arrays.asList(region));
|
||||||
|
dealUserLeaderDept(leaderDeptMap);
|
||||||
break;
|
break;
|
||||||
case DEPARTMENT_UPDATED:
|
case DEPARTMENT_UPDATED:
|
||||||
|
if(param.getIsChangeParent()){
|
||||||
|
syncAll();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Multimap<String, String> updateLeaderDeptMap = ArrayListMultimap.create();
|
||||||
|
RegionDO updateRegion = SysDepartmentDTO.convertRegionDO(departmentDetail, updateLeaderDeptMap);
|
||||||
|
regionDAO.batchInsertOrUpdate(Arrays.asList(updateRegion));
|
||||||
|
dealUserLeaderDept(updateLeaderDeptMap);
|
||||||
break;
|
break;
|
||||||
case DEPARTMENT_DELETED:
|
case DEPARTMENT_DELETED:
|
||||||
|
syncAll();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dealUserLeaderDept(Multimap<String, String> leaderDeptMap){
|
||||||
|
if(leaderDeptMap.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> userIds = leaderDeptMap.keys().stream().collect(Collectors.toList());
|
||||||
|
List<EnterpriseUserDO> userList = enterpriseUserDAO.getUserInfoByUserIds(userIds);
|
||||||
|
for (EnterpriseUserDO enterpriseUser : userList) {
|
||||||
|
List<String> deptIds = leaderDeptMap.get(enterpriseUser.getUserId()).stream().collect(Collectors.toList());
|
||||||
|
String leaderDeptIds = enterpriseUser.getLeaderDeptIds();
|
||||||
|
if(StringUtils.isNotBlank(leaderDeptIds)){
|
||||||
|
List<String> existDeptIds = JSONObject.parseArray(leaderDeptIds).stream().map(String::valueOf).collect(Collectors.toList());
|
||||||
|
//取并集
|
||||||
|
existDeptIds.addAll(deptIds);
|
||||||
|
List<String> allDeptIds = existDeptIds.stream().distinct().collect(Collectors.toList());
|
||||||
|
enterpriseUser.setLeaderDeptIds(JSONObject.toJSONString(allDeptIds));
|
||||||
|
}else{
|
||||||
|
enterpriseUser.setLeaderDeptIds(JSONObject.toJSONString(deptIds));
|
||||||
|
}
|
||||||
|
enterpriseUser.setIsLeader(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
enterpriseUserDAO.batchInsertOrUpdate(userList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
|||||||
return baseInfoVO;
|
return baseInfoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getLineIdByIdCard(String idCard) {
|
||||||
|
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
|
||||||
|
}
|
||||||
|
|
||||||
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
|
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
|
||||||
baseInfoDO.setPartnerId(request.getPartnerId());
|
baseInfoDO.setPartnerId(request.getPartnerId());
|
||||||
baseInfoDO.setPartnerLineId(request.getPartnerLineId());
|
baseInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||||
@@ -17,19 +19,21 @@ import com.cool.store.enums.WorkflowStatusEnum;
|
|||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.CloseFollowRequest;
|
import com.cool.store.request.CloseFollowRequest;
|
||||||
import com.cool.store.request.LineRequest;
|
import com.cool.store.request.LineRequest;
|
||||||
import com.cool.store.service.EnterpriseUserService;
|
|
||||||
import com.cool.store.service.HyPartnerLineInfoService;
|
import com.cool.store.service.HyPartnerLineInfoService;
|
||||||
import com.cool.store.utils.CoolDateUtils;
|
import com.cool.store.utils.CoolDateUtils;
|
||||||
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.cool.store.vo.*;
|
import com.cool.store.vo.*;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -49,6 +53,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
|||||||
EnterpriseUserDAO enterpriseUserDAO;
|
EnterpriseUserDAO enterpriseUserDAO;
|
||||||
@Resource
|
@Resource
|
||||||
UserRegionMappingDAO userRegionMappingDAO;
|
UserRegionMappingDAO userRegionMappingDAO;
|
||||||
|
@Resource
|
||||||
|
private RedisUtilPool redisUtilPool;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StageCountVO selectStagePendingCount(String userId) {
|
public StageCountVO selectStagePendingCount(String userId) {
|
||||||
@@ -291,6 +297,18 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
|||||||
return publicSeaLineList;
|
return publicSeaLineList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId) {
|
||||||
|
PartnerLineBaseInfoVO lineBaseInfoVO = new PartnerLineBaseInfoVO();
|
||||||
|
// todo wxp 需要加条件
|
||||||
|
HyPartnerLineInfoDO lineInfoDO = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
|
||||||
|
BeanUtil.copyProperties(lineInfoDO, lineBaseInfoVO);
|
||||||
|
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, partnerId);
|
||||||
|
String value = redisUtilPool.getString(coolingPeriodFirstLoginCacheKey);
|
||||||
|
lineBaseInfoVO.setCoolDownFirstLoginFlag(StringUtils.isNotBlank(value));
|
||||||
|
return lineBaseInfoVO;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convertPartnerBlackListDTOToVo
|
* convertPartnerBlackListDTOToVo
|
||||||
* @param partnerBlackListDTO
|
* @param partnerBlackListDTO
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
|||||||
hyPartnerUserInfoDO.setUsername(miniProgramUser.getNickName());
|
hyPartnerUserInfoDO.setUsername(miniProgramUser.getNickName());
|
||||||
hyPartnerUserInfoDO.setPartnerId(UUIDUtils.get32UUID());
|
hyPartnerUserInfoDO.setPartnerId(UUIDUtils.get32UUID());
|
||||||
hyPartnerUserInfoDAO.insertSelective(hyPartnerUserInfoDO);
|
hyPartnerUserInfoDAO.insertSelective(hyPartnerUserInfoDO);
|
||||||
// 生成一条线索
|
// 生成一条线索 也可在提交加盟信息时插入
|
||||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||||
hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||||
hyPartnerLineInfoDAO.insertSelective(hyPartnerLineInfoDO);
|
hyPartnerLineInfoDAO.insertSelective(hyPartnerLineInfoDO);
|
||||||
@@ -108,9 +108,7 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
|||||||
hyPartnerUserPlatformBindDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
hyPartnerUserPlatformBindDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||||
hyPartnerUserPlatformBindDAO.insertSelective(hyPartnerUserPlatformBindDO);
|
hyPartnerUserPlatformBindDAO.insertSelective(hyPartnerUserPlatformBindDO);
|
||||||
}
|
}
|
||||||
userInfoVO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
BeanUtil.copyProperties(hyPartnerUserInfoDO, userInfoVO);
|
||||||
userInfoVO.setMobile(hyPartnerUserInfoDO.getMobile());
|
|
||||||
userInfoVO.setUsername(hyPartnerUserInfoDO.getUsername());
|
|
||||||
}
|
}
|
||||||
userInfoVO.setOpenid(openid);
|
userInfoVO.setOpenid(openid);
|
||||||
userInfoVO.setUnionId(unionId);
|
userInfoVO.setUnionId(unionId);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.cool.store.entity.HyOpenAreaInfoDO;
|
|||||||
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.IDCardSideEnum;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||||
@@ -205,7 +206,7 @@ public class TestController {
|
|||||||
@ApiOperation("根据身份证正面解析获取数据")
|
@ApiOperation("根据身份证正面解析获取数据")
|
||||||
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl){
|
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl){
|
||||||
try {
|
try {
|
||||||
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl);
|
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl, IDCardSideEnum.FACE);
|
||||||
return ResponseResult.success(identityCardInfo);
|
return ResponseResult.success(identityCardInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package com.cool.store.controller;
|
package com.cool.store.controller;
|
||||||
|
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.IDCardSideEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.BaseUserInfoRequest;
|
import com.cool.store.request.BaseUserInfoRequest;
|
||||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||||
import com.cool.store.request.PartnerClerkInfoRequest;
|
import com.cool.store.request.PartnerClerkInfoRequest;
|
||||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.AliyunService;
|
import com.cool.store.service.*;
|
||||||
import com.cool.store.service.HyPartnerBaseInfoService;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.service.HyPartnerClerkService;
|
|
||||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
|
||||||
import com.cool.store.service.PartnerUserInfoService;
|
|
||||||
import com.cool.store.vo.*;
|
import com.cool.store.vo.*;
|
||||||
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -23,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,18 +38,18 @@ public class PartnerController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PartnerUserInfoService partnerUserInfoService;
|
private PartnerUserInfoService partnerUserInfoService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
private HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AliyunService aliyunService;
|
private AliyunService aliyunService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private HyPartnerBaseInfoService hyPartnerBaseInfoService;
|
private HyPartnerBaseInfoService hyPartnerBaseInfoService;
|
||||||
@Resource
|
@Resource
|
||||||
private HyPartnerClerkService hyPartnerClerkService;
|
private HyPartnerClerkService hyPartnerClerkService;
|
||||||
|
@Resource
|
||||||
|
private HyPartnerLineInfoService hyPartnerLineInfoService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtilPool redisUtilPool;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -76,8 +76,8 @@ public class PartnerController {
|
|||||||
})
|
})
|
||||||
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
|
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
|
||||||
|
|
||||||
|
Long lineId = hyPartnerBaseInfoService.getLineIdByIdCard(idCard);
|
||||||
return ResponseResult.success();
|
return ResponseResult.success(lineId != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -133,18 +133,21 @@ public class PartnerController {
|
|||||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(path = "/getPartnerLineBaseInfo")
|
@GetMapping(path = "/getPartnerLineBaseInfo")
|
||||||
@ApiOperation("查询加盟商线索详情(适用全部流程) 包括冷静期是否首次登录")
|
@ApiOperation("查询加盟商线索详情(适用全部流程) 包括冷静期是否首次登录")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "partnerId", value = "C端用户基本信息ID", required = false),
|
@ApiImplicitParam(name = "partnerId", value = "C端用户基本信息ID", required = false),
|
||||||
})
|
})
|
||||||
public ResponseResult<PartnerLineBaseInfoVO> getPartnerLinBaseInfo(@RequestParam(value = "partnerId",required = false)Long partnerId){
|
public ResponseResult<PartnerLineBaseInfoVO> getPartnerLinBaseInfo(@RequestParam(value = "partnerId",required = false)String partnerId){
|
||||||
|
return ResponseResult.success(hyPartnerLineInfoService.getPartnerLinBaseInfo(partnerId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(path = "/delCoolDownFirstLoginFlag")
|
||||||
return ResponseResult.success();
|
@ApiOperation("删除冷静期是否首次登录缓存")
|
||||||
|
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "partnerId",required = true)String partnerId){
|
||||||
|
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, partnerId);
|
||||||
|
redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey);
|
||||||
|
return ResponseResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -208,9 +211,9 @@ public class PartnerController {
|
|||||||
|
|
||||||
@GetMapping(path = "/getIdentityCardInfo")
|
@GetMapping(path = "/getIdentityCardInfo")
|
||||||
@ApiOperation("根据身份证正面解析获取数据")
|
@ApiOperation("根据身份证正面解析获取数据")
|
||||||
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl){
|
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl, @RequestParam("side")IDCardSideEnum sideEnum){
|
||||||
try {
|
try {
|
||||||
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl);
|
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl, sideEnum);
|
||||||
return ResponseResult.success(identityCardInfo);
|
return ResponseResult.success(identityCardInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
||||||
|
|||||||
Reference in New Issue
Block a user