Bladeren bron

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/MachineController.java
wangxiaoming 7 jaren geleden
bovenliggende
commit
82f8fd3dda
17 gewijzigde bestanden met toevoegingen van 548 en 114 verwijderingen
  1. 12 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineVersionService.java
  2. 8 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineVersionServiceImpl.java
  3. 9 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineVersionMapper.xml
  4. 4 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/ptsBatchMapper.xml
  5. 2 2
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java
  6. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsBatchController.java
  7. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsBomController.java
  8. 127 10
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminSoftwareVersionController.java
  9. 6 6
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/add_batch.ftl
  10. 4 4
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/update_batch.ftl
  11. 5 5
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/add_bom.ftl
  12. 2 2
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/bom_details.ftl
  13. 0 2
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/bom_list.ftl
  14. 4 8
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/bom/update_bom.ftl
  15. 130 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_add.ftl
  16. 85 66
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_list.ftl
  17. 148 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_update.ftl

+ 12 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineVersionService.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.faces.pts;
 
 
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsBom;
 import com.iamberry.rst.core.pts.PtsComponents;
 import com.iamberry.rst.core.pts.PtsMachineVersion;
 
@@ -31,4 +32,15 @@ public interface MachineVersionService {
      * 查询单个机器版本
      * **/
     PtsMachineVersion getMachineVersion(PtsMachineVersion ptsMachineVersion);
+
+    /**
+     * 机器列表
+     * @param pageNO
+     * @param pageSize
+     * @param ptsMachineVersion
+     * @param isTotalNum
+     * @return
+     */
+    PagedResult<PtsMachineVersion> listMachineVersion(int pageNO, int pageSize, PtsMachineVersion ptsMachineVersion, boolean isTotalNum);
+
 }

+ 8 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineVersionServiceImpl.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.service.pts;
 
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsBom;
 import com.iamberry.rst.core.pts.PtsComponents;
 import com.iamberry.rst.core.pts.PtsMachineVersion;
 import com.iamberry.rst.faces.pts.MachinePartsService;
@@ -43,4 +44,11 @@ public class MachineVersionServiceImpl implements MachineVersionService {
     public PtsMachineVersion getMachineVersion(PtsMachineVersion ptsMachineVersion) {
         return machineVersionMapper.getMachineVersion(ptsMachineVersion);
     }
+
+    @Override
+    public PagedResult<PtsMachineVersion> listMachineVersion(int pageNO, int pageSize, PtsMachineVersion ptsMachineVersion, boolean isTotalNum) {
+        PageHelper.startPage(pageNO, pageSize, isTotalNum);
+        List<PtsMachineVersion> list = machineVersionMapper.listMachineVersion(ptsMachineVersion);
+        return PageUtil.getPage(list);
+    }
 }

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

@@ -14,18 +14,20 @@
     <select id="listMachineVersion" parameterType="PtsMachineVersion" resultType="PtsMachineVersion">
         SELECT
         machine_version_id AS machineVersionId,
-        produce_id AS produceId,
         machine_version_no AS  machineVersionNo,
         machine_version_name AS machineVersionName,
         machine_version_content AS  machineVersionContent,
         machine_version_type AS machineVersionType,
         machine_version_create_time AS machineVersionCreateTime,
-        machine_version_update_time AS machineVersionUpdateTime
+        machine_version_update_time AS machineVersionUpdateTime,
+        pp.produce_id AS produceId,
+        pp.produce_name AS produceName
         FROM
         tb_rst_pts_machine_version
+        LEFT JOIN tb_rst_pts_produce pp ON tb_rst_pts_machine_version.produce_id = pp.produce_id
         <where>
             <if test="produceId != null and produceId != ''">
-                produce_id = #{produceId}
+                tb_rst_pts_machine_version.produce_id = #{produceId}
             </if>
             <if test="machineVersionId != null and machineVersionId != ''">
                 AND machine_version_id = #{machineVersionId}
