|
@@ -7,6 +7,7 @@ import com.google.zxing.common.HybridBinarizer;
|
|
|
import com.skyversation.xjcy.bean.User;
|
|
import com.skyversation.xjcy.bean.User;
|
|
|
import com.skyversation.xjcy.dms.DMSColumn;
|
|
import com.skyversation.xjcy.dms.DMSColumn;
|
|
|
import com.skyversation.xjcy.dms.DMSService;
|
|
import com.skyversation.xjcy.dms.DMSService;
|
|
|
|
|
+import com.skyversation.xjcy.service.AlyOCRService;
|
|
|
import com.skyversation.xjcy.service.AuthService;
|
|
import com.skyversation.xjcy.service.AuthService;
|
|
|
import com.skyversation.xjcy.service.WeChatService;
|
|
import com.skyversation.xjcy.service.WeChatService;
|
|
|
import com.skyversation.xjcy.util.MessageManage;
|
|
import com.skyversation.xjcy.util.MessageManage;
|
|
@@ -36,11 +37,13 @@ public class OtherController {
|
|
|
private final WeChatService weChatService;
|
|
private final WeChatService weChatService;
|
|
|
private final AuthService authService;
|
|
private final AuthService authService;
|
|
|
private final DMSService dMSService;
|
|
private final DMSService dMSService;
|
|
|
|
|
+ private final AlyOCRService alyOCRService;
|
|
|
|
|
|
|
|
- public OtherController(WeChatService weChatService, AuthService authService, DMSService dMSService) {
|
|
|
|
|
|
|
+ public OtherController(WeChatService weChatService, AuthService authService, DMSService dMSService, AlyOCRService alyOCRService) {
|
|
|
this.weChatService = weChatService;
|
|
this.weChatService = weChatService;
|
|
|
this.authService = authService;
|
|
this.authService = authService;
|
|
|
this.dMSService = dMSService;
|
|
this.dMSService = dMSService;
|
|
|
|
|
+ this.alyOCRService = alyOCRService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/wxacode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@RequestMapping(value = "/wxacode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@@ -105,4 +108,20 @@ public class OtherController {
|
|
|
return MessageManage.error(-1,"解析二维码失败");
|
|
return MessageManage.error(-1,"解析二维码失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(value ="/ocrBusinessLicense")
|
|
|
|
|
+ public String ocrBusinessLicense(
|
|
|
|
|
+ @RequestParam("file") MultipartFile file
|
|
|
|
|
+ ){
|
|
|
|
|
+ try {
|
|
|
|
|
+ InputStream inputStream = file.getInputStream();
|
|
|
|
|
+ Map<String,Object> result =alyOCRService.ocrBusinessLicense(inputStream);
|
|
|
|
|
+ if (result.isEmpty()){
|
|
|
|
|
+ return MessageManage.error(-1,"解析二维码失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ return MessageManage.success("成功",result.get("content"));
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return MessageManage.error(-1,"解析二维码失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|