1
0

3 コミット 77894eb54c ... 8ed93813e0

作者 SHA1 メッセージ 日付
  lxp 8ed93813e0 扫描图片上传 1 年間 前
  lxp 61561778f2 Merge remote-tracking branch 'origin/master' 1 年間 前
  lxp 7bd170633a 打印 1 年間 前

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

@@ -5,6 +5,7 @@ import com.yinet.common.core.controller.BaseController;
 import com.yinet.common.core.domain.AjaxResult;
 import com.yinet.common.enums.BusinessType;
 import com.yinet.common.utils.DateUtils;
+import com.yinet.print.domain.SelfApply;
 import com.yinet.rlzy.domain.RlzyApply;
 import com.yinet.rlzy.service.IRlzyApplyService;
 import com.yinet.common.core.domain.AjaxResult;
@@ -16,6 +17,8 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @Controller
 @RequestMapping("/rlzy/print")
 public class RlzyApplyPrintController extends BaseController {
@@ -62,11 +65,43 @@ public class RlzyApplyPrintController extends BaseController {
         return prefix+"/dylist";
     }
     @GetMapping("/getByIdcard/{idcard}")
-    public AjaxResult getByIdcard(@PathVariable String idcard,ModelMap mmap)
+    @ResponseBody
+    public AjaxResult getByIdcard(@PathVariable String idcard)
     {
         RlzyApply rlzy = new RlzyApply();
         rlzy.setIdcard(idcard);
-        RlzyApply rlzyApply = rlzyApplyService.getOne(rlzy);
-        return AjaxResult.success(rlzyApply);
+        List<RlzyApply> rlzyApplies = rlzyApplyService.select(rlzy);
+        return AjaxResult.success(rlzyApplies);
+    }
+    @GetMapping("/getApplyById/{id}")
+    public String getApplyById(@PathVariable String id,ModelMap map)
+    {
+
+        RlzyApply rlzyApply = rlzyApplyService.getById(id);
+        map.addAttribute("rlzyApply",rlzyApply);
+        return prefix+"/mouban";
+    }
+    /**
+     * 列表数据
+     * @return
+     */
+    @PostMapping("/getSapplyData")
+    @ResponseBody
+    public AjaxResult getSapplyData(String id ){
+
+        return  AjaxResult.success(rlzyApplyService.getById(id));
+
+    }
+
+    /**
+     * 列表数据
+     * @return
+     */
+    @PostMapping("/updateApply")
+    @ResponseBody
+    public AjaxResult updateApply(Long applyId ){
+        RlzyApply build = RlzyApply.builder().remark("0").id(applyId).build();
+        return  AjaxResult.success(rlzyApplyService.updateById(build));
+
     }
 }

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

@@ -79,6 +79,12 @@
                     <input name="email" th:field="*{email}" class="form-control" type="text">
                 </div>
             </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">文件:</label>
+                <div class="col-sm-8">
+                    <img  th:src="*{file}" >
+                </div>
+            </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />

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

@@ -446,7 +446,7 @@
                                 <button class="btn btn-lg btn-success" onclick = "cl_openidA4photos(1,1)">打开高拍仪</button>
                                 <button class="btn btn-lg btn-warning" onclick = "cl_closeidA4photos()">关闭高拍仪</button>
                                 <button class="btn btn-lg btn-info" onclick="cl_takePhotos()">拍照</button>
-                                <button class="btn btn-lg btn-warning" onclick="submitHandler()">提交并关闭</button>
+                                <button class="btn btn-lg btn-warning" onclick="submit()">提交并关闭</button>
                                 <!--<button class="btn btn-lg btn-info">拍照</button>
                                 <button class="btn btn-lg btn-success">上传</button>
                                 <button class="btn btn-lg btn-warning">重置</button><button class="btn btn-lg btn-info">拍照</button>
@@ -509,12 +509,12 @@
 
         }
     }
-    function submitHandler() {
+    function submit() {
         if ($.validate.form()) {
             var creditCode = $('#creditCode').val()
             console.log(creditCode)
             $.operate.save( prefix+"/add", $('#form-file-add').serialize(),function(){
-                window.location.href="/rlzy/print/"+creditCode
+                window.location.href="/rlzy/print/secound/13"
             });
         }
 
@@ -552,7 +552,7 @@
             $("#idcard1").attr('style','color: red;font-size: 12px;display: block')
         }
     }
