Commit cbd22ff2 authored by hongguangwu's avatar hongguangwu

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

parents 2a002ab4 f5bf6ce4
......@@ -36,4 +36,15 @@ public class ContractAlertSearchVo extends TEmpContractAlert {
* 查询数据止
**/
private int limitEnd;
/**
* @Author fxj
* 合同截止时间区间查询--开始
**/
private LocalDateTime contractEndStart;
/**
* @Author fxj
* 合同截止时间区间查询--截止
**/
private LocalDateTime contractEndEnd;
}
......@@ -70,6 +70,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
} else {
wrapper.orderByDesc(BaseEntity::getCreateTime);
}
if (Common.isNotNull(searchVo.getContractEndStart())){
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart());
}
if (Common.isNotNull(searchVo.getContractEndEnd())){
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd());
}
return baseMapper.selectPage(page,wrapper);
}
......@@ -80,7 +86,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList);
}
wrapper.ne(TEmpContractAlert::getId,CommonConstants.ZERO_STRING);
if (Common.isNotNull(searchVo.getContractEndStart())){
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart());
}
if (Common.isNotNull(searchVo.getContractEndEnd())){
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd());
}
if (Common.isNotNull(searchVo.getAuthSql())) {
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("a.", " "));
......@@ -96,6 +107,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList);
}
if (Common.isNotNull(searchVo.getContractEndStart())){
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart());
}
if (Common.isNotNull(searchVo.getContractEndEnd())){
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd());
}
if (Common.isNotNull(searchVo.getAuthSql())) {
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains("a.")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("a.", " "));
......@@ -171,7 +188,6 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity){
LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery();
wrapper.ne(TEmpContractAlert::getId,CommonConstants.ZERO_STRING);
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0])
.le(TEmpContractAlert::getCreateTime,
......
......@@ -32,6 +32,7 @@ public class ChecksUtil {
private static final String API_URL_MOBILE = "https://api.253.com/open/unn/batch-ucheck";
private static final String API_URL_BANK_NO ="https://api.253.com/open/bankcard/card-auth";
private static final String API_URL_BANK_NO_TWO ="https://api.253.com/open/bankcard/card-two-auth";
private static final String API_URL_BANK_NO_THREE ="https://api.253.com/open/bankcard/card-three-auth";
private static JsonParser jsonParser = new JsonParser();
public static void checkIdCard(TCheckIdCard checkIdCard, boolean canCheck) {
......@@ -96,7 +97,28 @@ public class ChecksUtil {
return R.ok(checkBankNo);
}
}
/**
* @Author fxj
* @Description 银行卡四要素标准版 校验
* @Date 17:50 2022/6/20
* @param name 姓名 是 [string]
* @param cardNo 银行卡号,限单个 是 [string]
**/
public static R<TCheckBankNo> checkBankNoThree(String name, String cardNo, String idNum, boolean canCheck) {
if (canCheck) {
// 1.调用银行卡信息校验api
return checkBankNoThreeMethod(name,cardNo,idNum);
} else {
TCheckBankNo checkBankNo = new TCheckBankNo();
checkBankNo.setBankNo(cardNo);
checkBankNo.setName(name);
checkBankNo.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
checkBankNo.setResult("01");
checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setRemark(ChecksConstants.CHECK_CONFIG_ACCESS);
return R.ok(checkBankNo);
}
}
private static R<TCheckBankNo> checkBankNoTwoMethod(String name, String cardNo) {
final JsonObject jsonObject = ChecksUtil.invokeBankNoTwoAuth(name,cardNo);
TCheckBankNo checkBankNo = new TCheckBankNo();
......@@ -131,6 +153,40 @@ public class ChecksUtil {
return R.ok(checkBankNo);
}
private static R<TCheckBankNo> checkBankNoThreeMethod(String name, String cardNo, String idNum) {
final JsonObject jsonObject = ChecksUtil.invokeBankNoThreeAuth(name,cardNo,idNum);
TCheckBankNo checkBankNo = new TCheckBankNo();
// 2.处理返回结果
if (jsonObject != null) {
//响应code码。200000:成功,其他失败
String code = jsonObject.get(ChecksConstants.CODE).getAsString();
if (ChecksConstants.CODE_200000.equals(code) && jsonObject.get(ChecksConstants.DATA) != null) {
// 调用身份信息校验成功
// 解析结果数据,进行业务处理
// 校验状态码 200000:成功,其他失败
JsonObject resJson = jsonObject.get(ChecksConstants.DATA).getAsJsonObject();
String message = jsonObject.get(ChecksConstants.MESSAGE).getAsString();
if (Common.isNotNull(resJson)){
checkBankNo.setBankNo(cardNo);
checkBankNo.setBankName(getJsonElementValue(resJson.getAsJsonObject().get("bankName")));
checkBankNo.setCardCategory(getJsonElementValue(resJson.getAsJsonObject().get("cardCategory")));
checkBankNo.setCardType(getJsonElementValue(resJson.getAsJsonObject().get("cardType")));
checkBankNo.setResult(getJsonElementValue(resJson.getAsJsonObject().get(ChecksConstants.RESULT)));
checkBankNo.setMessage(message);
checkBankNo.setRemark(getJsonElementValue(resJson.getAsJsonObject().get(ChecksConstants.REMARK)));
checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setName(name);
}
} else {
// 记录错误日志,正式项目中请换成log打印
return R.failed("银行卡号校验失败:"+jsonObject.get(ChecksConstants.MESSAGE).getAsString());
}
} else {
return R.failed(ChecksConstants.NO_DATA_RESULT);
}
return R.ok(checkBankNo);
}
private static String getJsonElementValue(JsonElement temp){
return Common.isNotNull(temp)?temp.getAsString():CommonConstants.EMPTY_STRING;
}
......@@ -273,4 +329,18 @@ public class ChecksUtil {
}
return null;
}
private static JsonObject invokeBankNoThreeAuth(String name,String cardNo,String idNum) {
Map<String, String> params = new HashMap<>();
params.put(ChecksConstants.APP_ID, APP_ID);
params.put(ChecksConstants.APP_KEY, APP_KEY_IDCARD);
params.put(ChecksConstants.NAME, name);
params.put(ChecksConstants.CARD_NO, cardNo);
params.put(ChecksConstants.ID_NUM, idNum);
String result = HttpUtils.post(API_URL_BANK_NO_THREE, params);
// 解析json,并返回结果
if (Common.isNotNull(result)){
return jsonParser.parse(result).getAsJsonObject();
}
return null;
}
}
package com.yifu.cloud.plus.v1.check.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2023/3/3
* @Description
* @Version 1.0
*/
@Data
public class CheckBankNoThreeVo extends RowIndex implements Serializable {
/**
* 银行卡号
*/
@Schema(description ="银行卡号")
@ExcelProperty(value ="银行卡号")
private String bankNo;
/**
* 姓名
*/
@Schema(description ="姓名")
@ExcelProperty(value ="姓名")
private String name;
/**
* 身份证
*/
@Schema(description ="身份证")
@ExcelProperty(value ="身份证")
private String idNum;
}
......@@ -23,14 +23,17 @@ import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.service.TCheckBankNoService;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
......@@ -152,4 +155,31 @@ public class TCheckBankNoController {
return tCheckBankNoService.checkBankNo(name, bankNo);
}
/**
* 银行卡号校验
* @param checkBankNo 姓名 是 [string] 身份证号码,限单个 是 [string] 银行卡号,限单个 是 [string]银行预留手机号,仅支持国内11位号码
*/
@Operation(description = "银行卡号校验")
@SysLog("银行卡号校验" )
@Inner
@PostMapping("/inner/checkBankNoThree" )
public CheckBankNoVo checkBankNoThreeInner(@RequestBody TCheckBankNo checkBankNo) {
return tCheckBankNoService.checkBankNoThree(checkBankNo.getName(),checkBankNo.getBankNo(),checkBankNo.getIdNum());
}
/**
* 批量新增员工工作信息
*
* @param file
* @return
* @Author fxj
* @Date 2019-08-16
**/
@SneakyThrows
@Operation(description = "批量新增员工工作信息 hasPermission('archives_tempworkrecording_importListAdd')")
@SysLog("批量新增员工工作信息")
@PostMapping("/importListAdd")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tCheckBankNoService.importDiy(file.getInputStream());
}
}
......@@ -21,8 +21,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.io.InputStream;
import java.util.List;
/**
......@@ -41,6 +43,8 @@ public interface TCheckBankNoService extends IService<TCheckBankNo> {
**/
R<TCheckBankNo> checkBankNo(String name, String cardNo);
CheckBankNoVo checkBankNoThree(String name, String cardNo, String idNum);
CheckBankNoVo checkBankNoTwo(String name, String cardNo);
/**
......@@ -52,4 +56,5 @@ public interface TCheckBankNoService extends IService<TCheckBankNo> {
**/
CheckBatchVo checkBankNoBatch(List<TCheckBankNo> list);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
}
......@@ -16,6 +16,11 @@
*/
package com.yifu.cloud.plus.v1.check.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
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.entity.TCheckBankNo;
......@@ -23,20 +28,24 @@ 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.TCheckBankNoService;
import com.yifu.cloud.plus.v1.check.utils.ChecksUtil;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoThreeVo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpWorkRecordExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 银行卡卡号 校验
......@@ -71,7 +80,30 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
return resR;
}
}
@Override
public CheckBankNoVo checkBankNoThree(String name, String cardNo, String idNum) {
CheckBankNoVo vo = new CheckBankNoVo();
if (Common.isEmpty(name) || Common.isEmpty(cardNo)){
vo.setRes(R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_BANK_NO_REQUEST_PARAM_ERROR)));
return vo;
}
synchronized (this){
TCheckBankNo checkBankNo = baseMapper.selectOne(Wrappers.<TCheckBankNo>query().lambda()
.eq(TCheckBankNo::getBankNo,cardNo)
.eq(TCheckBankNo::getName,name)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkBankNo)){
vo.setRes(R.ok(checkBankNo));
return vo;
}
R<TCheckBankNo> resR = ChecksUtil.checkBankNoThree(name,cardNo,idNum,canCheckService.getCanCheck());
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){
baseMapper.insert(resR.getData());
}
vo.setRes(resR);
return vo;
}
}
@Override
public CheckBankNoVo checkBankNoTwo(String name, String cardNo) {
CheckBankNoVo vo = new CheckBankNoVo();
......@@ -160,4 +192,99 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
return vo;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<CheckBankNoThreeVo> util1 = new ExcelUtil<>(CheckBankNoThreeVo.class);;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, CheckBankNoThreeVo.class, new ReadListener<CheckBankNoThreeVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<CheckBankNoThreeVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(CheckBankNoThreeVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex+1);
cachedDataList.add(data);
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
importRecord(cachedDataList,errorMessageList);
}
}).sheet().doRead();
}catch (Exception e){
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR,e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importRecord(List<CheckBankNoThreeVo> cachedDataList, List<ErrorMessage> errorMessageList) {
if (Common.isNotNull(cachedDataList)){
CheckBankNoVo vo;
TCheckBankNo checkBankNo;
List<CheckBankNoVo> res = new ArrayList<>();
for (CheckBankNoThreeVo threeVo:cachedDataList){
vo = new CheckBankNoVo();
if (Common.isEmpty(threeVo.getName()) || Common.isEmpty(threeVo.getBankNo())|| Common.isEmpty(threeVo.getIdNum())){
vo.setRes(R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_BANK_NO_REQUEST_PARAM_ERROR)));
res.add(vo);
}
synchronized (this){
checkBankNo = baseMapper.selectOne(Wrappers.<TCheckBankNo>query().lambda()
.eq(TCheckBankNo::getBankNo,threeVo.getBankNo())
.eq(TCheckBankNo::getName,threeVo.getName())
.eq(TCheckBankNo::getIdNum,threeVo.getIdNum())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkBankNo)){
vo.setRes(R.ok(checkBankNo));
res.add(vo);
}
R<TCheckBankNo> resR = ChecksUtil.checkBankNoThree(threeVo.getName(),threeVo.getBankNo(),threeVo.getIdNum(),canCheckService.getCanCheck());
if (Common.isNotNull(resR) && Common.isNotNull(resR.getData())){
baseMapper.insert(resR.getData());
}
vo.setRes(resR);
res.add(vo);
if (resR.getCode()==200){
log.error(threeVo.getBankNo()+"|"
+threeVo.getIdNum()+"|"
+threeVo.getName()+"|"
+resR.getData().getResult()+"|"
+resR.getData().getRemark());
}else {
log.error(threeVo.getBankNo()+"|"
+threeVo.getIdNum()+"|"
+threeVo.getName()+"|"
+resR.getMsg());
}
}
}
}
}
}
......@@ -429,7 +429,7 @@ public interface CommonConstants {
/**
* 一年365天
*/
int ONE_YEAR = 365;
int ONE_YEAR = 366;
/**
* 数字70
......
......@@ -37,6 +37,12 @@ public class InsuranceInsuredDetailParam implements Serializable {
@Schema(description = "变更后投保类型 1新增 3批增")
private Integer buyType;
/**
* 变更后的购买标准
*/
@Schema(description = "变更后的购买标准")
private String buyStandard;
/**
* 变更原因
*/
......
......@@ -57,6 +57,12 @@ public class InsuranceInsuredParam implements Serializable {
@Schema(description = "购买标准")
private String buyStandard;
/**
* 变更后的购买标准
*/
@Schema(description = "变更后的购买标准")
private String buyStandardNew;
/**
* 变更后保单开始时间
*/
......
......@@ -2198,8 +2198,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceInsuredParam> listSuccess = operateList.stream().filter(e-> e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS)).collect(Collectors.toList());
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
TInsuranceDetail detail;
for (InsuranceInsuredParam success : listSuccess) {
TInsuranceDetail detail = success.getDetail();
detail = success.getDetail();
if (Optional.ofNullable(detail).isPresent()){
TInsuranceDetail oldDetail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,oldDetail);
......@@ -2212,6 +2213,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Objects.nonNull(success.getBuyType())){
detail.setBuyType(success.getBuyType());
}
if (Common.isNotNull(success.getBuyStandardNew())) {
detail.setBuyStandard(success.getBuyStandardNew());
}
detailList.add(detail);
//变更记录
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,detail,success.getReason());
......@@ -2233,6 +2237,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!oldDetail.getBuyType().equals(detail.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(oldDetail.getBuyType()) + ";变更后投保类型:" + getBuyType(detail.getBuyType()));
}
if (!oldDetail.getBuyStandard().equals(detail.getBuyStandard())) {
sb.append(";变更前购买标准:" + oldDetail.getBuyStandard() + ";变更后购买标准:" + detail.getBuyStandard());
}
if (StringUtils.isNotBlank(success.getReason())){
sb.append(";变更原因:" + success.getReason());
}
......@@ -2258,7 +2265,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//操作记录
//addOperate(detailList,user,InsurancesConstants.UPDATE_INSURED,null,CommonConstants.ONE_INT);
if (operateList.stream().allMatch(e->e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS))) {
operateList = null;
}
......@@ -2326,6 +2332,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Objects.nonNull(param.getBuyType())){
byId.setBuyType(param.getBuyType());
}
if (Objects.nonNull(param.getBuyStandard())){
byId.setBuyStandard(param.getBuyStandard());
}
//变更记录
tBusinessOperateService.saveModificationRecord(byId.getId(),old,byId,param.getReason());
......@@ -2346,6 +2355,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!old.getBuyType().equals(param.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(old.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType()));
}
if (!old.getBuyStandard().equals(param.getBuyStandard())) {
sb.append(";变更前购买标准:" + old.getBuyStandard() + ";变更后购买标准:" + param.getBuyStandard());
}
if (StringUtils.isNotBlank(param.getReason())){
sb.append(";变更原因:" + param.getReason());
}
......@@ -3793,6 +3805,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
private List<InsuranceInsuredParam> updateInsuranceInsuredCheck(List<InsuranceInsuredParam> paramList, List<TInsuranceAreaRes> insuranceAreaResList){
List<InsuranceInsuredParam> collect = paramList.stream().distinct().collect(Collectors.toList());
TInsuranceDetail detail;
for (InsuranceInsuredParam param : collect) {
param.setFlag(CommonConstants.ONE_STRING);
// 必填校验
......@@ -3876,7 +3889,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
......@@ -3899,8 +3912,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//商险办理地权限校验
boolean b = insuranceAreaResList.stream().anyMatch(s -> detail.getInsuranceHandleCity().equals(s.getCity()) && detail.getInsuranceHandleProvince().equals(s.getProvince()));
if(!b){
String insuranceHandleCity = detail.getInsuranceHandleCity().toString();
String insuranceHandleProvince = detail.getInsuranceHandleProvince().toString();
if(insuranceAreaResList.stream().noneMatch(s -> insuranceHandleCity.equals(s.getCity()) && insuranceHandleProvince.equals(s.getProvince()))){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
continue;
}
......
......@@ -70,4 +70,12 @@ public class TPaymentInfoSearchVo extends TPaymentInfo {
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* @Author fxj
* 区域查询辅助字段:0 不包含下级 1 包含下级
**/
@Schema(description = "0 不包含下级 1 包含下级")
private String areaFlag;
}
......@@ -44,7 +44,7 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfo tPaymentInfo);
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库简单分页查询
......
......@@ -42,7 +42,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfo tPaymentInfo);
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库批量导入社保
......
......@@ -2512,11 +2512,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR2)));
return true;
}
if (CommonConstants.ZERO_STRING.equals(excel.getPaymentType())){
excel.setPensionCardinal(socialSet.getLowerLimit());
}
if (CommonConstants.TWO_STRING.equals(excel.getPaymentType())){
excel.setPensionCardinal(socialSet.getUpperLimit());
}
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& Common.isEmpty(excel.getTrustRemark())
&& (Common.isEmpty(excel.getPensionCardinal())
|| excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT)){
&& (excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR)));
return true;
}
......
......@@ -142,7 +142,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @return
*/
@Override
public IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfo tPaymentInfo) {
public IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return baseMapper.getTPaymentInfoPage(page, tPaymentInfo);
}
......
......@@ -390,12 +390,12 @@
<if test="tPaymentInfo.providentPayAddr != null and tPaymentInfo.providentPayAddr.trim() != ''">
AND a.PROVIDENT_PAY_ADDR = #{tPaymentInfo.providentPayAddr}
</if>
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != ''">
AND (a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' or a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}')
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != ''">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
<if test="tPaymentInfo.providentPayAddr != null and tPaymentInfo.providentPayAddr.trim() != ''">
AND a.PROVIDENT_PAY_ADDR = #{tPaymentInfo.providentPayAddr}
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 开始 2023-03-02 fxj -->
<if test="tPaymentInfo.areaFlag == null || tPaymentInfo.areaFlag == '0'">
<if test="tPaymentInfo.socialTown == null">
<if test="tPaymentInfo.socialCity != null">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
......@@ -409,6 +409,29 @@
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if>
</if>
<if test="tPaymentInfo.areaFlag == '1'">
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != '' and tPaymentInfo.socialCity == null">
AND (
(a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' and a.SOCIAL_CITY is null)
or
(a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}' and a.FUND_CITY is null)
)
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != '' and tPaymentInfo.socialTown == null">
AND (
(a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' and a.SOCIAL_TOWN is null )
or
(a.FUND_CITY = '${tPaymentInfo.socialCity}' and a.FUND_TOWN is null)
)
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if>
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
<if test="tPaymentInfo.socialId != null and tPaymentInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tPaymentInfo.socialId}
</if>
......@@ -607,15 +630,8 @@
<if test="tPaymentInfo.fundCity != null and tPaymentInfo.fundCity.trim() != ''">
AND a.FUND_CITY = #{tPaymentInfo.fundCity}
</if>
<if test="tPaymentInfo.fundTown != null and tPaymentInfo.fundTown.trim() != ''">
AND a.FUND_TOWN = #{tPaymentInfo.fundTown}
</if>
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != ''">
AND (a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' or a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}')
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != ''">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 开始 2023-03-02 fxj -->
<if test="tPaymentInfo.areaFlag == null || tPaymentInfo.areaFlag == '0'">
<if test="tPaymentInfo.socialTown == null">
<if test="tPaymentInfo.socialCity != null">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
......@@ -629,6 +645,28 @@
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if>
</if>
<if test="tPaymentInfo.areaFlag == '1'">
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != '' and tPaymentInfo.socialCity == null">
AND (
(a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' and a.SOCIAL_CITY is null)
or
(a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}' and a.FUND_CITY is null)
)
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != '' and tPaymentInfo.socialTown == null">
AND (
(a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' and a.SOCIAL_TOWN is null )
or
(a.FUND_CITY = '${tPaymentInfo.socialCity}' and a.FUND_TOWN is null)
)
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if>
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
<if test="tPaymentInfo.providentNo != null and tPaymentInfo.providentNo.trim() != ''">
AND a.PROVIDENT_NO = #{tPaymentInfo.providentNo}
</if>
......
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