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