diff --git a/pom.xml b/pom.xml index b613ba96..d06fbe47 100644 --- a/pom.xml +++ b/pom.xml @@ -216,6 +216,7 @@ ruoyi-modules ruoyi-api ruoyi-common + ruoyi-modules/ruoyi-invest pom 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..448b9089 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/PhoneVo.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.api.model; + +import com.ruoyi.common.core.web.domain.BaseEntity; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 苏海龙 + * @version 1.0 + * @description: TODO + * @date 2023/1/11 8:18 + */ + +@Data +public class PhoneVo extends BaseEntity { + private String phone; + private String code; +} 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..f271df0d --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TbUserVo.java @@ -0,0 +1,133 @@ +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 Long userId; + private String token; + + /** + * 用户账号 + */ + private String userName; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 用户邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 年龄 + */ + private Integer age; + + /** + * 用户性别(0男 1女 2未知) + */ + private Integer sex; + + /** + * 头像地址 + */ + private String avatar; + + /** + * 身份证(只有管理员能看到) + */ + private String userCard; + + /** + * 密码 + */ + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer 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 Integer realnameState; + + /** + * 信誉积分 + */ + private Integer honorIntegral; + +} 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-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index f456b03c..6cd0792f 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9200 + port: 9100 # Spring spring: diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml index 15929377..6404630d 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-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 139ee8b5..d9b48d22 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 f48b9d99..03e9fb6f 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 28556b5e..5a344be0 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 @@ -8,6 +8,8 @@ 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 f4a60375..f8da6fdc 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/pom.xml b/ruoyi-modules/pom.xml index dd18137e..c732e690 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -13,6 +13,9 @@ ruoyi-gen ruoyi-job ruoyi-file + ruoyi-potenza + ruoyi-user + ruoyi-product ruoyi-modules 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-modules/ruoyi-potenza/pom.xml b/ruoyi-modules/ruoyi-potenza/pom.xml new file mode 100644 index 00000000..17cc7352 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/pom.xml @@ -0,0 +1,111 @@ + + + + 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..850cbb62 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerController.java @@ -0,0 +1,140 @@ +package com.ruoyi.potenza.controller; + +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.potenza.domain.TbBorrower; +import com.ruoyi.potenza.domain.vo.IdVo; +import com.ruoyi.potenza.service.TbBorrowerService; +import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils; +import com.ruoyi.potenza.utils.AverageCapitalUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.utils.poi.ExcelUtil; + + +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/13 16:00 + */ +@RequestMapping("/borrower") +@RestController +@Slf4j +public class BorrowerController extends BaseController { + + @Autowired + private TbBorrowerService tbBorrowerService; + + @PostMapping("/pageList") + public TableDataInfo pageList(@RequestBody TbBorrower tbBorrower){ + startPage(); + return getDataTable(tbBorrowerService.pageList(tbBorrower)); + } + + //贷款申请 + @PostMapping("/save") + public AjaxResult save(@RequestBody TbBorrower tbBorrower){ + boolean save = tbBorrowerService.save(tbBorrower); + return AjaxResult.success(save); + } + + //逻辑删除 + @PostMapping("/BorrowerDele") + public AjaxResult save(@RequestBody IdVo idVo){ + return tbBorrowerService.borrowerDele(idVo); + } + + + @GetMapping("/list") + public TableDataInfo list(TbBorrower tbBorrower) + { + startPage(); + List list = tbBorrowerService.selectTbBorrowerList(tbBorrower); + return getDataTable(list); + } + + /** + * 导出贷款列表 + */ + + @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, "贷款数据"); + } + + /** + * 获取贷款详细信息 + */ + + @GetMapping(value = "/{borrowerById}") + public AjaxResult getInfo(@PathVariable("borrowerId") Long borrowerId) + { + return success(tbBorrowerService.selectTbBorrowerByBorrowerId(borrowerId)); + } + + /** + * 新增贷款 + */ + + @Log(title = "贷款", businessType = BusinessType.INSERT) + @PostMapping("/borrowerInsert") + public AjaxResult add(@RequestBody TbBorrower tbBorrower) + { + return toAjax(tbBorrowerService.insertTbBorrower(tbBorrower)); + } + + /** + * 修改贷款 + */ + + @Log(title = "贷款", businessType = BusinessType.UPDATE) + @PutMapping("/borrowerUpdate") + public AjaxResult edit(@RequestBody TbBorrower tbBorrower) + { + return toAjax(tbBorrowerService.updateTbBorrower(tbBorrower)); + } + + @PostMapping("/borrowerInserts") + public AjaxResult borrowerInserts(@RequestBody TbBorrower tbBorrower) + { + return toAjax(tbBorrowerService.borrowerInserts(tbBorrower)); + } + + + @PostMapping("/loans") + public AjaxResult loans(@RequestBody TbBorrower tbBorrower) + { + return tbBorrowerService.loans(tbBorrower); + } + + @PostMapping("ttt") + public void ttt(){ + AverageCapitalUtils.main(); + AverageCapitalPlusInterestUtils.main(); + } + + + + + + +} 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..3602e258 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPeriodsController.java @@ -0,0 +1,111 @@ +package com.ruoyi.potenza.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.potenza.domain.vo.PeriodDetailVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.potenza.domain.TbBorrowerPeriods; +import com.ruoyi.potenza.service.TbBorrowerPeriodsService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/13 16:00 + */ +@RequestMapping("periods") +@RestController +@Slf4j +public class BorrowerPeriodsController extends BaseController{ + @Autowired + private TbBorrowerPeriodsService tbBorrowerPeriodsService; + + /** + * 查询贷款周期列表 + */ + @RequiresPermissions("potenza:periods:list") + @GetMapping("/list") + public TableDataInfo list(TbBorrowerPeriods tbBorrowerPeriods) + { + startPage(); + List list = tbBorrowerPeriodsService.selectTbBorrowerPeriodsList(tbBorrowerPeriods); + return getDataTable(list); + } + + /** + * 导出贷款周期列表 + */ + @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, "贷款周期数据"); + } + + /** + * 获取贷款周期详细信息 + */ + @GetMapping(value = "/{periodsById}") + public AjaxResult getInfo(@PathVariable("periodsId") Long periodsId) + { + return success(tbBorrowerPeriodsService.selectTbBorrowerPeriodsByPeriodsId(periodsId)); + } + + /** + * 新增贷款周期 + */ + @Log(title = "贷款周期", businessType = BusinessType.INSERT) + @PostMapping("periodsInsert") + public AjaxResult add(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) + { + return toAjax(tbBorrowerPeriodsService.insertTbBorrowerPeriods(tbBorrowerPeriods)); + } + + /** + * 修改贷款周期 + */ + @Log(title = "贷款周期", businessType = BusinessType.UPDATE) + @PutMapping("/periodsUpdate") + public AjaxResult edit(@RequestBody TbBorrowerPeriods tbBorrowerPeriods) + { + return toAjax(tbBorrowerPeriodsService.updateTbBorrowerPeriods(tbBorrowerPeriods)); + } + + /** + * 删除贷款周期 + */ + @Log(title = "贷款周期", businessType = BusinessType.DELETE) + @DeleteMapping("/{periodsIds}") + public AjaxResult remove(@PathVariable Long[] periodsIds) + { + return toAjax(tbBorrowerPeriodsService.deleteTbBorrowerPeriodsByPeriodsIds(periodsIds)); + } + + + @Log(title = "周期详细", businessType = BusinessType.UPDATE) + @PostMapping("/detail") + public AjaxResult detail(@RequestBody PeriodDetailVo periodDetailVo) + { + return tbBorrowerPeriodsService.detail(periodDetailVo); + } +} 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..248ce36c --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/controller/BorrowerPlanController.java @@ -0,0 +1,102 @@ +package com.ruoyi.potenza.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.potenza.domain.TbBorrowerPlan; +import com.ruoyi.potenza.service.TbBorrowerPlanService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/13 16:01 + */ +@RequestMapping("plan") +@RestController +@Slf4j +public class BorrowerPlanController extends BaseController{ + + @Autowired + private TbBorrowerPlanService tbBorrowerPlanService; + + /** + * 查询计划列表 + */ + @RequiresPermissions("potenza:plan:list") + @GetMapping("/list") + public TableDataInfo list(TbBorrowerPlan tbBorrowerPlan) + { + startPage(); + List list = tbBorrowerPlanService.selectTbBorrowerPlanList(tbBorrowerPlan); + return getDataTable(list); + } + + /** + * 导出计划列表 + */ + @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, "计划数据"); + } + + /** + * 获取计划详细信息 + */ + @GetMapping(value = "/{planById}") + public AjaxResult getInfo(@PathVariable("planId") Long planId) + { + return success(tbBorrowerPlanService.selectTbBorrowerPlanByPlanId(planId)); + } + + /** + * 新增计划 + */ + @Log(title = "计划", businessType = BusinessType.INSERT) + @PostMapping("planInsert") + public AjaxResult add(@RequestBody TbBorrowerPlan tbBorrowerPlan) + { + return toAjax(tbBorrowerPlanService.insertTbBorrowerPlan(tbBorrowerPlan)); + } + + /** + * 修改计划 + */ + @Log(title = "计划", businessType = BusinessType.UPDATE) + @PutMapping("planUpdate") + public AjaxResult edit(@RequestBody TbBorrowerPlan tbBorrowerPlan) + { + return toAjax(tbBorrowerPlanService.updateTbBorrowerPlan(tbBorrowerPlan)); + } + + /** + * 删除计划 + */ + @Log(title = "计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{planIds}") + public AjaxResult remove(@PathVariable Long[] planIds) + { + return toAjax(tbBorrowerPlanService.deleteTbBorrowerPlanByPlanIds(planIds)); + } +} 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..d3387ce5 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/TbBorrowerPeriods.java @@ -0,0 +1,58 @@ +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; + + private Double rateInterest; + + /** + * 删除状态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/domain/vo/PeriodDetailVo.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/PeriodDetailVo.java new file mode 100644 index 00000000..da289bc5 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/PeriodDetailVo.java @@ -0,0 +1,20 @@ +package com.ruoyi.potenza.domain.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/15 20:39 + */ +@Data +public class PeriodDetailVo implements Serializable { + private Double borrowerMoney; + + private Integer wayId; + + private Integer periodsId; +} diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/TbBorrowerVo.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/TbBorrowerVo.java new file mode 100644 index 00000000..9abbee05 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/domain/vo/TbBorrowerVo.java @@ -0,0 +1,94 @@ +package com.ruoyi.potenza.domain.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/15 19:26 + */ +@Data +public class TbBorrowerVo implements Serializable { + + 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; + + + +} 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..9c1dcec0 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerPeriodsService.java @@ -0,0 +1,65 @@ +package com.ruoyi.potenza.service; + +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.potenza.domain.TbBorrowerPeriods; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.potenza.domain.vo.PeriodDetailVo; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service +* @createDate 2023-01-13 15:56:37 +*/ +public interface TbBorrowerPeriodsService extends IService { + /** + * 查询贷款周期 + * + * @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); + + AjaxResult detail(PeriodDetailVo periodDetailVo); +} 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..567c0789 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/TbBorrowerService.java @@ -0,0 +1,57 @@ +package com.ruoyi.potenza.service; + +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.potenza.domain.TbBorrower; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.potenza.domain.vo.IdVo; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower(贷款表)】的数据库操作Service +* @createDate 2023-01-13 15:56:37 +*/ +public interface TbBorrowerService extends IService { + + 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); + + + int borrowerInserts(TbBorrower tbBorrower); + + AjaxResult loans(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..25951d9d --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPeriodsServiceImpl.java @@ -0,0 +1,139 @@ +package com.ruoyi.potenza.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.potenza.domain.TbBorrowerPeriods; +import com.ruoyi.potenza.domain.vo.PeriodDetailVo; +import com.ruoyi.potenza.service.TbBorrowerPeriodsService; +import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper; +import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils; +import com.ruoyi.potenza.utils.AverageCapitalUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * @author 86155 + * @description 针对表【tb_borrower_periods(贷款周期表)】的数据库操作Service实现 + * @createDate 2023-01-13 15:56:37 + */ +@Service +public class TbBorrowerPeriodsServiceImpl extends ServiceImpl + 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); + } + + @Override + public AjaxResult detail(PeriodDetailVo periodDetailVo) { + + //查询利率 + Integer periodsId = periodDetailVo.getPeriodsId(); + long periodsid = periodsId.longValue(); + TbBorrowerPeriods tbBorrowerPeriods = tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsByPeriodsId(periodsid); + if(tbBorrowerPeriods==null){ + return AjaxResult.error(); + } + Integer wayId = periodDetailVo.getWayId(); + //等额本息 + if(wayId==0){ + double principalInterestCount = AverageCapitalPlusInterestUtils. + getPrincipalInterestCount(periodDetailVo.getBorrowerMoney(), + tbBorrowerPeriods.getRateInterest()/100, + tbBorrowerPeriods.getPeriodsName()); + return AjaxResult.success(principalInterestCount); + } + //等额本金 +// double principalInterestCount = AverageCapitalUtils. +// getPrincipalInterestCount(periodDetailVo.getBorrowerMoney(), +// tbBorrowerPeriods.getRateInterest()/100, +// tbBorrowerPeriods.getPeriodsName()); +// return AjaxResult.success(principalInterestCount); + + return AjaxResult.error(); + } + +} + + + + 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..bac30c97 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerPlanServiceImpl.java @@ -0,0 +1,103 @@ +package com.ruoyi.potenza.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.potenza.domain.TbBorrowerPlan; +import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper; +import com.ruoyi.potenza.service.TbBorrowerPlanService; +import com.ruoyi.potenza.mapper.TbBorrowerPlanMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower_plan(计划表)】的数据库操作Service实现 +* @createDate 2023-01-13 15:56:37 +*/ +@Service +public class TbBorrowerPlanServiceImpl extends ServiceImpl + 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..3651ce77 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/service/impl/TbBorrowerServiceImpl.java @@ -0,0 +1,138 @@ +package com.ruoyi.potenza.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.potenza.domain.TbBorrower; +import com.ruoyi.potenza.domain.TbBorrowerPeriods; +import com.ruoyi.potenza.domain.vo.IdVo; +import com.ruoyi.potenza.domain.vo.TbBorrowerVo; +import com.ruoyi.potenza.mapper.TbBorrowerPeriodsMapper; +import com.ruoyi.potenza.service.TbBorrowerService; +import com.ruoyi.potenza.mapper.TbBorrowerMapper; +import com.ruoyi.potenza.utils.AverageCapitalPlusInterestUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 86155 +* @description 针对表【tb_borrower(贷款表)】的数据库操作Service实现 +* @createDate 2023-01-13 15:56:37 +*/ +@Service +@Slf4j +public class TbBorrowerServiceImpl extends ServiceImpl + implements TbBorrowerService{ + + @Autowired + private TbBorrowerMapper tbBorrowerMapper; + + @Autowired + private TbBorrowerPeriodsMapper tbBorrowerPeriodsMapper; + + @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("删除成功"); + } + + @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); + } + + @Override + public int borrowerInserts(TbBorrower tbBorrower) { + return 0; + } + + @Override + public AjaxResult loans(TbBorrower tbBorrower) { + + //判断 用户 能否借款 + + + //判断同一个人 只能借一个产品 + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbBorrower::getUserId,tbBorrower.getUserId()); + wrapper.eq(TbBorrower::getProductId,tbBorrower.getProductId()); + TbBorrower tbBorrower1 = tbBorrowerMapper.selectOne(wrapper); + if(tbBorrower1!=null){ + return AjaxResult.error("请先还款"); + } + Integer periodsId = tbBorrower.getPeriodsId(); + long periodsid = periodsId.longValue(); + //查询利率 + TbBorrowerPeriods tbBorrowerPeriods = tbBorrowerPeriodsMapper.selectTbBorrowerPeriodsByPeriodsId(periodsid); + +// double perMonthPrincipalInterest = AverageCapitalPlusInterestUtils. +// getPerMonthPrincipalInterest(tbBorrower.getBorrowerMoney(), +// tbBorrowerPeriods.getRateInterest()/100, +// tbBorrowerPeriods.getPeriodsName()); + + + double principalInterestCount = AverageCapitalPlusInterestUtils. + getPrincipalInterestCount(tbBorrower.getBorrowerMoney(), + tbBorrowerPeriods.getRateInterest() / 100, + tbBorrowerPeriods.getPeriodsName()); + + log.info("---------"+principalInterestCount); + return AjaxResult.success("添加成功"); + } + + +} + + + + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalPlusInterestUtils.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalPlusInterestUtils.java new file mode 100644 index 00000000..abb53f92 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalPlusInterestUtils.java @@ -0,0 +1,285 @@ +package com.ruoyi.potenza.utils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +/** + + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + + * @description: TODO + * @author 木子 + * @date 2023/1/15 19:17 + * @version 1.0 + */ +public class AverageCapitalPlusInterestUtils { +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还本金和利息 +// *

