فهرست منبع

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

wangxiaoming 7 سال پیش
والد
کامیت
f3d35870d6

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachineController.java

@@ -274,7 +274,7 @@ public class AdminMachineController {
         /*机器异常总数*/
         mv.addObject("machineAbnormality", numbers.getMachineAbnormality());
         /*流程异常百分比*/
-        double percentage = (double)numbers.getMachineAbnormality() / (double)numbers.getMachineCount()*100;
+        double percentage = (numbers.getMachineAbnormality() == null? 0.0 : (double)numbers.getMachineAbnormality()) / (numbers.getMachineCount() == null? 0.0:(double)numbers.getMachineCount()) * 100;
         NumberFormat nf=new DecimalFormat( "0.0 ");
         percentage = Double.parseDouble(nf.format(percentage));
         mv.addObject("abnormalityPercentage", percentage);

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/device_list.ftl

@@ -84,7 +84,7 @@
                     </td>
                     <!-- 遍历操作 -->
                     <td class="td-manage text-c">
-                        <a style="text-decoration:none" href="javascript:;" title="查看"
+                        <a style="text-decoration:none" href="javascript:;" title="修改"
                            onclick="edit_detail('${path}/admin/equipment/_update_device?deviceId=${device.deviceId!}');">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>

+ 21 - 17
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/update_device.ftl

@@ -32,6 +32,7 @@
         <div class="my-title">设备信息</div>
         <input class="my-input" type="hidden" value="${device.deviceId!}" name="deviceId" id="deviceId" placeholder="请输入设备编号"/>
         <div class="input-box"><span class="input-dic">设备编号</span><input class="my-input" type="text" value="${device.deviceNumber!}" name="deviceNumber" id="deviceNumber" placeholder="请输入设备编号"/> </div>
+        <input type="hidden" id="hiddenDeviceId" value="${device.deviceNumber!}">
         <div class="input-box"><span class="input-dic">设备名称</span><input class="my-input" type="text" value="${device.deviceName!}" name="deviceName" id="deviceName" placeholder="请输入设备姓名"/> </div>
         <div class="input-box"><span class="input-dic">购买日期</span><input class="my-input-date" type="text" value="${(device.deviceDate?string("yyyy-MM-dd"))!''}" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" name="device_date" id="device_date" placeholder="请选择购买日期" readonly="readonly"/> </div>
         <div class="input-box"><span class="input-dic">设备状态</span>
@@ -58,30 +59,34 @@
         var deviceName = $('#deviceName').val();
         var device_date = $('#device_date').val();
         var deviceRemake = $('#deviceRemake').val();
+        var hiddenDeviceId = $('#hiddenDeviceId').val();
         if (deviceNumber == null || !check_number.test(deviceNumber)) {
             flag = false;
             layer.msg('设备编号格式不正确,请重新输入!',{icon: 5,time:1000});
             return flag;
         }
-        $.ajax({
-            cache: true,
-            type: "POST",
-            data: {
-                deviceNumber:deviceNumber
-            },
-            url: "${path}/admin/equipment/is_equipment",
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    flag = false;
-                    layer.msg('该设备编号已存在',{icon: 5,time:1000});
+        if(hiddenDeviceId != deviceNumber){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: {
+                    deviceNumber:deviceNumber
+                },
+                url: "${path}/admin/equipment/is_equipment",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        flag = false;
+                        layer.msg('该设备编号已存在',{icon: 5,time:1000});
+
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
 
                 }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
+            });
+        }
 
-            }
-        });
         if(flag == false){
             return flag;
         }
@@ -120,7 +125,6 @@
                 "deviceStatus":deviceStatus,
                 "deviceId":deviceId
             }
