Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

user5 1 год назад
Родитель
Сommit
f79ee118a0
27 измененных файлов с 4482 добавлено и 1655 удалено
  1. 1 0
      src/main/java/com/jeeplus/common/utils/MenuStatusEnum.java
  2. 9 0
      src/main/java/com/jeeplus/modules/identification/dao/PersonOpinionDao.java
  3. 57 0
      src/main/java/com/jeeplus/modules/identification/service/PersonOpinionService.java
  4. 92 0
      src/main/java/com/jeeplus/modules/identification/web/PersonOpinionController.java
  5. 10 0
      src/main/java/com/jeeplus/modules/test/dao/act/ActTestDao.java
  6. 165 0
      src/main/java/com/jeeplus/modules/test/entity/act/ActTest.java
  7. 673 0
      src/main/java/com/jeeplus/modules/test/service/act/ActTestService.java
  8. 319 0
      src/main/java/com/jeeplus/modules/test/web/act/ActTestController.java
  9. 8 0
      src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java
  10. 17 18
      src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java
  11. 416 436
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java
  12. 28 52
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  13. 110 97
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  14. 413 458
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  15. 127 0
      src/main/resources/mappings/modules/identification/PersonOpinionDao.xml
  16. 108 0
      src/main/resources/mappings/modules/test/act/ActTestDao.xml
  17. 35 80
      src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml
  18. 24 0
      src/main/webapp/static/common/jeeplus.js
  19. 103 0
      src/main/webapp/webpage/modules/personOpinion/personOpinionAddForm.jsp
  20. 205 0
      src/main/webapp/webpage/modules/personOpinion/personOpinionList.jsp
  21. 130 0
      src/main/webapp/webpage/modules/test/act/actTestAudit.jsp
  22. 95 0
      src/main/webapp/webpage/modules/test/act/actTestForm.jsp
  23. 603 0
      src/main/webapp/webpage/modules/test/act/actTestList.jsp
  24. 103 0
      src/main/webapp/webpage/modules/test/act/actTestModify.jsp
  25. 15 0
      src/main/webapp/webpage/modules/test/act/actTestTask.jsp
  26. 89 0
      src/main/webapp/webpage/modules/test/act/actTestView.jsp
  27. 527 514
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

+ 1 - 0
src/main/java/com/jeeplus/common/utils/MenuStatusEnum.java

@@ -83,6 +83,7 @@ public enum MenuStatusEnum {
     DISPUTE_MEDIATION("c0ce72cbeb5d446a946795b0a3b7e4a4","纠纷调解"),
     ELECTRONIC_SIGNATURE("50cfb2ad32814623a976bb7776e87c12","电子用章管理"),
     EBUSINESS_SIGNATURE("976b008b2c0f402ea7015bb15665d1f4","业务用章管理"),
+    PERSON_OPINION("de550330b679418cb43165c4937afa68","个人意见"),
     END("19940722131313","废弃");
 
     private String value;

+ 9 - 0
src/main/java/com/jeeplus/modules/identification/dao/PersonOpinionDao.java

@@ -0,0 +1,9 @@
+package com.jeeplus.modules.identification.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+
+@MyBatisDao
+public interface PersonOpinionDao extends CrudDao<AuditTemplate> {
+}

+ 57 - 0
src/main/java/com/jeeplus/modules/identification/service/PersonOpinionService.java

@@ -0,0 +1,57 @@
+package com.jeeplus.modules.identification.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.identification.dao.AuditTemplateDao;
+import com.jeeplus.modules.identification.dao.PersonOpinionDao;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class PersonOpinionService extends CrudService<PersonOpinionDao, AuditTemplate> {
+
+    @Autowired
+    private PersonOpinionDao personOpinionDao;
+
+
+    /**
+     * 查询列表
+     * @param page          分页对象
+     * @param auditTemplate
+     * @return
+     */
+    @Override
+    public Page<AuditTemplate> findPage(Page<AuditTemplate> page, AuditTemplate auditTemplate){
+        //设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+            auditTemplate.setOfficeId(UserUtils.getSelectOffice().getId());
+//            auditTemplate.getSqlMap().put("dsf", dataScopeFilter(auditTemplate.getCurrentUser(), "o", "u", "s", MenuStatusEnum.PERSON_OPINION.getValue()));
+            auditTemplate.setCreateBy(UserUtils.getUser());
+        }
+        int count = dao.queryCount(auditTemplate);
+        page.setCount(count);
+        page.setCountFlag(false);
+        auditTemplate.setPage(page);
+        List<AuditTemplate> auditTemplates = findList(auditTemplate);
+        for (AuditTemplate template:auditTemplates){
+            User user=UserUtils.get(template.getCreateBy().getId());
+            template.setCreateBy(user);
+        }
+        page.setList(auditTemplates);
+        return page;
+    }
+
+    @Transactional(readOnly = false)
+    public Integer deleteById(AuditTemplate auditTemplate){
+        return personOpinionDao.delete(auditTemplate);
+    }
+
+}

+ 92 - 0
src/main/java/com/jeeplus/modules/identification/web/PersonOpinionController.java

