Explorar el Código

1、完成会议通知表单功能
2、新增更新、删除会议通知功能
3、新增会议通知归档、作废、作废恢复、彻底作废功能

fuwb hace 3 meses
padre
commit
7d638a30ee

+ 26 - 6
zjugis-module-business/zjugis-module-business-biz/src/main/java/com/zjugis/module/business/flow/meetingNotice/controller/MeetingNoticeController.java

@@ -2,14 +2,13 @@ package com.zjugis.module.business.flow.meetingNotice.controller;
 
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.workflow.WorkFlow;
+import com.zjugis.module.business.flow.applicationinfo.vo.ApplicationInfoVO;
 import com.zjugis.module.business.flow.meetingNotice.service.IMeetingNoticeService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import com.zjugis.module.business.flow.meetingNotice.vo.MeetingNoticeVO;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.validation.Valid;
 import java.util.Map;
 
 /**
@@ -25,7 +24,7 @@ public class MeetingNoticeController extends BaseController {
     private IMeetingNoticeService meetingNoticeService;
 
     /**
-     * 获取依申请公开处理单流程表单
+     * 获取会议通知流程表单
      *
      * @param activityTemplateId
      * @param flowInstanceId
@@ -41,5 +40,26 @@ public class MeetingNoticeController extends BaseController {
         return resultPage(map);
     }
 
+    /**
+     * 更新会议通知
+     * @param updateReqVO
+     * @return
+     */
+    @PostMapping("/update")
+    public String updateMeetingNotice(@Valid @RequestBody MeetingNoticeVO updateReqVO) {
+        meetingNoticeService.updateMeetingNotice(updateReqVO);
+        return success(true);
+    }
+
+    /**
+     * 删除会议通知
+     * @param id
+     * @return
+     */
+    @DeleteMapping("/delete")
+    public String deleteMeetingNotice(@RequestParam("id") String id) {
+        meetingNoticeService.deleteMeetingNotice(id);
+        return success(true);
+    }
 
 }

+ 182 - 0
zjugis-module-business/zjugis-module-business-biz/src/main/java/com/zjugis/module/business/flow/meetingNotice/event/MeetingNoticeEvent.java

