feat:askbot 门店获取方式变更

This commit is contained in:
苏竹红
2025-05-12 10:38:19 +08:00
parent 66202bfca8
commit b15c9eed79
7 changed files with 45 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Repository @Repository
@@ -55,6 +56,12 @@ public class StoreDao {
return storeMapper.getByStoreNum(storeNum); return storeMapper.getByStoreNum(storeNum);
} }
public List<StoreDO> listByMobile(String mobile) {
if(StringUtils.isBlank(mobile)) {
return new ArrayList<>();
}
return storeMapper.listByMobile(mobile);
}
} }

View File

@@ -24,4 +24,11 @@ public interface StoreMapper {
StoreDO getByStoreNum(@Param("storeNum") String storeNum); StoreDO getByStoreNum(@Param("storeNum") String storeNum);
/**
* 查询自定义字段含有该手机号的门店
* @param mobile
* @return
*/
List<StoreDO> listByMobile(@Param("mobile") String mobile);
} }

View File

@@ -441,7 +441,8 @@
<select id="getShopListSuccessOpen" resultType="com.cool.store.response.MiniShopsResponse"> <select id="getShopListSuccessOpen" resultType="com.cool.store.response.MiniShopsResponse">
select a.shop_name as shopName, select a.shop_name as shopName,
a.id as shopId, a.id as shopId,
a.shop_code as shopCode a.shop_code as shopCode,
a.detail_address as detailAddress
from xfsg_shop_info a from xfsg_shop_info a
inner join store_${eid} c on a.shop_code = c.store_num inner join store_${eid} c on a.shop_code = c.store_num
where a.line_id = #{lineId} where a.line_id = #{lineId}

View File

@@ -79,4 +79,14 @@
where store_num = #{storeNum} where store_num = #{storeNum}
</select> </select>
<select id="listByMobile" resultMap="BaseResultMap">
select *
from store_${enterpriseId}
<where>
<if test="mobile!=null and mobile !=''">
and `extend_field` like concat('%', #{mobile}, '%')
</if>
</where>
</select>
</mapper> </mapper>

View File

@@ -17,4 +17,7 @@ public class ShopNameAndCodeDTO {
@ApiModelProperty("店铺编码") @ApiModelProperty("店铺编码")
private String shopCode; private String shopCode;
@ApiModelProperty("店铺地址")
private String shopAddress;
} }

View File

@@ -16,4 +16,6 @@ public class MiniShopsResponse {
private String shopName; private String shopName;
@ApiModelProperty("店铺编码") @ApiModelProperty("店铺编码")
private String shopCode; private String shopCode;
@ApiModelProperty("店铺详细地址")
private String detailAddress;
} }

View File

@@ -96,6 +96,8 @@ public class ShopServiceImpl implements ShopService {
ShopAccountDAO shopAccountDAO; ShopAccountDAO shopAccountDAO;
@Resource @Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO; HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Resource
StoreDao storeDao;
@Override @Override
@@ -599,6 +601,7 @@ public class ShopServiceImpl implements ShopService {
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO(); ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
dto.setShopName(shopInfoDO.getShopName()); dto.setShopName(shopInfoDO.getShopName());
dto.setShopCode(shopInfoDO.getShopCode()); dto.setShopCode(shopInfoDO.getShopCode());
dto.setShopAddress(shopInfoDO.getDetailAddress());
list.add(dto); list.add(dto);
} }
Map<Long, MiniShopsResponse> shopMap = shopList.stream().collect(Collectors.toMap(MiniShopsResponse::getShopId, Function.identity())); Map<Long, MiniShopsResponse> shopMap = shopList.stream().collect(Collectors.toMap(MiniShopsResponse::getShopId, Function.identity()));
@@ -607,18 +610,19 @@ public class ShopServiceImpl implements ShopService {
ShopNameAndCodeDTO currentShop = new ShopNameAndCodeDTO(); ShopNameAndCodeDTO currentShop = new ShopNameAndCodeDTO();
currentShop.setShopName(shopMap.get(shopId).getShopName()); currentShop.setShopName(shopMap.get(shopId).getShopName());
currentShop.setShopCode(shopMap.get(shopId).getShopCode()); currentShop.setShopCode(shopMap.get(shopId).getShopCode());
currentShop.setShopAddress(shopMap.get(shopId).getDetailAddress());
response.setCurrentShop(currentShop); response.setCurrentShop(currentShop);
} }
} }
List<OldShopDO> oldMobile = oldShopDAO.getByMobile(lineInfoDO.getMobile()); List<StoreDO> storeDOS = storeDao.listByMobile(lineInfoDO.getMobile());
if (CollectionUtils.isNotEmpty(oldMobile)) { storeDOS.stream().forEach(x->{
for (OldShopDO oldShopDO : oldMobile) { ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO(); dto.setShopName(x.getStoreName());
dto.setShopName(oldShopDO.getShopName()); dto.setShopCode(x.getStoreNum());
dto.setShopCode(oldShopDO.getShopCode()); dto.setShopAddress(x.getStoreAddress());
list.add(dto); list.add(dto);
} });
}
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@@ -631,8 +635,8 @@ public class ShopServiceImpl implements ShopService {
)) ))
.values()); .values());
response.setShopList(distinctList); response.setShopList(distinctList);
log.info("shopInfo{}",JSONObject.toJSONString(response));
return response; return response;
} }
@Override @Override