fix:获取云流水免登token接口处理不存在老店数据的门店
This commit is contained in:
@@ -40,4 +40,8 @@ public class OldShopDAO {
|
||||
List<OldShopDO> list = oldShopMapper.selectByExample(example);
|
||||
return list.isEmpty() ? null : list.get(0);
|
||||
}
|
||||
|
||||
public void insertSelective(OldShopDO oldShopDO) {
|
||||
oldShopMapper.insertSelective(oldShopDO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Table(name = "xfsg_old_shop")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OldShopDO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,6 +59,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
||||
ThirdXinGuanJiaService thirdXinGuanJiaService;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
|
||||
@Override
|
||||
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
||||
@@ -311,7 +313,17 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
||||
//查询老店关联表数据
|
||||
OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode);
|
||||
if (Objects.isNull(oldShopDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_YLS_CODE_FAIL);
|
||||
StoreDO storeDO = storeDao.getByStoreNum(shopCode);
|
||||
if (Objects.isNull(storeDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_YLS_CODE_FAIL);
|
||||
}
|
||||
oldShopDO = OldShopDO.builder()
|
||||
.shopCode(shopCode)
|
||||
.shopName(storeDO.getStoreName())
|
||||
.mobile(storeDO.getTelephone())
|
||||
.ylsShopCode("ZXA8_" + shopCode)
|
||||
.build();
|
||||
oldShopDAO.insertSelective(oldShopDO);
|
||||
}
|
||||
return oldShopDO.getYlsShopCode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user