This commit is contained in:
qitz
2024-02-20 09:17:29 +08:00
18 changed files with 233 additions and 111 deletions
@@ -51,6 +51,16 @@ public class MsCaseApplicationController extends BaseController {
List<MsCaseApplicationVO> list = caseApplicationService.list(req);
return getDataTable(list);
}
/**
* 根据登录人返回用户信息
*/
@GetMapping("/getUserInfo")
public AjaxResult getUserInfo()
{
return success(caseApplicationService.getUserInfo());
}
/**
* 新增案件
*/
@@ -63,6 +73,7 @@ public class MsCaseApplicationController extends BaseController {
return success(caseApplicationService.insert(caseApplication));
}
/**
* 根据身份证号获取性别和出生日期
*/
@@ -105,6 +116,17 @@ public class MsCaseApplicationController extends BaseController {
}
return success(caseApplicationService.update(caseApplication));
}
/**
* 删除案件
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody MsCaseApplication req ) {
if (req.getCaseFlowId() == null
|| (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
return error("参数校验失败");
}
return caseApplicationService.delete(req);
}
/**
* 根据id查询案件
*/
@@ -184,6 +184,10 @@ imConfig:
secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
# 腾讯云密钥
secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
# 调解机构代码配置
organizeConfig:
# creditCode
creditCode: 910000058386410047
#jodconverter:
# local:
# host: 121.40.189.20
@@ -1,58 +0,0 @@
package com.ruoyi.common.constant;
/**
* 立案申请案件状态
*
*/
public class CaseApplicationConstants {
/** 立案申请 */
public static final int CASE_APPLICATION = 0;
/** 待立案审查 */
public static final int CASE_CHECK = 1;
/** 待缴费 */
public static final int PENDING_PAYMENT = 2;
/** 待缴费确认 */
public static final int PENDING_PAYMENT_CONFIRM = 3;
/** 待案件质证 */
public static final int CASE_CROSSEXAMI = 4;
/** 待组庭 */
public static final int PENDING_TRIAL = 26;
/** 待组庭审核 */
public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 5;
/** 待组庭确定 */
public static final int CONFIRMDED_PENDING_TRIAL = 6;
/** 待审核仲裁方式 */
public static final int CHECK_ARBITRATION_METHOD = 7;
/** 待开庭审理 */
public static final int PENDING_OPENCOURT_HEAR = 8;
/** 待书面审理 */
public static final int PENDING_WRIITEN_HEAR = 9;
/** 待生成仲裁文书 */
public static final int GENERATED_ARBITRATION = 10;
/**待秘书核验仲裁文书*/
public static final int VERPRIF_ARBITRATION = 11;
/**待部门长审核仲裁文书*/
public static final int CHECK_ARBITRATION = 12;
/**待仲裁文书签名*/
public static final int SIGN_ARBITRATION = 13;
/** 待仲裁文书用印 */
public static final int ARBITRATED_SEAL = 14;
/** 待仲裁文书送达 */
public static final int ARBITRATION_DELIVERY = 15;
/** 待案件归档*/
public static final int CASE_FILING = 16;
/** 已归档*/
public static final int CASE_ARCHIVED = 17;
/** 待修改开庭时间*/
public static final int MODIFY_HEARDATE = 31;
/**待仲裁员审核仲裁文书*/
public static final int HEAD_CHECK_ARBITRATION = 18;
}
@@ -16,7 +16,7 @@ public enum AnnexTypeEnum implements EnumsInterface {
PAYMENT_RECEIPT(4, "申请人缴费单"),
MEETING_VIDEO(5, "会议视频"),
MEDIATE(6, "庭审笔录"),
MEDIATE_BOOK(7, "调解书"),
MEDIATE_BOOK(7, "调解书或和解协议"),
MEDIATION_FILES(8, "调解资料"),
RES_PAYMENT_RECEIPT(9, "被申请人缴费单"),
SEAL_PICTURE(10, "印章图片"),
@@ -4,10 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import javax.mail.*;
import javax.mail.internet.MimeMessage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@Slf4j
public final class EmailUtil {
@@ -27,8 +24,8 @@ public final class EmailUtil {
BodyPart bodyPart = multipart.getBodyPart(i);
if(bodyPart.getContentType().contains("Message/Rfc822")){
MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
if(mimeMessage.getSubject()!=null&&mimeMessage.getSubject().contains("裁决书")){
String[] split = mimeMessage.getSubject().split("裁决书");
if(mimeMessage.getSubject()!=null&&mimeMessage.getSubject().contains("调解书")){
String[] split = mimeMessage.getSubject().split("调解书");
if(split.length>0){
return split[0];
}
@@ -8,7 +8,7 @@ import java.util.List;
public class StringIdsReq {
private List<String> ids;
/**
* 签署人账号(即仲裁员手机号)
* 签署人账号(即调解员手机号)
*/
private String psnAccount;
/**
@@ -2,7 +2,6 @@ package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import lombok.Data;
@@ -40,13 +39,13 @@ public class CaseApplicationVO {
/** 立案日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date registerDate;
/** 仲裁方式 */
/** 调解方式 */
private Integer arbitratMethod;
/**
* 是否导入,0手动录入,1导入,默认0
*/
private Integer importFlag;
/** 仲裁方式名称 */
/** 调解方式名称 */
private String arbitratMethodName;
/** 案件状态 */
@@ -60,7 +59,7 @@ public class CaseApplicationVO {
private Integer respondentIsWrittenHear;
/** 开庭方式是否一致 */
private Integer arbitraMethodIssame;
/** 仲裁方式说明 */
/** 调解方式说明 */
private String arbitratMethodIllustrate;
@@ -35,7 +35,7 @@ public class MsCaseApplicationReq {
/**
* 申请机构
*/
private String applicationOrganId;
private List<Long> applicationOrganIds;
/**
* 是否申请人,不为空则是申请人
*/
@@ -100,4 +100,5 @@ public class MsCaseApplicationReq {
*/
private List<MsCaseAttach> attachList;
}
@@ -65,6 +65,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
* 拒绝原因
*/
private String rejectReason;
/**
* 调解方式名称,1-线上调解,2-线下调解
*/
private String mediationMethodName;
}
@@ -34,10 +34,20 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
* @param caseStatusNames
* @return
*/
@Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
@Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod," +
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
+
"0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> "
+
"<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0 '> and a.application_id in" +
"<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
"#{organId}" +
"</foreach>" +
"</if> "
+
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
"#{caseStatus}" +
@@ -50,7 +60,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c.case_flow_id = #{req.caseFlowId} " +
"</if> " +
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
" AND c.case_num = #{req.caseNum} " +
" AND c.case_num like concat('%', #{req.caseNum}, '%') "+
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -61,13 +71,23 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"<if test=\"req.endTime != null and req.endTime != ''\">" +
"and c.create_time &lt;= #{req.endTime}</if>" +
" </where> " +
"union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
+
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
+
"1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
"join ms_case_application c on r.case_appli_id=c.id " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" +
"select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
+
"<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0 '> and a.application_id in" +
"<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
"#{organId}" +
"</foreach>" +
"</if> "
+
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c1.case_status_name in" +
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
"#{caseStatus}" +
@@ -78,7 +98,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c1.case_flow_id = #{req.caseFlowId} " +
"</if> " +
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
" AND c1.case_num = #{req.caseNum} " +
" AND c1.case_num like concat('%', #{req.caseNum}, '%') " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -95,7 +115,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c.case_flow_id = #{req.caseFlowId} " +
"</if> " +
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
" AND c.case_num = #{req.caseNum} " +
" AND c.case_num like concat('%', #{req.caseNum}, '%')" +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -35,7 +35,11 @@ public interface MsCaseAttachMapper {
*/
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") Integer annexType);
/**
* 批量删除
* @param ids
*/
void batchDelete(@Param("ids")List<Long> ids);
}
@@ -78,4 +78,11 @@ public interface TemplateManageMapper {
* @return
*/
List<TemplateManage> selectTemplateListById(@Param("id")Long id);
/**
* 根据调解机构代码查询模板id
* @param creditCode
* @return
*/
Long selectByCreditCode(@Param("creditCode")long creditCode);
}
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.mscase;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
@@ -125,6 +126,12 @@ public interface MsCaseApplicationService {
* @return
*/
AjaxResult submit(MsCaseApplication req);
/**
* 删除案件
* @param req
* @return
*/
AjaxResult delete(MsCaseApplication req);
/**
* 查询调解员
@@ -208,4 +215,9 @@ public interface MsCaseApplicationService {
* @param caseId
*/
void notAccept(String caseId,String reason);
/**
* 根据登录人返回用户信息
*/
SysUser getUserInfo();
}
@@ -35,10 +35,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
import com.ruoyi.wisdomarbitrate.domain.dto.template.FatchRule;
import com.ruoyi.wisdomarbitrate.domain.dto.template.TemplateManage;
import com.ruoyi.wisdomarbitrate.domain.entity.dept.MsSealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.*;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
@@ -54,6 +51,7 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
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;
@@ -85,6 +83,11 @@ import static com.ruoyi.common.utils.SecurityUtils.getUsername;
*/
@Service
public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
/**
* 调解机构代码
*/
@Value("${organizeConfig.creditCode}")
private long creditCode;
@Autowired
MsCaseApplicationService caseApplicationService;
@Autowired
@@ -177,12 +180,24 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色为绑定案件流程");
}
Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
// Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
// 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
for (SysRole role : roles) {
if(StrUtil.isNotEmpty(role.getRoleName())){
if(StrUtil.equals(role.getRoleName(),"申请人")) {
List<Long> applicationOrganIds=new ArrayList<>();
applicationOrganIds.add(sysUser.getUserId());
caseStatusNames.add("待调解");
req.setApplicantFlag(1);
// 根据用户查询部门ids
List<SysDept> deptList = sysDeptMapper.selectDeptByUserId(loginUser.getUserId());
if(CollectionUtil.isNotEmpty(deptList)) {
List<Long> deptIds = deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList());
applicationOrganIds.addAll(deptIds);
}
req.setApplicationOrganIds(applicationOrganIds);
break;
}
if(StrUtil.equals(role.getRoleName(),"被申请人")){
@@ -232,11 +247,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色为绑定案件流程");
}
// 设置模板id,根据机构代码查询模板
Long templateId = templateManageMapper.selectByCreditCode(creditCode);
caseApplication.setTemplateId(templateId);
MsCaseFlow caseFlow = caseFlows.get(0);
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
caseApplication.setCaseFlowId(caseFlow.getId());
caseApplication.setCreateTime(new Date());
// 计算仲裁费用
// todo 暂时写死,费用300元
caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
setFeePayableMethod(caseApplication);
// 设置批号
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
@@ -260,7 +280,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 新增申请机构和代理人
caseApplicationService.insertAgentUser(affiliate);
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
// todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
// 查询申请人角色id
Long roleId = roleMapper.selectRoleIdByName("申请人");
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
@@ -306,8 +325,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
req.setBatchNumber(caseApplication.getBatchNumber());
}
// 生成调解申请书
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
// todo 部署放开
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
caseApplicationService.generateApplication(req);
// 保存案件附件
if (CollectionUtil.isNotEmpty(caseAttachList)) {
@@ -329,7 +348,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
columnValueMapper.batchSave(columnValueList);
}
// todo 发送短信
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
return 1;
}
@@ -359,7 +377,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
if(StrUtil.isNotEmpty(phone) && StrUtil.isNotEmpty(name)){
// 查询用户是否存在
SysUser sysUser = sysUserMapper.selectUserByUserName(name);
SysUser sysUser = sysUserMapper.selectUserByPhone(phone);
if(sysUser==null){
// 新增用户
sysUser = new SysUser();
@@ -446,6 +464,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
@Override
public AjaxResult update(MsCaseApplicationVO caseApplication) {
// 计算仲裁费用
caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
setFeePayableMethod(caseApplication);
caseApplication.setUpdateBy(SecurityUtils.getUsername());
caseApplication.setUpdateTime(new Date());
@@ -461,7 +480,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 新增申请机构代理人
caseApplicationService.insertAgentUser(affiliate);
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
// todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
// 查询申请人角色id
Long roleId = roleMapper.selectRoleIdByName("申请人");
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
@@ -873,10 +891,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
// 给申请人发送案件受理短信 尊敬的{1}用户,您的{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2049503", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2073601", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getContactTelphoneAgent(), new Date(), sendContent);
if (smsFlag) {
// 发送成功
@@ -891,7 +909,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件已经受理,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信";
// 给被申请人发送案件受理短信 2068468 待缴费通知 尊敬的用户,您编号为{1}的案件已经受理,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2068468", affiliate.getRespondentPhone(), new String[]{ application.getCaseNum()});
CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向被申请人发送短信," + sendContent);
// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向被申请人发送短信," + sendContent);
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getRespondentPhone(), new Date(), sendContent);
if (smsFlag) {
// 发送成功
@@ -918,17 +936,74 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
for (MsCaseApplication application : list) {
MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
// todo 发送短信
// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
}
}else {
MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
// todo 发送短信
// CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
}
return AjaxResult.success("提交成功");
}
@Transactional
@Override
public AjaxResult delete(MsCaseApplication req) {
if(req.getCaseFlowId()>1){
return AjaxResult.error("已提交的案件无法删除!");
}
if(StrUtil.isNotEmpty(req.getBatchNumber())){
// 批量删除
List<MsCaseApplication> list = listByBatchNumber(req.getBatchNumber(), req.getCaseFlowId());
if(CollectionUtil.isEmpty(list)){
return AjaxResult.error("该批次号下未找到案件");
}
List<Long> ids = list.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
// 删除主表
Example caseExample = new Example(MsCaseApplication.class);
Example.Criteria caseCriteria = caseExample.createCriteria();
caseCriteria.andIn("id", ids);
msCaseApplicationMapper.deleteByExample(caseExample);
// 删除相关人员表
Example affiliateExample = new Example(MsCaseAffiliate.class);
Example.Criteria affiliateCriteria = affiliateExample.createCriteria();
affiliateCriteria.andIn("caseAppliId", ids);
msCaseAffiliateMapper.deleteByExample(affiliateExample);
// 删除附件表
msCaseAttachMapper.batchDelete(ids);
// 删除预约调解员表
Example reservationExample = new Example(MsCaseMediator.class);
Example.Criteria reservationCriteria = reservationExample.createCriteria();
reservationCriteria.andIn("caseAppliId", ids);
msCaseMediatorMapper.deleteByExample(reservationExample);
// 删除日志表
Example caseLogExample = new Example(MsCaseLogRecord.class);
Example.Criteria caseLogCriteria = caseLogExample.createCriteria();
caseLogCriteria.andIn("caseAppliId", ids);
caseLogRecordMapper.deleteByExample(reservationExample);
}else {
// 删除主表
msCaseApplicationMapper.deleteByPrimaryKey(req.getId());
// 删除相关人员表
msCaseAffiliateMapper.deleteByPrimaryKey(req.getId());
// 删除附件表
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(),null);
// 删除预约调解员表
Example reservationExample = new Example(MsCaseMediator.class);
Example.Criteria reservationCriteria = reservationExample.createCriteria();
reservationCriteria.andEqualTo("caseAppliId", req.getId());
msCaseMediatorMapper.deleteByExample(reservationExample);
// 删除日志表
Example caseLogExample = new Example(MsCaseLogRecord.class);
Example.Criteria caseLogCriteria = caseLogExample.createCriteria();
caseLogCriteria.andEqualTo("caseAppliId", req.getId());
caseLogRecordMapper.deleteByExample(reservationExample);
}
return AjaxResult.success("删除成功");
}
/**
* 查询调解员
@@ -1024,9 +1099,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 被申请人预约
// 新增日志
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
return AjaxResult.error("申请代理人手机号为空");
}
// if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
// return AjaxResult.error("申请代理人手机号为空");
// }
// 判断申请人是否预约
caseApplicationService. isReservation( vo,userIds);
@@ -1115,7 +1190,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
}
// todo 发送短信
}
}
@@ -1207,7 +1282,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 发送短信 2065809 案件不予受理通知 尊敬的用户,您编号为{1}的案件由于{2}所以不予受理,请知晓,如非本人操作,请忽略本短信。
Boolean smsFlag = SmsUtils.sendSms(id, "2065809", phone, new String[]{application.getCaseNum(),reason});
String sendContent = "尊敬的用户,您编号为" + application.getCaseNum() + "的案件由于"+reason+"所以不予受理,请知晓,如非本人操作,请忽略本短信。";
CaseLogUtils.insertCaseLog(application.getId(), application.getCaseFlowId(), application.getCaseStatusName(), sendContent);
// CaseLogUtils.insertCaseLog(application.getId(), application.getCaseFlowId(), application.getCaseStatusName(), sendContent);
// 新增短信记录
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
@@ -1229,6 +1304,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
@Override
public SysUser getUserInfo() {
SysUser sysUser =new SysUser();
if(StrUtil.isNotEmpty(SecurityUtils.getUsername())){
sysUser = sysUserMapper.selectUserByUserName(getUsername());
}
return sysUser;
}
/**
* 查询预约信息
* @param id
@@ -1252,7 +1338,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
return AjaxResult.success(result);
}
Map<Integer, List<MsCaseMediator>> mediatorMap = msCaseMediators.stream().collect(Collectors.groupingBy(MsCaseMediator::getType));
// todo 申请人
result.setMediatorList(mediatorMap.get(MediatorTypeEnum.PC.getCode()));
result.setResMediatorList(mediatorMap.get(MediatorTypeEnum.MI_NI_PROGRESS.getCode()));
return AjaxResult.success(result);
@@ -1274,6 +1359,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (StrUtil.isEmpty(application.getMediationMethod())) {
return AjaxResult.error("未选择调解方式");
}
// 查询当前流程节点
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
if (currentFlow == null) {
throw new ServiceException("未找到当前流程节点");
}
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
if (application.getMediationMethod().equals("1")) {
// 线上调解
@@ -1559,6 +1649,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(caseFlow != null){
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
msCaseApplicationMapper.updateByPrimaryKey(application);
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
}
application.setMediaResult(mediaResult);
@@ -1597,6 +1690,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
if(caseFlow != null){
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
msCaseApplicationMapper.updateByPrimaryKey(application);
@@ -1615,6 +1710,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
msCaseApplicationMapper.updateByPrimaryKey(application);
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
}
application.setMediaResult(mediaResult);
@@ -1886,6 +1984,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
msCaseApplicationMapper.updateByPrimaryKey(application);
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
}
return AjaxResult.success();
}
@@ -354,7 +354,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
if(StrUtil.isNotEmpty(phone)) {
// 发送短信 2051914 调解缴费成功通知 尊敬的{1},您的调解申请费用已缴费成功。
Boolean smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", phone, new String[]{userName});
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人调解缴费成功通知短信,尊敬的" + userName + ",您的调解申请费用已缴费成功。");
// CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人调解缴费成功通知短信,尊敬的" + userName + ",您的调解申请费用已缴费成功。");
// 新增短信记录
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + ",您的调解申请费用已缴费成功。");
@@ -3,19 +3,16 @@ package com.ruoyi.wisdomarbitrate.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.enums.EsignRequestType;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.utils.EsignApplicaConfig;
import com.ruoyi.common.utils.EsignHttpHelper;
import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq;
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -826,8 +823,8 @@ public class SignAward {
String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
String jsonParm = "{\n" +
" \"keywords\": [\n" +
" \"仲裁员:\",\n" +
" \"(仲裁委员会盖章)\"\n" +
" \"调解员:\",\n" +
" \"(调解委员会盖章)\"\n" +
" ]\n" +
"}";
//请求方法
@@ -65,7 +65,16 @@
<delete id="deleteCaseAttachByCasedIdAndType">
delete from ms_case_attach
where case_appli_id = #{caseAppliId}
<if test="annexType != null ">
and annex_type = #{annexType}
</if>
</delete>
<delete id="batchDelete">
delete from ms_case_attach
where case_appli_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
@@ -150,4 +150,8 @@
select m.* ,f.* from ms_template_manage m join ms_template_manage_file f on m.id=f.template_manage_id
where m.id=#{id}
</select>
<select id="selectByCreditCode" resultType="java.lang.Long">
select m.id from ms_dept_identify i join ms_template_manage m on m.identify_id=i.id
where i.credit_code=#{creditCode} and i.del_flag=0 and i.identify_status=1 limit 1
</select>
</mapper>