会员信息
This commit is contained in:
parent
74efa27e2a
commit
ef2ef63234
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilNumberNameVo;
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -84,6 +85,9 @@ public class LJStore extends BaseEntity implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private List<String> welfareList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<OilNumberNameVo> oilList;
|
||||
|
||||
@ApiModelProperty("是否开启等级规则")
|
||||
private String isEnableLevel;
|
||||
|
||||
|
@ -2,6 +2,8 @@ package com.fuint.business.storeInformation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNumberService;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilNumberNameVo;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.mapper.LJStoreMapper;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
@ -11,10 +13,7 @@ import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 店铺信息 业务层
|
||||
@ -86,6 +85,9 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
return map1;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private OilNumberService oilNumberService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryStoreByPosition(Map<String, String> map) {
|
||||
Double lon = 0.0;
|
||||
@ -110,6 +112,13 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
double earthRadius = 6371; // 地球半径,单位为公里
|
||||
for (LJStore store : list) {
|
||||
Double distance = 0.0;
|
||||
if (StringUtils.isNotEmpty(store.getWelfare())){
|
||||
store.setWelfareList(Arrays.asList(store.getWelfare().split(",")));
|
||||
}
|
||||
// 添加店铺油品信息
|
||||
List<OilNumberNameVo> oilNumberNameVos = oilNumberService.selectOilNumberNameByStoreId(store.getId());
|
||||
store.setOilList(oilNumberNameVos);
|
||||
|
||||
Map<String,Object> map1 = new HashMap<>();
|
||||
if (StringUtils.isNotEmpty(store.getLatitude()) && StringUtils.isNotEmpty(store.getLongitude())){
|
||||
double dLat1 = Math.toRadians(Double.parseDouble(store.getLatitude()) - lat);
|
||||
@ -126,6 +135,14 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
list1.add(map1);
|
||||
}
|
||||
}
|
||||
|
||||
// 将店铺信息按照距离从小到大排序
|
||||
Collections.sort(list1, new Comparator<Map<String,Object>>() {
|
||||
@Override
|
||||
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
|
||||
return Double.compare(Double.parseDouble(o1.get("distance").toString()), Double.parseDouble(o2.get("distance").toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return list1;
|
||||
@ -161,4 +178,15 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
int row = baseMapper.updateById(store);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateStoreRule(Map<String, String> map) {
|
||||
String isEnableLevel = map.get("isEnableLevel");
|
||||
String isMonthClear = map.get("isMonthClear");
|
||||
LJStore store = this.selectStoreById();
|
||||
store.setIsEnableLevel(isEnableLevel);
|
||||
store.setIsMonthClear(isMonthClear);
|
||||
int row = baseMapper.updateById(store);
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,11 @@
|
||||
// 纬度
|
||||
latitude: "",
|
||||
// 店铺信息
|
||||
store: {},
|
||||
store: {
|
||||
name:"测试油站",
|
||||
description:"济南分店",
|
||||
address:"济南槐荫区"
|
||||
},
|
||||
// 店铺福利信息
|
||||
welfare: [],
|
||||
distance: "",
|
||||
@ -269,7 +273,7 @@
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
_this.getStore(2);
|
||||
_this.getStore(0);
|
||||
console.log('获取位置信息失败: ' + err.errMsg);
|
||||
}
|
||||
});
|
||||
|
@ -68,7 +68,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
<view class="anniu" @click="submitAmount">
|
||||
<text>立即加油</text>
|
||||
</view>
|
||||
|
||||
@ -318,14 +318,21 @@
|
||||
},
|
||||
// 数字键盘确定按钮
|
||||
submitAmount(){
|
||||
if (this.value!=""){
|
||||
if (this.value!="" && this.qindex!=null){
|
||||
this.show = false
|
||||
this.$refs.popup.open('bottom')
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:"请输入加油金额",
|
||||
icon:"error"
|
||||
})
|
||||
if (this.value=="") {
|
||||
uni.showToast({
|
||||
title:"请输入加油金额",
|
||||
icon:"error"
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:"请选择油枪号",
|
||||
icon:"error"
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
valChange(val) {
|
||||
|
@ -85,9 +85,9 @@
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-x="true" class="fa-scroll">
|
||||
<view class="scrollbox" v-for="(item,index) in 7" :key="index">
|
||||
<view style="font-size: 16px;">98#</view>
|
||||
<view style="font-size: 18px;">$7.69</view>
|
||||
<view class="scrollbox" v-for="(item1,index) in item.store.oilList" :key="index">
|
||||
<view style="font-size: 16px;">{{item1.oilNames}}</view>
|
||||
<view style="font-size: 18px;">¥{{item1.gbPrice}}/{{item1.unit}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="wrap-box">
|
||||
|
Loading…
Reference in New Issue
Block a user