瀏覽代碼

工单管理

[user3] 3 年之前
父節點
當前提交
3960c6e73c
共有 20 個文件被更改,包括 2817 次插入1 次删除
  1. 20 0
      src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderCommentDao.java
  2. 63 0
      src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderDao.java
  3. 14 0
      src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderProcessingDao.java
  4. 79 0
      src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrder.java
  5. 92 0
      src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrderComment.java
  6. 103 0
      src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrderProcessing.java
  7. 22 0
      src/main/java/com/jeeplus/modules/workOrder/enums/WorkOrderStatusEnum.java
  8. 70 0
      src/main/java/com/jeeplus/modules/workOrder/service/WorkOrderCommentService.java
  9. 175 0
      src/main/java/com/jeeplus/modules/workOrder/service/WorkOrderService.java
  10. 337 0
      src/main/java/com/jeeplus/modules/workOrder/web/WorkOrderController.java
  11. 62 0
      src/main/resources/mappings/modules/workOrder/WorkOrderCommentDao.xml
  12. 281 0
      src/main/resources/mappings/modules/workOrder/WorkOrderDao.xml
  13. 14 1
      src/main/webapp/static/common/jeeplus.js
  14. 169 0
      src/main/webapp/static/oss/ossupload.js
  15. 19 0
      src/main/webapp/webpage/modules/sys/sysIndex.jsp
  16. 249 0
      src/main/webapp/webpage/modules/workOrder/workOrderCommentAdd.jsp
  17. 201 0
      src/main/webapp/webpage/modules/workOrder/workOrderCommentView.jsp
  18. 291 0
      src/main/webapp/webpage/modules/workOrder/workOrderForm.jsp
  19. 482 0
      src/main/webapp/webpage/modules/workOrder/workOrderList.jsp
  20. 74 0
      src/main/webapp/webpage/modules/workOrder/workOrderProcessing.jsp

+ 20 - 0
src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderCommentDao.java

@@ -0,0 +1,20 @@
+package com.jeeplus.modules.workOrder.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.workOrder.entity.WorkOrderComment;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@MyBatisDao
+public interface WorkOrderCommentDao extends CrudDao<WorkOrderComment> {
+
+    /**
+     * 根据工单id
+     * 查询回复
+     * @param workOrderId
+     * @return
+     */
+    List<WorkOrderComment> findCommentByWorkOrderId(@Param("workOrderId") String workOrderId);
+}

+ 63 - 0
src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderDao.java

@@ -0,0 +1,63 @@
+package com.jeeplus.modules.workOrder.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.feedback.entity.QuestionFeedback;
+import com.jeeplus.modules.workOrder.entity.WorkOrder;
+import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 工单管理  Dao接口
+ */
+@MyBatisDao
+public interface WorkOrderDao extends CrudDao<WorkOrder> {
+    /**
+     * 查询工单问题类型关联的用户id
+     * @param questionType
+     * @return
+     */
+    String findRelationByUserId(@Param("questionType") String questionType);
+
+    /**
+     * 添加工单流程
+     * @param workOrderProcessing
+     * @return
+     */
+    Integer insertProcessing(WorkOrderProcessing workOrderProcessing);
+    /**
+     * 修改工单流程
+     * @param workOrderProcessing
+     * @return
+     */
+    Integer updateProcessing(WorkOrderProcessing workOrderProcessing);
+
+    /**
+     * 根据工单获取流程
+     * @param workOrderId
+     * @return
+     */
+    List<WorkOrderProcessing> findProcessingByOrderId(@Param("workOrderId") String workOrderId);
+
+    /**
+     * 根据流程id获取流程信息
+     * @param workOrderId
+     * @return
+     */
+    List<WorkOrderProcessing> getProcessingByOrder(@Param("workOrderId") String workOrderId);
+
+    /**
+     * 查询处理中的工单
+     * @param workOrder
+     * @return
+     */
+    Integer queryHandleCount(WorkOrder workOrder);
+//    /**
+//     * 获取所有处理人是当前用户的工单
+//     * @param handleId
+//     * @return
+//     */
+//    List<WorkOrder> findProcessingByUserId(@Param("handleId") String handleId);
+}

+ 14 - 0
src/main/java/com/jeeplus/modules/workOrder/dao/WorkOrderProcessingDao.java

@@ -0,0 +1,14 @@
+package com.jeeplus.modules.workOrder.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.workOrder.entity.WorkOrder;
+import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 工单管理  Dao接口
+ */
+@MyBatisDao
+public interface WorkOrderProcessingDao extends CrudDao<WorkOrderProcessing> {
+}

+ 79 - 0
src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrder.java

@@ -0,0 +1,79 @@
+package com.jeeplus.modules.workOrder.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.workofficechange.entity.WorkOfficeChangeUser;
+
+import java.util.List;
+
+/**
+ * 工单entity
+ */
+public class WorkOrder extends DataEntity<WorkOrder> {
+    private String title;       //表题
+    private String content;     //内容
+    private String processingStatus;  //处理状态
+    private String questionType;    //问题类型
+    private List<Workattachment> workAttachments;//附件
+
+    private User handle;  //处理人
+    private boolean handleFalg; //处理人判断
+
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getProcessingStatus() {
+        return processingStatus;
+    }
+
+    public void setProcessingStatus(String processingStatus) {
+        this.processingStatus = processingStatus;
+    }
+
+    public String getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(String questionType) {
+        this.questionType = questionType;
+    }
+
+    public List<Workattachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<Workattachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
+
+    public User getHandle() {
+        return handle;
+    }
+
+    public void setHandle(User handle) {
+        this.handle = handle;
+    }
+
+    public boolean isHandleFalg() {
+        return handleFalg;
+    }
+
+    public void setHandleFalg(boolean handleFalg) {
+        this.handleFalg = handleFalg;
+    }
+}

+ 92 - 0
src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrderComment.java