@@ -0,0 +1,182 @@
+package com.zjugis.module.business.flow.meetingNotice.event;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
+import com.zjugis.framework.workflow.exception.BusinessException;
+import com.zjugis.framework.workflow.model.BaseController;
+import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.spring.resovler.ParamModel;
+import com.zjugis.framework.workflow.workflow.WorkFlow;
+import com.zjugis.module.business.flow.applicationinfo.entity.ApplicationInfo;
+import com.zjugis.module.business.flow.applicationinfo.event.ApplicationInfoEvent;
+import com.zjugis.module.business.flow.applicationinfo.vo.ApplicationInfoVO;
+import com.zjugis.module.business.flow.meetingNotice.entity.MeetingNotice;
+import com.zjugis.module.business.flow.meetingNotice.service.IMeetingNoticeService;
+import com.zjugis.module.business.flow.meetingNotice.vo.MeetingNoticeVO;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.time.LocalDateTime;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.zjugis.module.business.constants.FlowStatusConstants.*;
+import static com.zjugis.module.business.constants.FlowStatusConstants.FLOW_PROCESS;
+
+/**
+ * 会议通知表 前端控制器
+ *
+ * @author fuwb
+ * @since 2025-03-17
+ */
+@RestController
+@RequestMapping("/meeting-notice")
+public class MeetingNoticeEvent extends BaseController {
+    public static final Logger log = LoggerFactory.getLogger(MeetingNoticeEvent.class);
+    @Resource
+    private IMeetingNoticeService meetingNoticeService;
+
+    @Resource
+    private WorkflowClient workflowClient;
+
+    /**
+     * 设置流程描述
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 活动实例
+     * @return true/false
+     */
+    @PostMapping("/setFlowDesc")
+    public String setFlowDesc(@ParamModel Map flowInstance, @ParamModel Map activityInstance) {
+        try {
+            if (!Objects.isNull(activityInstance) && activityInstance.containsKey("flowInstanceId")) {
+                String flowInstanceId = activityInstance.get("flowInstanceId").toString();
+                MeetingNotice entity = meetingNoticeService.findByInstanceId(flowInstanceId);
+                String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+                String flowDesc = StringUtils.join(Arrays.asList(entity.getPublisher(), applyTime, entity.getPublishDate()), "/");
+                entity.setFlowStatus(FLOW_PROCESS);
+                meetingNoticeService.updateMeetingNotice(BeanUtil.copyProperties(entity, MeetingNoticeVO.class));
+                workflowClient.saveFlowDescribe(flowInstanceId, flowDesc);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 流程归档事件
+     *
+     * @param flowInstance                  流程实例
+     * @param triggerFinishActivityInstance 触发归档的结束活动实例
+     * @return
+     */
+    @PostMapping("/flowArchingEvent")
+    public String flowArchingEvent(@ParamModel Map flowInstance, @ParamModel Map triggerFinishActivityInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                MeetingNotice entity = meetingNoticeService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_FINISHED);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                meetingNoticeService.updateMeetingNotice(BeanUtil.copyProperties(entity, MeetingNoticeVO.class));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废事件
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 申请作废所在活动实例
+     * @param nullyApplyUserId 作废申请人ID
+     * @return
+     */
+    @PostMapping("/nullyEvent")
+    public String nullyEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                MeetingNotice entity = meetingNoticeService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_NULLY);
+                entity.setIsvalid(0);
+                meetingNoticeService.updateMeetingNotice(BeanUtil.copyProperties(entity, MeetingNoticeVO.class));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废恢复事件
+     *
+     * @param flowInstance      流程实例
+     * @param activityInstance  申请作废所在活动实例
+     * @param nullyApplyUserId  作废申请人ID
+     * @param nullyRecoverserId 作废恢复人ID
+     * @return
+     */
+    @PostMapping("/nullyRecoverEvent")
+    public String nullyRecoverEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyRecoverserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                MeetingNotice entity = meetingNoticeService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_PROCESS);
+                entity.setIsvalid(1);
+                meetingNoticeService.updateMeetingNotice(BeanUtil.copyProperties(entity, MeetingNoticeVO.class));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 彻底作废事件
+     *
+     * @param flowInstance        流程实例
+     * @param activityInstance    申请作废所在活动实例
+     * @param nullyApplyUserId    作废申请人ID
+     * @param nullyCompleteUserId 彻底作废人ID
+     * @return
+     */
+    @PostMapping("/nullyCompleteEvent")
+    public String nullyCompleteEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyCompleteUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                MeetingNotice entity = meetingNoticeService.findByInstanceId(flowInstanceId);
+                meetingNoticeService.deleteMeetingNotice(entity.getId());
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+}

+ 5 - 0
zjugis-module-business/zjugis-module-business-biz/src/main/java/com/zjugis/module/business/flow/meetingNotice/service/IMeetingNoticeService.java

@@ -1,7 +1,9 @@
 package com.zjugis.module.business.flow.meetingNotice.service;
 
 import com.zjugis.module.business.flow.meetingNotice.entity.MeetingNotice;
+import com.zjugis.module.business.flow.meetingNotice.vo.MeetingNoticeVO;
 
+import javax.validation.Valid;
 import java.util.Map;
 
 /**
@@ -17,4 +19,7 @@ public interface IMeetingNoticeService {
     MeetingNotice findByInstanceId(String flowInstanceId);
 
 
+    void updateMeetingNotice(@Valid MeetingNoticeVO updateReqVO);
+
+    void deleteMeetingNotice(String id);
 }

+ 17 - 0
zjugis-module-business/zjugis-module-business-biz/src/main/java/com/zjugis/module/business/flow/meetingNotice/service/impl/MeetingNoticeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zjugis.module.business.flow.meetingNotice.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.fastjson2.JSON;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
@@ -10,6 +11,7 @@ import com.zjugis.module.business.constants.DictConstants;
 import com.zjugis.module.business.converter.common.SelectConvert;
 import com.zjugis.module.business.flow.meetingNotice.entity.MeetingNotice;
 import com.zjugis.module.business.flow.meetingNotice.service.IMeetingNoticeService;
+import com.zjugis.module.business.flow.meetingNotice.vo.MeetingNoticeVO;
 import com.zjugis.module.business.mapper.MeetingNoticeMapper;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.user.AdminUserApi;
@@ -76,6 +78,21 @@ public class MeetingNoticeServiceImpl implements IMeetingNoticeService {
         return meetingNoticeMapper.findByInstanceId(flowInstanceId);
     }
 
+    @Override
+    public void updateMeetingNotice(MeetingNoticeVO updateReqVO) {
+        validateExists(updateReqVO.getId());
+
+        MeetingNotice meetingNotice = BeanUtil.copyProperties(updateReqVO, MeetingNotice.class);
+        meetingNoticeMapper.updateById(meetingNotice);
+    }
+
+    @Override
+    public void deleteMeetingNotice(String id) {
+        validateExists(id);
+
+        meetingNoticeMapper.deleteById(id);
+    }
+
     private Map<String, Object> createMap(String flowInstanceId, MeetingNotice entity, String userId) {
         Map<String, Object> map = new HashMap<>();
         map.put("formEntity", entity);

+ 85 - 0
zjugis-module-business/zjugis-module-business-biz/src/main/java/com/zjugis/module/business/flow/meetingNotice/vo/MeetingNoticeVO.java

@@ -0,0 +1,85 @@
+package com.zjugis.module.business.flow.meetingNotice.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author: Fuwb
+ * @date: 2025/3/17
+ * @time: 16:00
+ * @description:
+ */
+@Data
+public class MeetingNoticeVO implements Serializable {
+    private static final long serialVersionUID = 745680896289973318L;
+
+
+    private String id;
+
+    /**
+     * 流程ID
+     */
+    private String instanceId;
+
+    /**
+     * 编号
+     */
+    private String noticeId;
+
+    /**
+     * 是否主页发布
+     */
+    private String isPublished;
+
+    /**
+     * 会议地点
+     */
+    private String meetingPlace;
+
+    /**
+     * 会议时间
+     */
+    private String meetingTime;
+
+    /**
+     * 会期
+     */
+    private String meetingDuration;
+
+    /**
+     * 会议类型
+     */
+    private String meetingType;
+
+    /**
+     * 会议内容
+     */
+    private String meetingContent;
+
+    /**
+     * 参会人员
+     */
+    private String attendees;
+
+    /**
+     * 发布人
+     */
+    private String publisher;
+
+    /**
+     * 发布日期
+     */
+    private String publishDate;
+
+    /**
+     * 流程状态
+     */
+    private Integer flowStatus;
+
+    /**
+     * 流程完成时间
+     */
+    private LocalDateTime flowFinishtime;
+}

+ 3 - 10
zjugis-module-business/zjugis-module-business-biz/src/main/resources/templates/MeetingNotice/index.ftl

@@ -48,7 +48,7 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                             <td>
                                 <div class="form-group">
                                     <div class="form-item">
-                                        <div class="z-comp-input" name="createReqVO$isPublished">
+                                        <div class="z-comp-select" name="createReqVO$isPublished"
                                             data='${publishList}' value="${formEntity.isPublished!}">
                                             <div class="z-inputselect-bar">
                                                 <span></span><i></i>
@@ -82,7 +82,7 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                             <td>
                                <div class="form-group">
                                     <div class="form-item">
-                                        <div class="z-comp-date" name="createReqVO$meetingTime">
+                                        <div class="z-comp-datetime" name="createReqVO$meetingTime">
                                             <input type="text" value="${formEntity.meetingTime!}">
                                         </div>
                                     </div>
@@ -120,8 +120,6 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                             <td class="th">
                                 <div class="form-label">会议内容:</div>
                             </td>
-                        </tr>
-                        <tr>
                             <td>
                                 <div class="z-form-row">
                                     <div class="z-form-control z-col-100 z-form-table">
@@ -136,10 +134,8 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                             <td class="th">
                                 <div class="form-label">参会人员:</div>
                             </td>
-                        </tr>
-                        <tr>
                             <td>
-                                <div class="z-form-group z-col-50">
+                                <div class="z-form-group z-col-100">
                                     <div class="z-form-control">
                                         <div class="z-comp-selecttree" name="createReqVO$attendees" value="">
                                             <div class="z-inputselect-bar">
@@ -157,9 +153,6 @@ styles=[ '/flow/css/formCommon.css','/OwCommon/OwCommon.css' ]>
                             <td>
                                 <div class="form-group">
                                     <div class="form-item">
-                                        <div class="z-comp-input" name="">
-                                            <input type="text" value="">
-                                        </div>
                                     </div>
                                 </div>
                             </td>