Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #215.
This commit is contained in:
@@ -394,11 +394,23 @@ public class CaseApplication extends BaseEntity {
|
|||||||
* 部门长状态
|
* 部门长状态
|
||||||
*/
|
*/
|
||||||
private List<Integer> deptHeadStatus;
|
private List<Integer> deptHeadStatus;
|
||||||
|
/**
|
||||||
|
* 代理人角色有关部门
|
||||||
|
*/
|
||||||
|
private List<Long> agentDeptIds;
|
||||||
/**
|
/**
|
||||||
* 财务状态
|
* 财务状态
|
||||||
*/
|
*/
|
||||||
private Integer financeStatus;
|
private Integer financeStatus;
|
||||||
|
|
||||||
|
public List<Long> getAgentDeptIds() {
|
||||||
|
return agentDeptIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgentDeptIds(List<Long> agentDeptIds) {
|
||||||
|
this.agentDeptIds = agentDeptIds;
|
||||||
|
}
|
||||||
|
|
||||||
public String getLoginUserName() {
|
public String getLoginUserName() {
|
||||||
return loginUserName;
|
return loginUserName;
|
||||||
}
|
}
|
||||||
|
|||||||
+56
-18
@@ -33,13 +33,6 @@ import com.ruoyi.wisdomarbitrate.mapper.*;
|
|||||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||||
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||||
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
||||||
import com.tencentcloudapi.common.Credential;
|
|
||||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
||||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
|
||||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
|
||||||
import com.tencentcloudapi.trtc.v20190722.TrtcClient;
|
|
||||||
import com.tencentcloudapi.trtc.v20190722.models.DismissRoomByStrRoomIdRequest;
|
|
||||||
import com.tencentcloudapi.trtc.v20190722.models.DismissRoomByStrRoomIdResponse;
|
|
||||||
import com.tencentyun.TLSSigAPIv2;
|
import com.tencentyun.TLSSigAPIv2;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
@@ -53,8 +46,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
@@ -121,7 +112,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||||
// 邮箱正则
|
// 邮箱正则
|
||||||
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
|
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
|
||||||
|
// 身份证号码正则表达式
|
||||||
|
private static final String ID_REGEX = "^(\\d{14}|\\d{17})(\\d|[Xx])$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
* 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
||||||
@@ -182,14 +174,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseApplication.setDeptIds(deptIds);
|
caseApplication.setDeptIds(deptIds);
|
||||||
}
|
}
|
||||||
if (role.getRoleName().equals("申请人")) {
|
if (role.getRoleName().equals("申请人")) {
|
||||||
// 查询角色有关的用户部门
|
// 查询有关的用户部门
|
||||||
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
||||||
}
|
}
|
||||||
if (role.getRoleName().equals("被申请人")) {
|
if (role.getRoleName().equals("被申请人")) {
|
||||||
//
|
//
|
||||||
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
||||||
}
|
}
|
||||||
|
if (role.getRoleName().equals("代理人")) {
|
||||||
|
// 查询角色有关的用户部门
|
||||||
|
List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
||||||
|
caseApplication.setAgentDeptIds(agentDeptIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1337,6 +1333,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
validDebtorApplicationAgentColumn(caseApplication, failureMsg);
|
validDebtorApplicationAgentColumn(caseApplication, failureMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证身份证号码是否合法
|
||||||
|
* @param idCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean validateIdCard(String idCard) {
|
||||||
|
if (idCard == null || idCard.trim().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Pattern.matches(ID_REGEX, idCard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据身份证号码的长度,采取不同的校验位计算方式
|
||||||
|
if (idCard.length() == 15) {
|
||||||
|
// 旧版身份证校验位计算
|
||||||
|
int sum = 0;
|
||||||
|
int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8};
|
||||||
|
String idDigits = idCard.substring(0, 14);
|
||||||
|
for (int i = 0; i < idDigits.length(); i++) {
|
||||||
|
sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
|
||||||
|
}
|
||||||
|
int checkCode = 11 - (sum % 11);
|
||||||
|
if (checkCode == 10) {
|
||||||
|
checkCode = 0;
|
||||||
|
}
|
||||||
|
return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
|
||||||
|
} else if (idCard.length() == 18) {
|
||||||
|
// 新版身份证校验位计算
|
||||||
|
int sum = 0;
|
||||||
|
int[] weights = {6, 7, 8, 4, 5, 6, 3, 2, 1, 0, 9, 7, 3, 4, 5, 6, 2, 8};
|
||||||
|
String idDigits = idCard.substring(0, 17);
|
||||||
|
for (int i = 0; i < idDigits.length(); i++) {
|
||||||
|
sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
|
||||||
|
}
|
||||||
|
int checkCode = sum % 10;
|
||||||
|
return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 校验被申请人代理信息
|
* 校验被申请人代理信息
|
||||||
*
|
*
|
||||||
@@ -1351,8 +1389,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
|
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
|
||||||
failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
|
failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
|
||||||
} else if (caseApplication.getDebtorIdentityNumAgent().length() > 50) {
|
} else if (validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
|
||||||
failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
|
failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
|
||||||
}
|
}
|
||||||
String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
|
String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
|
||||||
if (StrUtil.isEmpty(debtorContactTelphoneAgent)) {
|
if (StrUtil.isEmpty(debtorContactTelphoneAgent)) {
|
||||||
@@ -1381,8 +1419,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
|
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
|
||||||
failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
|
failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
|
||||||
} else if (caseApplication.getDebtorIdentityNum().length() > 50) {
|
} else if (validateIdCard(caseApplication.getDebtorIdentityNum())) {
|
||||||
failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;");
|
failureMsg.append("【被申请人主体信息-身份证号】不合法;");
|
||||||
}
|
}
|
||||||
String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
|
String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
|
||||||
if (StrUtil.isEmpty(debtorContactTelphone)) {
|
if (StrUtil.isEmpty(debtorContactTelphone)) {
|
||||||
@@ -1438,8 +1476,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) {
|
if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) {
|
||||||
failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
|
failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
|
||||||
} else if (caseApplication.getIdentityNumAgent().length() > 50) {
|
} else if (!validateIdCard(caseApplication.getIdentityNumAgent())) {
|
||||||
failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
|
failureMsg.append("【申请人主体信息-代理人身份证号】不合法;");
|
||||||
}
|
}
|
||||||
validAgentInfo(caseApplication, failureMsg, deptMap);
|
validAgentInfo(caseApplication, failureMsg, deptMap);
|
||||||
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
|
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
|
||||||
|
|||||||
@@ -187,7 +187,16 @@
|
|||||||
|
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
|
<!--代理人-->
|
||||||
|
<if test="agentDeptIds != null and agentDeptIds.size()>0">
|
||||||
|
or (
|
||||||
|
t.application_organ_id in
|
||||||
|
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
|
||||||
|
</foreach>
|
||||||
|
AND t.identity_type=1
|
||||||
|
and t.case_status in (0,9))
|
||||||
|
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
) t1
|
) t1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user