瀏覽代碼

发票作废

sangwenwei 1 年之前
父節點
當前提交
232c8ad4f6

+ 10 - 0
src/main/java/com/jeeplus/modules/test/dao/act/ActTestDao.java

@@ -0,0 +1,10 @@
+package com.jeeplus.modules.test.dao.act;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.test.entity.act.ActTest;
+
+@MyBatisDao
+public interface ActTestDao extends CrudDao<ActTest> {
+    void updateProcessInstanceId(ActTest actTest);
+}

+ 165 - 0
src/main/java/com/jeeplus/modules/test/entity/act/ActTest.java

@@ -0,0 +1,165 @@
+package com.jeeplus.modules.test.entity.act;
+
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.modules.sys.entity.Office;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+
+import java.util.Map;
+
+public class ActTest extends ActEntity<ActTest> {
+
+    public static final String SERIAL_BIZCODE = "261";//编号模板类型
+
+    private static final long serialVersionUID = 1L;
+
+    private String number; //编号
+
+    private String name; //名称
+
+    private String processInstanceId; //流程实例id
+
+    private String status; //状态
+
+    private String companyId; //提交人的公司编号
+    private String officeId;
+
+    private String notifyId; //代办判定条件
+    private Integer notifyFlag; //代办判定条件
+
+    // 流程任务
+    private Task task;
+    private Map<String, Object> variables;
+    // 运行中的流程实例
+    private ProcessInstance processInstance;
+    // 历史的流程实例
+    private HistoricProcessInstance historicProcessInstance;
+    // 流程定义
+    private ProcessDefinition processDefinition;
+
+    private Office office;
+
+    private String home;
+
+    public String getHome() {
+        return home;
+    }
+
+    public void setHome(String home) {
+        this.home = home;
+    }
+
+    public Office getOffice() {
+        return office;
+    }
+
+    public void setOffice(Office office) {
+        this.office = office;
+    }
+
+    public ProcessDefinition getProcessDefinition() {
+        return processDefinition;
+    }
+
+    public void setProcessDefinition(ProcessDefinition processDefinition) {
+        this.processDefinition = processDefinition;
+    }
+
+    public Task getTask() {
+        return task;
+    }
+
+    public void setTask(Task task) {
+        this.task = task;
+    }
+
+    public Map<String, Object> getVariables() {
+        return variables;
+    }
+
+    public void setVariables(Map<String, Object> variables) {
+        this.variables = variables;
+    }
+
+    public ProcessInstance getProcessInstance() {
+        return processInstance;
+    }
+
+    public void setProcessInstance(ProcessInstance processInstance) {
+        this.processInstance = processInstance;
+    }
+
+    public HistoricProcessInstance getHistoricProcessInstance() {
+        return historicProcessInstance;
+    }
+
+    public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
+        this.historicProcessInstance = historicProcessInstance;
+    }
+
+    public Integer getNotifyFlag() {
+        return notifyFlag;
+    }
+
+    public void setNotifyFlag(Integer notifyFlag) {
+        this.notifyFlag = notifyFlag;
+    }
+
+    public String getNotifyId() {
+        return notifyId;
+    }
+
+    public void setNotifyId(String notifyId) {
+        this.notifyId = notifyId;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public String getOfficeId() {
+        return officeId;
+    }
+
+    public void setOfficeId(String officeId) {
+        this.officeId = officeId;
+    }
+}

+ 673 - 0
src/main/java/com/jeeplus/modules/test/service/act/ActTestService.java

