Selaa lähdekoodia

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

wangxiaoming 7 vuotta sitten
vanhempi
commit
78a7c8844f

+ 28 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProduceProcess.java

@@ -28,6 +28,34 @@ public class ProduceProcess implements Serializable {
 
     private String json;    //传入的json字符串
 
+    private String produceName;             //产品名称
+    private String employeeName;            //员工名称
+    private String deviceName;              //设备名称
+
+    public String getEmployeeName() {
+        return employeeName;
+    }
+
+    public void setEmployeeName(String employeeName) {
+        this.employeeName = employeeName;
+    }
+
+    public String getDeviceName() {
+        return deviceName;
+    }
+
+    public void setDeviceName(String deviceName) {
+        this.deviceName = deviceName;
+    }
+
+    public String getProduceName() {
+        return produceName;
+    }
+
+    public void setProduceName(String produceName) {
+        this.produceName = produceName;
+    }
+
     public Integer getProcessId() {
         return processId;
     }

+ 17 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsDevice.java

@@ -1,7 +1,12 @@
 package com.iamberry.rst.core.pts;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * Created by Administrator on 2017/8/25.
@@ -11,12 +16,24 @@ public class PtsDevice implements Serializable{
     private Integer deviceId;//设备id
     private String deviceNumber;//设备编号
     private String deviceName;//设备名称
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date deviceDate;//购买日期
     private Integer deviceStatus;//设备状态
     private String deviceRemake;//设备备注
     private Date deviceCreateTime;//创建时间
     private Date deviceUpdateTime;//修改时间
 
+    private List<ProduceProcess> processList = new ArrayList<ProduceProcess>();//产品工序集合
+
+    public List<ProduceProcess> getProcessList() {
+        return processList;
+    }
+
+    public void setProcessList(List<ProduceProcess> processList) {
+        this.processList = processList;
+    }
+
     public Integer getDeviceId() {
         return deviceId;
     }

+ 57 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/EquipmentService.java

@@ -1,7 +1,64 @@
 package com.iamberry.rst.faces.pts;
 
+import com.iamberry.rst.core.page.PageRequest;
+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.PtsDevice;
+import com.iamberry.rst.core.pts.PtsEmployee;
+import java.util.List;
+
 /**
  * Created by Administrator on 2017/8/29.
  */
 public interface EquipmentService {
+
+    /**
+     * 新增设备信息和修改工序信息
+     * @param device
+     * @return
+     */
+    boolean addDevice(PtsDevice device, String[] processIds);
+
+    /**
+     * 分页查询机器列表信息
+     * @param pageRequest
+     * @return
+     */
+    PagedResult<PtsDevice> listDevice(PageRequest<PtsDevice> pageRequest);
+
+    /**
+     * 查询机器列表信息不分页
+     * @param device
+     * @return
+     */
+    List<PtsDevice> listPtsDevice(PtsDevice device);
+
+    /**
+     * 修改设备信息
+     * @param device
+     * @return
+     */
+    Integer updateDevice(PtsDevice device);
+
+    /**
+     * 关联查询产品和产品工序
+     * @param produce
+     * @return
+     */
+    List<Produce> listProduct(Produce produce);
+
+    /**
+     * 获取员工集合
+     * @param employee
+     * @return
+     */
+    List<PtsEmployee> listEmployee(PtsEmployee employee);
+
+    /**
+     * 修改产品工序信息
+     * @param process
+     * @return
+     */
+    boolean updateProcessInfo(ProduceProcess process);
 }

+ 88 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/EquipmentServiceImpl.java

@@ -1,7 +1,94 @@
 package com.iamberry.rst.service.pts;
 
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.page.PageRequest;
+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.PtsDevice;
+import com.iamberry.rst.core.pts.PtsEmployee;
+import com.iamberry.rst.faces.pts.EquipmentService;
+import com.iamberry.rst.service.pts.mapper.EquipmentMapper;
+import com.iamberry.rst.service.pts.mapper.ProduceMapper;
+import com.iamberry.rst.util.PageUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Created by Administrator on 2017/8/29.
  */
-public class EquipmentServiceImpl {
+@Service
+public class EquipmentServiceImpl implements EquipmentService {
+
+    @Autowired
+    private EquipmentMapper equipmentMapper;
+    @Autowired
+    private ProduceMapper produceMapper;
+
+    @Transactional
+    @Override
+    public boolean addDevice(PtsDevice device, String[] processIds) {
+        boolean flag = true;
+        int num = equipmentMapper.addDevice(device);
+        if (num <= 0) {
+            flag = false;
+        }
+        /*List<ProduceProcess> processList = new ArrayList<ProduceProcess>();
+        if (processIds.length > 0) {
+            for (int i = 0;i < processIds.length;i++) {
+                ProduceProcess process = new ProduceProcess();
+                process.setProcessId(Integer.parseInt(processIds[i]));
+                process.setDriveId(device.getDeviceId());
+                processList.add(process);
+            }
+            int sum = produceMapper.updateProduceProcessList(processList);
+            if (sum <= 0) {
+                flag = false;
+            }
+        }*/
+        return flag;
+    }
+
+    @Override
+    public PagedResult<PtsDevice> listDevice(PageRequest<PtsDevice> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<PtsDevice> deviceList = equipmentMapper.listDevice(pageRequest.getData());
+        return PageUtil.getPage(deviceList);
+    }
+
+    @Override
+    public List<PtsDevice> listPtsDevice(PtsDevice device) {
+        return equipmentMapper.listPtsDevice(device);
+    }
+
+    @Transactional
+    @Override
+    public Integer updateDevice(PtsDevice device) {
+        return equipmentMapper.updateDevice(device);
+    }
+
+    @Override
+    public List<Produce> listProduct(Produce produce) {
+        return equipmentMapper.listProduct(produce);
+    }
+
+    @Override
+    public List<PtsEmployee> listEmployee(PtsEmployee employee) {
+        return equipmentMapper.listEmployee(employee);
+    }
+
+    @Transactional
+    @Override
+    public boolean updateProcessInfo(ProduceProcess process) {
+        int num = equipmentMapper.updateProcessInfo(process);
+        if (num > 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
 }

+ 0 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/ProduceServiceImpl.java

@@ -4,7 +4,6 @@ import com.iamberry.rst.core.pts.ProcessNode;
 import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.ProduceProcess;
 import com.iamberry.rst.faces.pts.ProduceService;
-import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.service.pts.mapper.ProduceMapper;
 import com.iamberry.rst.util.ProduceNoUtil;
 import org.springframework.beans.factory.annotation.Autowired;

+ 56 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/EquipmentMapper.java

@@ -1,7 +1,63 @@
 package com.iamberry.rst.service.pts.mapper;
 
+import com.iamberry.rst.core.pts.Produce;
+import com.iamberry.rst.core.pts.ProduceProcess;
+import com.iamberry.rst.core.pts.PtsDevice;
+import com.iamberry.rst.core.pts.PtsEmployee;
+
+import java.util.List;
+
 /**
  * Created by Administrator on 2017/8/29.
  */
 public interface EquipmentMapper {
+
+    /**
+     * 新增设备信息
+     * @param device
+     * @return
+     */
+    Integer addDevice(PtsDevice device);
+
+    /**
+     * 分页查询机器列表信息
+     * @param device
+     * @return
+     */
+    List<PtsDevice> listDevice(PtsDevice device);
+
+    /**
+     * 查询机器列表信息不分页
+     * @param device
+     * @return
+     */
+    List<PtsDevice> listPtsDevice(PtsDevice device);
+
+    /**
+     * 修改设备信息
+     * @param device
+     * @return
+     */
+    Integer updateDevice(PtsDevice device);
+
+    /**
+     * 关联查询产品和产品工序
+     * @param produce
+     * @return
+     */
+    List<Produce> listProduct(Produce produce);
+
+    /**
+     * 获取员工集合
+     * @param employee
+     * @return
+     */
+    List<PtsEmployee> listEmployee(PtsEmployee employee);
+
+    /**
+     * 修改产品工序信息
+     * @param process
+     * @return
+     */
+    Integer updateProcessInfo(ProduceProcess process);
 }

+ 194 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/equipmentMapper.xml

@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.rst.service.pts.mapper.EquipmentMapper">
+
+    <!-- 分页查询机器列表信息 -->
+    <select id="listDevice" parameterType="PtsDevice" resultMap="deviceMap">
+        SELECT
+            device_id,
+            device_number,
+            device_name,
+            device_date,
+            device_status,
+            device_remake,
+            device_create_time,
+            device_update_time
+        FROM
+        tb_rst_pts_device
+        <where>
+            <if test="deviceNumber != null">
+                device_number like CONCAT('%',#{deviceNumber},'%')
+            </if>
+            <if test="deviceName != null">
+                and device_name like CONCAT('%',#{deviceName},'%')
+            </if>
+            <if test="deviceStatus != null">
+                and device_status = #{deviceStatus}
+            </if>
+            <if test="deviceRemake != null">
+                and device_remake like CONCAT('%',#{deviceRemake},'%')
+            </if>
+            <if test="deviceId != null">
+                and device_id = #{deviceId}
+            </if>
+        </where>
+    </select>
+
+    <resultMap type="PtsDevice" id="deviceMap">
+        <id column="device_id" property="deviceId"/>
+        <result column="device_number" property="deviceNumber"/>
+        <result column="device_name" property="deviceName"/>
+        <result column="device_date" property="deviceDate"/>
+        <result column="device_status" property="deviceStatus"/>
+        <result column="device_remake" property="deviceRemake"/>
+        <result column="device_create_time" property="deviceCreateTime"/>
+        <result column="device_update_time" property="deviceUpdateTime"/>
+        <collection property="processList" column="device_id" ofType="ProduceProcess" select="listProcess"/>
+    </resultMap>
+
+    <select id="listProcess" parameterType="Integer" resultType="ProduceProcess">
+        select
+            t.produce_name produceName,
+            p.process_id processId,
+            p.process_name processName
+        from
+            tb_rst_pts_produce_process p
+        LEFT JOIN tb_rst_pts_produce t ON p.produce_id = t.produce_id
+        <where>
+              drive_id = #{driveId}
+        </where>
+    </select>
+
+    <!-- 获取设备集合,不分页 -->
+    <select id="listPtsDevice" parameterType="PtsDevice" resultType="PtsDevice">
+      SELECT
+            *
+      FROM
+        tb_rst_pts_device
+    <where>
+      <if test="deviceId != null">
+          device_id = #{deviceId}
+      </if>
+      <if test="deviceStatus != null">
+          and device_status = #{deviceStatus}
+      </if>
+    </where>
+    </select>
+
+    <!-- 新增设备信息 -->
+    <insert id="addDevice" parameterType="PtsDevice"
+            useGeneratedKeys="true" keyProperty="deviceId">
+        insert into tb_rst_pts_device
+        (
+          device_number,device_name,device_date,device_status,
+          device_remake,device_create_time
+        )
+        VALUES
+        (
+          #{deviceNumber},#{deviceName},#{deviceDate},#{deviceStatus},
+          #{deviceRemake},NOW()
+        )
+    </insert>
+
+    <!-- 修改设备信息 -->
+    <update id="updateDevice" parameterType="PtsDevice">
+        update
+          tb_rst_pts_device
+          <set>
+              <if test="deviceNumber != null">
+                  device_number = #{deviceNumber},
+              </if>
+              <if test="deviceName != null">
+                  device_name = #{deviceName},
+              </if>
+              <if test="deviceDate != null">
+                  device_date = #{deviceDate},
+              </if>
+              <if test="deviceStatus != null">
+                  device_status = #{deviceStatus},
+              </if>
+              device_remake = #{deviceRemake}
+          </set>
+        <where>
+            device_id = #{deviceId}
+        </where>
+    </update>
+
+    <!-- 关联查询产品和产品工序 -->
+    <select id="listProduct" parameterType="Produce" resultMap="produceMap">
+        SELECT
+        produce_id,
+        produce_no,
+        produce_name,
+        produce_status,
+        produce_remake,
+        produce_create_time,
+        produce_update_time
+        FROM
+        tb_rst_pts_produce
+    </select>
+
+    <resultMap type="Produce" id="produceMap">
+        <id column="produce_id" property="produceId"/>
+        <result column="produce_no" property="produceNo"/>
+        <result column="produce_name" property="produceName"/>
+        <result column="produce_status" property="produceStatus"/>
+        <result column="produce_remake" property="produceRemake"/>
+        <result column="produce_create_time" property="produceCreateTime"/>
+        <result column="produce_update_time" property="produceUpdateTime"/>
+        <collection property="process" column="produce_id" ofType="ProduceProcess" select="listProduceProcess"/>
+    </resultMap>
+
+    <select id="listProduceProcess" parameterType="Integer" resultType="ProduceProcess">
+       SELECT
+		ts.process_id AS processId,
+		ts.produce_id AS produceId,
+		ts.process_no AS processNo,
+		ts.process_name AS  processName,
+		ts.employee_id AS employeeId,
+		ts.drive_id AS  driveId,
+		ts.process_status AS processStatus,
+		ts.process_sort AS processSort,
+		ts.process_remake AS processRemake,
+		ts.process_create_time AS processCreateTime,
+		ts.process_update_time AS processUpdateTime,
+		d.device_name AS deviceName,
+		e.employee_name AS employeeName
+        FROM
+            tb_rst_pts_produce_process ts
+        LEFT JOIN tb_rst_pts_device d ON ts.drive_id = d.device_id
+        LEFT JOIN tb_rst_pts_employee e ON ts.employee_id = e.employee_id
+        WHERE
+          ts.produce_id = #{produceId}
+    </select>
+
+    <!-- 获取员工集合 -->
+    <select id="listEmployee" parameterType="PtsEmployee" resultType="PtsEmployee">
+        select
+          *
+        from
+          tb_rst_pts_employee
+        <where>
+            <if test="employeeState != null">
+                employee_state = #{employeeState}
+            </if>
+        </where>
+    </select>
+
+    <!-- 修改产品工序信息 -->
+    <update id="updateProcessInfo" parameterType="ProduceProcess">
+      update
+        tb_rst_pts_produce_process
+      <set>
+          <if test="employeeId != null">
+              employee_id = #{employeeId},
+          </if>
+          <if test="driveId != null">
+              drive_id = #{driveId}
+          </if>
+      </set>
+      <where>
+          process_id = #{processId}
+      </where>
+    </update>
+</mapper>

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

@@ -1,17 +1,28 @@
 package com.iamberry.rst.controllers.pts;
 
+import com.iamberry.rst.core.page.PageRequest;
+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.PtsDevice;
+import com.iamberry.rst.core.pts.PtsEmployee;
+import com.iamberry.rst.faces.pts.EquipmentService;
 import com.iamberry.rst.faces.pts.ProduceService;
 import com.iamberry.wechat.tools.ResponseJson;
+import com.iamberry.wechat.tools.payUtil.StringUtil;
+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;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Created by Administrator on 2017/8/29.
@@ -22,13 +33,29 @@ public class EquipmentController {
 
     @Autowired
     private ProduceService produceService;
+    @Autowired
+    private EquipmentService equipmentService;
 
+    /**
+     * 进入添加设备页面
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:add:device")
     @RequestMapping("/_add_equpment")
     public ModelAndView addEqupmentUI(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("produce/addEqupment");
+        ModelAndView mv = new ModelAndView("pts/device/add_device");
         return mv;
     }
 
+    /**
+     * 查询所有可用产品工序信息
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:select:produce")
     @ResponseBody
     @RequestMapping("/select_produce_list")
     public ResponseJson selectProduceList(HttpServletRequest request) throws Exception {
@@ -42,9 +69,231 @@ public class EquipmentController {
                 iter.remove();
             }
         }
+        msg.setReturnCode(200);
+        msg.setResultCode(200);
+        msg.addResponseKeyValue("produceList",produceList);
+        return msg;
+    }
 
+    /**
+     * 添加设备信息
+     * @param request
+     * @param device
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:add:device")
+    @ResponseBody
+    @RequestMapping("/add_equpment")
+    public ResponseJson addEqupment(HttpServletRequest request,PtsDevice device) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        String processId = request.getParameter("selProcess");
+        String[] processIds = null;
+        /*if (processId != null && !"".equals(processId) && processId.indexOf(",") > 0) {
+            processId = processId.substring(0,processId.lastIndexOf(","));
+            processIds = processId.split(",");
+        }*/
+        //添加设备信息和修改工序信息
+        boolean flag = equipmentService.addDevice(device, processIds);
+        if (flag) {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        } else {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        }
+        return msg;
+    }
 
+    /**
+     * 查询设备列表信息
+     * @param request
+     * @param pageNO
+     * @param pageTotal
+     * @param pageSize
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:select:device")
+    @RequestMapping("/select_device_list")
+    public ModelAndView selectDeviceList(HttpServletRequest request,
+                                         @RequestParam(value = "pageNO", defaultValue = "1", required = false) int pageNO,
+                                         @RequestParam(value = "pageTotal", required = false) Integer pageTotal,
+                                         @RequestParam(value = "pageSize", defaultValue = "5", required = false) int pageSize
+                                         ) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/device/device_list");
+        StringBuilder url = new StringBuilder("/admin/equipment/select_device_list?pageSize=" + pageSize);
+        String deviceNumber = request.getParameter("deviceNumber");
+        String deviceStatus = request.getParameter("deviceStatus");
+        String deviceName = request.getParameter("deviceName");
+        String deviceRemake = request.getParameter("deviceRemake");
+        PtsDevice device = new PtsDevice();
+        if (StringUtil.isNotEmpty(deviceNumber)) {
+            device.setDeviceNumber(deviceNumber);
+            mv.addObject("deviceNumber", deviceNumber);
+        }
+        if (StringUtil.isNotEmpty(deviceName)) {
+            device.setDeviceName(deviceName);
+            mv.addObject("deviceName", deviceName);
+        }
+        if (StringUtil.isNotEmpty(deviceStatus)) {
+            device.setDeviceStatus(Integer.parseInt(deviceStatus));
+            mv.addObject("deviceStatus", device.getDeviceStatus());
+        }
+        if (StringUtil.isNotEmpty(deviceRemake)) {
+            device.setDeviceRemake(deviceRemake);
+            mv.addObject("deviceRemake", deviceRemake);
+        }
+        // 封装请求数据
+        PageRequest<PtsDevice> pageRequest = new PageRequest<PtsDevice>(device, pageNO, pageSize, pageTotal == null);
+        PagedResult<PtsDevice> result = equipmentService.listDevice(pageRequest);
+        long total = 0;
+        if (pageTotal == null) {
+            total = result.getPages();
+        } else {
+            total = pageTotal;
+            result.setPages(total);
+        }
+        url.append("&pageTotal=").append(total).append("&pageNO=");
+        mv.addObject("page", result);
+        mv.addObject("url", url.toString());
+        return mv;
+    }
+
+    /**
+     * 进入修改设备页面
+     * @param request
+     * @param deviceId
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:update:device")
+    @RequestMapping("/_update_device")
+    public ModelAndView editDevice(HttpServletRequest request,
+                  @RequestParam(value = "deviceId", defaultValue = "", required = false) Integer deviceId
+    ) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/device/update_device");
+        if (deviceId == null) {
+            return mv;
+        }
+        PtsDevice device = new PtsDevice();
+        device.setDeviceId(deviceId);
+        //获取机器列表
+        List<PtsDevice> deviceList = equipmentService.listPtsDevice(device);
+        if (deviceList == null || deviceList.size() <= 0) {
+            return mv;
+        }
+        device = deviceList.get(0);//通过id获取只可能有一条数据
+        mv.addObject("device",device);
+        return mv;
+    }
 
+    /**
+     * 修改设备信息
+     * @param request
+     * @param device
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequiresPermissions("equipment:update:device")
+    @RequestMapping("/update_device")
+    public ResponseJson updateDevice(HttpServletRequest request,PtsDevice device) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        //修改设备信息
+        int num = equipmentService.updateDevice(device);
+        if (num > 0) {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        } else {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        }
+        return msg;
+    }
+
+    /**
+     * 进入修改生产流程页面
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("equipment:update:process")
+    @RequestMapping("/_update_process")
+    public ModelAndView editProcess(HttpServletRequest request) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/device/update_process");
+        String deviceId = request.getParameter("deviceId");
+        mv.addObject("deviceId",deviceId);
+        return mv;
+    }
+
+    /**
+     * 查询产品及工序信息
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequiresPermissions("equipment:select:process")
+    @RequestMapping("/select_produce_process")
+    public ResponseJson selectproduceProcess(HttpServletRequest request) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        Map<String, Object> objMap = new HashMap<String, Object>();
+        Produce produce = new Produce();
+        //查询产品及工序信息
+        List<Produce> produceList = equipmentService.listProduct(produce);
+
+        PtsEmployee employee = new PtsEmployee();
+        employee.setEmployeeState(1);
+        //查询员工集合
+        List<PtsEmployee> employeeList = equipmentService.listEmployee(employee);
+
+        PtsDevice device = new PtsDevice();
+        device.setDeviceStatus(1);
+        //获取机器列表
+        List<PtsDevice> deviceList = equipmentService.listPtsDevice(device);
+
+        if (produceList != null && produceList.size() > 0) {
+            objMap.put("employeeList",employeeList);
+            objMap.put("produceList",produceList);
+            objMap.put("deviceList",deviceList);
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+            msg.addResponseKeyValue("objMap",objMap);
+        } else {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        }
         return msg;
     }
+
+    /**
+     * 修改产品工序方法
+     * @param request
+     * @param process
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequiresPermissions("equipment:update:process")
+    @RequestMapping("/update_process_info")
+    public ResponseJson updateProcessInfo(HttpServletRequest request,ProduceProcess process) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if (process == null || process.getProcessId() == null || "".equals(process.getProcessId())) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        //修改产品工序
+        boolean flag = equipmentService.updateProcessInfo(process);
+        if (flag) {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+            return msg;
+        } else {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+    }
 }

+ 1 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -65,5 +65,6 @@
 		<mapper resource="com/iamberry/rst/service/pts/mapper/machineMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/pts/mapper/deviceMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/pts/mapper/machineLogsMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/pts/mapper/equipmentMapper.xml"/>
 	</mappers>
 </configuration>

+ 145 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/add_device.ftl

@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+<#include "/base/add_base.ftl">
+    <title></title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 5px 10px;width: 60%;}
+        .my-input-date{padding: 5px 10px;width: 60%;background: url(images/rili-1.png) 98.5% center no-repeat; background-size:auto 80%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 60%;}
+        .my-btn-reset{padding: 6px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 6px 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;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(common/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> PST管理
+    <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>
+</nav>
+<div style="padding: 10px;">
+    <form class="form-horizontal" action="${path}/admin/equipment/add_equpment" id="form-admin-add">
+        <div class="my-title">设备信息</div>
+        <div class="input-box">
+            <span class="input-dic">设备编号</span>
+            <input class="my-input" type="text" value="" maxlength="10" minlength="2" name="deviceNumber" id="deviceNumber" placeholder="请输入设备编号,请输入英文、数字,2-10位"/>
+        </div>
+        <div class="input-box"><span class="input-dic">设备姓名</span><input class="my-input" type="text" value="" name="deviceName" id="deviceName" placeholder="请输入设备名称,中文和英文"/> </div>
+        <div class="input-box"><span class="input-dic">购买日期</span><input class="my-input-date" type="text" value="" name="device_date" id="device_date" placeholder="请选择购买日期" onClick="WdatePicker()" readonly="readonly"/> </div>
+        <div class="input-box"><span class="input-dic">设备状态</span> <input type="radio" id="radio1" name="deviceStatus" value="1" checked/><label for="radio1">正常使用</label><input type="radio" id="radio2" name="deviceStatus" value="0"/><label for="radio3">设备停用</label> </div>
+        <#--<div class="input-box"><span class="input-dic">作用流程</span>
+            <ul class="add-list">
+
+            </ul>
+        </div>-->
+        <div style="clear: both;"></div>
+        <div class="input-box"><span class="input-dic">设备备注</span>
+            <textarea rows="3" cols="20" name="deviceRemake" id="deviceRemake" class="my-textarea"></textarea>
+        </div>
+        <div>
+            <button type="reset" class="my-btn-reset">重置</button><button type="button" class="my-btn-submit" onclick="submit_value();">确认提交</button>
+        </div>
+    </form>
+</div>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+    var check_number = /^[A-Za-z0-9]+$/;
+    var check_name = /^[a-zA-Z\u4e00-\u9fa5]+$/;
+
+    $(function(){
+        /*$.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/equipment/select_produce_list",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var data_produce = data.returnMsg.produceList;
+                    var table = document.body.querySelector('.add-list');
+                    $.each(data_produce, function(i,item){
+                        var this_produce = this;
+                        var li = document.createElement('li');
+                        var process = '';
+                        var data_process = this_produce.process;
+                        $.each(data_process, function(j,obj){
+                            var this_process = this;
+                            process += '<option value="' + this_process.processId + '"> ' + this_process.processName + ' </option>';
+                        });
+                        li.innerHTML = this_produce.produceName + '<select class="my-select">' + process + '</select>';
+                        table.appendChild(li);
+                    });
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+
+            }
+        });*/
+    });
+
+    function check_value() {
+        var flag = true;
+        var deviceNumber = $('#deviceNumber').val();
+        var deviceName = $('#deviceName').val();
+        if (deviceNumber == null || !check_number.test(deviceNumber)) {
+            flag = false;
+            alert("设备编号格式不正确,请重新输入!");
+            return flag;
+        }
+        if (deviceName == null || !check_name.test(deviceName)) {
+            flag = false;
+            alert("设备名称格式不正确,请重新输入!");
+            return flag;
+        }
+        return flag;
+    }
+
+    function submit_value() {
+        var deviceNumber = $('#deviceNumber').val();
+        var deviceName = $('#deviceName').val();
+        var device_date = $('#device_date').val();
+        var deviceRemake = $('#deviceRemake').val();
+        var deviceStatus = $('input[name="deviceStatus"]:checked').val();
+        var flag = check_value();
+        if (flag) {
+            //var selProcess = '';
+            //循环获取所有流程节点
+            /*$.each($('.add-list>li>select option:selected'), function(i,item){
+                selProcess += $(this).val() + ',';
+            });*/
+            var data = {
+                "deviceNumber":deviceNumber,
+                "deviceName":deviceName,
+                "deviceDate":device_date,
+                "deviceRemake":deviceRemake,
+                "deviceStatus":deviceStatus
+                //"selProcess":selProcess
+            }
+
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: data,
+                url: "${path}/admin/equipment/add_equpment",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        window.location.href = '${path}/admin/equipment/select_device_list'
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+
+                }
+            });
+        }
+    }
+</script>
+</body>
+</html>

+ 113 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/device_list.ftl

@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <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(images/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;}
+    </style>
+<#include "/base/list_base.ftl">
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> PST管理
+    <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>
+</nav>
+<div class="page-container">
+<div class="text-c">
+    <form name="form1" action="${path}/admin/equipment/select_device_list" method="post">
+        <button type="button" class="my-btn-search" onclick="add_device();">添加设备</button>
+        <input class="my-input" type="text" name="deviceNumber" value="${deviceNumber!}" placeholder="请输入设备编号"/>
+        <select class="select" name="deviceStatus" style="height: 30px;width: 150px">
+            <option value ="">--请选择--</option>
+            <option value ="0" <#if deviceStatus??><#if deviceStatus == 0>selected="selected"</#if></#if>>停止使用</option>
+            <option value ="1" <#if deviceStatus??><#if deviceStatus == 1>selected="selected"</#if></#if>>正常使用</option>
+        </select>
+        <input class="my-input" type="text" name="deviceName" value="${deviceName!}" placeholder="请输入设备名称"/>
+        <input class="my-input" type="text" name="deviceRemake" value="${deviceRemake!}" placeholder="请输入备注"/>
+        <button type="submit" class="my-btn-search">搜索</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 width="100">设备编号</th>
+            <th width="100">设备名称</th>
+            <th width="100">设备备注</th>
+            <th width="100">购买日期</th>
+            <th width="100">状态</th>
+            <th width="150">作用流程岗位</th>
+            <th width="50">操作</th>
+        </tr>
+        </thead>
+        <tbody id="listid">
+        <#list page.dataList as device>
+        <tr>
+            <td class="text-c" width="100">${device.deviceNumber}</td>
+            <td class="text-c" width="100">${device.deviceName}</td>
+            <td class="text-c" width="100">${device.deviceRemake}</td>
+            <td class="text-c" width="100">${(device.deviceDate?string("yyyy-MM-dd"))!''}</td>
+            <td class="text-c" width="100">
+                <#if device.deviceStatus == 0>
+                    停止使用
+                </#if>
+                <#if device.deviceStatus == 1>
+                    正常使用
+                </#if>
+                <#if device.deviceStatus == 2>
+                    设备故障
+                </#if>
+            </td>
+            <td class="text-c" width="100">
+                <#if device.processList??>
+                    <#list device.processList as process>
+                        <#if (process_index + 1) == device.processList?size>
+                            ${process.produceName}-${process.processName}
+                        </#if>
+                        <#if (process_index + 1) != device.processList?size>
+                        ${process.produceName}-${process.processName},
+                        </#if>
+                    </#list>
+                </#if>
+            </td>
+            <!-- 遍历操作 -->
+            <td class="td-manage text-c">
+                <a style="text-decoration:none" href="javascript:;" title="查看"
+                   onclick="edit_detail('${path}/admin/equipment/_update_device?deviceId=${device.deviceId!}');">
+                    <i class="Hui-iconfont">&#xe6df;</i>
+                </a>
+                <a style="text-decoration:none" href="javascript:;" title="查看"
+                   onclick="edit_process('${path}/admin/equipment/_update_process?deviceId=${device.deviceId!}');">
+                    <i class="Hui-iconfont">&#xe665;</i>
+                </a>
+            </td>
+        </tr>
+        </#list>
+        </tbody>
+    </table>
+</div>
+</div>
+<div style="padding-top: 10px;"></div>
+<#include "/base/page_util.ftl">
+
+<script type="text/javascript">
+    function add_device() {
+        window.location.href = '${path}/admin/equipment/_add_equpment'
+    }
+
+    function edit_detail(url) {
+        window.location.href = url
+    }
+
+    function edit_process(url) {
+        window.location.href = url
+    }
+</script>
+</body>
+</html>

+ 107 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/update_device.ftl

@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+<#include "/base/add_base.ftl">
+    <title></title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 5px 10px;width: 60%;}
+        .my-input-date{padding: 5px 10px;width: 60%;background: url(images/rili-1.png) 98.5% center no-repeat; background-size:auto 80%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 60%;}
+        .my-btn-reset{padding: 6px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 6px 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;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(common/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> PST管理
+    <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>
+</nav>
+<div style="padding: 10px;">
+    <form class="form-horizontal" action="${path}/admin/equipment/update_device" id="form-admin-add">
+        <div class="my-title">设备信息</div>
+        <input class="my-input" type="hidden" value="${device.deviceId!}" name="deviceId" id="deviceId" placeholder="请输入设备编号"/>
+        <div class="input-box"><span class="input-dic">设备编号</span><input class="my-input" type="text" value="${device.deviceNumber!}" name="deviceNumber" id="deviceNumber" placeholder="请输入设备编号"/> </div>
+        <div class="input-box"><span class="input-dic">设备姓名</span><input class="my-input" type="text" value="${device.deviceName!}" name="deviceName" id="deviceName" placeholder="请输入设备姓名"/> </div>
+        <div class="input-box"><span class="input-dic">购买日期</span><input class="my-input-date" type="text" value="${(device.deviceDate?string("yyyy-MM-dd"))!''}" onClick="WdatePicker()" name="device_date" id="device_date" placeholder="请选择购买日期" readonly="readonly"/> </div>
+        <div class="input-box"><span class="input-dic">设备状态</span>
+            <input type="radio" id="radio1" name="deviceStatus" <#if device.deviceStatus??><#if device.deviceStatus == 1>checked</#if></#if> value="1"/><label for="radio1">正常使用</label>
+            <input type="radio" id="radio2" name="deviceStatus" <#if device.deviceStatus??><#if device.deviceStatus == 0>checked</#if></#if> value="0"/><label for="radio3">设备停用</label>
+        </div>
+        <div style="clear: both;"></div>
+        <div class="input-box"><span class="input-dic">设备备注</span>
+            <textarea rows="3" cols="20" name="deviceRemake" id="deviceRemake" class="my-textarea">${device.deviceRemake!}</textarea>
+        </div>
+        <div>
+            <button type="reset" class="my-btn-reset">重置</button><button type="button" class="my-btn-submit" onclick="update_value();">确认</button>
+        </div>
+    </form>
+</div>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+    var check_number = /^[A-Za-z0-9]+$/;
+    var check_name = /^[a-zA-Z\u4e00-\u9fa5]+$/;
+
+    function check_value() {
+        var flag = true;
+        var deviceNumber = $('#deviceNumber').val();
+        var deviceName = $('#deviceName').val();
+        if (deviceNumber == null || !check_number.test(deviceNumber)) {
+            flag = false;
+            alert("设备编号格式不正确,请重新输入!");
+            return flag;
+        }
+        if (deviceName == null || !check_name.test(deviceName)) {
+            flag = false;
+            alert("设备名称格式不正确,请重新输入!");
+            return flag;
+        }
+        return flag;
+    }
+
+    function update_value() {
+        var deviceNumber = $('#deviceNumber').val();
+        var deviceName = $('#deviceName').val();
+        var device_date = $('#device_date').val();
+        var deviceRemake = $('#deviceRemake').val();
+        var deviceStatus = $('input[name="deviceStatus"]:checked').val();
+        var deviceId = $('#deviceId').val();
+        var flag = check_value();
+        if (flag) {
+            var data = {
+                "deviceNumber":deviceNumber,
+                "deviceName":deviceName,
+                "deviceDate":device_date,
+                "deviceRemake":deviceRemake,
+                "deviceStatus":deviceStatus,
+                "deviceId":deviceId
+            }
+
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: data,
+                url: "${path}/admin/equipment/update_device",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        window.location.href = '${path}/admin/equipment/select_device_list'
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+
+                }
+            });
+        }
+    }
+</script>
+</body>
+</html>

+ 519 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/device/update_process.ftl

@@ -0,0 +1,519 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title></title>
+    <style>
+        article, section, time, aside {
+            display: block;
+        }
+        .point-time {
+            content: "";
+            position: absolute;
+            width: 15px;
+            height: 15px;
+            line-height: 15px;
+            top: 35%;
+            left: 48%;
+            background: #1c87bf;
+            margin-left: -5px;
+            border-radius: 50%;
+            box-shadow: 0 0 0 5px #fff;
+            font-size: 12px;
+            text-align: center;
+            color: #fff;
+        }
+
+        .text-red {
+            color: #f6393f;
+        }
+
+        .text-blue {
+            color: #1c87bf;
+        }
+
+        .text-green {
+            color: #999;
+        }
+
+        .text-yellow {
+            color: #ffb902;
+        }
+
+        .text-purple {
+            color: #d32d93;
+        }
+        .text-left{
+            text-align: left;
+            text-indent: 1em;
+        }
+        .text-right{
+            text-align: right;
+            padding-right: 1em;
+        }
+        .point-red {
+            background-color: #f6393f;
+        }
+
+        .point-blue {
+            background-color: #1c87bf;
+        }
+
+        .point-green {
+            background-color: #95c91e;
+        }
+
+        .point-yellow {
+            background-color: #ffb902;
+        }
+
+        .point-gray {
+            background-color: #999;
+        }
+
+        .point-purple {
+            background-color: #d32d93;
+        }
+
+        .content {
+            width: 100%;
+            margin: 0 auto;
+        }
+        .content article {
+            position: relative;
+        }
+        .content article > h3 {
+            width: 100%;
+            text-align: center;
+            font-size: 1.4em;
+            color: #fff;
+            padding: 10px 0 20px;
+            background-color: #32a3d8;
+            margin: 0 0 10px 0;
+        }
+        .content article section {
+            padding: 10px 0 10px;
+            position: relative;
+        }
+        .content article section:before {
+            content: "";
+            width: 5px;
+            top: 23px;
+            bottom: -50px;
+            left: 48%;
+            background: #e6e6e6;
+            position: absolute;
+        }
+        .content article section:last-child:before {
+            display: none;
+        }
+        .content article section time {
+            width: 45%;
+            display: block;
+            position: absolute;
+            text-align: right;
+        }
+        .content article section time > span {
+            display: block;
+        }
+        .content article section aside {
+            color: #3a3a38;
+            margin-left: 55%;
+            min-height: 50px;
+        }
+        .content article section aside > span{
+            display: block;
+        }
+        .content article section .brief {
+            color: #9f9f9f;
+        }
+
+        .class-hidden {
+            display: none;
+        }
+
+        /*设置Select样式*/
+        select {
+            border-width: 0px;
+            border-top-style: none;
+            border-right-style: none;
+            border-left-style: none;
+            border-bottom-style: none;
+            overflow:hidden;
+            -webkit-appearance: none;
+        }
+
+        select option {
+            text-align: center;
+            color: blue;
+        }
+
+        .add-title-left{position: absolute;right: 0;top: 15%;}
+        .add-title-right{position: absolute;left: 55%;top:33%;}
+        .my-btn-edit{padding: 6px 20px;background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 5px 0 5px 0;}
+        .list-main{list-style-type: none;margin: 0;padding: 10px;overflow-x: scroll;white-space: nowrap;}
+        .list-main>li{display: table-cell;min-width: 450px;position: relative;width: 450px;margin-right: 20px;border: 1px solid rgba(0,0,0,.1);}
+    </style>
+<#include "/base/list_base.ftl">
+</head>
+<body>
+<div><input type="hidden" value="${deviceId!}" id="deviceId"></div>
+<ul class="list-main">
+    <#--<li>
+        <div class="content">
+            <article>
+                <h3>净水机</h3>
+                <section>
+                    <span class="point-time point-yellow">1</span>
+                    <time>
+                        <span>净水机需求清洗物料</span>
+                        <span class="text-blue">员工:张三(a5)</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">2</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span>t1滤芯组装</span>
+                        <span class="text-blue">员工:李二二(a4)</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-green">3</span>
+                    <time>
+                        <span>t3滤芯组装</span>
+                        <span class="text-blue">员工:钟小小(a4)</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">4</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-green">5</span>
+                    <time>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-left">接头加工</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-blue">6</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">7</span>
+                    <time>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-left">接头加工</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-blue">8</span>
+                    <time datetime="2012-02">
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+            </article>
+        </div>
+    </li>
+
+    <li>
+        <div class="content">
+            <article>
+                <h3>净水机</h3>
+                <section>
+                    <span class="point-time point-yellow">1</span>
+                    <time>
+                        <span>净水机需求清洗物料</span>
+                        <span class="text-blue">员工:张三(a5)</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">2</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span>t1滤芯组装</span>
+                        <span class="text-blue">员工:李二二(a4)</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-green">3</span>
+                    <time>
+                        <span>t3滤芯组装</span>
+                        <span class="text-blue">员工:钟小小(a4)</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">4</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-green">5</span>
+                    <time>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-left">接头加工</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-blue">6</span>
+                    <time>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-red">7</span>
+                    <time>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-left"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-left">接头加工</span>
+                    </time>
+                    <aside>
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </aside>
+                </section>
+                <section>
+                    <span class="point-time point-blue">8</span>
+                    <time datetime="2012-02">
+                        <!--<span></span>
+                        <span></span>&ndash;&gt;
+                    </time>
+                    <aside>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加员工</button></span>
+                        <span class="text-right"><button type="button" class="my-btn-edit">添加设备</button></span>
+                        <span class="add-title-right">接头加工</span>
+                    </aside>
+                </section>
+            </article>
+        </div>
+    </li>-->
+</ul>
+<script type="text/javascript">
+
+    $(function(){
+        var deviceId = $('#deviceId').val();
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/equipment/select_produce_process",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var data_produce = data.returnMsg.objMap.produceList;
+                    var employeeList = data.returnMsg.objMap.employeeList;
+                    var deviceList = data.returnMsg.objMap.deviceList;
+                    var table = document.body.querySelector('.list-main');
+                    var tab_name = $('#tab_title');
+                    var tab_text = '';
+                    var id_num = 1;
+
+                    $.each(data_produce, function(i,item){
+                        var this_produce = this;
+
+                        var li = document.createElement('li');
+                        var process = '';
+                        var data_process = this_produce.process;
+                        $.each(data_process, function(j,obj){
+                            id_num++;
+                            var this_process = this;
+                            var tb_user = '';
+                            var tb_device = '';
+                            var point_class = '';
+                            if (deviceId == this_process.driveId) {
+                                point_class = 'point-red';
+                            } else {
+                                point_class = 'point-blue';
+                            }
+                            if (this_process.employeeName == null || this_process.employeeName == undefined) {
+                                var employee_option = '<option value="">选择员工</option>';
+                                $.each(employeeList, function(n,nobj){
+                                    var employee_list = this;
+                                    employee_option += '<option value="' + employee_list.employeeId + '">' + employee_list.employeeName + '</option>';
+                                });
+                                tb_user = '<select id="user' + id_num + '" process="' + this_process.processId + '" onchange="update_process(this,1)">' + employee_option + '</select>&nbsp;&nbsp;&nbsp;&nbsp;';
+                            } else {
+                                var employee_option = '';
+                                $.each(employeeList, function(n,nobj){
+                                    var employee_list = this;
+                                    if (employee_list.employeeId == this_process.employeeId) {
+                                        employee_option += '<option value="' + employee_list.employeeId + '" selected>' + employee_list.employeeName + '</option>';
+                                    } else {
+                                        employee_option += '<option value="' + employee_list.employeeId + '">' + employee_list.employeeName + '</option>';
+                                    }
+
+                                });
+                                tb_user = '<select id="user' + id_num + '" process="' + this_process.processId + '" onchange="update_process(this,1)">' + employee_option + '</select>';
+                            }
+                            if (this_process.deviceName == null || this_process.deviceName == undefined) {
+                                var device_option = '<option value="">添加打卡设备</option>';
+                                $.each(deviceList, function(n,nobj){
+                                    var device_list = this;
+                                    device_option += '<option value="' + device_list.deviceId + '">' + device_list.deviceName + '</option>';
+                                });
+                                tb_device = '(<select id="device' + id_num + '" process="' + this_process.processId + '" onchange="update_process(this,2)">' + device_option + '</select>)';
+                            } else {
+                                var device_option = '';
+                                $.each(deviceList, function(n,nobj){
+                                    var device_list = this;
+                                    if (this_process.driveId == device_list.deviceId) {
+                                        device_option += '<option value="' + device_list.deviceId + '" selected>' + device_list.deviceName + '</option>';
+                                    } else {
+                                        device_option += '<option value="' + device_list.deviceId + '">' + device_list.deviceName + '</option>';
+                                    }
+                                });
+                                tb_device = '(<select id="device' + id_num + '" process="' + this_process.processId + '" onchange="update_process(this,2)">' + device_option + '</select>)';
+                            }
+                            if (j % 2 == 0) {
+                                process += '<section>'
+                                        + '<span class="point-time ' + point_class + '">' + (j+1)
+                                        + '</span>'
+                                        + '<time>'
+                                        + '<span>' + this_process.processName
+                                        + '</span>'
+                                        + '<span class="text-blue">' + tb_user + tb_device
+                                        + '</span>'
+                                        + '</time>'
+                                        + '<aside>'
+                                        + '</aside>'
+                                        + '</section>'
+                            } else {
+                                process += '<section>'
+                                        + '<span class="point-time ' + point_class + '">' + (j+1)
+                                        + '</span>'
+                                        + '<time>'
+                                        + '</time>'
+                                        + '<aside>'
+                                        + '<span>' + this_process.processName
+                                        + '</span>'
+                                        + '<span class="text-blue">' + tb_user + tb_device
+                                        + '</span>'
+                                        + '</aside>'
+                                        + '</section>'
+                            }
+                        });
+                        li.innerHTML = '<div class="content"><article><h3>' + this_produce.produceName + '</h3>' + process + '</article></div>';
+                        li.id = 'tab_li' + i;
+                        li.setAttribute("index", i);
+                        table.appendChild(li);
+                    });
+                    tab_name.html(tab_text);
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+
+            }
+        });
+    });
+
+    function update_process(obj,num) {
+        var processId = obj.getAttribute("process");
+        var id = obj.getAttribute("id");
+        var value = $('#' + id + ' option:selected').val();
+        var data = null;
+        if (confirm("您确定修改吗?")) {
+            //num=1则是修改员工信息,num=2则是修改设备信息
+            if (num == 1) {
+                data = {
+                    processId: processId,
+                    employeeId: value
+                }
+            } else if(num == 2) {
+                data = {
+                    processId: processId,
+                    driveId: value
+                }
+            }
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: data,
+                url: "${path}/admin/equipment/update_process_info",
+                async: false,
+                success: function(dt){
+                    if (dt.returnCode == 200) {
+                        alert('恭喜您,修改成功!');
+                    } else {
+                        alert('对不起,修改失败!');
+                    }
+                }
+            })
+        } else {
+            location.reload();
+        }
+    }
+</script>
+</body>
+</html>

BIN
watero-rst-web/src/main/webapp/common/images/rili-1.png


BIN
watero-rst-web/src/main/webapp/common/images/select-1.png


+ 11 - 0
wateroPF-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/ResponseWechatPayHandler.java

@@ -4,6 +4,7 @@ import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.StringReader;
 import java.net.URLDecoder;
+import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
@@ -15,6 +16,7 @@ import java.util.UUID;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.service.ImberryConfig;
 import org.apache.commons.lang3.StringUtils;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -160,6 +162,15 @@ public class ResponseWechatPayHandler {
 					
 					// 修改订单状态
 					int count = cartService.updateOrderStatus(order);
+
+					//发送短信给运营部
+					ShopSystemRule rule = cartService.getReluByRid(241);
+					try {
+						String text = MessageFormat.format(ImberryConfig.ORDER_UPDATE_STATUS_TEXT, "发货");
+						codeService.informShipping(rule.getRuleDesc(),text);
+					} catch (Exception e) {
+						System.out.println("订单换货发送消息失败!");
+					}
 					
 //System.out.println("===========pay 132 修改订单状态==============");
 					//修改优惠券状态