Browse Source

ocr集成 word模板 签名集成

xiao-xx 1 year ago
parent
commit
e9d3b8209d

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

@@ -128,11 +128,10 @@ public class RlzyApplyPrintController extends BaseController {
         HashMap<String, Object> map = new HashMap<>();
         HashMap<String, Object> map = new HashMap<>();
 //        map.put("selfApply",selfApply);
 //        map.put("selfApply",selfApply);
         String imageToBase64 = Base64ImgUtils.ImageToBase64(Global.getProfile() + "" + (rlzyApply.getQianming().replace("/profile", "")));
         String imageToBase64 = Base64ImgUtils.ImageToBase64(Global.getProfile() + "" + (rlzyApply.getQianming().replace("/profile", "")));
-        rlzyApply.setQianming( imageToBase64.replace("data:image/jpeg;base64,",""));
+        map.put("qianming", imageToBase64.replace("data:image/jpeg;base64,",""));
 
 
-        map.put("sqsj",DateUtils.dateTime("yyyy年MM月dd日", String.valueOf(rlzyApply.getCreateTime())));
         map.put("printJson", rlzyApply);
         map.put("printJson", rlzyApply);
-        String fileName = UUID.randomUUID().toString().replaceAll("-","")+".doc";
+        String fileName = UUID.randomUUID().toString().replaceAll("-","")+".docx";
         PrintWriter pw = new PrintWriter(new File(f1,  fileName));
         PrintWriter pw = new PrintWriter(new File(f1,  fileName));
         template.process(map, pw);//合并  map:数据模型  pw:输出流对象
         template.process(map, pw);//合并  map:数据模型  pw:输出流对象
         pw.close();//关闭流
         pw.close();//关闭流
@@ -217,8 +216,8 @@ public class RlzyApplyPrintController extends BaseController {
         int licenseNumber = 0;
         int licenseNumber = 0;
         int licenseCode = 0;
         int licenseCode = 0;
         if(rlzyApply != null){
         if(rlzyApply != null){
-             licenseNumber = Integer.valueOf(rlzyApply.getLicenseNumber()).intValue();
-             licenseCode = Integer.valueOf(rlzyApply.getLicenseCode()).intValue();
+            licenseNumber = Integer.valueOf(rlzyApply.getLicenseNumber()).intValue();
+            licenseCode = Integer.valueOf(rlzyApply.getLicenseCode()).intValue();
         }else{
         }else{
             rlzyApply = new RlzyApply();
             rlzyApply = new RlzyApply();
         }
         }

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

@@ -532,13 +532,15 @@
             </div>
             </div>
 
 
         </div>
         </div>
-            <div class="content4">
-                <input id="printFilePath" value="" type="hidden">
-                <a style="    font-size: 25px; font-weight: bolder;">请打印行政许可告知承诺书</a>
-                <button   class="btn btn-lg btn-success" type="button" onclick="printCns()" >
+        <div class="content4"  id="content4" style="display:none">
+            <input id="printFilePath" value="" type="hidden">
+            <div> <a style=" font-size: 25px; font-weight: bolder;  margin-left: 41%; margin-top: 5%;">请打印行政许可告知承诺书</a></div>
+            <div>
+                <button  style="width:350px;  margin-left: 40%; margin-top: 5%;"  class="btn btn-lg btn-success" type="button" onclick="printCns()" >
                     打印行政许可告知承诺书
                     打印行政许可告知承诺书
                 </button>
                 </button>
             </div>
             </div>
+        </div>
 
 
 
 
     </article>
     </article>
@@ -598,7 +600,6 @@
         var Url = getRootPath_web();
         var Url = getRootPath_web();
         console.log(Url+$("#printFilePath").val())
         console.log(Url+$("#printFilePath").val())
         Toast('', '打印指定网页文件');
         Toast('', '打印指定网页文件');
-        Toast('打印指定网页文件.....');
         module_printer.print_webpage2(
         module_printer.print_webpage2(
             Url+$("#printFilePath").val(),
             Url+$("#printFilePath").val(),
             1,     //打印数量
             1,     //打印数量
@@ -611,6 +612,19 @@
 
 
 
 
     }
     }
+
+    function getRootPath_web() {
+        //获取当前网址
+        var curWwwPath = window.document.location.href;
+        //获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
+        var pathName = window.document.location.pathname;
+        var pos = curWwwPath.indexOf(pathName);
+        //获取主机地址,如: http://localhost:8083
+        var localhostPaht = curWwwPath.substring(0, pos);
+        //获取带"/"的项目名,如:/uimcardprj
+        // var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
+        return (localhostPaht);
+    }
     function toQianming() {
     function toQianming() {
         $("#content1").hide()
         $("#content1").hide()
         $("#content3").show()
         $("#content3").show()
@@ -640,6 +654,7 @@
         $.ajax({
         $.ajax({
             url: prefix+"/getOcrJson",
             url: prefix+"/getOcrJson",
             type:"post",
             type:"post",
+            // data: {"fileBase64":$("#baseFile").val()},
             data: {"fileBase64":"/profile/upload/aaaa.jpg"},
             data: {"fileBase64":"/profile/upload/aaaa.jpg"},
             beforeSend:function(){
             beforeSend:function(){
                 cl_closeidA4photos();
                 cl_closeidA4photos();
@@ -686,24 +701,26 @@
                 dataType: 'json',
                 dataType: 'json',
                 success: function (result) {
                 success: function (result) {
                     $('#qianming').val(result.fileName)
                     $('#qianming').val(result.fileName)
-
-
-                    var creditCode = $('#creditCode').val()
-                    console.log(creditCode)
-                    $.ajax({
-                        url: prefix + "/add",
-                        method: 'post',
-                        data: $('#form-file-add').serialize(),
-                        success: function (res) {
-                            if(res.code=="0"){
-                                $("#printFilePath").val(res.data)
-                                alert("提交成功")
-
-                            }else {
-                                alert(res.msg)
+                    if($("#qianming").val().indexOf("/profile")!=-1){
+                        var creditCode = $('#creditCode').val()
+                        console.log(creditCode)
+                        $.ajax({
+                            url: prefix + "/add",
+                            method: 'post',
+                            data: $('#form-file-add').serialize(),
+                            success: function (res) {
+                                if(res.code=="0"){
+                                    $("#printFilePath").val(res.data)
+                                    alert("提交成功")
+                                    $("#content3").hide()
+                                    $("#content4").show()
+
+                                }else {
+                                    alert(res.msg)
+                                }
                             }
                             }
-                        }
-                    })
+                        })
+                    }
                 }
                 }
             });
             });
 
 

File diff suppressed because it is too large
+ 2 - 281
yinet-admin/src/main/resources/templates/wordtemplates/cns.ftl