门店信息
This commit is contained in:
parent
f9940568ac
commit
f43d436015
@ -49,7 +49,9 @@
|
|||||||
"js-cookie": "3.0.1",
|
"js-cookie": "3.0.1",
|
||||||
"jsencrypt": "3.0.0-rc.1",
|
"jsencrypt": "3.0.0-rc.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
|
"qrcode": "^1.5.3",
|
||||||
"quill": "1.3.7",
|
"quill": "1.3.7",
|
||||||
|
"save": "^2.9.0",
|
||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
"sortablejs": "1.10.2",
|
"sortablejs": "1.10.2",
|
||||||
"vue": "2.6.12",
|
"vue": "2.6.12",
|
||||||
|
44
fuintAdmin/src/api/staff/qrcode.js
Normal file
44
fuintAdmin/src/api/staff/qrcode.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询二维码列表
|
||||||
|
export function listQRCode(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/storeInformation/qrCode/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询二维码详细
|
||||||
|
export function getQRCode(id) {
|
||||||
|
return request({
|
||||||
|
url: '/business/storeInformation/qrCode' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增二维码
|
||||||
|
export function addQRCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/storeInformation/qrCode',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改二维码
|
||||||
|
export function updateQRCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/storeInformation/qrCode',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除二维码
|
||||||
|
export function delQRCode(id) {
|
||||||
|
return request({
|
||||||
|
url: '/business/storeInformation/qrCode' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -38,6 +38,8 @@ import VueMeta from 'vue-meta'
|
|||||||
import DictData from '@/components/DictData'
|
import DictData from '@/components/DictData'
|
||||||
// 打印插件
|
// 打印插件
|
||||||
import Print from 'vue-print-nb'
|
import Print from 'vue-print-nb'
|
||||||
|
// 引入二维码插件
|
||||||
|
import QRCode from "qrcode"
|
||||||
|
|
||||||
// 全局方法挂载
|
// 全局方法挂载
|
||||||
Vue.prototype.getConfigKey = getConfigKey
|
Vue.prototype.getConfigKey = getConfigKey
|
||||||
@ -61,6 +63,7 @@ Vue.use(directive)
|
|||||||
Vue.use(plugins)
|
Vue.use(plugins)
|
||||||
Vue.use(VueMeta)
|
Vue.use(VueMeta)
|
||||||
Vue.use(Print);
|
Vue.use(Print);
|
||||||
|
Vue.use(QRCode)
|
||||||
DictData.install()
|
DictData.install()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
63
fuintAdmin/src/views/staff/storeInfo/index.vue
Normal file
63
fuintAdmin/src/views/staff/storeInfo/index.vue
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card >
|
||||||
|
<h4>门店二维码</h4>
|
||||||
|
<img class="qrcode" :src="QRImgUrl" /><br/>
|
||||||
|
<el-button class="but" type="primary">下载门店二维码</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'
|
||||||
|
export default {
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
QRImgUrl: '',
|
||||||
|
QRlink:'www.xxxsdnhgazregb.com'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getQRcode();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
getQRcode(){
|
||||||
|
QRCode.toDataURL(this.QRlink, { errorCorrectionLevel: 'L', margin: 2, width: 128 }, (err, url) => {
|
||||||
|
if (err) throw err
|
||||||
|
this.QRImgUrl= url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.qrcode{
|
||||||
|
width: 180px;
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
.but{
|
||||||
|
margin-left: 14px;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
.copy{
|
||||||
|
width: 50%;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -13,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色信息
|
||||||
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/business/member/duty")
|
@RequestMapping("/business/member/duty")
|
||||||
public class LjDutyController extends BaseController {
|
public class LjDutyController extends BaseController {
|
||||||
|
@ -5,6 +5,9 @@ import com.fuint.business.member.entity.LJDuty;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色信息 业务层
|
||||||
|
*/
|
||||||
public interface ILJDutyService extends IService<LJDuty> {
|
public interface ILJDutyService extends IService<LJDuty> {
|
||||||
/**
|
/**
|
||||||
* 查询角色信息
|
* 查询角色信息
|
||||||
|
@ -0,0 +1,76 @@
|
|||||||
|
package com.fuint.business.storeInformation.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.fuint.business.storeInformation.entity.QRCode;
|
||||||
|
import com.fuint.business.storeInformation.service.IQRCodeService;
|
||||||
|
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/qrCode")
|
||||||
|
public class QRCodeController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IQRCodeService iqrCodeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public ResponseObject list(QRCode qrCode,
|
||||||
|
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||||
|
Page page =new Page(pageNo,pageSize);
|
||||||
|
IPage<QRCode> list = iqrCodeService.selectQRCodeList(page,qrCode);
|
||||||
|
return getSuccessResult(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询二维码信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ResponseObject staffInfo(@PathVariable Integer id){
|
||||||
|
QRCode qrCode = iqrCodeService.selectQRCodeById(id);
|
||||||
|
return getSuccessResult(qrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除二维码信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ResponseObject remove(@PathVariable Integer id){
|
||||||
|
iqrCodeService.deleteQRCodeById(id);
|
||||||
|
return getSuccessResult("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public ResponseObject add(@Validated @RequestBody QRCode qrCode){
|
||||||
|
return getSuccessResult(iqrCodeService.insertQRCode(qrCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping
|
||||||
|
public ResponseObject edit(@Validated @RequestBody QRCode qrCode){
|
||||||
|
return getSuccessResult(iqrCodeService.updateQRCode(qrCode));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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.framework.entity.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二维码数据表
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("qr_code")
|
||||||
|
@ApiModel(value = "QRCode对象", description = "二维码表")
|
||||||
|
public class QRCode extends BaseEntity implements Serializable {
|
||||||
|
@ApiModelProperty("自增ID")
|
||||||
|
@TableId(value = "ID", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺id")
|
||||||
|
private Integer storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("连锁店id")
|
||||||
|
private Integer chainStoreId;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店二维码")
|
||||||
|
private String collection;
|
||||||
|
|
||||||
|
@ApiModelProperty("付款二维码")
|
||||||
|
private String payment;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.fuint.business.storeInformation.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.fuint.business.storeInformation.entity.QRCode;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface QRCodeMapper extends BaseMapper<QRCode> {
|
||||||
|
/**
|
||||||
|
* 根据条件查询二维码信息
|
||||||
|
* @param page
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public IPage<QRCode> selectQRCodeList(Page page, @Param("qrCode") QRCode qrCode);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.fuint.business.storeInformation.mapper.QRCodeMapper">
|
||||||
|
<resultMap id="getQRCode" type="com.fuint.business.storeInformation.entity.QRCode">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="storeId" column="store_id" />
|
||||||
|
<result property="chainStoreId" column="chain_store_id" />
|
||||||
|
<result property="collection" column="collection" />
|
||||||
|
<result property="payment" column="payment" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="selectQRCode">
|
||||||
|
select id, store_id, chain_store_id, collection, payment, create_time, update_time, create_by, update_by from qr_code
|
||||||
|
</sql>
|
||||||
|
<select id="selectQRCodeList" resultMap="getQRCode">
|
||||||
|
<include refid="selectQRCode"></include>
|
||||||
|
<where>
|
||||||
|
store_id = #{qrCode.storeId}
|
||||||
|
<!-- <if test="staff.realName != null and staff.realName != ''">-->
|
||||||
|
<!-- and real_name like concat('%', #{staff.realName}, '%')-->
|
||||||
|
<!-- </if>-->
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.fuint.business.storeInformation.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.fuint.business.member.entity.LJStaff;
|
||||||
|
import com.fuint.business.storeInformation.entity.QRCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店信息 业务层
|
||||||
|
*/
|
||||||
|
public interface IQRCodeService extends IService<QRCode> {
|
||||||
|
/**
|
||||||
|
* 根据条件模糊查询门店信息
|
||||||
|
* @param page
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public IPage<QRCode> selectQRCodeList(Page page, QRCode qrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询二维码信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public QRCode selectQRCodeById(int id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除二维码信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void deleteQRCodeById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int insertQRCode(QRCode qrCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateQRCode(QRCode qrCode);
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.fuint.business.storeInformation.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fuint.business.storeInformation.entity.QRCode;
|
||||||
|
import com.fuint.business.storeInformation.mapper.QRCodeMapper;
|
||||||
|
import com.fuint.business.storeInformation.service.IQRCodeService;
|
||||||
|
import com.fuint.common.dto.AccountInfo;
|
||||||
|
import com.fuint.common.util.TokenUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店信息 业务层
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> implements IQRCodeService {
|
||||||
|
/**
|
||||||
|
* 根据条件模糊查询门店信息
|
||||||
|
* @param page
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<QRCode> selectQRCodeList(Page page, QRCode qrCode) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
qrCode.setStoreId(storeId);
|
||||||
|
return baseMapper.selectQRCodeList(page,qrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询二维码信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QRCode selectQRCodeById(int id) {
|
||||||
|
return baseMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除二维码信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteQRCodeById(Integer id) {
|
||||||
|
baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertQRCode(QRCode qrCode) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
qrCode.setStoreId(storeId);
|
||||||
|
int row = baseMapper.insert(qrCode);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改二维码信息
|
||||||
|
* @param qrCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateQRCode(QRCode qrCode) {
|
||||||
|
int row = baseMapper.updateById(qrCode);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user