Commit 9d62b22e authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 3c4d96be 50fe8278
......@@ -74,7 +74,7 @@ public class TEmpDisabilityInfoController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempdisabilityinfo_get')" )
public R<TEmpDisabilityInfo> getById(@PathVariable("id" ) Long id) {
public R<TEmpDisabilityInfo> getById(@PathVariable("id" ) String id) {
return R.ok(tEmpDisabilityInfoService.getById(id));
}
......@@ -113,7 +113,7 @@ public class TEmpDisabilityInfoController {
@SysLog("通过id删除员工伤残信息表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempdisabilityinfo_del')" )
public R<Boolean> removeById(@PathVariable Long id) {
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmpDisabilityInfoService.removeById(id));
}
......
......@@ -76,7 +76,7 @@ public class TEmpEducationController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempeducation_get')" )
public R<TEmpEducation> getById(@PathVariable("id" ) Long id) {
public R<TEmpEducation> getById(@PathVariable("id" ) String id) {
return R.ok(tEmpEducationService.getById(id));
}
......@@ -115,7 +115,7 @@ public class TEmpEducationController {
@SysLog("通过id删除员工学历信息表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempeducation_del')" )
public R<Boolean> removeById(@PathVariable Long id) {
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmpEducationService.removeById(id));
}
......
......@@ -66,7 +66,7 @@ public class TEmpProfessionalQualificationController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_get')" )
public R getById(@PathVariable("id" ) Long id) {
public R getById(@PathVariable("id" ) String id) {
return R.ok(tEmpProfessionalQualificationService.getById(id));
}
......@@ -105,7 +105,7 @@ public class TEmpProfessionalQualificationController {
@SysLog("通过id删除员工职业资格信息表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_del')" )
public R removeById(@PathVariable Long id) {
public R removeById(@PathVariable String id) {
return R.ok(tEmpProfessionalQualificationService.removeById(id));
}
......
......@@ -75,7 +75,7 @@ public class TEmpWorkRecordingController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempworkrecording_get')" )
public R<TEmpWorkRecording> getById(@PathVariable("id" ) Long id) {
public R<TEmpWorkRecording> getById(@PathVariable("id" ) String id) {
return R.ok(tEmpWorkRecordingService.getById(id));
}
......@@ -89,7 +89,8 @@ public class TEmpWorkRecordingController {
@PostMapping
@PreAuthorize("@pms.hasPermission('archives_tempworkrecording_add')" )
public R<Boolean> save(@RequestBody TEmpWorkRecording tEmpWorkRecording) {
return R.ok(tEmpWorkRecordingService.save(tEmpWorkRecording));
tEmpWorkRecording.setDeleteFlag(CommonConstants.ZERO_STRING);
return tEmpWorkRecordingService.saveDiy(tEmpWorkRecording);
}
/**
......@@ -102,7 +103,7 @@ public class TEmpWorkRecordingController {
@PutMapping
@PreAuthorize("@pms.hasPermission('archives_tempworkrecording_edit')" )
public R<Boolean> updateById(@RequestBody TEmpWorkRecording tEmpWorkRecording) {
return R.ok(tEmpWorkRecordingService.updateById(tEmpWorkRecording));
return tEmpWorkRecordingService.updateByIdDiy(tEmpWorkRecording);
}
/**
......@@ -114,7 +115,7 @@ public class TEmpWorkRecordingController {
@SysLog("通过id删除员工工作履历信息表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_tempworkrecording_del')" )
public R<Boolean> removeById(@PathVariable Long id) {
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmpWorkRecordingService.removeById(id));
}
......
......@@ -35,4 +35,8 @@ import java.util.List;
public interface TEmpWorkRecordingService extends IService<TEmpWorkRecording> {
R<List<ErrorMessage>> importEmpWorkRecord(List<EmpWorkRecordExcelVO> excelVOList, BindingResult bindingResult);
R<Boolean> updateByIdDiy(TEmpWorkRecording tEmpWorkRecording);
R<Boolean> saveDiy(TEmpWorkRecording tEmpWorkRecording);
}
......@@ -18,9 +18,13 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
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.mapper.TEmpWorkRecordingMapper;
......@@ -100,6 +104,49 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
return R.ok();
}
@Override
public R<Boolean> updateByIdDiy(TEmpWorkRecording recording) {
String res = checkRepeat(recording);
if (Common.isEmpty(res)){
return R.ok(this.updateById(recording));
}else {
return R.failed(checkRepeat(recording));
}
}
@Override
public R<Boolean> saveDiy(TEmpWorkRecording recording) {
String res = checkRepeat(recording);
if (Common.isEmpty(res)){
this.save(recording);
return R.ok();
}else {
return R.failed(checkRepeat(recording));
}
}
public String checkRepeat(TEmpWorkRecording recording) {
LambdaQueryWrapper<TEmpWorkRecording> wrapper = Wrappers.lambdaQuery();
if (StrUtil.isNotBlank(recording.getEmpIdcard())){
wrapper.eq(TEmpWorkRecording::getEmpIdcard,recording.getEmpIdcard());
}
if (StrUtil.isNotBlank(recording.getWorkDepart())){
wrapper.eq(TEmpWorkRecording::getWorkDepart,recording.getWorkDepart());
}
if (StrUtil.isNotBlank(recording.getWorkUnit())){
wrapper.eq(TEmpWorkRecording::getWorkUnit,recording.getWorkUnit());
}
if (StrUtil.isNotBlank(recording.getWorkJob())){
wrapper.eq(TEmpWorkRecording::getWorkJob,recording.getWorkJob());
}
wrapper.eq(TEmpWorkRecording::getDeleteFlag,CommonConstants.ZERO_STRING);
wrapper.last(CommonConstants.LAST_ONE_SQL);
if (Common.isNotNull(baseMapper.selectOne(wrapper))){
return MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_FAMILY_NAME_EXISTING, recording.getEmpName());
}
return null;
}
private void checkRes(List<TEmpWorkRecording> list, TEmployeeInfo emp, Set<String> errorMsg, EmpWorkRecordExcelVO excel) {
if (Common.isEmpty(emp)){
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_NOT_EXIST, excel.getEmpIdcard()));
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 银行卡卡号 校验
*
* @author fxj
* @date 2022-06-20 19:56:33
*/
@Data
@TableName("t_check_bank_no")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "银行卡卡号 校验")
public class TCheckBankNo extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="id")
private String id;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
/**
* 0:初始数据 1:API验证结果
*/
@Schema(description ="0:初始数据 1:API验证结果")
private String type;
/**
* 响应code码解释
*/
@Schema(description ="响应code码解释")
private String message;
/**
* 样例:信息认证未通过(验证不一致)
*/
@Schema(description ="样例:信息认证未通过(验证不一致)")
private String remark;
/**
* 认证结果
*/
@Schema(description =" 认证结果")
private String result;
/**
* 所属银行。样例:招商银行
*/
@Schema(description ="所属银行。样例:招商银行")
private String bankName;
/**
* 银行卡号
*/
@Schema(description ="银行卡号")
private String bankNo;
/**
* 银行卡类型
*/
@Schema(description ="银行卡类型")
private String cardType;
/**
* 银行卡类别 样例:借记卡
*/
@Schema(description ="银行卡类别 样例:借记卡")
private String cardCategory;
}
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.check.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.check.utils;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -20,7 +21,7 @@ import java.util.Map;
*/
public class ChecksUtil {
@Value("${canCheck}")
@Value("${canCheck:false}")
private static boolean canCheck;
private static final String APP_ID_ID_CARD = "oi0mucL4";
......@@ -41,7 +42,12 @@ public class ChecksUtil {
checkIdCard.setReason("nacos中checks.yaml的配置canCheck未开启!");
}
}
/**
* @Author fxj
* @Description 手机号码状态检测
* @Date 17:50 2022/6/20
* @param mobiles 检测手机号,多个手机号码用英文半角逗号隔开,仅支持国内号码
**/
public static R<Map<String,TCheckMobile>> checkMobile(String mobiles) {
Map<String,TCheckMobile> checkMobiles = new HashMap<>();
if (canCheck) {
......@@ -51,7 +57,70 @@ public class ChecksUtil {
return R.failed("nacos中checks.yaml的配置canCheck未开启!");
}
}
/**
* @Author fxj
* @Description 银行卡四要素标准版 校验
* @Date 17:50 2022/6/20
* @param name 姓名 是 [string]
* @param idNum 身份证号码,限单个 是 [string]
* @param cardNo 银行卡号,限单个 是 [string]
* @param mobile 银行预留手机号,仅支持国内11位号码
**/
public static R<TCheckBankNo> checkBankNo(String name, String idNum, String cardNo, String mobile) {
TCheckBankNo checkBankNo = new TCheckBankNo();
if (canCheck) {
// 1.调用身份信息校验api
return checkBankNoMethod(name,idNum,cardNo,mobile,checkBankNo);
} else {
return R.failed("nacos中checks.yaml的配置canCheck未开启!");
}
}
private static R<TCheckBankNo> checkBankNoMethod(String name,
String idNum,
String cardNo,
String mobile,
TCheckBankNo checkBankNo) {
final JsonObject jsonObject = ChecksUtil.invokeBankNo(name,idNum,cardNo,mobile);
// 2.处理返回结果
if (jsonObject != null) {
//响应code码。200000:成功,其他失败
String code = jsonObject.get("code").getAsString();
if ("200000".equals(code) && jsonObject.get("data") != null) {
// 调用身份信息校验成功
// 解析结果数据,进行业务处理
// 校验状态码 200000:成功,其他失败
JsonObject resJson = jsonObject.get("data").getAsJsonObject();
String message = jsonObject.get("message").getAsString();
if (Common.isNotNull(resJson)){
TCheckBankNo bankNo = new TCheckBankNo();
bankNo.setBankNo(resJson.getAsJsonObject().get("bankNo").getAsString());
bankNo.setBankName(resJson.getAsJsonObject().get("bankName").getAsString());
bankNo.setCardCategory(resJson.getAsJsonObject().get("cardCategory").getAsString());
bankNo.setCardType(resJson.getAsJsonObject().get("cardType").getAsString());
bankNo.setResult(resJson.getAsJsonObject().get("result").getAsString());
bankNo.setMessage(message);
bankNo.setRemark(resJson.getAsJsonObject().get("remark").getAsString());
bankNo.setType(CommonConstants.ONE_STRING);
}
} else {
// 记录错误日志,正式项目中请换成log打印
return R.failed("银行卡号校验失败,code:" + code + ",msg:" + jsonObject.get("message").getAsString());
}
} else {
return R.failed("接口无返回数据");
}
return R.ok(checkBankNo);
}
/**
* @Author fxj
* @Description 手机号码状态检测
* @Date 17:50 2022/6/20
* @param mobiles 检测手机号,多个手机号码用英文半角逗号隔开,仅支持国内号码
**/
private static R<Map<String,TCheckMobile>> checkMobileMethod(String mobiles, Map<String,TCheckMobile> checkMobileMap) {
final JsonObject jsonObject = ChecksUtil.invokeMobile(mobiles);
// 2.处理返回结果
......@@ -146,4 +215,17 @@ public class ChecksUtil {
// 解析json,并返回结果
return jsonParser.parse(result).getAsJsonObject();
}
private static JsonObject invokeBankNo(String name, String idNum, String cardNo, String mobile) {
Map<String, String> params = new HashMap<>();
params.put("appId", APP_ID_ID_CARD);
params.put("appKey", APP_KEY_ID_CARD);
params.put("name", name);
params.put("idNum", idNum);
params.put("cardNo", cardNo);
params.put("mobile", mobile);
String result = HttpUtils.post(API_URL_ID_CARD, params);
// 解析json,并返回结果
return jsonParser.parse(result).getAsJsonObject();
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.service.TCheckBankNoService;
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.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 银行卡卡号 校验
*
* @author fxj
* @date 2022-06-20 19:56:33
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tcheckbankno" )
@Tag(name = "银行卡卡号 校验管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TCheckBankNoController {
private final TCheckBankNoService tCheckBankNoService;
/**
* 分页查询
* @param page 分页对象
* @param tCheckBankNo 银行卡卡号 校验
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_get')" )
public R getTCheckBankNoPage(Page page, TCheckBankNo tCheckBankNo) {
return R.ok(tCheckBankNoService.page(page, Wrappers.query(tCheckBankNo)));
}
/**
* 通过id查询银行卡卡号 校验
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_get')" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(tCheckBankNoService.getById(id));
}
/**
* 新增银行卡卡号 校验
* @param tCheckBankNo 银行卡卡号 校验
* @return R
*/
@Operation(summary = "新增银行卡卡号 校验", description = "新增银行卡卡号 校验")
@SysLog("新增银行卡卡号 校验" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_add')" )
public R save(@RequestBody TCheckBankNo tCheckBankNo) {
return R.ok(tCheckBankNoService.save(tCheckBankNo));
}
/**
* 修改银行卡卡号 校验
* @param tCheckBankNo 银行卡卡号 校验
* @return R
*/
@Operation(summary = "修改银行卡卡号 校验", description = "修改银行卡卡号 校验")
@SysLog("修改银行卡卡号 校验" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_edit')" )
public R updateById(@RequestBody TCheckBankNo tCheckBankNo) {
return R.ok(tCheckBankNoService.updateById(tCheckBankNo));
}
/**
* 通过id删除银行卡卡号 校验
* @param id id
* @return R
*/
@Operation(summary = "通过id删除银行卡卡号 校验", description = "通过id删除银行卡卡号 校验")
@SysLog("通过id删除银行卡卡号 校验" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_del')" )
public R removeById(@PathVariable String id) {
return R.ok(tCheckBankNoService.removeById(id));
}
/**
* 银行卡号校验
* @param name 姓名 是 [string]
* @param idNum 身份证号码,限单个 是 [string]
* @param cardNo 银行卡号,限单个 是 [string]
* @param mobile 银行预留手机号,仅支持国内11位号码
*/
@Operation(description = "银行卡号校验")
@SysLog("银行卡号校验" )
@Inner
@GetMapping("/checkBankNo" )
public R<TCheckBankNo> checkBankNo(String name, String idNum, String cardNo, String mobile) {
return tCheckBankNoService.checkBankNo(name,idNum,cardNo,mobile);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import org.apache.ibatis.annotations.Mapper;
/**
* 银行卡卡号 校验
*
* @author fxj
* @date 2022-06-20 19:56:33
*/
@Mapper
public interface TCheckBankNoMapper extends BaseMapper<TCheckBankNo> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* 银行卡卡号 校验
*
* @author fxj
* @date 2022-06-20 19:56:33
*/
public interface TCheckBankNoService extends IService<TCheckBankNo> {
R<TCheckBankNo> checkBankNo(String name, String idNum, String cardNo, String mobile);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.check.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.TCheckBankNoService;
import com.yifu.cloud.plus.v1.check.utils.ChecksUtil;
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 org.springframework.stereotype.Service;
/**
* 银行卡卡号 校验
*
* @author fxj
* @date 2022-06-20 19:56:33
*/
@Service
public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCheckBankNo> implements TCheckBankNoService {
@Override
public R<TCheckBankNo> checkBankNo(String name, String idNum, String cardNo, String mobile) {
if (Common.isEmpty(name) || Common.isEmpty(idNum) || Common.isEmpty(cardNo)){
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_BANK_NO_REQUEST_PARAM_ERROR));
}
return ChecksUtil.checkBankNo(name,idNum,cardNo,mobile);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.check.mapper.TCheckBankNoMapper">
<resultMap id="tCheckBankNoMap" type="com.yifu.cloud.plus.v1.check.entity.TCheckBankNo">
<id property="id" column="id"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createName" column="create_name"/>
<result property="type" column="type"/>
<result property="message" column="message"/>
<result property="remark" column="remark"/>
<result property="result" column="result"/>
<result property="bankName" column="bank_name"/>
<result property="bankNo" column="bank_no"/>
<result property="cardType" column="card_type"/>
<result property="cardCategory" column="card_category"/>
</resultMap>
</mapper>
......@@ -201,4 +201,8 @@ public interface ErrorCodes {
* 单次号码状态校验请求上限100
*/
String CHECKS_MOBILE_REQUEST_LIMIT_HUNDRED = "checks.mobile.request.limit.hundred";
/**
* 银行卡号校验传参有误:姓名、身份证号、银行卡号 必填
*/
String CHECKS_BANK_NO_REQUEST_PARAM_ERROR = "checks.bank.no.request.param.error";
}
......@@ -52,6 +52,7 @@ param.not.empty=\u53C2\u6570\u4E0D\u53EF\u4E3A\u7A7A
checks.mobile.request.error=\u6821\u9A8C\u8BF7\u6C42\u5F02\u5E38
checks.mobile.request.limit.hundred=\u5355\u6B21\u53F7\u7801\u72B6\u6001\u6821\u9A8C\u8BF7\u6C42\u4E0A\u9650100
checks.bank.no.request.param.error=\u94F6\u884C\u5361\u53F7\u6821\u9A8C\u4F20\u53C2\u6709\u8BEF\uFF1A\u59D3\u540D\u3001\u8EAB\u4EFD\u8BC1\u53F7\u3001\u94F6\u884C\u5361\u53F7 \u5FC5\u586B
......
# 数据源配置
spring:
redis:
host: 127.0.0.1
host: 192.168.1.65
port: 22379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
......
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