@@ -0,0 +1,92 @@
+package com.jeeplus.modules.identification.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+import com.jeeplus.modules.identification.service.PersonOpinionService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Controller
+@RequestMapping(value = "${adminPath}/personOpinion/personOpinion")
+public class PersonOpinionController extends BaseController {
+
+    @Autowired
+    private PersonOpinionService personOpinionService;
+
+
+    @ModelAttribute
+    public AuditTemplate get(@RequestParam(required=false) String id) {
+        AuditTemplate entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = personOpinionService.get(id);
+        }
+        if (entity == null){
+            entity = new AuditTemplate();
+        }
+        return entity;
+    }
+    /**
+     * 增加模板页面
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = {"list",""})
+    public String list(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<AuditTemplate> page=personOpinionService.findPage(new Page<AuditTemplate>(request, response),auditTemplate);
+        model.addAttribute("page",page);
+        model.addAttribute("auditTemplate",auditTemplate);
+        return "modules/personOpinion/personOpinionList";
+    }
+
+    /**
+     * 增加模板页面
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "toAddSave")
+    public String toAddSave(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
+        auditTemplate.setCreateBy(UserUtils.getUser());
+        model.addAttribute("auditTemplate",auditTemplate);
+        return "modules/personOpinion/personOpinionAddForm";
+    }
+    /**
+     * 增加模板信息
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "save")
+    public String save(AuditTemplate auditTemplate, Model model) {
+        personOpinionService.save(auditTemplate);
+        return "redirect:"+ Global.getAdminPath()+"/personOpinion/personOpinion/?repage";
+    }
+
+    /**
+     * 删除
+     * @param model
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "delete")
+    public String delete(AuditTemplate auditTemplate, Model model) {
+        try {
+            int i=personOpinionService.deleteById(auditTemplate);
+        }catch (Exception e){
+            return "删除失败";
+        }
+        return "删除成功";
+    }
+
+
+}

+ 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";
+    }
+
+
+
+}

+ 8 - 0
src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java

@@ -47,6 +47,14 @@ public interface WorkInvoiceDao extends CrudDao<WorkInvoice> {
 	public int updateProcessInstanceId(WorkInvoice workInvoice);
 
 	/**
+	 * 更新作废流程实例ID
+	 * @param
+	 * @return
+	 */
+	public int updateCancellationProcessInstanceId(WorkInvoice workInvoice);
+
+
+	/**
 	 * 修改日期信息
 	 * @param workInvoice
 	 * @return

+ 17 - 18
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java

@@ -111,11 +111,26 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	private Integer workReceiptCount;    	//收款数据量
 	private Double receiptMoneyD; //已收款金额
 	private Double notReceiptMoneyD; //未收款金额
+	private String cancellationProcessInstanceId; //作废流程实例id
+	private String cancellationState; //作废状态
 
 	private Integer electronicInvoiceFlag ;	//是否已经上传电子发票信息(0:未上传;1:已上传)
 
-	private Date auditPassDate;
-	private Date cancellationAuditPassDate;
+	public String getCancellationProcessInstanceId() {
+		return cancellationProcessInstanceId;
+	}
+
+	public void setCancellationProcessInstanceId(String cancellationProcessInstanceId) {
+		this.cancellationProcessInstanceId = cancellationProcessInstanceId;
+	}
+
+	public String getCancellationState() {
+		return cancellationState;
+	}
+
+	public void setCancellationState(String cancellationState) {
+		this.cancellationState = cancellationState;
+	}
 
 	@Override
 	@ExcelField(title="经办人", fieldType=User.class, value="createBy.name", align=2, sort=7)
@@ -803,20 +818,4 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	public void setAccountCheckingArea(String accountCheckingArea) {
 		this.accountCheckingArea = accountCheckingArea;
 	}
-
-	public Date getAuditPassDate() {
-		return auditPassDate;
-	}
-
-	public void setAuditPassDate(Date auditPassDate) {
-		this.auditPassDate = auditPassDate;
-	}
-
-	public Date getCancellationAuditPassDate() {
-		return cancellationAuditPassDate;
-	}
-
-	public void setCancellationAuditPassDate(Date cancellationAuditPassDate) {
-		this.cancellationAuditPassDate = cancellationAuditPassDate;
-	}
 }

+ 416 - 436
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java

@@ -210,17 +210,10 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 //		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			if("一部本部".equals(workInvoice.getOfficeId())){
-				List<String> officeIdList = Lists.newArrayList();
-				Office office = officeService.getByName("工程一部");
-				officeIdList.add(office.getId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}else{
-				//查询该选择节点下所有的部门Id
-				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-				officeIdList.add(workInvoice.getOfficeId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
 		}
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
@@ -270,19 +263,6 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	 */
 	public String getSumMoney(WorkInvoice workInvoice){
 		//workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
-		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			if("一部本部".equals(workInvoice.getOfficeId())){
-				List<String> officeIdList = Lists.newArrayList();
-				Office office = officeService.getByName("工程一部");
-				officeIdList.add(office.getId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}else{
-				//查询该选择节点下所有的部门Id
-				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-				officeIdList.add(workInvoice.getOfficeId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}
-		}
 		workInvoice.setPage(new Page<WorkInvoice>());
 		String getSumMoney = dao.getSumMoney(workInvoice);
 		if(StringUtils.isBlank(getSumMoney)){
@@ -337,94 +317,94 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	@Transactional(readOnly = false)
 	public String save(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
 		long s1=System.currentTimeMillis();
-			if (StringUtils.isBlank(workInvoice.getNumber())) {
-				synchronized (SYN_BYTE) {
-					workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
-				}
+		if (StringUtils.isBlank(workInvoice.getNumber())) {
+			synchronized (SYN_BYTE) {
+				workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
 			}
+		}
 		long s2=System.currentTimeMillis();
-			super.save(workInvoice);
+		super.save(workInvoice);
 		long s3=System.currentTimeMillis();
-			String str = "";
-			//所属部门
-			Office office = officeService.get(workInvoice.getOffice().getId());
-			String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
-			str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
-			String title = "实际开票单位:"+workInvoice.getClient().getName();
+		String str = "";
+		//所属部门
+		Office office = officeService.get(workInvoice.getOffice().getId());
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
+		String title = "实际开票单位:"+workInvoice.getClient().getName();
 		long s4=System.currentTimeMillis();
-			updateWorkInvoiceInfo(workInvoice);
+		updateWorkInvoiceInfo(workInvoice);
 		long s5=System.currentTimeMillis();
-			// 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
-			identityService.setAuthenticatedUserId(UserUtils.getUser().getId());
-			// 启动流程
-			String businessKey = workInvoice.getId().toString();
-			WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea93555c750905",officeService.get(workInvoice.getOfficeId()));
-			// 启动流程
-			String processType = workActivityMenu.getProcessType();
-			StringBuffer buffer = new StringBuffer();
-			Activity activity = new Activity();
-			WorkProjectNotify workProjectNotify = UtilNotify
-					.saveNotify(workInvoice.getId(),
-							null,
-							workInvoice.getCompanyId(),
-							title,
-							str,
-							"21",
-							"0",
-							"待审批",
-							""
-					);
+		// 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+		identityService.setAuthenticatedUserId(UserUtils.getUser().getId());
+		// 启动流程
+		String businessKey = workInvoice.getId().toString();
+		WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea93555c750905",officeService.get(workInvoice.getOfficeId()));
+		// 启动流程
+		String processType = workActivityMenu.getProcessType();
+		StringBuffer buffer = new StringBuffer();
+		Activity activity = new Activity();
+		WorkProjectNotify workProjectNotify = UtilNotify
+				.saveNotify(workInvoice.getId(),
+						null,
+						workInvoice.getCompanyId(),
+						title,
+						str,
+						"21",
+						"0",
+						"待审批",
+						""
+				);
 		long s6=System.currentTimeMillis();
-			List<User> users = new ArrayList<>();
-			List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",workInvoice.getCreateBy());
-			List<User> scbzrs = UserUtils.getByRoleActivityEnname("scfgld",1,office.getId(),"5",workInvoice.getCreateBy());
-			//List<User> fpglys = UserUtils.getByRoleActivityEnname("fpgly",1,office.getId(),"5",workInvoice.getCreateBy());
+		List<User> users = new ArrayList<>();
+		List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",workInvoice.getCreateBy());
+		List<User> scbzrs = UserUtils.getByRoleActivityEnname("scfgld",1,office.getId(),"5",workInvoice.getCreateBy());
+		//List<User> fpglys = UserUtils.getByRoleActivityEnname("fpgly",1,office.getId(),"5",workInvoice.getCreateBy());
 		//财务主任
 		List<User> fpglys = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.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",workInvoice.getCreateBy());
-						if (enusers.size()==0){
-							workInvoice.setInvoiceState("1");//暂存
-							this.save(workInvoice);
-							return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
-						}
-						variables.put(enlist, enusers);
-						variables.put(encount, enusers.size());
-					}
-					if (a.getDelFlag().equals("0") && a.getCount() == 1) {
-						activity = a;
+		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",workInvoice.getCreateBy());
+					if (enusers.size()==0){
+						workInvoice.setInvoiceState("1");//暂存
+						this.save(workInvoice);
+						return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
 					}
+					variables.put(enlist, enusers);
+					variables.put(encount, enusers.size());
 				}
-				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",workInvoice.getCreateBy());
-					}
-					//人员审批
-					if (StringUtils.isNotBlank(activity.getUser().getId())) {
-						users.add(activity.getUser());
-					}
+				if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+					activity = a;
 				}
-				workProjectNotify.setId("");
-			} else {
-				/*variables.put("scbzrList", scbzrs);
-				variables.put("fpglyList", fpglys);*/
-				if (bmzrs.size()==0 ){
-					workInvoice.setInvoiceState("1");//暂存
-					this.save(workInvoice);
+			}
+			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",workInvoice.getCreateBy());
 				}
-				if (bmzrs.size()==0){
-					return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
+				//人员审批
+				if (StringUtils.isNotBlank(activity.getUser().getId())) {
+					users.add(activity.getUser());
 				}
+			}
+			workProjectNotify.setId("");
+		} else {
+				/*variables.put("scbzrList", scbzrs);
+				variables.put("fpglyList", fpglys);*/
+			if (bmzrs.size()==0 ){
+				workInvoice.setInvoiceState("1");//暂存
+				this.save(workInvoice);
+			}
+			if (bmzrs.size()==0){
+				return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
+			}
 				/*if (scbzrs.size()==0){
 					return "流程审批人不能为空,角色市场分管领导下无用户,请联系管理员!";
 				}
@@ -433,67 +413,67 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 				}*/
 				/*variables.put("scbzrcount",scbzrs.size());
 				variables.put("fpglycount",fpglys.size());*/
-				processType = "workinvoice";
-				users.addAll(bmzrs);
-			}
-			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","21");
-				UserUtils.pushInfoToApp(title,str,extras,user.getId());
-				UserUtils.pushIm(user.getId(),str);
-			}
-			variables.put("type", processType);
-			variables.put("busId", businessKey);
-			variables.put("title", "发票申请编号:" + workInvoice.getNumber());//设置标题;
+			processType = "workinvoice";
+			users.addAll(bmzrs);
+		}
+		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","21");
+			UserUtils.pushInfoToApp(title,str,extras,user.getId());
+			UserUtils.pushIm(user.getId(),str);
+		}
+		variables.put("type", processType);
+		variables.put("busId", businessKey);
+		variables.put("title", "发票申请编号:" + workInvoice.getNumber());//设置标题;
 		long s8=System.currentTimeMillis();
-			ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
-			workInvoice.setProcessInstance(processInstance);
+		ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+		workInvoice.setProcessInstance(processInstance);
 		long s9=System.currentTimeMillis();
-			if (StringUtils.isNotBlank(processInstanceId)) {
-				workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
-				workActivityProcessService.deleteProcessInstanceId(processInstanceId);
-				workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
-			}
+		if (StringUtils.isNotBlank(processInstanceId)) {
+			workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+			workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+			workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+		}
 		long s10=System.currentTimeMillis();
-			// 更新流程实例ID
-			workInvoice.setProcessInstanceId(processInstance.getId());
-			workInvoiceDao.updateProcessInstanceId(workInvoice);
+		// 更新流程实例ID
+		workInvoice.setProcessInstanceId(processInstance.getId());
+		workInvoiceDao.updateProcessInstanceId(workInvoice);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
 		workProjectNotifyService.save(workProjectNotify);
-			List<Activity> list = workActivityMenu.getActivities();
+		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("workinvoice");
-				workActivityProcess.setCount(1);
-				workActivityProcess.setProcessInstanceId(processInstance.getId());
-				workActivityProcess.setIsApproval("0");
-				workActivityProcessService.save(workActivityProcess);
-				workActivityProcess.setCount(2);
-				workActivityProcess.setId("");
-				workActivityProcessService.save(workActivityProcess);
-				workActivityProcess.setCount(3);
-				workActivityProcess.setId("");
-				workActivityProcessService.save(workActivityProcess);
-				workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
-				workActivityProcessService.insertAuditsByType(scbzrs,processInstance.getId(),2,0);
-				workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),3,0);
-			}
+		if (list != null && list.size() != 0) {
+			workActivityProcessService.saveList(list, processInstance.getId());
+		} else {
+			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+			workActivityProcess.setProcessKey("workinvoice");
+			workActivityProcess.setCount(1);
+			workActivityProcess.setProcessInstanceId(processInstance.getId());
+			workActivityProcess.setIsApproval("0");
+			workActivityProcessService.save(workActivityProcess);
+			workActivityProcess.setCount(2);
+			workActivityProcess.setId("");
+			workActivityProcessService.save(workActivityProcess);
+			workActivityProcess.setCount(3);
+			workActivityProcess.setId("");
+			workActivityProcessService.save(workActivityProcess);
+			workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+			workActivityProcessService.insertAuditsByType(scbzrs,processInstance.getId(),2,0);
+			workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),3,0);
+		}
 		long s12=System.currentTimeMillis();