@@ -36,7 +38,11 @@
             <if test="machineVersionNo != null and machineVersionNo != ''">
                 AND machine_version_no like CONCAT('%',#{machineVersionNo},'%')
             </if>
+            <if test="machineVersionName != null and machineVersionName != ''">
+                AND machine_version_name like CONCAT('%',#{machineVersionName},'%')
+            </if>
         </where>
+        ORDER BY machine_version_id DESC
     </select>
 
     <select id="getMachineVersion" parameterType="PtsMachineVersion" resultType="PtsMachineVersion">

+ 4 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/ptsBatchMapper.xml

@@ -17,14 +17,14 @@
             trpp.produce_name AS produceName,
             trpb.bom_name AS bomName,
             count(tbpm.machine_id) AS generatedQuantity,
-            trpmv.machine_version_no AS softwareVersionNo,
-            trpb.machine_version_id AS batchSoftwareVersionId
+            t.batch_software_version_id AS batchSoftwareVersionId,
+            trpmv.machine_version_no AS softwareVersionNo
         FROM
             	tb_rst_pts_batch t
         LEFT JOIN tb_rst_pts_produce trpp ON t.produce_id = trpp.produce_id
         LEFT JOIN tb_rst_pts_bom trpb ON t.bom_id = trpb.bom_id
         LEFT JOIN tb_rst_pts_machine tbpm  ON t.batch_id = tbpm.machine_batch_id
-        LEFT JOIN tb_rst_pts_machine_version trpmv ON trpb.machine_version_id = trpmv.machine_version_id
+        LEFT JOIN tb_rst_pts_machine_version trpmv ON t.batch_software_version_id = trpmv.machine_version_id
         <where>
             <if test="produceId !=null">
                 AND t.produce_id = #{produceId}
@@ -49,7 +49,7 @@
             t.batch_desc AS batchDesc,
             t.batch_create_time AS batchCreateTime,
             t.batch_update_time AS batchUpdateTime,
-            trpb.machine_version_id AS batchSoftwareVersionId
+            t.batch_software_version_id AS batchSoftwareVersionId
         FROM
             tb_rst_pts_batch t
         LEFT JOIN tb_rst_pts_bom trpb ON t.bom_id = trpb.bom_id

+ 2 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java

@@ -645,7 +645,7 @@ public class AdminOrderController {
 
         // 准备model
         Map<String, Object> model = new HashMap<String, Object>();
-        model.put("fileName", "Efast订单");	// 下载文件名称
+        model.put("fileName", "Efast-order");	// 下载文件名称
 
         // 标题
         List<String> titles = new ArrayList<String>();
@@ -843,7 +843,7 @@ public class AdminOrderController {
 
         StringBuffer sb = new StringBuffer();
         for (int i = 0; i < orderEfasts.size(); i++) {
-            sb.append(orderEfasts.get(i).getPlatformOrderId() + "@");
+            sb.append(orderEfasts.get(i).getPlatformOrderId().trim() + "@");
             sb.append(orderEfasts.get(i).getOrderId() + "\r\n");
         }
         SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");

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

@@ -239,7 +239,7 @@ public class AdminPtsBatchController {
 
         //bom单
         PtsBom ptsBom = new PtsBom();
-        ptsBom.setProduceId(ptsBatch.getProduceId());
+        //ptsBom.setProduceId(ptsBatch.getProduceId());
         List<PtsBom> ptsBomsList = ptsBomService.listBom(ptsBom);
 
         //版本

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

@@ -308,7 +308,7 @@ public class AdminPtsBomController {
 
         //所有零件
         PtsComponents ptsComponents = new PtsComponents();
-        ptsComponents.setProduceId(ptsBom.getProduceId());
+        //ptsComponents.setProduceId(ptsBom.getProduceId());
         ptsComponents.setComponentsStatus(1);
         List<PtsComponents> ptsComponentsList = machinePartsService.listPtsComponentsOrderByNo(ptsComponents);
 

+ 127 - 10
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminSoftwareVersionController.java

@@ -1,15 +1,19 @@
 package com.iamberry.rst.controllers.pts;
 
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.ProduceProcess;
+import com.iamberry.rst.core.pts.PtsBom;
 import com.iamberry.rst.core.pts.PtsMachineVersion;
 import com.iamberry.rst.faces.pts.MachineVersionService;
 import com.iamberry.rst.faces.pts.ProduceService;
+import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -30,28 +34,141 @@ public class AdminSoftwareVersionController {
     private ProduceService produceService;
 
     /**
+     *  @新目录—软件版本列表
      * 查询生产产品列表
-     *
      * @param request
      * @return
      */
     @RequiresPermissions("softwareVersion:select:list")
     @RequestMapping("/_software_version_list")
-    public ModelAndView selectProduceList(HttpServletRequest request) {
+    public ModelAndView selectProduceList(HttpServletRequest request, PtsMachineVersion ptsMachineVersion,
+                                          @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                                          @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
+                                          @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
         ModelAndView mv = new ModelAndView("pts/softwareVersion/software_version_list");
-        List<Produce> list = produceService.getProduceList();
+        List<Produce> produceList = produceService.getProduceList();
 
-        //获取每个产品的所有工序
-        for (Produce produce : list){
-            ProduceProcess produceProcess = new ProduceProcess();
-            produceProcess.setProduceId(produce.getProduceId());
-            List<ProduceProcess> produceProcessesList = produceService.listProduceProcess(produceProcess);
-            produce.setProcess(produceProcessesList);
+        PagedResult<PtsMachineVersion> pagedResult = machineVersionService.listMachineVersion(pageNO, pageSize, ptsMachineVersion, totalNum == 0);
+        if (totalNum != 0) {
+            pagedResult.setTotal(totalNum);
         }
-        mv.addObject("resultList", list);
+        mv.addObject("produceList", produceList);
+        StitchAttrUtil.setModelAndView(ptsMachineVersion, mv, "/admin/softwareVersion/_software_version_list", pagedResult);
+        return mv;
+    }
+
+    /**
+     *  @新目录—软件版本列表
+     *跳转到添加软件版本
+     * **/
+    @RequiresPermissions("softwareVersion:add:softwareVersion")
+    @RequestMapping("/_to_add_version")
+    public ModelAndView toAddMachineVersion(HttpServletRequest request){
+        ModelAndView mv = new ModelAndView("pts/softwareVersion/software_version_add");
+        List<Produce> produceList = produceService.getProduceList();
+        mv.addObject("produceList", produceList);
+        return mv;
+    }
+
+    /**
+     *  @新目录—软件版本列表
+     * 添加机器版本
+     * **/
+    @ResponseBody
+    @RequiresPermissions("softwareVersion:add:softwareVersion")
+    @RequestMapping("/add_version")
+    public ResponseJson addVersion(HttpServletRequest request,PtsMachineVersion ptsMachineVersion){
+        if(ptsMachineVersion == null){
+            return new ResponseJson(500, "添加信息不全", 500);
+        }
+        PtsMachineVersion version = new PtsMachineVersion();
+        version.setMachineVersionNo(ptsMachineVersion.getMachineVersionNo());
+        version.setProduceId(ptsMachineVersion.getProduceId());
+        version.setMachineVersionType(ptsMachineVersion.getMachineVersionType());
+        version = machineVersionService.getMachineVersion(version);
+        if(version != null){
+            return new ResponseJson(500, "版本号重复", 500);
+        }
+        ptsMachineVersion.setMachineVersionCreateTime(new Date());
+        ptsMachineVersion.setMachineVersionType(1);//软件版本默认为1
+        Integer msg =  machineVersionService.addMachineVersion(ptsMachineVersion);
+        if(msg > 0){
+            return new ResponseJson(200, "添加成功", 200);
+        }else{
+            return new ResponseJson(500, "添加失败", 500);
+        }
+    }
+
+    /**
+     *  @新目录—软件版本列表
+     * 进入修改机器版本页面
+     * **/
+    @RequiresPermissions("machineVersion:update:machineVersion")
+    @RequestMapping("/_to_update_version")
+    public ModelAndView toUpdateVersion(HttpServletRequest request){
+        ModelAndView mv = new ModelAndView("pts/softwareVersion/software_version_update");
+        String machineVersionId = request.getParameter("machineVersionId");
+        PtsMachineVersion ptsMachineVersion = new PtsMachineVersion();
+        ptsMachineVersion.setMachineVersionId(Integer.valueOf(machineVersionId));
+        ptsMachineVersion = machineVersionService.getMachineVersion(ptsMachineVersion);
+        mv.addObject("ptsMachineVersion", ptsMachineVersion);
+        List<Produce> list = produceService.getProduceList();
+        mv.addObject("produceList", list);
         return mv;
     }
 
+    /**
+     * @新目录—软件版本列表
+     * 修改机器版本
+     * **/
+    @ResponseBody
+    @RequiresPermissions("machineVersion:update:machineVersion")
+    @RequestMapping("/update_version")
+    public ResponseJson update_version(HttpServletRequest request,PtsMachineVersion ptsMachineVersion){
+        if(ptsMachineVersion == null){
+            return new ResponseJson(500, "修改失败", 500);
+        }
+        PtsMachineVersion version = new PtsMachineVersion();
+        version.setMachineVersionId(ptsMachineVersion.getMachineVersionId());
+        version = machineVersionService.getMachineVersion(version);
+
+        boolean flag = false;
+        if(version.getProduceId().equals(ptsMachineVersion.getProduceId())){
+            if(version.getMachineVersionNo().equals(ptsMachineVersion.getMachineVersionNo())){
+                flag = true;
+            }else{
+                PtsMachineVersion version2 = new PtsMachineVersion();
+                version2.setMachineVersionNo(ptsMachineVersion.getMachineVersionNo());
+                version2.setProduceId(ptsMachineVersion.getProduceId());
+                version2 = machineVersionService.getMachineVersion(version2);
+                if(version2 == null){
+                    flag = true;
+                }
+            }
+        }else{
+            PtsMachineVersion version2 = new PtsMachineVersion();
+            version2.setMachineVersionNo(ptsMachineVersion.getMachineVersionNo());
+            version2.setProduceId(ptsMachineVersion.getProduceId());
+            version2 = machineVersionService.getMachineVersion(version2);
+            if(version2 == null){
+                flag = true;
+            }
+        }
+        Integer msg = 0;
+        if(flag){
+            ptsMachineVersion.setMachineVersionUpdateTime(new Date());
+            msg =  machineVersionService.updateVersion(ptsMachineVersion);
+        }else{
+            return new ResponseJson(500, "版本号重复", 500);
+        }
+
+        if(msg > 0){
+            return new ResponseJson(200, "修改成功", 200);
+        }else{
+            return new ResponseJson(500, "修改失败", 500);
+        }
+    }
+
 
     /**
      * 进入添加机器版本页面

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

@@ -81,7 +81,7 @@
             </div>
         </div>
 
-        <#--<div class="row cl">
+        <div class="row cl">
             <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">
@@ -90,7 +90,7 @@
 				</span>
                 <span id="batchSoftwareVersionIdMsg" style="color: red;"></span>
             </div>
-        </div>-->
+        </div>
 
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Bom单:</label>
@@ -206,7 +206,7 @@
         /*添加页面初始化,将根据产品的来获取bom和软件版本*/
         var produceId = $("[name='produceId']").val();
         getBomByProduce(produceId);
-        //getVersionByProduce(produceId);
+        getVersionByProduce(produceId);
 
         /*初始化一个颜色*/
         addBatchColor('','');
@@ -215,7 +215,7 @@
         $("[name='produceId']").change(function(){
             var produceId = $(this).val();
             getBomByProduce(produceId);
-           //getVersionByProduce(produceId);
+           getVersionByProduce(produceId);
         })
     })
     
@@ -275,7 +275,7 @@
     }
 
     /*根据产品获取软件版本*/
-   /* function getVersionByProduce(produceId) {
+    function getVersionByProduce(produceId) {
         $.ajax({
             type: "POST",
             data: {
@@ -302,7 +302,7 @@
             }
         });
     }
-*/
+
     /**
      * 添加颜色
      * colorName

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

@@ -101,7 +101,7 @@
             </div>
         </div>
 
-       <#-- <div class="row cl">
+       <div class="row cl">
             <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">
@@ -115,7 +115,7 @@
 				</span>
                 <span id="batchSoftwareVersionIdMsg" style="color: red;"></span>
             </div>
-        </div>-->
+        </div>
 
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Bom单:</label>
@@ -288,7 +288,7 @@
     }
 
     /*根据产品获取软件版本*/
-    /*function getVersionByProduce(produceId) {
+    function getVersionByProduce(produceId) {
         $.ajax({
             type: "POST",
             data: {
@@ -314,7 +314,7 @@
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
         });
-    }*/
+    }
 
     /*添加颜色*/
     function addBatchColor(colorName,colorQuantity) {

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

@@ -65,7 +65,7 @@
             </div>
         </div>
 
-        <div class="row cl">
+       <#-- <div class="row cl">
             <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" size="1" id="machineVersionId" name="machineVersionId" datatype="*" errormsg="请选择软件版本">
@@ -79,7 +79,7 @@
                     </select>
 				</span>
             </div>
-        </div>
+        </div>-->
 
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3">备注:</label>
@@ -193,7 +193,7 @@
 
             var produceId = $(this).val();
             getBomByProduce(produceId);
-            getMachineVersion(produceId);
+            //getMachineVersion(produceId);
 
             delComponent(0,"all");
             addComponents("#","");
@@ -362,7 +362,7 @@
     }
 
     /* 获取软件版本 */
-    function getMachineVersion(produceId){
+   /* function getMachineVersion(produceId){
         var html = '';
         $.ajax({
             type: "POST",
@@ -385,7 +385,7 @@
             }
         });
         $("#machineVersionId").html(html);
-    }
+    }*/
 
     /*当选择产品或者bom不选择时,都需要重置所有的输入框和表格*/
     function defaultAllInput() {

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

@@ -65,10 +65,10 @@
                 <span class="my-con-left content">${ptsBom.bomVersion ! ''}</span>
             </div>
 
-            <div class="input-box">
+          <#--  <div class="input-box">
                 <span class="my-con-right content">软件版本:</span>&nbsp;&nbsp;
                 <span class="my-con-left content">${ptsBom.machineVersionNo ! ''}</span>
-            </div>
+            </div>-->
 
             <div class="input-box">
                 <span class="my-con-right content">Bom备注:</span>&nbsp;&nbsp;

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

@@ -57,7 +57,6 @@
             <th width="60">所属产品</th>
             <th width="100">bom名称</th>
             <th width="80">硬件版本</th>
-            <th width="80">软件版本</th>
             <th width="80">零件总数量</th>
             <th width="80">零件总成本(元)</th>
             <th width="80">零件总重(g)</th>
@@ -75,7 +74,6 @@
                             <td>${bom.produceName!''}</td>
                             <td>${bom.bomName!''}</td>
                             <td>${bom.bomVersion!''}</td>
-                            <td>${bom.machineVersionNo!''}</td>
                             <td>${bom.componentsQuantity/100 !'0'}</td>
                             <td><#if bom.allComponentsCost?? >${bom.allComponentsCost/10000}</#if></td>
                             <td><#if bom.allComponentsWeight?? >${bom.allComponentsWeight/100}</#if></td>

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

@@ -55,7 +55,7 @@
             </div>
         </div>
 
-        <div class="row cl">
+       <#-- <div class="row cl">
             <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" size="1" id="machineVersionId" name="machineVersionId" datatype="*" errormsg="请选择软件版本">
@@ -69,7 +69,7 @@
                     </select>
 				</span>
             </div>
-        </div>
+        </div>-->
 
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3">备注:</label>
@@ -205,10 +205,6 @@
         });
     }
 
-    $(function(){
-    })
-
-
     var allComponents;  //所有零件的集合
 
     $(function () {
@@ -333,7 +329,7 @@
     }
 
     /* 获取软件版本 */
-    function getMachineVersion(produceId){
+    /*function getMachineVersion(produceId){
         var html = '';
         $.ajax({
             type: "POST",
@@ -356,7 +352,7 @@
             }
         });
         $("#machineVersionId").html(html);
-    }
+    }*/
 
     /*当选择产品或者bom不选择时,都需要重置所有的输入框和表格*/
     function defaultAllInput() {

+ 130 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_add.ftl

@@ -0,0 +1,130 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<meta name="renderer" content="webkit|ie-comp|ie-stand">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+<meta http-equiv="Cache-Control" content="no-siteapp" />
+<link rel="Bookmark" href="/favicon.ico" >
+<link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/add_base.ftl">
+    <link href="${path }/common/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
+<title>添加软件版本</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 软件版本管理
+    <span class="c-gray en">&gt;</span> 添加软件版本
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;width: 600px;margin: 0 auto;">
+	<form action="" method="post" class="form form-horizontal" id="form-parts-add">
+
+        <input type="hidden" name="machineVersionType" id="machineVersionType" value="1">
+
+        <div class="row cl">
+            <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" size="1" name="produceId" id="produceId">
+                <#if (produceList ?size > 0)>
+                    <#list produceList as list>
+                        <option value ="${list.produceId}">${list.produceName}</option>
+                    </#list>
+                <#else >
+                    <option value ="">暂无产品,请到生产产品列表添加产品</option>
+                </#if>
+				</select>
+				</span> </div>
+        </div>
+
+		<div class="row cl">
+			<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">
+				<input type="text" class="input-text" value=""  id="machineVersionNo" name="machineVersionNo" placeholder="请输入1-10位版本号,支持英文、数字组合">
+			</div>
+		</div>
+        <div class="row cl">
+            <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">
+                <input type="text" class="input-text" value=""  id="machineVersionName" name="machineVersionName" placeholder="请输入1-30位的名称,支持中文、字母、数字">
+            </div>
+        </div>
+
+
+        <div class="row cl">
+            <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">
+                <textarea name="machineVersionContent" id="machineVersionContent" cols="" rows="" class="textarea"  placeholder="请详细描述本次版本更新内容,较上次修复内容" onKeyUp="$.Huitextarealength(this,300)"></textarea>
+                <p class="textarea-numberbar"><em class="textarea-length">0</em>/300</p>
+            </div>
+        </div>
+		<div class="row cl">
+			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
+				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
+			</div>
+		</div>
+	</form>
+</article>
+<script type="text/javascript">
+    $(function(){
+	$('.skin-minimal input').iCheck({
+		checkboxClass: 'icheckbox-blue',
+		radioClass: 'iradio-blue',
+		increaseArea: '20%'
+	});
+	
+	$("#form-parts-add").validate({
+		rules:{
+            produceId:{
+                required:true
+            },
+            machineVersionNo:{
+				required:true,
+				minlength:2,
+				maxlength:10
+			},
+            machineVersionName:{
+				required:true,
+                minlength:2,
+                maxlength:30
+			},
+            machineVersionContent:{
+				required:true,
+                minlength:1,
+                maxlength:300
+			}
+		},
+		onkeyup:false,
+		focusCleanup:true,
+		success:"valid",
+		submitHandler:function(form){
+
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $("#form-parts-add").serialize(),
+                url: "${path}/admin/softwareVersion/add_machineVersion",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg('添加成功!', {icon: 1, time: 2000});
+                        window.location.href = document.referrer;
+                    }else{
+                        layer.msg('添加失败!', {icon: 2, time: 2000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('添加失败!', {icon: 2, time: 2000});
+                }
+            });
+
+		}
+	});
+});
+</script> 
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 85 - 66
watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_list.ftl

@@ -8,28 +8,15 @@
     <meta http-equiv="Cache-Control" content="no-siteapp" />
     <link rel="Bookmark" href="/favicon.ico" >
     <link rel="Shortcut Icon" href="/favicon.ico" />
-    <#include "/base/list_base.ftl">
+<#include "/base/list_base.ftl">
     <title>软件版本列表</title>
     <style>
-        .chanpin-list{margin: 0;padding: 10px;list-style-type: none;}
-        .chanpin-list>li{display: table-cell;width: 230px;border-left: 1px solid rgba(0,0,0,.1);border-bottom: 1px solid rgba(0,0,0,.1);background-color: #fff;position: relative;border-right: 30px solid transparent;padding-bottom: 30px;}
-        .chanpin-list>li:after{content: '';position: absolute;right: 0;width: 1px;height: 100%;background-color: #ccc;-webkit-transform:scaleX(.5);  top:0;}
-        .chanpin-list>li .title{background-color: #32a3d8;text-align: center;color: #fff;padding: 12px 0;}
-        .chanpin-list>li .title>span{padding:3px 3px 3px 28px;background: url(${path}/common/images/pts/jiqi-1.png) left center no-repeat;background-size:auto 80%;}
-        .items-list{margin: 0;padding: 20px 25px;list-style: none;}
-        .items-list>li{margin: 12px 0;font-size: 13px;position: relative;padding-left: 13px;color: #666;}
-        .items-list>li:after{content: '';position: absolute;left: 0;top: 5px;width: 5px;height: 5px;border-radius: 50%;border: 1px solid #32a3d8;}
-        .my-btn-edit{padding: 6px 20px;background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;display: block;
-            width: 100px;
-            left: 50%;
-            position: absolute;bottom: 10px;margin-left: 5px;}
-        .my-btn-select{padding: 6px 20px;background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;display: block;
-            width: 60%;
-            position: absolute;bottom: 10px;    margin-left: 20%;text-align: center;}
-        .chanpin-list>.li-add{width: 230px;height: 280px;text-align: center;display: table;padding-top: 55px;position: relative;cursor:pointer;}
-        .chanpin-list>.li-add:before{content: '';width: 5px;height: 80px; position: absolute;left: 50%;top: 90px;background-color: #32a3d8;border-radius: 50px;}
-        .chanpin-list>.li-add:after{content: '';height: 5px;width: 80px;position: absolute;left: 75px;top: 128px;background-color: #32a3d8;border-radius: 50px;-webkit-transform:scaleX(1);}
-        .chanpin-list>.li-add>div{display: table-cell;vertical-align: middle;height: 100%;width: 100%;text-align: center;color: #32a3d8;}
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .barcodeImg{margin:10px 0px}
+        .table-bg thead th{background-color: #e2f6ff;}
         input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/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(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
     </style>
@@ -38,65 +25,97 @@
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
     <span class="c-gray en">&gt;</span> 软件版本管理
     <span class="c-gray en">&gt;</span> 软件版本列表
-    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
 </nav>
 <div class="page-container">
-
-        <ul class="chanpin-list">
-
-        <#list resultList as produce>
-            <li>
-                <div class="title" <#if produce.produceStatus == 0>style="background-color: #ccc;"</#if>>
-                    <span>${produce.produceName!}</span>
-                </div>
-                <ul class="items-list">
-                    <#list produce.process as process>
-                        <li>${process.processName!}</li>
-                    </#list>
-                </ul>
-                <#--<button type="button" onclick="updateProduce(${produce.produceId!})" class="my-btn-edit">编辑流程</button>-->
-                <div>
-                    <button type="button" onclick="selectVersion('${produce.produceId!}','${produce.produceName!}')" class="my-btn-select">软件版本</button>
-                </div>
-            </li>
-        </#list>
-           <#-- <div class="li-add">
-                <div>添加产品</div>
-            </div>-->
-        </ul>
-    <div>
-
+    <div class="text-c" >
+        <form action="${path}/admin/softwareVersion/_software_version_list" method="post" >
+            <button type="button" style="cursor:pointer; float: left;" class="my-btn-search" onclick="toAddMachineVersion();">增加软件版本</button>
+            <select class="my-select" name="produceId" style="height: 36px;width: 150px">
+                <option value ="">所有产品</option>
+            <#if produceList?? &&  (produceList?size > 0) >
+                <#list produceList as produce>
+                    <option value ="${produce.produceId!}" <#if produceId??><#if produceId ==produce.produceId >selected="selected"</#if></#if>>${produce.produceName!}</option>
+                </#list>
+            </#if>
+            </select>
+            <input type="text" class="my-input"  style="width:150px" value="${machineVersionNo!}" placeholder="版本号" id="machineVersionNo" name="machineVersionNo">
+            <input type="text" class="my-input"  style="width:150px" value="${machineVersionName!}" placeholder="软件版本名称" id="machineVersionName" name="machineVersionName">
+            <button type="submit" class="my-btn-search" style="cursor:pointer;" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+           <#-- <input class="my-btn-search" style="cursor:pointer;" data-loading-text="请勿重复提交" type="button" value="上传Excel" onClick="upFiles()">
+            <button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>-->
+        </form>
     </div>
 
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort">
+            <thead>
+            <tr class="text-c">
+                <th hidden="hidden" width="50">软件版本id</th>
+                <th width="30">所属产品</th>
+                <th width="30">版本号</th>
+                <th width="60">版本名称</th>
+                <th width="200">更新内容</th>
+                <th width="45">创建时间</th>
+                <th width="10">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <#if page.dataList?? &&  (page.dataList?size > 0) >
+                <#list page.dataList as ptsMachineVersion>
+                <tr class="text-c">
+                    <td hidden="hidden">${ptsMachineVersion.machineVersionId!''}</td>
+                    <td>${ptsMachineVersion.produceName!''}</td>
+                    <td>${ptsMachineVersion.machineVersionNo!''}</td>
+                    <td>${ptsMachineVersion.machineVersionName!''}</td>
+                    <td>
+                        <#if (ptsMachineVersion.machineVersionContent?length > 80)>
+                            ${ptsMachineVersion.machineVersionContent?substring(0,80)}
+                        <#else>
+                             ${ptsMachineVersion.machineVersionContent}
+                        </#if>
+                    </td>
+                    <td>${(ptsMachineVersion.machineVersionCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                    <td>
+                        <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_machineVersion(${ptsMachineVersion.machineVersionId!''})">
+                            <i class="Hui-iconfont">&#xe6df;</i>
+                        </a>&nbsp;
+                    </td>
+                </tr>
+                </#list>
+            <#else>
+            <tr><td colspan="11" class="td-manage text-c" >暂时没有软件版本,请添加!</td></tr>
+            </#if>
+            </tbody>
+        </table>
+    </div>
 </div>
-<#--<#include "/base/page_util.ftl">-->
-<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
-<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
-<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
-<script type="text/javascript">
-    $(function(){
-       $(".li-add").click(function () {
-           window.location.href= "${path}/admin/produce/to_save_produce";
-       })
-    })
-
+<tfoot>
+<#include "/base/page_util.ftl">
+</tfoot>
+<script>
     /**
-     * 跳转到修改页面
-     * @param produceId
+     * 跳转到添加bom页面
      */
-    function updateProduce(produceId){
-        window.location.href= "${path}/admin/produce/to_update_produce?produceId="+ produceId;
+    function toAddMachineVersion(){
+        window.location.href= "${path}/admin/softwareVersion/_to_add_version";
     }
 
     /**
-     * 查询版本列表
-     * @param produceId
+     *跳转到编辑页面
+     * @param employee
      */
-    function selectVersion(produceId,produceName){
-        window.location.href= "${path}/admin/machineVersion/_version_list?produceId="+ produceId+"&produceName="+encodeURI(produceName);
+    function admin_update_machineVersion(machineVersionId) {
+        window.location.href= "${path}/admin/softwareVersion/_to_update_version?machineVersionId="+machineVersionId;
     }
 
-</script>
 
+    /**
+     * 下载模板
+     */
+    function downloadExcel(){
+        window.location.href= "${path}/common/images/uploadExcel/Bom单上传模板.xls";
+    }
+</script>
 </body>
 </html>

+ 148 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/softwareVersion/software_version_update.ftl

@@ -0,0 +1,148 @@
+<!--_meta 作为公共模版分离出去-->
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<meta name="renderer" content="webkit|ie-comp|ie-stand">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+<meta http-equiv="Cache-Control" content="no-siteapp" />
+<link rel="Bookmark" href="/favicon.ico" >
+<link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/add_base.ftl">
+    <link href="${path }/common/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
+<title>修改软件版本</title>
+    <style>
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .barcodeImg{margin:10px 0px}
+        .table-bg thead th{background-color: #e2f6ff;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/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(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 软件版本管理
+    <span class="c-gray en">&gt;</span> 修改软件版本
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;width: 600px;margin: 0 auto;">
+	<form action="" method="post" class="form form-horizontal" id="form-parts-add">
+
+        <div class="row cl">
+            <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" size="1" name="produceId" id="produceId">
+                <#if (produceList ?size > 0)>
+                    <#list produceList as list>
+                        <option value ="${list.produceId}" <#if ptsMachineVersion.produceId == list.produceId>selected</#if>>${list.produceName}</option>
+                    </#list>
+                <#else >
+                    <option value ="">暂无产品,请到生产产品列表添加产品</option>
+                </#if>
+				</select>
+				</select>
+				</span> </div>
+        </div>
+
+		<div class="row cl">
+			<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">
+				<input type="text" class="input-text" value="${ptsMachineVersion.machineVersionNo}"  id="machineVersionNo" name="machineVersionNo" placeholder="请输入1-10位版本号,支持英文、数字组合">
+			</div>
+		</div>
+        <div class="row cl">
+            <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">
+                <input type="text" class="input-text" value="${ptsMachineVersion.machineVersionName}"  id="machineVersionName" name="machineVersionName" placeholder="请输入1-30位的名称,支持中文、字母、数字">
+            </div>
+        </div>
+
+
+        <div class="row cl">
+            <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">
+                <textarea name="machineVersionContent" id="machineVersionContent" cols="" rows="" class="textarea"  placeholder="请详细描述本次版本更新内容,较上次修复内容" onKeyUp="$.Huitextarealength(this,300)">${ptsMachineVersion.machineVersionContent}</textarea>
+                <p class="textarea-numberbar"><em class="textarea-length">0</em>/300</p>
+            </div>
+        </div>
+		<div class="row cl">
+			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
+				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
+                <input type="hidden" value="${ptsMachineVersion.produceId!''}" id="oldProduceId">
+                <input type="hidden" value="${ptsMachineVersion.machineVersionId!''}" name="machineVersionId" id="machineVersionId">
+			</div>
+		</div>
+	</form>
+</article>
+<script type="text/javascript" src="${path}/common/kingedit/kindeditor.js"></script>
+<script type="text/javascript" src="${path}/common/kingedit/lang/zh_CN.js"></script>
+<script type="text/javascript">
+
+
+
+    $(function(){
+	$('.skin-minimal input').iCheck({
+		checkboxClass: 'icheckbox-blue',
+		radioClass: 'iradio-blue',
+		increaseArea: '20%'
+	});
+	
+	$("#form-parts-add").validate({
+		rules:{
+            produceId:{
+                required:true
+            },
+            machineVersionNo:{
+				required:true,
+				minlength:2,
+				maxlength:10
+			},
+            machineVersionName:{
+				required:true,
+                minlength:2,
+                maxlength:30
+			},
+            machineVersionContent:{
+				required:true,
+                minlength:1,
+                maxlength:300
+			}
+		},
+		onkeyup:false,
+		focusCleanup:true,
+		success:"valid",
+		submitHandler:function(form){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $("#form-parts-add").serialize(),
+                url: "${path}/admin/softwareVersion/update_version",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg('修改成功!', {icon: 1, time: 2000});
+                        /*window.location.href = '${path}/admin/machineVersion/version_list?produceId='+$("#oldProduceId").val();*/
+                        window.location.href = document.referrer;
+                    }else{
+                        layer.msg(data.resultMsg, {icon: 2, time: 2000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('添加失败!', {icon: 2, time: 2000});
+                }
+            });
+
+		}
+	});
+});
+</script> 
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>