系统代码上传

This commit is contained in:
lvleigang 2024-04-03 17:02:08 +08:00
parent 8df34a75b7
commit a4ff79ce37
45 changed files with 3074 additions and 226 deletions

View File

@ -37,7 +37,7 @@
<build>
<finalName>kangarooDataCenterV3</finalName>
<finalName>kangarooDataCenter</finalName>
</build>
</project>

View File

@ -1,11 +1,11 @@
#应用名
spring.application.name=kangarooDataCenterV3
spring.application.name=kangarooDataCenter
#端口
server.port=9999
#编码集
server.tomcat.uri-encoding=utf-8
#工程访问名称
server.servlet.context-path=/kangarooDataCenterV3
server.servlet.context-path=/kangarooDataCenter
#json日期格式化
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8

View File

@ -19,7 +19,7 @@ public class SysButtonConfigEntity extends BaseEntity {
/** 所属菜单ID */
private String menuId;
/** 图标 */
private String icoName;
private String iconName;
/** 样式 */
private String styles;
/** 按钮事件 */
@ -29,7 +29,10 @@ public class SysButtonConfigEntity extends BaseEntity {
/** 公司id */
private String companyId;
/**
* 是否选中
*/
private boolean check;
public String getCode() {
return code;
}
@ -62,12 +65,12 @@ public class SysButtonConfigEntity extends BaseEntity {
this.menuId = menuId;
}
public String getIcoName() {
return icoName;
public String getIconName() {
return iconName;
}
public void setIcoName(String icoName) {
this.icoName = icoName;
public void setIconName(String iconName) {
this.iconName = iconName;
}
public String getStyles() {
@ -102,5 +105,12 @@ public class SysButtonConfigEntity extends BaseEntity {
this.companyId = companyId;
}
public boolean isCheck() {
return check;
}
public void setCheck(boolean check) {
this.check = check;
}
}

View File

@ -8,7 +8,7 @@
<result property="nameCh" column="name_ch" jdbcType="VARCHAR"/>
<result property="nameEn" column="name_en" jdbcType="VARCHAR"/>
<result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
<result property="icoName" column="ico_name" jdbcType="VARCHAR"/>
<result property="iconName" column="icon_name" jdbcType="VARCHAR"/>
<result property="styles" column="styles" jdbcType="VARCHAR"/>
<result property="btnFunction" column="btn_function" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
@ -28,7 +28,7 @@
,name_ch
,name_en
,menu_id
,ico_name
,icon_name
,styles
,btn_function
,remark
@ -58,7 +58,7 @@
<if test="nameCh != null and nameCh != ''"> and name_ch = #{nameCh} </if>
<if test="nameEn != null and nameEn != ''"> and name_en = #{nameEn} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="icoName != null and icoName != ''"> and ico_name = #{icoName} </if>
<if test="iconName != null and iconName != ''"> and icon_name = #{iconName} </if>
<if test="styles != null and styles != ''"> and styles = #{styles} </if>
<if test="btnFunction != null and btnFunction != ''"> and btn_function = #{btnFunction} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
@ -85,7 +85,7 @@
<if test="nameCh != null and nameCh != ''"> and name_ch = #{nameCh} </if>
<if test="nameEn != null and nameEn != ''"> and name_en = #{nameEn} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="icoName != null and icoName != ''"> and ico_name = #{icoName} </if>
<if test="iconName != null and iconName != ''"> and icon_name = #{iconName} </if>
<if test="styles != null and styles != ''"> and styles = #{styles} </if>
<if test="btnFunction != null and btnFunction != ''"> and btn_function = #{btnFunction} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
@ -111,8 +111,8 @@
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="nameCh != null and nameCh != ''"> and name_ch like concat('%',#{nameCh},'%') </if>
<if test="nameEn != null and nameEn != ''"> and name_en like concat('%',#{nameEn},'%') </if>
<if test="menuId != null and menuId != ''"> and menu_id like concat('%',#{menuId},'%') </if>
<if test="icoName != null and icoName != ''"> and ico_name like concat('%',#{icoName},'%') </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="iconName != null and iconName != ''"> and icon_name like concat('%',#{iconName},'%') </if>
<if test="styles != null and styles != ''"> and styles like concat('%',#{styles},'%') </if>
<if test="btnFunction != null and btnFunction != ''"> and btn_function like concat('%',#{btnFunction},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
@ -141,7 +141,7 @@
<if test="nameCh != null and nameCh != ''"> or name_ch = #{nameCh} </if>
<if test="nameEn != null and nameEn != ''"> or name_en = #{nameEn} </if>
<if test="menuId != null and menuId != ''"> or menu_id = #{menuId} </if>
<if test="icoName != null and icoName != ''"> or ico_name = #{icoName} </if>
<if test="iconName != null and iconName != ''"> or icon_name = #{iconName} </if>
<if test="styles != null and styles != ''"> or styles = #{styles} </if>
<if test="btnFunction != null and btnFunction != ''"> or btn_function = #{btnFunction} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
@ -168,7 +168,7 @@
<if test="nameCh != null and nameCh != ''"> name_ch , </if>
<if test="nameEn != null and nameEn != ''"> name_en , </if>
<if test="menuId != null and menuId != ''"> menu_id , </if>
<if test="icoName != null and icoName != ''"> ico_name , </if>
<if test="iconName != null and iconName != ''"> icon_name , </if>
<if test="styles != null and styles != ''"> styles , </if>
<if test="btnFunction != null and btnFunction != ''"> btn_function , </if>
<if test="remark != null and remark != ''"> remark , </if>
@ -189,7 +189,7 @@
<if test="nameCh != null and nameCh != ''"> #{nameCh} ,</if>
<if test="nameEn != null and nameEn != ''"> #{nameEn} ,</if>
<if test="menuId != null and menuId != ''"> #{menuId} ,</if>
<if test="icoName != null and icoName != ''"> #{icoName} ,</if>
<if test="iconName != null and iconName != ''"> #{iconName} ,</if>
<if test="styles != null and styles != ''"> #{styles} ,</if>
<if test="btnFunction != null and btnFunction != ''"> #{btnFunction} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
@ -207,25 +207,25 @@
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_button_config(code, name_ch, name_en, menu_id, ico_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
insert into sys_button_config(code, name_ch, name_en, menu_id, icon_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.nameCh},#{entity.nameEn},#{entity.menuId},#{entity.icoName},#{entity.styles},#{entity.btnFunction},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
(#{entity.code},#{entity.nameCh},#{entity.nameEn},#{entity.menuId},#{entity.iconName},#{entity.styles},#{entity.btnFunction},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_button_config(code, name_ch, name_en, menu_id, ico_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
insert into sys_button_config(code, name_ch, name_en, menu_id, icon_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.nameCh},#{entity.nameEn},#{entity.menuId},#{entity.icoName},#{entity.styles},#{entity.btnFunction},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.code},#{entity.nameCh},#{entity.nameEn},#{entity.menuId},#{entity.iconName},#{entity.styles},#{entity.btnFunction},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
code = values(code),
name_ch = values(name_ch),
name_en = values(name_en),
menu_id = values(menu_id),
ico_name = values(ico_name),
icon_name = values(icon_name),
styles = values(styles),
btn_function = values(btn_function),
remark = values(remark),
@ -245,7 +245,7 @@ update sys_button_config set
<if test="nameCh != null and nameCh != ''"> name_ch = #{nameCh},</if>
<if test="nameEn != null and nameEn != ''"> name_en = #{nameEn},</if>
<if test="menuId != null and menuId != ''"> menu_id = #{menuId},</if>
<if test="icoName != null and icoName != ''"> ico_name = #{icoName},</if>
<if test="iconName != null and iconName != ''"> icon_name = #{iconName},</if>
<if test="styles != null and styles != ''"> styles = #{styles},</if>
<if test="btnFunction != null and btnFunction != ''"> btn_function = #{btnFunction},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
@ -274,7 +274,7 @@ update sys_button_config set sts= 'N' ,modify_time = #{modify_time},modify_user
<if test="nameCh != null and nameCh != ''"> and name_ch = #{nameCh} </if>
<if test="nameEn != null and nameEn != ''"> and name_en = #{nameEn} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="icoName != null and icoName != ''"> and ico_name = #{icoName} </if>
<if test="iconName != null and iconName != ''"> and icon_name = #{iconName} </if>
<if test="styles != null and styles != ''"> and styles = #{styles} </if>
<if test="btnFunction != null and btnFunction != ''"> and btn_function = #{btnFunction} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>

View File

@ -1,7 +1,10 @@
package com.hzya.frame.sys.buttonConfig.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 按钮配置表(SysButtonConfig)表服务接口
*
@ -9,4 +12,58 @@ import com.hzya.frame.basedao.service.IBaseService;
* @since 2024-03-26 15:23:01
*/
public interface ISysButtonConfigService extends IBaseService<SysButtonConfigEntity, String>{
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询按钮列表分页
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询按钮列表
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存按钮
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity saveEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取按钮
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改按钮
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity updateEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除按钮
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
}

View File

@ -1,12 +1,22 @@
package com.hzya.frame.sys.buttonConfig.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity;
import com.hzya.frame.sys.buttonConfig.dao.ISysButtonConfigDao;
import com.hzya.frame.sys.buttonConfig.service.ISysButtonConfigService;
import org.springframework.stereotype.Service;
import com.hzya.frame.sys.popedomOperate.dao.ISysPopedomOperateDao;
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import javax.annotation.Resource;
import java.util.List;
/**
* 按钮配置表(SysButtonConfig)表服务实现类
*
@ -17,10 +27,164 @@ import com.hzya.frame.basedao.service.impl.BaseService;
public class SysButtonConfigServiceImpl extends BaseService<SysButtonConfigEntity, String> implements ISysButtonConfigService {
private ISysButtonConfigDao sysButtonConfigDao;
@Autowired
@Resource
private ISysPopedomOperateDao sysPopedomOperateDao;
@Autowired
public void setSysButtonConfigDao(ISysButtonConfigDao dao) {
this.sysButtonConfigDao = dao;
this.dao = dao;
}
/**
* @Author lvleigang
* @Description 查询按钮列表分页
* @Date 11:52 上午 2024/3/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
//判断分页
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysButtonConfigEntity> sysApplicationVos = sysButtonConfigDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(sysApplicationVos);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @Author lvleigang
* @Description 查询按钮列表
* @Date 11:52 上午 2024/3/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
if(entity == null ){
entity = new SysButtonConfigEntity();
}
List<SysButtonConfigEntity> sysApplicationVos = sysButtonConfigDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationVos);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存按钮
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getNameCh() == null || "".equals(entity.getNameCh())) {
return BaseResult.getFailureMessageEntity("请先输入按钮名称");
}
if (entity.getMenuId() == null || "".equals(entity.getMenuId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setCreate();
//保存
sysButtonConfigDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存按钮成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取按钮
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysButtonConfigDao.get(entity.getId());
if(entity == null ){
return BaseResult.getFailureMessageEntity("获取按钮失败");
}
return BaseResult.getSuccessMessageEntity("获取按钮成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改按钮
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getNameCh() == null || "".equals(entity.getNameCh())) {
return BaseResult.getFailureMessageEntity("请先输入按钮名称");
}
if (entity.getMenuId() == null || "".equals(entity.getMenuId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
//保存
sysButtonConfigDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改按钮成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除按钮
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
SysButtonConfigEntity entity = getData("jsonStr", jsonObject, SysButtonConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if(!checkUse(entity)){
return BaseResult.getFailureMessageEntity("当前按钮已经使用,不允许删除");
}
entity.setUpdate();
sysButtonConfigDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除按钮成功");
}
/**
* @Author lvleigang
* @Description 校验按钮是否使用 目前只校验用户按钮按钮权限配置下的
* @Date 3:27 下午 2024/3/27
* @param entity
* @return boolean
**/
private boolean checkUse(SysButtonConfigEntity entity) {
SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity();
sysPopedomOperateEntity.setOperate(entity.getId());
if(sysPopedomOperateDao.getCount(sysPopedomOperateEntity) > 0){
return false;
}
return true;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.dictionaryshop.dao;
import com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 数据字典表(sys_dictionaryshop: table)表数据库访问层
*
* @author makejava
* @since 2024-04-03 14:22:47
*/
public interface ISysDictionaryshopDao extends IBaseDao<SysDictionaryshopEntity, String> {
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.sys.dictionaryshop.dao.impl;
import com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity;
import com.hzya.frame.sys.dictionaryshop.dao.ISysDictionaryshopDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 数据字典表(SysDictionaryshop)表数据库访问层
*
* @author makejava
* @since 2024-04-03 14:22:47
*/
@Repository(value = "SysDictionaryshopDaoImpl")
public class SysDictionaryshopDaoImpl extends MybatisGenericDao<SysDictionaryshopEntity, String> implements ISysDictionaryshopDao {
}

View File

@ -0,0 +1,126 @@
package com.hzya.frame.sys.dictionaryshop.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 数据字典表(SysDictionaryshop)实体类
*
* @author makejava
* @since 2024-04-03 14:22:47
*/
public class SysDictionaryshopEntity extends BaseEntity {
/**
* 表名
*/
private String tabName;
/**
* 列名
*/
private String columnName;
/**
* 列说明
*/
private String columnContent;
/**
* 列值
*/
private String columnValue;
/**
* 列数字值用于比较数据字典大小
*/
private Long columnNumValue;
/**
* 如果数据字典上下级通过连接上级id当前表id
*/
private Long upId;
/**
* 备注
*/
private String memo;
/**
* 使用状态,1 使用2 不使用
*/
private String usedSts;
/**
* 公司id
*/
private String companyId;
public String getTabName() {
return tabName;
}
public void setTabName(String tabName) {
this.tabName = tabName;
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnContent() {
return columnContent;
}
public void setColumnContent(String columnContent) {
this.columnContent = columnContent;
}
public String getColumnValue() {
return columnValue;
}
public void setColumnValue(String columnValue) {
this.columnValue = columnValue;
}
public Long getColumnNumValue() {
return columnNumValue;
}
public void setColumnNumValue(Long columnNumValue) {
this.columnNumValue = columnNumValue;
}
public Long getUpId() {
return upId;
}
public void setUpId(Long upId) {
this.upId = upId;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getUsedSts() {
return usedSts;
}
public void setUsedSts(String usedSts) {
this.usedSts = usedSts;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
}

View File

@ -0,0 +1,309 @@
<?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">
<mapper namespace="com.hzya.frame.sys.dictionaryshop.dao.impl.SysDictionaryshopDaoImpl">
<resultMap id="get-SysDictionaryshopEntity-result"
type="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="tabName" column="tab_name" jdbcType="VARCHAR"/>
<result property="columnName" column="column_name" jdbcType="VARCHAR"/>
<result property="columnContent" column="column_content" jdbcType="VARCHAR"/>
<result property="columnValue" column="column_value" jdbcType="VARCHAR"/>
<result property="columnNumValue" column="column_num_value" jdbcType="INTEGER"/>
<result property="upId" column="up_id" jdbcType="INTEGER"/>
<result property="memo" column="memo" jdbcType="VARCHAR"/>
<result property="usedSts" column="used_sts" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysDictionaryshopEntity_Base_Column_List">
id
,tab_name
,column_name
,column_content
,column_value
,column_num_value
,up_id
,memo
,used_sts
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysDictionaryshopEntity-result"
parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
select
<include refid="SysDictionaryshopEntity_Base_Column_List"/>
from sys_dictionaryshop
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="tabName != null and tabName != ''">and tab_name = #{tabName}</if>
<if test="columnName != null and columnName != ''">and column_name = #{columnName}</if>
<if test="columnContent != null and columnContent != ''">and column_content = #{columnContent}</if>
<if test="columnValue != null and columnValue != ''">and column_value = #{columnValue}</if>
<if test="columnNumValue != null">and column_num_value = #{columnNumValue}</if>
<if test="upId != null">and up_id = #{upId}</if>
<if test="memo != null and memo != ''">and memo = #{memo}</if>
<if test="usedSts != null and usedSts != ''">and used_sts = #{usedSts}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
select count(1) from sys_dictionaryshop
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="tabName != null and tabName != ''">and tab_name = #{tabName}</if>
<if test="columnName != null and columnName != ''">and column_name = #{columnName}</if>
<if test="columnContent != null and columnContent != ''">and column_content = #{columnContent}</if>
<if test="columnValue != null and columnValue != ''">and column_value = #{columnValue}</if>
<if test="columnNumValue != null">and column_num_value = #{columnNumValue}</if>
<if test="upId != null">and up_id = #{upId}</if>
<if test="memo != null and memo != ''">and memo = #{memo}</if>
<if test="usedSts != null and usedSts != ''">and used_sts = #{usedSts}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysDictionaryshopEntity-result"
parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
select
<include refid="SysDictionaryshopEntity_Base_Column_List"/>
from sys_dictionaryshop
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="tabName != null and tabName != ''">and tab_name like concat('%',#{tabName},'%')</if>
<if test="columnName != null and columnName != ''">and column_name like concat('%',#{columnName},'%')</if>
<if test="columnContent != null and columnContent != ''">and column_content like
concat('%',#{columnContent},'%')
</if>
<if test="columnValue != null and columnValue != ''">and column_value like concat('%',#{columnValue},'%')
</if>
<if test="columnNumValue != null">and column_num_value like concat('%',#{columnNumValue},'%')</if>
<if test="upId != null">and up_id like concat('%',#{upId},'%')</if>
<if test="memo != null and memo != ''">and memo like concat('%',#{memo},'%')</if>
<if test="usedSts != null and usedSts != ''">and used_sts like concat('%',#{usedSts},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysDictionaryshopentity_list_or" resultMap="get-SysDictionaryshopEntity-result"
parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
select
<include refid="SysDictionaryshopEntity_Base_Column_List"/>
from sys_dictionaryshop
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="tabName != null and tabName != ''">or tab_name = #{tabName}</if>
<if test="columnName != null and columnName != ''">or column_name = #{columnName}</if>
<if test="columnContent != null and columnContent != ''">or column_content = #{columnContent}</if>
<if test="columnValue != null and columnValue != ''">or column_value = #{columnValue}</if>
<if test="columnNumValue != null">or column_num_value = #{columnNumValue}</if>
<if test="upId != null">or up_id = #{upId}</if>
<if test="memo != null and memo != ''">or memo = #{memo}</if>
<if test="usedSts != null and usedSts != ''">or used_sts = #{usedSts}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity"
keyProperty="id" useGeneratedKeys="true">
insert into sys_dictionaryshop(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="tabName != null and tabName != ''">tab_name ,</if>
<if test="columnName != null and columnName != ''">column_name ,</if>
<if test="columnContent != null and columnContent != ''">column_content ,</if>
<if test="columnValue != null and columnValue != ''">column_value ,</if>
<if test="columnNumValue != null">column_num_value ,</if>
<if test="upId != null">up_id ,</if>
<if test="memo != null and memo != ''">memo ,</if>
<if test="usedSts != null and usedSts != ''">used_sts ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="tabName != null and tabName != ''">#{tabName} ,</if>
<if test="columnName != null and columnName != ''">#{columnName} ,</if>
<if test="columnContent != null and columnContent != ''">#{columnContent} ,</if>
<if test="columnValue != null and columnValue != ''">#{columnValue} ,</if>
<if test="columnNumValue != null">#{columnNumValue} ,</if>
<if test="upId != null">#{upId} ,</if>
<if test="memo != null and memo != ''">#{memo} ,</if>
<if test="usedSts != null and usedSts != ''">#{usedSts} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_dictionaryshop a WHERE
a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_dictionaryshop(tab_name, column_name, column_content, column_value, column_num_value, up_id,
memo, used_sts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.tabName},#{entity.columnName},#{entity.columnContent},#{entity.columnValue},#{entity.columnNumValue},#{entity.upId},#{entity.memo},#{entity.usedSts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_dictionaryshop(tab_name, column_name, column_content, column_value, column_num_value, up_id,
memo, used_sts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.tabName},#{entity.columnName},#{entity.columnContent},#{entity.columnValue},#{entity.columnNumValue},#{entity.upId},#{entity.memo},#{entity.usedSts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
tab_name = values(tab_name),
column_name = values(column_name),
column_content = values(column_content),
column_value = values(column_value),
column_num_value = values(column_num_value),
up_id = values(up_id),
memo = values(memo),
used_sts = values(used_sts),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
update sys_dictionaryshop set
<trim suffix="" suffixOverrides=",">
<if test="tabName != null and tabName != ''">tab_name = #{tabName},</if>
<if test="columnName != null and columnName != ''">column_name = #{columnName},</if>
<if test="columnContent != null and columnContent != ''">column_content = #{columnContent},</if>
<if test="columnValue != null and columnValue != ''">column_value = #{columnValue},</if>
<if test="columnNumValue != null">column_num_value = #{columnNumValue},</if>
<if test="upId != null">up_id = #{upId},</if>
<if test="memo != null and memo != ''">memo = #{memo},</if>
<if test="usedSts != null and usedSts != ''">used_sts = #{usedSts},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
update sys_dictionaryshop set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity">
update sys_dictionaryshop set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="tabName != null and tabName != ''">and tab_name = #{tabName}</if>
<if test="columnName != null and columnName != ''">and column_name = #{columnName}</if>
<if test="columnContent != null and columnContent != ''">and column_content = #{columnContent}</if>
<if test="columnValue != null and columnValue != ''">and column_value = #{columnValue}</if>
<if test="columnNumValue != null">and column_num_value = #{columnNumValue}</if>
<if test="upId != null">and up_id = #{upId}</if>
<if test="memo != null and memo != ''">and memo = #{memo}</if>
<if test="usedSts != null and usedSts != ''">and used_sts = #{usedSts}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_dictionaryshop where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,33 @@
package com.hzya.frame.sys.dictionaryshop.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 数据字典表(SysDictionaryshop)表服务接口
*
* @author makejava
* @since 2024-04-03 14:22:48
*/
public interface ISysDictionaryshopService extends IBaseService<SysDictionaryshopEntity, String> {
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询数据字典列表分页
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询数据字典列表
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,75 @@
package com.hzya.frame.sys.dictionaryshop.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity;
import com.hzya.frame.sys.dictionaryshop.entity.SysDictionaryshopEntity;
import com.hzya.frame.sys.dictionaryshop.dao.ISysDictionaryshopDao;
import com.hzya.frame.sys.dictionaryshop.service.ISysDictionaryshopService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 数据字典表(SysDictionaryshop)表服务实现类
*
* @author makejava
* @since 2024-04-03 14:22:48
*/
@Service(value = "sysDictionaryshopService")
public class SysDictionaryshopServiceImpl extends BaseService<SysDictionaryshopEntity, String> implements ISysDictionaryshopService {
private ISysDictionaryshopDao sysDictionaryshopDao;
@Autowired
public void setSysDictionaryshopDao(ISysDictionaryshopDao dao) {
this.sysDictionaryshopDao = dao;
this.dao = dao;
}
/**
* @Author lvleigang
* @Description 查询分页
* @Date 11:52 上午 2024/3/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysDictionaryshopEntity entity = getData("jsonStr", jsonObject, SysDictionaryshopEntity.class);
//判断分页
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysDictionaryshopEntity> list = sysDictionaryshopDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @Author lvleigang
* @Description 查询列表
* @Date 11:52 上午 2024/3/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject) {
SysDictionaryshopEntity entity = getData("jsonStr", jsonObject, SysDictionaryshopEntity.class);
if(entity == null ){
entity = new SysDictionaryshopEntity();
}
List<SysDictionaryshopEntity> list = sysDictionaryshopDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.homeComponent.dao;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 首页组件表(sys_home_component: table)表数据库访问层
*
* @author makejava
* @since 2024-04-02 11:57:12
*/
public interface ISysHomeComponentDao extends IBaseDao<SysHomeComponentEntity, String> {
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.sys.homeComponent.dao.impl;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import com.hzya.frame.sys.homeComponent.dao.ISysHomeComponentDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 首页组件表(SysHomeComponent)表数据库访问层
*
* @author makejava
* @since 2024-04-02 11:57:12
*/
@Repository(value = "SysHomeComponentDaoImpl")
public class SysHomeComponentDaoImpl extends MybatisGenericDao<SysHomeComponentEntity, String> implements ISysHomeComponentDao {
}

View File

@ -0,0 +1,88 @@
package com.hzya.frame.sys.homeComponent.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 首页组件表(SysHomeComponent)实体类
*
* @author makejava
* @since 2024-04-02 11:57:12
*/
public class SysHomeComponentEntity extends BaseEntity {
/**
* 组件名称
*/
private String name;
/**
* 组件编码
*/
private String code;
/**
* 状态0 启用 1 停用
*/
private String state;
/**
* 备注
*/
private String remark;
/**
* 公司id
*/
private String companyId;
/**
* 是否选中
*/
private boolean check;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public boolean isCheck() {
return check;
}
public void setCheck(boolean check) {
this.check = check;
}
}

View File

@ -0,0 +1,266 @@
<?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">
<mapper namespace="com.hzya.frame.sys.homeComponent.dao.impl.SysHomeComponentDaoImpl">
<resultMap id="get-SysHomeComponentEntity-result"
type="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysHomeComponentEntity_Base_Column_List">
id
,name
,code
,state
,remark
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysHomeComponentEntity-result"
parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
select
<include refid="SysHomeComponentEntity_Base_Column_List"/>
from sys_home_component
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
select count(1) from sys_home_component
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysHomeComponentEntity-result"
parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
select
<include refid="SysHomeComponentEntity_Base_Column_List"/>
from sys_home_component
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
<if test="code != null and code != ''">and code like concat('%',#{code},'%')</if>
<if test="state != null and state != ''">and state like concat('%',#{state},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysHomeComponententity_list_or" resultMap="get-SysHomeComponentEntity-result"
parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
select
<include refid="SysHomeComponentEntity_Base_Column_List"/>
from sys_home_component
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="name != null and name != ''">or name = #{name}</if>
<if test="code != null and code != ''">or code = #{code}</if>
<if test="state != null and state != ''">or state = #{state}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity"
keyProperty="" useGeneratedKeys="true">
insert into sys_home_component(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="code != null and code != ''">code ,</if>
<if test="state != null and state != ''">state ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="code != null and code != ''">#{code} ,</if>
<if test="state != null and state != ''">#{state} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_home_component a WHERE
a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
insert into sys_home_component(id, name, code, state, remark, sorts, create_user_id, create_time,
modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.id},#{entity.name},#{entity.code},#{entity.state},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
insert into sys_home_component(id, name, code, state, remark, sorts, create_user_id, create_time,
modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.id},#{entity.name},#{entity.code},#{entity.state},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
id = values(id),
name = values(name),
code = values(code),
state = values(state),
remark = values(remark),
sorts = values(sorts),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
update sys_home_component set
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id = #{id},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="code != null and code != ''">code = #{code},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
</trim>
where = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
update sys_home_component set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity">
update sys_home_component set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_home_component where = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,13 @@
package com.hzya.frame.sys.homeComponent.service;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 首页组件表(SysHomeComponent)表服务接口
*
* @author makejava
* @since 2024-04-02 11:57:13
*/
public interface ISysHomeComponentService extends IBaseService<SysHomeComponentEntity, String> {
}

View File

@ -0,0 +1,29 @@
package com.hzya.frame.sys.homeComponent.service.impl;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import com.hzya.frame.sys.homeComponent.dao.ISysHomeComponentDao;
import com.hzya.frame.sys.homeComponent.service.ISysHomeComponentService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 首页组件表(SysHomeComponent)表服务实现类
*
* @author makejava
* @since 2024-04-02 11:57:13
*/
@Service(value = "sysHomeComponentService")
public class SysHomeComponentServiceImpl extends BaseService<SysHomeComponentEntity, String> implements ISysHomeComponentService {
private ISysHomeComponentDao sysHomeComponentDao;
@Autowired
public void setSysHomeComponentDao(ISysHomeComponentDao dao) {
this.sysHomeComponentDao = dao;
this.dao = dao;
}
}

View File

@ -4,10 +4,22 @@ import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.login.ILoginService;
import com.hzya.frame.sys.organ.dao.ISysOrganDao;
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
import com.hzya.frame.sys.user.dao.ISysUserDao;
import com.hzya.frame.sys.user.entity.SysUserEntity;
import com.hzya.frame.sys.userCompany.dao.ISysUserCompanyDao;
import com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.checkerframework.checker.units.qual.C;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @Description 登录
* @Author xiangerlin
@ -15,24 +27,72 @@ import org.springframework.stereotype.Service;
**/
@Service(value = "loginService")
public class LoginServiceImpl implements ILoginService {
@Resource
private ISysUserDao sysUserDao;
@Resource
private ISysOrganDao sysOrganDao;
/**
* 登录
*
* @param requestJsonData
* @param jsonObject
* @return
* @throws Exception
*/
@Override
public JsonResultEntity doLogin(JSONObject requestJsonData) throws Exception {
public JsonResultEntity doLogin(JSONObject jsonObject) throws Exception {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("请输入用户名或密码");
}
if (entity.getPassword() == null || "".equals(entity.getPassword())) {
return BaseResult.getFailureMessageEntity("请输入用户名或密码");
}
if (entity.getLoginCode() == null || "".equals(entity.getLoginCode())) {
return BaseResult.getFailureMessageEntity("请输入用户名或密码");
}
entity.setPassword(AESUtil.encrypt(entity.getLoginCode() + "-" + entity.getPassword()));
SysUserEntity sysUserEntity = sysUserDao.queryOne(entity);
if (sysUserEntity.getId() == null || "".equals(sysUserEntity.getId())) {
return BaseResult.getFailureMessageEntity("用户名或密码错误");
}
//登录
StpUtil.login("1");
StpUtil.login(sysUserEntity.getId());
//获取token
SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
String token = tokenInfo.getTokenValue();
//获取公司
SysOrganEntity sysOrganEntity = new SysOrganEntity();
sysOrganEntity.setUserId(sysUserEntity.getId());
List<SysOrganEntity> sysOrganEntities = sysOrganDao.queryUserCompany(sysOrganEntity);
//返回值
JSONObject res = new JSONObject();
res.put("token", token);
res.put("token", token);
res.put("userInfo", sysUserEntity);
res.put("company", sysOrganEntities);
return BaseResult.getSuccessMessageEntity("登录成功", res);
}
protected <T> T getData(String key, JSONObject jsonObject, Class<T> clz) {
if (checkStr(jsonObject.getString(key))) {
return jsonObject.getJSONObject(key).toJavaObject(clz);
}
return null;
}
/**
* @param str
* @return void
* @Author lvleigang
* @Description 校验字符串
* @Date 11:41 上午 2022/12/7
**/
protected Boolean checkStr(String str) {
Boolean flag = true;
if (str == null || "".equals(str)) {
flag = false;
}
return flag;
}
}

View File

@ -3,6 +3,8 @@ package com.hzya.frame.sys.menuConfig.dao;
import com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 系统菜单表(sys_menu_config: table)表数据库访问层
*
@ -11,5 +13,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface ISysMenuConfigDao extends IBaseDao<SysMenuConfigEntity, String> {
List<SysMenuConfigEntity> queryUserMenu(SysMenuConfigEntity sysMenuConfigEntity);
}

View File

@ -2,9 +2,12 @@ package com.hzya.frame.sys.menuConfig.dao.impl;
import com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity;
import com.hzya.frame.sys.menuConfig.dao.ISysMenuConfigDao;
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 系统菜单表(SysMenuConfig)表数据库访问层
*
@ -14,5 +17,10 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
@Repository(value = "SysMenuConfigDaoImpl")
public class SysMenuConfigDaoImpl extends MybatisGenericDao<SysMenuConfigEntity, String> implements ISysMenuConfigDao {
@Override
public List<SysMenuConfigEntity> queryUserMenu(SysMenuConfigEntity sysMenuConfigEntity) {
List<SysMenuConfigEntity> o = super.query(getSqlIdPrifx() + "queryUserMenu", sysMenuConfigEntity);
return o;
}
}

View File

@ -13,6 +13,7 @@ import java.util.List;
*/
public class ModuleVo {
/** 主键ID */
private String id;
/** 路由地址 */
@ -21,14 +22,6 @@ public class ModuleVo {
private String name;
/** 一级Layout 二级 ParntView 三级component */
private String component;
/** 隐藏 */
private boolean hidden;
/** redirevt */
private String redirect;
/** 标题 */
private String label;
/** alwaysShow */
private boolean alwaysShow;
/** alwaysShow */
private JSONObject meta;
//下级菜单
@ -66,30 +59,6 @@ public class ModuleVo {
this.component = component;
}
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public String getRedirect() {
return redirect;
}
public void setRedirect(String redirect) {
this.redirect = redirect;
}
public boolean isAlwaysShow() {
return alwaysShow;
}
public void setAlwaysShow(boolean alwaysShow) {
this.alwaysShow = alwaysShow;
}
public JSONObject getMeta() {
return meta;
}
@ -97,7 +66,6 @@ public class ModuleVo {
public void setMeta(JSONObject meta) {
this.meta = meta;
}
public List<ModuleVo> getChildren() {
return children;
}
@ -105,12 +73,4 @@ public class ModuleVo {
public void setChildren(List<ModuleVo> children) {
this.children = children;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -1,6 +1,7 @@
package com.hzya.frame.sys.menuConfig.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.web.entity.BaseEntity;
@ -17,13 +18,9 @@ public class SysMenuConfigEntity extends BaseEntity {
*/
private String parentMenuId;
/**
* 所属菜单层级
* 上级菜单
*/
private String menuEntity;
/**
* 菜单深度
*/
private Long depth;
private String parentMenuName;
/**
* 菜单名称
*/
@ -49,7 +46,7 @@ public class SysMenuConfigEntity extends BaseEntity {
*/
private String remark;
/**
* 是否可见1可见2不可见
* 状态: 0启用 1 停用
*/
private String visibles;
/**
@ -60,8 +57,18 @@ public class SysMenuConfigEntity extends BaseEntity {
* 公司id
*/
private String companyId;
/**
* 用户id
*/
private String userId;
/**
* 是否选中
*/
private boolean check;
private String label;
//子级
private List<SysMenuConfigEntity> children;
public String getParentMenuId() {
return parentMenuId;
}
@ -70,22 +77,6 @@ public class SysMenuConfigEntity extends BaseEntity {
this.parentMenuId = parentMenuId;
}
public String getMenuEntity() {
return menuEntity;
}
public void setMenuEntity(String menuEntity) {
this.menuEntity = menuEntity;
}
public Long getDepth() {
return depth;
}
public void setDepth(Long depth) {
this.depth = depth;
}
public String getMenuName() {
return menuName;
}
@ -158,5 +149,45 @@ public class SysMenuConfigEntity extends BaseEntity {
this.companyId = companyId;
}
public List<SysMenuConfigEntity> getChildren() {
return children;
}
public void setChildren(List<SysMenuConfigEntity> children) {
this.children = children;
}
public boolean isCheck() {
return check;
}
public void setCheck(boolean check) {
this.check = check;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getParentMenuName() {
return parentMenuName;
}
public void setParentMenuName(String parentMenuName) {
this.parentMenuName = parentMenuName;
}
}

View File

@ -5,8 +5,6 @@
<resultMap id="get-SysMenuConfigEntity-result" type="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="parentMenuId" column="parent_menu_id" jdbcType="VARCHAR"/>
<result property="menuEntity" column="menu_entity" jdbcType="VARCHAR"/>
<result property="depth" column="depth" jdbcType="INTEGER"/>
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
<result property="menuEnglishName" column="menu_english_name" jdbcType="VARCHAR"/>
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
@ -23,14 +21,13 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="parentMenuName" column="parent_menu_name" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysMenuConfigEntity_Base_Column_List">
id
,parent_menu_id
,menu_entity
,depth
,menu_name
,menu_name
,menu_english_name
,menu_icon
,route
@ -50,8 +47,28 @@
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysMenuConfigEntity-result">
select
<include refid="SysMenuConfigEntity_Base_Column_List" />
from sys_menu_config where id = #{ id } and sts='Y'
a.id
,a.parent_menu_id
,p.menu_name as parent_menu_name
,a.menu_name
,a.menu_english_name
,a.menu_icon
,a.route
,a.menu_page
,a.remark
,a.visibles
,a.show_type
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
from sys_menu_config a
LEFT JOIN sys_menu_config p on p.id = a.parent_menu_id and p.sts = 'Y'
where a.id = #{ id } and a.sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysMenuConfigEntity-result"
@ -62,8 +79,6 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="parentMenuId != null and parentMenuId != ''">and parent_menu_id = #{parentMenuId}</if>
<if test="menuEntity != null and menuEntity != ''">and menu_entity = #{menuEntity}</if>
<if test="depth != null">and depth = #{depth}</if>
<if test="menuName != null and menuName != ''">and menu_name = #{menuName}</if>
<if test="menuEnglishName != null and menuEnglishName != ''">and menu_english_name = #{menuEnglishName}</if>
<if test="menuIcon != null and menuIcon != ''">and menu_icon = #{menuIcon}</if>
@ -93,8 +108,6 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="parentMenuId != null and parentMenuId != ''">and parent_menu_id = #{parentMenuId}</if>
<if test="menuEntity != null and menuEntity != ''">and menu_entity = #{menuEntity}</if>
<if test="depth != null">and depth = #{depth}</if>
<if test="menuName != null and menuName != ''">and menu_name = #{menuName}</if>
<if test="menuEnglishName != null and menuEnglishName != ''">and menu_english_name = #{menuEnglishName}</if>
<if test="menuIcon != null and menuIcon != ''">and menu_icon = #{menuIcon}</if>
@ -126,8 +139,6 @@
<if test="parentMenuId != null and parentMenuId != ''">and parent_menu_id like
concat('%',#{parentMenuId},'%')
</if>
<if test="menuEntity != null and menuEntity != ''">and menu_entity like concat('%',#{menuEntity},'%')</if>
<if test="depth != null">and depth like concat('%',#{depth},'%')</if>
<if test="menuName != null and menuName != ''">and menu_name like concat('%',#{menuName},'%')</if>
<if test="menuEnglishName != null and menuEnglishName != ''">and menu_english_name like
concat('%',#{menuEnglishName},'%')
@ -165,8 +176,6 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="parentMenuId != null and parentMenuId != ''">or parent_menu_id = #{parentMenuId}</if>
<if test="menuEntity != null and menuEntity != ''">or menu_entity = #{menuEntity}</if>
<if test="depth != null">or depth = #{depth}</if>
<if test="menuName != null and menuName != ''">or menu_name = #{menuName}</if>
<if test="menuEnglishName != null and menuEnglishName != ''">or menu_english_name = #{menuEnglishName}</if>
<if test="menuIcon != null and menuIcon != ''">or menu_icon = #{menuIcon}</if>
@ -191,13 +200,11 @@
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity"
>
>
insert into sys_menu_config(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="parentMenuId != null and parentMenuId != ''">parent_menu_id ,</if>
<if test="menuEntity != null and menuEntity != ''">menu_entity ,</if>
<if test="depth != null">depth ,</if>
<if test="menuName != null and menuName != ''">menu_name ,</if>
<if test="menuEnglishName != null and menuEnglishName != ''">menu_english_name ,</if>
<if test="menuIcon != null and menuIcon != ''">menu_icon ,</if>
@ -220,8 +227,6 @@
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="parentMenuId != null and parentMenuId != ''">#{parentMenuId} ,</if>
<if test="menuEntity != null and menuEntity != ''">#{menuEntity} ,</if>
<if test="depth != null">#{depth} ,</if>
<if test="menuName != null and menuName != ''">#{menuName} ,</if>
<if test="menuEnglishName != null and menuEnglishName != ''">#{menuEnglishName} ,</if>
<if test="menuIcon != null and menuIcon != ''">#{menuIcon} ,</if>
@ -243,29 +248,27 @@
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_menu_config(parent_menu_id, menu_entity, depth, menu_name, menu_english_name, menu_icon, route,
<insert id="entityInsertBatch">
insert into sys_menu_config(parent_menu_id, menu_name, menu_english_name, menu_icon, route,
menu_page, remark, visibles, show_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.parentMenuId},#{entity.menuEntity},#{entity.depth},#{entity.menuName},#{entity.menuEnglishName},#{entity.menuIcon},#{entity.route},#{entity.menuPage},#{entity.remark},#{entity.visibles},#{entity.showType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
(#{entity.parentMenuId},#{entity.menuName},#{entity.menuEnglishName},#{entity.menuIcon},#{entity.route},#{entity.menuPage},#{entity.remark},#{entity.visibles},#{entity.showType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_menu_config(parent_menu_id, menu_entity, depth, menu_name, menu_english_name, menu_icon, route,
<insert id="entityInsertOrUpdateBatch">
insert into sys_menu_config(parent_menu_id, menu_name, menu_english_name, menu_icon, route,
menu_page, remark, visibles, show_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.parentMenuId},#{entity.menuEntity},#{entity.depth},#{entity.menuName},#{entity.menuEnglishName},#{entity.menuIcon},#{entity.route},#{entity.menuPage},#{entity.remark},#{entity.visibles},#{entity.showType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.parentMenuId},#{entity.menuName},#{entity.menuEnglishName},#{entity.menuIcon},#{entity.route},#{entity.menuPage},#{entity.remark},#{entity.visibles},#{entity.showType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
parent_menu_id = values(parent_menu_id),
menu_entity = values(menu_entity),
depth = values(depth),
menu_name = values(menu_name),
menu_english_name = values(menu_english_name),
menu_icon = values(menu_icon),
@ -288,8 +291,6 @@
update sys_menu_config set
<trim suffix="" suffixOverrides=",">
<if test="parentMenuId != null and parentMenuId != ''">parent_menu_id = #{parentMenuId},</if>
<if test="menuEntity != null and menuEntity != ''">menu_entity = #{menuEntity},</if>
<if test="depth != null">depth = #{depth},</if>
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="menuEnglishName != null and menuEnglishName != ''">menu_english_name = #{menuEnglishName},</if>
<if test="menuIcon != null and menuIcon != ''">menu_icon = #{menuIcon},</if>
@ -321,8 +322,6 @@ where id = #{id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="parentMenuId != null and parentMenuId != ''">and parent_menu_id = #{parentMenuId}</if>
<if test="menuEntity != null and menuEntity != ''">and menu_entity = #{menuEntity}</if>
<if test="depth != null">and depth = #{depth}</if>
<if test="menuName != null and menuName != ''">and menu_name = #{menuName}</if>
<if test="menuEnglishName != null and menuEnglishName != ''">and menu_english_name = #{menuEnglishName}</if>
<if test="menuIcon != null and menuIcon != ''">and menu_icon = #{menuIcon}</if>
@ -341,6 +340,47 @@ where id = #{id}
<delete id="entity_delete">
delete from sys_menu_config where id = #{id}
</delete>
<!-- 查询 采用==查询 -->
<select id="queryUserMenu" resultMap="get-SysMenuConfigEntity-result"
parameterType="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity">
select
<include refid="SysMenuConfigEntity_Base_Column_List"/>
from sys_menu_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="parentMenuId != null and parentMenuId != ''">and parent_menu_id = #{parentMenuId}</if>
<if test="menuName != null and menuName != ''">and menu_name = #{menuName}</if>
<if test="menuEnglishName != null and menuEnglishName != ''">and menu_english_name = #{menuEnglishName}</if>
<if test="menuIcon != null and menuIcon != ''">and menu_icon = #{menuIcon}</if>
<if test="route != null and route != ''">and route = #{route}</if>
<if test="menuPage != null and menuPage != ''">and menu_page = #{menuPage}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="visibles != null and visibles != ''">and visibles = #{visibles}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="userId != null and userId != ''">
id in (
SELECT
menu_id from sys_popedom_menu WHERE object_id = #{userId} and kind_id = '1' and sts = 'Y'
)
OR
id in (
SELECT
menu_id from sys_popedom_menu WHERE object_id in (SELECT
role_id from sys_user_roles WHERE user_id = #{userId} and sts = 'Y') and kind_id = '2' and sts = 'Y'
)
</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</mapper>

View File

@ -20,5 +20,60 @@ public interface ISysMenuConfigService extends IBaseService<SysMenuConfigEntity,
* @Description 根据用户id查询菜单树
* @Date 9:40 上午 2022/12/7
**/
JsonResultEntity queryTree(JSONObject jsonObject);
JsonResultEntity queryTreeById(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询菜单树
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntityTree(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存菜单
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity saveEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取菜单
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改菜单
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity updateEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除菜单
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 启用停用菜单
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
}

View File

@ -3,6 +3,8 @@ package com.hzya.frame.sys.organ.dao;
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 组织机构表(Sys_Organ)(sys_organ: table)表数据库访问层
*
@ -11,5 +13,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface ISysOrganDao extends IBaseDao<SysOrganEntity, String> {
List<SysOrganEntity> queryUserCompany(SysOrganEntity sysOrganEntity);
}

View File

@ -5,6 +5,8 @@ import com.hzya.frame.sys.organ.dao.ISysOrganDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 组织机构表(Sys_Organ)(SysOrgan)表数据库访问层
*
@ -14,5 +16,10 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
@Repository(value = "SysOrganDaoImpl")
public class SysOrganDaoImpl extends MybatisGenericDao<SysOrganEntity, String> implements ISysOrganDao {
@Override
public List<SysOrganEntity> queryUserCompany(SysOrganEntity sysOrganEntity) {
List<SysOrganEntity> o = super.query(getSqlIdPrifx() + "queryUserCompany", sysOrganEntity);
return o;
}
}

View File

@ -25,6 +25,10 @@ public class SysOrganEntity extends BaseEntity {
* 组织机构父级ID
*/
private String parentOrganId;
/**
* 组织机构父级ID
*/
private String parentOrganName;
/**
* 状态: 0启用 1 停用
*/
@ -37,6 +41,10 @@ public class SysOrganEntity extends BaseEntity {
* 机构负责人
*/
private String managerId;
/**
* 机构负责人
*/
private String managerName;
/**
* 备注
*/
@ -46,11 +54,18 @@ public class SysOrganEntity extends BaseEntity {
*/
private String companyId;
/**
* 用户id
*/
private String userId;
/**
* 子集
*/
private List<SysOrganEntity> children;
private String label;
public String getOrganName() {
return organName;
}
@ -122,5 +137,37 @@ public class SysOrganEntity extends BaseEntity {
public void setChildren(List<SysOrganEntity> children) {
this.children = children;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getParentOrganName() {
return parentOrganName;
}
public void setParentOrganName(String parentOrganName) {
this.parentOrganName = parentOrganName;
}
public String getManagerName() {
return managerName;
}
public void setManagerName(String managerName) {
this.managerName = managerName;
}
}

View File

@ -10,6 +10,7 @@
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="company" column="company" jdbcType="VARCHAR"/>
<result property="managerId" column="manager_id" jdbcType="VARCHAR"/>
<result property="managerName" column="manager_name" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
@ -42,8 +43,25 @@
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysOrganEntity-result">
select
<include refid="SysOrganEntity_Base_Column_List" />
from sys_organ where id = #{ id } and sts='Y'
a.id
,a.organ_name
,a.organ_code
,a.parent_organ_id
,a.state
,a.company
,a.manager_id
, ( SELECT person_name from sys_person WHERE sts = 'Y' and id = a.manager_id )as manager_name
,a.remark
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
from sys_organ a where a.id = #{ id } and a.sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysOrganEntity-result"
@ -164,7 +182,7 @@
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.organ.entity.SysOrganEntity"
>
>
insert into sys_organ(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
@ -208,8 +226,8 @@
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
<insert id="entityInsertBatch">
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -218,8 +236,8 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
<insert id="entityInsertOrUpdateBatch">
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
@ -292,5 +310,39 @@ where id = #{id}
delete from sys_organ where id = #{id}
</delete>
<!-- 查询 采用==查询 -->
<select id="queryUserCompany" resultMap="get-SysOrganEntity-result"
parameterType="com.hzya.frame.sys.organ.entity.SysOrganEntity">
select
<include refid="SysOrganEntity_Base_Column_List"/>
from sys_organ
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="organName != null and organName != ''">and organ_name = #{organName}</if>
<if test="organCode != null and organCode != ''">and organ_code = #{organCode}</if>
<if test="parentOrganId != null and parentOrganId != ''">and parent_organ_id = #{parentOrganId}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="company != null and company != ''">and company = #{company}</if>
<if test="managerId != null and managerId != ''">and manager_id = #{managerId}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="userId != null and userId != ''">
and id in (
SELECT user_company_id FROM sys_user_company WHERE user_id = #{userId} and sts = 'Y'
)
</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</mapper>

View File

@ -61,6 +61,7 @@ public class SysOrganServiceImpl extends BaseService<SysOrganEntity, String> imp
for (int i = 0; i < sysOrganEntityList.size(); i++) {
if("0".equals(sysOrganEntityList.get(i).getParentOrganId())){
recursiveSetTree(sysOrganEntityList.get(i),sysOrganEntityList);
sysOrganEntityList.get(i).setLabel(sysOrganEntityList.get(i).getOrganName());
returnOrg.add(sysOrganEntityList.get(i));
}
}
@ -81,8 +82,9 @@ public class SysOrganServiceImpl extends BaseService<SysOrganEntity, String> imp
for (int i = 0; i < sysOrganEntityList.size(); i++) {
if(sysOrganEntityList.get(i).getParentOrganId() != null && !"".equals(sysOrganEntityList.get(i).getParentOrganId())){
if(sysOrganEntity.getId().equals(sysOrganEntityList.get(i).getParentOrganId())){
sysOrganEntityList.get(i).setLabel(sysOrganEntityList.get(i).getOrganName());
children.add(sysOrganEntityList.get(i));
recursiveSetTree(sysOrganEntity,sysOrganEntityList);
recursiveSetTree(sysOrganEntityList.get(i),sysOrganEntityList);
}
}
}
@ -136,6 +138,12 @@ public class SysOrganServiceImpl extends BaseService<SysOrganEntity, String> imp
if(entity == null ){
return BaseResult.getFailureMessageEntity("获取组织失败");
}
if(entity.getParentOrganId() != null && !"0".equals(entity.getParentOrganId())){
SysOrganEntity parentEntity = sysOrganDao.get(entity.getParentOrganId());
if(entity != null ){
entity.setParentOrganName(parentEntity.getOrganName());
}
}
return BaseResult.getSuccessMessageEntity("获取组织成功", entity);
}
/**

View File

@ -16,6 +16,10 @@ public class SysPersonEntity extends BaseEntity {
* 关联组织机构ID
*/
private String organId;
/**
* 关联组织机构ID
*/
private String organName;
/**
* 工号
*/
@ -31,7 +35,7 @@ public class SysPersonEntity extends BaseEntity {
/**
* 手机号码
*/
private String moiblePhone;
private String mobilePhone;
/**
* 入职时间
*/
@ -128,12 +132,12 @@ public class SysPersonEntity extends BaseEntity {
this.sex = sex;
}
public String getMoiblePhone() {
return moiblePhone;
public String getMobilePhone() {
return mobilePhone;
}
public void setMoiblePhone(String moiblePhone) {
this.moiblePhone = moiblePhone;
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public Date getEntryTime() {
@ -272,5 +276,12 @@ public class SysPersonEntity extends BaseEntity {
this.companyId = companyId;
}
public String getOrganName() {
return organName;
}
public void setOrganName(String organName) {
this.organName = organName;
}
}

View File

@ -5,10 +5,11 @@
<resultMap id="get-SysPersonEntity-result" type="com.hzya.frame.sys.person.entity.SysPersonEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="organId" column="organ_id" jdbcType="VARCHAR"/>
<result property="organName" column="organ_name" jdbcType="VARCHAR"/>
<result property="personCode" column="person_code" jdbcType="VARCHAR"/>
<result property="personName" column="person_name" jdbcType="VARCHAR"/>
<result property="sex" column="sex" jdbcType="VARCHAR"/>
<result property="moiblePhone" column="moible_phone" jdbcType="VARCHAR"/>
<result property="mobilePhone" column="mobile_phone" jdbcType="VARCHAR"/>
<result property="entryTime" column="entry_time" jdbcType="TIMESTAMP"/>
<result property="email" column="email" jdbcType="VARCHAR"/>
<result property="degreeId" column="degree_id" jdbcType="VARCHAR"/>
@ -37,11 +38,11 @@
<!-- 查询的字段-->
<sql id="SysPersonEntity_Base_Column_List">
id
,organ_id
,organ_id
,person_code
,person_name
,sex
,moible_phone
,mobile_phone
,entry_time
,email
,degree_id
@ -71,8 +72,39 @@
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysPersonEntity-result">
select
<include refid="SysPersonEntity_Base_Column_List" />
from sys_person where id = #{ id } and sts='Y'
a.id
,a.organ_id
,( SELECT organ_name from sys_organ WHERE sts = 'Y' and id = a.organ_id )as organ_name
,a.person_code
,a.person_name
,a.sex
,a.mobile_phone
,a.entry_time
,a.email
,a.degree_id
,a.post_id
,a.level_id
,a.birth_day
,a.tel_phone
,a.hometown
,a.id_card
,a.address
,a.leave_time
,a.state
,a.remark
,a.dd_user_id
,a.wx_user_id
,a.head_image_id
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
from sys_person a where a.id = #{ id } and a.sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysPersonEntity-result"
@ -86,7 +118,7 @@
<if test="personCode != null and personCode != ''">and person_code = #{personCode}</if>
<if test="personName != null and personName != ''">and person_name = #{personName}</if>
<if test="sex != null and sex != ''">and sex = #{sex}</if>
<if test="moiblePhone != null and moiblePhone != ''">and moible_phone = #{moiblePhone}</if>
<if test="mobilePhone != null and mobilePhone != ''">and mobile_phone = #{mobilePhone}</if>
<if test="entryTime != null">and entry_time = #{entryTime}</if>
<if test="email != null and email != ''">and email = #{email}</if>
<if test="degreeId != null and degreeId != ''">and degree_id = #{degreeId}</if>
@ -126,7 +158,7 @@
<if test="personCode != null and personCode != ''">and person_code = #{personCode}</if>
<if test="personName != null and personName != ''">and person_name = #{personName}</if>
<if test="sex != null and sex != ''">and sex = #{sex}</if>
<if test="moiblePhone != null and moiblePhone != ''">and moible_phone = #{moiblePhone}</if>
<if test="mobilePhone != null and mobilePhone != ''">and mobile_phone = #{mobilePhone}</if>
<if test="entryTime != null">and entry_time = #{entryTime}</if>
<if test="email != null and email != ''">and email = #{email}</if>
<if test="degreeId != null and degreeId != ''">and degree_id = #{degreeId}</if>
@ -159,48 +191,81 @@
<select id="entity_list_like" resultMap="get-SysPersonEntity-result"
parameterType="com.hzya.frame.sys.person.entity.SysPersonEntity">
select
<include refid="SysPersonEntity_Base_Column_List"/>
from sys_person
a.id
,a.organ_id
,( SELECT organ_name from sys_organ WHERE sts = 'Y' and id = a.organ_id )as organ_name
,a.person_code
,a.person_name
,a.sex
,a.mobile_phone
,a.entry_time
,a.email
,a.degree_id
,a.post_id
,a.level_id
,a.birth_day
,a.tel_phone
,a.hometown
,a.id_card
,a.address
,a.leave_time
,a.state
,a.remark
,a.dd_user_id
,a.wx_user_id
,a.head_image_id
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
from sys_person a
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="organId != null and organId != ''">and organ_id like concat('%',#{organId},'%')</if>
<if test="personCode != null and personCode != ''">and person_code like concat('%',#{personCode},'%')</if>
<if test="personName != null and personName != ''">and person_name like concat('%',#{personName},'%')</if>
<if test="sex != null and sex != ''">and sex like concat('%',#{sex},'%')</if>
<if test="moiblePhone != null and moiblePhone != ''">and moible_phone like concat('%',#{moiblePhone},'%')
<if test="id != null and id != ''">and a.id like concat('%',#{id},'%')</if>
<if test="organId != null and organId != ''">and a.organ_id like concat('%',#{organId},'%')</if>
<if test="personCode != null and personCode != ''">and a.person_code like concat('%',#{personCode},'%')</if>
<if test="personName != null and personName != ''">and a.person_name like concat('%',#{personName},'%')</if>
<if test="sex != null and sex != ''">and a.sex like concat('%',#{sex},'%')</if>
<if test="mobilePhone != null and mobilePhone != ''">and a.mobile_phone like concat('%',#{mobilePhone},'%')
</if>
<if test="entryTime != null">and entry_time like concat('%',#{entryTime},'%')</if>
<if test="email != null and email != ''">and email like concat('%',#{email},'%')</if>
<if test="degreeId != null and degreeId != ''">and degree_id like concat('%',#{degreeId},'%')</if>
<if test="postId != null and postId != ''">and post_id like concat('%',#{postId},'%')</if>
<if test="levelId != null and levelId != ''">and level_id like concat('%',#{levelId},'%')</if>
<if test="birthDay != null">and birth_day like concat('%',#{birthDay},'%')</if>
<if test="telPhone != null and telPhone != ''">and tel_phone like concat('%',#{telPhone},'%')</if>
<if test="hometown != null and hometown != ''">and hometown like concat('%',#{hometown},'%')</if>
<if test="idCard != null and idCard != ''">and id_card like concat('%',#{idCard},'%')</if>
<if test="address != null and address != ''">and address like concat('%',#{address},'%')</if>
<if test="leaveTime != null">and leave_time like concat('%',#{leaveTime},'%')</if>
<if test="state != null and state != ''">and state like concat('%',#{state},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="ddUserId != null and ddUserId != ''">and dd_user_id like concat('%',#{ddUserId},'%')</if>
<if test="wxUserId != null and wxUserId != ''">and wx_user_id like concat('%',#{wxUserId},'%')</if>
<if test="headImageId != null and headImageId != ''">and head_image_id like concat('%',#{headImageId},'%')
<if test="entryTime != null">and a.entry_time like concat('%',#{entryTime},'%')</if>
<if test="email != null and email != ''">and a.email like concat('%',#{email},'%')</if>
<if test="degreeId != null and degreeId != ''">and a.degree_id like concat('%',#{degreeId},'%')</if>
<if test="postId != null and postId != ''">and a.post_id like concat('%',#{postId},'%')</if>
<if test="levelId != null and levelId != ''">and a.level_id like concat('%',#{levelId},'%')</if>
<if test="birthDay != null">and a.birth_day like concat('%',#{birthDay},'%')</if>
<if test="telPhone != null and telPhone != ''">and a.tel_phone like concat('%',#{telPhone},'%')</if>
<if test="hometown != null and hometown != ''">and a.hometown like concat('%',#{hometown},'%')</if>
<if test="idCard != null and idCard != ''">and a.id_card like concat('%',#{idCard},'%')</if>
<if test="address != null and address != ''">and a.address like concat('%',#{address},'%')</if>
<if test="leaveTime != null">and a.leave_time like concat('%',#{leaveTime},'%')</if>
<if test="state != null and state != ''">and a.state like concat('%',#{state},'%')</if>
<if test="remark != null and remark != ''">and a.remark like concat('%',#{remark},'%')</if>
<if test="ddUserId != null and ddUserId != ''">and a.dd_user_id like concat('%',#{ddUserId},'%')</if>
<if test="wxUserId != null and wxUserId != ''">and a.wx_user_id like concat('%',#{wxUserId},'%')</if>
<if test="headImageId != null and headImageId != ''">and a.head_image_id like concat('%',#{headImageId},'%')
</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
<if test="sorts != null">and a.sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and a.create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
<if test="create_time != null">and a.create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and a.modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
<if test="modify_time != null">and a.modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and a.sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and a.org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and a.company_id like concat('%',#{companyId},'%')</if>
and a.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort == null or sort == ''.toString() ">order by a.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
@ -216,7 +281,7 @@
<if test="personCode != null and personCode != ''">or person_code = #{personCode}</if>
<if test="personName != null and personName != ''">or person_name = #{personName}</if>
<if test="sex != null and sex != ''">or sex = #{sex}</if>
<if test="moiblePhone != null and moiblePhone != ''">or moible_phone = #{moiblePhone}</if>
<if test="mobilePhone != null and mobilePhone != ''">or mobile_phone = #{mobilePhone}</if>
<if test="entryTime != null">or entry_time = #{entryTime}</if>
<if test="email != null and email != ''">or email = #{email}</if>
<if test="degreeId != null and degreeId != ''">or degree_id = #{degreeId}</if>
@ -257,7 +322,7 @@
<if test="personCode != null and personCode != ''">person_code ,</if>
<if test="personName != null and personName != ''">person_name ,</if>
<if test="sex != null and sex != ''">sex ,</if>
<if test="moiblePhone != null and moiblePhone != ''">moible_phone ,</if>
<if test="mobilePhone != null and mobilePhone != ''">mobile_phone ,</if>
<if test="entryTime != null">entry_time ,</if>
<if test="email != null and email != ''">email ,</if>
<if test="degreeId != null and degreeId != ''">degree_id ,</if>
@ -291,7 +356,7 @@
<if test="personCode != null and personCode != ''">#{personCode} ,</if>
<if test="personName != null and personName != ''">#{personName} ,</if>
<if test="sex != null and sex != ''">#{sex} ,</if>
<if test="moiblePhone != null and moiblePhone != ''">#{moiblePhone} ,</if>
<if test="mobilePhone != null and mobilePhone != ''">#{mobilePhone} ,</if>
<if test="entryTime != null">#{entryTime} ,</if>
<if test="email != null and email != ''">#{email} ,</if>
<if test="degreeId != null and degreeId != ''">#{degreeId} ,</if>
@ -322,32 +387,32 @@
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_person(organ_id, person_code, person_name, sex, moible_phone, entry_time, email, degree_id,
insert into sys_person(organ_id, person_code, person_name, sex, mobile_phone, entry_time, email, degree_id,
post_id, level_id, birth_day, tel_phone, hometown, id_card, address, leave_time, state, remark, dd_user_id,
wx_user_id, head_image_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.organId},#{entity.personCode},#{entity.personName},#{entity.sex},#{entity.moiblePhone},#{entity.entryTime},#{entity.email},#{entity.degreeId},#{entity.postId},#{entity.levelId},#{entity.birthDay},#{entity.telPhone},#{entity.hometown},#{entity.idCard},#{entity.address},#{entity.leaveTime},#{entity.state},#{entity.remark},#{entity.ddUserId},#{entity.wxUserId},#{entity.headImageId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
(#{entity.organId},#{entity.personCode},#{entity.personName},#{entity.sex},#{entity.mobilePhone},#{entity.entryTime},#{entity.email},#{entity.degreeId},#{entity.postId},#{entity.levelId},#{entity.birthDay},#{entity.telPhone},#{entity.hometown},#{entity.idCard},#{entity.address},#{entity.leaveTime},#{entity.state},#{entity.remark},#{entity.ddUserId},#{entity.wxUserId},#{entity.headImageId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_person(organ_id, person_code, person_name, sex, moible_phone, entry_time, email, degree_id,
insert into sys_person(organ_id, person_code, person_name, sex, mobile_phone, entry_time, email, degree_id,
post_id, level_id, birth_day, tel_phone, hometown, id_card, address, leave_time, state, remark, dd_user_id,
wx_user_id, head_image_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.organId},#{entity.personCode},#{entity.personName},#{entity.sex},#{entity.moiblePhone},#{entity.entryTime},#{entity.email},#{entity.degreeId},#{entity.postId},#{entity.levelId},#{entity.birthDay},#{entity.telPhone},#{entity.hometown},#{entity.idCard},#{entity.address},#{entity.leaveTime},#{entity.state},#{entity.remark},#{entity.ddUserId},#{entity.wxUserId},#{entity.headImageId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.organId},#{entity.personCode},#{entity.personName},#{entity.sex},#{entity.mobilePhone},#{entity.entryTime},#{entity.email},#{entity.degreeId},#{entity.postId},#{entity.levelId},#{entity.birthDay},#{entity.telPhone},#{entity.hometown},#{entity.idCard},#{entity.address},#{entity.leaveTime},#{entity.state},#{entity.remark},#{entity.ddUserId},#{entity.wxUserId},#{entity.headImageId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
organ_id = values(organ_id),
person_code = values(person_code),
person_name = values(person_name),
sex = values(sex),
moible_phone = values(moible_phone),
mobile_phone = values(mobile_phone),
entry_time = values(entry_time),
email = values(email),
degree_id = values(degree_id),
@ -381,7 +446,7 @@
<if test="personCode != null and personCode != ''">person_code = #{personCode},</if>
<if test="personName != null and personName != ''">person_name = #{personName},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="moiblePhone != null and moiblePhone != ''">moible_phone = #{moiblePhone},</if>
<if test="mobilePhone != null and mobilePhone != ''">mobile_phone = #{mobilePhone},</if>
<if test="entryTime != null">entry_time = #{entryTime},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="degreeId != null and degreeId != ''">degree_id = #{degreeId},</if>
@ -423,7 +488,7 @@ where id = #{id}
<if test="personCode != null and personCode != ''">and person_code = #{personCode}</if>
<if test="personName != null and personName != ''">and person_name = #{personName}</if>
<if test="sex != null and sex != ''">and sex = #{sex}</if>
<if test="moiblePhone != null and moiblePhone != ''">and moible_phone = #{moiblePhone}</if>
<if test="mobilePhone != null and mobilePhone != ''">and mobile_phone = #{mobilePhone}</if>
<if test="entryTime != null">and entry_time = #{entryTime}</if>
<if test="email != null and email != ''">and email = #{email}</if>
<if test="degreeId != null and degreeId != ''">and degree_id = #{degreeId}</if>

View File

@ -100,7 +100,7 @@ public class SysPersonServiceImpl extends BaseService<SysPersonEntity, String> i
if (entity.getPersonCode() == null || "".equals(entity.getPersonCode())) {
return BaseResult.getFailureMessageEntity("请先输入工号");
}
if (entity.getMoiblePhone() == null || "".equals(entity.getMoiblePhone())) {
if (entity.getMobilePhone() == null || "".equals(entity.getMobilePhone())) {
return BaseResult.getFailureMessageEntity("请先输入手机号码");
}
entity.setCreate();
@ -154,7 +154,7 @@ public class SysPersonServiceImpl extends BaseService<SysPersonEntity, String> i
if (entity.getPersonCode() == null || "".equals(entity.getPersonCode())) {
return BaseResult.getFailureMessageEntity("请先输入工号");
}
if (entity.getMoiblePhone() == null || "".equals(entity.getMoiblePhone())) {
if (entity.getMobilePhone() == null || "".equals(entity.getMobilePhone())) {
return BaseResult.getFailureMessageEntity("请先输入手机号码");
}
entity.setUpdate();

View File

@ -14,8 +14,8 @@ public class SysPopedomOperateEntity extends BaseEntity {
private String objectId;
/** 菜单id */
private String menuId;
/** 操作权限分类id集 */
private String operateKindList;
/** 操作权限分类 */
private String operate;
/** 权限分类1、人员、2、角色 */
private String kindId;
/** 公司id */
@ -38,12 +38,12 @@ public class SysPopedomOperateEntity extends BaseEntity {
this.menuId = menuId;
}
public String getOperateKindList() {
return operateKindList;
public String getOperate() {
return operate;
}
public void setOperateKindList(String operateKindList) {
this.operateKindList = operateKindList;
public void setOperate(String operate) {
this.operate = operate;
}
public String getKindId() {

View File

@ -6,7 +6,7 @@
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
<result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
<result property="operateKindList" column="operate_kind_list" jdbcType="VARCHAR"/>
<result property="operate" column="operate" jdbcType="VARCHAR"/>
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
@ -22,7 +22,7 @@
id
,object_id
,menu_id
,operate_kind_list
,operate
,kind_id
,sorts
,create_user_id
@ -48,7 +48,7 @@
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
<if test="operate != null and operate != ''"> and operate = #{operate} </if>
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
@ -71,7 +71,7 @@
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
<if test="operate != null and operate != ''"> and operate = #{operate} </if>
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
@ -94,7 +94,7 @@
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="objectId != null and objectId != ''"> and object_id like concat('%',#{objectId},'%') </if>
<if test="menuId != null and menuId != ''"> and menu_id like concat('%',#{menuId},'%') </if>
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list like concat('%',#{operateKindList},'%') </if>
<if test="operate != null and operate != ''"> and operate like concat('%',#{operate},'%') </if>
<if test="kindId != null and kindId != ''"> and kind_id like concat('%',#{kindId},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
@ -119,7 +119,7 @@
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="objectId != null and objectId != ''"> or object_id = #{objectId} </if>
<if test="menuId != null and menuId != ''"> or menu_id = #{menuId} </if>
<if test="operateKindList != null and operateKindList != ''"> or operate_kind_list = #{operateKindList} </if>
<if test="operate != null and operate != ''"> or operate = #{operate} </if>
<if test="kindId != null and kindId != ''"> or kind_id = #{kindId} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
@ -142,7 +142,7 @@
<if test="id != null and id != ''"> id , </if>
<if test="objectId != null and objectId != ''"> object_id , </if>
<if test="menuId != null and menuId != ''"> menu_id , </if>
<if test="operateKindList != null and operateKindList != ''"> operate_kind_list , </if>
<if test="operate != null and operate != ''"> operate , </if>
<if test="kindId != null and kindId != ''"> kind_id , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
@ -159,7 +159,7 @@
<if test="id != null and id != ''"> #{id} ,</if>
<if test="objectId != null and objectId != ''"> #{objectId} ,</if>
<if test="menuId != null and menuId != ''"> #{menuId} ,</if>
<if test="operateKindList != null and operateKindList != ''"> #{operateKindList} ,</if>
<if test="operate != null and operate != ''"> #{operate} ,</if>
<if test="kindId != null and kindId != ''"> #{kindId} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
@ -175,23 +175,23 @@
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
insert into sys_popedom_operate(object_id, menu_id, operate, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
(#{entity.objectId},#{entity.menuId},#{entity.operate},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
insert into sys_popedom_operate(object_id, menu_id, operate, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.objectId},#{entity.menuId},#{entity.operate},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
object_id = values(object_id),
menu_id = values(menu_id),
operate_kind_list = values(operate_kind_list),
operate = values(operate),
kind_id = values(kind_id),
create_user_id = values(create_user_id),
create_time = values(create_time),
@ -206,7 +206,7 @@ update sys_popedom_operate set
<trim suffix="" suffixOverrides=",">
<if test="objectId != null and objectId != ''"> object_id = #{objectId},</if>
<if test="menuId != null and menuId != ''"> menu_id = #{menuId},</if>
<if test="operateKindList != null and operateKindList != ''"> operate_kind_list = #{operateKindList},</if>
<if test="operate != null and operate != ''"> operate = #{operate},</if>
<if test="kindId != null and kindId != ''"> kind_id = #{kindId},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
@ -230,7 +230,7 @@ update sys_popedom_operate set sts= 'N' ,modify_time = #{modify_time},modify_us
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
<if test="operate != null and operate != ''"> and operate = #{operate} </if>
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>

View File

@ -3,6 +3,8 @@ package com.hzya.frame.sys.user.dao;
import com.hzya.frame.sys.user.entity.SysUserEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 用户表(sys_user: table)表数据库访问层
*
@ -11,5 +13,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface ISysUserDao extends IBaseDao<SysUserEntity, String> {
List<SysUserEntity> queryByLikePerson(SysUserEntity entity);
}

View File

@ -1,10 +1,13 @@
package com.hzya.frame.sys.user.dao.impl;
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
import com.hzya.frame.sys.user.entity.SysUserEntity;
import com.hzya.frame.sys.user.dao.ISysUserDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 用户表(SysUser)表数据库访问层
*
@ -14,5 +17,10 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
@Repository(value = "SysUserDaoImpl")
public class SysUserDaoImpl extends MybatisGenericDao<SysUserEntity, String> implements ISysUserDao {
@Override
public List<SysUserEntity> queryByLikePerson(SysUserEntity entity) {
List<SysUserEntity> o = super.query(getSqlIdPrifx() + "queryByLikePerson", entity);
return o;
}
}

View File

@ -0,0 +1,68 @@
package com.hzya.frame.sys.user.entity;
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
import java.util.List;
public class JurisdictionDto {
/**
* ID
*/
private String id;
/** 权限分类1、人员、2、角色 */
private String kindId;
//首页
private List<SysPopedomHomeEntity> sysPopedomHomeEntities;
//菜单
private List<SysPopedomMenuEntity> sysPopedomMenuEntities;
//按钮
private List<SysPopedomOperateEntity> sysPopedomOperateEntities;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getKindId() {
return kindId;
}
public void setKindId(String kindId) {
this.kindId = kindId;
}
public List<SysPopedomHomeEntity> getSysPopedomHomeEntities() {
return sysPopedomHomeEntities;
}
public void setSysPopedomHomeEntities(List<SysPopedomHomeEntity> sysPopedomHomeEntities) {
this.sysPopedomHomeEntities = sysPopedomHomeEntities;
}
public List<SysPopedomMenuEntity> getSysPopedomMenuEntities() {
return sysPopedomMenuEntities;
}
public void setSysPopedomMenuEntities(List<SysPopedomMenuEntity> sysPopedomMenuEntities) {
this.sysPopedomMenuEntities = sysPopedomMenuEntities;
}
public List<SysPopedomOperateEntity> getSysPopedomOperateEntities() {
return sysPopedomOperateEntities;
}
public void setSysPopedomOperateEntities(List<SysPopedomOperateEntity> sysPopedomOperateEntities) {
this.sysPopedomOperateEntities = sysPopedomOperateEntities;
}
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.sys.user.entity;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import java.util.List;
public class JurisdictionVo {
//菜单按钮
private List<MenuVo> menvVoList;
//首页
List<SysHomeComponentEntity> homeList;
public List<MenuVo> getMenvVoList() {
return menvVoList;
}
public void setMenvVoList(List<MenuVo> menvVoList) {
this.menvVoList = menvVoList;
}
public List<SysHomeComponentEntity> getHomeList() {
return homeList;
}
public void setHomeList(List<SysHomeComponentEntity> homeList) {
this.homeList = homeList;
}
}

View File

@ -0,0 +1,73 @@
package com.hzya.frame.sys.user.entity;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity;
import java.util.List;
public class MenuVo {
/** 主键ID */
private String id;
/** 名称 */
private String name;
/** 是否选中 */
private boolean check;
/** alwaysShow title */
private JSONObject meta;
//下级菜单
private List<MenuVo> children;
//按钮
private List<SysButtonConfigEntity> buttonList;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isCheck() {
return check;
}
public void setCheck(boolean check) {
this.check = check;
}
public JSONObject getMeta() {
return meta;
}
public void setMeta(JSONObject meta) {
this.meta = meta;
}
public List<MenuVo> getChildren() {
return children;
}
public void setChildren(List<MenuVo> children) {
this.children = children;
}
public List<SysButtonConfigEntity> getButtonList() {
return buttonList;
}
public void setButtonList(List<SysButtonConfigEntity> buttonList) {
this.buttonList = buttonList;
}
}

View File

@ -1,7 +1,10 @@
package com.hzya.frame.sys.user.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity;
import com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity;
import com.hzya.frame.web.entity.BaseEntity;
/**
@ -53,6 +56,26 @@ public class SysUserEntity extends BaseEntity {
*/
private String companyId;
//用户公司
private List<SysUserCompanyEntity> userCompanys;
//用户角色
private List<SysUserRolesEntity> userRoles;
/**
* 人员姓名
*/
private String personName;
/**
* 关联组织机构名称
*/
private String organName;
/**
* 关联组织机构名称
*/
private String organId;
/**
* 手机号码
*/
private String mobilePhone;
public String getPersonId() {
return personId;
@ -134,5 +157,52 @@ public class SysUserEntity extends BaseEntity {
this.companyId = companyId;
}
public List<SysUserCompanyEntity> getUserCompanys() {
return userCompanys;
}
public void setUserCompanys(List<SysUserCompanyEntity> userCompanys) {
this.userCompanys = userCompanys;
}
public List<SysUserRolesEntity> getUserRoles() {
return userRoles;
}
public void setUserRoles(List<SysUserRolesEntity> userRoles) {
this.userRoles = userRoles;
}
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getOrganName() {
return organName;
}
public void setOrganName(String organName) {
this.organName = organName;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getOrganId() {
return organId;
}
public void setOrganId(String organId) {
this.organId = organId;
}
}

View File

@ -21,6 +21,9 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="personName" column="person_Name" jdbcType="VARCHAR"/>
<result property="organName" column="organ_name" jdbcType="VARCHAR"/>
<result property="mobilePhone" column="mobile_phone" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysUserEntity_Base_Column_List">
@ -46,8 +49,29 @@
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysUserEntity-result">
select
<include refid="SysUserEntity_Base_Column_List" />
from sys_user where id = #{ id } and sts='Y'
a.id
,a.person_id
,a.login_code
,a.password
,a.salt
,a.last_login_time
,a.last_connection_time
,a.last_login_ip
,a.state
,a.remark
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
,p.person_Name
from
sys_user a
LEFT JOIN sys_person p on p.id = a.person_id and p.sts = 'Y'
where a.id = #{ id } and a.sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysUserEntity-result"
@ -142,6 +166,65 @@
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<select id="queryByLikePerson" resultMap="get-SysUserEntity-result"
parameterType="com.hzya.frame.sys.user.entity.SysUserEntity">
select
a.id
,a.person_id
,a.login_code
,a.password
,a.salt
,a.last_login_time
,a.last_connection_time
,a.last_login_ip
,a.state
,a.remark
,a.sorts
,a.create_user_id
,a.create_time
,a.modify_user_id
,a.modify_time
,a.sts
,a.org_id
,a.company_id
,p.person_Name
,p.mobile_phone
,o.organ_name
from
sys_user a
LEFT JOIN sys_person p on p.id = a.person_id and p.sts = 'Y'
LEFT JOIN sys_organ o on o.id = p.organ_id and o.sts = 'Y'
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and a.id like concat('%',#{id},'%')</if>
<if test="personId != null and personId != ''">and a.person_id like concat('%',#{personId},'%')</if>
<if test="loginCode != null and loginCode != ''">and a.login_code like concat('%',#{loginCode},'%')</if>
<if test="password != null and password != ''">and a.password like concat('%',#{password},'%')</if>
<if test="salt != null and salt != ''">and a.salt like concat('%',#{salt},'%')</if>
<if test="lastLoginTime != null">and a.last_login_time like concat('%',#{lastLoginTime},'%')</if>
<if test="lastConnectionTime != null">and a.last_connection_time like concat('%',#{lastConnectionTime},'%')
</if>
<if test="lastLoginIp != null and lastLoginIp != ''">and a.last_login_ip like concat('%',#{lastLoginIp},'%')
</if>
<if test="state != null and state != ''">and a.state like concat('%',#{state},'%')</if>
<if test="remark != null and remark != ''">and a.remark like concat('%',#{remark},'%')</if>
<if test="sorts != null">and a.sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and a.create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and a.create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and a.modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and a.modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and a.sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and a.org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and a.company_id like concat('%',#{companyId},'%')</if>
<if test="organId != null and organId != ''">and p.organ_id = #{organId}</if>
and a.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by a.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysUserentity_list_or" resultMap="get-SysUserEntity-result"

View File

@ -1,7 +1,9 @@
package com.hzya.frame.sys.user.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.user.entity.SysUserEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 用户表(SysUser)表服务接口
@ -10,4 +12,96 @@ import com.hzya.frame.basedao.service.IBaseService;
* @since 2024-03-26 15:27:46
*/
public interface ISysUserService extends IBaseService<SysUserEntity, String> {
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询用户列表分页
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询用户列表
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存用户
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity saveEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取用户
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改用户
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity updateEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除用户
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 启用停用用户
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 重置密码
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity resetPassword(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 权限查询
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity jurisdiction(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存权限查询
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity saveJurisdiction(JSONObject jsonObject);
}

View File

@ -1,15 +1,44 @@
package com.hzya.frame.sys.user.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.buttonConfig.dao.ISysButtonConfigDao;
import com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity;
import com.hzya.frame.sys.homeComponent.dao.ISysHomeComponentDao;
import com.hzya.frame.sys.homeComponent.entity.SysHomeComponentEntity;
import com.hzya.frame.sys.menuConfig.dao.ISysMenuConfigDao;
import com.hzya.frame.sys.menuConfig.entity.ModuleVo;
import com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity;
import com.hzya.frame.sys.popedomHome.dao.ISysPopedomHomeDao;
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
import com.hzya.frame.sys.popedomMenu.dao.ISysPopedomMenuDao;
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
import com.hzya.frame.sys.popedomOperate.dao.ISysPopedomOperateDao;
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
import com.hzya.frame.sys.user.entity.JurisdictionDto;
import com.hzya.frame.sys.user.entity.JurisdictionVo;
import com.hzya.frame.sys.user.entity.MenuVo;
import com.hzya.frame.sys.user.entity.SysUserEntity;
import com.hzya.frame.sys.user.dao.ISysUserDao;
import com.hzya.frame.sys.user.service.ISysUserService;
import com.hzya.frame.sys.userCompany.dao.ISysUserCompanyDao;
import com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity;
import com.hzya.frame.sys.userRoles.dao.ISysUserRolesDao;
import com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 用户表(SysUser)表服务实现类
*
@ -20,10 +49,527 @@ import com.hzya.frame.basedao.service.impl.BaseService;
public class SysUserServiceImpl extends BaseService<SysUserEntity, String> implements ISysUserService {
private ISysUserDao sysUserDao;
@Resource
private ISysUserCompanyDao sysUserCompanyDao;
@Resource
private ISysUserRolesDao sysUserRolesDao;
@Resource
private ISysMenuConfigDao sysMenuConfigDao;
@Resource
private ISysButtonConfigDao sysButtonConfigDao;
@Resource
private ISysPopedomMenuDao sysPopedomMenuDao;
@Resource
private ISysPopedomOperateDao sysPopedomOperateDao;
@Resource
private ISysHomeComponentDao sysHomeComponentDao;
@Resource
private ISysPopedomHomeDao sysPopedomHomeDao;
@Autowired
public void setSysUserDao(ISysUserDao dao) {
this.sysUserDao = dao;
this.dao = dao;
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询用户列表分页
* @Date 11:52 上午 2024/3/27
**/
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
//判断分页
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysUserEntity> list = sysUserDao.queryByLikePerson(entity);
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询用户列表
* @Date 11:52 上午 2024/3/27
**/
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
entity = new SysUserEntity();
}
List<SysUserEntity> list = sysUserDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存用户
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getPersonId() == null || "".equals(entity.getPersonId())) {
return BaseResult.getFailureMessageEntity("请先选择人员");
}
if (entity.getLoginCode() == null || "".equals(entity.getLoginCode())) {
return BaseResult.getFailureMessageEntity("请先输入登录账号");
}
if (entity.getUserCompanys() == null || entity.getUserCompanys().size() == 0) {
return BaseResult.getFailureMessageEntity("请先选择用户公司");
}
if (entity.getUserRoles() == null || entity.getUserRoles().size() == 0) {
return BaseResult.getFailureMessageEntity("请先选择用户角色");
}
if (!checkPersonIsUse(entity)) {
return BaseResult.getFailureMessageEntity("当前人员已经配置用户,请勿重复配置");
}
entity.setPassword(AESUtil.encrypt(entity.getLoginCode()+"-123456"));
entity.setCreate();
//保存
sysUserDao.save(entity);
//保存用户公司
for (int i = 0; i < entity.getUserCompanys().size(); i++) {
SysUserCompanyEntity sysUserCompanyEntity = entity.getUserCompanys().get(i);
sysUserCompanyEntity.setUserId(entity.getId());
sysUserCompanyEntity.setCreate();
sysUserCompanyDao.save(sysUserCompanyEntity);
}
//保存用户角色
for (int i = 0; i < entity.getUserRoles().size(); i++) {
SysUserRolesEntity sysUserRolesEntity = entity.getUserRoles().get(i);
sysUserRolesEntity.setUserId(entity.getId());
sysUserRolesEntity.setCreate();
sysUserRolesDao.save(sysUserRolesEntity);
}
return BaseResult.getSuccessMessageEntity("保存用户成功", entity);
}
/**
* @param entity
* @return boolean
* @Author lvleigang
* @Description 校验人员是否已经有配置
* @Date 10:00 上午 2024/4/1
**/
private boolean checkPersonIsUse(SysUserEntity entity) {
SysUserEntity sysUserEntity = new SysUserEntity();
sysUserEntity.setPersonId(entity.getPersonId());
sysUserEntity.setState("0");//启用
if (sysUserDao.getCount(sysUserEntity) > 0) {
return false;
}
return true;
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取用户
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysUserDao.get(entity.getId());
if (entity == null) {
return BaseResult.getFailureMessageEntity("获取用户失败");
}
//获取用户公司
SysUserCompanyEntity sysUserCompanyEntity = new SysUserCompanyEntity();
sysUserCompanyEntity.setUserId(entity.getId());
List<SysUserCompanyEntity> sysUserCompanyEntities = sysUserCompanyDao.queryBase(sysUserCompanyEntity);
entity.setUserCompanys(sysUserCompanyEntities);
//获取用户角色
SysUserRolesEntity sysUserRolesEntity = new SysUserRolesEntity();
sysUserRolesEntity.setUserId(entity.getId());
List<SysUserRolesEntity> sysUserRolesEntities = sysUserRolesDao.queryBase(sysUserRolesEntity);
entity.setUserRoles(sysUserRolesEntities);
return BaseResult.getSuccessMessageEntity("获取用户成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改用户
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getPersonId() == null || "".equals(entity.getPersonId())) {
return BaseResult.getFailureMessageEntity("请先选择人员");
}
if (entity.getLoginCode() == null || "".equals(entity.getLoginCode())) {
return BaseResult.getFailureMessageEntity("请先输入登录账号");
}
if (entity.getUserCompanys() == null || entity.getUserCompanys().size() == 0) {
return BaseResult.getFailureMessageEntity("请先选择用户公司");
}
if (entity.getUserRoles() == null || entity.getUserRoles().size() == 0) {
return BaseResult.getFailureMessageEntity("请先选择用户角色");
}
entity.setPassword(null);
entity.setUpdate();
//保存
sysUserDao.update(entity);
SysUserCompanyEntity deleteCompany = new SysUserCompanyEntity();
deleteCompany.setUserId(entity.getId());
deleteCompany.setUpdate();
sysUserCompanyDao.logicRemoveMultiCondition(deleteCompany);
SysUserRolesEntity deleteRole = new SysUserRolesEntity();
deleteRole.setUserId(entity.getId());
deleteRole.setUpdate();
sysUserRolesDao.logicRemoveMultiCondition(deleteRole);
//保存用户公司
for (int i = 0; i < entity.getUserCompanys().size(); i++) {
SysUserCompanyEntity sysUserCompanyEntity = entity.getUserCompanys().get(i);
sysUserCompanyEntity.setUserId(entity.getId());
sysUserCompanyEntity.setCreate();
sysUserCompanyDao.save(sysUserCompanyEntity);
}
//保存用户角色
for (int i = 0; i < entity.getUserRoles().size(); i++) {
SysUserRolesEntity sysUserRolesEntity = entity.getUserRoles().get(i);
sysUserRolesEntity.setUserId(entity.getId());
sysUserRolesEntity.setCreate();
sysUserRolesDao.save(sysUserRolesEntity);
}
return BaseResult.getSuccessMessageEntity("修改用户成功");
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除用户
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
sysUserDao.logicRemove(entity);
//删除用户公司
SysUserCompanyEntity deleteCompany = new SysUserCompanyEntity();
deleteCompany.setUserId(entity.getId());
deleteCompany.setUpdate();
sysUserCompanyDao.logicRemoveMultiCondition(deleteCompany);
//删除用户角色
SysUserRolesEntity deleteRole = new SysUserRolesEntity();
deleteRole.setUserId(entity.getId());
deleteRole.setUpdate();
sysUserRolesDao.logicRemoveMultiCondition(deleteRole);
return BaseResult.getSuccessMessageEntity("删除用户成功");
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 启用停用用户
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getState() == null || "".equals(entity.getState())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
sysUserDao.update(entity);
//0启用 1 停用
if ("0".equals(entity.getState())) {
return BaseResult.getSuccessMessageEntity("启用用户成功");
} else {
return BaseResult.getSuccessMessageEntity("停用用户成功");
}
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 重置密码
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity resetPassword(JSONObject jsonObject) {
SysUserEntity entity = getData("jsonStr", jsonObject, SysUserEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysUserDao.get(entity.getId());
if (entity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setPassword(AESUtil.encrypt(entity.getLoginCode()+"-123456"));
entity.setUpdate();
//保存密码
sysUserDao.update(entity);
return BaseResult.getSuccessMessageEntity("重置密码成功");
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 用户权限查询
* @Date 2:37 下午 2024/3/27
**/
@Override
public JsonResultEntity jurisdiction(JSONObject jsonObject) {
JurisdictionDto entity = getData("jsonStr", jsonObject, JurisdictionDto.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getKindId() == null || "".equals(entity.getKindId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//1查询所有菜单和按钮以及选中的菜单和按钮
SysMenuConfigEntity sysMenuConfigEntity = new SysMenuConfigEntity();
sysMenuConfigEntity.setVisibles("0");
List<SysMenuConfigEntity> allMenu = sysMenuConfigDao.queryBase(sysMenuConfigEntity);
SysButtonConfigEntity sysButtonConfigEntity = new SysButtonConfigEntity();
List<SysButtonConfigEntity> allButton = sysButtonConfigDao.queryBase(sysButtonConfigEntity);
//使用的菜单
SysPopedomMenuEntity sysPopedomMenuEntity = new SysPopedomMenuEntity();
sysPopedomMenuEntity.setObjectId(entity.getId());
sysPopedomMenuEntity.setKindId(entity.getKindId());
List<SysPopedomMenuEntity> useMenu = sysPopedomMenuDao.queryBase(sysPopedomMenuEntity);
SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity();
sysPopedomOperateEntity.setObjectId(entity.getId());
sysPopedomOperateEntity.setKindId(entity.getKindId());
List<SysPopedomOperateEntity> usebutton = sysPopedomOperateDao.queryBase(sysPopedomOperateEntity);
JurisdictionVo jurisdictionVo = new JurisdictionVo();
List<MenuVo> menvVoList = setReturnMenu(allMenu,allButton,useMenu,usebutton);
jurisdictionVo.setMenvVoList(menvVoList);
//2数据权限暂时没有所以不返回
//3首页拖拽返回全部并且设置是否选中
SysHomeComponentEntity sysHomeComponentEntity = new SysHomeComponentEntity();
sysHomeComponentEntity.setState("0");
List<SysHomeComponentEntity> sysHomeComponentEntities = sysHomeComponentDao.queryBase(sysHomeComponentEntity);
SysPopedomHomeEntity sysPopedomHomeEntity = new SysPopedomHomeEntity();
sysPopedomHomeEntity.setObjectId(entity.getId());
sysPopedomHomeEntity.setKindId(entity.getKindId());
List<SysPopedomHomeEntity> useHome = sysPopedomHomeDao.queryBase(sysPopedomHomeEntity);
for (int i = 0; i < sysHomeComponentEntities.size(); i++) {
sysHomeComponentEntities.get(i).setCheck(false);
}
if(useHome != null && useHome.size() > 0){
for (int i = 0; i < useHome.size(); i++) {
for (int a = 0; a < sysHomeComponentEntities.size(); a++) {
if(useHome.get(i).getHomeId().equals(sysHomeComponentEntities.get(a).getId())){
sysHomeComponentEntities.get(a).setCheck(true);
}
}
}
}
jurisdictionVo.setHomeList(sysHomeComponentEntities);
return BaseResult.getSuccessMessageEntity("查询权限成功",jurisdictionVo);
}
/**
* @Author lvleigang
* @Description 保存权限查询
* @Date 1:46 下午 2024/4/2
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
@Override
public JsonResultEntity saveJurisdiction(JSONObject jsonObject) {
JurisdictionDto entity = getData("jsonStr", jsonObject, JurisdictionDto.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getKindId() == null || "".equals(entity.getKindId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//保存菜单
SysPopedomMenuEntity deleteMenu = new SysPopedomMenuEntity();
deleteMenu.setObjectId(entity.getId());
deleteMenu.setKindId(entity.getKindId());
deleteMenu.setUpdate();
sysPopedomMenuDao.logicRemoveMultiCondition(deleteMenu);
SysPopedomOperateEntity deleteOperate = new SysPopedomOperateEntity();
deleteOperate.setObjectId(entity.getId());
deleteOperate.setKindId(entity.getKindId());
deleteOperate.setUpdate();
sysPopedomOperateDao.logicRemoveMultiCondition(deleteOperate);
if(entity.getSysPopedomMenuEntities() != null && entity.getSysPopedomMenuEntities().size() > 0){
for (int i = 0; i < entity.getSysPopedomMenuEntities().size(); i++) {
SysPopedomMenuEntity sysPopedomMenuEntity = entity.getSysPopedomMenuEntities().get(i);
sysPopedomMenuEntity.setObjectId(entity.getId());
sysPopedomMenuEntity.setKindId(entity.getKindId());
sysPopedomMenuEntity.setCreate();
sysPopedomMenuDao.save(sysPopedomMenuEntity);
}
}
//保存按钮
if(entity.getSysPopedomOperateEntities() != null && entity.getSysPopedomOperateEntities().size() > 0){
for (int i = 0; i < entity.getSysPopedomOperateEntities().size(); i++) {
SysPopedomOperateEntity sysPopedomOperateEntity = entity.getSysPopedomOperateEntities().get(i);
sysPopedomOperateEntity.setObjectId(entity.getId());
sysPopedomOperateEntity.setKindId(entity.getKindId());
sysPopedomOperateEntity.setCreate();
sysPopedomOperateDao.save(sysPopedomOperateEntity);
}
}
//保存首页
SysPopedomHomeEntity deleteHome = new SysPopedomHomeEntity();
deleteHome.setObjectId(entity.getId());
deleteHome.setKindId(entity.getKindId());
deleteHome.setUpdate();
sysPopedomHomeDao.logicRemoveMultiCondition(deleteHome);
if(entity.getSysPopedomHomeEntities() != null && entity.getSysPopedomHomeEntities().size() > 0){
for (int i = 0; i < entity.getSysPopedomHomeEntities().size(); i++) {
SysPopedomHomeEntity sysPopedomHomeEntity = entity.getSysPopedomHomeEntities().get(i);
sysPopedomHomeEntity.setObjectId(entity.getId());
sysPopedomHomeEntity.setKindId(entity.getKindId());
sysPopedomHomeEntity.setCreate();
sysPopedomHomeDao.save(sysPopedomHomeEntity);
}
}
return BaseResult.getSuccessMessageEntity("保存权限成功");
}
/**
* @Author lvleigang
* @Description 设置返回的菜单和按钮
* @Date 11:09 上午 2024/4/2
* @param allMenu
* @param allButton
* @param useMenu
* @param usebutton
* @return java.util.List<com.hzya.frame.sys.user.entity.MenuVo>
**/
private List<MenuVo> setReturnMenu(List<SysMenuConfigEntity> allMenu, List<SysButtonConfigEntity> allButton, List<SysPopedomMenuEntity> useMenu, List<SysPopedomOperateEntity> usebutton) {
List<MenuVo> menuVos = new ArrayList<>();
//设置菜单和按钮是否选中
for (int i = 0; i < allMenu.size(); i++) {
allMenu.get(i).setCheck(false);
}
if(useMenu != null && useMenu.size() > 0){
for (int i = 0; i < allMenu.size(); i++) {
for (int a = 0; a < useMenu.size(); a++) {
if(allMenu.get(i).getId().equals(useMenu.get(a).getMenuId())){
allMenu.get(i).setCheck(true);
}
}
}
}
for (int i = 0; i < allButton.size(); i++) {
allButton.get(i).setCheck(false);
}
if(usebutton != null && usebutton.size() > 0){
for (int i = 0; i < allButton.size(); i++) {
for (int a = 0; a < usebutton.size(); a++) {
if(allButton.get(i).getId().equals(usebutton.get(a).getOperate())){
allButton.get(i).setCheck(true);
}
}
}
}
//组装菜单树
if (allMenu != null && allMenu.size() > 0) {
for (int i = 0; i < allMenu.size(); i++) {
if ("0".equals(allMenu.get(i).getParentMenuId())) {
menuVos.add(recursiveSetUseTree(allMenu.get(i), allMenu,allButton));
}
}
}
return menuVos;
}
/**
* @param sysMenuConfigEntity
* @param sysMenuConfigEntities
* @return com.hzya.frame.sys.menuConfig.entity.ModuleVo
* @Author lvleigang
* @Description
* @Date 9:21 上午 2024/4/2
**/
private MenuVo recursiveSetUseTree(SysMenuConfigEntity sysMenuConfigEntity, List<SysMenuConfigEntity> sysMenuConfigEntities,List<SysButtonConfigEntity> allButton) {
MenuVo moduleVo = new MenuVo();
moduleVo.setId(sysMenuConfigEntity.getId());
moduleVo.setName(sysMenuConfigEntity.getMenuName());
moduleVo.setCheck(sysMenuConfigEntity.isCheck());
JSONObject meta = new JSONObject();
meta.put("title", sysMenuConfigEntity.getMenuName());
moduleVo.setMeta(meta);
List<MenuVo> children = new ArrayList<>();
for (int i = 0; i < sysMenuConfigEntities.size(); i++) {
if (sysMenuConfigEntity.getId().equals(sysMenuConfigEntities.get(i).getParentMenuId())) {
children.add(recursiveSetUseTree(sysMenuConfigEntities.get(i),sysMenuConfigEntities,allButton));
}
}
List<SysButtonConfigEntity> sysButtonConfigEntities = new ArrayList<>();
for (int i = 0; i < allButton.size(); i++) {
if(allButton.get(i).getMenuId().equals(sysMenuConfigEntity.getId())){
sysButtonConfigEntities.add(allButton.get(i));
}
}
moduleVo.setButtonList(sysButtonConfigEntities);
moduleVo.setChildren(children);
return moduleVo;
}
}