Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #58.
This commit is contained in:
+3
@@ -108,6 +108,9 @@ public class CaseApplicationController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('caseManagement:list:import')")
|
@PreAuthorize("@ss.hasPermi('caseManagement:list:import')")
|
||||||
@PostMapping("/importData")
|
@PostMapping("/importData")
|
||||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||||
|
if(file==null){
|
||||||
|
return warn("请上传文件");
|
||||||
|
}
|
||||||
ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
|
ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
|
||||||
List<CaseApplication> caseApplicationList = util.importExcel(file.getInputStream());
|
List<CaseApplication> caseApplicationList = util.importExcel(file.getInputStream());
|
||||||
String operName = getUsername();
|
String operName = getUsername();
|
||||||
|
|||||||
@@ -114,6 +114,16 @@ public class CaseApplication extends BaseEntity {
|
|||||||
private Integer paymentStatus;
|
private Integer paymentStatus;
|
||||||
/** 支付状态描述 */
|
/** 支付状态描述 */
|
||||||
private String paymentStatusName;
|
private String paymentStatusName;
|
||||||
|
// 导入校验失败信息
|
||||||
|
private StringBuilder errorMsg;
|
||||||
|
|
||||||
|
public StringBuilder getErrorMsg() {
|
||||||
|
return errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorMsg(StringBuilder errorMsg) {
|
||||||
|
this.errorMsg = errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getPaymentStatus() {
|
public Integer getPaymentStatus() {
|
||||||
return paymentStatus;
|
return paymentStatus;
|
||||||
|
|||||||
+247
-18
@@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||||
@@ -46,7 +47,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
private CaseAttachMapper caseAttachMapper;
|
private CaseAttachMapper caseAttachMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDeptMapper sysDeptMapper;
|
private SysDeptMapper sysDeptMapper;
|
||||||
|
// 手机号正则
|
||||||
|
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}$");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -305,16 +307,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
|
List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
|
||||||
for (int i = 0; i < caseApplicationList.size(); i++){
|
for (int i = 0; i < caseApplicationList.size(); i++){
|
||||||
CaseApplication caseApplication = caseApplicationList.get(i);
|
CaseApplication caseApplication = caseApplicationList.get(i);
|
||||||
//根据仲裁费用计费规则计算应缴费用
|
|
||||||
//暂时设置计费比率为0.01
|
|
||||||
BigDecimal feeRate = new BigDecimal(0.01);
|
|
||||||
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
||||||
caseApplication.setFeePayable(feePayable);
|
|
||||||
|
|
||||||
//赋值CaseApplication的案件关联人信息
|
// 导入校验
|
||||||
List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
|
importValid(caseApplication);
|
||||||
// 组装案件关联人信息
|
// 校验成功的数据
|
||||||
assignmentCaseAffiliates(caseApplication,caseAffiliatesnew,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);
|
||||||
|
caseApplication.setFeePayable(feePayable);
|
||||||
|
|
||||||
|
//赋值CaseApplication的案件关联人信息
|
||||||
|
List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
|
||||||
|
// 组装案件关联人信息
|
||||||
|
assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap);
|
||||||
|
|
||||||
// int caseApplicationCount = selectCaseApplicationCount(caseApplication);
|
// int caseApplicationCount = selectCaseApplicationCount(caseApplication);
|
||||||
// if(caseApplicationCount>0){
|
// if(caseApplicationCount>0){
|
||||||
@@ -323,9 +330,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
// }else {
|
// }else {
|
||||||
// caseApplicationListinsert.add(caseApplication);
|
// caseApplicationListinsert.add(caseApplication);
|
||||||
// }
|
// }
|
||||||
caseApplicationListinsert.add(caseApplication);
|
caseApplicationListinsert.add(caseApplication);
|
||||||
|
}else {
|
||||||
|
// 拼接错误信息
|
||||||
|
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
|
if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
|
||||||
// List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
|
// List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
|
||||||
// collectingAndThen(
|
// collectingAndThen(
|
||||||
@@ -384,15 +394,235 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}else {
|
}else {
|
||||||
throw new ServiceException("导入立案申请数据不能为空!");
|
throw new ServiceException("导入立案申请数据不能为空!");
|
||||||
}
|
}
|
||||||
// 编号存在不导入
|
return successMsg.append(failureMsg.toString()).toString();
|
||||||
if(StringUtils.isNotEmpty(failureMsg)){
|
|
||||||
return failureMsg.append(successMsg).toString();
|
|
||||||
}else {
|
|
||||||
|
|
||||||
return successMsg.toString();
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入校验
|
||||||
|
* @param caseApplication
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
private void importValid(CaseApplication caseApplication) {
|
||||||
|
StringBuilder failureMsg=new StringBuilder();
|
||||||
|
caseApplication.setErrorMsg(failureMsg);
|
||||||
|
// 校验基本字段
|
||||||
|
validBaseColumn(caseApplication,failureMsg);
|
||||||
|
// 校验申请人信息
|
||||||
|
validApplicationColumn(caseApplication,failureMsg);
|
||||||
|
// 校验申请人代理信息
|
||||||
|
validApplicationAgentColumn(caseApplication,failureMsg);
|
||||||
|
// 校验被申请人信息
|
||||||
|
validDebtorApplicationColumn(caseApplication,failureMsg);
|
||||||
|
// 校验被申请人代理信息
|
||||||
|
validDebtorApplicationAgentColumn(caseApplication,failureMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验被申请人代理信息
|
||||||
|
* @param caseApplication
|
||||||
|
* @param failureMsg
|
||||||
|
*/
|
||||||
|
private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorNameAgent())){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorNameAgent().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorIdentityNumAgent().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
|
||||||
|
if( StrUtil.isEmpty(debtorContactTelphoneAgent)){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorContactAddressAgent().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验被申请人信息
|
||||||
|
* @param caseApplication
|
||||||
|
* @param failureMsg
|
||||||
|
*/
|
||||||
|
private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorName())){
|
||||||
|
failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorName().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())){
|
||||||
|
failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorIdentityNum().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
|
||||||
|
if( StrUtil.isEmpty(debtorContactTelphone)){
|
||||||
|
failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()){
|
||||||
|
failureMsg.append("【被申请人主体信息-联系电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorContactAddress())){
|
||||||
|
failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorContactAddress().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone();
|
||||||
|
if( StrUtil.isEmpty(debtorWorkTelphone)){
|
||||||
|
failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()){
|
||||||
|
failureMsg.append("【被申请人主体信息-单位电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())){
|
||||||
|
failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getDebtorWorkAddress().length()>50){
|
||||||
|
failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验申请人代理信息
|
||||||
|
* @param caseApplication
|
||||||
|
* @param failureMsg
|
||||||
|
*/
|
||||||
|
private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getNameAgent())){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;");
|
||||||
|
}else if(caseApplication.getNameAgent().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getIdentityNumAgent())){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
|
||||||
|
}else if(caseApplication.getIdentityNumAgent().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
|
||||||
|
if( StrUtil.isEmpty(contactTelphoneAgent)){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getContactAddressAgent())){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getContactAddressAgent().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验申请人主题信息
|
||||||
|
* @param caseApplication
|
||||||
|
* @param failureMsg
|
||||||
|
*/
|
||||||
|
private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getName())){
|
||||||
|
failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;");
|
||||||
|
}else if(caseApplication.getName().length()>20){
|
||||||
|
failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isNotEmpty(caseApplication.getIdentityNum())&&caseApplication.getIdentityNum().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String contactTelphone = caseApplication.getContactTelphone();
|
||||||
|
if( StrUtil.isEmpty(contactTelphone)){
|
||||||
|
failureMsg.append("【申请人主体信息-联系电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(contactTelphone).matches()){
|
||||||
|
failureMsg.append("【申请人主体信息-联系电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getContactAddress())){
|
||||||
|
failureMsg.append("【申请人主体信息-联系地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getName().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
String workTelphone = caseApplication.getWorkTelphone();
|
||||||
|
if( StrUtil.isEmpty(workTelphone)){
|
||||||
|
failureMsg.append("【申请人主体信息-单位电话】字段不能为空;");
|
||||||
|
}else if(!TELEPHONE_REGX.matcher(workTelphone).matches()){
|
||||||
|
failureMsg.append("【申请人主体信息-单位电话】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getWorkAddress())){
|
||||||
|
failureMsg.append("【申请人主体信息-单位地址】字段不能为空;");
|
||||||
|
}else if(caseApplication.getWorkAddress().length()>50){
|
||||||
|
failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验基本字段
|
||||||
|
* @param caseApplication
|
||||||
|
* @param failureMsg
|
||||||
|
*/
|
||||||
|
private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
||||||
|
BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount();
|
||||||
|
if(null== caseSubjectAmount){
|
||||||
|
failureMsg.append("【案件标的】字段不合法;");
|
||||||
|
}else {
|
||||||
|
if(caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 ||caseSubjectAmount.compareTo(new BigDecimal("99999999.99"))>0){
|
||||||
|
failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);");
|
||||||
|
}
|
||||||
|
if(caseSubjectAmount.scale()>2){
|
||||||
|
failureMsg.append("【案件标的】字段超出指定精度(10^-2);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( caseApplication.getLoanStartDate()== null){
|
||||||
|
failureMsg.append("【借款开始日期】字段不合法;");
|
||||||
|
}
|
||||||
|
if( caseApplication.getLoanEndDate()== null){
|
||||||
|
failureMsg.append("【借款结束日期】字段不合法;");
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getContractNumber())){
|
||||||
|
failureMsg.append("【合同编号】字段不能为空;");
|
||||||
|
}else if(caseApplication.getContractNumber().length()>50){
|
||||||
|
failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;");
|
||||||
|
}
|
||||||
|
BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed();
|
||||||
|
if(null== claimPrinciOwed){
|
||||||
|
failureMsg.append("【申请人主张欠本金】字段不合法;");
|
||||||
|
}else {
|
||||||
|
if(claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 ||claimPrinciOwed.compareTo(new BigDecimal("99999999.99"))>0){
|
||||||
|
failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);");
|
||||||
|
}
|
||||||
|
if(claimPrinciOwed.scale()>2){
|
||||||
|
failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed();
|
||||||
|
if(null== claimInterestOwed){
|
||||||
|
failureMsg.append("【申请人主张欠利息】字段不合法;");
|
||||||
|
}else {
|
||||||
|
if(claimInterestOwed.compareTo(new BigDecimal("0")) < 0 ||claimInterestOwed.compareTo(new BigDecimal("99999999.99"))>0){
|
||||||
|
failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);");
|
||||||
|
}
|
||||||
|
if(claimInterestOwed.scale()>2){
|
||||||
|
failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag();
|
||||||
|
if(null== claimLiquidDamag){
|
||||||
|
failureMsg.append("【申请人主张违约金】字段不合法;");
|
||||||
|
}else {
|
||||||
|
if(claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 ||claimLiquidDamag.compareTo(new BigDecimal("99999999.99"))>0){
|
||||||
|
failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);");
|
||||||
|
}
|
||||||
|
if(claimLiquidDamag.scale()>2){
|
||||||
|
failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( StrUtil.isEmpty(caseApplication.getArbitratClaims())){
|
||||||
|
failureMsg.append("【申请人仲裁诉求】字段不能为空;");
|
||||||
|
}else if(caseApplication.getArbitratClaims().length()>10000){
|
||||||
|
failureMsg.append("【申请人仲裁诉求】字段超出指定长度,最大长度为10000;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int pendTral(CaseApplication caseApplication) {
|
public int pendTral(CaseApplication caseApplication) {
|
||||||
@@ -751,5 +981,4 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable());
|
caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user