初始化文件名
This commit is contained in:
parent
9bfb1cea20
commit
bca1192e18
|
|
@ -136,7 +136,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button v-if="scope.row.isPublic === '2'"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-download"
|
||||||
@click="handleDownload(scope.row)"
|
@click="handleDownload(scope.row)"
|
||||||
>下载
|
>下载
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -173,8 +173,15 @@
|
||||||
|
|
||||||
<el-dialog :title="fileForm.title" :visible.sync="fileForm.open" width="500px" append-to-body>
|
<el-dialog :title="fileForm.title" :visible.sync="fileForm.open" width="500px" append-to-body>
|
||||||
<el-form ref="uploadFrom" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="uploadFrom" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="文件夹">
|
<el-form-item v-show="isAdd" label="是否公开">
|
||||||
<el-select v-model="form.pId" multiple placeholder="请选择">
|
<el-radio-group v-model="form.isPublic" @change="isPublicChange">
|
||||||
|
<el-radio label="1">公开</el-radio>
|
||||||
|
<el-radio label="2">保护</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<div v-show="isPublicShow">
|
||||||
|
<el-form-item v-show="isAdd" label="文件夹">
|
||||||
|
<el-select v-model="form.pId" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in folderOptions"
|
v-for="item in folderOptions"
|
||||||
:key="item.fileId"
|
:key="item.fileId"
|
||||||
|
|
@ -183,7 +190,7 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色">
|
<el-form-item label="角色" prop="roleIds">
|
||||||
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in roleOptions"
|
v-for="item in roleOptions"
|
||||||
|
|
@ -194,24 +201,19 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否保护">
|
</div>
|
||||||
<el-radio-group v-model="form.isPublic">
|
|
||||||
<el-radio label="1">不保护</el-radio>
|
|
||||||
<el-radio label="2">保护</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<div v-show="isAdd">
|
<div v-show="isAdd">
|
||||||
<el-form-item v-show="isAdd" label="文件类型">
|
<el-form-item label="文件类型">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="fileForm.fileType"
|
v-model="fileForm.fileType"
|
||||||
active-text="文件"
|
active-text="文件"
|
||||||
inactive-text="图片" @change="fileTypeChange">
|
inactive-text="图片" @change="fileTypeChange">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图片上传" v-show="!fileForm.fileType">
|
<el-form-item label="图片上传" v-show="!fileForm.fileType" >
|
||||||
<ImageUpload v-model="fileForm.url" v-on:changeAddress="changeAddress"/>
|
<ImageUpload v-model="fileForm.url" v-on:changeAddress="changeAddress"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文件上传" v-show="fileForm.fileType">
|
<el-form-item label="文件上传" v-show="fileForm.fileType" >
|
||||||
<FileUpload v-model="fileForm.url" v-on:changeAddress="changeAddress"/>
|
<FileUpload v-model="fileForm.url" v-on:changeAddress="changeAddress"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -238,6 +240,17 @@ export default {
|
||||||
FileUpload,
|
FileUpload,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
var checkRoleIds = (rule, value, callback) => {
|
||||||
|
if (this.form.isPublic === "2") {
|
||||||
|
if (value.length === 0) {
|
||||||
|
callback(new Error('角色不能为空'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
fileForm: {
|
fileForm: {
|
||||||
title: "",
|
title: "",
|
||||||
|
|
@ -258,6 +271,7 @@ export default {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
isPublicShow: false,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 文件信息表格数据
|
// 文件信息表格数据
|
||||||
|
|
@ -286,7 +300,11 @@ export default {
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {}
|
rules: {
|
||||||
|
roleIds: [
|
||||||
|
{required: true, validator: checkRoleIds, trigger: 'change'},
|
||||||
|
]
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -300,7 +318,7 @@ export default {
|
||||||
getRoleAll().then(res => {
|
getRoleAll().then(res => {
|
||||||
this.roleOptions = res.data
|
this.roleOptions = res.data
|
||||||
})
|
})
|
||||||
getFolder().then(res =>{
|
getFolder().then(res => {
|
||||||
this.folderOptions = res.data
|
this.folderOptions = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -322,6 +340,12 @@ export default {
|
||||||
this.form.fileAddr = ""
|
this.form.fileAddr = ""
|
||||||
this.fileForm.url = ""
|
this.fileForm.url = ""
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*是否公开值改变
|
||||||
|
*/
|
||||||
|
isPublicChange() {
|
||||||
|
this.isPublicShow = (this.form.isPublic !== "1")
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 改变地址
|
* 改变地址
|
||||||
*/
|
*/
|
||||||
|
|
@ -366,13 +390,14 @@ export default {
|
||||||
this.form = {
|
this.form = {
|
||||||
fileId: null,
|
fileId: null,
|
||||||
pId: null,
|
pId: null,
|
||||||
roleIds: null,
|
roleIds: [],
|
||||||
fileName: null,
|
fileName: null,
|
||||||
mapping: null,
|
mapping: null,
|
||||||
fileAddr: null,
|
fileAddr: null,
|
||||||
fileType: null,
|
fileType: null,
|
||||||
isPublic: "1",
|
isPublic: "1",
|
||||||
};
|
};
|
||||||
|
this.isPublicShow = false
|
||||||
this.fileForm.url = null
|
this.fileForm.url = null
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
|
@ -410,6 +435,7 @@ export default {
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.isAdd = false
|
this.isAdd = false
|
||||||
|
this.isPublicShow = true
|
||||||
const fileId = row.fileId || this.ids
|
const fileId = row.fileId || this.ids
|
||||||
getFile(fileId).then(response => {
|
getFile(fileId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
|
@ -421,13 +447,17 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
this.$refs["uploadFrom"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
let roleIds = ""
|
let roleIds = ""
|
||||||
|
if (this.form.isPublic ==="2"){
|
||||||
for (let i = 0; i < this.form.roleIds.length; i++) {
|
for (let i = 0; i < this.form.roleIds.length; i++) {
|
||||||
roleIds += this.form.roleIds[i]
|
roleIds += this.form.roleIds[i]
|
||||||
if (i < this.form.roleIds.length - 1) {
|
if (i < this.form.roleIds.length - 1) {
|
||||||
roleIds += ","
|
roleIds += ","
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.form.roleIds = roleIds
|
this.form.roleIds = roleIds
|
||||||
if (this.form.fileId != null) {
|
if (this.form.fileId != null) {
|
||||||
updateFile(this.form).then(response => {
|
updateFile(this.form).then(response => {
|
||||||
|
|
@ -444,6 +474,8 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,15 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
|
var nametest = (rule, value, callback) =>{
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('请再次输入密码'));
|
||||||
|
} else {
|
||||||
|
console.log(value)
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
@ -221,6 +230,8 @@ export default {
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: "名称不能为空}", trigger: "blur" },
|
{ required: true, message: "名称不能为空}", trigger: "blur" },
|
||||||
|
|
||||||
|
{validator : nametest,trigger: 'blur'}
|
||||||
],
|
],
|
||||||
info: [
|
info: [
|
||||||
{ required: true, message: "信息不能为空}", trigger: "blur" },
|
{ required: true, message: "信息不能为空}", trigger: "blur" },
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.entity.SysLogininfor;
|
import com.hchyun.system.entity.Logininfor;
|
||||||
import com.hchyun.system.service.ISysLogininforService;
|
import com.hchyun.system.service.LogininforService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问记录
|
* 系统访问记录
|
||||||
|
|
@ -27,22 +27,22 @@ import com.hchyun.system.service.ISysLogininforService;
|
||||||
@RequestMapping("/monitor/logininfor")
|
@RequestMapping("/monitor/logininfor")
|
||||||
public class SysLogininforController extends BaseController {
|
public class SysLogininforController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysLogininforService logininforService;
|
private LogininforService logininforService;
|
||||||
|
|
||||||
@PreAuthorize("@hchyun.hasPermi('monitor:logininfor:list')")
|
@PreAuthorize("@hchyun.hasPermi('monitor:logininfor:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysLogininfor logininfor) {
|
public TableDataInfo list(Logininfor logininfor) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
List<Logininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('monitor:logininfor:export')")
|
@PreAuthorize("@hchyun.hasPermi('monitor:logininfor:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysLogininfor logininfor) {
|
public AjaxResult export(Logininfor logininfor) {
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
List<Logininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
ExcelUtil<Logininfor> util = new ExcelUtil<Logininfor>(Logininfor.class);
|
||||||
return util.exportExcel(list, "登录日志");
|
return util.exportExcel(list, "登录日志");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
import com.hchyun.system.service.ISysOperLogService;
|
import com.hchyun.system.service.OperLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志记录
|
* 操作日志记录
|
||||||
|
|
@ -27,22 +27,22 @@ import com.hchyun.system.service.ISysOperLogService;
|
||||||
@RequestMapping("/monitor/operlog")
|
@RequestMapping("/monitor/operlog")
|
||||||
public class SysOperlogController extends BaseController {
|
public class SysOperlogController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysOperLogService operLogService;
|
private OperLogService operLogService;
|
||||||
|
|
||||||
@PreAuthorize("@hchyun.hasPermi('monitor:operlog:list')")
|
@PreAuthorize("@hchyun.hasPermi('monitor:operlog:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysOperLog operLog) {
|
public TableDataInfo list(OperLog operLog) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
List<OperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('monitor:operlog:export')")
|
@PreAuthorize("@hchyun.hasPermi('monitor:operlog:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysOperLog operLog) {
|
public AjaxResult export(OperLog operLog) {
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
List<OperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
ExcelUtil<OperLog> util = new ExcelUtil<OperLog>(OperLog.class);
|
||||||
return util.exportExcel(list, "操作日志");
|
return util.exportExcel(list, "操作日志");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.core.redis.RedisCache;
|
import com.hchyun.common.core.redis.RedisCache;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.entity.SysUserOnline;
|
import com.hchyun.system.entity.UserOnline;
|
||||||
import com.hchyun.system.service.ISysUserOnlineService;
|
import com.hchyun.system.service.UserOnlineService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线用户监控
|
* 在线用户监控
|
||||||
|
|
@ -33,7 +33,7 @@ import com.hchyun.system.service.ISysUserOnlineService;
|
||||||
@RequestMapping("/monitor/online")
|
@RequestMapping("/monitor/online")
|
||||||
public class SysUserOnlineController extends BaseController {
|
public class SysUserOnlineController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserOnlineService userOnlineService;
|
private UserOnlineService userOnlineService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
@ -42,7 +42,7 @@ public class SysUserOnlineController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(String ipaddr, String userName) {
|
public TableDataInfo list(String ipaddr, String userName) {
|
||||||
Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
|
Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
|
||||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
List<UserOnline> userOnlineList = new ArrayList<UserOnline>();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
LoginUser user = redisCache.getCacheObject(key);
|
LoginUser user = redisCache.getCacheObject(key);
|
||||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,9 @@ public class FileController extends HcyBaseController {
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysFile sysFile) {
|
public AjaxResult add(@RequestBody SysFile sysFile) {
|
||||||
try {
|
try {
|
||||||
|
if (sysFile.getFileAddr() == null||sysFile.getFileAddr().equals("")){
|
||||||
|
return AjaxResult.error("上传文件不能为空!");
|
||||||
|
}
|
||||||
Map<String, String> modeMap = new HashMap<>();
|
Map<String, String> modeMap = new HashMap<>();
|
||||||
ServerResult<SysFile> serverResult = fileService.insertFile(sysFile);
|
ServerResult<SysFile> serverResult = fileService.insertFile(sysFile);
|
||||||
if (serverResult.isStart()) {
|
if (serverResult.isStart()) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.hchyun.web.controller.system;
|
package com.hchyun.web.controller.system;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -18,12 +20,11 @@ import com.hchyun.common.annotation.RepeatSubmit;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.entity.SysConfig;
|
import com.hchyun.system.entity.Config;
|
||||||
import com.hchyun.system.service.ISysConfigService;
|
import com.hchyun.system.service.ConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 信息操作处理
|
* 参数配置 信息操作处理
|
||||||
|
|
@ -34,26 +35,36 @@ import com.hchyun.system.service.ISysConfigService;
|
||||||
@RequestMapping("/system/config")
|
@RequestMapping("/system/config")
|
||||||
public class SysConfigController extends BaseController {
|
public class SysConfigController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取参数配置列表
|
* 获取参数配置列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:config:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:config:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysConfig config) {
|
public Serializable list(Config config) {
|
||||||
|
try {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
List<Config> list = configService.selectConfigList(config);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:config:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:config:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysConfig config) {
|
public AjaxResult export(Config config) {
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
try {
|
||||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
List<Config> list = configService.selectConfigList(config);
|
||||||
|
ExcelUtil<Config> util = new ExcelUtil<Config>(Config.class);
|
||||||
return util.exportExcel(list, "参数数据");
|
return util.exportExcel(list, "参数数据");
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,7 +73,12 @@ public class SysConfigController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:config:query')")
|
@PreAuthorize("@hchyun.hasPermi('system:config:query')")
|
||||||
@GetMapping(value = "/{configId}")
|
@GetMapping(value = "/{configId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long configId) {
|
public AjaxResult getInfo(@PathVariable Long configId) {
|
||||||
|
try {
|
||||||
return AjaxResult.success(configService.selectConfigById(configId));
|
return AjaxResult.success(configService.selectConfigById(configId));
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,7 +86,12 @@ public class SysConfigController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/configKey/{configKey}")
|
@GetMapping(value = "/configKey/{configKey}")
|
||||||
public AjaxResult getConfigKey(@PathVariable String configKey) {
|
public AjaxResult getConfigKey(@PathVariable String configKey) {
|
||||||
|
try {
|
||||||
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,12 +101,17 @@ public class SysConfigController extends BaseController {
|
||||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
public AjaxResult add(@Validated @RequestBody SysConfig config) {
|
public AjaxResult add(@Validated @RequestBody Config config) {
|
||||||
|
try {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
||||||
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setCreateBy(SecurityUtils.getUserId());
|
config.setCreateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(configService.insertConfig(config));
|
return toAjax(configService.insertConfig(config));
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -94,12 +120,17 @@ public class SysConfigController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:config:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:config:edit')")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysConfig config) {
|
public AjaxResult edit(@Validated @RequestBody Config config) {
|
||||||
|
try {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
||||||
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setUpdateBy(SecurityUtils.getUserId());
|
config.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(configService.updateConfig(config));
|
return toAjax(configService.updateConfig(config));
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -109,7 +140,12 @@ public class SysConfigController extends BaseController {
|
||||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{configIds}")
|
@DeleteMapping("/{configIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] configIds) {
|
public AjaxResult remove(@PathVariable Long[] configIds) {
|
||||||
|
try {
|
||||||
return toAjax(configService.deleteConfigByIds(configIds));
|
return toAjax(configService.deleteConfigByIds(configIds));
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -119,7 +155,12 @@ public class SysConfigController extends BaseController {
|
||||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||||
@DeleteMapping("/clearCache")
|
@DeleteMapping("/clearCache")
|
||||||
public AjaxResult clearCache() {
|
public AjaxResult clearCache() {
|
||||||
|
try {
|
||||||
configService.clearCache();
|
configService.clearCache();
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
}catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@ package com.hchyun.web.controller.system;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -19,11 +22,11 @@ import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysDept;
|
import com.hchyun.common.core.entity.entity.Dept;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.service.ISysDeptService;
|
import com.hchyun.system.service.DeptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 部门信息
|
||||||
|
|
@ -33,17 +36,24 @@ import com.hchyun.system.service.ISysDeptService;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/dept")
|
@RequestMapping("/system/dept")
|
||||||
public class SysDeptController extends BaseController {
|
public class SysDeptController extends BaseController {
|
||||||
|
private Logger logger = LoggerFactory.getLogger(SysDeptController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDeptService deptService;
|
private DeptService deptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取部门列表
|
* 获取部门列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dept:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:dept:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(SysDept dept) {
|
public AjaxResult list(Dept dept) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
try {
|
||||||
|
List<Dept> depts = deptService.selectDeptList(dept);
|
||||||
return AjaxResult.success(depts);
|
return AjaxResult.success(depts);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,16 +62,21 @@ public class SysDeptController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dept:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:dept:list')")
|
||||||
@GetMapping("/list/exclude/{deptId}")
|
@GetMapping("/list/exclude/{deptId}")
|
||||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
try {
|
||||||
Iterator<SysDept> it = depts.iterator();
|
List<Dept> depts = deptService.selectDeptList(new Dept());
|
||||||
|
Iterator<Dept> it = depts.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SysDept d = (SysDept) it.next();
|
Dept d = (Dept) it.next();
|
||||||
if (d.getDeptId().intValue() == deptId
|
if (d.getDeptId().intValue() == deptId
|
||||||
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) {
|
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(depts);
|
return AjaxResult.success(depts);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,16 +85,26 @@ public class SysDeptController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dept:query')")
|
@PreAuthorize("@hchyun.hasPermi('system:dept:query')")
|
||||||
@GetMapping(value = "/{deptId}")
|
@GetMapping(value = "/{deptId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long deptId) {
|
public AjaxResult getInfo(@PathVariable Long deptId) {
|
||||||
|
try {
|
||||||
return AjaxResult.success(deptService.selectDeptById(deptId));
|
return AjaxResult.success(deptService.selectDeptById(deptId));
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取部门下拉树列表
|
* 获取部门下拉树列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeselect")
|
@GetMapping("/treeselect")
|
||||||
public AjaxResult treeselect(SysDept dept) {
|
public AjaxResult treeselect(Dept dept) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
try {
|
||||||
|
List<Dept> depts = deptService.selectDeptList(dept);
|
||||||
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -87,11 +112,16 @@ public class SysDeptController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
||||||
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
|
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
try {
|
||||||
|
List<Dept> depts = deptService.selectDeptList(new Dept());
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
|
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
|
||||||
return ajax;
|
return ajax;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -100,12 +130,17 @@ public class SysDeptController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dept:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:dept:add')")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDept dept) {
|
public AjaxResult add(@Validated @RequestBody Dept dept) {
|
||||||
|
try {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
||||||
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
dept.setCreateBy(SecurityUtils.getUserId());
|
dept.setCreateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(deptService.insertDept(dept));
|
return toAjax(deptService.insertDept(dept));
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -114,7 +149,8 @@ public class SysDeptController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dept:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:dept:edit')")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDept dept) {
|
public AjaxResult edit(@Validated @RequestBody Dept dept) {
|
||||||
|
try {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
||||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
} else if (dept.getParentId().equals(dept.getDeptId())) {
|
} else if (dept.getParentId().equals(dept.getDeptId())) {
|
||||||
|
|
@ -125,6 +161,10 @@ public class SysDeptController extends BaseController {
|
||||||
}
|
}
|
||||||
dept.setUpdateBy(SecurityUtils.getUserId());
|
dept.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(deptService.updateDept(dept));
|
return toAjax(deptService.updateDept(dept));
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -134,6 +174,7 @@ public class SysDeptController extends BaseController {
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{deptId}")
|
@DeleteMapping("/{deptId}")
|
||||||
public AjaxResult remove(@PathVariable Long deptId) {
|
public AjaxResult remove(@PathVariable Long deptId) {
|
||||||
|
try {
|
||||||
if (deptService.hasChildByDeptId(deptId)) {
|
if (deptService.hasChildByDeptId(deptId)) {
|
||||||
return AjaxResult.error("存在下级部门,不允许删除");
|
return AjaxResult.error("存在下级部门,不允许删除");
|
||||||
}
|
}
|
||||||
|
|
@ -141,5 +182,9 @@ public class SysDeptController extends BaseController {
|
||||||
return AjaxResult.error("部门存在用户,不允许删除");
|
return AjaxResult.error("部门存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.hchyun.common.annotation.Log;
|
import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.service.ISysDictDataService;
|
import com.hchyun.system.service.DictDataService;
|
||||||
import com.hchyun.system.service.ISysDictTypeService;
|
import com.hchyun.system.service.DictTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
|
|
@ -33,25 +33,25 @@ import com.hchyun.system.service.ISysDictTypeService;
|
||||||
@RequestMapping("/system/dict/data")
|
@RequestMapping("/system/dict/data")
|
||||||
public class SysDictDataController extends BaseController {
|
public class SysDictDataController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictDataService dictDataService;
|
private DictDataService dictDataService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictTypeService dictTypeService;
|
private DictTypeService dictTypeService;
|
||||||
|
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysDictData dictData) {
|
public TableDataInfo list(DictData dictData) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
List<DictData> list = dictDataService.selectDictDataList(dictData);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysDictData dictData) {
|
public AjaxResult export(DictData dictData) {
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
List<DictData> list = dictDataService.selectDictDataList(dictData);
|
||||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
ExcelUtil<DictData> util = new ExcelUtil<DictData>(DictData.class);
|
||||||
return util.exportExcel(list, "字典数据");
|
return util.exportExcel(list, "字典数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ public class SysDictDataController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:add')")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictData dict) {
|
public AjaxResult add(@Validated @RequestBody DictData dict) {
|
||||||
dict.setCreateBy(SecurityUtils.getUserId());
|
dict.setCreateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(dictDataService.insertDictData(dict));
|
return toAjax(dictDataService.insertDictData(dict));
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +89,7 @@ public class SysDictDataController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:edit')")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
|
public AjaxResult edit(@Validated @RequestBody DictData dict) {
|
||||||
dict.setUpdateBy(SecurityUtils.getUserId());
|
dict.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(dictDataService.updateDictData(dict));
|
return toAjax(dictDataService.updateDictData(dict));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@ import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictType;
|
import com.hchyun.common.core.entity.entity.DictType;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.service.ISysDictTypeService;
|
import com.hchyun.system.service.DictTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
|
|
@ -33,22 +33,22 @@ import com.hchyun.system.service.ISysDictTypeService;
|
||||||
@RequestMapping("/system/dict/type")
|
@RequestMapping("/system/dict/type")
|
||||||
public class SysDictTypeController extends BaseController {
|
public class SysDictTypeController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictTypeService dictTypeService;
|
private DictTypeService dictTypeService;
|
||||||
|
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysDictType dictType) {
|
public TableDataInfo list(DictType dictType) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
List<DictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysDictType dictType) {
|
public AjaxResult export(DictType dictType) {
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
List<DictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
ExcelUtil<DictType> util = new ExcelUtil<DictType>(DictType.class);
|
||||||
return util.exportExcel(list, "字典类型");
|
return util.exportExcel(list, "字典类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class SysDictTypeController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:add')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictType dict) {
|
public AjaxResult add(@Validated @RequestBody DictType dict) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
||||||
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@ public class SysDictTypeController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:dict:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:dict:edit')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict) {
|
public AjaxResult edit(@Validated @RequestBody DictType dict) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
||||||
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +115,7 @@ public class SysDictTypeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public AjaxResult optionselect() {
|
public AjaxResult optionselect() {
|
||||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
List<DictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||||
return AjaxResult.success(dictTypes);
|
return AjaxResult.success(dictTypes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,15 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.hchyun.common.constant.Constants;
|
import com.hchyun.common.constant.Constants;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.core.entity.model.LoginBody;
|
import com.hchyun.common.core.entity.model.LoginBody;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.utils.ServletUtils;
|
import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.framework.web.service.SysLoginService;
|
import com.hchyun.framework.web.service.SysLoginService;
|
||||||
import com.hchyun.framework.web.service.SysPermissionService;
|
import com.hchyun.framework.web.service.SysPermissionService;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.service.ISysMenuService;
|
import com.hchyun.system.service.MenuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
|
|
@ -31,7 +31,7 @@ public class SysLoginController {
|
||||||
private SysLoginService loginService;
|
private SysLoginService loginService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private MenuService menuService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
@ -63,7 +63,7 @@ public class SysLoginController {
|
||||||
@GetMapping("getInfo")
|
@GetMapping("getInfo")
|
||||||
public AjaxResult getInfo() {
|
public AjaxResult getInfo() {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
SysUser user = loginUser.getUser();
|
User user = loginUser.getUser();
|
||||||
// 角色集合
|
// 角色集合
|
||||||
Set<String> roles = permissionService.getRolePermission(user);
|
Set<String> roles = permissionService.getRolePermission(user);
|
||||||
// 权限集合
|
// 权限集合
|
||||||
|
|
@ -84,8 +84,8 @@ public class SysLoginController {
|
||||||
public AjaxResult getRouters() {
|
public AjaxResult getRouters() {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
// 用户信息
|
// 用户信息
|
||||||
SysUser user = loginUser.getUser();
|
User user = loginUser.getUser();
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(user.getUserId());
|
List<Menu> menus = menuService.selectMenuTreeByUserId(user.getUserId());
|
||||||
return AjaxResult.success(menuService.buildMenus(menus));
|
return AjaxResult.success(menuService.buildMenus(menus));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ import com.hchyun.common.constant.Constants;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.ServletUtils;
|
import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.service.ISysMenuService;
|
import com.hchyun.system.service.MenuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
|
|
@ -36,7 +36,7 @@ import com.hchyun.system.service.ISysMenuService;
|
||||||
@RequestMapping("/system/menu")
|
@RequestMapping("/system/menu")
|
||||||
public class SysMenuController extends BaseController {
|
public class SysMenuController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private MenuService menuService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
@ -46,10 +46,10 @@ public class SysMenuController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:menu:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:menu:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(SysMenu menu) {
|
public AjaxResult list(Menu menu) {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
Long userId = loginUser.getUser().getUserId();
|
Long userId = loginUser.getUser().getUserId();
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
List<Menu> menus = menuService.selectMenuList(menu, userId);
|
||||||
return AjaxResult.success(menus);
|
return AjaxResult.success(menus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,10 +66,10 @@ public class SysMenuController extends BaseController {
|
||||||
* 获取菜单下拉树列表
|
* 获取菜单下拉树列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeselect")
|
@GetMapping("/treeselect")
|
||||||
public AjaxResult treeselect(SysMenu menu) {
|
public AjaxResult treeselect(Menu menu) {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
Long userId = loginUser.getUser().getUserId();
|
Long userId = loginUser.getUser().getUserId();
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
List<Menu> menus = menuService.selectMenuList(menu, userId);
|
||||||
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
|
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ public class SysMenuController extends BaseController {
|
||||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
List<SysMenu> menus = menuService.selectMenuList(loginUser.getUser().getUserId());
|
List<Menu> menus = menuService.selectMenuList(loginUser.getUser().getUserId());
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||||
|
|
@ -92,7 +92,7 @@ public class SysMenuController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:menu:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:menu:add')")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysMenu menu) {
|
public AjaxResult add(@Validated @RequestBody Menu menu) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
||||||
|
|
@ -109,7 +109,7 @@ public class SysMenuController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:menu:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:menu:edit')")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
|
public AjaxResult edit(@Validated @RequestBody Menu menu) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.system.entity.SysNotice;
|
import com.hchyun.system.entity.Notice;
|
||||||
import com.hchyun.system.service.ISysNoticeService;
|
import com.hchyun.system.service.NoticeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告 信息操作处理
|
* 公告 信息操作处理
|
||||||
|
|
@ -31,16 +31,16 @@ import com.hchyun.system.service.ISysNoticeService;
|
||||||
@RequestMapping("/system/notice")
|
@RequestMapping("/system/notice")
|
||||||
public class SysNoticeController extends BaseController {
|
public class SysNoticeController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysNoticeService noticeService;
|
private NoticeService noticeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取通知公告列表
|
* 获取通知公告列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:notice:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:notice:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysNotice notice) {
|
public TableDataInfo list(Notice notice) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
List<Notice> list = noticeService.selectNoticeList(notice);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class SysNoticeController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:notice:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:notice:add')")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
public AjaxResult add(@Validated @RequestBody Notice notice) {
|
||||||
notice.setCreateBy(SecurityUtils.getUserId());
|
notice.setCreateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ public class SysNoticeController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:notice:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:notice:edit')")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
|
public AjaxResult edit(@Validated @RequestBody Notice notice) {
|
||||||
notice.setUpdateBy(SecurityUtils.getUserId());
|
notice.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(noticeService.updateNotice(notice));
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.system.entity.SysPost;
|
import com.hchyun.system.entity.Post;
|
||||||
import com.hchyun.system.service.ISysPostService;
|
import com.hchyun.system.service.PostService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位信息操作处理
|
* 岗位信息操作处理
|
||||||
|
|
@ -33,25 +33,25 @@ import com.hchyun.system.service.ISysPostService;
|
||||||
@RequestMapping("/system/post")
|
@RequestMapping("/system/post")
|
||||||
public class SysPostController extends BaseController {
|
public class SysPostController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private PostService postService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取岗位列表
|
* 获取岗位列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:post:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:post:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysPost post) {
|
public TableDataInfo list(Post post) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
List<Post> list = postService.selectPostList(post);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:post:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:post:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysPost post) {
|
public AjaxResult export(Post post) {
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
List<Post> list = postService.selectPostList(post);
|
||||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
ExcelUtil<Post> util = new ExcelUtil<Post>(Post.class);
|
||||||
return util.exportExcel(list, "岗位数据");
|
return util.exportExcel(list, "岗位数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class SysPostController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:post:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:post:add')")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysPost post) {
|
public AjaxResult add(@Validated @RequestBody Post post) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
|
|
@ -86,7 +86,7 @@ public class SysPostController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:post:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:post:edit')")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysPost post) {
|
public AjaxResult edit(@Validated @RequestBody Post post) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
|
|
@ -111,7 +111,7 @@ public class SysPostController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public AjaxResult optionselect() {
|
public AjaxResult optionselect() {
|
||||||
List<SysPost> posts = postService.selectPostAll();
|
List<Post> posts = postService.selectPostAll();
|
||||||
return AjaxResult.success(posts);
|
return AjaxResult.success(posts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@ import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.config.HchYunConfig;
|
import com.hchyun.common.config.HchYunConfig;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.ServletUtils;
|
import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.file.FileUploadUtils;
|
import com.hchyun.common.utils.file.FileUploadUtils;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.service.ISysUserService;
|
import com.hchyun.system.service.UserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息 业务处理
|
* 个人信息 业务处理
|
||||||
|
|
@ -33,7 +33,7 @@ import com.hchyun.system.service.ISysUserService;
|
||||||
@RequestMapping("/system/user/profile")
|
@RequestMapping("/system/user/profile")
|
||||||
public class SysProfileController extends BaseController {
|
public class SysProfileController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
@ -44,7 +44,7 @@ public class SysProfileController extends BaseController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public AjaxResult profile() {
|
public AjaxResult profile() {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
SysUser user = loginUser.getUser();
|
User user = loginUser.getUser();
|
||||||
AjaxResult ajax = AjaxResult.success(user);
|
AjaxResult ajax = AjaxResult.success(user);
|
||||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||||
|
|
@ -56,7 +56,7 @@ public class SysProfileController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult updateProfile(@RequestBody SysUser user) {
|
public AjaxResult updateProfile(@RequestBody User user) {
|
||||||
if (userService.updateUserProfile(user) > 0) {
|
if (userService.updateUserProfile(user) > 0) {
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
// 更新缓存用户信息
|
// 更新缓存用户信息
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
|
|
@ -28,10 +28,8 @@ import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.framework.web.service.SysPermissionService;
|
import com.hchyun.framework.web.service.SysPermissionService;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.service.ISysRoleService;
|
import com.hchyun.system.service.RoleService;
|
||||||
import com.hchyun.system.service.ISysUserService;
|
import com.hchyun.system.service.UserService;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色信息
|
* 角色信息
|
||||||
|
|
@ -42,7 +40,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
@RequestMapping("/system/role")
|
@RequestMapping("/system/role")
|
||||||
public class SysRoleController extends BaseController {
|
public class SysRoleController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private RoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
@ -51,22 +49,22 @@ public class SysRoleController extends BaseController {
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysRole role) {
|
public TableDataInfo list(Role role) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
List<Role> list = roleService.selectRoleList(role);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysRole role) {
|
public AjaxResult export(Role role) {
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
List<Role> list = roleService.selectRoleList(role);
|
||||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
ExcelUtil<Role> util = new ExcelUtil<Role>(Role.class);
|
||||||
return util.exportExcel(list, "角色数据");
|
return util.exportExcel(list, "角色数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,7 +83,7 @@ public class SysRoleController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:add')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysRole role) {
|
public AjaxResult add(@Validated @RequestBody Role role) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
||||||
|
|
@ -102,7 +100,7 @@ public class SysRoleController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysRole role) {
|
public AjaxResult edit(@Validated @RequestBody Role role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
|
|
@ -130,7 +128,7 @@ public class SysRoleController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/dataScope")
|
@PutMapping("/dataScope")
|
||||||
public AjaxResult dataScope(@RequestBody SysRole role) {
|
public AjaxResult dataScope(@RequestBody Role role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
return toAjax(roleService.authDataScope(role));
|
return toAjax(roleService.authDataScope(role));
|
||||||
}
|
}
|
||||||
|
|
@ -141,7 +139,7 @@ public class SysRoleController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysRole role) {
|
public AjaxResult changeStatus(@RequestBody Role role) {
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
role.setUpdateBy(SecurityUtils.getUserId());
|
role.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(roleService.updateRoleStatus(role));
|
return toAjax(roleService.updateRoleStatus(role));
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ import com.hchyun.common.annotation.Log;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.controller.BaseController;
|
import com.hchyun.common.core.controller.BaseController;
|
||||||
import com.hchyun.common.core.entity.AjaxResult;
|
import com.hchyun.common.core.entity.AjaxResult;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.core.page.TableDataInfo;
|
import com.hchyun.common.core.page.TableDataInfo;
|
||||||
import com.hchyun.common.enums.BusinessType;
|
import com.hchyun.common.enums.BusinessType;
|
||||||
|
|
@ -29,9 +29,9 @@ import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.common.utils.poi.ExcelUtil;
|
import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.service.ISysPostService;
|
import com.hchyun.system.service.PostService;
|
||||||
import com.hchyun.system.service.ISysRoleService;
|
import com.hchyun.system.service.RoleService;
|
||||||
import com.hchyun.system.service.ISysUserService;
|
import com.hchyun.system.service.UserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
|
|
@ -42,13 +42,13 @@ import com.hchyun.system.service.ISysUserService;
|
||||||
@RequestMapping("/system/user")
|
@RequestMapping("/system/user")
|
||||||
public class SysUserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private RoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private PostService postService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
@ -58,18 +58,18 @@ public class SysUserController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:list')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysUser user) {
|
public TableDataInfo list(User user) {
|
||||||
startPage();
|
startPage();
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<User> list = userService.selectUserList(user);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:export')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(SysUser user) {
|
public AjaxResult export(User user) {
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<User> list = userService.selectUserList(user);
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<User> util = new ExcelUtil<User>(User.class);
|
||||||
return util.exportExcel(list, "用户数据");
|
return util.exportExcel(list, "用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,8 +77,8 @@ public class SysUserController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:import')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:import')")
|
||||||
@PostMapping("/importData")
|
@PostMapping("/importData")
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<User> util = new ExcelUtil<User>(User.class);
|
||||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
List<User> userList = util.importExcel(file.getInputStream());
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
Long operName = loginUser.getUser().getUserId();
|
Long operName = loginUser.getUser().getUserId();
|
||||||
String message = userService.importUser(userList, updateSupport, operName);
|
String message = userService.importUser(userList, updateSupport, operName);
|
||||||
|
|
@ -87,7 +87,7 @@ public class SysUserController extends BaseController {
|
||||||
|
|
||||||
@GetMapping("/importTemplate")
|
@GetMapping("/importTemplate")
|
||||||
public AjaxResult importTemplate() {
|
public AjaxResult importTemplate() {
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<User> util = new ExcelUtil<User>(User.class);
|
||||||
return util.importTemplateExcel("用户数据");
|
return util.importTemplateExcel("用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,8 +98,8 @@ public class SysUserController extends BaseController {
|
||||||
@GetMapping(value = {"/", "/{userId}"})
|
@GetMapping(value = {"/", "/{userId}"})
|
||||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
List<SysRole> roles = roleService.selectRoleAll(0);
|
List<Role> roles = roleService.selectRoleAll(0);
|
||||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
ajax.put("roles", User.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
ajax.put("posts", postService.selectPostAll());
|
ajax.put("posts", postService.selectPostAll());
|
||||||
if (StringUtils.isNotNull(userId)) {
|
if (StringUtils.isNotNull(userId)) {
|
||||||
ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
|
ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
|
||||||
|
|
@ -115,7 +115,7 @@ public class SysUserController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:add')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:add')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
public AjaxResult add(@Validated @RequestBody User user) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
} else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
} else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||||
|
|
@ -134,7 +134,7 @@ public class SysUserController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:edit')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysUser user) {
|
public AjaxResult edit(@Validated @RequestBody User user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
|
|
@ -161,7 +161,7 @@ public class SysUserController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:resetPwd')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:resetPwd')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/resetPwd")
|
@PutMapping("/resetPwd")
|
||||||
public AjaxResult resetPwd(@RequestBody SysUser user) {
|
public AjaxResult resetPwd(@RequestBody User user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
user.setUpdateBy(SecurityUtils.getUserId());
|
user.setUpdateBy(SecurityUtils.getUserId());
|
||||||
|
|
@ -174,7 +174,7 @@ public class SysUserController extends BaseController {
|
||||||
@PreAuthorize("@hchyun.hasPermi('system:user:edit')")
|
@PreAuthorize("@hchyun.hasPermi('system:user:edit')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysUser user) {
|
public AjaxResult changeStatus(@RequestBody User user) {
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
user.setUpdateBy(SecurityUtils.getUserId());
|
user.setUpdateBy(SecurityUtils.getUserId());
|
||||||
return toAjax(userService.updateUserStatus(user));
|
return toAjax(userService.updateUserStatus(user));
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.hchyun.common.core.entity.entity.SysDept;
|
import com.hchyun.common.core.entity.entity.Dept;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Treeselect树结构实体类
|
* Treeselect树结构实体类
|
||||||
|
|
@ -36,13 +36,13 @@ public class TreeSelect implements Serializable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeSelect(SysDept dept) {
|
public TreeSelect(Dept dept) {
|
||||||
this.id = dept.getDeptId();
|
this.id = dept.getDeptId();
|
||||||
this.label = dept.getDeptName();
|
this.label = dept.getDeptName();
|
||||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeSelect(SysMenu menu) {
|
public TreeSelect(Menu menu) {
|
||||||
this.id = menu.getMenuId();
|
this.id = menu.getMenuId();
|
||||||
this.label = menu.getMenuName();
|
this.label = menu.getMenuName();
|
||||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysDept extends BaseEntity {
|
public class Dept extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -76,7 +76,7 @@ public class SysDept extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 子部门
|
* 子部门
|
||||||
*/
|
*/
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<Dept> children = new ArrayList<Dept>();
|
||||||
|
|
||||||
public Long getDeptId() {
|
public Long getDeptId() {
|
||||||
return deptId;
|
return deptId;
|
||||||
|
|
@ -172,11 +172,11 @@ public class SysDept extends BaseEntity {
|
||||||
this.parentName = parentName;
|
this.parentName = parentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysDept> getChildren() {
|
public List<Dept> getChildren() {
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChildren(List<SysDept> children) {
|
public void setChildren(List<Dept> children) {
|
||||||
this.children = children;
|
this.children = children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysDictData extends BaseEntity {
|
public class DictData extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,7 +14,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysDictType extends BaseEntity {
|
public class DictType extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
import com.hchyun.common.utils.DateUtils;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.hchyun.common.core.entity.BaseEntity;
|
import com.hchyun.common.core.entity.BaseEntity;
|
||||||
|
|
@ -15,7 +14,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysMenu extends BaseEntity {
|
public class Menu extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,12 +90,12 @@ public class SysMenu extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 子菜单
|
* 子菜单
|
||||||
*/
|
*/
|
||||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
private List<Menu> children = new ArrayList<Menu>();
|
||||||
|
|
||||||
public SysMenu() {
|
public Menu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysMenu(Long uqId, String uqName, Long create) {
|
public Menu(Long uqId, String uqName, Long create) {
|
||||||
parentId = 6L;
|
parentId = 6L;
|
||||||
menuName = uqName;
|
menuName = uqName;
|
||||||
orderNum = "0";
|
orderNum = "0";
|
||||||
|
|
@ -230,11 +229,11 @@ public class SysMenu extends BaseEntity {
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysMenu> getChildren() {
|
public List<Menu> getChildren() {
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChildren(List<SysMenu> children) {
|
public void setChildren(List<Menu> children) {
|
||||||
this.children = children;
|
this.children = children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysRole extends BaseEntity {
|
public class Role extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -85,10 +85,10 @@ public class SysRole extends BaseEntity {
|
||||||
|
|
||||||
private Integer roleType = 0;
|
private Integer roleType = 0;
|
||||||
|
|
||||||
public SysRole() {
|
public Role() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysRole(Integer roleType) {
|
public Role(Integer roleType) {
|
||||||
this.roleType = roleType;
|
this.roleType = roleType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ public class SysRole extends BaseEntity {
|
||||||
this.roleType = roleType;
|
this.roleType = roleType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysRole(Long roleId) {
|
public Role(Long roleId) {
|
||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysUser extends BaseEntity {
|
public class User extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -111,12 +111,12 @@ public class SysUser extends BaseEntity {
|
||||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||||
})
|
})
|
||||||
private SysDept dept;
|
private Dept dept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色对象
|
* 角色对象
|
||||||
*/
|
*/
|
||||||
private List<SysRole> roles;
|
private List<Role> roles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色组
|
* 角色组
|
||||||
|
|
@ -128,11 +128,11 @@ public class SysUser extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long[] postIds;
|
private Long[] postIds;
|
||||||
|
|
||||||
public SysUser() {
|
public User() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysUser(Long userId) {
|
public User(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,19 +264,19 @@ public class SysUser extends BaseEntity {
|
||||||
this.loginDate = loginDate;
|
this.loginDate = loginDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysDept getDept() {
|
public Dept getDept() {
|
||||||
return dept;
|
return dept;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDept(SysDept dept) {
|
public void setDept(Dept dept) {
|
||||||
this.dept = dept;
|
this.dept = dept;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysRole> getRoles() {
|
public List<Role> getRoles() {
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoles(List<SysRole> roles) {
|
public void setRoles(List<Role> roles) {
|
||||||
this.roles = roles;
|
this.roles = roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6,7 +6,7 @@ import java.util.Set;
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录用户身份权限
|
* 登录用户身份权限
|
||||||
|
|
@ -59,7 +59,7 @@ public class LoginUser implements UserDetails {
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*/
|
*/
|
||||||
private SysUser user;
|
private User user;
|
||||||
|
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
return token;
|
return token;
|
||||||
|
|
@ -72,7 +72,7 @@ public class LoginUser implements UserDetails {
|
||||||
public LoginUser() {
|
public LoginUser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUser(SysUser user, Set<String> permissions) {
|
public LoginUser(User user, Set<String> permissions) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
@ -186,11 +186,11 @@ public class LoginUser implements UserDetails {
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysUser getUser() {
|
public User getUser() {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUser(SysUser user) {
|
public void setUser(User user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.constant.Constants;
|
import com.hchyun.common.constant.Constants;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
import com.hchyun.common.core.redis.RedisCache;
|
import com.hchyun.common.core.redis.RedisCache;
|
||||||
import com.hchyun.common.utils.spring.SpringUtils;
|
import com.hchyun.common.utils.spring.SpringUtils;
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class DictUtils {
|
||||||
* @param key 参数键
|
* @param key 参数键
|
||||||
* @param dictDatas 字典数据列表
|
* @param dictDatas 字典数据列表
|
||||||
*/
|
*/
|
||||||
public static void setDictCache(String key, List<SysDictData> dictDatas) {
|
public static void setDictCache(String key, List<DictData> dictDatas) {
|
||||||
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
|
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,10 +35,10 @@ public class DictUtils {
|
||||||
* @param key 参数键
|
* @param key 参数键
|
||||||
* @return dictDatas 字典数据列表
|
* @return dictDatas 字典数据列表
|
||||||
*/
|
*/
|
||||||
public static List<SysDictData> getDictCache(String key) {
|
public static List<DictData> getDictCache(String key) {
|
||||||
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||||
if (StringUtils.isNotNull(cacheObj)) {
|
if (StringUtils.isNotNull(cacheObj)) {
|
||||||
List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
|
List<DictData> dictDatas = StringUtils.cast(cacheObj);
|
||||||
return dictDatas;
|
return dictDatas;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -76,10 +76,10 @@ public class DictUtils {
|
||||||
*/
|
*/
|
||||||
public static String getDictLabel(String dictType, String dictValue, String separator) {
|
public static String getDictLabel(String dictType, String dictValue, String separator) {
|
||||||
StringBuilder propertyString = new StringBuilder();
|
StringBuilder propertyString = new StringBuilder();
|
||||||
List<SysDictData> datas = getDictCache(dictType);
|
List<DictData> datas = getDictCache(dictType);
|
||||||
|
|
||||||
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) {
|
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) {
|
||||||
for (SysDictData dict : datas) {
|
for (DictData dict : datas) {
|
||||||
for (String value : dictValue.split(separator)) {
|
for (String value : dictValue.split(separator)) {
|
||||||
if (value.equals(dict.getDictValue())) {
|
if (value.equals(dict.getDictValue())) {
|
||||||
propertyString.append(dict.getDictLabel() + separator);
|
propertyString.append(dict.getDictLabel() + separator);
|
||||||
|
|
@ -88,7 +88,7 @@ public class DictUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (SysDictData dict : datas) {
|
for (DictData dict : datas) {
|
||||||
if (dictValue.equals(dict.getDictValue())) {
|
if (dictValue.equals(dict.getDictValue())) {
|
||||||
return dict.getDictLabel();
|
return dict.getDictLabel();
|
||||||
}
|
}
|
||||||
|
|
@ -107,10 +107,10 @@ public class DictUtils {
|
||||||
*/
|
*/
|
||||||
public static String getDictValue(String dictType, String dictLabel, String separator) {
|
public static String getDictValue(String dictType, String dictLabel, String separator) {
|
||||||
StringBuilder propertyString = new StringBuilder();
|
StringBuilder propertyString = new StringBuilder();
|
||||||
List<SysDictData> datas = getDictCache(dictType);
|
List<DictData> datas = getDictCache(dictType);
|
||||||
|
|
||||||
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) {
|
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) {
|
||||||
for (SysDictData dict : datas) {
|
for (DictData dict : datas) {
|
||||||
for (String label : dictLabel.split(separator)) {
|
for (String label : dictLabel.split(separator)) {
|
||||||
if (label.equals(dict.getDictLabel())) {
|
if (label.equals(dict.getDictLabel())) {
|
||||||
propertyString.append(dict.getDictValue() + separator);
|
propertyString.append(dict.getDictValue() + separator);
|
||||||
|
|
@ -119,7 +119,7 @@ public class DictUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (SysDictData dict : datas) {
|
for (DictData dict : datas) {
|
||||||
if (dictLabel.equals(dict.getDictLabel())) {
|
if (dictLabel.equals(dict.getDictLabel())) {
|
||||||
return dict.getDictValue();
|
return dict.getDictValue();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.hchyun.common.annotation.DataScope;
|
import com.hchyun.common.annotation.DataScope;
|
||||||
import com.hchyun.common.core.entity.BaseEntity;
|
import com.hchyun.common.core.entity.BaseEntity;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.utils.ServletUtils;
|
import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
|
|
@ -76,7 +76,7 @@ public class DataScopeAspect {
|
||||||
// 获取当前的用户
|
// 获取当前的用户
|
||||||
LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
||||||
if (StringUtils.isNotNull(loginUser)) {
|
if (StringUtils.isNotNull(loginUser)) {
|
||||||
SysUser currentUser = loginUser.getUser();
|
User currentUser = loginUser.getUser();
|
||||||
// 如果是超级管理员,则不过滤数据
|
// 如果是超级管理员,则不过滤数据
|
||||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
|
||||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||||
|
|
@ -92,10 +92,10 @@ public class DataScopeAspect {
|
||||||
* @param user 用户
|
* @param user 用户
|
||||||
* @param userAlias 别名
|
* @param userAlias 别名
|
||||||
*/
|
*/
|
||||||
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) {
|
public static void dataScopeFilter(JoinPoint joinPoint, User user, String deptAlias, String userAlias) {
|
||||||
StringBuilder sqlString = new StringBuilder();
|
StringBuilder sqlString = new StringBuilder();
|
||||||
|
|
||||||
for (SysRole role : user.getRoles()) {
|
for (Role role : user.getRoles()) {
|
||||||
String dataScope = role.getDataScope();
|
String dataScope = role.getDataScope();
|
||||||
if (DATA_SCOPE_ALL.equals(dataScope)) {
|
if (DATA_SCOPE_ALL.equals(dataScope)) {
|
||||||
sqlString = new StringBuilder();
|
sqlString = new StringBuilder();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import com.hchyun.common.utils.spring.SpringUtils;
|
||||||
import com.hchyun.framework.dao.AsyncDao;
|
import com.hchyun.framework.dao.AsyncDao;
|
||||||
import com.hchyun.framework.dao.factory.AsyncFactory;
|
import com.hchyun.framework.dao.factory.AsyncFactory;
|
||||||
import com.hchyun.framework.web.service.TokenService;
|
import com.hchyun.framework.web.service.TokenService;
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志记录处理
|
* 操作日志记录处理
|
||||||
|
|
@ -79,7 +79,7 @@ public class LogAspect {
|
||||||
LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
||||||
|
|
||||||
// *========数据库日志=========*//
|
// *========数据库日志=========*//
|
||||||
SysOperLog operLog = new SysOperLog();
|
OperLog operLog = new OperLog();
|
||||||
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
||||||
// 请求的地址
|
// 请求的地址
|
||||||
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
||||||
|
|
@ -121,7 +121,7 @@ public class LogAspect {
|
||||||
* @param operLog 操作日志
|
* @param operLog 操作日志
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception {
|
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLog operLog) throws Exception {
|
||||||
// 设置action动作
|
// 设置action动作
|
||||||
operLog.setBusinessType(log.businessType().ordinal());
|
operLog.setBusinessType(log.businessType().ordinal());
|
||||||
// 设置标题
|
// 设置标题
|
||||||
|
|
@ -141,7 +141,7 @@ public class LogAspect {
|
||||||
* @param operLog 操作日志
|
* @param operLog 操作日志
|
||||||
* @throws Exception 异常
|
* @throws Exception 异常
|
||||||
*/
|
*/
|
||||||
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception {
|
private void setRequestValue(JoinPoint joinPoint, OperLog operLog) throws Exception {
|
||||||
String requestMethod = operLog.getRequestMethod();
|
String requestMethod = operLog.getRequestMethod();
|
||||||
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
|
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
|
||||||
String params = argsArrayToString(joinPoint.getArgs());
|
String params = argsArrayToString(joinPoint.getArgs());
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.ip.AddressUtils;
|
import com.hchyun.common.utils.ip.AddressUtils;
|
||||||
import com.hchyun.common.utils.ip.IpUtils;
|
import com.hchyun.common.utils.ip.IpUtils;
|
||||||
import com.hchyun.common.utils.spring.SpringUtils;
|
import com.hchyun.common.utils.spring.SpringUtils;
|
||||||
import com.hchyun.system.entity.SysLogininfor;
|
import com.hchyun.system.entity.Logininfor;
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
import com.hchyun.system.service.ISysLogininforService;
|
import com.hchyun.system.service.LogininforService;
|
||||||
import com.hchyun.system.service.ISysOperLogService;
|
import com.hchyun.system.service.OperLogService;
|
||||||
import eu.bitwalker.useragentutils.UserAgent;
|
import eu.bitwalker.useragentutils.UserAgent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +54,7 @@ public class AsyncFactory {
|
||||||
// 获取客户端浏览器
|
// 获取客户端浏览器
|
||||||
String browser = userAgent.getBrowser().getName();
|
String browser = userAgent.getBrowser().getName();
|
||||||
// 封装对象
|
// 封装对象
|
||||||
SysLogininfor logininfor = new SysLogininfor();
|
Logininfor logininfor = new Logininfor();
|
||||||
logininfor.setUserName(username);
|
logininfor.setUserName(username);
|
||||||
logininfor.setIpaddr(ip);
|
logininfor.setIpaddr(ip);
|
||||||
logininfor.setLoginLocation(address);
|
logininfor.setLoginLocation(address);
|
||||||
|
|
@ -68,7 +68,7 @@ public class AsyncFactory {
|
||||||
logininfor.setStatus(Constants.FAIL);
|
logininfor.setStatus(Constants.FAIL);
|
||||||
}
|
}
|
||||||
// 插入数据
|
// 插入数据
|
||||||
SpringUtils.getBean(ISysLogininforService.class).insertLogininfor(logininfor);
|
SpringUtils.getBean(LogininforService.class).insertLogininfor(logininfor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -79,13 +79,13 @@ public class AsyncFactory {
|
||||||
* @param operLog 操作日志信息
|
* @param operLog 操作日志信息
|
||||||
* @return 任务task
|
* @return 任务task
|
||||||
*/
|
*/
|
||||||
public static TimerTask recordOper(final SysOperLog operLog) {
|
public static TimerTask recordOper(final OperLog operLog) {
|
||||||
return new TimerTask() {
|
return new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// 远程查询操作地点
|
// 远程查询操作地点
|
||||||
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
|
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
|
||||||
SpringUtils.getBean(ISysOperLogService.class).insertOperlog(operLog);
|
SpringUtils.getBean(OperLogService.class).insertOperlog(operLog);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import java.util.Set;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.utils.ServletUtils;
|
import com.hchyun.common.utils.ServletUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
|
|
@ -98,7 +98,7 @@ public class PermissionService {
|
||||||
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
|
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (SysRole sysRole : loginUser.getUser().getRoles()) {
|
for (Role sysRole : loginUser.getUser().getRoles()) {
|
||||||
String roleKey = sysRole.getRoleKey();
|
String roleKey = sysRole.getRoleKey();
|
||||||
if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) {
|
if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.system.service.ISysMenuService;
|
import com.hchyun.system.service.MenuService;
|
||||||
import com.hchyun.system.service.ISysRoleService;
|
import com.hchyun.system.service.RoleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户权限处理
|
* 用户权限处理
|
||||||
|
|
@ -17,10 +17,10 @@ import com.hchyun.system.service.ISysRoleService;
|
||||||
@Component
|
@Component
|
||||||
public class SysPermissionService {
|
public class SysPermissionService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private RoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private MenuService menuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取角色数据权限
|
* 获取角色数据权限
|
||||||
|
|
@ -28,7 +28,7 @@ public class SysPermissionService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 角色权限信息
|
* @return 角色权限信息
|
||||||
*/
|
*/
|
||||||
public Set<String> getRolePermission(SysUser user) {
|
public Set<String> getRolePermission(User user) {
|
||||||
Set<String> roles = new HashSet<String>();
|
Set<String> roles = new HashSet<String>();
|
||||||
// 管理员拥有所有权限
|
// 管理员拥有所有权限
|
||||||
if (user.isAdmin()) {
|
if (user.isAdmin()) {
|
||||||
|
|
@ -45,7 +45,7 @@ public class SysPermissionService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 菜单权限信息
|
* @return 菜单权限信息
|
||||||
*/
|
*/
|
||||||
public Set<String> getMenuPermission(SysUser user) {
|
public Set<String> getMenuPermission(User user) {
|
||||||
Set<String> perms = new HashSet<String>();
|
Set<String> perms = new HashSet<String>();
|
||||||
// 管理员拥有所有权限
|
// 管理员拥有所有权限
|
||||||
if (user.isAdmin()) {
|
if (user.isAdmin()) {
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.enums.UserStatus;
|
import com.hchyun.common.enums.UserStatus;
|
||||||
import com.hchyun.common.exception.BaseException;
|
import com.hchyun.common.exception.BaseException;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.service.ISysUserService;
|
import com.hchyun.system.service.UserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户验证处理
|
* 用户验证处理
|
||||||
|
|
@ -24,14 +24,14 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||||
SysUser user = userService.selectUserByUserName(username);
|
User user = userService.selectUserByUserName(username);
|
||||||
if (StringUtils.isNull(user)) {
|
if (StringUtils.isNull(user)) {
|
||||||
log.info("登录用户:{} 不存在.", username);
|
log.info("登录用户:{} 不存在.", username);
|
||||||
throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
|
throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
|
||||||
|
|
@ -46,7 +46,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
||||||
return createLoginUser(user);
|
return createLoginUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserDetails createLoginUser(SysUser user) {
|
public UserDetails createLoginUser(User user) {
|
||||||
return new LoginUser(user, permissionService.getMenuPermission(user));
|
return new LoginUser(user, permissionService.getMenuPermission(user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.hchyun.generator.dao;
|
package com.hchyun.generator.dao;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.generator.entity.UniCon;
|
import com.hchyun.generator.entity.UniCon;
|
||||||
import com.hchyun.generator.entity.UniQuery;
|
import com.hchyun.generator.entity.UniQuery;
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ public interface QueryDao {
|
||||||
|
|
||||||
Integer changeRelease(UniQuery uniQuery);
|
Integer changeRelease(UniQuery uniQuery);
|
||||||
|
|
||||||
Integer insertMenu(SysMenu sysMenu);
|
Integer insertMenu(Menu menu);
|
||||||
|
|
||||||
Integer deleteMenu(String path);
|
Integer deleteMenu(String path);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.hchyun.generator.service.impl;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.hchyun.common.constant.ReturnConstants;
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.ServerResult;
|
import com.hchyun.common.utils.ServerResult;
|
||||||
import com.hchyun.generator.dao.QueryDao;
|
import com.hchyun.generator.dao.QueryDao;
|
||||||
|
|
@ -64,8 +64,8 @@ public class QueryServiceImpl implements QueryService {
|
||||||
if ((isRelease == 1 && uniQuery.getIsRelease() == 2) || (isRelease == 2 && uniQuery.getIsRelease() == 1)) {
|
if ((isRelease == 1 && uniQuery.getIsRelease() == 2) || (isRelease == 2 && uniQuery.getIsRelease() == 1)) {
|
||||||
if (uniQuery.getIsRelease() == 1) {
|
if (uniQuery.getIsRelease() == 1) {
|
||||||
UniQuery query = uniQueryDao.selectUniQueryById(uniQuery.getId());
|
UniQuery query = uniQueryDao.selectUniQueryById(uniQuery.getId());
|
||||||
SysMenu sysMenu = new SysMenu(query.getId(), query.getUqName(), SecurityUtils.getUserId());
|
Menu menu = new Menu(query.getId(), query.getUqName(), SecurityUtils.getUserId());
|
||||||
Integer insermenu = queryDao.insertMenu(sysMenu);
|
Integer insermenu = queryDao.insertMenu(menu);
|
||||||
if (insermenu == 0) {
|
if (insermenu == 0) {
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return new ServerResult<>(false, ReturnConstants.OP_ERROR);
|
return new ServerResult<>(false, ReturnConstants.OP_ERROR);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
<delete id="deleteMenu">
|
<delete id="deleteMenu">
|
||||||
delete from sys_menu where path = #{path}
|
delete from sys_menu where path = #{path}
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insertMenu" parameterType="SysMenu">
|
<insert id="insertMenu" parameterType="Menu">
|
||||||
insert into sys_menu(
|
insert into sys_menu(
|
||||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysConfig;
|
import com.hchyun.system.entity.Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 数据层
|
* 参数配置 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysConfigDao {
|
public interface ConfigDao {
|
||||||
/**
|
/**
|
||||||
* 查询参数配置信息
|
* 查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfig(SysConfig config);
|
public Config selectConfig(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
|
|
@ -24,7 +24,7 @@ public interface SysConfigDao {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置集合
|
* @return 参数配置集合
|
||||||
*/
|
*/
|
||||||
public List<SysConfig> selectConfigList(SysConfig config);
|
public List<Config> selectConfigList(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
|
|
@ -32,7 +32,7 @@ public interface SysConfigDao {
|
||||||
* @param configKey 参数键名
|
* @param configKey 参数键名
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig checkConfigKeyUnique(String configKey);
|
public Config checkConfigKeyUnique(String configKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
|
|
@ -40,7 +40,7 @@ public interface SysConfigDao {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConfig(SysConfig config);
|
public int insertConfig(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
|
|
@ -48,7 +48,7 @@ public interface SysConfigDao {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateConfig(SysConfig config);
|
public int updateConfig(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除参数配置
|
* 删除参数配置
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.hchyun.common.core.entity.entity.SysDept;
|
import com.hchyun.common.core.entity.entity.Dept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 数据层
|
* 部门管理 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysDeptDao {
|
public interface DeptDao {
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询部门管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList(SysDept dept);
|
public List<Dept> selectDeptList(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门树信息
|
* 根据角色ID查询部门树信息
|
||||||
|
|
@ -34,7 +34,7 @@ public interface SysDeptDao {
|
||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 部门信息
|
* @return 部门信息
|
||||||
*/
|
*/
|
||||||
public SysDept selectDeptById(Long deptId);
|
public Dept selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门
|
* 根据ID查询所有子部门
|
||||||
|
|
@ -42,7 +42,7 @@ public interface SysDeptDao {
|
||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 部门列表
|
* @return 部门列表
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectChildrenDeptById(Long deptId);
|
public List<Dept> selectChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门(正常状态)
|
* 根据ID查询所有子部门(正常状态)
|
||||||
|
|
@ -75,7 +75,7 @@ public interface SysDeptDao {
|
||||||
* @param parentId 父部门ID
|
* @param parentId 父部门ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
public Dept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门信息
|
* 新增部门信息
|
||||||
|
|
@ -83,7 +83,7 @@ public interface SysDeptDao {
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(SysDept dept);
|
public int insertDept(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改部门信息
|
* 修改部门信息
|
||||||
|
|
@ -91,14 +91,14 @@ public interface SysDeptDao {
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(SysDept dept);
|
public int updateDept(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改所在部门的父级部门状态
|
* 修改所在部门的父级部门状态
|
||||||
*
|
*
|
||||||
* @param dept 部门
|
* @param dept 部门
|
||||||
*/
|
*/
|
||||||
public void updateDeptStatus(SysDept dept);
|
public void updateDeptStatus(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改子元素关系
|
* 修改子元素关系
|
||||||
|
|
@ -106,7 +106,7 @@ public interface SysDeptDao {
|
||||||
* @param depts 子元素
|
* @param depts 子元素
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
public int updateDeptChildren(@Param("depts") List<Dept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除部门管理信息
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典表 数据层
|
* 字典表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysDictDataDao {
|
public interface DictDataDao {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询字典数据
|
* 根据条件分页查询字典数据
|
||||||
*
|
*
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
public List<DictData> selectDictDataList(DictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询字典数据
|
* 根据字典类型查询字典数据
|
||||||
|
|
@ -25,7 +25,7 @@ public interface SysDictDataDao {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataByType(String dictType);
|
public List<DictData> selectDictDataByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
* 根据字典类型和字典键值查询字典数据信息
|
||||||
|
|
@ -42,7 +42,7 @@ public interface SysDictDataDao {
|
||||||
* @param dictCode 字典数据ID
|
* @param dictCode 字典数据ID
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
public SysDictData selectDictDataById(Long dictCode);
|
public DictData selectDictDataById(Long dictCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典数据
|
* 查询字典数据
|
||||||
|
|
@ -74,7 +74,7 @@ public interface SysDictDataDao {
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictData(SysDictData dictData);
|
public int insertDictData(DictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典数据信息
|
* 修改字典数据信息
|
||||||
|
|
@ -82,7 +82,7 @@ public interface SysDictDataDao {
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictData(SysDictData dictData);
|
public int updateDictData(DictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步修改字典类型
|
* 同步修改字典类型
|
||||||
|
|
@ -3,7 +3,7 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictType;
|
import com.hchyun.common.core.entity.entity.DictType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典表 数据层
|
* 字典表 数据层
|
||||||
|
|
@ -11,21 +11,21 @@ import com.hchyun.common.core.entity.entity.SysDictType;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysDictTypeDao {
|
public interface DictTypeDao {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询字典类型
|
* 根据条件分页查询字典类型
|
||||||
*
|
*
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
public List<DictType> selectDictTypeList(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据所有字典类型
|
* 根据所有字典类型
|
||||||
*
|
*
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeAll();
|
public List<DictType> selectDictTypeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型ID查询信息
|
* 根据字典类型ID查询信息
|
||||||
|
|
@ -33,7 +33,7 @@ public interface SysDictTypeDao {
|
||||||
* @param dictId 字典类型ID
|
* @param dictId 字典类型ID
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeById(Long dictId);
|
public DictType selectDictTypeById(Long dictId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询信息
|
* 根据字典类型查询信息
|
||||||
|
|
@ -41,7 +41,7 @@ public interface SysDictTypeDao {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeByType(String dictType);
|
public DictType selectDictTypeByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过字典ID删除字典信息
|
* 通过字典ID删除字典信息
|
||||||
|
|
@ -65,7 +65,7 @@ public interface SysDictTypeDao {
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictType(SysDictType dictType);
|
public int insertDictType(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典类型信息
|
* 修改字典类型信息
|
||||||
|
|
@ -73,7 +73,7 @@ public interface SysDictTypeDao {
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictType(SysDictType dictType);
|
public int updateDictType(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验字典类型称是否唯一
|
* 校验字典类型称是否唯一
|
||||||
|
|
@ -81,5 +81,5 @@ public interface SysDictTypeDao {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysDictType checkDictTypeUnique(String dictType);
|
public DictType checkDictTypeUnique(String dictType);
|
||||||
}
|
}
|
||||||
|
|
@ -2,20 +2,20 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysLogininfor;
|
import com.hchyun.system.entity.Logininfor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 数据层
|
* 系统访问日志情况信息 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysLogininforDao {
|
public interface LogininforDao {
|
||||||
/**
|
/**
|
||||||
* 新增系统登录日志
|
* 新增系统登录日志
|
||||||
*
|
*
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
*/
|
*/
|
||||||
public void insertLogininfor(SysLogininfor logininfor);
|
public void insertLogininfor(Logininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统登录日志集合
|
* 查询系统登录日志集合
|
||||||
|
|
@ -23,7 +23,7 @@ public interface SysLogininforDao {
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
public List<Logininfor> selectLogininforList(Logininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统登录日志
|
* 批量删除系统登录日志
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单表 数据层
|
* 菜单表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysMenuDao {
|
public interface MenuDao {
|
||||||
/**
|
/**
|
||||||
* 查询系统菜单列表
|
* 查询系统菜单列表
|
||||||
*
|
*
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(SysMenu menu);
|
public List<Menu> selectMenuList(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户所有权限
|
* 根据用户所有权限
|
||||||
|
|
@ -32,7 +32,7 @@ public interface SysMenuDao {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
public List<Menu> selectMenuListByUserId(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
|
|
@ -47,7 +47,7 @@ public interface SysMenuDao {
|
||||||
*
|
*
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeAll();
|
public List<Menu> selectMenuTreeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
|
|
@ -55,7 +55,7 @@ public interface SysMenuDao {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
public List<Menu> selectMenuTreeByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
|
|
@ -72,7 +72,7 @@ public interface SysMenuDao {
|
||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 菜单信息
|
* @return 菜单信息
|
||||||
*/
|
*/
|
||||||
public SysMenu selectMenuById(Long menuId);
|
public Menu selectMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在菜单子节点
|
* 是否存在菜单子节点
|
||||||
|
|
@ -88,7 +88,7 @@ public interface SysMenuDao {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertMenu(SysMenu menu);
|
public int insertMenu(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜单信息
|
* 修改菜单信息
|
||||||
|
|
@ -96,7 +96,7 @@ public interface SysMenuDao {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateMenu(SysMenu menu);
|
public int updateMenu(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜单管理信息
|
* 删除菜单管理信息
|
||||||
|
|
@ -113,5 +113,5 @@ public interface SysMenuDao {
|
||||||
* @param parentId 父菜单ID
|
* @param parentId 父菜单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
public Menu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
||||||
}
|
}
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysNotice;
|
import com.hchyun.system.entity.Notice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告表 数据层
|
* 通知公告表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysNoticeDao {
|
public interface NoticeDao {
|
||||||
/**
|
/**
|
||||||
* 查询公告信息
|
* 查询公告信息
|
||||||
*
|
*
|
||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
public SysNotice selectNoticeById(Long noticeId);
|
public Notice selectNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告列表
|
* 查询公告列表
|
||||||
|
|
@ -24,7 +24,7 @@ public interface SysNoticeDao {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 公告集合
|
* @return 公告集合
|
||||||
*/
|
*/
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
public List<Notice> selectNoticeList(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
|
|
@ -32,7 +32,7 @@ public interface SysNoticeDao {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertNotice(SysNotice notice);
|
public int insertNotice(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
|
|
@ -40,7 +40,7 @@ public interface SysNoticeDao {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateNotice(SysNotice notice);
|
public int updateNotice(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除公告
|
* 批量删除公告
|
||||||
|
|
@ -2,20 +2,20 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 数据层
|
* 操作日志 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysOperLogDao {
|
public interface OperLogDao {
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
*/
|
*/
|
||||||
public void insertOperlog(SysOperLog operLog);
|
public void insertOperlog(OperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统操作日志集合
|
* 查询系统操作日志集合
|
||||||
|
|
@ -23,7 +23,7 @@ public interface SysOperLogDao {
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
public List<OperLog> selectOperLogList(OperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
|
|
@ -39,7 +39,7 @@ public interface SysOperLogDao {
|
||||||
* @param operId 操作ID
|
* @param operId 操作ID
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
public SysOperLog selectOperLogById(Long operId);
|
public OperLog selectOperLogById(Long operId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
|
|
@ -2,28 +2,28 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysPost;
|
import com.hchyun.system.entity.Post;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位信息 数据层
|
* 岗位信息 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysPostDao {
|
public interface PostDao {
|
||||||
/**
|
/**
|
||||||
* 查询岗位数据集合
|
* 查询岗位数据集合
|
||||||
*
|
*
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 岗位数据集合
|
* @return 岗位数据集合
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostList(SysPost post);
|
public List<Post> selectPostList(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有岗位
|
* 查询所有岗位
|
||||||
*
|
*
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostAll();
|
public List<Post> selectPostAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位ID查询岗位信息
|
* 通过岗位ID查询岗位信息
|
||||||
|
|
@ -31,7 +31,7 @@ public interface SysPostDao {
|
||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysPost selectPostById(Long postId);
|
public Post selectPostById(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取岗位选择框列表
|
* 根据用户ID获取岗位选择框列表
|
||||||
|
|
@ -47,7 +47,7 @@ public interface SysPostDao {
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostsByUserName(String userName);
|
public List<Post> selectPostsByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除岗位信息
|
* 删除岗位信息
|
||||||
|
|
@ -71,7 +71,7 @@ public interface SysPostDao {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updatePost(SysPost post);
|
public int updatePost(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增岗位信息
|
* 新增岗位信息
|
||||||
|
|
@ -79,7 +79,7 @@ public interface SysPostDao {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPost(SysPost post);
|
public int insertPost(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验岗位名称
|
* 校验岗位名称
|
||||||
|
|
@ -87,7 +87,7 @@ public interface SysPostDao {
|
||||||
* @param postName 岗位名称
|
* @param postName 岗位名称
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysPost checkPostNameUnique(String postName);
|
public Post checkPostNameUnique(String postName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验岗位编码
|
* 校验岗位编码
|
||||||
|
|
@ -95,5 +95,5 @@ public interface SysPostDao {
|
||||||
* @param postCode 岗位编码
|
* @param postCode 岗位编码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysPost checkPostCodeUnique(String postCode);
|
public Post checkPostCodeUnique(String postCode);
|
||||||
}
|
}
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色表 数据层
|
* 角色表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysRoleDao {
|
public interface RoleDao {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询角色数据
|
* 根据条件分页查询角色数据
|
||||||
*
|
*
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 角色数据集合信息
|
* @return 角色数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleList(SysRole role);
|
public List<Role> selectRoleList(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
|
|
@ -24,14 +24,14 @@ public interface SysRoleDao {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRolePermissionByUserId(Long userId);
|
public List<Role> selectRolePermissionByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有角色
|
* 查询所有角色
|
||||||
*
|
*
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleAll();
|
public List<Role> selectRoleAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取角色选择框列表
|
* 根据用户ID获取角色选择框列表
|
||||||
|
|
@ -47,7 +47,7 @@ public interface SysRoleDao {
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysRole selectRoleById(Long roleId);
|
public Role selectRoleById(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
|
|
@ -55,7 +55,7 @@ public interface SysRoleDao {
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRolesByUserName(String userName);
|
public List<Role> selectRolesByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色名称是否唯一
|
* 校验角色名称是否唯一
|
||||||
|
|
@ -63,7 +63,7 @@ public interface SysRoleDao {
|
||||||
* @param roleName 角色名称
|
* @param roleName 角色名称
|
||||||
* @return 角色信息
|
* @return 角色信息
|
||||||
*/
|
*/
|
||||||
public SysRole checkRoleNameUnique(String roleName);
|
public Role checkRoleNameUnique(String roleName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
|
|
@ -71,7 +71,7 @@ public interface SysRoleDao {
|
||||||
* @param roleKey 角色权限
|
* @param roleKey 角色权限
|
||||||
* @return 角色信息
|
* @return 角色信息
|
||||||
*/
|
*/
|
||||||
public SysRole checkRoleKeyUnique(String roleKey);
|
public Role checkRoleKeyUnique(String roleKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改角色信息
|
* 修改角色信息
|
||||||
|
|
@ -79,7 +79,7 @@ public interface SysRoleDao {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateRole(SysRole role);
|
public int updateRole(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增角色信息
|
* 新增角色信息
|
||||||
|
|
@ -87,7 +87,7 @@ public interface SysRoleDao {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertRole(SysRole role);
|
public int insertRole(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID删除角色
|
* 通过角色ID删除角色
|
||||||
|
|
@ -2,14 +2,14 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysRoleDept;
|
import com.hchyun.system.entity.RoleDept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色与部门关联表 数据层
|
* 角色与部门关联表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysRoleDeptDao {
|
public interface RoleDeptDao {
|
||||||
/**
|
/**
|
||||||
* 通过角色ID删除角色和部门关联
|
* 通过角色ID删除角色和部门关联
|
||||||
*
|
*
|
||||||
|
|
@ -40,5 +40,5 @@ public interface SysRoleDeptDao {
|
||||||
* @param roleDeptList 角色部门列表
|
* @param roleDeptList 角色部门列表
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int batchRoleDept(List<SysRoleDept> roleDeptList);
|
public int batchRoleDept(List<RoleDept> roleDeptList);
|
||||||
}
|
}
|
||||||
|
|
@ -2,14 +2,14 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysRoleMenu;
|
import com.hchyun.system.entity.RoleMenu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色与菜单关联表 数据层
|
* 角色与菜单关联表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysRoleMenuDao {
|
public interface RoleMenuDao {
|
||||||
/**
|
/**
|
||||||
* 查询菜单使用数量
|
* 查询菜单使用数量
|
||||||
*
|
*
|
||||||
|
|
@ -32,5 +32,5 @@ public interface SysRoleMenuDao {
|
||||||
* @param roleMenuList 角色菜单列表
|
* @param roleMenuList 角色菜单列表
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int batchRoleMenu(List<SysRoleMenu> roleMenuList);
|
public int batchRoleMenu(List<RoleMenu> roleMenuList);
|
||||||
}
|
}
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户表 数据层
|
* 用户表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysUserDao {
|
public interface UserDao {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询用户列表
|
* 根据条件分页查询用户列表
|
||||||
*
|
*
|
||||||
* @param sysUser 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysUser> selectUserList(SysUser sysUser);
|
public List<User> selectUserList(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户
|
* 通过用户名查询用户
|
||||||
|
|
@ -25,7 +25,7 @@ public interface SysUserDao {
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName(String userName);
|
public User selectUserByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
|
|
@ -33,7 +33,7 @@ public interface SysUserDao {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserById(Long userId);
|
public User selectUserById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户信息
|
* 新增用户信息
|
||||||
|
|
@ -41,7 +41,7 @@ public interface SysUserDao {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertUser(SysUser user);
|
public int insertUser(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户信息
|
* 修改用户信息
|
||||||
|
|
@ -49,7 +49,7 @@ public interface SysUserDao {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUser(SysUser user);
|
public int updateUser(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户头像
|
* 修改用户头像
|
||||||
|
|
@ -99,7 +99,7 @@ public interface SysUserDao {
|
||||||
* @param phonenumber 手机号码
|
* @param phonenumber 手机号码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysUser checkPhoneUnique(String phonenumber);
|
public User checkPhoneUnique(String phonenumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验email是否唯一
|
* 校验email是否唯一
|
||||||
|
|
@ -107,5 +107,5 @@ public interface SysUserDao {
|
||||||
* @param email 用户邮箱
|
* @param email 用户邮箱
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysUser checkEmailUnique(String email);
|
public User checkEmailUnique(String email);
|
||||||
}
|
}
|
||||||
|
|
@ -2,14 +2,14 @@ package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysUserPost;
|
import com.hchyun.system.entity.UserPost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户与岗位关联表 数据层
|
* 用户与岗位关联表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysUserPostDao {
|
public interface UserPostDao {
|
||||||
/**
|
/**
|
||||||
* 通过用户ID删除用户和岗位关联
|
* 通过用户ID删除用户和岗位关联
|
||||||
*
|
*
|
||||||
|
|
@ -40,5 +40,5 @@ public interface SysUserPostDao {
|
||||||
* @param userPostList 用户角色列表
|
* @param userPostList 用户角色列表
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int batchUserPost(List<SysUserPost> userPostList);
|
public int batchUserPost(List<UserPost> userPostList);
|
||||||
}
|
}
|
||||||
|
|
@ -3,14 +3,14 @@ package com.hchyun.system.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.hchyun.system.entity.SysUserRole;
|
import com.hchyun.system.entity.UserRole;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户与角色关联表 数据层
|
* 用户与角色关联表 数据层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface SysUserRoleDao {
|
public interface UserRoleDao {
|
||||||
/**
|
/**
|
||||||
* 通过用户ID删除用户和角色关联
|
* 通过用户ID删除用户和角色关联
|
||||||
*
|
*
|
||||||
|
|
@ -41,7 +41,7 @@ public interface SysUserRoleDao {
|
||||||
* @param userRoleList 用户角色列表
|
* @param userRoleList 用户角色列表
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int batchUserRole(List<SysUserRole> userRoleList);
|
public int batchUserRole(List<UserRole> userRoleList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除用户和角色关联信息
|
* 删除用户和角色关联信息
|
||||||
|
|
@ -49,7 +49,7 @@ public interface SysUserRoleDao {
|
||||||
* @param userRole 用户和角色关联信息
|
* @param userRole 用户和角色关联信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserRoleInfo(SysUserRole userRole);
|
public int deleteUserRoleInfo(UserRole userRole);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消授权用户角色
|
* 批量取消授权用户角色
|
||||||
|
|
@ -14,7 +14,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysConfig extends BaseEntity {
|
public class Config extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +12,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysLogininfor extends BaseEntity {
|
public class Logininfor extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +12,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysNotice extends BaseEntity {
|
public class Notice extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +12,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysOperLog extends BaseEntity {
|
public class OperLog extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,7 +14,7 @@ import com.hchyun.common.core.entity.BaseEntity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysPost extends BaseEntity {
|
public class Post extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -8,7 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysRoleDept {
|
public class RoleDept {
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
|
@ -8,7 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysRoleMenu {
|
public class RoleMenu {
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
|
@ -31,6 +31,11 @@ public class SysFile extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("角色id")
|
@ApiModelProperty("角色id")
|
||||||
private String roleIds;
|
private String roleIds;
|
||||||
|
/**
|
||||||
|
* 文件夹继承权限
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("文件夹继承权限")
|
||||||
|
private String inherit;
|
||||||
/**
|
/**
|
||||||
* 文件名称
|
* 文件名称
|
||||||
*/
|
*/
|
||||||
|
|
@ -68,6 +73,14 @@ public class SysFile extends BaseEntity {
|
||||||
private String isPublic;
|
private String isPublic;
|
||||||
|
|
||||||
|
|
||||||
|
public String getInherit() {
|
||||||
|
return inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInherit(String inherit) {
|
||||||
|
this.inherit = inherit;
|
||||||
|
}
|
||||||
|
|
||||||
public void setFileId(Long fileId) {
|
public void setFileId(Long fileId) {
|
||||||
this.fileId = fileId;
|
this.fileId = fileId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ package com.hchyun.system.entity;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysUserOnline {
|
public class UserOnline {
|
||||||
/**
|
/**
|
||||||
* 会话编号
|
* 会话编号
|
||||||
*/
|
*/
|
||||||
|
|
@ -8,7 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysUserPost {
|
public class UserPost {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
|
|
@ -8,7 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class SysUserRole {
|
public class UserRole {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysConfig;
|
import com.hchyun.system.entity.Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 服务层
|
* 参数配置 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysConfigService {
|
public interface ConfigService {
|
||||||
/**
|
/**
|
||||||
* 查询参数配置信息
|
* 查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param configId 参数配置ID
|
* @param configId 参数配置ID
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfigById(Long configId);
|
public Config selectConfigById(Long configId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
|
|
@ -32,7 +32,7 @@ public interface ISysConfigService {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置集合
|
* @return 参数配置集合
|
||||||
*/
|
*/
|
||||||
public List<SysConfig> selectConfigList(SysConfig config);
|
public List<Config> selectConfigList(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
|
|
@ -40,7 +40,7 @@ public interface ISysConfigService {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConfig(SysConfig config);
|
public int insertConfig(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
|
|
@ -48,7 +48,7 @@ public interface ISysConfigService {
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateConfig(SysConfig config);
|
public int updateConfig(Config config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除参数信息
|
* 批量删除参数信息
|
||||||
|
|
@ -69,5 +69,5 @@ public interface ISysConfigService {
|
||||||
* @param config 参数信息
|
* @param config 参数信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkConfigKeyUnique(SysConfig config);
|
public String checkConfigKeyUnique(Config config);
|
||||||
}
|
}
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.TreeSelect;
|
import com.hchyun.common.core.entity.TreeSelect;
|
||||||
import com.hchyun.common.core.entity.entity.SysDept;
|
import com.hchyun.common.core.entity.entity.Dept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 服务层
|
* 部门管理 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysDeptService {
|
public interface DeptService {
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询部门管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList(SysDept dept);
|
public List<Dept> selectDeptList(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
|
|
@ -25,7 +25,7 @@ public interface ISysDeptService {
|
||||||
* @param depts 部门列表
|
* @param depts 部门列表
|
||||||
* @return 树结构列表
|
* @return 树结构列表
|
||||||
*/
|
*/
|
||||||
public List<SysDept> buildDeptTree(List<SysDept> depts);
|
public List<Dept> buildDeptTree(List<Dept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要下拉树结构
|
* 构建前端所需要下拉树结构
|
||||||
|
|
@ -33,7 +33,7 @@ public interface ISysDeptService {
|
||||||
* @param depts 部门列表
|
* @param depts 部门列表
|
||||||
* @return 下拉树结构列表
|
* @return 下拉树结构列表
|
||||||
*/
|
*/
|
||||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
public List<TreeSelect> buildDeptTreeSelect(List<Dept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门树信息
|
* 根据角色ID查询部门树信息
|
||||||
|
|
@ -49,7 +49,7 @@ public interface ISysDeptService {
|
||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 部门信息
|
* @return 部门信息
|
||||||
*/
|
*/
|
||||||
public SysDept selectDeptById(Long deptId);
|
public Dept selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门(正常状态)
|
* 根据ID查询所有子部门(正常状态)
|
||||||
|
|
@ -81,7 +81,7 @@ public interface ISysDeptService {
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDeptNameUnique(SysDept dept);
|
public String checkDeptNameUnique(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存部门信息
|
||||||
|
|
@ -89,7 +89,7 @@ public interface ISysDeptService {
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(SysDept dept);
|
public int insertDept(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存部门信息
|
||||||
|
|
@ -97,7 +97,7 @@ public interface ISysDeptService {
|
||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(SysDept dept);
|
public int updateDept(Dept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除部门管理信息
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysDictDataService {
|
public interface DictDataService {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询字典数据
|
* 根据条件分页查询字典数据
|
||||||
*
|
*
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
public List<DictData> selectDictDataList(DictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
* 根据字典类型和字典键值查询字典数据信息
|
||||||
|
|
@ -33,7 +33,7 @@ public interface ISysDictDataService {
|
||||||
* @param dictCode 字典数据ID
|
* @param dictCode 字典数据ID
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
public SysDictData selectDictDataById(Long dictCode);
|
public DictData selectDictDataById(Long dictCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除字典数据信息
|
* 批量删除字典数据信息
|
||||||
|
|
@ -49,7 +49,7 @@ public interface ISysDictDataService {
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictData(SysDictData dictData);
|
public int insertDictData(DictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典数据信息
|
* 修改保存字典数据信息
|
||||||
|
|
@ -57,5 +57,5 @@ public interface ISysDictDataService {
|
||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictData(SysDictData dictData);
|
public int updateDictData(DictData dictData);
|
||||||
}
|
}
|
||||||
|
|
@ -2,29 +2,29 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictType;
|
import com.hchyun.common.core.entity.entity.DictType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysDictTypeService {
|
public interface DictTypeService {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询字典类型
|
* 根据条件分页查询字典类型
|
||||||
*
|
*
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
public List<DictType> selectDictTypeList(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据所有字典类型
|
* 根据所有字典类型
|
||||||
*
|
*
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeAll();
|
public List<DictType> selectDictTypeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询字典数据
|
* 根据字典类型查询字典数据
|
||||||
|
|
@ -32,7 +32,7 @@ public interface ISysDictTypeService {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataByType(String dictType);
|
public List<DictData> selectDictDataByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型ID查询信息
|
* 根据字典类型ID查询信息
|
||||||
|
|
@ -40,7 +40,7 @@ public interface ISysDictTypeService {
|
||||||
* @param dictId 字典类型ID
|
* @param dictId 字典类型ID
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeById(Long dictId);
|
public DictType selectDictTypeById(Long dictId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询信息
|
* 根据字典类型查询信息
|
||||||
|
|
@ -48,7 +48,7 @@ public interface ISysDictTypeService {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeByType(String dictType);
|
public DictType selectDictTypeByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除字典信息
|
* 批量删除字典信息
|
||||||
|
|
@ -69,7 +69,7 @@ public interface ISysDictTypeService {
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictType(SysDictType dictType);
|
public int insertDictType(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典类型信息
|
* 修改保存字典类型信息
|
||||||
|
|
@ -77,7 +77,7 @@ public interface ISysDictTypeService {
|
||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictType(SysDictType dictType);
|
public int updateDictType(DictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验字典类型称是否唯一
|
* 校验字典类型称是否唯一
|
||||||
|
|
@ -85,5 +85,5 @@ public interface ISysDictTypeService {
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDictTypeUnique(SysDictType dictType);
|
public String checkDictTypeUnique(DictType dictType);
|
||||||
}
|
}
|
||||||
|
|
@ -2,20 +2,20 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysLogininfor;
|
import com.hchyun.system.entity.Logininfor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 服务层
|
* 系统访问日志情况信息 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysLogininforService {
|
public interface LogininforService {
|
||||||
/**
|
/**
|
||||||
* 新增系统登录日志
|
* 新增系统登录日志
|
||||||
*
|
*
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
*/
|
*/
|
||||||
public void insertLogininfor(SysLogininfor logininfor);
|
public void insertLogininfor(Logininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统登录日志集合
|
* 查询系统登录日志集合
|
||||||
|
|
@ -23,7 +23,7 @@ public interface ISysLogininforService {
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
public List<Logininfor> selectLogininforList(Logininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统登录日志
|
* 批量删除系统登录日志
|
||||||
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.TreeSelect;
|
import com.hchyun.common.core.entity.TreeSelect;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.system.entity.vo.RouterVo;
|
import com.hchyun.system.entity.vo.RouterVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,14 +12,14 @@ import com.hchyun.system.entity.vo.RouterVo;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysMenuService {
|
public interface MenuService {
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(Long userId);
|
public List<Menu> selectMenuList(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
|
|
@ -28,7 +28,7 @@ public interface ISysMenuService {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId);
|
public List<Menu> selectMenuList(Menu menu, Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
|
|
@ -44,7 +44,7 @@ public interface ISysMenuService {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
public List<Menu> selectMenuTreeByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
|
|
@ -60,7 +60,7 @@ public interface ISysMenuService {
|
||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 路由列表
|
* @return 路由列表
|
||||||
*/
|
*/
|
||||||
public List<RouterVo> buildMenus(List<SysMenu> menus);
|
public List<RouterVo> buildMenus(List<Menu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
|
|
@ -68,7 +68,7 @@ public interface ISysMenuService {
|
||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 树结构列表
|
* @return 树结构列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus);
|
public List<Menu> buildMenuTree(List<Menu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要下拉树结构
|
* 构建前端所需要下拉树结构
|
||||||
|
|
@ -76,7 +76,7 @@ public interface ISysMenuService {
|
||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 下拉树结构列表
|
* @return 下拉树结构列表
|
||||||
*/
|
*/
|
||||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
|
public List<TreeSelect> buildMenuTreeSelect(List<Menu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据菜单ID查询信息
|
* 根据菜单ID查询信息
|
||||||
|
|
@ -84,7 +84,7 @@ public interface ISysMenuService {
|
||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 菜单信息
|
* @return 菜单信息
|
||||||
*/
|
*/
|
||||||
public SysMenu selectMenuById(Long menuId);
|
public Menu selectMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在菜单子节点
|
* 是否存在菜单子节点
|
||||||
|
|
@ -108,7 +108,7 @@ public interface ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertMenu(SysMenu menu);
|
public int insertMenu(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存菜单信息
|
* 修改保存菜单信息
|
||||||
|
|
@ -116,7 +116,7 @@ public interface ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateMenu(SysMenu menu);
|
public int updateMenu(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜单管理信息
|
* 删除菜单管理信息
|
||||||
|
|
@ -132,5 +132,5 @@ public interface ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkMenuNameUnique(SysMenu menu);
|
public String checkMenuNameUnique(Menu menu);
|
||||||
}
|
}
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysNotice;
|
import com.hchyun.system.entity.Notice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告 服务层
|
* 公告 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysNoticeService {
|
public interface NoticeService {
|
||||||
/**
|
/**
|
||||||
* 查询公告信息
|
* 查询公告信息
|
||||||
*
|
*
|
||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
public SysNotice selectNoticeById(Long noticeId);
|
public Notice selectNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告列表
|
* 查询公告列表
|
||||||
|
|
@ -24,7 +24,7 @@ public interface ISysNoticeService {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 公告集合
|
* @return 公告集合
|
||||||
*/
|
*/
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
public List<Notice> selectNoticeList(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
|
|
@ -32,7 +32,7 @@ public interface ISysNoticeService {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertNotice(SysNotice notice);
|
public int insertNotice(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
|
|
@ -40,7 +40,7 @@ public interface ISysNoticeService {
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateNotice(SysNotice notice);
|
public int updateNotice(Notice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告信息
|
* 删除公告信息
|
||||||
|
|
@ -2,20 +2,20 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 服务层
|
* 操作日志 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysOperLogService {
|
public interface OperLogService {
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
*/
|
*/
|
||||||
public void insertOperlog(SysOperLog operLog);
|
public void insertOperlog(OperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统操作日志集合
|
* 查询系统操作日志集合
|
||||||
|
|
@ -23,7 +23,7 @@ public interface ISysOperLogService {
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
public List<OperLog> selectOperLogList(OperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
|
|
@ -39,7 +39,7 @@ public interface ISysOperLogService {
|
||||||
* @param operId 操作ID
|
* @param operId 操作ID
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
public SysOperLog selectOperLogById(Long operId);
|
public OperLog selectOperLogById(Long operId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
|
|
@ -2,28 +2,28 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.SysPost;
|
import com.hchyun.system.entity.Post;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位信息 服务层
|
* 岗位信息 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysPostService {
|
public interface PostService {
|
||||||
/**
|
/**
|
||||||
* 查询岗位信息集合
|
* 查询岗位信息集合
|
||||||
*
|
*
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostList(SysPost post);
|
public List<Post> selectPostList(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有岗位
|
* 查询所有岗位
|
||||||
*
|
*
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostAll();
|
public List<Post> selectPostAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位ID查询岗位信息
|
* 通过岗位ID查询岗位信息
|
||||||
|
|
@ -31,7 +31,7 @@ public interface ISysPostService {
|
||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysPost selectPostById(Long postId);
|
public Post selectPostById(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取岗位选择框列表
|
* 根据用户ID获取岗位选择框列表
|
||||||
|
|
@ -47,7 +47,7 @@ public interface ISysPostService {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPostNameUnique(SysPost post);
|
public String checkPostNameUnique(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验岗位编码
|
* 校验岗位编码
|
||||||
|
|
@ -55,7 +55,7 @@ public interface ISysPostService {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPostCodeUnique(SysPost post);
|
public String checkPostCodeUnique(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位ID查询岗位使用数量
|
* 通过岗位ID查询岗位使用数量
|
||||||
|
|
@ -88,7 +88,7 @@ public interface ISysPostService {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPost(SysPost post);
|
public int insertPost(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存岗位信息
|
* 修改保存岗位信息
|
||||||
|
|
@ -96,5 +96,5 @@ public interface ISysPostService {
|
||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updatePost(SysPost post);
|
public int updatePost(Post post);
|
||||||
}
|
}
|
||||||
|
|
@ -3,21 +3,21 @@ package com.hchyun.system.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色业务层
|
* 角色业务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysRoleService {
|
public interface RoleService {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询角色数据
|
* 根据条件分页查询角色数据
|
||||||
*
|
*
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 角色数据集合信息
|
* @return 角色数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleList(SysRole role);
|
public List<Role> selectRoleList(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
|
|
@ -33,7 +33,7 @@ public interface ISysRoleService {
|
||||||
* @param type
|
* @param type
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleAll(Integer type);
|
public List<Role> selectRoleAll(Integer type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取角色选择框列表
|
* 根据用户ID获取角色选择框列表
|
||||||
|
|
@ -49,7 +49,7 @@ public interface ISysRoleService {
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysRole selectRoleById(Long roleId);
|
public Role selectRoleById(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色名称是否唯一
|
* 校验角色名称是否唯一
|
||||||
|
|
@ -57,7 +57,7 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkRoleNameUnique(SysRole role);
|
public String checkRoleNameUnique(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
|
|
@ -65,14 +65,14 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkRoleKeyUnique(SysRole role);
|
public String checkRoleKeyUnique(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色是否允许操作
|
* 校验角色是否允许操作
|
||||||
*
|
*
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
*/
|
*/
|
||||||
public void checkRoleAllowed(SysRole role);
|
public void checkRoleAllowed(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID查询角色使用数量
|
* 通过角色ID查询角色使用数量
|
||||||
|
|
@ -88,7 +88,7 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertRole(SysRole role);
|
public int insertRole(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存角色信息
|
* 修改保存角色信息
|
||||||
|
|
@ -96,7 +96,7 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateRole(SysRole role);
|
public int updateRole(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改角色状态
|
* 修改角色状态
|
||||||
|
|
@ -104,7 +104,7 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateRoleStatus(SysRole role);
|
public int updateRoleStatus(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改数据权限信息
|
* 修改数据权限信息
|
||||||
|
|
@ -112,7 +112,7 @@ public interface ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int authDataScope(SysRole role);
|
public int authDataScope(Role role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID删除角色
|
* 通过角色ID删除角色
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.hchyun.system.service;
|
package com.hchyun.system.service;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.system.entity.SysUserOnline;
|
import com.hchyun.system.entity.UserOnline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线用户 服务层
|
* 在线用户 服务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysUserOnlineService {
|
public interface UserOnlineService {
|
||||||
/**
|
/**
|
||||||
* 通过登录地址查询信息
|
* 通过登录地址查询信息
|
||||||
*
|
*
|
||||||
|
|
@ -16,7 +16,7 @@ public interface ISysUserOnlineService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
public UserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名称查询信息
|
* 通过用户名称查询信息
|
||||||
|
|
@ -25,7 +25,7 @@ public interface ISysUserOnlineService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
public UserOnline selectOnlineByUserName(String userName, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过登录地址/用户名称查询信息
|
* 通过登录地址/用户名称查询信息
|
||||||
|
|
@ -35,7 +35,7 @@ public interface ISysUserOnlineService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
public UserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置在线用户信息
|
* 设置在线用户信息
|
||||||
|
|
@ -43,5 +43,5 @@ public interface ISysUserOnlineService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户
|
* @return 在线用户
|
||||||
*/
|
*/
|
||||||
public SysUserOnline loginUserToUserOnline(LoginUser user);
|
public UserOnline loginUserToUserOnline(LoginUser user);
|
||||||
}
|
}
|
||||||
|
|
@ -2,21 +2,21 @@ package com.hchyun.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户 业务层
|
* 用户 业务层
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public interface ISysUserService {
|
public interface UserService {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询用户列表
|
* 根据条件分页查询用户列表
|
||||||
*
|
*
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysUser> selectUserList(SysUser user);
|
public List<User> selectUserList(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户
|
* 通过用户名查询用户
|
||||||
|
|
@ -24,7 +24,7 @@ public interface ISysUserService {
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName(String userName);
|
public User selectUserByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
|
|
@ -32,7 +32,7 @@ public interface ISysUserService {
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserById(Long userId);
|
public User selectUserById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询用户所属角色组
|
* 根据用户ID查询用户所属角色组
|
||||||
|
|
@ -64,7 +64,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPhoneUnique(SysUser user);
|
public String checkPhoneUnique(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验email是否唯一
|
* 校验email是否唯一
|
||||||
|
|
@ -72,14 +72,14 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkEmailUnique(SysUser user);
|
public String checkEmailUnique(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户是否允许操作
|
* 校验用户是否允许操作
|
||||||
*
|
*
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
*/
|
*/
|
||||||
public void checkUserAllowed(SysUser user);
|
public void checkUserAllowed(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户信息
|
* 新增用户信息
|
||||||
|
|
@ -87,7 +87,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertUser(SysUser user);
|
public int insertUser(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户信息
|
* 修改用户信息
|
||||||
|
|
@ -95,7 +95,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUser(SysUser user);
|
public int updateUser(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户状态
|
* 修改用户状态
|
||||||
|
|
@ -103,7 +103,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUserStatus(SysUser user);
|
public int updateUserStatus(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户基本信息
|
* 修改用户基本信息
|
||||||
|
|
@ -111,7 +111,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUserProfile(SysUser user);
|
public int updateUserProfile(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户头像
|
* 修改用户头像
|
||||||
|
|
@ -128,7 +128,7 @@ public interface ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int resetPwd(SysUser user);
|
public int resetPwd(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
|
|
@ -163,5 +163,5 @@ public interface ISysUserService {
|
||||||
* @param operName 操作用户
|
* @param operName 操作用户
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, Long operName);
|
public String importUser(List<User> userList, Boolean isUpdateSupport, Long operName);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,232 @@
|
||||||
|
package com.hchyun.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.hchyun.common.annotation.DataSource;
|
||||||
|
import com.hchyun.common.constant.Constants;
|
||||||
|
import com.hchyun.common.constant.UserConstants;
|
||||||
|
import com.hchyun.common.core.redis.RedisCache;
|
||||||
|
import com.hchyun.common.core.text.Convert;
|
||||||
|
import com.hchyun.common.enums.DataSourceType;
|
||||||
|
import com.hchyun.common.exception.CustomException;
|
||||||
|
import com.hchyun.common.utils.StringUtils;
|
||||||
|
import com.hchyun.system.entity.Config;
|
||||||
|
import com.hchyun.system.dao.ConfigDao;
|
||||||
|
import com.hchyun.system.service.ConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 服务层实现
|
||||||
|
*
|
||||||
|
* @author hchyun
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ConfigServiceImpl implements ConfigService {
|
||||||
|
private Logger logger = LoggerFactory.getLogger(ConfigServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
private ConfigDao configMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目启动时,初始化参数到缓存
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
try {
|
||||||
|
List<Config> configsList = configMapper.selectConfigList(new Config());
|
||||||
|
for (Config config : configsList) {
|
||||||
|
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询参数配置信息
|
||||||
|
*
|
||||||
|
* @param configId 参数配置ID
|
||||||
|
* @return 参数配置信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@DataSource(DataSourceType.MASTER)
|
||||||
|
public Config selectConfigById(Long configId) {
|
||||||
|
try {
|
||||||
|
Config config = new Config();
|
||||||
|
config.setConfigId(configId);
|
||||||
|
return configMapper.selectConfig(config);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据键名查询参数配置信息
|
||||||
|
*
|
||||||
|
* @param configKey 参数key
|
||||||
|
* @return 参数键值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String selectConfigByKey(String configKey) {
|
||||||
|
try {
|
||||||
|
String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey)));
|
||||||
|
if (StringUtils.isNotEmpty(configValue)) {
|
||||||
|
return configValue;
|
||||||
|
}
|
||||||
|
Config config = new Config();
|
||||||
|
config.setConfigKey(configKey);
|
||||||
|
Config retConfig = configMapper.selectConfig(config);
|
||||||
|
if (StringUtils.isNotNull(retConfig)) {
|
||||||
|
redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
||||||
|
return retConfig.getConfigValue();
|
||||||
|
}
|
||||||
|
return StringUtils.EMPTY;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询参数配置列表
|
||||||
|
*
|
||||||
|
* @param config 参数配置信息
|
||||||
|
* @return 参数配置集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Config> selectConfigList(Config config) {
|
||||||
|
try {
|
||||||
|
return configMapper.selectConfigList(config);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增参数配置
|
||||||
|
*
|
||||||
|
* @param config 参数配置信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertConfig(Config config) {
|
||||||
|
try {
|
||||||
|
int row = configMapper.insertConfig(config);
|
||||||
|
if (row > 0) {
|
||||||
|
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||||
|
}
|
||||||
|
return row;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改参数配置
|
||||||
|
*
|
||||||
|
* @param config 参数配置信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateConfig(Config config) {
|
||||||
|
try {
|
||||||
|
int row = configMapper.updateConfig(config);
|
||||||
|
if (row > 0) {
|
||||||
|
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||||
|
}
|
||||||
|
return row;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除参数信息
|
||||||
|
*
|
||||||
|
* @param configIds 需要删除的参数ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteConfigByIds(Long[] configIds) {
|
||||||
|
try {
|
||||||
|
for (Long configId : configIds) {
|
||||||
|
Config config = selectConfigById(configId);
|
||||||
|
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
|
||||||
|
throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = configMapper.deleteConfigByIds(configIds);
|
||||||
|
if (count > 0) {
|
||||||
|
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
|
||||||
|
redisCache.deleteObject(keys);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空缓存数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void clearCache() {
|
||||||
|
try {
|
||||||
|
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
|
||||||
|
redisCache.deleteObject(keys);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验参数键名是否唯一
|
||||||
|
*
|
||||||
|
* @param config 参数配置信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String checkConfigKeyUnique(Config config) {
|
||||||
|
try {
|
||||||
|
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||||
|
Config info = configMapper.checkConfigKeyUnique(config.getConfigKey());
|
||||||
|
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置cache key
|
||||||
|
*
|
||||||
|
* @param configKey 参数键
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
private String getCacheKey(String configKey) {
|
||||||
|
try {
|
||||||
|
return Constants.SYS_CONFIG_KEY + configKey;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,350 @@
|
||||||
|
package com.hchyun.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.hchyun.common.annotation.DataScope;
|
||||||
|
import com.hchyun.common.constant.UserConstants;
|
||||||
|
import com.hchyun.common.core.entity.TreeSelect;
|
||||||
|
import com.hchyun.common.core.entity.entity.Dept;
|
||||||
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
|
import com.hchyun.common.exception.CustomException;
|
||||||
|
import com.hchyun.common.utils.StringUtils;
|
||||||
|
import com.hchyun.system.dao.DeptDao;
|
||||||
|
import com.hchyun.system.dao.RoleDao;
|
||||||
|
import com.hchyun.system.service.DeptService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门管理 服务实现
|
||||||
|
*
|
||||||
|
* @author hchyun
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeptServiceImpl implements DeptService {
|
||||||
|
private Logger logger = LoggerFactory.getLogger(DeptServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeptDao sysDeptDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RoleDao roleDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门管理数据
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 部门信息集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@DataScope(deptAlias = "d")
|
||||||
|
public List<Dept> selectDeptList(Dept dept) {
|
||||||
|
try {
|
||||||
|
return sysDeptDao.selectDeptList(dept);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建前端所需要树结构
|
||||||
|
*
|
||||||
|
* @param depts 部门列表
|
||||||
|
* @return 树结构列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Dept> buildDeptTree(List<Dept> depts) {
|
||||||
|
try {
|
||||||
|
List<Dept> returnList = new ArrayList<Dept>();
|
||||||
|
List<Long> tempList = new ArrayList<Long>();
|
||||||
|
for (Dept dept : depts) {
|
||||||
|
tempList.add(dept.getDeptId());
|
||||||
|
}
|
||||||
|
for (Iterator<Dept> iterator = depts.iterator(); iterator.hasNext(); ) {
|
||||||
|
Dept dept = (Dept) iterator.next();
|
||||||
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
|
if (!tempList.contains(dept.getParentId())) {
|
||||||
|
recursionFn(depts, dept);
|
||||||
|
returnList.add(dept);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (returnList.isEmpty()) {
|
||||||
|
returnList = depts;
|
||||||
|
}
|
||||||
|
return returnList;
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建前端所需要下拉树结构
|
||||||
|
*
|
||||||
|
* @param depts 部门列表
|
||||||
|
* @return 下拉树结构列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TreeSelect> buildDeptTreeSelect(List<Dept> depts) {
|
||||||
|
try {
|
||||||
|
List<Dept> deptTrees = buildDeptTree(depts);
|
||||||
|
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色ID查询部门树信息
|
||||||
|
*
|
||||||
|
* @param roleId 角色ID
|
||||||
|
* @return 选中部门列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Integer> selectDeptListByRoleId(Long roleId) {
|
||||||
|
try {
|
||||||
|
Role role = roleDao.selectRoleById(roleId);
|
||||||
|
return sysDeptDao.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门ID查询信息
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 部门信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Dept selectDeptById(Long deptId) {
|
||||||
|
try {
|
||||||
|
return sysDeptDao.selectDeptById(deptId);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询所有子部门(正常状态)
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 子部门数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int selectNormalChildrenDeptById(Long deptId) {
|
||||||
|
try {
|
||||||
|
return sysDeptDao.selectNormalChildrenDeptById(deptId);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否存在子节点
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean hasChildByDeptId(Long deptId) {
|
||||||
|
try {
|
||||||
|
int result = sysDeptDao.hasChildByDeptId(deptId);
|
||||||
|
return result > 0 ? true : false;
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门是否存在用户
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 结果 true 存在 false 不存在
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkDeptExistUser(Long deptId) {
|
||||||
|
try {
|
||||||
|
int result = sysDeptDao.checkDeptExistUser(deptId);
|
||||||
|
return result > 0 ? true : false;
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验部门名称是否唯一
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String checkDeptNameUnique(Dept dept) {
|
||||||
|
try {
|
||||||
|
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
|
||||||
|
Dept info = sysDeptDao.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
|
||||||
|
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存部门信息
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDept(Dept dept) {
|
||||||
|
try {
|
||||||
|
Dept info = sysDeptDao.selectDeptById(dept.getParentId());
|
||||||
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||||
|
throw new CustomException("部门停用,不允许新增");
|
||||||
|
}
|
||||||
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||||
|
return sysDeptDao.insertDept(dept);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存部门信息
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDept(Dept dept) {
|
||||||
|
try {
|
||||||
|
Dept newParentDept = sysDeptDao.selectDeptById(dept.getParentId());
|
||||||
|
Dept oldDept = sysDeptDao.selectDeptById(dept.getDeptId());
|
||||||
|
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
||||||
|
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
||||||
|
String oldAncestors = oldDept.getAncestors();
|
||||||
|
dept.setAncestors(newAncestors);
|
||||||
|
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
|
||||||
|
}
|
||||||
|
int result = sysDeptDao.updateDept(dept);
|
||||||
|
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) {
|
||||||
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||||
|
updateParentDeptStatus(dept);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改该部门的父级部门状态
|
||||||
|
*
|
||||||
|
* @param dept 当前部门
|
||||||
|
*/
|
||||||
|
private void updateParentDeptStatus(Dept dept) {
|
||||||
|
try {
|
||||||
|
Long updateBy = dept.getUpdateBy();
|
||||||
|
dept = sysDeptDao.selectDeptById(dept.getDeptId());
|
||||||
|
dept.setUpdateBy(updateBy);
|
||||||
|
sysDeptDao.updateDeptStatus(dept);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改子元素关系
|
||||||
|
*
|
||||||
|
* @param deptId 被修改的部门ID
|
||||||
|
* @param newAncestors 新的父ID集合
|
||||||
|
* @param oldAncestors 旧的父ID集合
|
||||||
|
*/
|
||||||
|
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
||||||
|
try {
|
||||||
|
List<Dept> children = sysDeptDao.selectChildrenDeptById(deptId);
|
||||||
|
for (Dept child : children) {
|
||||||
|
child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors));
|
||||||
|
}
|
||||||
|
if (children.size() > 0) {
|
||||||
|
sysDeptDao.updateDeptChildren(children);
|
||||||
|
}
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除部门管理信息
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeptById(Long deptId) {
|
||||||
|
try {
|
||||||
|
return sysDeptDao.deleteDeptById(deptId);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归列表
|
||||||
|
*/
|
||||||
|
private void recursionFn(List<Dept> list, Dept t) {
|
||||||
|
// 得到子节点列表
|
||||||
|
List<Dept> childList = getChildList(list, t);
|
||||||
|
t.setChildren(childList);
|
||||||
|
for (Dept tChild : childList) {
|
||||||
|
if (hasChild(list, tChild)) {
|
||||||
|
recursionFn(list, tChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到子节点列表
|
||||||
|
*/
|
||||||
|
private List<Dept> getChildList(List<Dept> list, Dept t) {
|
||||||
|
List<Dept> tlist = new ArrayList<Dept>();
|
||||||
|
Iterator<Dept> it = list.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Dept n = (Dept) it.next();
|
||||||
|
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||||
|
tlist.add(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否有子节点
|
||||||
|
*/
|
||||||
|
private boolean hasChild(List<Dept> list, Dept t) {
|
||||||
|
return getChildList(list, t).size() > 0 ? true : false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,12 +2,16 @@ package com.hchyun.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
|
import com.hchyun.common.exception.CustomException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
import com.hchyun.common.utils.DictUtils;
|
import com.hchyun.common.utils.DictUtils;
|
||||||
import com.hchyun.system.dao.SysDictDataDao;
|
import com.hchyun.system.dao.DictDataDao;
|
||||||
import com.hchyun.system.service.ISysDictDataService;
|
import com.hchyun.system.service.DictDataService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层处理
|
* 字典 业务层处理
|
||||||
|
|
@ -15,9 +19,10 @@ import com.hchyun.system.service.ISysDictDataService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictDataServiceImpl implements ISysDictDataService {
|
public class DictDataServiceImpl implements DictDataService {
|
||||||
|
private Logger logger = LoggerFactory.getLogger(DictDataServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDictDataDao dictDataMapper;
|
private DictDataDao dictDataDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询字典数据
|
* 根据条件分页查询字典数据
|
||||||
|
|
@ -26,8 +31,13 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
public List<DictData> selectDictDataList(DictData dictData) {
|
||||||
return dictDataMapper.selectDictDataList(dictData);
|
try {
|
||||||
|
return dictDataDao.selectDictDataList(dictData);
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
throw new CustomException(ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -39,7 +49,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectDictLabel(String dictType, String dictValue) {
|
public String selectDictLabel(String dictType, String dictValue) {
|
||||||
return dictDataMapper.selectDictLabel(dictType, dictValue);
|
return dictDataDao.selectDictLabel(dictType, dictValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,8 +59,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysDictData selectDictDataById(Long dictCode) {
|
public DictData selectDictDataById(Long dictCode) {
|
||||||
return dictDataMapper.selectDictDataById(dictCode);
|
return dictDataDao.selectDictDataById(dictCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,7 +71,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteDictDataByIds(Long[] dictCodes) {
|
public int deleteDictDataByIds(Long[] dictCodes) {
|
||||||
int row = dictDataMapper.deleteDictDataByIds(dictCodes);
|
int row = dictDataDao.deleteDictDataByIds(dictCodes);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
DictUtils.clearDictCache();
|
DictUtils.clearDictCache();
|
||||||
}
|
}
|
||||||
|
|
@ -75,8 +85,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDictData(SysDictData dictData) {
|
public int insertDictData(DictData dictData) {
|
||||||
int row = dictDataMapper.insertDictData(dictData);
|
int row = dictDataDao.insertDictData(dictData);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
DictUtils.clearDictCache();
|
DictUtils.clearDictCache();
|
||||||
}
|
}
|
||||||
|
|
@ -90,8 +100,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateDictData(SysDictData dictData) {
|
public int updateDictData(DictData dictData) {
|
||||||
int row = dictDataMapper.updateDictData(dictData);
|
int row = dictDataDao.updateDictData(dictData);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
DictUtils.clearDictCache();
|
DictUtils.clearDictCache();
|
||||||
}
|
}
|
||||||
|
|
@ -7,14 +7,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictData;
|
import com.hchyun.common.core.entity.entity.DictData;
|
||||||
import com.hchyun.common.core.entity.entity.SysDictType;
|
import com.hchyun.common.core.entity.entity.DictType;
|
||||||
import com.hchyun.common.exception.CustomException;
|
import com.hchyun.common.exception.CustomException;
|
||||||
import com.hchyun.common.utils.DictUtils;
|
import com.hchyun.common.utils.DictUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.dao.SysDictDataDao;
|
import com.hchyun.system.dao.DictDataDao;
|
||||||
import com.hchyun.system.dao.SysDictTypeDao;
|
import com.hchyun.system.dao.DictTypeDao;
|
||||||
import com.hchyun.system.service.ISysDictTypeService;
|
import com.hchyun.system.service.DictTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层处理
|
* 字典 业务层处理
|
||||||
|
|
@ -22,21 +22,21 @@ import com.hchyun.system.service.ISysDictTypeService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
public class DictTypeServiceImpl implements DictTypeService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDictTypeDao dictTypeMapper;
|
private DictTypeDao dictTypeMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDictDataDao dictDataMapper;
|
private DictDataDao dictDataMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目启动时,初始化字典到缓存
|
* 项目启动时,初始化字典到缓存
|
||||||
*/
|
*/
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
|
List<DictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
|
||||||
for (SysDictType dictType : dictTypeList) {
|
for (DictType dictType : dictTypeList) {
|
||||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
List<DictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
||||||
DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +48,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
|
public List<DictType> selectDictTypeList(DictType dictType) {
|
||||||
return dictTypeMapper.selectDictTypeList(dictType);
|
return dictTypeMapper.selectDictTypeList(dictType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictType> selectDictTypeAll() {
|
public List<DictType> selectDictTypeAll() {
|
||||||
return dictTypeMapper.selectDictTypeAll();
|
return dictTypeMapper.selectDictTypeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,8 +69,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
public List<DictData> selectDictDataByType(String dictType) {
|
||||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
List<DictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||||
if (StringUtils.isNotEmpty(dictDatas)) {
|
if (StringUtils.isNotEmpty(dictDatas)) {
|
||||||
return dictDatas;
|
return dictDatas;
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +89,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysDictType selectDictTypeById(Long dictId) {
|
public DictType selectDictTypeById(Long dictId) {
|
||||||
return dictTypeMapper.selectDictTypeById(dictId);
|
return dictTypeMapper.selectDictTypeById(dictId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysDictType selectDictTypeByType(String dictType) {
|
public DictType selectDictTypeByType(String dictType) {
|
||||||
return dictTypeMapper.selectDictTypeByType(dictType);
|
return dictTypeMapper.selectDictTypeByType(dictType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
@Override
|
@Override
|
||||||
public int deleteDictTypeByIds(Long[] dictIds) {
|
public int deleteDictTypeByIds(Long[] dictIds) {
|
||||||
for (Long dictId : dictIds) {
|
for (Long dictId : dictIds) {
|
||||||
SysDictType dictType = selectDictTypeById(dictId);
|
DictType dictType = selectDictTypeById(dictId);
|
||||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
|
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
|
||||||
throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||||
}
|
}
|
||||||
|
|
@ -140,7 +140,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDictType(SysDictType dictType) {
|
public int insertDictType(DictType dictType) {
|
||||||
int row = dictTypeMapper.insertDictType(dictType);
|
int row = dictTypeMapper.insertDictType(dictType);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
DictUtils.clearDictCache();
|
DictUtils.clearDictCache();
|
||||||
|
|
@ -156,8 +156,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateDictType(SysDictType dictType) {
|
public int updateDictType(DictType dictType) {
|
||||||
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
|
DictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
|
||||||
dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
|
dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
|
||||||
int row = dictTypeMapper.updateDictType(dictType);
|
int row = dictTypeMapper.updateDictType(dictType);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
|
|
@ -173,9 +173,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkDictTypeUnique(SysDictType dict) {
|
public String checkDictTypeUnique(DictType dict) {
|
||||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||||
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
||||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.common.constant.ReturnConstants;
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.ServerResult;
|
import com.hchyun.common.utils.ServerResult;
|
||||||
|
|
@ -77,8 +77,8 @@ public class FileServiceImpl implements FileService {
|
||||||
public ServerResult<List<SysFile>> selectFileFolder() {
|
public ServerResult<List<SysFile>> selectFileFolder() {
|
||||||
try {
|
try {
|
||||||
List<SysFile> sysFiles = fileDao.selectFileFolder();
|
List<SysFile> sysFiles = fileDao.selectFileFolder();
|
||||||
return new ServerResult<>(true,sysFiles);
|
return new ServerResult<>(true, sysFiles);
|
||||||
}catch (RuntimeException e){
|
} catch (RuntimeException e) {
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
return new ServerResult<List<SysFile>>(false, ReturnConstants.DB_EX);
|
return new ServerResult<List<SysFile>>(false, ReturnConstants.DB_EX);
|
||||||
}
|
}
|
||||||
|
|
@ -93,11 +93,19 @@ public class FileServiceImpl implements FileService {
|
||||||
@Override
|
@Override
|
||||||
public ServerResult<SysFile> insertFile(SysFile sysFile) {
|
public ServerResult<SysFile> insertFile(SysFile sysFile) {
|
||||||
try {
|
try {
|
||||||
sysFile.setCreateBy(SecurityUtils.getUserId());
|
|
||||||
sysFile = FtpUtils.uploadFtp(sysFile);
|
|
||||||
if (sysFile == null) {
|
if (sysFile == null) {
|
||||||
return new ServerResult<>(false, "文件上传失败!");
|
return new ServerResult<>(false, "文件上传失败!");
|
||||||
}
|
}
|
||||||
|
if (sysFile.getpId() != null || sysFile.getpId() > 0) {
|
||||||
|
SysFile folder = fileDao.selectFileById(sysFile.getpId());
|
||||||
|
sysFile.setInherit(folder.getRoleIds());
|
||||||
|
}
|
||||||
|
sysFile.setCreateBy(SecurityUtils.getUserId());
|
||||||
|
try {
|
||||||
|
sysFile = FtpUtils.uploadFtp(sysFile);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return new ServerResult<>(false, "文件处理出错,请重新上传文件!");
|
||||||
|
}
|
||||||
Integer renewal = fileDao.insertFile(sysFile);
|
Integer renewal = fileDao.insertFile(sysFile);
|
||||||
if (renewal > 0) {
|
if (renewal > 0) {
|
||||||
return new ServerResult<>(true, sysFile);
|
return new ServerResult<>(true, sysFile);
|
||||||
|
|
@ -119,6 +127,10 @@ public class FileServiceImpl implements FileService {
|
||||||
@Override
|
@Override
|
||||||
public ServerResult<Integer> updateFile(SysFile sysFile) {
|
public ServerResult<Integer> updateFile(SysFile sysFile) {
|
||||||
try {
|
try {
|
||||||
|
if (sysFile.getpId() != null || sysFile.getpId() > 0) {
|
||||||
|
SysFile folder = fileDao.selectFileById(sysFile.getpId());
|
||||||
|
sysFile.setInherit(folder.getRoleIds());
|
||||||
|
}
|
||||||
sysFile.setUpdateBy(SecurityUtils.getUserId());
|
sysFile.setUpdateBy(SecurityUtils.getUserId());
|
||||||
Integer renewal = fileDao.updateFile(sysFile);
|
Integer renewal = fileDao.updateFile(sysFile);
|
||||||
if (renewal > 0) {
|
if (renewal > 0) {
|
||||||
|
|
@ -166,26 +178,32 @@ public class FileServiceImpl implements FileService {
|
||||||
public ServerResult<SysFile> downloadFile(Long fileId, LoginUser loginUser) {
|
public ServerResult<SysFile> downloadFile(Long fileId, LoginUser loginUser) {
|
||||||
try {
|
try {
|
||||||
SysFile sysFile = fileDao.selectFileById(fileId);
|
SysFile sysFile = fileDao.selectFileById(fileId);
|
||||||
if (sysFile.getIsPublic().equals("2")){
|
if (sysFile.getIsPublic().equals("2")) {
|
||||||
if (loginUser == null){
|
if (loginUser == null) {
|
||||||
return new ServerResult<>(false,"请登录后再试!");
|
return new ServerResult<>(false, "请登录后再试!");
|
||||||
}else {
|
} else {
|
||||||
if (!loginUser.getUser().isAdmin()){
|
if (!loginUser.getUser().isAdmin()) {
|
||||||
String[] roleIds = sysFile.getRoleIds().split(",");
|
String roleid;
|
||||||
|
if (sysFile.getpId() != 0) {
|
||||||
|
roleid = sysFile.getInherit() + "," + sysFile.getRoleIds();
|
||||||
|
} else {
|
||||||
|
roleid = sysFile.getRoleIds();
|
||||||
|
}
|
||||||
|
String[] roleIds = roleid.split(",");
|
||||||
boolean start = true;
|
boolean start = true;
|
||||||
for (SysRole role : loginUser.getUser().getRoles()) {
|
for (Role role : loginUser.getUser().getRoles()) {
|
||||||
for (String roleId : roleIds) {
|
for (String roleId : roleIds) {
|
||||||
if (String.valueOf(role.getRoleId()).equals(roleId)){
|
if (String.valueOf(role.getRoleId()).equals(roleId)) {
|
||||||
start = false;
|
start = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!start){
|
if (!start) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (start){
|
if (start) {
|
||||||
return new ServerResult<>(false,"您没有下载该文件的权限!");
|
return new ServerResult<>(false, "您没有下载该文件的权限!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.system.entity.SysLogininfor;
|
import com.hchyun.system.entity.Logininfor;
|
||||||
import com.hchyun.system.dao.SysLogininforDao;
|
import com.hchyun.system.dao.LogininforDao;
|
||||||
import com.hchyun.system.service.ISysLogininforService;
|
import com.hchyun.system.service.LogininforService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 服务层处理
|
* 系统访问日志情况信息 服务层处理
|
||||||
|
|
@ -14,10 +14,10 @@ import com.hchyun.system.service.ISysLogininforService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysLogininforServiceImpl implements ISysLogininforService {
|
public class LogininforServiceImpl implements LogininforService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysLogininforDao logininforMapper;
|
private LogininforDao logininforMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增系统登录日志
|
* 新增系统登录日志
|
||||||
|
|
@ -25,7 +25,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertLogininfor(SysLogininfor logininfor) {
|
public void insertLogininfor(Logininfor logininfor) {
|
||||||
logininforMapper.insertLogininfor(logininfor);
|
logininforMapper.insertLogininfor(logininfor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
|
public List<Logininfor> selectLogininforList(Logininfor logininfor) {
|
||||||
return logininforMapper.selectLogininforList(logininfor);
|
return logininforMapper.selectLogininforList(logininfor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -13,17 +13,17 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.entity.TreeSelect;
|
import com.hchyun.common.core.entity.TreeSelect;
|
||||||
import com.hchyun.common.core.entity.entity.SysMenu;
|
import com.hchyun.common.core.entity.entity.Menu;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.entity.vo.MetaVo;
|
import com.hchyun.system.entity.vo.MetaVo;
|
||||||
import com.hchyun.system.entity.vo.RouterVo;
|
import com.hchyun.system.entity.vo.RouterVo;
|
||||||
import com.hchyun.system.dao.SysMenuDao;
|
import com.hchyun.system.dao.MenuDao;
|
||||||
import com.hchyun.system.dao.SysRoleDao;
|
import com.hchyun.system.dao.RoleDao;
|
||||||
import com.hchyun.system.dao.SysRoleMenuDao;
|
import com.hchyun.system.dao.RoleMenuDao;
|
||||||
import com.hchyun.system.service.ISysMenuService;
|
import com.hchyun.system.service.MenuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单 业务层处理
|
* 菜单 业务层处理
|
||||||
|
|
@ -31,17 +31,17 @@ import com.hchyun.system.service.ISysMenuService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysMenuServiceImpl implements ISysMenuService {
|
public class MenuServiceImpl implements MenuService {
|
||||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysMenuDao menuMapper;
|
private MenuDao menuMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleDao roleMapper;
|
private RoleDao roleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMenuDao roleMenuMapper;
|
private RoleMenuDao roleMenuMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
|
|
@ -50,8 +50,8 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMenu> selectMenuList(Long userId) {
|
public List<Menu> selectMenuList(Long userId) {
|
||||||
return selectMenuList(new SysMenu(), userId);
|
return selectMenuList(new Menu(), userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,10 +61,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
|
public List<Menu> selectMenuList(Menu menu, Long userId) {
|
||||||
List<SysMenu> menuList = null;
|
List<Menu> menuList = null;
|
||||||
// 管理员显示所有菜单信息
|
// 管理员显示所有菜单信息
|
||||||
if (SysUser.isAdmin(userId)) {
|
if (User.isAdmin(userId)) {
|
||||||
menuList = menuMapper.selectMenuList(menu);
|
menuList = menuMapper.selectMenuList(menu);
|
||||||
} else {
|
} else {
|
||||||
menu.getParams().put("userId", userId);
|
menu.getParams().put("userId", userId);
|
||||||
|
|
@ -98,8 +98,8 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
public List<Menu> selectMenuTreeByUserId(Long userId) {
|
||||||
List<SysMenu> menus = null;
|
List<Menu> menus = null;
|
||||||
if (SecurityUtils.isAdmin(userId)) {
|
if (SecurityUtils.isAdmin(userId)) {
|
||||||
menus = menuMapper.selectMenuTreeAll();
|
menus = menuMapper.selectMenuTreeAll();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -116,7 +116,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> selectMenuListByRoleId(Long roleId) {
|
public List<Integer> selectMenuListByRoleId(Long roleId) {
|
||||||
SysRole role = roleMapper.selectRoleById(roleId);
|
Role role = roleMapper.selectRoleById(roleId);
|
||||||
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
|
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,16 +127,16 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 路由列表
|
* @return 路由列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RouterVo> buildMenus(List<SysMenu> menus) {
|
public List<RouterVo> buildMenus(List<Menu> menus) {
|
||||||
List<RouterVo> routers = new LinkedList<RouterVo>();
|
List<RouterVo> routers = new LinkedList<RouterVo>();
|
||||||
for (SysMenu menu : menus) {
|
for (Menu menu : menus) {
|
||||||
RouterVo router = new RouterVo();
|
RouterVo router = new RouterVo();
|
||||||
router.setHidden("1".equals(menu.getVisible()));
|
router.setHidden("1".equals(menu.getVisible()));
|
||||||
router.setName(getRouteName(menu));
|
router.setName(getRouteName(menu));
|
||||||
router.setPath(getRouterPath(menu));
|
router.setPath(getRouterPath(menu));
|
||||||
router.setComponent(getComponent(menu));
|
router.setComponent(getComponent(menu));
|
||||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
|
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
|
||||||
List<SysMenu> cMenus = menu.getChildren();
|
List<Menu> cMenus = menu.getChildren();
|
||||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||||
router.setAlwaysShow(true);
|
router.setAlwaysShow(true);
|
||||||
router.setRedirect("noRedirect");
|
router.setRedirect("noRedirect");
|
||||||
|
|
@ -163,14 +163,14 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 树结构列表
|
* @return 树结构列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus) {
|
public List<Menu> buildMenuTree(List<Menu> menus) {
|
||||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
List<Menu> returnList = new ArrayList<Menu>();
|
||||||
List<Long> tempList = new ArrayList<Long>();
|
List<Long> tempList = new ArrayList<Long>();
|
||||||
for (SysMenu dept : menus) {
|
for (Menu dept : menus) {
|
||||||
tempList.add(dept.getMenuId());
|
tempList.add(dept.getMenuId());
|
||||||
}
|
}
|
||||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
|
for (Iterator<Menu> iterator = menus.iterator(); iterator.hasNext(); ) {
|
||||||
SysMenu menu = (SysMenu) iterator.next();
|
Menu menu = (Menu) iterator.next();
|
||||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
if (!tempList.contains(menu.getParentId())) {
|
if (!tempList.contains(menu.getParentId())) {
|
||||||
recursionFn(menus, menu);
|
recursionFn(menus, menu);
|
||||||
|
|
@ -190,8 +190,8 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 下拉树结构列表
|
* @return 下拉树结构列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
|
public List<TreeSelect> buildMenuTreeSelect(List<Menu> menus) {
|
||||||
List<SysMenu> menuTrees = buildMenuTree(menus);
|
List<Menu> menuTrees = buildMenuTree(menus);
|
||||||
return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,7 +202,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 菜单信息
|
* @return 菜单信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysMenu selectMenuById(Long menuId) {
|
public Menu selectMenuById(Long menuId) {
|
||||||
return menuMapper.selectMenuById(menuId);
|
return menuMapper.selectMenuById(menuId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,7 +237,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertMenu(SysMenu menu) {
|
public int insertMenu(Menu menu) {
|
||||||
return menuMapper.insertMenu(menu);
|
return menuMapper.insertMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,7 +248,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateMenu(SysMenu menu) {
|
public int updateMenu(Menu menu) {
|
||||||
return menuMapper.updateMenu(menu);
|
return menuMapper.updateMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -270,9 +270,9 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkMenuNameUnique(SysMenu menu) {
|
public String checkMenuNameUnique(Menu menu) {
|
||||||
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
||||||
SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
|
Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
|
||||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -285,7 +285,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 路由名称
|
* @return 路由名称
|
||||||
*/
|
*/
|
||||||
public String getRouteName(SysMenu menu) {
|
public String getRouteName(Menu menu) {
|
||||||
String routerName = StringUtils.capitalize(menu.getPath());
|
String routerName = StringUtils.capitalize(menu.getPath());
|
||||||
// 非外链并且是一级目录(类型为目录)
|
// 非外链并且是一级目录(类型为目录)
|
||||||
if (isMeunFrame(menu)) {
|
if (isMeunFrame(menu)) {
|
||||||
|
|
@ -300,7 +300,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 路由地址
|
* @return 路由地址
|
||||||
*/
|
*/
|
||||||
public String getRouterPath(SysMenu menu) {
|
public String getRouterPath(Menu menu) {
|
||||||
String routerPath = menu.getPath();
|
String routerPath = menu.getPath();
|
||||||
// 非外链并且是一级目录(类型为目录)
|
// 非外链并且是一级目录(类型为目录)
|
||||||
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
|
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
|
||||||
|
|
@ -320,7 +320,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 组件信息
|
* @return 组件信息
|
||||||
*/
|
*/
|
||||||
public String getComponent(SysMenu menu) {
|
public String getComponent(Menu menu) {
|
||||||
String component = UserConstants.LAYOUT;
|
String component = UserConstants.LAYOUT;
|
||||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) {
|
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) {
|
||||||
component = menu.getComponent();
|
component = menu.getComponent();
|
||||||
|
|
@ -334,7 +334,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean isMeunFrame(SysMenu menu) {
|
public boolean isMeunFrame(Menu menu) {
|
||||||
return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
|
return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
|
||||||
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
|
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
|
||||||
}
|
}
|
||||||
|
|
@ -346,10 +346,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param parentId 传入的父节点ID
|
* @param parentId 传入的父节点ID
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
public List<Menu> getChildPerms(List<Menu> list, int parentId) {
|
||||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
List<Menu> returnList = new ArrayList<Menu>();
|
||||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
|
for (Iterator<Menu> iterator = list.iterator(); iterator.hasNext(); ) {
|
||||||
SysMenu t = (SysMenu) iterator.next();
|
Menu t = (Menu) iterator.next();
|
||||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||||
if (t.getParentId() == parentId) {
|
if (t.getParentId() == parentId) {
|
||||||
recursionFn(list, t);
|
recursionFn(list, t);
|
||||||
|
|
@ -365,11 +365,11 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
* @param list
|
* @param list
|
||||||
* @param t
|
* @param t
|
||||||
*/
|
*/
|
||||||
private void recursionFn(List<SysMenu> list, SysMenu t) {
|
private void recursionFn(List<Menu> list, Menu t) {
|
||||||
// 得到子节点列表
|
// 得到子节点列表
|
||||||
List<SysMenu> childList = getChildList(list, t);
|
List<Menu> childList = getChildList(list, t);
|
||||||
t.setChildren(childList);
|
t.setChildren(childList);
|
||||||
for (SysMenu tChild : childList) {
|
for (Menu tChild : childList) {
|
||||||
if (hasChild(list, tChild)) {
|
if (hasChild(list, tChild)) {
|
||||||
recursionFn(list, tChild);
|
recursionFn(list, tChild);
|
||||||
}
|
}
|
||||||
|
|
@ -379,11 +379,11 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
/**
|
/**
|
||||||
* 得到子节点列表
|
* 得到子节点列表
|
||||||
*/
|
*/
|
||||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
private List<Menu> getChildList(List<Menu> list, Menu t) {
|
||||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
List<Menu> tlist = new ArrayList<Menu>();
|
||||||
Iterator<SysMenu> it = list.iterator();
|
Iterator<Menu> it = list.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SysMenu n = (SysMenu) it.next();
|
Menu n = (Menu) it.next();
|
||||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||||
tlist.add(n);
|
tlist.add(n);
|
||||||
}
|
}
|
||||||
|
|
@ -394,7 +394,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||||
/**
|
/**
|
||||||
* 判断是否有子节点
|
* 判断是否有子节点
|
||||||
*/
|
*/
|
||||||
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
private boolean hasChild(List<Menu> list, Menu t) {
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
return getChildList(list, t).size() > 0 ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,9 +4,9 @@ import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.system.entity.SysNotice;
|
import com.hchyun.system.entity.Notice;
|
||||||
import com.hchyun.system.dao.SysNoticeDao;
|
import com.hchyun.system.dao.NoticeDao;
|
||||||
import com.hchyun.system.service.ISysNoticeService;
|
import com.hchyun.system.service.NoticeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告 服务层实现
|
* 公告 服务层实现
|
||||||
|
|
@ -14,9 +14,9 @@ import com.hchyun.system.service.ISysNoticeService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl implements ISysNoticeService {
|
public class NoticeServiceImpl implements NoticeService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysNoticeDao noticeMapper;
|
private NoticeDao noticeMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告信息
|
* 查询公告信息
|
||||||
|
|
@ -25,7 +25,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysNotice selectNoticeById(Long noticeId) {
|
public Notice selectNoticeById(Long noticeId) {
|
||||||
return noticeMapper.selectNoticeById(noticeId);
|
return noticeMapper.selectNoticeById(noticeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||||
* @return 公告集合
|
* @return 公告集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
public List<Notice> selectNoticeList(Notice notice) {
|
||||||
return noticeMapper.selectNoticeList(notice);
|
return noticeMapper.selectNoticeList(notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertNotice(SysNotice notice) {
|
public int insertNotice(Notice notice) {
|
||||||
return noticeMapper.insertNotice(notice);
|
return noticeMapper.insertNotice(notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateNotice(SysNotice notice) {
|
public int updateNotice(Notice notice) {
|
||||||
return noticeMapper.updateNotice(notice);
|
return noticeMapper.updateNotice(notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4,9 +4,9 @@ import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.system.entity.SysOperLog;
|
import com.hchyun.system.entity.OperLog;
|
||||||
import com.hchyun.system.dao.SysOperLogDao;
|
import com.hchyun.system.dao.OperLogDao;
|
||||||
import com.hchyun.system.service.ISysOperLogService;
|
import com.hchyun.system.service.OperLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 服务层处理
|
* 操作日志 服务层处理
|
||||||
|
|
@ -14,9 +14,9 @@ import com.hchyun.system.service.ISysOperLogService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysOperLogServiceImpl implements ISysOperLogService {
|
public class OperLogServiceImpl implements OperLogService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysOperLogDao operLogMapper;
|
private OperLogDao operLogMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
|
|
@ -24,7 +24,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertOperlog(SysOperLog operLog) {
|
public void insertOperlog(OperLog operLog) {
|
||||||
operLogMapper.insertOperlog(operLog);
|
operLogMapper.insertOperlog(operLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
|
public List<OperLog> selectOperLogList(OperLog operLog) {
|
||||||
return operLogMapper.selectOperLogList(operLog);
|
return operLogMapper.selectOperLogList(operLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysOperLog selectOperLogById(Long operId) {
|
public OperLog selectOperLogById(Long operId) {
|
||||||
return operLogMapper.selectOperLogById(operId);
|
return operLogMapper.selectOperLogById(operId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7,10 +7,10 @@ import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.exception.CustomException;
|
import com.hchyun.common.exception.CustomException;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.entity.SysPost;
|
import com.hchyun.system.entity.Post;
|
||||||
import com.hchyun.system.dao.SysPostDao;
|
import com.hchyun.system.dao.PostDao;
|
||||||
import com.hchyun.system.dao.SysUserPostDao;
|
import com.hchyun.system.dao.UserPostDao;
|
||||||
import com.hchyun.system.service.ISysPostService;
|
import com.hchyun.system.service.PostService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位信息 服务层处理
|
* 岗位信息 服务层处理
|
||||||
|
|
@ -18,12 +18,12 @@ import com.hchyun.system.service.ISysPostService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysPostServiceImpl implements ISysPostService {
|
public class PostServiceImpl implements PostService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPostDao postMapper;
|
private PostDao postMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserPostDao userPostMapper;
|
private UserPostDao userPostMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询岗位信息集合
|
* 查询岗位信息集合
|
||||||
|
|
@ -32,7 +32,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 岗位信息集合
|
* @return 岗位信息集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysPost> selectPostList(SysPost post) {
|
public List<Post> selectPostList(Post post) {
|
||||||
return postMapper.selectPostList(post);
|
return postMapper.selectPostList(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysPost> selectPostAll() {
|
public List<Post> selectPostAll() {
|
||||||
return postMapper.selectPostAll();
|
return postMapper.selectPostAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysPost selectPostById(Long postId) {
|
public Post selectPostById(Long postId) {
|
||||||
return postMapper.selectPostById(postId);
|
return postMapper.selectPostById(postId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,9 +75,9 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkPostNameUnique(SysPost post) {
|
public String checkPostNameUnique(Post post) {
|
||||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||||
SysPost info = postMapper.checkPostNameUnique(post.getPostName());
|
Post info = postMapper.checkPostNameUnique(post.getPostName());
|
||||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -91,9 +91,9 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkPostCodeUnique(SysPost post) {
|
public String checkPostCodeUnique(Post post) {
|
||||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||||
SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
|
Post info = postMapper.checkPostCodeUnique(post.getPostCode());
|
||||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
@Override
|
@Override
|
||||||
public int deletePostByIds(Long[] postIds) {
|
public int deletePostByIds(Long[] postIds) {
|
||||||
for (Long postId : postIds) {
|
for (Long postId : postIds) {
|
||||||
SysPost post = selectPostById(postId);
|
Post post = selectPostById(postId);
|
||||||
if (countUserPostById(postId) > 0) {
|
if (countUserPostById(postId) > 0) {
|
||||||
throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +147,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPost(SysPost post) {
|
public int insertPost(Post post) {
|
||||||
return postMapper.insertPost(post);
|
return postMapper.insertPost(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updatePost(SysPost post) {
|
public int updatePost(Post post) {
|
||||||
return postMapper.updatePost(post);
|
return postMapper.updatePost(post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11,17 +11,17 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.hchyun.common.annotation.DataScope;
|
import com.hchyun.common.annotation.DataScope;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.exception.CustomException;
|
import com.hchyun.common.exception.CustomException;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.common.utils.spring.SpringUtils;
|
import com.hchyun.common.utils.spring.SpringUtils;
|
||||||
import com.hchyun.system.entity.SysRoleDept;
|
import com.hchyun.system.entity.RoleDept;
|
||||||
import com.hchyun.system.entity.SysRoleMenu;
|
import com.hchyun.system.entity.RoleMenu;
|
||||||
import com.hchyun.system.dao.SysRoleDeptDao;
|
import com.hchyun.system.dao.RoleDeptDao;
|
||||||
import com.hchyun.system.dao.SysRoleDao;
|
import com.hchyun.system.dao.RoleDao;
|
||||||
import com.hchyun.system.dao.SysRoleMenuDao;
|
import com.hchyun.system.dao.RoleMenuDao;
|
||||||
import com.hchyun.system.dao.SysUserRoleDao;
|
import com.hchyun.system.dao.UserRoleDao;
|
||||||
import com.hchyun.system.service.ISysRoleService;
|
import com.hchyun.system.service.RoleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色 业务层处理
|
* 角色 业务层处理
|
||||||
|
|
@ -29,18 +29,18 @@ import com.hchyun.system.service.ISysRoleService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysRoleServiceImpl implements ISysRoleService {
|
public class RoleServiceImpl implements RoleService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleDao roleMapper;
|
private RoleDao roleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMenuDao roleMenuMapper;
|
private RoleMenuDao roleMenuMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserRoleDao userRoleMapper;
|
private UserRoleDao userRoleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleDeptDao roleDeptMapper;
|
private RoleDeptDao roleDeptMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询角色数据
|
* 根据条件分页查询角色数据
|
||||||
|
|
@ -50,7 +50,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d")
|
@DataScope(deptAlias = "d")
|
||||||
public List<SysRole> selectRoleList(SysRole role) {
|
public List<Role> selectRoleList(Role role) {
|
||||||
return roleMapper.selectRoleList(role);
|
return roleMapper.selectRoleList(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,9 +62,9 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Set<String> selectRolePermissionByUserId(Long userId) {
|
public Set<String> selectRolePermissionByUserId(Long userId) {
|
||||||
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
|
List<Role> perms = roleMapper.selectRolePermissionByUserId(userId);
|
||||||
Set<String> permsSet = new HashSet<>();
|
Set<String> permsSet = new HashSet<>();
|
||||||
for (SysRole perm : perms) {
|
for (Role perm : perms) {
|
||||||
if (StringUtils.isNotNull(perm)) {
|
if (StringUtils.isNotNull(perm)) {
|
||||||
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
|
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
|
||||||
}
|
}
|
||||||
|
|
@ -79,8 +79,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysRole> selectRoleAll(Integer type) {
|
public List<Role> selectRoleAll(Integer type) {
|
||||||
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole(type));
|
return SpringUtils.getAopProxy(this).selectRoleList(new Role(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,7 +101,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysRole selectRoleById(Long roleId) {
|
public Role selectRoleById(Long roleId) {
|
||||||
return roleMapper.selectRoleById(roleId);
|
return roleMapper.selectRoleById(roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,9 +112,9 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkRoleNameUnique(SysRole role) {
|
public String checkRoleNameUnique(Role role) {
|
||||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||||
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
Role info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
||||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -128,9 +128,9 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkRoleKeyUnique(SysRole role) {
|
public String checkRoleKeyUnique(Role role) {
|
||||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||||
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
|
Role info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
|
||||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -143,7 +143,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void checkRoleAllowed(SysRole role) {
|
public void checkRoleAllowed(Role role) {
|
||||||
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
|
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
|
||||||
throw new CustomException("不允许操作超级管理员角色");
|
throw new CustomException("不允许操作超级管理员角色");
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +168,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertRole(SysRole role) {
|
public int insertRole(Role role) {
|
||||||
// 新增角色信息
|
// 新增角色信息
|
||||||
roleMapper.insertRole(role);
|
roleMapper.insertRole(role);
|
||||||
return insertRoleMenu(role);
|
return insertRoleMenu(role);
|
||||||
|
|
@ -182,7 +182,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateRole(SysRole role) {
|
public int updateRole(Role role) {
|
||||||
// 修改角色信息
|
// 修改角色信息
|
||||||
roleMapper.updateRole(role);
|
roleMapper.updateRole(role);
|
||||||
// 删除角色与菜单关联
|
// 删除角色与菜单关联
|
||||||
|
|
@ -197,7 +197,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRoleStatus(SysRole role) {
|
public int updateRoleStatus(Role role) {
|
||||||
return roleMapper.updateRole(role);
|
return roleMapper.updateRole(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -209,7 +209,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int authDataScope(SysRole role) {
|
public int authDataScope(Role role) {
|
||||||
// 修改角色信息
|
// 修改角色信息
|
||||||
roleMapper.updateRole(role);
|
roleMapper.updateRole(role);
|
||||||
// 删除角色与部门关联
|
// 删除角色与部门关联
|
||||||
|
|
@ -223,12 +223,12 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*
|
*
|
||||||
* @param role 角色对象
|
* @param role 角色对象
|
||||||
*/
|
*/
|
||||||
public int insertRoleMenu(SysRole role) {
|
public int insertRoleMenu(Role role) {
|
||||||
int rows = 1;
|
int rows = 1;
|
||||||
// 新增用户与角色管理
|
// 新增用户与角色管理
|
||||||
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
|
List<RoleMenu> list = new ArrayList<RoleMenu>();
|
||||||
for (Long menuId : role.getMenuIds()) {
|
for (Long menuId : role.getMenuIds()) {
|
||||||
SysRoleMenu rm = new SysRoleMenu();
|
RoleMenu rm = new RoleMenu();
|
||||||
rm.setRoleId(role.getRoleId());
|
rm.setRoleId(role.getRoleId());
|
||||||
rm.setMenuId(menuId);
|
rm.setMenuId(menuId);
|
||||||
list.add(rm);
|
list.add(rm);
|
||||||
|
|
@ -244,12 +244,12 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
*
|
*
|
||||||
* @param role 角色对象
|
* @param role 角色对象
|
||||||
*/
|
*/
|
||||||
public int insertRoleDept(SysRole role) {
|
public int insertRoleDept(Role role) {
|
||||||
int rows = 1;
|
int rows = 1;
|
||||||
// 新增角色与部门(数据权限)管理
|
// 新增角色与部门(数据权限)管理
|
||||||
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
|
List<RoleDept> list = new ArrayList<RoleDept>();
|
||||||
for (Long deptId : role.getDeptIds()) {
|
for (Long deptId : role.getDeptIds()) {
|
||||||
SysRoleDept rd = new SysRoleDept();
|
RoleDept rd = new RoleDept();
|
||||||
rd.setRoleId(role.getRoleId());
|
rd.setRoleId(role.getRoleId());
|
||||||
rd.setDeptId(deptId);
|
rd.setDeptId(deptId);
|
||||||
list.add(rd);
|
list.add(rd);
|
||||||
|
|
@ -280,8 +280,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||||
@Override
|
@Override
|
||||||
public int deleteRoleByIds(Long[] roleIds) {
|
public int deleteRoleByIds(Long[] roleIds) {
|
||||||
for (Long roleId : roleIds) {
|
for (Long roleId : roleIds) {
|
||||||
checkRoleAllowed(new SysRole(roleId));
|
checkRoleAllowed(new Role(roleId));
|
||||||
SysRole role = selectRoleById(roleId);
|
Role role = selectRoleById(roleId);
|
||||||
if (countUserRoleByRoleId(roleId) > 0) {
|
if (countUserRoleByRoleId(roleId) > 0) {
|
||||||
throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||||
}
|
}
|
||||||
|
|
@ -1,178 +0,0 @@
|
||||||
package com.hchyun.system.service.impl;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hchyun.common.annotation.DataSource;
|
|
||||||
import com.hchyun.common.constant.Constants;
|
|
||||||
import com.hchyun.common.constant.UserConstants;
|
|
||||||
import com.hchyun.common.core.redis.RedisCache;
|
|
||||||
import com.hchyun.common.core.text.Convert;
|
|
||||||
import com.hchyun.common.enums.DataSourceType;
|
|
||||||
import com.hchyun.common.exception.CustomException;
|
|
||||||
import com.hchyun.common.utils.StringUtils;
|
|
||||||
import com.hchyun.system.entity.SysConfig;
|
|
||||||
import com.hchyun.system.dao.SysConfigDao;
|
|
||||||
import com.hchyun.system.service.ISysConfigService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数配置 服务层实现
|
|
||||||
*
|
|
||||||
* @author hchyun
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SysConfigServiceImpl implements ISysConfigService {
|
|
||||||
@Autowired
|
|
||||||
private SysConfigDao configMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目启动时,初始化参数到缓存
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
|
|
||||||
for (SysConfig config : configsList) {
|
|
||||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询参数配置信息
|
|
||||||
*
|
|
||||||
* @param configId 参数配置ID
|
|
||||||
* @return 参数配置信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@DataSource(DataSourceType.MASTER)
|
|
||||||
public SysConfig selectConfigById(Long configId) {
|
|
||||||
SysConfig config = new SysConfig();
|
|
||||||
config.setConfigId(configId);
|
|
||||||
return configMapper.selectConfig(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据键名查询参数配置信息
|
|
||||||
*
|
|
||||||
* @param configKey 参数key
|
|
||||||
* @return 参数键值
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String selectConfigByKey(String configKey) {
|
|
||||||
String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey)));
|
|
||||||
if (StringUtils.isNotEmpty(configValue)) {
|
|
||||||
return configValue;
|
|
||||||
}
|
|
||||||
SysConfig config = new SysConfig();
|
|
||||||
config.setConfigKey(configKey);
|
|
||||||
SysConfig retConfig = configMapper.selectConfig(config);
|
|
||||||
if (StringUtils.isNotNull(retConfig)) {
|
|
||||||
redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
|
||||||
return retConfig.getConfigValue();
|
|
||||||
}
|
|
||||||
return StringUtils.EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询参数配置列表
|
|
||||||
*
|
|
||||||
* @param config 参数配置信息
|
|
||||||
* @return 参数配置集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysConfig> selectConfigList(SysConfig config) {
|
|
||||||
return configMapper.selectConfigList(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增参数配置
|
|
||||||
*
|
|
||||||
* @param config 参数配置信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertConfig(SysConfig config) {
|
|
||||||
int row = configMapper.insertConfig(config);
|
|
||||||
if (row > 0) {
|
|
||||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改参数配置
|
|
||||||
*
|
|
||||||
* @param config 参数配置信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateConfig(SysConfig config) {
|
|
||||||
int row = configMapper.updateConfig(config);
|
|
||||||
if (row > 0) {
|
|
||||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除参数信息
|
|
||||||
*
|
|
||||||
* @param configIds 需要删除的参数ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteConfigByIds(Long[] configIds) {
|
|
||||||
for (Long configId : configIds) {
|
|
||||||
SysConfig config = selectConfigById(configId);
|
|
||||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
|
|
||||||
throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int count = configMapper.deleteConfigByIds(configIds);
|
|
||||||
if (count > 0) {
|
|
||||||
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
|
|
||||||
redisCache.deleteObject(keys);
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清空缓存数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void clearCache() {
|
|
||||||
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
|
|
||||||
redisCache.deleteObject(keys);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验参数键名是否唯一
|
|
||||||
*
|
|
||||||
* @param config 参数配置信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String checkConfigKeyUnique(SysConfig config) {
|
|
||||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
|
||||||
SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
|
|
||||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
|
||||||
}
|
|
||||||
return UserConstants.UNIQUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置cache key
|
|
||||||
*
|
|
||||||
* @param configKey 参数键
|
|
||||||
* @return 缓存键key
|
|
||||||
*/
|
|
||||||
private String getCacheKey(String configKey) {
|
|
||||||
return Constants.SYS_CONFIG_KEY + configKey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,275 +0,0 @@
|
||||||
package com.hchyun.system.service.impl;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hchyun.common.annotation.DataScope;
|
|
||||||
import com.hchyun.common.constant.UserConstants;
|
|
||||||
import com.hchyun.common.core.entity.TreeSelect;
|
|
||||||
import com.hchyun.common.core.entity.entity.SysDept;
|
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
|
||||||
import com.hchyun.common.exception.CustomException;
|
|
||||||
import com.hchyun.common.utils.StringUtils;
|
|
||||||
import com.hchyun.system.dao.SysDeptDao;
|
|
||||||
import com.hchyun.system.dao.SysRoleDao;
|
|
||||||
import com.hchyun.system.service.ISysDeptService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门管理 服务实现
|
|
||||||
*
|
|
||||||
* @author hchyun
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SysDeptServiceImpl implements ISysDeptService {
|
|
||||||
@Autowired
|
|
||||||
private SysDeptDao deptMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysRoleDao roleMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询部门管理数据
|
|
||||||
*
|
|
||||||
* @param dept 部门信息
|
|
||||||
* @return 部门信息集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@DataScope(deptAlias = "d")
|
|
||||||
public List<SysDept> selectDeptList(SysDept dept) {
|
|
||||||
return deptMapper.selectDeptList(dept);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建前端所需要树结构
|
|
||||||
*
|
|
||||||
* @param depts 部门列表
|
|
||||||
* @return 树结构列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SysDept> buildDeptTree(List<SysDept> depts) {
|
|
||||||
List<SysDept> returnList = new ArrayList<SysDept>();
|
|
||||||
List<Long> tempList = new ArrayList<Long>();
|
|
||||||
for (SysDept dept : depts) {
|
|
||||||
tempList.add(dept.getDeptId());
|
|
||||||
}
|
|
||||||
for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext(); ) {
|
|
||||||
SysDept dept = (SysDept) iterator.next();
|
|
||||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
|
||||||
if (!tempList.contains(dept.getParentId())) {
|
|
||||||
recursionFn(depts, dept);
|
|
||||||
returnList.add(dept);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (returnList.isEmpty()) {
|
|
||||||
returnList = depts;
|
|
||||||
}
|
|
||||||
return returnList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建前端所需要下拉树结构
|
|
||||||
*
|
|
||||||
* @param depts 部门列表
|
|
||||||
* @return 下拉树结构列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) {
|
|
||||||
List<SysDept> deptTrees = buildDeptTree(depts);
|
|
||||||
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据角色ID查询部门树信息
|
|
||||||
*
|
|
||||||
* @param roleId 角色ID
|
|
||||||
* @return 选中部门列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Integer> selectDeptListByRoleId(Long roleId) {
|
|
||||||
SysRole role = roleMapper.selectRoleById(roleId);
|
|
||||||
return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据部门ID查询信息
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 部门信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public SysDept selectDeptById(Long deptId) {
|
|
||||||
return deptMapper.selectDeptById(deptId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询所有子部门(正常状态)
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 子部门数
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int selectNormalChildrenDeptById(Long deptId) {
|
|
||||||
return deptMapper.selectNormalChildrenDeptById(deptId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否存在子节点
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean hasChildByDeptId(Long deptId) {
|
|
||||||
int result = deptMapper.hasChildByDeptId(deptId);
|
|
||||||
return result > 0 ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询部门是否存在用户
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 结果 true 存在 false 不存在
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean checkDeptExistUser(Long deptId) {
|
|
||||||
int result = deptMapper.checkDeptExistUser(deptId);
|
|
||||||
return result > 0 ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验部门名称是否唯一
|
|
||||||
*
|
|
||||||
* @param dept 部门信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String checkDeptNameUnique(SysDept dept) {
|
|
||||||
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
|
|
||||||
SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
|
|
||||||
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
|
||||||
}
|
|
||||||
return UserConstants.UNIQUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存部门信息
|
|
||||||
*
|
|
||||||
* @param dept 部门信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertDept(SysDept dept) {
|
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
|
||||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
|
||||||
throw new CustomException("部门停用,不允许新增");
|
|
||||||
}
|
|
||||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
||||||
return deptMapper.insertDept(dept);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存部门信息
|
|
||||||
*
|
|
||||||
* @param dept 部门信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateDept(SysDept dept) {
|
|
||||||
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
|
||||||
SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());
|
|
||||||
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
|
||||||
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
|
||||||
String oldAncestors = oldDept.getAncestors();
|
|
||||||
dept.setAncestors(newAncestors);
|
|
||||||
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
|
|
||||||
}
|
|
||||||
int result = deptMapper.updateDept(dept);
|
|
||||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) {
|
|
||||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
|
||||||
updateParentDeptStatus(dept);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改该部门的父级部门状态
|
|
||||||
*
|
|
||||||
* @param dept 当前部门
|
|
||||||
*/
|
|
||||||
private void updateParentDeptStatus(SysDept dept) {
|
|
||||||
Long updateBy = dept.getUpdateBy();
|
|
||||||
dept = deptMapper.selectDeptById(dept.getDeptId());
|
|
||||||
dept.setUpdateBy(updateBy);
|
|
||||||
deptMapper.updateDeptStatus(dept);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改子元素关系
|
|
||||||
*
|
|
||||||
* @param deptId 被修改的部门ID
|
|
||||||
* @param newAncestors 新的父ID集合
|
|
||||||
* @param oldAncestors 旧的父ID集合
|
|
||||||
*/
|
|
||||||
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
|
||||||
List<SysDept> children = deptMapper.selectChildrenDeptById(deptId);
|
|
||||||
for (SysDept child : children) {
|
|
||||||
child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors));
|
|
||||||
}
|
|
||||||
if (children.size() > 0) {
|
|
||||||
deptMapper.updateDeptChildren(children);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除部门管理信息
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteDeptById(Long deptId) {
|
|
||||||
return deptMapper.deleteDeptById(deptId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递归列表
|
|
||||||
*/
|
|
||||||
private void recursionFn(List<SysDept> list, SysDept t) {
|
|
||||||
// 得到子节点列表
|
|
||||||
List<SysDept> childList = getChildList(list, t);
|
|
||||||
t.setChildren(childList);
|
|
||||||
for (SysDept tChild : childList) {
|
|
||||||
if (hasChild(list, tChild)) {
|
|
||||||
recursionFn(list, tChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 得到子节点列表
|
|
||||||
*/
|
|
||||||
private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
|
|
||||||
List<SysDept> tlist = new ArrayList<SysDept>();
|
|
||||||
Iterator<SysDept> it = list.iterator();
|
|
||||||
while (it.hasNext()) {
|
|
||||||
SysDept n = (SysDept) it.next();
|
|
||||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
|
||||||
tlist.add(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否有子节点
|
|
||||||
*/
|
|
||||||
private boolean hasChild(List<SysDept> list, SysDept t) {
|
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,8 +3,8 @@ package com.hchyun.system.service.impl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hchyun.common.core.entity.model.LoginUser;
|
import com.hchyun.common.core.entity.model.LoginUser;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.entity.SysUserOnline;
|
import com.hchyun.system.entity.UserOnline;
|
||||||
import com.hchyun.system.service.ISysUserOnlineService;
|
import com.hchyun.system.service.UserOnlineService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线用户 服务层处理
|
* 在线用户 服务层处理
|
||||||
|
|
@ -12,7 +12,7 @@ import com.hchyun.system.service.ISysUserOnlineService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
public class UserOnlineServiceImpl implements UserOnlineService {
|
||||||
/**
|
/**
|
||||||
* 通过登录地址查询信息
|
* 通过登录地址查询信息
|
||||||
*
|
*
|
||||||
|
|
@ -21,7 +21,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) {
|
public UserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) {
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr())) {
|
if (StringUtils.equals(ipaddr, user.getIpaddr())) {
|
||||||
return loginUserToUserOnline(user);
|
return loginUserToUserOnline(user);
|
||||||
}
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) {
|
public UserOnline selectOnlineByUserName(String userName, LoginUser user) {
|
||||||
if (StringUtils.equals(userName, user.getUsername())) {
|
if (StringUtils.equals(userName, user.getUsername())) {
|
||||||
return loginUserToUserOnline(user);
|
return loginUserToUserOnline(user);
|
||||||
}
|
}
|
||||||
|
|
@ -52,7 +52,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) {
|
public UserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) {
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
|
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
|
||||||
return loginUserToUserOnline(user);
|
return loginUserToUserOnline(user);
|
||||||
}
|
}
|
||||||
|
|
@ -66,21 +66,21 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||||
* @return 在线用户
|
* @return 在线用户
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserOnline loginUserToUserOnline(LoginUser user) {
|
public UserOnline loginUserToUserOnline(LoginUser user) {
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) {
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SysUserOnline sysUserOnline = new SysUserOnline();
|
UserOnline userOnline = new UserOnline();
|
||||||
sysUserOnline.setTokenId(user.getToken());
|
userOnline.setTokenId(user.getToken());
|
||||||
sysUserOnline.setUserName(user.getUsername());
|
userOnline.setUserName(user.getUsername());
|
||||||
sysUserOnline.setIpaddr(user.getIpaddr());
|
userOnline.setIpaddr(user.getIpaddr());
|
||||||
sysUserOnline.setLoginLocation(user.getLoginLocation());
|
userOnline.setLoginLocation(user.getLoginLocation());
|
||||||
sysUserOnline.setBrowser(user.getBrowser());
|
userOnline.setBrowser(user.getBrowser());
|
||||||
sysUserOnline.setOs(user.getOs());
|
userOnline.setOs(user.getOs());
|
||||||
sysUserOnline.setLoginTime(user.getLoginTime());
|
userOnline.setLoginTime(user.getLoginTime());
|
||||||
if (StringUtils.isNotNull(user.getUser().getDept())) {
|
if (StringUtils.isNotNull(user.getUser().getDept())) {
|
||||||
sysUserOnline.setDeptName(user.getUser().getDept().getDeptName());
|
userOnline.setDeptName(user.getUser().getDept().getDeptName());
|
||||||
}
|
}
|
||||||
return sysUserOnline;
|
return userOnline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -10,21 +10,21 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.hchyun.common.annotation.DataScope;
|
import com.hchyun.common.annotation.DataScope;
|
||||||
import com.hchyun.common.constant.UserConstants;
|
import com.hchyun.common.constant.UserConstants;
|
||||||
import com.hchyun.common.core.entity.entity.SysRole;
|
import com.hchyun.common.core.entity.entity.Role;
|
||||||
import com.hchyun.common.core.entity.entity.SysUser;
|
import com.hchyun.common.core.entity.entity.User;
|
||||||
import com.hchyun.common.exception.CustomException;
|
import com.hchyun.common.exception.CustomException;
|
||||||
import com.hchyun.common.utils.SecurityUtils;
|
import com.hchyun.common.utils.SecurityUtils;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
import com.hchyun.system.entity.SysPost;
|
import com.hchyun.system.entity.Post;
|
||||||
import com.hchyun.system.entity.SysUserPost;
|
import com.hchyun.system.entity.UserPost;
|
||||||
import com.hchyun.system.entity.SysUserRole;
|
import com.hchyun.system.entity.UserRole;
|
||||||
import com.hchyun.system.dao.SysPostDao;
|
import com.hchyun.system.dao.PostDao;
|
||||||
import com.hchyun.system.dao.SysRoleDao;
|
import com.hchyun.system.dao.RoleDao;
|
||||||
import com.hchyun.system.dao.SysUserDao;
|
import com.hchyun.system.dao.UserDao;
|
||||||
import com.hchyun.system.dao.SysUserPostDao;
|
import com.hchyun.system.dao.UserPostDao;
|
||||||
import com.hchyun.system.dao.SysUserRoleDao;
|
import com.hchyun.system.dao.UserRoleDao;
|
||||||
import com.hchyun.system.service.ISysConfigService;
|
import com.hchyun.system.service.ConfigService;
|
||||||
import com.hchyun.system.service.ISysUserService;
|
import com.hchyun.system.service.UserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户 业务层处理
|
* 用户 业务层处理
|
||||||
|
|
@ -32,26 +32,26 @@ import com.hchyun.system.service.ISysUserService;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysUserServiceImpl implements ISysUserService {
|
public class UserServiceImpl implements UserService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserDao userMapper;
|
private UserDao userMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleDao roleMapper;
|
private RoleDao roleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPostDao postMapper;
|
private PostDao postMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserRoleDao userRoleMapper;
|
private UserRoleDao userRoleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserPostDao userPostMapper;
|
private UserPostDao userPostMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询用户列表
|
* 根据条件分页查询用户列表
|
||||||
|
|
@ -61,7 +61,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectUserList(SysUser user) {
|
public List<User> selectUserList(User user) {
|
||||||
return userMapper.selectUserList(user);
|
return userMapper.selectUserList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUser selectUserByUserName(String userName) {
|
public User selectUserByUserName(String userName) {
|
||||||
return userMapper.selectUserByUserName(userName);
|
return userMapper.selectUserByUserName(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUser selectUserById(Long userId) {
|
public User selectUserById(Long userId) {
|
||||||
return userMapper.selectUserById(userId);
|
return userMapper.selectUserById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,9 +95,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectUserRoleGroup(String userName) {
|
public String selectUserRoleGroup(String userName) {
|
||||||
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
|
List<Role> list = roleMapper.selectRolesByUserName(userName);
|
||||||
StringBuffer idsStr = new StringBuffer();
|
StringBuffer idsStr = new StringBuffer();
|
||||||
for (SysRole role : list) {
|
for (Role role : list) {
|
||||||
idsStr.append(role.getRoleName()).append(",");
|
idsStr.append(role.getRoleName()).append(",");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
||||||
|
|
@ -114,9 +114,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectUserPostGroup(String userName) {
|
public String selectUserPostGroup(String userName) {
|
||||||
List<SysPost> list = postMapper.selectPostsByUserName(userName);
|
List<Post> list = postMapper.selectPostsByUserName(userName);
|
||||||
StringBuffer idsStr = new StringBuffer();
|
StringBuffer idsStr = new StringBuffer();
|
||||||
for (SysPost post : list) {
|
for (Post post : list) {
|
||||||
idsStr.append(post.getPostName()).append(",");
|
idsStr.append(post.getPostName()).append(",");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
||||||
|
|
@ -147,9 +147,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkPhoneUnique(SysUser user) {
|
public String checkPhoneUnique(User user) {
|
||||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
User info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
||||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -163,9 +163,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkEmailUnique(SysUser user) {
|
public String checkEmailUnique(User user) {
|
||||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = userMapper.checkEmailUnique(user.getEmail());
|
User info = userMapper.checkEmailUnique(user.getEmail());
|
||||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +178,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void checkUserAllowed(SysUser user) {
|
public void checkUserAllowed(User user) {
|
||||||
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
|
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
|
||||||
throw new CustomException("不允许操作超级管理员用户");
|
throw new CustomException("不允许操作超级管理员用户");
|
||||||
}
|
}
|
||||||
|
|
@ -192,7 +192,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertUser(SysUser user) {
|
public int insertUser(User user) {
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
// 新增用户岗位关联
|
// 新增用户岗位关联
|
||||||
|
|
@ -210,7 +210,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateUser(SysUser user) {
|
public int updateUser(User user) {
|
||||||
Long userId = user.getUserId();
|
Long userId = user.getUserId();
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
|
|
@ -230,7 +230,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateUserStatus(SysUser user) {
|
public int updateUserStatus(User user) {
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -241,7 +241,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateUserProfile(SysUser user) {
|
public int updateUserProfile(User user) {
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,7 +264,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int resetPwd(SysUser user) {
|
public int resetPwd(User user) {
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,13 +285,13 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
public void insertUserRole(SysUser user) {
|
public void insertUserRole(User user) {
|
||||||
Long[] roles = user.getRoleIds();
|
Long[] roles = user.getRoleIds();
|
||||||
if (StringUtils.isNotNull(roles)) {
|
if (StringUtils.isNotNull(roles)) {
|
||||||
// 新增用户与角色管理
|
// 新增用户与角色管理
|
||||||
List<SysUserRole> list = new ArrayList<SysUserRole>();
|
List<UserRole> list = new ArrayList<UserRole>();
|
||||||
for (Long roleId : roles) {
|
for (Long roleId : roles) {
|
||||||
SysUserRole ur = new SysUserRole();
|
UserRole ur = new UserRole();
|
||||||
ur.setUserId(user.getUserId());
|
ur.setUserId(user.getUserId());
|
||||||
ur.setRoleId(roleId);
|
ur.setRoleId(roleId);
|
||||||
list.add(ur);
|
list.add(ur);
|
||||||
|
|
@ -307,13 +307,13 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
public void insertUserPost(SysUser user) {
|
public void insertUserPost(User user) {
|
||||||
Long[] posts = user.getPostIds();
|
Long[] posts = user.getPostIds();
|
||||||
if (StringUtils.isNotNull(posts)) {
|
if (StringUtils.isNotNull(posts)) {
|
||||||
// 新增用户与岗位管理
|
// 新增用户与岗位管理
|
||||||
List<SysUserPost> list = new ArrayList<SysUserPost>();
|
List<UserPost> list = new ArrayList<UserPost>();
|
||||||
for (Long postId : posts) {
|
for (Long postId : posts) {
|
||||||
SysUserPost up = new SysUserPost();
|
UserPost up = new UserPost();
|
||||||
up.setUserId(user.getUserId());
|
up.setUserId(user.getUserId());
|
||||||
up.setPostId(postId);
|
up.setPostId(postId);
|
||||||
list.add(up);
|
list.add(up);
|
||||||
|
|
@ -348,7 +348,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
@Override
|
@Override
|
||||||
public int deleteUserByIds(Long[] userIds) {
|
public int deleteUserByIds(Long[] userIds) {
|
||||||
for (Long userId : userIds) {
|
for (Long userId : userIds) {
|
||||||
checkUserAllowed(new SysUser(userId));
|
checkUserAllowed(new User(userId));
|
||||||
}
|
}
|
||||||
return userMapper.deleteUserByIds(userIds);
|
return userMapper.deleteUserByIds(userIds);
|
||||||
}
|
}
|
||||||
|
|
@ -362,7 +362,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, Long operName) {
|
public String importUser(List<User> userList, Boolean isUpdateSupport, Long operName) {
|
||||||
if (StringUtils.isNull(userList) || userList.size() == 0) {
|
if (StringUtils.isNull(userList) || userList.size() == 0) {
|
||||||
throw new CustomException("导入用户数据不能为空!");
|
throw new CustomException("导入用户数据不能为空!");
|
||||||
}
|
}
|
||||||
|
|
@ -371,10 +371,10 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
StringBuilder successMsg = new StringBuilder();
|
StringBuilder successMsg = new StringBuilder();
|
||||||
StringBuilder failureMsg = new StringBuilder();
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
String password = configService.selectConfigByKey("sys.user.initPassword");
|
||||||
for (SysUser user : userList) {
|
for (User user : userList) {
|
||||||
try {
|
try {
|
||||||
// 验证是否存在这个用户
|
// 验证是否存在这个用户
|
||||||
SysUser u = userMapper.selectUserByUserName(user.getUserName());
|
User u = userMapper.selectUserByUserName(user.getUserName());
|
||||||
if (StringUtils.isNull(u)) {
|
if (StringUtils.isNull(u)) {
|
||||||
user.setPassword(SecurityUtils.encryptPassword(password));
|
user.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
user.setCreateBy(operName);
|
user.setCreateBy(operName);
|
||||||
|
|
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectFileVo">
|
<sql id="selectFileVo">
|
||||||
select file_id, p_id, role_ids, file_name, mapping, file_addr, file_type, file_size, is_public, create_by, create_time, update_by, update_time from sys_file
|
select file_id, p_id, role_ids,inherit, file_name, mapping, file_addr, file_type, file_size, is_public, create_by, create_time, update_by, update_time from sys_file
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectFileList" parameterType="SysFile" resultMap="FileResult">
|
<select id="selectFileList" parameterType="SysFile" resultMap="FileResult">
|
||||||
<include refid="selectFileVo"/>
|
<include refid="selectFileVo"/>
|
||||||
|
|
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="pId != null">p_id,</if>
|
<if test="pId != null">p_id,</if>
|
||||||
<if test="roleIds != null">role_ids,</if>
|
<if test="roleIds != null">role_ids,</if>
|
||||||
|
<if test="inherit != null">inherit,</if>
|
||||||
<if test="fileName != null">file_name,</if>
|
<if test="fileName != null">file_name,</if>
|
||||||
<if test="mapping != null">mapping,</if>
|
<if test="mapping != null">mapping,</if>
|
||||||
<if test="fileAddr != null">file_addr,</if>
|
<if test="fileAddr != null">file_addr,</if>
|
||||||
|
|
@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="pId != null">#{pId},</if>
|
<if test="pId != null">#{pId},</if>
|
||||||
<if test="roleIds != null">#{roleIds},</if>
|
<if test="roleIds != null">#{roleIds},</if>
|
||||||
|
<if test="inherit != null">#{inherit},</if>
|
||||||
<if test="fileName != null">#{fileName},</if>
|
<if test="fileName != null">#{fileName},</if>
|
||||||
<if test="mapping != null">#{mapping},</if>
|
<if test="mapping != null">#{mapping},</if>
|
||||||
<if test="fileAddr != null">#{fileAddr},</if>
|
<if test="fileAddr != null">#{fileAddr},</if>
|
||||||
|
|
@ -76,10 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateFile" parameterType="SysFile">
|
<update id="updateFile" parameterType="SysFile">
|
||||||
update sys_file
|
update sys_file
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="pId != null">p_id = #{pId},</if>
|
|
||||||
<if test="roleIds != null">role_ids = #{roleIds},</if>
|
<if test="roleIds != null">role_ids = #{roleIds},</if>
|
||||||
<if test="isPublic != null">is_public = #{isPublic},</if>
|
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
where file_id = #{fileId}
|
where file_id = #{fileId}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysConfigDao">
|
<mapper namespace="com.hchyun.system.dao.ConfigDao">
|
||||||
|
|
||||||
<resultMap type="SysConfig" id="SysConfigResult">
|
<resultMap type="com.hchyun.system.entity.Config" id="ConfigResult">
|
||||||
<id property="configId" column="config_id" />
|
<id property="configId" column="config_id" />
|
||||||
<result property="configName" column="config_name" />
|
<result property="configName" column="config_name" />
|
||||||
<result property="configKey" column="config_key" />
|
<result property="configKey" column="config_key" />
|
||||||
|
|
@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
<select id="selectConfig" parameterType="com.hchyun.system.entity.Config" resultMap="ConfigResult">
|
||||||
<include refid="selectConfigVo"/>
|
<include refid="selectConfigVo"/>
|
||||||
<include refid="sqlwhereSearch"/>
|
<include refid="sqlwhereSearch"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
<select id="selectConfigList" parameterType="com.hchyun.system.entity.Config" resultMap="ConfigResult">
|
||||||
<include refid="selectConfigVo"/>
|
<include refid="selectConfigVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="configName != null and configName != ''">
|
<if test="configName != null and configName != ''">
|
||||||
|
|
@ -59,12 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
<select id="checkConfigKeyUnique" parameterType="String" resultMap="ConfigResult">
|
||||||
<include refid="selectConfigVo"/>
|
<include refid="selectConfigVo"/>
|
||||||
where config_key = #{configKey} limit 1
|
where config_key = #{configKey} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertConfig" parameterType="SysConfig">
|
<insert id="insertConfig" parameterType="com.hchyun.system.entity.Config">
|
||||||
insert into sys_config (
|
insert into sys_config (
|
||||||
<if test="configName != null and configName != '' ">config_name,</if>
|
<if test="configName != null and configName != '' ">config_name,</if>
|
||||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||||
|
|
@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateConfig" parameterType="SysConfig">
|
<update id="updateConfig" parameterType="com.hchyun.system.entity.Config">
|
||||||
update sys_config
|
update sys_config
|
||||||
<set>
|
<set>
|
||||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysDeptDao">
|
<mapper namespace="com.hchyun.system.dao.DeptDao">
|
||||||
|
|
||||||
<resultMap type="SysDept" id="SysDeptResult">
|
<resultMap type="com.hchyun.common.core.entity.entity.Dept" id="DeptResult">
|
||||||
<id property="deptId" column="dept_id" />
|
<id property="deptId" column="dept_id" />
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id" />
|
||||||
<result property="ancestors" column="ancestors" />
|
<result property="ancestors" column="ancestors" />
|
||||||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_dept d
|
from sys_dept d
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
<select id="selectDeptList" parameterType="com.hchyun.common.core.entity.entity.Dept" resultMap="DeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where d.del_flag = '0'
|
where d.del_flag = '0'
|
||||||
<if test="parentId != null and parentId != 0">
|
<if test="parentId != null and parentId != 0">
|
||||||
|
|
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by d.parent_id, d.order_num
|
order by d.parent_id, d.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
<select id="selectDeptById" parameterType="Long" resultMap="DeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where dept_id = #{deptId}
|
where dept_id = #{deptId}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
<select id="selectChildrenDeptById" parameterType="Long" resultMap="DeptResult">
|
||||||
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -77,12 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
<select id="checkDeptNameUnique" resultMap="DeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertDept" parameterType="SysDept">
|
<insert id="insertDept" parameterType="com.hchyun.common.core.entity.entity.Dept">
|
||||||
insert into sys_dept(
|
insert into sys_dept(
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
|
|
@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateDept" parameterType="SysDept">
|
<update id="updateDept" parameterType="com.hchyun.common.core.entity.entity.Dept">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
<set>
|
<set>
|
||||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||||
|
|
@ -140,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateDeptStatus" parameterType="SysDept">
|
<update id="updateDeptStatus" parameterType="com.hchyun.common.core.entity.entity.Dept">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
<set>
|
<set>
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysDictDataDao">
|
<mapper namespace="com.hchyun.system.dao.DictDataDao">
|
||||||
|
|
||||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
<resultMap type="com.hchyun.common.core.entity.entity.DictData" id="SysDictDataResult">
|
||||||
<id property="dictCode" column="dict_code" />
|
<id property="dictCode" column="dict_code" />
|
||||||
<result property="dictSort" column="dict_sort" />
|
<result property="dictSort" column="dict_sort" />
|
||||||
<result property="dictLabel" column="dict_label" />
|
<result property="dictLabel" column="dict_label" />
|
||||||
|
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_dict_data
|
from sys_dict_data
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
<select id="selectDictDataList" parameterType="com.hchyun.common.core.entity.entity.DictData" resultMap="SysDictDataResult">
|
||||||
<include refid="selectDictDataVo"/>
|
<include refid="selectDictDataVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="dictType != null and dictType != ''">
|
<if test="dictType != null and dictType != ''">
|
||||||
|
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by dict_sort asc
|
order by dict_sort asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
<select id="selectDictDataByType" parameterType="com.hchyun.common.core.entity.entity.DictData" resultMap="SysDictDataResult">
|
||||||
<include refid="selectDictDataVo"/>
|
<include refid="selectDictDataVo"/>
|
||||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateDictData" parameterType="SysDictData">
|
<update id="updateDictData" parameterType="com.hchyun.common.core.entity.entity.DictData">
|
||||||
update sys_dict_data
|
update sys_dict_data
|
||||||
<set>
|
<set>
|
||||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||||
|
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertDictData" parameterType="SysDictData">
|
<insert id="insertDictData" parameterType="com.hchyun.common.core.entity.entity.DictData">
|
||||||
insert into sys_dict_data(
|
insert into sys_dict_data(
|
||||||
<if test="dictSort != null">dict_sort,</if>
|
<if test="dictSort != null">dict_sort,</if>
|
||||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysDictTypeDao">
|
<mapper namespace="com.hchyun.system.dao.DictTypeDao">
|
||||||
|
|
||||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
<resultMap type="com.hchyun.common.core.entity.entity.DictType" id="DictTypeResult">
|
||||||
<id property="dictId" column="dict_id" />
|
<id property="dictId" column="dict_id" />
|
||||||
<result property="dictName" column="dict_name" />
|
<result property="dictName" column="dict_name" />
|
||||||
<result property="dictType" column="dict_type" />
|
<result property="dictType" column="dict_type" />
|
||||||
|
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_dict_type
|
from sys_dict_type
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
<select id="selectDictTypeList" parameterType="DictType" resultMap="DictTypeResult">
|
||||||
<include refid="selectDictTypeVo"/>
|
<include refid="selectDictTypeVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="dictName != null and dictName != ''">
|
<if test="dictName != null and dictName != ''">
|
||||||
|
|
@ -41,21 +41,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
<select id="selectDictTypeAll" resultMap="DictTypeResult">
|
||||||
<include refid="selectDictTypeVo"/>
|
<include refid="selectDictTypeVo"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
<select id="selectDictTypeById" parameterType="Long" resultMap="DictTypeResult">
|
||||||
<include refid="selectDictTypeVo"/>
|
<include refid="selectDictTypeVo"/>
|
||||||
where dict_id = #{dictId}
|
where dict_id = #{dictId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
<select id="selectDictTypeByType" parameterType="String" resultMap="DictTypeResult">
|
||||||
<include refid="selectDictTypeVo"/>
|
<include refid="selectDictTypeVo"/>
|
||||||
where dict_type = #{dictType}
|
where dict_type = #{dictType}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
<select id="checkDictTypeUnique" parameterType="String" resultMap="DictTypeResult">
|
||||||
<include refid="selectDictTypeVo"/>
|
<include refid="selectDictTypeVo"/>
|
||||||
where dict_type = #{dictType} limit 1
|
where dict_type = #{dictType} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateDictType" parameterType="SysDictType">
|
<update id="updateDictType" parameterType="DictType">
|
||||||
update sys_dict_type
|
update sys_dict_type
|
||||||
<set>
|
<set>
|
||||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||||
|
|
@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where dict_id = #{dictId}
|
where dict_id = #{dictId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertDictType" parameterType="SysDictType">
|
<insert id="insertDictType" parameterType="DictType">
|
||||||
insert into sys_dict_type(
|
insert into sys_dict_type(
|
||||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysLogininforDao">
|
<mapper namespace="com.hchyun.system.dao.LogininforDao">
|
||||||
|
|
||||||
<resultMap type="SysLogininfor" id="SysLogininforResult">
|
<resultMap type="com.hchyun.system.entity.Logininfor" id="SysLogininforResult">
|
||||||
<id property="infoId" column="info_id" />
|
<id property="infoId" column="info_id" />
|
||||||
<result property="userName" column="user_name" />
|
<result property="userName" column="user_name" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
|
|
@ -16,12 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="loginTime" column="login_time" />
|
<result property="loginTime" column="login_time" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
<insert id="insertLogininfor" parameterType="Logininfor">
|
||||||
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
||||||
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
|
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
<select id="selectLogininforList" parameterType="Logininfor" resultMap="SysLogininforResult">
|
||||||
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
|
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
|
||||||
<where>
|
<where>
|
||||||
<if test="ipaddr != null and ipaddr != ''">
|
<if test="ipaddr != null and ipaddr != ''">
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysMenuDao">
|
<mapper namespace="com.hchyun.system.dao.MenuDao">
|
||||||
|
|
||||||
<resultMap type="SysMenu" id="SysMenuResult">
|
<resultMap type="com.hchyun.common.core.entity.entity.Menu" id="SysMenuResult">
|
||||||
<id property="menuId" column="menu_id" />
|
<id property="menuId" column="menu_id" />
|
||||||
<result property="menuName" column="menu_name" />
|
<result property="menuName" column="menu_name" />
|
||||||
<result property="parentName" column="parent_name" />
|
<result property="parentName" column="parent_name" />
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
from sys_menu
|
from sys_menu
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
<select id="selectMenuList" parameterType="Menu" resultMap="SysMenuResult">
|
||||||
<include refid="selectMenuVo"/>
|
<include refid="selectMenuVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="menuName != null and menuName != ''">
|
<if test="menuName != null and menuName != ''">
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
order by m.parent_id, m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
<select id="selectMenuListByUserId" parameterType="Menu" resultMap="SysMenuResult">
|
||||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||||
from sys_menu m
|
from sys_menu m
|
||||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||||
|
|
@ -119,12 +119,12 @@
|
||||||
select count(1) from sys_menu where parent_id = #{menuId}
|
select count(1) from sys_menu where parent_id = #{menuId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
<select id="checkMenuNameUnique" parameterType="Menu" resultMap="SysMenuResult">
|
||||||
<include refid="selectMenuVo"/>
|
<include refid="selectMenuVo"/>
|
||||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateMenu" parameterType="SysMenu">
|
<update id="updateMenu" parameterType="Menu">
|
||||||
update sys_menu
|
update sys_menu
|
||||||
<set>
|
<set>
|
||||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
where menu_id = #{menuId}
|
where menu_id = #{menuId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertMenu" parameterType="SysMenu">
|
<insert id="insertMenu" parameterType="Menu">
|
||||||
insert into sys_menu(
|
insert into sys_menu(
|
||||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysNoticeDao">
|
<mapper namespace="com.hchyun.system.dao.NoticeDao">
|
||||||
|
|
||||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
<resultMap type="com.hchyun.system.entity.Notice" id="NoticeResult">
|
||||||
<result property="noticeId" column="notice_id" />
|
<result property="noticeId" column="notice_id" />
|
||||||
<result property="noticeTitle" column="notice_title" />
|
<result property="noticeTitle" column="notice_title" />
|
||||||
<result property="noticeType" column="notice_type" />
|
<result property="noticeType" column="notice_type" />
|
||||||
|
|
@ -22,12 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_notice
|
from sys_notice
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
<select id="selectNoticeById" parameterType="Long" resultMap="NoticeResult">
|
||||||
<include refid="selectNoticeVo"/>
|
<include refid="selectNoticeVo"/>
|
||||||
where notice_id = #{noticeId}
|
where notice_id = #{noticeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
<select id="selectNoticeList" parameterType="Notice" resultMap="NoticeResult">
|
||||||
<include refid="selectNoticeVo"/>
|
<include refid="selectNoticeVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">
|
<if test="noticeTitle != null and noticeTitle != ''">
|
||||||
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertNotice" parameterType="SysNotice">
|
<insert id="insertNotice" parameterType="Notice">
|
||||||
insert into sys_notice (
|
insert into sys_notice (
|
||||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||||
|
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateNotice" parameterType="SysNotice">
|
<update id="updateNotice" parameterType="Notice">
|
||||||
update sys_notice
|
update sys_notice
|
||||||
<set>
|
<set>
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysOperLogDao">
|
<mapper namespace="com.hchyun.system.dao.OperLogDao">
|
||||||
|
|
||||||
<resultMap type="SysOperLog" id="SysOperLogResult">
|
<resultMap type="com.hchyun.system.entity.OperLog" id="OperLogResult">
|
||||||
<id property="operId" column="oper_id" />
|
<id property="operId" column="oper_id" />
|
||||||
<result property="title" column="title" />
|
<result property="title" column="title" />
|
||||||
<result property="businessType" column="business_type" />
|
<result property="businessType" column="business_type" />
|
||||||
|
|
@ -28,12 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_oper_log
|
from sys_oper_log
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
<insert id="insertOperlog" parameterType="OperLog">
|
||||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
|
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
|
||||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
|
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
<select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
|
||||||
<include refid="selectOperLogVo"/>
|
<include refid="selectOperLogVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="title != null and title != ''">
|
<if test="title != null and title != ''">
|
||||||
|
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
<select id="selectOperLogById" parameterType="Long" resultMap="OperLogResult">
|
||||||
<include refid="selectOperLogVo"/>
|
<include refid="selectOperLogVo"/>
|
||||||
where oper_id = #{operId}
|
where oper_id = #{operId}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysPostDao">
|
<mapper namespace="com.hchyun.system.dao.PostDao">
|
||||||
|
|
||||||
<resultMap type="SysPost" id="SysPostResult">
|
<resultMap type="com.hchyun.system.entity.Post" id="PostResult">
|
||||||
<id property="postId" column="post_id" />
|
<id property="postId" column="post_id" />
|
||||||
<result property="postCode" column="post_code" />
|
<result property="postCode" column="post_code" />
|
||||||
<result property="postName" column="post_name" />
|
<result property="postName" column="post_name" />
|
||||||
|
|
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from sys_post
|
from sys_post
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
<select id="selectPostList" parameterType="Post" resultMap="PostResult">
|
||||||
<include refid="selectPostVo"/>
|
<include refid="selectPostVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="postCode != null and postCode != ''">
|
<if test="postCode != null and postCode != ''">
|
||||||
|
|
@ -37,11 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPostAll" resultMap="SysPostResult">
|
<select id="selectPostAll" resultMap="PostResult">
|
||||||
<include refid="selectPostVo"/>
|
<include refid="selectPostVo"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
<select id="selectPostById" parameterType="Long" resultMap="PostResult">
|
||||||
<include refid="selectPostVo"/>
|
<include refid="selectPostVo"/>
|
||||||
where post_id = #{postId}
|
where post_id = #{postId}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where u.user_id = #{userId}
|
where u.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
<select id="selectPostsByUserName" parameterType="String" resultMap="PostResult">
|
||||||
select p.post_id, p.post_name, p.post_code
|
select p.post_id, p.post_name, p.post_code
|
||||||
from sys_post p
|
from sys_post p
|
||||||
left join sys_user_post up on up.post_id = p.post_id
|
left join sys_user_post up on up.post_id = p.post_id
|
||||||
|
|
@ -62,17 +62,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where u.user_name = #{userName}
|
where u.user_name = #{userName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
<select id="checkPostNameUnique" parameterType="String" resultMap="PostResult">
|
||||||
<include refid="selectPostVo"/>
|
<include refid="selectPostVo"/>
|
||||||
where post_name=#{postName} limit 1
|
where post_name=#{postName} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
<select id="checkPostCodeUnique" parameterType="String" resultMap="PostResult">
|
||||||
<include refid="selectPostVo"/>
|
<include refid="selectPostVo"/>
|
||||||
where post_code=#{postCode} limit 1
|
where post_code=#{postCode} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updatePost" parameterType="SysPost">
|
<update id="updatePost" parameterType="Post">
|
||||||
update sys_post
|
update sys_post
|
||||||
<set>
|
<set>
|
||||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||||
|
|
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where post_id = #{postId}
|
where post_id = #{postId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
<insert id="insertPost" parameterType="Post" useGeneratedKeys="true" keyProperty="postId">
|
||||||
insert into sys_post(
|
insert into sys_post(
|
||||||
<if test="postId != null and postId != 0">post_id,</if>
|
<if test="postId != null and postId != 0">post_id,</if>
|
||||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysRoleDeptDao">
|
<mapper namespace="com.hchyun.system.dao.RoleDeptDao">
|
||||||
|
|
||||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
<resultMap type="com.hchyun.system.entity.RoleDept" id="RoleDeptResult">
|
||||||
<result property="roleId" column="role_id" />
|
<result property="roleId" column="role_id" />
|
||||||
<result property="deptId" column="dept_id" />
|
<result property="deptId" column="dept_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hchyun.system.dao.SysRoleDao">
|
<mapper namespace="com.hchyun.system.dao.RoleDao">
|
||||||
|
|
||||||
<resultMap type="SysRole" id="SysRoleResult">
|
<resultMap type="com.hchyun.common.core.entity.entity.Role" id="RoleResult">
|
||||||
<id property="roleId" column="role_id" />
|
<id property="roleId" column="role_id" />
|
||||||
<result property="roleName" column="role_name" />
|
<result property="roleName" column="role_name" />
|
||||||
<result property="roleKey" column="role_key" />
|
<result property="roleKey" column="role_key" />
|
||||||
|
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
<select id="selectRoleList" parameterType="Role" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.del_flag = '0'
|
where r.del_flag = '0'
|
||||||
<if test="roleType != 0 and roleType != null">
|
<if test="roleType != 0 and roleType != null">
|
||||||
|
|
@ -57,12 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by r.role_sort
|
order by r.role_sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
|
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
<select id="selectRoleAll" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -74,27 +74,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where u.user_id = #{userId}
|
where u.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
<select id="selectRoleById" parameterType="Long" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_id = #{roleId}
|
where r.role_id = #{roleId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
<select id="selectRolesByUserName" parameterType="String" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_name=#{roleName} limit 1
|
where r.role_name=#{roleName} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="RoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_key=#{roleKey} limit 1
|
where r.role_key=#{roleKey} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="Role" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
insert into sys_role(
|
insert into sys_role(
|
||||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||||
|
|
@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateRole" parameterType="SysRole">
|
<update id="updateRole" parameterType="Role">
|
||||||
update sys_role
|
update sys_role
|
||||||
<set>
|
<set>
|
||||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||||
|
|
@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where role_id = #{roleId}
|
where role_id = #{roleId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateRoleStatus" parameterType="SysRole">
|
<update id="updateRoleStatus" parameterType="Role">
|
||||||
update sys_user set status = #{status} where user_id = #{userId}
|
update sys_user set status = #{status} where user_id = #{userId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue