Bladeren bron

机器打印列表功能

liujiankang 7 jaren geleden
bovenliggende
commit
e015affc25

+ 7 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java

@@ -4,6 +4,7 @@ import com.iamberry.rst.core.order.Order;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.pts.PtsMachineLogs;
 
 import java.util.List;
 
@@ -28,4 +29,10 @@ public interface MachineService {
     Integer maxMachineId();
 
     List<PtsMachine> listPrintOrder(PtsMachine ptsMachine);
+
+    //获取单个机器生产流程日志
+    List<PtsMachineLogs> listMachineLogs(Integer machineId);
+
+    //查询单个机器信息
+    PtsMachine getMachine(Integer machineId);
 }

+ 11 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.order.Order;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.pts.PtsMachineLogs;
 import com.iamberry.rst.faces.pts.MachineService;
 import com.iamberry.rst.service.pts.mapper.MachineMapper;
 import com.iamberry.rst.util.PageUtil;
@@ -55,4 +56,14 @@ public class MachineServiceImpl implements MachineService {
         return machineMapper.listMachine(ptsMachine);
     }
 
+    @Override
+    public List<PtsMachineLogs> listMachineLogs(Integer machineId) {
+        return machineMapper.listMachineLogs(machineId);
+    }
+
+    @Override
+    public PtsMachine getMachine(Integer machineId) {
+        return machineMapper.getMachine(machineId);
+    }
+
 }

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.service.pts.mapper;
 
 import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.pts.PtsMachineLogs;
 
 import java.util.List;
 
@@ -24,4 +25,10 @@ public interface MachineMapper {
 
     //查询数据库最大的机器id
     Integer maxMachineId();
+
+    //获取单个机器生产流程日志
+    List<PtsMachineLogs> listMachineLogs(Integer machineId);
+
+    //查询单个机器信息
+    PtsMachine getMachine(Integer machineId);
 }

+ 39 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -104,4 +104,43 @@
     <select id="maxMachineId" resultType="Integer">
         select * from tb_rst_pts_machine ORDER BY machine_id DESC  limit 1
     </select>
+
+    <select id="listMachineLogs" parameterType="Integer" resultType="PtsMachineLogs">
+        select
+         logs_id logsId,
+         machine_id machineId,
+         employee_id employeeId,
+         produce_id produceId,
+         process_id processId,
+         device_id deviceId,
+         employee_name employeeName,
+         produce_name produceName,
+         process_name processName,
+         device_name deviceName,
+         logs_process_status logsProcessStatus,
+         logs_error_type logsErrorType,
+         logs_process_prompt logsProcessPrompt,
+         logs_process_time logsProcessTime,
+         logs_create_time logsCreateTime
+         FROM tb_rst_pts_machine_logs where machine_id = #{machineId} ORDER BY logs_id ASC
+    </select>
+
+    <select id="getMachine" parameterType="Integer" resultType="PtsMachine">
+        select machine_id machineId,
+         machine_qrcode machineQrcode,
+         machine_barcode machineBarcode,
+         machine_sales_date machineSalesDate,
+         machine_sales_state machineSalesState,
+         machine_status machineStatus,
+         machine_produced_time machineProducedTime,
+         machine_sub_time machineSubTime,
+         machine_is_print machineIsPrint,
+         machine_compound_img machineCompoundImg,
+         machine_process_state machineProcessState,
+         machine_software_version machineSoftwareVersion,
+         machine_hardware_version machineHardwareVersion,
+         machine_create_time machineCreateTime,
+         machine_update_time machineUpdateTime
+        from tb_rst_pts_machine WHERE  machine_id = #{machineId}
+    </select>
 </mapper>

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

@@ -4,6 +4,7 @@ import com.iamberry.rst.core.order.Order;
 import com.iamberry.rst.core.order.RentType;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.pts.PtsMachineLogs;
 import com.iamberry.rst.faces.pts.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -142,4 +143,24 @@ public class AdminMachineController {
     public List<PtsMachine> selectPrintMachine(PtsMachine ptsMachine){
         return machineService.listPrintOrder(ptsMachine);
     }
+
+    /**
+     * 查询机器生成流程
+     * @author LJK
+     * @date 2017年8月31日16:08:15
+     * @return
+     */
+    @RequiresPermissions("machine:logs_all:machine")
+    @RequestMapping("/_machine_logs_list")
+    public ModelAndView listLogsMachine(Integer machineId){
+        if(machineId == null || machineId < 0){
+            return null;
+        }
+        PtsMachine ptsMachine = machineService.getMachine(machineId);
+        ModelAndView mv = new ModelAndView("pts/machine/machine_particulars");
+        List<PtsMachineLogs> machineLogsList = machineService.listMachineLogs(machineId);
+        mv.addObject("machineLogsList", machineLogsList);
+        mv.addObject("ptsMachine", ptsMachine);
+        return mv;
+    }
 }

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