@@ -0,0 +1,673 @@
+package com.jeeplus.modules.test.service.act;
+
+import com.google.common.collect.Maps;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.serialnum.service.SerialNumTplService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.test.dao.act.ActTestDao;
+import com.jeeplus.modules.test.entity.act.ActTest;
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
+import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
+import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
+import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.activiti.engine.ActivitiObjectNotFoundException;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+@Service
+@Transactional(readOnly = false)
+@Lazy
+public class ActTestService extends CrudService<ActTestDao, ActTest> {
+
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private RuntimeService runtimeService;
+
+    @Autowired
+    private ActTestDao actTestDao;
+
+    @Autowired
+    private OfficeService officeService;
+
+    @Autowired
+    protected SerialNumTplService serialNumTplService;
+
+    @Autowired
+    protected WorkActivityProcessService workActivityProcessService;
+
+    @Autowired
+    protected WorkProjectNotifyService workProjectNotifyService;
+
+    @Autowired
+    protected WorkActivityMenuService workActivityMenuService;
+
+    @Autowired
+    private ActivityService activityService;
+
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+
+    private static byte[] SYN_BYTE = new byte[0];
+
+
+
+    public ActTest get(String id){
+        ActTest actTest = new ActTest();
+        actTest=super.get(id);
+        return actTest;
+    }
+
+
+    public Page<ActTest> findPage(Page<ActTest> page,ActTest actTest){
+        if(StringUtils.isNotBlank(actTest.getOfficeId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(actTest.getOfficeId());
+            officeIdList.add(actTest.getOfficeId());
+            actTest.setOfficeIdList(officeIdList);
+        }
+        int count = dao.queryCount(actTest);
+        page.setCount(count);
+        page.setCountFlag(false);
+        actTest.setPage(page);
+        page.setList(dao.findList(actTest));
+        return page;
+
+    }
+
+    @Transactional(readOnly = false)
+    public  void save(ActTest actTest){
+        if (StringUtils.isBlank(actTest.getNumber())) {
+            synchronized (SYN_BYTE) {
+                actTest.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), actTest.SERIAL_BIZCODE));
+            }
+        }
+        super.save(actTest);
+    }
+
+    @Transactional(readOnly = false)
+    public String saveBranch(ActTest actTest, Map<String, Object> variables, String processInstanceId) {
+        if (StringUtils.isBlank(actTest.getNumber())) {
+            synchronized (SYN_BYTE) {
+                actTest.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), actTest.SERIAL_BIZCODE));
+            }
+        }
+        String officeId = UserUtils.getUser().getOffice().getId();
+        Office office = officeService.get(officeId);
+        actTest.setOfficeId(officeId);
+        String companyId = UserUtils.getUser().getCompany().getId();
+        actTest.setCompanyId(companyId);
+        super.save(actTest);
+        String str = "";
+        String title = "流程测试待审批";
+        str = "测试流程申请待审批";
+
+        // 启动流程
+        String businessKey = actTest.getId().toString();
+        WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea00005c750905",officeService.get(actTest.getOfficeId()));
+        // 启动流程
+        String processType = workActivityMenu.getProcessType();
+        StringBuffer buffer = new StringBuffer();
+        Activity activity = new Activity();
+        WorkProjectNotify workProjectNotify = UtilNotify
+                .saveNotify(actTest.getId(),
+                        null,
+                        actTest.getCompanyId(),
+                        title,
+                        str,
+                        "261", //对应之后的判断
+                        "0",
+                        "待审批",
+                        ""  //通知角色
+                );
+        long s6=System.currentTimeMillis();
+        List<User> users = new ArrayList<>();
+        //List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",workInvoice.getCreateBy());
+        //List<User> fpglys = UserUtils.getByRoleActivityEnname("fpgly",3,office.getId(),"5",workInvoice.getCreateBy());
+        //部门主任
+        List<User> bmzr = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",actTest.getCreateBy());
+        long s7=System.currentTimeMillis();
+        if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+            workProjectNotify.setNotifyRole("");
+            workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+            List<Activity> activities = workActivityMenu.getActivities();
+            for (Activity a : activities) {
+                String encount = a.getEncount();
+                String enlist = a.getEnlist();
+                if (a.getRole()!=null && StringUtils.isNotBlank(a.getRole().getEnname())){
+                    List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"5",actTest.getCreateBy());
+                    if (enusers.size()==0){
+                        actTest.setStatus("1");//暂存
+                        this.save(actTest);
+                        return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+                    }
+                    variables.put(enlist, enusers);
+                    variables.put(encount, enusers.size());
+                }
+                if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                    activity = a;
+                }
+            }
+            buffer.append(activity.getRole().getEnname());
+            if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+                //角色审批
+                if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                    users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"5",actTest.getCreateBy());
+                }
+                //人员审批
+                if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                    users.add(activity.getUser());
+                }
+            }
+            workProjectNotify.setId("");
+        } else {
+            if (bmzr.size()==0 ){
+                actTest.setStatus("1");//暂存
+                this.save(actTest);
+            }
+            if (bmzr.size()==0){
+                return "流程审批人不能为空,请联系管理员!";
+            }
+            variables.put("bmzrCount",bmzr.size());
+            variables.put("bmzrList",bmzr);
+            processType = "actTest";
+            users.addAll(bmzr);
+        }
+        for (User user : users){
+            workProjectNotify.setUser(user);
+            workProjectNotify.setId("");
+            workProjectNotifyService
+                    .save(workProjectNotify);
+            Map<String,Object> extras = new HashMap<>();
+            extras.put("type","7002");
+            extras.put("id",workProjectNotify.getId());
+            extras.put("procDefKey","261");
+            UserUtils.pushInfoToApp(title,str,extras,user.getId());
+            UserUtils.pushIm(user.getId(),str);
+        }
+        variables.put("type", processType);
+        variables.put("busId", businessKey);
+        variables.put("title", "流程测试");//设置标题;
+        long s8=System.currentTimeMillis();
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+        actTest.setProcessInstance(processInstance);
+        long s9=System.currentTimeMillis();
+        if (StringUtils.isNotBlank(processInstanceId)) {
+            workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+            workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+            workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+        }
+        long s10=System.currentTimeMillis();
+        // 更新流程实例ID
+        actTest.setProcessInstanceId(processInstance.getId());
+        actTestDao.updateProcessInstanceId(actTest);
+        //通知添加流程实例ID
+        workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
+        workProjectNotifyService.save(workProjectNotify);
+        List<Activity> list = workActivityMenu.getActivities();
+        long s11=System.currentTimeMillis();
+        if (list != null && list.size() != 0) {
+            workActivityProcessService.saveList(list, processInstance.getId());
+        } else {
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessKey("actTest");
+            workActivityProcess.setCount(1);
+            workActivityProcess.setProcessInstanceId(processInstance.getId());
+            workActivityProcess.setIsApproval("0");
+            workActivityProcessService.save(workActivityProcess);
+				/*workActivityProcess.setCount(2);
+				workActivityProcess.setId("");
+				workActivityProcessService.save(workActivityProcess);*/
+            workActivityProcessService.insertAuditsByType(bmzr,processInstance.getId(),1,1);
+            //workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),2,0);
+        }
+        return "";
+    }
+
+    @Transactional(readOnly = false)
+    public void updateInfo(ActTest actTest) {
+        if (actTest.DEL_FLAG_NORMAL.equals(actTest.getDelFlag())){
+            if (StringUtils.isBlank(actTest.getId())){
+                actTest.preInsert();
+                actTestDao.insert(actTest);
+            }else{
+                actTest.preUpdate();
+                actTestDao.update(actTest);
+            }
+        }else{
+            actTestDao.delete(actTest);
+        }
+    }
+
+
+    /**
+     * 审核流程
+     * @param actTest
+     */
+    @Transactional(readOnly = false)
+    public String auditSaveBranch(ActTest actTest,List<User> auditUsers) {
+        //所属部门
+        Office office = officeService.get(actTest.getOffice().getId());
+        String userName = UserUtils.get(actTest.getCreateBy().getId()).getName();
+        String title = "流程测试";
+        String str = "流程测试";
+        // 对不同环节的业务逻辑进行操作
+        String taskDefKey = actTest.getAct().getTaskDefKey();
+        if("bmzr".equals(taskDefKey)){
+            updateInfo(actTest);
+            actTaskService.claim(actTest.getAct().getTaskId(), UserUtils.getUser().getId());
+        }else if (!"modifyApply".equals(taskDefKey)) {
+            actTaskService.claim(actTest.getAct().getTaskId(), UserUtils.getUser().getId());
+        }else {
+            actTest.getAct().setFlag("yes");
+            updateInfo(actTest);
+        }
+        String comment = "";
+        if (actTest.getStatus().equals("4")){
+            comment = ("yes".equals(actTest.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(actTest.getAct().getFlag())?"[同意] ":"[驳回] ")+actTest.getAct().getComment();
+        }
+        //yes 的时候状态为审核通过 否则为未通过
+        //2 审核中 4 驳回
+        actTest.setStatus(("yes".equals(actTest.getAct().getFlag()) ? "2" : "4"));
+        Map<String, Object> vars = Maps.newHashMap();
+        //业务逻辑对应的条件表达式
+        String exp = "";
+        String taskCount = "";
+        String notifyRole = "";
+        int key = 0;
+        String enname = "";
+        List<Activity> activitieList = activityService.getByProcessInstanceId(actTest.getProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            Iterator<Activity> iterator = activitieList.iterator();
+            while (iterator.hasNext()){
+                Activity activityInfo = iterator.next();
+                if (!"actTest".equals(activityInfo.getProcessKey())){
+                    iterator.remove();
+                }
+            }
+            workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            workActivityMenu.setActivities(activitieList);
+        }
+
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(actTest.getProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("actTest")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    exp = "pass";
+                    if (!"yes".equals(actTest.getAct().getFlag())) {
+                        actTest.setStatus("4");
+                        workActivityProcess.setIsApproval("2");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                notifyRole = activity.getName();
+                                returnBack = activity.getReturnBack();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                }else if(taskDefKey.equals("modifyApply")){
+                    taskCount = "0";
+                    notifyRole = "调整申请";
+                    exp = "pass";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(actTest.getAct().getFlag())) {
+                        actTest.setStatus("3");
+                        workActivityProcess.setIsApproval("2");
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                }
+            }
+        } else {
+            workActivityMenu.setProcessType("actTest");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = activityProcess.getCount() + "";
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                //if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+                if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+                    taskCount = "1";
+                    exp = "pass";
+                    if ("yes".equals(actTest.getAct().getFlag())) {
+                        workActivityProcessService.insertAuditsByType(auditUsers,actTest.getProcessInstanceId(),1,1);
+                        notifyRole = "审批通过";
+                        workActivityProcess.setIsApproval("1");
+                    }else {
+                        notifyRole = "调整申请";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+                    taskCount = "0";
+                    notifyRole = "部门主任审批";
+                    exp = "pass";
+                    workActivityProcess.setCount(0);
+                    enname = "bmzr";
+                    if (!"yes".equals(actTest.getAct().getFlag())) {
+                        actTest.setStatus("3");
+                    }
+                    break;
+                } else if ("apply_end".equals(taskDefKey)) {
+                }
+
+            }
+        }
+        // 设置意见
+        actTest.getAct().setComment(("yes".equals(actTest.getAct().getFlag()) ? "[同意] " : "[驳回] ") + actTest.getAct().getComment());
+        actTest.preUpdate();
+
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(actTest.getProcessInstanceId());
+
+        // 提交流程任务
+        vars.put(exp, "yes".equals(actTest.getAct().getFlag()) ? true : false);
+        vars.put("passs", true);
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,actTest.getProcessInstanceId(),taskDefKey,"modifyApply",actTest.getAct().getFlag(),comment, activities);
+        // 提交流程任务
+        actTaskService.complete(actTest.getAct().getTaskId(), actTest.getAct().getProcInsId(), actTest.getAct().getComment(), vars);
+        boolean state = actTaskService.isProcessEnd(actTest.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        //ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+        if (!state) {
+            users.add(actTest.getCreateBy());
+            if ("yes".equals(actTest.getAct().getFlag())) {
+                title = "流程测试申请通过";
+                actTest.setStatus("5");
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(actTest.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNewNotify(actTest.getId(),
+                                        actTest.getCreateBy(),
+                                        actTest.getCompanyId(),
+                                        title,
+                                        str,
+                                        "261",
+                                        "0",
+                                        "待通知",
+                                        notifyRole,
+                                        actTest.getProcessInstanceId(),new Date()));
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(actTest.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                if (StringUtils.isNotBlank(actTest.getStatus()) && !actTest.getStatus().equals("3")){
+                    actTest.setStatus("4");
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNewNotify(actTest.getId(),
+                                            actTest.getCreateBy(),
+                                            actTest.getCompanyId(),
+                                            title,
+                                            str,
+                                            "261",
+                                            "0",
+                                            "待通知",
+                                            notifyRole,
+                                            actTest.getProcessInstanceId(),new Date()));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(actTest.getProcessInstanceId());
+        } else {
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("actTest")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(actTest.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNewNotify(actTest.getId(),
+                                new User(),
+                                actTest.getCompanyId(),
+                                title,
+                                str,
+                                "261",
+                                "0",
+                                "待审批",
+                                notifyRole,
+                                actTest.getProcessInstanceId(),new Date());
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        actTest.getAct().getFlag(),
+                        taskCount,
+                        actTest.getCreateBy(),
+                        actTest.getOfficeId(),
+                        "5");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService
+                            .save(workProjectNotify1);
+                    if (!"modifyApply".equals(taskDefKey)){
+                        Map<String,Object> extras = new HashMap<>();
+                        if ("fpgly".equals(taskDefKey) ){
+                            extras.put("type","7001");
+                        }else {
+                            extras.put("type","7002");
+                        }
+                        extras.put("id",workProjectNotify.getId());
+                        extras.put("procDefKey","261");
+                        UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+
+                    }
+                }
+
+            } else {
+                if (!"yes".equals(actTest.getAct().getFlag())) {//驳回待办提醒
+                    title = "申请被驳回";
+                    str = "申请被驳回,请选择重新申请或作废";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(actTest.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNewNotify(actTest.getId(),
+                                            actTest.getCreateBy(),
+                                            actTest.getCompanyId(),
+                                            title,
+                                            str,
+                                            "261",
+                                            "0",
+                                            "重新申请",
+                                            notifyRole,
+                                            actTest.getProcessInstanceId(),new Date()));
+                    users.add( actTest.getCreateBy());
+                } else {
+                    if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+                        title = "重新申请,待审批";
+                        str = "重新申请,待审批";
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(actTest.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNewNotify(actTest.getId(),
+                                        new User(),
+                                        actTest.getCompanyId(),
+                                        title,
+                                        str,
+                                        "261",
+                                        "0",
+                                        "待审批",
+                                        notifyRole,
+                                        actTest.getProcessInstanceId(),new Date());
+                        for (User user1:auditUsers){
+                            users.add(user1);
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService
+                                    .save(workProjectNotify);
+                            if (!"modifyApply".equals(taskDefKey)){
+                                Map<String,Object> extras = new HashMap<>();
+                                if ("fpgly".equals(taskDefKey)){
+                                    extras.put("type","7001");
+                                }else {
+                                    extras.put("type","7002");
+                                }
+                                extras.put("id",workProjectNotify.getId());
+                                extras.put("procDefKey","261");
+                                UserUtils.pushInfoToApp(title,str,extras,user1.getId());
+
+                            }
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(actTest.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.addAll(userList);
+                        users.add(actTest.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNewNotify(actTest.getId(),
+                                                actTest.getCreateBy(),
+                                                actTest.getCompanyId(),
+                                                title,
+                                                str,
+                                                "261",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole,
+                                                actTest.getProcessInstanceId(),new Date()));
+                    }
+                }
+            }
+        }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
+        if (users!=null && users.size()!=0) {
+            for (User u : users) {
+                UserUtils.pushIm(u.getId(),str);
+            }
+        }
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+        actTestDao.update(actTest);
+        return "保存审核意见成功!";
+    }
+
+
+    /**
+     * 强制撤销
+     * @param actTest
+     */
+    @Transactional(readOnly = false)
+    public void cancelInvalidate(ActTest actTest) {
+        String invalidateProcessInstanceId = actTest.getProcessInstanceId();
+        try {
+            //将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
+            WorkActivityProcess process = new WorkActivityProcess();
+            process.setProcessInstanceId(actTest.getProcessInstanceId());
+            process.setIsApproval("0");
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessInstanceId(actTest.getProcessInstanceId());
+            List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+            WorkProjectNotify notify = new WorkProjectNotify();
+            notify.setNotifyId(actTest.getId());
+            workProjectNotifyService.readByNotifyId(notify);
+            if (processList != null && processList.size() > 0) {
+                for (int i = 0; i < processList.size(); i++) {
+                    WorkActivityProcess p = processList.get(i);
+                    if (StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())) {
+                        p.setDelFlag("1");
+                        p.setIsApproval("-1");
+                        workActivityProcessDao.updateDelFlagAndIsApproval(p);
+                    }
+                }
+                WorkActivityProcess pro = new WorkActivityProcess();
+                pro.setId("");
+                pro.preInsert();
+                pro.setDelFlag("0");
+                pro.setRemarks("[强制撤销]");
+                pro.setProcessKey(processList.get(0).getProcessKey());
+                pro.setIsApproval("1");
+                pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
+                pro.setCount(0);
+                workActivityProcessDao.insert(pro);
+            }
+            //结束该流程,设为"撤销"状态
+            actTaskService.endProcessInstance(invalidateProcessInstanceId, "流程测试申请-撤销");
+            actTest.setStatus("3");
+            actTest.preUpdate();
+            actTestDao.update(actTest);
+        } catch (ActivitiObjectNotFoundException e) {
+            System.err.println("撤销发票申请异常,因为这个流程已不存在!");
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(ActTest actTest) {
+        dao.get(actTest);
+        dao.deleteByLogic(actTest);
+        //删除流程表信息
+        workProjectNotifyService.deleteActivityProcess(actTest.getProcessInstanceId());
+        //删除流程人员表信息
+        workProjectNotifyService.deleteActivityProcessUser(actTest.getProcessInstanceId());
+
+    }
+
+
+
+}

+ 319 - 0
src/main/java/com/jeeplus/modules/test/web/act/ActTestController.java

@@ -0,0 +1,319 @@
+package com.jeeplus.modules.test.web.act;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.config.Global;
+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.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.test.entity.act.ActTest;
+import com.jeeplus.modules.test.service.act.ActTestService;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoiceProjectRelation;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+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.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/test/actTest")
+public class ActTestController extends BaseController {
+
+    @Autowired
+    private ActTestService actTestService;
+
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+
+    @Autowired
+    private HttpServletRequest request;
+
+    @Autowired
+    private ActTaskService actTaskService;
+
+    @Autowired
+    private OfficeService officeService;
+
+
+
+    @ModelAttribute
+    public ActTest get(@RequestParam(required=false) String id) {
+        ActTest entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = actTestService.get(id);
+        }
+        if (entity == null){
+            entity = new ActTest();
+        }
+        return entity;
+    }
+
+
+
+
+    @RequestMapping(value = {"list",""})
+    public String list(ActTest actTest, HttpServletRequest request, HttpServletResponse response, Model model){
+        //查询之后的任何操作,返回的都是查询后的结果
+        if (StringUtils.isNotBlank(actTest.getToflag())){
+            if (actTest.getToflag().equals("1")){
+                request.getSession().removeAttribute("searchActTest");
+                ActTest searchActTest = actTest;
+                request.getSession().setAttribute("searchActTest",searchActTest);
+            }
+        }else {
+            if (request.getSession().getAttribute("searchActTest")!=null){
+                actTest= (ActTest) request.getSession().getAttribute("searchActTest");
+            }
+        }
+
+        Page<ActTest> page = actTestService.findPage(new Page<ActTest>(request,response),actTest);
+
+        //查询和当前登陆人有关的数据
+        WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+        workProjectNotify.setUser(UserUtils.getUser());
+        workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+        workProjectNotify.setType("261");
+        workProjectNotify.setRemarks("待审批");
+        List<WorkProjectNotify> projectNotifyList = workProjectNotifyService.findList(workProjectNotify);
+        List<ActTest> actTestList = page.getList();
+        for (ActTest test : actTestList) {
+            for (WorkProjectNotify projectNotify : projectNotifyList) {
+                if (projectNotify.getNotifyId().equals(test.getId())){
+                    test.setNotifyId(projectNotify.getNotifyId());
+                    if ("待审批".equals(projectNotify.getRemarks()) && !"1".equals(projectNotify.getStatus())){
+                        test.setNotifyFlag(1);
+                    }
+                    break;
+                }
+            }
+        }
+        model.addAttribute("searchActTest",actTest);
+        model.addAttribute("page",page);
+        return "modules/test/act/actTestList";
+    }
+
+    @RequestMapping(value = "form")
+    public String form(ActTest actTest,Model model){
+        String view = "actTestForm";
+        String tabId = request.getParameter("tabId");
+        if ("1".equals(tabId)){
+            view = "actTestView";
+        }else if ("3".equals(tabId)){
+            ProcessInstance procIns = actTaskService.getProcIns(actTest.getProcessInstanceId());
+            if (procIns != null){
+                Task currentTaskInfo = actTaskService.getCurrentTaskInfo(procIns);
+                Act act = new Act();
+                act.setTaskId(currentTaskInfo.getId());
+                act.setTaskName(currentTaskInfo.getName());
+                act.setTaskDefKey(currentTaskInfo.getTaskDefinitionKey());
+                act.setProcDefId(currentTaskInfo.getProcessDefinitionId());
+                act.setProcInsId(currentTaskInfo.getProcessInstanceId());
+                act.setTask(currentTaskInfo);
+                actTest.setAct(act);
+                view = "actTestModify";
+            }
+        }
+        // 环节编号
+        String taskDefKey = actTest.getAct().getTaskDefKey();
+        if (StringUtils.isNotBlank(taskDefKey) && "bmzr".equals(taskDefKey)){
+            view = "actTestAudit";
+        }else if (StringUtils.isNotBlank(taskDefKey) && !taskDefKey.equals("modifyApply")){
+            view = "actTestAudit";
+        }
+        model.addAttribute("actTest",actTest);
+        return "modules/test/act/"+view;
+    }
+
+    @RequestMapping(value = "save")
+    public String save(ActTest actTest, Model model, RedirectAttributes attributes)throws Exception{
+        if (!beanValidator(model, actTest)){
+            return form(actTest, model);
+        }
+
+        User user = actTest.getCreateBy();
+        String invoiceState = actTest.getStatus();
+        if(user!=null && !UserUtils.getUser().getId().equals(user.getId()) && StringUtils.isNotBlank(user.getId())){
+            addMessage(attributes, "您不是申请人,无法修改");
+            return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+        }
+        //启动流程
+        actTest.setStatus("2");
+        String processInstanceId ="";
+        if (user!=null && StringUtils.isNotBlank(user.getId()) && StringUtils.isNotBlank(invoiceState) && "3".equals(invoiceState)){
+            processInstanceId = actTestService.get(actTest.getId()).getProcessInstanceId();
+        }
+        try{
+            Map<String, Object> variables = Maps.newHashMap();
+            actTest.setCompanyId(UserUtils.getSelectCompany().getId());
+            actTest.setOfficeId(UserUtils.getSelectOffice().getId());
+            actTestService.saveBranch(actTest, variables,processInstanceId);
+
+        }catch (Exception e){
+            addMessage(attributes, "提交失败!");
+            addMessage(attributes, "系统内部错误");
+            logger.error("Exception e:"+e);
+        }
+
+        return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+
+    }
+
+    @RequestMapping(value = "store")
+    public String store(ActTest actTest, Model model, RedirectAttributes redirectAttributes) throws Exception{
+
+        if (!beanValidator(model, actTest)){
+            return form(actTest, model);
+        }
+        User user = actTest.getCreateBy();
+        String submitter = "";
+        if(user != null){
+            submitter = user.getId();
+        }
+        String sta = actTest.getStatus();
+        if(!UserUtils.getUser().getId().equals(submitter) && !Strings.isNullOrEmpty(submitter) && sta != null){
+            addMessage(redirectAttributes, "您不是申请人,无法修改");
+            return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+        }
+        if(!actTest.getIsNewRecord()){//编辑表单保存
+            ActTest t = actTestService.get(actTest.getId());//从数据库取出记录的值
+            MyBeanUtils.copyBeanNotNull2Bean(actTest, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            actTestService.save(t);//保存
+        }else{//新增表单保存
+			/*WorkClientInfo workClientInfo =workClientInfoService.get(workInvoice.getClient().getId());
+			ProjectRecords workProject =projectRecordsService.getRuralProjectRecodes(workInvoice.getProject().getId());
+			workInvoice.setClient(workClientInfo);
+			workInvoice.setProject(workProject);*/
+            actTest.setCompanyId(UserUtils.getSelectCompany().getId());
+            actTest.setOfficeId(UserUtils.getSelectOffice().getId());
+            actTest.setStatus("1");
+            actTestService.save(actTest);//保存
+        }
+        addMessage(redirectAttributes, "保存成功");
+        return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+    }
+
+
+    /**
+     * 工单执行(完成任务)
+     * @param
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "saveAudit")
+    public String saveAudit(ActTest actTest, Model model,
+                            RedirectAttributes redirectAttributes) {
+        try{
+            // 对不同环节的业务逻辑进行操作
+            String taskDefKey = actTest.getAct().getTaskDefKey();
+            List<User> users = null;
+            //所属部门
+            Office office = officeService.get(actTest.getOffice().getId());
+            if ("bmzr".equals(taskDefKey)){
+                users = UserUtils.getByProssType(actTest.getProcessInstanceId(), 1);
+                if (users == null)
+                    users = UserUtils.getByRoleActivityEnname("bmzr", 2, office.getId(), "5", actTest.getCreateBy());
+
+            }else if ("modifyApply".equals(taskDefKey)){
+                users = UserUtils.getByProssType(actTest.getProcessInstanceId(), 1);
+            }
+            String flag = actTest.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                String str = "";
+                str = actTestService.auditSaveBranch(actTest,users);
+                addMessage(redirectAttributes, str);
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "审批失败:");
+            logger.error("Exception e:"+e);
+        }
+
+        if (StringUtils.isNotBlank(actTest.getHome()) && "home".equals(actTest.getHome())){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else if (StringUtils.isNotBlank(actTest.getHome()) && "notifyList".equals(actTest.getHome())){
+            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+        }else {
+            return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+        }
+    }
+
+    /**
+     * 撤销
+     */
+    @RequestMapping("cancelInvalidate")
+    public String cancelInvalidate(ActTest actTest,RedirectAttributes redirectAttributes){
+        actTestService.cancelInvalidate(actTest);
+        return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+    }
+
+    /**
+     * 读取单个实体流程
+     * @return
+     */
+    @RequestMapping(value = "getProcessOne")
+    public String getProcessOne(ActTest actTest,Model model) {
+        model.addAttribute("processInstanceId", actTest.getProcessInstanceId());
+        return "modules/test/act/actTestTask";
+    }
+
+    /**
+     * 获取公告是否存在判定
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "getExist")
+    @ResponseBody
+    public Map<String,String> getExist(String id){
+        Map map = new HashMap();
+        ActTest actTest = null;
+        if (StringUtils.isNotBlank(id)){
+            actTest = actTestService.get(id);
+        }
+        if(null != actTest){
+            map.put("success",true);
+        }else{
+            map.put("success",false);
+        }
+        return map;
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping(value = "delete")
+    public String delete(ActTest actTest, RedirectAttributes redirectAttributes) {
+        actTestService.delete(actTest);
+        addMessage(redirectAttributes, "删除成功");
+        return "redirect:"+Global.getAdminPath()+"/test/actTest/?repage";
+    }
+
+
+
+}

+ 49 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -94,6 +94,8 @@ import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
 import com.jeeplus.modules.syswarning.entity.SysWarning;
 import com.jeeplus.modules.syswarning.service.SysWarningService;
+import com.jeeplus.modules.test.entity.act.ActTest;
+import com.jeeplus.modules.test.service.act.ActTestService;
 import com.jeeplus.modules.workadministrativeatamp.entity.WorkAdministrativeAtamp;
 import com.jeeplus.modules.workadministrativeatamp.service.WorkAdministrativeAtampService;
 import com.jeeplus.modules.workaskcheckprice.entity.WorkAskCheckPrice;
@@ -554,6 +556,9 @@ public class WorkProjectNotifyController extends BaseController {
 	private DailyOfficeWorkService dailyOfficeWorkService;
 
 	@Autowired
+	private ActTestService actTestService;
+
+	@Autowired
 	private ProjectReportSignatureWorkService projectReportSignatureService;
 
 	@ModelAttribute
@@ -1187,6 +1192,10 @@ public class WorkProjectNotifyController extends BaseController {
 				WorkSingleWage workSingleWage = workSingleWageService.get(workProjectNotify.getNotifyId());
 				if (workSingleWage != null)
 					processInstanceId = workSingleWage.getProcessInstanceId();
+			}else if ("261".equals(workProjectNotify.getType())) {//流程测试
+				ActTest actTest = actTestService.get(workProjectNotify.getNotifyId());
+				if (actTest != null)
+					processInstanceId = actTest.getProcessInstanceId();
 			}
 			workProjectNotify.setProcessInstanceId(processInstanceId);
 			workProjectNotify.setUser(workProjectNotify.getUser()!=null?UserUtils.get(workProjectNotify.getUser().getId()):new User());
@@ -7996,6 +8005,19 @@ public class WorkProjectNotifyController extends BaseController {
 						return "modules/statement/companyReportDataView";
 					}
 				}
+				else if ("261".equals(workProjectNotify.getType())) {//流程测试
+					ActTest actTest = actTestService.get(workProjectNotify.getNotifyId());
+					actTest.setHome("home");
+					actTest.setAct(getByAct(actTest.getProcessInstanceId()));
+					model.addAttribute("actTest", actTest);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						return "modules/test/act/actTestView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/test/act/actTestAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/test/act/actTestModify";
+					}
+				}
 			}
 		}
 		//如果该通知所对应的某记录已经被删除,在获取记录时会空指针
@@ -8574,6 +8596,15 @@ public class WorkProjectNotifyController extends BaseController {
 					model.addAttribute("workContractSignature", workContractSignature);
 					return "modules/workcontractsignature/workContractSignatureView";
 				}
+				else if(workProjectNotify.getType().equals("261")){	//流程测试
+					ActTest actTest = actTestService.get(workProjectNotify.getNotifyId());
+					actTest.setAct(getByAct(actTest.getProcessInstanceId()));
+					if ( actTest.getAct()!=null){
+						String taskDefKey = actTest.getAct().getTaskDefKey();
+					}
+					model.addAttribute("actTest",actTest);
+					return "modules/test/act/actTestView";
+				}
 			}
 		}
 		//如果该通知所对应的某记录已经被删除,在获取记录时会空指针WorkItemCollar workItemCollar = workItemCollarService
@@ -8998,7 +9029,25 @@ public class WorkProjectNotifyController extends BaseController {
 				map.put("code",0);
 				map.put("msg","咨询成果信息删除失败,只有“暂存”、“驳回”、“撤回”状态的咨询成果信息才能删除");
 			}
+		}else if (workProjectNotify.getType().equals("261")) {    //测试删除
+		ActTest actTest = actTestService.get(workProjectNotify.getNotifyId());
+		int status = Integer.parseInt(actTest.getStatus());
+		if(status== ProjectStatusEnum.TSTORE.getValue()||status== ProjectStatusEnum.REJECTED.getValue()||status== ProjectStatusEnum.RECALL.getValue()){
+			//删除流程待办信息
+			workProjectNotifyService.deleteByNotifyId(workProjectNotify);
+			//删除流程表信息
+			workProjectNotifyService.deleteActivityProcess(actTest.getProcessInstanceId());
+			//删除流程人员表信息
+			workProjectNotifyService.deleteActivityProcessUser(actTest.getProcessInstanceId());
+			//删除发票信息
+			actTestService.delete(actTest);
+			map.put("code",1);
+			map.put("msg","信息删除成功");
+		}else{
+			map.put("code",0);
+			map.put("msg","信息删除失败,只有“暂存”、“驳回”、“撤回”状态的信息才能删除");
 		}
+	}
 		return map;
 	}
 

+ 108 - 0
src/main/resources/mappings/modules/test/act/ActTestDao.xml

@@ -0,0 +1,108 @@
+<?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.test.dao.act.ActTestDao">
+
+    <sql id="actColumns">
+		a.id AS "id",
+		a.name AS "name",
+		a.number as "number",
+		a.process_instance_id as "processInstanceId",
+		a.status as "status",
+		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.company_id as "companyId",
+		a.office_id as "office.id",
+		a.del_flag AS "delFlag"
+	</sql>
+
+    <sql id="actJoins">
+		JOIN sys_office o ON o.id = a.office_id
+		JOIN sys_office s ON s.id = a.company_id
+    </sql>
+
+
+    <select id="get" resultType="ActTest">
+        select
+            <include refid="actColumns"/>
+        from test_act a
+        <include refid="actJoins"/>
+        where a.id = #{id}
+    </select>
+
+	<select id="queryCount" resultType="integer">
+		select
+			count(distinct id)
+		from test_act
+		<where>
+			del_flag = '0'
+		</where>
+	</select>
+
+	<select id="findList" resultType="ActTest">
+		select
+			<include refid="actColumns"/>
+		from test_act a
+		<where>
+			a.del_flag = '0'
+		</where>
+		order By a.create_date DESC
+	</select>
+
+	<update id="updateProcessInstanceId">
+		UPDATE test_act SET
+			process_instance_id = #{processInstanceId}
+		WHERE id = #{id}
+	</update>
+
+	<insert id="insert">
+	INSERT INTO test_act(
+	id,
+	create_by,
+	create_date,
+	update_by,
+	update_date,
+	remarks,
+	del_flag,
+	name,
+	number,
+	office_id,
+	company_id,
+	status
+	) VALUES (
+	#{id},
+	#{createBy.id},
+	#{createDate},
+	#{updateBy.id},
+	#{updateDate},
+	#{remarks},
+	#{delFlag},
+	#{name},
+	#{number},
+	#{officeId},
+	#{companyId},
+	#{status}
+	)
+	</insert>
+
+	<update id="update">
+		UPDATE test_act SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			status = #{status},
+			number = #{number},
+			name = #{name}
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE test_act SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 130 - 0
src/main/webapp/webpage/modules/test/act/actTestAudit.jsp

@@ -0,0 +1,130 @@
+<%@ 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"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <style>
+        #contractTypeDoc-error{
+            top:80px;
+            left:0;
+        }
+        /*超过5个汉字,调整label的长度,以下是配套的*/
+        .layui-item .layui-form-label{
+            width:90px;
+        }
+        .form-group .layui-item .layui-input-block,
+        .query .layui-input-block {
+            margin-left: 116px;
+        }
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                if(obj == 1) {
+                    $("#flag").val("yes");
+                }else {
+                    $("#flag").val("no");
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+            return false;
+        }
+
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+            });
+        });
+        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,
+                btn1: function(index, layero){
+                    top.layer.close(index)
+                    document.getElementById('iframe').contentWindow.location.reload();
+                }
+            });
+        }
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="actTest" action="${ctx}/test/actTest/saveAudit" method="post" class="layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="home"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+            <c:set var="status" value="${actTest.act.status}" />
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>基本信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">名称:</label>
+                    <div class="layui-input-block">
+                        <form:input id="name" path="name" htmlEscape="false" placeholder="请输入名称"   class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label double-line">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+        <div class="form-group-label">
+            <div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+            <h2>审批意见</h2>
+        </div>
+        <iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+
+        <div class="form-group layui-row">
+            <div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+            <div class="layui-item layui-col-xs12 form-table-container" >
+                <act:flowChart procInsId="${actTest.act.procInsId}"/>
+                <act:histoicFlow procInsId="${actTest.act.procInsId}" />
+            </div>
+        </div>
+    </div>
+</div>
+
+</body>
+</html>

