masterniaoshen
Eterlaze 1 month ago
parent 2a4e121195
commit 3ef3bdc921

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="WarehouseManagerApi" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="WarehouseManagerApi" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.rabbiter</groupId>
<artifactId>WarehouseManagerApi</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>WarehouseManagerApi</name>
<description>Warehouse management system</description>
<!-- MyBatis Plus -->
<!-- Spring Boot Starter -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--mybatisPlus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.30</version>
</dependency>
<!--swagger-->
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>spring-boot-starter-swagger</artifactId>
<version>1.5.1.RELEASE</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,13 @@
package com.rabbiter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
@MapperScan("com.rabbiter.mapper")
public class WarehouseSystemApplication {
public static void main(String[] args) {
SpringApplication.run(WarehouseSystemApplication.class, args);
}
}

@ -0,0 +1,20 @@
package com.rabbiter.common;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
@Component
public class AutoFillMetaInfoHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createtime", LocalDateTime.now(),metaObject);
}
@Override
public void updateFill(MetaObject metaObject) {
}
}

@ -0,0 +1,26 @@
package com.rabbiter.common;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/*
* WebMvcConfigureraddCorsMappings
* @author rabbiter
* @date 2023/1/3 1:30
*/
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
//是否发送Cookie
.allowCredentials(true)
//放行哪些原始域
.allowedOriginPatterns("*")
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
.allowedHeaders("*")
.exposedHeaders("*");
}
}

@ -0,0 +1,23 @@
package com.rabbiter.common;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/*
* MybatisPlus
* @author rabbiter
* @date 2023/1/2 20:06
*/
@Configuration
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}

@ -0,0 +1,49 @@
package com.rabbiter.common;
import java.util.HashMap;
/*
*
* @author rabbiter
* @date 2023/1/2 19:53
*/
public class QueryPageParam {
//设置默认值
private int pageSize = 20;
private int pageNum = 1;
private HashMap param = new HashMap();
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public HashMap getParam() {
return param;
}
public void setParam(HashMap param) {
this.param = param;
}
@Override
public String toString() {
return "QueryPageParam{" +
"pageSize=" + pageSize +
", pageNum=" + pageNum +
", param=" + param +
'}';
}
}

