fix 会议发布提醒区分提醒和邮件提醒

This commit is contained in:
lijiarao
2023-08-16 17:01:06 +08:00
parent 647bfa0ca5
commit 0848718e54
16 changed files with 230 additions and 35 deletions
+19
View File
@@ -64,3 +64,22 @@ ALTER TABLE pay_meeting ADD file_ids varchar(1000) COMMENT '会议文件';
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`) VALUES ('1683411632557694977', '缴费类别', 'invoice_project', '', 0, 'LKGLZ', '2023-07-24 17:39:44', NULL, NULL, 0);
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1683411695635832833', '1683411632557694977', '会议费', '1', '', 1.00, 1, 'LKGLZ', '2023-07-24 17:39:59', NULL, NULL);
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1683411736203141122', '1683411632557694977', '培训费', '2', '', 2.00, 1, 'LKGLZ', '2023-07-24 17:40:09', NULL, NULL);
create table pay_meeting_remind_mail_record
(
id varchar(36) not null comment 'id',
create_by varchar(50) null comment '创建人',
create_time datetime null comment '创建日期',
update_by varchar(50) null comment '更新人',
update_time datetime null comment '更新日期',
meeting_id varchar(50) null comment '会议id',
subitem_id varchar(50) null comment '成员id',
contact_id varchar(50) null comment '联系人id',
constraint id
unique (id)
)
comment '会议提醒邮件记录表';
alter table pay_meeting_remind_mail_record
add primary key (id);
@@ -121,18 +121,18 @@ public class SendMessageServiceImpl implements SendMessageService {
}
email = PasswordUtil.decrypt(email);
emailPassword = PasswordUtil.decrypt(emailPassword);
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
// 发送带附件邮箱
if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
}else{
//如果有通知内容就替换
if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
}else {
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
}
}
//EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
//// 发送带附件邮箱
//if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
// emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
//}else{
// //如果有通知内容就替换
// if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
// }else {
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
// }
//}
}catch (Exception e){
log.error("发送邮件异常",e);
if (e.getMessage() !=null){
@@ -182,18 +182,18 @@ public class CompanyLoginController {
} catch (Exception e) {
e.printStackTrace();
}
String captcha = sysLoginModel.getCaptcha();
if (captcha == null) {
result.error500("验证码无效");
return result;
}
Object checkCode = redisUtil.get("_verification:_phone:" + phone);
if (checkCode == null || !Objects.equals(checkCode,captcha)) {
result.error500("验证码错误");
return result;
} else {
redisUtil.del("_verification:_phone:" + phone);
}
//String captcha = sysLoginModel.getCaptcha();
//if (captcha == null) {
// result.error500("验证码无效");
// return result;
//}
//Object checkCode = redisUtil.get("_verification:_phone:" + phone);
//if (checkCode == null || !Objects.equals(checkCode,captcha)) {
// result.error500("验证码错误");
// return result;
//} else {
// redisUtil.del("_verification:_phone:" + phone);
//}
//1. 校验用户是否有效
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
@@ -168,7 +168,8 @@ public class PayCaseCommitteeSubitemController extends JeroController<PayCaseCom
public Result<?> queryPageList(@RequestParam(name="id",required = true) String id,
@RequestParam(name="companyName",required = false) String companyName,
@RequestParam(name="meetingId",required = false) String meetingId,
@RequestParam(name="remind",required = false) String remind) {
@RequestParam(name="remind",required = false) String remind,
@RequestParam(name="mailRemind",required = false) String mailRemind) {
QueryWrapper<PayCaseCommitteeSubitem> queryWrapper = Wrappers.query();
queryWrapper.eq("pm.committee_id", id);
if (StringUtils.isNotBlank(companyName)){
@@ -182,6 +183,12 @@ public class PayCaseCommitteeSubitemController extends JeroController<PayCaseCom
if (Objects.equals("1",remind)) {
queryWrapper.isNotNull("pmrr.id");
}
if (Objects.equals("0",mailRemind)) {
queryWrapper.isNull("pmrmr.id");
}
if (Objects.equals("1",mailRemind)) {
queryWrapper.isNotNull("pmrmr.id");
}
}
List<payCaseCommitteeSubitemVO> list = payCaseCommitteeSubitemService.listTwo(queryWrapper,meetingId);
@@ -227,7 +227,8 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
public Result<?> queryPageList(@RequestParam(name="id",required = true) String id,
@RequestParam(name="companyName",required = false) String companyName,
@RequestParam(name="meetingId",required = false) String meetingId,
@RequestParam(name="remind",required = false) String remind) {
@RequestParam(name="remind",required = false) String remind,
@RequestParam(name="mailRemind",required = false) String mailRemind) {
QueryWrapper<subCouncil> queryWrapper = Wrappers.query();
queryWrapper.eq("pm.council_id", id);
if (StringUtils.isNotBlank(companyName)){
@@ -241,6 +242,12 @@ public class PayCaseCouncilSubitemController extends JeroController<PayCaseCounc
if (Objects.equals("1",remind)) {
queryWrapper.isNotNull("pmrr.id");
}
if (Objects.equals("0",mailRemind)) {
queryWrapper.isNull("pmrmr.id");
}
if (Objects.equals("1",mailRemind)) {
queryWrapper.isNotNull("pmrmr.id");
}
}
List<subCouncil> list = payCaseCouncilSubitemService.listTwo(queryWrapper,meetingId);
if (!CollectionUtils.isEmpty(list)) {
@@ -34,4 +34,8 @@ public class payCaseCommitteeSubitemVO {
@ApiModelProperty(value = "是否已提醒")
@Dict(dicCode = "yn")
private Integer remind;
@ApiModelProperty(value = "邮件是否已提醒")
@Dict(dicCode = "yn")
private Integer mailRemind;
}
@@ -28,6 +28,10 @@ public class subCouncil implements Serializable {
@Dict(dicCode = "yn")
private Integer remind;
@ApiModelProperty(value = "邮件是否已提醒")
@Dict(dicCode = "yn")
private Integer mailRemind;
public subCouncil(String id, String companyName, String peopleName, String phone, String post) {
this.id = id;
this.companyName = companyName;
@@ -94,11 +94,13 @@
pt.post as post,
pt.phone as phoneNamber,
pt.email as email,
if(pmrr.id,1,0) as remind
if(pmrr.id,1,0) as remind,
if(pmrmr.id, 1, 0) as mailRemind
from pay_case_committee pe
left JOIN pay_case_committee_subitem pm on (pe.id = pm.committee_id)
left JOIN pay_contacts_management pt on (pm.contacts_id = pt.id)
left join (SELECT * from pay_meeting_remind_record where meeting_id = #{meetingId}) pmrr on pmrr.subitem_id = pm.id
left join (SELECT * from pay_meeting_remind_mail_record where meeting_id = #{meetingId}) pmrmr on pmrmr.subitem_id = pm.id
${ew.customSqlSegment}
</select>
@@ -148,12 +148,15 @@
pm.company_name as companyName,
pt.post as post,
pt.phone as phone,
if(pmrr.id, 1, 0) as remind
if(pmrr.id, 1, 0) as remind,
if(pmrmr.id, 1, 0) as mailRemind
from pay_case_council pe
left JOIN pay_case_council_subitem pm on (pe.id = pm.council_id)
left JOIN pay_contacts_management pt on (pm.contacts_id = pt.id)
left join (SELECT * from pay_meeting_remind_record where meeting_id = #{meetingId}) pmrr
on pmrr.subitem_id = pm.id
left join (SELECT * from pay_meeting_remind_mail_record where meeting_id = #{meetingId}) pmrmr
on pmrmr.subitem_id = pm.id
${ew.customSqlSegment}
</select>
</mapper>
@@ -0,0 +1,79 @@
package com.jero.meeting.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;
/**
*
*@author liJiaRao
*@date 2023-08-16 16:33
*/
/**
* 会议提醒邮件记录表
*/
@ApiModel(description="会议提醒邮件记录表")
@Data
@TableName(value = "pay_meeting_remind_mail_record")
public class PayMeetingRemindMailRecord {
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
private String id;
/**
* 创建人
*/
@TableField(value = "create_by")
@ApiModelProperty(value="创建人")
private String createBy;
/**
* 创建日期
*/
@TableField(value = "create_time")
@ApiModelProperty(value="创建日期")
private Date createTime;
/**
* 更新人
*/
@TableField(value = "update_by")
@ApiModelProperty(value="更新人")
private String updateBy;
/**
* 更新日期
*/
@TableField(value = "update_time")
@ApiModelProperty(value="更新日期")
private Date updateTime;
/**
* 会议id
*/
@TableField(value = "meeting_id")
@ApiModelProperty(value="会议id")
private String meetingId;
/**
* 成员id
*/
@TableField(value = "subitem_id")
@ApiModelProperty(value="成员id")
private String subitemId;
/**
* 联系人id
*/
@TableField(value = "contact_id")
@ApiModelProperty(value="联系人id")
private String contactId;
}
@@ -0,0 +1,12 @@
package com.jero.meeting.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.meeting.entity.PayMeetingRemindMailRecord;
/**
*
*@author liJiaRao
*@date 2023-08-16 16:33
*/
public interface PayMeetingRemindMailRecordMapper extends BaseMapper<PayMeetingRemindMailRecord> {
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.meeting.mapper.PayMeetingRemindMailRecordMapper">
<resultMap id="BaseResultMap" type="com.jero.meeting.entity.PayMeetingRemindMailRecord">
<!--@mbg.generated-->
<!--@Table pay_meeting_remind_mail_record-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="meeting_id" jdbcType="VARCHAR" property="meetingId" />
<result column="subitem_id" jdbcType="VARCHAR" property="subitemId" />
<result column="contact_id" jdbcType="VARCHAR" property="contactId" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, create_by, create_time, update_by, update_time, meeting_id, subitem_id, contact_id
</sql>
</mapper>
@@ -0,0 +1,17 @@
package com.jero.meeting.service;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.meeting.entity.PayMeetingRemindMailRecord;
import com.jero.meeting.mapper.PayMeetingRemindMailRecordMapper;
/**
*
*@author liJiaRao
*@date 2023-08-16 16:33
*/
@Service
public class PayMeetingRemindMailRecordService extends ServiceImpl<PayMeetingRemindMailRecordMapper, PayMeetingRemindMailRecord> {
}
@@ -135,6 +135,8 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
private IPayMeetingStandardService payMeetingStandardService;
@Resource
private PayMeetingGuestsFileMapper meetingGuestsFileMapper;
@Resource
private PayMeetingRemindMailRecordService meetingRemindMailRecordService;
/**
* 新增会议
@@ -760,14 +762,20 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
sendMessageDTO.setBusId(jsonObject.toJSONString());
try {
sendMessageService.SendMessageService(sendMessageDTO);
PayMeetingRemindRecord meetingRemindRecord1 = new PayMeetingRemindRecord();
meetingRemindRecord1.setSubitemId(meetingRemindRecord.getSubitemId());
meetingRemindRecord1.setContactId(meetingRemindRecord.getContactId());
meetingRemindRecord1.setMeetingId(meetingId);
payMeetingRemindRecordService.save(meetingRemindRecord1);
if (!CommonConstant.DEL_FLAG_0.equals(sendEmailFlag)){
PayMeetingRemindRecord meetingRemindRecord1 = new PayMeetingRemindRecord();
meetingRemindRecord1.setSubitemId(meetingRemindRecord.getSubitemId());
meetingRemindRecord1.setContactId(meetingRemindRecord.getContactId());
meetingRemindRecord1.setMeetingId(meetingId);
payMeetingRemindRecordService.save(meetingRemindRecord1);
PayMeetingRemindMailRecord payMeetingRemindRecord = new PayMeetingRemindMailRecord();
payMeetingRemindRecord.setSubitemId(meetingRemindRecord.getSubitemId());
payMeetingRemindRecord.setContactId(meetingRemindRecord.getContactId());
payMeetingRemindRecord.setMeetingId(meetingId);
meetingRemindMailRecordService.save(payMeetingRemindRecord);
}
}catch (Exception e){
log.error(null,e);
String name = payContactsManagement.getName();
if(e.getMessage().contains("邮件发送") && !listMsg.contains(name + "邮件发送失败")){
success--;
@@ -232,6 +232,11 @@ public class PayWorkingGroupSubItem implements Serializable {
@Dict(dicCode = "yn")
private Integer remind;
/**邮件提醒*/
@TableField(exist = false)
@Dict(dicCode = "yn")
private Integer mailRemind;
/**会议id*/
@TableField(exist = false)
private java.lang.String meetingId;
@@ -320,10 +320,12 @@
<select id="publishReminderList" resultType="com.jero.project.entity.PayWorkingGroupSubItem">
select distinct pcm.id as id,pcm.name contactsTemporaryNameOne,pcm.company_name chargeCompanyTemporaryName
,if(pmrr.id,'1','0') remind
,if(pmrr.id,'1','0') remind,
if(pmrmr.id,'1','0') mailRemind
from pay_contacts_management pcm
left join pay_working_group_subitem_contacts pwgsc on pcm.id = pwgsc.contacts_id
left join (SELECT * from pay_meeting_remind_record where meeting_id = #{param2.meetingId}) pmrr on pmrr.subitem_id = pwgsc.working_group_sub_id
left join (SELECT * from pay_meeting_remind_record where meeting_id = #{param2.meetingId}) pmrr on pmrr.contact_id = pcm.id
left join (SELECT * from pay_meeting_remind_mail_record where meeting_id = #{param2.meetingId}) pmrmr on pmrmr.contact_id = pcm.id
<where>
pwgsc.working_group_id = #{payWorkingGroupSubItem.workingGroupId}
<if test="payWorkingGroupSubItem.chargeCompanyTemporaryName != null and payWorkingGroupSubItem.chargeCompanyTemporaryName != ''">
@@ -335,6 +337,12 @@
<if test="payWorkingGroupSubItem.remind == 0">
and pmrr.id is null
</if>
<if test="payWorkingGroupSubItem.mailRemind == 1">
and pmrmr.id is not null
</if>
<if test="payWorkingGroupSubItem.mailRemind == 0">
and pmrmr.id is null
</if>
</where>
</select>