添加业务表逻辑

zhangtao
吴顺杰 1 year ago
parent cfcfd77ad0
commit c166121ca8

@ -20,7 +20,6 @@
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.16</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
<fastjson.version>2.0.34</fastjson.version>
@ -30,12 +29,26 @@
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
<version>4.3.0</version>
</dependency>
<!-- mybatis-plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
@ -73,18 +86,6 @@
<version>${oshi.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>

@ -17,6 +17,13 @@
<dependencies>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
@ -24,17 +31,9 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
</dependency>
<!-- Mysql驱动包 -->

@ -3,28 +3,36 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
*
*
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
public static void main(String[] args) {
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
ConfigurableApplicationContext run = SpringApplication.run(RuoYiApplication.class, args);
Environment env = run.getEnvironment();
String ip;
try {
ip = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
String port = env.getProperty("server.port");
String path = env.getProperty("server.servlet.context-path");
path = path.isEmpty() ? "" : path;
System.out.println("\n----------------------------------------------------------\n\t"
+ "Application is running! Access URLs:\n\t"
+ "swagger-ui: http://localhost:" + port + path + "doc.html\n\t"
+ "swagger-ui: http://" + ip + ":" + port + path + "doc.html\n\t"
+ "----------------------------------------------------------");
}
}

@ -5,14 +5,12 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
/**
* web
*
*
* @author ruoyi
*/
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
public class RuoYiServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(RuoYiApplication.class);
}
}

@ -0,0 +1,105 @@
package com.ruoyi.programManagement.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.BKeyEnterprise;
import com.ruoyi.programManagement.service.BKeyEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* (BKeyEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@RestController
@RequestMapping("pharmaceuticals/bKeyEnterprise")
@Api(tags = "省重点企业表")
@Transactional(rollbackFor = Exception.class)
public class BKeyEnterpriseController extends BaseController {
/**
*
*/
@Resource
private BKeyEnterpriseService bKeyEnterpriseService;
/**
*
*
* @param page
* @param bKeyEnterprise
* @return
*/
@GetMapping
@ApiOperation(value = "分页条件查询省重点企业表", response = BKeyEnterprise.class)
public AjaxResult page(Page<BKeyEnterprise> page, BKeyEnterprise bKeyEnterprise) {
return success(bKeyEnterpriseService.page(page, new QueryWrapper<>(bKeyEnterprise)));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条省重点企业表", response = BKeyEnterprise.class)
public AjaxResult getById(@PathVariable Serializable id) {
return success(bKeyEnterpriseService.getById(id));
}
/**
*
*
* @param bKeyEnterprise
* @return
*/
@PostMapping
@ApiOperation(value = "新增省重点企业表", response = BKeyEnterprise.class)
public AjaxResult insert(@RequestBody BKeyEnterprise bKeyEnterprise) {
return success(bKeyEnterpriseService.save(bKeyEnterprise));
}
/**
*
*
* @param bKeyEnterprise
* @return
*/
@PutMapping
@ApiOperation(value = "修改省重点企业表")
public AjaxResult update(@RequestBody BKeyEnterprise bKeyEnterprise) {
return success(bKeyEnterpriseService.updateById(bKeyEnterprise));
}
/**
*
*
* @param idList
* @return
*/
@DeleteMapping
@ApiOperation(value = "删除省重点企业表")
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
return success(bKeyEnterpriseService.removeByIds(idList));
}
}

@ -0,0 +1,105 @@
package com.ruoyi.programManagement.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* (BPlanEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@RestController
@RequestMapping("pharmaceuticals/bPlanEnterprise")
@Api(tags = "计划企业表")
@Transactional(rollbackFor = Exception.class)
public class BPlanEnterpriseController extends BaseController {
/**
*
*/
@Resource
private BPlanEnterpriseService bPlanEnterpriseService;
/**
*
*
* @param page
* @param bPlanEnterprise
* @return
*/
@GetMapping
@ApiOperation(value = "分页条件查询计划企业表", response = BPlanEnterprise.class)
public AjaxResult page(Page<BPlanEnterprise> page, BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.page(page, new QueryWrapper<>(bPlanEnterprise)));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条计划企业表", response = BPlanEnterprise.class)
public AjaxResult getById(@PathVariable Serializable id) {
return success(bPlanEnterpriseService.getById(id));
}
/**
*
*
* @param bPlanEnterprise
* @return
*/
@PostMapping
@ApiOperation(value = "新增计划企业表", response = BPlanEnterprise.class)
public AjaxResult insert(@RequestBody BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.save(bPlanEnterprise));
}
/**
*
*
* @param bPlanEnterprise
* @return
*/
@PutMapping
@ApiOperation(value = "修改计划企业表")
public AjaxResult update(@RequestBody BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.updateById(bPlanEnterprise));
}
/**
*
*
* @param idList
* @return
*/
@DeleteMapping
@ApiOperation(value = "删除计划企业表")
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
return success(bPlanEnterpriseService.removeByIds(idList));
}
}

