Jelajahi Sumber

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

wangxiaoming 7 tahun lalu
induk
melakukan
78376ce5e1

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

@@ -96,6 +96,7 @@
             t.machine_update_time machineUpdateTime,
             t.machine_produce_type machineProduceType,
             t.machine_produce_id machineProduceId,
+            t.machine_is_retreading machineIsRetreading,
             trpb.bom_version AS machineHardwareVersionName,
             trpmv.machine_version_no AS machineSoftwareVersionName
         FROM  tb_rst_pts_machine t
@@ -391,13 +392,13 @@
         machine_qrcode,machine_barcode,machine_sales_state,machine_status,
         machine_produced_time,machine_is_print,machine_compound_img,machine_process_state,
         machine_create_time,machine_produce_type,machine_nfcId,machine_produce_id,
-        machine_batch_id,machine_bom_id,machine_is_retreading,machine_software_version)
+        machine_batch_id,machine_bom_id,machine_is_retreading,machine_software_version,machine_line)
         values
         <foreach collection="list" item="item" index="index" separator="," >
             (#{item.machineQrcode},#{item.machineBarcode},2,#{item.machineStatus},
             #{item.machineProducedTime},#{item.machineIsPrint},#{item.machineCompoundImg},#{item.machineProcessState},
             #{item.machineCreateTime},#{item.machineProduceType},#{item.machineNfcId},#{item.machineProduceId},
-            #{item.machineBatchId},#{item.machineBomId},#{item.machineIsRetreading},#{item.machineSoftwareVersion})
+            #{item.machineBatchId},#{item.machineBomId},#{item.machineIsRetreading},#{item.machineSoftwareVersion},#{item.machineLine})
         </foreach>
     </insert>
 </mapper>

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

@@ -596,9 +596,9 @@ public class AdminMachineController {
     @ResponseBody
     @RequiresPermissions("machine:add:batch")
     @RequestMapping("/add_renovationMachine")
-    public ResponseJson addRenovationMachine(HttpServletRequest request, Integer batchId, Integer versionId, Integer bomId, Integer number) {
+    public ResponseJson addRenovationMachine(HttpServletRequest request, Integer batchId, Integer versionId, Integer bomId, Integer number,Integer isRefurbishment,String machineLine) {
         ResponseJson rj = new ResponseJson();
-        if (batchId == null || versionId == null || bomId == null) {
+        if (batchId == null || versionId == null || bomId == null || isRefurbishment == null || machineLine == null) {
             rj.setReturnCode(500);
             return rj;
         }
@@ -659,9 +659,10 @@ public class AdminMachineController {
             //ptsMachine.setMachineHardwareVersion(ptsBom.getBomId());
             ptsMachine.setMachineSoftwareVersion(ptsBatch.getBatchSoftwareVersionId());
             ptsMachine.setMachineProduceId(produce.getProduceId());
-            ptsMachine.setMachineIsRetreading(1);
+            ptsMachine.setMachineIsRetreading(isRefurbishment);
             ptsMachine.setMachineBatchId(batchId);
             ptsMachine.setMachineBomId(bomId);
+            ptsMachine.setMachineLine(machineLine);
             ptsList.add(ptsMachine);
         }
         Integer msg = machineService.addMahineBatch(ptsList);

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

@@ -65,7 +65,17 @@
             </#if>
             </select>
         </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否翻新机</span>
+            <label for="radio-10">
+                <input type="radio" id="radio-10" name="isRefurbishment" value="1" checked/>是
+            </label>
+            <label for="radio-11" style="margin-left: 50px;">
+                <input type="radio" id="radio-11" name="isRefurbishment" value="2"/>否
+            </label>
+        </div>
 
+        <div class="input-box"><span class="input-dic spanhidth">拉线:</span><input class="my-input" type="text" style="width: 76%;"  name="machineLine" id="machineLine" /> </div>
         <div class="input-box"><span class="input-dic spanhidth">机器数量:</span><input class="my-input" type="text" style="width: 76%;"  name="number" id="number" placeholder="每次最少生成一个机器"/> </div>
 
         <div class="input-box">
@@ -134,6 +144,11 @@
              return false;
          }
 
+         var machineLine = $("#machineLine").val();
+         if(machineLine == null || machineLine == "" || typeof(machineLine)=="undefined"){
+             layer.msg("拉线不能为空",{icon: 5,time:3000});
+             return false;
+         }
          var number = $("#number").val();
          if(number == null || number == "" || typeof(number)=="undefined"){
              layer.msg("数量不能为空",{icon: 5,time:3000});

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

@@ -85,6 +85,7 @@
 					<th width="50">生产时间</th>
                     <th width="40">硬件版本</th>
                     <th width="40">软件版本</th>
+                    <th width="40">是否是翻新机</th>
 					<th width="150">操作</th>
 				</tr>
 				</thead>
@@ -122,6 +123,14 @@
                             <td class="text-c" width="100">${(list.machineProducedTime?string("yyyy-MM-dd"))!''}</td>
                             <td class="text-c" width="50">${list.machineHardwareVersionName!''}</td>
                             <td class="text-c" width="50">${list.machineSoftwareVersionName!''}</td>
+                            <td class="text-c" width="100">
+                                <#if list.machineIsRetreading == 1>
+                                    是
+                                </#if>
+                                <#if list.machineIsRetreading == 2>
+                                    否
+                                </#if>
+                            </td>
 							<!-- 遍历操作 -->
 							<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>

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

@@ -45,8 +45,9 @@
                     <thead>
                     <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="10">机器类型</th>
+                        <th width="6">机器类型</th>
                         <th width="20">操作</th>
                     </tr>
                     </thead>
@@ -62,8 +63,9 @@
                                     <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' machineId="${list.machineId }">
                                     <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
                                 </td>
+                                <td class="text-c" style="font-size: 17px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-4) }</td>
                                 <td class="text-c" width="10">${list.machineBarcode }</td>
-                                <td class="text-c" width="10">
+                                <td class="text-c" width="6">
                                     <#if list.machineProduceType == 1>
                                         净水机
                                     </#if>
@@ -93,7 +95,7 @@
 			<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  <#--style="display:none;"--> >
 				<div id="printlist">
                 </div>
 			</div>
@@ -166,14 +168,14 @@
                         /*$("#barcodeId").html(machineBarcode);
                         $("#qrcodeImg").attr('src',machineQrcode);*/
                         if (machineProduceType == 1) {//净水机模板
-                            $("#printlist").append('<div style="width: 268px;height: 162px;position: relative;">' +
+                            $("#printlist").append('<div style="width: 242px;height: 132px;position: relative;">' +
                                     '<span style="position: absolute;top:-1px;font-size: 14px;">WaterO可移动智能净水机</span>' +
-                                    '<span style="position: absolute;top: 23px;font-size: 12px;">型号:'+producePattern+'-'+produceModel+'</span>' +
-                                    '<span style="position: absolute;top: 39px;font-size: 12px;">S/N</span>' +
-                                    '<div style="position: absolute;left: -10px;top: 74px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                    '<span style="position: absolute;top: 101px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                    '<img style="position: absolute;right: 2px;top:17px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                    '<span style="position: absolute;right: 9px;top: 101px;font-size: 12px;">'+ machineNo +'</span>' +
+                                    '<span style="position: absolute;top: 22px;font-size: 12px;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                                    '<span style="position: absolute;top: 37px;font-size: 12px;">S/N</span>' +
+                                    '<div style="position: absolute;left: -5px;top: 54px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                    '<span style="position: absolute;top: 82px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                    '<img style="position: absolute;right: 2px;top:14px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                    '<span style="position: absolute;right: 9px;top: 82px;font-size: 12px;">'+ machineNo +'</span>' +
                                     '</div>');
                         }
                         if (machineProduceType == 2) {//冲奶机模板
@@ -192,7 +194,7 @@
                 })
                 if (prints != "") {
                     $("#printlist").printArea();
-                    $("#printlist").html("");
+                    /*$("#printlist").html("");*/
                     layer.closeAll();
                 } else {
                     layer.msg('未选中需要打印的条形码', {icon: 2, time: 2000});
@@ -206,8 +208,7 @@
             },2000);
             function  latestMachine() {
                 var machineIsPrint = $("#machineIsPrint").val();
-
-                if(machineIsPrint == 2){
+                if(machineIsPrint == 1){
                     $.ajax({
                         cache: true,
                         type: "POST",
@@ -226,12 +227,14 @@
                                     if(value.machineProduceType == 2){
                                         machineType = "冲奶机";
                                     }
+                                    var private = value.machineBarcode.substr(value.machineBarcode.length-4);
                                     $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
                                             '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'"  machineId="'+value.machineId+'"> ' +
                                             '<input type="hidden" value="'+value.machineId + 1000000 +'" id="'+value.machineBarcode + 'Id'+'"></td>' +
+                                    '<td class="text-c" style="font-size: 17px" width="10">'+private+'</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>' +
+                                            '<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">&#xe6a7;</i></a>' +
                                             '<a onclick="barCodePrint('+value.machineBarcode+value.machineQrcode+value.machineProduceType+','+value.machineId+');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a> </td></tr>');