wangxiaoming 7 rokov pred
rodič
commit
506e14d4bb

+ 19 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsMachine.java

@@ -31,6 +31,9 @@ public class PtsMachine implements Serializable{
     private Integer machineBomId; //bom单id
     private Integer machineIsRetreading; //是否翻新机
 
+    private String machineSoftwareVersionName;  //软件版本
+    private String machineHardwareVersionName;  //硬件版本
+
     private String  machineLine; //拉线
 
     public Integer getMachineId() {
@@ -208,4 +211,20 @@ public class PtsMachine implements Serializable{
     public void setMachineLine(String machineLine) {
         this.machineLine = machineLine;
     }
+
+    public String getMachineSoftwareVersionName() {
+        return machineSoftwareVersionName;
+    }
+
+    public void setMachineSoftwareVersionName(String machineSoftwareVersionName) {
+        this.machineSoftwareVersionName = machineSoftwareVersionName;
+    }
+
+    public String getMachineHardwareVersionName() {
+        return machineHardwareVersionName;
+    }
+
+    public void setMachineHardwareVersionName(String machineHardwareVersionName) {
+        this.machineHardwareVersionName = machineHardwareVersionName;
+    }
 }

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

@@ -57,24 +57,28 @@
 
     <select id="listMachine" parameterType="PtsMachine" 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,
-         machine_produce_type machineProduceType,
-         machine_produce_id machineProduceId
-         FROM  tb_rst_pts_machine
+            t.machine_id machineId,
+            t.machine_qrcode machineQrcode,
+            t.machine_barcode machineBarcode,
+            t.machine_sales_date machineSalesDate,
+            t.machine_sales_state machineSalesState,
+            t.machine_status machineStatus,
+            t.machine_produced_time machineProducedTime,
+            t.machine_sub_time machineSubTime,
+            t.machine_is_print machineIsPrint,
+            t.machine_compound_img machineCompoundImg,
+            t.machine_process_state machineProcessState,
+            t.machine_software_version machineSoftwareVersion,
+            t.machine_hardware_version machineHardwareVersion,
+            t.machine_create_time machineCreateTime,
+            t.machine_update_time machineUpdateTime,
+            t.machine_produce_type machineProduceType,
+            t.machine_produce_id machineProduceId,
+            trpb.bom_version AS machineHardwareVersionName,
+            trpmv.machine_version_no AS machineSoftwareVersionName
+        FROM  tb_rst_pts_machine t
+        LEFT JOIN tb_rst_pts_bom trpb ON t.machine_bom_id = trpb.bom_id
+        LEFT JOIN tb_rst_pts_machine_version trpmv ON t.machine_software_version = trpmv.machine_version_id
         <where>
             <if test="machineBarcode != null and machineBarcode != ''">
                 machine_barcode = #{machineBarcode}

+ 6 - 6
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsBomController.java

@@ -292,16 +292,16 @@ public class AdminPtsBomController {
         //查询bom信息
         PtsBom ptsBom = new PtsBom();
         ptsBom.setBomId(Integer.valueOf(bomId));
-        ptsBom = ptsBomService.getPtsBom(ptsBom);
+        ptsBom = ptsBomService.getPtsBomDetails(ptsBom);
 
         //所有零件
-        PtsComponents ptsComponents = new PtsComponents();
-        ptsComponents.setProduceId(ptsBom.getProduceId());
-        ptsComponents.setComponentsStatus(1);
-        List<PtsComponents> ptsComponentsList = machinePartsService.listPtsComponents(ptsComponents);
+//        PtsComponents ptsComponents = new PtsComponents();
+//        ptsComponents.setProduceId(ptsBom.getProduceId());
+//        ptsComponents.setComponentsStatus(1);
+//        List<PtsComponents> ptsComponentsList = machinePartsService.listPtsComponents(ptsComponents);
 
         mv.addObject("ptsBom", ptsBom);
-        mv.addObject("ptsComponentsList", ptsComponentsList);
+//        mv.addObject("ptsComponentsList", ptsComponentsList);
         return mv;
     }
 

+ 15 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/add_batch.ftl

@@ -302,8 +302,16 @@
         });
     }
 
