Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b0de1e3f05
Binary file not shown.
@ -37,7 +37,7 @@ INSERT INTO `sys_menu` VALUES (3, '系统工具', 0, 3, 'tool', NULL, '', 1, 0,
|
||||
INSERT INTO `sys_menu` VALUES (100, '用户管理', 2210, 4, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2022-04-07 00:29:31', 'admin', '2022-08-13 21:41:42', '用户管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (101, '角色管理', 2210, 3, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2022-04-07 00:29:31', 'admin', '2022-08-13 21:42:03', '角色管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2022-04-07 00:29:31', '', NULL, '菜单管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (103, '部门管理', 2210, 1, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2022-04-07 00:29:31', 'admin', '2022-08-13 21:42:27', '部门管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (103, '机构管理', 2210, 1, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2022-04-07 00:29:31', 'admin', '2022-08-13 21:42:27', '机构管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (104, '岗位管理', 2210, 2, 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2022-04-07 00:29:31', 'admin', '2022-08-13 21:42:38', '岗位管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2022-04-07 00:29:31', '', NULL, '字典管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2022-04-07 00:29:31', '', NULL, '参数设置菜单');
|
||||
@ -69,10 +69,10 @@ INSERT INTO `sys_menu` VALUES (1013, '菜单查询', 102, 1, '', '', '', 1, 0, '
|
||||
INSERT INTO `sys_menu` VALUES (1014, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1015, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1016, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1017, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1018, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1019, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1020, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1017, '机构查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1018, '机构新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1019, '机构修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1020, '机构删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1021, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1022, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1023, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2022-04-07 00:29:31', '', NULL, '');
|
||||
|
@ -24,7 +24,7 @@ import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.system.service.ISysDeptService;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
* 机构信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class SysDeptController extends BaseController
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 获取部门列表
|
||||
* 获取机构列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysDept dept)
|
||||
@ -46,7 +46,7 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
* 查询机构列表(排除节点)
|
||||
*/
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||
@ -66,7 +66,7 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
* 根据机构编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
@ -77,7 +77,7 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门下拉树列表
|
||||
* 获取机构下拉树列表
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(SysDept dept)
|
||||
@ -87,7 +87,7 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载对应角色部门列表树
|
||||
* 加载对应角色机构列表树
|
||||
*/
|
||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
||||
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
||||
@ -100,26 +100,26 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
* 新增机构
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@Log(title = "机构管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
return AjaxResult.error("新增机构'" + dept.getDeptName() + "'失败,机构名称已存在");
|
||||
}
|
||||
dept.setCreateBy(getUsername());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
* 修改机构
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "机构管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
@ -127,35 +127,35 @@ public class SysDeptController extends BaseController
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
return AjaxResult.error("修改机构'" + dept.getDeptName() + "'失败,机构名称已存在");
|
||||
}
|
||||
else if (dept.getParentId().equals(deptId))
|
||||
{
|
||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
return AjaxResult.error("修改机构'" + dept.getDeptName() + "'失败,上级机构不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||
{
|
||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||
return AjaxResult.error("该机构包含未停用的子机构!");
|
||||
}
|
||||
dept.setUpdateBy(getUsername());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
* 删除机构
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@Log(title = "机构管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public AjaxResult remove(@PathVariable Long deptId)
|
||||
{
|
||||
if (deptService.hasChildByDeptId(deptId))
|
||||
{
|
||||
return AjaxResult.error("存在下级部门,不允许删除");
|
||||
return AjaxResult.error("存在下级机构,不允许删除");
|
||||
}
|
||||
if (deptService.checkDeptExistUser(deptId))
|
||||
{
|
||||
return AjaxResult.error("部门存在用户,不允许删除");
|
||||
return AjaxResult.error("机构存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
|
@ -95,7 +95,7 @@ public class SysRoleController extends BaseController
|
||||
}
|
||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
{
|
||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色编码已存在");
|
||||
}
|
||||
role.setCreateBy(getUsername());
|
||||
return toAjax(roleService.insertRole(role));
|
||||
@ -118,7 +118,7 @@ public class SysRoleController extends BaseController
|
||||
}
|
||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
{
|
||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色编码已存在");
|
||||
}
|
||||
role.setUpdateBy(getUsername());
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
public @interface DataScope
|
||||
{
|
||||
/**
|
||||
* 部门表的别名
|
||||
* 机构表的别名
|
||||
*/
|
||||
public String deptAlias() default "";
|
||||
|
||||
|
@ -26,10 +26,10 @@ public class UserConstants
|
||||
/** 角色封禁状态 */
|
||||
public static final String ROLE_DISABLE = "1";
|
||||
|
||||
/** 部门正常状态 */
|
||||
/** 机构正常状态 */
|
||||
public static final String DEPT_NORMAL = "0";
|
||||
|
||||
/** 部门停用状态 */
|
||||
/** 机构停用状态 */
|
||||
public static final String DEPT_DISABLE = "1";
|
||||
|
||||
/** 字典正常状态 */
|
||||
|
@ -169,7 +169,7 @@ public class BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录部门id
|
||||
* 获取登录机构id
|
||||
*/
|
||||
public Long getDeptId()
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ public class TreeEntity extends BaseEntity
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 子部门 */
|
||||
/** 子机构 */
|
||||
private List<?> children = new ArrayList<>();
|
||||
|
||||
public String getParentName()
|
||||
|
@ -10,7 +10,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
* 机构表 sys_dept
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -18,18 +18,27 @@ public class SysDept extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
/** 机构ID */
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
/** 父机构ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 部门名称 */
|
||||
/** 机构名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 机构编码 */
|
||||
private String deptCode;
|
||||
|
||||
/** 机构类型 */
|
||||
private int deptType;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 显示顺序 */
|
||||
private String orderNum;
|
||||
|
||||
@ -42,16 +51,16 @@ public class SysDept extends BaseEntity
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
/** 机构状态:0正常,1停用 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
/** 父机构名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
/** 子机构 */
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
public Long getDeptId()
|
||||
@ -84,8 +93,8 @@ public class SysDept extends BaseEntity
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||
@NotBlank(message = "机构名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "机构名称长度不能超过30个字符")
|
||||
public String getDeptName()
|
||||
{
|
||||
return deptName;
|
||||
@ -102,6 +111,32 @@ public class SysDept extends BaseEntity
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public int getDeptType() {
|
||||
return deptType;
|
||||
}
|
||||
|
||||
public void setDeptType(int deptType) {
|
||||
this.deptType = deptType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
@ -187,6 +222,9 @@ public class SysDept extends BaseEntity
|
||||
.append("parentId", getParentId())
|
||||
.append("ancestors", getAncestors())
|
||||
.append("deptName", getDeptName())
|
||||
.append("deptCode", getDeptCode())
|
||||
.append("deptType", getDeptType())
|
||||
.append("remark", getRemark())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("leader", getLeader())
|
||||
.append("phone", getPhone())
|
||||
|
@ -33,14 +33,14 @@ public class SysRole extends BaseEntity
|
||||
@Excel(name = "角色排序")
|
||||
private String roleSort;
|
||||
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本机构数据权限;4:本机构及以下数据权限;5:仅本人数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本机构数据权限,4=本机构及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||
private boolean menuCheckStrictly;
|
||||
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
/** 机构树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
@ -56,7 +56,7 @@ public class SysRole extends BaseEntity
|
||||
/** 菜单组 */
|
||||
private Long[] menuIds;
|
||||
|
||||
/** 部门组(数据权限) */
|
||||
/** 机构组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
public SysRole()
|
||||
|
@ -30,8 +30,8 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
/** 机构ID */
|
||||
@Excel(name = "机构编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
@ -78,10 +78,10 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
/** 机构对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
@Excel(name = "机构名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "机构负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class LoginUser implements UserDetails
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
* 机构ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class SecurityUtils
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门ID
|
||||
* 获取机构ID
|
||||
**/
|
||||
public static Long getDeptId()
|
||||
{
|
||||
@ -40,7 +40,7 @@ public class SecurityUtils
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
|
||||
throw new ServiceException("获取机构ID异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,12 @@ public class DataScopeAspect
|
||||
public static final String DATA_SCOPE_CUSTOM = "2";
|
||||
|
||||
/**
|
||||
* 部门数据权限
|
||||
* 机构数据权限
|
||||
*/
|
||||
public static final String DATA_SCOPE_DEPT = "3";
|
||||
|
||||
/**
|
||||
* 部门及以下数据权限
|
||||
* 机构及以下数据权限
|
||||
*/
|
||||
public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
||||
|
||||
|
@ -211,7 +211,7 @@ public class MobileLoginService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置注册用户角色部门岗位信息
|
||||
* 设置注册用户角色机构岗位信息
|
||||
* @param registerUser
|
||||
* @return
|
||||
*/
|
||||
@ -222,7 +222,7 @@ public class MobileLoginService {
|
||||
}
|
||||
String registerDeptCode = DictUtils.getDictValue("sys_config","register_dept_code","");
|
||||
if (StringUtils.isBlank(registerDeptCode)) {
|
||||
throw new ServiceException("请前往数据字典【sys_config】中维护注册用户部门编码【register_dept_code】");
|
||||
throw new ServiceException("请前往数据字典【sys_config】中维护注册用户机构编码【register_dept_code】");
|
||||
}
|
||||
String registerPostCode = DictUtils.getDictValue("sys_config","register_post_code","");
|
||||
if (StringUtils.isBlank(registerPostCode)) {
|
||||
|
@ -37,7 +37,7 @@ public class ItemTypeController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除当前和父节点)
|
||||
* 查询机构列表(排除当前和父节点)
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
@ -61,7 +61,7 @@ public class ItemTypeController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门详情
|
||||
* 查询机构详情
|
||||
* @param itemTypeId
|
||||
* @return
|
||||
*/
|
||||
@ -98,8 +98,8 @@ public class ItemTypeController extends BaseController {
|
||||
if(itemType.getParentTypeId() ==null || itemType.getParentTypeId()==0){
|
||||
itemType.setParentTypeId(0L);
|
||||
}
|
||||
//自动生成一个唯一编码
|
||||
itemType.setItemTypeCode(autoCodeUtil.genSerialCode(UserConstants.ITEM_TYPE_CODE,null));
|
||||
// 自动生成一个唯一编码
|
||||
// itemType.setItemTypeCode(autoCodeUtil.genSerialCode(UserConstants.ITEM_TYPE_CODE,null));
|
||||
itemType.setCreateBy(getUsername());
|
||||
return AjaxResult.success(iItemTypeService.insertItemType(itemType));
|
||||
}
|
||||
|
@ -44,11 +44,12 @@ public class MdItemController extends BaseController {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdItem mdItem){
|
||||
public TableDataInfo list(MdItem mdItem) {
|
||||
startPage();
|
||||
List<MdItem> list = mdItemService.selectMdItemList(mdItem);
|
||||
return getDataTable(list);
|
||||
@ -60,8 +61,7 @@ public class MdItemController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:export')")
|
||||
@Log(title = "物料管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdItem mdItem)
|
||||
{
|
||||
public void export(HttpServletResponse response, MdItem mdItem) {
|
||||
List<MdItem> list = mdItemService.getExeportList(mdItem);
|
||||
ExcelUtil<MdItem> util = new ExcelUtil<MdItem>(MdItem.class);
|
||||
util.exportExcel(response, list, "物料产品数据");
|
||||
@ -69,11 +69,11 @@ public class MdItemController extends BaseController {
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*
|
||||
* @param response
|
||||
*/
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<MdItem> util = new ExcelUtil<MdItem>(MdItem.class);
|
||||
util.importTemplateExcel(response, "物料产品数据");
|
||||
}
|
||||
@ -81,6 +81,7 @@ public class MdItemController extends BaseController {
|
||||
|
||||
/**
|
||||
* 从模板导入供应商数据
|
||||
*
|
||||
* @param file
|
||||
* @param updateSupport
|
||||
* @return
|
||||
@ -89,8 +90,7 @@ public class MdItemController extends BaseController {
|
||||
@Log(title = "物料管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<MdItem> util = new ExcelUtil<MdItem>(MdItem.class);
|
||||
List<MdItem> mdItemList = util.importExcel(file.getInputStream());
|
||||
String operName = getUsername();
|
||||
@ -99,80 +99,83 @@ public class MdItemController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键查询
|
||||
*
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:query')")
|
||||
@GetMapping(value = "/{itemId}")
|
||||
public AjaxResult getInfo(@PathVariable Long itemId){
|
||||
public AjaxResult getInfo(@PathVariable Long itemId) {
|
||||
return AjaxResult.success(mdItemService.selectMdItemById(itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:add')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.INSERT)
|
||||
@Log(title = "物料管理", businessType = BusinessType.INSERT)
|
||||
@BarcodeGen(barcodeType = UserConstants.BARCODE_TYPE_ITEM)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody MdItem mdItem){
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料编码已存在");
|
||||
public AjaxResult add(@Validated @RequestBody MdItem mdItem) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))) {
|
||||
return AjaxResult.error("新增物料" + mdItem.getItemCode() + "失败,物料编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料名称已存在");
|
||||
if (UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))) {
|
||||
return AjaxResult.error("新增物料" + mdItem.getItemCode() + "失败,物料名称已存在");
|
||||
}
|
||||
|
||||
ItemType type =iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if(StringUtils.isNotNull(type)){
|
||||
ItemType type = iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if (StringUtils.isNotNull(type)) {
|
||||
mdItem.setItemTypeCode(type.getItemTypeCode());
|
||||
mdItem.setItemTypeName(type.getItemTypeName());
|
||||
mdItem.setItemOrProduct(type.getItemOrProduct());
|
||||
}
|
||||
|
||||
MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure());
|
||||
if(StringUtils.isNotNull(measure)){
|
||||
if (StringUtils.isNotNull(measure)) {
|
||||
mdItem.setUnitName(measure.getMeasureName());
|
||||
}
|
||||
|
||||
mdItem.setCreateBy(getUsername());
|
||||
mdItemService.insertMdItem(mdItem);
|
||||
barcodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_ITEM,mdItem.getItemId(),mdItem.getItemCode(), mdItem.getItemName());
|
||||
barcodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_ITEM, mdItem.getItemId(), mdItem.getItemCode(), mdItem.getItemName());
|
||||
|
||||
return AjaxResult.success(mdItem.getItemId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param mdItem
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:edit')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.UPDATE)
|
||||
@Log(title = "物料管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody MdItem mdItem){
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料编码已存在");
|
||||
public AjaxResult edit(@Validated @RequestBody MdItem mdItem) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemCodeUnique(mdItem))) {
|
||||
return AjaxResult.error("新增物料" + mdItem.getItemCode() + "失败,物料编码已存在");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))){
|
||||
return AjaxResult.error("新增物料"+mdItem.getItemCode()+"失败,物料名称已存在");
|
||||
if (UserConstants.NOT_UNIQUE.equals(mdItemService.checkItemNameUnique(mdItem))) {
|
||||
return AjaxResult.error("新增物料" + mdItem.getItemCode() + "失败,物料名称已存在");
|
||||
}
|
||||
ItemType type =iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if(StringUtils.isNotNull(type)){
|
||||
ItemType type = iItemTypeService.selectItemTypeById(mdItem.getItemTypeId());
|
||||
if (StringUtils.isNotNull(type)) {
|
||||
mdItem.setItemTypeCode(type.getItemTypeCode());
|
||||
mdItem.setItemTypeName(type.getItemTypeName());
|
||||
mdItem.setItemOrProduct(type.getItemOrProduct());
|
||||
}
|
||||
if(StringUtils.isNotNull(mdItem.getSafeStockFlag())&& "N".equals(mdItem.getSafeStockFlag())){
|
||||
if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) {
|
||||
mdItem.setMinStock(0D);
|
||||
mdItem.setMaxStock(0D);
|
||||
}
|
||||
MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure());
|
||||
if(StringUtils.isNotNull(measure)){
|
||||
if (StringUtils.isNotNull(measure)) {
|
||||
mdItem.setUnitName(measure.getMeasureName());
|
||||
}
|
||||
|
||||
@ -181,9 +184,9 @@ public class MdItemController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:mditem:remove')")
|
||||
@Log(title = "物料管理",businessType = BusinessType.DELETE)
|
||||
@Log(title = "物料管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{itemIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] itemIds){
|
||||
public AjaxResult remove(@PathVariable Long[] itemIds) {
|
||||
return toAjax(mdItemService.deleteByItemIds(itemIds));
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,10 @@ public class MdItem extends BaseEntity {
|
||||
private String itemCode;
|
||||
@Excel(name = "物料/产品名称")
|
||||
private String itemName;
|
||||
@Excel(name = "规格型号")
|
||||
@Excel(name = "规格")
|
||||
private String specification;
|
||||
@Excel(name = "型号")
|
||||
private String modelNumber;
|
||||
@Excel(name = "单位编码")
|
||||
private String unitOfMeasure;
|
||||
@Excel(name = "单位名称")
|
||||
@ -46,7 +48,7 @@ public class MdItem extends BaseEntity {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
@Size(min = 0,max = 64,message = "物料产品编码长度不能超过64个字符")
|
||||
@Size(min = 0, max = 64, message = "物料产品编码长度不能超过64个字符")
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
@ -56,7 +58,7 @@ public class MdItem extends BaseEntity {
|
||||
}
|
||||
|
||||
@NotBlank(message = "物料产品名称不能为空")
|
||||
@Size(min = 0,max = 255,message = "物料产品编码名称不能超过255个字符")
|
||||
@Size(min = 0, max = 255, message = "物料产品编码名称不能超过255个字符")
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
@ -65,7 +67,7 @@ public class MdItem extends BaseEntity {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
@Size(min = 0,max = 500,message = "规格型号不能超过255个字符")
|
||||
@Size(min = 0, max = 500, message = "规格不能超过255个字符")
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
@ -74,6 +76,15 @@ public class MdItem extends BaseEntity {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 500, message = "型号不能超过255个字符")
|
||||
public String getModelNumber() {
|
||||
return modelNumber;
|
||||
}
|
||||
|
||||
public void setModelNumber(String modelNumber) {
|
||||
this.modelNumber = modelNumber;
|
||||
}
|
||||
|
||||
@NotBlank(message = "单位编码不能为空")
|
||||
public String getUnitOfMeasure() {
|
||||
return unitOfMeasure;
|
||||
@ -204,6 +215,7 @@ public class MdItem extends BaseEntity {
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", modelNumber='" + modelNumber + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", itemOrProduct='" + itemOrProduct + '\'' +
|
||||
", itemTypeId=" + itemTypeId +
|
||||
|
@ -1,186 +1,330 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.md.mapper.MdItemMapper">
|
||||
<resultMap type="MdItem" id="MdItemResult">
|
||||
<id property="itemId" column="item_id"/>
|
||||
<result property="itemCode" column="item_code"/>
|
||||
<result property="itemName" column="item_name"/>
|
||||
<result property="specification" column="specification"/>
|
||||
<result property="modelNumber" column="model_number"/>
|
||||
<result property="unitOfMeasure" column="unit_of_measure"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="itemOrProduct" column="item_or_product"/>
|
||||
<result property="itemTypeId" column="item_type_id"/>
|
||||
<result property="itemTypeCode" column="item_type_code"/>
|
||||
<result property="itemTypeName" column="item_type_name"/>
|
||||
<result property="enableFlag" column="enable_flag"/>
|
||||
<result property="safeStockFlag" column="safe_stock_flag"/>
|
||||
<result property="minStock" column="min_stock"/>
|
||||
<result property="maxStock" column="max_stock"/>
|
||||
<result property="highValue" column="high_value"/>
|
||||
<result property="attr1" column="attr1"/>
|
||||
<result property="attr2" column="attr2"/>
|
||||
<result property="attr3" column="attr3"/>
|
||||
<result property="attr4" column="attr4"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="MdItem" id="MdItemResult">
|
||||
<id property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="itemOrProduct" column="item_or_product" />
|
||||
<result property="itemTypeId" column="item_type_id" />
|
||||
<result property="itemTypeCode" column="item_type_code" />
|
||||
<result property="itemTypeName" column="item_type_name" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="safeStockFlag" column="safe_stock_flag" />
|
||||
<result property="minStock" column="min_stock" />
|
||||
<result property="maxStock" column="max_stock" />
|
||||
<result property="highValue" column="high_value" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdItemVo">
|
||||
select item_id, item_code, item_name, specification, unit_of_measure,unit_name, item_or_product,
|
||||
item_type_id,item_type_code,item_type_name,enable_flag,safe_stock_flag,min_stock,max_stock,high_value, create_by, create_time, remark
|
||||
from md_item
|
||||
<sql id="selectMdItemVo">
|
||||
select item_id,
|
||||
item_code,
|
||||
item_name,
|
||||
specification,
|
||||
model_number,
|
||||
unit_of_measure,
|
||||
unit_name,
|
||||
item_or_product,
|
||||
item_type_id,
|
||||
item_type_code,
|
||||
item_type_name,
|
||||
enable_flag,
|
||||
safe_stock_flag,
|
||||
min_stock,
|
||||
max_stock,
|
||||
high_value,
|
||||
create_by,
|
||||
create_time,
|
||||
remark
|
||||
from md_item
|
||||
</sql>
|
||||
|
||||
<select id="selectMdItemList" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND item_code like concat('%', #{itemCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0 ">
|
||||
AND (item_type_id = #{itemTypeId} OR item_type_id in (select item_type_id from md_item_type where find_in_set(#{itemTypeId},ancestors)))
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND enable_flag = #{enableFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getExeportList" parameterType="MdItem" resultMap="MdItemResult">
|
||||
select i.item_id, i.item_code, i.item_name, i.specification, i.unit_of_measure,i.unit_name, i.item_or_product,
|
||||
i.item_type_id,i.item_type_code,i.enable_flag,i.safe_stock_flag,i.min_stock,i.max_stock,i.high_value, i.create_by, i.create_time, i.remark,CONCAT((select group_concat(item_type_name separator '/') from md_item_type b where FIND_IN_SET(CAST(item_type_id as CHAR),a.ancestors)>0),'/',a.item_type_name) as item_type_name
|
||||
from md_item i
|
||||
left join md_item_type a
|
||||
on i.item_type_id = a.item_type_id
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND i.item_code like concat('%', #{itemCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0 ">
|
||||
AND (i.item_type_id = #{itemTypeId} OR i.item_type_id in (select item_type_id from md_item_type where find_in_set(#{itemTypeId},ancestors)))
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND i.item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND i.enable_flag = #{enableFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectMdItemList" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND item_code like concat('%', #{itemCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0">
|
||||
AND (item_type_id = #{itemTypeId} OR item_type_id in (select item_type_id
|
||||
from md_item_type
|
||||
where find_in_set(#{itemTypeId}, ancestors)))
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND enable_flag = #{enableFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdItemAll" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"></include>
|
||||
</select>
|
||||
<select id="getExeportList" parameterType="MdItem" resultMap="MdItemResult">
|
||||
select i.item_id,
|
||||
i.item_code,
|
||||
i.item_name,
|
||||
i.specification,
|
||||
i.model_number,
|
||||
i.unit_of_measure,
|
||||
i.unit_name,
|
||||
i.item_or_product,
|
||||
i.item_type_id,
|
||||
i.item_type_code,
|
||||
i.enable_flag,
|
||||
i.safe_stock_flag,
|
||||
i.min_stock,
|
||||
i.max_stock,
|
||||
i.high_value,
|
||||
i.create_by,
|
||||
i.create_time,
|
||||
i.remark,
|
||||
CONCAT((select group_concat(item_type_name separator '/')
|
||||
from md_item_type b
|
||||
where FIND_IN_SET(CAST(item_type_id as CHAR), a.ancestors) > 0), '/',
|
||||
a.item_type_name) as item_type_name
|
||||
from md_item i
|
||||
left join md_item_type a
|
||||
on i.item_type_id = a.item_type_id
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND i.item_code like concat('%', #{itemCode}, '%')
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0">
|
||||
AND (i.item_type_id = #{itemTypeId} OR i.item_type_id in (select item_type_id
|
||||
from md_item_type
|
||||
where find_in_set(#{itemTypeId}, ancestors)))
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND i.item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
AND i.enable_flag = #{enableFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdItemById" parameterType="Long" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"></include>
|
||||
where item_id = #{itemId}
|
||||
</select>
|
||||
<select id="selectMdItemAll" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo">
|
||||
</include>
|
||||
</select>
|
||||
|
||||
<select id="checkItemCodeUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemCode} limit 1
|
||||
</select>
|
||||
<select id="selectMdItemById" parameterType="Long" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo">
|
||||
</include>
|
||||
where item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id="checkItemNameUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemName} limit 1
|
||||
</select>
|
||||
<select id="checkItemCodeUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemCode} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertMdItem" parameterType="MdItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into md_item(
|
||||
item_code,
|
||||
item_name,
|
||||
<if test="specification !=null and specification !=''">specification,</if>
|
||||
unit_of_measure,
|
||||
<if test="unitName != null and unitName !=''">unit_name,</if>
|
||||
item_or_product,
|
||||
item_type_id,
|
||||
<if test="itemTypeCode !=null and itemTypeCode !=''">item_type_code,</if>
|
||||
<if test="itemTypeName !=null and itemTypeName !=''">item_type_name,</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">enable_flag,</if>
|
||||
safe_stock_flag,
|
||||
<if test="safeStockFlag =='Y'.toString()">min_stock,</if>
|
||||
<if test="safeStockFlag =='Y'.toString()">max_stock,</if>
|
||||
<if test="highValue !=null and highValue !=''">high_value,</if>
|
||||
<if test="remark !=null and remark !=''">remark,</if>
|
||||
<if test="attr1 !=null and attr1 !=''">attr1,</if>
|
||||
<if test="attr2 !=null and attr2 !=''">attr2,</if>
|
||||
<if test="attr3 !=null and attr3 !=0">attr3,</if>
|
||||
<if test="attr4 !=null and attr4 !=0">attr4,</if>
|
||||
<if test="createBy !=null and createBy !=''">create_by,</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
#{itemCode},
|
||||
#{itemName},
|
||||
<if test="specification !=null and specification !=''">#{specification},</if>
|
||||
#{unitOfMeasure},
|
||||
<if test="unitName != null and unitName !=''">#{unitName},</if>
|
||||
#{itemOrProduct},
|
||||
#{itemTypeId},
|
||||
<if test="itemTypeCode !=null and itemTypeCode !=''">#{itemTypeCode},</if>
|
||||
<if test="itemTypeName !=null and itemTypeName !=''">#{itemTypeName},</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">#{enableFlag},</if>
|
||||
#{safeStockFlag},
|
||||
<if test="safeStockFlag =='Y'.toString() and minStock !=null ">#{minStock},</if>
|
||||
<if test="safeStockFlag =='Y'.toString() and safeStockFlag !=null ">#{maxStock},</if>
|
||||
<if test="highValue !=null and highValue !=''">#{highValue},</if>
|
||||
<if test="remark !=null and remark !=''">#{remark},</if>
|
||||
<if test="attr1 !=null and attr1 !=''">#{attr1},</if>
|
||||
<if test="attr2 !=null and attr2 !=''">#{attr2},</if>
|
||||
<if test="attr3 !=null and attr3 !=0">#{attr3},</if>
|
||||
<if test="attr4 !=null and attr4 !=0">#{attr4},</if>
|
||||
<if test="createBy !=null and createBy !=''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<select id="checkItemNameUnique" parameterType="MdItem" resultMap="MdItemResult">
|
||||
<include refid="selectMdItemVo"/>
|
||||
where item_code = #{itemName} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMdItem" parameterType="MdItem">
|
||||
update md_item
|
||||
<set>
|
||||
<if test="itemName !=null and itemName !=''">item_name = #{itemName},</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0 "> item_type_id = #{itemTypeId},</if>
|
||||
<if test="itemTypeCode !=null and itemTypeCode !=''">item_type_code = #{itemTypeCode},</if>
|
||||
<if test="itemTypeName !=null and itemTypeName !=''">item_type_name = #{itemTypeName},</if>
|
||||
<if test="specification !=null and specification !=''">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure !=null and unitOfMeasure !=''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="unitName != null and unitName !=''">unit_name = #{unitName},</if>
|
||||
<if test="itemOrProduct !=null and itemOrProduct !=''">item_or_product = #{itemOrProduct},</if>
|
||||
<if test="enableFlag !=null and enableFlag !=''">enable_flag = #{enableFlag},</if>
|
||||
<if test="safeStockFlag !=null and safeStockFlag !=''">safe_stock_flag = #{safeStockFlag},</if>
|
||||
<if test="minStock !=null and minStock !=''">min_stock = #{minStock},</if>
|
||||
<if test="maxStock !=null and maxStock !=''">max_stock = #{maxStock},</if>
|
||||
<if test="highValue !=null and highValue !=''">high_value = #{highValue},</if>
|
||||
<if test="remark !=null and remark !=''">remark = #{remark},</if>
|
||||
<if test="attr1 !=null and attr1 !=''">attr1=#{attr1},</if>
|
||||
<if test="attr2 !=null and attr2 !=''">attr2=#{attr2},</if>
|
||||
<if test="attr3 !=null and attr3 !=0">attr3=#{attr3},</if>
|
||||
<if test="attr4 !=null and attr4 !=0">attr4=#{attr4},</if>
|
||||
<if test="updateBy !=null and updateBy !=''">update_by=#{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
<insert id="insertMdItem" parameterType="MdItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into md_item(item_code,
|
||||
item_name,
|
||||
<if test="specification != null and specification != ''">
|
||||
specification,
|
||||
</if>
|
||||
<if test="modelNumber != null and modelNumber != ''">
|
||||
model_number,
|
||||
</if>
|
||||
unit_of_measure,
|
||||
<if test="unitName != null and unitName != ''">
|
||||
unit_name,
|
||||
</if>
|
||||
item_or_product,
|
||||
item_type_id,
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">
|
||||
item_type_code,
|
||||
</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">
|
||||
item_type_name,
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
enable_flag,
|
||||
</if>
|
||||
safe_stock_flag,
|
||||
<if test="safeStockFlag == 'Y'.toString()">
|
||||
min_stock,
|
||||
</if>
|
||||
<if test="safeStockFlag == 'Y'.toString()">
|
||||
max_stock,
|
||||
</if>
|
||||
<if test="highValue != null and highValue != ''">
|
||||
high_value,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="attr1 != null and attr1 != ''">
|
||||
attr1,
|
||||
</if>
|
||||
<if test="attr2 != null and attr2 != ''">
|
||||
attr2,
|
||||
</if>
|
||||
<if test="attr3 != null and attr3 != 0">
|
||||
attr3,
|
||||
</if>
|
||||
<if test="attr4 != null and attr4 != 0">
|
||||
attr4,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
create_time)
|
||||
values (#{itemCode},
|
||||
#{itemName},
|
||||
<if test="specification != null and specification != ''">
|
||||
#{specification},
|
||||
</if>
|
||||
<if test="modelNumber != null and modelNumber != ''">
|
||||
#{modelNumber},
|
||||
</if>
|
||||
#{unitOfMeasure},
|
||||
<if test="unitName != null and unitName != ''">
|
||||
#{unitName},
|
||||
</if>
|
||||
#{itemOrProduct},
|
||||
#{itemTypeId},
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">
|
||||
#{itemTypeCode},
|
||||
</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">
|
||||
#{itemTypeName},
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
#{enableFlag},
|
||||
</if>
|
||||
#{safeStockFlag},
|
||||
<if test="safeStockFlag == 'Y'.toString() and minStock != null">
|
||||
#{minStock},
|
||||
</if>
|
||||
<if test="safeStockFlag == 'Y'.toString() and safeStockFlag != null">
|
||||
#{maxStock},
|
||||
</if>
|
||||
<if test="highValue != null and highValue != ''">
|
||||
#{highValue},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="attr1 != null and attr1 != ''">
|
||||
#{attr1},
|
||||
</if>
|
||||
<if test="attr2 != null and attr2 != ''">
|
||||
#{attr2},
|
||||
</if>
|
||||
<if test="attr3 != null and attr3 != 0">
|
||||
#{attr3},
|
||||
</if>
|
||||
<if test="attr4 != null and attr4 != 0">
|
||||
#{attr4},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
sysdate())
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMdItemById" parameterType="Long">
|
||||
delete from md_item where item_id =#{itemId}
|
||||
</delete>
|
||||
<update id="updateMdItem" parameterType="MdItem">
|
||||
update md_item
|
||||
<set>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
item_name = #{itemName},
|
||||
</if>
|
||||
<if test="itemTypeId != null and itemTypeId != 0">
|
||||
item_type_id = #{itemTypeId},
|
||||
</if>
|
||||
<if test="itemTypeCode != null and itemTypeCode != ''">
|
||||
item_type_code = #{itemTypeCode},
|
||||
</if>
|
||||
<if test="itemTypeName != null and itemTypeName != ''">
|
||||
item_type_name = #{itemTypeName},
|
||||
</if>
|
||||
<if test="specification != null and specification != ''">
|
||||
specification = #{specification},
|
||||
</if>
|
||||
<if test="modelNumber != null and modelNumber != ''">
|
||||
model_number = #{modelNumber},
|
||||
</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">
|
||||
unit_of_measure = #{unitOfMeasure},
|
||||
</if>
|
||||
<if test="unitName != null and unitName != ''">
|
||||
unit_name = #{unitName},
|
||||
</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">
|
||||
item_or_product = #{itemOrProduct},
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
enable_flag = #{enableFlag},
|
||||
</if>
|
||||
<if test="safeStockFlag != null and safeStockFlag != ''">
|
||||
safe_stock_flag = #{safeStockFlag},
|
||||
</if>
|
||||
<if test="minStock != null and minStock != ''">
|
||||
min_stock = #{minStock},
|
||||
</if>
|
||||
<if test="maxStock != null and maxStock != ''">
|
||||
max_stock = #{maxStock},
|
||||
</if>
|
||||
<if test="highValue != null and highValue != ''">
|
||||
high_value = #{highValue},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="attr1 != null and attr1 != ''">
|
||||
attr1=#{attr1},
|
||||
</if>
|
||||
<if test="attr2 != null and attr2 != ''">
|
||||
attr2=#{attr2},
|
||||
</if>
|
||||
<if test="attr3 != null and attr3 != 0">
|
||||
attr3=#{attr3},
|
||||
</if>
|
||||
<if test="attr4 != null and attr4 != 0">
|
||||
attr4=#{attr4},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by=#{updateBy},
|
||||
</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdItemByIds" parameterType="Long">
|
||||
delete from md_item where item_id in
|
||||
<foreach collection="array" item="itemId" open="(" separator="," close=")" >
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteMdItemById" parameterType="Long">
|
||||
delete
|
||||
from md_item
|
||||
where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
<delete id="deleteMdItemByIds" parameterType="Long">
|
||||
delete
|
||||
from md_item where item_id in
|
||||
<foreach collection="array" item="itemId" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -46,8 +46,8 @@ public class SysOperLog extends BaseEntity
|
||||
@Excel(name = "操作人员")
|
||||
private String operName;
|
||||
|
||||
/** 部门名称 */
|
||||
@Excel(name = "部门名称")
|
||||
/** 机构名称 */
|
||||
@Excel(name = "机构名称")
|
||||
private String deptName;
|
||||
|
||||
/** 请求url */
|
||||
|
@ -4,7 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 角色和部门关联 sys_role_dept
|
||||
* 角色和机构关联 sys_role_dept
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -13,7 +13,7 @@ public class SysRoleDept
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
/** 部门ID */
|
||||
/** 机构ID */
|
||||
private Long deptId;
|
||||
|
||||
public Long getRoleId()
|
||||
|
@ -10,7 +10,7 @@ public class SysUserOnline
|
||||
/** 会话编号 */
|
||||
private String tokenId;
|
||||
|
||||
/** 部门名称 */
|
||||
/** 机构名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 用户名称 */
|
||||
|
@ -5,98 +5,98 @@ import org.apache.ibatis.annotations.Param;
|
||||
import com.ktg.common.core.domain.entity.SysDept;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
* 机构管理 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysDeptMapper
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
* 查询机构管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
* @param dept 机构信息
|
||||
* @return 机构信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
* 根据角色ID查询机构树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param deptCheckStrictly 部门树选择项是否关联显示
|
||||
* @return 选中部门列表
|
||||
* @param deptCheckStrictly 机构树选择项是否关联显示
|
||||
* @return 选中机构列表
|
||||
*/
|
||||
public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
* 根据机构ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
* @param deptId 机构ID
|
||||
* @return 机构信息
|
||||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门
|
||||
* 根据ID查询所有子机构
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门列表
|
||||
* @param deptId 机构ID
|
||||
* @return 机构列表
|
||||
*/
|
||||
public List<SysDept> selectChildrenDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
* 根据ID查询所有子机构(正常状态)
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 子部门数
|
||||
* @param deptId 机构ID
|
||||
* @return 子机构数
|
||||
*/
|
||||
public int selectNormalChildrenDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 是否存在子节点
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int hasChildByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
* 查询机构是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
* 校验机构名称是否唯一
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param parentId 父部门ID
|
||||
* @param deptName 机构名称
|
||||
* @param parentId 父机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 新增部门信息
|
||||
* 新增机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
* 修改机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 修改所在部门正常状态
|
||||
* 修改所在机构正常状态
|
||||
*
|
||||
* @param deptIds 部门ID组
|
||||
* @param deptIds 机构ID组
|
||||
*/
|
||||
public void updateDeptStatusNormal(Long[] deptIds);
|
||||
|
||||
@ -109,9 +109,9 @@ public interface SysDeptMapper
|
||||
public int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
* 删除机构管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
@ -4,14 +4,14 @@ import java.util.List;
|
||||
import com.ktg.system.domain.SysRoleDept;
|
||||
|
||||
/**
|
||||
* 角色与部门关联表 数据层
|
||||
* 角色与机构关联表 数据层
|
||||
*
|
||||
* @author ktg
|
||||
*/
|
||||
public interface SysRoleDeptMapper
|
||||
{
|
||||
/**
|
||||
* 通过角色ID删除角色和部门关联
|
||||
* 通过角色ID删除角色和机构关联
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 结果
|
||||
@ -19,7 +19,7 @@ public interface SysRoleDeptMapper
|
||||
public int deleteRoleDeptByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量删除角色部门关联信息
|
||||
* 批量删除角色机构关联信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
@ -27,17 +27,17 @@ public interface SysRoleDeptMapper
|
||||
public int deleteRoleDept(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询部门使用数量
|
||||
* 查询机构使用数量
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectCountRoleDeptByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 批量新增角色部门信息
|
||||
* 批量新增角色机构信息
|
||||
*
|
||||
* @param roleDeptList 角色部门列表
|
||||
* @param roleDeptList 角色机构列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchRoleDept(List<SysRoleDept> roleDeptList);
|
||||
|
@ -5,24 +5,24 @@ import com.ktg.common.core.domain.TreeSelect;
|
||||
import com.ktg.common.core.domain.entity.SysDept;
|
||||
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
* 机构管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysDeptService
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
* 查询机构管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
* @param dept 机构信息
|
||||
* @return 机构信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @param depts 机构列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public List<SysDept> buildDeptTree(List<SysDept> depts);
|
||||
@ -30,86 +30,86 @@ public interface ISysDeptService
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @param depts 机构列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
* 根据角色ID查询机构树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 选中部门列表
|
||||
* @return 选中机构列表
|
||||
*/
|
||||
public List<Long> selectDeptListByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
* 根据机构ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
* @param deptId 机构ID
|
||||
* @return 机构信息
|
||||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
* 根据ID查询所有子机构(正常状态)
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 子部门数
|
||||
* @param deptId 机构ID
|
||||
* @return 子机构数
|
||||
*/
|
||||
public int selectNormalChildrenDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 是否存在部门子节点
|
||||
* 是否存在机构子节点
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean hasChildByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
* 查询机构是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
* 校验机构名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDeptNameUnique(SysDept dept);
|
||||
|
||||
/**
|
||||
* 校验部门是否有数据权限
|
||||
* 校验机构是否有数据权限
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @param deptId 机构id
|
||||
*/
|
||||
public void checkDeptDataScope(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
* 新增保存机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
* 修改保存机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
* 删除机构管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
@ -22,7 +22,7 @@ import com.ktg.system.mapper.SysRoleMapper;
|
||||
import com.ktg.system.service.ISysDeptService;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
* 机构管理 服务实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -36,10 +36,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
* 查询机构管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
* @param dept 机构信息
|
||||
* @return 机构信息集合
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
@ -51,7 +51,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @param depts 机构列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
@Override
|
||||
@ -82,7 +82,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @param depts 机构列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
@Override
|
||||
@ -93,10 +93,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
* 根据角色ID查询机构树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 选中部门列表
|
||||
* @return 选中机构列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectDeptListByRoleId(Long roleId)
|
||||
@ -106,10 +106,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
* 根据机构ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
* @param deptId 机构ID
|
||||
* @return 机构信息
|
||||
*/
|
||||
@Override
|
||||
public SysDept selectDeptById(Long deptId)
|
||||
@ -118,10 +118,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
* 根据ID查询所有子机构(正常状态)
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 子部门数
|
||||
* @param deptId 机构ID
|
||||
* @return 子机构数
|
||||
*/
|
||||
@Override
|
||||
public int selectNormalChildrenDeptById(Long deptId)
|
||||
@ -132,7 +132,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
/**
|
||||
* 是否存在子节点
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@ -143,9 +143,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
* 查询机构是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
@Override
|
||||
@ -156,9 +156,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
* 校验机构名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@ -174,9 +174,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门是否有数据权限
|
||||
* 校验机构是否有数据权限
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @param deptId 机构id
|
||||
*/
|
||||
@Override
|
||||
public void checkDeptDataScope(Long deptId)
|
||||
@ -188,15 +188,15 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
||||
if (StringUtils.isEmpty(depts))
|
||||
{
|
||||
throw new ServiceException("没有权限访问部门数据!");
|
||||
throw new ServiceException("没有权限访问机构数据!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
* 新增保存机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@ -206,16 +206,16 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||
{
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
throw new ServiceException("机构停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
* 修改保存机构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param dept 机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@ -234,16 +234,16 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||
&& !StringUtils.equals("0", dept.getAncestors()))
|
||||
{
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
// 如果该机构是启用状态,则启用该机构的所有上级机构
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改该部门的父级部门状态
|
||||
* 修改该机构的父级机构状态
|
||||
*
|
||||
* @param dept 当前部门
|
||||
* @param dept 当前机构
|
||||
*/
|
||||
private void updateParentDeptStatusNormal(SysDept dept)
|
||||
{
|
||||
@ -255,7 +255,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param deptId 被修改的部门ID
|
||||
* @param deptId 被修改的机构ID
|
||||
* @param newAncestors 新的父ID集合
|
||||
* @param oldAncestors 旧的父ID集合
|
||||
*/
|
||||
@ -273,9 +273,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
* 删除机构管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param deptId 机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -277,9 +277,9 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
{
|
||||
// 修改角色信息
|
||||
roleMapper.updateRole(role);
|
||||
// 删除角色与部门关联
|
||||
// 删除角色与机构关联
|
||||
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
|
||||
// 新增角色和部门信息(数据权限)
|
||||
// 新增角色和机构信息(数据权限)
|
||||
return insertRoleDept(role);
|
||||
}
|
||||
|
||||
@ -308,14 +308,14 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色部门信息(数据权限)
|
||||
* 新增角色机构信息(数据权限)
|
||||
*
|
||||
* @param role 角色对象
|
||||
*/
|
||||
public int insertRoleDept(SysRole role)
|
||||
{
|
||||
int rows = 1;
|
||||
// 新增角色与部门(数据权限)管理
|
||||
// 新增角色与机构(数据权限)管理
|
||||
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
|
||||
for (Long deptId : role.getDeptIds())
|
||||
{
|
||||
@ -343,7 +343,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
{
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
|
||||
// 删除角色与部门关联
|
||||
// 删除角色与机构关联
|
||||
roleDeptMapper.deleteRoleDeptByRoleId(roleId);
|
||||
return roleMapper.deleteRoleById(roleId);
|
||||
}
|
||||
@ -370,7 +370,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
}
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenu(roleIds);
|
||||
// 删除角色与部门关联
|
||||
// 删除角色与机构关联
|
||||
roleDeptMapper.deleteRoleDept(roleIds);
|
||||
return roleMapper.deleteRoleByIds(roleIds);
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="deptCode" column="dept_code" />
|
||||
<result property="deptType" column="dept_type" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="phone" column="phone" />
|
||||
@ -23,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_code, d.dept_type, d.remark, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
@ -90,6 +93,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="deptCode != null and deptCode != ''">dept_code,</if>
|
||||
<if test="deptType != null and deptType != ''">dept_type,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
@ -102,6 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
|
||||
<if test="deptType != null and deptType != ''">#{deptType},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
@ -118,6 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
|
||||
<if test="deptType != null and deptType != ''">dept_type = #{deptType},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
|
@ -1,38 +1,38 @@
|
||||
-- ----------------------------
|
||||
-- 1、部门表
|
||||
-- 1、机构表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dept;
|
||||
create table sys_dept (
|
||||
dept_id bigint(20) not null auto_increment comment '部门id',
|
||||
parent_id bigint(20) default 0 comment '父部门id',
|
||||
dept_id bigint(20) not null auto_increment comment '机构id',
|
||||
parent_id bigint(20) default 0 comment '父机构id',
|
||||
ancestors varchar(50) default '' comment '祖级列表',
|
||||
dept_name varchar(30) default '' comment '部门名称',
|
||||
dept_name varchar(30) default '' comment '机构名称',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
leader varchar(20) default null comment '负责人',
|
||||
phone varchar(11) default null comment '联系电话',
|
||||
email varchar(50) default null comment '邮箱',
|
||||
status char(1) default '0' comment '部门状态(0正常 1停用)',
|
||||
status char(1) default '0' comment '机构状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (dept_id)
|
||||
) engine=innodb auto_increment=200 comment = '部门表';
|
||||
) engine=innodb auto_increment=200 comment = '机构表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-部门表数据
|
||||
-- 初始化-机构表数据
|
||||
-- ----------------------------
|
||||
insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(103, 101, '0,100,101', '研发机构', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(104, 101, '0,100,101', '市场机构', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(105, 101, '0,100,101', '测试机构', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(106, 101, '0,100,101', '财务机构', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(107, 101, '0,100,101', '运维机构', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(108, 102, '0,100,102', '市场机构', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(109, 102, '0,100,102', '财务机构', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
@ -41,7 +41,7 @@ insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若
|
||||
drop table if exists sys_user;
|
||||
create table sys_user (
|
||||
user_id bigint(20) not null auto_increment comment '用户ID',
|
||||
dept_id bigint(20) default null comment '部门ID',
|
||||
dept_id bigint(20) default null comment '机构ID',
|
||||
user_name varchar(30) not null comment '用户账号',
|
||||
nick_name varchar(30) not null comment '用户昵称',
|
||||
user_type varchar(2) default '00' comment '用户类型(00系统用户)',
|
||||
@ -106,9 +106,9 @@ create table sys_role (
|
||||
role_name varchar(30) not null comment '角色名称',
|
||||
role_key varchar(100) not null comment '角色权限字符串',
|
||||
role_sort int(4) not null comment '显示顺序',
|
||||
data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
|
||||
data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本机构数据权限 4:本机构及以下数据权限)',
|
||||
menu_check_strictly tinyint(1) default 1 comment '菜单树选择项是否关联显示',
|
||||
dept_check_strictly tinyint(1) default 1 comment '部门树选择项是否关联显示',
|
||||
dept_check_strictly tinyint(1) default 1 comment '机构树选择项是否关联显示',
|
||||
status char(1) not null comment '角色状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
@ -165,7 +165,7 @@ insert into sys_menu values('4', '苦糖果MES官网', '0', '4', 'http://029tec.
|
||||
insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', sysdate(), '', null, '用户管理菜单');
|
||||
insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', sysdate(), '', null, '角色管理菜单');
|
||||
insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', sysdate(), '', null, '菜单管理菜单');
|
||||
insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', sysdate(), '', null, '部门管理菜单');
|
||||
insert into sys_menu values('103', '机构管理', '1', '4', 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', sysdate(), '', null, '机构管理菜单');
|
||||
insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', sysdate(), '', null, '岗位管理菜单');
|
||||
insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', sysdate(), '', null, '字典管理菜单');
|
||||
insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', sysdate(), '', null, '参数设置菜单');
|
||||
@ -201,11 +201,11 @@ insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', 1,
|
||||
insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 部门管理按钮
|
||||
insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 机构管理按钮
|
||||
insert into sys_menu values('1017', '机构查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1018', '机构新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1019', '机构修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1020', '机构删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 岗位管理按钮
|
||||
insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', sysdate(), '', null, '');
|
||||
@ -373,17 +373,17 @@ insert into sys_role_menu values ('2', '1059');
|
||||
insert into sys_role_menu values ('2', '1060');
|
||||
|
||||
-- ----------------------------
|
||||
-- 8、角色和部门关联表 角色1-N部门
|
||||
-- 8、角色和机构关联表 角色1-N机构
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role_dept;
|
||||
create table sys_role_dept (
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
dept_id bigint(20) not null comment '部门ID',
|
||||
dept_id bigint(20) not null comment '机构ID',
|
||||
primary key(role_id, dept_id)
|
||||
) engine=innodb comment = '角色和部门关联表';
|
||||
) engine=innodb comment = '角色和机构关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色和部门关联表数据
|
||||
-- 初始化-角色和机构关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role_dept values ('2', '100');
|
||||
insert into sys_role_dept values ('2', '101');
|
||||
@ -420,7 +420,7 @@ create table sys_oper_log (
|
||||
request_method varchar(10) default '' comment '请求方式',
|
||||
operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)',
|
||||
oper_name varchar(50) default '' comment '操作人员',
|
||||
dept_name varchar(50) default '' comment '部门名称',
|
||||
dept_name varchar(50) default '' comment '机构名称',
|
||||
oper_url varchar(255) default '' comment '请求URL',
|
||||
oper_ip varchar(128) default '' comment '主机地址',
|
||||
oper_location varchar(255) default '' comment '操作地点',
|
||||
|
Loading…
Reference in New Issue
Block a user