+ 95 - 0
src/main/webapp/webpage/modules/test/act/actTestForm.jsp

@@ -0,0 +1,95 @@
+<%@ 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"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <style>
+        #contractTypeDoc-error{
+            top:80px;
+            left:0;
+        }
+        /*超过5个汉字,调整label的长度,以下是配套的*/
+        .layui-item .layui-form-label{
+            width:90px;
+        }
+        .form-group .layui-item .layui-input-block,
+        .query .layui-input-block {
+            margin-left: 116px;
+        }
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                console.log('obj',obj)
+                if(obj == 2){
+                    $("#inputForm").attr("action","${ctx}/test/actTest/store");
+                }else{
+                    var flag=judgment();
+                    if (flag){
+                        $("#inputForm").attr("action","${ctx}/test/actTest/save");
+                    }else if (!flags){
+                        return flag;
+                    }
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+            return false;
+        }
+
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+            });
+        });
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="actTest" action="${ctx}/test/actTest/save" method="post" class="layui-form">
+            <form:hidden path="id"/>
+
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>基本信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">名称:</label>
+                    <div class="layui-input-block">
+                        <form:input id="name" path="name" htmlEscape="false" placeholder="请输入名称"   class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label double-line">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+</body>
+</html>

+ 603 - 0
src/main/webapp/webpage/modules/test/act/actTestList.jsp