@ -0,0 +1,82 @@
package com.rabbiter.common;
public class Result {
private int code; //编码 200/400
private String msg; //成功/失败
private Long total; //总记录数
private Object data; //数据
public static Result fail() {
return result(400, "失败", 0L, null);
}
// 添加一个接受String参数的fail方法
public static Result fail(String msg) {
return result(400, msg, 0L, null);
}
public static Result success() {
return result(200, "成功", 0L, null);
}
public static Result success(Object data) {
return result(200, "成功", 0L, data);
}
public static Result success(Object data, Long total) {
return result(200, "成功", total, data);
}
private static Result result(int code, String msg, Long total, Object data) {
Result res = new Result();
res.setData(data);
res.setMsg(msg);
res.setCode(code);
res.setTotal(total);
return res;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public String toString() {
return "Result{" +
"code=" + code +
", msg='" + msg + '\'' +
", total=" + total +
", data=" + data +
'}';
}
}

@ -0,0 +1,91 @@
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.common.QueryPageParam;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Goods;
import com.rabbiter.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@RestController
@RequestMapping("/goods")
public class GoodsController {
@Autowired
private GoodsService goodsService;
/*
*
* @author rabbiter
* @date 2023/1/6 12:12
*/
@PostMapping("/save")
public Result save(@RequestBody Goods goods){
return goodsService.save(goods)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/6 13:22
*/
@PostMapping("/update")
public Result update(@RequestBody Goods goods){
return goodsService.updateById(goods)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/6 13:24
*/
@GetMapping("/del")
public Result del(@RequestParam String id){
return goodsService.removeById(id)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/6 13:31
*/
@PostMapping("/listPage")
public Result listPage(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
String goodstype = (String)param.get("goodstype");
String storage = (String)param.get("storage");
Page<Goods> page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
LambdaQueryWrapper<Goods> queryWrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
queryWrapper.like(Goods::getName,name);
}
if(StringUtils.isNotBlank(goodstype) && !"null".equals(goodstype)){
queryWrapper.like(Goods::getGoodstype,goodstype);
}
if(StringUtils.isNotBlank(storage) && !"null".equals(storage)){
queryWrapper.like(Goods::getStorage,storage);
}
IPage result = goodsService.pageCC(page,queryWrapper);
return Result.success(result.getRecords(),result.getTotal());
}
}

@ -0,0 +1,97 @@
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.common.QueryPageParam;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Goodstype;
import com.rabbiter.service.GoodstypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@RestController
@RequestMapping("/goodstype")
public class GoodstypeController {
@Autowired
private GoodstypeService goodstypeService;
/*
*
* @author rabbiter
* @date 2023/1/5 20:39
*/
@PostMapping("/save")
public Result save(@RequestBody Goodstype goodstype){
return goodstypeService.save(goodstype)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 20:41
*/
@PostMapping("/update")
public Result update(@RequestBody Goodstype goodstype){
return goodstypeService.updateById(goodstype)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 20:43
*/
@GetMapping("/del")
public Result del(@RequestParam String id){
return goodstypeService.removeById(id)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 21:06
*/
@GetMapping("/list")
public Result list(){
List list = goodstypeService.list();
return Result.success(list);
}
/*
*
* @author rabbiter
* @date 2023/1/5 21:13
*/
@PostMapping("/listPage")
public Result listPage(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
Page<Goodstype> page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
LambdaQueryWrapper<Goodstype> queryWrapper = new LambdaQueryWrapper();
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
queryWrapper.like(Goodstype::getName,name);
}
IPage result = goodstypeService.pageCC(page,queryWrapper);
return Result.success(result.getRecords(),result.getTotal());
}
}

@ -0,0 +1,30 @@
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.rabbiter.common.Result;
import com.rabbiter.entity.User;
import com.rabbiter.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/user")
public class LoginController {
@Autowired
private UserService userService;
@PostMapping("/login")
public Result login(@RequestBody User user) {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("no", user.getUsername()).eq("password", user.getPassword());
User existUser = userService.getOne(queryWrapper);
if (existUser != null) {
// 用户存在,返回成功结果
return Result.success(existUser);
} else {
// 用户不存在,返回失败结果
return Result.fail("登录失败,用户名或密码错误");
}
}
}

@ -0,0 +1,38 @@
package com.rabbiter.controller;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Menu;
import com.rabbiter.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
@RestController
@RequestMapping("/menu")
public class MenuController {
@Autowired
private MenuService menuService;
/*
*
* @author rabbiter
* @date 2023/1/3 20:48
*/
@GetMapping("/list")
public Result list(@RequestParam String roleId){
List list = menuService.lambdaQuery()
.like(Menu::getMenuright,roleId)
.list();
return Result.success(list);
}
}

@ -0,0 +1,104 @@
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.common.QueryPageParam;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Goods;
import com.rabbiter.service.GoodsService;
import com.rabbiter.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import com.rabbiter.entity.Record;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.HashMap;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@RestController
@RequestMapping("/record")
public class RecordController {
@Autowired
private RecordService recordService;
@Autowired
private GoodsService goodsService;
/*
*
* @author rabbiter
* @date 2023/1/6 20:58
*/
@PostMapping("/listPage")
public Result listPage(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
String goodstype = (String)param.get("goodstype");
String storage = (String)param.get("storage");
String roleId = (String)param.get("roleId");
String userId = (String)param.get("userId");
Page page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
QueryWrapper<Record> queryWrapper = new QueryWrapper();
queryWrapper.apply("a.goods=b.id and b.storage=c.id and b.goodsType=d.id ");
if("2".equals(roleId)){
// queryWrapper.eq(Record::getUserid,userId);
queryWrapper.apply(" a.userId= "+userId);
}
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
queryWrapper.like("b.name",name);
}
if(StringUtils.isNotBlank(goodstype) && !"null".equals(goodstype)){
queryWrapper.eq("d.id",goodstype);
}
if(StringUtils.isNotBlank(storage) && !"null".equals(storage)){
queryWrapper.eq("c.id",storage);
}
IPage result = recordService.pageCC(page,queryWrapper);
return Result.success(result.getRecords(),result.getTotal());
}
/*
*
* @author rabbiter
* @date 2023/1/6 21:21
*/
@PostMapping("/save")
public Result save(@RequestBody Record record){
Goods goods = goodsService.getById(record.getGoods());
int n = record.getCount();
// 出库
if("2".equals(record.getAction())){
n = -n;
record.setCount(n);
}
int num = goods.getCount()+n;
if(num < 0) {
return Result.fail();
}
goods.setCount(num);
goodsService.updateById(goods);
record.setCreatetime(LocalDateTime.now());
return recordService.save(record)?Result.success():Result.fail();
}
}

@ -0,0 +1,25 @@
package com.rabbiter.controller;
import com.rabbiter.common.Result;
import com.rabbiter.entity.User;
import com.rabbiter.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/user") // Base path for user related APIs
public class RegisterController {
@Autowired
private UserService userService;
@PostMapping("/register") // Maps to /user/register
public Result register(@RequestBody User user) {
boolean isRegistered = userService.register(user);
if (isRegistered) {
return Result.success("注册成功");
} else {
return Result.fail("注册失败,用户名可能已存在或其他原因");
}
}
}

@ -0,0 +1,96 @@
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.common.QueryPageParam;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Storage;
import com.rabbiter.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@RestController
@RequestMapping("/storage")
public class StorageController {
@Autowired
private StorageService storageService;
/*
*
* @author rabbiter
* @date 2023/1/5 19:36
*/
@PostMapping("/save")
public Result save(@RequestBody Storage storage){
return storageService.save(storage)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 19:38
*/
@PostMapping("/update")
public Result update(@RequestBody Storage storage){
return storageService.updateById(storage)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 19:40
*/
@GetMapping("/del")
public Result del(@RequestParam String id){
return storageService.removeById(id)?Result.success():Result.fail();
}
/*
*
* @author rabbiter
* @date 2023/1/5 19:42
*/
@GetMapping("/list")
public Result list(){
List list = storageService.list();
return Result.success(list);
}
/*
*
* @author rabbiter
* @date 2023/1/5 19:43
*/
@PostMapping("/listPage")
public Result listPage(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
Page<Storage> page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
LambdaQueryWrapper<Storage> queryWrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
queryWrapper.like(Storage::getName,name);
}
IPage result = storageService.pageCC(page,queryWrapper);
return Result.success(result.getRecords(),result.getTotal());
}
}

@ -0,0 +1,117 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@ApiModel(value="Goods对象", description="")
public class Goods implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "货名")
private String name;
@ApiModelProperty(value = "仓库")
private Integer storage;
@ApiModelProperty(value = "分类")
@TableField("goodsType")
private Integer goodstype;
@ApiModelProperty(value = "数量")
private Integer count;
@ApiModelProperty(value = "备注")
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getStorage() {
return storage;
}
public void setStorage(Integer storage) {
this.storage = storage;
}
public Integer getGoodstype() {
return goodstype;
}
public void setGoodstype(Integer goodstype) {
this.goodstype = goodstype;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "Goods{" +
"id=" + id +
", name='" + name + '\'' +
", storage=" + storage +
", goodstype=" + goodstype +
", count=" + count +
", remark='" + remark + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Goods goods = (Goods) o;
return Objects.equals(id, goods.id) && Objects.equals(name, goods.name) && Objects.equals(storage, goods.storage) && Objects.equals(goodstype, goods.goodstype) && Objects.equals(count, goods.count) && Objects.equals(remark, goods.remark);
}
@Override
public int hashCode() {
return Objects.hash(id, name, storage, goodstype, count, remark);
}
}

@ -0,0 +1,79 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@ApiModel(value="Goodstype对象", description="")
public class Goodstype implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "分类名")
private String name;
@ApiModelProperty(value = "备注")
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer 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;
}
@Override
public String toString() {
return "Goodstype{" +
"id=" + id +
", name='" + name + '\'' +
", remark='" + remark + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Goodstype goodstype = (Goodstype) o;
return Objects.equals(id, goodstype.id) && Objects.equals(name, goodstype.name) && Objects.equals(remark, goodstype.remark);
}
@Override
public int hashCode() {
return Objects.hash(id, name, remark);
}
}