@@ -72,6 +72,8 @@
 					<th width="100">销售日期</th>
 					<th width="100">生产流程状态</th>
 					<th width="50">生产时间</th>
+                    <th width="40">硬件版本</th>
+                    <th width="40">软件版本</th>
 					<th width="150">操作</th>
 				</tr>
 				</thead>
@@ -106,10 +108,11 @@
 							</#if>
                             </td>
                             <td class="text-c" width="100">${(list.machineProducedTime?string("yyyy-MM-dd"))!''}</td>
+                            <td class="text-c" width="50">${list.machineHardwareVersion!''}</td>
+                            <td class="text-c" width="50">${list.machineSoftwareVersion!''}</td>
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
-								<#--<a onclick="print(${100000 + st.index},${list.numberId},${list.numberIsPrint})" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
-								<a onclick="downLoad();" title="下载" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe640;</i></a>-->
+                                <a onclick="machineLogs(${list.machineId});" title="生产流程" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe667;</i></a>
 							</td>
 						</tr>
 					</#list>
@@ -261,6 +264,10 @@
                     }
                 });
             }
+
+            function machineLogs(machineId) {
+                window.location.href=root_path + '/admin/machine/_machine_logs_list?machineId='+machineId;
+            }
         </script>
 	</body>
 </html>

+ 196 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_particulars.ftl

