feat:移除功能点
This commit is contained in:
@@ -18,9 +18,6 @@ public class TestJobConfig {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
|
|
||||||
coreConfigService.refreshFunc("230328001", "demo", "辅导员统计", "辅导员责任班级,学生展示");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
package com.tiesheng.core.controller;
|
package com.tiesheng.core.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.tiesheng.annotation.token.TokenIgnore;
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||||
import com.tiesheng.util.pojos.PageDTO;
|
|
||||||
import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
|
||||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||||
import com.tiesheng.core.service.CoreConfigService;
|
import com.tiesheng.core.service.CoreConfigService;
|
||||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||||
import com.tiesheng.util.exception.ApiException;
|
import com.tiesheng.util.exception.ApiException;
|
||||||
import com.tiesheng.util.pojos.ApiResp;
|
import com.tiesheng.util.pojos.ApiResp;
|
||||||
|
import com.tiesheng.util.pojos.PageDTO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,35 +99,4 @@ public class ConfigController {
|
|||||||
return ApiResp.respOK(selectList);
|
return ApiResp.respOK(selectList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能点列表
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/func/page")
|
|
||||||
public ApiResp<List<CoreConfigFunc>> funcList(Integer isUsed, PageDTO dto) {
|
|
||||||
QueryWrapper<CoreConfigFunc> queryWrapper = new QueryWrapper<CoreConfigFunc>().eq("is_deleted", 0);
|
|
||||||
if (isUsed != null) {
|
|
||||||
queryWrapper.eq("is_used", isUsed);
|
|
||||||
}
|
|
||||||
dto.likeColumns(queryWrapper, "name");
|
|
||||||
Page<CoreConfigFunc> page = dto.pageObj();
|
|
||||||
coreConfigService.getFuncMapper().selectPage(page, queryWrapper);
|
|
||||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能点更新
|
|
||||||
*
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/func/update")
|
|
||||||
public ApiResp<String> funcUpdate(@Valid @RequestBody ConfigFuncDTO dto) {
|
|
||||||
CoreConfigFunc configFunc = BeanUtil.copyProperties(dto, CoreConfigFunc.class);
|
|
||||||
coreConfigService.getFuncMapper().updateById(configFunc);
|
|
||||||
return ApiResp.respOK("");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.tiesheng.core.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
|
||||||
import com.tiesheng.util.pojos.IdName;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface CoreConfigFuncMapper extends BaseMapper<CoreConfigFunc> {
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
package com.tiesheng.core.pojos.dao;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.tiesheng.util.pojos.DaoBase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 职位-功能点
|
|
||||||
*/
|
|
||||||
@TableName(value = "core_config_func")
|
|
||||||
public class CoreConfigFunc extends DaoBase {
|
|
||||||
/**
|
|
||||||
* 业务
|
|
||||||
*/
|
|
||||||
@TableField(value = "service")
|
|
||||||
private String service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
@TableField(value = "`name`")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 其他说明
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否启用
|
|
||||||
*/
|
|
||||||
@TableField(value = "is_used")
|
|
||||||
private Integer isUsed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取业务
|
|
||||||
*
|
|
||||||
* @return service - 业务
|
|
||||||
*/
|
|
||||||
public String getService() {
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置业务
|
|
||||||
*
|
|
||||||
* @param service 业务
|
|
||||||
*/
|
|
||||||
public void setService(String service) {
|
|
||||||
this.service = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取名称
|
|
||||||
*
|
|
||||||
* @return name - 名称
|
|
||||||
*/
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置名称
|
|
||||||
*
|
|
||||||
* @param name 名称
|
|
||||||
*/
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取其他说明
|
|
||||||
*
|
|
||||||
* @return remark - 其他说明
|
|
||||||
*/
|
|
||||||
public String getRemark() {
|
|
||||||
return remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置其他说明
|
|
||||||
*
|
|
||||||
* @param remark 其他说明
|
|
||||||
*/
|
|
||||||
public void setRemark(String remark) {
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取是否启用
|
|
||||||
*
|
|
||||||
* @return is_used - 是否启用
|
|
||||||
*/
|
|
||||||
public Integer getIsUsed() {
|
|
||||||
return isUsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置是否启用
|
|
||||||
*
|
|
||||||
* @param isUsed 是否启用
|
|
||||||
*/
|
|
||||||
public void setIsUsed(Integer isUsed) {
|
|
||||||
this.isUsed = isUsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package com.tiesheng.core.pojos.dto.config;
|
|
||||||
|
|
||||||
public class ConfigFuncDTO {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
private String name;
|
|
||||||
private String remark;
|
|
||||||
private Integer isUsed;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// setter\getter
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
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 String getRemark() {
|
|
||||||
return remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemark(String remark) {
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIsUsed() {
|
|
||||||
return isUsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsUsed(Integer isUsed) {
|
|
||||||
this.isUsed = isUsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.tiesheng.core.service;
|
package com.tiesheng.core.service;
|
||||||
|
|
||||||
import com.tiesheng.core.mapper.CoreConfigEnumMapper;
|
import com.tiesheng.core.mapper.CoreConfigEnumMapper;
|
||||||
import com.tiesheng.core.mapper.CoreConfigFuncMapper;
|
|
||||||
import com.tiesheng.core.mapper.CoreConfigSystemMapper;
|
import com.tiesheng.core.mapper.CoreConfigSystemMapper;
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
|
||||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||||
import com.tiesheng.util.service.TsServiceBase;
|
import com.tiesheng.util.service.TsServiceBase;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -17,18 +15,11 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
CoreConfigEnumMapper coreConfigEnumMapper;
|
CoreConfigEnumMapper coreConfigEnumMapper;
|
||||||
@Autowired
|
|
||||||
CoreConfigFuncMapper coreConfigFuncMapper;
|
|
||||||
|
|
||||||
public CoreConfigEnumMapper getEnumMapper() {
|
public CoreConfigEnumMapper getEnumMapper() {
|
||||||
return coreConfigEnumMapper;
|
return coreConfigEnumMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreConfigFuncMapper getFuncMapper() {
|
|
||||||
return coreConfigFuncMapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取(或创建)一个文本类型的配置
|
* 获取(或创建)一个文本类型的配置
|
||||||
*
|
*
|
||||||
@@ -50,26 +41,4 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
|
|||||||
return oneByColumn;
|
return oneByColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新功能点
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @param service
|
|
||||||
* @param name
|
|
||||||
* @param remark
|
|
||||||
*/
|
|
||||||
public void refreshFunc(String id, String service, String name, String remark) {
|
|
||||||
CoreConfigFunc jobPoint = new CoreConfigFunc();
|
|
||||||
jobPoint.setId(id);
|
|
||||||
jobPoint.setService(service);
|
|
||||||
jobPoint.setName(name);
|
|
||||||
jobPoint.setRemark(remark);
|
|
||||||
try {
|
|
||||||
coreConfigFuncMapper.insert(jobPoint);
|
|
||||||
} catch (Exception e) {
|
|
||||||
coreConfigFuncMapper.updateById(jobPoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,21 +33,4 @@ CREATE TABLE `core_config_system`
|
|||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统';
|
||||||
|
|
||||||
-- ----------------------------
|
|
||||||
-- Table structure for core_config_func
|
|
||||||
-- ----------------------------
|
|
||||||
CREATE TABLE `core_config_func`
|
|
||||||
(
|
|
||||||
`id` varchar(50) NOT NULL,
|
|
||||||
`create_time` datetime NOT NULL,
|
|
||||||
`update_time` datetime NOT NULL,
|
|
||||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
|
||||||
`service` varchar(20) DEFAULT NULL COMMENT '业务',
|
|
||||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
|
||||||
`remark` varchar(500) DEFAULT NULL COMMENT '其他说明',
|
|
||||||
`is_used` int(6) NOT NULL DEFAULT '0' COMMENT '是否启用',
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE = InnoDB
|
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能点';
|
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
<?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.tiesheng.core.mapper.CoreConfigFuncMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.tiesheng.core.pojos.dao.CoreConfigFunc">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
<!--@Table core_config_func-->
|
|
||||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
||||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
|
||||||
<result column="service" jdbcType="VARCHAR" property="service"/>
|
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
||||||
<result column="is_used" jdbcType="INTEGER" property="isUsed"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
id, create_time, update_time, is_deleted, service, `name`, remark,is_used
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
Reference in New Issue
Block a user