@ -0,0 +1,154 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
@ApiModel(value="Menu对象", description="")
public class Menu implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@ApiModelProperty(value = "菜单编码")
@TableField("menuCode")
private String menucode;
@ApiModelProperty(value = "菜单名字")
@TableField("menuName")
private String menuname;
@ApiModelProperty(value = "菜单级别")
@TableField("menuLevel")
private String menulevel;
@ApiModelProperty(value = "菜单的父code")
@TableField("menuParentCode")
private String menuparentcode;
@ApiModelProperty(value = "点击触发的函数")
@TableField("menuClick")
private String menuclick;
@ApiModelProperty(value = "权限 0快递员管理1表示快递员2表示用户可以用逗号组合使用")
@TableField("menuRight")
private String menuright;
@TableField("menuComponent")
private String menucomponent;
@TableField("menuIcon")
private String menuicon;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMenucode() {
return menucode;
}
public void setMenucode(String menucode) {
this.menucode = menucode;
}
public String getMenuname() {
return menuname;
}
public void setMenuname(String menuname) {
this.menuname = menuname;
}
public String getMenulevel() {
return menulevel;
}
public void setMenulevel(String menulevel) {
this.menulevel = menulevel;
}
public String getMenuparentcode() {
return menuparentcode;
}
public void setMenuparentcode(String menuparentcode) {
this.menuparentcode = menuparentcode;
}
public String getMenuclick() {
return menuclick;
}
public void setMenuclick(String menuclick) {
this.menuclick = menuclick;
}
public String getMenuright() {
return menuright;
}
public void setMenuright(String menuright) {
this.menuright = menuright;
}
public String getMenucomponent() {
return menucomponent;
}
public void setMenucomponent(String menucomponent) {
this.menucomponent = menucomponent;
}
public String getMenuicon() {
return menuicon;
}
public void setMenuicon(String menuicon) {
this.menuicon = menuicon;
}
@Override
public String toString() {
return "Menu{" +
"id=" + id +
", menucode='" + menucode + '\'' +
", menuname='" + menuname + '\'' +
", menulevel='" + menulevel + '\'' +
", menuparentcode='" + menuparentcode + '\'' +
", menuclick='" + menuclick + '\'' +
", menuright='" + menuright + '\'' +
", menucomponent='" + menucomponent + '\'' +
", menuicon='" + menuicon + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Menu menu = (Menu) o;
return Objects.equals(id, menu.id) && Objects.equals(menucode, menu.menucode) && Objects.equals(menuname, menu.menuname) && Objects.equals(menulevel, menu.menulevel) && Objects.equals(menuparentcode, menu.menuparentcode) && Objects.equals(menuclick, menu.menuclick) && Objects.equals(menuright, menu.menuright) && Objects.equals(menucomponent, menu.menucomponent) && Objects.equals(menuicon, menu.menuicon);
}
@Override
public int hashCode() {
return Objects.hash(id, menucode, menuname, menulevel, menuparentcode, menuclick, menuright, menucomponent, menuicon);
}
}