+// * 公式:每月偿还本息=〔贷款本金×月利率×(1+月利率)^还款月数〕÷〔(1+月利率)^还款月数-1〕 +// * +// * @param invest 总借款额(贷款本金) +// * @param yearRate 年利率 +// * @param month 还款总月数 +// * @return 每月偿还本金和利息, 不四舍五入,直接截取小数点最后两位 +// */ +// public static double getPerMonthPrincipalInterest(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal monthIncome = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); +// return monthIncome.doubleValue(); +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还利息 +// *

+// * 公式:每月偿还利息=贷款本金×月利率×〔(1+月利率)^还款月数-(1+月利率)^(还款月序号-1)〕÷〔(1+月利率)^还款月数-1〕 +// * +// * @param invest 总借款额(贷款本金) +// * @param yearRate 年利率 +// * @param month 还款总月数 +// * @return 每月偿还利息 +// */ +// public static Map getPerMonthInterest(double invest, double yearRate, int totalmonth) { +// Map map = new HashMap(); +// double monthRate = yearRate / 12; +// BigDecimal monthInterest; +// for (int i = 1; i < totalmonth + 1; i++) { +// BigDecimal multiply = new BigDecimal(invest).multiply(new BigDecimal(monthRate)); +// BigDecimal sub = new BigDecimal(Math.pow(1 + monthRate, totalmonth)).subtract(new BigDecimal(Math.pow(1 + monthRate, i - 1))); +// monthInterest = multiply.multiply(sub).divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 6, BigDecimal.ROUND_DOWN); +// monthInterest = monthInterest.setScale(2, BigDecimal.ROUND_DOWN); +// map.put(i, monthInterest); +// } +// return map; +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还本金 +// * +// * @param invest 总借款额(贷款本金) +// * @param yearRate 年利率 +// * @param month 还款总月数 +// * @return 每月偿还本金 +// */ +// public static Map getPerMonthPrincipal(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal monthIncome = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); +// Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); +// Map mapPrincipal = new HashMap(); +// +// for (Map.Entry entry : mapInterest.entrySet()) { +// mapPrincipal.put(entry.getKey(), monthIncome.subtract(entry.getValue())); +// } +// return mapPrincipal; +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的总利息 +// * +// * @param invest 总借款额(贷款本金) +// * @param yearRate 年利率 +// * @param month 还款总月数 +// * @return 总利息 +// */ +// public static double getInterestCount(double invest, double yearRate, int totalmonth) { +// BigDecimal count = new BigDecimal(0); +// Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); +// +// for (Map.Entry entry : mapInterest.entrySet()) { +// count = count.add(entry.getValue()); +// } +// return count.doubleValue(); +// } +// +// /** +// * 应还本金总和 +// * +// * @param invest 总借款额(贷款本金) +// * @param yearRate 年利率 +// * @param month 还款总月数 +// * @return 应还本金总和 +// */ +// public static double getPrincipalInterestCount(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal perMonthInterest = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); +// BigDecimal count = perMonthInterest.multiply(new BigDecimal(totalmonth)); +// count = count.setScale(2, BigDecimal.ROUND_DOWN); +// return count.doubleValue(); +// } +// +// +// /** +// * @param args +// */ +// public static void main(String[] args) { +// double invest = 20000; // 本金 +// int month = 12; +// double yearRate = 0.15; // 年利率 +// double perMonthPrincipalInterest = getPerMonthPrincipalInterest(invest, yearRate, month); +// System.out.println("等额本息---每月还款本息:" + perMonthPrincipalInterest); +// Map mapInterest = getPerMonthInterest(invest, yearRate, month); +// System.out.println("等额本息---每月还款利息:" + mapInterest); +// Map mapPrincipal = getPerMonthPrincipal(invest, yearRate, month); +// System.out.println("等额本息---每月还款本金:" + mapPrincipal); +// double count = getInterestCount(invest, yearRate, month); +// System.out.println("等额本息---总利息:" + count); +// double principalInterestCount = getPrincipalInterestCount(invest, yearRate, month); +// System.out.println("等额本息---应还本息总和:" + principalInterestCount); +// +// } + + /** + * 等额本息计算获取还款方式为等额本息的每月偿还本金和利息 + * + * 公式:每月偿还本息=〔贷款本金×月利率×(1+月利率)^还款月数〕÷〔(1+月利率)^还款月数-1〕 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还本金和利息,不四舍五入,直接截取小数点最后两位 + */ + public static BigDecimal getPerMonthPrincipalInterest(double invest, double yearRate, int totalmonth) { + double monthRate = yearRate / 12; + BigDecimal monthIncome = new BigDecimal(invest) + .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) + .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_UP); + //return monthIncome.doubleValue(); + return monthIncome; + } + + /** + * 等额本息计算获取还款方式为等额本息的每月偿还利息 + * + * 公式:每月偿还利息=贷款本金×月利率×〔(1+月利率)^还款月数-(1+月利率)^(还款月序号-1)〕÷〔(1+月利率)^还款月数-1〕 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还利息 + */ + public static Map getPerMonthInterest(double invest, double yearRate, int totalmonth) { + Map map = new HashMap(); + double monthRate = yearRate / 12; + BigDecimal monthInterest; + for (int i = 1; i < totalmonth + 1; i++) { + BigDecimal multiply = new BigDecimal(invest).multiply(new BigDecimal(monthRate)); + BigDecimal sub = new BigDecimal(Math.pow(1 + monthRate, totalmonth)) + .subtract(new BigDecimal(Math.pow(1 + monthRate, i - 1))); + monthInterest = multiply.multiply(sub).divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, + BigDecimal.ROUND_DOWN); + monthInterest = monthInterest.setScale(2, BigDecimal.ROUND_DOWN); + map.put(i, monthInterest); + } + return map; + } + + /** + * 等额本息计算获取还款方式为等额本息的每月偿还本金 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还本金 + */ + public static Map getPerMonthPrincipal(double invest, double yearRate, int totalmonth) { + double monthRate = yearRate / 12; + BigDecimal monthIncome = new BigDecimal(invest) + .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) + .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); + Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); + Map mapPrincipal = new HashMap(); + + for (Map.Entry entry : mapInterest.entrySet()) { + mapPrincipal.put(entry.getKey(), monthIncome.subtract(entry.getValue())); + } + return mapPrincipal; + } + + /** + * 等额本息计算获取还款方式为等额本息的总利息 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 总利息 + */ + public static double getInterestCount(double invest, double yearRate, int totalmonth) { + BigDecimal count = new BigDecimal(0); + Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); + + for (Map.Entry entry : mapInterest.entrySet()) { + count = count.add(entry.getValue()); + } + return count.doubleValue(); + } + + /** + * 应还本金总和 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 应还本金总和 + */ + public static double getPrincipalInterestCount(double invest, double yearRate, int totalmonth) { + double monthRate = yearRate / 12; + BigDecimal perMonthInterest = new BigDecimal(invest) + .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) + .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); + BigDecimal count = perMonthInterest.multiply(new BigDecimal(totalmonth)); + count = count.setScale(2, BigDecimal.ROUND_DOWN); + return count.doubleValue(); + } + + /** + * @param args + */ + public static void main() { + double invest = 10000; // 本金 + int month = 12; + double yearRate = 0.015; // 年利率 + BigDecimal perMonthPrincipalInterest = getPerMonthPrincipalInterest(invest, yearRate, month); + System.out.println("等额本息---每月还款本息:" + perMonthPrincipalInterest); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 3)); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 6)); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 9)); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 12)); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 15)); + System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 18)); + Map mapInterest = getPerMonthInterest(invest, yearRate, month); + System.out.println("等额本息---每月还款利息:" + mapInterest); + Map mapPrincipal = getPerMonthPrincipal(invest, yearRate, month); + System.out.println("等额本息---每月还款本金:" + mapPrincipal); + double count = getInterestCount(invest, yearRate, month); + System.out.println("等额本息---总利息:" + count); + double principalInterestCount = getPrincipalInterestCount(invest, yearRate, month); + System.out.println("等额本息---应还本息总和:" + principalInterestCount); + } + +} + diff --git a/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalUtils.java b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalUtils.java new file mode 100644 index 00000000..b445fd78 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/java/com/ruoyi/potenza/utils/AverageCapitalUtils.java @@ -0,0 +1,279 @@ +package com.ruoyi.potenza.utils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +/** + * @author 木子 + * @version 1.0 + * @description: TODO + * @date 2023/1/15 20:49 + */ +public class AverageCapitalUtils { +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还本金和利息 +// * +// * 公式:每月偿还本息=〔贷款本金×月利率×(1+月利率)^还款月数〕÷〔(1+月利率)^还款月数-1〕 +// * +// * @param invest +// * 总借款额(贷款本金) +// * @param yearRate +// * 年利率 +// * @param month +// * 还款总月数 +// * @return 每月偿还本金和利息,不四舍五入,直接截取小数点最后两位 +// */ +// public static BigDecimal getPerMonthPrincipalInterest(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal monthIncome = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_UP); +// //return monthIncome.doubleValue(); +// return monthIncome; +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还利息 +// * +// * 公式:每月偿还利息=贷款本金×月利率×〔(1+月利率)^还款月数-(1+月利率)^(还款月序号-1)〕÷〔(1+月利率)^还款月数-1〕 +// * +// * @param invest +// * 总借款额(贷款本金) +// * @param yearRate +// * 年利率 +// * @param month +// * 还款总月数 +// * @return 每月偿还利息 +// */ +// public static Map getPerMonthInterest(double invest, double yearRate, int totalmonth) { +// Map map = new HashMap(); +// double monthRate = yearRate / 12; +// BigDecimal monthInterest; +// for (int i = 1; i < totalmonth + 1; i++) { +// BigDecimal multiply = new BigDecimal(invest).multiply(new BigDecimal(monthRate)); +// BigDecimal sub = new BigDecimal(Math.pow(1 + monthRate, totalmonth)) +// .subtract(new BigDecimal(Math.pow(1 + monthRate, i - 1))); +// monthInterest = multiply.multiply(sub).divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, +// BigDecimal.ROUND_DOWN); +// monthInterest = monthInterest.setScale(2, BigDecimal.ROUND_DOWN); +// map.put(i, monthInterest); +// } +// return map; +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的每月偿还本金 +// * +// * @param invest +// * 总借款额(贷款本金) +// * @param yearRate +// * 年利率 +// * @param month +// * 还款总月数 +// * @return 每月偿还本金 +// */ +// public static Map getPerMonthPrincipal(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal monthIncome = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); +// Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); +// Map mapPrincipal = new HashMap(); +// +// for (Map.Entry entry : mapInterest.entrySet()) { +// mapPrincipal.put(entry.getKey(), monthIncome.subtract(entry.getValue())); +// } +// return mapPrincipal; +// } +// +// /** +// * 等额本息计算获取还款方式为等额本息的总利息 +// * +// * @param invest +// * 总借款额(贷款本金) +// * @param yearRate +// * 年利率 +// * @param month +// * 还款总月数 +// * @return 总利息 +// */ +// public static double getInterestCount(double invest, double yearRate, int totalmonth) { +// BigDecimal count = new BigDecimal(0); +// Map mapInterest = getPerMonthInterest(invest, yearRate, totalmonth); +// +// for (Map.Entry entry : mapInterest.entrySet()) { +// count = count.add(entry.getValue()); +// } +// return count.doubleValue(); +// } +// +// /** +// * 应还本金总和 +// * +// * @param invest +// * 总借款额(贷款本金) +// * @param yearRate +// * 年利率 +// * @param month +// * 还款总月数 +// * @return 应还本金总和 +// */ +// public static double getPrincipalInterestCount(double invest, double yearRate, int totalmonth) { +// double monthRate = yearRate / 12; +// BigDecimal perMonthInterest = new BigDecimal(invest) +// .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) +// .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); +// BigDecimal count = perMonthInterest.multiply(new BigDecimal(totalmonth)); +// count = count.setScale(2, BigDecimal.ROUND_DOWN); +// return count.doubleValue(); +// } +// +// /** +// * @param args +// */ +// public static void main(String[] args) { +// double invest = 38988; // 本金 +// int month = 12; +// double yearRate = 0.15; // 年利率 +// BigDecimal perMonthPrincipalInterest = getPerMonthPrincipalInterest(invest, yearRate, month); +// System.out.println("等额本息---每月还款本息:" + perMonthPrincipalInterest); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 3)); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 6)); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 9)); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 12)); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 15)); +// System.out.println("等额本息---每月还款本息:" + getPerMonthPrincipalInterest(invest, yearRate, 18)); +// /*Map mapInterest = getPerMonthInterest(invest, yearRate, month); +// System.out.println("等额本息---每月还款利息:" + mapInterest); +// Map mapPrincipal = getPerMonthPrincipal(invest, yearRate, month); +// System.out.println("等额本息---每月还款本金:" + mapPrincipal); +// double count = getInterestCount(invest, yearRate, month); +// System.out.println("等额本息---总利息:" + count); +// double principalInterestCount = getPrincipalInterestCount(invest, yearRate, month); +// System.out.println("等额本息---应还本息总和:" + principalInterestCount);*/ +// } + + + /** + * 等额本金计算获取还款方式为等额本金的每月偿还本金和利息 + * + * 公式:每月偿还本金=(贷款本金÷还款月数)+(贷款本金-已归还本金累计额)×月利率 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还本金和利息,不四舍五入,直接截取小数点最后两位 + */ + public static Map getPerMonthPrincipalInterest(double invest, double yearRate, int totalMonth) { + Map map = new HashMap(); + // 每月本金 + double monthPri = getPerMonthPrincipal(invest, totalMonth); + // 获取月利率 + double monthRate = yearRate / 12; + monthRate = new BigDecimal(monthRate).setScale(6, BigDecimal.ROUND_DOWN).doubleValue(); + for (int i = 1; i <= totalMonth; i++) { + double monthRes = monthPri + (invest - monthPri * (i - 1)) * monthRate; + monthRes = new BigDecimal(monthRes).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); + map.put(i, monthRes); + } + return map; + } + + /** + * 等额本金计算获取还款方式为等额本金的每月偿还利息 + * + * 公式:每月应还利息=剩余本金×月利率=(贷款本金-已归还本金累计额)×月利率 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还利息 + */ + public static Map getPerMonthInterest(double invest, double yearRate, int totalMonth) { + Map inMap = new HashMap(); + double principal = getPerMonthPrincipal(invest, totalMonth); + Map map = getPerMonthPrincipalInterest(invest, yearRate, totalMonth); + for (Map.Entry entry : map.entrySet()) { + BigDecimal principalBigDecimal = new BigDecimal(principal); + BigDecimal principalInterestBigDecimal = new BigDecimal(entry.getValue()); + BigDecimal interestBigDecimal = principalInterestBigDecimal.subtract(principalBigDecimal); + interestBigDecimal = interestBigDecimal.setScale(2, BigDecimal.ROUND_DOWN); + inMap.put(entry.getKey(), interestBigDecimal.doubleValue()); + } + return inMap; + } + + /** + * 等额本金计算获取还款方式为等额本金的每月偿还本金 + * + * 公式:每月应还本金=贷款本金÷还款月数 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 每月偿还本金 + */ + public static double getPerMonthPrincipal(double invest, int totalMonth) { + BigDecimal monthIncome = new BigDecimal(invest).divide(new BigDecimal(totalMonth), 2, BigDecimal.ROUND_DOWN); + return monthIncome.doubleValue(); + } + + /** + * 等额本金计算获取还款方式为等额本金的总利息 + * + * @param invest + * 总借款额(贷款本金) + * @param yearRate + * 年利率 + * @param month + * 还款总月数 + * @return 总利息 + */ + public static double getInterestCount(double invest, double yearRate, int totalMonth) { + BigDecimal count = new BigDecimal(0); + Map mapInterest = getPerMonthInterest(invest, yearRate, totalMonth); + + for (Map.Entry entry : mapInterest.entrySet()) { + count = count.add(new BigDecimal(entry.getValue())); + } + return count.doubleValue(); + } + + public static double getPrincipalInterestCount(double invest, double yearRate, int totalmonth) { + double monthRate = yearRate / 12; + BigDecimal perMonthInterest = new BigDecimal(invest) + .multiply(new BigDecimal(monthRate * Math.pow(1 + monthRate, totalmonth))) + .divide(new BigDecimal(Math.pow(1 + monthRate, totalmonth) - 1), 2, BigDecimal.ROUND_DOWN); + BigDecimal count = perMonthInterest.multiply(new BigDecimal(totalmonth)); + count = count.setScale(2, BigDecimal.ROUND_DOWN); + return count.doubleValue(); + } + + /** + * @param args + */ + public static void main() { + double invest = 10000; // 本金 + int month = 12; + double yearRate = 0.015; // 年利率 + Map getPerMonthPrincipalInterest = getPerMonthPrincipalInterest(invest, yearRate, month); + System.out.println("等额本金---每月本息:" + getPerMonthPrincipalInterest); + double benjin = getPerMonthPrincipal(invest, month); + System.out.println("等额本金---每月本金:" + benjin); + Map mapInterest = getPerMonthInterest(invest, yearRate, month); + System.out.println("等额本金---每月利息:" + mapInterest); + double count = getInterestCount(invest, yearRate, month); + System.out.println("等额本金---总利息:" + count); + double principalInterestCount = getPrincipalInterestCount(invest, yearRate, month); + System.out.println("等额本金---应还本息总和:"+principalInterestCount); + } + } 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..73846c89 --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9401 + +# Spring +spring: + application: + # 应用名称 + name: ruoyi-potenza + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} 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..e603adea --- /dev/null +++ b/ruoyi-modules/ruoyi-potenza/src/main/resources/mapper/TbBorrowerPeriodsMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + select periods_id, periods_name,rate_interest, create_by, update_by, del_flag, create_time, update_time from tb_borrower_periods + + + + + + + + insert into tb_borrower_periods + + periods_name, + rate_interest, + create_by, + update_by, + del_flag, + create_time, + update_time, + + + #{periodsName}, + #{rateInterest}, + #{createBy}, + #{updateBy}, + #{delFlag}, + #{createTime}, + #{updateTime}, + + + + + update tb_borrower_periods + + periods_name = #{periodsName}, + rate_interest = #{rateInterest}, + 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} + + + diff --git a/ruoyi-modules/ruoyi-product/pom.xml b/ruoyi-modules/ruoyi-product/pom.xml new file mode 100644 index 00000000..b2bf757b --- /dev/null +++ b/ruoyi-modules/ruoyi-product/pom.xml @@ -0,0 +1,120 @@ + + + + ruoyi-modules + com.ruoyi + 3.6.1 + + 4.0.0 + + com.ruoyi.product + ruoyi-product + + + 8 + 8 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.baomidou + mybatis-plus-boot-starter + 3.5.2 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + org.springframework.boot + spring-boot-starter-data-elasticsearch + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + com.github.xiaoymin + knife4j-spring-boot-starter + 3.0.3 + + + + 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-product/src/main/java/com/ruoyi/product/RuoYiProductApplication.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/RuoYiProductApplication.java new file mode 100644 index 00000000..2fe71da1 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/RuoYiProductApplication.java @@ -0,0 +1,36 @@ +package com.ruoyi.product; + +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * 系统模块 + * + * @author ruoyi + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +@EnableScheduling //定时任务 +public class RuoYiProductApplication +{ + public static void main(String[] args) + { + SpringApplication.run(RuoYiProductApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/ElasticsearchConfig.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/ElasticsearchConfig.java new file mode 100644 index 00000000..1e1b927a --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/ElasticsearchConfig.java @@ -0,0 +1,25 @@ +package com.ruoyi.product.config; + +import org.elasticsearch.client.RestHighLevelClient; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.elasticsearch.client.ClientConfiguration; +import org.springframework.data.elasticsearch.client.RestClients; + +@Configuration +public class ElasticsearchConfig { + @Bean + RestHighLevelClient elasticsearchClient() { + ClientConfiguration configuration = ClientConfiguration.builder() + .connectedTo("localhost:9200") + //.withConnectTimeout(Duration.ofSeconds(5)) + //.withSocketTimeout(Duration.ofSeconds(3)) + //.useSsl() + //.withDefaultHeaders(defaultHeaders) + //.withBasicAuth(username, password) + // ... other options + .build(); + RestHighLevelClient client = RestClients.create(configuration).rest(); + return client; + } +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/Knife4jConfiguration.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/Knife4jConfiguration.java new file mode 100644 index 00000000..b37736ba --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/Knife4jConfiguration.java @@ -0,0 +1,36 @@ +package com.ruoyi.product.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration +@EnableSwagger2 +public class Knife4jConfiguration { + @Bean(value = "defaultApi2") + public Docket defaultApi2() { + String groupName="3.X版本"; + Docket docket=new Docket(DocumentationType.OAS_30) + .apiInfo(new ApiInfoBuilder() + .title("产品中心 API详细描述 ") + .description("# 这里记录服务端所有的接口的入参,出参等等信息") + .termsOfServiceUrl("https://www.shenmazong.com") + .contact(new Contact("杨杨","http://yangzongli.com","337296894@qq.com")) + .version("3.0") + .build()) + //分组名称 + .groupName(groupName) + .select() + //这里指定Controller扫描包路径 + .apis(RequestHandlerSelectors.basePackage("com.ruoyi.product.controller")) + .paths(PathSelectors.any()) + .build(); + return docket; + } +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/MybatisPlusConfig.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/MybatisPlusConfig.java new file mode 100644 index 00000000..21638617 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/config/MybatisPlusConfig.java @@ -0,0 +1,24 @@ +package com.ruoyi.product.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MybatisPlusConfig { + + /** + * 新的分页插件,一缓和二缓遵循mybatis的规则, + * 需要设置 MybatisConfiguration#useDeprecatedExecutor = false + * 避免缓存出现问题(该属性会在旧插件移除后一同移除) + */ + // 最新版 + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); + return interceptor; + } +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/controller/ProductController.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/controller/ProductController.java new file mode 100644 index 00000000..ea6d24df --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/controller/ProductController.java @@ -0,0 +1,83 @@ +package com.ruoyi.product.controller; + +import com.ruoyi.common.core.web.domain.AjaxResult; + +import com.ruoyi.product.pojo.vo.IdVo; +import com.ruoyi.product.pojo.vo.PageInfoVo; +import com.ruoyi.product.service.TbFinancialProductService; +import com.ruoyi.product.pojo.vo.ProductInfoVo; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/15 16:34 + */ +@RestController +@RequestMapping(value = "/product") +public class ProductController { + @Autowired + private TbFinancialProductService tbFinancialProductService; + + /** + * 展示产品列表数据 + * @param pageInfoVo + * @return + */ + @PostMapping(value = "/list") + public AjaxResult list(@RequestBody PageInfoVo pageInfoVo){ + return tbFinancialProductService.listPage(pageInfoVo); + + } + + /** + * 添加列表数据 + * @param productInfoVo + * @return + */ + @PostMapping(value = "/add") + public AjaxResult add(@RequestBody ProductInfoVo productInfoVo){ + return tbFinancialProductService.add(productInfoVo); + } + + /** + * 删除数据 + * @param idVo + * @return + */ + @PostMapping(value = "/delete") + public AjaxResult delete(@RequestBody IdVo idVo){ + return tbFinancialProductService.deleteById(idVo); + } + + /** + *修改数据通过Id + * @param productInfoVo + * @return + */ + @PostMapping(value = "/update") + public AjaxResult update(@RequestBody ProductInfoVo productInfoVo){ + return tbFinancialProductService.updateId(productInfoVo); + + + } + + /** + * 通过id查询数据 + * @param productInfoVo + * @return + */ + @PostMapping(value = "/selectProduct") + public AjaxResult selectProduct(@RequestBody ProductInfoVo productInfoVo){ + return tbFinancialProductService.selectProduct(productInfoVo); + } + + +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbFinancialProductMapper.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbFinancialProductMapper.java new file mode 100644 index 00000000..4906bca3 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbFinancialProductMapper.java @@ -0,0 +1,17 @@ +package com.ruoyi.product.mapper; + +import com.ruoyi.product.pojo.TbFinancialProduct; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ruoyi.product.pojo.TbFinancialProduct + */ +@Mapper +public interface TbFinancialProductMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbProductTypeMapper.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbProductTypeMapper.java new file mode 100644 index 00000000..5821e8d3 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/mapper/TbProductTypeMapper.java @@ -0,0 +1,17 @@ +package com.ruoyi.product.mapper; + +import com.ruoyi.product.pojo.TbProductType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ruoyi.product.pojo.TbProductType + */ +@Mapper +public interface TbProductTypeMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbFinancialProduct.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbFinancialProduct.java new file mode 100644 index 00000000..dd3c0f0b --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbFinancialProduct.java @@ -0,0 +1,141 @@ +package com.ruoyi.product.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.data.elasticsearch.annotations.DateFormat; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 金融产品表 + * @TableName tb_financial_product + */ +@TableName(value ="tb_financial_product") +@Data +@Document(indexName = "tb_financial_product") +public class TbFinancialProduct implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer productId; + + /** + * 企业id + */ + private Integer firmId; + + /** + * 企业名称 + */ + private String firmName; + + /** + * 产品名称 + */ + @Field(type = FieldType.Text,analyzer = "ik_max_word") + private String productName; + + /** + * 产品描述 + */ + private String productDesc; + + /** + * 用户ID + */ + private Integer userId; + + /** + * 产品种类ID + */ + private Integer typeId; + + /** + * 期数 + */ + private Integer periods; + + /** + * 利率 + */ + private Integer productRate; + + /** + * 手续费 + */ + private Integer produtCharge; + + /** + * 最大额度 + */ + private Integer maxPrice; + + /** + * 最小额度 + */ + private Integer minPrice; + + /** + * 逾期还款 + */ + private Integer termsForLate; + + /** + * 允许提前还款 + */ + private String termsProductLate; + + /** + * 0:没有利息 1:等额本息 2:等额本金 + */ + private Integer modeProduct; + + /** + * 产品LOGO + */ + private String productPhoto; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @Field(type = FieldType.Date,format = DateFormat. custom,pattern = "yyy-MM-dd HH:mm: ss") + 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") + @Field(type = FieldType.Date,format = DateFormat. custom,pattern = "yyy-MM-dd HH:mm: ss") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbProductType.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbProductType.java new file mode 100644 index 00000000..3f937c9d --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/TbProductType.java @@ -0,0 +1,56 @@ +package com.ruoyi.product.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 lombok.Data; + +/** + * 金融产品类型表 + * @TableName tb_product_type + */ +@TableName(value ="tb_product_type") +@Data +public class TbProductType implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer typeId; + + /** + * 产品类型名称 + */ + private String typeName; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/IdVo.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/IdVo.java new file mode 100644 index 00000000..6a9e303d --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/IdVo.java @@ -0,0 +1,17 @@ +package com.ruoyi.product.pojo.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/15 20:16 + */ +@Data +public class IdVo implements Serializable { + private Integer ProductId; + +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/PageInfoVo.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/PageInfoVo.java new file mode 100644 index 00000000..fa714062 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/PageInfoVo.java @@ -0,0 +1,19 @@ +package com.ruoyi.product.pojo.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/15 16:46 + */ +@Data +public class PageInfoVo implements Serializable { + private Integer pageNum; + private Integer pageSize; + //模糊查询数据 + private String keyword; +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/ProductInfoVo.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/ProductInfoVo.java new file mode 100644 index 00000000..ebccbe0c --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/pojo/vo/ProductInfoVo.java @@ -0,0 +1,118 @@ +package com.ruoyi.product.pojo.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/16 16:02 + */ +@Data +public class ProductInfoVo implements Serializable { + private Integer productId; + + /** + * 企业id + */ + private Integer firmId; + + /** + * 企业名称 + */ + private String firmName; + + /** + * 产品名称 + */ + private String productName; + + /** + * 产品描述 + */ + private String productDesc; + + /** + * 用户ID + */ + private Integer userId; + + /** + * 产品种类ID + */ + private Integer typeId; + + /** + * 期数 + */ + private Integer periods; + + /** + * 利率 + */ + private Integer productRate; + + /** + * 手续费 + */ + private Integer produtCharge; + + /** + * 最大额度 + */ + private Integer maxPrice; + + /** + * 最小额度 + */ + private Integer minPrice; + + /** + * 逾期还款 + */ + private Integer termsForLate; + + /** + * 允许提前还款 + */ + private String termsProductLate; + + /** + * 0:没有利息 1:等额本息 2:等额本金 + */ + private Integer modeProduct; + + /** + * 产品LOGO + */ + private String productPhoto; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbFinancialProductService.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbFinancialProductService.java new file mode 100644 index 00000000..b9fb0f7a --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbFinancialProductService.java @@ -0,0 +1,26 @@ +package com.ruoyi.product.service; + +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.product.pojo.TbFinancialProduct; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.product.pojo.vo.IdVo; +import com.ruoyi.product.pojo.vo.PageInfoVo; +import com.ruoyi.product.pojo.vo.ProductInfoVo; + + + +/** + * + */ +public interface TbFinancialProductService extends IService { + + AjaxResult listPage(PageInfoVo pageInfoVo); + + AjaxResult add(ProductInfoVo productInfoVo); + + AjaxResult deleteById(IdVo idVo); + + AjaxResult updateId(ProductInfoVo productInfoVo); + + AjaxResult selectProduct(ProductInfoVo productInfoVo); +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbProductTypeService.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbProductTypeService.java new file mode 100644 index 00000000..0d0c3a97 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/TbProductTypeService.java @@ -0,0 +1,11 @@ +package com.ruoyi.product.service; + +import com.ruoyi.product.pojo.TbProductType; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface TbProductTypeService extends IService { + +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbFinancialProductServiceImpl.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbFinancialProductServiceImpl.java new file mode 100644 index 00000000..b34ef6f1 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbFinancialProductServiceImpl.java @@ -0,0 +1,189 @@ +package com.ruoyi.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.product.pojo.TbFinancialProduct; +import com.ruoyi.product.pojo.vo.IdVo; +import com.ruoyi.product.pojo.vo.PageInfoVo; +import com.ruoyi.product.pojo.vo.ProductInfoVo; +import com.ruoyi.product.service.TbFinancialProductService; +import com.ruoyi.product.mapper.TbFinancialProductMapper; + +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.query.TermQueryBuilder; +import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; +import org.elasticsearch.search.sort.FieldSortBuilder; +import org.elasticsearch.search.sort.SortBuilder; +import org.elasticsearch.search.sort.SortOrder; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; +import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * + */ +@Service +public class TbFinancialProductServiceImpl extends ServiceImpl + implements TbFinancialProductService{ + @Autowired + private TbFinancialProductMapper tbFinancialProductMapper; + @Autowired + private ElasticsearchRestTemplate elasticsearchRestTemplate; + + /** + * 产品数据查询 + * @param pageInfoVo + * @return + */ + @Override + public AjaxResult listPage(PageInfoVo pageInfoVo) { + if(pageInfoVo.getKeyword()==null){ + Page page = new Page<>(pageInfoVo.getPageNum(), pageInfoVo.getPageSize()); + //.lambda().eq(TbFinancialProduct::getFirmName, pageInfoVo.getKeyword()).last("limit 1") + Page financialProductPage = page(page, new QueryWrapper<>()); + List collect = financialProductPage.getRecords().stream().map((item) -> { + ProductInfoVo productInfoVo = new ProductInfoVo(); + BeanUtils.copyProperties(item, productInfoVo); + return productInfoVo; + + }).collect(Collectors.toList()); + Page infoVoPage = new Page<>(); + infoVoPage.setRecords(collect); + infoVoPage.setCurrent(financialProductPage.getCurrent()); + infoVoPage.setSize(financialProductPage.getSize()); + infoVoPage.setTotal(financialProductPage.getTotal()); + + return AjaxResult.success(infoVoPage); + } + //获取分页数据 + Pageable page = PageRequest.of(pageInfoVo.getPageNum() - 1, pageInfoVo.getPageSize()); + TermQueryBuilder termQuery = QueryBuilders.termQuery("productName", pageInfoVo.getKeyword()); + SortBuilder sortBuilder = new FieldSortBuilder("createTime").order(SortOrder.DESC); + //高亮查询数据 + HighlightBuilder highlightBuilder = new HighlightBuilder(); + highlightBuilder.preTags("") + .postTags("") + .field("productName"); + NativeSearchQuery searchQuery = new NativeSearchQueryBuilder() + .withQuery(termQuery) + .withPageable(page) + .withSort(sortBuilder) + .withHighlightBuilder(highlightBuilder) +// .withQuery(queryBuilder) + .build(); + long total = elasticsearchRestTemplate.count(searchQuery, TbFinancialProduct.class); + SearchHits search = elasticsearchRestTemplate.search(searchQuery, TbFinancialProduct.class); + List productInfoVoList = search.getSearchHits().stream().map((item) -> { + TbFinancialProduct content = item.getContent(); + List productName = item.getHighlightField("productName"); + if (productName != null && productName.size() > 0) { + String name = productName.get(0); + //设置高亮查询 + content.setProductName(name); + + } + ProductInfoVo productInfoVo = new ProductInfoVo(); + BeanUtils.copyProperties(content, productInfoVo); + return productInfoVo; + }).collect(Collectors.toList()); + Page infoVoPage = new Page<>(); + infoVoPage.setRecords(productInfoVoList); + infoVoPage.setCurrent(pageInfoVo.getPageNum()-1); + infoVoPage.setSize(pageInfoVo.getPageSize()); + infoVoPage.setTotal(total); + + return AjaxResult.success(infoVoPage); + + + } + + /** + * 添加列表数据 + * @param productInfoVo + * @return + */ + @Override + @Transactional //分布式事务 + public AjaxResult add(ProductInfoVo productInfoVo) { + String firmName = productInfoVo.getFirmName(); + TbFinancialProduct one = getOne(new QueryWrapper().lambda().eq(TbFinancialProduct::getFirmName, firmName)); + if(one!=null){ + return AjaxResult.error(302,"产品名称重复"); + } + TbFinancialProduct financialProduct = new TbFinancialProduct(); + BeanUtils.copyProperties(productInfoVo,financialProduct); + save(financialProduct); + elasticsearchRestTemplate.save(financialProduct); + return AjaxResult.success(); + } + + /** + * 删除数据通过id + * @param idVo + * @return + */ + @Override + public AjaxResult deleteById(IdVo idVo) { + Integer productId = idVo.getProductId(); + TbFinancialProduct one = getOne(new QueryWrapper().lambda().eq(TbFinancialProduct::getProductId, productId)); + if(one==null){ + return AjaxResult.error(402,"产品Id不存在"); + } + Integer oneProductId = one.getProductId(); + + BeanUtils.copyProperties(idVo,one); + int i = tbFinancialProductMapper.deleteById(oneProductId); + if(i>0){ + return AjaxResult.success("删除成功"); + }else { + return AjaxResult.error(302,"删除失败"); + } + + } + + /** + * 修改数据通过id + * @param productInfoVo + * @return + */ + @Override + public AjaxResult updateId(ProductInfoVo productInfoVo) { + Integer productId = productInfoVo.getProductId(); + TbFinancialProduct one = getOne(new QueryWrapper().lambda().eq(TbFinancialProduct::getProductId, productId)); + if(one==null){ + return AjaxResult.error(402,"产品Id不存在"); + } + TbFinancialProduct product = new TbFinancialProduct(); + // + BeanUtils.copyProperties(productInfoVo,product); + tbFinancialProductMapper.updateById(product); + return AjaxResult.success("修改成功"); + } + + @Override + public AjaxResult selectProduct(ProductInfoVo productInfoVo) { + Integer productId = productInfoVo.getProductId(); + TbFinancialProduct one = getOne(new QueryWrapper().lambda().eq(TbFinancialProduct::getProductId, productId)); + if(one==null){ + return AjaxResult.error(402,"产品Id不存在"); + } + TbFinancialProduct financialProduct = tbFinancialProductMapper.selectById(productId); + return AjaxResult.success(financialProduct); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbProductTypeServiceImpl.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbProductTypeServiceImpl.java new file mode 100644 index 00000000..e6b503fa --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/service/impl/TbProductTypeServiceImpl.java @@ -0,0 +1,20 @@ +package com.ruoyi.product.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.product.pojo.TbProductType; +import com.ruoyi.product.service.TbProductTypeService; +import com.ruoyi.product.mapper.TbProductTypeMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class TbProductTypeServiceImpl extends ServiceImpl + implements TbProductTypeService{ + +} + + + + diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/task/TaskQuartz.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/task/TaskQuartz.java new file mode 100644 index 00000000..3f7a18cd --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/task/TaskQuartz.java @@ -0,0 +1,85 @@ +package com.ruoyi.product.task; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.product.mapper.TbFinancialProductMapper; +import com.ruoyi.product.pojo.TbFinancialProduct; +import com.ruoyi.product.var.ConstantVars; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.core.document.Document; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/18 15:16 + */ +@Component +@Slf4j +public class TaskQuartz { + @Autowired + ElasticsearchRestTemplate elasticsearchTemplate; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private TbFinancialProductMapper tbFinancialProductMapper; + @Scheduled(fixedDelay = 1000*60) + public void ProductQuartz(){ + //判断索引 + if(!elasticsearchTemplate.indexOps(TbFinancialProduct.class).exists()){ + elasticsearchTemplate.indexOps(TbFinancialProduct.class).create(); + Document mapping = elasticsearchTemplate.indexOps(TbFinancialProduct.class).createMapping(); + elasticsearchTemplate.indexOps(TbFinancialProduct.class).putMapping(mapping); + + } + String strTime = (String) redisTemplate.opsForValue().get(ConstantVars.SYNC_PRODUCT_KEY); + + if(strTime==null){ + //全量同步 + List list = tbFinancialProductMapper.selectList(new QueryWrapper().lambda().orderByDesc(TbFinancialProduct::getCreateTime)); + if(list!=null && list.size()>0){ + elasticsearchTemplate.save(list); + TbFinancialProduct product = list.get(0); + Date updateTime = product.getUpdateTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String format = sdf.format(updateTime); + //存入redis中 + redisTemplate.opsForValue().set(ConstantVars.SYNC_PRODUCT_KEY,format); + + } + return; + + } + + //增量同步 + //全量同步 + List list = tbFinancialProductMapper.selectList(new QueryWrapper().lambda().gt(TbFinancialProduct::getUpdateTime,strTime) + .orderByDesc(TbFinancialProduct::getCreateTime)); + if(list!=null && list.size()>0){ + elasticsearchTemplate.save(list); + TbFinancialProduct product = list.get(0); + Date updateTime = product.getUpdateTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String format = sdf.format(updateTime); + //存入redis中 + redisTemplate.opsForValue().set(ConstantVars.SYNC_PRODUCT_KEY,format); + + } + return; + + + } + + + + + +} diff --git a/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/var/ConstantVars.java b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/var/ConstantVars.java new file mode 100644 index 00000000..b076ca19 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/java/com/ruoyi/product/var/ConstantVars.java @@ -0,0 +1,12 @@ +package com.ruoyi.product.var; + +/** + * @version 1.0 + * @description: TODO + * @author杨宗理 + * @date 2023/1/19 21:45 + */ +public interface ConstantVars { + //作为Key值 + final String SYNC_PRODUCT_KEY="SYNC_PRODUCT_KEY"; +} diff --git a/ruoyi-modules/ruoyi-product/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-product/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..4b2887ec --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9600 + +# Spring +spring: + application: + # 应用名称 + name: ruoyi-product + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/ruoyi-modules/ruoyi-product/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-product/src/main/resources/logback.xml new file mode 100644 index 00000000..0154e288 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/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-product/src/main/resources/mapper/TbFinancialProductMapper.xml b/ruoyi-modules/ruoyi-product/src/main/resources/mapper/TbFinancialProductMapper.xml new file mode 100644 index 00000000..bd7e7784 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/resources/mapper/TbFinancialProductMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + product_id,firm_id,firm_name, + product_name,product_desc,user_id, + type_id,periods,product_rate, + produt_charge,max_price,min_price, + terms_for_late,terms_product_late,mode_product, + product_photo,del_flag,create_by, + create_time,update_by,update_time + + diff --git a/ruoyi-modules/ruoyi-product/src/main/resources/mapper/TbProductTypeMapper.xml b/ruoyi-modules/ruoyi-product/src/main/resources/mapper/TbProductTypeMapper.xml new file mode 100644 index 00000000..04364f70 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/resources/mapper/TbProductTypeMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + type_id,type_name,del_flag, + create_by,create_time,update_by, + update_time + + diff --git a/ruoyi-modules/ruoyi-product/src/main/resources/pom.xml b/ruoyi-modules/ruoyi-product/src/main/resources/pom.xml new file mode 100644 index 00000000..077f0ca5 --- /dev/null +++ b/ruoyi-modules/ruoyi-product/src/main/resources/pom.xml @@ -0,0 +1,100 @@ + + + + com.ruoyi + ruoyi-modules + 3.6.1 + + 4.0.0 + + ruoyi-modules-system + + + ruoyi-modules-system系统模块 + + + + + + + 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/pom.xml b/ruoyi-modules/ruoyi-user/pom.xml new file mode 100644 index 00000000..aff0c0c5 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/pom.xml @@ -0,0 +1,151 @@ + + + + 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 + + + com.github.xiaoymin + knife4j-spring-boot-starter + 2.0.7 + + + + + ${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/user/RuoYiUserApplication.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/RuoYiUserApplication.java new file mode 100644 index 00000000..d5185ced --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/RuoYiUserApplication.java @@ -0,0 +1,36 @@ +package com.bwie.user; + +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 系统模块 + * + * @author ruoyi + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +@MapperScan("com.bwie.user.mapper") +public class RuoYiUserApplication +{ + public static void main(String[] args) + { + SpringApplication.run(RuoYiUserApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/config/Knife4jConfiguration.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/config/Knife4jConfiguration.java new file mode 100644 index 00000000..7e019913 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/config/Knife4jConfiguration.java @@ -0,0 +1,43 @@ +package com.bwie.user.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * @Description //TODO + * @Author 王辉 + * @Date 2022/11/13 19:53 + */ +@Configuration +@EnableSwagger2 +public class Knife4jConfiguration { + @Bean(value = "defaultApi2") + public Docket defaultApi2() { + String groupName="3.X版本"; + Docket docket=new Docket(DocumentationType.OAS_30) + .apiInfo(new ApiInfoBuilder() + .title("这是User API ") + .description("# 这里记录服务端所有的接口的入参,出参等等信息") + .termsOfServiceUrl("https://www.shenmazong.com") + .contact(new Contact("shl","http://bwie.com","1447562585@qq.com")) + .version("3.0") + .build()) + //分组名称 + .groupName(groupName) + .select() + //这里指定Controller扫描包路径 + .apis(RequestHandlerSelectors.basePackage("com.bwie.user")) + .paths(PathSelectors.any()) + .build(); + return docket; + } + + +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/DuanXinSend.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/DuanXinSend.java new file mode 100644 index 00000000..6f944f69 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/DuanXinSend.java @@ -0,0 +1,30 @@ +package com.bwie.user.controller; + +import com.bwie.user.service.TbUserService; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.system.api.model.PhoneVo; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author 苏海龙 + * @version 1.0 + * @description: TODO + * @date 2023/1/14 7:49 + */ + +@RestController +@CrossOrigin +@Api(tags = "aaa-api") +@RequestMapping("duanxin") +public class DuanXinSend { + @Resource + private TbUserService tbUserService; + //1.发送验证码 + @PostMapping("phoneSend") + public AjaxResult phoneSend(@RequestBody(required=false) PhoneVo phoneVo){ + return tbUserService.phoneSend(phoneVo); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbMyroleController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbMyroleController.java new file mode 100644 index 00000000..d7d6e470 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbMyroleController.java @@ -0,0 +1,105 @@ +package com.bwie.user.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.bwie.user.domain.TbMyrole; +import com.bwie.user.service.ITbMyroleService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 角色Controller + * + * @author xs + * @date 2023-01-15 + */ +@RestController +@RequestMapping("/myrole") +public class TbMyroleController extends BaseController +{ + @Autowired + private ITbMyroleService tbMyroleService; + + /** + * 查询角色列表 + */ + @RequiresPermissions("myrole:myrole:list") + @GetMapping("/list") + public TableDataInfo list(TbMyrole tbMyrole) + { + startPage(); + List list = tbMyroleService.selectTbMyroleList(tbMyrole); + return getDataTable(list); + } + + /** + * 导出角色列表 + */ + @RequiresPermissions("myrole:myrole:export") + @Log(title = "角色", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbMyrole tbMyrole) + { + List list = tbMyroleService.selectTbMyroleList(tbMyrole); + ExcelUtil util = new ExcelUtil(TbMyrole.class); + util.exportExcel(response, list, "角色数据"); + } + + /** + * 获取角色详细信息 + */ + @RequiresPermissions("myrole:myrole:query") + @GetMapping(value = "/{roleId}") + public AjaxResult getInfo(@PathVariable("roleId") Long roleId) + { + return success(tbMyroleService.selectTbMyroleByRoleId(roleId)); + } + + /** + * 新增角色 + */ + @RequiresPermissions("myrole:myrole:add") + @Log(title = "角色", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbMyrole tbMyrole) + { + return toAjax(tbMyroleService.insertTbMyrole(tbMyrole)); + } + + /** + * 修改角色 + */ + @RequiresPermissions("myrole:myrole:edit") + @Log(title = "角色", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbMyrole tbMyrole) + { + return toAjax(tbMyroleService.updateTbMyrole(tbMyrole)); + } + + /** + * 删除角色 + */ + @RequiresPermissions("myrole:myrole:remove") + @Log(title = "角色", businessType = BusinessType.DELETE) + @DeleteMapping("/{roleIds}") + public AjaxResult remove(@PathVariable Long[] roleIds) + { + return toAjax(tbMyroleService.deleteTbMyroleByRoleIds(roleIds)); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbPermController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbPermController.java new file mode 100644 index 00000000..f24a7c67 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbPermController.java @@ -0,0 +1,105 @@ +package com.bwie.user.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.bwie.user.domain.TbPerm; +import com.bwie.user.service.ITbPermService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 权限Controller + * + * @author ruoyi + * @date 2023-01-15 + */ +@RestController +@RequestMapping("/perm") +public class TbPermController extends BaseController +{ + @Autowired + private ITbPermService tbPermService; + + /** + * 查询权限列表 + */ + @RequiresPermissions("perm:perm:list") + @GetMapping("/list") + public TableDataInfo list(TbPerm tbPerm) + { + startPage(); + List list = tbPermService.selectTbPermList(tbPerm); + return getDataTable(list); + } + + /** + * 导出权限列表 + */ + @RequiresPermissions("perm:perm:export") + @Log(title = "权限", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbPerm tbPerm) + { + List list = tbPermService.selectTbPermList(tbPerm); + ExcelUtil util = new ExcelUtil(TbPerm.class); + util.exportExcel(response, list, "权限数据"); + } + + /** + * 获取权限详细信息 + */ + @RequiresPermissions("perm:perm:query") + @GetMapping(value = "/{permId}") + public AjaxResult getInfo(@PathVariable("permId") Long permId) + { + return success(tbPermService.selectTbPermByPermId(permId)); + } + + /** + * 新增权限 + */ + @RequiresPermissions("perm:perm:add") + @Log(title = "权限", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbPerm tbPerm) + { + return toAjax(tbPermService.insertTbPerm(tbPerm)); + } + + /** + * 修改权限 + */ + @RequiresPermissions("perm:perm:edit") + @Log(title = "权限", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbPerm tbPerm) + { + return toAjax(tbPermService.updateTbPerm(tbPerm)); + } + + /** + * 删除权限 + */ + @RequiresPermissions("perm:perm:remove") + @Log(title = "权限", businessType = BusinessType.DELETE) + @DeleteMapping("/{permIds}") + public AjaxResult remove(@PathVariable Long[] permIds) + { + return toAjax(tbPermService.deleteTbPermByPermIds(permIds)); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbRolePermController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbRolePermController.java new file mode 100644 index 00000000..d4699d5e --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbRolePermController.java @@ -0,0 +1,105 @@ +package com.bwie.user.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.bwie.user.domain.TbRolePerm; +import com.bwie.user.service.ITbRolePermService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 角色权限Controller + * + * @author xs + * @date 2023-01-15 + */ +@RestController +@RequestMapping("/roleperm") +public class TbRolePermController extends BaseController +{ + @Autowired + private ITbRolePermService tbRolePermService; + + /** + * 查询角色权限列表 + */ + @RequiresPermissions("roleperm:roleperm:list") + @GetMapping("/list") + public TableDataInfo list(TbRolePerm tbRolePerm) + { + startPage(); + List list = tbRolePermService.selectTbRolePermList(tbRolePerm); + return getDataTable(list); + } + + /** + * 导出角色权限列表 + */ + @RequiresPermissions("roleperm:roleperm:export") + @Log(title = "角色权限", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbRolePerm tbRolePerm) + { + List list = tbRolePermService.selectTbRolePermList(tbRolePerm); + ExcelUtil util = new ExcelUtil(TbRolePerm.class); + util.exportExcel(response, list, "角色权限数据"); + } + + /** + * 获取角色权限详细信息 + */ + @RequiresPermissions("roleperm:roleperm:query") + @GetMapping(value = "/{rolePermId}") + public AjaxResult getInfo(@PathVariable("rolePermId") Long rolePermId) + { + return success(tbRolePermService.selectTbRolePermByRolePermId(rolePermId)); + } + + /** + * 新增角色权限 + */ + @RequiresPermissions("roleperm:roleperm:add") + @Log(title = "角色权限", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbRolePerm tbRolePerm) + { + return toAjax(tbRolePermService.insertTbRolePerm(tbRolePerm)); + } + + /** + * 修改角色权限 + */ + @RequiresPermissions("roleperm:roleperm:edit") + @Log(title = "角色权限", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbRolePerm tbRolePerm) + { + return toAjax(tbRolePermService.updateTbRolePerm(tbRolePerm)); + } + + /** + * 删除角色权限 + */ + @RequiresPermissions("roleperm:roleperm:remove") + @Log(title = "角色权限", businessType = BusinessType.DELETE) + @DeleteMapping("/{rolePermIds}") + public AjaxResult remove(@PathVariable Long[] rolePermIds) + { + return toAjax(tbRolePermService.deleteTbRolePermByRolePermIds(rolePermIds)); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbUserRoleController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbUserRoleController.java new file mode 100644 index 00000000..3c317914 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/TbUserRoleController.java @@ -0,0 +1,105 @@ +package com.bwie.user.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.bwie.user.domain.TbUserRole; +import com.bwie.user.service.ITbUserRoleService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 用户类型Controller + * + * @author xs + * @date 2023-01-15 + */ +@RestController +@RequestMapping("/userrole") +public class TbUserRoleController extends BaseController +{ + @Autowired + private ITbUserRoleService tbUserRoleService; + + /** + * 查询用户类型列表 + */ + @RequiresPermissions("userrole:userrole:list") + @GetMapping("/list") + public TableDataInfo list(TbUserRole tbUserRole) + { + startPage(); + List list = tbUserRoleService.selectTbUserRoleList(tbUserRole); + return getDataTable(list); + } + + /** + * 导出用户类型列表 + */ + @RequiresPermissions("userrole:userrole:export") + @Log(title = "用户类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbUserRole tbUserRole) + { + List list = tbUserRoleService.selectTbUserRoleList(tbUserRole); + ExcelUtil util = new ExcelUtil(TbUserRole.class); + util.exportExcel(response, list, "用户类型数据"); + } + + /** + * 获取用户类型详细信息 + */ + @RequiresPermissions("userrole:userrole:query") + @GetMapping(value = "/{userRoleId}") + public AjaxResult getInfo(@PathVariable("userRoleId") Long userRoleId) + { + return success(tbUserRoleService.selectTbUserRoleByUserRoleId(userRoleId)); + } + + /** + * 新增用户类型 + */ + @RequiresPermissions("userrole:userrole:add") + @Log(title = "用户类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbUserRole tbUserRole) + { + return toAjax(tbUserRoleService.insertTbUserRole(tbUserRole)); + } + + /** + * 修改用户类型 + */ + @RequiresPermissions("userrole:userrole:edit") + @Log(title = "用户类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbUserRole tbUserRole) + { + return toAjax(tbUserRoleService.updateTbUserRole(tbUserRole)); + } + + /** + * 删除用户类型 + */ + @RequiresPermissions("userrole:userrole:remove") + @Log(title = "用户类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{userRoleIds}") + public AjaxResult remove(@PathVariable Long[] userRoleIds) + { + return toAjax(tbUserRoleService.deleteTbUserRoleByUserRoleIds(userRoleIds)); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/UserController.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/UserController.java new file mode 100644 index 00000000..1808605e --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/controller/UserController.java @@ -0,0 +1,60 @@ +package com.bwie.user.controller; + +import com.bwie.user.service.TbUserService; +import com.github.pagehelper.PageHelper; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.system.api.model.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author 苏海龙 + * @version 1.0 + * @description: TODO + * @date 2023/1/13 14:40 + */ + +@RestController +@RequestMapping("user") +@Slf4j +public class UserController extends BaseController { + @Resource + private TbUserService tbUserServicet; + @PostMapping("getuser") + private TableDataInfo getuser(@RequestBody PageInfoVo pageInfoVo){ + PageHelper.startPage(pageInfoVo.getPageNum(),pageInfoVo.getPageSize()); + List list=tbUserServicet.getuser(); + return getDataTable(list); + } + @PostMapping("deluser") + private AjaxResult deluser(@RequestBody IdVo idVo) { + return tbUserServicet.deluser(idVo); + } + @PostMapping("adduser") + private AjaxResult adduser(@RequestBody PhoneVo phoneVo){ + return tbUserServicet.adduser(phoneVo); + } + + @PostMapping("updateuser") + private AjaxResult updateuser(@RequestBody TbUserVo tbUserVo){ + return tbUserServicet.updateuser(tbUserVo); + } + //修改密码 + @PostMapping("uppassword") + private AjaxResult uppassword(@RequestBody PassWordCode passWordCode){ + return tbUserServicet.uppassword(passWordCode); + } + //登录 + @PostMapping("loginUser") + private AjaxResult loginuser(@RequestBody LoginVo loginVo){ + return tbUserServicet.loginuser(loginVo); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbMyrole.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbMyrole.java new file mode 100644 index 00000000..1925968d --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbMyrole.java @@ -0,0 +1,67 @@ +package com.bwie.user.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 角色对象 tb_myrole + * + * @author xs + * @date 2023-01-15 + */ +public class TbMyrole extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 角色id */ + private Long roleId; + + /** 角色名称 */ + @Excel(name = "角色名称") + private String roleName; + + /** 删除状态0:未删除1:已删除 */ + @Excel(name = "删除状态0:未删除1:已删除") + private Integer deleted; + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getRoleId() + { + return roleId; + } + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + public String getRoleName() + { + return roleName; + } + public void setDeleted(Integer deleted) + { + this.deleted = deleted; + } + + public Integer getDeleted() + { + return deleted; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("roleName", getRoleName()) + .append("deleted", getDeleted()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbPerm.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbPerm.java new file mode 100644 index 00000000..55f771b5 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbPerm.java @@ -0,0 +1,81 @@ +package com.bwie.user.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 权限对象 tb_perm + * + * @author ruoyi + * @date 2023-01-15 + */ +public class TbPerm extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long permId; + + /** 权限名称 */ + @Excel(name = "权限名称") + private String permName; + + /** 权限编码 */ + @Excel(name = "权限编码") + private String permCode; + + /** 删除状态0:未删除1:已删除 */ + @Excel(name = "删除状态0:未删除1:已删除") + private Integer deleted; + + public void setPermId(Long permId) + { + this.permId = permId; + } + + public Long getPermId() + { + return permId; + } + public void setPermName(String permName) + { + this.permName = permName; + } + + public String getPermName() + { + return permName; + } + public void setPermCode(String permCode) + { + this.permCode = permCode; + } + + public String getPermCode() + { + return permCode; + } + public void setDeleted(Integer deleted) + { + this.deleted = deleted; + } + + public Integer getDeleted() + { + return deleted; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("permId", getPermId()) + .append("permName", getPermName()) + .append("permCode", getPermCode()) + .append("deleted", getDeleted()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbRolePerm.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbRolePerm.java new file mode 100644 index 00000000..38b97c1b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbRolePerm.java @@ -0,0 +1,81 @@ +package com.bwie.user.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 角色权限对象 tb_role_perm + * + * @author xs + * @date 2023-01-15 + */ +public class TbRolePerm extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 角色权限id */ + private Long rolePermId; + + /** 角色ID */ + @Excel(name = "角色ID") + private Long roleId; + + /** 权限ID */ + @Excel(name = "权限ID") + private Long permId; + + /** 删除状态0:未删除1:已删除 */ + @Excel(name = "删除状态0:未删除1:已删除") + private Integer deleted; + + public void setRolePermId(Long rolePermId) + { + this.rolePermId = rolePermId; + } + + public Long getRolePermId() + { + return rolePermId; + } + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getRoleId() + { + return roleId; + } + public void setPermId(Long permId) + { + this.permId = permId; + } + + public Long getPermId() + { + return permId; + } + public void setDeleted(Integer deleted) + { + this.deleted = deleted; + } + + public Integer getDeleted() + { + return deleted; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("rolePermId", getRolePermId()) + .append("roleId", getRoleId()) + .append("permId", getPermId()) + .append("deleted", getDeleted()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUser.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUser.java new file mode 100644 index 00000000..cfe62fef --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUser.java @@ -0,0 +1,140 @@ +package com.bwie.user.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 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 Integer sex; + + /** + * 头像地址 + */ + private String avatar; + + /** + * 身份证(只有管理员能看到) + */ + private String userCard; + + /** + * 密码 + */ + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer 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 Integer 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/user/domain/TbUserBankcard.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUserBankcard.java new file mode 100644 index 00000000..b8df6b64 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUserBankcard.java @@ -0,0 +1,73 @@ +package com.bwie.user.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 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/user/domain/TbUserRole.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUserRole.java new file mode 100644 index 00000000..7745c8ca --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/domain/TbUserRole.java @@ -0,0 +1,69 @@ +package com.bwie.user.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 用户类型对象 tb_user_role + * + * @author xs + * @date 2023-01-15 + */ +public class TbUserRole extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 类型ID */ + private Long userRoleId; + + /** 用户角色类型 */ + @Excel(name = "用户角色类型") + private String userRoleName; + + /** 用户角色有哪些功能 */ + @Excel(name = "用户角色有哪些功能") + private String roleFunction; + + public void setUserRoleId(Long userRoleId) + { + this.userRoleId = userRoleId; + } + + public Long getUserRoleId() + { + return userRoleId; + } + public void setUserRoleName(String userRoleName) + { + this.userRoleName = userRoleName; + } + + public String getUserRoleName() + { + return userRoleName; + } + public void setRoleFunction(String roleFunction) + { + this.roleFunction = roleFunction; + } + + public String getRoleFunction() + { + return roleFunction; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userRoleId", getUserRoleId()) + .append("userRoleName", getUserRoleName()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("roleFunction", getRoleFunction()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbMyroleMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbMyroleMapper.java new file mode 100644 index 00000000..24cabdf1 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbMyroleMapper.java @@ -0,0 +1,61 @@ +package com.bwie.user.mapper; + +import java.util.List; +import com.bwie.user.domain.TbMyrole; + +/** + * 角色Mapper接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface TbMyroleMapper +{ + /** + * 查询角色 + * + * @param roleId 角色主键 + * @return 角色 + */ + public TbMyrole selectTbMyroleByRoleId(Long roleId); + + /** + * 查询角色列表 + * + * @param tbMyrole 角色 + * @return 角色集合 + */ + public List selectTbMyroleList(TbMyrole tbMyrole); + + /** + * 新增角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + public int insertTbMyrole(TbMyrole tbMyrole); + + /** + * 修改角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + public int updateTbMyrole(TbMyrole tbMyrole); + + /** + * 删除角色 + * + * @param roleId 角色主键 + * @return 结果 + */ + public int deleteTbMyroleByRoleId(Long roleId); + + /** + * 批量删除角色 + * + * @param roleIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbMyroleByRoleIds(Long[] roleIds); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbPermMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbPermMapper.java new file mode 100644 index 00000000..a44c4157 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbPermMapper.java @@ -0,0 +1,61 @@ +package com.bwie.user.mapper; + +import java.util.List; +import com.bwie.user.domain.TbPerm; + +/** + * 权限Mapper接口 + * + * @author ruoyi + * @date 2023-01-15 + */ +public interface TbPermMapper +{ + /** + * 查询权限 + * + * @param permId 权限主键 + * @return 权限 + */ + public TbPerm selectTbPermByPermId(Long permId); + + /** + * 查询权限列表 + * + * @param tbPerm 权限 + * @return 权限集合 + */ + public List selectTbPermList(TbPerm tbPerm); + + /** + * 新增权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + public int insertTbPerm(TbPerm tbPerm); + + /** + * 修改权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + public int updateTbPerm(TbPerm tbPerm); + + /** + * 删除权限 + * + * @param permId 权限主键 + * @return 结果 + */ + public int deleteTbPermByPermId(Long permId); + + /** + * 批量删除权限 + * + * @param permIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbPermByPermIds(Long[] permIds); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbRolePermMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbRolePermMapper.java new file mode 100644 index 00000000..fed0a1f6 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbRolePermMapper.java @@ -0,0 +1,61 @@ +package com.bwie.user.mapper; + +import java.util.List; +import com.bwie.user.domain.TbRolePerm; + +/** + * 角色权限Mapper接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface TbRolePermMapper +{ + /** + * 查询角色权限 + * + * @param rolePermId 角色权限主键 + * @return 角色权限 + */ + public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId); + + /** + * 查询角色权限列表 + * + * @param tbRolePerm 角色权限 + * @return 角色权限集合 + */ + public List selectTbRolePermList(TbRolePerm tbRolePerm); + + /** + * 新增角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + public int insertTbRolePerm(TbRolePerm tbRolePerm); + + /** + * 修改角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + public int updateTbRolePerm(TbRolePerm tbRolePerm); + + /** + * 删除角色权限 + * + * @param rolePermId 角色权限主键 + * @return 结果 + */ + public int deleteTbRolePermByRolePermId(Long rolePermId); + + /** + * 批量删除角色权限 + * + * @param rolePermIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbRolePermByRolePermIds(Long[] rolePermIds); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbUserMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbUserMapper.java new file mode 100644 index 00000000..65def1ec --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbUserMapper.java @@ -0,0 +1,18 @@ +package com.bwie.user.mapper; + +import com.bwie.user.domain.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/user/mapper/TbUserRoleMapper.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbUserRoleMapper.java new file mode 100644 index 00000000..db8accad --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/mapper/TbUserRoleMapper.java @@ -0,0 +1,61 @@ +package com.bwie.user.mapper; + +import java.util.List; +import com.bwie.user.domain.TbUserRole; + +/** + * 用户类型Mapper接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface TbUserRoleMapper +{ + /** + * 查询用户类型 + * + * @param userRoleId 用户类型主键 + * @return 用户类型 + */ + public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId); + + /** + * 查询用户类型列表 + * + * @param tbUserRole 用户类型 + * @return 用户类型集合 + */ + public List selectTbUserRoleList(TbUserRole tbUserRole); + + /** + * 新增用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + public int insertTbUserRole(TbUserRole tbUserRole); + + /** + * 修改用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + public int updateTbUserRole(TbUserRole tbUserRole); + + /** + * 删除用户类型 + * + * @param userRoleId 用户类型主键 + * @return 结果 + */ + public int deleteTbUserRoleByUserRoleId(Long userRoleId); + + /** + * 批量删除用户类型 + * + * @param userRoleIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbMyroleService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbMyroleService.java new file mode 100644 index 00000000..698bf80a --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbMyroleService.java @@ -0,0 +1,61 @@ +package com.bwie.user.service; + +import java.util.List; +import com.bwie.user.domain.TbMyrole; + +/** + * 角色Service接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface ITbMyroleService +{ + /** + * 查询角色 + * + * @param roleId 角色主键 + * @return 角色 + */ + public TbMyrole selectTbMyroleByRoleId(Long roleId); + + /** + * 查询角色列表 + * + * @param tbMyrole 角色 + * @return 角色集合 + */ + public List selectTbMyroleList(TbMyrole tbMyrole); + + /** + * 新增角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + public int insertTbMyrole(TbMyrole tbMyrole); + + /** + * 修改角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + public int updateTbMyrole(TbMyrole tbMyrole); + + /** + * 批量删除角色 + * + * @param roleIds 需要删除的角色主键集合 + * @return 结果 + */ + public int deleteTbMyroleByRoleIds(Long[] roleIds); + + /** + * 删除角色信息 + * + * @param roleId 角色主键 + * @return 结果 + */ + public int deleteTbMyroleByRoleId(Long roleId); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbPermService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbPermService.java new file mode 100644 index 00000000..72c8d968 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbPermService.java @@ -0,0 +1,61 @@ +package com.bwie.user.service; + +import java.util.List; +import com.bwie.user.domain.TbPerm; + +/** + * 权限Service接口 + * + * @author ruoyi + * @date 2023-01-15 + */ +public interface ITbPermService +{ + /** + * 查询权限 + * + * @param permId 权限主键 + * @return 权限 + */ + public TbPerm selectTbPermByPermId(Long permId); + + /** + * 查询权限列表 + * + * @param tbPerm 权限 + * @return 权限集合 + */ + public List selectTbPermList(TbPerm tbPerm); + + /** + * 新增权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + public int insertTbPerm(TbPerm tbPerm); + + /** + * 修改权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + public int updateTbPerm(TbPerm tbPerm); + + /** + * 批量删除权限 + * + * @param permIds 需要删除的权限主键集合 + * @return 结果 + */ + public int deleteTbPermByPermIds(Long[] permIds); + + /** + * 删除权限信息 + * + * @param permId 权限主键 + * @return 结果 + */ + public int deleteTbPermByPermId(Long permId); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbRolePermService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbRolePermService.java new file mode 100644 index 00000000..247df331 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbRolePermService.java @@ -0,0 +1,61 @@ +package com.bwie.user.service; + +import java.util.List; +import com.bwie.user.domain.TbRolePerm; + +/** + * 角色权限Service接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface ITbRolePermService +{ + /** + * 查询角色权限 + * + * @param rolePermId 角色权限主键 + * @return 角色权限 + */ + public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId); + + /** + * 查询角色权限列表 + * + * @param tbRolePerm 角色权限 + * @return 角色权限集合 + */ + public List selectTbRolePermList(TbRolePerm tbRolePerm); + + /** + * 新增角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + public int insertTbRolePerm(TbRolePerm tbRolePerm); + + /** + * 修改角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + public int updateTbRolePerm(TbRolePerm tbRolePerm); + + /** + * 批量删除角色权限 + * + * @param rolePermIds 需要删除的角色权限主键集合 + * @return 结果 + */ + public int deleteTbRolePermByRolePermIds(Long[] rolePermIds); + + /** + * 删除角色权限信息 + * + * @param rolePermId 角色权限主键 + * @return 结果 + */ + public int deleteTbRolePermByRolePermId(Long rolePermId); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbUserRoleService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbUserRoleService.java new file mode 100644 index 00000000..c2b1d18e --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/ITbUserRoleService.java @@ -0,0 +1,61 @@ +package com.bwie.user.service; + +import java.util.List; +import com.bwie.user.domain.TbUserRole; + +/** + * 用户类型Service接口 + * + * @author xs + * @date 2023-01-15 + */ +public interface ITbUserRoleService +{ + /** + * 查询用户类型 + * + * @param userRoleId 用户类型主键 + * @return 用户类型 + */ + public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId); + + /** + * 查询用户类型列表 + * + * @param tbUserRole 用户类型 + * @return 用户类型集合 + */ + public List selectTbUserRoleList(TbUserRole tbUserRole); + + /** + * 新增用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + public int insertTbUserRole(TbUserRole tbUserRole); + + /** + * 修改用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + public int updateTbUserRole(TbUserRole tbUserRole); + + /** + * 批量删除用户类型 + * + * @param userRoleIds 需要删除的用户类型主键集合 + * @return 结果 + */ + public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds); + + /** + * 删除用户类型信息 + * + * @param userRoleId 用户类型主键 + * @return 结果 + */ + public int deleteTbUserRoleByUserRoleId(Long userRoleId); +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/TbUserService.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/TbUserService.java new file mode 100644 index 00000000..bd9dbb9a --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/TbUserService.java @@ -0,0 +1,30 @@ +package com.bwie.user.service; + +import com.bwie.user.domain.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(PhoneVo phoneVo); + + 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/user/service/impl/TbMyroleServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbMyroleServiceImpl.java new file mode 100644 index 00000000..1e19ea9a --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbMyroleServiceImpl.java @@ -0,0 +1,96 @@ +package com.bwie.user.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bwie.user.mapper.TbMyroleMapper; +import com.bwie.user.domain.TbMyrole; +import com.bwie.user.service.ITbMyroleService; + +/** + * 角色Service业务层处理 + * + * @author xs + * @date 2023-01-15 + */ +@Service +public class TbMyroleServiceImpl implements ITbMyroleService +{ + @Autowired + private TbMyroleMapper tbMyroleMapper; + + /** + * 查询角色 + * + * @param roleId 角色主键 + * @return 角色 + */ + @Override + public TbMyrole selectTbMyroleByRoleId(Long roleId) + { + return tbMyroleMapper.selectTbMyroleByRoleId(roleId); + } + + /** + * 查询角色列表 + * + * @param tbMyrole 角色 + * @return 角色 + */ + @Override + public List selectTbMyroleList(TbMyrole tbMyrole) + { + return tbMyroleMapper.selectTbMyroleList(tbMyrole); + } + + /** + * 新增角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + @Override + public int insertTbMyrole(TbMyrole tbMyrole) + { + tbMyrole.setCreateTime(DateUtils.getNowDate()); + return tbMyroleMapper.insertTbMyrole(tbMyrole); + } + + /** + * 修改角色 + * + * @param tbMyrole 角色 + * @return 结果 + */ + @Override + public int updateTbMyrole(TbMyrole tbMyrole) + { + tbMyrole.setUpdateTime(DateUtils.getNowDate()); + return tbMyroleMapper.updateTbMyrole(tbMyrole); + } + + /** + * 批量删除角色 + * + * @param roleIds 需要删除的角色主键 + * @return 结果 + */ + @Override + public int deleteTbMyroleByRoleIds(Long[] roleIds) + { + return tbMyroleMapper.deleteTbMyroleByRoleIds(roleIds); + } + + /** + * 删除角色信息 + * + * @param roleId 角色主键 + * @return 结果 + */ + @Override + public int deleteTbMyroleByRoleId(Long roleId) + { + return tbMyroleMapper.deleteTbMyroleByRoleId(roleId); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbPermServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbPermServiceImpl.java new file mode 100644 index 00000000..66dd3592 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbPermServiceImpl.java @@ -0,0 +1,96 @@ +package com.bwie.user.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bwie.user.mapper.TbPermMapper; +import com.bwie.user.domain.TbPerm; +import com.bwie.user.service.ITbPermService; + +/** + * 权限Service业务层处理 + * + * @author ruoyi + * @date 2023-01-15 + */ +@Service +public class TbPermServiceImpl implements ITbPermService +{ + @Autowired + private TbPermMapper tbPermMapper; + + /** + * 查询权限 + * + * @param permId 权限主键 + * @return 权限 + */ + @Override + public TbPerm selectTbPermByPermId(Long permId) + { + return tbPermMapper.selectTbPermByPermId(permId); + } + + /** + * 查询权限列表 + * + * @param tbPerm 权限 + * @return 权限 + */ + @Override + public List selectTbPermList(TbPerm tbPerm) + { + return tbPermMapper.selectTbPermList(tbPerm); + } + + /** + * 新增权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + @Override + public int insertTbPerm(TbPerm tbPerm) + { + tbPerm.setCreateTime(DateUtils.getNowDate()); + return tbPermMapper.insertTbPerm(tbPerm); + } + + /** + * 修改权限 + * + * @param tbPerm 权限 + * @return 结果 + */ + @Override + public int updateTbPerm(TbPerm tbPerm) + { + tbPerm.setUpdateTime(DateUtils.getNowDate()); + return tbPermMapper.updateTbPerm(tbPerm); + } + + /** + * 批量删除权限 + * + * @param permIds 需要删除的权限主键 + * @return 结果 + */ + @Override + public int deleteTbPermByPermIds(Long[] permIds) + { + return tbPermMapper.deleteTbPermByPermIds(permIds); + } + + /** + * 删除权限信息 + * + * @param permId 权限主键 + * @return 结果 + */ + @Override + public int deleteTbPermByPermId(Long permId) + { + return tbPermMapper.deleteTbPermByPermId(permId); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbRolePermServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbRolePermServiceImpl.java new file mode 100644 index 00000000..bf150b49 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbRolePermServiceImpl.java @@ -0,0 +1,96 @@ +package com.bwie.user.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bwie.user.mapper.TbRolePermMapper; +import com.bwie.user.domain.TbRolePerm; +import com.bwie.user.service.ITbRolePermService; + +/** + * 角色权限Service业务层处理 + * + * @author xs + * @date 2023-01-15 + */ +@Service +public class TbRolePermServiceImpl implements ITbRolePermService +{ + @Autowired + private TbRolePermMapper tbRolePermMapper; + + /** + * 查询角色权限 + * + * @param rolePermId 角色权限主键 + * @return 角色权限 + */ + @Override + public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId) + { + return tbRolePermMapper.selectTbRolePermByRolePermId(rolePermId); + } + + /** + * 查询角色权限列表 + * + * @param tbRolePerm 角色权限 + * @return 角色权限 + */ + @Override + public List selectTbRolePermList(TbRolePerm tbRolePerm) + { + return tbRolePermMapper.selectTbRolePermList(tbRolePerm); + } + + /** + * 新增角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + @Override + public int insertTbRolePerm(TbRolePerm tbRolePerm) + { + tbRolePerm.setCreateTime(DateUtils.getNowDate()); + return tbRolePermMapper.insertTbRolePerm(tbRolePerm); + } + + /** + * 修改角色权限 + * + * @param tbRolePerm 角色权限 + * @return 结果 + */ + @Override + public int updateTbRolePerm(TbRolePerm tbRolePerm) + { + tbRolePerm.setUpdateTime(DateUtils.getNowDate()); + return tbRolePermMapper.updateTbRolePerm(tbRolePerm); + } + + /** + * 批量删除角色权限 + * + * @param rolePermIds 需要删除的角色权限主键 + * @return 结果 + */ + @Override + public int deleteTbRolePermByRolePermIds(Long[] rolePermIds) + { + return tbRolePermMapper.deleteTbRolePermByRolePermIds(rolePermIds); + } + + /** + * 删除角色权限信息 + * + * @param rolePermId 角色权限主键 + * @return 结果 + */ + @Override + public int deleteTbRolePermByRolePermId(Long rolePermId) + { + return tbRolePermMapper.deleteTbRolePermByRolePermId(rolePermId); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserRoleServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserRoleServiceImpl.java new file mode 100644 index 00000000..d86b0a15 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserRoleServiceImpl.java @@ -0,0 +1,96 @@ +package com.bwie.user.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bwie.user.mapper.TbUserRoleMapper; +import com.bwie.user.domain.TbUserRole; +import com.bwie.user.service.ITbUserRoleService; + +/** + * 用户类型Service业务层处理 + * + * @author xs + * @date 2023-01-15 + */ +@Service +public class TbUserRoleServiceImpl implements ITbUserRoleService +{ + @Autowired + private TbUserRoleMapper tbUserRoleMapper; + + /** + * 查询用户类型 + * + * @param userRoleId 用户类型主键 + * @return 用户类型 + */ + @Override + public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId) + { + return tbUserRoleMapper.selectTbUserRoleByUserRoleId(userRoleId); + } + + /** + * 查询用户类型列表 + * + * @param tbUserRole 用户类型 + * @return 用户类型 + */ + @Override + public List selectTbUserRoleList(TbUserRole tbUserRole) + { + return tbUserRoleMapper.selectTbUserRoleList(tbUserRole); + } + + /** + * 新增用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + @Override + public int insertTbUserRole(TbUserRole tbUserRole) + { + tbUserRole.setCreateTime(DateUtils.getNowDate()); + return tbUserRoleMapper.insertTbUserRole(tbUserRole); + } + + /** + * 修改用户类型 + * + * @param tbUserRole 用户类型 + * @return 结果 + */ + @Override + public int updateTbUserRole(TbUserRole tbUserRole) + { + tbUserRole.setUpdateTime(DateUtils.getNowDate()); + return tbUserRoleMapper.updateTbUserRole(tbUserRole); + } + + /** + * 批量删除用户类型 + * + * @param userRoleIds 需要删除的用户类型主键 + * @return 结果 + */ + @Override + public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds) + { + return tbUserRoleMapper.deleteTbUserRoleByUserRoleIds(userRoleIds); + } + + /** + * 删除用户类型信息 + * + * @param userRoleId 用户类型主键 + * @return 结果 + */ + @Override + public int deleteTbUserRoleByUserRoleId(Long userRoleId) + { + return tbUserRoleMapper.deleteTbUserRoleByUserRoleId(userRoleId); + } +} diff --git a/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserServiceImpl.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserServiceImpl.java new file mode 100644 index 00000000..c043324b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/service/impl/TbUserServiceImpl.java @@ -0,0 +1,146 @@ +package com.bwie.user.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.user.domain.TbUser; +import com.bwie.user.service.TbUserService; +import com.bwie.user.mapper.TbUserMapper; +import com.bwie.user.utils.DuanxinUtils; +import com.bwie.user.utils.TokenUtils; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.system.api.model.*; +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(PhoneVo phoneVo) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TbUser::getPhonenumber,phoneVo.getPhone()); + TbUser tbUser1 = tbUserMapper.selectOne(wrapper); + if(tbUser1!=null){ + return AjaxResult.error("手机号已被注册"); + } + Object o = redisTemplate.opsForValue().get(phoneVo.getPhone()); + if(!phoneVo.getCode().equals(o)){ + return AjaxResult.error("验证码不正确"); + } + TbUser tbUser = new TbUser(); + tbUser.setNickName("tbuser_"+RandomUtil.randomNumbers(4)); + tbUser.setPhonenumber(phoneVo.getPhone()); + String hashpw = BCrypt.hashpw("123456", BCrypt.gensalt()); + 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::getPhonenumber,loginVo.getPhone()); + TbUser tbUser = tbUserMapper.selectOne(wrapper); + if(tbUser==null){ + return AjaxResult.error("电话号没有被注册请先注册"); + } + //在进行判断code + String code =(String) redisTemplate.opsForValue().get(loginVo.getPhone()); + if(!loginVo.getCode().equals(code)) { + 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/user/utils/DuanxinUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/DuanxinUtils.java new file mode 100644 index 00000000..924bc21d --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/DuanxinUtils.java @@ -0,0 +1,46 @@ +package com.bwie.user.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/user/utils/HttpUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/HttpUtils.java new file mode 100644 index 00000000..0a353688 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/HttpUtils.java @@ -0,0 +1,311 @@ +package com.bwie.user.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/user/utils/TokenUtils.java b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/TokenUtils.java new file mode 100644 index 00000000..414ebdac --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/java/com/bwie/user/utils/TokenUtils.java @@ -0,0 +1,178 @@ +package com.bwie.user.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/TbUserMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/TbUserMapper.xml new file mode 100644 index 00000000..1747a718 --- /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/myrole/TbMyroleMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/myrole/TbMyroleMapper.xml new file mode 100644 index 00000000..6e552600 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/myrole/TbMyroleMapper.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + select role_id, role_name, deleted, create_time, update_time from tb_myrole + + + + + + + + insert into tb_myrole + + role_name, + deleted, + create_time, + update_time, + + + #{roleName}, + #{deleted}, + #{createTime}, + #{updateTime}, + + + + + update tb_myrole + + role_name = #{roleName}, + deleted = #{deleted}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where role_id = #{roleId} + + + + delete from tb_myrole where role_id = #{roleId} + + + + delete from tb_myrole where role_id in + + #{roleId} + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/perm/TbPermMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/perm/TbPermMapper.xml new file mode 100644 index 00000000..76b1725b --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/perm/TbPermMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + select perm_id, perm_name, perm_code, deleted, create_time, update_time from tb_perm + + + + + + + + insert into tb_perm + + perm_name, + perm_code, + deleted, + create_time, + update_time, + + + #{permName}, + #{permCode}, + #{deleted}, + #{createTime}, + #{updateTime}, + + + + + update tb_perm + + perm_name = #{permName}, + perm_code = #{permCode}, + deleted = #{deleted}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where perm_id = #{permId} + + + + delete from tb_perm where perm_id = #{permId} + + + + delete from tb_perm where perm_id in + + #{permId} + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/roleperm/TbRolePermMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/roleperm/TbRolePermMapper.xml new file mode 100644 index 00000000..50ea16b0 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/roleperm/TbRolePermMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + select role_perm_id, role_id, perm_id, deleted, create_time, update_time from tb_role_perm + + + + + + + + insert into tb_role_perm + + role_id, + perm_id, + deleted, + create_time, + update_time, + + + #{roleId}, + #{permId}, + #{deleted}, + #{createTime}, + #{updateTime}, + + + + + update tb_role_perm + + role_id = #{roleId}, + perm_id = #{permId}, + deleted = #{deleted}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where role_perm_id = #{rolePermId} + + + + delete from tb_role_perm where role_perm_id = #{rolePermId} + + + + delete from tb_role_perm where role_perm_id in + + #{rolePermId} + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-user/src/main/resources/mapper/userrole/TbUserRoleMapper.xml b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/userrole/TbUserRoleMapper.xml new file mode 100644 index 00000000..0b09a677 --- /dev/null +++ b/ruoyi-modules/ruoyi-user/src/main/resources/mapper/userrole/TbUserRoleMapper.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + select user_role_id, user_role_name, create_by, create_time, update_by, update_time, role_function from tb_user_role + + + + + + + + insert into tb_user_role + + user_role_name, + create_by, + create_time, + update_by, + update_time, + role_function, + + + #{userRoleName}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{roleFunction}, + + + + + update tb_user_role + + user_role_name = #{userRoleName}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + role_function = #{roleFunction}, + + where user_role_id = #{userRoleId} + + + + delete from tb_user_role where user_role_id = #{userRoleId} + + + + delete from tb_user_role where user_role_id in + + #{userRoleId} + + + \ No newline at end of file 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/api/potenza/borrower.js b/ruoyi-ui/src/api/potenza/borrower.js new file mode 100644 index 00000000..c2d1f070 --- /dev/null +++ b/ruoyi-ui/src/api/potenza/borrower.js @@ -0,0 +1,50 @@ +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 + }) +} + + +// 添加贷款 +export function insertBorrower(data) { + return request({ + url: '/potenza/borrower/loans', + method: 'post', + 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..e43d33fc --- /dev/null +++ b/ruoyi-ui/src/api/potenza/periods.js @@ -0,0 +1,53 @@ +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' + }) +} + + +export function detail(data) { + return request({ + url: '/potenza/periods/detail', + method: 'post', + data: data + }) +} 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/invest/firm/FirmList.vue b/ruoyi-ui/src/views/invest/firm/FirmList.vue new file mode 100644 index 00000000..eadb7b0f --- /dev/null +++ b/ruoyi-ui/src/views/invest/firm/FirmList.vue @@ -0,0 +1,287 @@ + + + diff --git a/ruoyi-ui/src/views/invest/invest/InvestList.vue b/ruoyi-ui/src/views/invest/invest/InvestList.vue new file mode 100644 index 00000000..8d7a6226 --- /dev/null +++ b/ruoyi-ui/src/views/invest/invest/InvestList.vue @@ -0,0 +1,309 @@ + + + diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index cdae8dc7..f195dbe1 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -3,49 +3,29 @@