@@ -0,0 +1,92 @@
+package com.jeeplus.modules.workOrder.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+
+import java.util.List;
+
+public class WorkOrderComment extends DataEntity<WorkOrderComment> {
+    private String workOrderId; //工单id
+    private String content;     //内容
+    private String userId;      //用户Id
+    private User user;          //用户
+    private List<Workattachment> workAttachments;//附件
+    private Long minuteTime;          //评论时间距今相差分钟数
+    private String commentDateStr;     //评论时间
+
+    private boolean commentFalg;    //回复指向判断
+    private String  commentName;    //回复指向名称
+
+    public String getWorkOrderId() {
+        return workOrderId;
+    }
+
+    public void setWorkOrderId(String workOrderId) {
+        this.workOrderId = workOrderId;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+
+    public List<Workattachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<Workattachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
+
+    public Long getMinuteTime() {
+        return minuteTime;
+    }
+
+    public void setMinuteTime(Long minuteTime) {
+        this.minuteTime = minuteTime;
+    }
+
+    public String getCommentDateStr() {
+        return commentDateStr;
+    }
+
+    public void setCommentDateStr(String commentDateStr) {
+        this.commentDateStr = commentDateStr;
+    }
+
+    public boolean isCommentFalg() {
+        return commentFalg;
+    }
+
+    public void setCommentFalg(boolean commentFalg) {
+        this.commentFalg = commentFalg;
+    }
+
+    public String getCommentName() {
+        return commentName;
+    }
+
+    public void setCommentName(String commentName) {
+        this.commentName = commentName;
+    }
+}

+ 103 - 0
src/main/java/com/jeeplus/modules/workOrder/entity/WorkOrderProcessing.java

@@ -0,0 +1,103 @@
+package com.jeeplus.modules.workOrder.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+
+import java.util.Date;
+
+/**
+ * 工单流程单
+ */
+public class WorkOrderProcessing extends DataEntity<WorkOrderProcessing> {
+    private String handleId;    //处理人id
+    private User handleUser;    //处理人
+    private String handleOffice;    //处理部门
+    private String officeName;      //部门名称
+    private String handleOpinion;   //处理意见
+    private String missionDuration; //任务历时
+    private String workOrderId;     //工单id
+    private int sort;   //顺序
+    private Date startDate; //开始时间
+    private Date endDate;   //结束时间
+
+    public String getHandleId() {
+        return handleId;
+    }
+
+    public void setHandleId(String handleId) {
+        this.handleId = handleId;
+    }
+
+    public User getHandleUser() {
+        return handleUser;
+    }
+
+    public void setHandleUser(User handleUser) {
+        this.handleUser = handleUser;
+    }
+
+    public String getHandleOffice() {
+        return handleOffice;
+    }
+
+    public void setHandleOffice(String handleOffice) {
+        this.handleOffice = handleOffice;
+    }
+
+    public String getHandleOpinion() {
+        return handleOpinion;
+    }
+
+    public void setHandleOpinion(String handleOpinion) {
+        this.handleOpinion = handleOpinion;
+    }
+
+    public String getMissionDuration() {
+        return missionDuration;
+    }
+
+    public void setMissionDuration(String missionDuration) {
+        this.missionDuration = missionDuration;
+    }
+
+    public String getWorkOrderId() {
+        return workOrderId;
+    }
+
+    public void setWorkOrderId(String workOrderId) {
+        this.workOrderId = workOrderId;
+    }
+
+    public String getOfficeName() {
+        return officeName;
+    }
+
+    public void setOfficeName(String officeName) {
+        this.officeName = officeName;
+    }
+
+    public int getSort() {
+        return sort;
+    }
+
+    public void setSort(int sort) {
+        this.sort = sort;
+    }
+
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+}

+ 22 - 0
src/main/java/com/jeeplus/modules/workOrder/enums/WorkOrderStatusEnum.java

@@ -0,0 +1,22 @@
+package com.jeeplus.modules.workOrder.enums;
+
+public enum WorkOrderStatusEnum {
+    IN_APRL(2,"处理中"),
+    SIGNED(5,"已解决");
+
+    private int value;
+    private String desc;
+
+    WorkOrderStatusEnum(int val, String desc) {
+        this.value = val;
+        this.desc = desc;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 70 - 0
src/main/java/com/jeeplus/modules/workOrder/service/WorkOrderCommentService.java

@@ -0,0 +1,70 @@
+package com.jeeplus.modules.workOrder.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workOrder.dao.WorkOrderCommentDao;
+import com.jeeplus.modules.workOrder.dao.WorkOrderDao;
+import com.jeeplus.modules.workOrder.entity.WorkOrder;
+import com.jeeplus.modules.workOrder.entity.WorkOrderComment;
+import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class WorkOrderCommentService extends CrudService<WorkOrderCommentDao, WorkOrderComment> {
+    @Autowired
+    private WorkOrderDao workOrderDao;
+    @Autowired
+    private WorkOrderCommentDao workOrderCommentDao;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Transactional(readOnly = false)
+    public void insertComment(WorkOrderComment workOrderComment){
+        //保存评论
+        workOrderComment.preInsert();
+        workOrderComment.setUserId(UserUtils.getUser().getId());
+        workOrderCommentDao.insert(workOrderComment);
+        //保存附件
+        this.saveAttachments(workOrderComment);
+    }
+
+    /**
+     * 保存附件
+     * @param workOrderComment
+     */
+    @Transactional(readOnly = false)
+    public void saveAttachments(WorkOrderComment workOrderComment) {
+        List<Workattachment> workattachments = workOrderComment.getWorkAttachments();
+        if (workattachments!=null && workattachments.size()!=0) {
+            for (Workattachment workattachment : workattachments) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(workOrderComment.getId());
+                    workattachment.setAttachmentFlag("191");
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    } else {
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                } else {
+                    workattachmentService.delete(workattachment);
+                }
+            }
+        }
+    }
+
+}

+ 175 - 0
src/main/java/com/jeeplus/modules/workOrder/service/WorkOrderService.java

@@ -0,0 +1,175 @@
+package com.jeeplus.modules.workOrder.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.oa.entity.OaNotify;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workOrder.dao.WorkOrderCommentDao;
+import com.jeeplus.modules.workOrder.dao.WorkOrderDao;
+import com.jeeplus.modules.workOrder.entity.WorkOrder;
+import com.jeeplus.modules.workOrder.entity.WorkOrderComment;
+import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
+import com.sun.corba.se.spi.orbutil.threadpool.Work;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class WorkOrderService  extends CrudService<WorkOrderDao, WorkOrder> {
+    @Autowired
+    private WorkOrderDao workOrderDao;
+    @Autowired
+    private WorkOrderCommentDao workOrderCommentDao;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Override
+    public Page<WorkOrder> findPage(Page<WorkOrder> page, WorkOrder workOrder) {
+		//设置数据权限
+//		if(!UserUtils.getUser().isAdmin()) {
+//			String dataScopeSql = dataScopeFilter(workOrder.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORDS.getValue());
+////			String dataScopeSql = dataScopeFilterOR(questionFeedback.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_PERFORMANCE.getValue());
+//            workOrder.getSqlMap().put("dsf", dataScopeSql);
+//		}
+        workOrder.setHandle(UserUtils.getUser());
+        int count = dao.queryCount(workOrder);
+        page.setCount(count);
+        page.setCountFlag(false);
+        workOrder.setPage(page);
+        List<WorkOrder> workOrderList = findList(workOrder);
+        for (WorkOrder order : workOrderList) {
+            WorkOrderProcessing workOrderProcessing=workOrderDao.getProcessingByOrder(order.getId()).get(0);
+                if (UserUtils.getUser().getId().equals(workOrderProcessing.getHandleId())) {
+                    order.setHandleFalg(true);
+                }else{
+                    order.setHandleFalg(false);
+                }
+            order.setHandle(workOrderProcessing.getHandleUser());
+        }
+        page.setList(workOrderList);
+        return page;
+    }
+
+    /**
+     * 保存流程以及工单信息
+     * @param workOrder
+     * @return
+     */
+    @Transactional(readOnly = false)
+    public String saveProcessing(WorkOrder workOrder){
+        //根据问题类型获取处理人
+        String handleId=workOrderDao.findRelationByUserId(workOrder.getQuestionType());
+        User user=UserUtils.get(handleId);
+        //添加工单信息
+        workOrder.setProcessingStatus("2");
+        super.save(workOrder);
+        //添加工单流程
+        WorkOrderProcessing processing=new WorkOrderProcessing();
+        processing.setId(IdGen.uuid());
+        processing.preInsert();
+        processing.setStartDate(new Date());
+        processing.setEndDate(new Date());
+        processing.setHandleId(workOrder.getCreateBy().getId());
+        processing.setHandleOffice(workOrder.getCreateBy().getOffice().getId());
+        processing.setHandleOpinion("发起申请");
+        processing.setMissionDuration("0秒");
+        processing.setWorkOrderId(workOrder.getId());
+        processing.setSort(1);
+        workOrderDao.insertProcessing(processing);
+        //添加工单流程
+        WorkOrderProcessing workOrderProcessing=new WorkOrderProcessing();
+        workOrderProcessing.setId(IdGen.uuid());
+        workOrderProcessing.preInsert();
+        workOrderProcessing.setStartDate(processing.getEndDate());
+        workOrderProcessing.setHandleId(handleId);
+        workOrderProcessing.setHandleOffice(user.getOffice().getId());
+        workOrderProcessing.setHandleOpinion("处理中");
+        workOrderProcessing.setWorkOrderId(workOrder.getId());
+        workOrderProcessing.setSort(2);
+        workOrderDao.insertProcessing(workOrderProcessing);
+        //添加一条默认评论
+        WorkOrderComment workOrderComment=new WorkOrderComment();
+        workOrderComment.setId(IdGen.uuid());
+        workOrderComment.preInsert();
+        workOrderComment.setUserId(UserUtils.getUser().getId());
+        workOrderComment.setContent(workOrder.getContent());
+        workOrderComment.setWorkOrderId(workOrder.getId());
+        workOrderComment.setWorkAttachments(workOrder.getWorkAttachments());
+        workOrderCommentDao.insert(workOrderComment);
+
+        //保存附件
+        this.saveAttachments(workOrderComment);
+        return "";
+    }
+    @Transactional(readOnly = false)
+    public void saveAttachments(WorkOrderComment workOrderComment) {
+        List<Workattachment> workattachments = workOrderComment.getWorkAttachments();
+        if (workattachments!=null && workattachments.size()!=0) {
+            for (Workattachment workattachment : workattachments) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(workOrderComment.getId());
+                    workattachment.setAttachmentFlag("191");
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    } else {
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                } else {
+                    workattachmentService.delete(workattachment);
+                }
+            }
+        }
+    }
+    @Transactional(readOnly = false)
+    public void updateHandle(WorkOrder workOrder) throws Exception {
+        WorkOrder order = dao.get(workOrder.getId());
+        MyBeanUtils.copyBeanNotNull2Bean(workOrder, order);
+        order.preUpdate();
+        dao.update(order);
+        //根据问题类型获取处理人
+        String handleId=workOrderDao.findRelationByUserId(workOrder.getQuestionType());
+        User user=UserUtils.get(handleId);
+        //设置当前处理人的结束时间
+        WorkOrderProcessing processing=workOrderDao.getProcessingByOrder(workOrder.getId()).get(0);
+        processing.setEndDate(new Date());
+        processing.setHandleOpinion("[处理中]转接");
+        workOrderDao.updateProcessing(processing);
+        //添加工单流程
+        WorkOrderProcessing workOrderProcessing=new WorkOrderProcessing();
+        workOrderProcessing.setId(IdGen.uuid());
+        workOrderProcessing.preInsert();
+        workOrderProcessing.setStartDate(processing.getEndDate());
+        workOrderProcessing.setHandleId(handleId);
+        workOrderProcessing.setHandleOffice(user.getOffice().getId());
+        workOrderProcessing.setSort(2);
+        workOrderProcessing.setHandleOpinion("处理中");
+        workOrderProcessing.setWorkOrderId(order.getId());
+        workOrderDao.insertProcessing(workOrderProcessing);
+    }
+    @Transactional(readOnly = false)
+    public void solve(WorkOrder workOrder) throws Exception {
+        workOrder.preUpdate();
+        dao.update(workOrder);
+        //设置当前处理人的结束时间
+        WorkOrderProcessing processing=workOrderDao.getProcessingByOrder(workOrder.getId()).get(0);
+        processing.setEndDate(new Date());
+        processing.setHandleOpinion("已解决");
+        workOrderDao.updateProcessing(processing);
+    }
+}

