浏览代码

文件审批功能及其他bug功能修复

xianwait 2 年之前
父节点
当前提交
7a687d992e
共有 29 个文件被更改,包括 596 次插入354 次删除
  1. 34 34
      willalp-admin/src/main/java/com/willalp/WillalpApplication.java
  2. 15 33
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppFLowController.java
  3. 4 2
      willalp-admin/src/main/java/com/willalp/web/controller/app/AppTwoController.java
  4. 2 1
      willalp-admin/src/main/java/com/willalp/web/controller/app/CustomController.java
  5. 44 15
      willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java
  6. 15 31
      willalp-admin/src/main/java/com/willalp/web/controller/common/CommonController.java
  7. 16 15
      willalp-admin/src/main/java/com/willalp/web/controller/system/HsPostConfigController.java
  8. 4 4
      willalp-admin/src/main/resources/application-dev.yml
  9. 2 2
      willalp-admin/src/main/resources/application.yml
  10. 3 2
      willalp-admin/src/main/resources/logback.xml
  11. 8 0
      willalp-clocking-in/src/main/java/com/willalp/flow/domain/HsFlowTask.java
  12. 3 1
      willalp-clocking-in/src/main/java/com/willalp/flow/domain/enums/FlowEnum.java
  13. 79 0
      willalp-clocking-in/src/main/java/com/willalp/flow/domain/vo/FileApprovalVo.java
  14. 3 1
      willalp-clocking-in/src/main/java/com/willalp/flow/mapper/HsFlowTaskMapper.java
  15. 12 1
      willalp-clocking-in/src/main/java/com/willalp/flow/mapper/xml/HsFlowTaskMapper.xml
  16. 11 3
      willalp-clocking-in/src/main/java/com/willalp/flow/service/HsFlowEngineService.java
  17. 67 41
      willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/HsFlowEngineServiceImpl.java
  18. 15 0
      willalp-clocking-in/src/main/java/com/willalp/msg/service/IHsAppUserMsgService.java
  19. 22 4
      willalp-clocking-in/src/main/java/com/willalp/msg/service/impl/HsAppUserMsgServiceImpl.java
  20. 7 4
      willalp-clocking-in/src/main/java/com/willalp/wx/domain/WxMsgTemplateApproval.java
  21. 19 2
      willalp-clocking-in/src/main/java/com/willalp/wx/service/WxMsgService.java
  22. 13 0
      willalp-clocking-in/src/main/java/com/willalp/wx/service/impl/WxMsgServiceImpl.java
  23. 4 3
      willalp-clocking-in/src/main/java/com/willalp/wx/utils/WxUtils.java
  24. 58 67
      willalp-common/src/main/java/com/willalp/common/utils/file/FileUploadUtils.java
  25. 22 18
      willalp-framework/src/main/java/com/willalp/framework/config/ThreadPoolConfig.java
  26. 2 2
      willalp-system/src/main/java/com/willalp/system/domain/vo/PostTreeVo.java
  27. 10 6
      willalp-system/src/main/java/com/willalp/system/service/impl/HsPostConfigServiceImpl.java
  28. 9 1
      willalp-ui/src/api/system/postConfig.js
  29. 93 61
      willalp-ui/src/views/files/approval/index.vue

+ 34 - 34
willalp-admin/src/main/java/com/willalp/WillalpApplication.java

@@ -75,39 +75,39 @@ public class WillalpApplication extends SpringBootServletInitializer implements
         return connector;
         return connector;
     }
     }
 
 
-//
-//    /**
-//     * http重定向到https
-//     *
-//     * @return
-//     */
-//    @Bean
-//    public TomcatServletWebServerFactory servletContainer() {
-//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
-//            @Override
-//            protected void postProcessContext(Context context) {
-//                SecurityConstraint constraint = new SecurityConstraint();
-//                constraint.setUserConstraint("CONFIDENTIAL");
-//                SecurityCollection collection = new SecurityCollection();
-//                collection.addPattern("/*");
-//                constraint.addCollection(collection);
-//                context.addConstraint(constraint);
-//            }
-//        };
-//        tomcat.addAdditionalTomcatConnectors(httpConnector());
-//        return tomcat;
-//    }
-//
-//    @Bean
-//    public Connector httpConnector() {
-//        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
-//        connector.setScheme("http");
-//        //Connector监听的http的默认端口号
-//        connector.setPort(8080);
-//        connector.setSecure(false);
-//        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
-//        connector.setRedirectPort(3005);
-//        return connector;
-//    }
+
+    /*
+    /**
+     * http重定向到https
+     *
+     * @return
+    @Bean
+    public TomcatServletWebServerFactory servletContainer() {
+        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
+            @Override
+            protected void postProcessContext(Context context) {
+                SecurityConstraint constraint = new SecurityConstraint();
+                constraint.setUserConstraint("CONFIDENTIAL");
+                SecurityCollection collection = new SecurityCollection();
+                collection.addPattern("/*");
+                constraint.addCollection(collection);
+                context.addConstraint(constraint);
+            }
+        };
+        tomcat.addAdditionalTomcatConnectors(httpConnector());
+        return tomcat;
+    }
+
+    @Bean
+    public Connector httpConnector() {
+        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
+        connector.setScheme("http");
+        //Connector监听的http的默认端口号
+        connector.setPort(8080);
+        connector.setSecure(false);
+        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
+        connector.setRedirectPort(3005);
+        return connector;
+    }*/
 
 
 }
 }

+ 15 - 33
willalp-admin/src/main/java/com/willalp/web/controller/app/AppFLowController.java

@@ -13,10 +13,7 @@ import com.willalp.flow.domain.HsFlowTask;
 import com.willalp.flow.domain.req.FLowReq;
 import com.willalp.flow.domain.req.FLowReq;
 import com.willalp.flow.service.HsFlowEngineService;
 import com.willalp.flow.service.HsFlowEngineService;
 import com.willalp.flow.service.IBizLeaveImgService;
 import com.willalp.flow.service.IBizLeaveImgService;
-import com.willalp.msg.domain.HsAppUserMsg;
 import com.willalp.msg.service.IHsAppUserMsgService;
 import com.willalp.msg.service.IHsAppUserMsgService;
-import com.willalp.wx.domain.WxMsgTemplateApproval;
-import com.willalp.wx.enums.WxTemplateKeyEnum;
 import com.willalp.wx.service.WxMsgService;
 import com.willalp.wx.service.WxMsgService;
 import com.willalp.wx.utils.WxUtils;
 import com.willalp.wx.utils.WxUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
@@ -35,10 +32,10 @@ public class AppFLowController extends BaseController {
     private IBizLeaveService bizLeaveService;
     private IBizLeaveService bizLeaveService;
 
 
     @Resource
     @Resource
-    private HsFlowEngineService flowEngineService;
+    private IBizLeaveImgService leaveImgService;
 
 
     @Resource
     @Resource
-    private IBizLeaveImgService leaveImgService;
+    private HsFlowEngineService flowEngineService;
 
 
     @Resource
     @Resource
     private WxMsgService wxMsgService;
     private WxMsgService wxMsgService;
@@ -68,31 +65,22 @@ public class AppFLowController extends BaseController {
             leaveImgService.saveBatch(leave.getImgUrls());
             leaveImgService.saveBatch(leave.getImgUrls());
         }
         }
         bizLeaveService.insertBizLeave(leave);
         bizLeaveService.insertBizLeave(leave);
-        Map<String, String> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         if (null != leave.getCandidate()) {
         if (null != leave.getCandidate()) {
             map.put("candidate", leave.getCandidate());
             map.put("candidate", leave.getCandidate());
             map.put("user", leave.getApplyUserId());
             map.put("user", leave.getApplyUserId());
         }
         }
         flowEngineService.submitATask(new HsFlowTask(taskId, idStr, "1580107848471093250"), map);
         flowEngineService.submitATask(new HsFlowTask(taskId, idStr, "1580107848471093250"), map);
-        //生成审批结果消息列表
-        HsAppUserMsg appUserMsg = new HsAppUserMsg();
+        //
         StringBuffer content = new StringBuffer();
         StringBuffer content = new StringBuffer();
         content.append("<p>标题:").append(leave.getTitle()).append("</p>")
         content.append("<p>标题:").append(leave.getTitle()).append("</p>")
                 .append("<p>申请人:").append(leave.getApplyUserName()).append("</p>")
                 .append("<p>申请人:").append(leave.getApplyUserName()).append("</p>")
                 .append("<p>开始时间:").append(DateUtils.parseDateToStr("yyyy-MM-dd", leave.getLeaveStartTime())).append("</p>")
                 .append("<p>开始时间:").append(DateUtils.parseDateToStr("yyyy-MM-dd", leave.getLeaveStartTime())).append("</p>")
                 .append("<p>结束时间:").append(DateUtils.parseDateToStr("yyyy-MM-dd", leave.getLeaveEndTime())).append("</p>");
                 .append("<p>结束时间:").append(DateUtils.parseDateToStr("yyyy-MM-dd", leave.getLeaveEndTime())).append("</p>");
-        appUserMsg.setMsgContent(content.toString());
-        appUserMsg.setMsgIsRead("0");
-        appUserMsg.setUserCode(leave.getCandidate());
-        appUserMsg.setMsgType("1");
-        appUserMsg.setRemark(taskId);
-        appUserMsg.setCreateTime(new Date());
-        userMsgService.save(appUserMsg);
-        WxMsgTemplateApproval wxMsgTemplateApproval = new WxMsgTemplateApproval();
-        wxMsgTemplateApproval.setThing5(wxUtils.getFormat(leave.getTitle()));
-        wxMsgTemplateApproval.setThing11(wxUtils.getFormat(leave.getApplyUserName()));
-        wxMsgTemplateApproval.setTime12(wxUtils.getFormat(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", leave.getApplyTime())));
-        wxMsgService.sendQRCodeMsg(leave.getCandidate(), wxMsgTemplateApproval, WxTemplateKeyEnum.APPROVAL_WAIT, true);
+        //异步生成审批消息列表
+        userMsgService.saveApprovalMsgAndPush("1",
+                leave.getTitle(), content, taskId,
+                leave.getCandidate(), leave.getApplyUserName(), leave.getApplyTime());
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
 
 
@@ -165,21 +153,13 @@ public class AppFLowController extends BaseController {
     }
     }
 
 
     /**
     /**
-     * 查询请假记录
+     * 获取所有发起审批
      */
      */
-    @GetMapping("/leaveList")
-    public TableDataInfo list(BizLeave bizLeave) {
+    @GetMapping("/initiator")
+    public TableDataInfo initiatorList(HttpServletRequest request) {
         startPage();
         startPage();
-        List<BizLeave> list = bizLeaveService.selectPersonnelList(bizLeave);
-        List<BizLeave> bizLeaves = new ArrayList<>();
-        list.forEach(i -> {
-            List<BizLeaveImg> leaveImgs = leaveImgService.getBaseMapper()
-                    .selectList(new QueryWrapper<BizLeaveImg>()
-                            .eq("biz_leave_id", i.getId()));
-            i.imgUrls = leaveImgs;
-            bizLeaves.add(i);
-        });
-        return getDataTable(bizLeaves);
+        return getDataTable(
+                flowEngineService.getInitiator(request.getHeader("UserName")));
     }
     }
 
 
 
 
@@ -209,4 +189,6 @@ public class AppFLowController extends BaseController {
         return toAjax(
         return toAjax(
                 flowEngineService.revoke(taskId));
                 flowEngineService.revoke(taskId));
     }
     }
