Browse Source

支付接口

v1.0
15989082884@163.com 2 years ago
parent
commit
2353f4f051
  1. 33
      src/main/java/com/qs/serve/modules/pay/controller/PayPaymentController.java
  2. 7
      src/main/java/com/qs/serve/modules/pay/entity/PayPayment.java
  3. 12
      src/main/java/com/qs/serve/modules/pay/entity/PayPaymentItem.java
  4. 29
      src/main/java/com/qs/serve/modules/pay/entity/bo/PayPaymentBo.java
  5. 6
      src/main/java/com/qs/serve/modules/pay/mapper/PayPaymentMapper.java
  6. 2
      src/main/java/com/qs/serve/modules/pay/service/PayPaymentService.java
  7. 278
      src/main/java/com/qs/serve/modules/pay/service/impl/PayPaymentServiceImpl.java
  8. 2
      src/main/java/com/qs/serve/modules/vtb/service/VtbVerificationSubjectService.java
  9. 6
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationSubjectServiceImpl.java

33
src/main/java/com/qs/serve/modules/pay/controller/PayPaymentController.java

@ -223,22 +223,22 @@ public class PayPaymentController {
* @param param
* @return
*/
@PostMapping("/unPayment")
@SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.INSERT)
@PreAuthorize("hasRole('pay:payment:pay')")
public R<PayPayment> save(@RequestBody @Valid PayUnPaymentBo param){
PayPaymentBo paymentBo = CopierUtil.copy(param,new PayPaymentBo());
paymentBo.setPayType(PaymentType.UN_PAYMENT);
PayPayment payPayment = payPaymentService.payment(paymentBo);
return R.ok(payPayment);
}
// @PostMapping("/unPayment")
// @SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.INSERT)
// @PreAuthorize("hasRole('pay:payment:pay')")
// public R<PayPayment> save(@RequestBody @Valid PayUnPaymentBo param){
// PayPaymentBo paymentBo = CopierUtil.copy(param,new PayPaymentBo());
// paymentBo.setPayType(PaymentType.UN_PAYMENT);
// PayPayment payPayment = payPaymentService.payment(paymentBo);
// return R.ok(payPayment);
// }
/**
* 新增支付核销调用
* 新增支付
* @param param
* @return
*/
@PostMapping("/payment")
@PostMapping("/save")
@SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.INSERT)
@PreAuthorize("hasRole('pay:payment:pay')")
public R<PayPayment> save(@RequestBody @Valid PayPaymentBo param){
@ -248,15 +248,14 @@ public class PayPaymentController {
/**
* 取消支付
* @param id
* @param erpId
* @return
*/
@DeleteMapping("/cancel/{id}")
@SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.DELETE)
@GetMapping("/cancel/{id}")
@SysLog(module = SystemModule.Payment, title = "取消支付", biz = BizType.DELETE)
@PreAuthorize("hasRole('pay:payment:cancel')")
public R<?> cancelById(@PathVariable("id") Long id){
//TODO 远程同步东哥的数据,方案暂未落实
payPaymentService.cancel(id);
public R<?> cancelById(@PathVariable("id") String erpId){
payPaymentService.cancel(erpId);
return R.ok();
}

7
src/main/java/com/qs/serve/modules/pay/entity/PayPayment.java

@ -95,6 +95,12 @@ public class PayPayment implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payTime;
@NotNull(message = "支付时间不能为空")
@Length(max = 0,message = "支付时间长度不能超过0字")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payDate;
/**
* 取消标识
* 不再支付列表0-冻结1-解冻
@ -127,6 +133,7 @@ public class PayPayment implements Serializable {
private Long costApplyId;
@TableField(condition = SqlCondition.LIKE)
@NotNull(message = "ErpId不能为空")
private String erpId;
/** 所属租户 */

12
src/main/java/com/qs/serve/modules/pay/entity/PayPaymentItem.java

@ -108,6 +108,12 @@ public class PayPaymentItem implements Serializable {
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
@TableField(condition = SqlCondition.LIKE)
private String erpId;
@TableField(condition = SqlCondition.LIKE)
private String billNumber;
/** 所属租户 */
@JsonIgnore
@JsonProperty
@ -126,12 +132,6 @@ public class PayPaymentItem implements Serializable {
@JsonProperty
private String delFlag;
@TableField(condition = SqlCondition.LIKE)
private String erpId;
@TableField(condition = SqlCondition.LIKE)
private String billNumber;
/** 支付时间 */
@NotNull(message = "支付时间不能为空")
@Length(max = 0,message = "支付时间长度不能超过0字")

29
src/main/java/com/qs/serve/modules/pay/entity/bo/PayPaymentBo.java

@ -5,6 +5,8 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -24,12 +26,9 @@ import javax.validation.constraints.NotBlank;
@Data
public class PayPaymentBo implements Serializable {
/** 标题 */
private String title;
/** 供应商id */
@NotNull(message = "供应商id不能为空")
private Long supplierId;
/** 核销子项编码 */
@NotNull(message = "核销子项编码不能为空")
private String verificationSubCode;
/** 支付金额 */
@DecimalMin(value = "0.01",message = "支付金额必须大于0元")
@ -37,7 +36,8 @@ public class PayPaymentBo implements Serializable {
private BigDecimal payAmount;
/** ERP编码 */
private String erpCode;
@NotNull(message = "ERP编码不能为空")
private String erpId;
/** 发票编号 */
@NotNull(message = "发票编号不能为空")
@ -47,11 +47,24 @@ public class PayPaymentBo implements Serializable {
@Length(max = 255,message = "备注长度不能超过255字")
private String remark;
/** 支付时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payTime;
/** 支付日期 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payDate;
/** 人员工号 */
@NotNull(message = "人员工号不能为空")
private String userCode;
/**
* 支付类型
* pay - 支付
* unPay - 不再支付 TODO 同步告知东哥
* unPay - 不再支付
**/
@NotNull(message = "支付类型不能为空")
private String payType;

6
src/main/java/com/qs/serve/modules/pay/mapper/PayPaymentMapper.java

@ -1,7 +1,10 @@
package com.qs.serve.modules.pay.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.pay.entity.PayPayment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* 支付 Mapper
@ -10,5 +13,8 @@ import com.qs.serve.modules.pay.entity.PayPayment;
*/
public interface PayPaymentMapper extends BaseMapper<PayPayment> {
@InterceptorIgnore(tenantLine = "1")
@Select("select * from pay_payment where erp_id = #{erpId}")
PayPayment getByErpId(@Param("erpId")String erpId);
}

2
src/main/java/com/qs/serve/modules/pay/service/PayPaymentService.java

@ -23,7 +23,7 @@ public interface PayPaymentService extends IService<PayPayment> {
* 取消支付
* @param id
*/
void cancel(Long id);
void cancel(String erpId);
/**
* 获取供应商需支付明细

278
src/main/java/com/qs/serve/modules/pay/service/impl/PayPaymentServiceImpl.java

@ -1,9 +1,11 @@
package com.qs.serve.modules.pay.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qs.serve.common.util.Assert;
import com.qs.serve.common.util.AuthContextUtils;
import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.bms.entity.BmsSupplier;
import com.qs.serve.modules.bms.service.BmsSupplierService;
@ -27,6 +29,7 @@ import com.qs.serve.modules.vtb.service.VtbVerificationSubjectService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.qs.serve.modules.pay.entity.PayPayment;
import com.qs.serve.modules.pay.service.PayPaymentService;
@ -60,190 +63,143 @@ public class PayPaymentServiceImpl extends ServiceImpl<PayPaymentMapper,PayPayme
@Override
@Transactional(rollbackFor = Exception.class)
public PayPayment payment(PayPaymentBo paymentBo) {
LocalDateTime now = LocalDateTime.now();
String payType = paymentBo.getPayType();
if(!payType.equals(PaymentType.PAYMENT)&&!payType.equals(PaymentType.UN_PAYMENT)){
Assert.throwEx("param err P1 ");
}
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId());
PayPaymentAmountDto amountDto = this.getSupplierBalance(paymentBo.getSupplierId());
BigDecimal allowAmount = amountDto.getTotalAmount().subtract(amountDto.getHasPayment());
BmsSupplier supplier = supplierService.getById(paymentBo.getSupplierId());
//本次支付金额
BigDecimal currentAmount = paymentBo.getPayAmount();
//本次支付余额
BigDecimal currentBalance = paymentBo.getPayAmount();
if(currentAmount.compareTo(allowAmount)>0){
Assert.throwEx("支付不能超过待支付金额!");
}
//截断:添加历史金额支付记录
BigDecimal supplierHisAmount = supplier.getInitCurAmount();
PayHistoryItem historyItem = null;
if(supplierHisAmount.compareTo(BigDecimal.ZERO)>0){
historyItem = new PayHistoryItem();
historyItem.setPayType(payType);
historyItem.setSupplierId(paymentBo.getSupplierId());
historyItem.setRemark(paymentBo.getRemark());
if(supplierHisAmount.compareTo(currentAmount)>=0){
historyItem.setItemPayAmount(currentAmount);
supplier.setInitCurAmount(supplierHisAmount.subtract(currentAmount));
currentBalance = BigDecimal.ZERO;
}else {
historyItem.setItemPayAmount(supplierHisAmount);
supplier.setInitCurAmount(BigDecimal.ZERO);
currentBalance = currentAmount.subtract(supplierHisAmount);
Assert.throwEx("支付类型异常");
}
LambdaQueryWrapper<PayPayment> lqw = new LambdaQueryWrapper<>();
lqw.eq(PayPayment::getErpId,paymentBo.getErpId());
if(this.count(lqw)>0){
Assert.throwEx("已存在ERPID");
}
List<VtbVerificationSubject> verificationSubjectList = amountDto.getVerificationSubjectList();
List<PayPaymentItem> paymentItemList = new ArrayList<>();
List<VtbVerificationSubject> verificationSubjectUpdateList = new ArrayList<>();
for (VtbVerificationSubject verificationSubject : verificationSubjectList) {
if(currentBalance.compareTo(BigDecimal.ZERO)==0){
break;
SysUser sysUser = sysUserService.getByAccount(paymentBo.getUserCode());
if(sysUser==null){
Assert.throwEx("人员工号异常");
}
currentBalance = this.buildPaymentItems(paymentBo, currentBalance, paymentItemList, verificationSubjectUpdateList, verificationSubject);
if(payType.equals(PaymentType.PAYMENT)){
//TODO 保存支付记录
XltPaymentRecord paymentRecord = new XltPaymentRecord();
xiaoLuTonService.savePaymentRecord(paymentRecord);
}else if(payType.equals(PaymentType.UN_PAYMENT)){
//TODO 不再支付保存记录待定
VtbVerificationSubject verSubject = verificationSubjectService.getByVerificationSubjectCode(paymentBo.getVerificationSubCode());
if(verSubject==null){
Assert.throwEx("核销子项编码异常");
}
LambdaQueryWrapper<PayPaymentItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PayPaymentItem::getVerificationSubjectId,verSubject.getId());
List<PayPaymentItem> payPaymentItemList = paymentItemService.list(lambdaQueryWrapper);
BigDecimal payedAmount = payPaymentItemList.stream().map(a->a.getItemPayAmount()).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal notPayAmount = verSubject.getUsedAmount().subtract(payedAmount);
if(paymentBo.getPayAmount().compareTo(notPayAmount)>0){
Assert.throwEx("支付金额已超出可支付额");
}
PayPayment payPayment = new PayPayment();
payPayment.setPayType(payType);
payPayment.setPayCode("PM"+ StringUtils.genShortId());
payPayment.setSupplierId(paymentBo.getSupplierId());
payPayment.setSupplierCode(supplier.getCode());
payPayment.setSupplierName(supplier.getName());
payPayment.setPayType(paymentBo.getPayType());
payPayment.setPayCode(paymentBo.getErpId());
payPayment.setSupplierId(verSubject.getSupplierId());
payPayment.setSupplierCode(verSubject.getSupplierCode());
payPayment.setSupplierName(verSubject.getSupplierName());
payPayment.setPayAmount(paymentBo.getPayAmount());
payPayment.setUserId(sysUser.getId());
payPayment.setUserCode(sysUser.getCode());
payPayment.setUserName(sysUser.getName());
payPayment.setPayTime(paymentBo.getPayTime());
payPayment.setPayDate(paymentBo.getPayDate());
payPayment.setBillNumber(paymentBo.getBillNumber());
payPayment.setRemark(paymentBo.getRemark());
payPayment.setPayTime(LocalDateTime.now());
payPayment.setErpCode(paymentBo.getErpCode());
payPayment.setTenantId("001");
payPayment.setCostApplyId(verSubject.getCostApplyId());
payPayment.setErpId(paymentBo.getErpId());
PayPaymentItem payPaymentItem = new PayPaymentItem();
payPaymentItem = CopierUtil.copy(payPayment,payPaymentItem);
payPaymentItem.setItemPayAmount(payPayment.getPayAmount());
payPaymentItem.setVerificationId(verSubject.getVerificationId());
payPaymentItem.setVerificationSubjectId(verSubject.getId());
payPaymentItem.setActivityId(verSubject.getActivityId());
payPaymentItem.setSubjectCode(verSubject.getSubjectCode());
payPaymentItem.setSubjectId(verSubject.getSubjectId());
payPaymentItem.setSubjectName(verSubject.getSubjectName());
payPaymentItem.setRemark(payPayment.getRemark());
this.save(payPayment);
//保存历史金额
if(historyItem!=null){
historyItem.setPaymentId(payPayment.getId());
payHistoryItemService.save(historyItem);
}
//关联活动编码
if(paymentItemList.size()>0){
List<Long> actIds = paymentItemList.stream().map(PayPaymentItem::getActivityId).distinct().collect(Collectors.toList());
List<TbsActivity> activityList = activityService.listByIds(actIds);
for (PayPaymentItem paymentItem : paymentItemList) {
for (TbsActivity activity : activityList) {
if(activity.getId().equals(paymentItem.getActivityId())){
paymentItem.setActivityCode(activity.getActivityCode());
break;
}
}
paymentItem.setPaymentId(payPayment.getId());
}
paymentItemService.saveBatch(paymentItemList);
}
if(verificationSubjectUpdateList.size()>0){
verificationSubjectService.updateBatchById(verificationSubjectUpdateList);
}
payPaymentItem.setPaymentId(payPayment.getId());
paymentItemService.save(payPaymentItem);
return payPayment;
}
/**
* 构建支付明细
* @param paymentBo
* @param currentBalance
* @param paymentItemList
* @param verificationSubjectUpdateList
* @param verificationSubject
* @return currentBalance 本次支付余额
*/
@NotNull
private BigDecimal buildPaymentItems(PayPaymentBo paymentBo, BigDecimal currentBalance, List<PayPaymentItem> paymentItemList, List<VtbVerificationSubject> verificationSubjectUpdateList, VtbVerificationSubject verificationSubject) {
//统计历史支付金额
BigDecimal hisPayAmount = BigDecimal.ZERO;
List<PayPaymentItem> payPaymentItems = paymentItemService.listByVerSubjectId(verificationSubject.getId());
for (PayPaymentItem paymentItem : payPaymentItems) {
hisPayAmount = hisPayAmount.add(paymentItem.getItemPayAmount());
}
//当前项未支付
BigDecimal shouldPay = verificationSubject.getUsedAmount().subtract(hisPayAmount);
//当前项支付金额
BigDecimal currentItemPay;
if(currentBalance.compareTo(shouldPay)>0){
currentItemPay = shouldPay;
currentBalance = currentBalance.subtract(shouldPay);
}else {
currentItemPay = currentBalance;
currentBalance = BigDecimal.ZERO;
}
PayPaymentItem paymentItem = new PayPaymentItem();
paymentItem.setPayType(paymentBo.getPayType());
paymentItem.setSupplierId(paymentBo.getSupplierId());
paymentItem.setItemPayAmount(currentItemPay);
paymentItem.setVerificationId(verificationSubject.getVerificationId());
paymentItem.setVerificationSubjectId(verificationSubject.getId());
paymentItem.setCostApplyId(verificationSubject.getCostApplyId());
paymentItem.setActivityId(verificationSubject.getActivityId());
paymentItem.setSubjectId(verificationSubject.getSubjectId());
paymentItem.setSubjectCode(verificationSubject.getSubjectCode());
paymentItem.setSubjectName(verificationSubject.getSubjectName());
paymentItemList.add(paymentItem);
//更新核销科目余额
BigDecimal payAmountOfVer = verificationSubject.getPayAmount().add(currentItemPay);
VtbVerificationSubject subjectParam = new VtbVerificationSubject();
subjectParam.setId(verificationSubject.getId());
subjectParam.setPayAmount(payAmountOfVer);
if(verificationSubject.getUsedAmount().compareTo(payAmountOfVer)==0){
subjectParam.setPayFinishedFlag(1);
}
verificationSubjectUpdateList.add(subjectParam);
return currentBalance;
}
// /**
// * 构建支付明细
// * @param paymentBo
// * @param currentBalance
// * @param paymentItemList
// * @param verificationSubjectUpdateList
// * @param verificationSubject
// * @return currentBalance 本次支付余额
// */
// @NotNull
// private BigDecimal buildPaymentItems(PayPaymentBo paymentBo, BigDecimal currentBalance, List<PayPaymentItem> paymentItemList, List<VtbVerificationSubject> verificationSubjectUpdateList, VtbVerificationSubject verificationSubject) {
// //统计历史支付金额
// BigDecimal hisPayAmount = BigDecimal.ZERO;
// List<PayPaymentItem> payPaymentItems = paymentItemService.listByVerSubjectId(verificationSubject.getId());
// for (PayPaymentItem paymentItem : payPaymentItems) {
// hisPayAmount = hisPayAmount.add(paymentItem.getItemPayAmount());
// }
// //当前项未支付
// BigDecimal shouldPay = verificationSubject.getUsedAmount().subtract(hisPayAmount);
// //当前项支付金额
// BigDecimal currentItemPay;
// if(currentBalance.compareTo(shouldPay)>0){
// currentItemPay = shouldPay;
// currentBalance = currentBalance.subtract(shouldPay);
// }else {
// currentItemPay = currentBalance;
// currentBalance = BigDecimal.ZERO;
// }
// PayPaymentItem paymentItem = new PayPaymentItem();
// paymentItem.setPayType(paymentBo.getPayType());
// paymentItem.setSupplierId(paymentBo.getSupplierId());
// paymentItem.setItemPayAmount(currentItemPay);
// paymentItem.setVerificationId(verificationSubject.getVerificationId());
// paymentItem.setVerificationSubjectId(verificationSubject.getId());
// paymentItem.setCostApplyId(verificationSubject.getCostApplyId());
// paymentItem.setActivityId(verificationSubject.getActivityId());
// paymentItem.setSubjectId(verificationSubject.getSubjectId());
// paymentItem.setSubjectCode(verificationSubject.getSubjectCode());
// paymentItem.setSubjectName(verificationSubject.getSubjectName());
// paymentItemList.add(paymentItem);
// //更新核销科目余额
// BigDecimal payAmountOfVer = verificationSubject.getPayAmount().add(currentItemPay);
// VtbVerificationSubject subjectParam = new VtbVerificationSubject();
// subjectParam.setId(verificationSubject.getId());
// subjectParam.setPayAmount(payAmountOfVer);
// if(verificationSubject.getUsedAmount().compareTo(payAmountOfVer)==0){
// subjectParam.setPayFinishedFlag(1);
// }
// verificationSubjectUpdateList.add(subjectParam);
// return currentBalance;
// }
@Override
@Transactional(rollbackFor = Exception.class)
public void cancel(Long id) {
PayPayment dbPay = this.getById(id);
if(dbPay.getCancelFlag().equals(1)){
Assert.throwEx("已取消,请勿重复提交");
}
List<PayPaymentItem> paymentItemList = paymentItemService.listByPaymentId(id);
List<PayHistoryItem> historyItemList = payHistoryItemService.listByPaymentId(id);
List<Long> historyItemIds = historyItemList.stream().map(PayHistoryItem::getId)
.distinct().collect(Collectors.toList());
List<Long> paymentItemIds = paymentItemList.stream().map(PayPaymentItem::getId)
.distinct().collect(Collectors.toList());
List<Long> verSubjectIds = paymentItemList.stream().map(PayPaymentItem::getVerificationSubjectId)
.distinct().collect(Collectors.toList());
List<VtbVerificationSubject> verificationSubjectList = verificationSubjectService.listByIds(verSubjectIds);
for (VtbVerificationSubject verificationSubject : verificationSubjectList) {
for (PayPaymentItem paymentItem : paymentItemList) {
if(verificationSubject.getId().equals(paymentItem.getVerificationSubjectId())){
BigDecimal payAmount = verificationSubject.getPayAmount().subtract(paymentItem.getItemPayAmount());
verificationSubject.setPayAmount(payAmount);
}
}
public void cancel(String erpId) {
PayPayment dbPay = this.baseMapper.getByErpId(erpId);
if(dbPay==null){
Assert.throwEx("没有该支付数据!");
}
List<VtbVerificationSubject> verificationSubjectUpdateList = verificationSubjectList.stream().map(obj->{
VtbVerificationSubject param = new VtbVerificationSubject();
param.setId(obj.getId());
param.setPayAmount(obj.getPayAmount());
param.setPayFinishedFlag(0);
return param;
}).collect(Collectors.toList());
//更新数据
PayPayment payPayment = new PayPayment();
payPayment.setId(id);
payPayment.setCancelFlag(1);
payPayment.setCancelTime(LocalDateTime.now());
this.updateById(payPayment);
paymentItemService.removeBatchByIds(paymentItemIds);
payHistoryItemService.removeBatchByIds(historyItemIds);
verificationSubjectService.updateBatchById(verificationSubjectUpdateList);
LambdaQueryWrapper<PayPayment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PayPayment::getErpId,erpId);
this.remove(lambdaQueryWrapper);
LambdaQueryWrapper<PayPaymentItem> paymentItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
paymentItemLambdaQueryWrapper.eq(PayPaymentItem::getErpId,erpId);
paymentItemService.remove(paymentItemLambdaQueryWrapper);
}
@Override

2
src/main/java/com/qs/serve/modules/vtb/service/VtbVerificationSubjectService.java

@ -16,5 +16,7 @@ public interface VtbVerificationSubjectService extends IService<VtbVerificationS
void removeByVerificationId(Long verificationId);
VtbVerificationSubject getByVerificationSubjectCode(String verificationSubjectCode);
}

6
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationSubjectServiceImpl.java

@ -35,5 +35,11 @@ public class VtbVerificationSubjectServiceImpl extends ServiceImpl<VtbVerificati
this.remove(lqw);
}
@Override
public VtbVerificationSubject getByVerificationSubjectCode(String verificationSubjectCode) {
LambdaQueryWrapper<VtbVerificationSubject> lqw = new LambdaQueryWrapper<>();
lqw.eq(VtbVerificationSubject::getVerificationSubCode,verificationSubjectCode);
return this.getOne(lqw);
}
}

Loading…
Cancel
Save