+ 337 - 0
src/main/java/com/jeeplus/modules/workOrder/web/WorkOrderController.java

@@ -0,0 +1,337 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workOrder.web;
+
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.feedback.entity.QuestionFeedback;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.utils.ErrorCode;
+import com.jeeplus.modules.workOrder.dao.WorkOrderCommentDao;
+import com.jeeplus.modules.workOrder.dao.WorkOrderDao;
+import com.jeeplus.modules.workOrder.entity.WorkOrder;
+import com.jeeplus.modules.workOrder.entity.WorkOrderComment;
+import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
+import com.jeeplus.modules.workOrder.enums.WorkOrderStatusEnum;
+import com.jeeplus.modules.workOrder.service.WorkOrderCommentService;
+import com.jeeplus.modules.workOrder.service.WorkOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+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.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+
+/**
+ * 工单管理Controller
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/workOrder/workOrder")
+public class WorkOrderController extends BaseController {
+	@Autowired
+	private WorkOrderService workOrderService;
+	@Autowired
+	private WorkOrderDao workOrderDao;
+	@Autowired
+	private WorkOrderCommentDao workOrderCommentDao;
+	@Autowired
+	private WorkattachmentService workattachmentService;
+	@Autowired
+	private WorkOrderCommentService workOrderCommentService;
+	@ModelAttribute
+	public WorkOrder get(@RequestParam(required=false) String id) {
+		WorkOrder entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = workOrderService.get(id);
+		}
+		if (entity == null){
+			entity = new WorkOrder();
+		}
+		return entity;
+	}
+
+	/**
+	 * 列表
+	 * @param workOrder
+	 * @param request
+	 * @param response
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequestMapping(value = {"list", ""})
+	public String list(WorkOrder workOrder, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes redirectAttributes) {
+		//进行查询之后进行任何操作,返回还是查询之后的数据页面
+		if (StringUtils.isNotBlank(workOrder.getToflag())){
+			if (workOrder.getToflag().equals("1")){
+				request.getSession().removeAttribute("searchWorkOrder");
+				WorkOrder search=workOrder;
+				request.getSession().setAttribute("searchWorkOrder",search);
+			}
+		}else{
+			if (request.getSession().getAttribute("searchWorkOrder")!=null){
+				workOrder= (WorkOrder) request.getSession().getAttribute("searchWorkOrder");
+				model.addAttribute("searchWorkOrder", workOrder);
+			}
+		}
+		Page<WorkOrder> page = workOrderService.findPage(new Page<WorkOrder>(request, response), workOrder);
+		model.addAttribute("page", page);
+		return "modules/workOrder/workOrderList";
+	}
+
+	/**
+	 * 工单添加或修改
+	 * @param workOrder
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "form")
+	public String form(WorkOrder workOrder, Model model) {
+		if (workOrder!=null&&StringUtils.isNotBlank(workOrder.getId())) {
+			workOrder = workOrderService.get(workOrder.getId());
+			User user=UserUtils.get(workOrder.getCreateBy().getId());
+			workOrder.setCreateBy(user);
+		}else {
+			workOrder.setCreateBy(UserUtils.getUser());
+			workOrder.setCreateDate(new Date());
+		}
+		model.addAttribute("workOrder", workOrder);
+		return "modules/workOrder/workOrderForm";
+	}
+
+	/**
+	 * 保存
+	 * @param workOrder
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "save")
+	public String save(WorkOrder workOrder, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		if (!beanValidator(model, workOrder)){
+			return form(workOrder, model);
+		}
+		workOrder.setProcessingStatus(String.valueOf(WorkOrderStatusEnum.IN_APRL.getValue()));
+		String str = "";
+		str = workOrderService.saveProcessing(workOrder);//保存
+		if (StringUtils.isNotBlank(str)){
+			addMessage(redirectAttributes, "保存工单失败:"+str);
+		}else {
+			addMessage(redirectAttributes, "保存工单成功");
+		}
+
+		return "redirect:" + adminPath + "/workOrder/workOrder/?repage";
+	}
+
+	/**
+	 * 查看流程
+	 * @param workOrder
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "getWorkOrderProcessing")
+	public String getWorkOrderProcessing(WorkOrder workOrder, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		if (!beanValidator(model, workOrder)){
+			return form(workOrder, model);
+		}
+		List<WorkOrderProcessing> workOrderProcessingList=workOrderDao.findProcessingByOrderId(workOrder.getId());
+		model.addAttribute("workOrderProcessingList",workOrderProcessingList);
+		return "modules/workOrder/workOrderProcessing";
+
+	}
+	/**
+	 * 回复 工单
+	 * @param workOrder
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "handle")
+	public String handle(WorkOrder workOrder, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		if (!beanValidator(model, workOrder)){
+			return form(workOrder, model);
+		}
+		workOrder = workOrderService.get(workOrder.getId());
+		List<WorkOrderComment> workOrderComments=workOrderCommentDao.findCommentByWorkOrderId(workOrder.getId());
+		for (WorkOrderComment comment:workOrderComments){
+			//获取评论人
+			User user=UserUtils.get(comment.getUserId());
+			comment.setUser(user);
+			if(null != comment.getMinuteTime()){
+				//判断评论时间是否小于60分钟
+				if(comment.getMinuteTime() < 60){
+					comment.setCommentDateStr(comment.getMinuteTime() + "分钟");
+				}else{
+					//计算评论时间距今过去多少小时
+					Long hour = comment.getMinuteTime()/60;
+					//判断小时数是否大于24
+					if(hour > 24){
+						Long day = hour/24;
+						comment.setCommentDateStr(day + "天");
+					}else{
+						comment.setCommentDateStr(hour + "小时");
+					}
+				}
+			}else{
+				comment.setCommentDateStr("0分钟");
+			}
+			//获取附件信息
+			List<Workattachment> attachmentList = workattachmentService.getListByAttachmentIdAndFlag(comment.getId(), "191");
+			comment.setWorkAttachments(attachmentList);
+			//添加当前文件服务器类型
+			comment.setUploadMode(uploadMode);
+			//数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+			workattachmentService.attachmentManageOnUrl(comment.getWorkAttachments());
+			User u=UserUtils.get(workOrder.getCreateBy().getId());
+			if (!workOrder.getCreateBy().getId().equals(comment.getUser().getId())){
+				comment.setCommentFalg(true);
+				String commentName= UserUtils.get(workOrder.getCreateBy().getId()).getName();
+				comment.setCommentName(commentName);
+			}else{
+				comment.setCommentFalg(false);
+			}
+		}
+		//获取工单的当前处理人
+		WorkOrderProcessing workOrderProcessing=workOrderDao.getProcessingByOrder(workOrder.getId()).get(0);
+		//判断当前登录人是否是当前处理人
+		boolean falg=false;
+		if (UserUtils.getUser().getId().equals(workOrderProcessing.getHandleId())) {
+			falg=true;
+		}
+		model.addAttribute("processingFalg",falg);
+		model.addAttribute("workOrder",workOrder);
+		model.addAttribute("workOrderComments",workOrderComments);
+		model.addAttribute("workOrderCommentCount",workOrderComments.size());
+		return "modules/workOrder/workOrderCommentAdd";
+
+	}
+	/**
+	 * 保存回复信息
+	 * @param workOrderComment
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@ResponseBody
+	@RequestMapping(value = "saveComment")
+	public String saveComment(WorkOrderComment workOrderComment, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		workOrderCommentService.insertComment(workOrderComment);
+		return "发布成功";
+	}
+	/**
+	 * 修改问题类型
+	 * 转接人
+	 * @param workOrder
+	 * @param model
+	 * @return
+	 * @throws Exception
+	 */
+	@ResponseBody
+	@RequestMapping(value = "updateHandle")
+	public AjaxJson updateHandle(WorkOrder workOrder, Model model) throws Exception {
+		AjaxJson j=new AjaxJson();
+		workOrderService.updateHandle(workOrder);
+		return j;
+	}
+	/**
+	 * 解决/结束
+	 * @param workOrder
+	 * @param model
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "solve")
+	public String solve(WorkOrder workOrder, Model model) throws Exception {
+		WorkOrder order =workOrderService.get(workOrder.getId());
+		MyBeanUtils.copyBeanNotNull2Bean(workOrder, order);
+		order.setProcessingStatus("5");
+		workOrderService.solve(order);
+		return "redirect:" + adminPath + "/workOrder/workOrder/?repage";
+	}
+	/**
+	 * 查看 工单
+	 * @param workOrder
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "handleView")
+	public String handleView(WorkOrder workOrder, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		workOrder = workOrderService.get(workOrder.getId());
+		List<WorkOrderComment> workOrderComments=workOrderCommentDao.findCommentByWorkOrderId(workOrder.getId());
+		for (WorkOrderComment comment:workOrderComments){
+			//获取评论人
+			User user=UserUtils.get(comment.getUserId());
+			comment.setUser(user);
+			if(null != comment.getMinuteTime()){
+				//判断评论时间是否小于60分钟
+				if(comment.getMinuteTime() < 60){
+					comment.setCommentDateStr(comment.getMinuteTime() + "分钟");
+				}else{
+					//计算评论时间距今过去多少小时
+					Long hour = comment.getMinuteTime()/60;
+					//判断小时数是否大于24
+					if(hour > 24){
+						Long day = hour/24;
+						comment.setCommentDateStr(day + "天");
+					}else{
+						comment.setCommentDateStr(hour + "小时");
+					}
+				}
+			}else{
+				comment.setCommentDateStr("0分钟");
+			}
+			//获取附件信息
+			List<Workattachment> attachmentList = workattachmentService.getListByAttachmentIdAndFlag(comment.getId(), "191");
+			comment.setWorkAttachments(attachmentList);
+			//添加当前文件服务器类型
+			comment.setUploadMode(uploadMode);
+			//数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+			workattachmentService.attachmentManageOnUrl(comment.getWorkAttachments());
+
+			List<WorkOrderProcessing> workOrderProcessings=workOrderDao.getProcessingByOrder(workOrder.getId());
+			for (WorkOrderProcessing processing:workOrderProcessings){
+				if (processing.getHandleId().equals(comment.getUser().getId())){
+					comment.setCommentFalg(true);
+					String commentName= UserUtils.get(workOrder.getCreateBy().getId()).getName();
+					comment.setCommentName(commentName);
+				}else{
+					comment.setCommentFalg(false);
+				}
+			}
+		}
+		model.addAttribute("workOrder",workOrder);
+		model.addAttribute("workOrderComments",workOrderComments);
+		model.addAttribute("workOrderCommentCount",workOrderComments.size());
+		return "modules/workOrder/workOrderCommentView";
+
+	}
+	@ResponseBody
+	@RequestMapping("getHandle")
+	public Map<String,Object> getHandle(WorkOrder workOrder, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes redirectAttributes) {
+		Map<String,Object> map=new HashMap<>();
+		workOrder.setHandle(UserUtils.getUser());
+		Integer count=workOrderDao.queryHandleCount(workOrder);
+		map.put("count",count);
+		return map;
+	}
+}

+ 62 - 0
src/main/resources/mappings/modules/workOrder/WorkOrderCommentDao.xml

@@ -0,0 +1,62 @@
+<?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.jeeplus.modules.workOrder.dao.WorkOrderCommentDao">
+    
+	<sql id="workOrderCommentColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.work_order_id AS "workOrderId",
+		a.content AS "content",
+		a.user_id AS "userId"
+	</sql>
+	<select id="get" resultType="com.jeeplus.modules.workOrder.entity.WorkOrderComment" >
+		SELECT 
+			<include refid="workOrderCommentColumns"/>
+		FROM work_order_comment a
+		WHERE a.id = #{id}
+	</select>
+	<select id="findCommentByWorkOrderId" resultType="com.jeeplus.modules.workOrder.entity.WorkOrderComment">
+		SELECT
+		<include refid="workOrderCommentColumns"/>
+		,timestampdiff(MINUTE,a.update_date,now()) as minuteTime
+		FROM work_order_comment a
+		WHERE a.work_order_id = #{workOrderId}
+		order By a.update_date desc
+	</select>
+	<insert id="insert">
+		INSERT INTO work_order_comment (
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			content,
+			work_order_id,
+			user_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{content},
+			#{workOrderId},
+			#{userId}
+		)
+	</insert>
+
+
+	<delete id="delete">
+		delete from work_order_comment WHERE id = #{id}
+	</delete>
+
+</mapper>

+ 281 - 0
src/main/resources/mappings/modules/workOrder/WorkOrderDao.xml

@@ -0,0 +1,281 @@
+<?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.jeeplus.modules.workOrder.dao.WorkOrderDao">
+    
+	<sql id="workOrderColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.title AS "title",
+		a.content AS "content",
+		a.processing_status AS "processingStatus",
+		a.question_type AS "questionType"
+	</sql>
+	<sql id="workOrderProcessingColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.handle_id AS "handleId",
+		a.handle_office AS "handleOffice",
+		a.handle_opinion AS "handleOpinion",
+		a.work_order_id AS "workOrderId",
+		a.start_date AS "startDate",
+		a.end_date AS "endDate"
+	</sql>
+	<select id="get" resultType="WorkOrder" >
+		SELECT 
+			<include refid="workOrderColumns"/>
+		FROM work_order a
+		WHERE a.id = #{id}
+	</select>
+	<select id="queryCount" resultType="int">
+		SELECT
+			count(DISTINCT a.id)
+		FROM
+			work_order a
+		<where>
+			<if test="title!=null and title !=''">
+				and a.title like CONCAT('%',#{title},'%')
+			</if>
+			<if test="content!=null and content !=''">
+				and a.content like CONCAT('%',#{content},'%')
+			</if>
+<!--			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">-->
+<!--				 ${sqlMap.dsf}-->
+<!--			</if>-->
+			<if test="handle!=null and handle!=''">
+				<if test="handle.id!=null and handle.id !=''">
+					and a.id IN (
+					SELECT
+					work_order_id
+					FROM
+					work_order_processing_flow
+					WHERE
+					handle_id = #{handle.id}
+					)
+				</if>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findList" resultType="WorkOrder" >
+		SELECT 
+			<include refid="workOrderColumns"/>
+			,u.name As "createBy.name"
+# 			,f.handle_id As "handle.id"
+# 			,uu.name As "handle.name"
+		FROM work_order a
+		left join sys_user u on a.create_by=u.id
+# 		left join work_order_processing_flow f on a.id=f.work_order_id
+# 		left join sys_user uu on f.handle_id=uu.id
+		<where>
+			<if test="title!=null and title !=''">
+				and a.title like CONCAT('%',#{title},'%')
+			</if>
+			<if test="content!=null and content !=''">
+				and a.content like CONCAT('%',#{content},'%')
+			</if>
+			<if test="handle.id!=null and handle.id !=''">
+				and a.id IN (
+				SELECT
+				work_order_id
+				FROM
+				work_order_processing_flow
+				WHERE
+				handle_id = #{handle.id}
+				)
+			</if>
+<!--			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">-->
+<!--				 ${sqlMap.dsf}-->
+<!--			</if>-->
+		</where>
+		GROUP BY a.id
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	<select id="findRelationByUserId" resultType="java.lang.String">
+		select user_id from work_order_querstion_relation
+		where question_key=#{questionType}
+	</select>
+	<select id="findProcessingByOrderId" resultType="com.jeeplus.modules.workOrder.entity.WorkOrderProcessing">
+		select
+			<include refid="workOrderProcessingColumns"/>
+			,u.name As "handleUser.name"
+			,o.name As "officeName"
+			,timestampdiff(MINUTE,a.start_date,a.end_date) as "missionDuration"
+		from work_order_processing_flow a
+		left join sys_user u on a.handle_id=u.id
+		left join sys_office o on o.id = a.handle_office
+		where a.work_order_id = #{workOrderId}
+		ORDER BY a.create_date asc,a.sort asc
+	</select>
+	<select id="getProcessingByOrder" resultType="com.jeeplus.modules.workOrder.entity.WorkOrderProcessing">
+		select
+		<include refid="workOrderProcessingColumns"/>
+		,u.name As "handleUser.name"
+		,u.id As "handleUser.id"
+		,o.name As "officeName"
+		,timestampdiff(MINUTE,a.start_date,a.end_date) as "missionDuration"
+		from work_order_processing_flow a
+		left join sys_user u on a.handle_id=u.id
+		left join sys_office o on o.id = a.handle_office
+		where a.work_order_id = #{workOrderId} and a.sort=2
+		ORDER BY a.create_date DESC,a.sort asc
+	</select>
+	<select id="queryHandleCount" resultType="java.lang.Integer">
+		SELECT
+		count(DISTINCT a.id)
+		FROM
+		work_order a
+		<where>
+			a.processing_status=2
+			<if test="handle.id!=null and handle.id !=''">
+				and a.id IN (
+				SELECT
+				work_order_id
+				FROM
+				work_order_processing_flow
+				WHERE
+				handle_id = #{handle.id}
+				)
+			</if>
+
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	<!--	<select id="findProcessingByUserId" resultType="com.jeeplus.modules.workOrder.entity.WorkOrderProcessing">-->
+<!--		select-->
+<!--		<include refid="workOrderProcessingColumns"/>-->
+<!--		,u.name As "handleUser.name"-->
+<!--		,u.id As "handleUser.id"-->
+<!--		,o.name As "officeName"-->
+<!--		from work_order_processing_flow a-->
+<!--		left join sys_user u on a.handle_id=u.id-->
+<!--		left join sys_office o on o.id = a.handle_office-->
+<!--		where a.handle_id = #{handleId}-->
+<!--		ORDER BY a.update_date DESC-->
+<!--	</select>-->
+
+	<insert id="insert">
+		INSERT INTO work_order(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			office_id,
+			title,
+			content,
+			processing_status,
+			question_type
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{createBy.office.id},
+			#{title},
+			#{content},
+			#{processingStatus},
+			#{questionType}
+		)
+	</insert>
+	<insert id="insertProcessing">
+		INSERT INTO work_order_processing_flow(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			handle_id,
+			handle_office,
+			handle_opinion,
+			mission_duration,
+			work_order_id,
+		    sort,
+		    start_date,
+		    end_date
+		) VALUES (
+			 #{id},
+			 #{createBy.id},
+			 #{createDate},
+			 #{updateBy.id},
+			 #{updateDate},
+			 #{remarks},
+			 #{delFlag},
+			 #{handleId},
+			 #{handleOffice},
+			 #{handleOpinion},
+			 #{missionDuration},
+			 #{workOrderId},
+			 #{sort},
+			 #{startDate},
+			 #{endDate}
+		 )
+	</insert>
+	<insert id="updateProcessing">
+		UPDATE work_order_processing_flow SET
+			  update_by = #{updateBy.id},
+			  update_date = #{updateDate},
+			  remarks = #{remarks},
+			  handle_id = #{handleId},
+			  handle_office = #{handleOffice},
+			  handle_opinion=#{handleOpinion},
+			  start_date=#{startDate},
+			  end_date=#{endDate}
+		WHERE id = #{id}
+	</insert>
+
+	<update id="update">
+		UPDATE work_order SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			title = #{title},
+			content = #{content},
+			processing_status=#{processingStatus},
+			question_type=#{questionType}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		delete from work_order WHERE id = #{id}
+	</delete>
+
+</mapper>

+ 14 - 1
src/main/webapp/static/common/jeeplus.js

@@ -578,7 +578,20 @@ function getAuditRecordState(id)
     }
     return result;
 }
-
+function getWorkOrderState(id)
+{
+    var result ={};
+    result.action = true;
+    switch(id)
+    {
+        case "0":result.status="";result.action = false;break;
+        case "2":result.label = "auditing";result.status="处理中";break;
+        case "5":result.label = "signed";result.status="已解决";break;
+        default:
+            result.label = "unknown";result.status="未知";break;
+    }
+    return result;
+}
 function getFilingBatchRelationStatus(id)
 {
     var result ={};

+ 169 - 0
src/main/webapp/static/oss/ossupload.js

@@ -153,6 +153,67 @@ function multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,upload
             multitest(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, cpt);
     })
 };
+function multipartUploadWorkOrder(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, cpt,idx,prefix,currentUser) {
+
+    console.log("-----------------------start");
+    console.log("-----------------------"+realPath);
+
+    file.name.replace(" ","")
+    file.name.replace(/—/g,"")
+    var fileName = file.name;
+    // 将单引号‘’都转换成',将双引号“”都转换成"
+    fileName = fileName.replace(/\’|\‘/g,"'").replace(/\“|\”/g,"\"");
+    // 将中括号【】转换成[],将大括号{}转换成{}
+    fileName = fileName.replace(/\【/g,"(").replace(/\】/g,")").replace(/\{/g,"(").replace(/\}/g,")");
+    fileName = fileName.replace(/\[/g,"(").replace(/\]/g,")").replace(/\{/g,"(").replace(/\}/g,")");
+    // 将逗号,转换成,,将:转换成:
+    fileName = fileName.replace(/,/g,",").replace(/:/g,":");
+    //将中文——转换为英文-
+    fileName = fileName.replace(/—/g,"-")
+    fileName = fileName.replace(/……/g,"")
+    fileName = fileName.replace(/±/g,"")
+    fileName = fileName.replace(/#/g,"")
+    fileName = fileName.replace(/%/g,"")
+    var dfl=new File([file],fileName,{type:file.type});
+    file = dfl
+
+    requestUrl = realPath+"/previewController/getAccess";
+    OSS.urllib.request(requestUrl, {method: 'GET'}, function (err, response) {
+        if (err) {
+            console.log(err);
+            $.ajax({
+                type:"post",
+                url:realPath+"/previewController/saveJSError",
+                data:{object:err.toString()},
+                async: false,
+                success:function(data){
+                }
+            });
+            return alert(err);
+        }
+        try {
+            result = JSON.parse(response);
+        } catch (e) {
+            errmsg = 'parse sts response info error: ' + e.message;
+            return alert(errmsg);
+        }
+        console.log("---------result"+result);
+        client = new OSS.Wrapper({
+            accessKeyId: result.AccessKeyId,
+            accessKeySecret: result.AccessKeySecret,
+            stsToken: result.SecurityToken,
+            bucket: result.Bucket,
+            endpoint: result.Endpoint,
+            timeout:'30000'
+        });
+        storeAs = "attachment-file/" + storeAs +"/"+today+new Date().getTime()+ file.name;
+        if(cpt == 1)
+            multitestFlag(client,storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, cpt,idx,prefix,currentUser);
+        else
+            multitestWorkOrder(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, cpt);
+    })
+};
+
 function ftlMultitest (storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,cpt) {
     var formdata = new FormData();
     formdata.append("storeAs",storeAs);
@@ -792,6 +853,114 @@ function multitest (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadP
         console.log(err);
     });
 };
+function multitestWorkOrder (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,cpt) {
+
+    var names =  storeAs.split("/");
+    var name = names[names.length-1];
+    ossClient.multipartUpload(storeAs, file,{
+        partSize: 1 * 1024 * 1024,
+        parallel: 5,
+        progress: function* (percent, cpt) {
+            var p = Math.floor(percent*100);
+            $("#jindutiao"+divId).attr("style","width: "+p+"%");
+            $("#jindutiao"+divId).attr("aria-valuenow",p+"%");
+            $("#baifenbi"+divId).html(p+"%");
+            $("#fileName"+divId).html(file.name);
+            checkpoint_temp = cpt;
+        }
+    }).then(function (result) {
+        var fileLocation = "";
+        var lookUrl = "";
+        //获取文件存储位置(0:本地;1:百度云;2:阿里云)
+        $.ajax({
+            type:"get",
+            url:realPath+"/bos/getFileStorageLocation",
+            async: false,
+            success:function(data){
+                fileLocation = data.fileLocation;
+            }
+        });
+
+        returnUrl = realPath+"/sys/workattachment/saveAttachment";
+        $.ajax({
+            type:'post',
+            url:returnUrl,
+            data:{
+                "attachmentName":file['name'],
+                "attachmentId":attachmentId,
+                "attachmentFlag":attachmentFlag,
+                "fileSize":file['size'],
+                "url":"/"+storeAs
+            },
+            success:function(data){
+                var lowerType = data.type.toLowerCase();
+                if(data.status=="Success"){
+                    parent.layer.msg("上传成功!",{icon:1});
+                    var lenght =$(".trIdAdds").length;
+                    if (size != 0){
+                        lenght += size;
+                    }
+                    var addFile = "addFile"+divId;
+                    var str = '<tr class="trIdAdds">'+
+                        '<td class="text-center">' ;
+                    if(2 == fileLocation){
+                        $.ajax({
+                            type:"post",
+                            async:false,
+                            url:realPath+"/workfullmanage/workFullManage/getFileTemporaryLookUrl",
+                            data:{"file":data.url,},
+                            success:function(result){
+                                lookUrl = result.lookUrl;
+                                if (isContains("jpg,png,gif,bmp,jpeg",lowerType)){
+                                    str = str +'<img src="'+lookUrl+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+ '/a/sys/picturepreview/picturePreview?url=' +lookUrl+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+                                }
+                            }
+                        });
+
+                    }else{
+                        if (isContains("jpg,png,gif,bmp,jpeg",lowerType)){
+                            str = str +'<img src="'+data.url+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+realPath+ '/a/sys/picturepreview/picturePreview?url=' +data.url+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+                        }
+                    }
+                    str = str +'</td>'+
+                        '<input name="workAttachments['+lenght+'].id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value=""/>'+
+                        '<input name="workAttachments['+lenght+'].attachmentId" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentId+'"/>'+
+                        '<input name="workAttachments['+lenght+'].url" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.url+'"/>'+
+                        '<input name="workAttachments['+lenght+'].temporaryUrl" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.temporaryUrl+'"/>'+
+                        '<input name="workAttachments['+lenght+'].attachmentName" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentName+'"/>'+
+                        '<input name="workAttachments['+lenght+'].createBy.id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.createBy+'"/>'+
+                        '<input name="workAttachments['+lenght+'].type" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.type+'"/>'+
+                        '<input name="workAttachments['+lenght+'].attachmentFlag" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentFlag+'"/>'+
+                        '<input name="workAttachments['+lenght+'].fileSize" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.fileSize+'"/>'+
+                        '</td>'+
+                        '<td class="op-td">'+
+                        '<div class="op-btn-box">';
+                    if(2 == fileLocation){
+                        if(isContains("pdf",lowerType)){
+                            str = str +'<a href="javascript:void(0)" onclick="openPreview(\''+lookUrl+'\',1)" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                        }else{
+                            str = str +'<a href="'+lookUrl+'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                        }
+                    }else{
+                        str = str +'<a href="javascript:location.href=\''+realPath+'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                    }
+                    str = str +
+                        '<a href="javascript:void(0)" onclick="deleteFileFromAliyun1(this,\''+realPath+'/a/sys/workattachment/deleteFileFromAliyun?url='+encodeURIComponent(data.url)+'&id='+data.id+'&type=2\',\''+addFile+'\',\''+divId+'\')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>'+
+                        '</div>' +
+                        '</td>'+
+                        '</tr>';
+                    $("#file"+divId).append(str);
+                }else {
+                    parent.layer.msg("上传失败!",{icon:2});
+                }
+            }
+        })
+    }).catch(function (err) {
+        console.log("err------ err:");
+        console.log(err);
+    });
+};
+
 function multipartUploadWithStsRecordsReported(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, cpt,idx,prefix,currentUser) {
 
     console.log("-----------------------start");

+ 19 - 0
src/main/webapp/webpage/modules/sys/sysIndex.jsp

@@ -41,6 +41,18 @@
             $.ajax({
                 type : "get",
                 async : true, //同步请求
+                url : "${ctx}/workOrder/workOrder/getHandle",
+                success:function(datas){
+                    //$("#mainContent").html(dates);//要刷新的div
+                    $("#totalCount2").text((datas.count)>9?"10+":(datas.count));
+                },
+                error: function() {
+                    <!--parent.layer.msg('获取通知失败,请稍后再试!',{icon:2}) -->
+                }
+            });
+            $.ajax({
+                type : "get",
+                async : true, //同步请求
                 url : "${ctx}/feedback/questionFeedback/getCount",
                 success:function(datas){
                     //$("#mainContent").html(dates);//要刷新的div
@@ -321,6 +333,13 @@
                         <%--</ul>--%>
                     </li>
                     <li class="dropdown">
+                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="javascript:void(0)" onclick='top.openTab("${ctx }/workOrder/workOrder/list","工单管理", false)' >
+                            <%--<i class="fa fa-bell"></i>--%>
+                            <i class="fa fa-list-ul"></i>
+                            <span class="label label-danger labelInfo" id="totalCount2">0</span>&nbsp;工单管理
+                        </a>
+                    </li>
+                    <li class="dropdown">
                         <a class="dropdown-toggle count-info" data-toggle="dropdown" href="javascript:void(0)" onclick='top.openTab("${ctx }/feedback/questionFeedback/list","反馈列表", false)' >
                             <%--<i class="fa fa-bell"></i>--%>
                             <i class="fa fa-list-ul"></i>

+ 249 - 0
src/main/webapp/webpage/modules/workOrder/workOrderCommentAdd.jsp

@@ -0,0 +1,249 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>反馈管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+    </style>
+    <script>
+        var validateForm;
+        $(document).ready(function() {
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+            });
+
+            layui.form.on('select(questionType)',function(data) {
+                var workOrderId=$("#workOrderId").val();
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/workOrder/workOrder/updateHandle',
+                    data:{
+                        "questionType":data.value,
+                        "id":workOrderId
+                    },
+                    dataType:"json",
+                    async: false,
+                    success:function(data){
+                        if(data.success) {
+                            top.layer.msg("转接成功!",{icon:1});
+                            location.reload();
+                        }
+                    }
+                })
+            });
+        })
+        function submitComment(){
+            var validateForm = $(document.getElementById("inputForm")).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $(document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $(document.getElementById("inputForm")).ajaxSubmit({
+                    success:function(data) {
+                        top.layer.msg("发布成功!",{icon:1});
+                        location.reload();
+                    }
+                });
+            }
+
+        }
+        function insertTitle(tValue){
+            var list = "${workOrder.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;
+            for(var i = 0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "191";
+                console.log(file);
+                var timestamp = new Date().getTime();
+                var str=file.name;
+                var index = str.lastIndexOf(".");
+                str = str.substring(index + 1, str.length);
+                if (str == "png" || str == "jpg" || str == "gif" || str == "bmp" || str == "jpeg"){
+                    var storeAs = "workOrder";
+                    var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                    /*将这段字符串存到数据库即可*/
+                    var divId = "_attachment";
+                    $("#addFile" + divId).show();
+                    multipartUploadWorkOrder(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+                }else{
+                    top.layer.msg("请上传图片!",{icon:2});
+                    return false
+                }
+            }
+        }
+        function resetComment() {
+            $("#content").val("");
+        }
+    </script>
+
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+        <div class="container">
+            <form:form id="inputForm" modelAttribute="workOrder" enctype="multipart/form-data" action="${ctx}/workOrder/workOrder/saveComment" method="post" class="form-horizontal layui-form">
+                <input type="hidden" id="workOrderId" name="workOrderId" value="${workOrder.id}" />
+                <sys:message content="${message}"/>
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>工单信息</h2></div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label"><span class="require-item">*</span>工单标题:</label>
+                        <div class="layui-input-block">
+                            <form:input path="title" readonly="true" htmlEscape="false" placeholder="请输入工单标题" maxlength="50" class="form-control required layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 ">
+                        <label class="layui-form-label">问题类型:</label>
+                        <div class="layui-input-block">
+                            <c:choose>
+                                <c:when test="${processingFalg}">
+                                    <form:select path="questionType" lay-filter="questionType" class="form-control required simple-select">
+                                        <form:option value="" label=""/>
+                                        <form:options items="${fns:getMainDictList('work_order_question_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                                    </form:select>
+                                </c:when>
+                                <c:otherwise>
+                                    <form:select path="questionType" disabled="true" class="form-control required simple-select">
+                                        <form:option value="" label=""/>
+                                        <form:options items="${fns:getMainDictList('work_order_question_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                                    </form:select>
+                                </c:otherwise>
+                            </c:choose>
+
+                        </div>
+                    </div>
+                </div>
+                <c:if test="${fns:getUser().id eq workOrder.createBy.id || processingFalg}">
+                    <div class="form-group layui-row">
+                        <div class="form-group-label"><h2>回复</h2></div>
+                        <div class="layui-item layui-col-xs12 with-textarea">
+                            <div class="layui-input-block" style="margin-left:0px;position: relative">
+                                <textarea name="content"  placeholder="请输入回复信息:" id="content" class="form-control required" rows="4" maxlength="255"></textarea>
+                            </div>
+                            <div class="form-group layui-row" style="width: 70%;float: left">
+                                <div>
+                                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                                <span id="attachment_title"></span>
+                                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                                    <table id="upTable" class="table table-bordered table-condensed details">
+                                        <tbody id="file_attachment">
+                                        </tbody>
+                                    </table>
+                                </div>
+                                </div>
+                            </div>
+                            <div style="float: right;width: 30%;">
+                                <br/>
+                                <a id="attachment_btn" class="layui-btn layui-bg-blue" title="添加附件"><i class="fa fa-plus"></i>&nbsp;上传图片</a>
+                                <a href="javascript:void(0)" id="submitComment" class="layui-btn" onclick="submitComment()">发表</a>
+                                <a href="javascript:void(0)" id="resetComment" class="layui-btn layui-btn-primary" onclick="resetComment()">清空</a>
+                            </div>
+                        </div>
+                    </div>
+
+                </c:if>
+                <div class="form-group layui-row page-end"></div>
+            </form:form>
+
+        </div>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class=" layui-form" style="width: 80%;margin: 20px auto;">
+                <div class="form-group layui-row">
+                    <h2 >全部回复(${workOrderCommentCount}条)</h2>
+                    <hr>
+                    <c:forEach items="${workOrderComments}" var="workOrderComment" varStatus="status">
+                        <div class="layui-item layui-col-xs12" id="comment${workOrderComment.id}">
+                            <div class="conmment_details">
+                                <c:choose>
+                                    <c:when test="${workOrderComment.commentFalg}">
+                                        <span class="comment_name"><span style="font-weight: bold;font-size: 18px">${workOrderComment.user.office.name}-${workOrderComment.user.name}</span><span style="padding-left: 10px;color: #666666">回复:${workOrderComment.commentName}</span></span>     
+                                    </c:when>
+                                    <c:otherwise>
+                                        <span class="comment_name"><h3 style="font-weight: bold">${workOrderComment.user.office.name}-${workOrderComment.user.name}</h3></span>     
+                                    </c:otherwise>
+                                </c:choose>
+                                <div class="comment_content" style="margin-left: 25px;margin-bottom: 20px;margin-top: 20px;">${workOrderComment.content}</div>
+                                <c:if test="${fn:length(workOrderComment.workAttachments)!=0}">
+                                    <div>
+                                    <div class="form-group layui-row">
+                                        <div class="layui-item layui-col-xs12" style="padding:0 16px;margin-left: 25px;">
+                                                <c:forEach items="${workOrderComment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                                            <%-- <td>${status.index + 1}</td>--%>
+                                                        <c:choose>
+                                                            <c:when test="${workOrderComment.uploadMode == 2}">
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.temporaryUrl}" width="100" height="100" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.url}" width="100" height="100" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                </c:forEach>
+                                        </div>
+                                    </div>
+
+                                </div>
+                                </c:if>
+                                <div class="del">
+                                    <br/>
+                                    <span>${workOrderComment.commentDateStr}前</span>
+                                </div>
+                            </div>
+                            <hr>
+                        </div>
+                    </c:forEach>
+                </div>
+            </div>
+
+        </div>
+    </div>
+    <div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+</body>
+</html>

