Browse Source

会议申请通过后,通知参会人员

dzx 2 tháng trước cách đây
mục cha
commit
886a9cf45a

+ 2 - 2
src/main/java/com/xjrsoft/module/databoard/controller/DatadetailController.java

@@ -27,8 +27,8 @@ import com.xjrsoft.module.databoard.vo.ProcessStatisticsDetailVo;
 import com.xjrsoft.module.databoard.vo.StudnetStatisticsDetailVo;
 import com.xjrsoft.module.databoard.vo.SubscriptionStatisticsDetailVo;
 import com.xjrsoft.module.databoard.vo.TeacherStatisticsDetailVo;
-import com.xjrsoft.module.ledger.entity.WfSubscription;
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.entity.WfSubscription;
+import com.xjrsoft.module.oa.service.IWfSubscriptionService;
 import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
 import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;

+ 2 - 2
src/main/java/com/xjrsoft/module/ledger/controller/WfSubscriptionController.java

@@ -11,8 +11,8 @@ import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.ledger.dto.AddWfSubscriptionDto;
 import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
-import com.xjrsoft.module.ledger.entity.WfSubscription;
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.entity.WfSubscription;
+import com.xjrsoft.module.oa.service.IWfSubscriptionService;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;

+ 31 - 0
src/main/java/com/xjrsoft/module/liteflow/node/WfMeetingApplyNode.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.oa.service.IWfMeetingApplyService;
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 会议通知
+ */
+@Component("wf_meeting_apply_node")
+public class WfMeetingApplyNode extends NodeComponent {
+
+    @Autowired
+    private IWfMeetingApplyService meetingApplyService;
+
+    @Override
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Map<String, Object> params = this.getFirstContextBean();
+        Object value = util.getFormDatKey(params,"id");
+        Long formId = Convert.toLong(value);
+        if (formId != null) {
+            // 数据处理
+            meetingApplyService.noticeParticipants(formId);
+        }
+    }
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/liteflow/node/WfSubscriptionNode.java

@@ -1,7 +1,7 @@
 package com.xjrsoft.module.liteflow.node;
 
 import cn.hutool.core.convert.Convert;
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.service.IWfSubscriptionService;
 import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;

+ 87 - 0
src/main/java/com/xjrsoft/module/oa/entity/WfMeetingApply.java

@@ -0,0 +1,87 @@
+package com.xjrsoft.module.oa.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+
+/**
+* @title: 会议申请
+* @Author dzx
+* @Date: 2024-09-04
+* @Version 1.0
+*/
+@Data
+@TableName("wf_meeting_apply")
+@ApiModel(value = "wf_meeting_apply", description = "会议申请")
+public class WfMeetingApply implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+
+    @ApiModelProperty("会议日期")
+    private LocalDateTime meetingApplyDate;
+
+    @ApiModelProperty("会议开始时间")
+    private LocalTime meetingApplyS;
+
+    @ApiModelProperty("会议结束时间")
+    private LocalTime meetingApplyE;
+
+    @ApiModelProperty("会议地点")
+    private String meetingApplyAddress;
+
+    @ApiModelProperty("会议形式")
+    private String meetingApplyFormat;
+
+    @ApiModelProperty("参会人员")
+    private String meetingApplyParticipants;
+
+    @ApiModelProperty("主持人")
+    private String meetingApplyHost;
+
+    @ApiModelProperty("会议主题")
+    private String meetingApplyTheme;
+
+    @ApiModelProperty("会议议题")
+    private String meetingApplyTopics;
+
+    @ApiModelProperty("是否准备座牌、会标")
+    private String isMonogram;
+
+    @ApiModelProperty("会标主题")
+    private String monogram;
+
+    @ApiModelProperty("会前消息提醒")
+    private String meetingApplyTip;
+
+    @ApiModelProperty("会前资料")
+    private String meetingApplyPmm;
+
+    @ApiModelProperty("会议签到签退")
+    private String meetingApplySignIn;
+
+    @ApiModelProperty("上传权限")
+    private Integer meetingApplyUp;
+
+    @ApiModelProperty("为参会人员创建工作任务")
+    private Integer meetingApplyMission;
+
+    @ApiModelProperty("下载权限")
+    private Integer meetingApplyDown;
+
+    @ApiModelProperty("状态(0:未通过 1:通过)")
+    private Integer status;
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/ledger/entity/WfSubscription.java → src/main/java/com/xjrsoft/module/oa/entity/WfSubscription.java

