wangxiaoming 7 anni fa
parent
commit
c2d23cf7f8

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

@@ -6,12 +6,12 @@
         (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_line)
+        machine_batch_id,machine_bom_id,machine_is_retreading,machine_line,machine_software_version)
         VALUES
         (#{machineQrcode},#{machineBarcode},2,#{machineStatus},
         #{machineProducedTime},#{machineIsPrint},#{machineCompoundImg},#{machineProcessState},#{machineCreateTime},
         #{machineProduceType},#{machineNfcId},#{machineProduceId},
-        #{machineBatchId},#{machineBomId},#{machineIsRetreading},#{machineLine})
+        #{machineBatchId},#{machineBomId},#{machineIsRetreading},#{machineLine},#{machineSoftwareVersion})
     </insert>
 
     <update id="updateMachine" parameterType="PtsMachine" >
@@ -327,14 +327,17 @@
 
     <!--批量添加机器 -->
     <insert id="addMahineBatch" useGeneratedKeys="true" parameterType="java.util.List">
-        insert into tb_rst_pts_machine (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)
+        insert into tb_rst_pts_machine (
+        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)
         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.machineCreateTime},#{item.machineProduceType},#{item.machineNfcId},#{item.machineProduceId},
+            #{item.machineBatchId},#{item.machineBomId},#{item.machineIsRetreading},#{item.machineSoftwareVersion})
         </foreach>
     </insert>
 </mapper>

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

@@ -77,7 +77,7 @@
                 AND t.components_type = #{componentsType}
             </if>
             <if test="componentsNo !=null and componentsNo !='' ">
