Commit 00f44ebb authored by fangxinjiang's avatar fangxinjiang

Merge branch 'develop' into MVP1.5.2

# Conflicts:
#	yifu-check/yifu-check-api/src/main/java/com/yifu/cloud/plus/v1/check/utils/ChecksUtil.java
#	yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/impl/TCheckBankNoServiceImpl.java
parents cbd22ff2 28bfaa0c
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -14,6 +15,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
......@@ -53,7 +55,8 @@ public class TProveApply extends Model<TProveApply> {
*/
@ExcelAttribute(name = "申请日期", isNotEmpty = true, errorInfo = "申请日期不能为空")
@Schema(description = "申请日期", name = "creatDate")
private LocalDate creatDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creatDate;
/**
* 开始月
*/
......
......@@ -51,9 +51,9 @@ public class TProveRecord extends Model<TProveRecord> {
* @return
**/
@Schema(description = "员工姓名")
@ExcelAttribute(name = "姓名")
@ExcelAttribute(name = "员工姓名")
@NotBlank(message = "员工姓名不能为空")
@ExcelProperty("姓名")
@ExcelProperty("员工姓名")
private String employeeName;
/**
* 员工身份证号
......@@ -62,10 +62,10 @@ public class TProveRecord extends Model<TProveRecord> {
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "员工身份证号")
@NotBlank(message = "员工身份证号不能为空")
@ExcelAttribute(name = "身份证")
@ExcelProperty("身份证")
@Schema(description = "身份证号")
@NotBlank(message = "身份证号不能为空")
@ExcelAttribute(name = "身份证")
@ExcelProperty("身份证")
private String employeeIdCard;
/**
* 结算主体(部门)名称
......@@ -74,23 +74,23 @@ public class TProveRecord extends Model<TProveRecord> {
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "结算主体(部门)名称")
@NotBlank(message = "结算主体名称不能为空")
@ExcelAttribute(name = "结算主体")
@ExcelProperty("结算主体")
@Schema(description = "项目名称")
@NotBlank(message = "项目名称不能为空")
@ExcelAttribute(name = "项目名称")
@ExcelProperty("项目名称")
private String employeeSettleDepartName;
/**
*
*/
private String creatUser;
@Schema(description = "申请人名称")
@Schema(description = "开具人")
@ExcelAttribute(name = "开具人")
@ExcelProperty("开具人")
private String creatUserName;
/**
* 创建日期
*/
@Schema(description = "创建日期", name = "creatDate")
@Schema(description = "开具日期", name = "creatDate")
@ExcelAttribute(name = "开具日期")
@ExcelProperty("开具日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
......
......@@ -17,8 +17,8 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -58,7 +58,7 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
proveApply.setId(null);
//初始化数据填充
proveApply.setAuditStatus(CommonConstants.ZERO_STRING);//待审核
proveApply.setCreatDate(LocalDate.now());
proveApply.setCreatDate(new Date());
proveApply.setCreatUser(user.getId());
proveApply.setCreatUserName(user.getNickname());
//保存数据
......
......@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
......@@ -138,7 +139,7 @@ public class TCheckBankNoController {
@SysLog("批量银行卡号校验" )
@Inner
@PostMapping("/inner/checkBankNoBatch" )
public CheckBatchVo checkBankNoBatch(@RequestBody List<TCheckBankNo> list) {
public CheckBatchVo checkBankNoBatch(@RequestBody List<TCheckBankNo> list) throws ExecutionException, InterruptedException{
return tCheckBankNoService.checkBankNoBatch(list);
}
......
......@@ -173,5 +173,15 @@ public class TCheckMobileController {
public CheckBatchVo checkMobileBatch(@RequestBody List<String> list) {
return tCheckMobileService.checkMobileBatch(list);
}
/**
* @Author fxj
* @Description 批量手机号校验
* @Date 18:20 2023/3/1
**/
@Operation(description = "批量手机号校验")
@SysLog("批量手机号校验" )
@PostMapping("/checkMobileBatch" )
public CheckBatchVo checkMobileBatchs(@RequestBody List<String> list) {
return tCheckMobileService.checkMobileBatch(list);
}
}
......@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.io.InputStream;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
* 银行卡卡号 校验
......@@ -54,7 +55,7 @@ public interface TCheckBankNoService extends IService<TCheckBankNo> {
* @Date: 2023/2/9 11:19
* @return: com.yifu.cloud.plus.v1.check.vo.CheckBatchVo
**/
CheckBatchVo checkBankNoBatch(List<TCheckBankNo> list);
CheckBatchVo checkBankNoBatch(List<TCheckBankNo> list) throws ExecutionException, InterruptedException;
R<List<ErrorMessage>> importDiy(InputStream inputStream);
}
......@@ -23,6 +23,7 @@ import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.mapper.TCheckBankNoMapper;
import com.yifu.cloud.plus.v1.check.service.TCanCheckService;
......@@ -46,6 +47,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.concurrent.*;
/**
* 银行卡卡号 校验
......@@ -130,7 +132,7 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
}
@Override
public CheckBatchVo checkBankNoBatch(List<TCheckBankNo> list) {
public CheckBatchVo checkBankNoBatch(List<TCheckBankNo> list) throws ExecutionException, InterruptedException{
CheckBatchVo vo = new CheckBatchVo();
List<String> noList = new ArrayList<>();
for (TCheckBankNo no : list) {
......@@ -168,30 +170,119 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
}
List<TCheckBankNo> saveList = new ArrayList<>();
if (!noCurlist.isEmpty()) {
synchronized (this) {
TCheckBankNo newNo;
R<TCheckBankNo> resR;
boolean canCheck = canCheckService.getCanCheck();
for (TCheckBankNo no : noCurlist) {
resR = ChecksUtil.checkBankNoTwo(no.getName(), no.getBankNo(), canCheck);
if (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);
boolean canCheck = canCheckService.getCanCheck();
int taskSize = 4;
// 创建一个线程池
ExecutorService pool = Executors.newFixedThreadPool(taskSize);
List<Future> listF = new ArrayList<>();
if (noCurlist.size()>=4) {
int l = 4;
Callable c;
Future f;
for (int k=0;k<l;k++) {
if ((k+1)==l) {
List<TCheckBankNo> finalList = noCurlist.subList(k * (noCurlist.size() / l), noCurlist.size());
if (canCheck) {
c = new MyCallable(bankMap, finalList, saveList);
// 执行任务并获取Future对象
f = pool.submit(c);
listF.add(f);
} else {
doNomal(bankMap, saveList, finalList);
}
} else {
bankMap.put(no.getBankNo(), false);
List<TCheckBankNo> finalList = noCurlist.subList(k * (noCurlist.size() / l), (k + 1) * (noCurlist.size() / l));
if (canCheck) {
c = new MyCallable(bankMap, finalList, saveList);
// 执行任务并获取Future对象
f = pool.submit(c);
listF.add(f);
} else {
doNomal(bankMap, saveList, finalList);
}
}
}
if (!saveList.isEmpty()) {
this.saveBatch(saveList);
} else {
if (canCheck) {
Callable c = new MyCallable(bankMap, noCurlist, saveList);
// 执行任务并获取Future对象
Future f = pool.submit(c);
listF.add(f);
} else {
doNomal(bankMap, saveList, noCurlist);
}
}
if (canCheck) {
// 关闭线程池
pool.shutdown();
for (Future fs : listF) {
// 从Future对象上获取任务的返回值,并输出到控制台
fs.get();
}
}
//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()) {
this.saveOrUpdateBatch(saveList);
saveList.clear();
}
}
vo.setCheckMap(bankMap);
return vo;
}
private void doNomal(Map<String, Boolean> bankMap, List<TCheckBankNo> saveList, List<TCheckBankNo> finalList) {
TCheckBankNo newNo;
for (TCheckBankNo no : finalList) {
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);
}
}
static class MyCallable implements Callable<Object> {
private final List<TCheckBankNo> saveList;
private final List<TCheckBankNo> noList;
private final Map<String, Boolean> bankMap;
MyCallable(Map<String, Boolean> bankMap, List<TCheckBankNo> no, List<TCheckBankNo> saveList) {
this.noList = no;
this.bankMap = bankMap;
this.saveList = saveList;
}
public Map<String, Boolean> call() {
for (TCheckBankNo no : noList) {
// 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);
}
}
return bankMap;
}
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
......
......@@ -178,9 +178,35 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
}
}
List<String> noCurlist = new ArrayList<>();
Boolean cur;
Map<String, Boolean> backMap = new HashMap<>();
List<String> tempList = new ArrayList<>();
// 因手机号码最多50个所以这里 要特殊处理下
if (Common.isNotNull(list)){
//计数器
int count =1;
for (String phone:list){
tempList.add(phone);
if (count == 50){
checkMobiles(tempList, vo, noMap, noCurlist, backMap);
tempList.clear();
// 重置
count =1;
}else {
count ++;
}
}
}
checkMobiles(tempList, vo, noMap, noCurlist, backMap);
return vo;
}
private void checkMobiles(List<String> list,
CheckBatchVo vo,
Map<String, Boolean> noMap,
List<String> noCurlist,
Map<String, Boolean> backMap) {
StringBuilder phones = new StringBuilder();
Boolean cur;
for (String check : list) {
cur = noMap.get(check);
if (cur != null) {
......@@ -211,12 +237,11 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
}
}
if (!saveList.isEmpty()) {
this.saveBatch(saveList);
this.saveOrUpdateBatch(saveList);
}
saveList.clear();
}
}
vo.setCheckMap(backMap);
return vo;
}
}
......@@ -1940,7 +1940,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//如果当前保费为空,且保单号或发票号不一样
if ((StringUtils.isBlank(success.getActualPremium()) || (Common.isNotNull(detail.getActualPremium())
if ((Common.isEmpty(success.getActualPremium()) || (Common.isNotNull(detail.getActualPremium())
&& Common.isNotNull(success.getActualPremium()) && new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) == 0))
&& (booleanInvoiceNo || booleanPolicyNo) && StringUtils.isNotBlank(detail.getDefaultSettleId())) {
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
......@@ -3601,6 +3601,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
continue;
}
} else if (BigDecimal.ZERO.compareTo(detail.getActualPremium()) == 0
&& Common.isEmpty(param.getActualPremium())) {
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
continue;
}
//批增类型,保单号存在
......@@ -3774,9 +3778,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.HANDLE_PROVINCE_IS_NULL);
continue;
}
String c = detail.getInsuranceHandleCity().toString();
//商险办理地权限校验
boolean b = insuranceAreaResList.stream().anyMatch(s -> detail.getInsuranceHandleCity().equals(s.getCity()) && detail.getInsuranceHandleProvince().equals(s.getProvince()));
if(!b){
if(insuranceAreaResList.stream().noneMatch(s -> c.equals(s.getCity()))){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
continue;
}
......
......@@ -1140,6 +1140,8 @@
and a.DELETE_FLAG = 0
AND PERIOD_DIFF(a.SALARY_MONTH, #{startMouth}) >= 0
AND PERIOD_DIFF(#{endMouth}, a.SALARY_MONTH) >= 0
AND a.FORM_TYPE != '3'
AND a.FORM_TYPE != '4'
</select>
<select id="getAccountMonthForProve" resultType="java.lang.String">
SELECT a.SALARY_MONTH
......@@ -1151,6 +1153,8 @@
and a.DELETE_FLAG = 0
AND PERIOD_DIFF(a.SALARY_MONTH, #{startMouth}) >= 0
AND PERIOD_DIFF(#{endMouth}, a.SALARY_MONTH) >= 0
AND a.FORM_TYPE != '3'
AND a.FORM_TYPE != '4'
group by a.SALARY_MONTH
</select>
......
......@@ -931,6 +931,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray;
String exitMoney;
String errorInfo;
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -1303,12 +1304,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
}
// 项目信息校验
String erroeInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(erroeInfo)){
errorInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(errorInfo)){
errorMessageMap.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(),
paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI
+ erroeInfo + SocialConstants.ERROR_END));
+ errorInfo + SocialConstants.ERROR_END));
continue;
}
if (Common.isNotNull(tSocialInfo)) {
......@@ -1662,6 +1663,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
String[] areaArray;
TSettleDomain domain;
String errorInfo;
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -1784,7 +1786,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setUnitName(fund.getUnitNameFund());
paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown());
paymentInfo.setFundTown(Common.isNotNull(fund.getFundTown()) ? fund.getFundTown(): "");
paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName());
} else if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setEmpId(tProvidentFund.getEmpId());
......@@ -1810,21 +1812,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSettleDomainCode(tProvidentFund.getSettleDomainCode());
paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
paymentInfo.setFundCity(tProvidentFund.getFundCity());
paymentInfo.setFundTown(tProvidentFund.getFundTown());
paymentInfo.setFundTown(Common.isNotNull(tProvidentFund.getFundTown()) ? tProvidentFund.getFundTown(): "");
paymentInfo.setProvidentHousehold(tProvidentFund.getProvidentHouseholdName());
}
// 项目信息校验
String erroeInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(erroeInfo)){
errorInfo = settleInfoCheck(paymentInfo);
if (!Common.isEmpty(errorInfo)){
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(),
paymentInfo.getProvidentHousehold(), infoVo.getEmpName(),
SocialConstants.ERROR_PRI + erroeInfo + SocialConstants.ERROR_END));
SocialConstants.ERROR_PRI + errorInfo + SocialConstants.ERROR_END));
continue;
}
if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setInauguralTeam(Common.isNotNull(tProvidentFund.getInauguralTeam()) ? tProvidentFund.getInauguralTeam(): "");
paymentInfo.setEmpNo(tProvidentFund.getEmpNo());
paymentInfo.setEmpNo(Common.isNotNull(tProvidentFund.getEmpNo()) ? tProvidentFund.getEmpNo(): "");
} else {
paymentInfo.setInauguralTeam("");
paymentInfo.setEmpNo("");
......@@ -2179,7 +2181,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray;
String exitMoney;
String errorInfo;
for (TPaymentHeFeiVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -2464,7 +2466,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setUnitName(Common.isNotNull(socialInfo.getUnitName()) ? socialInfo.getUnitName(): "");
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
payExists.setSocialTown(Common.isNotNull(socialInfo.getSocialTown()) ? socialInfo.getSocialTown(): "");
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
} else if (Common.isNotNull(tSocialInfo)) {
payExists.setEmpId(tSocialInfo.getEmpId());
......@@ -2489,21 +2491,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setBpoFlag(domain.getBpoFlag());
payExists.setSocialProvince(tSocialInfo.getSocialProvince());
payExists.setSocialCity(tSocialInfo.getSocialCity());
payExists.setSocialTown(tSocialInfo.getSocialTown());
payExists.setSocialTown(Common.isNotNull(tSocialInfo.getSocialTown()) ? tSocialInfo.getSocialTown(): "");
payExists.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
}
// 项目信息校验
String erroeInfo = settleInfoCheck(payExists);
if (!Common.isEmpty(erroeInfo)){
errorInfo = settleInfoCheck(payExists);
if (!Common.isEmpty(errorInfo)){
errorMessageList.put(UUID.randomUUID().toString(), new ErrorDetailVO(infoVo.getRowIndex(),
CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(),
payExists.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_PRI
+ erroeInfo + SocialConstants.ERROR_END));
+ errorInfo + SocialConstants.ERROR_END));
continue;
}
if (Common.isNotNull(tSocialInfo)) {
payExists.setInauguralTeam(Common.isNotNull(tSocialInfo.getInauguralTeam()) ? tSocialInfo.getInauguralTeam(): "");
payExists.setEmpNo(tSocialInfo.getEmpNo());
payExists.setEmpNo(Common.isNotNull(tSocialInfo.getEmpNo()) ? tSocialInfo.getEmpNo(): "");
} else {
payExists.setInauguralTeam("");
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