@ -0,0 +1,142 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@ApiModel(value="Record对象", description="")
public class Record implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "货品id")
private Integer goods;
@ApiModelProperty(value = "取货人/补货人")
@TableField("userId")
private Integer userid;
@ApiModelProperty(value = "操作人id")
private Integer adminId;
@ApiModelProperty(value = "数量")
private Integer count;
@ApiModelProperty(value = "操作时间")
private LocalDateTime createtime;
@ApiModelProperty(value = "备注")
private String remark;
@TableField(exist = false)
private String action;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGoods() {
return goods;
}
public void setGoods(Integer goods) {
this.goods = goods;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public Integer getAdminId() {
return adminId;
}
public void setAdminId(Integer adminId) {
this.adminId = adminId;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public LocalDateTime getCreatetime() {
return createtime;
}
public void setCreatetime(LocalDateTime createtime) {
this.createtime = createtime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
@Override
public String toString() {
return "Record{" +
"id=" + id +
", goods=" + goods +
", userid=" + userid +
", adminId=" + adminId +
", count=" + count +
", createtime=" + createtime +
", remark='" + remark + '\'' +
", action='" + action + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Record record = (Record) o;
return Objects.equals(id, record.id) && Objects.equals(goods, record.goods) && Objects.equals(userid, record.userid) && Objects.equals(adminId, record.adminId) && Objects.equals(count, record.count) && Objects.equals(createtime, record.createtime) && Objects.equals(remark, record.remark) && Objects.equals(action, record.action);
}
@Override
public int hashCode() {
return Objects.hash(id, goods, userid, adminId, count, createtime, remark, action);
}
}

@ -0,0 +1,61 @@
package com.rabbiter.entity;
public class RecordRes extends Record{
private String username;
private String adminname;
private String goodsname;
private String storagename;
private String goodstypename;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getAdminname() {
return adminname;
}
public void setAdminname(String adminname) {
this.adminname = adminname;
}
public String getGoodsname() {
return goodsname;
}
public void setGoodsname(String goodsname) {
this.goodsname = goodsname;
}
public String getStoragename() {
return storagename;
}
public void setStoragename(String storagename) {
this.storagename = storagename;
}
public String getGoodstypename() {
return goodstypename;
}
public void setGoodstypename(String goodstypename) {
this.goodstypename = goodstypename;
}
@Override
public String toString() {
return "RecordRes{" +
"username='" + username + '\'' +
", adminname='" + adminname + '\'' +
", goodsname='" + goodsname + '\'' +
", storagename='" + storagename + '\'' +
", goodstypename='" + goodstypename + '\'' +
'}';
}
}

@ -0,0 +1,79 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@ApiModel(value="Storage对象", description="")
public class Storage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "仓库名")
private String name;
@ApiModelProperty(value = "备注")
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer 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;
}
@Override
public String toString() {
return "Storage{" +
"id=" + id +
", name='" + name + '\'' +
", remark='" + remark + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Storage storage = (Storage) o;
return Objects.equals(id, storage.id) && Objects.equals(name, storage.name) && Objects.equals(remark, storage.remark);
}
@Override
public int hashCode() {
return Objects.hash(id, name, remark);
}
}