@@ -0,0 +1,603 @@
+<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
+<%@ 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">
+        <%--var Srole = "<%= UserUtils.getSelectRole().getName()%>";--%>
+
+        $(document).ready(function() {
+            // laydate.render({
+            //     elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            //     event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            // ,type:'datetime'
+            // });
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+                , trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+                , trigger: 'click'
+            });
+        });
+        function openDialogre(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,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){
+                }
+            });
+
+        }
+
+        function openDialogreplay(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:"two-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
+                    }
+
+                },
+                cancel: function(index){
+                }
+            });
+        }
+
+        function receiptInvoice(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,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){
+                }
+            });
+        }
+
+        function contractOpenDialogre(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: false, //开启最大化最小化按钮
+                skin:"three-btns",
+                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){
+                }
+            });
+
+        }
+
+        function openDialogreModify(title,url,id,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            $.ajax({
+                async: false,
+                url: "${ctx}/test/actTest/getInvoiceExist?id="+id,
+                dataType: "json",
+                success: function (data) {
+                    if(data.success){
+                        top.layer.open({
+                            type: 2,
+                            area: [width, height],
+                            title: title,
+                            maxmin: true, //开启最大化最小化按钮
+                            content: url ,
+                            skin:"two-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
+                                }
+
+                            },
+                            cancel: 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显示。
+
+            }
+            $.ajax({
+                async: false,
+                url: "${ctx}/test/actTest/getExist?id="+id,
+                dataType: "json",
+                success: function (data) {
+                    if(data.success){
+                        top.layer.open({
+                            type: 2,
+                            skin: 'one-btn',
+                            area: [width, height],
+                            title: title,
+                            maxmin: true, //开启最大化最小化按钮
+                            content: url ,
+                            btn: ['关闭'],
+                            cancel: function(index){
+                            }
+                        });
+                    }else{
+                        top.layer.msg("该信息已删除!", {icon: 0});
+                        window.location.reload();
+                    }
+                }
+            });
+
+        }
+
+    </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){
+                }
+            });
+
+        }
+        function cBlur(obj) {
+            var id = $("#accountCheckingUserId").val();
+            if(undefined != obj.value && null != obj.value && '' != obj.value){
+                $.ajax({
+                    url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+                    type:"post",
+                    success:function(data){
+                        var user = data.body.data;
+                        if(undefined == user || null == user || '' == user){
+                            $("#accountCheckingUserId").val("");
+                        }else{
+                            if(data.body.data.id != id){
+                                if(undefined != id && null != id && '' != id){
+                                    $("#accountCheckingUserId").val("");
+                                }
+                            }
+                        }
+                    }
+                });
+            }else{
+                $("#accountCheckingUserId").val("");
+            }
+
+        }
+        function blurSubmitterId(obj) {
+            var id = $("#submitterId").val();
+            if(undefined != obj.value && null != obj.value && '' != obj.value){
+                $.ajax({
+                    url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+                    type:"post",
+                    success:function(data){
+                        var user = data.body.data;
+                        if(undefined == user || null == user || '' == user){
+                            $("#submitterId").val("");
+                        }else{
+                            if(data.body.data.id != id){
+                                if(undefined != id && null != id && '' != id){
+                                    $("#submitterId").val("");
+                                }
+                            }
+                        }
+                    }
+                });
+            }else{
+                $("#submitterId").val("");
+            }
+
+        }
+    </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 shadowLTR list-form-tab" id="tabDiv">
+                <ul class="list-tabs" >
+                    <li class="active"><a href="${ctx}/workinvoice/workInvoice/list">发票管理</a></li>
+                    <li><a href="${ctx}/workinvoicealter/workInvoiceAlter/list">发票变更</a></li>
+                </ul>
+            </div>
+        </div>--%>
+        <div class="full-width fl">
+            <div class=" layui-row contentShadow shadowLR" id="queryDiv">
+                <form:form id="searchForm" modelAttribute="searchActTest" action="${ctx}/test/actTest/" 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 lw9">
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">发票号:</label>
+                            <div class="layui-input-block with-icon">
+                                <form:input path="number" htmlEscape="false"  class=" form-control layui-input"/>
+                            </div>
+                        </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>
+                            </div>
+                        </div>
+                        <div style="    clear:both;"></div>
+                    </div>
+                    <div id="moresees" class="lw9" style="clear:both;display:none;">
+
+                    </div>
+                </form:form>
+            </div>
+        </div>
+        <div class="full-width fl">
+            <div class=" contentShadow shadowLBR layui-form contentDetails">
+                <div class="nav-btns">
+                    <div class="layui-btn-group" style="float: left">
+                        <button class="layui-btn layui-btn-sm layui-bg-blue" title="测试" onclick="openDialogre('流程测试','${ctx}/test/actTest/form','95%','95%')">&nbsp;添加</button>
+                        <button class="layui-btn layui-btn-sm layui-bg-green" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+                    </div>
+
+
+                    <div style="clear: both;"></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', title: '序号',width:40}
+                ,{field:'name',align:'center', title: '名称', minWidth:160}
+                ,{field:'createDate',align:'center', sort:true,title: '创建日期',  width:80}
+                ,{align:'center', title: '状态', fixed: 'right', width:70,templet:function(d){
+                        var st = getAuditState(d.status);
+                        if(st.action)
+                            var xml = "<span onclick=\"openDialogListView('流程追踪', '${ctx}/test/actTest/getProcessOne?id=" + d.id + "','"+ d.id +"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        else
+                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        return xml;
+                    }}
+                ,{field:'op',align:'center',title:"操作",fixed: 'right',width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+
+                        if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 1)
+                        {
+                            xml+="<button onclick=\"notifyDialogre('审批', '${ctx}/test/actTest/form?id=" + d.notifyId +"&home=invoice','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 审批</button>";
+                        }
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改', '${ctx}/test/actTest/form?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('修改', '${ctx}/workinvoice/workInvoice/form?id=" + d.id + "&tabId=3','"+ d.id +"','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请', '${ctx}/test/actTest/form?id=" + d.id + "&tabId=4','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.candelete != undefined && d.candelete =="1")
+                        {
+                            xml += "<a href=\"${ctx}/test/actTest/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml += "<a href=\"${ctx}/test/actTest/cancelInvalidate?id="+ d.id +"\" onclick=\"return confirmx('确认要强制撤回?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 撤回</a>";
+                        }
+                        xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="actTest" varStatus="index"><c:set var="Srole" scope="session" value="<%= UserUtils.getSelectRole().get(0).getEnname()%>"/>
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${actTest.id}"
+                    ,"name":"${actTest.name}"
+                    ,"invoiceNum":"${actTest.number}"
+                    ,"status":"${actTest.status}"
+                    ,"createDate":"<fmt:formatDate value="${actTest.createDate}" pattern="yyyy-MM-dd"/>"
+                    <c:if test="${actTest.status == 1 && fns:getUser().id == actTest.createBy.id}">,"canedit1":"1"</c:if><%--暂存-修改--%>
+                    <c:if test="${actTest.status == '4' && fns:getUser().id == actTest.createBy.id}">,"canedit2":"1"</c:if><%--驳回--修改--%>
+                    <c:if test="${actTest.status == '3' && fns:getUser().id == actTest.createBy.id}">,"canedit3":"1"</c:if><%--撤回--修改--%>
+                    <c:if test="${fns:getUser().id == actTest.createBy.id}"><c:if test="${actTest.status == '1' or actTest.status == '3' or actTest.status == '4'}">,"candelete":"1"</c:if></c:if>
+                    <c:if test="${actTest.status == '2' && fns:getUser().id == actTest.createBy.id}">,"cancancel":"1"</c:if>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+    })
+
+    resizeListTable();/*消除由于有竖向滚动条造成table出现横向滚动条*/
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+
+</body>
+</html>

