This commit is contained in:
hejinbo
2023-11-01 18:05:01 +08:00
8 changed files with 173 additions and 91 deletions
@@ -211,13 +211,16 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override
public int insertDept(SysDept dept)
{
SysDept info = deptMapper.selectDeptById(dept.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
{
throw new ServiceException("部门停用,不允许新增");
Long parentId = dept.getParentId();
if(parentId!=null){
SysDept info = deptMapper.selectDeptById(dept.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
{
throw new ServiceException("部门停用,不允许新增");
}
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
}
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
return deptMapper.insertDept(dept);
}
@@ -29,6 +29,18 @@ public class CaseApplication extends BaseEntity {
private Date registerDate;
/** 仲裁方式 */
private Integer arbitratMethod;
/**
* 是否导入,0手动录入,1导入,默认0
*/
private Integer importFlag;
public Integer getImportFlag() {
return importFlag;
}
public void setImportFlag(Integer importFlag) {
this.importFlag = importFlag;
}
public String getSelectCaseStatus() {
return selectCaseStatus;
@@ -91,6 +103,13 @@ public class CaseApplication extends BaseEntity {
/** 申请人主张违约金 */
@Excel(name = "申请人主张违约金")
private BigDecimal claimLiquidDamag;
/** 申请人请求仲裁庭裁决 */
@Excel(name = "申请人请求仲裁庭裁决",width = 36)
private String requestRule;
/** 是否财产保全申请 */
@Excel(name = "是否财产保全申请",width = 26,combo= {"是","否"},readConverterExp = "0=否,1=是")
private Integer properPreser;
/** 申请人仲裁请求及事实和理由 */
@Excel(name = "申请人仲裁请求及事实和理由",width = 36)
private String arbitratClaims;
@@ -132,13 +151,10 @@ public class CaseApplication extends BaseEntity {
/** 是否需要开庭审理 */
private Integer openCourtHear;
/** 申请人请求仲裁庭裁决 */
@Excel(name = "申请人请求仲裁庭裁决",width = 36)
private String requestRule;
/** 是否仲裁反请求 */
private Integer adjudicaCounter;
/** 是否财产保全申请 */
private Integer properPreser;
/** 被申请人是否缺席 */
private Integer isAbsence;
/** 是否管辖异议申请 */
@@ -582,14 +598,19 @@ public class CaseApplication extends BaseEntity {
/** 姓名 */
@Excel(name = "申请人主体信息-申请人(机构)",width = 26)
private String name;
/** 身份证号 */
@Excel(name = "申请人主体信息-代码",width = 26)
private String identityNum;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人",width = 26)
private String compLegalPerson;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人职位",width = 26)
private String compLegalperPost;
/**
* 申请人主体信息-申请人(机构)id
*/
private String nameId;
/** 身份证号 */
@Excel(name = "申请人主体信息-代码",width = 26)
private String identityNum;
/** 联系电话 */
@Excel(name = "申请人主体信息-联系电话",width = 26)
@@ -603,12 +624,7 @@ public class CaseApplication extends BaseEntity {
/** 单位地址 */
@Excel(name = "申请人主体信息-单位地址",width = 26)
private String workAddress;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人",width = 26)
private String compLegalPerson;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人职位",width = 26)
private String compLegalperPost;
/** 申请人住所 */
@Excel(name = "申请人主体信息-住所",width = 26)
private String residenAffiliAppli;
@@ -664,7 +680,7 @@ public class CaseApplication extends BaseEntity {
@Excel(name = "被申请人主体信息-身份证号",width = 26)
private String debtorIdentityNum;
/** 被申请人主体信息-性别 */
@Excel(name = "被申请人主体信息-性别",width = 26)
@Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,女=1")
private String responSex;
public Date getResponBirth() {
@@ -44,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
@@ -905,8 +906,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
public int editCaseApplication(CaseApplication caseApplication) {
//根据仲裁费用计费规则计算应缴费用
//暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal feeRate = new BigDecimal("0.01");
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
caseApplication.setFeePayable(feePayable);
caseApplication.setUpdateBy(getUsername());
@@ -969,6 +970,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return rows;
}
/**
* 组装申请代理人信息
* @param caseAffiliate
@@ -1176,34 +1178,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
CaseApplication caseApplication = caseApplicationList.get(i);
// 导入校验
importValid(caseApplication);
importValid(caseApplication,deptMap);
// 校验成功的数据
if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
//根据仲裁费用计费规则计算应缴费用
//暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal feeRate = new BigDecimal("0.01");
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
caseApplication.setFeePayable(feePayable);
//赋值CaseApplication的案件关联人信息
List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
// 组装案件关联人信息
assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap,roleId);
// int caseApplicationCount = selectCaseApplicationCount(caseApplication);
// if(caseApplicationCount>0){
// failureNum++;
// failureMsg.append("<br/>" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在");
// }else {
// caseApplicationListinsert.add(caseApplication);
// }
if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
caseApplicationListinsert.add(caseApplication);
}else {
// 拼接错误信息
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
}
caseApplication.setImportFlag(1);
caseApplicationListinsert.add(caseApplication);
}else {
// 拼接错误信息
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
@@ -1283,7 +1272,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
* @param caseApplication
* @param
*/
private void importValid(CaseApplication caseApplication) {
private void importValid(CaseApplication caseApplication,Map<String, Long> deptMap) {
StringBuilder failureMsg=new StringBuilder();
caseApplication.setErrorMsg(failureMsg);
// 校验基本字段
@@ -1291,7 +1280,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 校验申请人信息
validApplicationColumn(caseApplication,failureMsg);
// 校验申请人代理信息
validApplicationAgentColumn(caseApplication,failureMsg);
validApplicationAgentColumn(caseApplication,failureMsg,deptMap);
// 校验被申请人信息
validDebtorApplicationColumn(caseApplication,failureMsg);
// 校验被申请人代理信息
@@ -1382,7 +1371,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
* @param caseApplication
* @param failureMsg
*/
private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg,Map<String, Long> deptMap) {
if( StrUtil.isEmpty(caseApplication.getNameAgent())){
failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;");
}else if(caseApplication.getNameAgent().length()>50){
@@ -1393,6 +1382,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}else if(caseApplication.getIdentityNumAgent().length()>50){
failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
}
validAgentInfo(caseApplication,failureMsg,deptMap);
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
if( StrUtil.isEmpty(contactTelphoneAgent)){
failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;");
@@ -1405,7 +1395,34 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
}
}
/**
* 校验代理人与组织机构关系
* @param caseApplication
* @param failureMsg
* @return
*/
private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg,Map<String, Long> deptMap) {
// 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下)
if (StrUtil.isNotEmpty(caseApplication.getName())&&StrUtil.isNotEmpty(caseApplication.getNameAgent())) {
String applicationOrganId="";
// 申请机构已经存在
if(deptMap.containsKey(caseApplication.getName())){
applicationOrganId=String.valueOf(deptMap.get(caseApplication.getName()));
}
// 根据代理人身份证去用户表查询
SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent());
// 代理人的部门和申请机构不匹配
if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) {
// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确";
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
failureMsg.append("该申请代理人已在【").append(agentUser.getDept().getDeptName()).append("】申请机构下存在,请检查填写信息是否正确");
} else {
failureMsg.append( "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
}
}
}
}
/**
* 校验申请人主题信息
* @param caseApplication
@@ -1806,33 +1823,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
*/
@Override
public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) {
CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2);
if(null==caseAffiliate){
return "被申请人不存在";
CaseAffiliate caseAffiliateSelect=new CaseAffiliate();
caseAffiliateSelect.setCaseAppliId(messageVO.getId());
List<CaseAffiliate> caseAffiliates= caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect);
if(CollectionUtil.isEmpty(caseAffiliates)){
return "申请人、被申请人不存在";
}
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(messageVO.getId());
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
String returnResult="短信发送成功";
//发送短信通知
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1952136");
// 1948332 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
request.setPhone(caseAffiliate.getContactTelphone());
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
if (SmsUtils.sendSms(request)){
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(messageVO.getId());
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content="尊敬的"+caseAffiliate.getName()+"用户,您的"+ caseApplicationselect.getCaseNum()+"仲裁案件,开庭审理房间号为"+ messageVO.getRoomNo()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
for (CaseAffiliate caseAffiliate : caseAffiliates) {
request.setPhone(caseAffiliate.getContactTelphone());
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
// 1948332 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
if (SmsUtils.sendSms(request)){
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(messageVO.getId());
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content="尊敬的"+caseAffiliate.getName()+"用户,您的"+ caseApplicationselect.getCaseNum()+"仲裁案件,开庭审理房间号为"+ messageVO.getRoomNo()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
smsSendRecord.setSendContent(content);
String userName;
try {
userName= getUsername();
} catch (Exception e) {
userName="admin";
}
smsSendRecord.setCreateBy(userName);
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}else {
returnResult= "短信发送失败";
}
}
return "短信发送成功";
return returnResult;
}
@Override
@@ -2074,6 +2105,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseApplication.setFilearbitraUrl(filearbitraUrl);
}
}
return caseApplication;
}
@@ -2083,8 +2115,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Transactional
public int pendTralSure(CaseApplication caseApplication) {
// caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
caseApplication.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
Integer isAgreePendTral = caseApplication.getIsAgreePendTral();
int rows = 0;
//同意组庭
if(isAgreePendTral!=null&&isAgreePendTral==1){
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}else {
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
// 仲裁员信息
if(arbitrators!=null&&arbitrators.size()>0){
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplication.setArbitratorId(idstr);
caseApplication.setArbitratorName(arbitratorNamestr);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
}
//发送短信通知
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
@@ -36,6 +36,10 @@ public class CaseLogUtils
operLog.setCreateBy(sysUser.getUserName());
operLog.setCreateNickName(sysUser.getNickName());
operLog.setUpdateBy(sysUser.getUserName());
}else {
operLog.setCreateBy("admin");
operLog.setCreateNickName("管理员");
operLog.setUpdateBy("admin");
}
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
@@ -77,16 +77,17 @@ public class FixSelectFlowDetailUtils {
caseApplication.setId(sealSignRecord.getCaseAppliId());
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION){
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
caseApplicationMapper.submitCaseApplication(caseApplication);
if(caseApplicationselect!=null){
if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION)){
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
caseApplicationMapper.submitCaseApplication(caseApplication);
//修改"签署用印记录表"的状态为待用印
sealSignRecord.setSignFlowStatus(2);
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
//修改"签署用印记录表"的状态为待用印
sealSignRecord.setSignFlowStatus(2);
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
}
}
}
if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
//更新立案申请状态为待送达
@@ -94,27 +95,30 @@ public class FixSelectFlowDetailUtils {
caseApplication.setId(sealSignRecord.getCaseAppliId());
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
//下载审核完成的裁决书,
String signFlowId = sealSignRecord.getSignFlowid();
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if(filesArray!=null&&filesArray.size()>0){
JsonObject fileObject = (JsonObject)filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
//修改"签署用印记录表"的状态为签署完成
sealSignRecord.setSignFlowStatus(3);
sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1));
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
caseApplication.setFilearbitraUrl(filearbitraUrl);
caseApplicationMapper.submitCaseApplication(caseApplication);
if(caseApplicationselect!=null){
if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL)){
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
//下载审核完成的裁决书,
String signFlowId = sealSignRecord.getSignFlowid();
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if(filesArray!=null&&filesArray.size()>0){
JsonObject fileObject = (JsonObject)filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
//修改"签署用印记录表"的状态为签署完成
sealSignRecord.setSignFlowStatus(3);
sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1));
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
caseApplication.setFilearbitraUrl(filearbitraUrl);
caseApplicationMapper.submitCaseApplication(caseApplication);
}
}
}
}
}