@ -0,0 +1,149 @@
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value="User对象", description="")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "账号")
private String no;
@ApiModelProperty(value = "名字")
private String name;
@ApiModelProperty(value = "密码")
private String password;
private Integer age;
@ApiModelProperty(value = "性别")
private Integer sex;
@ApiModelProperty(value = "电话")
private String phone;
@ApiModelProperty(value = "角色 0快递员管理1快递员2用户")
private Integer roleId;
@ApiModelProperty(value = "是否有效Y有效其他无效")
@TableField("isValid")
private String isvalid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public String getIsvalid() {
return isvalid;
}
public void setIsvalid(String isvalid) {
this.isvalid = isvalid;
}
// 新增的 getUsername 方法
public String getUsername() {
return this.no;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", no='" + no + '\'' +
", name='" + name + '\'' +
", password='" + password + '\'' +
", age=" + age +
", sex=" + sex +
", phone='" + phone + '\'' +
", roleId=" + roleId +
", isvalid='" + isvalid + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(id, user.id) && Objects.equals(no, user.no) && Objects.equals(name, user.name) && Objects.equals(password, user.password) && Objects.equals(age, user.age) && Objects.equals(sex, user.sex) && Objects.equals(phone, user.phone) && Objects.equals(roleId, user.roleId) && Objects.equals(isvalid, user.isvalid);
}
@Override
public int hashCode() {
return Objects.hash(id, no, name, password, age, sex, phone, roleId, isvalid);
}
}

@ -0,0 +1,22 @@
package com.rabbiter.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.rabbiter.entity.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
IPage pageCC(IPage<Goods> page, @Param(Constants.WRAPPER) Wrapper wrapper);
}

@ -0,0 +1,22 @@
package com.rabbiter.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.rabbiter.entity.Goodstype;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@Mapper
public interface GoodstypeMapper extends BaseMapper<Goodstype> {
IPage pageCC(IPage<Goodstype> page, @Param(Constants.WRAPPER) Wrapper wrapper);
}

@ -0,0 +1,18 @@
package com.rabbiter.mapper;
import com.rabbiter.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
}

@ -0,0 +1,22 @@
package com.rabbiter.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.rabbiter.entity.Record;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@Mapper
public interface RecordMapper extends BaseMapper<Record> {
IPage pageCC(IPage<Record> page, @Param(Constants.WRAPPER) Wrapper wrapper);
}

@ -0,0 +1,22 @@
package com.rabbiter.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.rabbiter.entity.Storage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@Mapper
public interface StorageMapper extends BaseMapper<Storage> {
IPage pageCC(IPage<Storage> page, @Param(Constants.WRAPPER) Wrapper wrapper);
}

@ -0,0 +1,15 @@
package com.rabbiter.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rabbiter.entity.User;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@Mapper
public interface UserMapper extends BaseMapper<User> {
IPage<User> pageC(IPage<User> page);
IPage<User> pageCC(IPage<User> page, Wrapper<User> wrapper);
int insert(User user);
}

@ -0,0 +1,18 @@
package com.rabbiter.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
public interface GoodsService extends IService<Goods> {
IPage pageCC(IPage<Goods> page, Wrapper wrapper);
}

@ -0,0 +1,18 @@
package com.rabbiter.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Goodstype;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
public interface GoodstypeService extends IService<Goodstype> {
IPage pageCC(IPage<Goodstype> page, Wrapper wrapper);
}

@ -0,0 +1,28 @@
package com.rabbiter.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Goods;
import com.rabbiter.mapper.GoodsMapper;
import com.rabbiter.service.GoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
@Autowired
private GoodsMapper goodsMapper;
@Override
public IPage pageCC(IPage<Goods> page, Wrapper wrapper) {
return goodsMapper.pageCC(page,wrapper);
}
}

@ -0,0 +1,30 @@
package com.rabbiter.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Goodstype;
import com.rabbiter.mapper.GoodstypeMapper;
import com.rabbiter.service.GoodstypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@Service
public class GoodstypeServiceImpl extends ServiceImpl<GoodstypeMapper, Goodstype> implements GoodstypeService {
@Autowired
private GoodstypeMapper goodstypeMapper;
@Override
public IPage pageCC(IPage<Goodstype> page, Wrapper wrapper) {
return goodstypeMapper.pageCC(page,wrapper);
}
}

@ -0,0 +1,20 @@
package com.rabbiter.service.Impl;
import com.rabbiter.entity.Menu;
import com.rabbiter.mapper.MenuMapper;
import com.rabbiter.service.MenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
}

@ -0,0 +1,29 @@
package com.rabbiter.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Record;
import com.rabbiter.mapper.RecordMapper;
import com.rabbiter.service.RecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@Service
public class RecordServiceImpl extends ServiceImpl<RecordMapper, Record> implements RecordService {
@Autowired
private RecordMapper recordMapper;
@Override
public IPage pageCC(IPage<Record> page, Wrapper wrapper) {
return recordMapper.pageCC(page,wrapper);
}
}

@ -0,0 +1,29 @@
package com.rabbiter.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Storage;
import com.rabbiter.mapper.StorageMapper;
import com.rabbiter.service.StorageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
@Service
public class StorageServiceImpl extends ServiceImpl<StorageMapper, Storage> implements StorageService {
@Autowired
private StorageMapper storageMapper;
@Override
public IPage pageCC(IPage<Storage> page, Wrapper wrapper) {
return storageMapper.pageCC(page,wrapper);
}
}

@ -0,0 +1,33 @@
package com.rabbiter.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.User;
import com.rabbiter.mapper.UserMapper;
import com.rabbiter.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public IPage<User> pageC(IPage<User> page) {
return userMapper.selectPage(page, new QueryWrapper<>());
}
@Override
public IPage<User> pageCC(IPage<User> page, Wrapper<User> wrapper) {
return userMapper.selectPage(page, wrapper);
}
@Override
public boolean register(User user) {
return save(user);
}
}

@ -0,0 +1,16 @@
package com.rabbiter.service;
import com.rabbiter.entity.Menu;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
public interface MenuService extends IService<Menu> {
}

@ -0,0 +1,18 @@
package com.rabbiter.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Record;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
public interface RecordService extends IService<Record> {
IPage pageCC(IPage<Record> page, Wrapper wrapper);
}

@ -0,0 +1,18 @@
package com.rabbiter.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.Storage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-05
*/
public interface StorageService extends IService<Storage> {
IPage pageCC(IPage<Storage> page, Wrapper wrapper);
}

@ -0,0 +1,12 @@
package com.rabbiter.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rabbiter.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
public interface UserService extends IService<User> {
IPage<User> pageC(IPage<User> page);
IPage<User> pageCC(IPage<User> page, Wrapper<User> wrapper);
boolean register(User user);
}

@ -0,0 +1,25 @@
server:
port: 8002
spring:
datasource:
url: jdbc:mysql://localhost:3306/rl?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.rabbiter.entity
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
logging:
level:
com.rabbiter: debug

