Commit 960f3d91 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.1' into MVP1.5.1

parents 3abee3c4 984efd32
...@@ -97,7 +97,7 @@ public class ChecksUtil { ...@@ -97,7 +97,7 @@ public class ChecksUtil {
} }
} }
private static R<TCheckBankNo> checkBankNoTwoMethod(String name, String cardNo) { public static R<TCheckBankNo> checkBankNoTwoMethod(String name, String cardNo) {
final JsonObject jsonObject = ChecksUtil.invokeBankNoTwoAuth(name,cardNo); final JsonObject jsonObject = ChecksUtil.invokeBankNoTwoAuth(name,cardNo);
TCheckBankNo checkBankNo = new TCheckBankNo(); TCheckBankNo checkBankNo = new TCheckBankNo();
// 2.处理返回结果 // 2.处理返回结果
......
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.check.service.impl; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.check.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.constant.ChecksConstants;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.mapper.TCheckBankNoMapper; import com.yifu.cloud.plus.v1.check.mapper.TCheckBankNoMapper;
import com.yifu.cloud.plus.v1.check.service.TCanCheckService; import com.yifu.cloud.plus.v1.check.service.TCanCheckService;
...@@ -30,13 +31,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; ...@@ -30,13 +31,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List; import static java.lang.Thread.sleep;
import java.util.Map;
/** /**
* 银行卡卡号 校验 * 银行卡卡号 校验
...@@ -137,20 +139,47 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh ...@@ -137,20 +139,47 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
List<TCheckBankNo> saveList = new ArrayList<>(); List<TCheckBankNo> saveList = new ArrayList<>();
if (!noCurlist.isEmpty()) { if (!noCurlist.isEmpty()) {
synchronized (this) { synchronized (this) {
TCheckBankNo newNo;
R<TCheckBankNo> resR;
boolean canCheck = canCheckService.getCanCheck(); boolean canCheck = canCheckService.getCanCheck();
for (TCheckBankNo no : noCurlist) { if (noCurlist.size()>=50) {
resR = ChecksUtil.checkBankNoTwo(no.getName(), no.getBankNo(), canCheck); int l = 4;
if (Common.isNotNull(resR) && resR.getCode() == CommonConstants.SUCCESS for (int k=0;k<l;k++) {
&& Common.isNotNull(resR.getData())) { if ((k+1)==l) {
newNo = resR.getData(); final List<TCheckBankNo> finalList = noCurlist.subList(k * (noCurlist.size() / l), noCurlist.size());
bankMap.put(no.getBankNo(), CommonConstants.ZERO_ONE.equals(newNo.getResult())); if (canCheck) {
saveList.add(newNo); doThread(bankMap, saveList, finalList);
} else {
doNomal(bankMap, saveList, finalList);
}
} else {
final List<TCheckBankNo> finalList = noCurlist.subList(k * (noCurlist.size() / l), (k + 1) * (noCurlist.size() / l));
if (canCheck) {
doThread(bankMap, saveList, finalList);
} else {
doNomal(bankMap, saveList, finalList);
}
}
}
} else {
if (canCheck) {
doThread(bankMap, saveList, noCurlist);
} else { } else {
bankMap.put(no.getBankNo(), false); doNomal(bankMap, saveList, noCurlist);
} }
} }
while (Thread.activeCount() > 4) {
Thread.yield();
}
//fo (TCheckBankNo no : noCurlist)
// 原代码
/*resR = ChecksUtil.checkBankNoTwo(no.getName(), no.getBankNo(), canCheck)
f (Common.isNotNull(resR) && resR.getCode() == CommonConstants.SUCCESS
&& Common.isNotNull(resR.getData()))
newNo = resR.getData()
bankMap.put(no.getBankNo(), CommonConstants.ZERO_ONE.equals(newNo.getResult()))
saveList.add(newNo)
else
bankMap.put(no.getBankNo(), false)
*/
if (!saveList.isEmpty()) { if (!saveList.isEmpty()) {
this.saveBatch(saveList); this.saveBatch(saveList);
} }
...@@ -160,4 +189,82 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh ...@@ -160,4 +189,82 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
return vo; return vo;
} }
private void doThread(Map<String, Boolean> bankMap, List<TCheckBankNo> saveList, List<TCheckBankNo> finalList) {
new Thread(() -> {
for (int i = 0; i< finalList.size(); i++) {
final TCheckBankNo no = finalList.get(i);
setBankMap(bankMap, no, saveList);
}
}).start();
}
private void doNomal(Map<String, Boolean> bankMap, List<TCheckBankNo> saveList, List<TCheckBankNo> finalList) {
TCheckBankNo no;
for (int i = 0; i< finalList.size(); i++) {
no = finalList.get(i);
final TCheckBankNo newNo = new TCheckBankNo();
newNo.setBankNo(no.getBankNo());
newNo.setName(no.getName());
newNo.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
newNo.setResult("01");
newNo.setType(CommonConstants.ONE_STRING);
newNo.setRemark(ChecksConstants.CHECK_CONFIG_ACCESS);
saveList.add(newNo);
bankMap.put(no.getBankNo(), true);
}
}
public void setBankMap(Map<String, Boolean> bankMap, TCheckBankNo no, List<TCheckBankNo> saveList) {
// 1.调用银行卡信息校验api
R<TCheckBankNo> resR = ChecksUtil.checkBankNoTwoMethod(no.getName(), no.getBankNo());
if (Common.isNotNull(resR) && resR.getCode() == CommonConstants.SUCCESS
&& Common.isNotNull(resR.getData())) {
TCheckBankNo newNo = resR.getData();
bankMap.put(no.getBankNo(), CommonConstants.ZERO_ONE.equals(newNo.getResult()));
saveList.add(newNo);
} else {
bankMap.put(no.getBankNo(), false);
}
}
/*public static void mai(String[] args) {
Map<Integer, Boolean> bankMap = new HashMap<>();
int j=100;
List<Integer> aList = new ArrayList<>();
for (int k=0;k<229;k++) {
aList.add(k);
}
if (j>=100) {
int l = 4;
for (int k=0;k<l;k++) {
if ((k+1)==l) {
final List<Integer> finalList = aList.subList(k * (aList.size() / l), aList.size());
new Thread(() -> {
for (int i=0;i<finalList.size();i++) {
final Integer finalI = finalList.get(i);
setBankMapByi(bankMap, finalI);
}
}).start();
} else {
final List<Integer> finalList = aList.subList(k * (aList.size() / l), (k + 1) * (aList.size() / l));
new Thread(() -> {
for (int i=0;i<finalList.size();i++) {
final Integer finalI = finalList.get(i);
setBankMapByi(bankMap, finalI);
}
}).start();
}
}
} else {
for (int i=0;i<aList.size();i++) {
setBankMapByi(bankMap, aList.get(i));
}
}
while (Thread.activeCount() > 4) {
Thread.yield();
}
}*/
} }
...@@ -3589,6 +3589,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3589,6 +3589,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY); param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
continue; continue;
} }
} else if (BigDecimal.ZERO.compareTo(detail.getActualPremium()) == 0
&& Common.isEmpty(param.getActualPremium())) {
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
continue;
} }
//批增类型,保单号存在 //批增类型,保单号存在
...@@ -3762,9 +3766,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3762,9 +3766,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.HANDLE_PROVINCE_IS_NULL); param.setErrorMessage(InsurancesConstants.HANDLE_PROVINCE_IS_NULL);
continue; continue;
} }
String c = detail.getInsuranceHandleCity().toString();
//商险办理地权限校验 //商险办理地权限校验
boolean b = insuranceAreaResList.stream().anyMatch(s -> detail.getInsuranceHandleCity().equals(s.getCity()) && detail.getInsuranceHandleProvince().equals(s.getProvince())); if(insuranceAreaResList.stream().noneMatch(s -> c.equals(s.getCity()))){
if(!b){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION); param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
continue; continue;
} }
......
...@@ -931,6 +931,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -931,6 +931,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray; String[] areaArray;
String exitMoney; String exitMoney;
String errorInfo;
for (TPaymentInfoVo infoVo : list) { for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) { if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X")); infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
...@@ -1303,12 +1304,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1303,12 +1304,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialHousehold(tSocialInfo.getSocialHouseholdName()); paymentInfo.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
} }
// 项目信息校验 // 项目信息校验
String erroeInfo = settleInfoCheck(paymentInfo); errorInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(erroeInfo)){ if (!Common.isEmpty(errorInfo)){
errorMessageMap.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(), errorMessageMap.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(),
paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI
+ erroeInfo + SocialConstants.ERROR_END)); + errorInfo + SocialConstants.ERROR_END));
continue; continue;
} }
if (Common.isNotNull(tSocialInfo)) { if (Common.isNotNull(tSocialInfo)) {
...@@ -1662,6 +1663,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1662,6 +1663,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
String[] areaArray; String[] areaArray;
TSettleDomain domain; TSettleDomain domain;
String errorInfo;
for (TPaymentInfoVo infoVo : list) { for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) { if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X")); infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
...@@ -1784,7 +1786,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1784,7 +1786,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setUnitName(fund.getUnitNameFund()); paymentInfo.setUnitName(fund.getUnitNameFund());
paymentInfo.setFundProvince(fund.getFundProvince()); paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity()); paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown()); paymentInfo.setFundTown(Common.isNotNull(fund.getFundTown()) ? fund.getFundTown(): "");
paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName()); paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName());
} else if (Common.isNotNull(tProvidentFund)) { } else if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setEmpId(tProvidentFund.getEmpId()); paymentInfo.setEmpId(tProvidentFund.getEmpId());
...@@ -1810,21 +1812,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1810,21 +1812,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSettleDomainCode(tProvidentFund.getSettleDomainCode()); paymentInfo.setSettleDomainCode(tProvidentFund.getSettleDomainCode());
paymentInfo.setFundProvince(tProvidentFund.getFundProvince()); paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
paymentInfo.setFundCity(tProvidentFund.getFundCity()); paymentInfo.setFundCity(tProvidentFund.getFundCity());
paymentInfo.setFundTown(tProvidentFund.getFundTown()); paymentInfo.setFundTown(Common.isNotNull(tProvidentFund.getFundTown()) ? tProvidentFund.getFundTown(): "");
paymentInfo.setProvidentHousehold(tProvidentFund.getProvidentHouseholdName()); paymentInfo.setProvidentHousehold(tProvidentFund.getProvidentHouseholdName());
} }
// 项目信息校验 // 项目信息校验
String erroeInfo = settleInfoCheck(paymentInfo); errorInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(erroeInfo)){ if (!Common.isEmpty(errorInfo)){
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(),
paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(),
SocialConstants.ERROR_PRI + erroeInfo + SocialConstants.ERROR_END)); SocialConstants.ERROR_PRI + errorInfo + SocialConstants.ERROR_END));
continue; continue;
} }
if (Common.isNotNull(tProvidentFund)) { if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setInauguralTeam(Common.isNotNull(tProvidentFund.getInauguralTeam()) ? tProvidentFund.getInauguralTeam(): ""); paymentInfo.setInauguralTeam(Common.isNotNull(tProvidentFund.getInauguralTeam()) ? tProvidentFund.getInauguralTeam(): "");
paymentInfo.setEmpNo(tProvidentFund.getEmpNo()); paymentInfo.setEmpNo(Common.isNotNull(tProvidentFund.getEmpNo()) ? tProvidentFund.getEmpNo(): "");
} else { } else {
paymentInfo.setInauguralTeam(""); paymentInfo.setInauguralTeam("");
paymentInfo.setEmpNo(""); paymentInfo.setEmpNo("");
...@@ -2179,7 +2181,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2179,7 +2181,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray; String[] areaArray;
String exitMoney; String exitMoney;
String errorInfo;
for (TPaymentHeFeiVo infoVo : list) { for (TPaymentHeFeiVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) { if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X")); infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
...@@ -2464,7 +2466,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2464,7 +2466,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setUnitName(Common.isNotNull(socialInfo.getUnitName()) ? socialInfo.getUnitName(): ""); payExists.setUnitName(Common.isNotNull(socialInfo.getUnitName()) ? socialInfo.getUnitName(): "");
payExists.setSocialProvince(socialInfo.getSocialProvince()); payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity()); payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown()); payExists.setSocialTown(Common.isNotNull(socialInfo.getSocialTown()) ? socialInfo.getSocialTown(): "");
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName()); payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
} else if (Common.isNotNull(tSocialInfo)) { } else if (Common.isNotNull(tSocialInfo)) {
payExists.setEmpId(tSocialInfo.getEmpId()); payExists.setEmpId(tSocialInfo.getEmpId());
...@@ -2489,21 +2491,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2489,21 +2491,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setBpoFlag(domain.getBpoFlag()); payExists.setBpoFlag(domain.getBpoFlag());
payExists.setSocialProvince(tSocialInfo.getSocialProvince()); payExists.setSocialProvince(tSocialInfo.getSocialProvince());
payExists.setSocialCity(tSocialInfo.getSocialCity()); payExists.setSocialCity(tSocialInfo.getSocialCity());
payExists.setSocialTown(tSocialInfo.getSocialTown()); payExists.setSocialTown(Common.isNotNull(tSocialInfo.getSocialTown()) ? tSocialInfo.getSocialTown(): "");
payExists.setSocialHousehold(tSocialInfo.getSocialHouseholdName()); payExists.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
} }
// 项目信息校验 // 项目信息校验
String erroeInfo = settleInfoCheck(payExists); errorInfo = settleInfoCheck(payExists);
if (!Common.isEmpty(erroeInfo)){ if (!Common.isEmpty(errorInfo)){
errorMessageList.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(), errorMessageList.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(),
payExists.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI payExists.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI
+ erroeInfo + SocialConstants.ERROR_END)); + errorInfo + SocialConstants.ERROR_END));
continue; continue;
} }
if (Common.isNotNull(tSocialInfo)) { if (Common.isNotNull(tSocialInfo)) {
payExists.setInauguralTeam(Common.isNotNull(tSocialInfo.getInauguralTeam()) ? tSocialInfo.getInauguralTeam(): ""); payExists.setInauguralTeam(Common.isNotNull(tSocialInfo.getInauguralTeam()) ? tSocialInfo.getInauguralTeam(): "");
payExists.setEmpNo(tSocialInfo.getEmpNo()); payExists.setEmpNo(Common.isNotNull(tSocialInfo.getEmpNo()) ? tSocialInfo.getEmpNo(): "");
} else { } else {
payExists.setInauguralTeam(""); payExists.setInauguralTeam("");
payExists.setEmpNo(""); payExists.setEmpNo("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment