11
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.yxt.portal.apiadmin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
@@ -111,9 +112,10 @@ public class DictCommonRest {
|
||||
if (null == dictCommon) {
|
||||
return ResultBean.fireFail().setMsg("该数据项不存在");
|
||||
}
|
||||
if (0 == dictCommonService.deleteBySid(sid)) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
dictCommonService.update(dictCommon,new QueryWrapper<DictCommon>().eq("sid",sid));
|
||||
// if (0 == ) {
|
||||
// return ResultBean.fireFail().setMsg("删除失败");
|
||||
// }
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yxt.portal.apiadmin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
@@ -97,9 +98,7 @@ public class DictTypeRest{
|
||||
if (dictCommon.size() > 0) {
|
||||
return ResultBean.fireFail().setMsg("该数据字典类型下存在数据项,请先删除该类下的数据项");
|
||||
}
|
||||
if (0 == dictTypeService.deleteBySid(sid)) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
dictTypeService.update(dictType,new QueryWrapper<DictType>().eq("sid",sid));
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,19 +347,27 @@ public class SysMenuRest {
|
||||
* @param sid 菜单sid
|
||||
* @return
|
||||
*/
|
||||
// @ApiOperation("删除记录 根据sid")
|
||||
// @GetMapping("/delBySids/{sid}")
|
||||
// public ResultBean delBySids(@PathVariable("sid") String sid) {
|
||||
// ResultBean rb = ResultBean.fireFail();
|
||||
// SysMenu sysMenu = sysMenuService.fetchBySid(sid);
|
||||
// if (sysMenu == null) {
|
||||
// return rb.setMsg("该菜单不存在");
|
||||
// }
|
||||
//// sysSourceMenuService.delByMenuSid(sid);
|
||||
// sysMenuService.deleteBySid(sid);
|
||||
// return rb.success();
|
||||
// }
|
||||
@ApiOperation("删除记录 根据sid")
|
||||
@GetMapping("/delBySids/{sid}")
|
||||
public ResultBean delBySids(@PathVariable("sid") String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
SysMenu sysMenu = sysMenuService.fetchBySid(sid);
|
||||
if (sysMenu == null) {
|
||||
return rb.setMsg("该菜单不存在");
|
||||
}
|
||||
// sysSourceMenuService.delByMenuSid(sid);
|
||||
sysMenuService.deleteBySid(sid);
|
||||
sysMenu.setIsDelete(1);
|
||||
sysMenuService.update(sysMenu,new QueryWrapper<SysMenu>().eq("sid",sid));
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public ResultBean<SysMenuVo> fetch(String id) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
|
||||
@@ -210,10 +210,10 @@ public class SysOrganizationRest{
|
||||
return ResultBean.fireFail().setMessage("sid不能为空!");
|
||||
}
|
||||
String[] sidArr = sid.split(",");
|
||||
sysOrganizationService.delBySids(sidArr);
|
||||
for (String s : sidArr) {
|
||||
sysStaffOrgService.delByOrgSid(s);
|
||||
}
|
||||
sysOrganizationService.updateIsDelete(sidArr);
|
||||
// for (String s : sidArr) {
|
||||
// sysStaffOrgService.delByOrgSid(s);
|
||||
// }
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class SysPostRest {
|
||||
public ResultBean delBySids(@PathVariable("sids") String sids){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
String[] sidArr = sids.split(",");
|
||||
sysPostService.delBySids(sidArr);
|
||||
sysPostService.updateIsDelete(sidArr);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
|
||||
107
src/main/java/com/yxt/portal/apiadmin/SystemLogRest.java
Normal file
107
src/main/java/com/yxt/portal/apiadmin/SystemLogRest.java
Normal file
@@ -0,0 +1,107 @@
|
||||
package com.yxt.portal.apiadmin;
|
||||
|
||||
import com.yxt.common.base.utils.WebUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.portal.biz.systemlog.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogFeignFallback.java <br/>
|
||||
* Class: com.yxt.anrui.portal.biz.systemlog.SystemLogRest <br/>
|
||||
* Description: 系统日志表. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Api(tags = "系统日志表")
|
||||
@RestController
|
||||
@RequestMapping("apiadmin/systemlog")
|
||||
public class SystemLogRest {
|
||||
|
||||
@Resource
|
||||
private SystemLogService systemLogService;
|
||||
|
||||
@ApiOperation("根据条件分页查询数据的列表")
|
||||
@PostMapping("/listPage")
|
||||
public ResultBean<PagerVo<SystemLogVo>> listPage(@RequestBody PagerQuery<SystemLogQuery> pq){
|
||||
SystemLogDto systemLogDto = SystemLogDto.builder()
|
||||
.userIp(WebUtil.getIp())
|
||||
.eventContent("日志列表查询")
|
||||
.eventName("日志列表查询")
|
||||
.eventUrl("/v1/systemlog/listPage")
|
||||
.userName("")
|
||||
.userSid("")
|
||||
.build();
|
||||
systemLogService.saveOrUpdateDto(systemLogDto);
|
||||
SystemLog log=new SystemLog();
|
||||
log.setEventName("日志列表查询");
|
||||
log.setEventContent("日志列表查询");
|
||||
log.setUserName("");
|
||||
log.setUserIp("0.0.0.0");
|
||||
systemLogService.save(log);
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
PagerVo<SystemLogVo> pv = systemLogService.listPageVo(pq);
|
||||
return rb.success().setData(pv);
|
||||
}
|
||||
|
||||
@ApiOperation("根据条件查询所有数据列表")
|
||||
@PostMapping("/listAll")
|
||||
public ResultBean<List<SystemLogVo>> listAll(@RequestBody SystemLogQuery query){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SystemLogVo> list = systemLogService.listAllVo(query);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据列表")
|
||||
@GetMapping("/list")
|
||||
public ResultBean<List<SystemLogVo>> list(){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SystemLogVo> list = systemLogService.listVo();
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("新增保存")
|
||||
@PostMapping("/save")
|
||||
public ResultBean save(SystemLogDto dto){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
systemLogService.saveOrUpdateDto(dto);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改保存")
|
||||
@PostMapping("/update/{sid}")
|
||||
public ResultBean update(SystemLogDto dto,String sid){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
systemLogService.updateBySid(dto.toMap(),sid);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@ApiOperation("删除记录")
|
||||
@GetMapping("/del/{ids}")
|
||||
public ResultBean del(String ids){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
systemLogService.delByIds(ids);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取一条记录")
|
||||
@GetMapping("/fetch/{id}")
|
||||
public ResultBean<SystemLogVo> fetch(String id){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
SystemLogVo vo = systemLogService.fetchByIdVo(id);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
<select id="selectByType" resultType="com.yxt.portal.biz.dictcommon.DictCommon">
|
||||
SELECT *
|
||||
FROM dict_common
|
||||
WHERE dictType = #{dictTypeCode}
|
||||
WHERE dictType = #{dictTypeCode} and isDelete !="1"
|
||||
</select>
|
||||
|
||||
<select id="pageList" resultType="com.yxt.portal.biz.dictcommon.DictCommonVo">
|
||||
@@ -38,6 +38,6 @@
|
||||
</select>
|
||||
|
||||
<select id="getList" resultType="com.yxt.portal.biz.dictcommon.DictCommonVo">
|
||||
select * from dict_common dc where dc.dictType = #{type} and find_in_set(#{groupNum}, replace(dc.groupName, ',', ','));
|
||||
select * from dict_common dc where dc.dictType = #{type} and isDelete !="1" and find_in_set(#{groupNum}, replace(dc.groupName, ',', ','));
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -44,6 +44,7 @@ public class DictCommonService extends MybatisBaseService<DictCommonMapper, Dict
|
||||
qw.eq("dc.dictType", params.getDictType());
|
||||
}
|
||||
}
|
||||
qw.ne("dc.isDelete","1");
|
||||
qw.orderByDesc("dc.createTime");
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
@@ -62,6 +63,7 @@ public class DictCommonService extends MybatisBaseService<DictCommonMapper, Dict
|
||||
if (StringUtils.isNotBlank(dictCommonTypeQuery.getPsid())) {//父级sid
|
||||
qw.eq("dc.parentSid", dictCommonTypeQuery.getPsid());
|
||||
}
|
||||
qw.ne("dc.isDelete","1");
|
||||
return baseMapper.getValue(qw);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ public class DictTypeService extends MybatisBaseService<DictTypeMapper, DictType
|
||||
qw.like("dt.remarks", params.getRemarks());
|
||||
}
|
||||
}
|
||||
qw.ne("dt.isDelete","1");
|
||||
qw.orderByDesc("dt.createTime");
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
@@ -62,5 +62,4 @@ public class SysMenu extends BaseEntity {
|
||||
@ApiModelProperty("菜单类型(0左侧当行菜单,1页面中功能)")
|
||||
private String menuType;
|
||||
private String cid;
|
||||
private String btnKey;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,4 @@ public class SysMenuDto implements Dto {
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
private String cid;
|
||||
private String btnKey;
|
||||
}
|
||||
@@ -74,6 +74,7 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
|
||||
List<SysMenu> selectByMenuUrl(String menuUrl);
|
||||
|
||||
|
||||
/**
|
||||
* 查询该资源下一级菜单列表
|
||||
*
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
(select name from sys_menu where sid=menu.pSid) as pName
|
||||
FROM sys_menu menu
|
||||
left join sys_source source on source.sid = menu.sourceSid
|
||||
where menu.pSid = #{sid}
|
||||
where menu.pSid = #{sid} and menu.isDelete !="1"
|
||||
ORDER BY menu.sortNo ASC
|
||||
</select>
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> {
|
||||
if (StringUtils.isNotBlank(query.getMenuType())) {
|
||||
qw.eq("menuType", query.getMenuType());
|
||||
}
|
||||
qw.ne("isDelete","1");
|
||||
return qw;
|
||||
}
|
||||
|
||||
@@ -448,6 +449,8 @@ public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> {
|
||||
return baseMapper.selectByMenuUrl(menuUrl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据资源sid查询该资源下的一级菜单列表(yxt_mtl 2024-01-31)
|
||||
*
|
||||
|
||||
@@ -61,5 +61,4 @@ public class SysMenuTreeVo implements Vo {
|
||||
@ApiModelProperty("子菜单")
|
||||
private List<SysMenuTreeVo> children;
|
||||
private String orgSid;
|
||||
private String btnKey;
|
||||
}
|
||||
|
||||
@@ -72,5 +72,4 @@ public class SysMenuVo implements Vo {
|
||||
@ApiModelProperty("资源名称")
|
||||
private String sourceName;
|
||||
private String cid;
|
||||
private String btnKey;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public interface SysOrganizationMapper extends BaseMapper<SysOrganization> {
|
||||
@Select("SELECT * FROM sys_organization")
|
||||
List<SysOrganizationVo> selectListVo();
|
||||
|
||||
Integer updateIsDelete(List<String> list);
|
||||
@Select("SELECT name FROM sys_organization WHERE sid=#{sid}")
|
||||
String selectOrgnameBySid(@Param("sid") String sid);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<select id="selectFirstOrgList" resultType="com.yxt.portal.biz.sysorganization.SysOrganizationVo">
|
||||
SELECT sid, name, psid, orgCode
|
||||
FROM sys_organization
|
||||
WHERE psid = '0'
|
||||
WHERE psid = '0' and isDelete!="1"
|
||||
<if test="orgSid!=null and orgSid!=''">
|
||||
and sid=#{orgSid}
|
||||
</if>
|
||||
@@ -56,7 +56,14 @@
|
||||
WHERE psid = #{psid}
|
||||
ORDER BY sort ASC
|
||||
</select>
|
||||
|
||||
<update id="updateIsDelete">
|
||||
UPDATE sys_organization
|
||||
SET isDelete=1
|
||||
where sid in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
<select id="selectOrgSidPath" resultType="java.lang.String">
|
||||
SELECT orgSidPath
|
||||
FROM sys_organization WHERE 1 = 1
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
@@ -90,7 +91,7 @@ public class SysOrganizationService extends MybatisBaseService<SysOrganizationMa
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.eq("name", query.getName());
|
||||
qw.like("name", query.getName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getPsid())) {
|
||||
@@ -128,6 +129,7 @@ public class SysOrganizationService extends MybatisBaseService<SysOrganizationMa
|
||||
if (StringUtils.isNotBlank(query.getOrgCode())) {
|
||||
qw.eq("orgCode", query.getOrgCode());
|
||||
}
|
||||
qw.ne("isDelete","1");
|
||||
return qw;
|
||||
}
|
||||
|
||||
@@ -272,7 +274,9 @@ public class SysOrganizationService extends MybatisBaseService<SysOrganizationMa
|
||||
entity.setOrgSidPath(sysOrganization.getOrgSidPath() + "/" + entity.getSid());
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
public void updateIsDelete(String[] sidArr) {
|
||||
int updateIsDelete=baseMapper.updateIsDelete(Arrays.stream(sidArr).collect(Collectors.toList()));
|
||||
}
|
||||
public SysOrganizationVo fetchByIdVo(String id) {
|
||||
SysOrganization entity = this.fetchById(id);
|
||||
SysOrganizationVo vo = new SysOrganizationVo();
|
||||
|
||||
@@ -35,7 +35,7 @@ public interface SysPostMapper extends BaseMapper<SysPost> {
|
||||
|
||||
@Select("select * from sys_post")
|
||||
List<SysPostVo> selectListVo();
|
||||
|
||||
Integer updateIsDelete( List<String> list);
|
||||
@Select("select * from sys_post where sid=#{sid} ")
|
||||
SysPost fetchBySid(@Param("sid") String sid);
|
||||
|
||||
|
||||
@@ -30,6 +30,14 @@
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<update id="updateIsDelete">
|
||||
UPDATE sys_post
|
||||
SET isDelete=1
|
||||
where sid in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
<!--根据部门sid查询该部门下的所有岗位列表-->
|
||||
<select id="selectListOne" resultType="com.yxt.portal.biz.syspost.SysPostListVo">
|
||||
select name, postCode, sid
|
||||
|
||||
@@ -13,7 +13,9 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
@@ -60,6 +62,7 @@ public class SysPostService extends MybatisBaseService<SysPostMapper, SysPost> {
|
||||
// if (StringUtils.isNotBlank(query.getOrgSid())) {
|
||||
// qw.eq("post.orgSid", query.getOrgSid());
|
||||
// }
|
||||
qw.ne("post.isDelete","1");
|
||||
return qw;
|
||||
}
|
||||
|
||||
@@ -86,7 +89,9 @@ public class SysPostService extends MybatisBaseService<SysPostMapper, SysPost> {
|
||||
dto.fillEntity(entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
public void updateIsDelete(String[] sidArr) {
|
||||
int updateIsDelete=baseMapper.updateIsDelete(Arrays.stream(sidArr).collect(Collectors.toList()));
|
||||
}
|
||||
public SysPostVo fetchByIdVo(String id) {
|
||||
SysPost entity = this.fetchById(id);
|
||||
SysPostVo vo = new SysPostVo();
|
||||
|
||||
@@ -46,6 +46,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
int deleteBatchSids(List<String> list);
|
||||
|
||||
int deleteBySid(String valueOf);
|
||||
Integer updateIsDelete(List<String> list);
|
||||
|
||||
SysRoleVo fetchBySid(String sid);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
SELECT role.name, role.sid, ISNULL(userRole.sid) AS checked
|
||||
FROM sys_role role
|
||||
LEFT JOIN sys_user_role userRole ON role.sid = userRole.`roleSid`
|
||||
AND userRole.userSid = #{userSid} and role.isEnable="1"
|
||||
AND userRole.userSid = #{userSid} and role.isEnable="1" and role.isDelete !="1"
|
||||
where
|
||||
role.orgSid=#{orgSid}
|
||||
</select>
|
||||
@@ -71,7 +71,14 @@
|
||||
FROM sys_role
|
||||
WHERE sid = #{sid}
|
||||
</delete>
|
||||
|
||||
<update id="updateIsDelete">
|
||||
UPDATE sys_role
|
||||
SET isDelete=1
|
||||
where sid in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateIsEnable">
|
||||
UPDATE sys_role
|
||||
SET isEnable = #{isEnable}
|
||||
|
||||
@@ -14,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
@@ -72,6 +74,7 @@ public class SysRoleService extends MybatisBaseService<SysRoleMapper, SysRole> {
|
||||
qw.eq("sr.orgSid", query.getOrgSid());
|
||||
}
|
||||
qw.eq("sr.isEnable","1");
|
||||
qw.ne("sr.isDelete","1");
|
||||
return qw;
|
||||
}
|
||||
|
||||
@@ -130,19 +133,20 @@ public class SysRoleService extends MybatisBaseService<SysRoleMapper, SysRole> {
|
||||
*/
|
||||
public int delBySids(String sids) {
|
||||
String[] split = sids.split(",");
|
||||
if (split.length < 1) {
|
||||
return 0;
|
||||
} else if (split.length == 1) {
|
||||
//删除该角色下的用户关联
|
||||
sysUserRoleService.deleteByRoleSid(sids);
|
||||
return baseMapper.deleteBySid(sids);
|
||||
} else {
|
||||
List<String> list = new ArrayList<>();
|
||||
for (String sid : split) {
|
||||
list.add(sid);
|
||||
}
|
||||
return baseMapper.deleteBatchSids(list);
|
||||
}
|
||||
return baseMapper.updateIsDelete(Arrays.stream(split).collect(Collectors.toList()));
|
||||
// if (split.length < 1) {
|
||||
// return 0;
|
||||
// } else if (split.length == 1) {
|
||||
// //删除该角色下的用户关联
|
||||
// sysUserRoleService.deleteByRoleSid(sids);
|
||||
// return baseMapper.updateIsDelete(sids);
|
||||
// } else {
|
||||
// List<String> list = new ArrayList<>();
|
||||
// for (String sid : split) {
|
||||
// list.add(sid);
|
||||
// }
|
||||
// return baseMapper.deleteBatchSids(list);
|
||||
// }
|
||||
}
|
||||
|
||||
public SysRoleVo fetchBySidVo(String sid) {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class SysRoleAuthorizeService extends MybatisBaseService<SysRoleAuthorize
|
||||
}
|
||||
qw.eq("m.isShow", 1);
|
||||
qw.orderByAsc("m.sortNo");
|
||||
qw.ne("m.isDelete","1");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
44
src/main/java/com/yxt/portal/biz/systemlog/SystemLog.java
Normal file
44
src/main/java/com/yxt/portal/biz/systemlog/SystemLog.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLog.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.systemlog.SystemLog <br/>
|
||||
* Description: 系统日志表. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(value = "系统日志表", description = "系统日志表")
|
||||
@TableName("system_log")
|
||||
@Data
|
||||
public class SystemLog extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty("事件名称或类别")
|
||||
private String eventName;
|
||||
|
||||
@ApiModelProperty("事件内容")
|
||||
private String eventContent;
|
||||
|
||||
@ApiModelProperty("事件url")
|
||||
private String eventUrl;
|
||||
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户iP")
|
||||
private String userIp;
|
||||
}
|
||||
46
src/main/java/com/yxt/portal/biz/systemlog/SystemLogDto.java
Normal file
46
src/main/java/com/yxt/portal/biz/systemlog/SystemLogDto.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogDto.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.systemlog.SystemLogDto <br/>
|
||||
* Description: 系统日志表 数据传输对象. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Builder
|
||||
@ApiModel(value = "系统日志表 数据传输对象", description = "系统日志表 数据传输对象")
|
||||
@Data
|
||||
public class SystemLogDto implements Dto {
|
||||
|
||||
|
||||
@ApiModelProperty("事件名称或类别")
|
||||
private String eventName;
|
||||
|
||||
@ApiModelProperty("事件内容")
|
||||
private String eventContent;
|
||||
|
||||
@ApiModelProperty("事件url")
|
||||
private String eventUrl;
|
||||
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户iP")
|
||||
private String userIp;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogMapper.java <br/>
|
||||
* Class: com.yxt.anrui.portal.biz.systemlog.SystemLogMapper <br/>
|
||||
* Description: 系统日志表. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SystemLogMapper extends BaseMapper<SystemLog> {
|
||||
|
||||
//@Update("update system_log set name=#{msg} where id=#{id}")
|
||||
//IPage<SystemLogVo> voPage(IPage<SystemLog> page, @Param(Constants.WRAPPER) QueryWrapper<SystemLog> qw);
|
||||
|
||||
IPage<SystemLogVo> selectPageVo(IPage<SystemLog> page, @Param(Constants.WRAPPER) Wrapper<SystemLog> qw);
|
||||
|
||||
List<SystemLogVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<SystemLog> qw);
|
||||
|
||||
@Select("select * from system_log")
|
||||
List<SystemLogVo> selectListVo();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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.yxt.portal.biz.systemlog.SystemLogMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
<select id="selectPageVo" resultType="com.yxt.portal.biz.systemlog.SystemLogVo">
|
||||
SELECT * FROM system_log <where> ${ew.sqlSegment} </where>
|
||||
</select>
|
||||
|
||||
<select id="selectListAllVo" resultType="com.yxt.portal.biz.systemlog.SystemLogVo">
|
||||
SELECT * FROM system_log <where> ${ew.sqlSegment} </where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogQuery.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.systemlog.SystemLogQuery <br/>
|
||||
* Description: 系统日志表 查询条件. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(value = "系统日志表 查询条件", description = "系统日志表 查询条件")
|
||||
@Data
|
||||
public class SystemLogQuery implements Query {
|
||||
|
||||
|
||||
@ApiModelProperty("事件名称或类别")
|
||||
private String eventName;
|
||||
|
||||
@ApiModelProperty("事件内容")
|
||||
private String eventContent;
|
||||
|
||||
@ApiModelProperty("事件url")
|
||||
private String eventUrl;
|
||||
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户iP")
|
||||
private String userIp;
|
||||
}
|
||||
109
src/main/java/com/yxt/portal/biz/systemlog/SystemLogService.java
Normal file
109
src/main/java/com/yxt/portal/biz/systemlog/SystemLogService.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.portal.biz.systemlog.SystemLog;
|
||||
import com.yxt.portal.biz.systemlog.SystemLogDto;
|
||||
import com.yxt.portal.biz.systemlog.SystemLogQuery;
|
||||
import com.yxt.portal.biz.systemlog.SystemLogVo;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogService.java <br/>
|
||||
* Class: com.yxt.anrui.portal.biz.systemlog.SystemLogService <br/>
|
||||
* Description: 系统日志表 业务逻辑. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Service
|
||||
public class SystemLogService extends MybatisBaseService<SystemLogMapper, SystemLog> {
|
||||
public PagerVo<SystemLog> listPage(PagerQuery<SystemLogQuery> pq) {
|
||||
SystemLogQuery query = pq.getParams();
|
||||
QueryWrapper<SystemLog> qw = createQueryWrapper(query);
|
||||
IPage<SystemLog> page = PagerUtil.queryToPage(pq);
|
||||
IPage<SystemLog> pagging = baseMapper.selectPage(page, qw);
|
||||
PagerVo<SystemLog> p = PagerUtil.pageToVo(pagging, null);
|
||||
return p;
|
||||
}
|
||||
public List<SystemLog> listAll(SystemLogQuery query) {
|
||||
QueryWrapper<SystemLog> qw = createQueryWrapper(query);
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
private QueryWrapper<SystemLog> createQueryWrapper(SystemLogQuery query) {
|
||||
// todo: 这里根据具体业务调整查询条件
|
||||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||
QueryWrapper<SystemLog> qw = new QueryWrapper<>();
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(query.getEventName())) {
|
||||
qw.eq("eventName", query.getEventName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getEventContent())) {
|
||||
qw.eq("eventContent", query.getEventContent());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getEventUrl())) {
|
||||
qw.eq("eventUrl", query.getEventUrl());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getUserSid())) {
|
||||
qw.eq("userSid", query.getUserSid());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getUserName())) {
|
||||
qw.eq("userName", query.getUserName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getUserIp())) {
|
||||
qw.eq("userIp", query.getUserIp());
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
|
||||
public PagerVo<SystemLogVo> listPageVo(PagerQuery<SystemLogQuery> pq) {
|
||||
SystemLogQuery query = pq.getParams();
|
||||
QueryWrapper<SystemLog> qw = createQueryWrapper(query);
|
||||
IPage<SystemLog> page = PagerUtil.queryToPage(pq);
|
||||
IPage<SystemLogVo> pagging = baseMapper.selectPageVo(page, qw);
|
||||
PagerVo<SystemLogVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return p;
|
||||
}
|
||||
|
||||
public List<SystemLogVo> listAllVo(SystemLogQuery query) {
|
||||
QueryWrapper<SystemLog> qw = createQueryWrapper(query);
|
||||
return baseMapper.selectListAllVo(qw);
|
||||
}
|
||||
|
||||
public List<SystemLogVo> listVo() {
|
||||
return baseMapper.selectListVo();
|
||||
}
|
||||
|
||||
public void saveOrUpdateDto(SystemLogDto dto){
|
||||
SystemLog entity = new SystemLog();
|
||||
dto.fillEntity(entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
public SystemLogVo fetchByIdVo(String id){
|
||||
SystemLog entity = this.fetchById(id);
|
||||
SystemLogVo vo = new SystemLogVo();
|
||||
BeanUtil.copyProperties(entity, vo);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/yxt/portal/biz/systemlog/SystemLogVo.java
Normal file
44
src/main/java/com/yxt/portal/biz/systemlog/SystemLogVo.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.yxt.portal.biz.systemlog;
|
||||
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SystemLogVo.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.systemlog.SystemLogVo <br/>
|
||||
* Description: 系统日志表 视图数据对象. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(value = "系统日志表 视图数据对象", description = "系统日志表 视图数据对象")
|
||||
@Data
|
||||
public class SystemLogVo implements Vo {
|
||||
|
||||
|
||||
@ApiModelProperty("事件名称或类别")
|
||||
private String eventName;
|
||||
|
||||
@ApiModelProperty("事件内容")
|
||||
private String eventContent;
|
||||
|
||||
@ApiModelProperty("事件url")
|
||||
private String eventUrl;
|
||||
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户iP")
|
||||
private String userIp;
|
||||
}
|
||||
Reference in New Issue
Block a user