@@ -1,4 +1,4 @@
-package com.xjrsoft.module.ledger.entity;
+package com.xjrsoft.module.oa.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 1 - 1
src/main/java/com/xjrsoft/module/ledger/entity/WfSubscriptionList.java → src/main/java/com/xjrsoft/module/oa/entity/WfSubscriptionList.java

@@ -1,4 +1,4 @@
-package com.xjrsoft.module.ledger.entity;
+package com.xjrsoft.module.oa.entity;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;

+ 17 - 0
src/main/java/com/xjrsoft/module/oa/mapper/WfMeetingApplyMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.oa.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.oa.entity.WfMeetingApply;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Mapper
+public interface WfMeetingApplyMapper extends MPJBaseMapper<WfMeetingApply> {
+
+}
+

+ 2 - 2
src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionListMapper.java → src/main/java/com/xjrsoft/module/oa/mapper/WfSubscriptionListMapper.java

@@ -1,7 +1,7 @@
-package com.xjrsoft.module.ledger.mapper;
+package com.xjrsoft.module.oa.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
-import com.xjrsoft.module.ledger.entity.WfSubscriptionList;
+import com.xjrsoft.module.oa.entity.WfSubscriptionList;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionMapper.java → src/main/java/com/xjrsoft/module/oa/mapper/WfSubscriptionMapper.java

@@ -1,9 +1,9 @@
-package com.xjrsoft.module.ledger.mapper;
+package com.xjrsoft.module.oa.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
-import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.oa.entity.WfSubscription;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
 import org.apache.ibatis.annotations.Mapper;

+ 16 - 0
src/main/java/com/xjrsoft/module/oa/service/IWfMeetingApplyService.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.oa.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.oa.entity.WfMeetingApply;
+
+/**
+* @title: 会议申请
+* @Author dzx
+* @Date: 2024-09-04
+* @Version 1.0
+*/
+
+public interface IWfMeetingApplyService extends MPJBaseService<WfMeetingApply> {
+
+    void noticeParticipants(Long id);
+}

+ 2 - 2
src/main/java/com/xjrsoft/module/ledger/service/IWfSubscriptionService.java → src/main/java/com/xjrsoft/module/oa/service/IWfSubscriptionService.java

@@ -1,9 +1,9 @@
-package com.xjrsoft.module.ledger.service;
+package com.xjrsoft.module.oa.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
-import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.oa.entity.WfSubscription;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;

+ 94 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/WfMeetingApplyServiceImpl.java

