From 80e0567257d6dba6df2d164776e1eb88921cfe13 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 19 May 2022 16:13:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HighMerchantStoreServiceImpl.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java index e1c3de96..a6355805 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java @@ -11,10 +11,9 @@ import com.hai.common.utils.CoordCommonUtil; import com.hai.common.utils.MD5Util; import com.hai.config.SpPrinterConfig; import com.hai.dao.HighMerchantStoreMapper; -import com.hai.entity.HighMerchantStore; -import com.hai.entity.HighMerchantStoreExample; -import com.hai.entity.SecUser; +import com.hai.entity.*; import com.hai.model.HighMerchantStoreModel; +import com.hai.service.HighMerchantStoreAccountService; import com.hai.service.HighMerchantStoreService; import com.hai.service.SecUserService; import org.apache.commons.collections4.MapUtils; @@ -25,6 +24,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.Comparator; import java.util.Date; import java.util.List; @@ -41,6 +41,9 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService { @Resource private SecUserService secUserService; + @Resource + private HighMerchantStoreAccountService merchantStoreAccountService; + @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public void insertMerchantStore(HighMerchantStoreModel highMerchantStore) throws Exception { @@ -72,6 +75,18 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, jsonObject.getString("errormsg")); } } + + // 预存类型 0:非预存 1:预存门店 + if (highMerchantStore.getPrestoreType().equals(1)) { + // 是否开通了账户 + HighMerchantStoreAccount account = merchantStoreAccountService.getStoreAccountDetail(highMerchantStore.getId()); + if (account == null) { + account = new HighMerchantStoreAccount(); + account.setStoreId(highMerchantStore.getId()); + account.setAmounts(new BigDecimal("0")); + merchantStoreAccountService.editStoreAccount(account); + } + } } @Override