This commit is contained in:
qitz
2023-12-15 17:26:14 +08:00
6 changed files with 98 additions and 42 deletions
@@ -72,6 +72,7 @@ public class SmsUtils {
* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 * 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
*/ */
private String[] templateParamSet; private String[] templateParamSet;
private Long caseId;
} }
} }
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord; import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@@ -11,4 +12,11 @@ public interface SmsRecordMapper {
int saveSmsSendRecord(SmsSendRecord smsSendRecord); int saveSmsSendRecord(SmsSendRecord smsSendRecord);
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord); List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
/**
* 批量新增
* @param smsSendRecordList
* @return
*/
int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
} }
@@ -111,7 +111,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。"; String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。";
//书面仲裁时 //书面仲裁时
String writtenDate="{{writtenDate}}"; String writtenDate="{{writtenDate}}";
String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。"; String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
//开庭+缺席审理 //开庭+缺席审理
String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
"《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" +
@@ -1249,10 +1249,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setCaseId(caseAffiliate.getCaseAppliId());
request.setTemplateId("1956159"); request.setTemplateId("1956159");
request.setPhone(agentUser.getPhonenumber()); request.setPhone(agentUser.getPhonenumber());
request.setTemplateParamSet(new String[]{agentUser.getNickName()}); request.setTemplateParamSet(new String[]{agentUser.getNickName()});
Boolean aBoolean = SmsUtils.sendSms(request); Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录 //保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord(); SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
@@ -216,12 +216,7 @@ public class CaseZipImportImpl {
caseApplication.setCaseLogId(IdWorkerUtil.getId()); caseApplication.setCaseLogId(IdWorkerUtil.getId());
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
caseApplication.setCaseAppliId(caseApplication.getId()); caseApplication.setCaseAppliId(caseApplication.getId());
//默认案件标的 todo 案件标的是什么,默认写死
caseApplication.setCaseSubjectAmount(new BigDecimal(100000));
//todo 暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
caseApplication.setFeePayable(feePayable);
// 设置批号 // 设置批号
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) { if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
@@ -356,18 +351,32 @@ public class CaseZipImportImpl {
} }
); );
// todo 发送短信 // todo 发送短信
// ThreadPoolUtil.execute(() -> { ThreadPoolUtil.execute(() -> {
// CaseLogUtils.batchInsertCaseLog(logRecords); CaseLogUtils.batchInsertCaseLog(logRecords);
// // 发送短信 // 发送短信
// if (CollectionUtil.isNotEmpty(smsRequestList)) { if (CollectionUtil.isNotEmpty(smsRequestList)) {
// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { Map<Long, SmsSendRecord> sendRecordMap = null;
// Boolean aBoolean = SmsUtils.sendSms(request); if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
// } sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
// } for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
// Boolean aBoolean = SmsUtils.sendSms(request);
// } if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
// if (aBoolean) {
// ); sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
} else {
sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
}
}
}
smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
}
}
}
);
} }
// 案件日志 // 案件日志
return success("导入成功"); return success("导入成功");
@@ -598,7 +607,7 @@ public class CaseZipImportImpl {
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) { || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
// 组装申请人内置自段 // 组装申请人内置自段
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication.getId(), smsSendRecords, smsRequestList); buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList);
} else if (dictData.getDictLabel().contains("合同编号")) { } else if (dictData.getDictLabel().contains("合同编号")) {
// 合同编号 // 合同编号
String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId()); String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
@@ -608,6 +617,14 @@ public class CaseZipImportImpl {
String replaceAll = contractNumber.replaceAll(regx, ""); String replaceAll = contractNumber.replaceAll(regx, "");
caseApplication.setContractNumber(replaceAll.toUpperCase()); caseApplication.setContractNumber(replaceAll.toUpperCase());
} }
}else if(dictData.getDictLabel().contains("案件标的")){
// todo 案件标的名字要改,字典配置中也要改
if(null!=caseApplication.getCaseSubjectAmount()) {
//todo 暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
caseApplication.setFeePayable(feePayable);
}
} else { } else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
} }
@@ -637,7 +654,7 @@ public class CaseZipImportImpl {
*/ */
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate, private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
Map<String, Long> deptMap, List<SysDept> sysDepts, Map<String, Long> deptMap, List<SysDept> sysDepts,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, Long caseId, Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, CaseApplication caseApplication,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) { List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
affiliate.setIdentityType(1); affiliate.setIdentityType(1);
@@ -645,7 +662,7 @@ public class CaseZipImportImpl {
// 申请人 // 申请人
switch (dictData.getDictLabel()) { switch (dictData.getDictLabel()) {
case "申请人姓名": case "申请人姓名":
affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId))); affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
if (StrUtil.isNotEmpty(affiliate.getName())) { if (StrUtil.isNotEmpty(affiliate.getName())) {
// 组装申请机构 // 组装申请机构
// 将组织机构id设为申请人名称 // 将组织机构id设为申请人名称
@@ -673,25 +690,25 @@ public class CaseZipImportImpl {
} }
break; break;
case "统一社会信用代码": case "统一社会信用代码":
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId))); affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
break; break;
case "法定代表人": case "法定代表人":
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
break; break;
case "法定代表人职位": case "法定代表人职位":
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId))); affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
break; break;
case "申请人住所": case "申请人住所":
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId))); affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
break; break;
case "申请人联系地址": case "申请人联系地址":
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
break; break;
case "委托代理人姓名": case "委托代理人姓名":
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
break; break;
case "委托代理人联系电话": case "委托代理人联系电话":
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) { if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
SysUser agentUser = null; SysUser agentUser = null;
// 用户已存在 // 用户已存在
@@ -736,28 +753,31 @@ public class CaseZipImportImpl {
} }
if (addUsers != null) { 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(); SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159"); request.setTemplateId("1956159");
request.setPhone(agentUser.getPhonenumber()); request.setPhone(agentUser.getPhonenumber());
request.setTemplateParamSet(new String[]{agentUser.getNickName()}); request.setTemplateParamSet(new String[]{agentUser.getNickName()});
SmsSendRecord smsSendRecord = new SmsSendRecord(); smsRequestList.add(request);
smsSendRecord.setCaseId(caseId); SmsSendRecord smsSendRecord = new SmsSendRecord();
CaseApplication caseApplication = new CaseApplication(); smsSendRecord.setCaseId(caseApplication.getId());
caseApplication.setId(caseId); smsSendRecord.setCaseNum(caseApplication.getCaseNum());
smsSendRecord.setCaseNum(caseApplication.getCaseNum()); smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setSendTime(new Date());
smsSendRecord.setSendTime(new Date()); String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; smsSendRecord.setSendContent(content);
smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername());
smsSendRecord.setCreateBy(getUsername()); smsSendRecords.add(smsSendRecord);
smsSendRecords.add(smsSendRecord); }
smsRequestList.add(request);
} }
} }
break; break;
case "委托代理人电子邮件": case "委托代理人电子邮件":
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null); affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()).replace("\n", "").replaceAll("\\s", "") : null);
break; break;
default: default:
@@ -39,6 +39,31 @@
sysdate() sysdate()
) )
</insert> </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="getSmsSendRecord" parameterType="SmsSendRecord" resultMap="SmsSendRecordResult">