diff --git a/fuintAdmin/package.json b/fuintAdmin/package.json index 4bffc85aa..726a9da7a 100644 --- a/fuintAdmin/package.json +++ b/fuintAdmin/package.json @@ -49,7 +49,9 @@ "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "nprogress": "0.2.0", + "qrcode": "^1.5.3", "quill": "1.3.7", + "save": "^2.9.0", "screenfull": "5.0.2", "sortablejs": "1.10.2", "vue": "2.6.12", diff --git a/fuintAdmin/src/api/staff/qrcode.js b/fuintAdmin/src/api/staff/qrcode.js new file mode 100644 index 000000000..669ac7e68 --- /dev/null +++ b/fuintAdmin/src/api/staff/qrcode.js @@ -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' + }) +} diff --git a/fuintAdmin/src/main.js b/fuintAdmin/src/main.js index f6a04b9db..a6311e836 100644 --- a/fuintAdmin/src/main.js +++ b/fuintAdmin/src/main.js @@ -38,6 +38,8 @@ import VueMeta from 'vue-meta' import DictData from '@/components/DictData' // 打印插件 import Print from 'vue-print-nb' +// 引入二维码插件 +import QRCode from "qrcode" // 全局方法挂载 Vue.prototype.getConfigKey = getConfigKey @@ -61,6 +63,7 @@ Vue.use(directive) Vue.use(plugins) Vue.use(VueMeta) Vue.use(Print); +Vue.use(QRCode) DictData.install() /** diff --git a/fuintAdmin/src/views/staff/storeInfo/index.vue b/fuintAdmin/src/views/staff/storeInfo/index.vue new file mode 100644 index 000000000..f2eb699cf --- /dev/null +++ b/fuintAdmin/src/views/staff/storeInfo/index.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/controller/LjDutyController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/controller/LjDutyController.java index e55bd391f..4e932aa5c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/controller/LjDutyController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/controller/LjDutyController.java @@ -13,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; +/** + * 角色信息 + */ @RestController @RequestMapping("/business/member/duty") public class LjDutyController extends BaseController { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJDutyService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJDutyService.java index 6016cda20..019a3741b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJDutyService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/ILJDutyService.java @@ -5,6 +5,9 @@ import com.fuint.business.member.entity.LJDuty; import java.util.List; +/** + * 角色信息 业务层 + */ public interface ILJDutyService extends IService { /** * 查询角色信息 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/QRCodeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/QRCodeController.java new file mode 100644 index 000000000..0e8d9d237 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/controller/QRCodeController.java @@ -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 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)); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/entity/QRCode.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/entity/QRCode.java new file mode 100644 index 000000000..a94a901b6 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/entity/QRCode.java @@ -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; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/QRCodeMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/QRCodeMapper.java new file mode 100644 index 000000000..b9ba7ca5d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/QRCodeMapper.java @@ -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 { + /** + * 根据条件查询二维码信息 + * @param page + * @param qrCode + * @return + */ + public IPage selectQRCodeList(Page page, @Param("qrCode") QRCode qrCode); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/xml/QRCodeMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/xml/QRCodeMapper.xml new file mode 100644 index 000000000..2d95c628b --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/mapper/xml/QRCodeMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + select id, store_id, chain_store_id, collection, payment, create_time, update_time, create_by, update_by from qr_code + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/IQRCodeService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/IQRCodeService.java new file mode 100644 index 000000000..830c29a8e --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/IQRCodeService.java @@ -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 { + /** + * 根据条件模糊查询门店信息 + * @param page + * @param qrCode + * @return + */ + public IPage 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); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java new file mode 100644 index 000000000..08872cb5d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java @@ -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 implements IQRCodeService { + /** + * 根据条件模糊查询门店信息 + * @param page + * @param qrCode + * @return + */ + @Override + public IPage 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; + } +}