From ded5474fee83be9e5cdefa5c499252080e9df37a Mon Sep 17 00:00:00 2001 From: muzi <2098333240@qq.com> Date: Fri, 13 Jan 2023 23:16:53 +0800 Subject: [PATCH 01/14] CRUD --- ruoyi-common/ruoyi-common-core/pom.xml | 4 + ruoyi-modules/pom.xml | 1 + ruoyi-modules/ruoyi-potenza/pom.xml | 106 ++++++++++++++++ .../potenza/RuoYiPotenzaApplication.java | 34 +++++ .../controller/BorrowerController.java | 116 ++++++++++++++++++ .../controller/BorrowerPeriodsController.java | 107 ++++++++++++++++ .../controller/BorrowerPlanController.java | 107 ++++++++++++++++ .../com/ruoyi/potenza/domain/TbBorrower.java | 96 +++++++++++++++ .../potenza/domain/TbBorrowerPeriods.java | 56 +++++++++ .../ruoyi/potenza/domain/TbBorrowerPlan.java | 81 ++++++++++++ .../com/ruoyi/potenza/domain/vo/IdVo.java | 17 +++ .../potenza/mapper/TbBorrowerMapper.java | 60 +++++++++ .../mapper/TbBorrowerPeriodsMapper.java | 66 ++++++++++ .../potenza/mapper/TbBorrowerPlanMapper.java | 66 ++++++++++ .../service/TbBorrowerPeriodsService.java | 61 +++++++++ .../service/TbBorrowerPlanService.java | 61 +++++++++ .../potenza/service/TbBorrowerService.java | 55 +++++++++ .../impl/TbBorrowerPeriodsServiceImpl.java | 102 +++++++++++++++ .../impl/TbBorrowerPlanServiceImpl.java | 101 +++++++++++++++ .../service/impl/TbBorrowerServiceImpl.java | 98 +++++++++++++++ .../src/main/resources/bootstrap.yml | 25 ++++ .../src/main/resources/logback.xml | 74 +++++++++++ .../resources/mapper/TbBorrowerMapper.xml | 108 ++++++++++++++++ .../mapper/TbBorrowerPeriodsMapper.xml | 76 ++++++++++++ .../resources/mapper/TbBorrowerPlanMapper.xml | 104 ++++++++++++++++ 25 files changed, 1782 insertions(+) create mode 100644 ruoyi-modules/ruoyi-potenza/pom.xml create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/RuoYiPotenzaApplication.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrower.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPeriods.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPlan.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/IdVo.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerMapper.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPeriodsMapper.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPlanMapper.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPeriodsService.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPlanService.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerService.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPeriodsServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPlanServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/resources/bootstrap.yml create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/resources/logback.xml create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerMapper.xml create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPeriodsMapper.xml create mode 100644 ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPlanMapper.xml diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml index efe0e0cd..38c219a4 100644 --- a/ruoyi-common/ruoyi-common-core/pom.xml +++ b/ruoyi-common/ruoyi-common-core/pom.xml @@ -16,6 +16,10 @@ + + org.projectlombok + lombok + diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index b8b532f8..91177839 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -13,6 +13,7 @@ ruoyi-gen ruoyi-job ruoyi-file + ruoyi-potenza ruoyi-modules diff --git a/ruoyi-modules/ruoyi-potenza/pom.xml b/ruoyi-modules/ruoyi-potenza/pom.xml new file mode 100644 index 00000000..2c63b051 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/pom.xml @@ -0,0 +1,106 @@ + + + + ruoyi-modules + com.ruoyi + 3.6.1 + + 4.0.0 + + com.ruoyi.potenza + com.ruoyi.potenza + + + 8 + 8 + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/RuoYiPotenzaApplication.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/RuoYiPotenzaApplication.java new file mode 100644 index 00000000..4693c3d4 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/RuoYiPotenzaApplication.java @@ -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" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java new file mode 100644 index 00000000..860685d2 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java @@ -0,0 +1,116 @@ +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 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); + } + + @RequiresPermissions("potenza:borrower:list") + @GetMapping("/list") + public TableDataInfo list(TbBorrower tbBorrower) + { + startPage(); + List list = tbBorrowerService.selectTbBorrowerList(tbBorrower); + return getDataTable(list); + } + + /** + * 导出贷款列表 + */ + @RequiresPermissions("potenza:borrower:export") + @Log(title = "贷款", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbBorrower tbBorrower) + { + List list = tbBorrowerService.selectTbBorrowerList(tbBorrower); + ExcelUtil util = new ExcelUtil(TbBorrower.class); + util.exportExcel(response, list, "贷款数据"); + } + + /** + * 获取贷款详细信息 + */ + @RequiresPermissions("potenza:borrower:query") + @GetMapping(value = "/{borrowerId}") + public AjaxResult getInfo(@PathVariable("borrowerId") Long borrowerId) + { + return success(tbBorrowerService.selectTbBorrowerByBorrowerId(borrowerId)); + } + + /** + * 新增贷款 + */ + @RequiresPermissions("potenza:borrower:add") + @Log(title = "贷款", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbBorrower tbBorrower) + { + return toAjax(tbBorrowerService.insertTbBorrower(tbBorrower)); + } + + /** + * 修改贷款 + */ + @RequiresPermissions("potenza:borrower:edit") + @Log(title = "贷款", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbBorrower tbBorrower) + { + return toAjax(tbBorrowerService.updateTbBorrower(tbBorrower)); + } + + + +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java new file mode 100644 index 00000000..2089a3f1 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java @@ -0,0 +1,107 @@ +package com.ruoyi.potenza.controller; + +import java.util.List; +import java.io.IOException; +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.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 list = tbBorrowerPeriodsService.selectTbBorrowerPeriodsList(tbBorrowerPeriods); + return getDataTable(list); + } + + /** + * 导出贷款周期列表 + */ + @RequiresPermissions("potenza:periods:export") + @Log(title = "贷款周期", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbBorrowerPeriods tbBorrowerPeriods) + { + List list = tbBorrowerPeriodsService.selectTbBorrowerPeriodsList(tbBorrowerPeriods); + ExcelUtil util = new ExcelUtil(TbBorrowerPeriods.class); + util.exportExcel(response, list, "贷款周期数据"); + } + + /** + * 获取贷款周期详细信息 + */ + @RequiresPermissions("potenza:periods:query") + @GetMapping(value = "/{periodsId}") + public AjaxResult getInfo(@PathVariable("periodsId") Long periodsId) + { + return success(tbBorrowerPeriodsService.selectTbBorrowerPeriodsByPeriodsId(periodsId)); + } + + /** + * 新增贷款周期 + */ + @RequiresPermissions("potenza:periods:add") + @Log(title = "贷款周期", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) + { + return toAjax(tbBorrowerPeriodsService.insertTbBorrowerPeriods(tbBorrowerPeriods)); + } + + /** + * 修改贷款周期 + */ + @RequiresPermissions("potenza:periods:edit") + @Log(title = "贷款周期", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) + { + return toAjax(tbBorrowerPeriodsService.updateTbBorrowerPeriods(tbBorrowerPeriods)); + } + + /** + * 删除贷款周期 + */ + @RequiresPermissions("potenza:periods:remove") + @Log(title = "贷款周期", businessType = BusinessType.DELETE) + @DeleteMapping("/{periodsIds}") + public AjaxResult remove(@PathVariable Long[] periodsIds) + { + return toAjax(tbBorrowerPeriodsService.deleteTbBorrowerPeriodsByPeriodsIds(periodsIds)); + } +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java new file mode 100644 index 00000000..e139655a --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java @@ -0,0 +1,107 @@ +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 list = tbBorrowerPlanService.selectTbBorrowerPlanList(tbBorrowerPlan); + return getDataTable(list); + } + + /** + * 导出计划列表 + */ + @RequiresPermissions("potenza:plan:export") + @Log(title = "计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbBorrowerPlan tbBorrowerPlan) + { + List list = tbBorrowerPlanService.selectTbBorrowerPlanList(tbBorrowerPlan); + ExcelUtil util = new ExcelUtil(TbBorrowerPlan.class); + util.exportExcel(response, list, "计划数据"); + } + + /** + * 获取计划详细信息 + */ + @RequiresPermissions("potenza:plan:query") + @GetMapping(value = "/{planId}") + public AjaxResult getInfo(@PathVariable("planId") Long planId) + { + return success(tbBorrowerPlanService.selectTbBorrowerPlanByPlanId(planId)); + } + + /** + * 新增计划 + */ + @RequiresPermissions("potenza:plan:add") + @Log(title = "计划", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbBorrowerPlan tbBorrowerPlan) + { + return toAjax(tbBorrowerPlanService.insertTbBorrowerPlan(tbBorrowerPlan)); + } + + /** + * 修改计划 + */ + @RequiresPermissions("potenza:plan:edit") + @Log(title = "计划", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbBorrowerPlan tbBorrowerPlan) + { + return toAjax(tbBorrowerPlanService.updateTbBorrowerPlan(tbBorrowerPlan)); + } + + /** + * 删除计划 + */ + @RequiresPermissions("potenza:plan:remove") + @Log(title = "计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{planIds}") + public AjaxResult remove(@PathVariable Long[] planIds) + { + return toAjax(tbBorrowerPlanService.deleteTbBorrowerPlanByPlanIds(planIds)); + } +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrower.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrower.java new file mode 100644 index 00000000..aa6b06d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrower.java @@ -0,0 +1,96 @@ +package com.ruoyi.potenza.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_borrower + */ +@TableName(value ="tb_borrower") +@Data +public class TbBorrower implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer borrowerId; + + /** + * 用户ID + */ + private Integer userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 产品ID + */ + private Integer productId; + + /** + * 默认为最高可以借款金额 + */ + private Double borrowerMoney; + + /** + * 贷款周期ID + */ + private Integer periodsId; + + /** + * 贷款方式ID 0:等额本息 6000 1:等额本金 6000 1000 第一个月60000*利率 第二个月 5000*利率 + */ + private Integer wayId; + + /** + * 借款用途 + */ + private String borrowerPurpose; + + /** + * 1: 待审核 2:贷款成功 3:贷款失败 + */ + private Integer borrowerState; + + /** + * 放款人 + */ + private Integer loanerId; + + /** + * 创建者 + */ + private String createBy; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 删除状态0:存在,2:删除 + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPeriods.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPeriods.java new file mode 100644 index 00000000..4e0162bb --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPeriods.java @@ -0,0 +1,56 @@ +package com.ruoyi.potenza.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_borrower_periods + */ +@TableName(value ="tb_borrower_periods") +@Data +public class TbBorrowerPeriods implements Serializable { + /** + * ID + */ + @TableId(type = IdType.AUTO) + private Integer periodsId; + + /** + * 周期:3 6 9 12 24 + */ + private Integer periodsName; + + /** + * 创建者 + */ + private String createBy; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 删除状态0:存在,2:删除 + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPlan.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPlan.java new file mode 100644 index 00000000..1702059c --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPlan.java @@ -0,0 +1,81 @@ +package com.ruoyi.potenza.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_borrower_plan + */ +@TableName(value ="tb_borrower_plan") +@Data +public class TbBorrowerPlan implements Serializable { + /** + * 还款结果ID + */ + @TableId(type = IdType.AUTO) + private Integer planId; + + /** + * 用户ID + */ + private Integer userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 共几期 + */ + private Integer borrowerPeriods; + + /** + * 每期应还金额 + */ + private Double periodsMoney; + + /** + * 月供本金 + */ + private Double periodsCapital; + + /** + * 月供利息 + */ + private Double periodsInterests; + + /** + * 计划还款日期 + */ + private Date planDate; + + /** + * 0:本月未还 1:提前还款 2:按时还款 3:逾期还款 + */ + private Integer planState; + + /** + * 删除状态0:存在,2:删除 + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/IdVo.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/IdVo.java new file mode 100644 index 00000000..c943b6e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/IdVo.java @@ -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; +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerMapper.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerMapper.java new file mode 100644 index 00000000..68118e5f --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerMapper.java @@ -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 { + + List pageList(); + + + + /** + * 查询贷款 + * + * @param borrowerId 贷款主键 + * @return 贷款 + */ + public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId); + + /** + * 查询贷款列表 + * + * @param tbBorrower 贷款 + * @return 贷款集合 + */ + public List selectTbBorrowerList(TbBorrower tbBorrower); + + /** + * 新增贷款 + * + * @param tbBorrower 贷款 + * @return 结果 + */ + public int insertTbBorrower(TbBorrower tbBorrower); + + /** + * 修改贷款 + * + * @param tbBorrower 贷款 + * @return 结果 + */ + public int updateTbBorrower(TbBorrower tbBorrower); + + + + +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPeriodsMapper.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPeriodsMapper.java new file mode 100644 index 00000000..e4d7795d --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPeriodsMapper.java @@ -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 { + /** + * 查询贷款周期 + * + * @param periodsId 贷款周期主键 + * @return 贷款周期 + */ + public TbBorrowerPeriods selectTbBorrowerPeriodsByPeriodsId(Long periodsId); + + /** + * 查询贷款周期列表 + * + * @param tbBorrowerPeriods 贷款周期 + * @return 贷款周期集合 + */ + public List 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); +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPlanMapper.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPlanMapper.java new file mode 100644 index 00000000..c418af1e --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/mapper/TbBorrowerPlanMapper.java @@ -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 { + /** + * 查询计划 + * + * @param planId 计划主键 + * @return 计划 + */ + public TbBorrowerPlan selectTbBorrowerPlanByPlanId(Long planId); + + /** + * 查询计划列表 + * + * @param tbBorrowerPlan 计划 + * @return 计划集合 + */ + public List 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); +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPeriodsService.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPeriodsService.java new file mode 100644 index 00000000..7e3a82b3 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPeriodsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.potenza.service; + +import com.ruoyi.potenza.domain.TbBorrowerPeriods; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service +* @createDate 2023-01-13 15:56:37 +*/ +public interface TbBorrowerPeriodsService extends IService { + /** + * 查询贷款周期 + * + * @param periodsId 贷款周期主键 + * @return 贷款周期 + */ + public TbBorrowerPeriods selectTbBorrowerPeriodsByPeriodsId(Long periodsId); + + /** + * 查询贷款周期列表 + * + * @param tbBorrowerPeriods 贷款周期 + * @return 贷款周期集合 + */ + public List 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); +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPlanService.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPlanService.java new file mode 100644 index 00000000..e7fe07a2 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPlanService.java @@ -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 { + /** + * 查询计划 + * + * @param planId 计划主键 + * @return 计划 + */ + public TbBorrowerPlan selectTbBorrowerPlanByPlanId(Long planId); + + /** + * 查询计划列表 + * + * @param tbBorrowerPlan 计划 + * @return 计划集合 + */ + public List 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); +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerService.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerService.java new file mode 100644 index 00000000..ab007948 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerService.java @@ -0,0 +1,55 @@ +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 { + + List pageList(TbBorrower tbBorrower); + + AjaxResult borrowerDele(IdVo idVo); + + /** + * 查询贷款 + * + * @param borrowerId 贷款主键 + * @return 贷款 + */ + public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId); + + /** + * 查询贷款列表 + * + * @param tbBorrower 贷款 + * @return 贷款集合 + */ + public List selectTbBorrowerList(TbBorrower tbBorrower); + + /** + * 新增贷款 + * + * @param tbBorrower 贷款 + * @return 结果 + */ + public int insertTbBorrower(TbBorrower tbBorrower); + + /** + * 修改贷款 + * + * @param tbBorrower 贷款 + * @return 结果 + */ + public int updateTbBorrower(TbBorrower tbBorrower); + + + +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPeriodsServiceImpl.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPeriodsServiceImpl.java new file mode 100644 index 00000000..0bddb453 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPeriodsServiceImpl.java @@ -0,0 +1,102 @@ +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.TbBorrowerPeriods; +import com.ruoyi.potenza.service.TbBorrowerPeriodsService; +import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service实现 +* @createDate 2023-01-13 15:56:37 +*/ +@Service +public class TbBorrowerPeriodsServiceImpl extends ServiceImpl + 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 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); + } + +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPlanServiceImpl.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPlanServiceImpl.java new file mode 100644 index 00000000..9d03eb03 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPlanServiceImpl.java @@ -0,0 +1,101 @@ +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.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 + 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 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); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerServiceImpl.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerServiceImpl.java new file mode 100644 index 00000000..6a4b4e92 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerServiceImpl.java @@ -0,0 +1,98 @@ +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.TbBorrower; +import com.ruoyi.potenza.domain.vo.IdVo; +import com.ruoyi.potenza.service.TbBorrowerService; +import com.ruoyi.potenza.mapper.TbBorrowerMapper; +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 +public class TbBorrowerServiceImpl extends ServiceImpl + implements TbBorrowerService{ + + @Autowired + private TbBorrowerMapper tbBorrowerMapper; + + @Override + public List pageList(TbBorrower tbBorrower) { + List list= tbBorrowerMapper.pageList(); + return list; + } + + @Override + public AjaxResult borrowerDele(IdVo idVo) { + tbBorrowerMapper.deleteById(idVo.getId()); + return AjaxResult.success("删除成功"); + } + + + + /** + * 查询贷款 + * + * @param borrowerId 贷款主键 + * @return 贷款 + */ + @Override + public TbBorrower selectTbBorrowerByBorrowerId(Long borrowerId) + { + return tbBorrowerMapper.selectTbBorrowerByBorrowerId(borrowerId); + } + + /** + * 查询贷款列表 + * + * @param tbBorrower 贷款 + * @return 贷款 + */ + @Override + public List 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); + } + + + + +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-potenza/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..4a64873b --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9301 + +# 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} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-potenza/src/main/resources/logback.xml new file mode 100644 index 00000000..c57c927c --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerMapper.xml b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerMapper.xml new file mode 100644 index 00000000..717348f1 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into tb_borrower + + 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, + + + #{userId}, + #{userName}, + #{productId}, + #{borrowerMoney}, + #{periodsId}, + #{wayId}, + #{borrowerPurpose}, + #{borrowerState}, + #{loanerId}, + #{createBy}, + #{updateBy}, + #{delFlag}, + #{createTime}, + #{updateTime}, + + + + + update tb_borrower + + user_id = #{userId}, + user_name = #{userName}, + product_id = #{productId}, + borrower_money = #{borrowerMoney}, + periods_id = #{periodsId}, + way_id = #{wayId}, + borrower_purpose = #{borrowerPurpose}, + borrower_state = #{borrowerState}, + loaner_id = #{loanerId}, + create_by = #{createBy}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where borrower_id = #{borrowerId} + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPeriodsMapper.xml b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPeriodsMapper.xml new file mode 100644 index 00000000..c8760ec7 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPeriodsMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + select periods_id, periods_name, create_by, update_by, del_flag, create_time, update_time from tb_borrower_periods + + + + + + + + insert into tb_borrower_periods + + periods_name, + create_by, + update_by, + del_flag, + create_time, + update_time, + + + #{periodsName}, + #{createBy}, + #{updateBy}, + #{delFlag}, + #{createTime}, + #{updateTime}, + + + + + update tb_borrower_periods + + periods_name = #{periodsName}, + create_by = #{createBy}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where periods_id = #{periodsId} + + + + delete from tb_borrower_periods where periods_id = #{periodsId} + + + + delete from tb_borrower_periods where periods_id in + + #{periodsId} + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPlanMapper.xml b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPlanMapper.xml new file mode 100644 index 00000000..41491377 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPlanMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into tb_borrower_plan + + user_id, + user_name, + borrower_periods, + periods_money, + periods_capital, + periods_interests, + plan_date, + plan_state, + del_flag, + create_time, + update_time, + + + #{userId}, + #{userName}, + #{borrowerPeriods}, + #{periodsMoney}, + #{periodsCapital}, + #{periodsInterests}, + #{planDate}, + #{planState}, + #{delFlag}, + #{createTime}, + #{updateTime}, + + + + + update tb_borrower_plan + + user_id = #{userId}, + user_name = #{userName}, + borrower_periods = #{borrowerPeriods}, + periods_money = #{periodsMoney}, + periods_capital = #{periodsCapital}, + periods_interests = #{periodsInterests}, + plan_date = #{planDate}, + plan_state = #{planState}, + del_flag = #{delFlag}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where plan_id = #{planId} + + + + delete from tb_borrower_plan where plan_id = #{planId} + + + + delete from tb_borrower_plan where plan_id in + + #{planId} + + + From 1c6142e090c716c74b29de4380f3a656d60f6cfa Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 14 Jan 2023 11:09:25 +0800 Subject: [PATCH 02/14] =?UTF-8?q?1/=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + ruoyi-modules/ruoyi-invest/pom.xml | 108 ++++++ .../ruoyi/invest/RuoYiInvestApplication.java | 34 ++ .../invest/controller/TbFirmController.java | 105 ++++++ .../invest/controller/TbInvestController.java | 104 ++++++ .../java/com/ruoyi/invest/domain/TbFirm.java | 71 ++++ .../com/ruoyi/invest/domain/TbInvest.java | 76 +++++ .../com/ruoyi/invest/mapper/TbFirmMapper.java | 65 ++++ .../ruoyi/invest/mapper/TbInvestMapper.java | 65 ++++ .../ruoyi/invest/service/TbFirmService.java | 59 ++++ .../ruoyi/invest/service/TbInvestService.java | 59 ++++ .../service/impl/TbFirmServiceImpl.java | 99 ++++++ .../service/impl/TbInvestServiceImpl.java | 99 ++++++ .../src/main/resources/bootstrap.yml | 25 ++ .../src/main/resources/logback.xml | 74 +++++ .../main/resources/mapper/TbFirmMapper.xml | 93 ++++++ .../main/resources/mapper/TbInvestMapper.xml | 96 ++++++ ruoyi-ui/src/api/invest/firm.js | 44 +++ ruoyi-ui/src/api/invest/invest.js | 44 +++ ruoyi-ui/src/views/invest/firm/index.vue | 287 ++++++++++++++++ ruoyi-ui/src/views/invest/invest/index.vue | 309 ++++++++++++++++++ 21 files changed, 1917 insertions(+) create mode 100644 ruoyi-modules/ruoyi-invest/pom.xml create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml create mode 100644 ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml create mode 100644 ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml create mode 100644 ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml create mode 100644 ruoyi-ui/src/api/invest/firm.js create mode 100644 ruoyi-ui/src/api/invest/invest.js create mode 100644 ruoyi-ui/src/views/invest/firm/index.vue create mode 100644 ruoyi-ui/src/views/invest/invest/index.vue diff --git a/pom.xml b/pom.xml index 0f8e3f3d..3e880a4d 100644 --- a/pom.xml +++ b/pom.xml @@ -232,6 +232,7 @@ ruoyi-modules ruoyi-api ruoyi-common + ruoyi-modules/ruoyi-invest pom diff --git a/ruoyi-modules/ruoyi-invest/pom.xml b/ruoyi-modules/ruoyi-invest/pom.xml new file mode 100644 index 00000000..a429309b --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/pom.xml @@ -0,0 +1,108 @@ + + + + ruoyi + com.ruoyi + 3.6.1 + ../../pom.xml + + 4.0.0 + + ruoyi-invest + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + + org.projectlombok + lombok + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java new file mode 100644 index 00000000..1c882421 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java @@ -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" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java new file mode 100644 index 00000000..414860b9 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java @@ -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 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 list = tbFirmService.selectTbFirmList(tbFirm); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java new file mode 100644 index 00000000..a3fa93de --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java @@ -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 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 list = tbInvestService.selectTbInvestList(tbInvest); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java new file mode 100644 index 00000000..0e78c2e1 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java @@ -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; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java new file mode 100644 index 00000000..8da1b383 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java @@ -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; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java new file mode 100644 index 00000000..59437f28 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java @@ -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 { + /** + * 查询企业 + * + * @param firmId 企业主键 + * @return 企业 + */ + public TbFirm selectTbFirmByFirmId(Long firmId); + + /** + * 查询企业列表 + * + * @param tbFirm 企业 + * @return 企业集合 + */ + public List 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); +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java new file mode 100644 index 00000000..9f84b152 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java @@ -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 { + /** + * 查询投资 + * + * @param investId 投资主键 + * @return 投资 + */ + public TbInvest selectTbInvestByInvestId(Long investId); + + /** + * 查询投资列表 + * + * @param tbInvest 投资 + * @return 投资集合 + */ + public List 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); +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java new file mode 100644 index 00000000..a7df95f6 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java @@ -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 { + /** + * 查询企业 + * + * @param firmId 企业主键 + * @return 企业 + */ + public TbFirm selectTbFirmByFirmId(Long firmId); + + /** + * 查询企业列表 + * + * @param tbFirm 企业 + * @return 企业集合 + */ + public List 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); +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java new file mode 100644 index 00000000..56086c06 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java @@ -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 { + /** + * 查询投资 + * + * @param investId 投资主键 + * @return 投资 + */ + public TbInvest selectTbInvestByInvestId(Long investId); + + /** + * 查询投资列表 + * + * @param tbInvest 投资 + * @return 投资集合 + */ + public List 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); +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java new file mode 100644 index 00000000..c99ac7f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java @@ -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 + 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 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); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java new file mode 100644 index 00000000..1af6d5ce --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java @@ -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 + 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 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); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..f45744cc --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml @@ -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} diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml new file mode 100644 index 00000000..313140f7 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml new file mode 100644 index 00000000..9a3d1147 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + select firm_id, firm_name, firm_pic, firm_market, firm_desc, del_flag, create_time, create_by, update_time, update_by from tb_firm + + + + + + + + insert into tb_firm + + firm_id, + firm_name, + firm_pic, + firm_market, + firm_desc, + del_flag, + create_time, + create_by, + update_time, + update_by, + + + #{firmId}, + #{firmName}, + #{firmPic}, + #{firmMarket}, + #{firmDesc}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update tb_firm + + firm_name = #{firmName}, + firm_pic = #{firmPic}, + firm_market = #{firmMarket}, + firm_desc = #{firmDesc}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where firm_id = #{firmId} + + + + delete from tb_firm where firm_id = #{firmId} + + + + delete from tb_firm where firm_id in + + #{firmId} + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml new file mode 100644 index 00000000..bafe16d3 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into tb_invest + + user_id, + firm_id, + invest_amount, + invest_yield, + invest_state, + del_flag, + create_time, + create_by, + update_time, + update_by, + + + #{userId}, + #{firmId}, + #{investAmount}, + #{investYield}, + #{investState}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update tb_invest + + user_id = #{userId}, + firm_id = #{firmId}, + invest_amount = #{investAmount}, + invest_yield = #{investYield}, + invest_state = #{investState}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where invest_id = #{investId} + + + + delete from tb_invest where invest_id = #{investId} + + + + delete from tb_invest where invest_id in + + #{investId} + + + diff --git a/ruoyi-ui/src/api/invest/firm.js b/ruoyi-ui/src/api/invest/firm.js new file mode 100644 index 00000000..6013a18e --- /dev/null +++ b/ruoyi-ui/src/api/invest/firm.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询企业列表 +export function listFirm(query) { + return request({ + url: '/invest/firm/list', + method: 'get', + params: query + }) +} + +// 查询企业详细 +export function getFirm(firmId) { + return request({ + url: '/invest/firm/' + firmId, + method: 'get' + }) +} + +// 新增企业 +export function addFirm(data) { + return request({ + url: '/invest/firm', + method: 'post', + data: data + }) +} + +// 修改企业 +export function updateFirm(data) { + return request({ + url: '/invest/firm', + method: 'put', + data: data + }) +} + +// 删除企业 +export function delFirm(firmId) { + return request({ + url: '/invest/firm/' + firmId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/invest/invest.js b/ruoyi-ui/src/api/invest/invest.js new file mode 100644 index 00000000..abc0e021 --- /dev/null +++ b/ruoyi-ui/src/api/invest/invest.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询投资列表 +export function listInvest(query) { + return request({ + url: '/invest/invest/list', + method: 'get', + params: query + }) +} + +// 查询投资详细 +export function getInvest(investId) { + return request({ + url: '/invest/invest/' + investId, + method: 'get' + }) +} + +// 新增投资 +export function addInvest(data) { + return request({ + url: '/invest/invest', + method: 'post', + data: data + }) +} + +// 修改投资 +export function updateInvest(data) { + return request({ + url: '/invest/invest', + method: 'put', + data: data + }) +} + +// 删除投资 +export function delInvest(investId) { + return request({ + url: '/invest/invest/' + investId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/invest/firm/index.vue b/ruoyi-ui/src/views/invest/firm/index.vue new file mode 100644 index 00000000..eadb7b0f --- /dev/null +++ b/ruoyi-ui/src/views/invest/firm/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/ruoyi-ui/src/views/invest/invest/index.vue b/ruoyi-ui/src/views/invest/invest/index.vue new file mode 100644 index 00000000..8d7a6226 --- /dev/null +++ b/ruoyi-ui/src/views/invest/invest/index.vue @@ -0,0 +1,309 @@ + + + From 0669a85058b0d608118b51364c332b565593c866 Mon Sep 17 00:00:00 2001 From: suhailong <3528551583@qq.com> Date: Sat, 14 Jan 2023 12:34:55 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A8=A1=E5=9D=97(?= =?UTF-8?q?=E8=8B=8F=E6=B5=B7=E9=BE=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/api/model/IdVo.java | 17 + .../com/ruoyi/system/api/model/LoginVo.java | 20 ++ .../ruoyi/system/api/model/PageInfoVo.java | 41 +++ .../ruoyi/system/api/model/PassWordCode.java | 19 ++ .../com/ruoyi/system/api/model/PhoneVo.java | 18 + .../com/ruoyi/system/api/model/TbUserVo.java | 135 ++++++++ ruoyi-modules/pom.xml | 1 + ruoyi-modules/ruoyi-user/pom.xml | 147 +++++++++ .../com/bwie/ruoyi/RuoYiUserApplication.java | 34 ++ .../ruoyi/config/Knife4jConfiguration.java | 48 +++ .../bwie/ruoyi/controller/DuanXinSend.java | 30 ++ .../bwie/ruoyi/controller/UserController.java | 61 ++++ .../com/bwie/ruoyi/mapper/TbPermMapper.java | 18 + .../com/bwie/ruoyi/mapper/TbRoleMapper.java | 18 + .../bwie/ruoyi/mapper/TbRolePermMapper.java | 18 + .../ruoyi/mapper/TbUserBankcardMapper.java | 18 + .../com/bwie/ruoyi/mapper/TbUserMapper.java | 18 + .../bwie/ruoyi/mapper/TbUserRoleMapper.java | 18 + .../main/java/com/bwie/ruoyi/pojo/TbPerm.java | 58 ++++ .../main/java/com/bwie/ruoyi/pojo/TbRole.java | 53 +++ .../java/com/bwie/ruoyi/pojo/TbRolePerm.java | 58 ++++ .../main/java/com/bwie/ruoyi/pojo/TbUser.java | 140 ++++++++ .../com/bwie/ruoyi/pojo/TbUserBankcard.java | 73 ++++ .../java/com/bwie/ruoyi/pojo/TbUserRole.java | 63 ++++ .../com/bwie/ruoyi/service/TbPermService.java | 13 + .../bwie/ruoyi/service/TbRolePermService.java | 13 + .../com/bwie/ruoyi/service/TbRoleService.java | 13 + .../ruoyi/service/TbUserBankcardService.java | 13 + .../bwie/ruoyi/service/TbUserRoleService.java | 13 + .../com/bwie/ruoyi/service/TbUserService.java | 30 ++ .../ruoyi/service/impl/TbPermServiceImpl.java | 22 ++ .../service/impl/TbRolePermServiceImpl.java | 22 ++ .../ruoyi/service/impl/TbRoleServiceImpl.java | 22 ++ .../impl/TbUserBankcardServiceImpl.java | 22 ++ .../service/impl/TbUserRoleServiceImpl.java | 22 ++ .../ruoyi/service/impl/TbUserServiceImpl.java | 155 +++++++++ .../com/bwie/ruoyi/utils/DuanxinUtils.java | 46 +++ .../java/com/bwie/ruoyi/utils/HttpUtils.java | 311 ++++++++++++++++++ .../java/com/bwie/ruoyi/utils/TokenUtils.java | 178 ++++++++++ .../src/main/resources/bootstrap.yml | 25 ++ .../ruoyi-user/src/main/resources/logback.xml | 74 +++++ .../main/resources/mapper/TbPermMapper.xml | 20 ++ .../main/resources/mapper/TbRoleMapper.xml | 19 ++ .../resources/mapper/TbRolePermMapper.xml | 20 ++ .../resources/mapper/TbUserBankcardMapper.xml | 24 ++ .../main/resources/mapper/TbUserMapper.xml | 42 +++ .../resources/mapper/TbUserRoleMapper.xml | 22 ++ 47 files changed, 2265 insertions(+) create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/IdVo.java create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/LoginVo.java create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PageInfoVo.java create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PassWordCode.java create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PhoneVo.java create mode 100644 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TbUserVo.java create mode 100644 ruoyi-modules/ruoyi-user/pom.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/RuoYiUserApplication.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/config/Knife4jConfiguration.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/DuanXinSend.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/UserController.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbPermMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRoleMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRolePermMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserBankcardMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserRoleMapper.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbPerm.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRole.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRolePerm.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUser.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserBankcard.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserRole.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbPermService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRolePermService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRoleService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserBankcardService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserRoleService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserService.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbPermServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRolePermServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRoleServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserBankcardServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserRoleServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/DuanxinUtils.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/HttpUtils.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/TokenUtils.java create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/bootstrap.yml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/logback.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbPermMapper.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRoleMapper.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRolePermMapper.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserBankcardMapper.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserMapper.xml create mode 100644 ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserRoleMapper.xml diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/IdVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/IdVo.java new file mode 100644 index 00000000..670a7935 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/IdVo.java @@ -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; +} diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/LoginVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/LoginVo.java new file mode 100644 index 00000000..ee6e8860 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/LoginVo.java @@ -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; +} diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PageInfoVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PageInfoVo.java new file mode 100644 index 00000000..d151469e --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PageInfoVo.java @@ -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; + + + + + + + + + + + + + + + +} diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PassWordCode.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PassWordCode.java new file mode 100644 index 00000000..dbc8163e --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PassWordCode.java @@ -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; +} diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PhoneVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PhoneVo.java new file mode 100644 index 00000000..11ce82c3 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PhoneVo.java @@ -0,0 +1,18 @@ +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; +} diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TbUserVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TbUserVo.java new file mode 100644 index 00000000..884338a5 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TbUserVo.java @@ -0,0 +1,135 @@ +package com.ruoyi.system.api.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.web.domain.BaseEntity; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author 苏海龙 + * @version 1.0 + * @description: TODO + * @date 2023/1/10 15:03 + */ + +@Data +public class TbUserVo extends BaseEntity { + private static final long serialVersionUID = 1L; + private Long userId; + + /** + * 用户账号 + */ + private String userName; + private String token; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 用户邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 年龄 + */ + private Integer age; + + /** + * 用户性别(0男 1女 2未知) + */ + private String sex; + + /** + * 头像地址 + */ + private String avatar; + + /** + * 身份证(只有管理员能看到) + */ + private String userCard; + + /** + * 密码 + */ + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + /** + * 最后登录IP + */ + private String loginIp; + + /** + * 最后登录时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date loginDate; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 账号金额(元) + */ + private Double userPrice; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 实名状态(0,未实名1已实名) + */ + private String realnameState; + + /** + * 信誉积分 + */ + private Integer honorIntegral; + + +} diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 91177839..3d5da182 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -14,6 +14,7 @@ ruoyi-job ruoyi-file ruoyi-potenza + ruoyi-user ruoyi-modules diff --git a/ruoyi-modules/ruoyi-user/pom.xml b/ruoyi-modules/ruoyi-user/pom.xml new file mode 100644 index 00000000..c738af55 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/pom.xml @@ -0,0 +1,147 @@ + + + + ruoyi-modules + com.ruoyi + 3.6.1 + + 4.0.0 + + ruoyi-user + + + 8 + 8 + + + + + + + + com.alibaba + fastjson + 1.2.15 + + + org.apache.httpcomponents + httpclient + + + org.apache.httpcomponents + httpcore + + + commons-lang + commons-lang + 2.6 + + + org.eclipse.jetty + jetty-util + + + + cn.hutool + hutool-all + 4.5.16 + + + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.4 + + + org.projectlombok + lombok + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/RuoYiUserApplication.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/RuoYiUserApplication.java new file mode 100644 index 00000000..5e96c64e --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/RuoYiUserApplication.java @@ -0,0 +1,34 @@ +package com.bwie.ruoyi; + +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 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" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/config/Knife4jConfiguration.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/config/Knife4jConfiguration.java new file mode 100644 index 00000000..3edeb256 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/config/Knife4jConfiguration.java @@ -0,0 +1,48 @@ +package com.bwie.ruoyi.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.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +/** + * @author 冰烆 + * @version 1.0 + * @description: TODO + * @date 2022/10/21 20:15 + */ + +@Configuration +@EnableSwagger2WebMvc +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.bwie")) + .paths(PathSelectors.any()) + .build(); + return docket; + } + + private ApiInfo webApiInfo() { + return new ApiInfoBuilder() + //描述字段支持Markdown语法 + .title("Weekly-API") + .contact(new Contact("苏海龙", "https://www.bwie.net/", "bwie@bwie.com")) + .description("考试服务端API-version1.0") + .version("1.0") + .build(); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/DuanXinSend.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/DuanXinSend.java new file mode 100644 index 00000000..688ffdb4 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/DuanXinSend.java @@ -0,0 +1,30 @@ +package com.bwie.ruoyi.controller; + +import com.bwie.ruoyi.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); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/UserController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/UserController.java new file mode 100644 index 00000000..6d7f0282 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/controller/UserController.java @@ -0,0 +1,61 @@ +package com.bwie.ruoyi.controller; + +import com.bwie.ruoyi.pojo.TbUser; +import com.bwie.ruoyi.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 list=tbUserServicet.getuser(); + return getDataTable(list); + } + @PostMapping("deluser") + private AjaxResult deluser(@RequestBody IdVo idVo) { + return tbUserServicet.deluser(idVo); + } + @PostMapping("adduser") + private AjaxResult adduser(@RequestBody TbUserVo tbUserVo){ + return tbUserServicet.adduser(tbUserVo); + } + + @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); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbPermMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbPermMapper.java new file mode 100644 index 00000000..3176d6aa --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbPermMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbPerm; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_perm(权限表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbPerm +*/ +public interface TbPermMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRoleMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRoleMapper.java new file mode 100644 index 00000000..9cbc5598 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRoleMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_role(角色表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbRole +*/ +public interface TbRoleMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRolePermMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRolePermMapper.java new file mode 100644 index 00000000..3b4d3262 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbRolePermMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbRolePerm; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbRolePerm +*/ +public interface TbRolePermMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserBankcardMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserBankcardMapper.java new file mode 100644 index 00000000..b7f99c99 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserBankcardMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbUserBankcard; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbUserBankcard +*/ +public interface TbUserBankcardMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserMapper.java new file mode 100644 index 00000000..b2b89529 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_user(用户信息表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbUser +*/ +public interface TbUserMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserRoleMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserRoleMapper.java new file mode 100644 index 00000000..a1ee4340 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/mapper/TbUserRoleMapper.java @@ -0,0 +1,18 @@ +package com.bwie.ruoyi.mapper; + +import com.bwie.ruoyi.pojo.TbUserRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 海龙 +* @description 针对表【tb_user_role(用户类型表)】的数据库操作Mapper +* @createDate 2023-01-13 14:34:44 +* @Entity com.bwie.ruoyi.pojo.TbUserRole +*/ +public interface TbUserRoleMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbPerm.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbPerm.java new file mode 100644 index 00000000..98b151ed --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbPerm.java @@ -0,0 +1,58 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 权限表 + * @TableName tb_perm + */ +@TableName(value ="tb_perm") +@Data +public class TbPerm implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer permId; + + /** + * 权限名称 + */ + private String permName; + + /** + * 权限编码 + */ + private String permCode; + + /** + * 删除状态0:未删除1:已删除 + */ + private Integer deleted; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRole.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRole.java new file mode 100644 index 00000000..aa188dce --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRole.java @@ -0,0 +1,53 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 角色表 + * @TableName tb_role + */ +@TableName(value ="tb_role") +@Data +public class TbRole implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer roleId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 删除状态0:未删除1:已删除 + */ + private Integer deleted; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRolePerm.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRolePerm.java new file mode 100644 index 00000000..47ac169b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbRolePerm.java @@ -0,0 +1,58 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 角色权限表 + * @TableName tb_role_perm + */ +@TableName(value ="tb_role_perm") +@Data +public class TbRolePerm implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer rolePermId; + + /** + * 角色ID + */ + private Integer roleId; + + /** + * 权限ID + */ + private Integer permId; + + /** + * 删除状态0:未删除1:已删除 + */ + private Integer deleted; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUser.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUser.java new file mode 100644 index 00000000..79d52f02 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUser.java @@ -0,0 +1,140 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 用户信息表 + * @TableName tb_user + */ +@TableName(value ="tb_user") +@Data +public class TbUser implements Serializable { + /** + * 用户ID + */ + @TableId(type = IdType.AUTO) + private Long userId; + + /** + * 用户账号 + */ + private String userName; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 用户邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 年龄 + */ + private Integer age; + + /** + * 用户性别(0男 1女 2未知) + */ + private String sex; + + /** + * 头像地址 + */ + private String avatar; + + /** + * 身份证(只有管理员能看到) + */ + private String userCard; + + /** + * 密码 + */ + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + /** + * 最后登录IP + */ + private String loginIp; + + /** + * 最后登录时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date loginDate; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 账号金额(元) + */ + private Double userPrice; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 实名状态(0,未实名1已实名) + */ + private String realnameState; + + /** + * 信誉积分 + */ + private Integer honorIntegral; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserBankcard.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserBankcard.java new file mode 100644 index 00000000..6d6af6c2 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserBankcard.java @@ -0,0 +1,73 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 账户表 + * @TableName tb_user_bankcard + */ +@TableName(value ="tb_user_bankcard") +@Data +public class TbUserBankcard implements Serializable { + /** + * 账户ID + */ + @TableId(type = IdType.AUTO) + private Integer bankcardId; + + /** + * 账户昵称 + */ + private String brankcardName; + + /** + * 用户ID + */ + private Integer userId; + + /** + * 账户金额 + */ + private Integer bankcardMoney; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 删除状态0:存在,2:删除 + */ + private Integer delFlag; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserRole.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserRole.java new file mode 100644 index 00000000..44293573 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/pojo/TbUserRole.java @@ -0,0 +1,63 @@ +package com.bwie.ruoyi.pojo; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 用户类型表 + * @TableName tb_user_role + */ +@TableName(value ="tb_user_role") +@Data +public class TbUserRole implements Serializable { + /** + * 类型ID + */ + @TableId(type = IdType.AUTO) + private Long userRoleId; + + /** + * 用户角色类型 + */ + private String userRoleName; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date updateTime; + + /** + * 用户角色有哪些功能 + */ + private String roleFunction; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbPermService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbPermService.java new file mode 100644 index 00000000..558705b4 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbPermService.java @@ -0,0 +1,13 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbPerm; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 海龙 +* @description 针对表【tb_perm(权限表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbPermService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRolePermService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRolePermService.java new file mode 100644 index 00000000..5cb53d14 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRolePermService.java @@ -0,0 +1,13 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbRolePerm; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 海龙 +* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbRolePermService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRoleService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRoleService.java new file mode 100644 index 00000000..89446534 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbRoleService.java @@ -0,0 +1,13 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbRole; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 海龙 +* @description 针对表【tb_role(角色表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbRoleService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserBankcardService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserBankcardService.java new file mode 100644 index 00000000..15509d8b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserBankcardService.java @@ -0,0 +1,13 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbUserBankcard; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 海龙 +* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbUserBankcardService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserRoleService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserRoleService.java new file mode 100644 index 00000000..db30cbc1 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserRoleService.java @@ -0,0 +1,13 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbUserRole; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 海龙 +* @description 针对表【tb_user_role(用户类型表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbUserRoleService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserService.java new file mode 100644 index 00000000..555faabe --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/TbUserService.java @@ -0,0 +1,30 @@ +package com.bwie.ruoyi.service; + +import com.bwie.ruoyi.pojo.TbUser; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.system.api.model.*; + +import java.util.List; + +/** +* @author 海龙 +* @description 针对表【tb_user(用户信息表)】的数据库操作Service +* @createDate 2023-01-13 14:34:44 +*/ +public interface TbUserService extends IService { + + List getuser(); + + AjaxResult deluser(IdVo idVo); + + AjaxResult adduser(TbUserVo tbUserVo); + + AjaxResult phoneSend(PhoneVo phoneVo); + + AjaxResult updateuser(TbUserVo tbUserVo); + + AjaxResult uppassword(PassWordCode passWordCode); + + AjaxResult loginuser(LoginVo loginVo); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbPermServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbPermServiceImpl.java new file mode 100644 index 00000000..6afaa891 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbPermServiceImpl.java @@ -0,0 +1,22 @@ +package com.bwie.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbPerm; +import com.bwie.ruoyi.service.TbPermService; +import com.bwie.ruoyi.mapper.TbPermMapper; +import org.springframework.stereotype.Service; + +/** +* @author 海龙 +* @description 针对表【tb_perm(权限表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbPermServiceImpl extends ServiceImpl + implements TbPermService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRolePermServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRolePermServiceImpl.java new file mode 100644 index 00000000..3024fe4b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRolePermServiceImpl.java @@ -0,0 +1,22 @@ +package com.bwie.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbRolePerm; +import com.bwie.ruoyi.service.TbRolePermService; +import com.bwie.ruoyi.mapper.TbRolePermMapper; +import org.springframework.stereotype.Service; + +/** +* @author 海龙 +* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbRolePermServiceImpl extends ServiceImpl + implements TbRolePermService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRoleServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRoleServiceImpl.java new file mode 100644 index 00000000..e4f043d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbRoleServiceImpl.java @@ -0,0 +1,22 @@ +package com.bwie.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbRole; +import com.bwie.ruoyi.service.TbRoleService; +import com.bwie.ruoyi.mapper.TbRoleMapper; +import org.springframework.stereotype.Service; + +/** +* @author 海龙 +* @description 针对表【tb_role(角色表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbRoleServiceImpl extends ServiceImpl + implements TbRoleService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserBankcardServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserBankcardServiceImpl.java new file mode 100644 index 00000000..fa8bcc56 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserBankcardServiceImpl.java @@ -0,0 +1,22 @@ +package com.bwie.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbUserBankcard; +import com.bwie.ruoyi.service.TbUserBankcardService; +import com.bwie.ruoyi.mapper.TbUserBankcardMapper; +import org.springframework.stereotype.Service; + +/** +* @author 海龙 +* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbUserBankcardServiceImpl extends ServiceImpl + implements TbUserBankcardService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserRoleServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserRoleServiceImpl.java new file mode 100644 index 00000000..3bafb84f --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserRoleServiceImpl.java @@ -0,0 +1,22 @@ +package com.bwie.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbUserRole; +import com.bwie.ruoyi.service.TbUserRoleService; +import com.bwie.ruoyi.mapper.TbUserRoleMapper; +import org.springframework.stereotype.Service; + +/** +* @author 海龙 +* @description 针对表【tb_user_role(用户类型表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbUserRoleServiceImpl extends ServiceImpl + implements TbUserRoleService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserServiceImpl.java new file mode 100644 index 00000000..7ed4eb6e --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/service/impl/TbUserServiceImpl.java @@ -0,0 +1,155 @@ +package com.bwie.ruoyi.service.impl; + +import cn.hutool.core.util.RandomUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bwie.ruoyi.pojo.TbUser; +import com.bwie.ruoyi.service.TbUserService; +import com.bwie.ruoyi.mapper.TbUserMapper; +import com.bwie.ruoyi.utils.DuanxinUtils; +import com.bwie.ruoyi.utils.TokenUtils; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.system.api.model.*; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** +* @author 海龙 +* @description 针对表【tb_user(用户信息表)】的数据库操作Service实现 +* @createDate 2023-01-13 14:34:44 +*/ +@Service +public class TbUserServiceImpl extends ServiceImpl + implements TbUserService{ + @Resource + private TbUserMapper tbUserMapper; + @Resource + private RedisTemplate redisTemplate; + @Override + public List getuser() { + List tbUsers = tbUserMapper.selectList(null); + List collect = tbUsers.stream().map(item -> { + TbUserVo tbUserVo = new TbUserVo(); + BeanUtils.copyProperties(item, tbUserVo); + return tbUserVo; + }).collect(Collectors.toList()); + return collect; + } + + @Override + public AjaxResult deluser(IdVo idVo) { + tbUserMapper.deleteById(idVo.getId()); + return AjaxResult.success(); + } + + @Override + public AjaxResult adduser(TbUserVo tbUserVo) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbUser::getPhonenumber,tbUserVo.getPhonenumber()); + //判断手机号 + if(tbUserMapper.selectOne(wrapper)!=null){ + return AjaxResult.error("手机号已经注册请检查手机号"); + } + //判断用户的昵称 + LambdaQueryWrapper wrapper1=new LambdaQueryWrapper<>(); + wrapper1.eq(TbUser::getNickName,tbUserVo.getNickName() ); + if(tbUserMapper.selectOne(wrapper1)!=null){ + return AjaxResult.error("用户昵称已经被注册请换一个"); + } + //加密密码 + String hashpw = BCrypt.hashpw(tbUserVo.getPassword(), BCrypt.gensalt()); + TbUser tbUser = new TbUser(); + BeanUtils.copyProperties(tbUserVo, tbUser); + //更换加密密码 + tbUser.setPassword(hashpw); + tbUserMapper.insert(tbUser); + return AjaxResult.success(tbUser); + } + + @Override + public AjaxResult phoneSend(PhoneVo phoneVo) { + //随机生成的四位数 + String nums = RandomUtil.randomNumbers(6); + //存入redis用来做登录 + redisTemplate.opsForValue().set(phoneVo.getPhone(), nums); + //向手机发送信息 + DuanxinUtils.sendDuanxin(phoneVo.getPhone(), nums); + return AjaxResult.success("验证码已经发送是:"+nums+"请注意查收"); + } + + @Override + public AjaxResult updateuser(TbUserVo tbUserVo) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbUser::getUserId,tbUserVo.getUserId()); + if(tbUserMapper.selectOne(wrapper)==null){ + return AjaxResult.error(); + } + TbUser tbUser = new TbUser(); + BeanUtils.copyProperties(tbUserVo, tbUser); + tbUserMapper.updateById(tbUser); + return AjaxResult.success("修改完成"); + } + + @Override + public AjaxResult uppassword(PassWordCode passWordCode) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbUser::getUserId,passWordCode.getUserId()); + if(tbUserMapper.selectOne(wrapper)==null){ + return AjaxResult.error("用户不存在"); + } + boolean b = BCrypt.checkpw(passWordCode.getOldPassword(), tbUserMapper.selectOne(wrapper).getPassword()); + if(!b){ + return AjaxResult.error("输入的老密码不正确请重新输入"); + } + String hashpw = BCrypt.hashpw(passWordCode.getNewPassword(), BCrypt.gensalt()); + TbUser tbUser = new TbUser(); + BeanUtils.copyProperties(tbUserMapper.selectOne(wrapper), tbUser); + tbUser.setPassword(hashpw); + return AjaxResult.success(); + } + + @Override + public AjaxResult loginuser(LoginVo loginVo) { + //第一步判断账号 + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbUser::getNickName,loginVo.getNickName()); + TbUser tbUser = tbUserMapper.selectOne(wrapper); + if(tbUser==null){ + return AjaxResult.error("账号不存在"); + } + boolean checkpw = BCrypt.checkpw(loginVo.getUserPass(), tbUser.getPassword()); + if(!checkpw){ + return AjaxResult.error("密码不正确"); + } + //判断code + String o =(String) redisTemplate.opsForValue().get(loginVo.getPhone()); + if(!loginVo.getCode().equals(o)){ + return AjaxResult.error("验证码不正确"); + } + //生成token + String token = TokenUtils.token().setKey("123456").setClaim("userId", tbUser.getUserId() + "").setClaim("nickName", tbUser.getNickName()).makeToken(); + //存入redis + redisTemplate.opsForValue().set(token, token,1, TimeUnit.MINUTES); + //返回类 + TbUserVo tbUserVo = new TbUserVo(); + BeanUtils.copyProperties(tbUser, tbUserVo); + tbUserVo.setToken(token); + tbUserVo.setPassword(null); + tbUserVo.setUserCard(null); + return AjaxResult.success(tbUserVo); + } + + +} + + + + diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/DuanxinUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/DuanxinUtils.java new file mode 100644 index 00000000..3233885b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/DuanxinUtils.java @@ -0,0 +1,46 @@ +package com.bwie.ruoyi.utils; + +import org.apache.http.HttpResponse; + +import java.util.HashMap; +import java.util.Map; + +public class DuanxinUtils { + + public static Boolean sendDuanxin(String mobile,String code){ + String host = "http://dingxin.market.alicloudapi.com"; + String path = "/dx/sendSms"; + String method = "POST"; + String appcode = "42feffa4bb0b463ab03421a67ec79e0c"; + Map headers = new HashMap(); + //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 + headers.put("Authorization", "APPCODE " + appcode); + Map querys = new HashMap(); + querys.put("mobile", mobile); + querys.put("param", "code:"+code); + querys.put("tpl_id", "TP20010711"); + Map bodys = new HashMap(); + + + try { + /** + * 重要提示如下: + * HttpUtils请从 + * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java + * 下载 + * + * 相应的依赖请参照 + * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml + */ + HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys); + System.out.println(response.toString()); + //获取response的body + //System.out.println(EntityUtils.toString(response.getEntity())); + return true; + } catch (Exception e) { + //打印异常 + e.printStackTrace(); + return false; + } + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/HttpUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/HttpUtils.java new file mode 100644 index 00000000..1b9bd7db --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/HttpUtils.java @@ -0,0 +1,311 @@ +package com.bwie.ruoyi.utils; + +import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.scheme.SchemeRegistry; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicNameValuePair; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class HttpUtils { + + /** + * get + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doGet(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpGet request = new HttpGet(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + /** + * post form + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param bodys + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + Map bodys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (bodys != null) { + List nameValuePairList = new ArrayList(); + + for (String key : bodys.keySet()) { + nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); + } + UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); + formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); + request.setEntity(formEntity); + } + + return httpClient.execute(request); + } + + /** + * Post String + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Post stream + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Put String + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Put stream + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Delete + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doDelete(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { + StringBuilder sbUrl = new StringBuilder(); + sbUrl.append(host); + if (!StringUtils.isBlank(path)) { + sbUrl.append(path); + } + if (null != querys) { + StringBuilder sbQuery = new StringBuilder(); + for (Map.Entry query : querys.entrySet()) { + if (0 < sbQuery.length()) { + sbQuery.append("&"); + } + if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { + sbQuery.append(query.getValue()); + } + if (!StringUtils.isBlank(query.getKey())) { + sbQuery.append(query.getKey()); + if (!StringUtils.isBlank(query.getValue())) { + sbQuery.append("="); + sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); + } + } + } + if (0 < sbQuery.length()) { + sbUrl.append("?").append(sbQuery); + } + } + + return sbUrl.toString(); + } + + private static HttpClient wrapClient(String host) { + HttpClient httpClient = new DefaultHttpClient(); + if (host.startsWith("https://")) { + sslClient(httpClient); + } + + return httpClient; + } + + private static void sslClient(HttpClient httpClient) { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); + X509TrustManager tm = new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted(X509Certificate[] xcs, String str) { + + } + public void checkServerTrusted(X509Certificate[] xcs, String str) { + + } + }; + ctx.init(null, new TrustManager[] { tm }, null); + SSLSocketFactory ssf = new SSLSocketFactory(ctx); + ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + ClientConnectionManager ccm = httpClient.getConnectionManager(); + SchemeRegistry registry = ccm.getSchemeRegistry(); + registry.register(new Scheme("https", 443, ssf)); + } catch (KeyManagementException ex) { + throw new RuntimeException(ex); + } catch (NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/TokenUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/TokenUtils.java new file mode 100644 index 00000000..5b43a79f --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/ruoyi/utils/TokenUtils.java @@ -0,0 +1,178 @@ +package com.bwie.ruoyi.utils; + +import io.jsonwebtoken.*; + +import java.util.ArrayList; +import java.util.Date; + +public class TokenUtils { + + public static int SUCCESS = 0; + public static int ERROR_SIGN = 1; + public static int ERROR_EXPIRE = 2; + public static int ERROR = 3; + + private String key = "123456"; + private Integer expireTime = 60; + private Claims claims = null; + JwtBuilder builder = null; + + public TokenUtils() { + builder = Jwts.builder(); + } + + public static TokenUtils token() { + return new TokenUtils(); + } + + public TokenUtils setKey(String key) { + this.key = key; + return this; + } + + public TokenUtils setExpire(Integer seconds) { + this.expireTime = seconds; + + // 设置签发日期 + builder.setIssuedAt(new Date()); + // 设置过期时间 + long now = System.currentTimeMillis(); + long exp = now+1000*expireTime; + builder.setExpiration( new Date( exp ) ); + + return this; + } + + public TokenUtils setClaim(String key, String value) { + builder.claim( key, value ); + return this; + } + + /** + * @description 生成最终token + * @author 军哥 + * @date 2022/6/22 15:44 + * @version 1.0 + */ + public String makeToken() { + // 设置签名 使用HS256算法,并设置SecretKey(字符串) + builder.signWith(SignatureAlgorithm.HS256,key); + + // 生成token + String token = builder.compact(); + + return token; + } + + + /** + * @description 存放多个Key-Value数据 + * @author 军哥 + * @date 2022/6/22 15:47 + * @version 1.0 + */ + public TokenUtils putKeyValues(String... keyValues) { + if(keyValues.length > 0) { + // 添加数据 + ArrayList stringPair = new ArrayList<>(); + for(String kv:keyValues) { + // 添加键值对 + stringPair.add(kv); + // + if(stringPair.size()>=2) { + builder.claim( stringPair.get(0),stringPair.get(1) ); + stringPair.clear(); + continue; + } + } + } + + return this; + } + + /** + * @description 添加键值对数据,然后生成token + * @author 军哥 + * @date 2022/6/22 15:45 + * @version 1.0 + */ + public String createToken(String... keyValues) { + + // 存放数据 + if(keyValues.length > 0) { + // 添加数据 + ArrayList stringPair = new ArrayList<>(); + for(String kv:keyValues) { + // 添加键值对 + stringPair.add(kv); + // + if(stringPair.size()>=2) { + builder.claim( stringPair.get(0),stringPair.get(1) ); + stringPair.clear(); + continue; + } + } + } + + // + // 设置签名 使用HS256算法,并设置SecretKey(字符串) + builder.signWith(SignatureAlgorithm.HS256,key); + + // 生成token + String token = builder.compact(); + + return token; + } + + public int parseToken(String token) { + try { + claims = Jwts.parser() + .setSigningKey(key) + .parseClaimsJws(token) + .getBody(); + return TokenUtils.SUCCESS; + } + catch (ExpiredJwtException e) { + System.out.println("token expired"); + claims = e.getClaims(); + return TokenUtils.ERROR_EXPIRE; + } catch (SignatureException e) { + System.out.println("token signature error"); + return TokenUtils.ERROR_SIGN; + } catch (Exception e) { + System.out.println("token error"); + return TokenUtils.ERROR; + } + } + + public String getClaim(String key) { + if(claims == null) { + return null; + } + + String value = (String)claims.get(key); + + return value; + } + + /** + * @description 测试工具类 + * @author 军哥 + * @date 2022/6/22 15:49 + * @version 1.0 + */ + public static void main(String[] args) { + String token = TokenUtils.token() + // 设置加密密码 + .setKey("123456") + // 设置过期时间 + .setExpire(60 * 30) + // 添加数据 + .setClaim("id", "" + 666) + .setClaim("userName", "zhaoyun") + .putKeyValues("role", "admin", "permissions", "select,delete,insert") + // 生成token + .makeToken(); + System.out.println("token="+token); + } +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-user/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..d0eb132c --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9302 + +# Spring +spring: + application: + # 应用名称 + name: ruoyi-user + 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} diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-user/src/main/resources/logback.xml new file mode 100644 index 00000000..0154e288 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbPermMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbPermMapper.xml new file mode 100644 index 00000000..5a3a0096 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbPermMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + perm_id,perm_name,perm_code, + deleted,create_time,update_time + + diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRoleMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRoleMapper.xml new file mode 100644 index 00000000..b59b2c7f --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRoleMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + role_id,role_name,deleted, + create_time,update_time + + diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRolePermMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRolePermMapper.xml new file mode 100644 index 00000000..2a5d1614 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbRolePermMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + role_perm_id,role_id,perm_id, + deleted,create_time,update_time + + diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserBankcardMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserBankcardMapper.xml new file mode 100644 index 00000000..d63cb616 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserBankcardMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + bankcard_id,brankcard_name,user_id, + bankcard_money,create_by,create_time, + del_flag,update_by,update_time + + diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserMapper.xml new file mode 100644 index 00000000..c7ac2290 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + user_id,user_name,nick_name, + email,phonenumber,age, + sex,avatar,user_card, + password,status,del_flag, + login_ip,login_date,create_by, + create_time,update_by,user_price, + update_time,remark,realname_state, + honor_integral + + diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserRoleMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserRoleMapper.xml new file mode 100644 index 00000000..fd2a8128 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserRoleMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + user_role_id,user_role_name,create_by, + create_time,update_by,update_time, + role_function + + From 78c6cd676b671df62ebdb24b74186dcbb4f346a9 Mon Sep 17 00:00:00 2001 From: muzi <2098333240@qq.com> Date: Sun, 15 Jan 2023 00:05:59 +0800 Subject: [PATCH 04/14] CRUD --- .../auth/controller/TokenController.java | 1 + .../common/security/service/TokenService.java | 1 + ruoyi-common/ruoyi-common-swagger/pom.xml | 7 + .../swagger/config/Knife4jConfiguration.java | 44 ++ .../config/SwaggerWebConfiguration.java | 2 + ruoyi-gateway/pom.xml | 13 + .../ruoyi/gateway/config/SwaggerProvider.java | 2 + .../src/main/resources/bootstrap.yml | 2 +- .../controller/BorrowerController.java | 18 +- .../controller/BorrowerPeriodsController.java | 7 +- .../controller/BorrowerPlanController.java | 11 +- ruoyi-ui/src/api/potenza/borrower.js | 39 ++ ruoyi-ui/src/api/potenza/periods.js | 44 ++ ruoyi-ui/src/api/potenza/plan.js | 44 ++ ruoyi-ui/src/views/login.vue | 50 +-- ruoyi-ui/src/views/potenza/classes/index.vue | 286 +++++++++++++ ruoyi-ui/src/views/potenza/periods/index.vue | 210 ++++++++++ ruoyi-ui/src/views/potenza/plan/index.vue | 379 ++++++++++++++++++ 18 files changed, 1108 insertions(+), 52 deletions(-) create mode 100644 ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/Knife4jConfiguration.java create mode 100644 ruoyi-ui/src/api/potenza/borrower.js create mode 100644 ruoyi-ui/src/api/potenza/periods.js create mode 100644 ruoyi-ui/src/api/potenza/plan.js create mode 100644 ruoyi-ui/src/views/potenza/classes/index.vue create mode 100644 ruoyi-ui/src/views/potenza/periods/index.vue create mode 100644 ruoyi-ui/src/views/potenza/plan/index.vue diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java index 3b93514e..24a3de30 100644 --- a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java @@ -36,6 +36,7 @@ public class TokenController { // 用户登录 LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword()); + // 获取登录token return R.ok(tokenService.createToken(userInfo)); } diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java index b3093c9c..d7ebfe81 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java @@ -62,6 +62,7 @@ public class TokenService Map rspMap = new HashMap(); rspMap.put("access_token", JwtUtils.createToken(claimsMap)); rspMap.put("expires_in", expireTime); + System.err.println(rspMap); return rspMap; } diff --git a/ruoyi-common/ruoyi-common-swagger/pom.xml b/ruoyi-common/ruoyi-common-swagger/pom.xml index c301179f..efef7279 100644 --- a/ruoyi-common/ruoyi-common-swagger/pom.xml +++ b/ruoyi-common/ruoyi-common-swagger/pom.xml @@ -23,6 +23,13 @@ spring-boot-starter-web + + + com.github.xiaoymin + knife4j-spring-boot-starter + 2.0.7 + + io.springfox diff --git a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/Knife4jConfiguration.java b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/Knife4jConfiguration.java new file mode 100644 index 00000000..0cd20ed1 --- /dev/null +++ b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/Knife4jConfiguration.java @@ -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(); + } +} diff --git a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java index 424e8c3c..9d61c354 100644 --- a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java +++ b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java @@ -1,6 +1,7 @@ package com.ruoyi.common.swagger.config; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -10,6 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; * @author ruoyi */ @Configuration +@Primary public class SwaggerWebConfiguration implements WebMvcConfigurer { @Override diff --git a/ruoyi-gateway/pom.xml b/ruoyi-gateway/pom.xml index b2f6649d..01f5285a 100644 --- a/ruoyi-gateway/pom.xml +++ b/ruoyi-gateway/pom.xml @@ -16,6 +16,19 @@ + + + com.github.xiaoymin + knife4j-spring-boot-starter + 2.0.7 + + + + com.github.xiaoymin + knife4j-spring-ui + 2.0.7 + + org.springframework.cloud diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java index 72667305..1bfcc733 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java @@ -7,6 +7,7 @@ import org.springframework.cloud.gateway.config.GatewayProperties; import org.springframework.cloud.gateway.route.RouteLocator; import org.springframework.cloud.gateway.support.NameUtils; import org.springframework.context.annotation.Lazy; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; @@ -19,6 +20,7 @@ import springfox.documentation.swagger.web.SwaggerResourcesProvider; * @author ruoyi */ @Component +@Primary public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer { /** diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml index f45744cc..4092e5ee 100644 --- a/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9301 + port: 9401 # Spring spring: diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java index 860685d2..633d59bd 100644 --- a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java @@ -30,7 +30,7 @@ import com.ruoyi.common.core.utils.poi.ExcelUtil; * @description: TODO * @date 2023/1/13 16:00 */ -@RequestMapping("/Borrower") +@RequestMapping("/borrower") @RestController @Slf4j public class BorrowerController extends BaseController { @@ -57,7 +57,7 @@ public class BorrowerController extends BaseController { return tbBorrowerService.borrowerDele(idVo); } - @RequiresPermissions("potenza:borrower:list") + @GetMapping("/list") public TableDataInfo list(TbBorrower tbBorrower) { @@ -69,7 +69,7 @@ public class BorrowerController extends BaseController { /** * 导出贷款列表 */ - @RequiresPermissions("potenza:borrower:export") + @Log(title = "贷款", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TbBorrower tbBorrower) @@ -82,8 +82,8 @@ public class BorrowerController extends BaseController { /** * 获取贷款详细信息 */ - @RequiresPermissions("potenza:borrower:query") - @GetMapping(value = "/{borrowerId}") + + @GetMapping(value = "/{borrowerById}") public AjaxResult getInfo(@PathVariable("borrowerId") Long borrowerId) { return success(tbBorrowerService.selectTbBorrowerByBorrowerId(borrowerId)); @@ -92,9 +92,9 @@ public class BorrowerController extends BaseController { /** * 新增贷款 */ - @RequiresPermissions("potenza:borrower:add") + @Log(title = "贷款", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("/borrowerInsert") public AjaxResult add(@RequestBody TbBorrower tbBorrower) { return toAjax(tbBorrowerService.insertTbBorrower(tbBorrower)); @@ -103,9 +103,9 @@ public class BorrowerController extends BaseController { /** * 修改贷款 */ - @RequiresPermissions("potenza:borrower:edit") + @Log(title = "贷款", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("/borrowerUpdate") public AjaxResult edit(@RequestBody TbBorrower tbBorrower) { return toAjax(tbBorrowerService.updateTbBorrower(tbBorrower)); diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java index 2089a3f1..7925c981 100644 --- a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java @@ -52,7 +52,6 @@ public class BorrowerPeriodsController extends BaseController{ /** * 导出贷款周期列表 */ - @RequiresPermissions("potenza:periods:export") @Log(title = "贷款周期", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TbBorrowerPeriods tbBorrowerPeriods) @@ -66,7 +65,7 @@ public class BorrowerPeriodsController extends BaseController{ * 获取贷款周期详细信息 */ @RequiresPermissions("potenza:periods:query") - @GetMapping(value = "/{periodsId}") + @GetMapping(value = "/{periodsById}") public AjaxResult getInfo(@PathVariable("periodsId") Long periodsId) { return success(tbBorrowerPeriodsService.selectTbBorrowerPeriodsByPeriodsId(periodsId)); @@ -77,7 +76,7 @@ public class BorrowerPeriodsController extends BaseController{ */ @RequiresPermissions("potenza:periods:add") @Log(title = "贷款周期", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("periodsInsert") public AjaxResult add(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) { return toAjax(tbBorrowerPeriodsService.insertTbBorrowerPeriods(tbBorrowerPeriods)); @@ -88,7 +87,7 @@ public class BorrowerPeriodsController extends BaseController{ */ @RequiresPermissions("potenza:periods:edit") @Log(title = "贷款周期", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("/periodsUpdate") public AjaxResult edit(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) { return toAjax(tbBorrowerPeriodsService.updateTbBorrowerPeriods(tbBorrowerPeriods)); diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java index e139655a..248ce36c 100644 --- a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java @@ -52,7 +52,6 @@ public class BorrowerPlanController extends BaseController{ /** * 导出计划列表 */ - @RequiresPermissions("potenza:plan:export") @Log(title = "计划", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TbBorrowerPlan tbBorrowerPlan) @@ -65,8 +64,7 @@ public class BorrowerPlanController extends BaseController{ /** * 获取计划详细信息 */ - @RequiresPermissions("potenza:plan:query") - @GetMapping(value = "/{planId}") + @GetMapping(value = "/{planById}") public AjaxResult getInfo(@PathVariable("planId") Long planId) { return success(tbBorrowerPlanService.selectTbBorrowerPlanByPlanId(planId)); @@ -75,9 +73,8 @@ public class BorrowerPlanController extends BaseController{ /** * 新增计划 */ - @RequiresPermissions("potenza:plan:add") @Log(title = "计划", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("planInsert") public AjaxResult add(@RequestBody TbBorrowerPlan tbBorrowerPlan) { return toAjax(tbBorrowerPlanService.insertTbBorrowerPlan(tbBorrowerPlan)); @@ -86,9 +83,8 @@ public class BorrowerPlanController extends BaseController{ /** * 修改计划 */ - @RequiresPermissions("potenza:plan:edit") @Log(title = "计划", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("planUpdate") public AjaxResult edit(@RequestBody TbBorrowerPlan tbBorrowerPlan) { return toAjax(tbBorrowerPlanService.updateTbBorrowerPlan(tbBorrowerPlan)); @@ -97,7 +93,6 @@ public class BorrowerPlanController extends BaseController{ /** * 删除计划 */ - @RequiresPermissions("potenza:plan:remove") @Log(title = "计划", businessType = BusinessType.DELETE) @DeleteMapping("/{planIds}") public AjaxResult remove(@PathVariable Long[] planIds) diff --git a/ruoyi-ui/src/api/potenza/borrower.js b/ruoyi-ui/src/api/potenza/borrower.js new file mode 100644 index 00000000..d0ef6cb1 --- /dev/null +++ b/ruoyi-ui/src/api/potenza/borrower.js @@ -0,0 +1,39 @@ +import request from '@/utils/request' + +// 查询贷款列表 +export function listBorrower(query) { + return request({ + url: '/potenza/borrower/list', + method: 'get', + params: query + }) +} + +// 查询贷款详细 +export function getBorrower(borrowerId) { + return request({ + url: '/potenza/borrower/borrowerById/' + borrowerId, + method: 'get' + }) +} + +// 新增贷款 +export function addBorrower(data) { + return request({ + url: '/potenza/borrower/borrowerInsert', + method: 'post', + data: data + }) +} + +// 修改贷款 +export function updateBorrower(data) { + return request({ + url: '/potenza/borrower/borrowerUpdate', + method: 'put', + data: data + }) +} + + + diff --git a/ruoyi-ui/src/api/potenza/periods.js b/ruoyi-ui/src/api/potenza/periods.js new file mode 100644 index 00000000..2367da67 --- /dev/null +++ b/ruoyi-ui/src/api/potenza/periods.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询贷款周期列表 +export function listPeriods(query) { + return request({ + url: '/potenza/periods/list', + method: 'get', + params: query + }) +} + +// 查询贷款周期详细 +export function getPeriods(periodsId) { + return request({ + url: '/potenza/periods/periodsById/' + periodsId, + method: 'get' + }) +} + +// 新增贷款周期 +export function addPeriods(data) { + return request({ + url: '/potenza/periods/periodsInsert', + method: 'post', + data: data + }) +} + +// 修改贷款周期 +export function updatePeriods(data) { + return request({ + url: '/potenza/periods/periodsUpdate', + method: 'put', + data: data + }) +} + +// 删除贷款周期 +export function delPeriods(periodsId) { + return request({ + url: '/potenza/periods/' + periodsId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/potenza/plan.js b/ruoyi-ui/src/api/potenza/plan.js new file mode 100644 index 00000000..dc129d60 --- /dev/null +++ b/ruoyi-ui/src/api/potenza/plan.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询计划列表 +export function listPlan(query) { + return request({ + url: '/potenza/plan/list', + method: 'get', + params: query + }) +} + +// 查询计划详细 +export function getPlan(planId) { + return request({ + url: '/potenza/plan/planById' + planId, + method: 'get' + }) +} + +// 新增计划 +export function addPlan(data) { + return request({ + url: '/potenza/plan/planInsert', + method: 'post', + data: data + }) +} + +// 修改计划 +export function updatePlan(data) { + return request({ + url: '/potenza/plan/planUpdate', + method: 'put', + data: data + }) +} + +// 删除计划 +export function delPlan(planId) { + return request({ + url: '/potenza/plan/planIds/' + planId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 074fecd3..0687e4f0 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -3,49 +3,29 @@