Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -44,11 +44,10 @@ public enum ErrorCodeEnum {
|
|||||||
USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null),
|
USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null),
|
||||||
USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
|
USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
|
||||||
GET_INFO_ERROR(1021078, "获取信息异常", null),
|
GET_INFO_ERROR(1021078, "获取信息异常", null),
|
||||||
|
GET_PHONENUMBER_INFO_ERROR(1021079, "手机号归属地获取异常", null),
|
||||||
|
IDENTITY_CARD_PARSE_FAIL(1021080, "身份证解析失败", null),
|
||||||
|
|
||||||
|
|
||||||
PARAMS_REQUIRED(400002, "参数缺失!", null),
|
PARAMS_REQUIRED(400002, "参数缺失!", null),
|
||||||
|
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
||||||
|
|
||||||
|
|
||||||
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.dto.partner;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: DescribePhoneNumberDTO
|
||||||
|
* @Description:手机号归属
|
||||||
|
* @date 2023-06-15 20:07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DescribePhoneNumberDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("基础运营商")
|
||||||
|
public String basicCarrier;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际运营商")
|
||||||
|
public String carrier;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否携号转网")
|
||||||
|
public Boolean isNumberPortability;
|
||||||
|
|
||||||
|
@ApiModelProperty("号码归属号段")
|
||||||
|
public Long numberSegment;
|
||||||
|
|
||||||
|
@ApiModelProperty("号码归属城市")
|
||||||
|
public String city;
|
||||||
|
|
||||||
|
@ApiModelProperty("号码归属省份")
|
||||||
|
public String province;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.vo.cuser;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: IdentityCardInfoVO
|
||||||
|
* @Description:
|
||||||
|
* @date 2023-06-16 10:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IdentityCardInfoVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("用户名")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String liveAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty("出生日期")
|
||||||
|
private String birthdate;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty("民族")
|
||||||
|
private String nation;
|
||||||
|
|
||||||
|
public IdentityCardInfoVO(String username, String liveAddress, String birthdate, String sex, String idCard, String nation) {
|
||||||
|
this.username = username;
|
||||||
|
this.liveAddress = liveAddress;
|
||||||
|
this.birthdate = birthdate;
|
||||||
|
this.sex = sex;
|
||||||
|
this.idCard = idCard;
|
||||||
|
this.nation = nation;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -130,6 +130,20 @@
|
|||||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:ons20190214:1.0.0" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:ons20190214:1.0.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:endpoint-util:0.0.6" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:endpoint-util:0.0.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.13.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.12" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:4.5.10" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.opentracing:opentracing-api:0.33.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.opentracing:opentracing-util:0.33.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.opentracing:opentracing-noop:0.33.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-kms:2.11.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||||
@@ -142,5 +156,17 @@
|
|||||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:ocr20191230:1.0.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:openplatform20191219:5.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-client:3.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-xml:0.1.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc-util:0.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc:0.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-util:1.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-fileform:0.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-array:0.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-number:0.0.3" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -68,6 +68,10 @@
|
|||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>dytnsapi20200217</artifactId>
|
<artifactId>dytnsapi20200217</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>ocr20191230</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -4,6 +4,7 @@ package com.cool.store.handler;
|
|||||||
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.error.ErrorResponse;
|
import com.cool.store.response.error.ErrorResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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;
|
||||||
@@ -15,23 +16,27 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|||||||
* @Description: 自定义异常处理
|
* @Description: 自定义异常处理
|
||||||
* @date 2023-06-13 19:42
|
* @date 2023-06-13 19:42
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class CustomExceptionHandler {
|
public class CustomExceptionHandler {
|
||||||
|
|
||||||
@ExceptionHandler(value = ServiceException.class)
|
@ExceptionHandler(value = ServiceException.class)
|
||||||
public ResponseEntity<ErrorResponse> handleCustomException(ServiceException e) {
|
public ResponseEntity<ErrorResponse> handleCustomException(ServiceException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = ApiException.class)
|
@ExceptionHandler(value = ApiException.class)
|
||||||
public ResponseEntity<ErrorResponse> handleCustomException(ApiException e) {
|
public ResponseEntity<ErrorResponse> handleCustomException(ApiException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = Exception.class)
|
@ExceptionHandler(value = Exception.class)
|
||||||
public ResponseEntity<ErrorResponse> handleException(Exception e) {
|
public ResponseEntity<ErrorResponse> handleException(Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
|
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
|
||||||
return new ResponseEntity<>(errorResponse, HttpStatus.INTERNAL_SERVER_ERROR);
|
return new ResponseEntity<>(errorResponse, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
||||||
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: AliyunService
|
||||||
|
* @Description:阿里云相关服务
|
||||||
|
* @date 2023-06-15 20:04
|
||||||
|
*/
|
||||||
|
public interface AliyunService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取手机号归属信息
|
||||||
|
* @param phoneNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
DescribePhoneNumberDTO getPhoneNumberAttribute(String phoneNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证正面获取信息
|
||||||
|
* @param faceImageUrl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.aliyun.dytnsapi20200217.Client;
|
||||||
|
import com.aliyun.dytnsapi20200217.models.DescribePhoneNumberOperatorAttributeRequest;
|
||||||
|
import com.aliyun.dytnsapi20200217.models.DescribePhoneNumberOperatorAttributeResponse;
|
||||||
|
import com.aliyun.ocr20191230.models.RecognizeIdentityCardResponse;
|
||||||
|
import com.aliyun.ocr20191230.models.RecognizeIdentityCardResponseBody;
|
||||||
|
import com.aliyun.tea.TeaException;
|
||||||
|
import com.aliyun.tea.TeaModel;
|
||||||
|
import com.aliyun.teaopenapi.models.Config;
|
||||||
|
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.service.AliyunService;
|
||||||
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: AliyunServiceImpl
|
||||||
|
* @Description:
|
||||||
|
* @date 2023-06-15 20:04
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class AliyunServiceImpl implements AliyunService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescribePhoneNumberDTO getPhoneNumberAttribute(String phoneNumber) {
|
||||||
|
try {
|
||||||
|
Config config = new Config();
|
||||||
|
//todo zcb ak sk替换
|
||||||
|
config.accessKeyId = "LTAI5t9RaXvABZbHvoXjDFJ1";
|
||||||
|
config.accessKeySecret = "zhOK7WWo3yGoUWkOMaatty19k25CMd";
|
||||||
|
Client client = new Client(config);
|
||||||
|
DescribePhoneNumberOperatorAttributeRequest request = new DescribePhoneNumberOperatorAttributeRequest();
|
||||||
|
request.authCode = "Y81FVZepk6";
|
||||||
|
request.inputNumber = phoneNumber;
|
||||||
|
request.mask = "NORMAL";
|
||||||
|
DescribePhoneNumberOperatorAttributeResponse response = client.describePhoneNumberOperatorAttribute(request);
|
||||||
|
String code = response.body.code;
|
||||||
|
if (!com.aliyun.teautil.Common.equalString(code, "OK")) {
|
||||||
|
log.error("错误信息:" , response.body.message + "");
|
||||||
|
throw new ServiceException(ErrorCodeEnum.GET_PHONENUMBER_INFO_ERROR);
|
||||||
|
}
|
||||||
|
return JSONObject.parseObject(JSONObject.toJSONString(response.body.data), DescribePhoneNumberDTO.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取手机号异常:", e);
|
||||||
|
throw new ServiceException(ErrorCodeEnum.GET_PHONENUMBER_INFO_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl) {
|
||||||
|
//todo zcb ak sk替换
|
||||||
|
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||||
|
.setAccessKeyId("LTAI5t9RaXvABZbHvoXjDFJ1")
|
||||||
|
.setAccessKeySecret("zhOK7WWo3yGoUWkOMaatty19k25CMd");
|
||||||
|
// 访问的域名
|
||||||
|
config.endpoint = "ocr.cn-shanghai.aliyuncs.com";
|
||||||
|
try {
|
||||||
|
com.aliyun.ocr20191230.Client client = new com.aliyun.ocr20191230.Client(config);
|
||||||
|
URL url = new URL(faceImageUrl);
|
||||||
|
InputStream inputStream = url.openConnection().getInputStream();
|
||||||
|
com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest recognizeIdentityCardAdvanceRequest = new com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest()
|
||||||
|
.setImageURLObject(inputStream)
|
||||||
|
.setSide("face");
|
||||||
|
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||||
|
RecognizeIdentityCardResponse idCardResponse = client.recognizeIdentityCardAdvance(recognizeIdentityCardAdvanceRequest, runtime);
|
||||||
|
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);
|
||||||
|
String username = frontResult.name;
|
||||||
|
String liveAddress = frontResult.address;
|
||||||
|
String birthdate = frontResult.birthDate;
|
||||||
|
if(StringUtils.isNotBlank(birthdate)){
|
||||||
|
birthdate = convertDate(birthdate, "yyyyMMdd");
|
||||||
|
}
|
||||||
|
String sex = frontResult.gender;
|
||||||
|
String idCard = frontResult.IDNumber;
|
||||||
|
String nation = frontResult.nationality;
|
||||||
|
IdentityCardInfoVO result = new IdentityCardInfoVO(username, liveAddress, birthdate, sex, idCard, nation);
|
||||||
|
log.info("身份证解析:{}", JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
} catch (com.aliyun.tea.TeaException e) {
|
||||||
|
log.error("身份证解析报错TeaException:{}", e);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
log.error("身份证解析报错MalformedURLException:{}", e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("身份证解析报错IOException:{}", e);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("身份证解析报错Exception:{}", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String convertDate(String date, String format) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||||
|
LocalDate localDate = LocalDate.parse(date, formatter);
|
||||||
|
return localDate.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.DATA_CONVERT_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -107,6 +107,18 @@
|
|||||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:ocr20191230:1.0.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:openplatform20191219:5.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-client:3.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-xml:0.1.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc-util:0.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc:0.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-util:1.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-fileform:0.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-array:0.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-number:0.0.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
package com.cool.store.controller;
|
package com.cool.store.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
|
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
|
||||||
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
|
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
|
||||||
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
||||||
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
|
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
|
||||||
|
import com.cool.store.dto.partner.DescribePhoneNumberDTO;
|
||||||
import com.cool.store.dto.response.ResultDTO;
|
import com.cool.store.dto.response.ResultDTO;
|
||||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.enums.RocketMqTagEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||||
import com.cool.store.http.ISVHttpRequest;
|
import com.cool.store.http.ISVHttpRequest;
|
||||||
import com.cool.store.mq.producer.SimpleMessageService;
|
|
||||||
import com.cool.store.request.AllocationInvestmentManagerRequest;
|
|
||||||
import com.cool.store.request.City;
|
import com.cool.store.request.City;
|
||||||
import com.cool.store.request.TestRequest;
|
import com.cool.store.request.TestRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.AliyunService;
|
||||||
import com.cool.store.service.EnterpriseSyncService;
|
import com.cool.store.service.EnterpriseSyncService;
|
||||||
import com.cool.store.service.EnterpriseUserService;
|
import com.cool.store.service.EnterpriseUserService;
|
||||||
import com.cool.store.utils.UUIDUtils;
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -43,9 +46,13 @@ public class TestController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ISVHttpRequest isvHttpRequest;
|
private ISVHttpRequest isvHttpRequest;
|
||||||
@Resource
|
@Resource
|
||||||
HyOpenAreaInfoMapper hyOpenAreaInfoMapper;
|
private HyOpenAreaInfoMapper hyOpenAreaInfoMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private EnterpriseSyncService enterpriseSyncService;
|
private EnterpriseSyncService enterpriseSyncService;
|
||||||
|
@Resource
|
||||||
|
private EnterpriseUserDAO enterpriseUserDAO;
|
||||||
|
@Resource
|
||||||
|
private AliyunService aliyunService;
|
||||||
|
|
||||||
@PostMapping("/post")
|
@PostMapping("/post")
|
||||||
public ResponseResult<Boolean> get(@RequestBody List<TestRequest> testRequestList){
|
public ResponseResult<Boolean> get(@RequestBody List<TestRequest> testRequestList){
|
||||||
@@ -186,4 +193,22 @@ public class TestController {
|
|||||||
return ResultDTO.successResult(isvHttpRequest.deleteUserCalendarEvent(param));
|
return ResultDTO.successResult(isvHttpRequest.deleteUserCalendarEvent(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/user/getUserCalendarsEvents")
|
||||||
|
public ResultDTO<List<UserCalendarsEventDTO>> getUserCalendarsEvents(@RequestParam("userId") String userId, @RequestParam("startTime") long startTime,
|
||||||
|
@RequestParam("endTime") long endTime) throws ApiException {
|
||||||
|
log.info("getUserCalendarsEvents : corpId:{}, appType:{}, userId:{}, startTime:{}, endTime:{}", userId, startTime, endTime);
|
||||||
|
return ResultDTO.successResult(isvHttpRequest.getUserCalendarsEvents(userId, startTime, endTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/getIdentityCardInfo")
|
||||||
|
@ApiOperation("根据身份证正面解析获取数据")
|
||||||
|
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl){
|
||||||
|
try {
|
||||||
|
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl);
|
||||||
|
return ResponseResult.success(identityCardInfo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,18 @@
|
|||||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:dytnsapi20200217:1.0.28" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:ocr20191230:1.0.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:openplatform20191219:5.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-client:3.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-xml:0.1.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc-util:0.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-rpc:0.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:oss-util:1.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:tea-fileform:0.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-array:0.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.aliyun:darabonba-number:0.0.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
package com.cool.store.controller;
|
package com.cool.store.controller;
|
||||||
|
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
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.HyPartnerBaseInfoService;
|
import com.cool.store.service.HyPartnerBaseInfoService;
|
||||||
import com.cool.store.service.HyPartnerClerkService;
|
import com.cool.store.service.HyPartnerClerkService;
|
||||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
import com.cool.store.service.HyPartnerIntentInfoService;
|
||||||
import com.cool.store.service.PartnerUserInfoService;
|
import com.cool.store.service.PartnerUserInfoService;
|
||||||
import com.cool.store.vo.*;
|
import com.cool.store.vo.*;
|
||||||
|
import com.cool.store.vo.cuser.IdentityCardInfoVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@@ -36,12 +40,15 @@ public class PartnerController {
|
|||||||
private PartnerUserInfoService partnerUserInfoService;
|
private PartnerUserInfoService partnerUserInfoService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
private HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerBaseInfoService hyPartnerBaseInfoService;
|
private AliyunService aliyunService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerClerkService hyPartnerClerkService;
|
private HyPartnerBaseInfoService hyPartnerBaseInfoService;
|
||||||
|
@Resource
|
||||||
|
private HyPartnerClerkService hyPartnerClerkService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -198,4 +205,16 @@ public class PartnerController {
|
|||||||
return ResponseResult.success(partnerUserInfoService.queryJoinNotice(partnerId));
|
return ResponseResult.success(partnerUserInfoService.queryJoinNotice(partnerId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/getIdentityCardInfo")
|
||||||
|
@ApiOperation("根据身份证正面解析获取数据")
|
||||||
|
public ResponseResult<IdentityCardInfoVO> getIdentityCardInfo(@RequestParam(value = "faceImageUrl")String faceImageUrl){
|
||||||
|
try {
|
||||||
|
IdentityCardInfoVO identityCardInfo = aliyunService.getIdentityCardInfo(faceImageUrl);
|
||||||
|
return ResponseResult.success(identityCardInfo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.IDENTITY_CARD_PARSE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
5
pom.xml
5
pom.xml
@@ -181,6 +181,11 @@
|
|||||||
<artifactId>dytnsapi20200217</artifactId>
|
<artifactId>dytnsapi20200217</artifactId>
|
||||||
<version>1.0.28</version>
|
<version>1.0.28</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>ocr20191230</artifactId>
|
||||||
|
<version>1.0.26</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user