@ -0,0 +1,105 @@
package com.ruoyi.programManagement.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.BPlanManage;
import com.ruoyi.programManagement.service.BPlanManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* (BPlanManage)
*
* @author wu
* @since 2023-09-07 09:43:07
*/
@RestController
@RequestMapping("pharmaceuticals/bPlanManage")
@Api(tags = "计划管理表")
@Transactional(rollbackFor = Exception.class)
public class BPlanManageController extends BaseController {
/**
*
*/
@Resource
private BPlanManageService bPlanManageService;
/**
*
*
* @param page
* @param bPlanManage
* @return
*/
@GetMapping
@ApiOperation(value = "分页条件查询计划管理表", response = BPlanManage.class)
public AjaxResult page(Page<BPlanManage> page, BPlanManage bPlanManage) {
return success(bPlanManageService.page(page, new QueryWrapper<>(bPlanManage)));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条计划管理表", response = BPlanManage.class)
public AjaxResult getById(@PathVariable Serializable id) {
return success(bPlanManageService.getById(id));
}
/**
*
*
* @param bPlanManage
* @return
*/
@PostMapping
@ApiOperation(value = "新增计划管理表", response = BPlanManage.class)
public AjaxResult insert(@RequestBody BPlanManage bPlanManage) {
return success(bPlanManageService.save(bPlanManage));
}
/**
*
*
* @param bPlanManage
* @return
*/
@PutMapping
@ApiOperation(value = "修改计划管理表")
public AjaxResult update(@RequestBody BPlanManage bPlanManage) {
return success(bPlanManageService.updateById(bPlanManage));
}
/**
*
*
* @param idList
* @return
*/
@DeleteMapping
@ApiOperation(value = "删除计划管理表")
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
return success(bPlanManageService.removeByIds(idList));
}
}