-			logger.info("发票送审-------生成发票编号:"+(s2-s1)+"  保存发票信息:"+(s3-s2)+"  保存发票明细数据:"+(s5-s4)
-					+"  查询角色人员:"+(s7-s6)+"  流程启动:"+(s9-s8)+"  workActivityProcessService.updateProcessInstanceId:"+(s10-s9)
-					+"  查询角色人员:"+(s12-s11)+"  总时间:"+(s12-s1));
-			logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{
-					ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
+		logger.info("发票送审-------生成发票编号:"+(s2-s1)+"  保存发票信息:"+(s3-s2)+"  保存发票明细数据:"+(s5-s4)
+				+"  查询角色人员:"+(s7-s6)+"  流程启动:"+(s9-s8)+"  workActivityProcessService.updateProcessInstanceId:"+(s10-s9)
+				+"  查询角色人员:"+(s12-s11)+"  总时间:"+(s12-s1));
+		logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{
+				ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
 		return "";
 	}
 
@@ -1211,176 +1191,195 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	 */
 	@Transactional(readOnly = false)
 	public String auditSaveBranch(WorkInvoice workInvoice,List<User> auditUsers) {
-			//所属部门
-			Office office = officeService.get(workInvoice.getOffice().getId());
-			String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
-			String  str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
-			String title = "实际开票单位:"+workInvoice.getClient().getName();
-			// 对不同环节的业务逻辑进行操作
-			String taskDefKey = workInvoice.getAct().getTaskDefKey();
-			if("fpgly".equals(taskDefKey)){
-				updateWorkInvoiceInfo(workInvoice);
-				actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
-			}else if (!"modifyApply".equals(taskDefKey)) {
-				actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
-			}else {
-				workInvoice.getAct().setFlag("yes");
-				updateWorkInvoiceInfo(workInvoice);
-			}
-			String comment = "";
-			if (workInvoice.getInvoiceState().equals("4")){
-				comment = ("yes".equals(workInvoice.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
-			}else {
-				comment = ("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment();
-			}
+		//所属部门
+		Office office = officeService.get(workInvoice.getOffice().getId());
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		String  str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
+		String title = "实际开票单位:"+workInvoice.getClient().getName();
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		if("fpgly".equals(taskDefKey)){
+			updateWorkInvoiceInfo(workInvoice);
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else if (!"modifyApply".equals(taskDefKey)) {
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else {
+			workInvoice.getAct().setFlag("yes");
+			updateWorkInvoiceInfo(workInvoice);
+		}
+		String comment = "";
+		if (workInvoice.getInvoiceState().equals("4")){
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+		}else {
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment();
+		}
 		//项目名称获取
 		List<String> projectNameList = getProjectNameList(workInvoice);
 		String projectNameStr = String.join(",", projectNameList);
-			//yes 的时候状态为审核通过 否则为未通过
-			//2 审核中 4 驳回
-			workInvoice.setInvoiceState(("yes".equals(workInvoice.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(workInvoice.getProcessInstanceId());
-			WorkActivityMenu workActivityMenu = new WorkActivityMenu();
-			if (activitieList != null && activitieList.size() != 0) {
-				workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
-				workActivityMenu.setActivities(activitieList);
-			}
+		//yes 的时候状态为审核通过 否则为未通过
+		//2 审核中 4 驳回
+		workInvoice.setInvoiceState(("yes".equals(workInvoice.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(workInvoice.getProcessInstanceId());
+		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+		if (activitieList != null && activitieList.size() != 0) {
+			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+			workActivityMenu.setActivities(activitieList);
+		}
 
-			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
-			WorkActivityProcess selectProcess = new WorkActivityProcess();
-			selectProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
-			List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
-			List<Activity> activities = workActivityMenu.getActivities();
-			if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceBranch")) {
-				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(workInvoice.getAct().getFlag())) {
-							workInvoice.setInvoiceState("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("");
+		WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+		WorkActivityProcess selectProcess = new WorkActivityProcess();
+		selectProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+		List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+		List<Activity> activities = workActivityMenu.getActivities();
+		if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceBranch")) {
+			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(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("4");
+						workActivityProcess.setIsApproval("2");
+						String returnBack = "-1";
+						for (Activity activity : activities) {
+							if (activity.getCount() == activityProcess.getCount()) {
+								notifyRole = activity.getName();
+								returnBack = activity.getReturnBack();
+								break;
 							}
-
-						} else {
-							workActivityProcess.setIsApproval("1");
 						}
-					}else if(taskDefKey.equals("modifyApply")){
-						taskCount = "0";
-						notifyRole = "调整申请";
-						exp = "pass";
-						workActivityProcess.setId("");
-						workActivityProcess.setCount(0);
-						if (!"yes".equals(workInvoice.getAct().getFlag())) {
-							workInvoice.setInvoiceState("3");
-							workActivityProcess.setIsApproval("2");
-						} else {
-							workActivityProcess.setIsApproval("1");
+						if (returnBack.equals("0")) {
+							workActivityProcess.setId("");
 						}
-						break;
+
+					} else {
+						workActivityProcess.setIsApproval("1");
 					}
-				}
-			} else {
-				workActivityMenu.setProcessType("newWorkInvoiceBranch");
-				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("");
+				}else if(taskDefKey.equals("modifyApply")){
+					taskCount = "0";
+					notifyRole = "调整申请";
+					exp = "pass";
+					workActivityProcess.setId("");
+					workActivityProcess.setCount(0);
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+						workActivityProcess.setIsApproval("2");
+					} else {
+						workActivityProcess.setIsApproval("1");
 					}
-					// 审核环节
-					//if ("bmzr".equals(taskDefKey) && count.contains("1")) {
-					if ("fpgly".equals(taskDefKey) && count.contains("1")) {
-						taskCount = "1";
-						exp = "pass";
-						if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
-							workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
-							//分公司流程
-							//notifyRole = "财务主任审批";
-							notifyRole = "审批通过";
-							workActivityProcess.setIsApproval("1");
+					break;
+				}
+			}
+		} else {
+			workActivityMenu.setProcessType("newWorkInvoiceBranch");
+			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 ("fpgly".equals(taskDefKey) && count.contains("1")) {
+					taskCount = "1";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						//分公司流程
+						//notifyRole = "财务主任审批";
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
 							/*enname = "fpgly";
 							vars.put("fpglyList", auditUsers);
 							vars.put("fpglycount",auditUsers.size());*/
-						}else {
-							notifyRole = "调整申请";
-							workActivityProcess.setIsApproval("2");
-						}
-						break;
-					}  else if ("fpgly".equals(taskDefKey) && count.contains("2")) {
-						taskCount = "2";
-						exp = "pass";
-						if ("yes".equals(workInvoice.getAct().getFlag())) {
-							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 = "cwygevod";
-						if (!"yes".equals(workInvoice.getAct().getFlag())) {
-							workInvoice.setInvoiceState("3");
-						}
-						break;
-					} else if ("apply_end".equals(taskDefKey)) {
+					}else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
 					}
-
+					break;
+				}  else if ("fpgly".equals(taskDefKey) && count.contains("2")) {
+					taskCount = "2";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag())) {
+						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 = "cwygevod";
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+					}
+					break;
+				} else if ("apply_end".equals(taskDefKey)) {
 				}
+
 			}
-			// 设置意见
-			workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
-			workInvoice.preUpdate();
+		}
+		// 设置意见
+		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
+		workInvoice.preUpdate();
 
 		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workInvoice.getProcessInstanceId());
 
-			// 提交流程任务
-			vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
-		    vars.put("passs", true);
-			workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
-			// 提交流程任务
-			actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
-			boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
-			List<User> users = new ArrayList<>();
-			List<User> userList = new ArrayList<>();
-			//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+		// 提交流程任务
+		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
+		vars.put("passs", true);
+		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
+		// 提交流程任务
+		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
+		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
+		List<User> users = new ArrayList<>();
+		List<User> userList = new ArrayList<>();
+		//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
 		if (!state) {
-				users.add(workInvoice.getCreateBy());
-				if ("yes".equals(workInvoice.getAct().getFlag())) {
-					title = "项目【"+ projectNameStr +"】发票申请通过";
-					str = "项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
-					workInvoice.setInvoiceState("5");
-					WorkProjectNotify notify = new WorkProjectNotify();
-					notify.setNotifyId(workInvoice.getId());
-					userList = workProjectNotifyService.readByNotifyId(notify);
+			users.add(workInvoice.getCreateBy());
+			if ("yes".equals(workInvoice.getAct().getFlag())) {
+				title = "项目【"+ projectNameStr +"】发票申请通过";
+				str = "项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
+				workInvoice.setInvoiceState("5");
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				workProjectNotifyService
+						.save(UtilNotify
+								.saveNewNotify(workInvoice.getId(),
+										workInvoice.getCreateBy(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"21",
+										"0",
+										"待通知",
+										notifyRole,
+										workInvoice.getProcessInstanceId(), new Date()));
+
+			} else {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				if (StringUtils.isNotBlank(workInvoice.getInvoiceState()) && !workInvoice.getInvoiceState().equals("3")){
+					workInvoice.setInvoiceState("4");
 					workProjectNotifyService
 							.save(UtilNotify
 									.saveNewNotify(workInvoice.getId(),
@@ -1393,80 +1392,118 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 											"待通知",
 											notifyRole,
 											workInvoice.getProcessInstanceId(), new Date()));
+				}
+			}
+			workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
+		} else {
+			if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceBranch")) {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				WorkProjectNotify workProjectNotify = UtilNotify
+						.saveNewNotify(workInvoice.getId(),
+								new User(),
+								workInvoice.getCompanyId(),
+								title,
+								str,
+								"21",
+								"0",
+								"待审批",
+								notifyRole,
+								workInvoice.getProcessInstanceId(), new Date());
+				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+						activities,
+						workProjectNotify,
+						taskDefKey,
+						workInvoice.getAct().getFlag(),
+						taskCount,
+						workInvoice.getCreateBy(),
+						workInvoice.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","21");
+						UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
 
-				} else {
-					WorkProjectNotify notify = new WorkProjectNotify();
-					notify.setNotifyId(workInvoice.getId());
-					userList = workProjectNotifyService.readByNotifyId(notify);
-					if (StringUtils.isNotBlank(workInvoice.getInvoiceState()) && !workInvoice.getInvoiceState().equals("3")){
-						workInvoice.setInvoiceState("4");
-						workProjectNotifyService
-								.save(UtilNotify
-										.saveNewNotify(workInvoice.getId(),
-												workInvoice.getCreateBy(),
-												workInvoice.getCompanyId(),
-												title,
-												str,
-												"21",
-												"0",
-												"待通知",
-												notifyRole,
-												workInvoice.getProcessInstanceId(), new Date()));
 					}
 				}
-				workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
+
 			} else {
-				if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceBranch")) {
+				if (!"yes".equals(workInvoice.getAct().getFlag())) {//驳回待办提醒
+					title = "项目【"+ projectNameStr +"】发票申请被驳回";
+					str = "项目【"+ projectNameStr +"】发票申请被驳回,请选择重新申请或作废";
 					WorkProjectNotify notify = new WorkProjectNotify();
 					notify.setNotifyId(workInvoice.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
-					WorkProjectNotify workProjectNotify = UtilNotify
-							.saveNewNotify(workInvoice.getId(),
-									new User(),
-									workInvoice.getCompanyId(),
-									title,
-									str,
-									"21",
-									"0",
-									"待审批",
-									notifyRole,
-									workInvoice.getProcessInstanceId(), new Date());
-					List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
-							activities,
-							workProjectNotify,
-							taskDefKey,
-							workInvoice.getAct().getFlag(),
-							taskCount,
-							workInvoice.getCreateBy(),
-							workInvoice.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","21");
-							UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+					workProjectNotifyService
+							.save(UtilNotify
+									.saveNewNotify(workInvoice.getId(),
+											workInvoice.getCreateBy(),
+											workInvoice.getCompanyId(),
+											title,
+											str,
+											"21",
+											"0",
+											"重新申请",
+											notifyRole,
+											workInvoice.getProcessInstanceId(), new Date()));
+					users.add( workInvoice.getCreateBy());
+				} else {
+					if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+						title = "项目【"+ projectNameStr +"】发票重新申请,待审批";
+						str = "项目【"+ projectNameStr +"】发票重新申请,待审批,发票申请编号:"+workInvoice.getNumber();;
+						WorkProjectNotify notify = new WorkProjectNotify();
+						notify.setNotifyId(workInvoice.getId());
+						userList = workProjectNotifyService.readByNotifyId(notify);
+						WorkProjectNotify workProjectNotify = UtilNotify
+								.saveNewNotify(workInvoice.getId(),
+										new User(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"21",
+										"0",
+										"待审批",
+										notifyRole,
+										workInvoice.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","21");
+								UserUtils.pushInfoToApp(title,str,extras,user1.getId());
 
+							}
 						}
-					}
-
-				} else {
-					if (!"yes".equals(workInvoice.getAct().getFlag())) {//驳回待办提醒
-						title = "项目【"+ projectNameStr +"】发票申请被驳回";
-						str = "项目【"+ projectNameStr +"】发票申请被驳回,请选择重新申请或作废";
+					}else {
 						WorkProjectNotify notify = new WorkProjectNotify();
 						notify.setNotifyId(workInvoice.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
+						users.addAll(userList);
+						users.add(workInvoice.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
 										.saveNewNotify(workInvoice.getId(),
@@ -1479,83 +1516,26 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 												"重新申请",
 												notifyRole,
 												workInvoice.getProcessInstanceId(), new Date()));
-						users.add( workInvoice.getCreateBy());
-					} else {
-						if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
-							title = "项目【"+ projectNameStr +"】发票重新申请,待审批";
-							str = "项目【"+ projectNameStr +"】发票重新申请,待审批,发票申请编号:"+workInvoice.getNumber();;
-							WorkProjectNotify notify = new WorkProjectNotify();
-							notify.setNotifyId(workInvoice.getId());
-							userList = workProjectNotifyService.readByNotifyId(notify);
-							WorkProjectNotify workProjectNotify = UtilNotify
-									.saveNewNotify(workInvoice.getId(),
-											new User(),
-											workInvoice.getCompanyId(),
-											title,
-											str,
-											"21",
-											"0",
-											"待审批",
-											notifyRole,
-											workInvoice.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","21");
-									UserUtils.pushInfoToApp(title,str,extras,user1.getId());
-
-								}
-							}
-						}else {
-							WorkProjectNotify notify = new WorkProjectNotify();
-							notify.setNotifyId(workInvoice.getId());
-							userList = workProjectNotifyService.readByNotifyId(notify);
-							users.addAll(userList);
-							users.add(workInvoice.getCreateBy());
-							workProjectNotifyService
-									.save(UtilNotify
-											.saveNewNotify(workInvoice.getId(),
-													workInvoice.getCreateBy(),
-													workInvoice.getCompanyId(),
-													title,
-													str,
-													"21",
-													"0",
-													"重新申请",
-													notifyRole,
-													workInvoice.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 (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());
-				}
+		}
+		if (userList!=null && userList.size()!=0) {
+			for (User u : userList) {
+				UserUtils.pushMeIm(u.getId());
 			}
-			workInvoiceDao.update(workInvoice);
-			return "保存审核意见成功!";
+		}
+		workInvoiceDao.update(workInvoice);
+		return "保存审核意见成功!";
 	}
 
 
@@ -1707,14 +1687,14 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	 */
 	@Transactional(readOnly = false)
 	public void conditionCancelInvalidate(WorkInvoice workInvoice) {
-		String invalidateProcessInstanceId = workInvoice.getProcessInstanceId();
+		String invalidateProcessInstanceId = workInvoice.getCancellationProcessInstanceId();
 		try {
 			//将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
 			WorkActivityProcess process = new WorkActivityProcess();
-			process.setProcessInstanceId(workInvoice.getProcessInstanceId());
+			process.setProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 			process.setIsApproval("0");
 			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
-			workActivityProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+			workActivityProcess.setProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 			List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
 			WorkProjectNotify notify = new WorkProjectNotify();
 			notify.setNotifyId(workInvoice.getId());
@@ -1741,7 +1721,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 			}
 			//结束该流程,设为"撤销"状态
 			actTaskService.endProcessInstance(invalidateProcessInstanceId, "发票作废-撤销");
-			workInvoice.setInvoiceState("11");
+			workInvoice.setCancellationState("11");
 			workInvoice.preUpdate();
 			workInvoiceDao.update(workInvoice);
 		} catch (ActivitiObjectNotFoundException e) {

+ 28 - 52
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -245,19 +245,11 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 		workInvoice.getSqlMap().put("dsf", invoiceDataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			if("一部本部".equals(workInvoice.getOfficeId())){
-				List<String> officeIdList = Lists.newArrayList();
-				Office office = officeService.getByName("工程一部");
-				officeIdList.add(office.getId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}else{
-				//查询该选择节点下所有的部门Id
-				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-				officeIdList.add(workInvoice.getOfficeId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
 		}
-
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
 		page.setCountFlag(false);
@@ -402,19 +394,6 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	 */
 	public String getSumMoney(WorkInvoice workInvoice){
 		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
-		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			if("一部本部".equals(workInvoice.getOfficeId())){
-				List<String> officeIdList = Lists.newArrayList();
-				Office office = officeService.getByName("工程一部");
-				officeIdList.add(office.getId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}else{
-				//查询该选择节点下所有的部门Id
-				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-				officeIdList.add(workInvoice.getOfficeId());
-				workInvoice.setOfficeIdList(officeIdList);
-			}
-		}
 		workInvoice.setPage(new Page<WorkInvoice>());
 		String getSumMoney = dao.getSumMoney(workInvoice);
 		if(StringUtils.isBlank(getSumMoney)){
@@ -1490,7 +1469,6 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			users.add(workInvoice.getCreateBy());
 			if ("yes".equals(workInvoice.getAct().getFlag())) {
 				workInvoice.setInvoiceState("5");
-				workInvoice.setAuditPassDate(new Date());
 				WorkProjectNotify notify = new WorkProjectNotify();
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
@@ -1852,7 +1830,6 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					title = "项目【"+ projectNameStr +"】发票申请通过";
 					str = "发票金额:" + workInvoice.getMoney() + "(元)。项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
 					workInvoice.setInvoiceState("5");
-					workInvoice.setAuditPassDate(new Date());
 					WorkProjectNotify notify = new WorkProjectNotify();
 					notify.setNotifyId(workInvoice.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
@@ -2921,14 +2898,14 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	 */
 	@Transactional(readOnly = false)
 	public void conditionCancelInvalidate(WorkInvoice workInvoice) {
-		String invalidateProcessInstanceId = workInvoice.getProcessInstanceId();
+		String invalidateProcessInstanceId = workInvoice.getCancellationProcessInstanceId();
 		try {
 			//将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
 			WorkActivityProcess process = new WorkActivityProcess();
-			process.setProcessInstanceId(workInvoice.getProcessInstanceId());
+			process.setProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 			process.setIsApproval("0");
 			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
-			workActivityProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+			workActivityProcess.setProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 			List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
 			WorkProjectNotify notify = new WorkProjectNotify();
 			notify.setNotifyId(workInvoice.getId());
@@ -2955,7 +2932,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			}
 			//结束该流程,设为"撤销"状态
 			actTaskService.endProcessInstance(invalidateProcessInstanceId, "发票作废-撤销");
-			workInvoice.setInvoiceState("11");
+			workInvoice.setCancellationState("11");
 			workInvoice.preUpdate();
 			workInvoiceDao.update(workInvoice);
 		} catch (ActivitiObjectNotFoundException e) {
@@ -3013,7 +2990,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	 * @param variables
 	 */
 	@Transactional(readOnly = false)
-	public String cancellationBranch(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
+	public String cancellationBranch(WorkInvoice workInvoice,Map<String, Object> variables,String cancellationProcessInstanceId) {
 		if (StringUtils.isBlank(workInvoice.getNumber())) {
 			synchronized (SYN_BYTE) {
 				workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
@@ -3064,7 +3041,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 				if (a.getRole()!=null && StringUtils.isNotBlank(a.getRole().getEnname())){
 					List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"5",workInvoice.getCreateBy());
 					if (enusers.size()==0){
-						workInvoice.setInvoiceState("1");//暂存
+						workInvoice.setCancellationState("1");//暂存
 						this.save(workInvoice);
 						return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
 					}
@@ -3114,14 +3091,14 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		variables.put("title", "发票申请编号:" + workInvoice.getNumber());//设置标题;
 		ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
 		workInvoice.setProcessInstance(processInstance);
-		if (StringUtils.isNotBlank(processInstanceId)) {
-			workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
-			workActivityProcessService.deleteProcessInstanceId(processInstanceId);
-			workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+		if (StringUtils.isNotBlank(cancellationProcessInstanceId)) {
+			workActivityProcessService.updateProcessInstanceId(processInstance.getId(),cancellationProcessInstanceId);
+			workActivityProcessService.deleteProcessInstanceId(cancellationProcessInstanceId);
+			workActivityProcessService.deleteProcessIdAuditUsers(cancellationProcessInstanceId);
 		}
 		// 更新流程实例ID
-		workInvoice.setProcessInstanceId(processInstance.getId());
-		workInvoiceDao.updateProcessInstanceId(workInvoice);
+		workInvoice.setCancellationProcessInstanceId(processInstance.getId());
+		workInvoiceDao.updateCancellationProcessInstanceId(workInvoice);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
 		workProjectNotifyService.save(workProjectNotify);
@@ -3169,14 +3146,14 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			updateWorkInvoiceInfo(workInvoice);
 		}
 		String comment = "";
-		if (workInvoice.getInvoiceState().equals("9")){
+		if (workInvoice.getCancellationState().equals("9")){
 			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
 		}else {
 			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment();
 		}
 		//yes 的时候状态为审核通过 否则为未通过
 		//6 作废审批中 9 作废驳回
-		workInvoice.setInvoiceState(("yes".equals(workInvoice.getAct().getFlag()) ? "6" : "9"));
+		workInvoice.setCancellationState(("yes".equals(workInvoice.getAct().getFlag()) ? "6" : "9"));
 		Map<String, Object> vars = Maps.newHashMap();
 		//业务逻辑对应的条件表达式
 		String exp = "";
@@ -3184,7 +3161,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		String notifyRole = "";
 		int key = 0;
 		String enname = "";
-		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
+		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
 		if (activitieList != null && activitieList.size() != 0) {
 			Iterator<Activity> iterator = activitieList.iterator();
@@ -3200,7 +3177,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 
 		WorkActivityProcess workActivityProcess = new WorkActivityProcess();
 		WorkActivityProcess selectProcess = new WorkActivityProcess();
-		selectProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+		selectProcess.setProcessInstanceId(workInvoice.getCancellationProcessInstanceId());
 		List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
 		List<Activity> activities = workActivityMenu.getActivities();
 		if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceBranch")) {
@@ -3215,7 +3192,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					}
 					exp = "pass";
 					if (!"yes".equals(workInvoice.getAct().getFlag())) {
-						workInvoice.setInvoiceState("9");
+						workInvoice.setCancellationState("9");
 						workActivityProcess.setIsApproval("2");
 						String returnBack = "-1";
 						for (Activity activity : activities) {
@@ -3239,7 +3216,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					workActivityProcess.setId("");
 					workActivityProcess.setCount(0);
 					if (!"yes".equals(workInvoice.getAct().getFlag())) {
-						workInvoice.setInvoiceState("3");
+						workInvoice.setCancellationState("3");
 						workActivityProcess.setIsApproval("2");
 					} else {
 						workActivityProcess.setIsApproval("1");
@@ -3262,7 +3239,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					taskCount = "1";
 					exp = "pass";
 					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
-						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getCancellationProcessInstanceId(),2,1);
 						//分公司流程
 						//notifyRole = "财务主任审批";
 						notifyRole = "审批通过";
@@ -3293,7 +3270,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					workActivityProcess.setCount(0);
 					enname = "cwygevod";
 					if (!"yes".equals(workInvoice.getAct().getFlag())) {
-						workInvoice.setInvoiceState("3");
+						workInvoice.setCancellationState("3");
 					}
 					break;
 				} else if ("apply_end".equals(taskDefKey)) {
@@ -3307,7 +3284,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		// 提交流程任务
 		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
 		vars.put("passs", true);
-		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
+		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getCancellationProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
 		// 提交流程任务
 		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
 		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
@@ -3318,8 +3295,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			title = "实际开票单位:"+workInvoice.getClient().getName();
 			users.add(workInvoice.getCreateBy());
 			if ("yes".equals(workInvoice.getAct().getFlag())) {
-				workInvoice.setInvoiceState("7");
-				workInvoice.setCancellationAuditPassDate(new Date());
+				workInvoice.setCancellationState("7");
 				WorkProjectNotify notify = new WorkProjectNotify();
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
@@ -3339,8 +3315,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 				WorkProjectNotify notify = new WorkProjectNotify();
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
-				if (StringUtils.isNotBlank(workInvoice.getInvoiceState()) && !workInvoice.getInvoiceState().equals("3")){
-					workInvoice.setInvoiceState("9");
+				if (StringUtils.isNotBlank(workInvoice.getCancellationState()) && !workInvoice.getCancellationState().equals("3")){
+					workInvoice.setCancellationState("9");
 					workProjectNotifyService
 							.save(UtilNotify
 									.saveNotify(workInvoice.getId(),

+ 110 - 97
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -474,7 +474,7 @@ public class WorkInvoiceTwoController extends BaseController {
 			}
 
 			if(projectIdList.size()>0){
-			//根据项目id查询项目信息中的项目类别
+				//根据项目id查询项目信息中的项目类别
 				String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
 				//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
 				if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
@@ -579,19 +579,22 @@ public class WorkInvoiceTwoController extends BaseController {
 		if("1".equals(tabId)){
 			view = "workInvoiceView";
 		}else if("3".equals(tabId)){
-			ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getProcessInstanceId());
-			if (processInstance!=null) {
-				Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
-				Act act = new Act();
-				act.setTaskId(taskInfok.getId());
-				act.setTaskName(taskInfok.getName());
-				act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
-				act.setProcDefId(taskInfok.getProcessDefinitionId());
-				act.setProcInsId(taskInfok.getProcessInstanceId());
-				act.setTask(taskInfok);
-				workInvoice.setAct(act);
-				view = "conditionWorkInvoiceTwoModify";
+			if (StringUtils.isNotBlank(workInvoice.getCancellationProcessInstanceId())){
+				ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getCancellationProcessInstanceId());
+				if (processInstance!=null) {
+					Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+					Act act = new Act();
+					act.setTaskId(taskInfok.getId());
+					act.setTaskName(taskInfok.getName());
+					act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+					act.setProcDefId(taskInfok.getProcessDefinitionId());
+					act.setProcInsId(taskInfok.getProcessInstanceId());
+					act.setTask(taskInfok);
+					workInvoice.setAct(act);
+					view = "conditionWorkInvoiceTwoModify";
+				}
 			}
+
 		}
 		// 环节编号
 		String taskDefKey = workInvoice.getAct().getTaskDefKey();
@@ -634,41 +637,41 @@ public class WorkInvoiceTwoController extends BaseController {
 
 		User user = workInvoice.getCreateBy();
 		User loginUser = UserUtils.getUser();
-		String invoiceState = workInvoice.getInvoiceState();
+		String invoiceState = workInvoice.getCancellationState();
 		if(null != loginUser && (loginUser.getOffice().getName().equals("财务部") || loginUser.getId().equals(workInvoice.getCreateBy().getId()))){
-		//启动流程
-		workInvoice.setInvoiceState("6");
-		String processInstanceId ="";
-		if (user!=null && StringUtils.isNotBlank(user.getId()) && StringUtils.isNotBlank(invoiceState) && "9".equals(invoiceState)){
-			processInstanceId = workInvoiceService.get(workInvoice.getId()).getProcessInstanceId();
-		}
-		try {
-			Map<String, Object> variables = Maps.newHashMap();
+			//启动流程
+			workInvoice.setCancellationState("6");
+			String cancellationProcessInstanceId ="";
+			if (user!=null && StringUtils.isNotBlank(user.getId()) && StringUtils.isNotBlank(invoiceState) && "9".equals(invoiceState)){
+				cancellationProcessInstanceId = workInvoiceService.get(workInvoice.getId()).getCancellationProcessInstanceId();
+			}
+			try {
+				Map<String, Object> variables = Maps.newHashMap();
 			/*WorkClientInfo workClientInfo =workClientInfoService.get(workInvoice.getClient().getId());
 			ProjectRecords workProject =projectRecordsService.getRuralProjectRecodes(workInvoice.getProject().getId());
 			workInvoice.setClient(workClientInfo);
 			workInvoice.setProject(workProject);*/
-			workInvoice.setCompanyId(UserUtils.getSelectCompany().getId());
-			workInvoice.setOfficeId(UserUtils.getSelectOffice().getId());
-			String str = "";
-			//1总公司0分公司
-			if("1".equals(workInvoice.getExt())){
-				//str = workInvoiceService.save(workInvoice, variables,processInstanceId);
-				str = workInvoiceService.cancellationBranch(workInvoice, variables,processInstanceId);
-			}else if("0".equals(workInvoice.getExt())){
-				str = workInvoiceService.cancellationBranch(workInvoice, variables,processInstanceId);
-			}
-			if(StringUtils.isNotBlank(workInvoice.getExt())){
-				if (StringUtils.isNotBlank(str)){
-					addMessage(redirectAttributes, "发票作废申请提交失败:"+str);
-				}else {
-					addMessage(redirectAttributes, "发票作废申请已经提交");
+				workInvoice.setCompanyId(UserUtils.getSelectCompany().getId());
+				workInvoice.setOfficeId(UserUtils.getSelectOffice().getId());
+				String str = "";
+				//1总公司0分公司
+				if("1".equals(workInvoice.getExt())){
+					//str = workInvoiceService.save(workInvoice, variables,processInstanceId);
+					str = workInvoiceService.cancellationBranch(workInvoice, variables,cancellationProcessInstanceId);
+				}else if("0".equals(workInvoice.getExt())){
+					str = workInvoiceService.cancellationBranch(workInvoice, variables,cancellationProcessInstanceId);
+				}
+				if(StringUtils.isNotBlank(workInvoice.getExt())){
+					if (StringUtils.isNotBlank(str)){
+						addMessage(redirectAttributes, "发票作废申请提交失败:"+str);
+					}else {
+						addMessage(redirectAttributes, "发票作废申请已经提交");
+					}
 				}
+			} catch (Exception e) {
+				addMessage(redirectAttributes, "发票作废申请提交失败!");
+				logger.error("Exception e:"+e);
 			}
-		} catch (Exception e) {
-			addMessage(redirectAttributes, "发票作废申请提交失败!");
-			logger.error("Exception e:"+e);
-		}
 		}
 		else{
 			addMessage(redirectAttributes, "您不是申请人或财务部成员,无法作废");
@@ -686,48 +689,48 @@ public class WorkInvoiceTwoController extends BaseController {
 	 */
 	@RequestMapping(value = "cancellationSaveAudit")
 	public String cancellationSaveAudit(WorkInvoice workInvoice, Model model,
-							RedirectAttributes redirectAttributes) {
+										RedirectAttributes redirectAttributes) {
 		try{
-		// 对不同环节的业务逻辑进行操作
-		String taskDefKey = workInvoice.getAct().getTaskDefKey();
-		List<User> users = null;
-		//所属部门
-		Office office = officeService.get(workInvoice.getOffice().getId());
-		if ("bmzr".equals(taskDefKey)){
-			if(("1").equals(workInvoice.getExt())) {
-				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 2);
-				if (users == null)
-					users = UserUtils.getByRoleActivityEnname("scfgld", 1, office.getId(), "5", workInvoice.getCreateBy());
-			}else{
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workInvoice.getAct().getTaskDefKey();
+			List<User> users = null;
+			//所属部门
+			Office office = officeService.get(workInvoice.getOffice().getId());
+			if ("bmzr".equals(taskDefKey)){
+				if(("1").equals(workInvoice.getExt())) {
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 2);
+					if (users == null)
+						users = UserUtils.getByRoleActivityEnname("scfgld", 1, office.getId(), "5", workInvoice.getCreateBy());
+				}else{
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+					if (users==null )
+						users = UserUtils.getByRoleActivityEnname("cwzg",3,office.getId(),"5",workInvoice.getCreateBy());
+				}
+			}else  if ("scbzr".equals(taskDefKey)){
 				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
 				if (users==null )
-					users = UserUtils.getByRoleActivityEnname("cwzg",3,office.getId(),"5",workInvoice.getCreateBy());
-			}
-		}else  if ("scbzr".equals(taskDefKey)){
-			users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
-			if (users==null )
-				users = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.getCreateBy());
-		}else  if ("fpgly".equals(taskDefKey)){
-			if(("1").equals(workInvoice.getExt())) {
-				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 3);
-			}else{
-				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),1);
+					users = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("fpgly".equals(taskDefKey)){
+				if(("1").equals(workInvoice.getExt())) {
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 3);
+				}else{
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),1);
+				}
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 1);
 			}
-		}else if ("modifyApply".equals(taskDefKey)){
-			users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 1);
-		}
-		String flag = workInvoice.getAct().getFlag();
-		if ("yes".equals(flag) && (users==null || users.size()==0)){
-			addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
-		}else {
-			String str = "";
-			if(("1").equals(workInvoice.getExt())){
-				str = workInvoiceService.cancellationSaveAudit(workInvoice,users);
-			}else if(("0").equals(workInvoice.getExt())){
-				str = workInvoiceService.cancellationSaveAudit(workInvoice,users);
+			String flag = workInvoice.getAct().getFlag();
+			if ("yes".equals(flag) && (users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = "";
+				if(("1").equals(workInvoice.getExt())){
+					str = workInvoiceService.cancellationSaveAudit(workInvoice,users);
+				}else if(("0").equals(workInvoice.getExt())){
+					str = workInvoiceService.cancellationSaveAudit(workInvoice,users);
+				}
+				addMessage(redirectAttributes, str);
 			}
-			addMessage(redirectAttributes, str);
-		}
 		}catch (Exception e){
 			addMessage(redirectAttributes, "审批失败:");
 			logger.error("Exception e:"+e);
@@ -848,11 +851,11 @@ public class WorkInvoiceTwoController extends BaseController {
 	 * 导出excel文件
 	 */
 	@RequiresPermissions("workinvoiceTwo:workinvoiceTwo:export")
-    @RequestMapping(value = "export", method=RequestMethod.POST)
-    public String exportFile(WorkInvoice workInvoice, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+	@RequestMapping(value = "export", method=RequestMethod.POST)
+	public String exportFile(WorkInvoice workInvoice, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
 		try {
-            String fileName = "发票一览表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-            Page<WorkInvoice> page = workInvoiceService.findListExport(new Page<WorkInvoice>(request, response, -1), workInvoice);
+			String fileName = "发票一览表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+			Page<WorkInvoice> page = workInvoiceService.findListExport(new Page<WorkInvoice>(request, response, -1), workInvoice);
 			List<WorkInvoice> workInvoiceList = page.getList();
 			workInvoiceService.disposeListExport(workInvoiceList);
 
@@ -875,22 +878,22 @@ public class WorkInvoiceTwoController extends BaseController {
 				String projectNameStr = String.join(",", projectNameList);
 				invoice.setProjectName(projectNameStr);*/
 			}
-    		new ExportExcel("发票一览表", WorkInvoiceExport.class).setDataList(page.getList()).write(response, fileName).dispose();
-    		return null;
+			new ExportExcel("发票一览表", WorkInvoiceExport.class).setDataList(page.getList()).write(response, fileName).dispose();
+			return null;
 		} catch (Exception e) {
 			addMessage(redirectAttributes, "导出发票管理记录失败!失败信息:"+e.getMessage());
 			logger.error("Exception e:"+e);
 		}
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
-    }
+	}
 
 	/**
 	 * 导入Excel数据
 
 	 */
 	@RequiresPermissions("workinvoiceTwo:workInvoice:import")
-    @RequestMapping(value = "import", method=RequestMethod.POST)
-    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+	@RequestMapping(value = "import", method=RequestMethod.POST)
+	public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
 		try {
 			int successNum = 0;
 			int failureNum = 0;
@@ -918,25 +921,25 @@ public class WorkInvoiceTwoController extends BaseController {
 			logger.error("Exception e:"+e);
 		}
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
-    }
+	}
 
 	/**
 	 * 下载导入开票管理数据模板
 	 */
 	@RequiresPermissions("workinvoice:workInvoice:import")
-    @RequestMapping(value = "import/template")
-    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+	@RequestMapping(value = "import/template")
+	public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
 		try {
-            String fileName = "发票管理数据导入模板.xlsx";
-    		List<WorkInvoice> list = Lists.newArrayList();
-    		new ExportExcel("发票管理数据", WorkInvoice.class, 1).setDataList(list).write(response, fileName).dispose();
-    		return null;
+			String fileName = "发票管理数据导入模板.xlsx";
+			List<WorkInvoice> list = Lists.newArrayList();
+			new ExportExcel("发票管理数据", WorkInvoice.class, 1).setDataList(list).write(response, fileName).dispose();
+			return null;
 		} catch (Exception e) {
 			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
 			logger.error("Exception e:"+e);
 		}
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
-    }
+	}
 
 
 	/**
@@ -1294,7 +1297,7 @@ public class WorkInvoiceTwoController extends BaseController {
 	@RequestMapping(value = "applyOnWorkInvoice")
 	public String applyOnWorkInvoice(Act act, HttpServletResponse response, Model model) {
 		// 获取流程XML上的表单KEY
-			String formKey = "/workinvoice/workInvoice/form";
+		String formKey = "/workinvoice/workInvoice/form";
 		//logger.info("------formKeys:"+formKeys);
 		// 获取流程实例对象
 		if (act.getProcInsId() != null){
@@ -1336,6 +1339,16 @@ public class WorkInvoiceTwoController extends BaseController {
 	}
 
 	/**
+	 * 读取单个作废实体流程
+	 * @return
+	 */
+	@RequestMapping(value = "getCancellationProcess")
+	public String getCancellationProcess(WorkInvoice workInvoice,Model model) {
+		model.addAttribute("processInstanceId", workInvoice.getCancellationProcessInstanceId());
+		return "modules/workinvoice/workInvoiceTask";
+	}
+
+	/**
 	 * 撤销
 	 */
 	@RequestMapping("cancelInvalidate")
@@ -1518,7 +1531,7 @@ public class WorkInvoiceTwoController extends BaseController {
 		//return "redirect:" + adminPath + "/act/task";
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
 	}
-/*--------------------------分割线---------------------------------*/
+	/*--------------------------分割线---------------------------------*/
 
 
 

Разница между файлами не показана из-за своего большого размера
+ 413 - 458
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java


+ 127 - 0
src/main/resources/mappings/modules/identification/PersonOpinionDao.xml

@@ -0,0 +1,127 @@
+<?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.identification.dao.PersonOpinionDao">
+    <sql id="auditColumns">
+		distinct a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.name AS "name",
+		a.identification as "identification",
+		a.content as "content",
+		a.office_id as "officeId"
+	</sql>
+
+    <select id="get" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
+        SELECT
+        <include refid="auditColumns"/>
+        FROM audit_template a
+        WHERE a.id = #{id}
+    </select>
+    <select id="findList" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
+        SELECT
+        <include refid="auditColumns"/>
+        FROM audit_template a
+        <where>
+            a.del_flag='0'
+            <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+                ${sqlMap.dsf}
+            </if>
+            <if test="name !=null and name != ''">
+                and a.name like concat('%',#{name},'%')
+            </if>
+            <if test="content !=null and content != ''">
+                and a.content like concat('%',#{content},'%')
+            </if>
+            <if test="createBy!=null and createBy!=''">
+                <if test="createBy.id!=null and createBy.id!=''">
+                    And a.create_by = #{createBy.id}
+                </if>
+            </if>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+    <select id="queryCount" resultType="int" >
+        SELECT
+        count(distinct a.id)
+        FROM audit_template a
+        <where>
+            a.del_flag='0'
+            <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+                ${sqlMap.dsf}
+            </if>
+            <if test="name !=null and name != ''">
+                and a.name like concat('%',#{name},'%')
+            </if>
+            <if test="content !=null and content != ''">
+                and a.content like concat('%',#{content},'%')
+            </if>
+            <if test="createBy!=null and createBy!=''">
+                <if test="createBy.id!=null and createBy.id!=''">
+                    And a.create_by = #{createBy.id}
+                </if>
+            </if>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <insert id="insert">
+		INSERT INTO audit_template(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			name,
+			identification,
+			content,
+			office_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{delFlag},
+			#{name},
+			#{identification},
+			#{content},
+			#{createBy.office.id}
+		)
+	</insert>
+
+    <update id="update">
+		UPDATE audit_template SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			identification=#{identification},
+			name = #{name},
+			content=#{content}
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM audit_template
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 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>

+ 35 - 80
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -67,7 +67,9 @@
 		a.new_drawer as "newDrawer",
 		a.actual_drawer_email_address as "actualDrawerEmailAddress",
 		a.actual_drawer_id as "actualDrawerId",
-		a.electronic_invoice_flag as "electronicInvoiceFlag"
+		a.electronic_invoice_flag as "electronicInvoiceFlag",
+		a.cancellation_process_instance_id as "cancellationProcessInstanceId",
+		a.cancellation_state as "cancellationState"
 	</sql>
 
 	<sql id="newWorkInvoiceColumns">
@@ -492,7 +494,7 @@
 				<if test="dbName == 'mysql'">concat('%',#{number},'%')</if>
 			</if>
 			<if test="invoiceState != null and invoiceState != ''">
-				AND a.invoice_state = #{invoiceState}
+				AND a.invoice_state = #{invoiceState} or a.cancellation_state = #{invoiceState}
 			</if>
 			<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
 				AND a.invoice_date BETWEEN #{beginContractDate} AND #{endContractDate}
@@ -1119,15 +1121,12 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
-			<!--<if test="officeId != null and officeId != ''">
+			<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
-			</if>-->
+			</if>
 			<if test="money != null and money != ''">
 				AND a.money = #{money}
 			</if>
-			<!--<if test="submitterId != null and submitterId != ''">
-				AND a.create_by = #{submitterId}
-			</if>-->
 			<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
 				AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
 			</if>
@@ -1149,20 +1148,14 @@
 			<if test="companyId != null and companyId != ''">
 				AND a.company_id = #{companyId}
 			</if>
-			<!--<if test="office != null and office.id != null and office.id != ''">
+			<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
-			</if>-->
-			<if test="officeIdList!=null and officeIdList.size!=0">
-				and a.office_id in
-				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
-					#{officeId}
-				</foreach>
 			</if>
 			<if test="invoiceNumber != null and invoiceNumber != ''">
 				AND a.invoice_number LIKE
-				<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
+					<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
 			</if>
 			<if test="invoiceDate != null and invoiceDate != ''">
 				AND a.invoice_date = #{invoiceDate}
@@ -1188,7 +1181,7 @@
 				)
 			</if>
 			<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
-				AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
+				AND (a.account_checking_user_id = #{accountCheckingUserId} or acu.name like concat('%',#{accountCheckingUserName},'%'))
 			</if>
 			<if test="widNumber != null and widNumber != ''">
 				AND wid.number LIKE
@@ -1196,35 +1189,6 @@
 				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
 			</if>
-			<if test="newDrawerId != null and newDrawerId != ''">
-				and new_drawer_id like
-				<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
-			</if>
-			<if test="newDrawer != null and newDrawer != ''">
-				and new_drawer like
-				<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
-			</if>
-			<if test="projectName != null and projectName != ''">
-				and (wipr.details like
-				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
-				or rpr.project_name like
-				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
-				)
-			</if>
-			<if test="reportNumber != null and reportNumber != ''">
-				and prds.number like
-				<if test="dbName == 'oracle'">'%'||#{reportNumber}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{reportNumber}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{reportNumber},'%')</if>
-			</if>
 			${sqlMap.dsf}
 		</where>
 	) as x
@@ -1262,7 +1226,7 @@
 				<if test="dbName == 'mysql'">concat('%',#{number},'%')</if>
 			</if>
 			<if test="invoiceState != null and invoiceState != ''">
-				AND a.invoice_state = #{invoiceState}
+				AND a.invoice_state = #{invoiceState} or a.cancellation_state = #{invoiceState}
 			</if>
 			<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
 				AND a.invoice_date BETWEEN #{beginContractDate} AND #{endContractDate}
@@ -1308,8 +1272,11 @@
 			<!--<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
 			</if>-->
-			<if test="money != null and money != ''">
-				AND a.money = #{money}
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<!--<if test="submitterId != null and submitterId != ''">
 				AND a.create_by = #{submitterId}
@@ -1320,6 +1287,9 @@
 			<if test="receiptMoney != null and receiptMoney != ''">
 				AND a.receipt_money = #{receiptMoney}
 			</if>
+			<if test="money != null and money != ''">
+				AND a.money = #{money}
+			</if>
 			<if test="invoiceType != null and invoiceType != ''">
 				AND a.invoice_type = #{invoiceType}
 			</if>
@@ -1335,14 +1305,11 @@
 			<if test="companyId != null and companyId != ''">
 				AND a.company_id = #{companyId}
 			</if>
-			<!--<if test="office != null and office.id != null and office.id != ''">
+			<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
-			</if>-->
-			<if test="officeIdList!=null and officeIdList.size!=0">
-				and a.office_id in
-				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
-					#{officeId}
-				</foreach>
+			</if>
+			<if test="billingContent != null and billingContent != ''">
+				AND a.billing_content = #{billingContent}
 			</if>
 			<if test="invoiceNumber != null and invoiceNumber != ''">
 				AND a.invoice_number LIKE
@@ -1362,9 +1329,6 @@
 			<if test="isInvalid != null and isInvalid != ''">
 				AND a.is_invalid = #{isInvalid}
 			</if>
-			<if test="billingContent != null and billingContent != ''">
-				AND a.billing_content = #{billingContent}
-			</if>
 			<if test="area != null and area.id != null and area.id != ''">
 				AND (a.area_parent_id LIKE
 				<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
@@ -1382,18 +1346,6 @@
 				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
 			</if>
-			<if test="newDrawerId != null and newDrawerId != ''">
-				and new_drawer_id like
-				<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
-			</if>
-			<if test="newDrawer != null and newDrawer != ''">
-				and new_drawer like
-				<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
-			</if>
 			<if test="projectName != null and projectName != ''">
 				and (wipr.details like
 				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
@@ -1600,6 +1552,12 @@
 		WHERE id = #{id}
 	</update>
 
+	<update id="updateCancellationProcessInstanceId">
+		UPDATE work_invoice SET
+			cancellation_process_instance_id = #{cancellationProcessInstanceId}
+		WHERE id = #{id}
+	</update>
+
 	<insert id="insert">
 		INSERT INTO work_invoice(
 			id,
@@ -1739,13 +1697,9 @@
 			new_drawer_id = #{newDrawerId},
 			actual_drawer_email_address = #{actualDrawerEmailAddress},
 			new_drawer = #{newDrawer},
-			actual_drawer_id = #{actualDrawerId}
-			<if test="null != auditPassDate">
-				,audit_pass_date = #{auditPassDate}
-			</if>
-			<if test="null != cancellationAuditPassDate">
-				,cancellation_audit_pass_date = #{cancellationAuditPassDate}
-			</if>
+			actual_drawer_id = #{actualDrawerId},
+			cancellation_process_instance_id = #{cancellationProcessInstanceId},
+			cancellation_state = #{cancellationState}
 		WHERE id = #{id}
 	</update>
 	<update id="updateDate">
@@ -1771,7 +1725,8 @@
 	<!--逻辑删除-->
 	<update id="cancellationDelete">
 		UPDATE work_invoice SET
-			invoice_state=5
+			cancellation_process_instance_id='',
+			cancellation_state = 0
 		WHERE id = #{id}
 	</update>
 

+ 24 - 0
src/main/webapp/static/common/jeeplus.js

@@ -616,6 +616,30 @@ function getWorkInvoiceAuditState(id)
     return result;
 }
 
+function getCancellationAuditState(id)
+{
+    var result ={};
+    result.action = true;
+    switch(id)
+    {
+        case "0":result.label = "tempstore";result.status="未作废";result.action = false;break;
+        case "1":result.label = "tempstore";result.status="暂存";result.action = false;break;
+        case "2":result.label = "auditing";result.status="审批中";break;
+        case "3":result.label = "cancel";result.status="撤回";break;
+        case "4":result.label = "reject";result.status="驳回";break;
+        case "5":result.label = "signed";result.status="已完成";break;
+        case "6":result.label = "auditing";result.status="作废中";break;
+        case "7":result.label = "signed";result.status="作废";break;
+        case "9":result.label = "reject";result.status="作废驳回";break;
+        case "8":result.label = "changing";result.status="变更中";break;
+        case "10":result.label = "signed";result.status="无复核";result.action = false;break;
+        case "11":result.label = "cancel";result.status="作废撤回";break;
+        default:
+            result.label = "unknown";result.status="未作废";break;
+    }
+    return result;
+}
+
 function getReportIssueState(id)
 {
     var result ={};

+ 103 - 0
src/main/webapp/webpage/modules/personOpinion/personOpinionAddForm.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}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <style>
+        label.error{
+            top:40px;
+            left:0;
+        }
+        #standardDetail-error{
+            top:82px;
+            left:0;
+        }
+    </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;
+                form.on('select(identification)', function(data){
+                    $("#name").val(this.innerHTML)
+                });
+            });
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    // loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            var edit = "${workReviewStandard.id}";
+            if(edit!=null && edit!=''){
+                $("#reviewParentButton").attr("disabled","disabled");
+            }
+        });
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="auditTemplate" action="${ctx}/personOpinion/personOpinion/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="createBy.name" readonly="true"  htmlEscape="false" class="form-control layui-input"/>
+            <form:hidden path="name" id="name" readonly="true" htmlEscape="false"  class="form-control layui-input"/>
+            <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">模板类型:</label>
+                    <div class="layui-input-block">
+                        <select name="identification" lay-filter="identification" >
+                            <option value=""></option>
+                            <option value="workreimbursement" <c:if test="${auditTemplate.identification=='workreimbursement'}">selected</c:if> >报销审核意见</option>
+                            <option value="workinvoice" <c:if test="${auditTemplate.identification=='workinvoice'}">selected</c:if> >发票审核意见</option>
+                            <option value="oaNotify" <c:if test="${auditTemplate.identification=='oaNotify'}">selected</c:if> >公告审核意见</option>
+                            <option value="workContractInfo" <c:if test="${auditTemplate.identification=='workContractInfo'}">selected</c:if> >合同审核意见</option>
+                            <option value="workContractRecord" <c:if test="${auditTemplate.identification=='workContractRecord'}">selected</c:if> >合同归档审核意见</option>
+                            <option value="workContractBorrow" <c:if test="${auditTemplate.identification=='workContractBorrow'}">selected</c:if> >合同借用审核意见</option>
+                            <option value="ruralprojectrecords" <c:if test="${auditTemplate.identification=='ruralprojectrecords'}">selected</c:if> >项目登记审核意见</option>
+                            <option value="projectReportDataLeader" <c:if test="${auditTemplate.identification=='projectReportDataLeader'}">selected</c:if> >新增报告项目组成员审核意见</option>
+                            <option value="projectReportData" <c:if test="${auditTemplate.identification=='projectReportData'}">selected</c:if> >报告审核意见</option>
+                            <option value="projectcontentinfoFile"<c:if test="${auditTemplate.identification=='projectcontentinfoFile'}">selected</c:if>>归档审核意见</option>
+                            <option value="ruralprojectrecordsCheck" <c:if test="${auditTemplate.identification=='ruralprojectrecordsCheck'}">selected</c:if> >选查审核意见</option>
+                            <option value="projectFilingBatch" <c:if test="${auditTemplate.identification=='projectFilingBatch'}">selected</c:if> >批量归档审核意见</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label ">模板信息:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="content" placeholder="请输入模板信息" id="content" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+                    </div>
+                </div>
+            </div>
+        </form:form>
+    </div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+
+</script>
+</body>
+</html>

+ 205 - 0
src/main/webapp/webpage/modules/personOpinion/personOpinionList.jsp

@@ -0,0 +1,205 @@
+<%@ 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}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <style>
+        label.error{
+            top:40px;
+            left:0;
+        }
+        #standardDetail-error{
+            top:82px;
+            left:0;
+        }
+    </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){
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            $("#cus_name").show();
+            $("#cus_name").siblings().hide();
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow4);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow4);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+        });
+        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){
+                    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
+                    }
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){
+                            location = '${ctx}/personOpinion/personOpinion/list';
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index){
+                }
+            });
+        }
+        function deleteByid(mess, href) {
+            top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+                if (typeof href == 'function') {
+                    href();
+                }else{
+                    resetTip(); //loading();
+                    $.ajax({
+                        url:href,
+                        type:"post",
+                        success:function(data){
+                            parent.layer.msg(data,{icon:1});
+                            rereset();
+                        }
+                    });
+                }
+                top.layer.close(index);
+            });
+            return false;
+        }
+        function rereset(){//重置,页码清零
+            $("#pageNo").val(0);
+            $("#inputForm div.query input").val("");
+            $("#inputForm div.query select").val("");
+            $("#inputForm").submit();
+            return false;
+        }
+        function page(n,s){//翻页
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#inputForm").submit();
+            $("span.page-size").text(s);
+            return false;
+        }
+    </script>
+</head>
+<body>
+
+<form:form id="inputForm"  modelAttribute="auditTemplate"  action="${ctx}/personOpinion/personOpinion/" 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}"/>
+    <div class="commonQuery lw6" style="margin-bottom: 20px;">
+        <div class="layui-item query athird">
+            <label class="layui-form-label">模板类型:</label>
+            <div class="layui-input-block">
+                <form:input path="name" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+            </div>
+        </div>
+        <div class="layui-item query athird">
+            <label class="layui-form-label">模板内容:</label>
+            <div class="layui-input-block">
+                <form:input path="content" htmlEscape="false" maxlength="64"   class=" form-control layui-input"/>
+            </div>
+        </div>
+        <div class="layui-item athird">
+            <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="rereset()">重置</button>
+            </div>
+        </div>
+        <div style="clear:both;"></div>
+    </div>
+    <div class="single-form">
+        <div class="container" style="width: 98%">
+            <div class="nav-btns">
+                <div class="layui-btn-group" style="float: left">
+                    <button class="layui-btn layui-btn-sm layui-bg-blue" onclick="openDialogre('添加模板', '${ctx}/personOpinion/personOpinion/toAddSave','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">
+                <thead>
+                    <th width="20%">模板类型</th>
+                    <th width="40%">模板</th>
+                    <th width="20%">创建人</th>
+                    <th width="20%">操作</th>
+                </thead>
+                <tbody>
+                    <c:forEach items="${page.list}" var="tem">
+                        <tr align="center" >
+                            <td>${tem.name}</td>
+                            <td><span title="${tem.content}">${tem.content}</span></td>
+                            <td>${tem.createBy.name}</td>
+                            <td>
+                                <div class="layui-btn-group">
+                                    <div class="op-btn-box">
+                                        <a href="${ctx}/personOpinion/personOpinion/delete?id=${tem.id}" onclick="return deleteByid('确认要删除该审核模板吗?', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除</a>
+                                    </div>
+                                    <div class="op-btn-box">
+                                        <a style="color: white" onclick="openDialogre('修改模板', '${ctx}/personOpinion/personOpinion/toAddSave?id=${tem.id}','80%', '70%','','修改,关闭')" class="layui-btn layui-btn-xs" >修改</a>
+                                    </div>
+                                </div>
+                            </td>
+                        </tr>
+                    </c:forEach>
+                </tbody>
+            </table>
+            <!-- 分页代码 -->
+            <table:page page="${page}"></table:page>
+        </div>
+    </div>
+</form:form>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+
+</script>
+</body>
+</html>

+ 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>

Разница между файлами не показана из-за своего большого размера
+ 527 - 514
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp