Pārlūkot izejas kodu

ocr集成 word模板 签名集成

xiao-xx 1 gadu atpakaļ
vecāks
revīzija
4f2c7cfcee

+ 4 - 4
yinet-admin/pom.xml

@@ -83,13 +83,13 @@
                 </includes>
                 &lt;!&ndash; <filtering>false</filtering>&ndash;&gt;
             </resource>-->
-            <resource>
-                <directory>src/main/resources</directory><!--资源文件的路径-->
+           <!-- <resource>
+                <directory>src/main/resources</directory>&lt;!&ndash;资源文件的路径&ndash;&gt;
                 <includes>
                     <include>**/*.*</include>
                 </includes>
-                <!-- <filtering>false</filtering>-->
-            </resource>
+                &lt;!&ndash; <filtering>false</filtering>&ndash;&gt;
+            </resource>-->
         </resources>
         <plugins>
             <plugin>

+ 1 - 1
yinet-admin/src/main/java/com/yinet/web/controller/rlzy/RlzyApplyPrintController.java

@@ -37,7 +37,7 @@ public class RlzyApplyPrintController extends BaseController {
     private ISelfServiceService selfServiceService;
 
 
-    private static  final String TEMPLATE_ID="ddcf414aee3efcaaa4a4a6788c03045a";
+    private static  final String TEMPLATE_ID="9b9345770988dec4089eb1cc636af3e5";
 
     @GetMapping("/secound/{type}")
     public String liucheng(@PathVariable String type,ModelMap mmap){

+ 3 - 3
yinet-admin/src/main/resources/application.yml

@@ -165,6 +165,6 @@ python:
 saomiao:
   der: E
 baiducloud:
-  appid: 17793460
-  apikey: jxcWdsiGEkgweUUj6yXW8EVg
-  secretkey: kjccupB9YH8ND0YLIqSK6aEx7CdDdP6e
+  appid: 28412951
+  apikey: 916dsWFfvBOndaN3Tx64rqOf
+  secretkey: EjK5krRRLCs3zU6FXBVFZYq28BnHutch

+ 6 - 6
yinet-admin/src/main/resources/templates/rlzy/print/apply.html

@@ -654,8 +654,8 @@
         $.ajax({
             url: prefix+"/getOcrJson",
             type:"post",
-            // data: {"fileBase64":$("#baseFile").val()},
-            data: {"fileBase64":"/profile/upload/aaaa.jpg"},
+            data: {"fileBase64":$("#baseFile").val()},
+            // data: {"fileBase64":"/profile/upload/aaaa.jpg"},
             beforeSend:function(){
                 cl_closeidA4photos();
                 $.modal.loading("智能识别中,请稍等...")
@@ -664,8 +664,8 @@
                 console.log(res)
                 $.modal.closeLoading()
                 if(res.code=="0"){
-                    $("input[name='name']").val(res.data['名称'])
-                    $("input[name='creditCode']").val(res.data['社会信用代码'])
+                    $("input[name='name']").val(res.data['公司名称'])
+                    $("input[name='creditCode']").val(res.data['统一社会信用代码'])
                     $("input[name='legalName']").val(res.data['法定代表人'])
                     $("input[name='servicePlace']").val(res.data['住所'])
                     $("#content1").show()
@@ -710,8 +710,8 @@
                             data: $('#form-file-add').serialize(),
                             success: function (res) {
                                 if(res.code=="0"){
-                                    $("#printFilePath").val(res.data)
-                                    alert("提交成功")
+                                    $("#printFilePath").val(res.msg)
+                                    $.modal.msgSuccess("提交成功")
                                     $("#content3").hide()
                                     $("#content4").show()
 

+ 2 - 2
yinet-admin/src/main/resources/templates/wordtemplates/cns.ftl

@@ -2880,7 +2880,7 @@
                                 <w:sz w:val="32"/>
                                 <w:szCs w:val="32"/>
                             </w:rPr>
-                            <w:t>${printJson.createTime}</w:t>
+                            <w:t>${printJson.createTime?string('yyyy年MM月dd日')!'-'}</w:t>
                         </w:r>
                         <w:r>
                             <w:rPr>
@@ -2939,7 +2939,7 @@
                                 <w:sz w:val="32"/>
                                 <w:szCs w:val="32"/>
                             </w:rPr>
-                            <w:t>${printJson.createTime!''}</w:t>
+                            <w:t>${printJson.createTime?string('yyyy年MM月dd日')!'-'}</w:t>
                         </w:r>
                         <w:r w:rsidR="00545C4E">
                             <w:rPr>

+ 1 - 0
yinet-system/src/main/java/com/yinet/rlzy/service/impl/RlzyApplyServiceImpl.java

@@ -83,6 +83,7 @@ public class RlzyApplyServiceImpl extends BaseServiceImpl<RlzyApply> implements
         String substring = fileBase64.replace("/profile",Global.getProfile());
 
         org.json.JSONObject custom = aipOcr.custom(substring, options);
+        System.out.println(custom.toString());
         if(custom.getString("error_msg")!=null && custom.getString("error_msg")!=""){
             if("未能匹配模板".equals(custom.getString("error_msg").toString())){
                 throw new RuntimeException("未能识别模板");