Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1fda3fd5b2
@ -11,6 +11,6 @@ VUE_APP_BASE_API = '/stage-api'
|
||||
VUE_APP_PUBLIC_PATH = '/'
|
||||
|
||||
# 后端接口地址
|
||||
VUE_APP_SERVER_URL = 'https://www.tuofeng.cc/oilAdmin/'
|
||||
VUE_APP_SERVER_URL = 'https://oilapi.youkerr.com/oilAdmin/'
|
||||
# cp端地址
|
||||
VUE_PC_SERVER_URL = 'https://www.tuofeng.cc/oilAdmin/'
|
||||
VUE_PC_SERVER_URL = 'https://oilapi.youkerr.com/oilAdmin/'
|
||||
|
@ -1,25 +1,24 @@
|
||||
<script>
|
||||
import {treeselect as menuTreeselect} from "@/api/system/menu";
|
||||
import {selectChildByDeptId} from "@/api/system/Site/site";
|
||||
import {addRole, getRole, updateRole} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
merchantId: "2",
|
||||
ruleForm: {
|
||||
name: '',
|
||||
roleName: '',
|
||||
storeId: '',
|
||||
date1: '',
|
||||
date2: '',
|
||||
status: 'A',
|
||||
type: [],
|
||||
resource: '',
|
||||
description: ''
|
||||
description: '',
|
||||
dutyId: "",
|
||||
checkedKeys: []
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
roleName: [
|
||||
{required: true, message: '请输入角色名称', trigger: 'blur'},
|
||||
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
|
||||
],
|
||||
storeId: [
|
||||
{required: true, message: '请选择机构信息', trigger: 'change'}
|
||||
@ -38,18 +37,21 @@ export default {
|
||||
label: '组织架构',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄',
|
||||
|
||||
childrens: [{
|
||||
id: 31,
|
||||
label: '用户信息',
|
||||
|
||||
list: [{show: true, name: '新增'}, {show: true, name: '修改'}, {show: true, name: '重置密码'},]
|
||||
}, {
|
||||
id: 32,
|
||||
label: '机构信息',
|
||||
|
||||
list: [{show: true, name: '保存'},]
|
||||
}]
|
||||
},
|
||||
]
|
||||
|
||||
// list:[{show:true,name:'选项一'},{show:true,name:'选项二'},{show:true,name:'选项三'},]
|
||||
|
||||
}, {
|
||||
id: 4,
|
||||
@ -73,24 +75,34 @@ export default {
|
||||
created() {
|
||||
// this.merchantId = this.$route.query.merchantId
|
||||
// this.getMenuTreeselect()
|
||||
if (this.$route.query.dutyId) {
|
||||
this.getRoleMune(this.$route.query.dutyId);
|
||||
}
|
||||
this.selectChildByDeptIdApi()
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 查询菜单树结构
|
||||
getMenuTreeselect() {
|
||||
// merchantId 代表deptType
|
||||
menuTreeselect({merchantId:this.merchantId}).then(response => {
|
||||
menuTreeselect({merchantId: this.merchantId, roleId: this.ruleForm.dutyId}).then(response => {
|
||||
this.tableData = response.data;
|
||||
console.log(this.tableData)
|
||||
});
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
alert('submit!');
|
||||
if (this.ruleForm.dutyId) {
|
||||
updateRole(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$router.push("/Site/index")
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
addRole(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.$router.push("/Site/index")
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -101,20 +113,116 @@ export default {
|
||||
selectChildByDeptIdApi() {
|
||||
selectChildByDeptId().then(res => {
|
||||
this.deptListSelect = res.data
|
||||
if (!this.$route.query.dutyId) {
|
||||
this.ruleForm.storeId = res.data[0].deptId
|
||||
this.merchantId = res.data[0].deptType
|
||||
this.ruleForm.deptType = res.data[0].deptType
|
||||
this.getMenuTreeselect()
|
||||
}
|
||||
})
|
||||
},
|
||||
getRoleMune(roleId) {
|
||||
getRole(roleId).then(response => {
|
||||
this.ruleForm.roleName = response.data.roleInfo.name;
|
||||
this.ruleForm.status = response.data.roleInfo.status;
|
||||
this.ruleForm.dutyId = response.data.roleInfo.id;
|
||||
this.ruleForm.roleType = response.data.roleInfo.type;
|
||||
this.ruleForm.storeId = response.data.roleInfo.storeId;
|
||||
this.ruleForm.description = response.data.roleInfo.description;
|
||||
let checkedKeys = response.data.checkedKeys
|
||||
this.ruleForm.checkedKeys = checkedKeys
|
||||
this.ruleForm.menuIds = checkedKeys
|
||||
this.merchantId = response.data.roleInfo.type
|
||||
this.getMenuTreeselect()
|
||||
// this.tableData = response.data.treeselect;
|
||||
});
|
||||
},
|
||||
// 选择机构信息
|
||||
chooseRegion(deptId) {
|
||||
this.deptListSelect.forEach(item => {
|
||||
if (item.deptId == deptId) {
|
||||
this.merchantId = item.deptType
|
||||
this.ruleForm.deptType = item.deptType
|
||||
this.getMenuTreeselect()
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseImg(row, data) {
|
||||
let ids = []
|
||||
let show = false;
|
||||
this.tableData.forEach(item => {
|
||||
if (!row.show) show = true
|
||||
// 尝试直接在顶级项目中找到匹配的 ID
|
||||
if (item.id == row.id) {
|
||||
item.show = show;
|
||||
ids.push(item.id)
|
||||
// 如果上面的条件都不满足,再检查子项
|
||||
item.childrens.forEach(item1 => {
|
||||
item1.show = show;
|
||||
ids.push(item1.id)
|
||||
item1.list.forEach(item2 => {
|
||||
item2.show = show;
|
||||
ids.push(item2.id)
|
||||
});
|
||||
});
|
||||
item.list.forEach(item1 => {
|
||||
ids.push(item1.id)
|
||||
item1.show = show;
|
||||
});
|
||||
return; // 如果找到,则直接返回,不再继续处理子项
|
||||
} else {
|
||||
item.list.forEach(item1 => {
|
||||
if (item1.id == row.id) {
|
||||
ids.push(item1.id)
|
||||
item1.show = show;
|
||||
}
|
||||
|
||||
if (!show) {
|
||||
if (item1.name == '选中' && item1.id == data.id) {
|
||||
item1.show = show;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 如果上面的条件都不满足,再检查子项
|
||||
item.childrens.forEach(item1 => {
|
||||
// 直接检查子项是否匹配
|
||||
if (item1.id == row.id) {
|
||||
ids.push(item1.id)
|
||||
item1.show = show;
|
||||
item1.list.forEach(item2 => {
|
||||
ids.push(item2.id)
|
||||
item2.show = show;
|
||||
});
|
||||
return; // 如果在子项中找到,也直接返回
|
||||
} else {
|
||||
item1.list.forEach(item2 => {
|
||||
if (item2.id == row.id) {
|
||||
ids.push(item2.id)
|
||||
item2.show = show;
|
||||
}
|
||||
|
||||
if (!show) {
|
||||
if (item2.name == '选中' && item2.id == data.id) {
|
||||
item2.show = show;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
let uniqueArr = ids.filter((item, index) => ids.indexOf(item) === index);
|
||||
if (show) {
|
||||
this.ruleForm.checkedKeys = [...uniqueArr, ...this.ruleForm.checkedKeys];
|
||||
// this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter((item, index) => this.ruleForm.checkedKeys.indexOf(item) === index);
|
||||
} else {
|
||||
this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => !uniqueArr.includes(item));
|
||||
}
|
||||
this.ruleForm.menuIds = this.ruleForm.checkedKeys;
|
||||
console.log(ids, uniqueArr, this.ruleForm.checkedKeys, show);
|
||||
// this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => item !== row.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -124,8 +232,8 @@ export default {
|
||||
<div class="top-box">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||
<div>
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="ruleForm.name"></el-input>
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="ruleForm.roleName"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
@ -153,6 +261,7 @@ export default {
|
||||
<el-input v-model="ruleForm.description"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="center-box">
|
||||
@ -163,24 +272,35 @@ export default {
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'childrens', hasChildren: 'hasChildren'}">
|
||||
|
||||
<el-table-column
|
||||
prop="label"
|
||||
label="菜单"
|
||||
|
||||
width="180">
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="功能">
|
||||
<template slot-scope="scope">
|
||||
<div style="display: flex;align-items: center">
|
||||
<div class="f-box" v-for="(item,index) in scope.row.list" :key="index"> <img v-if="item.show == true" style="width: 15px;height: 15px;margin-right: 5px" src="../../assets/images/xz.png"> <div v-else class="k_" ></div> {{item.name}} </div>
|
||||
<div class="f-box" v-for="(item,index) in scope.row.list" :key="index" @click="chooseImg(item,scope.row)">
|
||||
<img v-if="item.show == true" style="width: 15px;height: 15px;margin-right: 5px"
|
||||
src="../../assets/images/xz.png">
|
||||
<div v-else class="k_"></div>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="display: flex">
|
||||
<el-button @click="resetForm('ruleForm')">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -193,6 +313,7 @@ export default {
|
||||
padding: 20px;
|
||||
background: #f4f5f9;
|
||||
}
|
||||
|
||||
.top-box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -203,11 +324,13 @@ export default {
|
||||
box-shadow: 0px 3px 6px 1px rgba(255, 255, 255, 0.4), inset 0px 3px 6px 1px rgba(255, 255, 255, 0.5);
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.demo-ruleForm {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center-box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -218,11 +341,13 @@ export default {
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.f-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.k_ {
|
||||
width: 15px;
|
||||
border-radius: 4px;
|
||||
|
@ -675,6 +675,7 @@
|
||||
type="warning"
|
||||
plain
|
||||
size="mini"
|
||||
v-hasPermi="['role:add']"
|
||||
@click="handleAdd1"
|
||||
|
||||
>新增角色
|
||||
@ -717,6 +718,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-hasPermi="['role:edit']"
|
||||
@click="handleUpdate1(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
@ -1279,10 +1281,10 @@ export default {
|
||||
submitForm1: function() {
|
||||
this.$refs["form1"].validate(valid => {
|
||||
if (valid) {
|
||||
console.log(this.deptType)
|
||||
this.form1.deptType = this.deptType
|
||||
if (this.form1.dutyId) {
|
||||
this.form1.menuIds = this.getMenuAllCheckedKeys();
|
||||
console.log(this.form1.menuIds)
|
||||
updateRole(this.form1).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.openDuty = false;
|
||||
@ -1360,35 +1362,23 @@ export default {
|
||||
},
|
||||
handleUpdate1(data){
|
||||
this.reset1();
|
||||
// let val = null;
|
||||
// if (data.dutyType == '3') val = 1;
|
||||
// if (data.dutyType == '4') val = 2;
|
||||
// const roleMenu = this.getMenuTreeselect(val);
|
||||
const roleId = data.dutyId
|
||||
this.form1.menuCheckStrictly = false
|
||||
getRole(roleId).then(response => {
|
||||
this.form1.roleName = response.data.roleInfo.name;
|
||||
this.form1.roleType = response.data.roleInfo.type;
|
||||
this.form1.status = response.data.roleInfo.status;
|
||||
this.form1.dutyId = response.data.roleInfo.id;
|
||||
this.form1.description = response.data.roleInfo.description;
|
||||
this.openDuty = true;
|
||||
this.title = "修改角色";
|
||||
let checkedKeys = response.data.checkedKeys
|
||||
this.form1.checkedKeys = checkedKeys
|
||||
this.merchantId = response.data.roleInfo.type
|
||||
this.getMenuTreeselect(response.data.roleInfo.type)
|
||||
// this.form1.menuCheckStrictly = false
|
||||
// getRole(roleId).then(response => {
|
||||
// this.form1.roleName = response.data.roleInfo.name;
|
||||
// this.form1.roleType = response.data.roleInfo.type;
|
||||
// this.form1.status = response.data.roleInfo.status;
|
||||
// this.form1.dutyId = response.data.roleInfo.id;
|
||||
// this.form1.description = response.data.roleInfo.description;
|
||||
// this.openDuty = true;
|
||||
// this.title = "修改角色";
|
||||
// let checkedKeys = response.data.checkedKeys
|
||||
// this.form1.checkedKeys = checkedKeys
|
||||
// this.merchantId = response.data.roleInfo.type
|
||||
// this.getMenuTreeselect(response.data.roleInfo.type)
|
||||
// });
|
||||
|
||||
// this.$nextTick(() => {
|
||||
// roleMenu.then(res => {
|
||||
// checkedKeys.forEach((v) => {
|
||||
// this.$nextTick(()=>{
|
||||
// this.$refs.menu.setChecked(v, true ,false);
|
||||
// })
|
||||
// })
|
||||
// });
|
||||
// });
|
||||
});
|
||||
this.$router.push({path:"/Site/add",query: { dutyId: roleId }})
|
||||
},
|
||||
handleStatusChangeDuty(data){
|
||||
console.log(data)
|
||||
|
@ -254,8 +254,8 @@ export default {
|
||||
code:this.loginForm.telcode
|
||||
}
|
||||
this.$store.dispatch("codeLogin", data).then(() => {
|
||||
// this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
this.$router.push({ path: "/Service/index" }).catch(()=>{});
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
// this.$router.push({ path: "/Service/index" }).catch(()=>{});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
|
||||
|
@ -49,12 +49,12 @@ public class Const {
|
||||
public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB";
|
||||
|
||||
//小程序异步通知(回调地址)
|
||||
public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
|
||||
public static String notify_url = "https://oilapi.youkerr.com/oilAdmin/api/fyPay/notify";
|
||||
// public static String notify_url = "http://k40180f897.goho.co/api/fyPay/notify";
|
||||
// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
|
||||
|
||||
//主扫异步通知(回调地址)
|
||||
public static String notify_url_scan = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notifyScan";
|
||||
public static String notify_url_scan = "https://oilapi.youkerr.com/oilAdmin/api/fyPay/notifyScan";
|
||||
//public static String notify_url_scan = "https://8q4f124343.yicp.fun/api/fyPay/notifyScan";
|
||||
|
||||
//主扫下单
|
||||
|
@ -223,7 +223,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),storeId);
|
||||
if (ObjectUtil.isNotEmpty(staff1)){
|
||||
// 添加员工码
|
||||
staff1.setStaffCode("https://www.tuofeng.cc/oilRefuel?storeId="+storeId+"&staffId="+staff1.getId());
|
||||
staff1.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId="+storeId+"&staffId="+staff1.getId());
|
||||
this.updateStaff(staff1);
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
}
|
||||
if (StringUtils.isEmpty(staff.getStaffCode())){
|
||||
// 添加员工码
|
||||
staff.setStaffCode("https://www.tuofeng.cc/oilRefuel?storeId="+staff.getStoreId()+"&staffId="+staff.getId());
|
||||
staff.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId="+staff.getStoreId()+"&staffId="+staff.getId());
|
||||
}
|
||||
row = baseMapper.updateById(staff);
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())){
|
||||
|
@ -189,9 +189,9 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
|
||||
qrCode.setChainStoreId(store.getChainStoreId());
|
||||
|
||||
// 带有店铺id 跳转首页
|
||||
qrCode.setCollection("https://www.tuofeng.cc/oilStation?storeId="+store.getId());
|
||||
qrCode.setCollection("https://oilapi.youkerr.com/oilStation?storeId="+store.getId());
|
||||
// 带有店铺id 跳转一键加油页面
|
||||
qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getId());
|
||||
qrCode.setPayment("https://oilapi.youkerr.com/oilRefuel?storeId="+store.getId());
|
||||
row = baseMapper.insert(qrCode);
|
||||
IndexBanner indexBanner = new IndexBanner();
|
||||
indexBannerService.insertIndexBanner(indexBanner,storeId);
|
||||
|
@ -75,7 +75,7 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
|
||||
for (int i = 0; i < total; i++) {
|
||||
Random random = new Random();
|
||||
int i1 = random.nextInt(90000000);
|
||||
String url = "https://www.tuofeng.cc/oilRefuel?sn=byx"+i1;
|
||||
String url = "https://oilapi.youkerr.com/oilRefuel?sn=byx"+i1;
|
||||
|
||||
TagCode tagCode = new TagCode();
|
||||
|
||||
|
@ -56,11 +56,29 @@ public class TreeNode {
|
||||
*/
|
||||
private String perms;
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private Boolean show;
|
||||
|
||||
public Boolean getShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public void setShow(Boolean show) {
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<TreeNode> childrens = new ArrayList<TreeNode>();
|
||||
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<TreeNode> list = new ArrayList<TreeNode>();
|
||||
|
||||
/**
|
||||
* 菜单级别
|
||||
*/
|
||||
@ -147,6 +165,14 @@ public class TreeNode {
|
||||
this.childrens = childrens;
|
||||
}
|
||||
|
||||
public List<TreeNode> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<TreeNode> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
@ -28,6 +28,28 @@ public class TreeSelect implements Serializable {
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> childrens;
|
||||
|
||||
// 按钮列表
|
||||
private List<TreeNode> list;
|
||||
|
||||
// 是否选中
|
||||
private Boolean show;
|
||||
|
||||
public Boolean getShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public void setShow(Boolean show) {
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
public List<TreeNode> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<TreeNode> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public TreeSelect()
|
||||
{
|
||||
|
||||
@ -44,6 +66,8 @@ public class TreeSelect implements Serializable {
|
||||
this.id = menu.getId();
|
||||
this.label = menu.getName();
|
||||
this.childrens = menu.getChildrens().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
this.list = menu.getList();
|
||||
this.show = menu.getShow();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
|
@ -15,6 +15,11 @@ public class RoleDto {
|
||||
* */
|
||||
private Integer merchantId;
|
||||
|
||||
/**
|
||||
* 机构ID
|
||||
* */
|
||||
private Integer storeId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ -38,6 +43,13 @@ public class RoleDto {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public Integer getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(Integer storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
|
@ -37,6 +37,20 @@ public interface SourceService extends IService<TSource> {
|
||||
*/
|
||||
List<TreeNode> getSourceTree(Integer merchantId);
|
||||
|
||||
/**
|
||||
* 获取菜单的属性结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TreeNode> getSourceTree2(Integer merchantId,List<Long> checkedKeys);
|
||||
|
||||
/**
|
||||
* 获取菜单的属性结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TreeNode> getSourceTree1(Integer merchantId);
|
||||
|
||||
/**
|
||||
* 根据菜单ID集合查询菜单列表信息
|
||||
*
|
||||
|
@ -332,7 +332,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
queryWrapper.eq("if_delete","0");
|
||||
staff = ljStaffMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(staff)) {
|
||||
staff.setStaffCode("https://www.tuofeng.cc/oilRefuel?storeId="+storeId+"&staffId="+staff.getId());
|
||||
staff.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId="+storeId+"&staffId="+staff.getId());
|
||||
ljStaffMapper.updateById(staff);
|
||||
|
||||
// LJStaff staff1 = ljStaffMapper.selectById(staff.getId());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.common.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.common.domain.TreeSelect;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -24,7 +25,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 菜单管理接口实现类
|
||||
*
|
||||
* <p>
|
||||
* Created by FSQ
|
||||
* CopyRight https://www.fuint.cn
|
||||
*/
|
||||
@ -46,7 +47,16 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
||||
|
||||
@Override
|
||||
public List<TSource> getAvailableSources1(Integer merchantId) {
|
||||
return tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
|
||||
List<TSource> byStatus1 = tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
|
||||
for (TSource tSource : byStatus1) {
|
||||
List<TSource> byStatusButton = tSourceMapper.findByStatusButton(tSource.getSourceId(), StatusEnum.ENABLED.getKey());
|
||||
TSource tSource1 = new TSource();
|
||||
tSource1.setSourceName("选中");
|
||||
tSource1.setSourceId(tSource.getSourceId());
|
||||
byStatusButton.add(tSource1);
|
||||
tSource.setList(byStatusButton);
|
||||
}
|
||||
return byStatus1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,6 +84,147 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
||||
sourceTreeNode.setIsMenu(tSource.getIsMenu());
|
||||
sourceTreeNode.setStatus(tSource.getStatus());
|
||||
sourceTreeNode.setPerms(tSource.getPath().replaceAll("/", ":"));
|
||||
List<TreeNode> treesChildrens = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(tSource.getList())){
|
||||
TreeNode treeNode = null;
|
||||
for (TSource children : tSource.getList()) {
|
||||
treeNode = new TreeNode();
|
||||
treeNode.setName(children.getSourceName());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceId())) treeNode.setId(children.getSourceId());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceLevel())) treeNode.setLevel(children.getSourceLevel());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceStyle())) treeNode.setSort((children.getSourceStyle() == null || StringUtil.isEmpty(tSource.getSourceStyle())) ? 0 : Integer.parseInt(tSource.getSourceStyle()));
|
||||
if (ObjectUtil.isNotEmpty(children.getPath())) treeNode.setPath(children.getPath());
|
||||
if (ObjectUtil.isNotEmpty(children.getParentId())) treeNode.setpId(children.getParentId());
|
||||
if (ObjectUtil.isNotEmpty(children.getNewIcon())) treeNode.setIcon(children.getNewIcon());
|
||||
if (ObjectUtil.isNotEmpty(children.getIsMenu())) treeNode.setIsMenu(children.getIsMenu());
|
||||
if (ObjectUtil.isNotEmpty(children.getStatus())) treeNode.setStatus(children.getStatus());
|
||||
if (ObjectUtil.isNotEmpty(children.getPath())) treeNode.setPerms(children.getPath().replaceAll("/", ":"));
|
||||
treesChildrens.add(treeNode);
|
||||
}
|
||||
}
|
||||
sourceTreeNode.setList(treesChildrens);
|
||||
if (tSource.getParentId() != null) {
|
||||
sourceTreeNode.setpId(tSource.getParentId());
|
||||
} else {
|
||||
sourceTreeNode.setpId(0);
|
||||
}
|
||||
trees.add(sourceTreeNode);
|
||||
}
|
||||
}
|
||||
return trees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单的属性结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TreeNode> getSourceTree2(Integer merchantId,List<Long> checkedKeys) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// List<TSource> tSources = getAvailableSources(merchantId);
|
||||
// if (nowAccountInfo.getRoleIds().equals("14")) tSources = getAvailableSources1(1);
|
||||
List<TSource> tSources = getAvailableSources1(merchantId);
|
||||
List<TreeNode> trees = new ArrayList<>();
|
||||
if (tSources != null && tSources.size() > 0) {
|
||||
TreeNode sourceTreeNode = null;
|
||||
for (TSource tSource : tSources) {
|
||||
sourceTreeNode = new TreeNode();
|
||||
sourceTreeNode.setName(tSource.getSourceName());
|
||||
sourceTreeNode.setId(tSource.getSourceId());
|
||||
sourceTreeNode.setLevel(tSource.getSourceLevel());
|
||||
sourceTreeNode.setSort((tSource.getSourceStyle() == null || StringUtil.isEmpty(tSource.getSourceStyle())) ? 0 : Integer.parseInt(tSource.getSourceStyle()));
|
||||
sourceTreeNode.setPath(tSource.getPath());
|
||||
sourceTreeNode.setIcon(tSource.getNewIcon());
|
||||
sourceTreeNode.setIsMenu(tSource.getIsMenu());
|
||||
sourceTreeNode.setStatus(tSource.getStatus());
|
||||
sourceTreeNode.setPerms(tSource.getPath().replaceAll("/", ":"));
|
||||
sourceTreeNode.setShow(false);
|
||||
for (Long checkedKey : checkedKeys) {
|
||||
if (checkedKey.compareTo(Long.valueOf(tSource.getSourceId()))==0){
|
||||
sourceTreeNode.setShow(true);
|
||||
}
|
||||
}
|
||||
List<TreeNode> treesChildrens = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(tSource.getList())){
|
||||
TreeNode treeNode = null;
|
||||
for (TSource children : tSource.getList()) {
|
||||
treeNode = new TreeNode();
|
||||
treeNode.setName(children.getSourceName());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceId())) treeNode.setId(children.getSourceId());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceLevel())) treeNode.setLevel(children.getSourceLevel());
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceStyle())) treeNode.setSort((children.getSourceStyle() == null || StringUtil.isEmpty(tSource.getSourceStyle())) ? 0 : Integer.parseInt(tSource.getSourceStyle()));
|
||||
if (ObjectUtil.isNotEmpty(children.getPath())) treeNode.setPath(children.getPath());
|
||||
if (ObjectUtil.isNotEmpty(children.getParentId())) treeNode.setpId(children.getParentId());
|
||||
if (ObjectUtil.isNotEmpty(children.getNewIcon())) treeNode.setIcon(children.getNewIcon());
|
||||
if (ObjectUtil.isNotEmpty(children.getIsMenu())) treeNode.setIsMenu(children.getIsMenu());
|
||||
if (ObjectUtil.isNotEmpty(children.getStatus())) treeNode.setStatus(children.getStatus());
|
||||
if (ObjectUtil.isNotEmpty(children.getPath())) treeNode.setPerms(children.getPath().replaceAll("/", ":"));
|
||||
treeNode.setShow(false);
|
||||
for (Long checkedKey : checkedKeys) {
|
||||
if (ObjectUtil.isNotEmpty(children.getSourceId()) && checkedKey.compareTo(Long.valueOf(children.getSourceId()))==0){
|
||||
treeNode.setShow(true);
|
||||
}
|
||||
}
|
||||
treesChildrens.add(treeNode);
|
||||
}
|
||||
}
|
||||
sourceTreeNode.setList(treesChildrens);
|
||||
if (tSource.getParentId() != null) {
|
||||
sourceTreeNode.setpId(tSource.getParentId());
|
||||
} else {
|
||||
sourceTreeNode.setpId(0);
|
||||
}
|
||||
trees.add(sourceTreeNode);
|
||||
}
|
||||
}
|
||||
return trees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单的属性结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TreeNode> getSourceTree1(Integer merchantId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// List<TSource> tSources = getAvailableSources(merchantId);
|
||||
// if (nowAccountInfo.getRoleIds().equals("14")) tSources = getAvailableSources1(1);
|
||||
List<TSource> tSources = getAvailableSources(merchantId);
|
||||
List<TreeNode> trees = new ArrayList<>();
|
||||
if (tSources != null && tSources.size() > 0) {
|
||||
TreeNode sourceTreeNode = null;
|
||||
for (TSource tSource : tSources) {
|
||||
sourceTreeNode = new TreeNode();
|
||||
sourceTreeNode.setName(tSource.getSourceName());
|
||||
sourceTreeNode.setId(tSource.getSourceId());
|
||||
sourceTreeNode.setLevel(tSource.getSourceLevel());
|
||||
sourceTreeNode.setSort((tSource.getSourceStyle() == null || StringUtil.isEmpty(tSource.getSourceStyle())) ? 0 : Integer.parseInt(tSource.getSourceStyle()));
|
||||
sourceTreeNode.setPath(tSource.getPath());
|
||||
sourceTreeNode.setIcon(tSource.getNewIcon());
|
||||
sourceTreeNode.setIsMenu(tSource.getIsMenu());
|
||||
sourceTreeNode.setStatus(tSource.getStatus());
|
||||
sourceTreeNode.setPerms(tSource.getPath().replaceAll("/", ":"));
|
||||
List<TreeNode> treesChildrens = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(tSource.getList())){
|
||||
TreeNode treeNode = null;
|
||||
for (TSource children : tSource.getList()) {
|
||||
treeNode = new TreeNode();
|
||||
treeNode.setName(children.getSourceName());
|
||||
treeNode.setId(children.getSourceId());
|
||||
treeNode.setLevel(children.getSourceLevel());
|
||||
treeNode.setSort((children.getSourceStyle() == null || StringUtil.isEmpty(tSource.getSourceStyle())) ? 0 : Integer.parseInt(tSource.getSourceStyle()));
|
||||
treeNode.setPath(children.getPath());
|
||||
treeNode.setpId(children.getParentId());
|
||||
treeNode.setIcon(children.getNewIcon());
|
||||
treeNode.setIsMenu(children.getIsMenu());
|
||||
treeNode.setStatus(children.getStatus());
|
||||
treeNode.setPerms(children.getPath().replaceAll("/", ":"));
|
||||
treesChildrens.add(treeNode);
|
||||
}
|
||||
}
|
||||
sourceTreeNode.setList(treesChildrens);
|
||||
if (tSource.getParentId() != null) {
|
||||
sourceTreeNode.setpId(tSource.getParentId());
|
||||
} else {
|
||||
|
@ -64,7 +64,7 @@ public class BackendSourceController extends BaseController {
|
||||
return getFailureResult(1001, "请先登录");
|
||||
}
|
||||
|
||||
List<TreeNode> sources = sSourceService.getSourceTree(accountInfo.getMerchantId());
|
||||
List<TreeNode> sources = sSourceService.getSourceTree1(accountInfo.getMerchantId());
|
||||
return getSuccessResult(sources);
|
||||
}
|
||||
|
||||
@ -273,7 +273,12 @@ public class BackendSourceController extends BaseController {
|
||||
if (accountInfo == null) {
|
||||
return getFailureResult(1001, "请先登录");
|
||||
}
|
||||
|
||||
List<TreeNode> sources = sSourceService.getSourceTree(ObjectUtil.isNotEmpty(account.getMerchantId()) ? account.getMerchantId() : null);
|
||||
if (ObjectUtil.isNotEmpty(account.getRoleId())){
|
||||
List<Long> checkedKeys = tDutyService.getSourceIdsByDutyId(account.getRoleId());
|
||||
sources = sSourceService.getSourceTree2(ObjectUtil.isNotEmpty(account.getMerchantId()) ? account.getMerchantId() : null,checkedKeys);
|
||||
}
|
||||
List<TreeSelect> data = sourceService.buildMenuTreeSelect(sources);
|
||||
|
||||
return getSuccessResult(data);
|
||||
|
@ -210,6 +210,7 @@ public class BackendDutyController extends BaseController {
|
||||
roleInfo.setName(htDuty.getDutyName());
|
||||
roleInfo.setType(htDuty.getDutyType());
|
||||
roleInfo.setStatus(htDuty.getStatus());
|
||||
roleInfo.setStoreId(htDuty.getStoreId());
|
||||
roleInfo.setDescription(htDuty.getDescription());
|
||||
|
||||
result.put("roleInfo", roleInfo);
|
||||
|
@ -21,4 +21,6 @@ public interface TSourceMapper extends BaseMapper<TSource> {
|
||||
|
||||
List<TSource> findByStatus1(@Param("merchantId") Integer merchantId, @Param("status") String status);
|
||||
|
||||
List<TSource> findByStatusButton(@Param("parentId") Integer parentId, @Param("status") String status);
|
||||
|
||||
}
|
||||
|
@ -79,4 +79,7 @@ public class TAccount extends BaseEntity implements Serializable {
|
||||
private String deptType;
|
||||
// @TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer roleId;
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.fuint.repository.model;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
@ -70,5 +73,7 @@ public class TSource implements Serializable {
|
||||
@ApiModelProperty("菜单图标")
|
||||
private String icon;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<TSource> list;
|
||||
|
||||
}
|
||||
|
@ -31,10 +31,18 @@
|
||||
</select>
|
||||
<select id="findByStatus1" resultType="com.fuint.repository.model.TSource">
|
||||
select * from t_source s
|
||||
where s.status = #{status}
|
||||
where s.status = #{status} and s.is_menu = '1'
|
||||
<if test="merchantId != null and merchantId > 0">
|
||||
and s.merchant_id = #{merchantId}
|
||||
</if>
|
||||
order by source_style asc
|
||||
</select>
|
||||
<select id="findByStatusButton" resultType="com.fuint.repository.model.TSource">
|
||||
select * from t_source s
|
||||
where s.status = #{status} and s.is_menu = '0'
|
||||
<if test="parentId != null">
|
||||
and s.parent_id = #{parentId}
|
||||
</if>
|
||||
order by source_style asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -89,7 +89,7 @@
|
||||
storeId: '',
|
||||
show: false,
|
||||
options: {
|
||||
code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
|
||||
code: 'https://oilapi.youkerr.com/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
|
||||
.getStorageSync('userId') + '&type=yaoqingyouli',
|
||||
// code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + ' &userId=' + uni
|
||||
// .getStorageSync('userId'), // 生成二维码的值
|
||||
@ -99,7 +99,7 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let codes = 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') +
|
||||
let codes = 'https://oilapi.youkerr.com/oily?storeId=' + uni.getStorageSync('storeId') +
|
||||
'&userId=' + uni.getStorageSync('userId') + '&type=yaoqingyouli'
|
||||
console.log(codes);
|
||||
this.query.storeId = uni.getStorageSync("storeId");
|
||||
|
@ -29,7 +29,7 @@
|
||||
pageSize: 10,
|
||||
totalPage: '',
|
||||
options: {
|
||||
code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
|
||||
code: 'https://oilapi.youkerr.com/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
|
||||
.getStorageSync('userId') + '&type=yaoqingyouli',
|
||||
// code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + ' &userId=' + uni
|
||||
// .getStorageSync('userId'), // 生成二维码的值
|
||||
|
Loading…
Reference in New Issue
Block a user