Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7856d6fa8f | ||
|
|
a16bc85a5e | ||
|
|
8a5c145c49 | ||
|
|
ff3bd85992 |
@@ -57,6 +57,7 @@ dk.loan.amount.notGe=\u8D37\u6B3E\u91D1\u989D\u4E0D\u80FD\u5927\u4E8E
|
|||||||
dk.loan.auditing=\u5BA1\u6838\u4E2D
|
dk.loan.auditing=\u5BA1\u6838\u4E2D
|
||||||
dk.loan.auditing.remark=\u5BA1\u6838\u4E2D...
|
dk.loan.auditing.remark=\u5BA1\u6838\u4E2D...
|
||||||
dk.withdraw.account.error=\u63D0\u73B0\u5931\u8D25\uFF0C\u8D26\u53F7\u5F02\u5E38
|
dk.withdraw.account.error=\u63D0\u73B0\u5931\u8D25\uFF0C\u8D26\u53F7\u5F02\u5E38
|
||||||
|
dk.withdraw.account.noStatus=\u63D0\u73B0\u5931\u8D25\uFF0C\u8BF7\u5148\u7533\u8BF7\u8D37\u6B3E
|
||||||
dk.withdraw.balance.not.enough.error=\u4F59\u989D\u4E0D\u8DB3
|
dk.withdraw.balance.not.enough.error=\u4F59\u989D\u4E0D\u8DB3
|
||||||
dk.withdraw.fail=\u63D0\u73B0\u5931\u8D25
|
dk.withdraw.fail=\u63D0\u73B0\u5931\u8D25
|
||||||
dk.withdraw.ing=\u63D0\u73B0\u4E2D
|
dk.withdraw.ing=\u63D0\u73B0\u4E2D
|
||||||
@@ -64,10 +65,11 @@ dk.withdraw.remark=\u63D0\u73B0\u4E2D...
|
|||||||
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
||||||
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
||||||
|
|
||||||
|
dk.borrow.push.not=\u672A\u63D0\u4EA4
|
||||||
dk.borrow.push.success=\u63D0\u4EA4\u6210\u529F
|
dk.borrow.push.success=\u63D0\u4EA4\u6210\u529F
|
||||||
dk.borrow.auditing=\u6B63\u5728\u5BA1\u6838
|
dk.borrow.auditing=\u6B63\u5728\u5BA1\u6838
|
||||||
dk.borrow.account.success=\u5230\u8D26\u6210\u529F
|
dk.borrow.account.success=\u5230\u8D26\u6210\u529F
|
||||||
dk.borrow.accounting.remark=\u60A8\u7684\u4E2A\u4EBA\u4FE1\u7528\u8D37\u6B3E\u6B63\u5728\u5BA1\u6838\uFF0C\u8BF7\u7559\u610F\u60A8\u7684\u5BA1\u6838\u72B6\u6001\uFF01\u5982\u6709\u7591\u95EE\uFF0C\u8BF7\u8054\u7CFB\u4E1A\u52A1\u5458\u54A8\u8BE2\u2026
|
dk.borrow.accounting.remark=\u8BF7\u60A8\u5B8C\u5584\u8D44\u6599,\u63D0\u4EA4\u7533\u8BF7
|
||||||
dk.borrow.contract.error=\u501F\u6B3E\u4E0D\u5B58\u5728
|
dk.borrow.contract.error=\u501F\u6B3E\u4E0D\u5B58\u5728
|
||||||
|
|
||||||
dk.customer.update.having.loans=\u8D37\u6B3E\u5DF2\u63D0\u4EA4\u65E0\u6CD5\u4FEE\u6539\u4FE1\u606F\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D
|
dk.customer.update.having.loans=\u8D37\u6B3E\u5DF2\u63D0\u4EA4\u65E0\u6CD5\u4FEE\u6539\u4FE1\u606F\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ dk.withdraw.remark=Withdrawal in progress...
|
|||||||
dk.withdraw.code.null=Please enter withdrawal code
|
dk.withdraw.code.null=Please enter withdrawal code
|
||||||
dk.withdraw.code.error=Withdrawal code error
|
dk.withdraw.code.error=Withdrawal code error
|
||||||
|
|
||||||
|
dk.borrow.push.not=not submit
|
||||||
dk.borrow.push.success=Submission successful
|
dk.borrow.push.success=Submission successful
|
||||||
dk.borrow.auditing=Currently under review
|
dk.borrow.auditing=Currently under review
|
||||||
dk.borrow.account.success=Amount successfully credited
|
dk.borrow.account.success=Amount successfully credited
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ dk.withdraw.remark=\u0928\u093F\u0915\u093E\u0938\u0940 \u092A\u094D\u0930\u0915
|
|||||||
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
||||||
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
||||||
|
|
||||||
|
dk.borrow.push.not=\u672A\u63D0\u4EA4
|
||||||
dk.borrow.push.success=\u0938\u092B\u0932\u0924\u093E\u092A\u0942\u0930\u094D\u0935\u0915 \u092A\u094D\u0930\u0938\u094D\u0924\u0941\u0924
|
dk.borrow.push.success=\u0938\u092B\u0932\u0924\u093E\u092A\u0942\u0930\u094D\u0935\u0915 \u092A\u094D\u0930\u0938\u094D\u0924\u0941\u0924
|
||||||
dk.borrow.auditing=\u0938\u092E\u0940\u0915\u094D\u0937\u093E \u0915\u0947 \u0905\u0927\u0940\u0928 \u0939\u0948
|
dk.borrow.auditing=\u0938\u092E\u0940\u0915\u094D\u0937\u093E \u0915\u0947 \u0905\u0927\u0940\u0928 \u0939\u0948
|
||||||
dk.borrow.account.success=\u0939\u093F\u0938\u093E\u092C \u0938\u092B\u0932
|
dk.borrow.account.success=\u0939\u093F\u0938\u093E\u092C \u0938\u092B\u0932
|
||||||
|
|||||||
@@ -64,10 +64,11 @@ dk.withdraw.remark=\u63D0\u73B0\u4E2D...
|
|||||||
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
dk.withdraw.code.null=\u8BF7\u8F93\u5165\u63D0\u73B0\u7801
|
||||||
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
dk.withdraw.code.error=\u63D0\u73B0\u7801\u9519\u8BEF
|
||||||
|
|
||||||
|
dk.borrow.push.not=\u672A\u63D0\u4EA4
|
||||||
dk.borrow.push.success=\u63D0\u4EA4\u6210\u529F
|
dk.borrow.push.success=\u63D0\u4EA4\u6210\u529F
|
||||||
dk.borrow.auditing=\u6B63\u5728\u5BA1\u6838
|
dk.borrow.auditing=\u6B63\u5728\u5BA1\u6838
|
||||||
dk.borrow.account.success=\u5230\u8D26\u6210\u529F
|
dk.borrow.account.success=\u5230\u8D26\u6210\u529F
|
||||||
dk.borrow.accounting.remark=\u60A8\u7684\u4E2A\u4EBA\u4FE1\u7528\u8D37\u6B3E\u6B63\u5728\u5BA1\u6838\uFF0C\u8BF7\u7559\u610F\u60A8\u7684\u5BA1\u6838\u72B6\u6001\uFF01\u5982\u6709\u7591\u95EE\uFF0C\u8BF7\u8054\u7CFB\u4E1A\u52A1\u5458\u54A8\u8BE2\u2026
|
dk.borrow.accounting.remark=\u8BF7\u60A8\u5B8C\u5584\u8D44\u6599,\u63D0\u4EA4\u7533\u8BF7
|
||||||
dk.borrow.contract.error=\u501F\u6B3E\u4E0D\u5B58\u5728
|
dk.borrow.contract.error=\u501F\u6B3E\u4E0D\u5B58\u5728
|
||||||
|
|
||||||
dk.customer.update.having.loans=\u8D37\u6B3E\u5DF2\u63D0\u4EA4\u65E0\u6CD5\u4FEE\u6539\u4FE1\u606F\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D
|
dk.customer.update.having.loans=\u8D37\u6B3E\u5DF2\u63D0\u4EA4\u65E0\u6CD5\u4FEE\u6539\u4FE1\u606F\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D
|
||||||
|
|||||||
@@ -191,33 +191,34 @@ public class BorrowServiceImpl extends ServiceImpl<BorrowMapper, Borrow> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void withdraw(Double withdrawAmount, Long customerId) {
|
public void withdraw(Double withdrawAmount, Long customerId) {
|
||||||
|
Customer customer = customerService.getById(customerId);
|
||||||
|
if(customer.getAccount().doubleValue() < withdrawAmount){
|
||||||
|
throw new CustomException(MessageUtils.message("dk.withdraw.balance.not.enough.error"));
|
||||||
|
}
|
||||||
|
if(BooleanUtils.isNotTrue(customer.getAllowWithdrawFlag())){
|
||||||
|
throw new CustomException(MessageUtils.message("dk.withdraw.account.error"));
|
||||||
|
}
|
||||||
Borrow borrow = this.getByCustomerId(customerId);
|
Borrow borrow = this.getByCustomerId(customerId);
|
||||||
if(borrow == null){
|
if(borrow == null){
|
||||||
throw new CustomException(MessageUtils.message("dk.withdraw.account.error"));
|
throw new CustomException(MessageUtils.message("dk.withdraw.account.noStatus"));
|
||||||
}
|
}
|
||||||
if(borrow.getBorrowStatusId() != null){
|
if(borrow.getBorrowStatusId() != null){
|
||||||
BorrowStatus borrowStatus = borrowStatusService.getById(borrow.getBorrowStatusId());
|
BorrowStatus borrowStatus = borrowStatusService.getById(borrow.getBorrowStatusId());
|
||||||
if(borrowStatus != null){
|
if(borrowStatus != null){
|
||||||
if(BooleanUtils.isFalse(borrowStatus.getWithdrawFlag())){
|
if(BooleanUtils.isFalse(borrowStatus.getWithdrawFlag())){
|
||||||
throw new CustomException(MessageUtils.message("dk.withdraw.account.error"));
|
throw new CustomException(borrowStatus.getBorrowRemark());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Customer customer = customerService.getById(customerId);
|
|
||||||
if(BooleanUtils.isNotTrue(customer.getAllowWithdrawFlag())){
|
|
||||||
throw new CustomException(MessageUtils.message("dk.withdraw.account.error"));
|
|
||||||
}
|
|
||||||
if(customer.getAccount().doubleValue() < withdrawAmount){
|
|
||||||
throw new CustomException(MessageUtils.message("dk.withdraw.balance.not.enough.error"));
|
|
||||||
}
|
|
||||||
Borrow one = this.getOne(Wrappers.lambdaQuery(Borrow.class).eq(Borrow::getCustomerId,customerId));
|
Borrow one = this.getOne(Wrappers.lambdaQuery(Borrow.class).eq(Borrow::getCustomerId,customerId));
|
||||||
if(one == null){
|
if(one == null){
|
||||||
throw new CustomException(MessageUtils.message("dk.withdraw.fail"));
|
throw new CustomException(MessageUtils.message("dk.withdraw.fail"));
|
||||||
}
|
}
|
||||||
if(!MessageUtils.message("dk.audit.success").equals(one.getBorrowName())){
|
/*if(!MessageUtils.message("dk.audit.success").equals(one.getBorrowName())){
|
||||||
throw new CustomException(one.getBorrowName());
|
throw new CustomException(one.getBorrowName());
|
||||||
}
|
}*/
|
||||||
boolean result = customerService.withdraw(customerId,withdrawAmount);
|
boolean result = customerService.withdraw(customerId,withdrawAmount);
|
||||||
Borrow update = new Borrow();
|
Borrow update = new Borrow();
|
||||||
update.setId(one.getId());
|
update.setId(one.getId());
|
||||||
@@ -244,7 +245,7 @@ public class BorrowServiceImpl extends ServiceImpl<BorrowMapper, Borrow> impleme
|
|||||||
LoanProcessResp resp = new LoanProcessResp();
|
LoanProcessResp resp = new LoanProcessResp();
|
||||||
List<BorrowStepResp> borrowStep = new ArrayList<>();
|
List<BorrowStepResp> borrowStep = new ArrayList<>();
|
||||||
if(one == null){
|
if(one == null){
|
||||||
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.push.success"),false));
|
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.push.not"),false));
|
||||||
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.auditing"),false));
|
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.auditing"),false));
|
||||||
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.account.success"),false));
|
borrowStep.add(new BorrowStepResp(MessageUtils.message("dk.borrow.account.success"),false));
|
||||||
resp.setBorrowStep(borrowStep);
|
resp.setBorrowStep(borrowStep);
|
||||||
|
|||||||
Reference in New Issue
Block a user