Quellcode durchsuchen

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

wangxiaoming vor 7 Jahren
Ursprung
Commit
8100625269

+ 9 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -100,10 +100,15 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             return true;
         }
         //添加订单数据
-        int orderNum = salesOrderMapper.addSalesOrder(salesOrder);
-        if (orderNum <= 0) {
-            return false;
+        try {
+            int orderNum = salesOrderMapper.addSalesOrder(salesOrder);
+            if (orderNum <= 0) {
+                return false;
+            }
+        }catch (Exception e){
+            return true;
         }
+
         for (SalesOrderItem item : list) {
             item.setItemOrderId(salesOrder.getSalesId());
         }
@@ -228,7 +233,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             try{
                 orderInfo = efastOrderService.getOrderFormEfast(order.getString("deal_code"));
             }catch (Exception e){
-                logger.info("推送订单失败;异常编号:505;失败原因:"+ e.getMessage() +"--推送失败订单号:" + orderList.getJSONObject(i).getString("deal_code"));
+                logger.info("获取订单失败;异常编号:505;失败原因:"+ e.getMessage() +"--获取失败订单号:" + orderList.getJSONObject(i).getString("deal_code"));
             }
             if (orderInfo == null) {
                 continue;

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/EfastOrderServiceImpl.java

@@ -528,6 +528,12 @@ public class EfastOrderServiceImpl implements EfastOrderService {
             if (resultJson.indexOf("江西省 南昌市 新建县 \"江西南昌市新建县县城内江西南昌新建县黄家湖东路1666号众森红谷一品45栋2单元601室")!=-1){
                 resultJson = resultJson.replace("江西省 南昌市 新建县 \"江西南昌市新建县县城内江西南昌新建县黄家湖东路1666号众森红谷一品45栋2单元601室","江西南昌市新建县县城内江西南昌新建县黄家湖东路1666号众森红谷一品45栋2单元601室");
             }
+            if (resultJson.indexOf("山东省 淄博市 临淄区 稷下路东王便民市场东头\"范范和饭\"门店")!=-1){
+                resultJson = resultJson.replace("山东省 淄博市 临淄区 稷下路东王便民市场东头\"范范和饭\"门店","山东省 淄博市 临淄区 稷下路东王便民市场东头范范和饭门店");
+            }
+            if (resultJson.indexOf("北京 北京市 西城区 \"")!=-1){
+                resultJson = resultJson.replace("北京 北京市 西城区 \"","");
+            }
             JSONObject jsonObject = JSONObject.fromObject(resultJson);
             // default HTTP SUCCESS
             JSONObject respData = JSONObject.fromObject(jsonObject.get("resp_data"));

+ 7 - 7
watero-rst-web/src/main/resources/dev-jdbc.properties

@@ -6,15 +6,15 @@ jdbc.driver=com.mysql.jdbc.Driver
 ##### \uFFFD\uFFFD\u02BD\uFFFD\uFFFD\uFFFD\uFFFD end #####
 
 #\u6D4B\u8BD5
-jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/test_rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-jdbc.username=rst_test
-jdbc.password=RST_test
-#
+#jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/test_rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#jdbc.username=rst_test
+#jdbc.password=RST_test
+
 
 ### \uFFFD\uFFFD\uFFFD\u053B\uFFFD\uFFFD\uFFFD
-#jdbc.url=jdbc:mysql://192.168.1.254/rst_test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-#jdbc.username=root
-#jdbc.password=root
+jdbc.url=jdbc:mysql://192.168.1.254/rst_test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+jdbc.username=root
+jdbc.password=root
 ### \uFFFD\uFFFD\uFFFD\u053B\uFFFD\uFFFD\uFFFD end ######
 
 #pool settings

+ 1 - 0
watero-rst-web/src/main/resources/platform.properties

@@ -1,5 +1,6 @@
 #---efast begin---#
 efast_base_url=http://121.199.165.244/efast_test/efast_api/webservice/web/index.php
+#efast_base_url=http://121.199.165.244/efast/efast_api/webservice/web/index.php
 app_nick=openapi
 app_key=8888
 app_secret=8888

+ 1 - 1
watero-rst-web/src/main/resources/watero-rst-ioc.xml

@@ -26,7 +26,7 @@
     <aop:aspectj-autoproxy proxy-target-class="true"/>
 
 	<!-- 开启注解启动定时器 -->
-    <!--<task:annotation-driven/>-->
+    <task:annotation-driven/>
 
 	<!-- DataSource -->
 	<import resource="classpath:watero-rst-db.xml"/>

+ 328 - 326
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/tooth_print_List.ftl

@@ -1,357 +1,359 @@
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/html">
-	<head>
-		<meta charset="UTF-8">
-		<title></title>
-        <#include "/base/list_base.ftl">
-		<style>
-            *{padding: 0;margin: 0;}
-			.my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
-			.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}
-			.my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
-			.my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
-            .barcodeImg{margin:10px 0px}
-			.isprint{width: 200px;height:50px;}
-            .background{background-color: #0a6999}
-		</style>
-	</head>
-	<body>
-    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
-        <span class="c-gray en">&gt;</span> PST管理
-        <span class="c-gray en">&gt;</span> 电动牙刷打印列表
-        <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
-    </nav>
-		<div class="text-c" style="margin-top: 20px;">
-			<form action="${path}/admin/machine/_tooth_print_list" method="post">
+<head>
+    <meta charset="UTF-8">
+    <title></title>
+<#include "/base/list_base.ftl">
+    <style>
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        .my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .barcodeImg{margin:10px 0px}
+        .isprint{width: 200px;height:50px;}
+        .background{background-color: #0a6999}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> PST管理
+    <span class="c-gray en">&gt;</span> 电动牙刷打印列表
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="text-c" style="margin-top: 20px;">
+    <form action="${path}/admin/machine/_tooth_print_list" method="post">
 
-				<#--<div id="havePrint" class="isprint background" onclick="selectIsPrint(1);"><span>未打印</span></div>
-                <div id="notPrint" class="isprint" onclick="selectIsPrint(2);"><span>已打印</span></div>-->
-                    <div id="HuiTab-demo1" class="HuiTab">
-                        <div class="tabBar cl">
-                            <span id="notPrint" onclick="selectIsPrint(1);" class="allOrder">未打印</span>
-                            <span id="havePrint" onclick="selectIsPrint(2);" class="returnOrderEtc">已打印</span>
-                        </div>
-                    </div>
-                <input class="my-input" type="hidden" id="machineIsPrint" name="machineIsPrint" />
-               <#-- <input  class="my-input" type="text" value="每个二维码打印数量:" readonly="readonly" style="border: 0;margin-top: 8px;margin-right: 0"/>
-                <input class="my-input" type="text" id="settingNumber" name="printNumber" value="3" placeholder="打印数量" style="margin-top: 10px;"/>-->
-                <button type="button" class="my-btn-search" onclick="printList();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">打印</button>
-                <button id="updatePrintId" type="button" class="my-btn-search" onclick="batchUpdatePring();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">修改为已打印</button>
-			</form>
-		</div>
-		<div class="mt-2" style="margin: 20px; " >
-            <div style="width: 55%;margin: 0 auto; ">
-                <table class="table table-border table-bordered table-bg table-hover table-sort" >
-                    <thead>
-                    <tr class="text-c">
-                        <th width="1"><input name='checkbox2' type='checkbox' value='' id="all" ></th>
-                        <th width="40">设备尾号</th>
-                        <th width="40">产品条码</th>
-                        <th width="70">产品名/型号</th>
-                        <th width="10">生产时间</th>
-                        <th width="20">操作</th>
-                    </tr>
-                    </thead>
-                    <tbody id="listid">
+    <#--<div id="havePrint" class="isprint background" onclick="selectIsPrint(1);"><span>未打印</span></div>
+    <div id="notPrint" class="isprint" onclick="selectIsPrint(2);"><span>已打印</span></div>-->
+        <div id="HuiTab-demo1" class="HuiTab">
+            <div class="tabBar cl">
+                <span id="notPrint" onclick="selectIsPrint(1);" class="allOrder">未打印</span>
+                <span id="havePrint" onclick="selectIsPrint(2);" class="returnOrderEtc">已打印</span>
+            </div>
+        </div>
+        <input class="my-input" type="hidden" id="machineIsPrint" name="machineIsPrint" />
+    <#-- <input  class="my-input" type="text" value="每个二维码打印数量:" readonly="readonly" style="border: 0;margin-top: 8px;margin-right: 0"/>
+     <input class="my-input" type="text" id="settingNumber" name="printNumber" value="3" placeholder="打印数量" style="margin-top: 10px;"/>-->
+        <button type="button" class="my-btn-search" onclick="printList();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">打印</button>
+        <button id="updatePrintId" type="button" class="my-btn-search" onclick="batchUpdatePring();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">修改为已打印</button>
+    </form>
+</div>
+<div class="mt-2" style="margin: 20px; " >
+    <div style="width: 55%;margin: 0 auto; ">
+        <table class="table table-border table-bordered table-bg table-hover table-sort" >
+            <thead>
+            <tr class="text-c">
+                <th width="1"><input name='checkbox2' type='checkbox' value='' id="all" ></th>
+                <th width="40">设备尾号</th>
+                <th width="40">产品条码</th>
+                <th width="70">产品名/型号</th>
+                <th width="10">生产时间</th>
+                <th width="20">操作</th>
+            </tr>
+            </thead>
+            <tbody id="listid">
+            <#if machineIsPrint == '1'>
+                <#assign machineList = machineList />
+            <#else >
+                <#assign machineList = page.dataList />
+            </#if>
+            <#if machineList?? &&  (machineList?size > 0) >
+                <#list machineList as list>
+                <tr class="text-c" id="${list.machineBarcode }">
+                    <td width="2">
+                        <input name='checkbox' type='checkbox' value='${list.machineBarcode }' machineId='${list.machineId }'>
+                        <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
+                        <input type="hidden" value="${list.machineQrcode}" id="machineQrcode${list.machineId }">
+                        <input type="hidden" value="${(list.machineCreateTime?string("yyyy/MM/dd"))!''}" id="machineCreateTime${list.machineId }">
+                        <input type="hidden" value="${list.machineProduceType}" id="machineProduceType${list.machineId }">
+                    </td>
+                    <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-5) }</td>
+                    <td class="text-c" width="10">${list.machineBarcode }</td>
+                    <td class="text-c" width="6">
+                    ${list.produceName }/${list.producePattern }-${list.produceModel }
+                    </td>
+                    <td>${(list.machineCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                    <!-- 遍历操作 -->
+                    <td class="td-manage text-c">
                         <#if machineIsPrint == '1'>
-                            <#assign machineList = machineList />
-                        <#else >
-                            <#assign machineList = page.dataList />
-                        </#if>
-                        <#if machineList?? &&  (machineList?size > 0) >
-                        <#list machineList as list>
-                            <tr class="text-c" id="${list.machineBarcode }">
-                                <td width="2">
-                                    <input name='checkbox' type='checkbox' value='${list.machineBarcode }' machineId='${list.machineId }'>
-                                    <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
-                                    <input type="hidden" value="${list.machineQrcode}" id="machineQrcode${list.machineId }">
-                                    <input type="hidden" value="${(list.machineCreateTime?string("yyyy/MM/dd"))!''}" id="machineCreateTime${list.machineId }">
-                                    <input type="hidden" value="${list.machineProduceType}" id="machineProduceType${list.machineId }">
-                                </td>
-                                <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-5) }</td>
-                                <td class="text-c" width="10">${list.machineBarcode }</td>
-                                <td class="text-c" width="6">
-                                ${list.produceName }/${list.producePattern }-${list.produceModel }
-                                </td>
-                                <td>${(list.machineCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
-                                <!-- 遍历操作 -->
-                                <td class="td-manage text-c">
-                                    <#if machineIsPrint == '1'>
-                                        <a onclick="updatePrint('${list.machineBarcode}',true);" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
-                                    </#if>
-                                    <a onclick="barCodePrint('${list.machineBarcode }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
-                                </td>
-                            </tr>
-                        </#list>
-                        <#else>
-                        <tr id="noMachineTr"><td colspan="6" class="td-manage text-c" >暂时没有机器,请添加!</td></tr>
+                            <a onclick="updatePrint('${list.machineBarcode}',true);" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
                         </#if>
-                    </tbody>
-                </table>
+                        <a onclick="barCodePrint('${list.machineBarcode }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
+                    </td>
+                </tr>
+                </#list>
+            <#else>
+            <tr id="noMachineTr"><td colspan="6" class="td-manage text-c" >暂时没有机器,请添加!</td></tr>
+            </#if>
+            </tbody>
+        </table>
 
-                <#if machineIsPrint == '2'>
-                    <tfoot>
-                        <div style="margin-top: 20px"><#include "/base/page_util.ftl"></div>
-                    </tfoot>
-                </#if>
-            </div>
-			<input type="hidden" value="${machineId!''}" name="machineId" id="machineId">
-            <input type="hidden" value="" name="codeId" id="codeId">
-            <div style="position: absolute;top: 80px;height: 23px;display:none;" id="bcTarget" class="barcodeImg"></div>
-			<div style="display:none;">
-				<div id="printlist" style="margin-left: 28px;">
-                </div>
-			</div>
-		</div>
-        <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>
+    <#if machineIsPrint == '2'>
+        <tfoot>
+        <div style="margin-top: 20px"><#include "/base/page_util.ftl"></div>
+        </tfoot>
+    </#if>
+    </div>
+    <input type="hidden" value="${machineId!''}" name="machineId" id="machineId">
+    <input type="hidden" value="" name="codeId" id="codeId">
+    <div style="position: absolute;top: 80px;height: 23px;display:none;" id="bcTarget" class="barcodeImg"></div>
+    <div>
+        <div id="printlist" style="margin-left: 31px;">
+        </div>
+    </div>
+</div>
+<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">
-            $("#all").on('click',function(){
-                console.log($(this).prop('checked'));
-                if($(this).prop('checked')){
-                    $("input[name='checkbox']").prop("checked","true");
-                }else{
-                    $("input[name='checkbox']").removeAttr("checked");
-                }
+<script type="text/javascript">
+    $("#all").on('click',function(){
+        console.log($(this).prop('checked'));
+        if($(this).prop('checked')){
+            $("input[name='checkbox']").prop("checked","true");
+        }else{
+            $("input[name='checkbox']").removeAttr("checked");
+        }
 
-            });
-                if(${machineIsPrint} == '1'){
-                    $("#notPrint").attr("class", "current");
-                    $("#machineIsPrint").val(1);
-                }
-                if(${machineIsPrint} == '2'){
-                    $("#havePrint").attr("class", "current");
-                    $("#machineIsPrint").val(2);
-                    $("#updatePrintId").hide();//隐藏修改打印按钮
-                }
+    });
+    if(${machineIsPrint} == '1'){
+        $("#notPrint").attr("class", "current");
+        $("#machineIsPrint").val(1);
+    }
+    if(${machineIsPrint} == '2'){
+        $("#havePrint").attr("class", "current");
+        $("#machineIsPrint").val(2);
+        $("#updatePrintId").hide();//隐藏修改打印按钮
+    }
 
-            function selectIsPrint(printState) {
-                if(printState == 1){
-                    $("#notPrint").attr("class", "current");
-                    $("#havePrint").removeClass("current");
-                }else if(printState == 2){
-                    $("#havePrint").attr("class", "current");
-                    $("#notPrint").removeClass("current");
-                }
+    function selectIsPrint(printState) {
+        if(printState == 1){
+            $("#notPrint").attr("class", "current");
+            $("#havePrint").removeClass("current");
+        }else if(printState == 2){
+            $("#havePrint").attr("class", "current");
+            $("#notPrint").removeClass("current");
+        }
 
-                $("#machineIsPrint").val(printState);
-                window.location.href=root_path + '/admin/machine/_tooth_print_list?machineIsPrint='+printState;
-            }
-                //生成128条形码
-                function code128(barcode){
-                    $("#codeId").val(barcode);
-                    $("#bcTarget").empty().barcode($("#codeId").val(), "code128",{
-                        barWidth:1, barHeight:23,showHRI:false
-                    });
+        $("#machineIsPrint").val(printState);
+        window.location.href=root_path + '/admin/machine/_tooth_print_list?machineIsPrint='+printState;
+    }
+    //生成128条形码
+    function code128(barcode){
+        $("#codeId").val(barcode);
+        $("#bcTarget").empty().barcode($("#codeId").val(), "code128",{
+            barWidth:1, barHeight:23,showHRI:false
+        });
 
-                }
+    }
 
-            function getNowFormatDate() {
-                var date = new Date();
-                var seperator1 = "/";
-                var year = date.getFullYear();
-                var month = date.getMonth() + 1;
-                var strDate = date.getDate();
-                if (month >= 1 && month <= 9) {
-                    month = "0" + month;
-                }
-                if (strDate >= 0 && strDate <= 9) {
-                    strDate = "0" + strDate;
-                }
-                var currentdate = year + seperator1 + month + seperator1 + strDate;
-                return currentdate;
-            }
-            function  printList() {
-                var machineBarcode = null;
-                var machineQrcode = null;
-                var machineCreateTime = null;
-                var machineProduceType = null;
-                var prints = "";
-                var settingNumber = $("#settingNumber").val();
-                var selectNum = $("#listid").find("input[name='checkbox']:checked").length;
-                if(selectNum > 50){
-                    layer.msg('每次打印条数最多可支持50条', {icon: 2, time: 2000});
-                    return;
-                }
-                $("input[name='checkbox']:checkbox:checked").each(function (index,element) {
-                    prints += $(this).val();
-                    /*numbers = numbers+parseInt(settingNumber);*/
-                    var machineId = $(this).attr("machineId");
-                    machineBarcode = $(this).val();
-                    machineQrcode = $("#machineQrcode"+machineId).val();
-                    machineCreateTime = $("#machineCreateTime"+machineId).val();
-                    machineProduceType = $("#machineProduceType"+machineId).val();
-                    /*if((index+1)%10 == 0){
-                        num = parseInt(num) + 1;
-                    }*/
-                    $("#printlist").append('<div style="width: 156px;height: 183px;margin-top: 0px;position: relative;/*position: relative;margin-bottom: 4px;*/"> ' +
-                            '<img style="position: absolute; width: 130px;height: 128px;margin-top: 15px;" src="'+machineQrcode+'" />' +
-                            '<span style="position: absolute;margin-left: 20px;margin-top: 133px;font-size: 16px;">'+machineCreateTime+'</span>' +
-                            '</div>');
+    function getNowFormatDate() {
+        var date = new Date();
+        var seperator1 = "/";
+        var year = date.getFullYear();
+        var month = date.getMonth() + 1;
+        var strDate = date.getDate();
+        if (month >= 1 && month <= 9) {
+            month = "0" + month;
+        }
+        if (strDate >= 0 && strDate <= 9) {
+            strDate = "0" + strDate;
+        }
+        var currentdate = year + seperator1 + month + seperator1 + strDate;
+        return currentdate;
+    }
+    function  printList() {
+        var machineBarcode = null;
+        var machineQrcode = null;
+        var machineCreateTime = null;
+        var machineProduceType = null;
+        var prints = "";
+        var settingNumber = $("#settingNumber").val();
+        var selectNum = $("#listid").find("input[name='checkbox']:checked").length;
+        if(selectNum > 50){
+            layer.msg('每次打印条数最多可支持50条', {icon: 2, time: 2000});
+            return;
+        }
+        $("input[name='checkbox']:checkbox:checked").each(function (index,element) {
+            prints += $(this).val();
+            /*numbers = numbers+parseInt(settingNumber);*/
+            var machineId = $(this).attr("machineId");
+            machineBarcode = $(this).val();
+            machineQrcode = $("#machineQrcode"+machineId).val();
+            machineCreateTime = $("#machineCreateTime"+machineId).val();
+            machineProduceType = $("#machineProduceType"+machineId).val();
+            /*if((index+1)%10 == 0){
+                num = parseInt(num) + 1;
+            }*/
+            $("#printlist").append('<div style="width: 158px;height: 188px;position: relative;/*position: relative;margin-bottom: 4px;*/"> ' +
+                    '<span style="position: absolute;margin-left: 26px;z-index: 99;margin-top: 15px;font-size: 16px;">产品唯一码</span>' +
+                    '<img style="position: absolute; width: 130px;height: 128px;margin-top: 24px;" src="'+machineQrcode+'" />' +
+                    '<span style="position: absolute;margin-left: 20px;margin-top: 133px;font-size: 16px;">'+machineCreateTime+'</span>' +
+                    '</div>');
 
-                    if(${machineIsPrint} == '1')
-                    {
-                        updatePrint(machineBarcode,false);
-                        $("#" + machineBarcode).remove();
-                    }
-                });
-                if (prints != ""){
-                    $("#printlist").printArea();
-                    $("#printlist").html("");
-                    layer.closeAll();
-                } else {
-                    layer.msg('未选中需要打印的条形码', {icon: 2, time: 2000});
-                }
-
-                $("#printlist").html("");  //未打印成功,需要清除数据
-                prints = "";
+            if(${machineIsPrint} == '1')
+            {
+                updatePrint(machineBarcode,false);
+                $("#" + machineBarcode).remove();
             }
-            //动态刷新是否有最新的机器
-            ref = setInterval(function(){
-                latestMachine();
-            },2000);
-            function  latestMachine() {
-                var machineIsPrint = $("#machineIsPrint").val();
-                if(machineIsPrint == 1){
-                    $.ajax({
-                        cache: true,
-                        type: "POST",
-                        url: "${path}/admin/machine/_LatestTooth_list",
-                        data:{machineId : $("#machineId").val()},// 你的formid
-                        success: function(data){
-                            if(data != null){
-                                $("#noMachineTr").remove();
-                                $.each(data,function(i,value) {
-                                    if(i+1 == data.length){
-                                        $("#machineId").val(value.machineId);
-                                    }
-                                    var machineName = value.produceName+"/"+value.producePattern+"-"+value.produceModel;
-                                    /*var machineType = "";
-                                    if(value.machineProduceType == 1){
-                                        machineType = "净水机";
-                                    }
-                                    if(value.machineProduceType == 2){
-                                        machineType = "冲奶机";
-                                    }*/
-                                    var private = value.machineBarcode.substr(value.machineBarcode.length-5);
-                                    var machineCreateTime = formatDate(value.machineCreateTime,"yyyy-MM-dd HH:mm:ss");
-                                    $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
-                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+'"  machineId="'+value.machineId+'"> ' +
-                                            '<input type="hidden" value="'+value.machineId + 1000000 +'" id="'+value.machineBarcode + 'Id'+'"></td>' +
-                                            '<input type="hidden" value="'+value.machineQrcode+'" id="'+'machineQrcode'+value.machineId+'">' +
-                                            '<input type="hidden" value="'+value.machineProduceType+'" id="'+'machineProduceType'+value.machineId+'">' +
-                                            '<td class="text-c" style="font-size: 24px" width="10">'+private+'</td>' +
-                                            '<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
-                                            '<td class="text-c" width="10">'+machineName+'</td>' +
-                                            '<td>'+machineCreateTime+'</td>' +
-                                            '<td class="td-manage text-c"> <a onclick="updatePrint('+value.machineBarcode+',true);" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>' +
-                                            '<a onclick="barCodePrint('+'\''+value.machineBarcode+'\''+','+'\''+value.machineId+'\''+',);" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a> </td></tr>');
-
+        });
+        if (prints != ""){
+            $("#printlist").printArea();
+            $("#printlist").html("");
+            layer.closeAll();
+        } else {
+            layer.msg('未选中需要打印的条形码', {icon: 2, time: 2000});
+        }
 
-                                });
+        $("#printlist").html("");  //未打印成功,需要清除数据
+        prints = "";
+    }
+    //动态刷新是否有最新的机器
+    ref = setInterval(function(){
+        latestMachine();
+    },2000);
+    function  latestMachine() {
+        var machineIsPrint = $("#machineIsPrint").val();
+        if(machineIsPrint == 1){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: "${path}/admin/machine/_LatestTooth_list",
+                data:{machineId : $("#machineId").val()},// 你的formid
+                success: function(data){
+                    if(data != null){
+                        $("#noMachineTr").remove();
+                        $.each(data,function(i,value) {
+                            if(i+1 == data.length){
+                                $("#machineId").val(value.machineId);
                             }
+                            var machineName = value.produceName+"/"+value.producePattern+"-"+value.produceModel;
+                            /*var machineType = "";
+                            if(value.machineProduceType == 1){
+                                machineType = "净水机";
+                            }
+                            if(value.machineProduceType == 2){
+                                machineType = "冲奶机";
+                            }*/
+                            var private = value.machineBarcode.substr(value.machineBarcode.length-5);
+                            var machineCreateTime = formatDate(value.machineCreateTime,"yyyy-MM-dd HH:mm:ss");
+                            $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
+                                    '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+'"  machineId="'+value.machineId+'"> ' +
+                                    '<input type="hidden" value="'+value.machineId + 1000000 +'" id="'+value.machineBarcode + 'Id'+'"></td>' +
+                                    '<input type="hidden" value="'+value.machineQrcode+'" id="'+'machineQrcode'+value.machineId+'">' +
+                                    '<input type="hidden" value="'+value.machineProduceType+'" id="'+'machineProduceType'+value.machineId+'">' +
+                                    '<td class="text-c" style="font-size: 24px" width="10">'+private+'</td>' +
+                                    '<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
+                                    '<td class="text-c" width="10">'+machineName+'</td>' +
+                                    '<td>'+machineCreateTime+'</td>' +
+                                    '<td class="td-manage text-c"> <a onclick="updatePrint('+value.machineBarcode+',true);" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>' +
+                                    '<a onclick="barCodePrint('+'\''+value.machineBarcode+'\''+','+'\''+value.machineId+'\''+',);" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a> </td></tr>');
+
 
-                        },
-                        error: function(){
-                            console.log("查询最新机器失败!");
-                        }
-                    });
+                        });
+                    }
+
+                },
+                error: function(){
+                    console.log("查询最新机器失败!");
                 }
+            });
+        }
 
-            }
+    }
 
 
-                function updatePrint(machineBarcode,type){
-                    $.ajax({
-                        "type" : "post",
-                        "url" : "${path}/admin/machine/_update_print",
-                        "dataType" : "json",
-                        "data" :{machineBarcode : machineBarcode},
-                        "success" : function(data) {
-                            $("#"+machineBarcode).remove();
-                            if(type){
-                                layer.msg('修改成功', {icon: 1, time: 2000});
-                            }
-                        },
-                        "error":function(data){
-                            layer.msg('操作失败', {icon: 2, time: 2000});
-                        }
-                    });
+    function updatePrint(machineBarcode,type){
+        $.ajax({
+            "type" : "post",
+            "url" : "${path}/admin/machine/_update_print",
+            "dataType" : "json",
+            "data" :{machineBarcode : machineBarcode},
+            "success" : function(data) {
+                $("#"+machineBarcode).remove();
+                if(type){
+                    layer.msg('修改成功', {icon: 1, time: 2000});
                 }
+            },
+            "error":function(data){
+                layer.msg('操作失败', {icon: 2, time: 2000});
+            }
+        });
+    }
 
-                function machineLogs(machineId) {
-                    window.location.href=root_path + '/admin/machine/_machine_logs_list?machineId='+machineId;
-                }
+    function machineLogs(machineId) {
+        window.location.href=root_path + '/admin/machine/_machine_logs_list?machineId='+machineId;
+    }
 
-            function batchUpdatePring(){
-                var a = new Array();
-                $("input[name='checkbox']:checkbox:checked").each(function(i) {
-                    a[i] = $(this).val();
-                })
-                $.ajax({
-                    "type" : "post",
-                    "url" : "${path}/admin/machine/_batchUpdate_print",
-                    "dataType" : "json",
-                    "data" :{machineBarcodes : ""+a},
-                    /*"data" :{machineBarcodes : JSON.stringify(a)},*/
-                    "success" : function(data) {
-                        layer.msg('修改成功!', {icon: 1,time:2000});
-                        location.replace(location.href);
-                    },
-                    "error":function(data){
-                        /*alert("操作失败,请联系管理员!");*/
-                        layer.msg('操作失败!', {icon: 2,time:2000});
-                    }
-                });
+    function batchUpdatePring(){
+        var a = new Array();
+        $("input[name='checkbox']:checkbox:checked").each(function(i) {
+            a[i] = $(this).val();
+        })
+        $.ajax({
+            "type" : "post",
+            "url" : "${path}/admin/machine/_batchUpdate_print",
+            "dataType" : "json",
+            "data" :{machineBarcodes : ""+a},
+            /*"data" :{machineBarcodes : JSON.stringify(a)},*/
+            "success" : function(data) {
+                layer.msg('修改成功!', {icon: 1,time:2000});
+                location.replace(location.href);
+            },
+            "error":function(data){
+                /*alert("操作失败,请联系管理员!");*/
+                layer.msg('操作失败!', {icon: 2,time:2000});
             }
+        });
+    }
 
-            //单个打印条形码
-             function barCodePrint(barCode,machineId){
-                 var machineCreateTime = $("#machineCreateTime"+machineId).val();
-                 var  machineBarcode = barCode;
-                 var machineQrcode = $("#machineQrcode"+machineId).val();
-                 $("#printlist").append('<div style="width: 156px;height: 183px;margin-top: 0px;position: relative;/*position: relative;margin-bottom: 4px;*/"> ' +
-                         '<img style="position: absolute; width: 130px;height: 128px;margin-top: 15px;" src="'+machineQrcode+'" />' +
-                         '<span style="position: absolute;margin-left: 20px;margin-top: 133px;font-size: 16px;">'+machineCreateTime+'</span>' +
-                         '</div>');
-                     if(${machineIsPrint} == '1')
-                     {
-                         updatePrint(machineBarcode,false);
-                         $("#" + machineBarcode).remove();
-                     }
-                     $("#printlist").printArea();
-                     $("#printlist").html("");
-            }
+    //单个打印条形码
+    function barCodePrint(barCode,machineId){
+        var machineCreateTime = $("#machineCreateTime"+machineId).val();
+        var  machineBarcode = barCode;
+        var machineQrcode = $("#machineQrcode"+machineId).val();
+        $("#printlist").append('<div style="width: 158px;height: 188px;position: relative;/*position: relative;margin-bottom: 4px;*/"> ' +
+                '<span style="position: absolute;margin-left: 26px;z-index: 99;margin-top: 15px;font-size: 16px;">产品唯一码</span>' +
+                '<img style="position: absolute; width: 130px;height: 128px;margin-top: 24px;" src="'+machineQrcode+'" />' +
+                '<span style="position: absolute;margin-left: 20px;margin-top: 133px;font-size: 16px;">'+machineCreateTime+'</span>' +
+                '</div>');
+        if(${machineIsPrint} == '1')
+        {
+            updatePrint(machineBarcode,false);
+            $("#" + machineBarcode).remove();
+        }
+        $("#printlist").printArea();
+        $("#printlist").html("");
+    }
 
-            /*获取产品信息*/
-            function getProduce(machineId){
-                var produce = new Object();
-                produce.producePattern = "";
-                produce.produceModel = "";
-                produce.produceFeature = "";
-                produce.produceName = "";
-                $.ajax({
-                    type: "POST",
-                    url: "${path}/admin/machine/_getProduce_print",
-                    async: false,
-                    data:{machineId : machineId},
-                    success: function(data){
-                        if(data != null){
-                            produce.producePattern = data.producePattern;
-                            produce.produceModel = data.produceModel;
-                            produce.produceFeature = data.produceFeature;
-                            produce.produceName = data.produceName;
-                        }
-                    },
-                    error: function(){
-                        console.log("查询产品型号信息失败!");
-                    }
-                });
-                return produce;
+    /*获取产品信息*/
+    function getProduce(machineId){
+        var produce = new Object();
+        produce.producePattern = "";
+        produce.produceModel = "";
+        produce.produceFeature = "";
+        produce.produceName = "";
+        $.ajax({
+            type: "POST",
+            url: "${path}/admin/machine/_getProduce_print",
+            async: false,
+            data:{machineId : machineId},
+            success: function(data){
+                if(data != null){
+                    produce.producePattern = data.producePattern;
+                    produce.produceModel = data.produceModel;
+                    produce.produceFeature = data.produceFeature;
+                    produce.produceName = data.produceName;
+                }
+            },
+            error: function(){
+                console.log("查询产品型号信息失败!");
             }
-        </script>
+        });
+        return produce;
+    }
+</script>
 
 
-	</body>
+</body>
 </html>