@@ -0,0 +1,94 @@
+package com.xjrsoft.module.oa.service.impl;
+
+import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.oa.mapper.WfMeetingApplyMapper;
+import com.xjrsoft.module.oa.entity.WfMeetingApply;
+import com.xjrsoft.module.oa.service.IWfMeetingApplyService;
+import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.organization.service.IWeChatService;
+import com.xjrsoft.module.workflow.entity.WorkflowExtra;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
+import com.xjrsoft.module.workflow.service.IWorkflowExtraService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.time.format.DateTimeFormatter;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class WfMeetingApplyServiceImpl extends MPJBaseServiceImpl<WfMeetingApplyMapper, WfMeetingApply> implements IWfMeetingApplyService {
+
+    private final IUserService userService;
+
+    private final IWeChatService weChatService;
+
+    private final IWorkflowExtraService extraService;
+    @Override
+    public void noticeParticipants(Long id) {
+        WfMeetingApply meetingApply = this.getById(id);
+        if(meetingApply.getMeetingApplyParticipants() == null || meetingApply.getMeetingApplyParticipants().isEmpty()){
+            return;
+        }
+        List<String> userIds = Arrays.asList(meetingApply.getMeetingApplyParticipants().split(","));
+
+        List<User> userList = userService.list(new QueryWrapper<User>().lambda().in(User::getId, userIds).isNotNull(User::getOpenId));
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String startTime = meetingApply.getMeetingApplyS().format(formatter);
+        String endTime = meetingApply.getMeetingApplyE().format(formatter);
+
+        List<WorkflowExtra> list = extraService.list(
+                new MPJLambdaWrapper<WorkflowExtra>()
+                        .select(WorkflowExtra.class, x -> VoToColumnUtil.fieldsToColumns(WorkflowExtra.class).contains(x.getProperty()))
+                        .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getProcessId, WorkflowExtra::getProcessId)
+                        .eq(WorkflowFormRelation::getFormId, id)
+                        .orderByAsc(WorkflowExtra::getStartTime)
+        );
+        String startUserName = list.get(0).getStartUserName();
+
+        for (User user : userList) {
+            WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
+            weChatSendMessageDto.setUserId(user.getOpenId());
+            weChatSendMessageDto.setTemplateId("Hign0b3e4WSXe__YmBKyDsBgAjkfNYC7c6yIUHjk3Hg");
+            weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
+            JSONObject paramJson = new JSONObject();
+
+            JSONObject thing2 = new JSONObject();
+            thing2.put("value", meetingApply.getMeetingApplyTheme());
+            paramJson.put("thing2", thing2);
+
+            JSONObject time5 = new JSONObject();
+            time5.put("value", startTime);
+            paramJson.put("time5", time5);
+
+            JSONObject time6 = new JSONObject();
+            time6.put("value", endTime);
+            paramJson.put("time6", time6);
+
+            JSONObject thing7 = new JSONObject();
+            thing7.put("value", meetingApply.getMeetingApplyAddress());
+            paramJson.put("thing7", thing7);
+
+            JSONObject thing8 = new JSONObject();
+            thing8.put("value", startUserName);
+            paramJson.put("thing8", thing8);
+
+            weChatSendMessageDto.setContent(paramJson);
+            weChatService.sendTemplateMessage(weChatSendMessageDto);
+        }
+    }
+}

+ 6 - 6
src/main/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImpl.java → src/main/java/com/xjrsoft/module/oa/service/impl/WfSubscriptionServiceImpl.java

@@ -1,4 +1,4 @@
-package com.xjrsoft.module.ledger.service.impl;
+package com.xjrsoft.module.oa.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -9,11 +9,11 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
-import com.xjrsoft.module.ledger.entity.WfSubscription;
-import com.xjrsoft.module.ledger.entity.WfSubscriptionList;
-import com.xjrsoft.module.ledger.mapper.WfSubscriptionListMapper;
-import com.xjrsoft.module.ledger.mapper.WfSubscriptionMapper;
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.entity.WfSubscription;
+import com.xjrsoft.module.oa.entity.WfSubscriptionList;
+import com.xjrsoft.module.oa.mapper.WfSubscriptionListMapper;
+import com.xjrsoft.module.oa.mapper.WfSubscriptionMapper;
+import com.xjrsoft.module.oa.service.IWfSubscriptionService;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
 import com.xjrsoft.module.ledger.vo.WfSubscriptionListVo;

+ 1 - 1
src/main/resources/mapper/ledger/WfSubscriptionMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.xjrsoft.module.ledger.mapper.WfSubscriptionMapper">
+<mapper namespace="com.xjrsoft.module.oa.mapper.WfSubscriptionMapper">
     <select id="getPage" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo">
         select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752,t1.folder_id,t1.number,t1.total_amount from wf_subscription t1
         left join xjr_department t2 on t1.application_department = t2.id

+ 0 - 2
src/test/java/com/xjrsoft/module/asset/service/impl/WfAssetManageInventoryServiceImplTest.java

@@ -1,12 +1,10 @@
 package com.xjrsoft.module.asset.service.impl;
 
 import com.xjrsoft.module.asset.service.IWfAssetManageInventoryService;
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import static org.junit.jupiter.api.Assertions.*;
 @SpringBootTest
 class WfAssetManageInventoryServiceImplTest {
     @Autowired

+ 1 - 2
src/test/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImplTest.java

@@ -1,11 +1,10 @@
 package com.xjrsoft.module.ledger.service.impl;
 
-import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.service.IWfSubscriptionService;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import static org.junit.jupiter.api.Assertions.*;
 @SpringBootTest
 class WfSubscriptionServiceImplTest {
     @Autowired