+ 103 - 0
src/main/webapp/webpage/modules/test/act/actTestModify.jsp

@@ -0,0 +1,103 @@
+<%@ 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"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <style>
+        #contractTypeDoc-error{
+            top:80px;
+            left:0;
+        }
+        /*超过5个汉字,调整label的长度,以下是配套的*/
+        .layui-item .layui-form-label{
+            width:90px;
+        }
+        .form-group .layui-item .layui-input-block,
+        .query .layui-input-block {
+            margin-left: 116px;
+        }
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                if(obj == 1) {
+                    $("#flag").val("yes");
+                }else {
+                    $("#flag").val("no");
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+            return false;
+        }
+
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+            });
+        });
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="actTest" action="${ctx}/test/actTest/saveAudit" method="post" class="layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="home"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+            <c:set var="status" value="${actTest.act.status}" />
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>基本信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">名称:</label>
+                    <div class="layui-input-block">
+                        <form:input id="name" path="name" htmlEscape="false" placeholder="请输入名称"   class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label double-line">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+                <div class="layui-item layui-col-xs12 form-table-container" >
+                    <act:flowChart procInsId="${actTest.act.procInsId}"/>
+                    <act:histoicFlow procInsId="${actTest.act.procInsId}" />
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+</body>
+</html>

