From 91448e7e2acc40fbccd8ebfe8a38148421bc3c24 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Mon, 16 Oct 2023 17:44:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysConfigController.java | 105 ++++++++++++++++++ .../fuint/system/config/entity/SysConfig.java | 30 +++++ .../system/config/mapper/SysConfigMapper.java | 15 +++ .../config/mapper/xml/SysConfigMapper.xml | 96 ++++++++++++++++ .../config/service/SysConfigService.java | 19 ++++ .../service/impl/SysConfigServiceImpl.java | 58 ++++++++++ .../framework/shiroConfig/ShiroConfig.java | 1 + 7 files changed, 324 insertions(+) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/controller/SysConfigController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/entity/SysConfig.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/SysConfigMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/SysConfigService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/impl/SysConfigServiceImpl.java diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/controller/SysConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/controller/SysConfigController.java new file mode 100644 index 000000000..de2175d71 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/controller/SysConfigController.java @@ -0,0 +1,105 @@ +package com.fuint.system.config.controller; + + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.api.ApiController; +import com.baomidou.mybatisplus.extension.api.R; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import com.fuint.system.config.entity.SysConfig; +import com.fuint.system.config.service.SysConfigService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.io.Serializable; +import java.util.List; + +/** + * (SysConfig)表控制层 + * + * @author makejava + * @since 2023-10-16 17:18:59 + */ +@RestController +@RequestMapping("sysConfig") +public class SysConfigController extends BaseController { + /** + * 服务对象 + */ + @Resource + private SysConfigService sysConfigService; + + /** + * 分页查询所有数据 + * + * @param sysConfig 查询实体 + * @return 所有数据 + */ + @GetMapping + public ResponseObject selectAll(SysConfig sysConfig, + @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) { + Page page =new Page(pageNum,pageSize); + return getSuccessResult(this.sysConfigService.page(page, new QueryWrapper<>(sysConfig))); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseObject selectOne(@PathVariable Serializable id) { + return getSuccessResult(this.sysConfigService.getById(id)); + } + /** + * 通过主键查询单条数据 + * + * @param key 主键 + * @return 单条数据 + */ + @GetMapping("/getByKey/{key}") + public ResponseObject getByKey(@PathVariable String key) { + return getSuccessResult(this.sysConfigService.getValueByKey(key)); + } + + /** + * 新增数据 + * + * @param sysConfig 实体对象 + * @return 新增结果 + */ + @PostMapping + public ResponseObject insert(@RequestBody SysConfig sysConfig) { + this.sysConfigService.saveVo(sysConfig); + return getSuccessResult("成功"); + } + + /** + * 修改数据 + * + * @param sysConfig 实体对象 + * @return 修改结果 + */ + @PutMapping + public ResponseObject update(@RequestBody SysConfig sysConfig) { + this.sysConfigService.updateByIdVo(sysConfig); + return getSuccessResult("成功"); + } + + /** + * 删除数据 + * + * @param id 主键结合 + * @return 删除结果 + */ + @DeleteMapping + public ResponseObject delete(@RequestParam("id") Long id) { + this.sysConfigService.removeByIdVo(id); + return getSuccessResult("成功"); + } +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/entity/SysConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/entity/SysConfig.java new file mode 100644 index 000000000..401d05ac7 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/entity/SysConfig.java @@ -0,0 +1,30 @@ +package com.fuint.system.config.entity; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.fuint.repository.model.base.BaseEntity; +import lombok.Data; + +import java.io.Serializable; + +/** + * (SysConfig)表实体类 + * + * @author makejava + * @since 2023-10-16 17:18:59 + */ +@Data +public class SysConfig extends BaseEntity { + //主键 + @TableId(type = IdType.AUTO) + private Integer id; + //key值 + private String keyStr; + //value值 + private String valueStr; + + } + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/SysConfigMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/SysConfigMapper.java new file mode 100644 index 000000000..1ada84860 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/SysConfigMapper.java @@ -0,0 +1,15 @@ +package com.fuint.system.config.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.fuint.system.config.entity.SysConfig; + +/** + * (SysConfig)表数据库访问层 + * + * @author makejava + * @since 2023-10-16 17:18:59 + */ +public interface SysConfigMapper extends BaseMapper { + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml new file mode 100644 index 000000000..9e0ccc464 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + update sys_dept set ancestors = + + when #{item.deptId} then #{item.ancestors} + + where dept_id in + + #{item.deptId} + + + + + update sys_dept set status = '0' where dept_id in + + #{deptId} + + + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/SysConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/SysConfigService.java new file mode 100644 index 000000000..5626489d9 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/SysConfigService.java @@ -0,0 +1,19 @@ +package com.fuint.system.config.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.fuint.system.config.entity.SysConfig; + +/** + * (SysConfig)表服务接口 + * + * @author makejava + * @since 2023-10-16 17:18:59 + */ +public interface SysConfigService extends IService { + void saveVo(SysConfig sysConfig); + void updateByIdVo(SysConfig sysConfig); + void removeByIdVo(Long id); + String getValueByKey(String keyStr); + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/impl/SysConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/impl/SysConfigServiceImpl.java new file mode 100644 index 000000000..6244c0387 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,58 @@ +package com.fuint.system.config.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.common.util.RedisUtil; +import com.fuint.system.config.mapper.SysConfigMapper; +import com.fuint.system.config.entity.SysConfig; +import com.fuint.system.config.service.SysConfigService; +import com.fuint.utils.ObjectUtil; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * (SysConfig)表服务实现类 + * + * @author makejava + * @since 2023-10-16 17:18:59 + */ +@Service("sysConfigService") +public class SysConfigServiceImpl extends ServiceImpl implements SysConfigService { + + public static String configRedisKey = "sys:config:"; + + @Override + public void saveVo(SysConfig sysConfig) { + RedisUtil.set(configRedisKey+sysConfig.getKeyStr(),sysConfig.getValueStr()); + this.save(sysConfig); + } + + @Override + public void updateByIdVo(SysConfig sysConfig) { + RedisUtil.set(configRedisKey+sysConfig.getKeyStr(),sysConfig.getValueStr()); + this.updateById(sysConfig); + } + + @Override + public void removeByIdVo(Long id) { + SysConfig sysConfig = this.getById(id); + RedisUtil.remove(configRedisKey+sysConfig.getKeyStr()); + this.removeById(id); + } + + @Override + public String getValueByKey(String keyStr) { + if (RedisUtil.hasKey(configRedisKey+keyStr)){ + return RedisUtil.get(configRedisKey+keyStr); + } + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(SysConfig::getKeyStr,keyStr); + SysConfig one = this.getOne(queryWrapper); + if (ObjectUtils.isNotEmpty(one)){ + return one.getValueStr(); + } + return null; + } +} + diff --git a/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/shiroConfig/ShiroConfig.java b/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/shiroConfig/ShiroConfig.java index 9bc72f5c6..5bbbab166 100644 --- a/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/shiroConfig/ShiroConfig.java +++ b/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/shiroConfig/ShiroConfig.java @@ -38,6 +38,7 @@ public class ShiroConfig { filterMap.put("/static/**","anon"); filterMap.put("/**","authc"); filter.setFilterChainDefinitionMap(filterMap); + filter.setLoginUrl("/login"); return filter; } From e0385816b37454883590913875ca266f40fe6637 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 16 Oct 2023 18:04:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/staff/user/chainstoreconfig.js | 19 + fuintAdmin/src/api/staff/user/user.js | 44 +++ fuintAdmin/src/api/staff/user/usergrade.js | 44 +++ .../src/components/map/mapComponent.vue | 32 +- fuintAdmin/src/views/member/index.vue | 258 +++++++------ fuintAdmin/src/views/staff/list.vue | 2 +- .../src/views/staff/storeInfo/index.vue | 29 +- fuintAdmin/src/views/userGrade/index.vue | 352 +++++++++++++----- .../ChainStoreConfigController.java | 39 ++ .../controller/LJUserController.java | 78 ++++ .../controller/LJUserGradeController.java | 78 ++++ .../userManager/entity/ChainStoreConfig.java | 37 ++ .../business/userManager/entity/LJUser.java | 117 ++++++ .../userManager/entity/LJUserGrade.java | 89 +++++ .../mapper/ChainStoreConfigMapper.java | 10 + .../userManager/mapper/LJUserGradeMapper.java | 21 ++ .../userManager/mapper/LJUserMapper.java | 20 + .../mapper/xml/LJUserGradeMapper.xml | 55 +++ .../userManager/mapper/xml/LJUserMapper.xml | 63 ++++ .../service/ChainStoreConfigService.java | 21 ++ .../service/LJUserGradeService.java | 44 +++ .../userManager/service/LJUserService.java | 44 +++ .../impl/ChainStoreConfigServiceImpl.java | 44 +++ .../service/impl/LJUserGradeServiceImpl.java | 39 ++ .../service/impl/LJUserServiceImpl.java | 75 ++++ 25 files changed, 1438 insertions(+), 216 deletions(-) create mode 100644 fuintAdmin/src/api/staff/user/chainstoreconfig.js create mode 100644 fuintAdmin/src/api/staff/user/user.js create mode 100644 fuintAdmin/src/api/staff/user/usergrade.js create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ChainStoreConfigController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserGradeController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/ChainStoreConfig.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/LJUser.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/entity/LJUserGrade.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/ChainStoreConfigMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserGradeMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserGradeMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/ChainStoreConfigService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java diff --git a/fuintAdmin/src/api/staff/user/chainstoreconfig.js b/fuintAdmin/src/api/staff/user/chainstoreconfig.js new file mode 100644 index 000000000..3dcd0c0aa --- /dev/null +++ b/fuintAdmin/src/api/staff/user/chainstoreconfig.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' + +// 查询会员详细 +export function getChainStoreConfig(id) { + return request({ + url: '/business/userManager/chainStoreConfig', + method: 'get' + }) +} + +// 修改会员 +export function updateChainStoreConfig(data) { + return request({ + url: '/business/userManager/chainStoreConfig', + method: 'put', + data: data + }) +} + diff --git a/fuintAdmin/src/api/staff/user/user.js b/fuintAdmin/src/api/staff/user/user.js new file mode 100644 index 000000000..76941d2d8 --- /dev/null +++ b/fuintAdmin/src/api/staff/user/user.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询会员列表 +export function listUser(query) { + return request({ + url: '/business/userManager/user/list', + method: 'get', + params: query + }) +} + +// 查询会员详细 +export function getUser(id) { + return request({ + url: '/business/userManager/user/' + id, + method: 'get' + }) +} + +// 新增会员 +export function addUser(data) { + return request({ + url: '/business/userManager/user', + method: 'post', + data: data + }) +} + +// 修改会员 +export function updateUser(data) { + return request({ + url: '/business/userManager/user', + method: 'put', + data: data + }) +} + +// 删除会员 +export function delUser(id) { + return request({ + url: '/business/userManager/user/' + id, + method: 'delete' + }) +} diff --git a/fuintAdmin/src/api/staff/user/usergrade.js b/fuintAdmin/src/api/staff/user/usergrade.js new file mode 100644 index 000000000..9872fe133 --- /dev/null +++ b/fuintAdmin/src/api/staff/user/usergrade.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询会员等级列表 +export function listUserGrade(query) { + return request({ + url: '/business/userManager/userGrade/list', + method: 'get', + params: query + }) +} + +// 查询会员等级详细 +export function getUserGrade(id) { + return request({ + url: '/business/userManager/userGrade/' + id, + method: 'get' + }) +} + +// 新增会员等级 +export function addUserGrade(data) { + return request({ + url: '/business/userManager/userGrade', + method: 'post', + data: data + }) +} + +// 修改会员等级 +export function updateUserGrade(data) { + return request({ + url: '/business/userManager/userGrade', + method: 'put', + data: data + }) +} + +// 删除会员等级 +export function delUserGrade(id) { + return request({ + url: '/business/userManager/userGrade/' + id, + method: 'delete' + }) +} diff --git a/fuintAdmin/src/components/map/mapComponent.vue b/fuintAdmin/src/components/map/mapComponent.vue index ef1d86fd5..1543c6bb9 100644 --- a/fuintAdmin/src/components/map/mapComponent.vue +++ b/fuintAdmin/src/components/map/mapComponent.vue @@ -1,6 +1,6 @@ @@ -69,16 +67,19 @@ export default { this.getOption(); }, mounted() { - this.initAMap(); }, methods:{ + pasVal(){ + this.$emit('pform', this.form); // 触发custom-event事件并传递参数 + // this.$refs.pform.pasVal() + }, changeOption(val){ this.remoteMethod(val[2]); }, getOption(){ let _this = this; getClient().then(response => { - this.options = response.data.list; + _this.options = response.data.list; }) }, initAMap() { @@ -93,6 +94,7 @@ export default { zoom: 11, //初始化地图级别 center: [_this.form.lng, _this.form.lat], //初始化地图中心点位置 }); + // console.log(this.map.center) //地址逆解析插件 this.geoCoder = new AMap.Geocoder({ city: "010", //城市设为北京,默认:“全国” @@ -161,6 +163,7 @@ export default { _this.form.lng = result.districtList[0].center.lng _this.form.lat = result.districtList[0].center.lat _this.toGeoCoder(); + _this.pasVal(); _this.initAMap(); }); }, 200); @@ -169,6 +172,23 @@ export default { this.initAMap(); } }, + getLngLat(){ + let _this = this; + const geocoder = new AMap.Geocoder() + // 地址反向查经纬度,cName: 当前选中城市 + geocoder.getLocation(this.form.address, (status, result) => { + if (status === 'complete' && result.info === 'OK') { + // 经纬度 + _this.form.lng = result.geocodes[0].location.lng + _this.form.lat = result.geocodes[0].location.lat + _this.toGeoCoder(); + _this.pasVal(); + _this.initAMap(); + } else { + this.$modal.msgError("定位失败"); + } + }) + }, // 选中提示 currentSelect(val) { // 清空时不执行后面代码 diff --git a/fuintAdmin/src/views/member/index.vue b/fuintAdmin/src/views/member/index.vue index 0a32e9f21..3498a9527 100644 --- a/fuintAdmin/src/views/member/index.vue +++ b/fuintAdmin/src/views/member/index.vue @@ -1,15 +1,7 @@