Quellcode durchsuchen

ocr集成 word模板 签名集成

xiao-xx vor 1 Jahr
Ursprung
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<>();
 //        map.put("selfApply",selfApply);
         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);
-        String fileName = UUID.randomUUID().toString().replaceAll("-","")+".doc";
+        String fileName = UUID.randomUUID().toString().replaceAll("-","")+".docx";
         PrintWriter pw = new PrintWriter(new File(f1,  fileName));
         template.process(map, pw);//合并  map:数据模型  pw:输出流对象
         pw.close();//关闭流
@@ -217,8 +216,8 @@ public class RlzyApplyPrintController extends BaseController {
         int licenseNumber = 0;
         int licenseCode = 0;
         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{
             rlzyApply = new RlzyApply();
         }

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

@@ -532,13 +532,15 @@
             </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>
             </div>
+        </div>
 
 
     </article>
@@ -598,7 +600,6 @@
         var Url = getRootPath_web();
         console.log(Url+$("#printFilePath").val())
         Toast('', '打印指定网页文件');
-        Toast('打印指定网页文件.....');
         module_printer.print_webpage2(
             Url+$("#printFilePath").val(),
             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() {
         $("#content1").hide()
         $("#content3").show()
@@ -640,6 +654,7 @@
         $.ajax({
             url: prefix+"/getOcrJson",
             type:"post",
+            // data: {"fileBase64":$("#baseFile").val()},
             data: {"fileBase64":"/profile/upload/aaaa.jpg"},
             beforeSend:function(){
                 cl_closeidA4photos();
@@ -686,24 +701,26 @@
                 dataType: 'json',
                 success: function (result) {
                     $('#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)
+                                }
                             }
-                        }
-                    })
+                        })
+                    }
                 }
             });
 

Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 281
yinet-admin/src/main/resources/templates/wordtemplates/cns.ftl