@@ -0,0 +1,196 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title></title>
+		<style>
+			.my-title{font-weight: 500;padding-left: 15px;position: relative;}
+			.my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+			.my-list{list-style-type: none;padding: 0;margin: 0;}
+			.my-list>li{margin: 10px 0;}
+			article, section, time, aside {
+				display: block;
+			}
+			.point-time {
+				content: "";
+				position: absolute;
+				width: 13px;
+				height: 13px;
+				top: 12px;
+				left: 90px;
+				background: #1c87bf;
+				margin-left: -4px;
+				border-radius: 50%;
+				box-shadow: 0 0 0 2px #fff;
+			}
+
+			.text-red {
+				color: #f6393f;
+			}
+
+			.text-blue {
+				color: #32a3d8;
+			}
+
+			.text-green {
+				color: #95c91e;
+			}
+
+			.text-yellow {
+				color: #ffb902;
+			}
+
+			.text-purple {
+				color: #d32d93;
+			}
+
+			.point-red {
+				background-color: #f6393f;
+			}
+
+			.point-blue {
+				background-color: #32a3d8;
+			}
+
+			.point-green {
+				background-color: #24c175;
+			}
+
+			.point-yellow {
+				background-color: #ffb902;
+			}
+
+			.point-purple {
+				background-color: #d32d93;
+			}
+
+			.content {
+				width: 100%;
+				margin: 0 auto;
+			}
+			.content article {
+				position: relative;
+			}
+			.content article > h3 {
+				width: 100%;
+				height: 20px;
+				line-height: 20px;
+				text-align: left;
+				text-indent: 3%;
+				font-size: 1.4em;
+				color: #fff;
+				padding: 10px 0 20px;
+				background-color: #dd6d01;
+			}
+			.content article section {
+				padding: 0 0 17px;
+				position: relative;
+			}
+			.content article section:before {
+				content: "";
+				width: 3px;
+				top: 17px;
+				bottom: -17px;
+				left: 91px;
+				background: #84c9e9;
+				position: absolute;
+				-webkit-transform: scaleX(.5);
+			}
+			.content article section.no-before:before{
+				display: none;
+			}
+			.content article section:last-child:before {
+				display: none;
+			}
+			.content article section time {
+				width: 80px;
+				display: block;
+				position: absolute;
+				padding: 8px 0;
+			}
+			.content article section time > span {
+				display: block;
+				text-align: center;
+			}
+			.content article section aside {
+				color: #3a3a38;
+				margin-left: 108px;
+				height: 35px;
+				line-height: 35px;
+			}
+			.content article section .brief {
+				color: #9f9f9f;
+			}
+			.things>.items{margin: 0 15px;}
+			p{margin: 0;}
+		</style>
+	<#include "/base/list_base.ftl">
+	</head>
+	<body>
+		<div style="padding: 10px;">
+			<div class="my-title">产品生产详情</div>
+			<ul class="my-list">
+				<li>机器条码:${ptsMachine.machineBarcode!''}</li>
+				<li>生产状态:<#if ptsMachine.machineProcessState == 1><span class="text-blue">正常</#if>
+							<#if ptsMachine.machineProcessState == 2><span class="text-red">异常</#if></span></li>
+				<li>
+					<div class="content">
+					<article>
+					<#list machineLogsList as list>
+                        <section>
+                            <span class="point-time point-blue"></span>
+                            <time>
+								<#if list_index == 1>生产流程:</#if>
+                            </time>
+                            <aside>
+                                <p class="things">
+								${(list.logsProcessTime?string("yyyy-MM-dd HH:mm:ss"))!''}<span class="items">${list.employeeName!''}</span><span class="items">${list.processName!''}</span><#if list.logsProcessStatus == 0><span class="btn-see-ditails text-red">异常</#if><#if list.logsProcessStatus == 1><span class="btn-see-ditails text-blue">正常</#if></span>
+                                </p>
+								<#if list.logsErrorType??>
+									<#if list.logsErrorType == 1>
+										<img style="width: 20px;float: left;margin-top:8px;margin-right: 10px;" src="/common/images/tanhao.png" />提示:<span class="btn-see-ditails text-red">${list.logsProcessPrompt}</span>
+									<#else>
+                                        <img style="width: 20px;float: left;margin-top:8px;margin-right: 10px;" src="/common/images/tanhao.png" />提示:<span class="btn-see-ditails text-red">次品异常</span>
+									</#if>
+								</#if>
+                            </aside>
+                        </section>
+
+					</#list>
+						<#--<section style="padding-bottom: 37px;">
+							<span class="point-time point-blue"></span>
+							<time>
+								
+							</time>
+							<aside>
+								<p class="things">
+									2017-08-09 12:12:12  <span class="items">王老五</span><span class="items">净水机需求清洗物料</span><span class="btn-see-ditails text-red">异常</span>
+								</p>
+								<p class="things text-red">
+									<img style="width: 20px;float: left;margin-top:8px;margin-right: 10px;" src="/common/images/tanhao.png" />提示:此正常流程为检查水箱是否完好
+								</p>
+							</aside>
+						</section>-->
+						<section>
+							<span class="point-time point-green"></span>
+							<time>
+								销售信息:
+							</time>
+							<aside>
+								<p class="things">
+									<#if ptsMachine.machineSalesState == 2>
+									${(ptsMachine.machineSalesDate?string("yyyy-MM-dd"))!''}售出<#--<span class="items">王老五</span><span class="items">净水机需求清洗物料</span>-->
+									<#else >
+										未售出
+									</#if>
+
+								</p>
+							</aside>
+						</section>
+					</article>
+				</div>
+				</li>
+			</ul>
+		</div>
+	</body>
+</html>

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

@@ -47,8 +47,7 @@
 							<td class="text-c" width="10">${list.machineBarcode }</td>
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
-								<#--<a onclick="print(${100000 + st.index},${list.numberId},${list.numberIsPrint})" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
-								<a onclick="downLoad();" title="下载" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe640;</i></a>-->
+								<a onclick="machineLogs(${list.machineId});" title="生产流程" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe667;</i></a>
 							</td>
 						</tr>
 					</#list>
@@ -107,10 +106,10 @@
                             var settingNumber = $("#settingNumber").val();
                             $.each(data,function(i,value) {
                                 for (var i=0;i<settingNumber;i++){
-                                    code128(value.machineBarcode);
-                                    var barcodes = $("#bcTarget").html();
-                                    /*$("#barcodeId").html(machineBarcode);
-                                    $("#qrcodeImg").attr('src',machineQrcode);*/
+                                        code128(value.machineBarcode);
+                                        var barcodes = $("#bcTarget").html();
+                                        /*$("#barcodeId").html(machineBarcode);
+                                        $("#qrcodeImg").attr('src',machineQrcode);*/
                                     $("#printlist").append('<div style="width: 227px;height: 150px;position: relative;margin-left: 20px;">' +
                                             '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO净饮水机</span>' +
                                             '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:wa-1x</span>' +
@@ -195,6 +194,10 @@
                         }
                     });
                 }
+
+                function machineLogs(machineId) {
+                    window.location.href=root_path + '/admin/machine/_machine_logs_list?machineId='+machineId;
+                }
         </script>
 	</body>
 </html>

BIN
watero-rst-web/src/main/webapp/common/images/tanhao.png