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

This commit is contained in:
Tankaikai
2024-11-25 11:02:03 +08:00
2 changed files with 45 additions and 43 deletions

View File

@@ -637,7 +637,7 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
flow.setBizName("会员储值卡退款");
flow.setType("+");
flow.setAmount(returnAmount);
flow.setBalance(user.getAmount());
flow.setBalance(user.getAmount().add(returnAmount));
flow.setCreateTime(cn.hutool.core.date.DateUtil.date().toTimestamp());
flow.setIsReturn("0");
tbShopUserFlowMapper.insert(flow);

View File

@@ -49,9 +49,9 @@ import java.time.Instant;
import java.util.*;
/**
* @author lyf
* @website https://eladmin.vip
* @description 服务实现
* @author lyf
* @date 2023-11-07
**/
@Service
@@ -86,9 +86,11 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
public JSONObject binding(BindingDto bindingDto) {
TbShopInfo tbShopInfo = tbShopInfoRepository.findById(bindingDto.getShopId()).orElseGet(null);
TbMerchantAccount account = merchantAccountRepository.findByAccount(tbShopInfo.getAccount());
boolean isNew = true;
if (org.apache.commons.lang3.StringUtils.isBlank(bindingDto.getAccount())) {
if (tbShopInfo != null) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(account.getBindAccount())) {
isNew = false;
bindingDto.setAccount(account.getBindAccount());
} else {
return null;
@@ -98,7 +100,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
Map<String, Object> param = new HashMap<>();
param.put("account", bindingDto.getAccount());
JSONObject data = bindService.binding(param);
if (org.apache.commons.lang3.StringUtils.isNotBlank(bindingDto.getAccount())) {
if (isNew) {
account.setBindAccount(bindingDto.getAccount());
account.setArticle(bindingDto.getArticle());
account.setTaxAmount(bindingDto.getTaxAmount());