调解系统修改

This commit is contained in:
18792927508
2024-04-02 15:56:40 +08:00
parent 08f4aca27c
commit 72026ee6f4
51 changed files with 3102 additions and 3242 deletions
@@ -1,5 +1,6 @@
package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@@ -7,161 +8,128 @@ import lombok.ToString;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
@Getter
@Setter
@ToString
@Table(name = "ms_case_affiliate")
public class MsCaseAffiliate {
public class MsCaseAffiliate{
/**
* id
*/
@Id
@Column(name = "id")
private Long id;
/**
* 案件主表id,案件申请表主键
*/
@Id
@Column(name = "case_appli_id")
private Long caseAppliId;
/**
* 是否机构申请,0-自然人,1-申请机构,默认0
* 用户id,用户表user_id关联
*/
@Column(name = "organize_flag")
private Integer organizeFlag;
@Column(name = "user_id")
private Long userId;
/**
* 申请人id
* 申请机构id,和部门表id关联
*/
@Column(name = "application_id")
private String applicationId;
/**
* 申请人名称
*/
@Column(name = "application_name")
private String applicationName;
@Column(name = "applicant_dept_id")
private Long applicantDeptId;
/**
* 代码(统一社会信用代码或者身份证号)
*/
@Column(name = "code")
@Transient
private String code;
/**
* 申请人联系电话
*/
@Column(name = "application_phone")
private String applicationPhone;
/**
* 申请人邮箱
*/
@Column(name = "application_email")
private String applicationEmail;
/**
* 法定代表人
*/
@Column(name = "comp_legal_person")
@Transient
private String compLegalPerson;
/**
* 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人
*/
@Column(name = "role_type")
private Integer roleType=1;
/**
* 组别
*/
@Column(name = "group_order")
private Integer groupOrder;
/**
* 是否操作人,0-否,1-是
*/
@Column(name = "operator_flag")
private Integer operatorFlag=1;
/**
* 电话
*/
@Transient
private String phone;
/**
* 邮箱
*/
@Transient
private String email;
/**
* 姓名
*/
@Transient
private String name;
/**
* 住所
*/
@Transient
private String home;
/**
* 联系地址
*/
@Transient
private String address;
/**
* 身份证号
*/
@Transient
private String idCard;
/**
* 申请人住所
* '身份类别,0-身份证,1-护照,默认0'
*/
@Column(name = "applicant_home")
private String applicantHome;
@Transient
private Integer idType;
/**
* 申请人联系地址
* 国籍,0-境内,1-境外,默认0
*/
@Column(name = "applicant_address")
private String applicantAddress;
@Transient
private Integer nationality;
/**
* 委托代理人姓名
* 生日
*/
@Column(name = "name_agent")
private String nameAgent;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
@Transient
private Date birth;
/**
* 代理人联系电话
* 性别,0-男,1-女
*/
@Column(name = "contact_telphone_agent")
private String contactTelphoneAgent;
/**
* 代理人邮箱
*/
@Column(name = "agent_email")
private String agentEmail;
/**
* 申请人快递单号
*/
@Column(name = "applicant_track_num")
private String applicantTrackNum;
@Transient
private String sex;
/**
* 被申请人姓名
*/
@Column(name = "respondent_name")
private String respondentName;
@Transient
private String resName;
/**
* 角色名称
*/
@Transient
private String roleName;
/**
* 申请机构名称
*/
@Transient
private String applicantOrgName;
/**
* 被申请人身份证号
*/
@Column(name = "respondent_identity_num")
private String respondentIdentityNum;
/**
* 被申请人联系电话
*/
@Column(name = "respondent_phone")
private String respondentPhone;
/**
* 被申请人性别(0=男,女=1)
*/
@Column(name = "respondent_sex")
private String respondentSex;
/**
* 被申请人出生年月日
*/
@Column(name = "respondent_birth")
private Date respondentBirth;
/**
* 被申请人申请人住所
*/
@Column(name = "respondent_home")
private String respondentHome;
/**
* 被申请人邮箱
*/
@Column(name = "respondent_email")
private String respondentEmail;
/**
* 被申请人快递单号
*/
@Column(name = "respondent_track_num")
private String respondentTrackNum;
/**
* 申请人是否签收
*/
@Column(name = "is_sign_apply")
private Integer isSignApply;
/**
* 被申请人是否签收
*/
@Column(name = "is_sign_respon")
private Integer isSignRespon;
/**
* 身份类别,0-身份证,1-护照,默认0
*/
@Column(name = "id_type")
private Integer idType;
/**
* 国籍,0-国内,1-国外,默认0
*/
@Column(name = "nationality")
private Integer nationality;
}
@@ -6,10 +6,7 @@ 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 javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
@@ -208,5 +205,20 @@ public class MsCaseApplication {
*/
@Column(name = "is_reconci")
private Integer isReconci;
/**
* 是否机构申请,0-自然人,1-申请机构,默认0
*/
@Column(name = "organize_flag")
private Integer organizeFlag;
/**
* 案件来源,YC-乙巢,空字符串-北明
*/
@Column(name = "case_source")
private String caseSource;
/**
* 拒绝原因
*/
@Transient
private String rejectReason;
}
@@ -77,4 +77,9 @@ public class MsCaseAttach {
*/
@Column(name = "only_office_file_id")
private String onlyOfficeFileId;
/**
* 对接其它系统返回的附件id
*/
@Column(name = "other_sys_file_id")
private String otherSysFileId;
}
@@ -0,0 +1,32 @@
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
import lombok.Data;
/**
* @Classname MsCaseAffiliateList
* @Description TODO
* @Version 1.0.0
* @Date 2024/3/27 16:08
* @Created wangqiong
*/
@Data
public class MsCaseAffiliateBase {
/**
* 申请人/操作人
*/
private MsCaseAffiliate applicant;
/**
* 申请人代理人
*/
private MsCaseAffiliate applicantAgent;
/**
* 被申请人/操作人
*/
private MsCaseAffiliate res;
/**
* 被申请人代理人
*/
private MsCaseAffiliate resAgent;
}
@@ -0,0 +1,11 @@
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
/**
* @Classname MsCaseAffiliateParent
* @Description TODO
* @Version 1.0.0
* @Date 2024/3/27 16:05
* @Created wangqiong
*/
public class MsCaseAffiliateParent extends MsCaseAffiliateVO {
}
@@ -0,0 +1,32 @@
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* @Classname MsCaseAffiliateVO
* @Description TODO
* @Version 1.0.0
* @Date 2024/3/22 11:46
* @Created wangqiong
*/
@Getter
@Setter
@ToString
@Data
public class MsCaseAffiliateVO {
/**
* 申请人/操作人
*/
private List<MsCaseAffiliateBase> applicant;
/**
* 被申请人/操作人
*/
private List<MsCaseAffiliateBase> res;
}
@@ -107,5 +107,18 @@ public class MsCaseApplicationReq {
* 代理人电话
*/
private String contactTelphoneAgent;
/**
* 邮箱
*/
private String resEmail;
/**
* 申请人邮箱
*/
private String email;
/**
* 角色类别
*/
private Integer roleType;
private Long userId;
}
@@ -1,7 +1,6 @@
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
import com.fasterxml.jackson.annotation.JsonFormat;
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 lombok.AllArgsConstructor;
@@ -34,7 +33,7 @@ public class MsCaseApplicationVO extends MsCaseApplication {
/**
* 案件相关人员
*/
private MsCaseAffiliate affiliate;
private MsCaseAffiliateVO affiliate;
/**
* 是否压缩包导入,默认false
*/
@@ -84,5 +83,17 @@ public class MsCaseApplicationVO extends MsCaseApplication {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date endTime;
/**
* 是否申请操作人,0-否,1-是
*/
private Integer appOperatorFlag;
/**
* 是否被申请操作人,0-否,1-是
*/
private Integer resOperatorFlag;
/**
* 是否财务,部门长,秘书,0-否,1-是
*/
private Integer otherFlag;
}
@@ -1,7 +1,30 @@
package com.ruoyi.wisdomarbitrate.mapper.mscase;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface MsCaseAffiliateMapper extends Mapper<MsCaseAffiliate> {
/**
* 查询申请人被申请人
* @param caseIds
* @return
*/
List<MsCaseAffiliate> listGroupConcat(@Param("caseIds") List<Long> caseIds);
/**
* 根据案件id查询案件人员
* @param id
* @return
*/
List<MsCaseAffiliate> selectByCaseId(@Param("id") Long id);
/**
* 根据案件id查询相关人员及角色
* @param id
* @return
*/
List<MsCaseAffiliate> selectUserRoleByCaseIds(@Param("caseIds") List<Long> caseIds);
}
@@ -29,125 +29,14 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" </script>")
Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
/**
/**
* 案件列表查询
* @param req
* @param caseStatusNames
* @param caseFlowIds
* @return
*/
@Select("<script> select t.* from (select c.media_result mediaResult,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> "
+
"<if test=\"req.mediatorId != null \">" +
" AND c.mediator_id = #{req.mediatorId} " +
"</if> "
+
"<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> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
"</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}" +
"</foreach>" +
"</if> " +
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
" AND c.batch_number = #{req.batchNumber} " +
"</if> " +
"<if test=\"req.caseFlowId != null \">" +
" AND c.case_flow_id = #{req.caseFlowId} " +
"</if> "
+
"<if test=\"req.mediationMethod != null \">" +
" AND c.mediation_method = #{req.mediationMethod} " +
"</if> "
+
"<if test=\"req.caseNum != null and 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} " +
"</if> "
+
"<if test=\"req.startTime != null and req.startTime != ''\">" +
"and c.create_time &gt;= #{req.startTime}</if>" +
"<if test=\"req.endTime != null and req.endTime != ''\">" +
"and c.create_time &lt;= #{req.endTime}</if>" +
" </where> " +
"union select c.media_result mediaResult,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.mediatorId != null \">" +
" AND c1.mediator_id = #{req.mediatorId} " +
"</if> "
+
"<if test=\"req.mediationMethod != null \">" +
" AND c1.mediation_method = #{req.mediationMethod} " +
"</if> "
+
"<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> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
"</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}" +
"</foreach>" +
"</if> "
+
"<if test=\"req.caseFlowId != null \">" +
" AND c1.case_flow_id = #{req.caseFlowId} " +
"</if> " +
"<if test=\"req.caseNum != null and 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} " +
"</if> "
+
"<if test=\"req.startTime != null and req.startTime != ''\">" +
"and c1.create_time &gt;= #{req.startTime}</if>" +
"<if test=\"req.endTime != null and req.endTime != ''\">" +
"and c1.create_time &lt;= #{req.endTime}</if>" +
" </where> " +
" ) "
+
"<if test=\"req.caseFlowId != null \">" +
" AND c.case_flow_id = #{req.caseFlowId} " +
"</if> " +
"<if test=\"req.caseNum != null and 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} " +
"</if> "
+
"<if test=\"req.startTime != null and req.startTime != ''\">" +
"and c.create_time &gt;= #{req.startTime}</if>" +
"<if test=\"req.endTime != null and req.endTime != ''\">" +
"and c.create_time &lt;= #{req.endTime}</if>" +
" ) t order by t.createTime desc,t.caseNum desc" +
" </script>")
List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds , @Param("roleIds") List<Long> roleIds );
/**
* 查询调解员列表
@@ -162,46 +51,5 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
@Select("select max(room_id) maxRoomId from ms_reserved_conference")
Long selectMaxRoomId();
/**
* 待办数量
* @param o
* @return
*/
@Select(" <script> SELECT c.case_flow_id caseFlowId,count(c.id) caseCount " +
"FROM ms_case_application c " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
"<if test=\"req.mediatorId != null \">" +
" AND c.mediator_id = #{req.mediatorId} " +
"</if> "
+
"<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> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
"</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}" +
"</foreach>" +
"</if> " +
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
" AND c.batch_number = #{req.batchNumber} " +
"</if> " +
"<if test=\"req.caseFlowId != null \">" +
" AND c.case_flow_id = #{req.caseFlowId} " +
"</if> "
+
"<if test=\"req.mediationMethod != null \">" +
" AND c.mediation_method = #{req.mediationMethod} " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
"</if> "
+
" </where> " +
"group by c.case_flow_id,c.case_status_name"+
" </script>"
)
List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds, @Param("roleIds") List<Long> roleIds);
}
@@ -1,9 +1,13 @@
package com.ruoyi.wisdomarbitrate.service.mscase;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SMSNotice;
import com.ruoyi.common.core.domain.entity.SMSNoticeDO;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.PushCaseStatusEnum;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
@@ -49,6 +53,20 @@ public interface MsCaseApplicationService {
* @return
*/
String insert(MsCaseApplicationVO caseApplication);
/**
* 设置案件相关信息
* @param caseApplication
* @param affiliate
* @param groupOrder 组别
*/
public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder);
/**
* 新增案件相关人员信息
* @param affiliate 相关人员信息
* @param roleId 角色id
*/
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList);
/**
* 新增案件
@@ -62,13 +80,7 @@ public interface MsCaseApplicationService {
* @return
*/
AjaxResult batchInsert(MsCaseBatchInsertVO vo);
/**
* 新增用户
* @param affiliate
* @param agentFlag 是否代理人,0-否,1-是
* @param roleId
*/
void insertApplicantUser( MsCaseAffiliate affiliate,boolean agentFlag, Long roleId);
/**
* 新增申请机构代理人
* @param affiliate
@@ -150,6 +162,13 @@ public interface MsCaseApplicationService {
* @return
*/
AjaxResult submit(MsCaseApplication req);
/**
* 北明推送案件状态
* @param caseApplication 案件
* @param pushCaseStatusEnum 案件状态
* @return
*/
public JSONObject pushStatusToBM(MsCaseApplication caseApplication, PushCaseStatusEnum pushCaseStatusEnum);
/**
* 删除案件
* @param req
@@ -204,22 +223,16 @@ public interface MsCaseApplicationService {
AjaxResult updateTrialPen(MsCaseAttach attach);
/**
* 确认调解书
* @param attach
* @return
*/
AjaxResult confirmMediation(MsCaseAttachVO attach) throws EsignDemoException, InterruptedException ;
/**
* 生成调解申请书
* @param application 案件基本信息
* @param affiliate 案件相关人员
* @param affiliates 案件相关人员
* @param templatePath 模板路径
* @param bookmarkList 标签
* @param dictDataList 内置字段
*/
void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
void createMediateApplication(MsCaseApplication application, List<MsCaseAffiliate> affiliates, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
/**
* 调解书上传到onlyoffice服务器
* @param annexPath
@@ -231,8 +244,15 @@ public interface MsCaseApplicationService {
* @param req
* @param affiliateMap
*/
void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, MsCaseAffiliate> affiliateMap) ;
void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, List<MsCaseAffiliate>> affiliateMap) ;
/**
* 受理分配通知
* @param application 案件基本信息
* @param affiliates 案件人员
* @param applicantFlag 是否申请人
*/
public void isAcceptNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag);
/**
* 判断申请人/被申请人是否预约
* @param vo
* @param userIds 选择的调解员ids
@@ -268,4 +288,49 @@ public interface MsCaseApplicationService {
*/
AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
/**
* 发送短信
* @param smsFlag 短信是否发送成功
* @param application 案件基本信息
* @param affiliate 案件人员
* @param sendContent 发送内容
*/
public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
/**
* 发送邮件
* @param application 案件基本信息
* @param affiliate 案件人员
* @param subject 主题
* @param sendContent 内容
*/
public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent);
/**
* 发送开庭日期短信
* @param application
* @param affiliates
*/
public void sendHearDateSms(MsCaseApplication application, List<MsCaseAffiliate> affiliates);
/**
* 发送短信
* @param application
* @param affiliate
* @param notice
*/
public void sendNotice(MsCaseApplication application, MsCaseAffiliate affiliate,
SMSNoticeDO notice);
/**
* 申请操作人/被申操作人发送通知
* @param application
* @param affiliates
* @param applicantFlag
* @param notice
*/
public void sendNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag,
SMSNotice notice);
/**
* 根据案件id查询案件相关人员
* @param id
* @return
*/
public List<MsCaseAffiliate> selectAffliatesByCaseId(Long id);
}
@@ -64,4 +64,11 @@ public interface MsCasePaymentService {
*/
public void confirmPayment(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto);
/**
* 发送受理短信
* @param dto
* @param caseAppllication
*/
public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone );
}
@@ -4,7 +4,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
import java.io.IOException;
@@ -13,7 +12,7 @@ import java.util.List;
public interface MsSignSealService {
AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplication) throws EsignDemoException, InterruptedException;
AjaxResult sealApply(MsSignSealDTO dto);
@@ -30,12 +29,6 @@ public interface MsSignSealService {
AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
@@ -44,7 +44,7 @@ public interface VideoConferenceService {
* @param userId
* @return
*/
AjaxResult secretaryRoleByUserId(Long userId);
AjaxResult secretaryRoleByUserId(Long userId, Long caseId);
/**
* 根据html字符串转pdf并和案件关联
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.AnnexTypeEnum;
import com.ruoyi.common.enums.PaymentStatusEnum;
import com.ruoyi.common.enums.YesOrNoEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
@@ -40,6 +41,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
public class MsCasePaymentServiceImpl implements MsCasePaymentService {
@@ -226,7 +228,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
JSONObject jsonObject = new JSONObject();
jsonObject.set("totalFee", totalFee);
jsonObject.set("applicationOrganName", affiliate.getApplicationName());
// jsonObject.set("applicationOrganName", affiliate.getApplicationName());
return AjaxResult.success(jsonObject);
}
@@ -248,10 +250,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
result.setCaseSubjectAmount(application.getCaseSubjectAmount());
result.setFeePayable(application.getFeePayable());
result.setCaseStatusName(application.getCaseStatusName());
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
if(affiliate != null) {
result.setApplicationOrganName(affiliate.getApplicationName());
}
// 查询缴费单
result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
result.setResCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.RES_PAYMENT_RECEIPT.getCode()));
@@ -369,12 +367,78 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
auditMapper.insert(audit);
}
// 查询申请人电话,如果是自然人,代理人不为空,则给代理人发短信,代理人为空,给申请人发短信
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
// 发送缴费通知
sendPaymentSms(dto,caseAppllication, affiliate,flow);
// 查询案件人员
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(application.getId());
if(CollectionUtil.isEmpty(affiliates)){
throw new ServiceException("未找到案件相关人员");
}
List<MsCaseAffiliate> operatorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(affiliate.getPhone())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(operatorList)){
throw new ServiceException("未找到案件操作人员");
}
if(dto.getApplicantConfirm()) {
// 申请人确认缴费
for (MsCaseAffiliate affiliate : operatorList) {
// 发送缴费通知
if (affiliate.getRoleType() == null) {
continue;
}
if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
Boolean smsFlag = true;
SmsSendRecord smsSendRecord = null;
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// 缴费通过
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
} else {
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
}
// 新增短信记录
if (smsFlag) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
}
}else {
// 被申请人确认缴费
for (MsCaseAffiliate affiliate : operatorList) {
// 发送缴费通知
if (affiliate.getRoleType() == null) {
continue;
}
if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
Boolean smsFlag = true;
SmsSendRecord smsSendRecord = null;
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// 缴费通过
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
} else {
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
}
// 新增短信记录
if (smsFlag) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
// 被申请人确认缴费,发送受理通知
if( dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// 申请人发送受理短信
casePaymentService.sendAcceptSms(dto, caseAppllication, affiliate.getName(), affiliate.getPhone());
}
}
}
}
@@ -395,76 +459,15 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
/**
* 发送缴费短信
* @param dto
* @param caseAppllication
* @param affiliate
*/
private void sendPaymentSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication, MsCaseAffiliate affiliate,MsCaseFlow flow) {
if (affiliate != null) {
// 受理通知
String phone = "";
String userName = "";
// 缴费通知
String payPhone = "";
String payUserName = "";
if (affiliate.getOrganizeFlag().equals(0)) {
// 自然人
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
phone = affiliate.getContactTelphoneAgent();
userName = affiliate.getNameAgent();
} else {
phone = affiliate.getApplicationPhone();
userName = affiliate.getApplicationName();
}
} else {
phone = affiliate.getContactTelphoneAgent();
userName = affiliate.getNameAgent();
}
if (StrUtil.isNotEmpty(phone)) {
payPhone=phone;
payUserName=userName;
if(!dto.getApplicantConfirm()) {
// 被申请人发送通知
payPhone=affiliate.getRespondentPhone();
payUserName=affiliate.getRespondentName();
}
Boolean smsFlag =true;
SmsSendRecord smsSendRecord=null;
// 申请人被申请人发送缴费成功短信 2051914 调解缴费成功通知 尊敬的{1},您的调解申请费用已缴费成功。
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", payPhone, new String[]{payUserName});
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + ",您的调解申请费用已缴费成功。");
} else {
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", payPhone, new String[]{payUserName, caseAppllication.getCaseNum(), dto.getReason()});
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
}
// 新增短信记录
if (smsFlag) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
if(!dto.getApplicantConfirm()&& dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// 申请人发送受理短信
sendAcceptSms(dto, caseAppllication, userName, phone);
// 被申请人发送受理短信
sendAcceptSms(dto, caseAppllication, affiliate.getRespondentName(), affiliate.getRespondentPhone());
}
}
}
}
/**
* 发送受理短信
* @param dto
* @param caseAppllication
*/
private void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
@Transactional
public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
// 申请人被申请人发送受理通知书 2073601 尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
Boolean smsFlag = SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
@@ -16,18 +16,20 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.AnnexTypeEnum;
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
import com.ruoyi.common.enums.PushCaseStatusEnum;
import com.ruoyi.common.enums.YesOrNoEnum;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.EmailOutUtil;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseLogRecord;
@@ -40,6 +42,7 @@ import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseLogRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
@@ -54,6 +57,7 @@ import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.wisdomarbitrate.utils.SignAward;
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;
@@ -106,286 +110,19 @@ public class MsSignSealServiceImpl implements MsSignSealService {
@Autowired
private SendMailRecordMapper sendMailRecordMapper;
// 北明配置
@Value("${BMConfig.userName}")
private String BMUserName;
@Value("${BMConfig.password}")
private String BMPassword;
@Value("${BMConfig.syncSource}")
private String BMSyncSource;
@Autowired
BeiMingInterfaceService beiMingInterfaceService;
@Override
@Transactional
public AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplicationVO) throws EsignDemoException, InterruptedException {
Long id = caseApplicationVO.getId();
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
// 查询案件相关人员
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
// 查询附件
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(id);
if (caseAttachList != null && caseAttachList.size() > 0) {
for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
// String annexPath = caseAttach.getAnnexPath();
// String path = "/home/ruoyi" + annexPath;
String prefix = "/profile";
int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
String path = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\f8551b0e003e4af89acae7b500dacb77调解书.docx";
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
String body = response.getBody();
if (body != null) {
JSONObject jsonObject = JSONObject.parseObject(body);
String fileId = jsonObject.getJSONObject("data").getString("fileId");
String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
//上传文件流
EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
if (jsonObject1.getIntValue("errCode") == 0) {
//查看文件上传状态
Thread.sleep(1000);
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
JSONObject data = jsonObject2.getJSONObject("data");
int fileStatus = data.getIntValue("fileStatus");
if (fileStatus == 2 || fileStatus == 5) {
String fileName = data.getString("fileName");
//上传成功,获取文件签名印章位置
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setFileid(fileId);
EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
Gson gson = new Gson();
JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
String keywordPositions = positionsData.get("keywordPositions").toString();
//发起签署
sealSignRecord.setFilename(fileName);
Long arbitratorId = caseApplication.getMediatorId();
if (arbitratorId!=null) {
SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
if (sysUser == null) {
return AjaxResult.error();
}
sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
sealSignRecord.setPensonNameMedi(sysUser.getNickName());
}
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIsUse(1);
DeptIdentify deptIdentifyselect = new DeptIdentify();
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
deptIdentifyselect = deptIdentifysnew.get(0);
sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
} else {
return AjaxResult.error("没有用印时的机构名称及经办人信息");
}
//解析文件签名印章位置
JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject3 = jsonArray.getJSONObject(i);
String keyword = jsonObject3.getString("keyword");
if (keyword.equals("甲方(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
for (int j = 0; j < positionsArray.size(); j++) {
JSONObject positionObj = positionsArray.getJSONObject(j);
int pageNum = positionObj.getIntValue("pageNum");
sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsn(positionX + 90);
sealSignRecord.setPositionYpsn(positionY + 30);
}
}else if (keyword.equals("乙方(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
for (int j = 0; j < positionsArray.size(); j++) {
JSONObject positionObj = positionsArray.getJSONObject(j);
int pageNum = positionObj.getIntValue("pageNum");
sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsnRes(positionX + 90);
sealSignRecord.setPositionYpsnRes(positionY);
}
}else if (keyword.equals("调解员(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
for (int j = 0; j < positionsArray.size(); j++) {
JSONObject positionObj = positionsArray.getJSONObject(j);
int pageNum = positionObj.getIntValue("pageNum");
sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsnMedi(positionX + 90);
sealSignRecord.setPositionYpsnMedi(positionY);
}
}else {
//用印
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
for (int j = 0; j < positionsArray.size(); j++) {
JSONObject positionObj = positionsArray.getJSONObject(j);
int pageNum = positionObj.getIntValue("pageNum");
sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXorg(positionX + 90);
sealSignRecord.setPositionYorg(positionY);
}
}
}
/*DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setSealStatus(1); // 印章状态为启用
//根据机构名称查询部门id
SysDept sysDept = new SysDept();
sysDept.setDeptName(sealSignRecord.getOrgnizeName());
List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
if (sysDepts != null && sysDepts.size() > 0) {
Long deptId = sysDepts.get(0).getDeptId();
deptIdentify1.setDeptId(deptId);
}
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
List<String> sealIds = new ArrayList<>();
if (deptIdentifies != null && deptIdentifies.size() > 0) {
for (DeptIdentify identify : deptIdentifies) {
String sealId = identify.getSealId();
sealIds.add(sealId);
}
}*/
String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
//查询机构信息
DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setIdentifyName(orgnizeName);
deptIdentify1.setOperName(orgnizeNamepsnName);
deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
Long iddeptIdent = deptIdentifies.get(0).getId();
SealManage sealManage = new SealManage();
sealManage.setIdentifyId(iddeptIdent);
List<String> sealIdList = new ArrayList<>();
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
if (selectSealList != null && selectSealList.size() > 0) {
for (SealManage manage : selectSealList) {
Integer sealStatus = manage.getSealStatus();
Integer isUse = manage.getIsUse();
if (sealStatus == 1 && isUse ==1) {
sealIdList.add(manage.getSealId());
}
}
EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
if (jsonObject3 != null) {
if (jsonObject3.getIntValue("code") == 0) {
//获取签署流程ID
JSONObject data1 = jsonObject3.getJSONObject("data");
String signFlowId = data1.getString("signFlowId");
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
sealSignRecord.setCaseAppliId(caseApplication.getId());
sealSignRecord.setSignFlowid(signFlowId);
sealSignRecord.setSignFlowStatus(1);//待签名
MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
msSealSignRecord.setFileId(sealSignRecord.getFileid());
msSealSignRecord.setFileName(sealSignRecord.getFilename());
msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
sealSignRecordMapper.insert(msSealSignRecord);
SealSignRecord sealSignRecordapply = new SealSignRecord();
sealSignRecordapply.setSignFlowid(signFlowId);
sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String urlapply = signUrlData.get("shortUrl").getAsString();
String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
//发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("2047719");
request.setPhone(caseAffiliate.getContactTelphoneAgent());
request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
Boolean aBoolean = SmsUtils.sendSms(request);
SealSignRecord sealSignRecordRespon = new SealSignRecord();
sealSignRecordRespon.setSignFlowid(signFlowId);
sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
request1.setTemplateId("2047719");
request1.setPhone(caseAffiliate.getRespondentPhone());
request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
Boolean aBoolean1 = SmsUtils.sendSms(request1);
SealSignRecord sealSignRecordMedi = new SealSignRecord();
sealSignRecordMedi.setSignFlowid(signFlowId);
sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
requestMedi.setTemplateId("2047719");
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
} else {
throw new ServiceException(jsonObject3.getString("message"));
}
} else {
return AjaxResult.error();
}
}
} else {
return AjaxResult.error();
}
}
}
}
break;
}
}
}
return AjaxResult.success();
}
@Override
@Transactional
@@ -457,8 +194,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
public AjaxResult selectCaseProgress(MsSignSealDTO dto) {
Map<String, Object> datas = new HashMap<>();
Long id = dto.getCaseId();
// MsCaseLogRecord caseLogRecord = new MsCaseLogRecord();
// caseLogRecord.setCaseAppliId(id);
List<MsCaseLogRecordVO> records = caseLogRecordMapper.selectCaseLogRecordListCaseProgress(dto.getCaseId());
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(id);
@@ -468,7 +203,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
List<MsCaseLogRecordVO> recordsNew = new ArrayList<>();
if (records != null && records.size() > 0) {
for (MsCaseLogRecordVO msCaseLogRecordVO : records) {
// String content = msCaseLogRecordVO.getContent();
String content = msCaseLogRecordVO.getCaseStatusName();
if(StringUtils.isNotEmpty(content)){
if(content.equals("结束")){
@@ -594,6 +328,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult msCaseFile(List<Long> ids){
// todo
try {
for (Long id : ids) {
MsCaseApplication caseApplication1 = msCaseApplicationMapper.selectByPrimaryKey(id);
@@ -606,10 +341,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if (caseAttachList != null && caseAttachList.size() > 0) {
for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
// String annexName = caseAttach.getAnnexName();
// String prefix = "/profile/upload/";
// int startIndex = prefix.length();
// String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
String prefix = "/profile";
int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
@@ -638,9 +369,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String day = String.format("%02d", now.getDayOfMonth());
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/";
String saveName = fileName;
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
@@ -687,61 +415,48 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplication1.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(caseApplication1);
String appEmail = "";
String resEmail = "";
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
// 获取案件相关人员
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(id);
if(CollectionUtil.isEmpty(affiliates)){
return AjaxResult.error("未找到案件相关人员");
}
List<MsCaseAffiliate> oprratorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null
&& affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()))
.collect(Collectors.toList());
if(CollectionUtil.isEmpty(oprratorList)){
return AjaxResult.error("未找到案件操作人员");
}
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
if(organizeFlag!=null){
if(organizeFlag.intValue()==1){
appEmail = caseAffiliate.getAgentEmail();
}else {
appEmail = caseAffiliate.getApplicationEmail();
for (MsCaseAffiliate affiliate : oprratorList) {
if(affiliate.getRoleType()==null){
continue;
}
}
resEmail = caseAffiliate.getRespondentEmail();
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
boolean appEmailFlag = sendCaseEmail(caseApplication1, affiliate.getEmail(), caseAttachList);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(appEmail);
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord.setMailName("签署后的调解书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(SecurityUtils.getUsername());
if (appEmailFlag) {
sendMailRecord.setSendStatus(1);
} else {
sendMailRecord.setSendStatus(0);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(affiliate.getEmail());
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
sendMailRecord.setMailName("签署后的调解书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(SecurityUtils.getUsername());
if (appEmailFlag) {
sendMailRecord.setSendStatus(1);
} else {
sendMailRecord.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
SendMailRecord sendMailRecord1 = new SendMailRecord();
sendMailRecord1.setCaseId(id);
sendMailRecord1.setMailAddress(resEmail);
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord1.setMailContent("您好,审核后的调解书在附件中请查阅");
sendMailRecord1.setMailName("签署后的调解书");
sendMailRecord1.setSendTime(new Date());
sendMailRecord1.setCreateBy(SecurityUtils.getUsername());
if (resEmailFlag) {
sendMailRecord1.setSendStatus(1);
}else {
sendMailRecord1.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
if(!appEmailFlag&&!resEmailFlag){
throw new ServiceException("调解书发送失败");
}
if(!appEmailFlag){
throw new ServiceException("申请人调解书发送失败");
}
if(!resEmailFlag){
throw new ServiceException("被申请人调解书发送失败");
}
// if(!appEmailFlag&&!resEmailFlag){
// throw new ServiceException("调解书发送失败");
// }
// if(!appEmailFlag){
// throw new ServiceException("申请人调解书发送失败");
// }
// if(!resEmailFlag){
// throw new ServiceException("被申请人调解书发送失败");
// }
CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
@@ -778,8 +493,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
// }
// }
if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
caseAffiliate.setIsSignApply(1);
msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
// todo 签收不要该字段
// caseAffiliate.setIsSignApply(1);
// todo 签收不要该字段
// msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -802,8 +519,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
// }
if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
caseAffiliate.setIsSignRespon(1);
msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
// todo 签收不要该字段
// caseAffiliate.setIsSignRespon(1);
// todo 签收不要该字段
// msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -811,6 +530,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
// todo 被申请人签收结束对接北明,为调解成功状态
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
}
}
return AjaxResult.success("签收成功");
@@ -819,12 +543,29 @@ public class MsSignSealServiceImpl implements MsSignSealService {
@Override
public AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException {
// todo
Long caseId = dto.getCaseId();
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
//MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(caseId);
if(CollectionUtil.isEmpty(affiliates)){
return AjaxResult.error("未找到案件相关人员");
}
List<MsCaseAffiliate> operatorList = affiliates.stream().filter(msCaseAffiliate -> msCaseAffiliate.getOperatorFlag() != null
&& msCaseAffiliate.getOperatorFlag() == 1
&& StrUtil.isNotEmpty(msCaseAffiliate.getPhone())).collect(Collectors.toList());
Optional<MsCaseAffiliate> appOpt =null;
Optional<MsCaseAffiliate> resOpt =null;
if(CollectionUtil.isNotEmpty(operatorList)){
appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
&& (msCaseAffiliate.getRoleType() == 1 || msCaseAffiliate.getRoleType() == 2))
.findFirst();
resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
&& (msCaseAffiliate.getRoleType() == 3 || msCaseAffiliate.getRoleType() == 4))
.findFirst();
}
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(caseId);
Integer organizeFlag = caseApplication.getOrganizeFlag();
SysUser user = new SysUser();
Long userId = SecurityUtils.getUserId();
user.setUserId(userId);
@@ -836,6 +577,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
}
List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
if(roleNames.contains("申请人")){
if(appOpt==null || !appOpt.isPresent()){
return AjaxResult.error("未找到案件申请操作人");
}
SealSignRecord sealSignRecordres = new SealSignRecord();
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
mssealSignRecord.setCaseAppliId(caseId);
@@ -844,19 +588,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String signFlowid = sealSignRecords.get(0).getSignFlowId();
if(organizeFlag!=null){
SealSignRecord sealSignRecord = new SealSignRecord();
if(organizeFlag.intValue()==1){
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
}else {
String nameAgent = caseAffiliate.getNameAgent();
if(StringUtils.isNotBlank(nameAgent)){
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
}else {
sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
}
}
sealSignRecord.setPensonAccount(appOpt.get().getPhone());
sealSignRecord.setPensonName(appOpt.get().getName());
sealSignRecord.setSignFlowid(signFlowid);
Gson gson = new Gson();
@@ -873,6 +606,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
}else if(roleNames.contains("被申请人")){
if(resOpt==null || !resOpt.isPresent()){
return AjaxResult.error("未找到案件申请操作人");
}
SealSignRecord sealSignRecordres = new SealSignRecord();
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
mssealSignRecord.setCaseAppliId(caseId);
@@ -880,7 +616,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if (sealSignRecords != null && sealSignRecords.size() > 0) {
String signFlowid = sealSignRecords.get(0).getSignFlowId();
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
sealSignRecord.setPensonAccount(resOpt.get().getPhone());
sealSignRecord.setPensonName(resOpt.get().getName());
sealSignRecord.setSignFlowid(signFlowid);
Gson gson = new Gson();
@@ -927,95 +664,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
return AjaxResult.success();
}
@Override
public AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException {
Long caseId = dto.getCaseId();
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
SealSignRecord sealSignRecordres = new SealSignRecord();
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
mssealSignRecord.setCaseAppliId(caseId);
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
if (sealSignRecords != null && sealSignRecords.size() > 0) {
String signFlowid = sealSignRecords.get(0).getSignFlowId();
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
sealSignRecord.setSignFlowid(signFlowid);
Gson gson = new Gson();
EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String urlapply = signUrlData.get("shortUrl").getAsString();
sealSignRecordres.setSealUrl(urlapply);
}
return AjaxResult.success(sealSignRecordres);
}
@Override
public AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException {
Long caseId = dto.getCaseId();
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
SealSignRecord sealSignRecordres = new SealSignRecord();
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
mssealSignRecord.setCaseAppliId(caseId);
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
if (sealSignRecords != null && sealSignRecords.size() > 0) {
String signFlowid = sealSignRecords.get(0).getSignFlowId();
if(organizeFlag!=null){
SealSignRecord sealSignRecord = new SealSignRecord();
if(organizeFlag.intValue()==1){
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
}else {
String nameAgent = caseAffiliate.getNameAgent();
if(StringUtils.isNotBlank(nameAgent)){
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
}else {
sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
}
}
sealSignRecord.setSignFlowid(signFlowid);
Gson gson = new Gson();
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String urlapply = signUrlData.get("shortUrl").getAsString();
sealSignRecordres.setSealUrl(urlapply);
}
}
return AjaxResult.success(sealSignRecordres);
}
@Override
public AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException {
Long caseId = dto.getCaseId();
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
SealSignRecord sealSignRecordres = new SealSignRecord();
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
mssealSignRecord.setCaseAppliId(caseId);
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
if (sealSignRecords != null && sealSignRecords.size() > 0) {
String signFlowid = sealSignRecords.get(0).getSignFlowId();
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
sealSignRecord.setSignFlowid(signFlowid);
Gson gson = new Gson();
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String urlapply = signUrlData.get("shortUrl").getAsString();
sealSignRecordres.setSealUrl(urlapply);
}
return AjaxResult.success(sealSignRecordres);
}
@Override
@Transactional(rollbackFor = Exception.class)
@@ -1187,12 +835,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
// 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){
// todo 对接北明,同步案件状态,删除
for (MsCaseAttach msCaseAttach : existAttach) {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
continue;
}
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
}
}
}
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
caseAttachMapper.save(caseAttach);
// todo 对接北明,调用上传附件接口
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
String templatePath = "/home/ruoyi" + savePath;
File file = new File(templatePath.replace("/profile", "/uploadPath"));
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
// 更新附件表
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
@@ -1256,12 +930,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
// 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){
// todo 对接北明,同步案件状态,删除
for (MsCaseAttach msCaseAttach : existAttach) {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
continue;
}
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
}
}
}
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
caseAttachMapper.save(caseAttach);
// todo 对接北明,调用上传附件接口
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
String templatePath = "/home/ruoyi" + savePath;
File file = new File(templatePath.replace("/profile", "/uploadPath"));
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
// 更新附件表
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
@@ -1322,12 +1022,39 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
// 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){
// todo 对接北明,同步案件状态,删除
for (MsCaseAttach msCaseAttach : existAttach) {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
continue;
}
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
}
}
}
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
caseAttachMapper.save(caseAttach);
// todo 对接北明,调用上传附件接口
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
String templatePath = "/home/ruoyi" + savePath;
File file = new File(templatePath.replace("/profile", "/uploadPath"));
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
// 更新附件表
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
@@ -31,9 +31,6 @@ import com.tencentcloudapi.trtc.v20190722.TrtcClient;
import com.tencentcloudapi.trtc.v20190722.models.*;
import com.tencentyun.TLSSigAPIv2;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -42,18 +39,14 @@ import tk.mybatis.mapper.entity.Example;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.file.FileUploadUtils.*;
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
/**
* @author wangqiong
@@ -373,18 +366,27 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
* @return
*/
@Override
public AjaxResult secretaryRoleByUserId(Long userId) {
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
public AjaxResult secretaryRoleByUserId(Long userId, Long caseId) {
// 根据案件id查询案件
MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(caseId);
if(caseApplication==null){
return AjaxResult.error("案件不存在");
}
JSONObject jsonObject = new JSONObject();
boolean isSecretaryRole=false;
if(CollectionUtil.isNotEmpty(roles)){
for (SysRole role : roles) {
if("调解员".equals(role.getRoleName())){
isSecretaryRole=true;
break;
if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){
// 是调解员
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
if(CollectionUtil.isNotEmpty(roles)){
for (SysRole role : roles) {
if("调解员".equals(role.getRoleName())){
isSecretaryRole=true;
break;
}
}
}
}
jsonObject.put("isSecretaryRole",isSecretaryRole);
return success(jsonObject);
}
@@ -424,21 +426,6 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
}
}
public static void main(String[] args) throws Exception{
String htmlContent = "<h1>wangwu</h1><p>喂喂喂</p><h1>zhangsan</h1><p>hello</p><h1>zhangsan</h1><p>我能听到你说话</p><h1>wangwu</h1><p>欧克</p><h1>wangwu</h1><p>关于XXX我有几点想说的,balalalalalal</p><h1>zhangsan</h1><p>看到回复的时刻双方都是华德福额外补充你下次u饿哦是那些二的河南省而很为难啊看的法国队哈哈哈哈哈哈哈哈哈</p> "; // HTML字符串
String outputFileName="D://output.docx";
XWPFDocument document = new XWPFDocument();
XWPFParagraph paragraph = document.createParagraph();
XWPFRun run = paragraph.createRun();
run.setText(htmlContent);
FileOutputStream out = new FileOutputStream(new File(outputFileName));
document.write(out);
out.close();
System.out.printf("生成调解笔录成功");
}
/**
* 将视频下载到本地