@ -0,0 +1,103 @@
package com.ruoyi.programManagement.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* (BKeyEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@Data
@ApiModel("省重点企业表实体类")
@TableName(value = "b_key_enterprise")
public class BKeyEnterprise implements Serializable {
private static final long serialVersionUID = 852154491977160819L;
/**
*
*/
@ApiModelProperty(value = "编号")
private Long id;
/**
*
*/
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
/**
*
*/
@ApiModelProperty(value = "大类")
private String type;
/**
*
*/
@ApiModelProperty(value = "年份")
private Date year;
/**
* ID
*/
@ApiModelProperty(value = "创建者ID")
private Integer createId;
/**
*
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* ID
*/
@ApiModelProperty(value = "更新者ID")
private Integer updateId;
/**
*
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* id
*/
@ApiModelProperty(value = "用户权限id")
private Long userId;
/**
* id
*/
@ApiModelProperty(value = "部门权限id")
private Long deptId;
}

@ -0,0 +1,97 @@
package com.ruoyi.programManagement.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* (BPlanEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@Data
@ApiModel("计划企业表实体类")
@TableName(value = "b_plan_enterprise")
public class BPlanEnterprise implements Serializable {
private static final long serialVersionUID = -98531345456142440L;
/**
*
*/
@ApiModelProperty(value = "编号")
private Long id;
/**
* id
*/
@ApiModelProperty(value = "计划id")
private Long planId;
/**
* id
*/
@ApiModelProperty(value = "企业id")
private Long enterpriseId;
/**
* ID
*/
@ApiModelProperty(value = "创建者ID")
private Integer createId;
/**
*
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* ID
*/
@ApiModelProperty(value = "更新者ID")
private Integer updateId;
/**
*
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* id
*/
@ApiModelProperty(value = "用户权限id")
private Long userId;
/**
* id
*/
@ApiModelProperty(value = "部门权限id")
private Long deptId;
}

@ -0,0 +1,121 @@
package com.ruoyi.programManagement.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* (BPlanManage)
*
* @author wu
* @since 2023-09-07 09:43:07
*/
@Data
@ApiModel("计划管理表实体类")
@TableName(value = "b_plan_manage")
public class BPlanManage implements Serializable {
private static final long serialVersionUID = 886164627593957269L;
/**
*
*/
@ApiModelProperty(value = "编号")
private Long id;
/**
*
*/
@ApiModelProperty(value = "计划年份")
private String plannedYear;
/**
*
*/
@ApiModelProperty(value = "行政区划")
private String district;
/**
*
*/
@ApiModelProperty(value = "计划企业数量")
private String planNumb;
/**
*
*/
@ApiModelProperty(value = "计划标题")
private String planName;
/**
*
*/
@ApiModelProperty(value = "计划内容")
private String planContent;
/**
* 0: 1:
*/
@ApiModelProperty(value = "状态0:未执法 1:已执法)")
private String planState;
/**
* ID
*/
@ApiModelProperty(value = "创建者ID")
private Integer createId;
/**
*
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* ID
*/
@ApiModelProperty(value = "更新者ID")
private Integer updateId;
/**
*
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* id
*/
@ApiModelProperty(value = "用户权限id")
private Long userId;
/**
* id
*/
@ApiModelProperty(value = "部门权限id")
private Long deptId;
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.programManagement.entity.BKeyEnterprise;
/**
* (BKeyEnterprise)访
*
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BKeyEnterpriseMapper extends BaseMapper<BKeyEnterprise> {
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
/**
* (BPlanEnterprise)访
*
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.programManagement.entity.BPlanManage;
/**
* (BPlanManage)访
*
* @author wu
* @since 2023-09-07 09:43:07
*/
public interface BPlanManageMapper extends BaseMapper<BPlanManage> {
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.programManagement.entity.BKeyEnterprise;
/**
* (BKeyEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BKeyEnterpriseService extends IService<BKeyEnterprise> {
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
/**
* (BPlanEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
}

@ -0,0 +1,15 @@
package com.ruoyi.programManagement.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.programManagement.entity.BPlanManage;
/**
* (BPlanManage)
*
* @author wu
* @since 2023-09-07 09:43:07
*/
public interface BPlanManageService extends IService<BPlanManage> {
}

@ -0,0 +1,19 @@
package com.ruoyi.programManagement.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.programManagement.mapper.BKeyEnterpriseMapper;
import com.ruoyi.programManagement.entity.BKeyEnterprise;
import com.ruoyi.programManagement.service.BKeyEnterpriseService;
import org.springframework.stereotype.Service;
/**
* (BKeyEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@Service("bKeyEnterpriseService")
public class BKeyEnterpriseServiceImpl extends ServiceImpl<BKeyEnterpriseMapper, BKeyEnterprise> implements BKeyEnterpriseService {
}

@ -0,0 +1,19 @@
package com.ruoyi.programManagement.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
import org.springframework.stereotype.Service;
/**
* (BPlanEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:07
*/
@Service("bPlanEnterpriseService")
public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMapper, BPlanEnterprise> implements BPlanEnterpriseService {
}

@ -0,0 +1,19 @@
package com.ruoyi.programManagement.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.programManagement.mapper.BPlanManageMapper;
import com.ruoyi.programManagement.entity.BPlanManage;
import com.ruoyi.programManagement.service.BPlanManageService;
import org.springframework.stereotype.Service;
/**
* (BPlanManage)
*
* @author wu
* @since 2023-09-07 09:43:07
*/
@Service("bPlanManageService")
public class BPlanManageServiceImpl extends ServiceImpl<BPlanManageMapper, BPlanManage> implements BPlanManageService {
}

@ -1,183 +0,0 @@
package com.ruoyi.web.controller.tool;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
/**
* swagger
*
* @author ruoyi
*/
@Api("用户信息管理")
@RestController
@RequestMapping("/test/user")
public class TestController extends BaseController
{
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
{
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
}
@ApiOperation("获取用户列表")
@GetMapping("/list")
public R<List<UserEntity>> userList()
{
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
return R.ok(userList);
}
@ApiOperation("获取用户详细")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@GetMapping("/{userId}")
public R<UserEntity> getUser(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
return R.ok(users.get(userId));
}
else
{
return R.fail("用户不存在");
}
}
@ApiOperation("新增用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
})
@PostMapping("/save")
public R<String> save(UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("更新用户")
@PutMapping("/update")
public R<String> update(@RequestBody UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
if (users.isEmpty() || !users.containsKey(user.getUserId()))
{
return R.fail("用户不存在");
}
users.remove(user.getUserId());
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("删除用户信息")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@DeleteMapping("/{userId}")
public R<String> delete(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
users.remove(userId);
return R.ok();
}
else
{
return R.fail("用户不存在");
}
}
}
@ApiModel(value = "UserEntity", description = "用户实体")
class UserEntity
{
@ApiModelProperty("用户ID")
private Integer userId;
@ApiModelProperty("用户名称")
private String username;
@ApiModelProperty("用户密码")
private String password;
@ApiModelProperty("用户手机")
private String mobile;
public UserEntity()
{
}
public UserEntity(Integer userId, String username, String password, String mobile)
{
this.userId = userId;
this.username = username;
this.password = password;
this.mobile = mobile;
}
public Integer getUserId()
{
return userId;
}
public void setUserId(Integer userId)
{
this.userId = userId;
}
public String getUsername()
{
return username;
}
public void setUsername(String username)
{
this.username = username;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getMobile()
{
return mobile;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
}

@ -1,56 +1,58 @@
package com.ruoyi.web.core.config;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
/**
* Swagger2
*
*
* @author ruoyi
*/
@Configuration
public class SwaggerConfig
{
/** 系统基础配置 */
@EnableSwagger2WebMvc
public class SwaggerConfig {
/**
*
*/
@Autowired
private RuoYiConfig ruoyiConfig;
/** 是否开启swagger */
@Value("${swagger.enabled}")
/**
* swagger
*/
@Value("${knife4j.enable}")
private boolean enabled;
/** 设置请求的统一前缀 */
@Value("${swagger.pathMapping}")
/**
*
*/
@Value("${server.servlet.context-path}")
private String pathMapping;
/**
* API
*/
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.OAS_30)
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
// 是否启用Swagger
.enable(enabled)
//分组名称
.groupName("苏州应急3期")
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
@ -62,60 +64,22 @@ public class SwaggerConfig
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
/* 设置安全模式swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
.pathMapping(pathMapping);
.pathMapping(pathMapping)
// 排除mybatis-plus的分页参数
.ignoredParameterTypes(Page.class, IPage.class);
}
/**
* tokenAuthorization
*/
private List<SecurityScheme> securitySchemes()
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
/**
*
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}
/**
*
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/**
*
*/
private ApiInfo apiInfo()
{
private ApiInfo apiInfo() {
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题:若依管理系统_接口文档")
.title("苏州应急3期系统_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
.description("描述用于苏州应急3期系统")
// 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本

@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/ying_ji3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -18,7 +18,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
port: 9033
servlet:
# 应用的访问路径
context-path: /
@ -99,14 +99,17 @@ token:
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# MyBatis-plus配置
mybatis-plus:
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.entity
global-config:
db-config:
id-type: auto
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# PageHelper分页插件
pagehelper:
@ -115,11 +118,9 @@ pagehelper:
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
knife4j:
enable: true
# 防止XSS攻击
xss:

@ -16,7 +16,11 @@
</description>
<dependencies>
<!-- mybatisplus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!-- Spring框架基本的核心工具 -->
<dependency>
<groupId>org.springframework</groupId>
@ -52,19 +56,19 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- JSON工具类 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- 动态数据源 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>

@ -1,11 +1,6 @@
package com.ruoyi.framework.config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import javax.sql.DataSource;
import com.ruoyi.common.utils.StringUtils;
import org.apache.ibatis.io.VFS;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
@ -22,90 +17,73 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.util.ClassUtils;
import com.ruoyi.common.utils.StringUtils;
import javax.sql.DataSource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
/**
* Mybatis*
*
*
* @author ruoyi
*/
@Configuration
public class MyBatisConfig
{
public class MyBatisConfig {
static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
@Autowired
private Environment env;
static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
public static String setTypeAliasesPackage(String typeAliasesPackage)
{
public static String setTypeAliasesPackage(String typeAliasesPackage) {
ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
List<String> allResult = new ArrayList<String>();
try
{
for (String aliasesPackage : typeAliasesPackage.split(","))
{
try {
for (String aliasesPackage : typeAliasesPackage.split(",")) {
List<String> result = new ArrayList<String>();
aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
+ ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
Resource[] resources = resolver.getResources(aliasesPackage);
if (resources != null && resources.length > 0)
{
if (resources != null && resources.length > 0) {
MetadataReader metadataReader = null;
for (Resource resource : resources)
{
if (resource.isReadable())
{
for (Resource resource : resources) {
if (resource.isReadable()) {
metadataReader = metadataReaderFactory.getMetadataReader(resource);
try
{
try {
result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
}
catch (ClassNotFoundException e)
{
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
}
if (result.size() > 0)
{
if (result.size() > 0) {
HashSet<String> hashResult = new HashSet<String>(result);
allResult.addAll(hashResult);
}
}
if (allResult.size() > 0)
{
if (allResult.size() > 0) {
typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
}
else
{
} else {
throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
}
}
catch (IOException e)
{
} catch (IOException e) {
e.printStackTrace();
}
return typeAliasesPackage;
}
public Resource[] resolveMapperLocations(String[] mapperLocations)
{
public Resource[] resolveMapperLocations(String[] mapperLocations) {
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
List<Resource> resources = new ArrayList<Resource>();
if (mapperLocations != null)
{
for (String mapperLocation : mapperLocations)
{
try
{
if (mapperLocations != null) {
for (String mapperLocation : mapperLocations) {
try {
Resource[] mappers = resourceResolver.getResources(mapperLocation);
resources.addAll(Arrays.asList(mappers));
}
catch (IOException e)
{
} catch (IOException e) {
// ignore
}
}
@ -113,20 +91,19 @@ public class MyBatisConfig
return resources.toArray(new Resource[resources.size()]);
}
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
{
String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
String mapperLocations = env.getProperty("mybatis.mapperLocations");
String configLocation = env.getProperty("mybatis.configLocation");
typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
VFS.addImplClass(SpringBootVFS.class);
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
return sessionFactory.getObject();
}
// @Bean
// public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
// String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
// String mapperLocations = env.getProperty("mybatis.mapperLocations");
// String configLocation = env.getProperty("mybatis.configLocation");
// typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
// VFS.addImplClass(SpringBootVFS.class);
//
// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
// sessionFactory.setDataSource(dataSource);
// sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
// sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
// sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
// return sessionFactory.getObject();
// }
}

@ -4,78 +4,74 @@ import com.ruoyi.common.utils.StringUtils;
/**
*
*
*
* @author ruoyi
*/
public class SysCache
{
/** 缓存名称 */
public class SysCache {
/**
*
*/
private String cacheName = "";
/** 缓存键名 */
/**
*
*/
private String cacheKey = "";
/** 缓存内容 */
/**
*
*/
private String cacheValue = "";
/** 备注 */
/**
*
*/
private String remark = "";
public SysCache()
{
public SysCache() {
}
public SysCache(String cacheName, String remark)
{
public SysCache(String cacheName, String remark) {
this.cacheName = cacheName;
this.remark = remark;
}
public SysCache(String cacheName, String cacheKey, String cacheValue)
{
public SysCache(String cacheName, String cacheKey, String cacheValue) {
this.cacheName = StringUtils.replace(cacheName, ":", "");
this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
this.cacheValue = cacheValue;
}
public String getCacheName()
{
public String getCacheName() {
return cacheName;
}
public void setCacheName(String cacheName)
{
public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}
public String getCacheKey()
{
public String getCacheKey() {
return cacheKey;
}
public void setCacheKey(String cacheKey)
{
public void setCacheKey(String cacheKey) {
this.cacheKey = cacheKey;
}
public String getCacheValue()
{
public String getCacheValue() {
return cacheValue;
}
public void setCacheValue(String cacheValue)
{
public void setCacheValue(String cacheValue) {
this.cacheValue = cacheValue;
}
public String getRemark()
{
public String getRemark() {
return remark;
}
public void setRemark(String remark)
{
public void setRemark(String remark) {
this.remark = remark;
}
}

@ -1,111 +1,111 @@
package com.ruoyi.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.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* sys_config
*
*
* @author ruoyi
*/
public class SysConfig extends BaseEntity
{
public class SysConfig extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 参数主键 */
/**
*
*/
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
private Long configId;
/** 参数名称 */
/**
*
*/
@Excel(name = "参数名称")
private String configName;
/** 参数键名 */
/**
*
*/
@Excel(name = "参数键名")
private String configKey;
/** 参数键值 */
/**
*
*/
@Excel(name = "参数键值")
private String configValue;
/** 系统内置Y是 N否 */
/**
* Y N
*/
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
private String configType;
public Long getConfigId()
{
public Long getConfigId() {
return configId;
}
public void setConfigId(Long configId)
{
public void setConfigId(Long configId) {
this.configId = configId;
}
@NotBlank(message = "参数名称不能为空")
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
public String getConfigName()
{
public String getConfigName() {
return configName;
}
public void setConfigName(String configName)
{
public void setConfigName(String configName) {
this.configName = configName;
}
@NotBlank(message = "参数键名长度不能为空")
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
public String getConfigKey()
{
public String getConfigKey() {
return configKey;
}
public void setConfigKey(String configKey)
{
public void setConfigKey(String configKey) {
this.configKey = configKey;
}
@NotBlank(message = "参数键值不能为空")
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
public String getConfigValue()
{
public String getConfigValue() {
return configValue;
}
public void setConfigValue(String configValue)
{
public void setConfigValue(String configValue) {
this.configValue = configValue;
}
public String getConfigType()
{
public String getConfigType() {
return configType;
}
public void setConfigType(String configType)
{
public void setConfigType(String configType) {
this.configType = configType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("configId", getConfigId())
.append("configName", getConfigName())
.append("configKey", getConfigKey())
.append("configValue", getConfigValue())
.append("configType", getConfigType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("configId", getConfigId())
.append("configName", getConfigName())
.append("configKey", getConfigKey())
.append("configValue", getConfigValue())
.append("configType", getConfigType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -1,144 +1,144 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 访 sys_logininfor
*
*
* @author ruoyi
*/
public class SysLogininfor extends BaseEntity
{
public class SysLogininfor extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
/**
* ID
*/
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
private Long infoId;
/** 用户账号 */
/**
*
*/
@Excel(name = "用户账号")
private String userName;
/** 登录状态 0成功 1失败 */
/**
* 0 1
*/
@Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
private String status;
/** 登录IP地址 */
/**
* IP
*/
@Excel(name = "登录地址")
private String ipaddr;
/** 登录地点 */
/**
*
*/
@Excel(name = "登录地点")
private String loginLocation;
/** 浏览器类型 */
/**
*
*/
@Excel(name = "浏览器")
private String browser;
/** 操作系统 */
/**
*
*/
@Excel(name = "操作系统")
private String os;
/** 提示消息 */
/**
*
*/
@Excel(name = "提示消息")
private String msg;
/** 访问时间 */
/**
* 访
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date loginTime;
public Long getInfoId()
{
public Long getInfoId() {
return infoId;
}
public void setInfoId(Long infoId)
{
public void setInfoId(Long infoId) {
this.infoId = infoId;
}
public String getUserName()
{
public String getUserName() {
return userName;
}
public void setUserName(String userName)
{
public void setUserName(String userName) {
this.userName = userName;
}
public String getStatus()
{
public String getStatus() {
return status;
}
public void setStatus(String status)
{
public void setStatus(String status) {
this.status = status;
}
public String getIpaddr()
{
public String getIpaddr() {
return ipaddr;
}
public void setIpaddr(String ipaddr)
{
public void setIpaddr(String ipaddr) {
this.ipaddr = ipaddr;
}
public String getLoginLocation()
{
public String getLoginLocation() {
return loginLocation;
}
public void setLoginLocation(String loginLocation)
{
public void setLoginLocation(String loginLocation) {
this.loginLocation = loginLocation;
}
public String getBrowser()
{
public String getBrowser() {
return browser;
}
public void setBrowser(String browser)
{
public void setBrowser(String browser) {
this.browser = browser;
}
public String getOs()
{
public String getOs() {
return os;
}
public void setOs(String os)
{
public void setOs(String os) {
this.os = os;
}
public String getMsg()
{
public String getMsg() {
return msg;
}
public void setMsg(String msg)
{
public void setMsg(String msg) {
this.msg = msg;
}
public Date getLoginTime()
{
public Date getLoginTime() {
return loginTime;
}
public void setLoginTime(Date loginTime)
{
public void setLoginTime(Date loginTime) {
this.loginTime = loginTime;
}
}

@ -1,102 +1,102 @@
package com.ruoyi.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.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* sys_notice
*
*
* @author ruoyi
*/
public class SysNotice extends BaseEntity
{
public class SysNotice extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 公告ID */
/**
* ID
*/
private Long noticeId;
/** 公告标题 */
/**
*
*/
private String noticeTitle;
/** 公告类型1通知 2公告 */
/**
* 1 2
*/
private String noticeType;
/** 公告内容 */
/**
*
*/
private String noticeContent;
/** 公告状态0正常 1关闭 */
/**
* 0 1
*/
private String status;
public Long getNoticeId()
{
public Long getNoticeId() {
return noticeId;
}
public void setNoticeId(Long noticeId)
{
public void setNoticeId(Long noticeId) {
this.noticeId = noticeId;
}
public void setNoticeTitle(String noticeTitle)
{
this.noticeTitle = noticeTitle;
}
@Xss(message = "公告标题不能包含脚本字符")
@NotBlank(message = "公告标题不能为空")
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
public String getNoticeTitle()
{
public String getNoticeTitle() {
return noticeTitle;
}
public void setNoticeType(String noticeType)
{
this.noticeType = noticeType;
public void setNoticeTitle(String noticeTitle) {
this.noticeTitle = noticeTitle;
}
public String getNoticeType()
{
public String getNoticeType() {
return noticeType;
}
public void setNoticeContent(String noticeContent)
{
this.noticeContent = noticeContent;
public void setNoticeType(String noticeType) {
this.noticeType = noticeType;
}
public String getNoticeContent()
{
public String getNoticeContent() {
return noticeContent;
}
public void setStatus(String status)
{
this.status = status;
public void setNoticeContent(String noticeContent) {
this.noticeContent = noticeContent;
}
public String getStatus()
{
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -1,269 +1,269 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* oper_log
*
*
* @author ruoyi
*/
public class SysOperLog extends BaseEntity
{
public class SysOperLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 日志主键 */
/**
*
*/
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
private Long operId;
/** 操作模块 */
/**
*
*/
@Excel(name = "操作模块")
private String title;
/** 业务类型0其它 1新增 2修改 3删除 */
/**
* 0 1 2 3
*/
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
private Integer businessType;
/** 业务类型数组 */
/**
*
*/
private Integer[] businessTypes;
/** 请求方法 */
/**
*
*/
@Excel(name = "请求方法")
private String method;
/** 请求方式 */
/**
*
*/
@Excel(name = "请求方式")
private String requestMethod;
/** 操作类别0其它 1后台用户 2手机端用户 */
/**
* 0 1 2
*/
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
private Integer operatorType;
/** 操作人员 */
/**
*
*/
@Excel(name = "操作人员")
private String operName;
/** 部门名称 */
/**
*
*/
@Excel(name = "部门名称")
private String deptName;
/** 请求url */
/**
* url
*/
@Excel(name = "请求地址")
private String operUrl;
/** 操作地址 */
/**
*
*/
@Excel(name = "操作地址")
private String operIp;
/** 操作地点 */
/**
*
*/
@Excel(name = "操作地点")
private String operLocation;
/** 请求参数 */
/**
*
*/
@Excel(name = "请求参数")
private String operParam;
/** 返回参数 */
/**
*
*/
@Excel(name = "返回参数")
private String jsonResult;
/** 操作状态0正常 1异常 */
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=异常")
private Integer status;
/** 错误消息 */
/**
*
*/
@Excel(name = "错误消息")
private String errorMsg;
/** 操作时间 */
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date operTime;
/** 消耗时间 */
/**
*
*/
@Excel(name = "消耗时间", suffix = "毫秒")
private Long costTime;
public Long getOperId()
{
public Long getOperId() {
return operId;
}
public void setOperId(Long operId)
{
public void setOperId(Long operId) {
this.operId = operId;
}
public String getTitle()
{
public String getTitle() {
return title;
}
public void setTitle(String title)
{
public void setTitle(String title) {
this.title = title;
}
public Integer getBusinessType()
{
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType)
{
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public Integer[] getBusinessTypes()
{
public Integer[] getBusinessTypes() {
return businessTypes;
}
public void setBusinessTypes(Integer[] businessTypes)
{
public void setBusinessTypes(Integer[] businessTypes) {
this.businessTypes = businessTypes;
}
public String getMethod()
{
public String getMethod() {
return method;
}
public void setMethod(String method)
{
public void setMethod(String method) {
this.method = method;
}
public String getRequestMethod()
{
public String getRequestMethod() {
return requestMethod;
}
public void setRequestMethod(String requestMethod)
{
public void setRequestMethod(String requestMethod) {
this.requestMethod = requestMethod;
}
public Integer getOperatorType()
{
public Integer getOperatorType() {
return operatorType;
}
public void setOperatorType(Integer operatorType)
{
public void setOperatorType(Integer operatorType) {
this.operatorType = operatorType;
}
public String getOperName()
{
public String getOperName() {
return operName;
}
public void setOperName(String operName)
{
public void setOperName(String operName) {
this.operName = operName;
}
public String getDeptName()
{
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName)
{
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getOperUrl()
{
public String getOperUrl() {
return operUrl;
}
public void setOperUrl(String operUrl)
{
public void setOperUrl(String operUrl) {
this.operUrl = operUrl;
}
public String getOperIp()
{
public String getOperIp() {
return operIp;
}
public void setOperIp(String operIp)
{
public void setOperIp(String operIp) {
this.operIp = operIp;
}
public String getOperLocation()
{
public String getOperLocation() {
return operLocation;
}
public void setOperLocation(String operLocation)
{
public void setOperLocation(String operLocation) {
this.operLocation = operLocation;
}
public String getOperParam()
{
public String getOperParam() {
return operParam;
}
public void setOperParam(String operParam)
{
public void setOperParam(String operParam) {
this.operParam = operParam;
}
public String getJsonResult()
{
public String getJsonResult() {
return jsonResult;
}
public void setJsonResult(String jsonResult)
{
public void setJsonResult(String jsonResult) {
this.jsonResult = jsonResult;
}
public Integer getStatus()
{
public Integer getStatus() {
return status;
}
public void setStatus(Integer status)
{
public void setStatus(Integer status) {
this.status = status;
}
public String getErrorMsg()
{
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg)
{
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public Date getOperTime()
{
public Date getOperTime() {
return operTime;
}
public void setOperTime(Date operTime)
{
public void setOperTime(Date operTime) {
this.operTime = operTime;
}
public Long getCostTime()
{
public Long getCostTime() {
return costTime;
}
public void setCostTime(Long costTime)
{
public void setCostTime(Long costTime) {
this.costTime = costTime;
}
}

@ -1,124 +1,124 @@
package com.ruoyi.system.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* sys_post
*
*
* @author ruoyi
*/
public class SysPost extends BaseEntity
{
public class SysPost extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 岗位序号 */
/**
*
*/
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
private Long postId;
/** 岗位编码 */
/**
*
*/
@Excel(name = "岗位编码")
private String postCode;
/** 岗位名称 */
/**
*
*/
@Excel(name = "岗位名称")
private String postName;
/** 岗位排序 */
/**
*
*/
@Excel(name = "岗位排序")
private Integer postSort;
/** 状态0正常 1停用 */
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 用户是否存在此岗位标识 默认不存在 */
/**
*
*/
private boolean flag = false;
public Long getPostId()
{
public Long getPostId() {
return postId;
}
public void setPostId(Long postId)
{
public void setPostId(Long postId) {
this.postId = postId;
}
@NotBlank(message = "岗位编码不能为空")
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
public String getPostCode()
{
public String getPostCode() {
return postCode;
}
public void setPostCode(String postCode)
{
public void setPostCode(String postCode) {
this.postCode = postCode;
}
@NotBlank(message = "岗位名称不能为空")
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
public String getPostName()
{
public String getPostName() {
return postName;
}
public void setPostName(String postName)
{
public void setPostName(String postName) {
this.postName = postName;
}
@NotNull(message = "显示顺序不能为空")
public Integer getPostSort()
{
public Integer getPostSort() {
return postSort;
}
public void setPostSort(Integer postSort)
{
public void setPostSort(Integer postSort) {
this.postSort = postSort;
}
public String getStatus()
{
public String getStatus() {
return status;
}
public void setStatus(String status)
{
public void setStatus(String status) {
this.status = status;
}
public boolean isFlag()
{
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag)
{
public void setFlag(boolean flag) {
this.flag = flag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postCode", getPostCode())
.append("postName", getPostName())
.append("postSort", getPostSort())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postCode", getPostCode())
.append("postName", getPostName())
.append("postSort", getPostSort())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_role_dept
*
*
* @author ruoyi
*/
public class SysRoleDept
{
/** 角色ID */
public class SysRoleDept {
/**
* ID
*/
private Long roleId;
/** 部门ID */
/**
* ID
*/
private Long deptId;
public Long getRoleId()
{
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId)
{
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getDeptId()
{
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId)
{
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("deptId", getDeptId())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("deptId", getDeptId())
.toString();
}
}

@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_role_menu
*
*
* @author ruoyi
*/
public class SysRoleMenu
{
/** 角色ID */
public class SysRoleMenu {
/**
* ID
*/
private Long roleId;
/** 菜单ID */
/**
* ID
*/
private Long menuId;
public Long getRoleId()
{
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId)
{
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getMenuId()
{
public Long getMenuId() {
return menuId;
}
public void setMenuId(Long menuId)
{
public void setMenuId(Long menuId) {
this.menuId = menuId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("menuId", getMenuId())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("menuId", getMenuId())
.toString();
}
}

@ -2,112 +2,111 @@ package com.ruoyi.system.domain;
/**
* 线
*
*
* @author ruoyi
*/
public class SysUserOnline
{
/** 会话编号 */
public class SysUserOnline {
/**
*
*/
private String tokenId;
/** 部门名称 */
/**
*
*/
private String deptName;
/** 用户名称 */
/**
*
*/
private String userName;
/** 登录IP地址 */
/**
* IP
*/
private String ipaddr;
/** 登录地址 */
/**
*
*/
private String loginLocation;
/** 浏览器类型 */
/**
*
*/
private String browser;
/** 操作系统 */
/**
*
*/
private String os;
/** 登录时间 */
/**
*
*/
private Long loginTime;
public String getTokenId()
{
public String getTokenId() {
return tokenId;
}
public void setTokenId(String tokenId)
{
public void setTokenId(String tokenId) {
this.tokenId = tokenId;
}
public String getDeptName()
{
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName)
{
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getUserName()
{
public String getUserName() {
return userName;
}
public void setUserName(String userName)
{
public void setUserName(String userName) {
this.userName = userName;
}
public String getIpaddr()
{
public String getIpaddr() {
return ipaddr;
}
public void setIpaddr(String ipaddr)
{
public void setIpaddr(String ipaddr) {
this.ipaddr = ipaddr;
}
public String getLoginLocation()
{
public String getLoginLocation() {
return loginLocation;
}
public void setLoginLocation(String loginLocation)
{
public void setLoginLocation(String loginLocation) {
this.loginLocation = loginLocation;
}
public String getBrowser()
{
public String getBrowser() {
return browser;
}
public void setBrowser(String browser)
{
public void setBrowser(String browser) {
this.browser = browser;
}
public String getOs()
{
public String getOs() {
return os;
}
public void setOs(String os)
{
public void setOs(String os) {
this.os = os;
}
public Long getLoginTime()
{
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime)
{
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
}

@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_user_post
*
*
* @author ruoyi
*/
public class SysUserPost
{
/** 用户ID */
public class SysUserPost {
/**
* ID
*/
private Long userId;
/** 岗位ID */
/**
* ID
*/
private Long postId;
public Long getUserId()
{
public Long getUserId() {
return userId;
}
public void setUserId(Long userId)
{
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getPostId()
{
public Long getPostId() {
return postId;
}
public void setPostId(Long postId)
{
public void setPostId(Long postId) {
this.postId = postId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("postId", getPostId())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("postId", getPostId())
.toString();
}
}

@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_user_role
*
*
* @author ruoyi
*/
public class SysUserRole
{
/** 用户ID */
public class SysUserRole {
/**
* ID
*/
private Long userId;
/** 角色ID */
/**
* ID
*/
private Long roleId;
public Long getUserId()
{
public Long getUserId() {
return userId;
}
public void setUserId(Long userId)
{
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId()
{
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId)
{
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("roleId", getRoleId())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("roleId", getRoleId())
.toString();
}
}

@ -4,11 +4,10 @@ import com.ruoyi.common.utils.StringUtils;
/**
*
*
*
* @author ruoyi
*/
public class MetaVo
{
public class MetaVo {
/**
*
*/
@ -29,78 +28,64 @@ public class MetaVo
*/
private String link;
public MetaVo()
{
public MetaVo() {
}
public MetaVo(String title, String icon)
{
public MetaVo(String title, String icon) {
this.title = title;
this.icon = icon;
}
public MetaVo(String title, String icon, boolean noCache)
{
public MetaVo(String title, String icon, boolean noCache) {
this.title = title;
this.icon = icon;
this.noCache = noCache;
}
public MetaVo(String title, String icon, String link)
{
public MetaVo(String title, String icon, String link) {
this.title = title;
this.icon = icon;
this.link = link;
}
public MetaVo(String title, String icon, boolean noCache, String link)
{
public MetaVo(String title, String icon, boolean noCache, String link) {
this.title = title;
this.icon = icon;
this.noCache = noCache;
if (StringUtils.ishttp(link))
{
if (StringUtils.ishttp(link)) {
this.link = link;
}
}
public boolean isNoCache()
{
public boolean isNoCache() {
return noCache;
}
public void setNoCache(boolean noCache)
{
public void setNoCache(boolean noCache) {
this.noCache = noCache;
}
public String getTitle()
{
public String getTitle() {
return title;
}
public void setTitle(String title)
{
public void setTitle(String title) {
this.title = title;
}
public String getIcon()
{
public String getIcon() {
return icon;
}
public void setIcon(String icon)
{
public void setIcon(String icon) {
this.icon = icon;
}
public String getLink()
{
public String getLink() {
return link;
}
public void setLink(String link)
{
public void setLink(String link) {
this.link = link;
}
}

@ -1,16 +1,16 @@
package com.ruoyi.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
/**
*
*
*
* @author ruoyi
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouterVo
{
public class RouterVo {
/**
*
*/
@ -56,93 +56,75 @@ public class RouterVo
*/
private List<RouterVo> children;
public String getName()
{
public String getName() {
return name;
}
public void setName(String name)
{
public void setName(String name) {
this.name = name;
}
public String getPath()
{
public String getPath() {
return path;
}
public void setPath(String path)
{
public void setPath(String path) {
this.path = path;
}
public boolean getHidden()
{
public boolean getHidden() {
return hidden;
}
public void setHidden(boolean hidden)
{
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public String getRedirect()
{
public String getRedirect() {
return redirect;
}
public void setRedirect(String redirect)
{
public void setRedirect(String redirect) {
this.redirect = redirect;
}
public String getComponent()
{
public String getComponent() {
return component;
}
public void setComponent(String component)
{
public void setComponent(String component) {
this.component = component;
}
public String getQuery()
{
public String getQuery() {
return query;
}
public void setQuery(String query)
{
public void setQuery(String query) {
this.query = query;
}
public Boolean getAlwaysShow()
{
public Boolean getAlwaysShow() {
return alwaysShow;
}
public void setAlwaysShow(Boolean alwaysShow)
{
public void setAlwaysShow(Boolean alwaysShow) {
this.alwaysShow = alwaysShow;
}
public MetaVo getMeta()
{
public MetaVo getMeta() {
return meta;
}
public void setMeta(MetaVo meta)
{
public void setMeta(MetaVo meta) {
this.meta = meta;
}
public List<RouterVo> getChildren()
{
public List<RouterVo> getChildren() {
return children;
}
public void setChildren(List<RouterVo> children)
{
public void setChildren(List<RouterVo> children) {
this.children = children;
}
}

@ -1,13 +1,5 @@
package com.ruoyi.system.service.impl;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysDictType;
@ -17,15 +9,23 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.mapper.SysDictTypeMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
*
* @author ruoyi
*/
@Service
public class SysDictTypeServiceImpl implements ISysDictTypeService
{
public class SysDictTypeServiceImpl implements ISysDictTypeService {
@Autowired
private SysDictTypeMapper dictTypeMapper;
@ -36,51 +36,45 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
*
*/
@PostConstruct
public void init()
{
public void init() {
loadingDictCache();
}
/**
*
*
*
* @param dictType
* @return
*/
@Override
public List<SysDictType> selectDictTypeList(SysDictType dictType)
{
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
return dictTypeMapper.selectDictTypeList(dictType);
}
/**
*
*
*
* @return
*/
@Override
public List<SysDictType> selectDictTypeAll()
{
public List<SysDictType> selectDictTypeAll() {
return dictTypeMapper.selectDictTypeAll();
}
/**
*
*
*
* @param dictType
* @return
*/
@Override
public List<SysDictData> selectDictDataByType(String dictType)
{
public List<SysDictData> selectDictDataByType(String dictType) {
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotEmpty(dictDatas))
{
if (StringUtils.isNotEmpty(dictDatas)) {
return dictDatas;
}
dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotEmpty(dictDatas))
{
if (StringUtils.isNotEmpty(dictDatas)) {
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;
}
@ -89,41 +83,36 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
/**
* ID
*
*
* @param dictId ID
* @return
*/
@Override
public SysDictType selectDictTypeById(Long dictId)
{
public SysDictType selectDictTypeById(Long dictId) {
return dictTypeMapper.selectDictTypeById(dictId);
}
/**
*
*
*
* @param dictType
* @return
*/
@Override
public SysDictType selectDictTypeByType(String dictType)
{
public SysDictType selectDictTypeByType(String dictType) {
return dictTypeMapper.selectDictTypeByType(dictType);
}
/**
*
*
*
* @param dictIds ID
*/
@Override
public void deleteDictTypeByIds(Long[] dictIds)
{
for (Long dictId : dictIds)
{
public void deleteDictTypeByIds(Long[] dictIds) {
for (Long dictId : dictIds) {
SysDictType dictType = selectDictTypeById(dictId);
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
{
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
}
dictTypeMapper.deleteDictTypeById(dictId);
@ -135,13 +124,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
*
*/
@Override
public void loadingDictCache()
{
public void loadingDictCache() {
SysDictData dictData = new SysDictData();
dictData.setStatus("0");
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
{
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) {
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
}
}
@ -150,8 +137,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
*
*/
@Override
public void clearDictCache()
{
public void clearDictCache() {
DictUtils.clearDictCache();
}
@ -159,24 +145,21 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
*
*/
@Override
public void resetDictCache()
{
public void resetDictCache() {
clearDictCache();
loadingDictCache();
}
/**
*
*
*
* @param dict
* @return
*/
@Override
public int insertDictType(SysDictType dict)
{
public int insertDictType(SysDictType dict) {
int row = dictTypeMapper.insertDictType(dict);
if (row > 0)
{
if (row > 0) {
DictUtils.setDictCache(dict.getDictType(), null);
}
return row;
@ -184,19 +167,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
/**
*
*
*
* @param dict
* @return
*/
@Override
@Transactional
public int updateDictType(SysDictType dict)
{
public int updateDictType(SysDictType dict) {
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
int row = dictTypeMapper.updateDictType(dict);
if (row > 0)
{
if (row > 0) {
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
DictUtils.setDictCache(dict.getDictType(), dictDatas);
}
@ -205,17 +186,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
/**
*
*
*
* @param dict
* @return
*/
@Override
public boolean checkDictTypeUnique(SysDictType dict)
{
public boolean checkDictTypeUnique(SysDictType dict) {
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
{
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;

@ -26,9 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
<include refid="selectDictDataVo"/>
<where>
<if test="dictType != null and dictType != ''">
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
<if test="dictLabel != null and dictLabel != ''">

Loading…
Cancel
Save