Merge remote-tracking branch 'origin/master'

This commit is contained in:
paidaxing444
2020-04-18 20:08:28 +08:00
11 changed files with 460 additions and 282 deletions

View File

@ -103,7 +103,7 @@ public class BySchoolController extends BaseController
{
//从school表中取出当前最大的ID值 并且将其赋值给dept中的ordernumber
String maxId = jdbcTemplate.queryForObject(String.format("select MAX(id) from by_school"),String.class);
//生成32位UUID
String uuid = getUUID32();
//将UUID赋值给xxdm
@ -114,12 +114,19 @@ public class BySchoolController extends BaseController
//创建dept实例 并且向要添加的dept中设置各个参数
SysDept dept = new SysDept();
if (maxId != "0")
{
dept.setOrderNum(maxId);
System.out.println("------------" + maxId);
}else
{
dept.setOrderNum("6");
}
dept.setSchoolId(bySchool.getXxdm());
dept.setCreateBy(SecurityUtils.getUsername());
dept.setParentId(200L);
dept.setAncestors("0,100,200");
dept.setDeptName(bySchool.getSchoolName());
dept.setOrderNum(maxId);
dept.setPhone(bySchool.getTel());
dept.setLeader(SecurityUtils.getUsername());
//插入数据
@ -136,6 +143,16 @@ public class BySchoolController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody BySchool bySchool)
{
//创建dept实例 并且向要添加的dept中设置各个参数
SysDept dept = new SysDept();
//设置schoolID为xxdm
dept.setSchoolId(bySchool.getXxdm());
//通过selectdeptlist来获取deptid
dept.setDeptId(deptService.selectDeptList(dept).get(0).getDeptId());
dept.setStatus(bySchool.getStatus());
deptService.updateDept(dept);
return toAjax(bySchoolService.updateBySchool(bySchool));
}
@ -147,6 +164,31 @@ public class BySchoolController extends BaseController
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
//遍历ids
for (int i=0;i<ids.length;i++)
{
//循环找出school表的id
Long bySchId = ids[i];
//用school表ID获取xxdm的值
//将值赋给dept中的schoolID
SysDept dept = new SysDept();
dept.setSchoolId(bySchoolService.selectBySchoolById(bySchId).getXxdm());
//通过dept表的schoolID来找出dept的List
deptService.deleteDeptById(deptService.selectDeptList(dept).get(0).getDeptId());
}
return toAjax(bySchoolService.deleteBySchoolByIds(ids));
}
}

View File

@ -88,9 +88,9 @@ public class BySchool extends BaseEntity
@Excel(name = "紧急联系电话")
private String emTel;
/** 状态0试用1开通2停用,3禁用) */
@Excel(name = "状态", readConverterExp = "0=试用1开通2停用,3禁")
private Long status;
/** 状态0正常1停用) */
@Excel(name = "状态", readConverterExp = "0=正常1停")
private String status;
/** 幼儿园规模 */
@Excel(name = "幼儿园规模")
@ -140,6 +140,12 @@ public class BySchool extends BaseEntity
@Excel(name = "当前学期")
private String dqxq;
/** 删除标志0代表存在 2代表删除 */
private String isDel;
//部门
private SysDept dept;
@ -295,12 +301,12 @@ public class BySchool extends BaseEntity
{
return emTel;
}
public void setStatus(Long status)
public void setStatus(String status)
{
this.status = status;
}
public Long getStatus()
public String getStatus()
{
return status;
}
@ -421,7 +427,13 @@ public class BySchool extends BaseEntity
this.xxdm = xxdm;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
@ -459,6 +471,7 @@ public class BySchool extends BaseEntity
.append("dqxn", getDqxn())
.append("dqxq", getDqxq())
.append("dept", getDept())
.append("isDel",getIsDel())
.toString();
}

View File