-    var formFileLg = document.querySelector("#formFileLg")
+    /*var formFileLg = document.querySelector("#formFileLg")
     formFileLg.onchange = function () {
         var formData = new FormData()
         formData.append("file",document.getElementById("formFileLg").files[0])
@@ -569,7 +569,7 @@
 
             }
         });
-    }
+    }*/
 </script>
 <script th:inline="javascript">
 
@@ -675,6 +675,21 @@
                     if (code == 0) {
                         Toast('res', '拍照成功');
                         addImage(image);
+                        var formData = getFileFromBase64(image,"人力资源设立.jpg");
+
+                        $.ajax({
+                            type: "post",
+                            url: ctx + "common/upload",
+                            data: formData,
+                            cache: false,
+                            contentType: false,
+                            processData: false,
+                            dataType: 'json',
+                            success: function (result) {
+                                console.log(result)
+                                $('#baseFile').val(result.fileName)
+                            }
+                        });
                     } else if (code == -1) {
                         Toast('errs', '摄像头未打开拍照失败');
                     } else {
@@ -687,6 +702,24 @@
 
     }
 
+    function getFileFromBase64 (data,fileName) {
+        var _base64 = "data:image/jpeg;base64," + data;
+        const dataArr = _base64.split(",");
+        const byteString = atob(dataArr[1]);
+        const options = {
+            type: "image/jpeg",
+            endings: "native"
+        };
+        const u8Arr = new Uint8Array(byteString.length);
+        for (let i = 0; i < byteString.length; i++) {
+            u8Arr[i] = byteString.charCodeAt(i);
+        }
+        let formData = new FormData();
+        let fileOfBlob = new File([u8Arr], fileName, options);//返回文件流
+        formData.append("file", fileOfBlob);
+        return formData
+    }
+
     function goBack() {
         history.go(-2);
     }

+ 15 - 29
yinet-admin/src/main/resources/templates/rlzy/print/dylist.html

@@ -46,8 +46,6 @@
 	<script src='/raio/Alert/js/alert.min.js'></script>
 	<script src='/raio/Alert/js/alert-api.js'></script>
     <script th:inline="javascript">
-        var type=[[${type}]];
-        var xydm=[[${xydm}]];
         var aid;
         var pid;
         //定义定时器
