页面跳转,组织架构
This commit is contained in:
parent
4f7abd2c45
commit
457953c715
@ -57,6 +57,7 @@ Vue.prototype.handleTree = handleTree
|
||||
Vue.prototype.imgurl = 'http://192.168.0.138:8008'
|
||||
// Vue.prototype.pcUrl = 'http://192.168.0.178:83/'
|
||||
Vue.prototype.pcUrl = 'https://cashier.youkerr.com/'
|
||||
Vue.prototype.ztUrl = 'http://localhost:82/'
|
||||
const Collapse= false
|
||||
Vue.prototype.isCollapse = Collapse
|
||||
|
||||
|
@ -7,6 +7,7 @@ import {getToken, removeToken, setToken} from '@/utils/auth'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import { loginVerificationApi } from '@/api/login'
|
||||
import BigNumber from 'bignumber.js';
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
@ -14,7 +15,7 @@ const whiteList = ['/login', '/auth-redirect']
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start()
|
||||
console.log(to,from,next)
|
||||
|
||||
if (to.query.entrance) {
|
||||
try {
|
||||
const res = await loginVerificationApi(to.query.entrance);
|
||||
@ -26,11 +27,15 @@ router.beforeEach(async (to, from, next) => {
|
||||
console.error("An error occurred:", error);
|
||||
}
|
||||
}
|
||||
if (to.path === '/resource_oilstore') {
|
||||
if (Cookies.get("IS_BK_LOGIN")) {
|
||||
setToken(JSON.parse(Cookies.get("IS_BK_LOGIN")).token);
|
||||
}
|
||||
}
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
}else {
|
||||
@ -39,11 +44,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
isRelogin.show = true
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
console.log("111116")
|
||||
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
console.log("111117")
|
||||
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
|
@ -85,6 +85,12 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '系统首页', icon: 'dashboard', affix: true }
|
||||
},
|
||||
{
|
||||
path: 'resource_oilstore',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '系统首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { login, logout, getInfo,gettellogin } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
@ -53,8 +54,14 @@ const user = {
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, captchaCode, uuid).then(res => {
|
||||
setToken(res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
console.log("user_58",res.data)
|
||||
if (res.data.ownerId == "3") {
|
||||
setToken(res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
Cookies.remove('IS_ZT_LOGIN');
|
||||
}else {
|
||||
Cookies.set("IS_ZT_LOGIN", JSON.stringify(res.data));
|
||||
}
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
@ -279,14 +279,19 @@ export default {
|
||||
Cookies.remove('rememberMe');
|
||||
}
|
||||
app.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
}).catch(() => {
|
||||
app.loading = false;
|
||||
// if (app.captchaOnOff) {
|
||||
// app.getCode();
|
||||
// }
|
||||
});
|
||||
}
|
||||
if (Cookies.get("IS_ZT_LOGIN")) {
|
||||
location.replace(this.ztUrl+"resource_oilbank");
|
||||
}else {
|
||||
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
app.loading = false;
|
||||
// if (app.captchaOnOff) {
|
||||
// app.getCode();
|
||||
// }
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +186,15 @@ export function deptTreeSelect(data) {
|
||||
|
||||
})
|
||||
}
|
||||
// 查询部门下拉树结构
|
||||
export function selectChildByDeptId(data) {
|
||||
return request({
|
||||
url: '/system/dept/selectChildByDeptId',
|
||||
method: 'get',
|
||||
params: data
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 合作商审核
|
||||
export function partnerVerifyPass(data) {
|
||||
|
@ -54,6 +54,7 @@ Vue.prototype.handleTree = handleTree
|
||||
// Vue.prototype.pcUrl = 'http://192.168.31.96:82/'
|
||||
// Vue.prototype.pcUrl = 'http://47.95.206.185:85/'
|
||||
Vue.prototype.pcUrl = 'https://www.youkerr.com/'
|
||||
Vue.prototype.bkUrl = 'http://localhost:81/' //跳转油站
|
||||
|
||||
// 全局组件挂载
|
||||
Vue.component('DictTag', DictTag)
|
||||
|
@ -3,8 +3,10 @@ import store from '@/store'
|
||||
import { Message } from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { getToken,setToken } from '@/utils/auth'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
@ -12,14 +14,9 @@ const whiteList = ['/login', '/auth-redirect']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
// this.$store.commit('token/setToken', 'your_token_value');
|
||||
// const currentToken = this.$store.state.token.token;
|
||||
// 调用 mutations 更新 token
|
||||
// store.commit('setToken', '');
|
||||
|
||||
// 读取状态
|
||||
// const currentToken = store.state.token;
|
||||
// console.log('Current Token:', currentToken.token);
|
||||
if (to.path === '/resource_oilbank') {
|
||||
setToken(JSON.parse(Cookies.get("IS_ZT_LOGIN")).token);
|
||||
}
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
|
@ -66,6 +66,12 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/Service/index.vue'),
|
||||
name: 'Index',
|
||||
meta: { title: '系统首页', icon: 'dashboard', affix: true }
|
||||
},
|
||||
{
|
||||
path: 'resource_oilbank',
|
||||
component: () => import('@/views/Service/index.vue'),
|
||||
name: 'Index',
|
||||
meta: { title: '系统首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { login, logout, getInfo } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
@ -53,8 +54,18 @@ const user = {
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, captchaCode, uuid).then(res => {
|
||||
setToken(res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
|
||||
|
||||
console.log("user_58",res.data)
|
||||
if (res.data.ownerId !== "3") {
|
||||
setToken(res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
Cookies.remove('IS_BK_LOGIN');
|
||||
}else {
|
||||
Cookies.set("IS_BK_LOGIN", JSON.stringify(res.data));
|
||||
}
|
||||
|
||||
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
@ -37,25 +37,44 @@
|
||||
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
<el-form-item label="用户名" prop="accountName">
|
||||
<el-form-item label="" prop="accountName">
|
||||
<el-input
|
||||
v-model="queryParams.accountName"
|
||||
placeholder="请输入用户名"
|
||||
placeholder="用户名"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="真实姓名" prop="accountName">
|
||||
<el-form-item label="" prop="accountName">
|
||||
<el-input
|
||||
v-model="queryParams.realName"
|
||||
placeholder="请输入真实姓名"
|
||||
placeholder="真实姓名"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="accountStatus">
|
||||
<el-form-item label="" prop="accountStatus">
|
||||
<el-select
|
||||
v-model="queryParams.deptId"
|
||||
placeholder="所属机构"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptListSelect"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item label="" prop="accountStatus">
|
||||
<el-select
|
||||
v-model="queryParams.accountStatus"
|
||||
placeholder="用户状态"
|
||||
@ -66,9 +85,9 @@
|
||||
<el-option key="0" label="禁用" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -78,7 +97,6 @@
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增
|
||||
@ -615,25 +633,40 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="角色信息" name="duty">
|
||||
<el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="dutyName">
|
||||
<el-form-item label="" prop="dutyName">
|
||||
<el-input
|
||||
v-model="queryParams1.dutyName"
|
||||
placeholder="请输入角色名称"
|
||||
placeholder="角色名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色状态" prop="status">
|
||||
<el-form-item label="" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams1.status"
|
||||
placeholder="全部"
|
||||
placeholder="角色状态"
|
||||
clearable
|
||||
>
|
||||
<el-option label="启用" value="A"></el-option>
|
||||
<el-option label="禁用" value="D"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item label="" prop="accountStatus">
|
||||
<el-select
|
||||
v-model="queryParams1.deptId"
|
||||
placeholder="所属机构"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptListSelect"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -894,7 +927,7 @@ import {
|
||||
deptedit,
|
||||
deptDelete,
|
||||
Userlist,
|
||||
jklist, getDutyList, isTopLevelNodesApi,getMaxNumber
|
||||
jklist, getDutyList, isTopLevelNodesApi, getMaxNumber, selectChildByDeptId
|
||||
} from "@/api/system/Site/site";
|
||||
// import { getStoreStaffList } from "@/api/staff";
|
||||
import { getAccountList, getAccount, delAccount, addAccount, updateAccount, resetAccountPwd, changeAccountStatus } from "@/api/system/account";
|
||||
@ -1007,6 +1040,7 @@ export default {
|
||||
pageSize:10,
|
||||
// 当做机构id使用
|
||||
storeId:"",
|
||||
deptId:''
|
||||
},
|
||||
total1:0,
|
||||
dutyList:[],
|
||||
@ -1055,6 +1089,7 @@ export default {
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
||||
},
|
||||
deptListSelect:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -1193,6 +1228,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.selectChildByDeptIdApi();
|
||||
|
||||
|
||||
},
|
||||
@ -1766,20 +1802,21 @@ export default {
|
||||
console.log("data",data)
|
||||
console.log("store",store)
|
||||
let isAdd = data.deptType == '3'
|
||||
|
||||
return (
|
||||
<span class="custom-tree-node">
|
||||
<span class="custom-tree-box">{node.label}</span>
|
||||
<span>
|
||||
{!isAdd ?
|
||||
<el-button size="mini" type="text" on-click={() => this.append(data)}>新增</el-button>
|
||||
<el-button v-if="!isAdd" size="mini" type="text" on-click={() => this.append(data)}>新增</el-button>
|
||||
: null
|
||||
}
|
||||
{node.level !== 1 ?
|
||||
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>删除</el-button>
|
||||
: null
|
||||
}
|
||||
</span>
|
||||
</span>);
|
||||
</span>
|
||||
</span>);
|
||||
},
|
||||
|
||||
|
||||
@ -1819,8 +1856,11 @@ export default {
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
},
|
||||
selectChildByDeptIdApi() {
|
||||
selectChildByDeptId().then(res=>{
|
||||
this.deptListSelect = res.data
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
@ -280,8 +280,14 @@ export default {
|
||||
Cookies.remove('rememberMe');
|
||||
}
|
||||
app.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
|
||||
if (Cookies.get("IS_BK_LOGIN")) {
|
||||
location.replace(this.bkUrl+"resource_oilstore");
|
||||
}else {
|
||||
app.$router.push({ path: "/Service/index" }).catch(()=>{});
|
||||
}
|
||||
|
||||
// app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
app.$router.push({ path: "/Service/index" }).catch(()=>{});
|
||||
}).catch(() => {
|
||||
app.loading = false;
|
||||
if (app.captchaOnOff) {
|
||||
|
@ -5,6 +5,10 @@
|
||||
SELECT td.*,sd.dept_name FROM t_duty td
|
||||
left join sys_dept sd on sd.dept_id = td.store_id
|
||||
<where>
|
||||
|
||||
<if test="duty.deptId != null and duty.deptId != ''">
|
||||
and td.store_id = #{duty.deptId}
|
||||
</if>
|
||||
<if test="duty.dutyName != null and duty.dutyName != ''">
|
||||
and td.duty_name like concat('%', #{duty.dutyName}, '%')
|
||||
</if>
|
||||
|
@ -102,9 +102,9 @@ public class BackendLoginController extends BaseController {
|
||||
* 后台登录
|
||||
* */
|
||||
@ApiOperation(value = "油站登录")
|
||||
@RequestMapping(value="/doLogin", method = RequestMethod.POST)
|
||||
@RequestMapping(value="/doLogin2", method = RequestMethod.POST)
|
||||
@OperationServiceLog(description = "登录后台系统")
|
||||
public ResponseObject doLogin(HttpServletRequest request, @RequestBody LoginRequest loginRequest) {
|
||||
public ResponseObject doLogin2(HttpServletRequest request, @RequestBody LoginRequest loginRequest) {
|
||||
String userAgent = request.getHeader("user-agent");
|
||||
String accountName = loginRequest.getUsername();
|
||||
String password = loginRequest.getPassword();
|
||||
@ -165,6 +165,77 @@ public class BackendLoginController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "油站登录")
|
||||
@RequestMapping(value="/doLogin", method = RequestMethod.POST)
|
||||
@OperationServiceLog(description = "登录后台系统")
|
||||
public ResponseObject doLogin(HttpServletRequest request, @RequestBody LoginRequest loginRequest) {
|
||||
String userAgent = request.getHeader("user-agent");
|
||||
String accountName = loginRequest.getUsername();
|
||||
String password = loginRequest.getPassword();
|
||||
String captchaCode = loginRequest.getCaptchaCode();
|
||||
String uuid = loginRequest.getUuid();
|
||||
|
||||
LambdaQueryWrapper<TAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TAccount::getAccountName, accountName);
|
||||
TAccount one = accountService.getOne(queryWrapper);
|
||||
// if (ObjectUtils.isNotEmpty(one) && ObjectUtils.isNotEmpty(one.getOwnerId()) && one.getOwnerId().toString().equals("2")
|
||||
// ||ObjectUtils.isNotEmpty(one) && ObjectUtils.isNotEmpty(one.getOwnerId()) && one.getOwnerId().toString().equals("1") ){
|
||||
// return getFailureResult(201,"请登录终台端!");
|
||||
// }
|
||||
|
||||
LambdaQueryWrapper<SysDept> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(SysDept::getDeptId,one.getDeptId());
|
||||
SysDept one1 = iSysDeptService.getOne(queryWrapper1);
|
||||
if (ObjectUtils.isNotEmpty(one1) && ObjectUtils.isNotEmpty(one1.getTurnoverType()) && one1.getTurnoverType().equals("2")){
|
||||
if (ObjectUtils.isNotEmpty(one1.getTurnoverEndTime())){
|
||||
Date date = new Date();
|
||||
Date turnoverEndTime = one1.getTurnoverEndTime();
|
||||
if (date.compareTo(turnoverEndTime)>0){
|
||||
return getFailureResult(201,"请付费后再登录!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Boolean captchaVerify = captchaService.checkCodeByUuid(captchaCode, uuid);
|
||||
if (!captchaVerify) {
|
||||
return getFailureResult(201,"图形验证码有误");
|
||||
}
|
||||
|
||||
if (StringUtil.isEmpty(accountName)|| StringUtil.isEmpty(password) || StringUtil.isEmpty(captchaCode)) {
|
||||
return getFailureResult(Constants.HTTP_RESPONSE_CODE_PARAM_ERROR);
|
||||
} else {
|
||||
AccountInfo accountInfo = accountService.getAccountByName(loginRequest.getUsername());
|
||||
if (accountInfo == null) {
|
||||
return getFailureResult(Constants.HTTP_RESPONSE_CODE_USER_LOGIN_ERROR);
|
||||
}
|
||||
TAccount tAccount = accountService.getAccountInfoById(accountInfo.getId());
|
||||
String myPassword = tAccount.getPassword();
|
||||
String inputPassword = accountService.getEntryptPassword(password, tAccount.getSalt());
|
||||
if (!myPassword.equals(inputPassword) || !tAccount.getAccountStatus().toString().equals("1")) {
|
||||
return getFailureResult(201, "账号或密码有误");
|
||||
}
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
UsernamePasswordToken info = new UsernamePasswordToken(accountInfo.getAccountName(), tAccount.getPassword());
|
||||
subject.login(info);
|
||||
String token = TokenUtil.generateToken(userAgent, accountInfo.getId());
|
||||
accountInfo.setToken(token);
|
||||
TokenUtil.saveAccountToken(accountInfo);
|
||||
LoginResponse response = new LoginResponse();
|
||||
response.setLogin(true);
|
||||
response.setToken(token);
|
||||
if (ObjectUtil.isEmpty(one.getOwnerId())) {
|
||||
one.setOwnerId(-1); //设置为普通员工并进行跳转
|
||||
}
|
||||
response.setOwnerId(one.getOwnerId().toString());
|
||||
response.setTokenCreatedTime(new Date());
|
||||
return getSuccessResult(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后台登录
|
||||
* */
|
||||
@ -248,9 +319,9 @@ public class BackendLoginController extends BaseController {
|
||||
LambdaQueryWrapper<TAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TAccount::getAccountName, accountName);
|
||||
TAccount one = accountService.getOne(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(one) && ObjectUtils.isNotEmpty(one.getOwnerId()) && one.getOwnerId().toString().equals("3")){
|
||||
return getFailureResult(201,"请登录油站端!");
|
||||
}
|
||||
// if (ObjectUtils.isNotEmpty(one) && ObjectUtils.isNotEmpty(one.getOwnerId()) && one.getOwnerId().toString().equals("3")){
|
||||
// return getFailureResult(201,"请登录油站端!");
|
||||
// }
|
||||
|
||||
LambdaQueryWrapper<SysDept> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(SysDept::getDeptId,one.getDeptId());
|
||||
@ -297,6 +368,10 @@ public class BackendLoginController extends BaseController {
|
||||
response.setLogin(true);
|
||||
response.setToken(token);
|
||||
response.setTokenCreatedTime(new Date());
|
||||
if (ObjectUtils.isEmpty(one.getOwnerId())) {
|
||||
one.setOwnerId(2);
|
||||
}
|
||||
response.setOwnerId(one.getOwnerId().toString());
|
||||
return getSuccessResult(response);
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,5 @@ public class LoginResponse implements Serializable {
|
||||
private Integer storeId;
|
||||
private Integer accountId;
|
||||
private String phone;
|
||||
private String ownerId;
|
||||
}
|
||||
|
@ -157,6 +157,16 @@ public class SysDeptController extends BaseController
|
||||
return getSuccessResult(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户的deptid查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectChildByDeptId")
|
||||
public ResponseObject selectChildByDeptId() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
return getSuccessResult(deptService.selectChildByDeptId(nowAccountInfo.getDeptId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树列表
|
||||
*/
|
||||
|
@ -64,6 +64,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
|
||||
*/
|
||||
public int selectNormalChildrenDeptById(Long deptId);
|
||||
|
||||
List<SysDeptVo> selectChildByDeptId(Long deptId);
|
||||
|
||||
int selectStatusByParentId(Long parentId);
|
||||
|
||||
|
@ -103,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
select count(*) from sys_dept where status = 'qy' and find_in_set(#{deptId}, ancestors) and if_delete = 0
|
||||
</select>
|
||||
<select id="selectChildByDeptId" resultType="com.fuint.system.dept.vo.SysDeptVo">
|
||||
select * from sys_dept where status = 'qy' and (find_in_set(#{deptId}, ancestors) or dept_id = #{deptId}) and if_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="selectStatusByParentId" resultType="java.lang.Integer">
|
||||
select count(*) from sys_dept where status = 'jy' and dept_id= #{parentId} and if_delete = 0
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.system.dept.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.common.domain.TreeSelect;
|
||||
import com.fuint.system.dept.entity.SysDept;
|
||||
import com.fuint.system.dept.vo.SysDeptVo;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@ -75,6 +76,7 @@ public interface ISysDeptService extends IService<SysDept>
|
||||
* @return 子部门数
|
||||
*/
|
||||
public int selectNormalChildrenDeptById(Long deptId);
|
||||
List<SysDeptVo> selectChildByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询是否有父级部门未启用
|
||||
|
@ -26,6 +26,7 @@ import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.system.dept.entity.SysDept;
|
||||
import com.fuint.system.dept.mapper.SysDeptMapper;
|
||||
import com.fuint.system.dept.service.ISysDeptService;
|
||||
import com.fuint.system.dept.vo.SysDeptVo;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -207,6 +208,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
{
|
||||
return baseMapper.selectNormalChildrenDeptById(deptId);
|
||||
}
|
||||
@Override
|
||||
public List<SysDeptVo> selectChildByDeptId(Long deptId)
|
||||
{
|
||||
return baseMapper.selectChildByDeptId(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否有父级部门未启用
|
||||
|
@ -54,5 +54,7 @@ public class TDuty extends BaseEntity implements Serializable {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
@TableField(exist = false)
|
||||
private String deptId;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user