|
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import me.zhengjie.annotation.rest.AnonymousGetMapping;
|
|
|
import me.zhengjie.annotation.rest.AnonymousPostMapping;
|
|
|
+import me.zhengjie.appapi.config.TencentHumanFaceVerify;
|
|
|
import me.zhengjie.appapi.dto.FileInfoDto;
|
|
|
import me.zhengjie.appapi.dto.OrderDetailDto;
|
|
|
import me.zhengjie.appapi.dto.OrderDto;
|
|
|
@@ -34,6 +35,7 @@ import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 银行端的登录接口
|
|
|
+ *
|
|
|
* @author auas
|
|
|
*
|
|
|
*/
|
|
|
@@ -58,8 +60,14 @@ public class ApiBankController extends BaseController {
|
|
|
OrderService orderService;
|
|
|
@Autowired
|
|
|
OrderFileRepository orderFileRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ TencentHumanFaceVerify faceVerify;
|
|
|
+ @Autowired
|
|
|
+ UserAXQInfoService userAXQInfoService;
|
|
|
/**
|
|
|
* 登录接口
|
|
|
+ *
|
|
|
* @param loginVo
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -146,9 +154,9 @@ public class ApiBankController extends BaseController {
|
|
|
return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
}
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("id",id);
|
|
|
+ map.put("id", id);
|
|
|
BaseResponse response = mortgageService.mortgageInfo(map);
|
|
|
- OrderDetailDto detailDto = (OrderDetailDto)response.getData().getResult();
|
|
|
+ OrderDetailDto detailDto = (OrderDetailDto) response.getData().getResult();
|
|
|
return ResponseDTO.success(detailDto);
|
|
|
}
|
|
|
|
|
|
@@ -165,14 +173,15 @@ public class ApiBankController extends BaseController {
|
|
|
return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
}
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("id",id);
|
|
|
+ map.put("id", id);
|
|
|
BaseResponse response = guaranteeService.guaranteeInfo(map);
|
|
|
- OrderDetailDto detailDto = (OrderDetailDto)response.getData().getResult();
|
|
|
+ OrderDetailDto detailDto = (OrderDetailDto) response.getData().getResult();
|
|
|
return ResponseDTO.success(detailDto);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提交订单
|
|
|
+ *
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -219,21 +228,10 @@ public class ApiBankController extends BaseController {
|
|
|
log.info("文件上传结果返回:" + fileDtos);
|
|
|
return ResponseDTO.success(fileDtos);
|
|
|
}
|
|
|
- //人脸核身
|
|
|
- @RequestMapping("/order/getFaceId")
|
|
|
- public ResponseDTO<?> getFaceId(@RequestBody String json) throws Exception {
|
|
|
|
|
|
- JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
- String orderId = jsonObj.getString("orderId");
|
|
|
- if (StringUtils.isEmpty(orderId)) {
|
|
|
- return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
- }
|
|
|
- OrderDto order = this.apiService.getOrderDetail(orderId);
|
|
|
- JSONObject str = SdkTest.getFaceId(order.getUsername(), order.getIdCard(), orderId);
|
|
|
- return ResponseDTO.success(str);
|
|
|
- }
|
|
|
/**
|
|
|
* 获取借款人信息
|
|
|
+ *
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -245,9 +243,9 @@ public class ApiBankController extends BaseController {
|
|
|
return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
}
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("id",id);
|
|
|
+ map.put("id", id);
|
|
|
BaseResponse response = borrowerService.borrowerInfo(map);
|
|
|
- OrderDetailDto detailDto = (OrderDetailDto)response.getData().getResult();
|
|
|
+ OrderDetailDto detailDto = (OrderDetailDto) response.getData().getResult();
|
|
|
return ResponseDTO.success(detailDto);
|
|
|
}
|
|
|
|
|
|
@@ -275,6 +273,12 @@ public class ApiBankController extends BaseController {
|
|
|
return ResponseDTO.success(json);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 订单列表
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("/order/list")
|
|
|
public ResponseDTO<?> getOrderList(@RequestBody String json) {
|
|
|
|
|
|
@@ -285,11 +289,17 @@ public class ApiBankController extends BaseController {
|
|
|
|
|
|
Integer size = Integer.MAX_VALUE;
|
|
|
|
|
|
- List<OrderEntity> list = borrowerService.getOrderList(phone,status, startIndex, size);
|
|
|
+ List<OrderEntity> list = borrowerService.getOrderList(phone, status, startIndex, size);
|
|
|
|
|
|
return ResponseDTO.success(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 得到抵押人,借款人,担保人订单
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("/sub/order/list")
|
|
|
public ResponseDTO<?> getSubOrderList(@RequestBody String json) {
|
|
|
|
|
|
@@ -298,11 +308,12 @@ public class ApiBankController extends BaseController {
|
|
|
String status = jsonObj.getString("status");
|
|
|
Integer startIndex = 1;
|
|
|
Integer size = Integer.MAX_VALUE;
|
|
|
- List<OrderDto> list = borrowerService.getSubOrderList(phone,status, startIndex, size);
|
|
|
+ List<OrderDto> list = borrowerService.getSubOrderList(phone, status, startIndex, size);
|
|
|
|
|
|
return ResponseDTO.success(list);
|
|
|
}
|
|
|
|
|
|
+ // 得到公证书
|
|
|
@RequestMapping("/getNotarization")
|
|
|
public ResponseDTO<?> getNotarization(@RequestBody String json) {
|
|
|
JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
@@ -311,6 +322,7 @@ public class ApiBankController extends BaseController {
|
|
|
return ResponseDTO.success(orderFile.getSignedPdfUrl());
|
|
|
}
|
|
|
|
|
|
+ // ocr解析
|
|
|
@RequestMapping("/orderOCRParser")
|
|
|
public ResponseDTO<?> orderOCRParser(@RequestBody String json) {
|
|
|
JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
@@ -322,4 +334,115 @@ public class ApiBankController extends BaseController {
|
|
|
}
|
|
|
return ResponseDTO.success(object);
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping("/axqRegister")
|
|
|
+ public ResponseDTO<?> axqRegister(@RequestBody String json) {
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String idCard = jsonObj.getString("idCard");
|
|
|
+ String phone = jsonObj.getString("phone");
|
|
|
+ String name = jsonObj.getString("name");
|
|
|
+ if (StringUtils.isEmpty(idCard) || StringUtils.isEmpty(phone) || StringUtils.isEmpty(name)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ return userAXQInfoService.registAXQUser(idCard, phone, name);
|
|
|
+ }
|
|
|
+ // 人脸核身
|
|
|
+ @RequestMapping("/order/getFaceId")
|
|
|
+ public ResponseDTO<?> getFaceId(@RequestBody String json) throws Exception {
|
|
|
+
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String orderId = jsonObj.getString("orderId");
|
|
|
+ if (StringUtils.isEmpty(orderId)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ OrderDto order = this.apiBankService.getOrderDetail(orderId);
|
|
|
+ JSONObject str = SdkTest.getFaceId(faceVerify.getBankWebankAppId(), faceVerify.getBankSecret(),
|
|
|
+ faceVerify.getBankKeyLicence(), order.getUsername(), order.getIdCard(), orderId);
|
|
|
+ return ResponseDTO.success(str);
|
|
|
+ }
|
|
|
+ @AnonymousPostMapping("/video/call")
|
|
|
+ public ResponseDTO<?> videoCall(@RequestBody String json) {
|
|
|
+ return this.apiBankService.videoCall(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/order/pdf")
|
|
|
+ public ResponseDTO<?> getOrderPDF(@RequestBody String json) {
|
|
|
+
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String orderId = jsonObj.getString("orderId");
|
|
|
+ if (StringUtils.isEmpty(orderId)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ ResponseDTO<?> order = this.apiBankService.getOrderPDF(orderId);
|
|
|
+
|
|
|
+ return order;
|
|
|
+ }
|
|
|
+ @AnonymousPostMapping("/order/note")
|
|
|
+ public ResponseDTO<?> note(@RequestBody String json) {
|
|
|
+
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String orderId = jsonObj.getString("orderId");
|
|
|
+ if (StringUtils.isEmpty(orderId)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ //
|
|
|
+ OrderFileEntity orderFile = orderFileRepository.getOrderNote(orderId);
|
|
|
+ // pdf的地址预览
|
|
|
+ String noteUrl = FileUploadUtil.getPreviewUrl(orderFile.getHtmlUrl());
|
|
|
+
|
|
|
+ return ResponseDTO.success(noteUrl);
|
|
|
+ }
|
|
|
+ @RequestMapping("/sendAuthMessage")
|
|
|
+ public ResponseDTO<?> sendAuthMessage(@RequestBody String json) {
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String idCard = jsonObj.getString("idCard");
|
|
|
+ if (StringUtils.isEmpty(idCard)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ return userAXQInfoService.sendAuthMessage(idCard);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/verifyAuthMessage")
|
|
|
+ public ResponseDTO<?> verifyAuthMessage(@RequestBody String json) {
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String idCard = jsonObj.getString("idCard");
|
|
|
+ String checkCode = jsonObj.getString("checkCode");
|
|
|
+ if (StringUtils.isEmpty(idCard) || StringUtils.isEmpty(checkCode)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ return userAXQInfoService.verifyAuthMessage(idCard, checkCode);
|
|
|
+ }
|
|
|
+ @RequestMapping("/order/updateStatus")
|
|
|
+ public ResponseDTO<?> updateOrderStatus(@RequestBody String json) throws Exception {
|
|
|
+
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String orderId = jsonObj.getString("orderId");
|
|
|
+ if (StringUtils.isEmpty(orderId)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ orderService.updateOrderStatus(orderId);
|
|
|
+
|
|
|
+ return ResponseDTO.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/getAuthStatus")
|
|
|
+ public ResponseDTO<?> getAuthStatus(@RequestBody String json) {
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String idCard = jsonObj.getString("idCard");
|
|
|
+ if (StringUtils.isEmpty(idCard)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ return userAXQInfoService.getAuthStatus(idCard);
|
|
|
+ }
|
|
|
+ @AnonymousPostMapping("/uploadSeal")
|
|
|
+ public ResponseDTO<?> uploadSeal(@RequestBody String json) {
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(json);
|
|
|
+ String idCard = jsonObj.getString("idCard");
|
|
|
+ String contractId = jsonObj.getString("contractId");
|
|
|
+ String content = jsonObj.getString("content");
|
|
|
+ if (StringUtils.isEmpty(idCard) || StringUtils.isEmpty(contractId) || StringUtils.isEmpty(content)) {
|
|
|
+ return ResponseDTO.error(ResultCode.PARAM_IS_BLANK);
|
|
|
+ }
|
|
|
+ return userAXQInfoService.uploadSeal(idCard, contractId, content);
|
|
|
+ }
|
|
|
}
|