提交代码

dev-discount
胡锐 3 years ago
parent abbfe7b697
commit 80e0567257
  1. 21
      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.common.utils.MD5Util;
import com.hai.config.SpPrinterConfig; import com.hai.config.SpPrinterConfig;
import com.hai.dao.HighMerchantStoreMapper; import com.hai.dao.HighMerchantStoreMapper;
import com.hai.entity.HighMerchantStore; import com.hai.entity.*;
import com.hai.entity.HighMerchantStoreExample;
import com.hai.entity.SecUser;
import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighMerchantStoreModel;
import com.hai.service.HighMerchantStoreAccountService;
import com.hai.service.HighMerchantStoreService; import com.hai.service.HighMerchantStoreService;
import com.hai.service.SecUserService; import com.hai.service.SecUserService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -25,6 +24,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -41,6 +41,9 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
@Resource @Resource
private SecUserService secUserService; private SecUserService secUserService;
@Resource
private HighMerchantStoreAccountService merchantStoreAccountService;
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertMerchantStore(HighMerchantStoreModel highMerchantStore) throws Exception { 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")); 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 @Override

Loading…
Cancel
Save