门店信息
This commit is contained in:
parent
c31d009ade
commit
c63b6018a1
@ -36,6 +36,7 @@
|
||||
"url": "https://gitee.com/fuint/fuint-uniapp.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.24.0",
|
||||
"clipboard": "2.0.8",
|
||||
@ -45,6 +46,7 @@
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
"highlight.js": "9.18.5",
|
||||
"html2canvas": "^1.4.1",
|
||||
"js-beautify": "1.13.0",
|
||||
"js-cookie": "3.0.1",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
|
@ -199,4 +199,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
window._AMapSecurityConfig = {
|
||||
// 例如 :serviceHost:'http://1.1.1.1:80/_AMapService', //安全写法,前面是服务器地址
|
||||
securityJsCode: "6e7d904a9f6e98a02fe4f0bb8f276f98" //测试时候的写法
|
||||
};
|
||||
</script>
|
||||
</html>
|
||||
|
10
fuintAdmin/src/api/staff/client.js
Normal file
10
fuintAdmin/src/api/staff/client.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询省市区详细
|
||||
export function getClient() {
|
||||
return request({
|
||||
url: '/province/region/tree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -9,10 +9,18 @@ export function listQRCode(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询二维码详细
|
||||
export function qrCodeInfo() {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询二维码详细
|
||||
export function getQRCode(id) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode' + id,
|
||||
url: '/business/storeInformation/qrCode/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -38,7 +46,7 @@ export function updateQRCode(data) {
|
||||
// 删除二维码
|
||||
export function delQRCode(id) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode' + id,
|
||||
url: '/business/storeInformation/qrCode/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
18
fuintAdmin/src/api/staff/store.js
Normal file
18
fuintAdmin/src/api/staff/store.js
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询店铺详细
|
||||
export function ljStoreInfo() {
|
||||
return request({
|
||||
url: '/business/storeInformation/store',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改店铺信息
|
||||
export function updateStore(data) {
|
||||
return request({
|
||||
url: '/business/storeInformation/store',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
171
fuintAdmin/src/components/map/mapComponent.vue
Normal file
171
fuintAdmin/src/components/map/mapComponent.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin: 20px 0px">
|
||||
<div style="display: flex">
|
||||
<p style="margin-right: 34px">省市区</p>
|
||||
<el-cascader :options="options" clearable style="margin-top: 8px"></el-cascader>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<p style="margin-right: 20px">选择区域</p>
|
||||
<div id="container" class="container" clearable style="margin-top: 15px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p>详细地址:<el-input v-model="form.address"
|
||||
placeholder="请输入内容"
|
||||
style="width: 50%"
|
||||
></el-input></p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import {getClient} from "@/api/staff/client";
|
||||
|
||||
export default {
|
||||
props:['pform'],
|
||||
data(){
|
||||
return {
|
||||
// 地图实例
|
||||
map: null,
|
||||
polygons: [],
|
||||
// 标记点
|
||||
marker: "",
|
||||
// 地址逆解析
|
||||
geoCoder: null,
|
||||
// 搜索提示
|
||||
AutoComplete: null,
|
||||
// 搜索关键字
|
||||
keywords: "",
|
||||
// 位置信息
|
||||
form: {
|
||||
lng: "105.602725",
|
||||
lat: "37.076636",
|
||||
address: "",
|
||||
adcode: "", //地区编码
|
||||
},
|
||||
// 搜索节流阀
|
||||
loading: false,
|
||||
// 搜索提示信息
|
||||
options: [],
|
||||
option:{
|
||||
value:'',
|
||||
label:'',
|
||||
children:[],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getOption();
|
||||
},
|
||||
mounted() {
|
||||
this.initAMap();
|
||||
},
|
||||
methods:{
|
||||
getOption(){
|
||||
this.form = this.pform;
|
||||
let _this = this;
|
||||
getClient().then(response => {
|
||||
this.options = response.data.list;
|
||||
})
|
||||
},
|
||||
initAMap() {
|
||||
let _this = this;
|
||||
AMapLoader.load({
|
||||
key: "b5abec514cab7c71cb0572765131e6fc", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: ["AMap.Geocoder", "AMap.AutoComplete"], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
}).then((AMap) => {
|
||||
this.map = new AMap.Map("container", {
|
||||
viewMode: "3D", //是否为3D地图模式
|
||||
zoom: 5, //初始化地图级别
|
||||
center: [_this.form.lng, _this.form.lat], //初始化地图中心点位置
|
||||
});
|
||||
//地址逆解析插件
|
||||
this.geoCoder = new AMap.Geocoder({
|
||||
city: "010", //城市设为北京,默认:“全国”
|
||||
radius: 1000, //范围,默认:500
|
||||
});
|
||||
// 搜索提示插件
|
||||
this.AutoComplete = new AMap.AutoComplete({ city: "全国" });
|
||||
//点击获取经纬度;
|
||||
this.map.on("click", (e) => {
|
||||
// 获取经纬度
|
||||
this.form.lng = e.lnglat.lng;
|
||||
this.form.lat = e.lnglat.lat;
|
||||
// 清除点
|
||||
this.removeMarker();
|
||||
// 标记点
|
||||
this.setMapMarker();
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 标记点
|
||||
setMapMarker() {
|
||||
// 自动适应显示想显示的范围区域
|
||||
this.map.setFitView();
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.map,
|
||||
position: [this.form.lng, this.form.lat],
|
||||
});
|
||||
// 逆解析地址
|
||||
this.toGeoCoder();
|
||||
this.map.setFitView();
|
||||
this.map.add(this.marker);
|
||||
},
|
||||
// 清除点
|
||||
removeMarker() {
|
||||
if (this.marker) {
|
||||
this.map.remove(this.marker);
|
||||
}
|
||||
},
|
||||
// 逆解析地址
|
||||
toGeoCoder() {
|
||||
let lnglat = [this.form.lng, this.form.lat];
|
||||
this.geoCoder.getAddress(lnglat, (status, result) => {
|
||||
if (status === "complete" && result.regeocode) {
|
||||
this.form.address = result.regeocode.formattedAddress;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 搜索
|
||||
remoteMethod(query) {
|
||||
console.log(query);
|
||||
if (query !== "") {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
this.AutoComplete.search(query, (status, result) => {
|
||||
this.options = result.tips;
|
||||
});
|
||||
}, 200);
|
||||
} else {
|
||||
// this.options = [];
|
||||
}
|
||||
},
|
||||
// 选中提示
|
||||
currentSelect(val) {
|
||||
// 清空时不执行后面代码
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
this.form = {
|
||||
lng: val.location.lng,
|
||||
lat: val.location.lat,
|
||||
address: val.district + val.address,
|
||||
adcode: val.adcode,
|
||||
};
|
||||
// 清除点
|
||||
this.removeMarker();
|
||||
// 标记点
|
||||
this.setMapMarker();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
@ -448,12 +448,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStaffList, getStaffInfo, updateStaffStatus, deleteStaff, saveStaff } from "@/api/staff";
|
||||
import {getName} from "../../utils/fuint";
|
||||
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "@/api/staff/staff";
|
||||
import {getDuty, listDuty} from "@/api/staff/duty";
|
||||
import {listType} from "@/api/dict/type";
|
||||
import {listData} from "@/api/system/dict/data";
|
||||
|
||||
export default {
|
||||
name: "StaffList",
|
||||
|
@ -1,59 +1,193 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card >
|
||||
<h4>收款二维码</h4>
|
||||
<img class="qrcode" :src="QRImgUrl" /><br/>
|
||||
<el-button class="but" type="primary">下载收款二维码</el-button>
|
||||
<div class="copy">
|
||||
<el-input v-model="input1">
|
||||
<template slot="prepend">复制链接</template>
|
||||
</el-input>
|
||||
<el-card class="card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ store.oilStationName }}({{ store.description }})</span>
|
||||
</div>
|
||||
|
||||
<map-componment :pform="form"></map-componment>
|
||||
|
||||
<div style="display: flex;margin-bottom: 20px">
|
||||
<span style="margin-right: 10px">店铺福利:</span>
|
||||
<el-checkbox-group v-model="welfare" ref="" @change="getCheckbox">
|
||||
<el-checkbox
|
||||
v-for="dict in dict.type.store_welfare"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<el-button type="primary" @click="submitStore">保存信息</el-button>
|
||||
</el-card>
|
||||
<el-card >
|
||||
<h4>门店二维码</h4>
|
||||
<img class="qrcode" :src="QRImgUrl" /><br/>
|
||||
<el-button class="but" type="primary">下载门店二维码</el-button>
|
||||
<el-card class="card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>门店二维码</span>
|
||||
</div>
|
||||
<img id="collection" class="qrcode" :src="collectionImg" /><br/>
|
||||
<el-button class="but" type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="handleDownloadqrCode('collection')">
|
||||
下载门店二维码
|
||||
</el-button>
|
||||
</el-card>
|
||||
<el-card class="card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>收款二维码</span>
|
||||
</div>
|
||||
<img id="payment" class="qrcode" :src="paymentImg" /><br/>
|
||||
<el-button class="but" type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="handleDownloadqrCode('payment')">
|
||||
下载收款二维码
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="copy">
|
||||
<el-input v-model="input1">
|
||||
<template slot="prepend">复制链接</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QRCode from 'qrcode'
|
||||
import html2canvas from "html2canvas";
|
||||
import {listQRCode} from "@/api/staff/qrcode";
|
||||
import {ljStoreInfo, updateStore} from "@/api/staff/store";
|
||||
import mapComponment from "@/components/map/mapComponent.vue";
|
||||
|
||||
export default {
|
||||
components:{
|
||||
mapComponment,
|
||||
},
|
||||
name: "map-view",
|
||||
dicts: ['store_welfare'],
|
||||
props: {
|
||||
data: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
QRImgUrl: '',
|
||||
QRlink:'www.xxxsdnhgazregb.com'
|
||||
// 门店二维码
|
||||
collectionImg:'',
|
||||
// 收款二维码
|
||||
paymentImg:'',
|
||||
qrcode: {},
|
||||
store:{},
|
||||
// 地图实例
|
||||
map: null,
|
||||
polygons: [],
|
||||
// 标记点
|
||||
marker: "",
|
||||
// 地址逆解析
|
||||
geoCoder: null,
|
||||
// 搜索提示
|
||||
AutoComplete: null,
|
||||
// 搜索关键字
|
||||
keywords: "",
|
||||
// 位置信息
|
||||
form: {
|
||||
lng: "",
|
||||
lat: "",
|
||||
address: "",
|
||||
adcode: "", //地区编码
|
||||
},
|
||||
// 搜索节流阀
|
||||
loading: false,
|
||||
// 搜索提示信息
|
||||
options: [],
|
||||
welfare:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getQRcode();
|
||||
this.getQRCodeInfo();
|
||||
this.getStore();
|
||||
},
|
||||
methods:{
|
||||
getQRcode(){
|
||||
QRCode.toDataURL(this.QRlink, { errorCorrectionLevel: 'L', margin: 2, width: 128 }, (err, url) => {
|
||||
if (err) throw err
|
||||
this.QRImgUrl= url
|
||||
methods: {
|
||||
// 获取门店信息
|
||||
getStore() {
|
||||
ljStoreInfo().then(response => {
|
||||
this.store = response.data
|
||||
this.form.lat = this.store.latitude;
|
||||
this.form.lng = this.store.longitude;
|
||||
this.form.address = this.store.address;
|
||||
this.welfare = this.store.welfare.split(",")
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
getCheckbox(){
|
||||
this.store.welfare = this.welfare.toString();
|
||||
},
|
||||
|
||||
submitStore(){
|
||||
updateStore(this.store).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getStore();
|
||||
})
|
||||
},
|
||||
|
||||
// 获取二维码信息
|
||||
getQRCodeInfo(){
|
||||
listQRCode().then(response => {
|
||||
this.qrcode = response.data.records;
|
||||
this.getQRcode();
|
||||
})
|
||||
},
|
||||
// 根据字符串获取二维码图片url地址
|
||||
getQRcode(){
|
||||
let opts = {
|
||||
errorCorrectionLevel: "L",//容错级别
|
||||
type: "image/png",//生成的二维码类型
|
||||
quality: 0.3,//二维码质量
|
||||
margin: 0,//二维码留白边距
|
||||
width: 180,//宽
|
||||
height: 180,//高
|
||||
text: "http://www.xxx.com",//二维码内容
|
||||
color: {
|
||||
dark: "#666666",//前景色
|
||||
light: "#fff"//背景色
|
||||
}
|
||||
};
|
||||
//this.QRlink 生成的二维码地址url
|
||||
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.collectionImg= url
|
||||
})
|
||||
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.paymentImg= url
|
||||
})
|
||||
},
|
||||
// 根据dom生成图片并下载到本地
|
||||
handleDownloadqrCode(id) {
|
||||
html2canvas(document.getElementById(id)).then((canvas) => {
|
||||
let imgUrl = canvas.toDataURL("image/png"); //可将 canvas 转为 base64 格式
|
||||
let a = document.createElement('a')
|
||||
a.href = imgUrl;
|
||||
if (id=='collection'){
|
||||
a.download = "门店二维码"; //文件名
|
||||
}else {
|
||||
a.download = "收款二维码"; //文件名
|
||||
}
|
||||
document.body.appendChild(a);
|
||||
a.click(); // 触发点击
|
||||
document.body.removeChild(a); // 然后移除
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card{
|
||||
width: 96%;
|
||||
margin: 30px auto;
|
||||
}
|
||||
.qrcode{
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.but{
|
||||
margin-left: 14px;
|
||||
margin-top: 10px;
|
||||
margin-top: 15px;
|
||||
width: 180px;
|
||||
}
|
||||
.copy{
|
||||
|
@ -74,4 +74,9 @@ public class MtStore extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("状态,A:有效/启用;D:无效")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("油站名称")
|
||||
private String oilStationName;
|
||||
|
||||
@ApiModelProperty("福利信息")
|
||||
private String welfare;
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.fuint.business.storeInformation.controller;
|
||||
|
||||
import com.fuint.business.storeInformation.service.ILJRegionService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 省市区信息
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/province/region")
|
||||
public class LJRegionController extends BaseController {
|
||||
@Autowired
|
||||
private ILJRegionService regionService;
|
||||
|
||||
/**
|
||||
* 查询省市级信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/tree")
|
||||
public ResponseObject tree(){
|
||||
Map<String, Object> map = regionService.selectRegion();
|
||||
return getSuccessResult(map);
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.fuint.business.storeInformation.controller;
|
||||
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.entity.QRCode;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/storeInformation/store")
|
||||
public class LJStoreController extends BaseController {
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
|
||||
/**
|
||||
* 根据id查询门店信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseObject storeInfo(){
|
||||
LJStore store = storeService.selectStoreById();
|
||||
return getSuccessResult(store);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店信息
|
||||
* @param store
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@Validated @RequestBody LJStore store){
|
||||
return getSuccessResult(storeService.updateStore(store));
|
||||
}
|
||||
}
|
@ -32,6 +32,14 @@ public class QRCodeController extends BaseController {
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺id查询二维码信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseObject qrCodeInfo(){
|
||||
return getSuccessResult(iqrCodeService.selectQRCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询二维码信息
|
||||
@ -39,7 +47,7 @@ public class QRCodeController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject staffInfo(@PathVariable Integer id){
|
||||
public ResponseObject qrCodeInfoById(@PathVariable Integer id){
|
||||
QRCode qrCode = iqrCodeService.selectQRCodeById(id);
|
||||
return getSuccessResult(qrCode);
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.fuint.business.storeInformation.dot;
|
||||
|
||||
import com.fuint.common.dto.RegionDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地区实体类
|
||||
* */
|
||||
@Data
|
||||
public class LJRegionDto {
|
||||
|
||||
private String value;
|
||||
|
||||
private String label;
|
||||
|
||||
private List<LJRegionDto> children;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.fuint.business.storeInformation.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 省市区数据表
|
||||
* </p>
|
||||
*
|
||||
* Created by FSQ
|
||||
* CopyRight https://www.fuint.cn
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mt_region")
|
||||
@ApiModel(value = "MtRegion对象", description = "省市区数据表")
|
||||
public class LJRegion implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("区划信息ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("区划名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("父级ID")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty("区划编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("层级(1省级 2市级 3区/县级)")
|
||||
private Integer level;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.fuint.business.storeInformation.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 店铺表
|
||||
*
|
||||
* Created by FSQ
|
||||
* CopyRight https://www.fuint.cn
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mt_store")
|
||||
@ApiModel(value = "MtStore对象", description = "店铺表")
|
||||
public class LJStore extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
@ApiModelProperty("连锁店主键")
|
||||
private Integer chainStoreId;
|
||||
@ApiModelProperty("关联机构主键")
|
||||
private Long contractDeptId;
|
||||
@ApiModelProperty("店铺名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("商户logo")
|
||||
private String logo;
|
||||
|
||||
|
||||
@ApiModelProperty("联系人姓名")
|
||||
private String contact;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
private String latitude;
|
||||
|
||||
@ApiModelProperty("维度")
|
||||
private String longitude;
|
||||
|
||||
@ApiModelProperty("距离")
|
||||
private BigDecimal distance;
|
||||
|
||||
@ApiModelProperty("营业时间")
|
||||
private String hours;
|
||||
|
||||
@ApiModelProperty("营业执照")
|
||||
private String license;
|
||||
|
||||
@ApiModelProperty("统一社会信用代码")
|
||||
private String creditCode;
|
||||
|
||||
@ApiModelProperty("备注信息")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("状态,A:有效/启用;D:无效")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("油站名称")
|
||||
private String oilStationName;
|
||||
|
||||
@ApiModelProperty("福利信息")
|
||||
private String welfare;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.fuint.business.storeInformation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.storeInformation.entity.LJRegion;
|
||||
|
||||
/**
|
||||
* 省市区信息 mapper层
|
||||
*/
|
||||
public interface LJRegionMapper extends BaseMapper<LJRegion> {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.fuint.business.storeInformation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
|
||||
/**
|
||||
* 店铺表 mapper层
|
||||
*/
|
||||
public interface LJStoreMapper extends BaseMapper<LJStore> {
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.business.storeInformation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.storeInformation.entity.LJRegion;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 省市区信息 业务层
|
||||
*/
|
||||
public interface ILJRegionService extends IService<LJRegion> {
|
||||
/**
|
||||
* 查询省市区信息
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> selectRegion();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.fuint.business.storeInformation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
|
||||
/**
|
||||
* 店铺信息 业务层
|
||||
*/
|
||||
public interface ILJStoreService extends IService<LJStore> {
|
||||
/**
|
||||
* 根据id查询店铺信息
|
||||
* @return
|
||||
*/
|
||||
public LJStore selectStoreById();
|
||||
|
||||
/**
|
||||
* 修改店铺信息
|
||||
* @param store 店铺信息
|
||||
* @return
|
||||
*/
|
||||
public int updateStore(LJStore store);
|
||||
}
|
@ -20,6 +20,12 @@ public interface IQRCodeService extends IService<QRCode> {
|
||||
*/
|
||||
public IPage<QRCode> selectQRCodeList(Page page, QRCode qrCode);
|
||||
|
||||
/**
|
||||
* 根据店铺id查询二维码信息
|
||||
* @return
|
||||
*/
|
||||
public QRCode selectQRCode();
|
||||
|
||||
/**
|
||||
* 根据id查询二维码信息
|
||||
* @param id
|
||||
|
@ -0,0 +1,111 @@
|
||||
package com.fuint.business.storeInformation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.storeInformation.dot.LJRegionDto;
|
||||
import com.fuint.business.storeInformation.entity.LJRegion;
|
||||
import com.fuint.business.storeInformation.mapper.LJRegionMapper;
|
||||
import com.fuint.business.storeInformation.service.ILJRegionService;
|
||||
import com.fuint.common.dto.RegionDto;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 省市区信息 业务层
|
||||
*/
|
||||
@Service
|
||||
public class LJRegionServiceImpl extends ServiceImpl<LJRegionMapper, LJRegion> implements ILJRegionService {
|
||||
@Autowired
|
||||
private LJRegionMapper regionMapper;
|
||||
|
||||
/**
|
||||
* 查询省市区信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> selectRegion() {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
List<LJRegion> regionList = regionMapper.selectByMap(params);
|
||||
|
||||
List<RegionDto> treeData = new ArrayList<>();
|
||||
List<LJRegionDto> list = new ArrayList<>();
|
||||
|
||||
for (LJRegion mtRegion : regionList) {
|
||||
if (mtRegion.getLevel().equals(1)) {
|
||||
RegionDto dto = new RegionDto();
|
||||
LJRegionDto regionDto = new LJRegionDto();
|
||||
|
||||
dto.setId(mtRegion.getId());
|
||||
dto.setName(mtRegion.getName());
|
||||
dto.setCode(mtRegion.getCode());
|
||||
dto.setPid(mtRegion.getPid());
|
||||
dto.setLevel(mtRegion.getLevel() + "");
|
||||
dto.setCity(new ArrayList<>());
|
||||
|
||||
regionDto.setLabel(mtRegion.getName());
|
||||
regionDto.setValue(mtRegion.getCode());
|
||||
regionDto.setChildren(new ArrayList<>());
|
||||
treeData.add(dto);
|
||||
list.add(regionDto);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < treeData.size(); i++) {
|
||||
List<RegionDto> cityArr = new ArrayList<>();
|
||||
List<LJRegionDto> city = new ArrayList<>();
|
||||
for (LJRegion mtRegion : regionList) {
|
||||
if (treeData.get(i).getId().equals(mtRegion.getPid())) {
|
||||
RegionDto dto = new RegionDto();
|
||||
LJRegionDto regionDto = new LJRegionDto();
|
||||
|
||||
dto.setId(mtRegion.getId());
|
||||
dto.setName(mtRegion.getName());
|
||||
dto.setCode(mtRegion.getCode());
|
||||
dto.setPid(mtRegion.getPid());
|
||||
dto.setLevel(mtRegion.getLevel() + "");
|
||||
|
||||
regionDto.setLabel(mtRegion.getName());
|
||||
regionDto.setValue(mtRegion.getCode());
|
||||
|
||||
List<RegionDto> regionArr = new ArrayList<>();
|
||||
List<LJRegionDto> region = new ArrayList<>();
|
||||
for (LJRegion mtRegion1 : regionList) {
|
||||
if (mtRegion.getId().equals(mtRegion1.getPid())) {
|
||||
RegionDto dto1 = new RegionDto();
|
||||
LJRegionDto regionDto1 = new LJRegionDto();
|
||||
|
||||
dto1.setId(mtRegion1.getId());
|
||||
dto1.setName(mtRegion1.getName());
|
||||
dto1.setCode(mtRegion1.getCode());
|
||||
dto1.setPid(mtRegion1.getPid());
|
||||
dto1.setLevel(mtRegion1.getLevel() + "");
|
||||
|
||||
regionDto1.setLabel(mtRegion1.getName());
|
||||
regionDto1.setValue(mtRegion1.getCode());
|
||||
|
||||
regionArr.add(dto1);
|
||||
region.add(regionDto1);
|
||||
}
|
||||
}
|
||||
|
||||
dto.setRegion(regionArr);
|
||||
regionDto.setChildren(region);
|
||||
cityArr.add(dto);
|
||||
city.add(regionDto);
|
||||
}
|
||||
}
|
||||
|
||||
treeData.get(i).setCity(cityArr);
|
||||
list.get(i).setChildren(city);
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("data", treeData);
|
||||
result.put("list", list);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.fuint.business.storeInformation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.mapper.LJStoreMapper;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺信息 业务层
|
||||
*/
|
||||
@Service
|
||||
public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> implements ILJStoreService {
|
||||
/**
|
||||
* 根据id查询店铺信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LJStore selectStoreById() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
LJStore store = baseMapper.selectById(storeId);
|
||||
return store;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺信息
|
||||
* @param store 店铺信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateStore(LJStore store) {
|
||||
int row = baseMapper.updateById(store);
|
||||
return row;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.storeInformation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -14,7 +15,7 @@ import org.springframework.stereotype.Service;
|
||||
* 门店信息 业务层
|
||||
*/
|
||||
@Service
|
||||
public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> implements IQRCodeService {
|
||||
public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> implements IQRCodeService {
|
||||
/**
|
||||
* 根据条件模糊查询门店信息
|
||||
* @param page
|
||||
@ -29,6 +30,15 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> implem
|
||||
return baseMapper.selectQRCodeList(page,qrCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QRCode selectQRCode() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询二维码信息
|
||||
* @param id
|
||||
|
@ -37,7 +37,6 @@ public class ClientRegionController extends BaseController {
|
||||
*/
|
||||
@ApiOperation(value = "获取地区树状结构")
|
||||
@RequestMapping(value = "/tree", method = RequestMethod.GET)
|
||||
@CrossOrigin
|
||||
public ResponseObject tree(HttpServletRequest request) {
|
||||
String token = request.getHeader("Access-Token");
|
||||
UserInfo userInfo = TokenUtil.getUserInfoByToken(token);
|
||||
|
Loading…
Reference in New Issue
Block a user