@@ -218,7 +216,7 @@
 							})
 							$("#print"+pid).text("已打印")
 							$.ajax({
-								url: "/zhuxiao/updateApply",
+								url: "/rlzy/print/updateApply",
 								type: "post",
 								dataType: "json",
 								data: {applyId: pid},
@@ -235,37 +233,32 @@
 		}
 
         function datalist(){
-        	var card=""
-        	if(xydm==''||xydm==undefined){
-
-				 card=getCookie("cardno")
-			}
+        	var card=getCookie("cardno")
             $.ajax({
                 url: "/rlzy/print/getByIdcard/"+card,
                 type: "get",
 				dataType: "json",
                 success: function(data) {
-                   /* console.log(data);
+                    console.log(data);
                     if(data.data.length==0){
 						$("#rowlist").append("<H1>暂无需要打印的信息。 </H1>")
 					}
                     for (let i = 0; i <data.data.length; i++) {
 						var dayin_hmtl=""
-						if(data.data[i].isprint=="1"|| data.data[i].isprint==1){
-							dayin_hmtl='<a class="btn btn-info btn-lg"  onclick="printPapers(\''+data.data[i].selfApplyId+'\')" id="print'+data.data[i].selfApplyId+'">打印</a>';
+						if(data.data[i].remark=="0"|| data.data[i].remark==0){
+							dayin_hmtl='<a class="btn btn-info btn-lg"  onclick="printPapers(\''+data.data[i].id+'\')" id="print'+data.data[i].id+'">打印</a>';
                         }else {
-							dayin_hmtl='<a class="btn btn-info btn-lg"  id="'+data.data[i].selfApplyId+'">已打印</a>'
+							dayin_hmtl='<a class="btn btn-info btn-lg"  id="'+data.data[i].id+'">已打印</a>'
                         }
                         $("#rowlist").append("  <div class=\"col-md-4\">\n" +
 								"                                <div class=\"thumbnail\">\n" +
 								"                                <div class=\"caption\">\n" +
-								"                                <h3>\n" +  data.data[i].serviceName +
-								"                                </h3>\n" +
+								"                                <h3>人力资源服务许可-设立 </h3>\n" +
 								"                                <p>\n" +
-								"                                企业名称:\n" +data.data[i].companyName+
+								"                                机构名称:\n" +data.data[i].name+
 								"                                </p>\n" +
 								"                                <p>\n" +
-										(data.data[i].name==null?"":"执照打印人:\n" +data.data[i].name)+
+										(data.data[i].legalName==null?"":"执照打印人:\n" +data.data[i].legalName)+
 								"                                </p>\n" +
 								"                                <p>\n" +
 								"                                \n" +dayin_hmtl+
@@ -273,7 +266,7 @@
 								"                                </div>\n" +
 								"                                </div>\n" +
 								"                                </div>");
-                    }*/
+                    }
 
                 }
 
@@ -282,14 +275,14 @@
         function printPapers (id){
         	var filepath="";
 			$.ajax({
-				url: "/zhuxiao/getSapplyData",
+				url: "/rlzy/print/getSapplyData",
 				type: "post",
 				dataType: "json",
 				data: {applyId: id},
 				success: function (data) {
 
-					filepath=data.data.printFile;
-					if (data.data.isprint=='0'){
+					filepath="/rlzy/print/getApplyById/"+data.data.id;
+					if (data.data.remark=='1'){
 						var dialog = jqueryAlert({
 							'style': 'wap',
 							'icon': '/raio/Alert/img/right.png',
@@ -310,7 +303,7 @@
 					}
 
 					//0是A3   1是A4
-					if( data.data.isprint=="1"){
+					if( data.data.remark=="0"){
 						var dialog = jqueryAlert({
 							'style': 'wap',
 							'icon': '/raio/Alert/img/wait.png',
@@ -322,13 +315,6 @@
 						var double = 0 // double = 0 单面打印 ,double = 1 双面打印
 						//choiceTray = 1时:A3打印,ChoiceTray =0 时 :A4打印
 
-						var suffix =filepath.substring(filepath.lastIndexOf(".")+1);
-						console.log(suffix)
-						console.log(data.data.serviceName)
-						if(data.data.serviceName=='食品经营备案(仅销售预包装食品)'){
-							double = 1
-						}
-
 						//开始打印
 						var Url = getRootPath_web();
 						console.log(Url+filepath)
@@ -336,7 +322,7 @@
 						Toast('打印指定网页文件.....');
 						module_printer.print_net_file(
 								Url+filepath,
-								suffix,
+								jpg,
 								1,        //打印数量
 								0,//打印纸盒选择(0使用默认纸盒,1使用纸盒1,2使用纸盒2,3使用纸盒3,4使用纸盒4,5使用手动纸盒
 								0,//选择纸张规格 0 A4 ,1 A3, 2 A5

+ 291 - 0
yinet-admin/src/main/resources/templates/rlzy/print/saomiao.html

@@ -0,0 +1,291 @@
+<!DOCTYPE html>
+<html  xmlns:th="http://www.thymeleaf.org">
+<head>
+	<meta charset="utf-8" />
+	<title>赵县行政审批局</title>
+	<link rel="stylesheet" type="text/css" href="/print/css/index.css">
+
+	<link rel="stylesheet" type="text/css" href="/print/css/style.css">
+	<link rel="stylesheet" type="text/css" href="/print/css/bootstrap.min.css">
+	<style>
+		.list-left-active{
+			color: #459fff!important;
+		}
+	</style>
+	<script>
+		function checkLeave() {
+			console.log("quit")
+			cl_closeidA4photos();
+		}
+		function goIndex() {
+			window.location.href='/zhuxiao/index'
+		}
+
+	</script>
+</head>
+<body  onbeforeunload="return checkLeave()" class="bluebg" >
+<header>
+	<img class="fl" style="width: 800px;padding: 20px 90px;" src="/print/img/logo_03.png" />
+	<div class="anniu"><a class="button" onclick="goIndex()" ><img src="/print/img/index.png"/></a>
+		<a class="button" onclick="goBack()"><img src="/print/img/fh.png"/></a></div>
+</header>
+<div class="con write">
+	<div class="row clearfix" style="width:98%;margin:0 auto;padding:1% 0;height: 100%;">
+		<div class="col-md-12 column">
+			<div class="row">
+				<div class="col-md-3">
+					<h3 class="title">—— 事项列表 ——</h3>
+					<div style="height:810px;overflow:auto">
+						<table class="table table-bordered">
+							<tbody>
+							<tr class="info" th:each="item,itemStar : ${files}">
+								<td>
+									[[${itemStar.index+1}]]
+								</td>
+								<td>
+									<a th:id="${itemStar.index+1}" th:onclick="'javascript:chageFile('+${itemStar.index+1}+')'" class="list">[[${item}]]</a>
+								</td>
+							</tr>
+
+							</tbody>
+						</table>
+					</div>
+				</div>
+				<div class="col-md-6">
+					<h3 class="title">—— 高拍仪 ——</h3>
+					<div class="gaopaiyi" id="CameraCtl"></div>
+					<div  id="idCard" style="display: none;width:100%; height:600px; background:#fff;"></div>
+					<div class="gaopai" style="padding-left: 200px">
+						<button class="btn btn-lg btn-success" onclick = "cl_openidA4photos(1,1)">打开高拍仪</button>
+						<button class="btn btn-lg btn-warning" onclick = "cl_closeidA4photos()">关闭高拍仪</button>
+						<button class="btn btn-lg btn-info" onclick="cl_takePhotos()">拍照</button>
+						<button class="btn btn-lg btn-warning" onclick="saveFile()">保存并关闭</button>
+						<!--<button class="btn btn-lg btn-info">拍照</button>
+                        <button class="btn btn-lg btn-success">上传</button>
+                        <button class="btn btn-lg btn-warning">重置</button><button class="btn btn-lg btn-info">拍照</button>
+                        <button class="btn btn-lg btn-success">上传</button>-->
+					</div>
+				</div>
+				<div class="col-md-3">
+					<h3 class="title">—— 预览 ——</h3>
+					<div id="ylDivList" style="height:810px;overflow:auto" >
+						<div class="col-md-12 yllist" style="display:none;"  th:each="item,itemStar : ${files}" th:id="'yl'+${itemStar.index+1}" >
+							<a >[[${item}]]</a>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+<footer class="foot">
+	技术支持:石家庄开发区亿网科技发展有限公司
+</footer>
+</body>
+<script src="/print/js/cookie.tool.js"  type="text/javascript" charset="utf-8"></script>
+<script th:src="@{/js/jquery.min.js}"></script>
+<script th:src="@{/js/bootstrap.min.js}"></script>
+<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
+<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
+<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
+<script th:src="@{/ajax/libs/layui/layui.js}"></script>
+<script th:src="@{/ruoyi/js/ry-ui.js?v=4.0.0}"></script>
+<!-- jquery-validate 表单验证插件 -->
+<script src="/raio/newjs/qwebchannel.js"  type="text/javascript" charset="utf-8"></script>
+<script src="/raio/newjs/app.js"  type="text/javascript" charset="utf-8"></script>
+
+
+<script>
+
+
+	function chageFile(index){
+		$(".list").removeClass('list-left-active');
+		$("#"+index).addClass('list-left-active');
+
+		$(".yllist").hide();
+		$("#yl"+index).show();
+
+	}
+
+	var filebase64s=[]
+	var card=getCookie("cardno")
+	var name=getCookie("cardname")
+
+
+	//材料上传--打开摄像头
+	function cl_openidA4photos(size,type) {
+
+		var oViewport;
+		var offsetWidth;
+		var offsetHeight;
+		var topWidth;
+		var topHeight;
+		Toast('', '高拍仪正在打开');
+		if (size == 0 || size == 1) {
+			// 设置A3 A4窗口
+		 	topWidth=535
+		 	topHeight=160
+			offsetWidth=850;
+			offsetHeight=575;
+		} else if (size == 2) {
+			// 设置身份证窗口
+			topWidth=565
+			topHeight=240
+			offsetWidth=428;
+			offsetHeight=270;
+		}
+
+		module_camera.open(type, 0, 0, 0, topWidth, topHeight, offsetWidth,offsetHeight);
+	}
+
+
+	//材料上传-关闭摄像头
+	function cl_closeidA4photos() {
+	close_light()
+		Toast('', '高拍仪/摄像头正在关闭');
+		module_camera.close();
+		Toast('res', '高拍仪/摄像头关闭成功');
+
+	}
+
+	//材料上传
+	function saveFile() {
+		cl_closeidA4photos()
+		$.modal.confirm("是否保存文件并关闭该页面",function(){
+
+			$("#ylDivList div").each(function(){
+				var filename=$(this).find("a")[0].text
+
+				 $(this).find("img").each(function (){
+					 filebase64s.push({
+						 "filename":filename,
+						 "src":$(this)[0].src, });
+				})
+			})
+			$.ajax({
+				url: "http://127.0.0.1:5000/saveFile",
+				type: "post",
+				dataType: "json",
+				cache: false,
+				data: {
+					"filebase64s":JSON.stringify(filebase64s),
+					"card": card,
+					"name":name,
+				},
+				success: function (data) {
+					alert("success")
+				},
+				error:function(data){
+					alert("文件已保存到D盘目录下")
+					goBack()
+				}
+			});
+		})
+
+	}
+      var RAIO_lightctrl_light = {
+            RAIO_LIGHTCTR_LIGHT_CAMERA: 0x04,   // 拍摄灯
+            RAIO_LIGHTCTR_LIGHT_IDCARD: 0x05,   // 身份证读卡器背光灯
+            RAIO_LIGHTCTR_LIGHT_PRINTER: 0x06,   // 激光打印机出稿灯
+            RAIO_LIGHTCTR_LIGHT_UNIONPAY: 0x07,   // 银联读卡器指示灯
+            RAIO_LIGHTCTR_LIGHT_TICKET: 0x08,   // 热敏小票打印机出稿灯
+            RAIO_LIGHTCTR_LIGHT_KEYBOARD: 0x09,   // 金属密码键盘指示灯
+            RAIO_LIGHTCTR_LIGHT_FILL: 0x0a,   // 前置摄像头补光灯
+            RAIO_LIGHTCTR_LIGHT_CARDSENDER: 0x0b,   // 发卡机指示灯
+        };
+        var RAIO_lightctrl_mode = {
+            RAIO_LIGHTCTR_MODE_FLASHES_THREE_TIMES: 0,  // 闪烁3次后常亮
+            RAIO_LIGHTCTR_MODE_ALWAYS: 1,  // 常亮
+            RAIO_LIGHTCTR_MODE_FLICKER: 2,  // 闪烁
+        };
+
+        function open_light() {
+            module_lightctrl.open_light(RAIO_lightctrl_light.RAIO_LIGHTCTR_LIGHT_CAMERA,RAIO_lightctrl_mode.RAIO_LIGHTCTR_MODE_FLICKER);
+        }
+		
+        function close_light() {
+            module_lightctrl.close_light(RAIO_lightctrl_light.RAIO_LIGHTCTR_LIGHT_CAMERA);
+        }
+
+	//材料上传--拍照
+	function cl_takePhotos() {//材料名称,材料index
+		Toast('', '开始拍照');
+		module_camera.take_photo();
+
+	}
+	function output(message) {
+		console.log(message)
+	}
+
+	window.onload = function () {
+		// var baseUrl = "http://127.0.0.1:12345/";
+		if (location.search != "")
+			var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+		else
+			var baseUrl = "ws://localhost:12345";
+
+		output("正在连接RAIO:" + baseUrl);
+		var socket = new WebSocket(baseUrl);
+
+		socket.onclose = function () {
+			console.error("web channel closed");
+		};
+		socket.onerror = function (error) {
+			console.error("web channel error: " + error);
+		};
+		socket.onopen = function () {
+			output("RAIO连接成功");
+			new QWebChannel(socket, function (channel) {
+				window.module_camera = channel.objects.camera;
+				 window.module_lightctrl = channel.objects.lightctrl;
+				module_camera.sig_open_result.connect(function (code) {
+					Toast('res', "摄像头打开结果:" + code);
+
+				});
+   module_lightctrl.sig_open_light_error.connect(function (code) {
+                            Toast('res', '打开控制灯结果:' + code);
+                        });
+                        module_lightctrl.sig_close_light_error.connect(function (code) {
+                            Toast('res', "关闭控制灯结果" + code)
+                        });
+				module_camera.sig_take_photo.connect(function (code, image) {
+					if (code == 0) {
+						Toast('res', '拍照成功');
+						addImage(image);
+					} else if (code == -1) {
+						Toast('errs', '摄像头未打开拍照失败');
+					} else {
+						Toast('err', '拍照失败:' + code);
+					}
+				});
+				cl_openidA4photos(0,1);
+				open_light()
+			});
+		}
+
+	}
+
+
+
+
+	function delImage(This) {
+		var obj = This.parentNode;
+		obj.parentNode.removeChild(obj);
+		Toast('', '删除成功');
+	}
+	function addImage(base64) {
+		var base64 = "data:image/jpeg;base64," + base64;
+		var imghtml='<li ><i class="iconfont icon-guanbi" onClick="delImage(this)"></i><img src="'+base64+'" style="width:100%;height:200px;z-index:100;"/></li>'
+		if($(".list-left-active").attr("id")==undefined){
+			alert("请选择要扫描的事项")
+			return ;
+		}
+		var imgId=$(".list-left-active").attr("id");
+		$("#yl"+imgId).append(imghtml);
+
+	}
+	function goBack() {
+		history.go(-2);
+	}
+</script>
+</html>