@ -0,0 +1,24 @@
<?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.rabbiter.mapper.GoodsMapper">
<select id="pageCC" resultType="com.rabbiter.entity.Goods">
select * from goods ${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Goods">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="storage" property="storage" />
<result column="goodsType" property="goodstype" />
<result column="count" property="count" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, storage, goodsType, count, remark
</sql>
</mapper>

@ -0,0 +1,21 @@
<?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.rabbiter.mapper.GoodstypeMapper">
<select id="pageCC" resultType="com.rabbiter.entity.Goodstype">
select * from Goodstype ${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Goodstype">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, remark
</sql>
</mapper>

@ -0,0 +1,23 @@
<?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.rabbiter.mapper.MenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Menu">
<id column="id" property="id" />
<result column="menuCode" property="menucode" />
<result column="menuName" property="menuname" />
<result column="menuLevel" property="menulevel" />
<result column="menuParentCode" property="menuparentcode" />
<result column="menuClick" property="menuclick" />
<result column="menuRight" property="menuright" />
<result column="menuComponent" property="menucomponent" />
<result column="menuIcon" property="menuicon" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, menuCode, menuName, menuLevel, menuParentCode, menuClick, menuRight, menuComponent, menuIcon
</sql>
</mapper>

@ -0,0 +1,31 @@
<?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.rabbiter.mapper.RecordMapper">
<select id="pageCC" resultType="com.rabbiter.entity.RecordRes">
select a.*,b.name goodsname,c.name storagename,d.name goodstypename,
(select u.name from user u where u.id=a.userid)username,
(select u.name from user u where u.id=a.admin_id)adminname
from record a ,goods b,storage c,goodsType d
/* where a.goods=b.id
and b.storage=c.id and b.goodsType=d.id*/
${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Record">
<id column="id" property="id" />
<result column="goods" property="goods" />
<result column="userId" property="userid" />
<result column="admin_id" property="adminId" />
<result column="count" property="count" />
<result column="createtime" property="createtime" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, goods, userId, admin_id, count, createtime, remark
</sql>
</mapper>

@ -0,0 +1,20 @@
<?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.rabbiter.mapper.StorageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Storage">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, remark
</sql>
<select id="pageCC" resultType="com.rabbiter.entity.Storage">
select * from storage ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,31 @@
<?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.rabbiter.mapper.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.User">
<id column="id" property="id" />
<result column="no" property="no" />
<result column="name" property="name" />
<result column="password" property="password" />
<result column="age" property="age" />
<result column="sex" property="sex" />
<result column="phone" property="phone" />
<result column="role_id" property="roleId" />
<result column="isValid" property="isvalid" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, no, name, password, age, sex, phone, role_id, isValid
</sql>
<select id="pageC" resultType="com.rabbiter.entity.User">
select * from user
</select>
<select id="pageCC" resultType="com.rabbiter.entity.User">
select * from user ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,13 @@
package com.rabbiter;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class WarehouseSystemApplicationTests {
@Test
void contextLoads() {
}
}

@ -0,0 +1,25 @@
server:
port: 8002
spring:
datasource:
url: jdbc:mysql://localhost:3306/yzl?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.rabbiter.entity
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
logging:
level:
com.rabbiter: debug

@ -0,0 +1,24 @@
<?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.rabbiter.mapper.GoodsMapper">
<select id="pageCC" resultType="com.rabbiter.entity.Goods">
select * from goods ${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Goods">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="storage" property="storage" />
<result column="goodsType" property="goodstype" />
<result column="count" property="count" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, storage, goodsType, count, remark
</sql>
</mapper>

@ -0,0 +1,21 @@
<?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.rabbiter.mapper.GoodstypeMapper">
<select id="pageCC" resultType="com.rabbiter.entity.Goodstype">
select * from Goodstype ${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Goodstype">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, remark
</sql>
</mapper>

@ -0,0 +1,23 @@
<?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.rabbiter.mapper.MenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Menu">
<id column="id" property="id" />
<result column="menuCode" property="menucode" />
<result column="menuName" property="menuname" />
<result column="menuLevel" property="menulevel" />
<result column="menuParentCode" property="menuparentcode" />
<result column="menuClick" property="menuclick" />
<result column="menuRight" property="menuright" />
<result column="menuComponent" property="menucomponent" />
<result column="menuIcon" property="menuicon" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, menuCode, menuName, menuLevel, menuParentCode, menuClick, menuRight, menuComponent, menuIcon
</sql>
</mapper>

@ -0,0 +1,31 @@
<?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.rabbiter.mapper.RecordMapper">
<select id="pageCC" resultType="com.rabbiter.entity.RecordRes">
select a.*,b.name goodsname,c.name storagename,d.name goodstypename,
(select u.name from user u where u.id=a.userid)username,
(select u.name from user u where u.id=a.admin_id)adminname
from record a ,goods b,storage c,goodsType d
/* where a.goods=b.id
and b.storage=c.id and b.goodsType=d.id*/
${ew.customSqlSegment}
</select>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Record">
<id column="id" property="id" />
<result column="goods" property="goods" />
<result column="userId" property="userid" />
<result column="admin_id" property="adminId" />
<result column="count" property="count" />
<result column="createtime" property="createtime" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, goods, userId, admin_id, count, createtime, remark
</sql>
</mapper>

@ -0,0 +1,20 @@
<?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.rabbiter.mapper.StorageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.Storage">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, remark
</sql>
<select id="pageCC" resultType="com.rabbiter.entity.Storage">
select * from storage ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,31 @@
<?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.rabbiter.mapper.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rabbiter.entity.User">
<id column="id" property="id" />
<result column="no" property="no" />
<result column="name" property="name" />
<result column="password" property="password" />
<result column="age" property="age" />
<result column="sex" property="sex" />
<result column="phone" property="phone" />
<result column="role_id" property="roleId" />
<result column="isValid" property="isvalid" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, no, name, password, age, sex, phone, role_id, isValid
</sql>
<select id="pageC" resultType="com.rabbiter.entity.User">
select * from user
</select>
<select id="pageCC" resultType="com.rabbiter.entity.User">
select * from user ${ew.customSqlSegment}
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save