邮箱完善

This commit is contained in:
18792927508
2023-11-16 12:09:36 +08:00
parent d8c09d6dff
commit 5287c031bc
9 changed files with 110 additions and 7 deletions
@@ -25,4 +25,11 @@ public interface IAdjudicationService {
AjaxResult getArchivesDetail(Long id);
AjaxResult regenerationDocument(CaseApplication caseApplication);
/**
* 根据案件id查询邮箱
* @param id
* @return
*/
AjaxResult emailByCaseId(Long id);
}
@@ -1,5 +1,6 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.deepoove.poi.data.PictureRenderData;
@@ -7,6 +8,7 @@ import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.EmailOutUtil;
@@ -936,6 +938,24 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
@Override
public AjaxResult emailByCaseId(Long id) {
List<CaseAffiliate> list = caseAffiliateMapper.emailByCaseId(id);
BookSendVO bookSendVO = new BookSendVO();
if (CollectionUtil.isNotEmpty(list)) {
for (CaseAffiliate caseAffiliate : list) {
// 申请人邮箱
if (caseAffiliate.getIdentityType() == 1) {
bookSendVO.setAppEmail(caseAffiliate.getEmail());
} else {
// 被申请人邮箱
bookSendVO.setResEmail(caseAffiliate.getEmail());
}
}
}
return AjaxResult.success(bookSendVO);
}
public String getNewEquipmentNo() {
Object awardNum = redisCache.getCacheObject("awardNum");
if (awardNum == null) {
@@ -119,6 +119,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 手机号正则
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
// 邮箱正则
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
/**
@@ -1414,6 +1416,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} else if (caseApplication.getResponBirth().after(new Date())) {
failureMsg.append("【被申请人主体信息-出生年月日】字段不合法,不能超过当前日期;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) {
failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;");
} else if(!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()){
failureMsg.append("【被申请人主体信息-邮箱】字段不合法;");
}
}
/**
@@ -1514,6 +1522,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} else if (caseApplication.getWorkAddress().length() > 50) {
failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getEmail())) {
failureMsg.append("【申请人主体信息-邮箱】字段不能为空;");
} else if(!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()){
failureMsg.append("【申请人主体信息-邮箱】字段不合法;");
}
}
/**
@@ -2456,6 +2470,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseAffiliate.setResidenAffili(caseApplication.getResidenAffiliAppli());
caseAffiliate.setAppliAgentTitle(caseApplication.getAppliAgentTitle());
caseAffiliate.setEmail(caseApplication.getEmail());
return caseAffiliate;
@@ -2520,6 +2535,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
debtorCaseAffiliate.setResponSex(caseApplication.getResponSex());
debtorCaseAffiliate.setResponBirth(caseApplication.getResponBirth());
debtorCaseAffiliate.setResidenAffili(caseApplication.getResidenAffiliRespon());
debtorCaseAffiliate.setEmail(caseApplication.getDebtorEmail());
return debtorCaseAffiliate;
}
@@ -2609,7 +2625,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 新增预约会议表
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(), 1);
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
reservedConferenceMapper.insert(conference);
return AjaxResult.success("预约会议成功");
@@ -2637,7 +2653,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String roomId = generateRoomId();
// 新增预约会议表
ReservedConference conference = new ReservedConference(caseId, roomId,
null, null, 0);
null, null,0);
reservedConferenceMapper.insert(conference);
return roomId;
}
@@ -2651,7 +2667,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 查询最大房间号
Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
if (null == maxRoomId || maxRoomId > 999999) {
if (null == maxRoomId || maxRoomId >999999) {
return "000001";
} else {
return String.format("%06d", maxRoomId);
@@ -2699,7 +2715,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Override
public AjaxResult deleteRoom(String roomId) {
return AjaxResult.success(reservedConferenceMapper.deleteByRoomId(roomId));
return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
}
}