-
             $.ajax({
                 cache: true,
                 type: "POST",

+ 15 - 13
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_List.ftl

@@ -24,9 +24,9 @@
     </nav>
 		<div class="text-c" style="margin-top: 20px;">
 			<form action="${path}/admin/machine/_machine_list" method="post">
-				 	<input class="my-input" type="text" id="printNumber" name="printNumber" value="3" placeholder="打印数量"/>
-                	<input class="my-input" type="hidden" id="settingNumber" name="settingNumber" value="3"/>
-					<button type="button" class="my-btn-search" onclick="setting();" style="cursor:pointer; margin-right: 50px;">设置</button>
+				 	<#--<input class="my-input" type="text" id="printNumber" name="printNumber" value="3" placeholder="打印数量"/>-->
+                	<input class="my-input" type="hidden" id="settingNumber" name="settingNumber" value="1"/>
+					<#--<button type="button" class="my-btn-search" onclick="setting();" style="cursor:pointer; margin-right: 50px;">设置</button>-->
 
 					<input class="my-input" type="text" name="machineBarcode" value="${machineBarcode!''}" placeholder="请输入机器编号"/>
 					<select class="my-select" name="machineIsPrint">
@@ -73,11 +73,11 @@
 			<table class="table table-border table-bordered table-bg table-hover table-sort">
 				<thead>
 				<tr class="text-c">
-					<th width="100">机器条码(点击打印)</th>
-					<th width="100">机器二维码(点击打印)</th>
+					<th width="100">机器条码</th>
+					<th width="100">机器二维码</th>
 					<th width="100">打印状态</th>
 					<th width="100">销售状态</th>
-					<th width="100">销售日期</th>
+					<#--<th width="100">销售日期</th>-->
 					<th width="100">生产流程状态</th>
 					<th width="50">生产时间</th>
                     <th width="40">硬件版本</th>
@@ -106,7 +106,7 @@
                                     未售出
 							</#if>
                             </td>
-							<td class="text-c" width="100">${(list.machineSalesDate?string("yyyy-MM-dd"))!''}</td>
+							<#--<td class="text-c" width="100">${(list.machineSalesDate?string("yyyy-MM-dd"))!''}</td>-->
                             <td class="text-c" width="100">
 							<#if list.machineProcessState == 1>
                                     正常
@@ -121,7 +121,8 @@
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
                                 <a onclick="machineLogs(${list.machineId});" title="生产流程" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe667;</i></a>
-							</td>
+                                <a onclick="print('${list.machineBarcode }','${list.machineQrcode }','${list.machineId }','${list.machineProduceType }')" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
+                            </td>
 						</tr>
 					</#list>
 				</tbody>
@@ -149,13 +150,14 @@
                 });
 
             }