若依后台管理系统

- + - + - + 记住密码 - + 登 录 登 录 中... @@ -97,7 +77,7 @@ export default { }, watch: { $route: { - handler: function(route) { + handler: function (route) { this.redirect = route.query && route.query.redirect; }, immediate: true @@ -132,6 +112,7 @@ export default { if (valid) { this.loading = true; if (this.loginForm.rememberMe) { + console.log(this.loginForm.rememberMe) Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); @@ -141,7 +122,7 @@ export default { Cookies.remove('rememberMe'); } this.$store.dispatch("Login", this.loginForm).then(() => { - this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); + this.$router.push({ path: this.redirect || "/" }).catch(() => { }); }).catch(() => { this.loading = false; if (this.captchaEnabled) { @@ -164,6 +145,7 @@ export default { background-image: url("../assets/images/login-background.jpg"); background-size: cover; } + .title { margin: 0px auto 30px auto; text-align: center; @@ -175,32 +157,39 @@ export default { background: #ffffff; width: 400px; padding: 25px 25px 5px 25px; + .el-input { height: 38px; + input { height: 38px; } } + .input-icon { height: 39px; width: 14px; margin-left: 2px; } } + .login-tip { font-size: 13px; text-align: center; color: #bfbfbf; } + .login-code { width: 33%; height: 38px; float: right; + img { cursor: pointer; vertical-align: middle; } } + .el-login-footer { height: 40px; line-height: 40px; @@ -213,6 +202,7 @@ export default { font-size: 12px; letter-spacing: 1px; } + .login-code-img { height: 38px; } diff --git a/ruoyi-ui/src/views/potenza/classes/index.vue b/ruoyi-ui/src/views/potenza/classes/index.vue new file mode 100644 index 00000000..2b102a1e --- /dev/null +++ b/ruoyi-ui/src/views/potenza/classes/index.vue @@ -0,0 +1,286 @@ + + + diff --git a/ruoyi-ui/src/views/potenza/loans/index.vue b/ruoyi-ui/src/views/potenza/loans/index.vue new file mode 100644 index 00000000..610af222 --- /dev/null +++ b/ruoyi-ui/src/views/potenza/loans/index.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/potenza/periods/index.vue b/ruoyi-ui/src/views/potenza/periods/index.vue new file mode 100644 index 00000000..b22f8a3b --- /dev/null +++ b/ruoyi-ui/src/views/potenza/periods/index.vue @@ -0,0 +1,210 @@ + + + diff --git a/ruoyi-ui/src/views/potenza/plan/index.vue b/ruoyi-ui/src/views/potenza/plan/index.vue new file mode 100644 index 00000000..3ab61886 --- /dev/null +++ b/ruoyi-ui/src/views/potenza/plan/index.vue @@ -0,0 +1,379 @@ + + +