-                AND t.components_no = #{componentsNo}
+                AND t.components_no like CONCAT('%',#{componentsNo},'%')
             </if>
             <if test="produceId !=null and produceId !='' ">
                 AND t.produce_id = #{produceId}
@@ -89,7 +89,7 @@
                 AND t.components_id = #{componentsId}
             </if>
             <if test="componentsName !=null and componentsName !='' ">
-                AND t.components_name = #{componentsName}
+                AND t.components_name like CONCAT('%',#{componentsName},'%')
             </if>
             <if test="supplierId !=null and supplierId !='' ">
                 AND t.supplier_id = #{supplierId}

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

@@ -542,7 +542,7 @@ public class AdminMachineController {
         mv.addObject("listptsBatch",listptsBatch);
         //查询所有软件版本
         PtsMachineVersion ptsMachineVersion = new PtsMachineVersion();
-        ptsMachineVersion.setMachineVersionType(2);
+        ptsMachineVersion.setMachineVersionType(1);
         List<PtsMachineVersion> ListVersion = machineVersionService.listMachineVersion(ptsMachineVersion);
         mv.addObject("listVersion",ListVersion);
         //根据第一个批次查询所有bom

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

@@ -19,10 +19,10 @@
         .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
         .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
         .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
-        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 80%; height: 34px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
         input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/rst/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
         input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/rst/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
-    	.spanhidth{width: 48px;}
+    	.spanhidth{width: 70px;text-align: right;}
 	</style>
 <#include "/base/add_base.ftl">
 </head>
@@ -30,7 +30,7 @@
 <div class="pd-20">
 	<form   class="form form-horizontal" id="form-admin-add">
             <div class="input-box">
-                <span class="input-dic spanhidth">请选择批次</span>
+                <span class="input-dic spanhidth">批次:</span>
 				<select class="my-select" name="batchId" id="batchId">
 						<#if (listptsBatch ?size > 0)>
 							<#list listptsBatch as list>
@@ -42,8 +42,8 @@
 				</select>
             </div>
         <div class="input-box">
-            <span class="input-dic spanhidth">软件版本</span>
-            <select class="my-select" name="versionId">
+            <span class="input-dic spanhidth">软件版本:</span>
+            <select class="my-select" name="versionId" id="versionId">
             <#if (listVersion ?size > 0)>
                 <#list listVersion as list>
                     <option value ="${list.machineVersionId}">${list.machineVersionName}</option>
@@ -54,7 +54,7 @@
             </select>
         </div>
         <div class="input-box">
-            <span class="input-dic spanhidth">Bom</span>
+            <span class="input-dic spanhidth">Bom单:</span>
             <select class="my-select" name="bomId" id="bomId">
             <#if (listBom ?size > 0)>
                 <#list listBom as list>
@@ -66,13 +66,13 @@
             </select>
         </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">
+            <span class="input-dic spanhidth"></span>
+            <input id="sumbit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="admin_add()">
+        </div>
 
-        <div class="input-box"><span class="input-dic spanhidth">数量</span><input class="my-input" type="text"  name="number" id="number" placeholder="每次最少生成一个机器"/> </div>
-		<div class="row cl">
-			<div class="col-9 col-offset-3">
-				<input id="sumbit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="admin_add()">
-			</div>
-		</div>
 	</form>
 </div>
 <#--<script type="text/javascript" src="${path}/common/admin/js/tips.js"></script>-->
@@ -115,8 +115,27 @@
     }
 
  function dataCharm() {
+
+         var batchId = $("#batchId").val();
+         if(batchId == null || batchId == "" || typeof(batchId)=="undefined"){
+             layer.msg("必须选择一个批次,没有批次请到批次列表添加批次",{icon: 5,time:3000});
+             return false;
+         }
+
+         var versionId = $("#versionId").val();
+         if(versionId == null || versionId == "" || typeof(versionId)=="undefined"){
+             layer.msg("必须选择一个软件版本,没有软件版本请到产品列表中添加软件版本",{icon: 5,time:3000});
+             return false;
+         }
+
+        var bomId = $("#bomId").val();
+         if(bomId == null || bomId == "" || typeof(bomId)=="undefined"){
+             layer.msg("必须选择一个Bom单,没有Bom单请到Bom单列表添加Bom单",{icon: 5,time:3000});
+             return false;
+         }
+
          var number = $("#number").val();
-         if(number == null){
+         if(number == null || number == "" || typeof(number)=="undefined"){
              layer.msg("数量不能为空",{icon: 5,time:3000});
              return false;
          }

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

@@ -29,7 +29,7 @@
 					<#--<button type="button" class="my-btn-search" onclick="setting();" style="cursor:pointer; margin-right: 50px;">设置</button>-->
                      <button type="button" class="my-btn-search" onclick="batch_add_machine('批量添加机器','${path}/admin/machine/_to_add_batch','','550');" style="cursor:pointer; margin-right: 50px;">添加机器</button>
                      &nbsp; &nbsp;
-                     <button type="button" class="my-btn-search" onclick="add_renovationmachine('批量添加机器','${path}/admin/machine/_to_add_renovation','','550');" style="cursor:pointer; margin-right: 50px;">添加翻新机</button>
+                     <button type="button" class="my-btn-search" onclick="add_renovationmachine('批量添加机器','${path}/admin/machine/_to_add_renovation','560','390');" style="cursor:pointer; margin-right: 50px;">添加翻新机</button>
 
 					<input class="my-input" type="text" name="machineBarcode" value="${machineBarcode!''}" placeholder="请输入机器编号"/>
 					<select class="my-select" name="machineIsPrint">

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

@@ -148,7 +148,7 @@
         <li style="width: 100%;height: 25px;">
             <div style="float: left;width: 200px;">软件版本:
                 <span class="text-red">
-                    <a class="rj-a" style="" href="javascript:void(0);" title="点击查看软件版本" onclick="admin_to_version(${ptsMachine.machineSoftwareVersion ! ''})">${ptsMachineVersion.machineVersionNo ! ''}</a>
+                    <a class="rj-a" style="" href="javascript:void(0);" title="点击查看软件版本" onclick="selectVersion(${ptsMachine.machineSoftwareVersion ! ''})">${ptsMachineVersion.machineVersionNo ! ''}</a>
                 </span>
             </div>
             <div style="float: left;width: 200px;">硬件版本:<span class="text-red">${ptsBom.bomVersion ! ''}</span></div>
@@ -267,5 +267,15 @@
         </li>
     </ul>
 </div>
+
+<script>
+    /**
+     * 查询版本列表
+     * @param produceId
+     */
+    function selectVersion(produceId,produceName){
+        window.location.href= "${path}/admin/machineVersion/_version_list?produceId="+ produceId;
+    }
+</script>
 </body>
 </html>

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

@@ -113,7 +113,7 @@
                         </tr>
                     </#list>
             <#else>
-                <tr><td colspan="9" class="td-manage text-c" >暂时没有零件,请添加!</td></tr>
+                <tr><td colspan="13" class="td-manage text-c" >暂时没有零件,请添加!</td></tr>
             </#if>
         </tbody>
     </table>