+ 201 - 0
src/main/webapp/webpage/modules/workOrder/workOrderCommentView.jsp

@@ -0,0 +1,201 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>反馈管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+    </style>
+    <script>
+        var validateForm;
+        $(document).ready(function() {
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+            });
+
+            layui.form.on('select(questionType)',function(data) {
+                var workOrderId=$("#workOrderId").val();
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/workOrder/workOrder/updateHandle',
+                    data:{
+                        "questionType":data.value,
+                        "id":workOrderId
+                    },
+                    dataType:"json",
+                    async: false,
+                    success:function(data){
+                        if(data.success) {
+                            top.layer.msg("转接成功!",{icon:1});
+                            location.reload();
+                        }
+                    }
+                })
+            });
+        })
+        function submitComment(){
+            var validateForm = $(document.getElementById("inputForm")).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $(document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $(document.getElementById("inputForm")).ajaxSubmit({
+                    success:function(data) {
+                        top.layer.msg("发布成功!",{icon:1});
+                        location.reload();
+                    }
+                });
+            }
+
+        }
+        function insertTitle(tValue){
+            var list = "${workOrder.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;
+            for(var i = 0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "191";
+                console.log(file);
+                var timestamp = new Date().getTime();
+                var storeAs = "workOrder";
+                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                /*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile" + divId).show();
+                multipartUploadWorkOrder(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+            }
+        }
+        function resetComment() {
+            $("#content").val("");
+        }
+    </script>
+
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+        <div class="container">
+            <form:form id="inputForm" modelAttribute="workOrder" enctype="multipart/form-data" action="${ctx}/workOrder/workOrder/saveComment" method="post" class="form-horizontal layui-form">
+                <input type="hidden" id="workOrderId" name="workOrderId" value="${workOrder.id}" />
+                <sys:message content="${message}"/>
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>工单信息</h2></div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label"><span class="require-item">*</span>工单标题:</label>
+                        <div class="layui-input-block">
+                            <form:input path="title" readonly="true" htmlEscape="false" placeholder="请输入工单标题" maxlength="50" class="form-control required layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 ">
+                        <label class="layui-form-label">问题类型:</label>
+                        <div class="layui-input-block">
+                            <form:select path="questionType" disabled="true" class="form-control simple-select">
+                                <form:option value="" label=""/>
+                                <form:options items="${fns:getMainDictList('work_order_question_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group layui-row page-end"></div>
+            </form:form>
+
+        </div>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class=" layui-form" style="width: 80%;margin: 20px auto;">
+                <div class="form-group layui-row">
+                    <h2 >全部回复(${workOrderCommentCount}条)</h2>
+                    <hr>
+                    <c:forEach items="${workOrderComments}" var="workOrderComment" varStatus="status">
+                        <div class="layui-item layui-col-xs12" id="comment${workOrderComment.id}">
+                            <div class="conmment_details">
+                                <c:choose>
+                                    <c:when test="${workOrderComment.commentFalg}">
+                                        <span class="comment_name"><span style="font-weight: bold;font-size: 18px">${workOrderComment.user.office.name}-${workOrderComment.user.name}</span><span style="padding-left: 10px;color: #666666">回复:${workOrderComment.commentName}</span></span>     
+                                    </c:when>
+                                    <c:otherwise>
+                                        <span class="comment_name"><h3 style="font-weight: bold">${workOrderComment.user.office.name}-${workOrderComment.user.name}</h3></span>     
+                                    </c:otherwise>
+                                </c:choose>
+                                <div class="comment_content" style="margin-left: 25px;margin-bottom: 20px;margin-top: 20px;">${workOrderComment.content}</div>
+                                <div>
+                                    <div class="form-group layui-row">
+                                        <div class="layui-item layui-col-xs12" style="padding:0 16px;margin-left: 25px;">
+                                                <c:forEach items="${workOrderComment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                                            <%-- <td>${status.index + 1}</td>--%>
+                                                        <c:choose>
+                                                            <c:when test="${workOrderComment.uploadMode == 2}">
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.temporaryUrl}" width="100" height="100" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.url}" width="100" height="100" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                </c:forEach>
+                                                </tbody>
+                                            </table>
+                                        </div>
+                                    </div>
+
+                                </div>
+                                <div class="del">
+                                    <br/>
+                                    <span>${workOrderComment.commentDateStr}前</span>
+                                </div>
+                            </div>
+                            <hr>
+                        </div>
+                    </c:forEach>
+                </div>
+            </div>
+
+        </div>
+    </div>
+    <div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+</body>
+</html>

+ 291 - 0
src/main/webapp/webpage/modules/workOrder/workOrderForm.jsp

@@ -0,0 +1,291 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>反馈管理</title>
+    <meta name="decorator" content="default"/>
+
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <style type="text/css">
+        img {width: 50px; height: 50px;}
+    </style>
+    <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script type="text/javascript" language="JavaScript" for="window" event="onload">
+        var validateForm;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            var type =$("#questionType").val();
+            if (type==''){
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+            });
+            //$("#name").focus();
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            //只做查看时,禁用掉以下标签
+            $('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);
+            laydate.render({
+                elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'datetime'
+                , trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'datetime'
+                , trigger: 'click'
+            });
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+        });
+    </script>
+    <script type="text/javascript">
+
+        function changeUser(ids,names,parents) {
+            var split = ids.split(',');
+            var split2 = names.split(',');
+            $("#userTableList").html("");
+            userIdx=0;
+            for(var i=0;i<split.length;i++){
+                var id = split[i];
+                if(id==''||id==null){
+                    continue;
+                }
+                var obj = {'id':id,'name':split2[i],'officeName':parents[i]};
+                addRow('#userTableList',userIdx,userTpl,obj);
+                userIdx+=1;
+            }
+        }
+        function insertTitle(tValue){
+            var list = "${workOrder.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;
+            for(var i = 0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "191";
+                console.log(file);
+                var timestamp = new Date().getTime();
+                var str=file.name;
+                var index = str.lastIndexOf(".");
+                str = str.substring(index + 1, str.length);
+                if (str == "png" || str == "jpg" || str == "gif" || str == "bmp" || str == "jpeg"){
+                    var storeAs = "workOrder";
+                    var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                    /*将这段字符串存到数据库即可*/
+                    var divId = "_attachment";
+                    $("#addFile" + divId).show();
+                    multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+                }else{
+                    top.layer.msg("请上传图片!",{icon:2});
+                    return false
+                }
+
+            }
+        }
+
+
+    </script>
+
+</head>
+<body >
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="workOrder" enctype="multipart/form-data" action="${ctx}/workOrder/workOrder/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+            <sys:message content="${message}"/>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>工单信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>工单标题:</label>
+                    <div class="layui-input-block">
+                        <form:input path="title" htmlEscape="false" placeholder="请输入工单标题" maxlength="50" class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">创建人:</label>
+                    <div class="layui-input-block">
+                        <form:input id="cBName" path="createBy.name" htmlEscape="false" readonly="true" class="form-control  layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 ">
+                    <label class="layui-form-label">问题类型:</label>
+                    <div class="layui-input-block">
+                        <form:select path="questionType" class="form-control simple-select">
+                            <form:option value="" label=""/>
+                            <form:options items="${fns:getMainDictList('work_order_question_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
+                    <label class="layui-form-label"><span class="require-item">*</span>内容:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="content" htmlEscape="false"  colspan="3" rows="6"  maxlength="550" class="form-control required"/>
+<%--                        <sys:ckeditor replace="contents" uploadPath="/feedback/feedback"/>--%>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="layui-item nav-btns">
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;上传图片</a>
+                </div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment" ></span>
+                    <b><span id="baifenbi_attachment" ></span></b>
+                    <div class="progress">
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th>文件预览</th>
+                            <th>上传人</th>
+                            <th>上传时间</th>
+                            <th width="200px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${workOrder.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr>
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${workOrder.uploadMode == 2}">
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                            <%--附件下载删除--%>
+                                        <c:choose>
+                                            <c:when test="${workOrder.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                            </c:otherwise>
+                                        </c:choose>
+                                        <c:if test="${workClientAttachment.collectFlag != 1}">
+                                            <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+                                        </c:if>
+                                        <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                            <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                        </c:if>
+
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 482 - 0
src/main/webapp/webpage/modules/workOrder/workOrderList.jsp