+ 15 - 0
src/main/webapp/webpage/modules/test/act/actTestTask.jsp

@@ -0,0 +1,15 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>流程追踪</title>
+	<meta name="decorator" content="default"/>
+</head>
+<body class="gray-bg">
+	<div class="container form layui-form">
+        <act:flowChart procInsId="${processInstanceId}"/>
+        <act:histoicFlow procInsId="${processInstanceId}"/>
+	</div>
+</body>
+</html>
+

+ 89 - 0
src/main/webapp/webpage/modules/test/act/actTestView.jsp

@@ -0,0 +1,89 @@
+<%@ 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"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <style>
+        #contractTypeDoc-error{
+            top:80px;
+            left:0;
+        }
+        /*超过5个汉字,调整label的长度,以下是配套的*/
+        .layui-item .layui-form-label{
+            width:90px;
+        }
+        .form-group .layui-item .layui-input-block,
+        .query .layui-input-block {
+            margin-left: 116px;
+        }
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+            });
+        });
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="actTest" action="${ctx}/test/actTest/saveAudit" method="post" class="layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="home"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+            <c:set var="status" value="${actTest.act.status}" />
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>基本信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">名称:</label>
+                    <div class="layui-input-block">
+                        <form:input id="name" readonly="true" path="name" htmlEscape="false" placeholder="请输入名称"   class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label double-line">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" readonly="true" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+</body>
+</html>