+
+
 }
 }

+ 4 - 2
willalp-admin/src/main/java/com/willalp/web/controller/app/AppTwoController.java

@@ -96,8 +96,10 @@ public class AppTwoController extends BaseController {
     public AjaxResult readTask(String id) {
     public AjaxResult readTask(String id) {
         if (StringUtils.isNotBlank(id)) {
         if (StringUtils.isNotBlank(id)) {
             BizLeave byId = bizLeaveService.getById(id);
             BizLeave byId = bizLeaveService.getById(id);
-            byId.setRemark("");
-            bizLeaveService.updateById(byId);
+            if (byId != null) {
+                byId.setRemark("");
+                bizLeaveService.updateById(byId);
+            }
         }
         }
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }

+ 2 - 1
willalp-admin/src/main/java/com/willalp/web/controller/app/CustomController.java

@@ -130,6 +130,8 @@ public class CustomController extends BaseController {
                             type = HS_CODE;
                             type = HS_CODE;
                             dataStr = bodyText;
                             dataStr = bodyText;
                             LOG.debug("使用HS码:" + bodyText);
                             LOG.debug("使用HS码:" + bodyText);
+                        } else {
+                            return AjaxResult.error("无效二维码,请使用[HS码]再次扫描");
                         }
                         }
 //                        else if (length > 86) {
 //                        else if (length > 86) {
 //                            //同时刷卡扫码
 //                            //同时刷卡扫码
@@ -148,7 +150,6 @@ public class CustomController extends BaseController {
                     jsonObject.put("type", type);
                     jsonObject.put("type", type);
                     jsonObject.put("data", dataStr);
                     jsonObject.put("data", dataStr);
                     redisCache.setCacheObject(dn, jsonObject, 20, TimeUnit.SECONDS);
                     redisCache.setCacheObject(dn, jsonObject, 20, TimeUnit.SECONDS);
-                    return AjaxResult.error("无效二维码,请使用[HS码]再次扫描");
                 } catch (Exception e) {
                 } catch (Exception e) {
                     e.printStackTrace();
                     e.printStackTrace();
                 }
                 }

+ 44 - 15
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/FileApprovalController.java

@@ -1,5 +1,7 @@
-package com.willalp.flow.controller;
+package com.willalp.web.controller.clockingin;
 
 
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.annotation.Log;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.controller.BaseController;
 import com.willalp.common.core.domain.AjaxResult;
 import com.willalp.common.core.domain.AjaxResult;
@@ -9,7 +11,13 @@ import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.SecurityUtils;
 import com.willalp.common.utils.SecurityUtils;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.common.utils.poi.ExcelUtil;
 import com.willalp.flow.domain.FileApproval;
 import com.willalp.flow.domain.FileApproval;
+import com.willalp.flow.domain.HsFlowTask;
+import com.willalp.flow.domain.vo.FileApprovalVo;
+import com.willalp.flow.service.HsFlowEngineService;
 import com.willalp.flow.service.IFileApprovalService;
 import com.willalp.flow.service.IFileApprovalService;
+import com.willalp.msg.service.IHsAppUserMsgService;
+import com.willalp.wx.service.WxMsgService;
+import com.willalp.wx.utils.WxUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -25,18 +33,29 @@ import java.util.List;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/flow/accessory")
 @RequestMapping("/flow/accessory")
-public class FileApprovalController extends BaseController
-{
+public class FileApprovalController extends BaseController {
     @Resource
     @Resource
     private IFileApprovalService fileApprovalService;
     private IFileApprovalService fileApprovalService;
 
 
+    @Resource
+    private HsFlowEngineService flowEngineService;
+
+    @Resource
+    private WxMsgService wxMsgService;
+
+    @Resource
+    private WxUtils wxUtils;
+
+    @Resource
+    private IHsAppUserMsgService userMsgService;
+
+
     /**
     /**
      * 查询文件审批业务列表
      * 查询文件审批业务列表
      */
      */
     @PreAuthorize("@ss.hasPermi('flow:accessory:list')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:list')")
     @GetMapping("/list")
     @GetMapping("/list")
-    public TableDataInfo list(FileApproval fileApproval)
-    {
+    public TableDataInfo list(FileApproval fileApproval) {
         startPage();
         startPage();
         List<FileApproval> list = fileApprovalService.selectFileApprovalList(fileApproval);
         List<FileApproval> list = fileApprovalService.selectFileApprovalList(fileApproval);
         return getDataTable(list);
         return getDataTable(list);
@@ -48,8 +67,7 @@ public class FileApprovalController extends BaseController
     @PreAuthorize("@ss.hasPermi('flow:accessory:export')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:export')")
     @Log(title = "文件审批业务", businessType = BusinessType.EXPORT)
     @Log(title = "文件审批业务", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     @GetMapping("/export")
-    public AjaxResult export(FileApproval fileApproval)
-    {
+    public AjaxResult export(FileApproval fileApproval) {
         List<FileApproval> list = fileApprovalService.selectFileApprovalList(fileApproval);
         List<FileApproval> list = fileApprovalService.selectFileApprovalList(fileApproval);
         ExcelUtil<FileApproval> util = new ExcelUtil<FileApproval>(FileApproval.class);
         ExcelUtil<FileApproval> util = new ExcelUtil<FileApproval>(FileApproval.class);
         return util.exportExcel(list, "文件审批业务数据");
         return util.exportExcel(list, "文件审批业务数据");
@@ -60,8 +78,7 @@ public class FileApprovalController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('flow:accessory:query')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:query')")
     @GetMapping(value = "/{id}")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(fileApprovalService.getById(id));
         return AjaxResult.success(fileApprovalService.getById(id));
     }
     }
 
 
@@ -71,12 +88,26 @@ public class FileApprovalController extends BaseController
     @PreAuthorize("@ss.hasPermi('flow:accessory:add')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:add')")
     @Log(title = "文件审批业务", businessType = BusinessType.INSERT)
     @Log(title = "文件审批业务", businessType = BusinessType.INSERT)
     @PostMapping
     @PostMapping
-    public AjaxResult add(@RequestBody FileApproval fileApproval)
-    {
+    public AjaxResult add(@RequestBody FileApprovalVo fileApprovalVo) {
+        FileApproval fileApproval = new FileApproval();
+        fileApproval.setFileList(JSON.toJSONString(fileApprovalVo.getFileList()));
+        fileApproval.setImgList(JSON.toJSONString(fileApprovalVo.getImgList()));
+        fileApproval.setParams(fileApprovalVo.getParams());
+        fileApproval.setTitle(fileApprovalVo.getTitle());
         fileApproval.setApplyUserId(getUsername());
         fileApproval.setApplyUserId(getUsername());
         fileApproval.setApplyUserName(getLoginUser().getUser().getNickName());
         fileApproval.setApplyUserName(getLoginUser().getUser().getNickName());
         fileApproval.setCreateBy(SecurityUtils.getUsername());
         fileApproval.setCreateBy(SecurityUtils.getUsername());
         fileApproval.setCreateTime(DateUtils.getNowDate());
         fileApproval.setCreateTime(DateUtils.getNowDate());
+        String idStr = IdWorker.getIdStr();
+        fileApproval.setId(idStr);
+        flowEngineService.submitATask(new HsFlowTask(idStr, idStr, "1600773666636759041"), fileApproval.getParams());
+        StringBuffer content = new StringBuffer();
+        content.append("<p>标题:").append(fileApproval.getTitle()).append("</p>")
+                .append("<p>申请人:").append(fileApproval.getApplyUserName()).append("</p>");
+        //异步生成审批消息列表
+        userMsgService.saveApprovalMsgAndPush("5",
+                fileApproval.getTitle(), content, idStr,
+                String.valueOf(fileApproval.getParams().get("candidate")), fileApproval.getApplyUserName(), fileApproval.getCreateTime());
         return toAjax(fileApprovalService.save(fileApproval));
         return toAjax(fileApprovalService.save(fileApproval));
     }
     }
 
 
@@ -86,8 +117,7 @@ public class FileApprovalController extends BaseController
     @PreAuthorize("@ss.hasPermi('flow:accessory:edit')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:edit')")
     @Log(title = "文件审批业务", businessType = BusinessType.UPDATE)
     @Log(title = "文件审批业务", businessType = BusinessType.UPDATE)
     @PutMapping
     @PutMapping
-    public AjaxResult edit(@RequestBody FileApproval fileApproval)
-    {
+    public AjaxResult edit(@RequestBody FileApproval fileApproval) {
         fileApproval.setUpdateBy(SecurityUtils.getUsername());
         fileApproval.setUpdateBy(SecurityUtils.getUsername());
         fileApproval.setUpdateTime(DateUtils.getNowDate());
         fileApproval.setUpdateTime(DateUtils.getNowDate());
         return toAjax(fileApprovalService.updateById(fileApproval));
         return toAjax(fileApprovalService.updateById(fileApproval));
@@ -99,8 +129,7 @@ public class FileApprovalController extends BaseController
     @PreAuthorize("@ss.hasPermi('flow:accessory:remove')")
     @PreAuthorize("@ss.hasPermi('flow:accessory:remove')")
     @Log(title = "文件审批业务", businessType = BusinessType.DELETE)
     @Log(title = "文件审批业务", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(fileApprovalService.removeByIds(Arrays.asList(ids)));
         return toAjax(fileApprovalService.removeByIds(Arrays.asList(ids)));
     }
     }
 }
 }

+ 15 - 31
willalp-admin/src/main/java/com/willalp/web/controller/common/CommonController.java

@@ -27,8 +27,7 @@ import java.io.IOException;
  * @author willalp
  * @author willalp
  */
  */
 @RestController
 @RestController
-public class CommonController
-{
+public class CommonController {
     private static final Logger log = LoggerFactory.getLogger(CommonController.class);
     private static final Logger log = LoggerFactory.getLogger(CommonController.class);
 
 
     @Autowired
     @Autowired
@@ -43,12 +42,9 @@ public class CommonController
      * @param delete 是否删除
      * @param delete 是否删除
      */
      */
     @GetMapping("common/download")
     @GetMapping("common/download")
-    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(fileName))
-            {
+    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
+        try {
+            if (!FileUtils.checkAllowDownload(fileName)) {
                 throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
                 throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
             }
             }
             String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
             String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
@@ -57,13 +53,10 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, realFileName);
             FileUtils.setAttachmentResponseHeader(response, realFileName);
             FileUtils.writeBytes(filePath, response.getOutputStream());
             FileUtils.writeBytes(filePath, response.getOutputStream());
-            if (delete)
-            {
+            if (delete) {
                 FileUtils.deleteFile(filePath);
                 FileUtils.deleteFile(filePath);
             }
             }
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
             log.error("下载文件失败", e);
         }
         }
     }
     }
@@ -72,22 +65,18 @@ public class CommonController
      * 通用上传请求
      * 通用上传请求
      */
      */
     @PostMapping("/common/upload")
     @PostMapping("/common/upload")
-    public AjaxResult uploadFile(MultipartFile file) throws Exception
-    {
-        try
-        {
+    public AjaxResult uploadFile(MultipartFile file) throws Exception {
+        try {
             // 上传文件路径
             // 上传文件路径
             String filePath = WillalpConfig.getUploadPath();
             String filePath = WillalpConfig.getUploadPath();
             // 上传并返回新文件名称
             // 上传并返回新文件名称
-            String fileName = FileUploadUtils.upload(filePath, file);
-            String url = serverConfig.getUrl() + fileName;
+            String fileName = file.getOriginalFilename();
+            String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
             AjaxResult ajax = AjaxResult.success();
             AjaxResult ajax = AjaxResult.success();
             ajax.put("fileName", fileName);
             ajax.put("fileName", fileName);
             ajax.put("url", url);
             ajax.put("url", url);
             return ajax;
             return ajax;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             return AjaxResult.error(e.getMessage());
             return AjaxResult.error(e.getMessage());
         }
         }
     }
     }
@@ -97,12 +86,9 @@ public class CommonController
      */
      */
     @GetMapping("/common/download/resource")
     @GetMapping("/common/download/resource")
     public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
     public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
-            throws Exception
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(resource))
-            {
+            throws Exception {
+        try {
+            if (!FileUtils.checkAllowDownload(resource)) {
                 throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
                 throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
             }
             }
             // 本地资源路径
             // 本地资源路径
@@ -114,9 +100,7 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, downloadName);
             FileUtils.setAttachmentResponseHeader(response, downloadName);
             FileUtils.writeBytes(downloadPath, response.getOutputStream());
             FileUtils.writeBytes(downloadPath, response.getOutputStream());
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
             log.error("下载文件失败", e);
         }
         }
     }
     }

