Pre Merge pull request !320 from muzi/dev
commit
636fec875b
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.system.api.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/10 20:07
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class IdVo implements Serializable {
|
||||
private Integer id;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.system.api.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/10 20:57
|
||||
*/
|
||||
//登录的vo实体类
|
||||
@Data
|
||||
public class LoginVo implements Serializable {
|
||||
private String nickName;
|
||||
private String userPass;
|
||||
private String code;
|
||||
private String phone;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.system.api.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description //TODO
|
||||
* @Author 王辉
|
||||
* @Date 2022/11/14 18:34
|
||||
*/
|
||||
@Data
|
||||
public class PageInfoVo implements Serializable {
|
||||
|
||||
//分页
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
//区间查询
|
||||
private Integer maxprice;
|
||||
private Integer minprice;
|
||||
//模糊条件查询
|
||||
private String keyWord;
|
||||
//根据类型
|
||||
private Integer id;
|
||||
private Integer pid;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.system.api.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/14 8:05
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PassWordCode implements Serializable {
|
||||
private Integer userId;
|
||||
private String oldPassword;
|
||||
private String newPassword;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.system.api.model;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/11 8:18
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PhoneVo extends BaseEntity {
|
||||
private String phone;
|
||||
private String code;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.common.swagger.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class Knife4jConfiguration {
|
||||
@Bean(value = "dockerBean")
|
||||
public Docket dockerBean() {
|
||||
//指定使用Swagger2规范
|
||||
Docket docket = new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(webApiInfo())
|
||||
//分组名称
|
||||
.groupName("WebApi")
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.ruoyi"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
|
||||
private ApiInfo webApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
//描述字段支持Markdown语法
|
||||
.title("Weekly-API")
|
||||
.contact(new Contact("木子", "https://www.muzi.net/", "muzi@muzi.com"))
|
||||
.description("实训项目端")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.1</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-invest</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.invest;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class RuoYiInvestApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(RuoYiInvestApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 投资模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.invest.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.invest.service.TbFirmService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.invest.domain.TbFirm;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 企业Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/firm")
|
||||
public class TbFirmController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private TbFirmService tbFirmService;
|
||||
|
||||
/**
|
||||
* 查询企业列表
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbFirm tbFirm)
|
||||
{
|
||||
startPage();
|
||||
List<TbFirm> list = tbFirmService.selectTbFirmList(tbFirm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出企业列表
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:export")
|
||||
@Log(title = "企业", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbFirm tbFirm)
|
||||
{
|
||||
List<TbFirm> list = tbFirmService.selectTbFirmList(tbFirm);
|
||||
ExcelUtil<TbFirm> util = new ExcelUtil<TbFirm>(TbFirm.class);
|
||||
util.exportExcel(response, list, "企业数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业详细信息
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:query")
|
||||
@GetMapping(value = "/{firmId}")
|
||||
public AjaxResult getInfo(@PathVariable("firmId") Long firmId)
|
||||
{
|
||||
return success(tbFirmService.selectTbFirmByFirmId(firmId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:add")
|
||||
@Log(title = "企业", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbFirm tbFirm)
|
||||
{
|
||||
return toAjax(tbFirmService.insertTbFirm(tbFirm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:edit")
|
||||
@Log(title = "企业", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbFirm tbFirm)
|
||||
{
|
||||
return toAjax(tbFirmService.updateTbFirm(tbFirm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业
|
||||
*/
|
||||
// @RequiresPermissions("system:firm:remove")
|
||||
@Log(title = "企业", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{firmIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] firmIds)
|
||||
{
|
||||
return toAjax(tbFirmService.deleteTbFirmByFirmIds(firmIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.invest.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.invest.domain.TbInvest;
|
||||
import com.ruoyi.invest.service.TbInvestService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 投资Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/invest")
|
||||
public class TbInvestController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private TbInvestService tbInvestService;
|
||||
|
||||
/**
|
||||
* 查询投资列表
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbInvest tbInvest)
|
||||
{
|
||||
startPage();
|
||||
List<TbInvest> list = tbInvestService.selectTbInvestList(tbInvest);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出投资列表
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:export")
|
||||
@Log(title = "投资", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbInvest tbInvest)
|
||||
{
|
||||
List<TbInvest> list = tbInvestService.selectTbInvestList(tbInvest);
|
||||
ExcelUtil<TbInvest> util = new ExcelUtil<TbInvest>(TbInvest.class);
|
||||
util.exportExcel(response, list, "投资数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取投资详细信息
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:query")
|
||||
@GetMapping(value = "/{investId}")
|
||||
public AjaxResult getInfo(@PathVariable("investId") Long investId)
|
||||
{
|
||||
return success(tbInvestService.selectTbInvestByInvestId(investId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增投资
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:add")
|
||||
@Log(title = "投资", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbInvest tbInvest)
|
||||
{
|
||||
return toAjax(tbInvestService.insertTbInvest(tbInvest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改投资
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:edit")
|
||||
@Log(title = "投资", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbInvest tbInvest)
|
||||
{
|
||||
return toAjax(tbInvestService.updateTbInvest(tbInvest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除投资
|
||||
*/
|
||||
// @RequiresPermissions("system:invest:remove")
|
||||
@Log(title = "投资", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{investIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] investIds)
|
||||
{
|
||||
return toAjax(tbInvestService.deleteTbInvestByInvestIds(investIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.ruoyi.invest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 企业表
|
||||
* @TableName tb_firm
|
||||
*/
|
||||
@TableName(value ="tb_firm")
|
||||
@Data
|
||||
public class TbFirm implements Serializable {
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer firmId;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 企业logo
|
||||
*/
|
||||
private String firmPic;
|
||||
|
||||
/**
|
||||
* 企业市值
|
||||
*/
|
||||
private Double firmMarket;
|
||||
|
||||
/**
|
||||
* 企业描述
|
||||
*/
|
||||
private String firmDesc;
|
||||
|
||||
/**
|
||||
* 删除状态0:存在2:删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ruoyi.invest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 投资表
|
||||
* @TableName tb_invest
|
||||
*/
|
||||
@TableName(value ="tb_invest")
|
||||
@Data
|
||||
public class TbInvest implements Serializable {
|
||||
/**
|
||||
* 投资id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer investId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private Integer firmId;
|
||||
|
||||
/**
|
||||
* 投资金额
|
||||
*/
|
||||
private Double investAmount;
|
||||
|
||||
/**
|
||||
* 投资收益
|
||||
*/
|
||||
private Double investYield;
|
||||
|
||||
/**
|
||||
* 投资状态0:手动投资1:自动投资
|
||||
*/
|
||||
private Integer investState;
|
||||
|
||||
/**
|
||||
* 删除状态0:存在2:删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.invest.mapper;
|
||||
|
||||
import com.ruoyi.invest.domain.TbFirm;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Entity com.ruoyi.invest.domain.TbFirm
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbFirmMapper extends BaseMapper<TbFirm> {
|
||||
/**
|
||||
* 查询企业
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 企业
|
||||
*/
|
||||
public TbFirm selectTbFirmByFirmId(Long firmId);
|
||||
|
||||
/**
|
||||
* 查询企业列表
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 企业集合
|
||||
*/
|
||||
public List<TbFirm> selectTbFirmList(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 新增企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbFirm(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 修改企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbFirm(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 删除企业
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbFirmByFirmId(Long firmId);
|
||||
|
||||
/**
|
||||
* 批量删除企业
|
||||
*
|
||||
* @param firmIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbFirmByFirmIds(Long[] firmIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.invest.mapper;
|
||||
|
||||
import com.ruoyi.invest.domain.TbInvest;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Entity com.ruoyi.invest.domain.TbInvest
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbInvestMapper extends BaseMapper<TbInvest> {
|
||||
/**
|
||||
* 查询投资
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 投资
|
||||
*/
|
||||
public TbInvest selectTbInvestByInvestId(Long investId);
|
||||
|
||||
/**
|
||||
* 查询投资列表
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 投资集合
|
||||
*/
|
||||
public List<TbInvest> selectTbInvestList(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 新增投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbInvest(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 修改投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbInvest(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 删除投资
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbInvestByInvestId(Long investId);
|
||||
|
||||
/**
|
||||
* 批量删除投资
|
||||
*
|
||||
* @param investIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbInvestByInvestIds(Long[] investIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.ruoyi.invest.service;
|
||||
|
||||
import com.ruoyi.invest.domain.TbFirm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TbFirmService extends IService<TbFirm> {
|
||||
/**
|
||||
* 查询企业
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 企业
|
||||
*/
|
||||
public TbFirm selectTbFirmByFirmId(Long firmId);
|
||||
|
||||
/**
|
||||
* 查询企业列表
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 企业集合
|
||||
*/
|
||||
public List<TbFirm> selectTbFirmList(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 新增企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbFirm(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 修改企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbFirm(TbFirm tbFirm);
|
||||
|
||||
/**
|
||||
* 批量删除企业
|
||||
*
|
||||
* @param firmIds 需要删除的企业主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbFirmByFirmIds(Long[] firmIds);
|
||||
|
||||
/**
|
||||
* 删除企业信息
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbFirmByFirmId(Long firmId);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.ruoyi.invest.service;
|
||||
|
||||
import com.ruoyi.invest.domain.TbInvest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TbInvestService extends IService<TbInvest> {
|
||||
/**
|
||||
* 查询投资
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 投资
|
||||
*/
|
||||
public TbInvest selectTbInvestByInvestId(Long investId);
|
||||
|
||||
/**
|
||||
* 查询投资列表
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 投资集合
|
||||
*/
|
||||
public List<TbInvest> selectTbInvestList(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 新增投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbInvest(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 修改投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbInvest(TbInvest tbInvest);
|
||||
|
||||
/**
|
||||
* 批量删除投资
|
||||
*
|
||||
* @param investIds 需要删除的投资主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbInvestByInvestIds(Long[] investIds);
|
||||
|
||||
/**
|
||||
* 删除投资信息
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbInvestByInvestId(Long investId);
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.invest.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.invest.domain.TbFirm;
|
||||
import com.ruoyi.invest.service.TbFirmService;
|
||||
import com.ruoyi.invest.mapper.TbFirmMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TbFirmServiceImpl extends ServiceImpl<TbFirmMapper, TbFirm>
|
||||
implements TbFirmService{
|
||||
@Autowired
|
||||
private TbFirmMapper tbFirmMapper;
|
||||
|
||||
/**
|
||||
* 查询企业
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 企业
|
||||
*/
|
||||
@Override
|
||||
public TbFirm selectTbFirmByFirmId(Long firmId)
|
||||
{
|
||||
return tbFirmMapper.selectTbFirmByFirmId(firmId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业列表
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 企业
|
||||
*/
|
||||
@Override
|
||||
public List<TbFirm> selectTbFirmList(TbFirm tbFirm)
|
||||
{
|
||||
return tbFirmMapper.selectTbFirmList(tbFirm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbFirm(TbFirm tbFirm)
|
||||
{
|
||||
tbFirm.setCreateTime(DateUtils.getNowDate());
|
||||
return tbFirmMapper.insertTbFirm(tbFirm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业
|
||||
*
|
||||
* @param tbFirm 企业
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbFirm(TbFirm tbFirm)
|
||||
{
|
||||
tbFirm.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbFirmMapper.updateTbFirm(tbFirm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除企业
|
||||
*
|
||||
* @param firmIds 需要删除的企业主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbFirmByFirmIds(Long[] firmIds)
|
||||
{
|
||||
return tbFirmMapper.deleteTbFirmByFirmIds(firmIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业信息
|
||||
*
|
||||
* @param firmId 企业主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbFirmByFirmId(Long firmId)
|
||||
{
|
||||
return tbFirmMapper.deleteTbFirmByFirmId(firmId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.invest.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.invest.domain.TbInvest;
|
||||
import com.ruoyi.invest.service.TbInvestService;
|
||||
import com.ruoyi.invest.mapper.TbInvestMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TbInvestServiceImpl extends ServiceImpl<TbInvestMapper, TbInvest>
|
||||
implements TbInvestService{
|
||||
@Autowired
|
||||
private TbInvestMapper tbInvestMapper;
|
||||
|
||||
/**
|
||||
* 查询投资
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 投资
|
||||
*/
|
||||
@Override
|
||||
public TbInvest selectTbInvestByInvestId(Long investId)
|
||||
{
|
||||
return tbInvestMapper.selectTbInvestByInvestId(investId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询投资列表
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 投资
|
||||
*/
|
||||
@Override
|
||||
public List<TbInvest> selectTbInvestList(TbInvest tbInvest)
|
||||
{
|
||||
return tbInvestMapper.selectTbInvestList(tbInvest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbInvest(TbInvest tbInvest)
|
||||
{
|
||||
tbInvest.setCreateTime(DateUtils.getNowDate());
|
||||
return tbInvestMapper.insertTbInvest(tbInvest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改投资
|
||||
*
|
||||
* @param tbInvest 投资
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbInvest(TbInvest tbInvest)
|
||||
{
|
||||
tbInvest.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbInvestMapper.updateTbInvest(tbInvest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除投资
|
||||
*
|
||||
* @param investIds 需要删除的投资主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbInvestByInvestIds(Long[] investIds)
|
||||
{
|
||||
return tbInvestMapper.deleteTbInvestByInvestIds(investIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除投资信息
|
||||
*
|
||||
* @param investId 投资主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbInvestByInvestId(Long investId)
|
||||
{
|
||||
return tbInvestMapper.deleteTbInvestByInvestId(investId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9301
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-invest
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/ruoyi-invest" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,93 @@
|
||||
<?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.ruoyi.invest.mapper.TbFirmMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.invest.domain.TbFirm" id="TbFirmResult">
|
||||
<result property="firmId" column="firm_id" />
|
||||
<result property="firmName" column="firm_name" />
|
||||
<result property="firmPic" column="firm_pic" />
|
||||
<result property="firmMarket" column="firm_market" />
|
||||
<result property="firmDesc" column="firm_desc" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbFirmVo">
|
||||
select firm_id, firm_name, firm_pic, firm_market, firm_desc, del_flag, create_time, create_by, update_time, update_by from tb_firm
|
||||
</sql>
|
||||
|
||||
<select id="selectTbFirmList" parameterType="com.ruoyi.invest.domain.TbFirm" resultMap="TbFirmResult">
|
||||
<include refid="selectTbFirmVo"/>
|
||||
<where>
|
||||
<if test="firmName != null and firmName != ''"> and firm_name like concat('%', #{firmName}, '%')</if>
|
||||
<if test="firmPic != null and firmPic != ''"> and firm_pic = #{firmPic}</if>
|
||||
<if test="firmMarket != null "> and firm_market = #{firmMarket}</if>
|
||||
<if test="firmDesc != null and firmDesc != ''"> and firm_desc = #{firmDesc}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbFirmByFirmId" parameterType="Long" resultMap="TbFirmResult">
|
||||
<include refid="selectTbFirmVo"/>
|
||||
where firm_id = #{firmId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbFirm" parameterType="com.ruoyi.invest.domain.TbFirm">
|
||||
insert into tb_firm
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="firmId != null">firm_id,</if>
|
||||
<if test="firmName != null">firm_name,</if>
|
||||
<if test="firmPic != null">firm_pic,</if>
|
||||
<if test="firmMarket != null">firm_market,</if>
|
||||
<if test="firmDesc != null">firm_desc,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="firmId != null">#{firmId},</if>
|
||||
<if test="firmName != null">#{firmName},</if>
|
||||
<if test="firmPic != null">#{firmPic},</if>
|
||||
<if test="firmMarket != null">#{firmMarket},</if>
|
||||
<if test="firmDesc != null">#{firmDesc},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbFirm" parameterType="com.ruoyi.invest.domain.TbFirm">
|
||||
update tb_firm
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="firmName != null">firm_name = #{firmName},</if>
|
||||
<if test="firmPic != null">firm_pic = #{firmPic},</if>
|
||||
<if test="firmMarket != null">firm_market = #{firmMarket},</if>
|
||||
<if test="firmDesc != null">firm_desc = #{firmDesc},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where firm_id = #{firmId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbFirmByFirmId" parameterType="Long">
|
||||
delete from tb_firm where firm_id = #{firmId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbFirmByFirmIds" parameterType="String">
|
||||
delete from tb_firm where firm_id in
|
||||
<foreach item="firmId" collection="array" open="(" separator="," close=")">
|
||||
#{firmId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,96 @@
|
||||
<?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.ruoyi.invest.mapper.TbInvestMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.invest.domain.TbInvest" id="TbInvestResult">
|
||||
<result property="investId" column="invest_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="firmId" column="firm_id" />
|
||||
<result property="investAmount" column="invest_amount" />
|
||||
<result property="investYield" column="invest_yield" />
|
||||
<result property="investState" column="invest_state" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbInvestVo">
|
||||
select invest_id, user_id, firm_id, invest_amount, invest_yield, invest_state, del_flag, create_time, create_by, update_time, update_by from tb_invest
|
||||
</sql>
|
||||
|
||||
<select id="selectTbInvestList" parameterType="com.ruoyi.invest.domain.TbInvest" resultMap="TbInvestResult">
|
||||
<include refid="selectTbInvestVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="firmId != null "> and firm_id = #{firmId}</if>
|
||||
<if test="investAmount != null "> and invest_amount = #{investAmount}</if>
|
||||
<if test="investYield != null "> and invest_yield = #{investYield}</if>
|
||||
<if test="investState != null "> and invest_state = #{investState}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbInvestByInvestId" parameterType="Long" resultMap="TbInvestResult">
|
||||
<include refid="selectTbInvestVo"/>
|
||||
where invest_id = #{investId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbInvest" parameterType="com.ruoyi.invest.domain.TbInvest" useGeneratedKeys="true" keyProperty="investId">
|
||||
insert into tb_invest
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="firmId != null">firm_id,</if>
|
||||
<if test="investAmount != null">invest_amount,</if>
|
||||
<if test="investYield != null">invest_yield,</if>
|
||||
<if test="investState != null">invest_state,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="firmId != null">#{firmId},</if>
|
||||
<if test="investAmount != null">#{investAmount},</if>
|
||||
<if test="investYield != null">#{investYield},</if>
|
||||
<if test="investState != null">#{investState},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbInvest" parameterType="com.ruoyi.invest.domain.TbInvest">
|
||||
update tb_invest
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="firmId != null">firm_id = #{firmId},</if>
|
||||
<if test="investAmount != null">invest_amount = #{investAmount},</if>
|
||||
<if test="investYield != null">invest_yield = #{investYield},</if>
|
||||
<if test="investState != null">invest_state = #{investState},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where invest_id = #{investId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbInvestByInvestId" parameterType="Long">
|
||||
delete from tb_invest where invest_id = #{investId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbInvestByInvestIds" parameterType="String">
|
||||
delete from tb_invest where invest_id in
|
||||
<foreach item="investId" collection="array" open="(" separator="," close=")">
|
||||
#{investId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,111 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ruoyi.potenza</groupId>
|
||||
<artifactId>com.ruoyi.potenza</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos-->
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.potenza;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/12 20:33
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class RuoYiPotenzaApplication {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(RuoYiPotenzaApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package com.ruoyi.potenza.controller;
|
||||
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.potenza.domain.TbBorrower;
|
||||
import com.ruoyi.potenza.domain.vo.IdVo;
|
||||
import com.ruoyi.potenza.service.TbBorrowerService;
|
||||
import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils;
|
||||
import com.ruoyi.potenza.utils.AverageCapitalUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/13 16:00
|
||||
*/
|
||||
@RequestMapping("/borrower")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class BorrowerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerService tbBorrowerService;
|
||||
|
||||
@PostMapping("/pageList")
|
||||
public TableDataInfo pageList(@RequestBody TbBorrower tbBorrower){
|
||||
startPage();
|
||||
return getDataTable(tbBorrowerService.pageList(tbBorrower));
|
||||
}
|
||||
|
||||
//贷款申请
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody TbBorrower tbBorrower){
|
||||
boolean save = tbBorrowerService.save(tbBorrower);
|
||||
return AjaxResult.success(save);
|
||||
}
|
||||
|
||||
//逻辑删除
|
||||
@PostMapping("/BorrowerDele")
|
||||
public AjaxResult save(@RequestBody IdVo idVo){
|
||||
return tbBorrowerService.borrowerDele(idVo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbBorrower tbBorrower)
|
||||
{
|
||||
startPage();
|
||||
List<TbBorrower> list = tbBorrowerService.selectTbBorrowerList(tbBorrower);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出贷款列表
|
||||
*/
|
||||
|
||||
@Log(title = "贷款", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbBorrower tbBorrower)
|
||||
{
|
||||
List<TbBorrower> list = tbBorrowerService.selectTbBorrowerList(tbBorrower);
|
||||
ExcelUtil<TbBorrower> util = new ExcelUtil<TbBorrower>(TbBorrower.class);
|
||||
util.exportExcel(response, list, "贷款数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贷款详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{borrowerById}")
|
||||
public AjaxResult getInfo(@PathVariable("borrowerId") Long borrowerId)
|
||||
{
|
||||
return success(tbBorrowerService.selectTbBorrowerByBorrowerId(borrowerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增贷款
|
||||
*/
|
||||
|
||||
@Log(title = "贷款", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/borrowerInsert")
|
||||
public AjaxResult add(@RequestBody TbBorrower tbBorrower)
|
||||
{
|
||||
return toAjax(tbBorrowerService.insertTbBorrower(tbBorrower));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改贷款
|
||||
*/
|
||||
|
||||
@Log(title = "贷款", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/borrowerUpdate")
|
||||
public AjaxResult edit(@RequestBody TbBorrower tbBorrower)
|
||||
{
|
||||
return toAjax(tbBorrowerService.updateTbBorrower(tbBorrower));
|
||||
}
|
||||
|
||||
@PostMapping("/borrowerInserts")
|
||||
public AjaxResult borrowerInserts(@RequestBody TbBorrower tbBorrower)
|
||||
{
|
||||
return toAjax(tbBorrowerService.borrowerInserts(tbBorrower));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/loans")
|
||||
public AjaxResult loans(@RequestBody TbBorrower tbBorrower)
|
||||
{
|
||||
return tbBorrowerService.loans(tbBorrower);
|
||||
}
|
||||
|
||||
@PostMapping("ttt")
|
||||
public void ttt(){
|
||||
AverageCapitalUtils.main();
|
||||
AverageCapitalPlusInterestUtils.main();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.ruoyi.potenza.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.potenza.domain.vo.PeriodDetailVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPeriods;
|
||||
import com.ruoyi.potenza.service.TbBorrowerPeriodsService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/13 16:00
|
||||
*/
|
||||
@RequestMapping("periods")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class BorrowerPeriodsController extends BaseController{
|
||||
@Autowired
|
||||
private TbBorrowerPeriodsService tbBorrowerPeriodsService;
|
||||
|
||||
/**
|
||||
* 查询贷款周期列表
|
||||
*/
|
||||
@RequiresPermissions("potenza:periods:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
startPage();
|
||||
List<TbBorrowerPeriods> list = tbBorrowerPeriodsService.selectTbBorrowerPeriodsList(tbBorrowerPeriods);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出贷款周期列表
|
||||
*/
|
||||
@Log(title = "贷款周期", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
List<TbBorrowerPeriods> list = tbBorrowerPeriodsService.selectTbBorrowerPeriodsList(tbBorrowerPeriods);
|
||||
ExcelUtil<TbBorrowerPeriods> util = new ExcelUtil<TbBorrowerPeriods>(TbBorrowerPeriods.class);
|
||||
util.exportExcel(response, list, "贷款周期数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贷款周期详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{periodsById}")
|
||||
public AjaxResult getInfo(@PathVariable("periodsId") Long periodsId)
|
||||
{
|
||||
return success(tbBorrowerPeriodsService.selectTbBorrowerPeriodsByPeriodsId(periodsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增贷款周期
|
||||
*/
|
||||
@Log(title = "贷款周期", businessType = BusinessType.INSERT)
|
||||
@PostMapping("periodsInsert")
|
||||
public AjaxResult add(@RequestBody TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
return toAjax(tbBorrowerPeriodsService.insertTbBorrowerPeriods(tbBorrowerPeriods));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改贷款周期
|
||||
*/
|
||||
@Log(title = "贷款周期", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/periodsUpdate")
|
||||
public AjaxResult edit(@RequestBody TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
return toAjax(tbBorrowerPeriodsService.updateTbBorrowerPeriods(tbBorrowerPeriods));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除贷款周期
|
||||
*/
|
||||
@Log(title = "贷款周期", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{periodsIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] periodsIds)
|
||||
{
|
||||
return toAjax(tbBorrowerPeriodsService.deleteTbBorrowerPeriodsByPeriodsIds(periodsIds));
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "周期详细", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/detail")
|
||||
public AjaxResult detail(@RequestBody PeriodDetailVo periodDetailVo)
|
||||
{
|
||||
return tbBorrowerPeriodsService.detail(periodDetailVo);
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.ruoyi.potenza.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPlan;
|
||||
import com.ruoyi.potenza.service.TbBorrowerPlanService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/13 16:01
|
||||
*/
|
||||
@RequestMapping("plan")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class BorrowerPlanController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerPlanService tbBorrowerPlanService;
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
@RequiresPermissions("potenza:plan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
startPage();
|
||||
List<TbBorrowerPlan> list = tbBorrowerPlanService.selectTbBorrowerPlanList(tbBorrowerPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划列表
|
||||
*/
|
||||
@Log(title = "计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
List<TbBorrowerPlan> list = tbBorrowerPlanService.selectTbBorrowerPlanList(tbBorrowerPlan);
|
||||
ExcelUtil<TbBorrowerPlan> util = new ExcelUtil<TbBorrowerPlan>(TbBorrowerPlan.class);
|
||||
util.exportExcel(response, list, "计划数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{planById}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") Long planId)
|
||||
{
|
||||
return success(tbBorrowerPlanService.selectTbBorrowerPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*/
|
||||
@Log(title = "计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping("planInsert")
|
||||
public AjaxResult add(@RequestBody TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
return toAjax(tbBorrowerPlanService.insertTbBorrowerPlan(tbBorrowerPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
@Log(title = "计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("planUpdate")
|
||||
public AjaxResult edit(@RequestBody TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
return toAjax(tbBorrowerPlanService.updateTbBorrowerPlan(tbBorrowerPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
@Log(title = "计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] planIds)
|
||||
{
|
||||
return toAjax(tbBorrowerPlanService.deleteTbBorrowerPlanByPlanIds(planIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.potenza.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/13 16:45
|
||||
*/
|
||||
@Data
|
||||
public class IdVo implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.potenza.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 木子
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/15 20:39
|
||||
*/
|
||||
@Data
|
||||
public class PeriodDetailVo implements Serializable {
|
||||
private Double borrowerMoney;
|
||||
|
||||
private Integer wayId;
|
||||
|
||||
private Integer periodsId;
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.ruoyi.potenza.mapper;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.potenza.domain.TbBorrower;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower(贷款表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
* @Entity com.ruoyi.potenza.domain.TbBorrower
|
||||
*/
|
||||
public interface TbBorrowerMapper extends BaseMapper<TbBorrower> {
|
||||
|
||||
List<TbBorrower> pageList();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询贷款
|
||||
*
|
||||
* @param borrowerId 贷款主键
|
||||
* @return 贷款
|
||||
*/
|
||||
public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId);
|
||||
|
||||
/**
|
||||
* 查询贷款列表
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 贷款集合
|
||||
*/
|
||||
public List<TbBorrower> selectTbBorrowerList(TbBorrower tbBorrower);
|
||||
|
||||
/**
|
||||
* 新增贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrower(TbBorrower tbBorrower);
|
||||
|
||||
/**
|
||||
* 修改贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrower(TbBorrower tbBorrower);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.ruoyi.potenza.mapper;
|
||||
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPeriods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
* @Entity com.ruoyi.potenza.domain.TbBorrowerPeriods
|
||||
*/
|
||||
public interface TbBorrowerPeriodsMapper extends BaseMapper<TbBorrowerPeriods> {
|
||||
/**
|
||||
* 查询贷款周期
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 贷款周期
|
||||
*/
|
||||
public TbBorrowerPeriods selectTbBorrowerPeriodsByPeriodsId(Long periodsId);
|
||||
|
||||
/**
|
||||
* 查询贷款周期列表
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 贷款周期集合
|
||||
*/
|
||||
public List<TbBorrowerPeriods> selectTbBorrowerPeriodsList(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 新增贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 修改贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 删除贷款周期
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPeriodsByPeriodsId(Long periodsId);
|
||||
|
||||
/**
|
||||
* 批量删除贷款周期
|
||||
*
|
||||
* @param periodsIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPeriodsByPeriodsIds(Long[] periodsIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.ruoyi.potenza.mapper;
|
||||
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPlan;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_plan(计划表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
* @Entity com.ruoyi.potenza.domain.TbBorrowerPlan
|
||||
*/
|
||||
public interface TbBorrowerPlanMapper extends BaseMapper<TbBorrowerPlan> {
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
public TbBorrowerPlan selectTbBorrowerPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 计划集合
|
||||
*/
|
||||
public List<TbBorrowerPlan> selectTbBorrowerPlanList(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPlanByPlanIds(Long[] planIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.potenza.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPeriods;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.potenza.domain.vo.PeriodDetailVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
public interface TbBorrowerPeriodsService extends IService<TbBorrowerPeriods> {
|
||||
/**
|
||||
* 查询贷款周期
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 贷款周期
|
||||
*/
|
||||
public TbBorrowerPeriods selectTbBorrowerPeriodsByPeriodsId(Long periodsId);
|
||||
|
||||
/**
|
||||
* 查询贷款周期列表
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 贷款周期集合
|
||||
*/
|
||||
public List<TbBorrowerPeriods> selectTbBorrowerPeriodsList(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 新增贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 修改贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods);
|
||||
|
||||
/**
|
||||
* 批量删除贷款周期
|
||||
*
|
||||
* @param periodsIds 需要删除的贷款周期主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPeriodsByPeriodsIds(Long[] periodsIds);
|
||||
|
||||
/**
|
||||
* 删除贷款周期信息
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPeriodsByPeriodsId(Long periodsId);
|
||||
|
||||
AjaxResult detail(PeriodDetailVo periodDetailVo);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.potenza.service;
|
||||
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPlan;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_plan(计划表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
public interface TbBorrowerPlanService extends IService<TbBorrowerPlan> {
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
public TbBorrowerPlan selectTbBorrowerPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 计划集合
|
||||
*/
|
||||
public List<TbBorrowerPlan> selectTbBorrowerPlanList(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan);
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的计划主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbBorrowerPlanByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.ruoyi.potenza.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.potenza.domain.TbBorrower;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.potenza.domain.vo.IdVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower(贷款表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
public interface TbBorrowerService extends IService<TbBorrower> {
|
||||
|
||||
List<?> pageList(TbBorrower tbBorrower);
|
||||
|
||||
AjaxResult borrowerDele(IdVo idVo);
|
||||
|
||||
/**
|
||||
* 查询贷款
|
||||
*
|
||||
* @param borrowerId 贷款主键
|
||||
* @return 贷款
|
||||
*/
|
||||
public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId);
|
||||
|
||||
/**
|
||||
* 查询贷款列表
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 贷款集合
|
||||
*/
|
||||
public List<TbBorrower> selectTbBorrowerList(TbBorrower tbBorrower);
|
||||
|
||||
/**
|
||||
* 新增贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbBorrower(TbBorrower tbBorrower);
|
||||
|
||||
/**
|
||||
* 修改贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbBorrower(TbBorrower tbBorrower);
|
||||
|
||||
|
||||
int borrowerInserts(TbBorrower tbBorrower);
|
||||
|
||||
AjaxResult loans(TbBorrower tbBorrower);
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package com.ruoyi.potenza.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPeriods;
|
||||
import com.ruoyi.potenza.domain.vo.PeriodDetailVo;
|
||||
import com.ruoyi.potenza.service.TbBorrowerPeriodsService;
|
||||
import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper;
|
||||
import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils;
|
||||
import com.ruoyi.potenza.utils.AverageCapitalUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
@Service
|
||||
public class TbBorrowerPeriodsServiceImpl extends ServiceImpl<TbBorrowerPeriodsMapper, TbBorrowerPeriods>
|
||||
implements TbBorrowerPeriodsService{
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerPeriodsMapper tbBorrowerPeriodsMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询贷款周期
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 贷款周期
|
||||
*/
|
||||
@Override
|
||||
public TbBorrowerPeriods selectTbBorrowerPeriodsByPeriodsId(Long periodsId)
|
||||
{
|
||||
return tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsByPeriodsId(periodsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询贷款周期列表
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 贷款周期
|
||||
*/
|
||||
@Override
|
||||
public List<TbBorrowerPeriods> selectTbBorrowerPeriodsList(TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
return tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsList(tbBorrowerPeriods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
tbBorrowerPeriods.setCreateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerPeriodsMapper.insertTbBorrowerPeriods(tbBorrowerPeriods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改贷款周期
|
||||
*
|
||||
* @param tbBorrowerPeriods 贷款周期
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbBorrowerPeriods(TbBorrowerPeriods tbBorrowerPeriods)
|
||||
{
|
||||
tbBorrowerPeriods.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerPeriodsMapper.updateTbBorrowerPeriods(tbBorrowerPeriods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除贷款周期
|
||||
*
|
||||
* @param periodsIds 需要删除的贷款周期主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbBorrowerPeriodsByPeriodsIds(Long[] periodsIds)
|
||||
{
|
||||
return tbBorrowerPeriodsMapper.deleteTbBorrowerPeriodsByPeriodsIds(periodsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除贷款周期信息
|
||||
*
|
||||
* @param periodsId 贷款周期主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbBorrowerPeriodsByPeriodsId(Long periodsId)
|
||||
{
|
||||
return tbBorrowerPeriodsMapper.deleteTbBorrowerPeriodsByPeriodsId(periodsId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult detail(PeriodDetailVo periodDetailVo) {
|
||||
|
||||
//查询利率
|
||||
Integer periodsId = periodDetailVo.getPeriodsId();
|
||||
long periodsid = periodsId.longValue();
|
||||
TbBorrowerPeriods tbBorrowerPeriods = tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsByPeriodsId(periodsid);
|
||||
if(tbBorrowerPeriods==null){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
Integer wayId = periodDetailVo.getWayId();
|
||||
//等额本息
|
||||
if(wayId==0){
|
||||
double principalInterestCount = AverageCapitalPlusInterestUtils.
|
||||
getPrincipalInterestCount(periodDetailVo.getBorrowerMoney(),
|
||||
tbBorrowerPeriods.getRateInterest()/100,
|
||||
tbBorrowerPeriods.getPeriodsName());
|
||||
return AjaxResult.success(principalInterestCount);
|
||||
}
|
||||
//等额本金
|
||||
// double principalInterestCount = AverageCapitalUtils.
|
||||
// getPrincipalInterestCount(periodDetailVo.getBorrowerMoney(),
|
||||
// tbBorrowerPeriods.getRateInterest()/100,
|
||||
// tbBorrowerPeriods.getPeriodsName());
|
||||
// return AjaxResult.success(principalInterestCount);
|
||||
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.potenza.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPlan;
|
||||
import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper;
|
||||
import com.ruoyi.potenza.service.TbBorrowerPlanService;
|
||||
import com.ruoyi.potenza.mapper.TbBorrowerPlanMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower_plan(计划表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
@Service
|
||||
public class TbBorrowerPlanServiceImpl extends ServiceImpl<TbBorrowerPlanMapper, TbBorrowerPlan>
|
||||
implements TbBorrowerPlanService{
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerPlanMapper tbBorrowerPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
@Override
|
||||
public TbBorrowerPlan selectTbBorrowerPlanByPlanId(Long planId)
|
||||
{
|
||||
return tbBorrowerPlanMapper.selectTbBorrowerPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 计划
|
||||
*/
|
||||
@Override
|
||||
public List<TbBorrowerPlan> selectTbBorrowerPlanList(TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
return tbBorrowerPlanMapper.selectTbBorrowerPlanList(tbBorrowerPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
tbBorrowerPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerPlanMapper.insertTbBorrowerPlan(tbBorrowerPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param tbBorrowerPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbBorrowerPlan(TbBorrowerPlan tbBorrowerPlan)
|
||||
{
|
||||
tbBorrowerPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerPlanMapper.updateTbBorrowerPlan(tbBorrowerPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbBorrowerPlanByPlanIds(Long[] planIds)
|
||||
{
|
||||
return tbBorrowerPlanMapper.deleteTbBorrowerPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbBorrowerPlanByPlanId(Long planId)
|
||||
{
|
||||
return tbBorrowerPlanMapper.deleteTbBorrowerPlanByPlanId(planId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,138 @@
|
||||
package com.ruoyi.potenza.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.potenza.domain.TbBorrower;
|
||||
import com.ruoyi.potenza.domain.TbBorrowerPeriods;
|
||||
import com.ruoyi.potenza.domain.vo.IdVo;
|
||||
import com.ruoyi.potenza.domain.vo.TbBorrowerVo;
|
||||
import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper;
|
||||
import com.ruoyi.potenza.service.TbBorrowerService;
|
||||
import com.ruoyi.potenza.mapper.TbBorrowerMapper;
|
||||
import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 86155
|
||||
* @description 针对表【tb_borrower(贷款表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 15:56:37
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TbBorrowerServiceImpl extends ServiceImpl<TbBorrowerMapper, TbBorrower>
|
||||
implements TbBorrowerService{
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerMapper tbBorrowerMapper;
|
||||
|
||||
@Autowired
|
||||
private TbBorrowerPeriodsMapper tbBorrowerPeriodsMapper;
|
||||
|
||||
@Override
|
||||
public List<?> pageList(TbBorrower tbBorrower) {
|
||||
List<TbBorrower> list= tbBorrowerMapper.pageList();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult borrowerDele(IdVo idVo) {
|
||||
tbBorrowerMapper.deleteById(idVo.getId());
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId)
|
||||
{
|
||||
return tbBorrowerMapper.selectTbBorrowerByBorrowerId(borrowerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询贷款列表
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 贷款
|
||||
*/
|
||||
@Override
|
||||
public List<TbBorrower> selectTbBorrowerList(TbBorrower tbBorrower)
|
||||
{
|
||||
return tbBorrowerMapper.selectTbBorrowerList(tbBorrower);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbBorrower(TbBorrower tbBorrower)
|
||||
{
|
||||
tbBorrower.setCreateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerMapper.insertTbBorrower(tbBorrower);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改贷款
|
||||
*
|
||||
* @param tbBorrower 贷款
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbBorrower(TbBorrower tbBorrower)
|
||||
{
|
||||
tbBorrower.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbBorrowerMapper.updateTbBorrower(tbBorrower);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int borrowerInserts(TbBorrower tbBorrower) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult loans(TbBorrower tbBorrower) {
|
||||
|
||||
//判断 用户 能否借款
|
||||
|
||||
|
||||
//判断同一个人 只能借一个产品
|
||||
LambdaQueryWrapper<TbBorrower> wrapper=new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TbBorrower::getUserId,tbBorrower.getUserId());
|
||||
wrapper.eq(TbBorrower::getProductId,tbBorrower.getProductId());
|
||||
TbBorrower tbBorrower1 = tbBorrowerMapper.selectOne(wrapper);
|
||||
if(tbBorrower1!=null){
|
||||
return AjaxResult.error("请先还款");
|
||||
}
|
||||
Integer periodsId = tbBorrower.getPeriodsId();
|
||||
long periodsid = periodsId.longValue();
|
||||
//查询利率
|
||||
TbBorrowerPeriods tbBorrowerPeriods = tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsByPeriodsId(periodsid);
|
||||
|
||||
// double perMonthPrincipalInterest = AverageCapitalPlusInterestUtils.
|
||||
// getPerMonthPrincipalInterest(tbBorrower.getBorrowerMoney(),
|
||||
// tbBorrowerPeriods.getRateInterest()/100,
|
||||
// tbBorrowerPeriods.getPeriodsName());
|
||||
|
||||
|
||||
double principalInterestCount = AverageCapitalPlusInterestUtils.
|
||||
getPrincipalInterestCount(tbBorrower.getBorrowerMoney(),
|
||||
tbBorrowerPeriods.getRateInterest() / 100,
|
||||
tbBorrowerPeriods.getPeriodsName());
|
||||
|
||||
log.info("---------"+principalInterestCount);
|
||||
return AjaxResult.success("添加成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9401
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-potenza
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/ruoyi-potenza" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,108 @@
|
||||
<?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.ruoyi.potenza.mapper.TbBorrowerMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.potenza.domain.TbBorrower" id="TbBorrowerResult">
|
||||
<result property="borrowerId" column="borrower_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="borrowerMoney" column="borrower_money" />
|
||||
<result property="periodsId" column="periods_id" />
|
||||
<result property="wayId" column="way_id" />
|
||||
<result property="borrowerPurpose" column="borrower_purpose" />
|
||||
<result property="borrowerState" column="borrower_state" />
|
||||
<result property="loanerId" column="loaner_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbBorrowerVo">
|
||||
select borrower_id, user_id, user_name, product_id, borrower_money, periods_id, way_id, borrower_purpose, borrower_state, loaner_id, create_by, update_by, del_flag, create_time, update_time from tb_borrower where del_flag=0
|
||||
</sql>
|
||||
<select id="pageList" resultType="com.ruoyi.potenza.domain.TbBorrower">
|
||||
select * from tb_borrower where del_flag=0
|
||||
</select>
|
||||
<select id="selectTbBorrowerList" parameterType="com.ruoyi.potenza.domain.TbBorrower" resultMap="TbBorrowerResult">
|
||||
<include refid="selectTbBorrowerVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="borrowerMoney != null "> and borrower_money = #{borrowerMoney}</if>
|
||||
<if test="periodsId != null "> and periods_id = #{periodsId}</if>
|
||||
<if test="wayId != null "> and way_id = #{wayId}</if>
|
||||
<if test="borrowerPurpose != null and borrowerPurpose != ''"> and borrower_purpose = #{borrowerPurpose}</if>
|
||||
<if test="borrowerState != null "> and borrower_state = #{borrowerState}</if>
|
||||
<if test="loanerId != null "> and loaner_id = #{loanerId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbBorrowerByBorrowerId" parameterType="Long" resultMap="TbBorrowerResult">
|
||||
<include refid="selectTbBorrowerVo"/>
|
||||
where borrower_id = #{borrowerId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbBorrower" parameterType="com.ruoyi.potenza.domain.TbBorrower" useGeneratedKeys="true" keyProperty="borrowerId">
|
||||
insert into tb_borrower
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="borrowerMoney != null">borrower_money,</if>
|
||||
<if test="periodsId != null">periods_id,</if>
|
||||
<if test="wayId != null">way_id,</if>
|
||||
<if test="borrowerPurpose != null and borrowerPurpose != ''">borrower_purpose,</if>
|
||||
<if test="borrowerState != null">borrower_state,</if>
|
||||
<if test="loanerId != null">loaner_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="borrowerMoney != null">#{borrowerMoney},</if>
|
||||
<if test="periodsId != null">#{periodsId},</if>
|
||||
<if test="wayId != null">#{wayId},</if>
|
||||
<if test="borrowerPurpose != null and borrowerPurpose != ''">#{borrowerPurpose},</if>
|
||||
<if test="borrowerState != null">#{borrowerState},</if>
|
||||
<if test="loanerId != null">#{loanerId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbBorrower" parameterType="com.ruoyi.potenza.domain.TbBorrower">
|
||||
update tb_borrower
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="borrowerMoney != null">borrower_money = #{borrowerMoney},</if>
|
||||
<if test="periodsId != null">periods_id = #{periodsId},</if>
|
||||
<if test="wayId != null">way_id = #{wayId},</if>
|
||||
<if test="borrowerPurpose != null and borrowerPurpose != ''">borrower_purpose = #{borrowerPurpose},</if>
|
||||
<if test="borrowerState != null">borrower_state = #{borrowerState},</if>
|
||||
<if test="loanerId != null">loaner_id = #{loanerId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where borrower_id = #{borrowerId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,80 @@
|
||||
<?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.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.potenza.domain.TbBorrowerPeriods" id="TbBorrowerPeriodsResult">
|
||||
<result property="periodsId" column="periods_id" />
|
||||
<result property="periodsName" column="periods_name" />
|
||||
<result property="rateInterest" column="rate_interest" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbBorrowerPeriodsVo">
|
||||
select periods_id, periods_name,rate_interest, create_by, update_by, del_flag, create_time, update_time from tb_borrower_periods
|
||||
</sql>
|
||||
|
||||
<select id="selectTbBorrowerPeriodsList" parameterType="com.ruoyi.potenza.domain.TbBorrowerPeriods" resultMap="TbBorrowerPeriodsResult">
|
||||
<include refid="selectTbBorrowerPeriodsVo"/>
|
||||
<where>
|
||||
<if test="periodsName != null "> and periods_name like concat('%', #{periodsName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbBorrowerPeriodsByPeriodsId" parameterType="Long" resultMap="TbBorrowerPeriodsResult">
|
||||
<include refid="selectTbBorrowerPeriodsVo"/>
|
||||
where periods_id = #{periodsId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbBorrowerPeriods" parameterType="com.ruoyi.potenza.domain.TbBorrowerPeriods" useGeneratedKeys="true" keyProperty="periodsId">
|
||||
insert into tb_borrower_periods
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="periodsName != null">periods_name,</if>
|
||||
<if test="rateInterest != null">rate_interest,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="periodsName != null">#{periodsName},</if>
|
||||
<if test="rateInterest != null">#{rateInterest},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbBorrowerPeriods" parameterType="com.ruoyi.potenza.domain.TbBorrowerPeriods">
|
||||
update tb_borrower_periods
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="periodsName != null">periods_name = #{periodsName},</if>
|
||||
<if test="rateInterest != null">rate_interest = #{rateInterest},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where periods_id = #{periodsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbBorrowerPeriodsByPeriodsId" parameterType="Long">
|
||||
delete from tb_borrower_periods where periods_id = #{periodsId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbBorrowerPeriodsByPeriodsIds" parameterType="String">
|
||||
delete from tb_borrower_periods where periods_id in
|
||||
<foreach item="periodsId" collection="array" open="(" separator="," close=")">
|
||||
#{periodsId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,104 @@
|
||||
<?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.ruoyi.potenza.mapper.TbBorrowerPlanMapper">
|
||||
|
||||
|
||||
<resultMap type="com.ruoyi.potenza.domain.TbBorrowerPlan" id="TbBorrowerPlanResult">
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="borrowerPeriods" column="borrower_periods" />
|
||||
<result property="periodsMoney" column="periods_money" />
|
||||
<result property="periodsCapital" column="periods_capital" />
|
||||
<result property="periodsInterests" column="periods_interests" />
|
||||
<result property="planDate" column="plan_date" />
|
||||
<result property="planState" column="plan_state" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbBorrowerPlanVo">
|
||||
select plan_id, user_id, user_name, borrower_periods, periods_money, periods_capital, periods_interests, plan_date, plan_state, del_flag, create_time, update_time from tb_borrower_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectTbBorrowerPlanList" parameterType="com.ruoyi.potenza.domain.TbBorrowerPlan" resultMap="TbBorrowerPlanResult">
|
||||
<include refid="selectTbBorrowerPlanVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="borrowerPeriods != null "> and borrower_periods = #{borrowerPeriods}</if>
|
||||
<if test="periodsMoney != null "> and periods_money = #{periodsMoney}</if>
|
||||
<if test="periodsCapital != null "> and periods_capital = #{periodsCapital}</if>
|
||||
<if test="periodsInterests != null "> and periods_interests = #{periodsInterests}</if>
|
||||
<if test="planDate != null "> and plan_date = #{planDate}</if>
|
||||
<if test="planState != null "> and plan_state = #{planState}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbBorrowerPlanByPlanId" parameterType="Long" resultMap="TbBorrowerPlanResult">
|
||||
<include refid="selectTbBorrowerPlanVo"/>
|
||||
where plan_id = #{planId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbBorrowerPlan" parameterType="com.ruoyi.potenza.domain.TbBorrowerPlan" useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into tb_borrower_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="borrowerPeriods != null">borrower_periods,</if>
|
||||
<if test="periodsMoney != null">periods_money,</if>
|
||||
<if test="periodsCapital != null">periods_capital,</if>
|
||||
<if test="periodsInterests != null">periods_interests,</if>
|
||||
<if test="planDate != null">plan_date,</if>
|
||||
<if test="planState != null">plan_state,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="borrowerPeriods != null">#{borrowerPeriods},</if>
|
||||
<if test="periodsMoney != null">#{periodsMoney},</if>
|
||||
<if test="periodsCapital != null">#{periodsCapital},</if>
|
||||
<if test="periodsInterests != null">#{periodsInterests},</if>
|
||||
<if test="planDate != null">#{planDate},</if>
|
||||
<if test="planState != null">#{planState},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbBorrowerPlan" parameterType="com.ruoyi.potenza.domain.TbBorrowerPlan">
|
||||
update tb_borrower_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="borrowerPeriods != null">borrower_periods = #{borrowerPeriods},</if>
|
||||
<if test="periodsMoney != null">periods_money = #{periodsMoney},</if>
|
||||
<if test="periodsCapital != null">periods_capital = #{periodsCapital},</if>
|
||||
<if test="periodsInterests != null">periods_interests = #{periodsInterests},</if>
|
||||
<if test="planDate != null">plan_date = #{planDate},</if>
|
||||
<if test="planState != null">plan_state = #{planState},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbBorrowerPlanByPlanId" parameterType="Long">
|
||||
delete from tb_borrower_plan where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbBorrowerPlanByPlanIds" parameterType="String">
|
||||
delete from tb_borrower_plan where plan_id in
|
||||
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,120 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ruoyi.product</groupId>
|
||||
<artifactId>ruoyi-product</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- redis-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,36 @@
|
||||
package com.ruoyi.product;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@EnableScheduling //定时任务
|
||||
public class RuoYiProductApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(RuoYiProductApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.product.config;
|
||||
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.elasticsearch.client.ClientConfiguration;
|
||||
import org.springframework.data.elasticsearch.client.RestClients;
|
||||
|
||||
@Configuration
|
||||
public class ElasticsearchConfig {
|
||||
@Bean
|
||||
RestHighLevelClient elasticsearchClient() {
|
||||
ClientConfiguration configuration = ClientConfiguration.builder()
|
||||
.connectedTo("localhost:9200")
|
||||
//.withConnectTimeout(Duration.ofSeconds(5))
|
||||
//.withSocketTimeout(Duration.ofSeconds(3))
|
||||
//.useSsl()
|
||||
//.withDefaultHeaders(defaultHeaders)
|
||||
//.withBasicAuth(username, password)
|
||||
// ... other options
|
||||
.build();
|
||||
RestHighLevelClient client = RestClients.create(configuration).rest();
|
||||
return client;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.ruoyi.product.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class Knife4jConfiguration {
|
||||
@Bean(value = "defaultApi2")
|
||||
public Docket defaultApi2() {
|
||||
String groupName="3.X版本";
|
||||
Docket docket=new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
.title("产品中心 API详细描述 ")
|
||||
.description("# 这里记录服务端所有的接口的入参,出参等等信息")
|
||||
.termsOfServiceUrl("https://www.shenmazong.com")
|
||||
.contact(new Contact("杨杨","http://yangzongli.com","337296894@qq.com"))
|
||||
.version("3.0")
|
||||
.build())
|
||||
//分组名称
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.ruoyi.product.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.product.config;
|
||||
|
||||
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;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 新的分页插件,一缓和二缓遵循mybatis的规则,
|
||||
* 需要设置 MybatisConfiguration#useDeprecatedExecutor = false
|
||||
* 避免缓存出现问题(该属性会在旧插件移除后一同移除)
|
||||
*/
|
||||
// 最新版
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.product.controller;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
|
||||
import com.ruoyi.product.pojo.vo.IdVo;
|
||||
import com.ruoyi.product.pojo.vo.PageInfoVo;
|
||||
import com.ruoyi.product.service.TbFinancialProductService;
|
||||
import com.ruoyi.product.pojo.vo.ProductInfoVo;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @author杨宗理
|
||||
* @date 2023/1/15 16:34
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/product")
|
||||
public class ProductController {
|
||||
@Autowired
|
||||
private TbFinancialProductService tbFinancialProductService;
|
||||
|
||||
/**
|
||||
* 展示产品列表数据
|
||||
* @param pageInfoVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/list")
|
||||
public AjaxResult list(@RequestBody PageInfoVo pageInfoVo){
|
||||
return tbFinancialProductService.listPage(pageInfoVo);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加列表数据
|
||||
* @param productInfoVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public AjaxResult add(@RequestBody ProductInfoVo productInfoVo){
|
||||
return tbFinancialProductService.add(productInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param idVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public AjaxResult delete(@RequestBody IdVo idVo){
|
||||
return tbFinancialProductService.deleteById(idVo);
|
||||
}
|
||||
|
||||
/**
|
||||
*修改数据通过Id
|
||||
* @param productInfoVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/update")
|
||||
public AjaxResult update(@RequestBody ProductInfoVo productInfoVo){
|
||||
return tbFinancialProductService.updateId(productInfoVo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询数据
|
||||
* @param productInfoVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/selectProduct")
|
||||
public AjaxResult selectProduct(@RequestBody ProductInfoVo productInfoVo){
|
||||
return tbFinancialProductService.selectProduct(productInfoVo);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.product.mapper;
|
||||
|
||||
import com.ruoyi.product.pojo.TbFinancialProduct;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Entity com.ruoyi.product.pojo.TbFinancialProduct
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbFinancialProductMapper extends BaseMapper<TbFinancialProduct> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.product.mapper;
|
||||
|
||||
import com.ruoyi.product.pojo.TbProductType;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Entity com.ruoyi.product.pojo.TbProductType
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbProductTypeMapper extends BaseMapper<TbProductType> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.product.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @author杨宗理
|
||||
* @date 2023/1/15 20:16
|
||||
*/
|
||||
@Data
|
||||
public class IdVo implements Serializable {
|
||||
private Integer ProductId;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.product.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @author杨宗理
|
||||
* @date 2023/1/15 16:46
|
||||
*/
|
||||
@Data
|
||||
public class PageInfoVo implements Serializable {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
//模糊查询数据
|
||||
private String keyword;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ruoyi.product.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.product.pojo.TbFinancialProduct;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.product.pojo.vo.IdVo;
|
||||
import com.ruoyi.product.pojo.vo.PageInfoVo;
|
||||
import com.ruoyi.product.pojo.vo.ProductInfoVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TbFinancialProductService extends IService<TbFinancialProduct> {
|
||||
|
||||
AjaxResult listPage(PageInfoVo pageInfoVo);
|
||||
|
||||
AjaxResult add(ProductInfoVo productInfoVo);
|
||||
|
||||
AjaxResult deleteById(IdVo idVo);
|
||||
|
||||
AjaxResult updateId(ProductInfoVo productInfoVo);
|
||||
|
||||
AjaxResult selectProduct(ProductInfoVo productInfoVo);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.ruoyi.product.service;
|
||||
|
||||
import com.ruoyi.product.pojo.TbProductType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TbProductTypeService extends IService<TbProductType> {
|
||||
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
package com.ruoyi.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.product.pojo.TbFinancialProduct;
|
||||
import com.ruoyi.product.pojo.vo.IdVo;
|
||||
import com.ruoyi.product.pojo.vo.PageInfoVo;
|
||||
import com.ruoyi.product.pojo.vo.ProductInfoVo;
|
||||
import com.ruoyi.product.service.TbFinancialProductService;
|
||||
import com.ruoyi.product.mapper.TbFinancialProductMapper;
|
||||
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.index.query.TermQueryBuilder;
|
||||
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.FieldSortBuilder;
|
||||
import org.elasticsearch.search.sort.SortBuilder;
|
||||
import org.elasticsearch.search.sort.SortOrder;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
||||
import org.springframework.data.elasticsearch.core.SearchHits;
|
||||
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TbFinancialProductServiceImpl extends ServiceImpl<TbFinancialProductMapper, TbFinancialProduct>
|
||||
implements TbFinancialProductService{
|
||||
@Autowired
|
||||
private TbFinancialProductMapper tbFinancialProductMapper;
|
||||
@Autowired
|
||||
private ElasticsearchRestTemplate elasticsearchRestTemplate;
|
||||
|
||||
/**
|
||||
* 产品数据查询
|
||||
* @param pageInfoVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult listPage(PageInfoVo pageInfoVo) {
|
||||
if(pageInfoVo.getKeyword()==null){
|
||||
Page<TbFinancialProduct> page = new Page<>(pageInfoVo.getPageNum(), pageInfoVo.getPageSize());
|
||||
//.lambda().eq(TbFinancialProduct::getFirmName, pageInfoVo.getKeyword()).last("limit 1")
|
||||
Page<TbFinancialProduct> financialProductPage = page(page, new QueryWrapper<>());
|
||||
List<ProductInfoVo> collect = financialProductPage.getRecords().stream().map((item) -> {
|
||||
ProductInfoVo productInfoVo = new ProductInfoVo();
|
||||
BeanUtils.copyProperties(item, productInfoVo);
|
||||
return productInfoVo;
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
Page<ProductInfoVo> infoVoPage = new Page<>();
|
||||
infoVoPage.setRecords(collect);
|
||||
infoVoPage.setCurrent(financialProductPage.getCurrent());
|
||||
infoVoPage.setSize(financialProductPage.getSize());
|
||||
infoVoPage.setTotal(financialProductPage.getTotal());
|
||||
|
||||
return AjaxResult.success(infoVoPage);
|
||||
}
|
||||
//获取分页数据
|
||||
Pageable page = PageRequest.of(pageInfoVo.getPageNum() - 1, pageInfoVo.getPageSize());
|
||||
TermQueryBuilder termQuery = QueryBuilders.termQuery("productName", pageInfoVo.getKeyword());
|
||||
SortBuilder sortBuilder = new FieldSortBuilder("createTime").order(SortOrder.DESC);
|
||||
//高亮查询数据
|
||||
HighlightBuilder highlightBuilder = new HighlightBuilder();
|
||||
highlightBuilder.preTags("<strong style='color:red'>")
|
||||
.postTags("</strong>")
|
||||
.field("productName");
|
||||
NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
|
||||
.withQuery(termQuery)
|
||||
.withPageable(page)
|
||||
.withSort(sortBuilder)
|
||||
.withHighlightBuilder(highlightBuilder)
|
||||
// .withQuery(queryBuilder)
|
||||
.build();
|
||||
long total = elasticsearchRestTemplate.count(searchQuery, TbFinancialProduct.class);
|
||||
SearchHits<TbFinancialProduct> search = elasticsearchRestTemplate.search(searchQuery, TbFinancialProduct.class);
|
||||
List<ProductInfoVo> productInfoVoList = search.getSearchHits().stream().map((item) -> {
|
||||
TbFinancialProduct content = item.getContent();
|
||||
List<String> productName = item.getHighlightField("productName");
|
||||
if (productName != null && productName.size() > 0) {
|
||||
String name = productName.get(0);
|
||||
//设置高亮查询
|
||||
content.setProductName(name);
|
||||
|
||||
}
|
||||
ProductInfoVo productInfoVo = new ProductInfoVo();
|
||||
BeanUtils.copyProperties(content, productInfoVo);
|
||||
return productInfoVo;
|
||||
}).collect(Collectors.toList());
|
||||
Page<ProductInfoVo> infoVoPage = new Page<>();
|
||||
infoVoPage.setRecords(productInfoVoList);
|
||||
infoVoPage.setCurrent(pageInfoVo.getPageNum()-1);
|
||||
infoVoPage.setSize(pageInfoVo.getPageSize());
|
||||
infoVoPage.setTotal(total);
|
||||
|
||||
return AjaxResult.success(infoVoPage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加列表数据
|
||||
* @param productInfoVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional //分布式事务
|
||||
public AjaxResult add(ProductInfoVo productInfoVo) {
|
||||
String firmName = productInfoVo.getFirmName();
|
||||
TbFinancialProduct one = getOne(new QueryWrapper<TbFinancialProduct>().lambda().eq(TbFinancialProduct::getFirmName, firmName));
|
||||
if(one!=null){
|
||||
return AjaxResult.error(302,"产品名称重复");
|
||||
}
|
||||
TbFinancialProduct financialProduct = new TbFinancialProduct();
|
||||
BeanUtils.copyProperties(productInfoVo,financialProduct);
|
||||
save(financialProduct);
|
||||
elasticsearchRestTemplate.save(financialProduct);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据通过id
|
||||
* @param idVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteById(IdVo idVo) {
|
||||
Integer productId = idVo.getProductId();
|
||||
TbFinancialProduct one = getOne(new QueryWrapper<TbFinancialProduct>().lambda().eq(TbFinancialProduct::getProductId, productId));
|
||||
if(one==null){
|
||||
return AjaxResult.error(402,"产品Id不存在");
|
||||
}
|
||||
Integer oneProductId = one.getProductId();
|
||||
|
||||
BeanUtils.copyProperties(idVo,one);
|
||||
int i = tbFinancialProductMapper.deleteById(oneProductId);
|
||||
if(i>0){
|
||||
return AjaxResult.success("删除成功");
|
||||
}else {
|
||||
return AjaxResult.error(302,"删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据通过id
|
||||
* @param productInfoVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateId(ProductInfoVo productInfoVo) {
|
||||
Integer productId = productInfoVo.getProductId();
|
||||
TbFinancialProduct one = getOne(new QueryWrapper<TbFinancialProduct>().lambda().eq(TbFinancialProduct::getProductId, productId));
|
||||
if(one==null){
|
||||
return AjaxResult.error(402,"产品Id不存在");
|
||||
}
|
||||
TbFinancialProduct product = new TbFinancialProduct();
|
||||
//
|
||||
BeanUtils.copyProperties(productInfoVo,product);
|
||||
tbFinancialProductMapper.updateById(product);
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectProduct(ProductInfoVo productInfoVo) {
|
||||
Integer productId = productInfoVo.getProductId();
|
||||
TbFinancialProduct one = getOne(new QueryWrapper<TbFinancialProduct>().lambda().eq(TbFinancialProduct::getProductId, productId));
|
||||
if(one==null){
|
||||
return AjaxResult.error(402,"产品Id不存在");
|
||||
}
|
||||
TbFinancialProduct financialProduct = tbFinancialProductMapper.selectById(productId);
|
||||
return AjaxResult.success(financialProduct);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.product.pojo.TbProductType;
|
||||
import com.ruoyi.product.service.TbProductTypeService;
|
||||
import com.ruoyi.product.mapper.TbProductTypeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TbProductTypeServiceImpl extends ServiceImpl<TbProductTypeMapper, TbProductType>
|
||||
implements TbProductTypeService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.product.task;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.product.mapper.TbFinancialProductMapper;
|
||||
import com.ruoyi.product.pojo.TbFinancialProduct;
|
||||
import com.ruoyi.product.var.ConstantVars;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
||||
import org.springframework.data.elasticsearch.core.document.Document;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @author杨宗理
|
||||
* @date 2023/1/18 15:16
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class TaskQuartz {
|
||||
@Autowired
|
||||
ElasticsearchRestTemplate elasticsearchTemplate;
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private TbFinancialProductMapper tbFinancialProductMapper;
|
||||
@Scheduled(fixedDelay = 1000*60)
|
||||
public void ProductQuartz(){
|
||||
//判断索引
|
||||
if(!elasticsearchTemplate.indexOps(TbFinancialProduct.class).exists()){
|
||||
elasticsearchTemplate.indexOps(TbFinancialProduct.class).create();
|
||||
Document mapping = elasticsearchTemplate.indexOps(TbFinancialProduct.class).createMapping();
|
||||
elasticsearchTemplate.indexOps(TbFinancialProduct.class).putMapping(mapping);
|
||||
|
||||
}
|
||||
String strTime = (String) redisTemplate.opsForValue().get(ConstantVars.SYNC_PRODUCT_KEY);
|
||||
|
||||
if(strTime==null){
|
||||
//全量同步
|
||||
List<TbFinancialProduct> list = tbFinancialProductMapper.selectList(new QueryWrapper<TbFinancialProduct>().lambda().orderByDesc(TbFinancialProduct::getCreateTime));
|
||||
if(list!=null && list.size()>0){
|
||||
elasticsearchTemplate.save(list);
|
||||
TbFinancialProduct product = list.get(0);
|
||||
Date updateTime = product.getUpdateTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String format = sdf.format(updateTime);
|
||||
//存入redis中
|
||||
redisTemplate.opsForValue().set(ConstantVars.SYNC_PRODUCT_KEY,format);
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
//增量同步
|
||||
//全量同步
|
||||
List<TbFinancialProduct> list = tbFinancialProductMapper.selectList(new QueryWrapper<TbFinancialProduct>().lambda().gt(TbFinancialProduct::getUpdateTime,strTime)
|
||||
.orderByDesc(TbFinancialProduct::getCreateTime));
|
||||
if(list!=null && list.size()>0){
|
||||
elasticsearchTemplate.save(list);
|
||||
TbFinancialProduct product = list.get(0);
|
||||
Date updateTime = product.getUpdateTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String format = sdf.format(updateTime);
|
||||
//存入redis中
|
||||
redisTemplate.opsForValue().set(ConstantVars.SYNC_PRODUCT_KEY,format);
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.ruoyi.product.var;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @author杨宗理
|
||||
* @date 2023/1/19 21:45
|
||||
*/
|
||||
public interface ConstantVars {
|
||||
//作为Key值
|
||||
final String SYNC_PRODUCT_KEY="SYNC_PRODUCT_KEY";
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9600
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-product
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/ruoyi-system" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,40 @@
|
||||
<?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.ruoyi.product.mapper.TbFinancialProductMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.product.pojo.TbFinancialProduct">
|
||||
<id property="productId" column="product_id" jdbcType="INTEGER"/>
|
||||
<result property="firmId" column="firm_id" jdbcType="INTEGER"/>
|
||||
<result property="firmName" column="firm_name" jdbcType="VARCHAR"/>
|
||||
<result property="productName" column="product_name" jdbcType="VARCHAR"/>
|
||||
<result property="productDesc" column="product_desc" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="typeId" column="type_id" jdbcType="INTEGER"/>
|
||||
<result property="periods" column="periods" jdbcType="INTEGER"/>
|
||||
<result property="productRate" column="product_rate" jdbcType="INTEGER"/>
|
||||
<result property="produtCharge" column="produt_charge" jdbcType="INTEGER"/>
|
||||
<result property="maxPrice" column="max_price" jdbcType="INTEGER"/>
|
||||
<result property="minPrice" column="min_price" jdbcType="INTEGER"/>
|
||||
<result property="termsForLate" column="terms_for_late" jdbcType="INTEGER"/>
|
||||
<result property="termsProductLate" column="terms_product_late" jdbcType="VARCHAR"/>
|
||||
<result property="modeProduct" column="mode_product" jdbcType="INTEGER"/>
|
||||
<result property="productPhoto" column="product_photo" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
product_id,firm_id,firm_name,
|
||||
product_name,product_desc,user_id,
|
||||
type_id,periods,product_rate,
|
||||
produt_charge,max_price,min_price,
|
||||
terms_for_late,terms_product_late,mode_product,
|
||||
product_photo,del_flag,create_by,
|
||||
create_time,update_by,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,22 @@
|
||||
<?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.ruoyi.product.mapper.TbProductTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.product.pojo.TbProductType">
|
||||
<id property="typeId" column="type_id" jdbcType="INTEGER"/>
|
||||
<result property="typeName" column="type_name" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
type_id,type_name,del_flag,
|
||||
create_by,create_time,update_by,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-modules-system</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-modules-system系统模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,151 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-user</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- 短信发送的依赖 5个-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>4.5.16</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>2.0.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,36 @@
|
||||
package com.bwie.user;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.bwie.user.mapper")
|
||||
public class RuoYiUserApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(RuoYiUserApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.bwie.user.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* @Description //TODO
|
||||
* @Author 王辉
|
||||
* @Date 2022/11/13 19:53
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class Knife4jConfiguration {
|
||||
@Bean(value = "defaultApi2")
|
||||
public Docket defaultApi2() {
|
||||
String groupName="3.X版本";
|
||||
Docket docket=new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
.title("这是User API ")
|
||||
.description("# 这里记录服务端所有的接口的入参,出参等等信息")
|
||||
.termsOfServiceUrl("https://www.shenmazong.com")
|
||||
.contact(new Contact("shl","http://bwie.com","1447562585@qq.com"))
|
||||
.version("3.0")
|
||||
.build())
|
||||
//分组名称
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.bwie.user"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import com.bwie.user.service.TbUserService;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.system.api.model.PhoneVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/14 7:49
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
@Api(tags = "aaa-api")
|
||||
@RequestMapping("duanxin")
|
||||
public class DuanXinSend {
|
||||
@Resource
|
||||
private TbUserService tbUserService;
|
||||
//1.发送验证码
|
||||
@PostMapping("phoneSend")
|
||||
public AjaxResult phoneSend(@RequestBody(required=false) PhoneVo phoneVo){
|
||||
return tbUserService.phoneSend(phoneVo);
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
import com.bwie.user.service.ITbMyroleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 角色Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/myrole")
|
||||
public class TbMyroleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbMyroleService tbMyroleService;
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbMyrole tbMyrole)
|
||||
{
|
||||
startPage();
|
||||
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色列表
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:export")
|
||||
@Log(title = "角色", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbMyrole tbMyrole)
|
||||
{
|
||||
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
|
||||
ExcelUtil<TbMyrole> util = new ExcelUtil<TbMyrole>(TbMyrole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色详细信息
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:query")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
return success(tbMyroleService.selectTbMyroleByRoleId(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:add")
|
||||
@Log(title = "角色", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbMyrole tbMyrole)
|
||||
{
|
||||
return toAjax(tbMyroleService.insertTbMyrole(tbMyrole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:edit")
|
||||
@Log(title = "角色", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbMyrole tbMyrole)
|
||||
{
|
||||
return toAjax(tbMyroleService.updateTbMyrole(tbMyrole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:remove")
|
||||
@Log(title = "角色", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||
{
|
||||
return toAjax(tbMyroleService.deleteTbMyroleByRoleIds(roleIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbPerm;
|
||||
import com.bwie.user.service.ITbPermService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 权限Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/perm")
|
||||
public class TbPermController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbPermService tbPermService;
|
||||
|
||||
/**
|
||||
* 查询权限列表
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbPerm tbPerm)
|
||||
{
|
||||
startPage();
|
||||
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出权限列表
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:export")
|
||||
@Log(title = "权限", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbPerm tbPerm)
|
||||
{
|
||||
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
|
||||
ExcelUtil<TbPerm> util = new ExcelUtil<TbPerm>(TbPerm.class);
|
||||
util.exportExcel(response, list, "权限数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限详细信息
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:query")
|
||||
@GetMapping(value = "/{permId}")
|
||||
public AjaxResult getInfo(@PathVariable("permId") Long permId)
|
||||
{
|
||||
return success(tbPermService.selectTbPermByPermId(permId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:add")
|
||||
@Log(title = "权限", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbPerm tbPerm)
|
||||
{
|
||||
return toAjax(tbPermService.insertTbPerm(tbPerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:edit")
|
||||
@Log(title = "权限", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbPerm tbPerm)
|
||||
{
|
||||
return toAjax(tbPermService.updateTbPerm(tbPerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:remove")
|
||||
@Log(title = "权限", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{permIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] permIds)
|
||||
{
|
||||
return toAjax(tbPermService.deleteTbPermByPermIds(permIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbRolePerm;
|
||||
import com.bwie.user.service.ITbRolePermService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 角色权限Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/roleperm")
|
||||
public class TbRolePermController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbRolePermService tbRolePermService;
|
||||
|
||||
/**
|
||||
* 查询角色权限列表
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbRolePerm tbRolePerm)
|
||||
{
|
||||
startPage();
|
||||
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色权限列表
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:export")
|
||||
@Log(title = "角色权限", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbRolePerm tbRolePerm)
|
||||
{
|
||||
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
|
||||
ExcelUtil<TbRolePerm> util = new ExcelUtil<TbRolePerm>(TbRolePerm.class);
|
||||
util.exportExcel(response, list, "角色权限数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色权限详细信息
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:query")
|
||||
@GetMapping(value = "/{rolePermId}")
|
||||
public AjaxResult getInfo(@PathVariable("rolePermId") Long rolePermId)
|
||||
{
|
||||
return success(tbRolePermService.selectTbRolePermByRolePermId(rolePermId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:add")
|
||||
@Log(title = "角色权限", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbRolePerm tbRolePerm)
|
||||
{
|
||||
return toAjax(tbRolePermService.insertTbRolePerm(tbRolePerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:edit")
|
||||
@Log(title = "角色权限", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbRolePerm tbRolePerm)
|
||||
{
|
||||
return toAjax(tbRolePermService.updateTbRolePerm(tbRolePerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:remove")
|
||||
@Log(title = "角色权限", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rolePermIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rolePermIds)
|
||||
{
|
||||
return toAjax(tbRolePermService.deleteTbRolePermByRolePermIds(rolePermIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbUserRole;
|
||||
import com.bwie.user.service.ITbUserRoleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户类型Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userrole")
|
||||
public class TbUserRoleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbUserRoleService tbUserRoleService;
|
||||
|
||||
/**
|
||||
* 查询用户类型列表
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbUserRole tbUserRole)
|
||||
{
|
||||
startPage();
|
||||
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户类型列表
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:export")
|
||||
@Log(title = "用户类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbUserRole tbUserRole)
|
||||
{
|
||||
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
|
||||
ExcelUtil<TbUserRole> util = new ExcelUtil<TbUserRole>(TbUserRole.class);
|
||||
util.exportExcel(response, list, "用户类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户类型详细信息
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:query")
|
||||
@GetMapping(value = "/{userRoleId}")
|
||||
public AjaxResult getInfo(@PathVariable("userRoleId") Long userRoleId)
|
||||
{
|
||||
return success(tbUserRoleService.selectTbUserRoleByUserRoleId(userRoleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:add")
|
||||
@Log(title = "用户类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbUserRole tbUserRole)
|
||||
{
|
||||
return toAjax(tbUserRoleService.insertTbUserRole(tbUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:edit")
|
||||
@Log(title = "用户类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbUserRole tbUserRole)
|
||||
{
|
||||
return toAjax(tbUserRoleService.updateTbUserRole(tbUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:remove")
|
||||
@Log(title = "用户类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userRoleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userRoleIds)
|
||||
{
|
||||
return toAjax(tbUserRoleService.deleteTbUserRoleByUserRoleIds(userRoleIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import com.bwie.user.service.TbUserService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.api.model.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 苏海龙
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2023/1/13 14:40
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("user")
|
||||
@Slf4j
|
||||
public class UserController extends BaseController {
|
||||
@Resource
|
||||
private TbUserService tbUserServicet;
|
||||
@PostMapping("getuser")
|
||||
private TableDataInfo getuser(@RequestBody PageInfoVo pageInfoVo){
|
||||
PageHelper.startPage(pageInfoVo.getPageNum(),pageInfoVo.getPageSize());
|
||||
List<TbUserVo> list=tbUserServicet.getuser();
|
||||
return getDataTable(list);
|
||||
}
|
||||
@PostMapping("deluser")
|
||||
private AjaxResult deluser(@RequestBody IdVo idVo) {
|
||||
return tbUserServicet.deluser(idVo);
|
||||
}
|
||||
@PostMapping("adduser")
|
||||
private AjaxResult adduser(@RequestBody PhoneVo phoneVo){
|
||||
return tbUserServicet.adduser(phoneVo);
|
||||
}
|
||||
|
||||
@PostMapping("updateuser")
|
||||
private AjaxResult updateuser(@RequestBody TbUserVo tbUserVo){
|
||||
return tbUserServicet.updateuser(tbUserVo);
|
||||
}
|
||||
//修改密码
|
||||
@PostMapping("uppassword")
|
||||
private AjaxResult uppassword(@RequestBody PassWordCode passWordCode){
|
||||
return tbUserServicet.uppassword(passWordCode);
|
||||
}
|
||||
//登录
|
||||
@PostMapping("loginUser")
|
||||
private AjaxResult loginuser(@RequestBody LoginVo loginVo){
|
||||
return tbUserServicet.loginuser(loginVo);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.bwie.user.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户类型对象 tb_user_role
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public class TbUserRole extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 类型ID */
|
||||
private Long userRoleId;
|
||||
|
||||
/** 用户角色类型 */
|
||||
@Excel(name = "用户角色类型")
|
||||
private String userRoleName;
|
||||
|
||||
/** 用户角色有哪些功能 */
|
||||
@Excel(name = "用户角色有哪些功能")
|
||||
private String roleFunction;
|
||||
|
||||
public void setUserRoleId(Long userRoleId)
|
||||
{
|
||||
this.userRoleId = userRoleId;
|
||||
}
|
||||
|
||||
public Long getUserRoleId()
|
||||
{
|
||||
return userRoleId;
|
||||
}
|
||||
public void setUserRoleName(String userRoleName)
|
||||
{
|
||||
this.userRoleName = userRoleName;
|
||||
}
|
||||
|
||||
public String getUserRoleName()
|
||||
{
|
||||
return userRoleName;
|
||||
}
|
||||
public void setRoleFunction(String roleFunction)
|
||||
{
|
||||
this.roleFunction = roleFunction;
|
||||
}
|
||||
|
||||
public String getRoleFunction()
|
||||
{
|
||||
return roleFunction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userRoleId", getUserRoleId())
|
||||
.append("userRoleName", getUserRoleName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("roleFunction", getRoleFunction())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
|
||||
/**
|
||||
* 角色Mapper接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface TbMyroleMapper
|
||||
{
|
||||
/**
|
||||
* 查询角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 角色
|
||||
*/
|
||||
public TbMyrole selectTbMyroleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 角色集合
|
||||
*/
|
||||
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*
|
||||
* @param roleIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleIds(Long[] roleIds);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue