feat:askbot 门店获取方式变更
This commit is contained in:
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@@ -55,6 +56,12 @@ public class StoreDao {
|
||||
return storeMapper.getByStoreNum(storeNum);
|
||||
}
|
||||
|
||||
public List<StoreDO> listByMobile(String mobile) {
|
||||
if(StringUtils.isBlank(mobile)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return storeMapper.listByMobile(mobile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,4 +24,11 @@ public interface StoreMapper {
|
||||
|
||||
StoreDO getByStoreNum(@Param("storeNum") String storeNum);
|
||||
|
||||
/**
|
||||
* 查询自定义字段含有该手机号的门店
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
List<StoreDO> listByMobile(@Param("mobile") String mobile);
|
||||
|
||||
}
|
||||
|
||||
@@ -441,7 +441,8 @@
|
||||
<select id="getShopListSuccessOpen" resultType="com.cool.store.response.MiniShopsResponse">
|
||||
select a.shop_name as shopName,
|
||||
a.id as shopId,
|
||||
a.shop_code as shopCode
|
||||
a.shop_code as shopCode,
|
||||
a.detail_address as detailAddress
|
||||
from xfsg_shop_info a
|
||||
inner join store_${eid} c on a.shop_code = c.store_num
|
||||
where a.line_id = #{lineId}
|
||||
|
||||
@@ -79,4 +79,14 @@
|
||||
where store_num = #{storeNum}
|
||||
</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>
|
||||
|
||||
@@ -17,4 +17,7 @@ public class ShopNameAndCodeDTO {
|
||||
|
||||
@ApiModelProperty("店铺编码")
|
||||
private String shopCode;
|
||||
|
||||
@ApiModelProperty("店铺地址")
|
||||
private String shopAddress;
|
||||
}
|
||||
|
||||
@@ -16,4 +16,6 @@ public class MiniShopsResponse {
|
||||
private String shopName;
|
||||
@ApiModelProperty("店铺编码")
|
||||
private String shopCode;
|
||||
@ApiModelProperty("店铺详细地址")
|
||||
private String detailAddress;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
ShopAccountDAO shopAccountDAO;
|
||||
@Resource
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
@Resource
|
||||
StoreDao storeDao;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -599,6 +601,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
|
||||
dto.setShopName(shopInfoDO.getShopName());
|
||||
dto.setShopCode(shopInfoDO.getShopCode());
|
||||
dto.setShopAddress(shopInfoDO.getDetailAddress());
|
||||
list.add(dto);
|
||||
}
|
||||
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();
|
||||
currentShop.setShopName(shopMap.get(shopId).getShopName());
|
||||
currentShop.setShopCode(shopMap.get(shopId).getShopCode());
|
||||
currentShop.setShopAddress(shopMap.get(shopId).getDetailAddress());
|
||||
response.setCurrentShop(currentShop);
|
||||
}
|
||||
}
|
||||
List<OldShopDO> oldMobile = oldShopDAO.getByMobile(lineInfoDO.getMobile());
|
||||
if (CollectionUtils.isNotEmpty(oldMobile)) {
|
||||
for (OldShopDO oldShopDO : oldMobile) {
|
||||
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
|
||||
dto.setShopName(oldShopDO.getShopName());
|
||||
dto.setShopCode(oldShopDO.getShopCode());
|
||||
list.add(dto);
|
||||
}
|
||||
}
|
||||
List<StoreDO> storeDOS = storeDao.listByMobile(lineInfoDO.getMobile());
|
||||
storeDOS.stream().forEach(x->{
|
||||
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
|
||||
dto.setShopName(x.getStoreName());
|
||||
dto.setShopCode(x.getStoreNum());
|
||||
dto.setShopAddress(x.getStoreAddress());
|
||||
list.add(dto);
|
||||
});
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
@@ -631,8 +635,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
))
|
||||
.values());
|
||||
response.setShopList(distinctList);
|
||||
log.info("shopInfo:{}",JSONObject.toJSONString(response));
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user