fix:获取云流水免登token接口处理不存在老店数据的门店

This commit is contained in:
wangff
2025-11-03 14:57:13 +08:00
parent 22e7aa07e8
commit c0d76eda61
3 changed files with 23 additions and 1 deletions

View File

@@ -40,4 +40,8 @@ public class OldShopDAO {
List<OldShopDO> list = oldShopMapper.selectByExample(example); List<OldShopDO> list = oldShopMapper.selectByExample(example);
return list.isEmpty() ? null : list.get(0); return list.isEmpty() ? null : list.get(0);
} }
public void insertSelective(OldShopDO oldShopDO) {
oldShopMapper.insertSelective(oldShopDO);
}
} }

View File

@@ -1,13 +1,19 @@
package com.cool.store.entity; package com.cool.store.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
@Data @Data
@Table(name = "xfsg_old_shop") @Table(name = "xfsg_old_shop")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class OldShopDO { public class OldShopDO {
/** /**

View File

@@ -59,6 +59,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
ThirdXinGuanJiaService thirdXinGuanJiaService; ThirdXinGuanJiaService thirdXinGuanJiaService;
@Resource @Resource
private LineInfoDAO lineInfoDAO; private LineInfoDAO lineInfoDAO;
@Resource
private StoreDao storeDao;
@Override @Override
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) { public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
@@ -311,7 +313,17 @@ public class ShopAccountServiceImpl implements ShopAccountService {
//查询老店关联表数据 //查询老店关联表数据
OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode); OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode);
if (Objects.isNull(oldShopDO)) { 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(); return oldShopDO.getYlsShopCode();
} }