@@ -0,0 +1,482 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>反馈管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+	<script type="text/javascript">
+
+		$(function () {
+
+        });
+
+        $(document).ready(function() {
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#createStartDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+            laydate.render({
+                elem: '#createEndDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+        });
+
+        function openDialog(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['保存', '关闭'],
+                /*yes: function (index, layero) {
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if (target) {
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    } else {
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if (iframeWin.contentWindow.doSubmit()) {
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function () {
+                            top.layer.close(index)
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },*/
+
+                btn1:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn2: function (index) {
+                }
+            });
+        }
+
+        function openDialogAdmin(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['提交', '关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2: function (index) {
+                }
+            });
+        }
+
+        function openDialogre(title,url,width,height,target,buttons) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            var split = buttons.split(",");
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                skin: 'three-btns',
+                content: url,
+                btn: split,
+                btn3: function (index) {
+                }
+            });
+        }
+
+        function openDialogreModify(title,url,id,width,height,target,buttons) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+			$.ajax({
+				async: false,
+				url: "${ctx}/oa/oaNotify/getOaNotify?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						var split = buttons.split(",");
+						top.layer.open({
+							type: 2,
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							skin: 'three-btns',
+							content: url,
+							btn: split,
+							btn1: function(index, layero){
+								var body = top.layer.getChildFrame('body', index);
+								var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+								var inputForm = body.find('#inputForm');
+								var top_iframe;
+								if(target){
+									top_iframe = target;//如果指定了iframe,则在改frame中跳转
+								}else{
+									top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+								}
+								inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+								if(iframeWin.contentWindow.doSubmit(1) ){
+									// top.layer.close(index);//关闭对话框。
+									setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+								}
+							},
+							btn2:function(index,layero){
+								if(split.length==2){return}
+								var body = top.layer.getChildFrame('body', index);
+								var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+								var inputForm = body.find('#inputForm');
+								var top_iframe;
+								if(target){
+									top_iframe = target;//如果指定了iframe,则在改frame中跳转
+								}else{
+									top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+								}
+								inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+								if(iframeWin.contentWindow.doSubmit(2) ){
+									// top.layer.close(index);//关闭对话框。
+									setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+								}else {
+									return false;
+								}
+							},
+							btn3: function (index) {
+							}
+						});
+					}else{
+						top.layer.msg("该公告信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+
+        }
+
+
+		//打开对话框(查看)
+		function openDialogListView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 2,
+				skin: 'one-btn',
+				area: [width, height],
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				btn: ['关闭'],
+				cancel: function(index){
+				}
+			});
+
+		}
+	</script>
+	<script>
+
+		function notifyDialogre(title,url,width,height,target){
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				skin:"three-btns",
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				btn: ['通过','驳回','关闭'],
+				btn1: function(index, layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(1) ){
+						top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+				},
+				btn2:function(index,layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(2) ){
+						top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+
+		}
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="contentShadow layui-row" id="queryDiv">
+			<form:form id="searchForm" modelAttribute="workOrder" action="${ctx}/workOrder/workOrder/" method="post" class="form-inline">
+			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+			<input id="toflag" name="toflag" type="hidden" value="1"/>
+			<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+
+				<div class="commonQuery">
+					<div class="layui-item query athird">
+						<label class="layui-form-label">工单标题:</label>
+						<div class="layui-input-block with-icon">
+							<form:input path="title" htmlEscape="false" maxlength="200"  class=" form-control layui-input"/>
+						</div>
+					</div>
+					<div class="layui-item query athird">
+
+					</div>
+					<div class="layui-item athird">
+						<div class="input-group">
+							<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+							<div class="layui-btn-group search-spacing">
+								<button id="searchQuery" class="layui-btn layui-btn-sm  layui-bg-blue" onclick="search()">查询</button>
+								<button id="searchReset" class="layui-btn layui-btn-sm  " onclick="resetSearch()">重置</button>
+							</div>
+<%--							<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>--%>
+<%--							<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>--%>
+<%--							<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>--%>
+						</div>
+					</div>
+					<div style="    clear:both;"></div>
+				</div>
+				<div id="moresees" style="clear:both;display:none;">
+					<div class="layui-item query athird">
+						<label class="layui-form-label">工单内容:</label>
+						<div class="layui-input-block with-icon">
+							<form:input path="content" htmlEscape="false" maxlength="200"  class=" form-control layui-input"/>
+						</div>
+					</div>
+					<div style="clear:both;"></div>
+				</div>
+			</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="contentShadow layui-form contentDetails">
+				<div class="nav-btns">
+					<div class="layui-btn-group">
+<%--						<shiro:hasPermission name="feedback:workOrder:add">--%>
+							<table:addRow label="新增" url="${ctx}/workOrder/workOrder/form" title="反馈" height="95%;" width="95%;"></table:addRow><!-- 增加按钮 -->
+<%--						</shiro:hasPermission>--%>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                // {checkbox: true, fixed: true},
+                {field:'index',align:'center',  width:40,title: '序号'}
+				,{field:'title',align:'center', title: '工单标题', minWidth:150,templet:function(d){
+						var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogListView('查看反馈', '${ctx}/workOrder/workOrder/handleView?id=" + d.id + "','" + d.id + "','95%','95%')\">" +
+								"<span title=" + d.title + ">" + d.title + "</span></a>";
+						return xml;
+					}}
+                ,{field:'content',align:'center', title: '工单内容', minWidth:200,templet:function(d){
+                    return "<span title='"+ d.content +"'>" + d.content + "</span>";
+                }}
+                ,{field:'createBy', align:'center',title: '发起人', width:80,templet:function(d){
+                        return "<span title='"+ d.createBy +"'>" + d.createBy + "</span>";
+                    }}
+                ,{field:'createDate', align:'center',title: '发起时间',width:150,templet:function(d){
+						return "<span title='"+ d.createDate +"'>" + d.createDate + "</span>";
+					}}
+				,{field:'handleName', align:'center',title: '当前处理人',width:150,templet:function(d){
+						return "<span title='"+ d.handleName +"'>" + d.handleName + "</span>";
+					}}
+				,{field:'handlingStatus', align:'center',title: '处理状态',width:150,templet:function(d){
+						var st = getWorkOrderState(d.handlingStatus)
+						return "<span onclick=\"openDialogView('流程追踪', '${ctx}/workOrder/workOrder/getWorkOrderProcessing?id=" + d.id + "','95%','95%')\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+					}}
+                // ,{fixed: 'right',align:'center', toolbar: '#op',title:"操作"}
+                ,{align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml = "<div class=\"layui-btn-group\">";
+                        if(d.handlingStatus!='5'){
+							if(d.canedit1 != undefined && d.canedit1 =="1")
+							{
+								xml+="<a href=\"#\" onclick=\"openDialogre('回复', '${ctx}/workOrder/workOrder/handle?id=" + d.id +"','95%', '95%','','关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 回复</a>";
+							}
+							if(d.canedit2 != undefined && d.canedit2 =="2")
+							{
+								xml+="<a href=\"${ctx}/workOrder/workOrder/solve?id=" + d.id + "\" onclick=\"return confirmx('确认解决信息了吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 解决</a>";
+							}
+							<%--if(d.canedit4 != undefined && d.canedit4 =="4")--%>
+							<%--{--%>
+							<%--	&lt;%&ndash;xml+="<a href=\"${ctx}/workOrder/workOrder/solve?id=" + d.id + "\" onclick=\"return confirmx('确认要撤回该处理信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 解决</a>";&ndash;%&gt;--%>
+							<%--}--%>
+						}
+                        xml+="</div>"
+                            return xml;
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="order" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${order.id}"
+                    ,"title":"<c:out value="${order.title}" escapeXml="true"/>"
+                    ,"content":"<c:out value="${order.content}" escapeXml="true"/>"
+                    ,"createBy":"${order.createBy.name}"
+                    ,"handleName":"${order.handle.name}"
+                    ,"handlingStatus":"${order.processingStatus}"
+                    ,"createDate":"<fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd"/>"
+					,"canedit1":1
+					<c:if test="${order.createBy.id == fns:getUser().id}">
+						,"canedit2":2
+					</c:if>
+<%--					<c:if test="${order.handleFalg}">--%>
+<%--						,"canedit4":4--%>
+<%--					</c:if>--%>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+    })
+
+    resizeListTable();
+</script>
+<script>
+    resizeListWindow1();
+    $(window).resize(function(){
+        resizeListWindow1();
+    });
+</script>
+</body>
+</html>

+ 74 - 0
src/main/webapp/webpage/modules/workOrder/workOrderProcessing.jsp

@@ -0,0 +1,74 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>反馈管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+    </style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class=" layui-form" style="width: 80%;margin: 20px auto;">
+                <table id="contentTable" class="table table-bordered ">
+                    <thead>
+                    <tr>
+                        <th width="200px">处理部门</th>
+                        <th width="200px">处理人</th>
+                        <th width="200px">开始时间</th>
+                        <th width="200px">结束时间</th>
+                        <th width="200px">处理意见</th>
+                        <th width="200px">任务历时</th>
+
+                    </tr>
+                    </thead>
+                    <tbody id="workChangeJobUserList">
+                    <c:if test="${not empty workOrderProcessingList}">
+                        <c:forEach items="${workOrderProcessingList}" var="list" varStatus="index">
+                            <tr align="center" style="line-height: 30px">
+                                <td>
+                                    ${list.officeName}
+                                </td>
+                                <td>
+                                    ${list.handleUser.name}
+                                </td>
+                                <td>
+                                    <fmt:formatDate value="${list.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+                                </td>
+                                <td>
+                                    <fmt:formatDate value="${list.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+                                </td>
+                                <td>
+                                    ${list.handleOpinion}
+                                </td>
+                                <td>
+                                    ${list.missionDuration}分钟
+                                </td>
+
+
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+
+            </div>
+
+        </div>
+    </div>
+    <div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+</body>
+</html>