-    /*添加颜色*/
+    /**
+     * 添加颜色
+     * colorName
+     * */
     function addBatchColor(colorName,colorQuantity) {
+        //判断颜色数量
+        if(getColorNumber() >= 9){
+            layer.msg("添加的颜色不能超过9个", {icon: 5, time: 3000});
+            return false;
+        }
         var notAddColor = colorAll
         var opHtml = '';
         for(var i=0;i<notAddColor.length;i++){
@@ -327,6 +335,12 @@
         $("#batchColorAll").append(html);
     }
 
+    /*获取颜色数量*/
+    function getColorNumber(){
+        var number = $("#batchColorAll").find("tr").length;
+        return number;
+    }
+
     /*删除颜色  type=all时删除所有的颜色,但必须要保留一个颜色 */
     function delComponent(node,type) {
         if(type == "all"){

+ 11 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/update_batch.ftl

@@ -318,6 +318,11 @@
 
     /*添加颜色*/
     function addBatchColor(colorName,colorQuantity) {
+        //判断颜色数量
+        if(getColorNumber() >= 9){
+            layer.msg("添加的颜色不能超过9个", {icon: 5, time: 3000});
+            return false;
+        }
         var notAddColor = colorAll
         var opHtml = '';
         for(var i=0;i<notAddColor.length;i++){
@@ -341,6 +346,12 @@
         $("#batchColorAll").append(html);
     }
 
+    /*获取颜色数量*/
+    function getColorNumber(){
+        var number = $("#batchColorAll").find("tr").length;
+        return number;
+    }
+
     /*删除颜色  type=all时删除所有的颜色,但必须要保留一个颜色 */
     function delComponent(node,type) {
         if(type == "all"){

+ 28 - 29
watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/bom_details.ftl

@@ -93,40 +93,39 @@
                             <th width="">零件数量</th>
                             <th width="">零件成本(元)</th>
                             <th width="">零件净重(g)</th>
+                            <th width="">零件规格</th>
                             <th width="">零件供应商</th>
                         </tr>
                         </thead>
                         <tbody id="componentaAll">
-                        <#if ptsBom.ptsBomComponentsList?? &&  (ptsBom.ptsBomComponentsList?size > 0) >
-                            <#list ptsBom.ptsBomComponentsList  as bomComponents>
-                                <#list ptsComponentsList as ptsComponents>
-                                    <#if bomComponents.componentsId == ptsComponents.componentsId >
-                                        <#assign compont = ptsComponents/>
-                                    </#if>
+                            <#if ptsBom.ptsBomComponentsList?? &&  (ptsBom.ptsBomComponentsList?size > 0) >
+                                <#list ptsBom.ptsBomComponentsList  as bomComponents>
+                                    <#assign compont = bomComponents.ptsComponents/>
+                                        <tr class="text-c">
+                                            <td>
+                                                ${compont.componentsNo}
+                                            </td>
+                                            <td>
+                                                ${compont.componentsName}
+                                            </td>
+                                            <td>
+                                                ${bomComponents.bomComponentsQuantity}
+                                            </td>
+                                            <td>
+                                                <#if compont.componentsCost?? >${compont.componentsCost/100}</#if>
+                                            </td>
+                                            <td>
+                                                ${compont.componentsWeight}
+                                            </td>
+                                            <td>
+                                            ${compont.componentsSpecification}
+                                            </td>
+                                            <td>
+                                                ${compont.supplierName}
+                                            </td>
+                                        </tr>
                                 </#list>
-
-                            <tr class="text-c">
-                                <td>
-                                    ${compont.componentsNo}
-                                </td>
-                                <td>
-                                    ${compont.componentsName}
-                                </td>
-                                <td>
-                                    ${bomComponents.bomComponentsQuantity}
-                                </td>
-                                <td>
-                                    <#if compont.componentsCost?? >${compont.componentsCost/100}</#if>
-                                </td>
-                                <td>
-                                    ${compont.componentsWeight}
-                                </td>
-                                <td>
-                                    ${compont.supplierName}
-                                </td>
-                            </tr>
-                            </#list>
-                        </#if>
+                            </#if>
                         </tbody>
                     </table>
                 </div>

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/bom_list.ftl

@@ -51,7 +51,7 @@
         <table class="table table-border table-bordered table-bg table-hover table-sort">
         <thead>
         <tr class="text-c">
-            <th width="50">Bom编号</th>
+            <#--<th width="50">Bom编号</th>-->
             <th width="60">所属产品</th>
             <th width="100">bom名称</th>
             <th width="80">硬件版本</th>
@@ -68,7 +68,7 @@
             <#if page.dataList?? &&  (page.dataList?size > 0) >
                     <#list page.dataList as bom>
                         <tr class="text-c">
-                            <td>${bom.bomId!''}</td>
+                            <#--<td>${bom.bomId!''}</td>-->
                             <td>${bom.produceName!''}</td>
                             <td>${bom.bomName!''}</td>
                             <td>${bom.bomVersion!''}</td>

+ 14 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/update_bom.ftl

@@ -28,7 +28,7 @@
         <input type="hidden" value="${ptsBom.produceId}" id="produceId" name="produceId">
 
         <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-3">所属产品:</label>
+            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所属产品:</label>
             <div class="formControls col-xs-8 col-sm-9" > <span class="select-box">
 				<select class="select" disabled="disabled" style="background: #eee;" datatype="*" errormsg="请选择产品">
                 <#if produceList?? &&  (produceList?size > 0) >
@@ -152,6 +152,12 @@
                     ptsBomComponentsList.push(ptsBomComponents);
                 })
                 $("#bomComponentJson").val(JSON.stringify(ptsBomComponentsList));
+
+                var componentLength = $("#componentaAll").find("tr").length;
+                if(componentLength < 1){
+                    layer.msg('必须要有一个零件', {icon: 5, time: 3000});
+                    return false;
+                }
             },
             callback: function (data) {//异步回调函数
                 if (data) {
@@ -216,7 +222,13 @@
                 $(this).remove();
             })
         }else{
-            $(node).parent().parent().remove();
+            //删除零件必须保证还有一个零件
+            var componentLength = $("#componentaAll").find("tr").length;
+            if(componentLength > 1){
+                $(node).parent().parent().remove();
+            }else{
+                layer.msg('必须要有一个零件', {icon: 5, time: 3000});
+            }
         }
     }
 

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

@@ -119,8 +119,8 @@
 							</#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="text-c" width="50">${list.machineHardwareVersionName!''}</td>
+                            <td class="text-c" width="50">${list.machineSoftwareVersionName!''}</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>