优化和解功能 #51

Merged
qtz merged 2 commits from qtz into dev 2024-01-29 07:08:26 +00:00
@@ -1239,6 +1239,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 查询案件相关人员
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
Integer isReconci = attach.getIsReconci();
if(attach.getAnnexId()!=null){
MsCaseAttach caseAttach = msCaseAttachMapper.queryAnnexById(attach.getAnnexId());
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
@@ -1697,7 +1698,67 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
}
/*DeptIdentify deptIdentify1 = new DeptIdentify();
if(isReconci.intValue()==1){
EsignHttpResponse response3 = SignAward.createByFileReconci(sealSignRecord);
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());
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);
} else {
throw new ServiceException(jsonObject3.getString("message"));
}
} else {
return AjaxResult.error();
}
}else {
/*DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setSealStatus(1); // 印章状态为启用
//根据机构名称查询部门id
SysDept sysDept = new SysDept();
@@ -1715,108 +1776,109 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
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());
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);
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);
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);
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);
//发送签名链接短信,尊敬的{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);
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);
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);
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);
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 {
throw new ServiceException(jsonObject3.getString("message"));
return AjaxResult.error();
}
} else {
return AjaxResult.error();
}
} else {
return AjaxResult.error();
}
} else {
return AjaxResult.error();
}
}else{
return AjaxResult.error();