Jelajahi Sumber

ocr集成 word模板 签名集成

xiao-xx 1 tahun lalu
induk
melakukan
4f2c7cfcee

+ 4 - 4
yinet-admin/pom.xml

@@ -83,13 +83,13 @@
                 </includes>
                 </includes>
                 &lt;!&ndash; <filtering>false</filtering>&ndash;&gt;
                 &lt;!&ndash; <filtering>false</filtering>&ndash;&gt;
             </resource>-->
             </resource>-->
-            <resource>
-                <directory>src/main/resources</directory><!--资源文件的路径-->
+           <!-- <resource>
+                <directory>src/main/resources</directory>&lt;!&ndash;资源文件的路径&ndash;&gt;
                 <includes>
                 <includes>
                     <include>**/*.*</include>
                     <include>**/*.*</include>
                 </includes>
                 </includes>
-                <!-- <filtering>false</filtering>-->
-            </resource>
+                &lt;!&ndash; <filtering>false</filtering>&ndash;&gt;
+            </resource>-->
         </resources>
         </resources>
         <plugins>
         <plugins>
             <plugin>
             <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 ISelfServiceService selfServiceService;
 
 
 
 
-    private static  final String TEMPLATE_ID="ddcf414aee3efcaaa4a4a6788c03045a";
+    private static  final String TEMPLATE_ID="9b9345770988dec4089eb1cc636af3e5";
 
 
     @GetMapping("/secound/{type}")
     @GetMapping("/secound/{type}")
     public String liucheng(@PathVariable String type,ModelMap mmap){
     public String liucheng(@PathVariable String type,ModelMap mmap){

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

@@ -165,6 +165,6 @@ python:
 saomiao:
 saomiao:
   der: E
   der: E
 baiducloud:
 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({
         $.ajax({
             url: prefix+"/getOcrJson",
             url: prefix+"/getOcrJson",
             type:"post",
             type:"post",
-            // data: {"fileBase64":$("#baseFile").val()},
-            data: {"fileBase64":"/profile/upload/aaaa.jpg"},
+            data: {"fileBase64":$("#baseFile").val()},
+            // data: {"fileBase64":"/profile/upload/aaaa.jpg"},
             beforeSend:function(){
             beforeSend:function(){
                 cl_closeidA4photos();
                 cl_closeidA4photos();
                 $.modal.loading("智能识别中,请稍等...")
                 $.modal.loading("智能识别中,请稍等...")
@@ -664,8 +664,8 @@
                 console.log(res)
                 console.log(res)
                 $.modal.closeLoading()
                 $.modal.closeLoading()
                 if(res.code=="0"){
                 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='legalName']").val(res.data['法定代表人'])
                     $("input[name='servicePlace']").val(res.data['住所'])
                     $("input[name='servicePlace']").val(res.data['住所'])
                     $("#content1").show()
                     $("#content1").show()
@@ -710,8 +710,8 @@
                             data: $('#form-file-add').serialize(),
                             data: $('#form-file-add').serialize(),
                             success: function (res) {
                             success: function (res) {
                                 if(res.code=="0"){
                                 if(res.code=="0"){
-                                    $("#printFilePath").val(res.data)
-                                    alert("提交成功")
+                                    $("#printFilePath").val(res.msg)
+                                    $.modal.msgSuccess("提交成功")
                                     $("#content3").hide()
                                     $("#content3").hide()
                                     $("#content4").show()
                                     $("#content4").show()
 
 

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

@@ -2880,7 +2880,7 @@
                                 <w:sz w:val="32"/>
                                 <w:sz w:val="32"/>
                                 <w:szCs w:val="32"/>
                                 <w:szCs w:val="32"/>
                             </w:rPr>
                             </w:rPr>
-                            <w:t>${printJson.createTime}</w:t>
+                            <w:t>${printJson.createTime?string('yyyy年MM月dd日')!'-'}</w:t>
                         </w:r>
                         </w:r>
                         <w:r>
                         <w:r>
                             <w:rPr>
                             <w:rPr>
@@ -2939,7 +2939,7 @@
                                 <w:sz w:val="32"/>
                                 <w:sz w:val="32"/>
                                 <w:szCs w:val="32"/>
                                 <w:szCs w:val="32"/>
                             </w:rPr>
                             </w:rPr>
-                            <w:t>${printJson.createTime!''}</w:t>
+                            <w:t>${printJson.createTime?string('yyyy年MM月dd日')!'-'}</w:t>
                         </w:r>
                         </w:r>
                         <w:r w:rsidR="00545C4E">
                         <w:r w:rsidR="00545C4E">
                             <w:rPr>
                             <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());
         String substring = fileBase64.replace("/profile",Global.getProfile());
 
 
         org.json.JSONObject custom = aipOcr.custom(substring, options);
         org.json.JSONObject custom = aipOcr.custom(substring, options);
+        System.out.println(custom.toString());
         if(custom.getString("error_msg")!=null && custom.getString("error_msg")!=""){
         if(custom.getString("error_msg")!=null && custom.getString("error_msg")!=""){
             if("未能匹配模板".equals(custom.getString("error_msg").toString())){
             if("未能匹配模板".equals(custom.getString("error_msg").toString())){
                 throw new RuntimeException("未能识别模板");
                 throw new RuntimeException("未能识别模板");