Sfoglia il codice sorgente

机器列表及添加翻新机给你修改

liujiankang 7 anni fa
parent
commit
5ce41ecb3d

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

@@ -77,6 +77,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
@@ -335,13 +336,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

@@ -599,9 +599,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;
         }
@@ -662,9 +662,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>

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

@@ -95,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>
@@ -168,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) {//冲奶机模板
@@ -194,7 +194,7 @@
                 })
                 if (prints != "") {
                     $("#printlist").printArea();
-                    $("#printlist").html("");
+                    /*$("#printlist").html("");*/
                     layer.closeAll();
                 } else {
                     layer.msg('未选中需要打印的条形码', {icon: 2, time: 2000});