Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #360.
This commit is contained in:
+5
-13
@@ -496,17 +496,7 @@ public class CaseApplicationController extends BaseController {
|
||||
return AjaxResult.success(caseApplicationService.updateCaseLockStatus(caseApplication));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短信发送记录
|
||||
* @param smsSendRecord
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/smsRecord")
|
||||
public TableDataInfo getSmsSendRecord(@RequestBody SmsSendRecord smsSendRecord){
|
||||
startPage();
|
||||
List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取userSign
|
||||
* @param userId
|
||||
@@ -566,12 +556,14 @@ public class CaseApplicationController extends BaseController {
|
||||
/**
|
||||
* 案件压缩包导入
|
||||
* @param file
|
||||
* @param applicantType 申请人类型,自然人-1,机构-2
|
||||
* @param resType 被申请人类型,自然人-1,机构-2
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("/uploadCaseZipFile")
|
||||
public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId) throws IOException {
|
||||
return caseApplicationService.uploadCaseZipFile(file,templateId);
|
||||
public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId,Integer applicantType,Integer resType) throws IOException {
|
||||
return caseApplicationService.uploadCaseZipFile(file,templateId,applicantType,resType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
|
||||
import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sendMailRecord")
|
||||
public class SendMailRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ISendMailRecordService sendMailRecordService;
|
||||
|
||||
/**
|
||||
* 查询发送邮件记录列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SendMailRecord sendMailRecord)
|
||||
{
|
||||
startPage();
|
||||
List<SendMailRecord> list = sendMailRecordService.selectSendMailRecordList(sendMailRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 新增立案数据
|
||||
// */
|
||||
// @Log(title = "新增立案数据", businessType = BusinessType.INSERT)
|
||||
// @PostMapping("/addSendMailRecord")
|
||||
// public AjaxResult addSendMailRecord(@Validated @RequestBody SendMailRecord sendMailRecord)
|
||||
// {
|
||||
//
|
||||
// return toAjax(sendMailRecordService.addSendMailRecord(sendMailRecord));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||
import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sendMailRecord")
|
||||
public class SendMailRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ISendMailRecordService sendMailRecordService;
|
||||
|
||||
/**
|
||||
* 查询发送邮件记录列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SendMailRecord sendMailRecord) {
|
||||
startPage();
|
||||
List<SendMailRecord> list = sendMailRecordService.selectSendMailRecordList(sendMailRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑邮件记录
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody SendMailRecord sendMailRecord) {
|
||||
return sendMailRecordService.updateSendMailRecord(sendMailRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发送邮件记录
|
||||
*/
|
||||
@PostMapping("/reSendMailRecord")
|
||||
public AjaxResult reSendMailRecord(@RequestBody SendMailRecord sendMailRecord) {
|
||||
Boolean aBoolean = sendMailRecordService.reSendMailRecord(sendMailRecord);
|
||||
if (aBoolean) {
|
||||
return AjaxResult.success("发送成功");
|
||||
} else {
|
||||
return AjaxResult.error("发送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MeetingInfoMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendHistoryRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/shortMessage")
|
||||
public class ShortMessageController extends BaseController {
|
||||
@Autowired
|
||||
private SmsRecordMapper smsRecordMapper;
|
||||
@Autowired
|
||||
private ShortMessageService shortMessageService;
|
||||
@Autowired
|
||||
MsSmsSendRecordParamMapper recordParamMapper;
|
||||
@Autowired
|
||||
MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
|
||||
|
||||
/**
|
||||
* 查询短信发送记录
|
||||
*
|
||||
* @param smsSendRecord
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/recordList")
|
||||
public TableDataInfo smsSendRecordList(SmsSendRecord smsSendRecord) {
|
||||
startPage();
|
||||
List<SmsSendRecord> list = shortMessageService.smsSendRecordList(smsSendRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@PostMapping("/updateSendContent")
|
||||
public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
|
||||
if (smsSendRecord == null || smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())) {
|
||||
return AjaxResult.error("参数校验失败");
|
||||
}
|
||||
// 查询当前版本记录
|
||||
SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
|
||||
smsSendRecord.setUpdateTime(new Date());
|
||||
// 更新短信内容,先删除短信记录参数表
|
||||
Example recordParamExam = new Example(MsSmsSendRecordParam.class);
|
||||
recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
|
||||
recordParamMapper.deleteByExample(recordParamExam);
|
||||
// 新增短信记录参数表
|
||||
List<MsSmsSendRecordParam> recordParams = new ArrayList<>();
|
||||
for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) {
|
||||
MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
|
||||
recordParam.setSmsRecordId(smsSendRecord.getId());
|
||||
recordParam.setParamValue(templateParam.getParamValue());
|
||||
recordParams.add(recordParam);
|
||||
}
|
||||
recordParamMapper.batchInsert(recordParams);
|
||||
shortMessageService.insertShortMessageHistoryRecord(oldSendRecord, recordParams);
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发送短信
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/reSendShortMessage")
|
||||
public AjaxResult reSendShortMessage(@RequestBody ReSendMessageVO reSendMessageVO) {
|
||||
if (reSendMessageVO != null) {
|
||||
AjaxResult result = shortMessageService.reSendShortMessage(reSendMessageVO);
|
||||
return result;
|
||||
}
|
||||
return AjaxResult.error("参数缺失");
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信回调
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/smsCallBack")
|
||||
public AjaxResult smsCallBack(@RequestBody String body) {
|
||||
if(body != null){
|
||||
return shortMessageService.smsCallBack(body);
|
||||
}
|
||||
return AjaxResult.error("参数缺失");
|
||||
}
|
||||
|
||||
@Autowired
|
||||
MeetingInfoMapper meetingInfoMapper;
|
||||
@Autowired
|
||||
SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 查询UID好的密钥
|
||||
*/
|
||||
// @Anonymous
|
||||
// @GetMapping("/getMeetingInfo")
|
||||
// public Object getEncryptInfoByUid(@RequestParam(name = "authId", required = true) String authId) {
|
||||
// MeetingInfoVO result = new MeetingInfoVO();
|
||||
// if (authId != null) {
|
||||
// MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(authId);
|
||||
// if (meetingInfo != null && meetingInfo.getUserId() != null) {
|
||||
// BeanUtils.copyProperties(meetingInfo, result);
|
||||
// SysUser sysUser = sysUserMapper.selectUserById(meetingInfo.getUserId());
|
||||
// LoginUser loginUser = new LoginUser();
|
||||
// loginUser.setUserId(sysUser.getUserId());
|
||||
// loginUser.setUser(sysUser);
|
||||
// String token = tokenService.createVideoToken(loginUser, 120);
|
||||
//// String createToken = createToken(claims);
|
||||
// result.setToken(token);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
// return AjaxResult.error("查询失败");
|
||||
// }
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.sms;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 短信模板控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/smsTemplate")
|
||||
public class SMSTemplateController extends BaseController {
|
||||
@Autowired
|
||||
private SMSTemplateService templateService;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page( ){
|
||||
startPage();
|
||||
List<MsSmsTemplate> list = templateService.page();
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 新增或者修改
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult insert(@RequestBody MsSmsTemplate template){
|
||||
return templateService.insert(template);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult delete(@RequestBody MsSmsTemplate template){
|
||||
if(template.getId()==null){
|
||||
return AjaxResult.warn("id不能为空");
|
||||
}
|
||||
return templateService.delete(template.getId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -156,4 +156,9 @@ public class Constants
|
||||
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
|
||||
// 中文逗号分隔符
|
||||
public static final String CN_SPLIT_COMMA = ",";
|
||||
/**
|
||||
* 会议主键Id
|
||||
*/
|
||||
public static final String MEETING_KEY = "meeting_key";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.common.enums;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
* @description 短信状态枚举
|
||||
* @date 2023-11-17 14:05
|
||||
*/
|
||||
public enum SMSStatusEnum
|
||||
{
|
||||
SUCCESS(1, "成功"),
|
||||
SENDING(2, "发送中"),
|
||||
FAIL(3, "失败"),
|
||||
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String text;
|
||||
|
||||
SMSStatusEnum(Integer code, String text)
|
||||
{
|
||||
this.code = code;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getText()
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取text
|
||||
* @param codeNo
|
||||
* @return
|
||||
*/
|
||||
public static String getTextByCode(Integer codeNo){
|
||||
for (SMSStatusEnum value : SMSStatusEnum.values()) {
|
||||
if (value.getCode().equals(codeNo)){
|
||||
return value.getText();
|
||||
}
|
||||
}
|
||||
return codeNo.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据text获取code
|
||||
* @param textStr
|
||||
* @return
|
||||
*/
|
||||
public static String getCodeByText(String textStr){
|
||||
for (SMSStatusEnum value : SMSStatusEnum.values()) {
|
||||
if (value.getText().equals(textStr)){
|
||||
return value.getText();
|
||||
}
|
||||
}
|
||||
return textStr;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,12 @@ package com.ruoyi.common.utils;
|
||||
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mail.MailException;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
@@ -49,12 +51,12 @@ public class EmailOutUtil {
|
||||
// private static String fromOut;
|
||||
@Value("${spring.mail.host}")
|
||||
private String hostOut;
|
||||
// @Value("${spring.mail.username}")
|
||||
// private String usernameOut;
|
||||
private String usernameOut="wq18792927508@163.com";
|
||||
// @Value("${spring.mail.password}")
|
||||
// private String passwordOut;
|
||||
private String passwordOut= "WDFHKSEMCKVRELEA";
|
||||
@Value("${spring.mail.username}")
|
||||
private String usernameOut;
|
||||
|
||||
@Value("${spring.mail.password}")
|
||||
private String passwordOut;
|
||||
|
||||
@Value("${spring.mail.port}")
|
||||
private Integer portOut;
|
||||
|
||||
@@ -76,10 +78,18 @@ public class EmailOutUtil {
|
||||
* @param subject 邮件主题
|
||||
* @param content 邮件内容(发送内容)
|
||||
*/
|
||||
public void sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
|
||||
public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
|
||||
try {
|
||||
if(mailSender==null){
|
||||
mailSender= rebuildMailSender();
|
||||
}
|
||||
// 创建一个邮件对象
|
||||
SimpleMailMessage msg = new SimpleMailMessage();
|
||||
if(StrUtil.isEmpty(from)){
|
||||
msg.setFrom(usernameOut);
|
||||
}else {
|
||||
msg.setFrom(from);
|
||||
}
|
||||
msg.setTo(to);
|
||||
// 设置邮件主题
|
||||
msg.setSubject(subject);
|
||||
@@ -87,7 +97,10 @@ public class EmailOutUtil {
|
||||
msg.setText(content);
|
||||
// 发送邮件
|
||||
mailSender.send(msg);
|
||||
////System.out.println("发送成功:" + from + ":to:" + to);
|
||||
} catch (MailException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +108,14 @@ public class EmailOutUtil {
|
||||
* @param message 邮件内容
|
||||
* @param subject 邮件主题
|
||||
* @param fileList 邮件附件
|
||||
* @param fileNameMap 附件名称map,附件路径-附件名称
|
||||
*/
|
||||
public Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file) {
|
||||
public Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file,Map<String,String> fileNameMap) {
|
||||
try {
|
||||
String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
|
||||
MimeBodyPart messageBodyPart = new MimeBodyPart();
|
||||
messageBodyPart.setContent(messageContent, "text/html;charset=utf-8");
|
||||
messageBodyPart.setContentID(UUID.randomUUID().toString());
|
||||
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
|
||||
final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
|
||||
//设置邮件会话参数
|
||||
Properties props = new Properties();
|
||||
@@ -154,7 +167,10 @@ public class EmailOutUtil {
|
||||
for (File tempfile : fileList) {
|
||||
MimeBodyPart attachmentPart = new MimeBodyPart();
|
||||
attachmentPart.attachFile(tempfile);
|
||||
attachmentPart.setFileName(MimeUtility.encodeText(tempfile.getName()));
|
||||
// 设置附件名称
|
||||
if(fileNameMap!=null && fileNameMap.containsKey(tempfile.getPath())) {
|
||||
attachmentPart.setFileName(MimeUtility.encodeText(fileNameMap.get(tempfile.getPath())));
|
||||
}
|
||||
multipart.addBodyPart(attachmentPart);
|
||||
}
|
||||
msg.setContent(multipart);
|
||||
@@ -273,7 +289,7 @@ public class EmailOutUtil {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
public void buildReceiveConnect() throws Exception {
|
||||
public void buildReceiveConnect() throws Exception {
|
||||
|
||||
//POP3主机名
|
||||
String host = "pop3.163.com";
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.cvm.v20170312.CvmClient;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.var;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class SmsUtils {
|
||||
//应用id
|
||||
private static final String SDK_APP_ID = "1400854852";
|
||||
//API的SecretId
|
||||
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
|
||||
//API的SecretKey
|
||||
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
|
||||
//签名内容
|
||||
private static final String SIGN_NAME = "乙巢智慧仲裁网";
|
||||
|
||||
public static Boolean sendSms(SendSmsRequest request) {
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEY );
|
||||
|
||||
SmsClient client = new SmsClient(cred, "ap-guangzhou");
|
||||
|
||||
final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
|
||||
req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
|
||||
req.setSmsSdkAppId(SDK_APP_ID );
|
||||
req.setSignName(SIGN_NAME);
|
||||
req.setTemplateId(request.getTemplateId());
|
||||
req.setTemplateParamSet(request.getTemplateParamSet());
|
||||
SendSmsResponse res = null;
|
||||
try {
|
||||
res = client.SendSms(req);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
log.error("发送短信出错:", e);
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
SendStatus sendStatus = res.getSendStatusSet()[0];
|
||||
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
|
||||
|
||||
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
/**
|
||||
* 参数对象
|
||||
*/
|
||||
@Data
|
||||
public static class SendSmsRequest {
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 模板 ID: 必须填写已审核通过的模板 ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
|
||||
*/
|
||||
private String[] templateParamSet;
|
||||
private Long caseId;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
* @Author: ymbgy
|
||||
* @Date: 2022-09-23 10:06
|
||||
*/
|
||||
public class ThreadUtil {
|
||||
public static ExecutorService createThreadPool() {
|
||||
//获取系统处理器个数,作为线程池数量
|
||||
int nThreads = Runtime.getRuntime().availableProcessors();
|
||||
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
|
||||
.setNameFormat("demo-pool-%d").build();
|
||||
//Thread Pool
|
||||
ExecutorService executor = new ThreadPoolExecutor(nThreads, 200,
|
||||
0L, TimeUnit.MILLISECONDS,
|
||||
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import java.util.TimeZone;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
//import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import tk.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
/**
|
||||
* 程序注解配置
|
||||
|
||||
@@ -12,11 +12,16 @@
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
|
||||
<description>
|
||||
system系统模块
|
||||
<!-- system系统模块-->
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--通用mapper-->
|
||||
<dependency>
|
||||
<groupId>tk.mybatis</groupId>
|
||||
<artifactId>mapper-spring-boot-starter</artifactId>
|
||||
<version>2.1.5</version>
|
||||
</dependency>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SmsSendRecord extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件申请id
|
||||
*/
|
||||
private Long caseId;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sendTime;
|
||||
/**
|
||||
* 发送内容
|
||||
*/
|
||||
private String sendContent;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
private Integer sendStatus;
|
||||
}
|
||||
+15
-2
@@ -1,11 +1,14 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SendMailRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -40,6 +43,16 @@ public class SendMailRecord extends BaseEntity {
|
||||
private Integer sendStatus;
|
||||
|
||||
|
||||
/** 附件id */
|
||||
private String fileIds;
|
||||
|
||||
/** 邮件主题 */
|
||||
private String mailSubject;
|
||||
|
||||
/** 邮件发件人地址 */
|
||||
private String mailFromAddress;
|
||||
private List<CaseAttach> caseAttachList;
|
||||
|
||||
|
||||
public Integer getSendStatus() {
|
||||
return sendStatus;
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SmsSendRecord extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 短信模板主键id
|
||||
*/
|
||||
private Long msSmsTemplateId;
|
||||
/**
|
||||
* 案件申请id
|
||||
*/
|
||||
private Long caseId;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sendTime;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
private Integer sendStatus;
|
||||
/**
|
||||
* 短信sid,发送的唯一标识
|
||||
*/
|
||||
private String sid;
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 短信内容
|
||||
*/
|
||||
private String sendContent;
|
||||
/**
|
||||
* 腾讯云模板id
|
||||
*/
|
||||
private String templateId;
|
||||
/**
|
||||
* 模板内容
|
||||
*/
|
||||
private String templateContent;
|
||||
private List<MsSmsTemplateParam> templateParams;
|
||||
|
||||
public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) {
|
||||
this.caseId = caseId;
|
||||
this.caseNum = caseNum;
|
||||
this.phone = phone;
|
||||
this.sendTime = sendTime;
|
||||
this.sendContent = sendContent;
|
||||
this.sid = sid;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "sms_send_history_record_param")
|
||||
public class MsSmsSendHistoryRecordParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 短信历史记录表id
|
||||
*/
|
||||
@Column(name = "sms_record_history_id")
|
||||
private Long smsRecordHistoryId;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Column(name = "param_value")
|
||||
private String paramValue;
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "sms_send_record_param")
|
||||
public class MsSmsSendRecordParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 短信记录表id
|
||||
*/
|
||||
@Column(name = "sms_record_id")
|
||||
private Long smsRecordId;
|
||||
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Column(name = "param_value")
|
||||
private String paramValue;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "sms_template")
|
||||
public class MsSmsTemplate {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 腾讯云模板id
|
||||
*/
|
||||
@Column(name = "template_id")
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模板内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 模板参数
|
||||
*/
|
||||
@Transient
|
||||
private List<MsSmsTemplateParam> templateParams;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "sms_template_param")
|
||||
public class MsSmsTemplateParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* ms_sms_template表id
|
||||
*/
|
||||
@Column(name = "sms_template_id")
|
||||
private Long smsTemplateId;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private String param;
|
||||
/**
|
||||
* 参数名
|
||||
*/
|
||||
@Column(name = "param_name")
|
||||
private String paramName;
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Transient
|
||||
private String paramValue;
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.shortmessage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "meeting_info")
|
||||
public class MeetingInfo {
|
||||
/**
|
||||
* 主键Id
|
||||
*/
|
||||
@Id
|
||||
private String uid;
|
||||
|
||||
/**
|
||||
* 案件Id
|
||||
*/
|
||||
@Column(name = "case_id")
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@Column(name = "user_name")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 房间Id
|
||||
*/
|
||||
@Column(name = "room_id")
|
||||
private String roomId;
|
||||
|
||||
/**
|
||||
* 系统类型
|
||||
*/
|
||||
@Column(name = "system_type")
|
||||
private String systemType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.shortmessage;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "send_mail_history_record")
|
||||
public class MsSendMailHistoryRecord {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 邮件名称
|
||||
*/
|
||||
@Column(name = "mail_name")
|
||||
private String mailName;
|
||||
|
||||
/**
|
||||
* 邮件接收地址
|
||||
*/
|
||||
@Column(name = "mail_address")
|
||||
private String mailAddress;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@Column(name = "send_time")
|
||||
private Date sendTime;
|
||||
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
@Column(name = "case_num")
|
||||
private String caseNum;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
@Column(name = "send_status")
|
||||
private Long sendStatus;
|
||||
|
||||
/**
|
||||
* 立案申请id
|
||||
*/
|
||||
@Column(name = "case_id")
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@Column(name = "create_by")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@Column(name = "update_by")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 附件id用英文逗号隔开
|
||||
*/
|
||||
@Column(name = "file_ids")
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 邮件主题
|
||||
*/
|
||||
@Column(name = "mail_subject")
|
||||
private String mailSubject;
|
||||
|
||||
/**
|
||||
* 邮件发送地址
|
||||
*/
|
||||
@Column(name = "mail_from_address")
|
||||
private String mailFromAddress;
|
||||
|
||||
/**
|
||||
* 邮件父类id
|
||||
*/
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 邮件内容
|
||||
*/
|
||||
@Column(name = "mail_content")
|
||||
private String mailContent;
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.shortmessage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Table(name = "sms_send_history_record")
|
||||
public class MsSmsSendHistoryRecord {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
@Column(name = "case_appli_id")
|
||||
private Long caseAppliId;
|
||||
/**
|
||||
* 短信模板表主键id
|
||||
*/
|
||||
@Column(name = "ms_sms_template_id")
|
||||
private Long msSmsTemplateId;
|
||||
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
@Column(name = "case_num")
|
||||
private String caseNum;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@Column(name = "send_time")
|
||||
private Date sendTime;
|
||||
|
||||
/**
|
||||
* 发送状态,0-失败,1-成功
|
||||
*/
|
||||
@Column(name = "send_status")
|
||||
private Long sendStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Column(name = "create_by")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@Column(name = "update_by")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 发送短信唯一标识
|
||||
*/
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 父类短信id
|
||||
*/
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String reason;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MeetingInfoVO {
|
||||
/**
|
||||
* 案件Id
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 房间Id
|
||||
*/
|
||||
private String roomId;
|
||||
|
||||
/**
|
||||
* 系统类型
|
||||
*/
|
||||
private String systemType;
|
||||
/**
|
||||
* 登录认证令牌
|
||||
*/
|
||||
private String token;
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ReSendMessageVO {
|
||||
/**
|
||||
* 短信模版Id
|
||||
*/
|
||||
private String templateId;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 短信id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 短信模版参数值
|
||||
*/
|
||||
private List<MsSmsTemplateParam> templateParams;
|
||||
|
||||
}
|
||||
@@ -43,4 +43,10 @@ public interface CaseAttachMapper {
|
||||
* @param annexId 附件id
|
||||
*/
|
||||
void deleteCaseAttach(@Param("caseId")Long caseId, @Param("type")int type,@Param("annexId") Long annexId);
|
||||
/**
|
||||
* 根据ids查询
|
||||
* @param fileIds
|
||||
* @return
|
||||
*/
|
||||
List<CaseAttach> selectByIds(@Param("ids") List<String> fileIds);
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SendMailRecordMapper {
|
||||
int saveSendMailRecord(SendMailRecord sendMailRecord);
|
||||
|
||||
List<SendMailRecord> selectSendMailRecord(SendMailRecord sendMailRecord);
|
||||
|
||||
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sendrecord;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SendMailRecordMapper {
|
||||
/**
|
||||
* 新增发送邮件记录
|
||||
*
|
||||
* @param sendMailRecord 发送邮件记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
int saveSendMailRecord(SendMailRecord sendMailRecord);
|
||||
/**
|
||||
* 查询发送邮件记录
|
||||
*
|
||||
* @param sendMailRecord 发送邮件记录
|
||||
* @return 结果
|
||||
*/
|
||||
List<SendMailRecord> selectSendMailRecord(SendMailRecord sendMailRecord);
|
||||
/**
|
||||
* 修改发送邮件记录
|
||||
*
|
||||
* @param sendMailRecord 发送邮件记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSendMailRecord(SendMailRecord sendMailRecord);
|
||||
|
||||
/**
|
||||
* 根据id查询发送邮件记录
|
||||
* @param id
|
||||
*/
|
||||
SendMailRecord querySendMailRecordById(Long id);
|
||||
}
|
||||
+11
-2
@@ -1,6 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sendrecord;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -19,4 +19,13 @@ public interface SmsRecordMapper {
|
||||
* @return
|
||||
*/
|
||||
int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
|
||||
SmsSendRecord selectBySId(@Param("sid") String sid);
|
||||
void updateStatus (SmsSendRecord smsSendRecord);
|
||||
|
||||
/**
|
||||
* 通过id查询短信发送记录
|
||||
*/
|
||||
SmsSendRecord selectById(@Param("id") Long id);
|
||||
|
||||
void update(SmsSendRecord smsSendRecord);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.shortmessage;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MeetingInfoMapper extends Mapper<MeetingInfo> {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.shortmessage;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MsSendMailHistoryRecordMapper extends Mapper<MsSendMailHistoryRecord> {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.shortmessage;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSmsSendHistoryRecord;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MsSmsSendHistoryRecordMapper extends Mapper<MsSmsSendHistoryRecord> {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sms;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendHistoryRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsSendHistoryRecordParamMapper extends Mapper<MsSmsSendHistoryRecordParam> {
|
||||
/**
|
||||
* 批量新增
|
||||
* @param historyRecordParams
|
||||
*/
|
||||
@Select("<script> INSERT INTO sms_send_history_record_param (sms_record_history_id, param_value)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsRecordHistoryId}, #{item.paramValue})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsSendHistoryRecordParam> historyRecordParams);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sms;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsSendRecordParamMapper extends Mapper<MsSmsSendRecordParam> {
|
||||
/**
|
||||
* 批量插入
|
||||
* @param list
|
||||
*/
|
||||
@Select("<script> INSERT INTO sms_send_record_param (sms_record_id, param_value)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsRecordId}, #{item.paramValue})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsSendRecordParam> list);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sms;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MsSmsTemplateMapper extends Mapper<MsSmsTemplate> {
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.sms;
|
||||
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsTemplateParamMapper extends Mapper<MsSmsTemplateParam> {
|
||||
@Select("<script> INSERT INTO sms_template_param (sms_template_id, param,param_name)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsTemplateId}, #{item.param}, #{item.paramName})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsTemplateParam> templateParams);
|
||||
}
|
||||
+2
-7
@@ -76,12 +76,7 @@ public interface ICaseApplicationService {
|
||||
int updateCaseLockStatus(CaseApplication caseApplication);
|
||||
|
||||
AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId);
|
||||
/**
|
||||
* 查询短信发送记录
|
||||
* @param smsSendRecord
|
||||
* @return
|
||||
*/
|
||||
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 获取userSign
|
||||
@@ -113,7 +108,7 @@ public interface ICaseApplicationService {
|
||||
|
||||
AjaxResult deleteRoom( String roomId);
|
||||
|
||||
AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId);
|
||||
AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId,Integer applicantType,Integer resType);
|
||||
|
||||
/**
|
||||
* 根据附件id修改案件id
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISendMailRecordService {
|
||||
|
||||
|
||||
List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+60
-109
@@ -2,15 +2,11 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.constant.FileTransformation;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
@@ -19,19 +15,20 @@ import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.EmailOutUtil;
|
||||
import com.ruoyi.common.utils.ObjectFieldUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSendMailHistoryRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.WordUtil;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.wisdomarbitrate.StringIdsReq;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
@@ -41,6 +38,7 @@ import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mail.MailSendException;
|
||||
@@ -49,9 +47,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
@@ -63,7 +58,6 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.io.Files.getFileExtension;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||
import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog;
|
||||
|
||||
@@ -108,6 +102,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
|
||||
@Autowired
|
||||
private IAdjudicationService adjudicationService;
|
||||
@Value("${spring.mail.username}")
|
||||
private String emailFrom;
|
||||
@Autowired
|
||||
private MsSendMailHistoryRecordMapper sendMailHistoryRecordMapper;
|
||||
// 仲裁反请求模板内容
|
||||
private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
|
||||
// 财产保全内容
|
||||
@@ -804,7 +802,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
if (caseApplication1 == null) {
|
||||
return AjaxResult.error("未查询到相关案件");
|
||||
}
|
||||
Integer currentNode = caseApplication1.getCaseStatus();
|
||||
String caseNum = caseApplication1.getCaseNum();
|
||||
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
|
||||
Boolean isExistPdf = false;
|
||||
String path=null;
|
||||
@@ -872,38 +870,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
//申请人发送邮件
|
||||
boolean appEmailFlag = sendCaseEmail(appEmail, path);
|
||||
SendMailRecord sendMailRecord = new SendMailRecord();
|
||||
sendMailRecord.setCaseId(id);
|
||||
sendMailRecord.setMailAddress(appEmail);
|
||||
sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅");
|
||||
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
|
||||
sendMailRecord.setMailName("签署后的裁决书");
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setCreateBy(getUsername());
|
||||
if (appEmailFlag) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
// 被申请人发送邮件
|
||||
boolean resEmailFlag = sendCaseEmail( resEmail, path);
|
||||
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum);
|
||||
|
||||
SendMailRecord sendMailRecord1 = new SendMailRecord();
|
||||
sendMailRecord1.setCaseId(id);
|
||||
sendMailRecord1.setMailAddress(resEmail);
|
||||
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
|
||||
sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅");
|
||||
sendMailRecord1.setMailName("签署后的裁决书");
|
||||
sendMailRecord1.setSendTime(new Date());
|
||||
sendMailRecord1.setCreateBy(getUsername());
|
||||
if (resEmailFlag) {
|
||||
sendMailRecord1.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord1.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
|
||||
// 被申请人发送邮件
|
||||
boolean resEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum);
|
||||
if (!appEmailFlag && !resEmailFlag) {
|
||||
throw new ServiceException("裁决书发送失败");
|
||||
}
|
||||
@@ -931,28 +901,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
operatorList.add(resAffiliateOpt.get());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(operatorList)) {
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("1990362");
|
||||
for (CaseAffiliateEntity affiliate : operatorList) {
|
||||
String telphone = affiliate.getPhone();
|
||||
request.setPhone(telphone);
|
||||
request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
// 保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(id);
|
||||
smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
|
||||
SmsUtils.sendSms(caseApplication1, "1990362", affiliate.getPhone(), new String[]{affiliate.getName(),caseApplication1.getCaseNum()});
|
||||
|
||||
}
|
||||
|
||||
@@ -967,69 +918,69 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
return AjaxResult.success("裁决书送达成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过邮件发送裁决书文件
|
||||
*
|
||||
* @param caseApplication1
|
||||
*/
|
||||
private boolean sendCaseEmail(CaseApplication caseApplication1, String email, List<CaseAttach> caseAttachList) {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
File file = null;
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == 3) {
|
||||
String annexName = caseAttach.getAnnexName();
|
||||
String prefix = "/profile/upload/";
|
||||
int startIndex = prefix.length();
|
||||
String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
|
||||
// todo 部署放开
|
||||
file = new File(path);
|
||||
// file = new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\09\\b10b20d66cfa44df8995c3999e3b6266.pdf");
|
||||
fileList.add(file);
|
||||
System.out.println("文件长度==================:" + file.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file != null && file.exists()) {
|
||||
try {
|
||||
Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
if (aBoolean) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
|
||||
System.out.println(e.toString());
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过邮件发送裁决书文件
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
private boolean sendCaseEmail(String email, String path) {
|
||||
if(StrUtil.isEmpty(path)){
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
private boolean sendCaseEmail(CaseApplication caseApplication, String email, List<CaseAttach> caseAttachList, String caseNum) {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
File file = new File(path);
|
||||
File file = null;
|
||||
Long fileId = null;
|
||||
Map<String,String> fileNameMap = new HashMap<>();
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
if (Objects.equals(caseAttach.getAnnexType(), 3)) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
String path = annexPath.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/");
|
||||
file = new File(path);
|
||||
fileList.add(file);
|
||||
fileId = caseAttach.getAnnexId();
|
||||
fileNameMap.put(file.getPath(), caseAttach.getAnnexName());
|
||||
System.out.println("文件长度==================:" + file.length());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
SendMailRecord sendMailRecord = new SendMailRecord();
|
||||
sendMailRecord.setCaseId(caseApplication.getId());
|
||||
sendMailRecord.setCaseNum(caseNum);
|
||||
sendMailRecord.setMailAddress(email);
|
||||
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
|
||||
sendMailRecord.setMailName("签署后的调解书");
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setMailSubject("签署后的调解书");
|
||||
sendMailRecord.setMailFromAddress(emailFrom);
|
||||
sendMailRecord.setFileIds(fileId != null ? fileId.toString() : "");
|
||||
// sendMailRecord.setCreateBy(SecurityUtils.getUsername());
|
||||
sendMailRecord.setCreateTime(new Date());
|
||||
sendMailRecord.setMailFromAddress(emailFrom);
|
||||
|
||||
if (file != null && file.exists()) {
|
||||
try {
|
||||
Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的调解书在附件中请查阅", "签署后的调解书", fileList, null,fileNameMap);
|
||||
|
||||
if (aBoolean) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
|
||||
BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord);
|
||||
msSendMailHistoryRecord.setParentId(sendMailRecord.getId());
|
||||
msSendMailHistoryRecord.setId(null);
|
||||
sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
|
||||
System.out.println(e.toString());
|
||||
sendMailRecord.setSendStatus(0);
|
||||
MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
|
||||
BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord);
|
||||
msSendMailHistoryRecord.setParentId(sendMailRecord.getId());
|
||||
msSendMailHistoryRecord.setId(null);
|
||||
sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-24
@@ -3,15 +3,14 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.enums.UpdateSubmitStatus;
|
||||
import com.ruoyi.common.enums.YesOrNoEnum;
|
||||
import com.ruoyi.common.utils.ObjectFieldUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||
@@ -210,30 +209,11 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("1996949");
|
||||
request.setPhone(caseAffiliate.getContactTelphone());
|
||||
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), logCase.getCaseNum(),vo.getReason()});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(caseAffiliate.getCaseAppliId());
|
||||
caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
// 1996949 审核案件结果通知 尊敬的{1}用户,您的{2}仲裁案件,审核未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||
String content = "尊敬的" + caseAffiliate.getName() + ",您的"+logCase.getCaseNum()+"仲裁案件,审核未通过,理由为"+vo.getReason()+",请知晓,如非本人操作,请忽略本短信。";
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
|
||||
SmsUtils.sendSms(caseApplication, "1996949", caseAffiliate.getContactTelphone(), new String[]{caseAffiliate.getName(),caseApplication.getCaseNum(),vo.getReason()});
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
+66
-321
@@ -33,30 +33,25 @@ import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.ZipFileUtils;
|
||||
import com.tencentyun.TLSSigAPIv2;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -65,8 +60,6 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static cn.hutool.system.SystemUtil.getUserInfo;
|
||||
import static com.google.common.io.Files.getFileExtension;
|
||||
import static com.ruoyi.common.constant.CaseApplicationConstants.HEAD_CHECK_ARBITRATION;
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
@@ -206,7 +199,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
) {
|
||||
roleIds = null;
|
||||
}
|
||||
if ("申请人".equals(role.getRoleName()) || "被申请人".equals(role.getRoleName())) {
|
||||
if ("申请人" .equals(role.getRoleName()) || "被申请人" .equals(role.getRoleName())) {
|
||||
caseApplication.setUserId(userId);
|
||||
}
|
||||
if (StrUtil.contains(role.getRoleName(), "代理")) {
|
||||
@@ -272,8 +265,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<Long> caseIds = list.stream().map(CaseApplication::getId).collect(Collectors.toList());
|
||||
List<CaseAffiliateEntity> affiliatesList = caseAffiliateMapper.selectCaseAffiliateByCaseIds(caseIds);
|
||||
// 根据案件id分组
|
||||
Map<Long, List<CaseAffiliateEntity>> affiliateMap=new HashMap<>();
|
||||
if(CollectionUtil.isNotEmpty(affiliatesList)){
|
||||
Map<Long, List<CaseAffiliateEntity>> affiliateMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(affiliatesList)) {
|
||||
affiliateMap = affiliatesList.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getCaseAppliId));
|
||||
}
|
||||
for (CaseApplication vo : list) {
|
||||
@@ -289,7 +282,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
vo.setAgentFlag(0);
|
||||
} else {
|
||||
// todo 如果案件流程id变了需要改
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), vo.getCreateBy()) && agentFlag ) {
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), vo.getCreateBy()) && agentFlag) {
|
||||
vo.setAgentFlag(1);
|
||||
} else {
|
||||
vo.setAgentFlag(0);
|
||||
@@ -299,7 +292,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
vo.setAgentFlag(0);
|
||||
}
|
||||
// 设置申请人和被申请人
|
||||
if ( affiliateMap.containsKey(vo.getId())) {
|
||||
if (affiliateMap.containsKey(vo.getId())) {
|
||||
List<CaseAffiliateEntity> affiliates = affiliateMap.get(vo.getId());
|
||||
StringBuilder applicantName = new StringBuilder();
|
||||
StringBuilder respondentName = new StringBuilder();
|
||||
@@ -353,7 +346,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
List<Integer> caseStatusList = new ArrayList<>();
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
||||
caseApplication.setCreateBy(String.valueOf(sysUser.getUserName()));
|
||||
// caseApplication.setCreateBy(String.valueOf(sysUser.getUserName()));
|
||||
toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication, caseStatusList, null);
|
||||
if (toDoCount == null) {
|
||||
toDoCount = new ToDoCount();
|
||||
@@ -382,7 +375,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
) {
|
||||
roleIds = null;
|
||||
}
|
||||
if ("申请人".equals(role.getRoleName()) || "被申请人".equals(role.getRoleName())) {
|
||||
if ("申请人" .equals(role.getRoleName()) || "被申请人" .equals(role.getRoleName())) {
|
||||
caseApplication.setUserId(userId);
|
||||
}
|
||||
if (StrUtil.contains(role.getRoleName(), "代理")) {
|
||||
@@ -514,12 +507,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
caseApplication.setLockStatus(1);
|
||||
int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
//1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信
|
||||
//发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("1975139");
|
||||
|
||||
// 发送开庭日期通知短信
|
||||
sendHearDateMessage(caseApplication, request, "1975139");
|
||||
sendHearDateMessage(caseApplication, "1975139");
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
||||
return rows;
|
||||
@@ -676,9 +666,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
|
||||
String substrTwo = filestr.substring(allindex.get(6) + 1, allindex.get(7));
|
||||
Integer annexType = null;
|
||||
if ("申请书".equals(substrTwo)) {
|
||||
if ("申请书" .equals(substrTwo)) {
|
||||
annexType = 1;
|
||||
} else if ("证据材料".equals(substrTwo)) {
|
||||
} else if ("证据材料" .equals(substrTwo)) {
|
||||
annexType = 2;
|
||||
}
|
||||
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
@@ -720,10 +710,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord) {
|
||||
return smsRecordMapper.getSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -1176,98 +1163,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 组装申请代理人信息
|
||||
*
|
||||
* @param caseAffiliate
|
||||
*/
|
||||
private String buildAgentInfo(CaseAffiliate caseAffiliate, Long roleId) {
|
||||
if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
|
||||
|
||||
// 组装申请机构代理人信息,用户表新增并且和部门关联
|
||||
// 根据代理人手机号去用户表查询,有修改,么有新增
|
||||
SysUser agentUser = sysUserMapper.selectUserByPhone(caseAffiliate.getContactTelphoneAgent());
|
||||
if (agentUser == null) {
|
||||
agentUser = new SysUser();
|
||||
agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
|
||||
agentUser.setNickName(caseAffiliate.getNameAgent());
|
||||
agentUser.setUserName(caseAffiliate.getContactTelphoneAgent());
|
||||
agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
|
||||
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
|
||||
int insertUserRow = sysUserMapper.insertUser(agentUser);
|
||||
// 新增角色为申请人
|
||||
ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(agentUser.getUserId());
|
||||
sysUserRole.setRoleId(roleId);
|
||||
sysUserRoles.add(sysUserRole);
|
||||
if (CollectionUtil.isNotEmpty(sysUserRoles)) {
|
||||
userRoleMapper.batchUserRole(sysUserRoles);
|
||||
}
|
||||
if (insertUserRow > 0) {
|
||||
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
||||
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setCaseId(caseAffiliate.getCaseAppliId());
|
||||
request.setTemplateId("1956159");
|
||||
request.setPhone(agentUser.getPhonenumber());
|
||||
request.setTemplateParamSet(new String[]{agentUser.getNickName()});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(caseAffiliate.getCaseAppliId());
|
||||
caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
} else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
|
||||
// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确";
|
||||
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
|
||||
return "该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确";
|
||||
} else {
|
||||
return "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确";
|
||||
}
|
||||
} else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
|
||||
// 同步用户表和案件关联人表的手机号和名称
|
||||
caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
|
||||
caseAffiliate.setNameAgent(agentUser.getNickName());
|
||||
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
||||
if (StrUtil.isNotEmpty(agentUser.getIdCard())) {
|
||||
caseAffiliate.setIdentityNumAgent(agentUser.getIdCard());
|
||||
} else {
|
||||
caseAffiliate.setIdentityNumAgent(caseAffiliate.getIdentityNumAgent());
|
||||
}
|
||||
List<Long> longList = new ArrayList<>();
|
||||
// 新增角色为申请人
|
||||
if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
|
||||
longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||
if (!longList.contains(roleId)) {
|
||||
insertAgentUserRole(agentUser, roleId);
|
||||
}
|
||||
} else {
|
||||
|
||||
insertAgentUserRole(agentUser, roleId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色为申请人
|
||||
@@ -1401,15 +1296,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
if(StrUtil.isEmpty(annexPath)){
|
||||
if (StrUtil.isEmpty(annexPath)) {
|
||||
continue;
|
||||
}
|
||||
// String annexPath =annexName.replace("/profile/","/home/ruoyi/uploadPath/");
|
||||
|
||||
caseAttach.setAnnexPath(annexPath);
|
||||
caseAttach.setAnnexName(caseAttach.getAnnexName());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
caseApplicationselect.setCaseAttachList(caseAttachList);
|
||||
@@ -1423,8 +1314,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<CaseAffiliateBase> resList = new ArrayList<>();
|
||||
affiliateVO.setApplicant(applicantList);
|
||||
affiliateVO.setRes(resList);
|
||||
StringBuffer applicantName=new StringBuffer();
|
||||
StringBuffer respondentName=new StringBuffer();
|
||||
StringBuffer applicantName = new StringBuffer();
|
||||
StringBuffer respondentName = new StringBuffer();
|
||||
affliateMap.forEach((k, v) -> {
|
||||
CaseAffiliateBase affiliateBase = null;
|
||||
|
||||
@@ -1445,7 +1336,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
} else {
|
||||
// 组织机构
|
||||
if ( StrUtil.isNotEmpty(affiliate.getApplicantOrgName())
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicantOrgName())
|
||||
&& !applicantName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) {
|
||||
applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
@@ -1463,14 +1354,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
resBase.setRes(affiliate);
|
||||
if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) {
|
||||
if ( StrUtil.isNotEmpty(affiliate.getName())
|
||||
if (StrUtil.isNotEmpty(affiliate.getName())
|
||||
&& !respondentName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) {
|
||||
|
||||
respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
} else {
|
||||
// 组织机构
|
||||
if ( StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) {
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) {
|
||||
respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
}
|
||||
@@ -1495,8 +1386,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
});
|
||||
caseApplicationselect.setAffiliate(affiliateVO);
|
||||
caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(),Constants.CN_SPLIT_COMMA));
|
||||
caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(),Constants.CN_SPLIT_COMMA));
|
||||
caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA));
|
||||
caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA));
|
||||
}
|
||||
caseApplicationselect.setArbitrateRecord(arbitrateRecordselect);
|
||||
if (arbitrateRecordselect != null) {
|
||||
@@ -1771,10 +1662,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == 3) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
if(StrUtil.isEmpty(annexPath)){
|
||||
if (StrUtil.isEmpty(annexPath)) {
|
||||
throw new ServiceException("文件找不到");
|
||||
}
|
||||
String path = annexPath.replace("/profile/","/home/ruoyi/uploadPath/");
|
||||
String path = annexPath.replace("/profile/", "/home/ruoyi/uploadPath/");
|
||||
// System.out.println("这是查询到的裁决书路径" + path);
|
||||
// String path = "D:\\home\\新裁决书模板.docx";
|
||||
//获取文件上传地址
|
||||
@@ -2038,7 +1929,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
//查询案件详细信息
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
//发短信给申请人
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
List<CaseAffiliateEntity> affiliates = selectAfflicatesByCaseId(id);
|
||||
if (affiliates != null && affiliates.size() > 0) {
|
||||
// 申请操作人
|
||||
@@ -2047,27 +1937,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
|
||||
CaseAffiliateEntity affiliate = applicantAffiliateOpt.get();
|
||||
String caseName = "仲裁";
|
||||
String caseNum = caseApplication1.getCaseNum();
|
||||
request.setPhone(affiliate.getPhone());
|
||||
request.setTemplateId("2018697");
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseName, caseNum, caseCheckReject});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplication.getId());
|
||||
smsSendRecord.setCaseNum(caseNum);
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已拒绝,拒接原因:" + caseCheckReject;
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
SmsUtils.sendSms(caseApplication1, "2018697",affiliate.getPhone(), new String[]{affiliate.getName(),caseName,caseApplication1.getCaseNum(),caseCheckReject});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2098,7 +1969,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
String returnResult = "短信发送成功";
|
||||
// 需要申请模板,申请人,被申请人发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
String startFormat = "";
|
||||
String endFormat = "";
|
||||
// 创建房间短信通知
|
||||
@@ -2113,40 +1983,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
endFormat = sdf.format(endDate);
|
||||
}
|
||||
// 预约会议短信模板
|
||||
request.setTemplateId("1983711");
|
||||
|
||||
|
||||
for (CaseAffiliateEntity affiliate : afflicates) {
|
||||
if (affiliate.getOperatorFlag() == 1) {
|
||||
// 操作人发送短信短信
|
||||
|
||||
request.setPhone(affiliate.getPhone());
|
||||
// 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。
|
||||
request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo(), startFormat + "-" + endFormat});
|
||||
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(messageVO.getId());
|
||||
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + affiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + "会议时间为" + startFormat + "-" + endFormat + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
||||
smsSendRecord.setSendContent(content);
|
||||
|
||||
String userName;
|
||||
try {
|
||||
userName = getUsername();
|
||||
} catch (Exception e) {
|
||||
userName = "admin";
|
||||
}
|
||||
smsSendRecord.setCreateBy(userName);
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
SmsUtils.sendSms(caseApplicationselect, "1983711", affiliate.getPhone(), new String[]{affiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo(), startFormat + "-" + endFormat});
|
||||
}
|
||||
}
|
||||
return returnResult;
|
||||
@@ -2549,7 +2389,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
}
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(),CaseApplicationConstants. CONFIRMDED_PENDING_TRIAL_SUBMMIT, "");
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, "");
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -2569,30 +2409,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1);
|
||||
if (caseApplications != null && caseApplications.size() > 0) {
|
||||
for (CaseApplication caseApplicationse : caseApplications) {
|
||||
// Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId());
|
||||
caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
|
||||
caseApplicationse.setIsAgreePendTral(isAgreePendTral);
|
||||
if (isAgreePendTral != null && isAgreePendTral == 1) {
|
||||
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
|
||||
} else {
|
||||
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
|
||||
// 仲裁员信息
|
||||
if (arbitrators != null && arbitrators.size() > 0) {
|
||||
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
|
||||
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
|
||||
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
|
||||
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
|
||||
caseApplicationse.setArbitratorId(idstr);
|
||||
caseApplicationse.setArbitratorName(arbitratorNamestr);
|
||||
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
|
||||
}
|
||||
}
|
||||
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("2033619");
|
||||
sendHearDateMessage(caseApplicationse, request, "2033619");
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
|
||||
caseApplicationService.pendTralSure(caseApplicationse);
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -2611,14 +2428,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
int rows = 0;
|
||||
if (caseApplications != null && caseApplications.size() > 0) {
|
||||
for (CaseApplication caseApplicationse : caseApplications) {
|
||||
// Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId());
|
||||
// 秘书核验裁决书,流转到待仲裁员审核裁决书
|
||||
caseApplicationse.setCaseStatus(HEAD_CHECK_ARBITRATION);
|
||||
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
|
||||
// ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
||||
// arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
|
||||
caseApplicationService.verificationArbitrateRecord(caseApplicationse);
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("这个批号没有批量核验裁决书的案件");
|
||||
@@ -2639,38 +2449,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
|
||||
if (caseApplications1 != null && caseApplications1.size() > 0) {
|
||||
for (CaseApplication caseApplicationse : caseApplications1) {
|
||||
// Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId());
|
||||
if (agreeOrNotCheck.intValue() == 1) {
|
||||
caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION);
|
||||
caseApplicationService.arbitratorCheckArbitrateRecord(caseApplicationse);
|
||||
|
||||
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, "");
|
||||
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
|
||||
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
||||
|
||||
ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
|
||||
arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId());
|
||||
ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel);
|
||||
if (arbitrateRecordnew != null) {
|
||||
arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
|
||||
arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
|
||||
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
|
||||
} else {
|
||||
arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
|
||||
arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
|
||||
arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
|
||||
}
|
||||
caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
||||
|
||||
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
|
||||
String notes = "";
|
||||
if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())) {
|
||||
notes = "仲裁员驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getArbitrateReject();
|
||||
}
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -3064,10 +2844,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
|
||||
//发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("2033619");
|
||||
// 发送开庭日期通知短信
|
||||
sendHearDateMessage(caseApplication, request, "2033619");
|
||||
sendHearDateMessage(caseApplication, "2033619");
|
||||
// 新增日志
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
|
||||
|
||||
@@ -3079,9 +2857,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
* 发送开庭日期通知短信
|
||||
*
|
||||
* @param caseApplication
|
||||
* @param request
|
||||
* @param
|
||||
*/
|
||||
private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request, String templateId) {
|
||||
private void sendHearDateMessage(CaseApplication caseApplication, String templateId) {
|
||||
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplicationselect == null) {
|
||||
throw new ServiceException("案件不存在");
|
||||
@@ -3109,39 +2887,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<SysUser> userList = sysUserMapper.selectUserListByIds(idList);
|
||||
if (CollectionUtil.isNotEmpty(userList)) {
|
||||
for (SysUser user : userList) {
|
||||
//给仲裁员发送短信通知
|
||||
request.setPhone(user.getPhonenumber());
|
||||
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
||||
String name = user.getNickName();
|
||||
if (templateId.equals("2033619")) {
|
||||
request.setTemplateParamSet(new String[]{name, caseNum});
|
||||
|
||||
SmsUtils.sendSms(caseApplicationselect, "2033619", user.getPhonenumber(), new String[]{user.getNickName(),caseApplicationselect.getCaseNum()});
|
||||
|
||||
}
|
||||
if (templateId.equals("1975139")) {
|
||||
request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
||||
|
||||
SmsUtils.sendSms(caseApplicationselect, "1975139", user.getPhonenumber(), new String[]{user.getNickName(),caseApplicationselect.getCaseNum(),hearDatestr});
|
||||
|
||||
}
|
||||
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplicationselect.getId());
|
||||
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "";
|
||||
if (templateId.equals("2033619")) {
|
||||
content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
|
||||
}
|
||||
if (templateId.equals("1975139")) {
|
||||
content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
||||
}
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3151,38 +2907,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
for (int j = 0; j < afflicates.size(); j++) {
|
||||
CaseAffiliateEntity caseAffiliateselect = afflicates.get(j);
|
||||
if (caseAffiliateselect.getOperatorFlag() != null && caseAffiliateselect.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(caseAffiliateselect.getPhone())) {
|
||||
//给申请人、被申请人发送短信通知
|
||||
request.setPhone(caseAffiliateselect.getPhone());
|
||||
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
||||
String name = caseAffiliateselect.getName();
|
||||
if (templateId.equals("2033619")) {
|
||||
request.setTemplateParamSet(new String[]{name, caseNum});
|
||||
SmsUtils.sendSms(caseApplicationselect, "2033619",caseAffiliateselect.getPhone(), new String[]{caseAffiliateselect.getName(),caseApplicationselect.getCaseNum()});
|
||||
|
||||
}
|
||||
if (templateId.equals("1975139")) {
|
||||
request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
||||
|
||||
SmsUtils.sendSms(caseApplicationselect, "1975139",caseAffiliateselect.getPhone(), new String[]{caseAffiliateselect.getName(),caseApplicationselect.getCaseNum(),hearDatestr});
|
||||
|
||||
}
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplication.getId());
|
||||
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "";
|
||||
if (templateId.equals("2033619")) {
|
||||
content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
|
||||
}
|
||||
if (templateId.equals("1975139")) {
|
||||
content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
||||
}
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3446,8 +3180,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) {
|
||||
return caseZipImportImpl.zipImport(file, templateId);
|
||||
public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId, Integer applicantType, Integer resType) {
|
||||
return caseZipImportImpl.zipImport(file, templateId, applicantType, resType);
|
||||
}
|
||||
|
||||
|
||||
@@ -3527,6 +3261,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
caseApplication.setCreateTime(new Date());
|
||||
caseApplication.setRegisterDate(new Date());
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
||||
|
||||
// 设置编码
|
||||
caseApplication.setCaseNum(generateCaseNum());
|
||||
// 设置批号
|
||||
@@ -3627,7 +3362,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
affiliate.setCaseAppliId(caseApplication.getId());
|
||||
boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
|
||||
if (b || StrUtil.isEmpty(affiliate.getName())) {
|
||||
boolean importFlag= caseApplication.getImportFlag() != null && !caseApplication.getImportFlag().equals( 2 );
|
||||
if ((b || StrUtil.isEmpty(affiliate.getName())) && importFlag) {
|
||||
return operatorCount;
|
||||
}
|
||||
affiliate.setGroupOrder(groupOrder);
|
||||
@@ -3748,7 +3484,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
@Transactional
|
||||
public void insertAfficateUser(CaseAffiliateEntity affiliate, List<Long> roleIdList, boolean updateFlag) {
|
||||
|
||||
if (StrUtil.isEmpty(affiliate.getEmail())) {
|
||||
if (StrUtil.isEmpty(affiliate.getEmail()) && StrUtil.isEmpty(affiliate.getPhone())) {
|
||||
return;
|
||||
}
|
||||
SysUser user = null;
|
||||
@@ -3759,8 +3495,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 修改案件则根据userId查用户
|
||||
if (affiliate.getUserId() != null) {
|
||||
user = sysUserMapper.selectUserById(affiliate.getUserId());
|
||||
} else {
|
||||
} else if(StrUtil.isNotEmpty(affiliate.getEmail())){
|
||||
user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getPhone())){
|
||||
user = sysUserMapper.selectUserByPhone(affiliate.getPhone());
|
||||
}
|
||||
}
|
||||
// 判断该用户是否存在
|
||||
@@ -3769,7 +3507,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
user = new SysUser();
|
||||
user.setPosition(affiliate.getPosition());
|
||||
user.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
if(StrUtil.isNotEmpty(affiliate.getPhone())){
|
||||
user.setUserName(affiliate.getPhone());
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getEmail())) {
|
||||
user.setUserName(affiliate.getEmail());
|
||||
}
|
||||
user.setNickName(affiliate.getName());
|
||||
user.setEmail(affiliate.getEmail());
|
||||
user.setHome(affiliate.getHome());
|
||||
@@ -3787,7 +3529,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 查询该角色是否存在申请人角色
|
||||
List<Long> roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId());
|
||||
for (Long roleId : roleIdList) {
|
||||
if(roleId==null){
|
||||
if (roleId == null) {
|
||||
continue;
|
||||
}
|
||||
if (CollectionUtil.isEmpty(roleIds) && !roleIds.contains(roleId)) {
|
||||
@@ -3815,7 +3557,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 查询该角色是否存在申请人角色
|
||||
List<Long> roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId());
|
||||
for (Long roleId : roleIdList) {
|
||||
if(roleId==null){
|
||||
if (roleId == null) {
|
||||
continue;
|
||||
}
|
||||
if (CollectionUtil.isEmpty(roleIds) || !roleIds.contains(roleId)) {
|
||||
@@ -3846,9 +3588,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(res)) {
|
||||
for (int i = 0; i < res.size(); i++) {
|
||||
// 申请人
|
||||
// 被申请人
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, false);
|
||||
// 申请人代理人
|
||||
// 被申请人代理人
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, false);
|
||||
}
|
||||
}
|
||||
@@ -3905,6 +3647,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
private BigDecimal calculateFee(BigDecimal caseSubjectAmount) {
|
||||
if(caseSubjectAmount==null){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (caseSubjectAmount.equals(BigDecimal.ZERO)) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
@@ -3955,7 +3700,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 保存附件
|
||||
if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
|
||||
for (CaseAttach caseAttach : caseApplication.getCaseAttachList()) {
|
||||
if(caseAttach==null){
|
||||
if (caseAttach == null) {
|
||||
continue;
|
||||
}
|
||||
caseAttach.setCaseAppliId(caseApplication.getId());
|
||||
@@ -3998,7 +3743,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
// 插入附件表日志
|
||||
if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
|
||||
List<CaseAttach> filterList = caseApplication.getCaseAttachList().stream().filter(c -> c!=null && c.getAnnexType().equals(2)).collect(Collectors.toList());
|
||||
List<CaseAttach> filterList = caseApplication.getCaseAttachList().stream().filter(c -> c != null && c.getAnnexType().equals(2)).collect(Collectors.toList());
|
||||
// 插入日志附件表
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
for (CaseAttach caseAttach : filterList) {
|
||||
|
||||
+3
-41
@@ -1,39 +1,24 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.WordUtil;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||
@@ -126,8 +111,6 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
if (i > 0) {
|
||||
String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
|
||||
//发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
//获取案件关联人信息
|
||||
List<CaseAffiliateEntity> caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication1.getId());
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
@@ -142,28 +125,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
operatorList.add(applicantAffiliateOpt.get());
|
||||
operatorList.add(resAffiliateOpt.get());
|
||||
for (CaseAffiliateEntity affiliate : operatorList) {
|
||||
request.setTemplateId("1931000");
|
||||
request.setPhone(affiliate.getPhone());
|
||||
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
||||
// 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplication.getId());
|
||||
smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。";
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
SmsUtils.sendSms(caseApplication1, "1931000", affiliate.getPhone(), new String[]{affiliate.getName(),caseApplication1.getCaseNum(),arbitratMethodStr});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-35
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -8,13 +7,10 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
|
||||
@@ -23,11 +19,8 @@ import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseDetailVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -54,8 +47,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private SmsRecordMapper smsRecordMapper;
|
||||
// @Autowired
|
||||
// private SmsRecordMapper smsRecordMapper;
|
||||
@Autowired
|
||||
private ICaseApplicationService caseApplicationService;
|
||||
|
||||
@@ -359,33 +352,11 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
SysUser user= sysUserMapper.selectUserByRole("法律顾问");
|
||||
if(user!=null){
|
||||
// 新增短信记录
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
// 1992106 普通短信 修改证据资料通知 尊敬的{1}用户,您的{2}仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。
|
||||
request.setTemplateId("1992106");
|
||||
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
|
||||
request.setPhone(user.getPhonenumber());
|
||||
request.setTemplateParamSet(new String[]{user.getNickName(),caseApplication.getCaseNum()});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(id);
|
||||
|
||||
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + user.getNickName() + ",您的"+caseApplication.getCaseNum()+"仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。";
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
|
||||
SmsUtils.sendSms(caseApplication, "1992106", user.getPhonenumber(), new String[]{user.getNickName(),caseApplication.getCaseNum()});
|
||||
|
||||
}
|
||||
|
||||
|
||||
+10
-52
@@ -5,25 +5,22 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.ElegentPay;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CasePayListVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
import com.ruoyi.dto.PayResponse;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -153,8 +150,6 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
}
|
||||
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
//发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
List<CaseAffiliateEntity> caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication.getId());
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
// 申请操作人
|
||||
@@ -170,58 +165,21 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
CaseAffiliateEntity app = applicantAffiliateOpt.get();
|
||||
CaseAffiliateEntity res = resAffiliateOpt.get();
|
||||
//申请人
|
||||
String name = app.getName();
|
||||
request.setPhone(app.getPhone());
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplication.getId());
|
||||
smsSendRecord.setCaseNum(caseNum);
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){
|
||||
// 同意
|
||||
request.setTemplateId("1928003"); //案件受理通知
|
||||
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
|
||||
smsSendRecord.setSendContent("尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。");
|
||||
SmsUtils.sendSms(caseApplication1, "1928003", app.getPhone(), new String[]{app.getName(),caseName,caseApplication1.getCaseNum()});
|
||||
}else {
|
||||
//拒绝 2074402,尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||
request.setTemplateId("2074402"); //确认缴费不通过通知
|
||||
request.setTemplateParamSet(new String[]{name, caseNum,batchCaseApplication.getCaseCheckReject()});
|
||||
smsSendRecord.setSendContent("尊敬的" + name + "用户,您的" + caseNum + "案件,确认缴费未通过,理由为" + batchCaseApplication.getCaseCheckReject() + ",请知晓,如非本人操作,请忽略本短信。");
|
||||
SmsUtils.sendSms(caseApplication1, "2074402", app.getPhone(), new String[]{app.getName(),caseApplication1.getCaseNum(),batchCaseApplication.getCaseCheckReject()});
|
||||
|
||||
}
|
||||
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
|
||||
|
||||
|
||||
//被申请人
|
||||
if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) {
|
||||
|
||||
request.setPhone(res.getPhone());
|
||||
request.setTemplateId("1952840");
|
||||
// 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信
|
||||
name = res.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
|
||||
aBoolean = SmsUtils.sendSms(request);
|
||||
//保存短信发送记录
|
||||
smsSendRecord = new SmsSendRecord();
|
||||
smsSendRecord.setCaseId(caseApplication.getId());
|
||||
smsSendRecord.setCaseNum(caseNum);
|
||||
smsSendRecord.setPhone(request.getPhone());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信";
|
||||
smsSendRecord.setSendContent(content);
|
||||
smsSendRecord.setCreateBy(getUsername());
|
||||
if (aBoolean) {
|
||||
smsSendRecord.setSendStatus(1);
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(0);
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
SmsUtils.sendSms(caseApplication1, "1952840", res.getPhone(), new String[]{res.getName(),caseName,caseApplication1.getCaseNum()});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+124
-263
@@ -25,8 +25,13 @@ import com.ruoyi.common.utils.thread.ThreadPoolUtil;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateBase;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.task.CaseZipImportTask;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
|
||||
@@ -100,9 +105,17 @@ public class CaseZipImportImpl {
|
||||
@Autowired
|
||||
private CaseZipImportImpl caseZipImportImpl;
|
||||
|
||||
|
||||
@Transactional
|
||||
public AjaxResult zipImport(MultipartFile file, Long templateId) {
|
||||
/**
|
||||
* * @param applicantType 申请人类型,自然人-1,机构-2
|
||||
* * @param resType 被申请人类型,自然人-1,机构-2
|
||||
* @param file
|
||||
* @param templateId
|
||||
* @param applicantType
|
||||
* @param resType
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public AjaxResult zipImport(MultipartFile file, Long templateId,Integer applicantType,Integer resType) {
|
||||
UUID uuid = UUID.randomUUID();
|
||||
|
||||
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + uuid + "/";
|
||||
@@ -133,24 +146,9 @@ public class CaseZipImportImpl {
|
||||
SysDictData sysDictData = new SysDictData();
|
||||
sysDictData.setDictType("case_built_type");
|
||||
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
|
||||
// 查询所有的组织机构,组装成map
|
||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||
// 所有部门
|
||||
Map<String, Long> deptMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(deptList)) {
|
||||
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
|
||||
|
||||
}
|
||||
// 查询申请人角色id
|
||||
roleId = roleMapper.selectRoleIdByName("申请人");
|
||||
/**
|
||||
* 用户表已存在的用户
|
||||
*/
|
||||
List<SysUser> existUsers = userMapper.selectUserList(new SysUser());
|
||||
Map<String, SysUser> userMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(existUsers)) {
|
||||
userMap = existUsers.stream().collect(Collectors.toMap(SysUser::getPhonenumber, Function.identity(), (n1, n2) -> n2));
|
||||
}
|
||||
//查询出当天的案件编号的最大值
|
||||
String currentDay = DateUtils.dateTime();
|
||||
String caseNum = "zc" + currentDay;
|
||||
@@ -171,13 +169,13 @@ public class CaseZipImportImpl {
|
||||
|
||||
File[] files = directory.listFiles();
|
||||
// todo
|
||||
List<CaseApplication> caseApplications = new ArrayList<>();
|
||||
List<CaseApplicationDTO> caseApplications = new ArrayList<>();
|
||||
for (File file1 : files) {
|
||||
if (file1.isDirectory() && file1.listFiles() != null) {
|
||||
|
||||
for (File file2 : file1.listFiles()) {
|
||||
|
||||
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser());
|
||||
CaseApplicationDTO caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, dictDataList, applicantType,resType);
|
||||
if (caseApplication != null) {
|
||||
caseApplications.add(caseApplication);
|
||||
}
|
||||
@@ -206,19 +204,24 @@ public class CaseZipImportImpl {
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装案件内置字段
|
||||
* @param file
|
||||
* @param templateId
|
||||
* @param fatchRuleList
|
||||
* @param fatchRuleMap
|
||||
* @param dictDataList
|
||||
* @param applicantType 申请人类型,自然人-1,机构-2
|
||||
* @param resType 被申请人类型,自然人-1,机构-2
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser) {
|
||||
public CaseApplicationDTO buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap,
|
||||
List<SysDictData> dictDataList,
|
||||
Integer applicantType,Integer resType) {
|
||||
// fileMap<caseId, List<File>>
|
||||
Map<String, String> fatchMap = new HashMap<>();
|
||||
Integer batchNumber = caseApplicationMapper.selectMaxBatchNumber();
|
||||
AtomicInteger maxBatchNumber = new AtomicInteger();
|
||||
if (batchNumber == null) {
|
||||
maxBatchNumber.set(1);
|
||||
|
||||
} else {
|
||||
maxBatchNumber.set(batchNumber+1);
|
||||
|
||||
}
|
||||
Map<String, String> fileMap = findFile(file, fatchRuleList);
|
||||
if (fileMap != null && fileMap.size()> 0) {
|
||||
// 根据抓取规则循环抓取
|
||||
@@ -228,15 +231,9 @@ public class CaseZipImportImpl {
|
||||
}
|
||||
|
||||
if (fatchMap.size() > 0) {
|
||||
|
||||
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
|
||||
// SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
// request.setTemplateId("1956159");
|
||||
|
||||
// 新增的案件
|
||||
// 组装案件内置字段主表内容
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(IdWorkerUtil.getId());
|
||||
CaseApplicationDTO caseApplication = new CaseApplicationDTO();
|
||||
caseApplication.setTemplateId(templateId);
|
||||
Map<Integer, List<FatchRule>> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
|
||||
// 自定义字段,组装columnValue表
|
||||
@@ -252,39 +249,13 @@ public class CaseZipImportImpl {
|
||||
columnValue.setCaseId(caseApplication.getId());
|
||||
columnValueList.add(columnValue);
|
||||
});
|
||||
caseApplication.setColumnValues(columnValueList);
|
||||
caseApplication.setColumnValueList(columnValueList);
|
||||
}
|
||||
|
||||
// 角色用户
|
||||
List<SysUserRole> userRoleList = new ArrayList<>();
|
||||
|
||||
// 组装机构
|
||||
List<SysDept> sysDepts = new ArrayList<>();
|
||||
// 案件附件
|
||||
List<CaseAttach> caseAttachs = new ArrayList<>();
|
||||
//发送短信列表
|
||||
List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
|
||||
// 短信记录
|
||||
List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
|
||||
|
||||
// 需要新增的用户
|
||||
List<SysUser> addUsers = new ArrayList<>();
|
||||
// caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
||||
caseApplication.setCaseLogId(IdWorkerUtil.getId());
|
||||
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
||||
caseApplication.setCaseAppliId(caseApplication.getId());
|
||||
|
||||
// 设置批号
|
||||
caseApplication.setBatchNumber(maxBatchNumber.get());
|
||||
// 设置编号
|
||||
String maxCaseNumStr = generateCaseNum();
|
||||
caseApplication.setCaseNum(maxCaseNumStr);
|
||||
caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin");
|
||||
caseApplication.setVersion(1);
|
||||
// 组装案件内置字段主表内容
|
||||
|
||||
// 组装内置字段
|
||||
buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
|
||||
buildDefaultColumn(caseApplication, dictDataList, fatchMap, applicantType,resType);
|
||||
// 组装附件
|
||||
for (Map.Entry<String, String> entry : fileMap.entrySet()) {
|
||||
String fileUrl = entry.getValue();
|
||||
@@ -332,7 +303,7 @@ public class CaseZipImportImpl {
|
||||
|
||||
CaseAttach caseAttach = new CaseAttach();
|
||||
caseAttach.setCaseAppliId(caseApplication.getId());
|
||||
filePath=filePath.replace("home/ruoyi/uploadPath/","profile/");
|
||||
filePath=fileUrl.replace("home/ruoyi/uploadPath/","profile/");
|
||||
caseAttach.setAnnexPath(filePath);
|
||||
|
||||
caseAttach.setAnnexName(name);
|
||||
@@ -350,59 +321,12 @@ public class CaseZipImportImpl {
|
||||
}
|
||||
}
|
||||
caseApplication.setCaseAttachList(caseAttachs);
|
||||
|
||||
// 案件压缩包导入
|
||||
caseApplication.setImportFlag(2);
|
||||
// 多线程执行
|
||||
// List<MultipleThreadListParam> execList = new ArrayList<>();
|
||||
// if (CollectionUtil.isNotEmpty(addUsers)) {
|
||||
// Function<List<SysUser>, Integer> function = userMapper::batchSave;
|
||||
// execList.add(new MultipleThreadListParam(function, addUsers));
|
||||
// }
|
||||
|
||||
// 多线程执行
|
||||
// ThreadPoolUtil.execute(() -> {
|
||||
try {
|
||||
|
||||
caseApplicationMapper.insertCaseApplication(caseApplication);
|
||||
// 新增日志
|
||||
// CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_INSERT, "",loginUser);
|
||||
caseApplicationLogMapper.insert(caseApplication);
|
||||
// 多线程执行
|
||||
if (CollectionUtil.isNotEmpty(addUsers)) {
|
||||
userMapper.batchSave(addUsers);
|
||||
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(userRoleList)) {
|
||||
userRoleMapper.batchUserRole(userRoleList);
|
||||
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(sysDepts)) {
|
||||
sysDeptMapper.batchSave(sysDepts);
|
||||
|
||||
}
|
||||
// todo
|
||||
// if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) {
|
||||
//
|
||||
// caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
|
||||
// //todo
|
||||
//// caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
|
||||
// }
|
||||
if (CollectionUtil.isNotEmpty(caseAttachs)) {
|
||||
caseAttachMapper.batchSave(caseAttachs);
|
||||
caseAttachLogMapper.batchSave(caseAttachs);
|
||||
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(columnValueList)) {
|
||||
columnValueMapper.batchSave(columnValueList);
|
||||
columnValueLogMapper.batchSave(columnValueList);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("案件导入失败");
|
||||
}
|
||||
|
||||
// });
|
||||
// 新增
|
||||
caseApplicationService.insertOrUpdate(caseApplication);
|
||||
return caseApplication;
|
||||
}
|
||||
}
|
||||
@@ -712,33 +636,68 @@ public class CaseZipImportImpl {
|
||||
* @param caseApplication 案件信息
|
||||
* @param dictDataList 内置字段
|
||||
* @param fatchMap 抓取字段内容
|
||||
* @param applicantType 申请人类型,自然人-1,机构-2
|
||||
* @param resType 被申请人类型,自然人-1,机构-2
|
||||
*/
|
||||
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
|
||||
Map<String, Long> deptMap, List<SysDept> sysDepts,
|
||||
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
|
||||
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
|
||||
private void buildDefaultColumn(CaseApplicationDTO caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
|
||||
Integer applicantType,Integer resType) {
|
||||
// 组装内置字段
|
||||
if (CollectionUtil.isEmpty(dictDataList)) {
|
||||
return;
|
||||
}
|
||||
List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
||||
// 被申请人
|
||||
CaseAffiliate debtorAffiliate = new CaseAffiliate();
|
||||
debtorAffiliate.setCaseAppliId(caseApplication.getId());
|
||||
debtorAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId());
|
||||
// 申请人
|
||||
CaseAffiliate affiliate = new CaseAffiliate();
|
||||
affiliate.setCaseAppliLogId(caseApplication.getCaseLogId());
|
||||
affiliate.setCaseAppliId(caseApplication.getId());
|
||||
CaseAffiliateVO affiliateVO = new CaseAffiliateVO();
|
||||
List<CaseAffiliateBase> applicantList = new ArrayList<>();
|
||||
List<CaseAffiliateBase> resList = new ArrayList<>();
|
||||
affiliateVO.setApplicant(applicantList);
|
||||
affiliateVO.setRes(resList);
|
||||
CaseAffiliateBase affiliateBase = new CaseAffiliateBase();
|
||||
|
||||
CaseAffiliateBase resBase = new CaseAffiliateBase();
|
||||
CaseAffiliateEntity applicant = new CaseAffiliateEntity();
|
||||
applicant.setRoleType(1);
|
||||
if(applicantType.equals(1)){
|
||||
// 自然人
|
||||
applicant.setOrganizeFlag(0);
|
||||
applicant.setOperatorFlag(1);
|
||||
}else {
|
||||
// 机构
|
||||
applicant.setOrganizeFlag(1);
|
||||
}
|
||||
CaseAffiliateEntity applicantAgent = new CaseAffiliateEntity();
|
||||
applicantAgent.setRoleType(2);
|
||||
applicantAgent.setOrganizeFlag(0);
|
||||
applicantAgent.setOperatorFlag(1);
|
||||
CaseAffiliateEntity res = new CaseAffiliateEntity();
|
||||
res.setRoleType(3);
|
||||
if(resType.equals(1)){
|
||||
// 自然人
|
||||
res.setOrganizeFlag(0);
|
||||
res.setOperatorFlag(1);
|
||||
}else {
|
||||
// 机构
|
||||
res.setOrganizeFlag(1);
|
||||
}
|
||||
CaseAffiliateEntity resAgent = new CaseAffiliateEntity();
|
||||
resAgent.setRoleType(4);
|
||||
resAgent.setOrganizeFlag(0);
|
||||
resAgent.setOperatorFlag(1);
|
||||
affiliateBase.setApplicant(applicant);
|
||||
affiliateBase.setApplicantAgent(applicantAgent);
|
||||
resBase.setRes(res);
|
||||
resBase.setResAgent(resAgent);
|
||||
applicantList.add(affiliateBase);
|
||||
resList.add(resBase);
|
||||
affiliateVO.setApplicant(applicantList);
|
||||
affiliateVO.setRes(resList);
|
||||
for (SysDictData dictData : dictDataList) {
|
||||
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
|
||||
if (dictData.getDictLabel().contains("被申请人")) {
|
||||
// 组装被申请人内置自段
|
||||
buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId());
|
||||
buildDebtorColumn(dictData, fatchMap, res,resAgent);
|
||||
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|
||||
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
|
||||
// 组装申请人内置自段
|
||||
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList);
|
||||
buildAffilcateColumn(dictData, fatchMap, caseApplication,applicant,applicantAgent);
|
||||
} else if (dictData.getDictLabel().contains("合同编号")) {
|
||||
// 合同编号
|
||||
String contractNumber = fatchMap.get("合同编号" );
|
||||
@@ -754,13 +713,10 @@ public class CaseZipImportImpl {
|
||||
try {
|
||||
BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount);
|
||||
caseApplication.setCaseSubjectAmount(bigDecimal);
|
||||
//todo 暂时设置计费比率为0.01
|
||||
BigDecimal feeRate = new BigDecimal(0.01);
|
||||
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
caseApplication.setFeePayable(feePayable);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}else {
|
||||
caseApplication.setCaseSubjectAmount(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -773,14 +729,7 @@ public class CaseZipImportImpl {
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(affiliate)) {
|
||||
caseAffiliates.add(affiliate);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(debtorAffiliate)) {
|
||||
caseAffiliates.add(debtorAffiliate);
|
||||
}
|
||||
// todo
|
||||
// caseApplication.setCaseAffiliates(caseAffiliates);
|
||||
caseApplication.setAffiliate(affiliateVO);
|
||||
|
||||
}
|
||||
|
||||
@@ -789,134 +738,43 @@ public class CaseZipImportImpl {
|
||||
*
|
||||
* @param dictData 内置字段
|
||||
* @param fatchMap 抓取内容
|
||||
* @param affiliate 案件人员
|
||||
* @param applicant 申请人
|
||||
* @param applicantAgent 申请代理人
|
||||
*/
|
||||
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
|
||||
Map<String, Long> deptMap, List<SysDept> sysDepts,
|
||||
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, CaseApplication caseApplication,
|
||||
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
|
||||
|
||||
affiliate.setIdentityType(1);
|
||||
|
||||
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap,
|
||||
CaseApplicationDTO caseApplication,CaseAffiliateEntity applicant,
|
||||
CaseAffiliateEntity applicantAgent) {
|
||||
// 申请人
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "申请人姓名":
|
||||
affiliate.setName((fatchMap.get(dictData.getDictLabel())));
|
||||
if (StrUtil.isNotEmpty(affiliate.getName())) {
|
||||
// 组装申请机构
|
||||
// 将组织机构id设为申请人名称
|
||||
if (deptMap.containsKey(affiliate.getName())) {
|
||||
affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getName())));
|
||||
affiliate.setApplicationOrganName(affiliate.getName());
|
||||
} else {
|
||||
// 如果不存在则新增
|
||||
SysDept dept = new SysDept();
|
||||
dept.setParentId(0L);
|
||||
dept.setDeptName(affiliate.getName());
|
||||
dept.setAncestors("0");
|
||||
dept.setOrderNum(1);
|
||||
dept.setStatus("0");
|
||||
dept.setDelFlag("0");
|
||||
// dept.setCreateBy(getUsername());
|
||||
// dept.setUpdateBy(getUsername());
|
||||
dept.setDeptId(Long.valueOf(IdWorkerUtil.getId()));
|
||||
sysDepts.add(dept);
|
||||
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
||||
affiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
||||
affiliate.setApplicationOrganName(affiliate.getName());
|
||||
|
||||
}
|
||||
}
|
||||
applicant.setName((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "统一社会信用代码":
|
||||
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel())));
|
||||
applicant.setCode((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "身份证号":
|
||||
applicant.setIdCard((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "法定代表人":
|
||||
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
|
||||
applicant.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "法定代表人职位":
|
||||
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel())));
|
||||
applicant.setPosition((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "申请人住所":
|
||||
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel())));
|
||||
applicant.setHome((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "申请人联系地址":
|
||||
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()));
|
||||
applicant.setAddress(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人姓名":
|
||||
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()));
|
||||
applicantAgent.setName(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人联系电话":
|
||||
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()));
|
||||
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
|
||||
SysUser agentUser = null;
|
||||
// 用户已存在
|
||||
if (userMap.containsKey(affiliate.getContactTelphoneAgent())) {
|
||||
agentUser = userMap.get(affiliate.getContactTelphoneAgent());
|
||||
if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
||||
// 同步用户表和案件关联人表的手机号和名称
|
||||
affiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
|
||||
affiliate.setNameAgent(agentUser.getNickName());
|
||||
affiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
||||
if (StrUtil.isNotEmpty(agentUser.getIdCard())) {
|
||||
affiliate.setIdentityNumAgent(agentUser.getIdCard());
|
||||
} else {
|
||||
affiliate.setIdentityNumAgent(affiliate.getIdentityNumAgent());
|
||||
}
|
||||
List<Long> longList = new ArrayList<>();
|
||||
// 新增角色为申请人
|
||||
if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
|
||||
longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||
if (!longList.contains(roleId)) {
|
||||
insertAgentUserRole(agentUser, roleId, userRoleList);
|
||||
}
|
||||
} else {
|
||||
|
||||
insertAgentUserRole(agentUser, roleId, userRoleList);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// 用户不存在,新增
|
||||
agentUser = new SysUser();
|
||||
agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId()));
|
||||
agentUser.setIdCard(affiliate.getIdentityNumAgent());
|
||||
agentUser.setNickName(affiliate.getNameAgent());
|
||||
agentUser.setUserName(affiliate.getContactTelphoneAgent());
|
||||
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
||||
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
|
||||
addUsers.add(agentUser);
|
||||
userMap.put(agentUser.getPhonenumber(), agentUser);
|
||||
insertAgentUserRole(agentUser, roleId, userRoleList);
|
||||
|
||||
}
|
||||
// if (addUsers != null) {
|
||||
// SysUser finalAgentUser = agentUser;
|
||||
// if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) {
|
||||
// SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
// request.setTemplateId("1956159");
|
||||
// request.setPhone(agentUser.getPhonenumber());
|
||||
// request.setTemplateParamSet(new String[]{agentUser.getNickName()});
|
||||
// smsRequestList.add(request);
|
||||
// SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
// smsSendRecord.setCaseId(caseApplication.getId());
|
||||
// smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
||||
// smsSendRecord.setPhone(request.getPhone());
|
||||
// smsSendRecord.setSendTime(new Date());
|
||||
// String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
|
||||
// smsSendRecord.setSendContent(content);
|
||||
// // smsSendRecord.setCreateBy(getUsername());
|
||||
// smsSendRecords.add(smsSendRecord);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
applicantAgent.setPhone(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人电子邮件":
|
||||
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null);
|
||||
applicantAgent.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null);
|
||||
break;
|
||||
default:
|
||||
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
|
||||
@@ -944,19 +802,22 @@ public class CaseZipImportImpl {
|
||||
*
|
||||
* @param dictData 内置字段
|
||||
* @param fatchMap 抓取内容
|
||||
* @param debtorAffiliate 被申请人
|
||||
* @param res 被申请人
|
||||
* @param resAgent 被申请人代理
|
||||
*/
|
||||
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate, Long caseId) {
|
||||
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap,CaseAffiliateEntity res,CaseAffiliateEntity resAgent) {
|
||||
|
||||
debtorAffiliate.setIdentityType(2);
|
||||
// 被申请人
|
||||
// 被申请人在。
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "被申请人姓名":
|
||||
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() ));
|
||||
res.setName(fatchMap.get(dictData.getDictLabel() ));
|
||||
break;
|
||||
case "被申请人":
|
||||
res.setName(fatchMap.get(dictData.getDictLabel() ));
|
||||
break;
|
||||
case "被申请人身份证号":
|
||||
String identityNum = fatchMap.get(dictData.getDictLabel() );
|
||||
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() ));
|
||||
res.setIdCard(fatchMap.get(dictData.getDictLabel() ));
|
||||
// 出生年月日,从身份证抓取
|
||||
if (StrUtil.isNotEmpty(identityNum)) {
|
||||
identityNum = identityNum.replace("\n", "");
|
||||
@@ -970,21 +831,21 @@ public class CaseZipImportImpl {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
debtorAffiliate.setResponBirth(birthdayDate);
|
||||
res.setBirth(birthdayDate);
|
||||
}
|
||||
//从身份证抓取性别
|
||||
debtorAffiliate.setResponSex(identityNumMap.get("sexCode"));
|
||||
res.setSex(identityNumMap.get("sexCode"));
|
||||
}
|
||||
|
||||
break;
|
||||
case "被申请人住所":
|
||||
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() ));
|
||||
res.setHome(fatchMap.get(dictData.getDictLabel() ));
|
||||
break;
|
||||
case "被申请人联系电话":
|
||||
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() ));
|
||||
res.setPhone(fatchMap.get(dictData.getDictLabel() ));
|
||||
break;
|
||||
case "被申请人电子邮件":
|
||||
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null);
|
||||
res.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ public class DownFileService {
|
||||
CaseAttach caseAttach = new CaseAttach();
|
||||
caseAttach.setCaseAppliId(caseAppliId);
|
||||
caseAttach.setAnnexType(3);
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttach.setAnnexPath(saveName);
|
||||
caseAttach.setAnnexName("裁决书.pdf");
|
||||
caseAttachMapper.save(caseAttach);
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -144,7 +144,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
||||
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
String savePath = "/home/ruoyi/uploadPath/upload/";
|
||||
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
@@ -163,8 +162,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
CaseAttach caseAttach = new CaseAttach();
|
||||
caseAttach.setCaseAppliId(caseAppliId);
|
||||
caseAttach.setAnnexType(3);
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttach.setAnnexPath(saveName);
|
||||
caseAttach.setAnnexName("裁决书.pdf");
|
||||
//caseAttach.setUserName(SecurityUtils.getUsername());
|
||||
//caseAttach.setUserId(SecurityUtils.getUserId());
|
||||
// 删除已存在的
|
||||
@@ -247,8 +246,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if (downLoadFile) {
|
||||
CaseAttach caseAttach = new CaseAttach();
|
||||
caseAttach.setAnnexType(10); //10代表印章图片
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttach.setAnnexPath(saveName);
|
||||
caseAttach.setAnnexName(fileName);
|
||||
int i1 = caseAttachMapper.save(caseAttach);
|
||||
if (i1 > 0) {
|
||||
//将附件id保存到公章管理表里
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SendMailRecordServiceImpl implements ISendMailRecordService {
|
||||
@Autowired
|
||||
private SendMailRecordMapper sendMailRecordMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
|
||||
List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
|
||||
return records;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
-18
@@ -8,32 +8,20 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.PdfUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.VideoService;
|
||||
import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
@@ -49,19 +37,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
|
||||
+7
-5
@@ -1,12 +1,14 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
@@ -48,9 +50,9 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
// 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
|
||||
request.setPhone(userVO.getPhone());
|
||||
request.setTemplateParamSet(new String[]{ code});
|
||||
Boolean flag = SmsUtils.sendSms(request);
|
||||
if(flag){
|
||||
setCodeCache(userVO.getPhone(),code);
|
||||
JSONObject resultObj = SmsUtils.sendSms(request);
|
||||
if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
|
||||
setCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + userVO.getPhone(),code);
|
||||
return AjaxResult.success("短信发送成功");
|
||||
}else {
|
||||
return AjaxResult.warn("短信发送失败");
|
||||
@@ -90,7 +92,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
|
||||
String codeCache = getCodeCache(ientityAuthentication.getPhone());
|
||||
String codeCache = getVerifyCodeCacheKey(ientityAuthentication.getPhone());
|
||||
// 校验短信验证码
|
||||
if(StrUtil.isEmpty(codeCache)){
|
||||
return AjaxResult.warn("验证码校验失败");
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.sendrecord;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISendMailRecordService {
|
||||
/**
|
||||
* 查询邮件发送记录
|
||||
*
|
||||
* @param sendMailRecord
|
||||
* @return
|
||||
*/
|
||||
|
||||
List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord);
|
||||
|
||||
/**
|
||||
* 编辑邮件记录
|
||||
*
|
||||
* @param sendMailRecord
|
||||
*/
|
||||
AjaxResult updateSendMailRecord(SendMailRecord sendMailRecord);
|
||||
|
||||
/**
|
||||
* 重新发送邮件
|
||||
*
|
||||
* @param sendMailRecord
|
||||
* @return
|
||||
*/
|
||||
Boolean reSendMailRecord(SendMailRecord sendMailRecord);
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.sendrecord.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.EmailOutUtil;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSendMailHistoryRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SendMailRecordServiceImpl implements ISendMailRecordService {
|
||||
@Autowired
|
||||
private SendMailRecordMapper sendMailRecordMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
|
||||
List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
|
||||
if(CollectionUtil.isNotEmpty(records)){
|
||||
Map<Long, String> recordmap = records.stream().filter(record -> StrUtil.isNotEmpty(record.getFileIds())).collect(Collectors.toMap(SendMailRecord::getId, SendMailRecord::getFileIds, (k1, k2) -> k2));
|
||||
List<String> fileIds = new ArrayList<>(recordmap.values());
|
||||
if(CollectionUtil.isNotEmpty(fileIds)){
|
||||
List<CaseAttach> caseAttaches= msCaseAttachMapper.selectByIds(fileIds);
|
||||
if(CollectionUtil.isNotEmpty(caseAttaches)){
|
||||
Map<Long, CaseAttach> attachMap = caseAttaches.stream().collect(Collectors.toMap(CaseAttach::getAnnexId, Function.identity(), (k1, k2) -> k2));
|
||||
for (SendMailRecord record : records) {
|
||||
List<CaseAttach> msCaseAttaches = new ArrayList<>();
|
||||
if(recordmap.containsKey(record.getId())){
|
||||
String fileIdStr = recordmap.get(record.getId());
|
||||
if(ObjectUtil.isNotNull(fileIdStr) ) {
|
||||
String[] splitFileId = fileIdStr.split(",");
|
||||
for (String fileId : splitFileId) {
|
||||
if (ObjectUtil.isNotNull(fileId) && attachMap.containsKey(Long.parseLong(fileId))) {
|
||||
msCaseAttaches.add(attachMap.get(Long.parseLong(fileId)));
|
||||
}
|
||||
}
|
||||
record.setCaseAttachList(msCaseAttaches);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
MsSendMailHistoryRecordMapper msSendMailHistoryRecordMapper;
|
||||
|
||||
/**
|
||||
* 编辑邮件记录
|
||||
*
|
||||
* @param sendMailRecord
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateSendMailRecord(SendMailRecord sendMailRecord) {
|
||||
try {
|
||||
if (sendMailRecord != null && sendMailRecord.getId() != null) {
|
||||
SendMailRecord old = sendMailRecordMapper.querySendMailRecordById(sendMailRecord.getId());
|
||||
MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
|
||||
BeanUtils.copyProperties(old, msSendMailHistoryRecord);
|
||||
msSendMailHistoryRecord.setParentId(old.getId());
|
||||
msSendMailHistoryRecord.setId(null);
|
||||
msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
|
||||
sendMailRecord.setUpdateTime(new Date());
|
||||
if(CollectionUtil.isNotEmpty(sendMailRecord.getCaseAttachList())){
|
||||
List<Long> fileIdList = sendMailRecord.getCaseAttachList().stream().map(CaseAttach::getAnnexId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(fileIdList)){
|
||||
String fileIdStr = StrUtil.join(",", fileIdList);
|
||||
sendMailRecord.setFileIds(fileIdStr);
|
||||
}
|
||||
}
|
||||
sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
|
||||
return AjaxResult.success("编辑成功");
|
||||
} else {
|
||||
return AjaxResult.error("编辑失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("编辑失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private EmailOutUtil emailOutUtil;
|
||||
@Autowired
|
||||
CaseAttachMapper msCaseAttachMapper;
|
||||
|
||||
/**
|
||||
* 重新发送邮件
|
||||
*
|
||||
* @param sendMailRecord
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean reSendMailRecord(SendMailRecord sendMailRecord) {
|
||||
List<File> fileList = null;
|
||||
// 附件名称map,路径-附件名称
|
||||
Map<String,String> fileNameMap=new HashMap<>();
|
||||
if (sendMailRecord.getFileIds() != null && sendMailRecord.getFileIds() != "") {
|
||||
String[] fileIds = sendMailRecord.getFileIds().split(",");
|
||||
for (int i = 0; i < fileIds.length; i++) {
|
||||
String fileId = fileIds[i];
|
||||
try {
|
||||
Long id = Long.parseLong(fileId);
|
||||
CaseAttach CaseAttach = msCaseAttachMapper.queryAnnexById(id);
|
||||
String annexPath = CaseAttach.getAnnexPath();
|
||||
if (annexPath != null && annexPath != "") {
|
||||
String prefix = "/profile";
|
||||
int startIndex = prefix.length();
|
||||
String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex + 1);
|
||||
File file = new File(path);
|
||||
fileList.add(file);
|
||||
fileNameMap.put(file.getPath(), CaseAttach.getAnnexName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Boolean flag = emailOutUtil.sendEmil(sendMailRecord.getMailAddress(), sendMailRecord.getMailContent(), sendMailRecord.getMailSubject(), fileList, null,fileNameMap);
|
||||
//发送成功后更细邮件记录的发送时间和发送状态
|
||||
if (flag) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setUpdateTime(new Date());
|
||||
sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.shortmessage;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShortMessageService {
|
||||
public List<SmsSendRecord> smsSendRecordList(SmsSendRecord smsSendRecord);
|
||||
|
||||
/**
|
||||
* 新增发送历史记录
|
||||
*/
|
||||
void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord,List<MsSmsSendRecordParam> recordParams);
|
||||
|
||||
/**
|
||||
* 重新发送短信
|
||||
*
|
||||
* @param reSendMessageVO
|
||||
*/
|
||||
AjaxResult reSendShortMessage(ReSendMessageVO reSendMessageVO);
|
||||
|
||||
/**
|
||||
* 根据信息生成加密信息记录
|
||||
*
|
||||
* @param meetingInfoVO
|
||||
* @return
|
||||
*/
|
||||
String buildMeetingInfoRecord(MeetingInfoVO meetingInfoVO);
|
||||
|
||||
/**
|
||||
* 通过UID查询加密信息并解密成明文对象
|
||||
*/
|
||||
Object getMeetingInfo(String uid);
|
||||
|
||||
AjaxResult smsCallBack(String body);
|
||||
}
|
||||
+301
@@ -0,0 +1,301 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.shortmessage.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendHistoryRecordParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSmsSendHistoryRecord;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MeetingInfoMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSmsSendHistoryRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendHistoryRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
|
||||
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ShortMessageServiceImpl implements ShortMessageService {
|
||||
@Autowired
|
||||
MsSmsSendHistoryRecordMapper msSmsSendHistoryRecordMapper;
|
||||
@Autowired
|
||||
MeetingInfoMapper meetingInfoMapper;
|
||||
@Autowired
|
||||
SmsRecordMapper smsRecordMapper;
|
||||
@Autowired
|
||||
MsSmsTemplateMapper templateMapper;
|
||||
@Autowired
|
||||
MsSmsTemplateParamMapper templateParamMapper;
|
||||
@Autowired
|
||||
MsSmsSendRecordParamMapper recordParamMapper;
|
||||
@Autowired
|
||||
MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
|
||||
|
||||
@Override
|
||||
public List<SmsSendRecord> smsSendRecordList(SmsSendRecord smsSendRecord) {
|
||||
List<SmsSendRecord> records = smsRecordMapper.getSmsSendRecord(smsSendRecord);
|
||||
if (CollectionUtil.isEmpty(records)) {
|
||||
return null;
|
||||
}
|
||||
List<Long> templateIds = records.stream().map(SmsSendRecord::getMsSmsTemplateId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(templateIds)) {
|
||||
return records;
|
||||
}
|
||||
List<Long> ids = records.stream().map(SmsSendRecord::getId).collect(Collectors.toList());
|
||||
// 查询记录表参数值
|
||||
Example recordParamExam = new Example(MsSmsSendRecordParam.class);
|
||||
recordParamExam.createCriteria().andIn("smsRecordId", ids);
|
||||
List<MsSmsSendRecordParam> recordParams = recordParamMapper.selectByExample(recordParamExam);
|
||||
if (CollectionUtil.isEmpty(recordParams)) {
|
||||
return records;
|
||||
}
|
||||
// 根据模板id查询模板参数
|
||||
Example templateParamExam = new Example(MsSmsTemplateParam.class);
|
||||
templateParamExam.createCriteria().andIn("smsTemplateId", templateIds);
|
||||
List<MsSmsTemplateParam> templateParams = templateParamMapper.selectByExample(templateParamExam);
|
||||
if (CollectionUtil.isEmpty(templateParams)) {
|
||||
return records;
|
||||
}
|
||||
// 根据模板id对模板参数分组
|
||||
Map<Long, List<MsSmsTemplateParam>> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId));
|
||||
|
||||
// 根据记录id分组
|
||||
Map<Long, List<String>> recordParamContentMap = new HashMap<>();
|
||||
for (MsSmsSendRecordParam recordParam : recordParams) {
|
||||
List<String> list = recordParamContentMap.get(recordParam.getSmsRecordId());
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
list.add(recordParam.getParamValue());
|
||||
recordParamContentMap.put(recordParam.getSmsRecordId(), list);
|
||||
}
|
||||
// 根据模板id查询模板
|
||||
Example templateExam = new Example(MsSmsTemplate.class);
|
||||
templateExam.createCriteria().andIn("id", templateIds);
|
||||
List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
|
||||
if (CollectionUtil.isEmpty(templates)) {
|
||||
return records;
|
||||
}
|
||||
// 根据主键id获取模板内容
|
||||
Map<Long, String> templateMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getContent, (k1, k2) -> k2));
|
||||
Map<Long, String> templateIdMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getTemplateId, (k1, k2) -> k2));
|
||||
// 组装模板内容
|
||||
for (SmsSendRecord record : records) {
|
||||
if (record.getMsSmsTemplateId() == null) {
|
||||
continue;
|
||||
}
|
||||
if (!templateMap.containsKey(record.getMsSmsTemplateId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!recordParamContentMap.containsKey(record.getId())) {
|
||||
continue;
|
||||
}
|
||||
if (templateIdMap.containsKey(record.getMsSmsTemplateId())) {
|
||||
record.setTemplateId(templateIdMap.get(record.getMsSmsTemplateId()));
|
||||
}
|
||||
String templateContent = templateMap.get(record.getMsSmsTemplateId());
|
||||
record.setTemplateContent(templateContent);
|
||||
List<String> recordParamList = recordParamContentMap.get(record.getId());
|
||||
if (recordParamContentMap.containsKey(record.getId()) && templateParamMap.containsKey(record.getMsSmsTemplateId())) {
|
||||
List<MsSmsTemplateParam> templateParamList = templateParamMap.get(record.getMsSmsTemplateId());
|
||||
ArrayList<MsSmsTemplateParam> copyParamList = new ArrayList<>();
|
||||
for (int i = 0; i < templateParamList.size(); i++) {
|
||||
MsSmsTemplateParam templateParam = templateParamList.get(i);
|
||||
MsSmsTemplateParam msSmsTemplateParam = new MsSmsTemplateParam();
|
||||
msSmsTemplateParam.setParam(templateParam.getParam());
|
||||
msSmsTemplateParam.setSmsTemplateId(templateParam.getSmsTemplateId());
|
||||
msSmsTemplateParam.setParamName(templateParam.getParamName());
|
||||
msSmsTemplateParam.setId(templateParam.getId());
|
||||
msSmsTemplateParam.setParamValue(recordParamContentMap.get(record.getId()).get(i));
|
||||
copyParamList.add(msSmsTemplateParam);
|
||||
}
|
||||
record.setTemplateParams(copyParamList);
|
||||
|
||||
}
|
||||
// 按顺序替换占位符
|
||||
if (CollectionUtil.isNotEmpty(recordParamList)) {
|
||||
recordParamList.add(0, "0");
|
||||
|
||||
// 将List<String>转换为String[]数组
|
||||
String[] paramArray = recordParamList.toArray(new String[recordParamList.size()]);
|
||||
String formattedMessage = MessageFormat.format(templateContent, paramArray);
|
||||
record.setSendContent(formattedMessage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发送历史记录
|
||||
*
|
||||
* @param smsSendRecord
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord, List<MsSmsSendRecordParam> recordParams) {
|
||||
if (smsSendRecord != null) {
|
||||
MsSmsSendHistoryRecord historyRecord = new MsSmsSendHistoryRecord();
|
||||
BeanUtils.copyProperties(smsSendRecord, historyRecord);
|
||||
historyRecord.setId(null);
|
||||
historyRecord.setParentId(smsSendRecord.getId());
|
||||
int i = msSmsSendHistoryRecordMapper.insert(historyRecord);
|
||||
if (i > 0 && CollectionUtil.isNotEmpty(recordParams)) {
|
||||
// 新增参数表
|
||||
List<MsSmsSendHistoryRecordParam> historyRecordParams = new ArrayList<>();
|
||||
for (MsSmsSendRecordParam templateParam : recordParams) {
|
||||
MsSmsSendHistoryRecordParam recordParam = new MsSmsSendHistoryRecordParam();
|
||||
BeanUtils.copyProperties(templateParam, recordParam);
|
||||
recordParam.setId(null);
|
||||
recordParam.setSmsRecordHistoryId(historyRecord.getId());
|
||||
historyRecordParams.add(recordParam);
|
||||
}
|
||||
historyRecordParamMapper.batchInsert(historyRecordParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发送短信
|
||||
*
|
||||
* @param reSendMessageVO
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reSendShortMessage(ReSendMessageVO reSendMessageVO) {
|
||||
if (reSendMessageVO != null && reSendMessageVO.getTemplateId() != null && reSendMessageVO.getPhone() != null && reSendMessageVO.getTemplateParams() != null && reSendMessageVO.getTemplateParams().size() > 0 && reSendMessageVO.getId() != null) {
|
||||
// 根据id查询短信记录
|
||||
SmsSendRecord smsSendRecord = smsRecordMapper.selectById(reSendMessageVO.getId());
|
||||
if (smsSendRecord == null) {
|
||||
return AjaxResult.warn("短信记录不存在");
|
||||
}
|
||||
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId(reSendMessageVO.getTemplateId());
|
||||
request.setPhone(reSendMessageVO.getPhone());
|
||||
List<String> paramsList = reSendMessageVO.getTemplateParams().stream().map(MsSmsTemplateParam::getParamValue).collect(Collectors.toList());
|
||||
String[] messageContent = paramsList.toArray(new String[0]);
|
||||
request.setTemplateParamSet(messageContent);
|
||||
JSONObject resultObj = SmsUtils.sendSms(request);
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
// 修改sid和状态
|
||||
if (resultObj.get("status") != null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
|
||||
smsSendRecord.setSid(resultObj.get("sid") == null ? null : resultObj.get("sid").toString());
|
||||
smsSendRecord.setReason(null);
|
||||
// 修改
|
||||
smsRecordMapper.update(smsSendRecord);
|
||||
|
||||
return AjaxResult.success("重新发送成功");
|
||||
} else {
|
||||
smsSendRecord.setSid(resultObj.get("sid") == null ? null : resultObj.get("sid").toString());
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
smsSendRecord.setSid(resultObj.get("reason") == null ? null : resultObj.get("reason").toString());
|
||||
// 修改
|
||||
smsRecordMapper.update(smsSendRecord);
|
||||
return AjaxResult.warn("重新发送失败");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.warn("参数缺失");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据信息生成加密信息记录
|
||||
*
|
||||
* @param meetingInfoVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String buildMeetingInfoRecord(MeetingInfoVO meetingInfoVO) {
|
||||
String uid = UUID.randomUUID().toString().replace("-", "");
|
||||
MeetingInfo meetingInfo = MeetingInfo.builder().userId(meetingInfoVO.getUserId()).userName(meetingInfoVO.getUserName()).caseId(meetingInfoVO.getCaseId()).roomId(meetingInfoVO.getRoomId()).systemType(meetingInfoVO.getSystemType()).createTime(new Date()).uid(uid).build();
|
||||
meetingInfo.setUid(uid);
|
||||
meetingInfoMapper.insertSelective(meetingInfo);
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过UID查询加密信息并解密成明文对象
|
||||
*
|
||||
* @param uid
|
||||
*/
|
||||
@Override
|
||||
public Object getMeetingInfo(String uid) {
|
||||
MeetingInfoVO result = new MeetingInfoVO();
|
||||
MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(uid);
|
||||
if (meetingInfo != null) {
|
||||
BeanUtils.copyProperties(meetingInfo, result);
|
||||
if (result != null) {
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("userName", meetingInfo.getUserName());
|
||||
claims.put("userId", meetingInfo.getUserId());
|
||||
claims.put(Constants.MEETING_KEY, uid);
|
||||
String createToken = createToken(claims);
|
||||
result.setToken(createToken);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult smsCallBack(String body) {
|
||||
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(body);
|
||||
if (jsonObject.get("sid") != null) {
|
||||
Object description = jsonObject.get("description");
|
||||
System.out.println(description);
|
||||
// 查询sid对应的短信,更新短信状态
|
||||
SmsSendRecord smsSendRecord = smsRecordMapper.selectBySId(jsonObject.getStr("sid"));
|
||||
if (smsSendRecord != null) {
|
||||
if (jsonObject.get("report_status") != null && jsonObject.getStr("report_status").equals("SUCCESS")) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
smsSendRecord.setReason(description != null ? description.toString() : null);
|
||||
}
|
||||
smsRecordMapper.updateStatus(smsSendRecord);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
// 令牌秘钥
|
||||
@Value("${token.secret}")
|
||||
private String secret;
|
||||
|
||||
private String createToken(Map<String, Object> claims) {
|
||||
String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
|
||||
return token;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.sms;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname SMSTemplateService
|
||||
* @Description
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/4/16 11:39
|
||||
* @Created wangqiong
|
||||
*/
|
||||
public interface SMSTemplateService {
|
||||
List<MsSmsTemplate> page();
|
||||
|
||||
AjaxResult insert(MsSmsTemplate template);
|
||||
|
||||
AjaxResult delete(Long id);
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.sms.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Classname SMSTemplateServiceImpl
|
||||
* @Description
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/4/16 11:40
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Service
|
||||
public class SMSTemplateServiceImpl implements SMSTemplateService {
|
||||
@Autowired
|
||||
private MsSmsTemplateMapper templateMapper;
|
||||
@Autowired
|
||||
private MsSmsTemplateParamMapper templateParamMapper;
|
||||
|
||||
@Override
|
||||
public List<MsSmsTemplate> page() {
|
||||
// 分页查询模板
|
||||
Example templateExam = new Example(MsSmsTemplate.class);
|
||||
List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
|
||||
if(CollectionUtil.isEmpty(templates)){
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Long> templateIds = templates.stream().map(MsSmsTemplate::getId).collect(Collectors.toList());
|
||||
// 查询参数
|
||||
Example templateParamExam = new Example(MsSmsTemplateParam.class);
|
||||
templateParamExam.createCriteria().andIn("smsTemplateId", templateIds);
|
||||
List<MsSmsTemplateParam> templateParams = templateParamMapper.selectByExample(templateParamExam);
|
||||
// 根据模板id对模板参数分组
|
||||
Map<Long, List<MsSmsTemplateParam>> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId));
|
||||
for (MsSmsTemplate template : templates) {
|
||||
if(templateParamMap.containsKey(template.getId())){
|
||||
template.setTemplateParams(templateParamMap.get(template.getId()));
|
||||
}
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改
|
||||
* @param template
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insert(MsSmsTemplate template) {
|
||||
if(template.getId() == null){
|
||||
templateMapper.insert(template);
|
||||
|
||||
}else{
|
||||
templateMapper.updateByPrimaryKey(template);
|
||||
for (MsSmsTemplateParam templateParam : template.getTemplateParams()) {
|
||||
templateParam.setSmsTemplateId(template.getId());
|
||||
}
|
||||
// 先删除
|
||||
Example paramExam = new Example(MsSmsTemplateParam.class);
|
||||
paramExam.createCriteria().andEqualTo("smsTemplateId", template.getId());
|
||||
templateParamMapper.deleteByExample(paramExam);
|
||||
}
|
||||
// 新增参数表
|
||||
if(CollectionUtil.isNotEmpty(template.getTemplateParams())){
|
||||
for (MsSmsTemplateParam templateParam : template.getTemplateParams()) {
|
||||
templateParam.setSmsTemplateId(template.getId());
|
||||
}
|
||||
templateParamMapper.batchInsert(template.getTemplateParams());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult delete(Long id) {
|
||||
// 删除
|
||||
templateMapper.deleteByPrimaryKey(id);
|
||||
// 删除参数表
|
||||
Example paramExam = new Example(MsSmsTemplateParam.class);
|
||||
paramExam.createCriteria().andEqualTo("smsTemplateId", id);
|
||||
templateParamMapper.deleteByExample(paramExam);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@@ -54,10 +54,10 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
|
||||
if (file1.isDirectory() && file1.listFiles() != null) {
|
||||
|
||||
for (File file2 : file1.listFiles()) {
|
||||
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, loginUser);
|
||||
if (caseApplication != null) {
|
||||
caseApplications.add(caseApplication);
|
||||
}
|
||||
// CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, loginUser);
|
||||
// if (caseApplication != null) {
|
||||
// caseApplications.add(caseApplication);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.ruoyi.wisdomarbitrate.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
import com.ruoyi.common.utils.ThreadUtil;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.cvm.v20170312.CvmClient;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.var;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@Slf4j
|
||||
public class SmsUtils {
|
||||
//应用id
|
||||
private static final String SDK_APP_ID = "1400854852";
|
||||
//API的SecretId
|
||||
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
|
||||
//API的SecretKey
|
||||
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
|
||||
//签名内容
|
||||
private static final String SIGN_NAME = "乙巢智慧仲裁网";
|
||||
private static SmsRecordMapper recordMapper = SpringUtil.getBean(SmsRecordMapper.class);
|
||||
private static MsSmsSendRecordParamMapper recordParamMapper = SpringUtil.getBean(MsSmsSendRecordParamMapper.class);
|
||||
private static MsSmsTemplateMapper templateMapper = SpringUtil.getBean(MsSmsTemplateMapper.class);
|
||||
private static SysUserMapper sysUserMapper = SpringUtil.getBean(SysUserMapper.class);
|
||||
private static SysRoleMapper roleMapper = SpringUtil.getBean(SysRoleMapper.class);
|
||||
private static ShortMessageService shortMessageService = SpringUtil.getBean(ShortMessageService.class);
|
||||
|
||||
public static JSONObject sendSms(SendSmsRequest request) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEY);
|
||||
|
||||
SmsClient client = new SmsClient(cred, "ap-guangzhou");
|
||||
|
||||
final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
|
||||
req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
|
||||
req.setSmsSdkAppId(SDK_APP_ID);
|
||||
req.setSignName(SIGN_NAME);
|
||||
req.setTemplateId(request.getTemplateId());
|
||||
req.setTemplateParamSet(request.getTemplateParamSet());
|
||||
SendSmsResponse res = null;
|
||||
try {
|
||||
res = client.SendSms(req);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
log.error("发送短信出错:", e);
|
||||
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
|
||||
jsonObject.set("reason",e.getMessage());
|
||||
return jsonObject;
|
||||
}
|
||||
SendStatus sendStatus = res.getSendStatusSet()[0];
|
||||
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
|
||||
|
||||
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) {
|
||||
jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
|
||||
} else {
|
||||
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
|
||||
}
|
||||
jsonObject.set("sid", sendStatus.getSerialNo());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
public static void sendSms(CaseApplication application, String templateId, String phone, String[] templateParamSet) {
|
||||
if(application==null||StrUtil.isEmpty(templateId)||StrUtil.isEmpty(phone)||templateParamSet==null||templateParamSet.length==0){
|
||||
return;
|
||||
}
|
||||
Example templateExam = new Example(MsSmsTemplate.class);
|
||||
templateExam.createCriteria().andEqualTo("templateId", templateId);
|
||||
List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
|
||||
if (CollectionUtil.isEmpty(templates)) {
|
||||
return ;
|
||||
}
|
||||
MsSmsTemplate template = templates.get(0);
|
||||
SendSmsRequest request = new SendSmsRequest(phone, templateId, templateParamSet, application.getId());
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEY);
|
||||
|
||||
SmsClient client = new SmsClient(cred, "ap-guangzhou");
|
||||
|
||||
final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
|
||||
req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
|
||||
req.setSmsSdkAppId(SDK_APP_ID);
|
||||
req.setSignName(SIGN_NAME);
|
||||
req.setTemplateId(request.getTemplateId());
|
||||
req.setTemplateParamSet(request.getTemplateParamSet());
|
||||
sendSms(client,template,application,phone, templateParamSet,req);
|
||||
}
|
||||
|
||||
|
||||
private static void sendSms(SmsClient client,MsSmsTemplate template, CaseApplication application, String phone, String[] templateParamSet, com.tencentcloudapi.sms.v20210111.models.SendSmsRequest req) {
|
||||
SmsSendRecord smsSendRecord=new SmsSendRecord();
|
||||
smsSendRecord.setMsSmsTemplateId(template.getId());
|
||||
smsSendRecord.setCaseId(application.getId());
|
||||
smsSendRecord.setCaseNum(application.getCaseNum());
|
||||
smsSendRecord.setSendTime(new Date());
|
||||
smsSendRecord.setPhone(phone);
|
||||
smsSendRecord.setCreateTime(new Date());
|
||||
// smsSendRecord.setCreateBy(SecurityUtils.getUsername());
|
||||
// SendSmsRequest request = new SendSmsRequest(phone, template.getTemplateId(), templateParamSet, application.getId());
|
||||
req.setPhoneNumberSet(new String[]{"+86" + phone});
|
||||
req.setTemplateId(template.getTemplateId());
|
||||
req.setTemplateParamSet(templateParamSet);
|
||||
try {
|
||||
SendSmsResponse res=client.SendSms(req);
|
||||
SendStatus sendStatus = res.getSendStatusSet()[0];
|
||||
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) {
|
||||
smsSendRecord.setSendStatus( SMSStatusEnum.SENDING.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
smsSendRecord.setReason(sendStatus.getMessage());
|
||||
}
|
||||
smsSendRecord.setSid(sendStatus.getSerialNo());
|
||||
} catch (TencentCloudSDKException e) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
smsSendRecord.setReason(e.getMessage());
|
||||
}
|
||||
int i = recordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
if(i>0){
|
||||
List<MsSmsSendRecordParam> recordParams=new ArrayList<>();
|
||||
for (String paramValue : templateParamSet) {
|
||||
// 新增参数
|
||||
MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
|
||||
recordParam.setSmsRecordId(smsSendRecord.getId());
|
||||
recordParam.setParamValue(paramValue);
|
||||
recordParams.add(recordParam);
|
||||
}
|
||||
// recordParamMapper.batchInsert(recordParams);
|
||||
// shortMessageService.insertShortMessageHistoryRecord(smsSendRecord,recordParams);
|
||||
ExecutorService executor = ThreadUtil.createThreadPool();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
recordParamMapper.batchInsert(recordParams);
|
||||
|
||||
}, executor);
|
||||
// 新增历史记录表
|
||||
CompletableFuture.runAsync(() -> {
|
||||
shortMessageService.insertShortMessageHistoryRecord(smsSendRecord,recordParams);
|
||||
|
||||
}, executor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数对象
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SendSmsRequest {
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 模板 ID: 必须填写已审核通过的模板 ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
|
||||
*/
|
||||
private String[] templateParamSet;
|
||||
private Long caseId;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper">
|
||||
<resultMap type="CaseAttach" id="CaseAttachResult">
|
||||
<resultMap type="com.ruoyi.wisdomarbitrate.domain.CaseAttach" id="CaseAttachResult">
|
||||
<id property="annexId" column="annex_id" />
|
||||
<result property="caseAppliId" column="case_appli_id" />
|
||||
<result property="annexName" column="annex_name" />
|
||||
@@ -97,14 +97,14 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateCaseAttach" parameterType="CaseAttach">
|
||||
<update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseAttach">
|
||||
update case_attach
|
||||
set
|
||||
case_appli_id= #{caseAppliId}
|
||||
where annex_id = #{annexId}
|
||||
</update>
|
||||
|
||||
<update id="updateCaseAttachBycaseid" parameterType="CaseAttach" >
|
||||
<update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" >
|
||||
update case_attach
|
||||
<set>
|
||||
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
|
||||
@@ -127,4 +127,12 @@
|
||||
where case_appli_id = #{caseId}
|
||||
and annex_type = #{type} and annex_id!=#{annexId}
|
||||
</delete>
|
||||
<select id="selectByIds" resultMap="CaseAttachResult">
|
||||
select *
|
||||
from case_attach
|
||||
where annex_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?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.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper">
|
||||
|
||||
<resultMap type="SendMailRecord" id="SendMailRecordResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="mailName" column="mail_name" />
|
||||
<result property="mailContent" column="mail_content" />
|
||||
<result property="mailAddress" column="mail_address" />
|
||||
<result property="sendTime" column="send_time" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="sendStatus" column="send_status" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSendMailRecord" parameterType="SendMailRecord" resultMap="SendMailRecordResult">
|
||||
SELECT s.id ,s.mail_name ,s.mail_content ,s.mail_address ,s.send_time ,s.case_id ,s.create_time ,s.create_by ,
|
||||
s.update_by ,s.update_time , s.send_status ,c.case_num
|
||||
from send_mail_record s left join case_application c
|
||||
on s.case_id = c.id
|
||||
<where>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND c.case_num = #{caseNum}
|
||||
</if>
|
||||
</where>
|
||||
order by s.send_time desc
|
||||
</select>
|
||||
|
||||
<insert id="saveSendMailRecord">
|
||||
insert into send_mail_record(
|
||||
<if test="mailName != null and mailName != ''">mail_name,</if>
|
||||
<if test="mailContent != null and mailContent != ''">mail_content,</if>
|
||||
<if test="mailAddress != null and mailAddress != ''">mail_address,</if>
|
||||
<if test="sendTime != null ">send_time,</if>
|
||||
<if test="caseId != null ">case_id,</if>
|
||||
<if test="sendStatus != null ">send_status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="mailName != null and mailName != ''">#{mailName},</if>
|
||||
<if test="mailContent != null and mailContent != ''">#{mailContent},</if>
|
||||
<if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
|
||||
<if test="sendTime != null ">#{sendTime},</if>
|
||||
<if test="caseId != null ">#{caseId},</if>
|
||||
<if test="sendStatus != null ">#{sendStatus},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,80 +0,0 @@
|
||||
<?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.ruoyi.wisdomarbitrate.mapper.SmsRecordMapper">
|
||||
<resultMap type="SmsSendRecord" id="SmsSendRecordResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseId" column="case_appli_id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="sendTime" column="send_time" />
|
||||
<result property="sendContent" column="send_content" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="sendStatus" column="send_status" />
|
||||
</resultMap>
|
||||
<insert id="saveSmsSendRecord" parameterType="SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
||||
insert into sms_send_record(
|
||||
<if test="caseId != null ">case_appli_id,</if>
|
||||
<if test="caseNum != null ">case_num,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="sendTime != null ">send_time,</if>
|
||||
<if test="sendContent != null ">send_content,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="sendStatus != null ">send_status,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseId != null ">#{caseId},</if>
|
||||
<if test="caseNum != null ">#{caseNum},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="sendTime != null ">#{sendTime},</if>
|
||||
<if test="sendContent != null ">#{sendContent},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="sendStatus != null ">#{sendStatus},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<insert id="batchSaveSmsSendRecord">
|
||||
|
||||
insert into sms_send_record(
|
||||
case_appli_id,
|
||||
case_num,
|
||||
phone,
|
||||
send_time,
|
||||
send_content,
|
||||
create_by,
|
||||
send_status,
|
||||
create_time
|
||||
)values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{item.caseId},
|
||||
#{item.caseNum},
|
||||
#{item.phone},
|
||||
#{item.sendTime},
|
||||
#{item.sendContent},
|
||||
#{item.createBy},
|
||||
#{item.sendStatus},
|
||||
sysdate()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getSmsSendRecord" parameterType="SmsSendRecord" resultMap="SmsSendRecordResult">
|
||||
|
||||
select id ,case_appli_id ,case_num ,phone ,send_time ,send_content,send_status
|
||||
from sms_send_record
|
||||
<where>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND case_num = #{caseNum}
|
||||
</if>
|
||||
</where>
|
||||
order by send_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
<?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.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord" id="SendMailRecordResult">
|
||||
<id property="id" column="id"/>
|
||||
<result property="mailName" column="mail_name"/>
|
||||
<result property="mailContent" column="mail_content"/>
|
||||
<result property="mailAddress" column="mail_address"/>
|
||||
<result property="sendTime" column="send_time"/>
|
||||
<result property="caseId" column="case_id"/>
|
||||
<result property="caseNum" column="case_num"/>
|
||||
<result property="sendStatus" column="send_status"/>
|
||||
<result property="fileIds" column="file_ids"/>
|
||||
<result property="mailSubject" column="mail_subject"/>
|
||||
<result property="mailFromAddress" column="mail_from_address"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSendMailRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord"
|
||||
resultMap="SendMailRecordResult">
|
||||
SELECT s.*
|
||||
from send_mail_record s
|
||||
<where>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND s.case_num = #{caseNum}
|
||||
</if>
|
||||
</where>
|
||||
order by s.send_time desc
|
||||
</select>
|
||||
|
||||
<insert id="saveSendMailRecord">
|
||||
insert into send_mail_record(
|
||||
<if test="mailName != null and mailName != ''">mail_name,</if>
|
||||
<if test="mailContent != null and mailContent != ''">mail_content,</if>
|
||||
<if test="mailAddress != null and mailAddress != ''">mail_address,</if>
|
||||
<if test="sendTime != null ">send_time,</if>
|
||||
<if test="caseId != null ">case_id,</if>
|
||||
<if test="sendStatus != null ">send_status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="fileIds != null and fileIds != ''">file_ids,</if>
|
||||
<if test="mailSubject != null and mailSubject != ''">mail_subject,</if>
|
||||
<if test="mailFromAddress != null and mailFromAddress != ''">mail_from_address,</if>
|
||||
<if test="caseNum != null and caseNum != ''">case_num,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="mailName != null and mailName != ''">#{mailName},</if>
|
||||
<if test="mailContent != null and mailContent != ''">#{mailContent},</if>
|
||||
<if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
|
||||
<if test="sendTime != null ">#{sendTime},</if>
|
||||
<if test="caseId != null ">#{caseId},</if>
|
||||
<if test="sendStatus != null ">#{sendStatus},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="fileIds != null and fileIds != ''">#{fileIds},</if>
|
||||
<if test="mailSubject != null and mailSubject != ''">#{mailSubject},</if>
|
||||
<if test="mailFromAddress != null and mailFromAddress != ''">#{mailFromAddress},</if>
|
||||
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<update id="updateSendMailRecord">
|
||||
update send_mail_record
|
||||
set
|
||||
<if test="mailContent != null ">mail_content= #{mailContent}</if>
|
||||
<if test="updateTime != null ">,update_time=#{updateTime}</if>
|
||||
<if test="sendTime != null ">,send_time=#{sendTime}</if>
|
||||
<if test="sendStatus != null ">,send_status=#{sendStatus}</if>
|
||||
<if test="fileIds != null and fileIds != ''">,file_ids=#{fileIds}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="querySendMailRecordById" resultMap="SendMailRecordResult">
|
||||
select *
|
||||
from send_mail_record
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
<?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.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper">
|
||||
<resultMap type="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" id="SmsSendRecordResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseId" column="case_appli_id" />
|
||||
<result property="msSmsTemplateId" column="ms_sms_template_id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="sendTime" column="send_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="sendStatus" column="send_status" />
|
||||
<result property="sid" column="sid" />
|
||||
</resultMap>
|
||||
<insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
||||
insert into sms_send_record(
|
||||
<if test="caseId != null ">case_appli_id,</if>
|
||||
<if test="caseNum != null ">case_num,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="sendTime != null ">send_time,</if>
|
||||
<if test="msSmsTemplateId != null ">ms_sms_template_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="sendStatus != null ">send_status,</if>
|
||||
sid,
|
||||
reason,
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseId != null ">#{caseId},</if>
|
||||
<if test="caseNum != null ">#{caseNum},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="sendTime != null ">#{sendTime},</if>
|
||||
<if test="msSmsTemplateId != null ">#{msSmsTemplateId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="sendStatus != null ">#{sendStatus},</if>
|
||||
#{sid},
|
||||
#{reason},
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<insert id="batchSaveSmsSendRecord">
|
||||
|
||||
insert into sms_send_record(
|
||||
case_appli_id,
|
||||
case_num,
|
||||
phone,
|
||||
send_time,
|
||||
sms_template_id,
|
||||
create_by,
|
||||
send_status,
|
||||
create_time,
|
||||
sid,reason
|
||||
)values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{item.caseId},
|
||||
#{item.caseNum},
|
||||
#{item.phone},
|
||||
#{item.sendTime},
|
||||
#{item.msSmsTemplateId},
|
||||
#{item.createBy},
|
||||
#{item.sendStatus},
|
||||
sysdate(),#{sid},#{reason}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord"
|
||||
resultMap="SmsSendRecordResult">
|
||||
|
||||
select *
|
||||
from sms_send_record
|
||||
<where>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND case_num = #{caseNum}
|
||||
</if>
|
||||
</where>
|
||||
order by send_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBySId" resultMap="SmsSendRecordResult">
|
||||
select *
|
||||
from sms_send_record
|
||||
where sid = #{sid}
|
||||
</select>
|
||||
|
||||
<update id="updateStatus">
|
||||
update sms_send_record
|
||||
set send_status= #{sendStatus},
|
||||
reason=#{reason}
|
||||
where sid = #{sid}
|
||||
</update>
|
||||
<update id="update">
|
||||
update sms_send_record
|
||||
<set>
|
||||
<if test="caseId != null ">case_appli_id = #{caseId},</if>
|
||||
<if test="caseNum != null and caseNum != '' ">case_num = #{caseNum},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
|
||||
<if test="sendTime != null ">send_time = #{sendTime},</if>
|
||||
<if test="msSmsTemplateId != null ">ms_sms_template_id = #{msSmsTemplateId},
|
||||
</if>
|
||||
<if test="sendStatus != null ">send_status = #{sendStatus},</if>
|
||||
<if test="sid != null and sid != '' ">sid = #{sid},</if>
|
||||
reason = #{reason}
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultMap="SmsSendRecordResult">
|
||||
select *
|
||||
from sms_send_record
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user