+ 16 - 15
willalp-admin/src/main/java/com/willalp/web/controller/system/HsPostConfigController.java

@@ -25,8 +25,7 @@ import java.util.List;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/system/postConfig")
 @RequestMapping("/system/postConfig")
-public class HsPostConfigController extends BaseController
-{
+public class HsPostConfigController extends BaseController {
     @Resource
     @Resource
     private IHsPostConfigService hsPostConfigService;
     private IHsPostConfigService hsPostConfigService;
 
 
@@ -35,21 +34,27 @@ public class HsPostConfigController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:postConfig:list')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:list')")
     @GetMapping("/list")
     @GetMapping("/list")
-    public TableDataInfo list(HsPostConfig hsPostConfig)
-    {
+    public TableDataInfo list(HsPostConfig hsPostConfig) {
         startPage();
         startPage();
         List<HsPostConfig> list = hsPostConfigService.selectHsPostConfigList(hsPostConfig);
         List<HsPostConfig> list = hsPostConfigService.selectHsPostConfigList(hsPostConfig);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
+    /**
+     * 查询岗位配置列表
+     */
+    @GetMapping("/pcTreeList")
+    public AjaxResult pcTreeList() {
+        return AjaxResult.success(hsPostConfigService.getTreePost());
+    }
+
     /**
     /**
      * 导出岗位配置列表
      * 导出岗位配置列表
      */
      */
     @PreAuthorize("@ss.hasPermi('system:postConfig:export')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:export')")
     @Log(title = "岗位配置", businessType = BusinessType.EXPORT)
     @Log(title = "岗位配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     @GetMapping("/export")
-    public AjaxResult export(HsPostConfig hsPostConfig)
-    {
+    public AjaxResult export(HsPostConfig hsPostConfig) {
         List<HsPostConfig> list = hsPostConfigService.selectHsPostConfigList(hsPostConfig);
         List<HsPostConfig> list = hsPostConfigService.selectHsPostConfigList(hsPostConfig);
         ExcelUtil<HsPostConfig> util = new ExcelUtil<HsPostConfig>(HsPostConfig.class);
         ExcelUtil<HsPostConfig> util = new ExcelUtil<HsPostConfig>(HsPostConfig.class);
         return util.exportExcel(list, "岗位配置数据");
         return util.exportExcel(list, "岗位配置数据");
@@ -60,8 +65,7 @@ public class HsPostConfigController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:postConfig:query')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:query')")
     @GetMapping(value = "/{id}")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return AjaxResult.success(hsPostConfigService.getById(id));
         return AjaxResult.success(hsPostConfigService.getById(id));
     }
     }
 
 
@@ -71,8 +75,7 @@ public class HsPostConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:postConfig:add')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:add')")
     @Log(title = "岗位配置", businessType = BusinessType.INSERT)
     @Log(title = "岗位配置", businessType = BusinessType.INSERT)
     @PostMapping
     @PostMapping
-    public AjaxResult add(@RequestBody HsPostConfig hsPostConfig)
-    {
+    public AjaxResult add(@RequestBody HsPostConfig hsPostConfig) {
         hsPostConfig.setCreateBy(SecurityUtils.getUsername());
         hsPostConfig.setCreateBy(SecurityUtils.getUsername());
         hsPostConfig.setCreateTime(DateUtils.getNowDate());
         hsPostConfig.setCreateTime(DateUtils.getNowDate());
         return toAjax(hsPostConfigService.save(hsPostConfig));
         return toAjax(hsPostConfigService.save(hsPostConfig));
@@ -84,8 +87,7 @@ public class HsPostConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:postConfig:edit')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:edit')")
     @Log(title = "岗位配置", businessType = BusinessType.UPDATE)
     @Log(title = "岗位配置", businessType = BusinessType.UPDATE)
     @PutMapping
     @PutMapping
-    public AjaxResult edit(@RequestBody HsPostConfig hsPostConfig)
-    {
+    public AjaxResult edit(@RequestBody HsPostConfig hsPostConfig) {
         hsPostConfig.setUpdateBy(SecurityUtils.getUsername());
         hsPostConfig.setUpdateBy(SecurityUtils.getUsername());
         hsPostConfig.setUpdateTime(DateUtils.getNowDate());
         hsPostConfig.setUpdateTime(DateUtils.getNowDate());
         return toAjax(hsPostConfigService.updateById(hsPostConfig));
         return toAjax(hsPostConfigService.updateById(hsPostConfig));
@@ -96,9 +98,8 @@ public class HsPostConfigController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:postConfig:remove')")
     @PreAuthorize("@ss.hasPermi('system:postConfig:remove')")
     @Log(title = "岗位配置", businessType = BusinessType.DELETE)
     @Log(title = "岗位配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(hsPostConfigService.removeByIds(Arrays.asList(ids)));
         return toAjax(hsPostConfigService.removeByIds(Arrays.asList(ids)));
     }
     }
 }
 }

+ 4 - 4
willalp-admin/src/main/resources/application-dev.yml

@@ -32,13 +32,13 @@ spring:
       # 主库数据源
       # 主库数据源
       master:
       master:
         #url: jdbc:mysql://47.103.86.55:3306/willalp_pns_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #url: jdbc:mysql://47.103.86.55:3306/willalp_pns_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-#        url: jdbc:mysql://114.115.142.166:3306/willalp_pns_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://114.115.142.166:3306/willalp_pns_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #url: jdbc:mysql://114.115.142.166:3306/willalp_pns_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         #url: jdbc:mysql://114.115.142.166:3306/willalp_pns_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        url: jdbc:mysql://localhost:3306/willalp-pns-ml-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        #        url: jdbc:mysql://localhost:3306/willalp-pns-ml-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         username: root
         #password: annaru_mysql
         #password: annaru_mysql
-#        password: willalp_mysql
-        password: 123456
+        password: willalp_mysql
+      #password: 123456
       # 从库数据源
       # 从库数据源
       slave:
       slave:
       # 从数据源开关/默认关闭
       # 从数据源开关/默认关闭

+ 2 - 2
willalp-admin/src/main/resources/application.yml

@@ -1,7 +1,7 @@
 # 开发环境配置
 # 开发环境配置
 server:
 server:
   # 服务器的HTTP端口,默认为8080
   # 服务器的HTTP端口,默认为8080
-  port: 3005
+  port: 3012
   servlet:
   servlet:
     # 应用的访问路径
     # 应用的访问路径
     context-path: /
     context-path: /
@@ -26,7 +26,7 @@ spring:
     # 国际化资源文件路径
     # 国际化资源文件路径
     basename: i18n/messages
     basename: i18n/messages
   profiles:
   profiles:
-    active: prod
+    active: dev
   # 文件上传
   # 文件上传
   servlet:
   servlet:
     multipart:
     multipart:

+ 3 - 2
willalp-admin/src/main/resources/logback.xml

@@ -7,8 +7,9 @@
     <!-- 日志输出格式 -->
     <!-- 日志输出格式 -->
     <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
     <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
     <property name="CONSOLE_LOG_PATTERN"
     <property name="CONSOLE_LOG_PATTERN"
-              value="%highlight(%date{yyyy-MM-dd HH:mm:ss.SSS}) %cyan([%thread]) %yellow(%-5level) %green(%logger{36}).%boldMagenta(%line) - %blue(%msg%n)"/>
-    <!--value="%date{yyyy-MM-dd HH:mm:ss}|%highlight(%-5level)|%boldYellow(%thread)|%boldGreen(%logger)|%msg%n"/>-->
+              value="%cyan([%thread]) %blue(%msg%n)"/>
+    <!--value="%date{yyyy-MM-dd HH:mm:ss}|%highlight(%-5level)|%boldYellow(%thread)|%boldGreen(%logger)|%msg%n"/>
+    %highlight(%date{yyyy-MM-dd HH:mm:ss.SSS}) %yellow(%-5level) %green(%logger{36}).%boldMagenta(%line) -->
 
 
     <!-- 活动文件的大小 -->
     <!-- 活动文件的大小 -->
     <property name="max.file.size" value="50MB"/>
     <property name="max.file.size" value="50MB"/>

+ 8 - 0
willalp-clocking-in/src/main/java/com/willalp/flow/domain/HsFlowTask.java

@@ -97,6 +97,14 @@ public class HsFlowTask extends BaseEntity {
     @TableLogic
     @TableLogic
     private Integer isDelete;
     private Integer isDelete;
 
 
+    public JSONObject getFormData() {
+        return formData;
+    }
+
+    public void setFormData(JSONObject formData) {
+        this.formData = formData;
+    }
+
     @TableField(exist = false)
     @TableField(exist = false)
     public JSONObject formData;
     public JSONObject formData;
 
 

+ 3 - 1
willalp-clocking-in/src/main/java/com/willalp/flow/domain/enums/FlowEnum.java

@@ -6,7 +6,9 @@ public enum FlowEnum {
     RESULT_TRUE("RESULT_TRUE", "同意"),
     RESULT_TRUE("RESULT_TRUE", "同意"),
     RESULT_FALSE("RESULT_FALSE", "拒绝"),
     RESULT_FALSE("RESULT_FALSE", "拒绝"),
     FIRST("FIRST", "第一位"),
     FIRST("FIRST", "第一位"),
-    RESULT_CASE_OF("RESULT_CASE_OF", "转交");
+    RESULT_CASE_OF("RESULT_CASE_OF", "转交"),
+    LEAVE_FLOW_EXAMPLES_ID("1580107848471093250", "请假流程实例ID"),
+    FILE_FLOW_EXAMPLES_ID("1600773666636759041", "文件流程实例ID");
 
 
     private String value;
     private String value;
     private String label;
     private String label;

+ 79 - 0
willalp-clocking-in/src/main/java/com/willalp/flow/domain/vo/FileApprovalVo.java

@@ -0,0 +1,79 @@
+/**
+ * @projectName willalp-pns-ml
+ * @package com.willalp.flow.domain.req
+ * @className com.willalp.flow.domain.vo.FileApprovalVo
+ * @copyright Copyright 2019 HuiShan, Inc All rights reserved.
+ */
+package com.willalp.flow.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * FileApprovalVo
+ * @description 文件审批上传伪类
+ * @author hs
+ * @date 2022/12/9 18:30
+ * @version 1.0
+ */
+@NoArgsConstructor
+@Data
+public class FileApprovalVo {
+
+    /**
+     * 审批标题
+     */
+    private String title;
+
+    /**
+     * 附件列表
+     */
+    private List<FileItemVo> fileList;
+
+    /**
+     * 图片列表
+     */
+    private List<FileItemVo> imgList;
+
+    /**
+     * 申请人user_code
+     */
+    private String applyUserId;
+
+    /**
+     * 申请人
+     */
+    private String applyUserName;
+
+    @Data
+    public static class FileItemVo {
+        @JsonProperty("url")
+        private String url;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("uid")
+        private Long uid;
+        @JsonProperty("status")
+        private String status;
+    }
+
+    /**
+     * 请求参数
+     */
+    @TableField(exist = false)
+    private Map<String, Object> params;
+
+    public Map<String, Object> getParams() {
+        if (params == null) {
+            params = new HashMap<>();
+        }
+        return params;
+    }
+}
+ 

+ 3 - 1
willalp-clocking-in/src/main/java/com/willalp/flow/mapper/HsFlowTaskMapper.java

@@ -24,7 +24,9 @@ public interface HsFlowTaskMapper extends BaseMapper<HsFlowTask> {
      */
      */
     List<HsFlowTask> selectHsFlowTaskList(HsFlowTask hsFlowTask);
     List<HsFlowTask> selectHsFlowTaskList(HsFlowTask hsFlowTask);
 
 
-    List<HsFlowTask> selectAllByUserCode(@Param("userCode") String userCode);
+    List<HsFlowTask> selectAllByOperator(@Param("userCode") String userCode);
+
+    List<HsFlowTask> selectAllByInitiator(@Param("userCode") String userCode);
 
 
     /**
     /**
      * 获取已办
      * 获取已办

+ 12 - 1
willalp-clocking-in/src/main/java/com/willalp/flow/mapper/xml/HsFlowTaskMapper.xml

@@ -64,7 +64,8 @@
             </if>
             </if>
         </where>
         </where>
     </select>
     </select>
-    <select id="selectAllByUserCode" resultType="com.willalp.flow.domain.HsFlowTask">
+
+    <select id="selectAllByOperator" resultType="com.willalp.flow.domain.HsFlowTask">
         <include refid="selectHsFlowTaskVo"/>
         <include refid="selectHsFlowTaskVo"/>
         <where>
         <where>
             is_delete = 0
             is_delete = 0
@@ -73,6 +74,16 @@
         </where>
         </where>
         group by create_time desc
         group by create_time desc
     </select>
     </select>
+
+    <select id="selectAllByInitiator" resultType="com.willalp.flow.domain.HsFlowTask">
+        <include refid="selectHsFlowTaskVo"/>
+        <where>
+            is_delete = 0
+            AND initiator = #{userCode}
+        </where>
+        group by create_time desc
+    </select>
+
     <select id="getDone" resultType="com.willalp.flow.domain.HsFlowTask">
     <select id="getDone" resultType="com.willalp.flow.domain.HsFlowTask">
         <include refid="selectHsFlowTaskVo"/>
         <include refid="selectHsFlowTaskVo"/>
         <where>
         <where>

+ 11 - 3
willalp-clocking-in/src/main/java/com/willalp/flow/service/HsFlowEngineService.java

@@ -9,16 +9,16 @@ import java.util.Map;
 
 
 /**
 /**
  * 会山流程引擎业务接口
  * 会山流程引擎业务接口
+ * @author Administrator
  */
  */
 public interface HsFlowEngineService {
 public interface HsFlowEngineService {
 
 
     /**
     /**
      * 提交并生成任务实例
      * 提交并生成任务实例
-     *
-     * @param task
+     *  @param task
      * @param params
      * @param params
      */
      */
-    void submitATask(HsFlowTask task, Map<String, String> params);
+    void submitATask(HsFlowTask task, Map<String, Object> params);
 
 
     /**
     /**
      * 下一步
      * 下一步
@@ -52,6 +52,14 @@ public interface HsFlowEngineService {
      */
      */
     List<HsFlowTask> getDone(String userCode);
     List<HsFlowTask> getDone(String userCode);
 
 
+    /**
+     * 获取已办
+     *
+     * @param userCode
+     * @return
+     */
+    List<HsFlowTask> getInitiator(String userCode);
+
     /**
     /**
      * 获取当前任务记录
      * 获取当前任务记录
      *
      *

+ 67 - 41
willalp-clocking-in/src/main/java/com/willalp/flow/service/impl/HsFlowEngineServiceImpl.java

@@ -31,7 +31,6 @@ import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.*;
-import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class HsFlowEngineServiceImpl implements HsFlowEngineService {
 public class HsFlowEngineServiceImpl implements HsFlowEngineService {
@@ -71,28 +70,31 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
 
 
 
 
     @Override
     @Override
-    public void submitATask(HsFlowTask task, Map<String, String> params) {
+    public void submitATask(HsFlowTask task, Map<String, Object> params) {
         try {
         try {
             String examplesId = task.getExamplesId();
             String examplesId = task.getExamplesId();
             if (StringUtils.isBlank(examplesId)) {
             if (StringUtils.isBlank(examplesId)) {
                 throw new BaseException("EXAMPLES_ID - IS_NULL");
                 throw new BaseException("EXAMPLES_ID - IS_NULL");
             }
             }
+            HsFlowExamples hsFlowExamples = hsFlowExamplesMapper.selectById(examplesId);
+            if (null == hsFlowExamples) {
+                throw new BaseException("流程实例为定义或找不到");
+            }
             HsFlowBase hsFlowBase = hsFlowBaseMapper.firstFlowBase(examplesId);
             HsFlowBase hsFlowBase = hsFlowBaseMapper.firstFlowBase(examplesId);
             if (null == hsFlowBase) {
             if (null == hsFlowBase) {
                 throw new BaseException("请创建实例");
                 throw new BaseException("请创建实例");
             }
             }
             task.setInitiator(SecurityUtils.getUsername());
             task.setInitiator(SecurityUtils.getUsername());
             task.setBaseId(hsFlowBase.getId());
             task.setBaseId(hsFlowBase.getId());
-            task.setTaskName("请假");
+            task.setTaskName(hsFlowExamples.getExamplesName());
             task.setCreateTime(new Date());
             task.setCreateTime(new Date());
+            //获取候选人
             if (ObjectUtils.isNotNull(params)) {
             if (ObjectUtils.isNotNull(params)) {
-                String userName = params.get("candidate");
+                String userName = (String) params.get("candidate");
                 if (StringUtils.isNotBlank(userName)) {
                 if (StringUtils.isNotBlank(userName)) {
-                    hsFlowBase.setOperator(userName);
                     task.setOperator(userName);
                     task.setOperator(userName);
                 }
                 }
             }
             }
-            hsFlowBaseMapper.updateById(hsFlowBase);
             hsFlowTaskMapper.insert(task);
             hsFlowTaskMapper.insert(task);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
@@ -215,23 +217,23 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
             }
             }
         }
         }
         //任务结束
         //任务结束
-        if (StringUtils.isBlank(stepId) &&
-                StringUtils.isBlank(hsFlowBase.getDownStepId()) &&
-                !resultCaseOf) {
+        if (StringUtils.isBlank(stepId) && !resultCaseOf) {
             hsFlowTask.setBaseId(null);
             hsFlowTask.setBaseId(null);
             hsFlowTask.setOperator(hsFlowTask.getOperator());
             hsFlowTask.setOperator(hsFlowTask.getOperator());
             hsFlowTask.setIsEnd("1");
             hsFlowTask.setIsEnd("1");
             String businessId = hsFlowTask.getBusinessId();
             String businessId = hsFlowTask.getBusinessId();
             if (StringUtils.isNotBlank(businessId)) {
             if (StringUtils.isNotBlank(businessId)) {
                 BizLeaveImg byId = leaveImgService.getById(businessId);
                 BizLeaveImg byId = leaveImgService.getById(businessId);
-                byId.setRemark("新进度");
-                leaveImgService.updateById(byId);
+                if (byId != null) {
+                    byId.setRemark("新进度");
+                    leaveImgService.updateById(byId);
+                }
             }
             }
             HsFlowRunningRecord frr1 = new HsFlowRunningRecord();
             HsFlowRunningRecord frr1 = new HsFlowRunningRecord();
             frr1.setComment("自动结束");
             frr1.setComment("自动结束");
             frr1.setOperator(SecurityUtils.getUsername());
             frr1.setOperator(SecurityUtils.getUsername());
             frr1.setTaskId(flow.getTaskId());
             frr1.setTaskId(flow.getTaskId());
-            frr1.setCreateTime(new Date(new Date().getTime() + 1000));
+            frr1.setCreateTime(new Date(System.currentTimeMillis() + 1000));
             list.add(frr1);
             list.add(frr1);
             //生成审批结果消息列表
             //生成审批结果消息列表
             HsAppUserMsg appUserMsg = new HsAppUserMsg();
             HsAppUserMsg appUserMsg = new HsAppUserMsg();
@@ -257,17 +259,33 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
             String content = null;
             String content = null;
             try {
             try {
-                content = "<p>标题:" + jsonObject.get("title") + "</p>" +
-                        "<p>申请人:" + jsonObject.get("apply_user_name") + "</p>" +
-                        "<p>开始时间:" + DateUtils.dateTime(sdf.parse(jsonObject.get("leave_start_time").toString())) + "</p>" +
-                        "<p>结束时间:" + DateUtils.dateTime(sdf.parse(jsonObject.get("leave_end_time").toString())) + "</p>";
+                String examplesId = hsFlowTask.getExamplesId();
+                switch (examplesId) {
+                    case "1580107848471093250":
+                        content = "<p>标题:" + jsonObject.get("title") + "</p>" +
+                                "<p>申请人:" + jsonObject.get("apply_user_name") + "</p>" +
+                                "<p>开始时间:" + DateUtils.dateTime(sdf.parse(jsonObject.get("leave_start_time").toString())) + "</p>" +
+                                "<p>结束时间:" + DateUtils.dateTime(sdf.parse(jsonObject.get("leave_end_time").toString())) + "</p>";
+                        break;
+                    case "1600773666636759041":
+                        content = "<p>标题:" + jsonObject.get("title") + "</p>" +
+                                "<p>申请人:" + jsonObject.get("apply_user_name") + "</p>";
+                        break;
+                    default:
+                        break;
+                }
             } catch (ParseException e) {
             } catch (ParseException e) {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
             appUserMsg.setMsgContent(content);
             appUserMsg.setMsgContent(content);
             appUserMsg.setMsgIsRead("0");
             appUserMsg.setMsgIsRead("0");
             appUserMsg.setUserCode(hsFlowTask.getOperator());
             appUserMsg.setUserCode(hsFlowTask.getOperator());
-            appUserMsg.setMsgType("1");
+            //设置类型
+            if (FlowEnum.LEAVE_FLOW_EXAMPLES_ID.getValue().equals(hsFlowTask.getExamplesId())) {
+                appUserMsg.setMsgType("1");
+            } else if (FlowEnum.FILE_FLOW_EXAMPLES_ID.getValue().equals(hsFlowTask.getExamplesId())) {
+                appUserMsg.setMsgType("5");
+            }
             appUserMsg.setRemark(hsFlowTask.getId());
             appUserMsg.setRemark(hsFlowTask.getId());
             appUserMsg.setCreateTime(new Date());
             appUserMsg.setCreateTime(new Date());
             userMsgService.save(appUserMsg);
             userMsgService.save(appUserMsg);
@@ -298,7 +316,16 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
         if (StringUtils.isBlank(userCode)) {
         if (StringUtils.isBlank(userCode)) {
             return null;
             return null;
         }
         }
-        List<HsFlowTask> hsFlowTasks = hsFlowTaskMapper.selectAllByUserCode(userCode);
+        List<HsFlowTask> hsFlowTasks = hsFlowTaskMapper.selectAllByOperator(userCode);
+        return getHsFlowTasks(hsFlowTasks);
+    }
+
+    @Override
+    public List<HsFlowTask> getInitiator(String userCode) {
+        if (StringUtils.isBlank(userCode)) {
+            return null;
+        }
+        List<HsFlowTask> hsFlowTasks = hsFlowTaskMapper.selectAllByInitiator(userCode);
         return getHsFlowTasks(hsFlowTasks);
         return getHsFlowTasks(hsFlowTasks);
     }
     }
 
 
@@ -315,32 +342,31 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
         if (0 != hsFlowTasks.size()) {
         if (0 != hsFlowTasks.size()) {
             List<HsFlowExamples> hsFlowExamples = hsFlowExamplesMapper.selectHsFlowExamplesList(null);
             List<HsFlowExamples> hsFlowExamples = hsFlowExamplesMapper.selectHsFlowExamplesList(null);
             hsFlowTasks.forEach(item -> {
             hsFlowTasks.forEach(item -> {
-                List<HsFlowExamples> collect = hsFlowExamples.stream().filter(examples -> {
-                    if (StringUtils.isNotBlank(examples.getId()) && examples.getId().equals(item.getExamplesId())) {
-                        return true;
-                    }
-                    return false;
-                }).collect(Collectors.toList());
                 String businessId = item.getBusinessId();
                 String businessId = item.getBusinessId();
-                if (0 != collect.size()) {
-                    if (StringUtils.isNotBlank(businessId)) {
-                        Map<String, Object> stringObjectMap = hsFlowTaskMapper
-                                .selectBusinessCase(collect.get(0).getBusinessTableName(), businessId);
-                        if (ObjectUtils.isNotNull(stringObjectMap)) {
-                            List<Map<String, Object>> leaveImgs = leaveImgService.getBaseMapper().selectMaps(new QueryWrapper<BizLeaveImg>().eq("biz_leave_id", businessId));
-                            stringObjectMap.put("imgUrls", leaveImgs);
-                            Set<String> strings = stringObjectMap.keySet();
-                            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                            strings.forEach(str -> {
-                                if (StringUtils.isNotBlank(str) && str.contains("time")) {
-                                    if (stringObjectMap.get(str) instanceof LocalDateTime) {
-                                        stringObjectMap.put(str, formatter.format((LocalDateTime) stringObjectMap.get(str)));
-                                    }
+                if (0 != hsFlowExamples.size()) {
+                    hsFlowExamples.forEach(example -> {
+                        if (StringUtils.isNotBlank(businessId)) {
+                            Map<String, Object> stringObjectMap = hsFlowTaskMapper
+                                    .selectBusinessCase(example.getBusinessTableName(), businessId);
+                            if (ObjectUtils.isNotNull(stringObjectMap)) {
+                                if ("biz_leave".equals(example.getBusinessTableName())) {
+                                    List<Map<String, Object>> leaveImgs = leaveImgService.getBaseMapper().selectMaps(new QueryWrapper<BizLeaveImg>().eq("biz_leave_id", businessId));
+                                    stringObjectMap.put("imgUrls", leaveImgs);
                                 }
                                 }
-                            });
-                            item.formData = new JSONObject(stringObjectMap);
+                                //统一时间类型字段处理
+                                Set<String> strings = stringObjectMap.keySet();
+                                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                                strings.forEach(str -> {
+                                    if (StringUtils.isNotBlank(str) && str.contains("time")) {
+                                        if (stringObjectMap.get(str) instanceof LocalDateTime) {
+                                            stringObjectMap.put(str, formatter.format((LocalDateTime) stringObjectMap.get(str)));
+                                        }
+                                    }
+                                });
+                                item.setFormData(new JSONObject(stringObjectMap));
+                            }
                         }
                         }
-                    }
+                    });
                 }
                 }
             });
             });
         }
         }

+ 15 - 0
willalp-clocking-in/src/main/java/com/willalp/msg/service/IHsAppUserMsgService.java

@@ -2,7 +2,9 @@ package com.willalp.msg.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.willalp.msg.domain.HsAppUserMsg;
 import com.willalp.msg.domain.HsAppUserMsg;
+import org.springframework.scheduling.annotation.Async;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -50,4 +52,17 @@ public interface IHsAppUserMsgService extends IService<HsAppUserMsg>
      * @param uc
      * @param uc
      */
      */
     void allReadMsgByUserCode(String uc);
     void allReadMsgByUserCode(String uc);
+
+    /**
+     * 保存审批消息并推送
+     * @param msgType
+     * @param title
+     * @param content
+     * @param taskId
+     * @param sendUser
+     * @param applyUn
+     * @param createTime
+     */
+    @Async("threadPoolTaskExecutor")
+    void saveApprovalMsgAndPush(String msgType,String title, StringBuffer content, String taskId, String sendUser, String applyUn, Date createTime);
 }
 }

+ 22 - 4
willalp-clocking-in/src/main/java/com/willalp/msg/service/impl/HsAppUserMsgServiceImpl.java

@@ -7,10 +7,12 @@ import com.willalp.common.utils.StringUtils;
 import com.willalp.msg.domain.HsAppUserMsg;
 import com.willalp.msg.domain.HsAppUserMsg;
 import com.willalp.msg.mapper.HsAppUserMsgMapper;
 import com.willalp.msg.mapper.HsAppUserMsgMapper;
 import com.willalp.msg.service.IHsAppUserMsgService;
 import com.willalp.msg.service.IHsAppUserMsgService;
+import com.willalp.wx.service.WxMsgService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -24,6 +26,9 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
     @Resource
     @Resource
     private HsAppUserMsgMapper hsAppUserMsgMapper;
     private HsAppUserMsgMapper hsAppUserMsgMapper;
 
 
+    @Resource
+    private WxMsgService wxMsgService;
+
     /**
     /**
      * 查询APP用户消息列表
      * 查询APP用户消息列表
      *
      *
@@ -41,8 +46,7 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
             List<HsAppUserMsg> msgsByUserCode = hsAppUserMsgMapper.selectList(new QueryWrapper<HsAppUserMsg>()
             List<HsAppUserMsg> msgsByUserCode = hsAppUserMsgMapper.selectList(new QueryWrapper<HsAppUserMsg>()
                     .eq("user_code", uc)
                     .eq("user_code", uc)
                     .eq("msg_is_read", "0"));
                     .eq("msg_is_read", "0"));
-
-            hsAppUserMsgMapper.insertBatchSomeColumn(msgsByUserCode);
+            //hsAppUserMsgMapper.insertBatchSomeColumn(msgsByUserCode);
             List<HsAppUserMsg> l1 = new ArrayList<>();
             List<HsAppUserMsg> l1 = new ArrayList<>();
             List<HsAppUserMsg> l3 = new ArrayList<>();
             List<HsAppUserMsg> l3 = new ArrayList<>();
             List<HsAppUserMsg> l2 = new ArrayList<>();
             List<HsAppUserMsg> l2 = new ArrayList<>();
@@ -77,8 +81,8 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
     }
     }
 
 
     @Override
     @Override
-    public void readMsgByTaskId(String taskId,String userCode) {
-        hsAppUserMsgMapper.readMsgByTaskId(taskId,userCode);
+    public void readMsgByTaskId(String taskId, String userCode) {
+        hsAppUserMsgMapper.readMsgByTaskId(taskId, userCode);
     }
     }
 
 
     @Override
     @Override
@@ -94,4 +98,18 @@ public class HsAppUserMsgServiceImpl extends ServiceImpl<HsAppUserMsgMapper, HsA
             hsAppUserMsgMapper.allReadMsgByUserCode(uc);
             hsAppUserMsgMapper.allReadMsgByUserCode(uc);
         }
         }
     }
     }
+
+    @Override
+    public void saveApprovalMsgAndPush(String msgType, String title, StringBuffer content, String taskId, String sendUser, String applyUn, Date createTime) {
+        HsAppUserMsg appUserMsg = new HsAppUserMsg();
+        appUserMsg.setMsgContent(content.toString());
+        appUserMsg.setMsgIsRead("0");
+        appUserMsg.setUserCode(sendUser);
+        appUserMsg.setMsgType(msgType);
+        appUserMsg.setRemark(taskId);
+        appUserMsg.setCreateTime(new Date());
+        save(appUserMsg);
+        wxMsgService.sendApprovalMsg(msgType, sendUser, applyUn, createTime);
+    }
+
 }
 }

+ 7 - 4
willalp-clocking-in/src/main/java/com/willalp/wx/domain/WxMsgTemplateApproval.java

@@ -4,17 +4,20 @@ import lombok.Data;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
+/**
+ * 消息模板-审批
+ * @author Administrator
+ */
 @Data
 @Data
-/*消息模板-审批*/
 public class WxMsgTemplateApproval {
 public class WxMsgTemplateApproval {
 
 
-    /*审批类型*/
+    /**审批类型*/
     private Map<String, String> thing5;
     private Map<String, String> thing5;
 
 
-    /*提交人*/
+    /**提交人*/
     private Map<String, String> thing11;
     private Map<String, String> thing11;
 
 
-    /*提交时间*/
+    /**提交时间*/
     private Map<String, String> time12;
     private Map<String, String> time12;
 
 
 }
 }

+ 19 - 2
willalp-clocking-in/src/main/java/com/willalp/wx/service/WxMsgService.java

@@ -2,9 +2,26 @@ package com.willalp.wx.service;
 
 
 import com.willalp.wx.enums.WxTemplateKeyEnum;
 import com.willalp.wx.enums.WxTemplateKeyEnum;
 
 
+import java.util.Date;
+
+/**
+ * 微信开放平台 小程序消息推送
+ *
+ * @author Administrator
+ */
 public interface WxMsgService {
 public interface WxMsgService {
 
 
-    /*消息推送,参数可以自定义修改*/
-    boolean sendQRCodeMsg(String openId, Object obj, WxTemplateKeyEnum wxTemplateKeyEnum,boolean isQuery);
+    /**
+     * 消息推送,参数可以自定义修改
+     */
+    boolean sendQRCodeMsg(String openId, Object obj, WxTemplateKeyEnum wxTemplateKeyEnum, boolean isQuery);
 
 
+    /**
+     * 发送审批消息
+     * @param title
+     * @param sendUser
+     * @param applyUn
+     * @param createTime
+     */
+    void sendApprovalMsg(String title, String sendUser, String applyUn, Date createTime);
 }
 }

+ 13 - 0
willalp-clocking-in/src/main/java/com/willalp/wx/service/impl/WxMsgServiceImpl.java

@@ -2,9 +2,11 @@ package com.willalp.wx.service.impl;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.StringUtils;
 import com.willalp.push.service.IHsAppPushService;
 import com.willalp.push.service.IHsAppPushService;
 import com.willalp.wx.domain.WxMsgConfig;
 import com.willalp.wx.domain.WxMsgConfig;
+import com.willalp.wx.domain.WxMsgTemplateApproval;
 import com.willalp.wx.enums.WxTemplateKeyEnum;
 import com.willalp.wx.enums.WxTemplateKeyEnum;
 import com.willalp.wx.service.WxMsgService;
 import com.willalp.wx.service.WxMsgService;
 import com.willalp.wx.utils.WxUtils;
 import com.willalp.wx.utils.WxUtils;
@@ -17,6 +19,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.client.RestTemplate;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.Date;
 
 
 @Service
 @Service
 public class WxMsgServiceImpl implements WxMsgService {
 public class WxMsgServiceImpl implements WxMsgService {
@@ -71,4 +74,14 @@ public class WxMsgServiceImpl implements WxMsgService {
         return sendSuccess;
         return sendSuccess;
     }
     }
 
 
+    @Override
+    public void sendApprovalMsg(String title, String sendUser, String applyUn, Date createTime) {
+        //生成审批结果消息列表
+        WxMsgTemplateApproval wxMsgTemplateApproval = new WxMsgTemplateApproval();
+        wxMsgTemplateApproval.setThing5(wxUtils.getFormat(title));
+        wxMsgTemplateApproval.setThing11(wxUtils.getFormat(applyUn));
+        wxMsgTemplateApproval.setTime12(wxUtils.getFormat(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", createTime)));
+        sendQRCodeMsg(sendUser, wxMsgTemplateApproval, WxTemplateKeyEnum.APPROVAL_WAIT, true);
+
+    }
 }
 }

+ 4 - 3
willalp-clocking-in/src/main/java/com/willalp/wx/utils/WxUtils.java

@@ -27,7 +27,7 @@ public class WxUtils {
     private String appId;
     private String appId;
     @Value("${wx.appSecret}")
     @Value("${wx.appSecret}")
     private String appSecret;
     private String appSecret;
-    /*微信官方换取openid的固定接口*/
+    /**微信官方换取openid的固定接口*/
     final String CODE2SESSION_URL = "https://api.weixin.qq.com/sns/jscode2session?appid={appId}&secret={appSecret}&js_code={code}&grant_type=authorization_code";
     final String CODE2SESSION_URL = "https://api.weixin.qq.com/sns/jscode2session?appid={appId}&secret={appSecret}&js_code={code}&grant_type=authorization_code";
 
 
     @Resource
     @Resource
@@ -38,14 +38,15 @@ public class WxUtils {
     private RedisCache redisUtils;
     private RedisCache redisUtils;
 
 
 
 
-
     public HashMap<String, String> getFormat(String str) {
     public HashMap<String, String> getFormat(String str) {
         return new HashMap<String, String>() {{
         return new HashMap<String, String>() {{
             put("value", str);
             put("value", str);
         }};
         }};
     }
     }
 
 
-    /*获取openid和session_key,参数code是小程序端传过来的*/
+    /**
+     * 获取openid和session_key,参数code是小程序端传过来的
+     */
     public Map code2Session(String code) throws JsonMappingException, JsonProcessingException {
     public Map code2Session(String code) throws JsonMappingException, JsonProcessingException {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("appId", appId);
         params.put("appId", appId);

+ 58 - 67
willalp-common/src/main/java/com/willalp/common/utils/file/FileUploadUtils.java

@@ -1,9 +1,5 @@
 package com.willalp.common.utils.file;
 package com.willalp.common.utils.file;
 
 
-import java.io.File;
-import java.io.IOException;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
 import com.willalp.common.config.WillalpConfig;
 import com.willalp.common.config.WillalpConfig;
 import com.willalp.common.constant.Constants;
 import com.willalp.common.constant.Constants;
 import com.willalp.common.exception.file.FileNameLengthLimitExceededException;
 import com.willalp.common.exception.file.FileNameLengthLimitExceededException;
@@ -12,14 +8,18 @@ import com.willalp.common.exception.file.InvalidExtensionException;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.DateUtils;
 import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.StringUtils;
 import com.willalp.common.utils.uuid.IdUtils;
 import com.willalp.common.utils.uuid.IdUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
 
 
 /**
 /**
  * 文件上传工具类
  * 文件上传工具类
  *
  *
  * @author willalp
  * @author willalp
  */
  */
-public class FileUploadUtils
-{
+public class FileUploadUtils {
     /**
     /**
      * 默认大小 50M
      * 默认大小 50M
      */
      */
@@ -35,13 +35,11 @@ public class FileUploadUtils
      */
      */
     private static String defaultBaseDir = WillalpConfig.getProfile();
     private static String defaultBaseDir = WillalpConfig.getProfile();
 
 
-    public static void setDefaultBaseDir(String defaultBaseDir)
-    {
+    public static void setDefaultBaseDir(String defaultBaseDir) {
         FileUploadUtils.defaultBaseDir = defaultBaseDir;
         FileUploadUtils.defaultBaseDir = defaultBaseDir;
     }
     }
 
 
-    public static String getDefaultBaseDir()
-    {
+    public static String getDefaultBaseDir() {
         return defaultBaseDir;
         return defaultBaseDir;
     }
     }
 
 
@@ -52,14 +50,10 @@ public class FileUploadUtils
      * @return 文件名称
      * @return 文件名称
      * @throws Exception
      * @throws Exception
      */
      */
-    public static final String upload(MultipartFile file) throws IOException
-    {
-        try
-        {
+    public static final String upload(MultipartFile file) throws IOException {
+        try {
             return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
             return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new IOException(e.getMessage(), e);
             throw new IOException(e.getMessage(), e);
         }
         }
     }
     }
@@ -72,14 +66,26 @@ public class FileUploadUtils
      * @return 文件名称
      * @return 文件名称
      * @throws IOException
      * @throws IOException
      */
      */
-    public static final String upload(String baseDir, MultipartFile file) throws IOException
-    {
-        try
-        {
+    public static final String upload(String baseDir, MultipartFile file) throws IOException {
+        try {
             return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
             return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
+        } catch (Exception e) {
+            throw new IOException(e.getMessage(), e);
         }
         }
-        catch (Exception e)
-        {
+    }
+
+    /**
+     * 根据文件路径上传
+     *
+     * @param baseDir 相对应用的基目录
+     * @param file 上传的文件
+     * @return 文件名称
+     * @throws IOException
+     */
+    public static final String uploadNotRname(String baseDir, MultipartFile file) throws IOException {
+        try {
+            return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
+        } catch (Exception e) {
             throw new IOException(e.getMessage(), e);
             throw new IOException(e.getMessage(), e);
         }
         }
     }
     }
@@ -98,11 +104,9 @@ public class FileUploadUtils
      */
      */
     public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
     public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
             throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
             throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-            InvalidExtensionException
-    {
+            InvalidExtensionException {
         int fileNamelength = file.getOriginalFilename().length();
         int fileNamelength = file.getOriginalFilename().length();
-        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
-        {
+        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
             throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
             throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
         }
         }
 
 
@@ -119,30 +123,34 @@ public class FileUploadUtils
     /**
     /**
      * 编码文件名
      * 编码文件名
      */
      */
-    public static final String extractFilename(MultipartFile file)
-    {
+    public static final String extractFilename(MultipartFile file) {
         String fileName = file.getOriginalFilename();
         String fileName = file.getOriginalFilename();
         String extension = getExtension(file);
         String extension = getExtension(file);
         fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
         fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
         return fileName;
         return fileName;
     }
     }
 
 
-    public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
-    {
+    /**
+     * 编码文件名
+     */
+    public static final String extractFilenameNotUUIDName(MultipartFile file) {
+        String fileName = file.getOriginalFilename();
+        fileName = DateUtils.datePath() + "/" + fileName;
+        return fileName;
+    }
+
+    public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException {
         File desc = new File(uploadDir + File.separator + fileName);
         File desc = new File(uploadDir + File.separator + fileName);
 
 
-        if (!desc.exists())
-        {
-            if (!desc.getParentFile().exists())
-            {
+        if (!desc.exists()) {
+            if (!desc.getParentFile().exists()) {
                 desc.getParentFile().mkdirs();
                 desc.getParentFile().mkdirs();
             }
             }
         }
         }
         return desc;
         return desc;
     }
     }
 
 
-    public static final String getPathFileName(String uploadDir, String fileName) throws IOException
-    {
+    public static final String getPathFileName(String uploadDir, String fileName) throws IOException {
         int dirLastIndex = WillalpConfig.getProfile().length() + 1;
         int dirLastIndex = WillalpConfig.getProfile().length() + 1;
         String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
         String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
         String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
         String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
@@ -158,40 +166,28 @@ public class FileUploadUtils
      * @throws InvalidExtensionException
      * @throws InvalidExtensionException
      */
      */
     public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
     public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, InvalidExtensionException
-    {
+            throws FileSizeLimitExceededException, InvalidExtensionException {
         long size = file.getSize();
         long size = file.getSize();
-        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
-        {
+        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) {
             throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
             throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
         }
         }
 
 
         String fileName = file.getOriginalFilename();
         String fileName = file.getOriginalFilename();
         String extension = getExtension(file);
         String extension = getExtension(file);
-        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
-        {
-            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
-            {
+        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
+            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
                 throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
                 throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
                         fileName);
                         fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
-            {
+            } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) {
                 throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
                 throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
                         fileName);
                         fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
-            {
+            } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) {
                 throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
                 throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
                         fileName);
                         fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
-            {
+            } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) {
                 throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
                 throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
                         fileName);
                         fileName);
-            }
-            else
-            {
+            } else {
                 throw new InvalidExtensionException(allowedExtension, extension, fileName);
                 throw new InvalidExtensionException(allowedExtension, extension, fileName);
             }
             }
         }
         }
@@ -205,12 +201,9 @@ public class FileUploadUtils
      * @param allowedExtension
      * @param allowedExtension
      * @return
      * @return
      */
      */
-    public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
-    {
-        for (String str : allowedExtension)
-        {
-            if (str.equalsIgnoreCase(extension))
-            {
+    public static final boolean isAllowedExtension(String extension, String[] allowedExtension) {
+        for (String str : allowedExtension) {
+            if (str.equalsIgnoreCase(extension)) {
                 return true;
                 return true;
             }
             }
         }
         }
@@ -223,11 +216,9 @@ public class FileUploadUtils
      * @param file 表单文件
      * @param file 表单文件
      * @return 后缀名
      * @return 后缀名
      */
      */
-    public static final String getExtension(MultipartFile file)
-    {
+    public static final String getExtension(MultipartFile file) {
         String extension = FilenameUtils.getExtension(file.getOriginalFilename());
         String extension = FilenameUtils.getExtension(file.getOriginalFilename());
-        if (StringUtils.isEmpty(extension))
-        {
+        if (StringUtils.isEmpty(extension)) {
             extension = MimeTypeUtils.getExtension(file.getContentType());
             extension = MimeTypeUtils.getExtension(file.getContentType());
         }
         }
         return extension;
         return extension;

+ 22 - 18
willalp-framework/src/main/java/com/willalp/framework/config/ThreadPoolConfig.java

@@ -1,13 +1,14 @@
 package com.willalp.framework.config;
 package com.willalp.framework.config;
 
 
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
+import com.willalp.common.utils.Threads;
 import org.apache.commons.lang3.concurrent.BasicThreadFactory;
 import org.apache.commons.lang3.concurrent.BasicThreadFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import com.willalp.common.utils.Threads;
+
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor;
 
 
 /**
 /**
  * 线程池配置
  * 线程池配置
@@ -15,23 +16,29 @@ import com.willalp.common.utils.Threads;
  * @author willalp
  * @author willalp
  **/
  **/
 @Configuration
 @Configuration
-public class ThreadPoolConfig
-{
-    // 核心线程池大小
+public class ThreadPoolConfig {
+    /**
+     * 核心线程池大小
+     */
     private int corePoolSize = 50;
     private int corePoolSize = 50;
 
 
-    // 最大可创建的线程数
+    /**
+     * 最大可创建的线程数
+     */
     private int maxPoolSize = 200;
     private int maxPoolSize = 200;
 
 
-    // 队列最大长度
+    /**
+     * 队列最大长度
+     */
     private int queueCapacity = 1000;
     private int queueCapacity = 1000;
 
 
-    // 线程池维护线程所允许的空闲时间
+    /**
+     * 线程池维护线程所允许的空闲时间
+     */
     private int keepAliveSeconds = 300;
     private int keepAliveSeconds = 300;
 
 
     @Bean(name = "threadPoolTaskExecutor")
     @Bean(name = "threadPoolTaskExecutor")
-    public ThreadPoolTaskExecutor threadPoolTaskExecutor()
-    {
+    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
         ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
         ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
         executor.setMaxPoolSize(maxPoolSize);
         executor.setMaxPoolSize(maxPoolSize);
         executor.setCorePoolSize(corePoolSize);
         executor.setCorePoolSize(corePoolSize);
@@ -46,14 +53,11 @@ public class ThreadPoolConfig
      * 执行周期性或定时任务
      * 执行周期性或定时任务
      */
      */
     @Bean(name = "scheduledExecutorService")
     @Bean(name = "scheduledExecutorService")
-    protected ScheduledExecutorService scheduledExecutorService()
-    {
+    protected ScheduledExecutorService scheduledExecutorService() {
         return new ScheduledThreadPoolExecutor(corePoolSize,
         return new ScheduledThreadPoolExecutor(corePoolSize,
-                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
-        {
+                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) {
             @Override
             @Override
-            protected void afterExecute(Runnable r, Throwable t)
-            {
+            protected void afterExecute(Runnable r, Throwable t) {
                 super.afterExecute(r, t);
                 super.afterExecute(r, t);
                 Threads.printException(r, t);
                 Threads.printException(r, t);
             }
             }

+ 2 - 2
willalp-system/src/main/java/com/willalp/system/domain/vo/PostTreeVo.java

@@ -1,16 +1,16 @@
 package com.willalp.system.domain.vo;
 package com.willalp.system.domain.vo;
 
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
  * 岗位 APP端 树状Data
  * 岗位 APP端 树状Data
+ * @author Administrator
  */
  */
 public class PostTreeVo {
 public class PostTreeVo {
 
 
     private String text;
     private String text;
     private String value;
     private String value;
-    List<PostTreeVo> children = new ArrayList<>();
+    List<PostTreeVo> children;
 
 
     public String getText() {
     public String getText() {
         return text;
         return text;

+ 10 - 6
willalp-system/src/main/java/com/willalp/system/service/impl/HsPostConfigServiceImpl.java

@@ -44,11 +44,11 @@ public class HsPostConfigServiceImpl extends ServiceImpl<HsPostConfigMapper, HsP
                 postTreeVo.setText(item.getPostName());
                 postTreeVo.setText(item.getPostName());
                 postTreeVo.setValue(item.getId());
                 postTreeVo.setValue(item.getId());
                 String postUserG = item.getPostUserG();
                 String postUserG = item.getPostUserG();
-                List<PostTreeVo> postTreeCVos = new ArrayList<>();
+                List<PostTreeVo> postTreeCcVos = new ArrayList<>();
                 if (postUserG != null) {
                 if (postUserG != null) {
                     String[] split = postUserG.split(",");
                     String[] split = postUserG.split(",");
                     for (int i = 0; i < split.length; i++) {
                     for (int i = 0; i < split.length; i++) {
-                        PostTreeVo postTreeCVo = new PostTreeVo();
+                        PostTreeVo postTreeCcVo = new PostTreeVo();
                         String nick;
                         String nick;
                         String userId;
                         String userId;
                         int of = split[i].indexOf(userBS);
                         int of = split[i].indexOf(userBS);
@@ -59,12 +59,16 @@ public class HsPostConfigServiceImpl extends ServiceImpl<HsPostConfigMapper, HsP
                             nick = "WILLALP";
                             nick = "WILLALP";
                             userId = "admin";
                             userId = "admin";
                         }
                         }
-                        postTreeCVo.setText(nick);
-                        postTreeCVo.setValue(userId);
-                        postTreeCVos.add(postTreeCVo);
+                        postTreeCcVo.setText(nick);
+                        postTreeCcVo.setValue(userId);
+                        postTreeCcVos.add(postTreeCcVo);
                     }
                     }
                 }
                 }
-                postTreeVo.setChildren(postTreeCVos);
+                if (postTreeCcVos.size() != 0) {
+                    postTreeVo.setChildren(postTreeCcVos);
+                } else {
+                    postTreeVo.setChildren(null);
+                }
                 list.add(postTreeVo);
                 list.add(postTreeVo);
             });
             });
             return list;
             return list;

+ 9 - 1
willalp-ui/src/api/system/postConfig.js

@@ -9,6 +9,14 @@ export function listPostConfig(query) {
   })
   })
 }
 }
 
 
+// 查询岗位配置列表
+export function pcTreeList() {
+  return request({
+    url: '/system/postConfig/pcTreeList',
+    method: 'get'
+  })
+}
+
 // 查询岗位配置详细
 // 查询岗位配置详细
 export function getPostConfig(id) {
 export function getPostConfig(id) {
   return request({
   return request({
@@ -50,4 +58,4 @@ export function exportPostConfig(query) {
     method: 'get',
     method: 'get',
     params: query
     params: query
   })
   })
-}
+}

+ 93 - 61
willalp-ui/src/views/files/approval/index.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div style="padding: 10px">
   <div style="padding: 10px">
     <el-row :gutter="10">
     <el-row :gutter="10">
-      <el-col :span="8">
+      <el-col :span="10">
         <el-card>
         <el-card>
           <div slot="header" class="clearfix">
           <div slot="header" class="clearfix">
             <span>新增审批</span>
             <span>新增审批</span>
@@ -19,7 +19,6 @@
                 :on-success="handleUploadSuccess"
                 :on-success="handleUploadSuccess"
                 :before-remove="beforeRemove"
                 :before-remove="beforeRemove"
                 :headers="headers"
                 :headers="headers"
-                :limit="1"
                 drag
                 drag
                 :file-list="form.fileList">
                 :file-list="form.fileList">
                 <i class="el-icon-upload"></i>
                 <i class="el-icon-upload"></i>
@@ -53,9 +52,11 @@
                 </div>
                 </div>
               </el-upload>
               </el-upload>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="级联选择" prop="">
-              <el-cascader v-model="form.field103" @change="handleChange"
-                           :style="{width: '100%'}" placeholder="请选择级联选择" clearable></el-cascader>
+            <el-form-item label="部门负责人审批" prop="applyUserName">
+              <el-cascader ref="apply" @change="handleChange" :options="pcTreeList"
+                           :props="{label:'text'}"
+                           :style="{width: '100%'}" v-model="applyUserName" placeholder="请选择级联选择" clearable>
+              </el-cascader>
             </el-form-item>
             </el-form-item>
             <div>
             <div>
               <div style="text-align: center">
               <div style="text-align: center">
@@ -65,7 +66,7 @@
           </el-form>
           </el-form>
         </el-card>
         </el-card>
       </el-col>
       </el-col>
-      <el-col :span="16">
+      <el-col :span="14">
         <el-card>
         <el-card>
           <div slot="header" class="clearfix">
           <div slot="header" class="clearfix">
             <span>已提交审批</span>
             <span>已提交审批</span>
@@ -73,14 +74,14 @@
           <el-table v-loading="loading" :data="accessoryList" @selection-change="handleSelectionChange">
           <el-table v-loading="loading" :data="accessoryList" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="55" align="center"/>
             <el-table-column type="selection" width="55" align="center"/>
             <el-table-column label="审批标题" align="center" prop="title"/>
             <el-table-column label="审批标题" align="center" prop="title"/>
-            <el-table-column label="附件列表" align="center" prop="fileList"/>
-            <el-table-column label="图片列表" align="center" prop="imgList"/>
+            <!--            <el-table-column label="附件列表" align="center" prop="fileList"/>-->
+            <!--            <el-table-column label="图片列表" align="center" prop="imgList"/>-->
             <el-table-column label="申请人" align="center" prop="applyUserName"/>
             <el-table-column label="申请人" align="center" prop="applyUserName"/>
-            <el-table-column label="结束时间" align="center" prop="endTime" width="180">
-              <template slot-scope="scope">
-                <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
-              </template>
-            </el-table-column>
+            <!--            <el-table-column label="结束时间" align="center" prop="endTime" width="180">-->
+            <!--              <template slot-scope="scope">-->
+            <!--                <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>-->
+            <!--              </template>-->
+            <!--            </el-table-column>-->
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-button
                 <el-button
@@ -115,16 +116,19 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import {getToken} from "@/utils/auth";
-import {listAccessory, addAccessory} from "@/api/flow/accessory";
+import { getToken } from '@/utils/auth'
+import { listAccessory, addAccessory, delAccessory } from '@/api/flow/accessory'
+import { pcTreeList } from '@/api/system/postConfig'
+import { delResult } from '@/api/yiqing/result'
 
 
 export default {
 export default {
   data() {
   data() {
     return {
     return {
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
+      // baseUrl: 'https://hzl.willalp.com:3005',
+      // uploadImgUrl: 'https://hzl.willalp.com:3005/common/upload', // 上传的图片服务器地址
+      uploadImgUrl:  process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
       headers: {
       headers: {
-        Authorization: "Bearer " + getToken(),
+        Authorization: 'Bearer ' + getToken()
       },
       },
       // 遮罩层
       // 遮罩层
       loading: true,
       loading: true,
@@ -135,6 +139,8 @@ export default {
       // 总条数
       // 总条数
       total: 0,
       total: 0,
       accessoryList: [],
       accessoryList: [],
+      pcTreeList: [],
+      applyUserName: {},
       // 查询参数
       // 查询参数
       queryParams: {
       queryParams: {
         pageNum: 1,
         pageNum: 1,
@@ -144,37 +150,46 @@ export default {
         imgList: null,
         imgList: null,
         applyUserId: null,
         applyUserId: null,
         applyUserName: null,
         applyUserName: null,
-        endTime: null,
+        endTime: null
       },
       },
       form: {
       form: {
         title: null,
         title: null,
         fileList: [],
         fileList: [],
-        imgList: []
+        imgList: [],
+        applyUserName: null
       },
       },
       dialogImageUrl: '',
       dialogImageUrl: '',
       dialogVisible: false,
       dialogVisible: false,
       disabled: false
       disabled: false
-    };
+    }
   },
   },
   created() {
   created() {
-    this.getList();
+    this.getList()
   },
   },
   methods: {
   methods: {
     getList() {
     getList() {
-      this.loading = true;
+      this.getPcTreeList()
+      this.loading = true
       listAccessory(this.queryParams).then(response => {
       listAccessory(this.queryParams).then(response => {
-        this.accessoryList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.accessoryList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    getPcTreeList() {
+      pcTreeList().then(req => {
+        if (req.code === 200) {
+          this.pcTreeList = req.data
+        }
+      })
     },
     },
     // 表单重置
     // 表单重置
     reset() {
     reset() {
       this.form = {
       this.form = {
         id: null,
         id: null,
         title: null,
         title: null,
-        fileList: null,
-        imgList: null,
+        fileList: [],
+        imgList: [],
         applyUserId: null,
         applyUserId: null,
         applyUserName: null,
         applyUserName: null,
         endTime: null,
         endTime: null,
@@ -183,9 +198,11 @@ export default {
         createTime: null,
         createTime: null,
         updateBy: null,
         updateBy: null,
         updateTime: null,
         updateTime: null,
-        remark: null
-      };
-      this.resetForm("form");
+        remark: null,
+        pageNum: {}
+      }
+      this.applyUserName = ''
+      this.resetForm('form')
     },
     },
     // 多选框选中数据
     // 多选框选中数据
     handleSelectionChange(selection) {
     handleSelectionChange(selection) {
@@ -195,62 +212,77 @@ export default {
     },
     },
     /** 新增按钮操作 */
     /** 新增按钮操作 */
     handleAdd() {
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加文件审批业务";
+      this.reset()
+      this.open = true
+      this.title = '添加文件审批业务'
     },
     },
     // 上传成功回调
     // 上传成功回调
     handleUploadSuccess(res, file) {
     handleUploadSuccess(res, file) {
-      this.$message.success("上传成功");
-      this.form.fileList.push({url: res.url});
+      this.$message.success('上传成功')
+      this.form.fileList.push({ url: res.url, name: res.fileName })
     },
     },
     handleImgUploadSuccess(res, file) {
     handleImgUploadSuccess(res, file) {
-      this.$message.success("上传成功");
-      this.form.imgList.push({url: res.url});
+      this.$message.success('上传成功')
+      this.form.imgList.push({ url: res.url, name: res.fileName })
     },
     },
     /** 提交按钮 */
     /** 提交按钮 */
     submitForm() {
     submitForm() {
-      if (this.form.imgList) {
-        this.form.imgList = JSON.stringify(this.form.imgList)
-      } else {
-        this.$modal.msgError("表单不完整");
+      if (this.form.fileList.length === 0) {
+        this.$modal.msgError('请上传文件')
         return
         return
       }
       }
-      if (this.form.fileList) {
-        this.form.fileList = JSON.stringify(this.form.fileList)
-      } else {
-        this.$modal.msgError("表单不完整");
+      if (this.form.imgList.length === 0) {
+        this.$modal.msgError('请上传图片')
         return
         return
       }
       }
-      this.$refs["form"].validate(valid => {
+      // this.form.imgList = JSON.stringify(this.form.imgList)
+      // this.form.fileList = JSON.stringify(this.form.fileList)
+
+      this.$refs['form'].validate(valid => {
         addAccessory(this.form).then(() => {
         addAccessory(this.form).then(() => {
-          this.$modal.msgSuccess("新增成功");
-          this.open = false;
-          this.getList();
-        });
-      });
+          this.reset()
+          this.$modal.msgSuccess('新增成功')
+          this.open = false
+          this.getList()
+        })
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids
+      this.$modal.confirm('是否确认删除该文件审批流程吗?').then(function() {
+        return delAccessory(ids)
+      }).then(() => {
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
     },
     },
     handleRemove(file, fileList) {
     handleRemove(file, fileList) {
-      console.log(file, fileList);
+      console.log(file, fileList)
     },
     },
     handlePreview(file) {
     handlePreview(file) {
-      console.log(file);
+      console.log(file)
     },
     },
     handleExceed(files, fileList) {
     handleExceed(files, fileList) {
-      this.$modal.msgWarning(`当前最多选择 4 个图片`);
+      this.$modal.msgWarning(`当前最多选择 4 个图片`)
     },
     },
     beforeRemove(file, fileList) {
     beforeRemove(file, fileList) {
-      return this.$modal.confirm(`确定移除 ${file.name}?`);
+      return this.$modal.confirm(`确定移除 ${file.name}?`)
     },
     },
     handlePictureCardPreview(file) {
     handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible = true;
+      this.dialogImageUrl = file.url
+      this.dialogVisible = true
     },
     },
     handleDownload(file) {
     handleDownload(file) {
-      console.log(file);
+      console.log(file)
     },
     },
     handleChange(value) {
     handleChange(value) {
-      console.log(value);
+      let node = this.$refs.apply.getCheckedNodes()[0]
+      this.form.params = {
+        apUserName: node.label,
+        candidate: node.value
+      }
     }
     }
   }
   }
 }
 }