-            function setting() {
+            /*function setting() {
                 var printNumber = $("#printNumber").val();
                 $("#settingNumber").val(printNumber);
                 alert("设置成功!");
-            }
+            }*/
 			function print(machineBarcode,machineQrcode,machineId,produceType){
                 var settingNumber = $("#settingNumber").val();
+                var machineNo = 1000000 + parseInt(machineId);
                 for (var i=0;i<settingNumber;i++){
                     code128(machineBarcode);
                     var barcodes = $("#bcTarget").html();
@@ -169,7 +171,7 @@
                                 '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                                 '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                                 '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
                     if(produceType == '' || produceType == null){
@@ -180,7 +182,7 @@
                                 '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                                 '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                                 '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
                     if(produceType == 2){//冲奶机模板
@@ -191,7 +193,7 @@
                                 '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                                 '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                                 '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
 

+ 37 - 14
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -45,6 +45,7 @@
 				<tr class="text-c">
                     <th width="1"><input name='checkbox' type='checkbox' value='' id="all" ></th>
 					<th width="10">产品条码</th>
+                    <th width="10">机器类型</th>
 					<th width="20">操作</th>
 				</tr>
 				</thead>
@@ -58,11 +59,22 @@
 						<tr class="text-c" id="${list.machineBarcode }">
                             <td width="2">
                                 <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
+                                <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
                             </td>
 							<td class="text-c" width="10">${list.machineBarcode }</td>
+                            <td class="text-c" width="10">
+                                <#if list.machineProduceType == 1>
+                                    净水机
+                                </#if>
+                                <#if list.machineProduceType == 2>
+                                    冲奶机
+                                </#if>
+                            </td>
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
-								<a onclick="updatePrint('${list.machineBarcode}');" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
+                                <#if machineIsPrint == 1>
+                                <a onclick="updatePrint('${list.machineBarcode}');" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
+                                </#if>
                                 <a onclick="barCodePrint('${list.machineBarcode }'+'${list.machineQrcode }'+'${list.machineProduceType }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
                             </td>
 						</tr>
@@ -84,7 +96,7 @@
                 </div>
 			</div>
 		</div>
-        <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery.PrintArea.js"></script>
+        <script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
         <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
 
 		<script type="text/javascript">
@@ -139,6 +151,7 @@
                     machineBarcode = $(this).val().substring(0, 13);
                     machineQrcode = $(this).val().substring(13, ($(this).val().length) - 1);
                     machineProduceType = $(this).val().substring(($(this).val().length) - 1, $(this).val().length);
+                    var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
                     for (var i = 0; i < settingNumber; i++) {
                         code128(machineBarcode);
                         var barcodes = $("#bcTarget").html();
@@ -152,7 +165,7 @@
                                     '<div style="position: absolute;left: -10px;top: 75px;height: 30px;"  class="barcodeImg">' + barcodes + '</div>' +
                                     '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;">' + machineBarcode + '</span>' +
                                     '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;"  src="' + machineQrcode + '" /> ' +
-                                    '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                    '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                     '</div>');
                         }
                         if (machineProduceType == 2) {//冲奶机模板
@@ -163,7 +176,7 @@
                                     '<div style="position: absolute;left: -10px;top: 75px;height: 30px;"  class="barcodeImg">' + barcodes + '</div>' +
                                     '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" >' + machineBarcode + '</span>' +
                                     '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;"  src="' + machineQrcode + '" /> ' +
-                                    '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                    '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                     '</div>');
                         }
                         /*updatePrint(machineBarcode);*/
@@ -185,6 +198,7 @@
             },2000);
             function  latestMachine() {
                 var machineIsPrint = $("#machineIsPrint").val();
+
                 if(machineIsPrint == 2){
                     $.ajax({
                         cache: true,
@@ -197,9 +211,18 @@
                                     if(i+1 == data.length){
                                         $("#machineId").val(value.machineId);
                                     }
+                                    var machineType = "";
+                                    if(value.machineProduceType == 1){
+                                        machineType = "净水机";
+                                    }
+                                    if(value.machineProduceType == 2){
+                                        machineType = "冲奶机";
+                                    }
                                     $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
-                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > </td>' +
+                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > ' +
+                                            '<input type="hidden" value="'+value.machineId + 1000000 +'" id="'+value.machineBarcode + 'Id'+'"></td>' +
                                             '<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
+                                            '<td class="text-c" width="10">'+machineType+'</td>' +
                                             '<td class="td-manage text-c"> <a onclick="updatePrint('+value.machineBarcode+');" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe647;</i></a>' +
                                             '<a onclick="barCodePrint('+value.machineBarcode+value.machineQrcode+value.machineProduceType+');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a> </td></tr>');
 
@@ -266,7 +289,7 @@
                     machineBarcode = barCode.substring(0,13);
                     machineQrcode = barCode.substring(13,(barCode.length)-1);
                     machineProduceType = barCode.substring((barCode.length)-1,barCode.length);
-
+                 var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
                 var settingNumber = $("#settingNumber").val();
                 for (var i=0;i<settingNumber;i++){
                     code128(machineBarcode);
@@ -274,17 +297,17 @@
                     /*$("#barcodeId").html(machineBarcode);
                     $("#qrcodeImg").attr('src',machineQrcode);*/
 
-                    $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
+                    /*$("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
                             '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
                             '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
                             '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
                             '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                             '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                             '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                            '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
-                            '</div>');
+                            '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
+                            '</div>');*/
 
-                    /*if(machineProduceType == 1){//净水机模板
+                    if(machineProduceType == 1){//净水机模板
                         $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
                                 '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
                                 '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
@@ -292,7 +315,7 @@
                                 '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                                 '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                                 '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span>' +
                                 '</div>');
                     }
                     if(machineProduceType == 2){//冲奶机模板
@@ -303,12 +326,12 @@
                                 '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
                                 '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
                                 '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                 '</div>');
-                    }*/
+                    }
                 }
                 $("#printlist").printArea();
-
+                $("#printlist").html("");
             }
         </script>
 	</body>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/producedAbnormalityStatistics.ftl

@@ -10,7 +10,7 @@
 <style>
 	.charts-box{width:500px;height:400px;display: inline-block;position: relative;margin-right: 40px;margin-bottom: 40px;}
 	.my-nav{width: 100%;height: 48px;background: #fff;display: table;text-align: center;}
-	.my-nav>a{display: table-cell;vertical-align: middle; border: 1px solid #32a3d8;font-size: 18px;border-left: 0;color: #32a3d8;}
+	.my-nav>a{display: table-cell;vertical-align: middle; border: 1px solid #32a3d8;font-size: 15px;border-left: 0;color: #32a3d8;}
 	.my-nav>a:first-child{border-left: 1px solid #32a3d8;}
 	.my-nav>a.active{background-color: #32a3d8;color:#fff;}
 </style>