@ -37,6 +37,9 @@ public class SysPost extends BaseEntity
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 用途1幼儿园 2系统 */
private String purp;
/** 用户是否存在此岗位标识 默认不存在 */
private boolean flag = false;
@ -104,6 +107,14 @@ public class SysPost extends BaseEntity
{
this.flag = flag;
}
public String getPurp() {
return purp;
}
public void setPurp(String purp) {
this.purp = purp;
}
@Override
public String toString() {
@ -118,6 +129,9 @@ public class SysPost extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("purp", getPurp())
.toString();
}
}

View File

@ -1,197 +1,209 @@
package com.ruoyi.project.system.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 角色表 sys_role
*
* @author ruoyi
*/
public class SysRole extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 角色ID */
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
private Long roleId;
/** 角色名称 */
@Excel(name = "角色名称")
private String roleName;
/** 角色权限 */
@Excel(name = "角色权限")
private String roleKey;
/** 角色排序 */
@Excel(name = "角色排序")
private String roleSort;
/** 数据范围1所有数据权限2自定义数据权限3本部门数据权限4本部门及以下数据权限 */
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
private String dataScope;
/** 角色状态0正常 1停用 */
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 用户是否存在此角色标识 默认不存在 */
private boolean flag = false;
/** 菜单组 */
private Long[] menuIds;
/** 部门组(数据权限) */
private Long[] deptIds;
public SysRole()
{
}
public SysRole(Long roleId)
{
this.roleId = roleId;
}
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public boolean isAdmin()
{
return isAdmin(this.roleId);
}
public static boolean isAdmin(Long roleId)
{
return roleId != null && 1L == roleId;
}
@NotBlank(message = "角色名称不能为空")
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
public String getRoleName()
{
return roleName;
}
public void setRoleName(String roleName)
{
this.roleName = roleName;
}
@NotBlank(message = "权限字符不能为空")
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
public String getRoleKey()
{
return roleKey;
}
public void setRoleKey(String roleKey)
{
this.roleKey = roleKey;
}
@NotBlank(message = "显示顺序不能为空")
public String getRoleSort()
{
return roleSort;
}
public void setRoleSort(String roleSort)
{
this.roleSort = roleSort;
}
public String getDataScope()
{
return dataScope;
}
public void setDataScope(String dataScope)
{
this.dataScope = dataScope;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getDelFlag()
{
return delFlag;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public boolean isFlag()
{
return flag;
}
public void setFlag(boolean flag)
{
this.flag = flag;
}
public Long[] getMenuIds()
{
return menuIds;
}
public void setMenuIds(Long[] menuIds)
{
this.menuIds = menuIds;
}
public Long[] getDeptIds()
{
return deptIds;
}
public void setDeptIds(Long[] deptIds)
{
this.deptIds = deptIds;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("roleName", getRoleName())
.append("roleKey", getRoleKey())
.append("roleSort", getRoleSort())
.append("dataScope", getDataScope())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package com.ruoyi.project.system.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 角色表 sys_role
*
* @author ruoyi
*/
public class SysRole extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 角色ID */
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
private Long roleId;
/** 角色名称 */
@Excel(name = "角色名称")
private String roleName;
/** 角色权限 */
@Excel(name = "角色权限")
private String roleKey;
/** 角色排序 */
@Excel(name = "角色排序")
private String roleSort;
/** 数据范围1所有数据权限2自定义数据权限3本部门数据权限4本部门及以下数据权限 */
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
private String dataScope;
/** 角色状态0正常 1停用 */
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 用户是否存在此角色标识 默认不存在 */
private boolean flag = false;
/** 菜单组 */
private Long[] menuIds;
/** 部门组(数据权限) */
private Long[] deptIds;
/** 角色用途 (1代表幼儿园 2代表系统) */
private String purpose;
public SysRole()
{
}
public SysRole(Long roleId)
{
this.roleId = roleId;
}
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public boolean isAdmin()
{
return isAdmin(this.roleId);
}
public static boolean isAdmin(Long roleId)
{
return roleId != null && 1L == roleId;
}
@NotBlank(message = "角色名称不能为空")
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
public String getRoleName()
{
return roleName;
}
public void setRoleName(String roleName)
{
this.roleName = roleName;
}
@NotBlank(message = "权限字符不能为空")
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
public String getRoleKey()
{
return roleKey;
}
public void setRoleKey(String roleKey)
{
this.roleKey = roleKey;
}
@NotBlank(message = "显示顺序不能为空")
public String getRoleSort()
{
return roleSort;
}
public void setRoleSort(String roleSort)
{
this.roleSort = roleSort;
}
public String getDataScope()
{
return dataScope;
}
public void setDataScope(String dataScope)
{
this.dataScope = dataScope;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getDelFlag()
{
return delFlag;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public boolean isFlag()
{
return flag;
}
public void setFlag(boolean flag)
{
this.flag = flag;
}
public Long[] getMenuIds()
{
return menuIds;
}
public void setMenuIds(Long[] menuIds)
{
this.menuIds = menuIds;
}
public Long[] getDeptIds()
{
return deptIds;
}
public void setDeptIds(Long[] deptIds)
{
this.deptIds = deptIds;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("roleName", getRoleName())
.append("roleKey", getRoleKey())
.append("roleSort", getRoleSort())
.append("dataScope", getDataScope())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("purpose", getPurpose())
.toString();
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
}

View File

@ -37,45 +37,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="openDeadline" column="open_deadline" />
<result property="dqxn" column="dqxn" />
<result property="dqxq" column="dqxq" />
<result property="isDel" column="is_del" />
</resultMap>
<sql id="selectBySchoolVo">
select id, xxdm, school_name, name_short, type, parent_id, province, provincename, regionid, regionname, area, areaname, address, mastername, tel, em_man, em_tel, status, scale, create_time, create_user, approval_user, approval_time, remark, location, is_demonstr, businesslicenseimg, open_book, fee_status, open_deadline, dqxn, dqxq from by_school
select id, xxdm, school_name, name_short, type, parent_id, province, provincename, regionid, regionname, area, areaname, address, mastername, tel, em_man, em_tel, status, scale, create_time, create_user, approval_user, approval_time, remark, location, is_demonstr, businesslicenseimg, open_book, fee_status, open_deadline, dqxn, dqxq, is_del from by_school
</sql>
<select id="selectBySchoolList" parameterType="BySchool" resultMap="BySchoolResult">
<include refid="selectBySchoolVo"/>
<where>
<if test="xxdm != null and xxdm != ''"> and xxdm like concat('%', #{xxdm}, '%')</if>
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
<if test="nameShort != null and nameShort != ''"> and name_short = #{nameShort}</if>
<if test="type != null "> and type = #{type}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="provincename != null and provincename != ''"> and provincename like concat('%', #{provincename}, '%')</if>
<if test="regionid != null and regionid != ''"> and regionid = #{regionid}</if>
<if test="regionname != null and regionname != ''"> and regionname like concat('%', #{regionname}, '%')</if>
<if test="area != null and area != ''"> and area = #{area}</if>
<if test="areaname != null and areaname != ''"> and areaname like concat('%', #{areaname}, '%')</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="mastername != null and mastername != ''"> and mastername like concat('%', #{mastername}, '%')</if>
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
<if test="emMan != null and emMan != ''"> and em_man = #{emMan}</if>
<if test="emTel != null and emTel != ''"> and em_tel = #{emTel}</if>
<if test="status != null "> and status = #{status}</if>
<if test="scale != null "> and scale = #{scale}</if>
<if test="createUser != null "> and create_user = #{createUser}</if>
<if test="approvalUser != null "> and approval_user = #{approvalUser}</if>
<if test="approvalTime != null "> and approval_time = #{approvalTime}</if>
<if test="location != null and location != ''"> and location = #{location}</if>
<if test="isDemonstr != null "> and is_demonstr = #{isDemonstr}</if>
<if test="businesslicenseimg != null and businesslicenseimg != ''"> and businesslicenseimg = #{businesslicenseimg}</if>
<if test="openBook != null "> and open_book = #{openBook}</if>
<if test="feeStatus != null "> and fee_status = #{feeStatus}</if>
<if test="openDeadline != null "> and open_deadline = #{openDeadline}</if>
<if test="dqxn != null and dqxn != ''"> and dqxn = #{dqxn}</if>
<if test="dqxq != null and dqxq != ''"> and dqxq = #{dqxq}</if>
</where>
where is_del = '0'
<if test="xxdm != null and xxdm != ''"> and xxdm like concat('%', #{xxdm}, '%')</if>
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
<if test="nameShort != null and nameShort != ''"> and name_short = #{nameShort}</if>
<if test="type != null "> and type = #{type}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="provincename != null and provincename != ''"> and provincename like concat('%', #{provincename}, '%')</if>
<if test="regionid != null and regionid != ''"> and regionid = #{regionid}</if>
<if test="regionname != null and regionname != ''"> and regionname like concat('%', #{regionname}, '%')</if>
<if test="area != null and area != ''"> and area = #{area}</if>
<if test="areaname != null and areaname != ''"> and areaname like concat('%', #{areaname}, '%')</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="mastername != null and mastername != ''"> and mastername like concat('%', #{mastername}, '%')</if>
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
<if test="emMan != null and emMan != ''"> and em_man = #{emMan}</if>
<if test="emTel != null and emTel != ''"> and em_tel = #{emTel}</if>
<if test="status != null "> and status = #{status}</if>
<if test="scale != null "> and scale = #{scale}</if>
<if test="createUser != null "> and create_user = #{createUser}</if>
<if test="approvalUser != null "> and approval_user = #{approvalUser}</if>
<if test="approvalTime != null "> and approval_time = #{approvalTime}</if>
<if test="location != null and location != ''"> and location = #{location}</if>
<if test="isDemonstr != null "> and is_demonstr = #{isDemonstr}</if>
<if test="businesslicenseimg != null and businesslicenseimg != ''"> and businesslicenseimg = #{businesslicenseimg}</if>
<if test="openBook != null "> and open_book = #{openBook}</if>
<if test="feeStatus != null "> and fee_status = #{feeStatus}</if>
<if test="openDeadline != null "> and open_deadline = #{openDeadline}</if>
<if test="dqxn != null and dqxn != ''"> and dqxn = #{dqxn}</if>
<if test="dqxq != null and dqxq != ''"> and dqxq = #{dqxq}</if>
</select>
<select id="selectBySchoolById" parameterType="Long" resultMap="BySchoolResult">
@ -196,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteBySchoolByIds" parameterType="String">
delete from by_school where id in
update by_school set is_del = '2' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -40,6 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="schoolId != null and schoolId != ''">
AND school_id = #{schoolId}
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by d.parent_id, d.order_num
@ -152,4 +155,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>

View File

@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="purp" column="purp" />
</resultMap>
<sql id="selectPostVo">
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark, purp
from sys_post
</sql>
@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="postName != null and postName != ''">post_name = #{postName},</if>
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="purp != null and purp != ''">purp = #{purp},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="postName != null and postName != ''">post_name,</if>
<if test="postSort != null and postSort != ''">post_sort,</if>
<if test="status != null and status != ''">status,</if>
<if test="purp != null and purp != ''">purp,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
@ -102,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="postName != null and postName != ''">#{postName},</if>
<if test="postSort != null and postSort != ''">#{postSort},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="purp != null and purp != ''">#{purp},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()

View File

@ -17,11 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="purpose" column="purpose" />
</resultMap>
<sql id="selectRoleVo">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.status, r.del_flag, r.create_time, r.remark
r.status, r.del_flag, r.create_time, r.remark, r.purpose
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
@ -96,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataScope != null and dataScope != ''">data_scope,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="purpose != null and purpose != ''">purpose,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
@ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
@ -119,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="purpose != null and purpose != ''">purpose = #{purpose},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()