diff --git a/fivegroup-auth/src/main/java/com/fivegroup/auth/service/SysPasswordService.java b/fivegroup-auth/src/main/java/com/fivegroup/auth/service/SysPasswordService.java
index 5fce48a..ff323c8 100644
--- a/fivegroup-auth/src/main/java/com/fivegroup/auth/service/SysPasswordService.java
+++ b/fivegroup-auth/src/main/java/com/fivegroup/auth/service/SysPasswordService.java
@@ -54,7 +54,7 @@ public class SysPasswordService {
throw new ServiceException(errMsg);
}
- if (!matches(user, password)) {
+ if (!matches(user, password)) {
retryCount = retryCount + 1;
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
diff --git a/fivegroup-modules/fivegroup-enter/pom.xml b/fivegroup-modules/fivegroup-enter/pom.xml
index 3a5593f..3b43338 100644
--- a/fivegroup-modules/fivegroup-enter/pom.xml
+++ b/fivegroup-modules/fivegroup-enter/pom.xml
@@ -24,6 +24,26 @@
org.springframework.boot
spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
+
+ org.projectlombok
+ lombok
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.0
+
+
+ com.github.pagehelper
+ pagehelper-spring-boot-starter
+ 1.4.6
+
com.alibaba.cloud
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MailConfig.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MailConfig.java
new file mode 100644
index 0000000..e30b60d
--- /dev/null
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MailConfig.java
@@ -0,0 +1,19 @@
+package com.fivegroup.enter.apect;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.mail.javamail.JavaMailSender;
+import org.springframework.mail.javamail.JavaMailSenderImpl;
+
+/**
+ * @author LiuJiaXin
+ * @version 2023/12/2 - 7:20
+ */
+@Configuration
+public class MailConfig {
+ @Bean
+ public JavaMailSender javaMailSender(){
+ JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
+ return mailSender;
+ }
+}
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MybatisPlusConfig.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MybatisPlusConfig.java
new file mode 100644
index 0000000..689a448
--- /dev/null
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/apect/MybatisPlusConfig.java
@@ -0,0 +1,32 @@
+package com.fivegroup.enter.apect;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * mybatis-plus分页
+ *
+ * @author LiuJiaXin
+ * @version 2023/12/1 - 19:00
+ */
+@Configuration
+@EnableTransactionManagement
+public class MybatisPlusConfig {
+ @Bean
+ public MybatisPlusInterceptor mybatisPlusInterceptor(){
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+ PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
+ // paginationInnerInterceptor.setOptimizeJoin(true);
+ paginationInnerInterceptor.setDbType(DbType.MYSQL);
+ paginationInnerInterceptor.setOverflow(true);
+ interceptor.addInnerInterceptor(paginationInnerInterceptor);
+ OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor = new OptimisticLockerInnerInterceptor();
+ interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor);
+ return interceptor;
+ }
+}
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/config/EmailUtil.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/config/EmailUtil.java
new file mode 100644
index 0000000..d8200f3
--- /dev/null
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/config/EmailUtil.java
@@ -0,0 +1,97 @@
+package com.fivegroup.enter.config;//package com.bwie.system.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.mail.javamail.JavaMailSender;
+import org.springframework.mail.javamail.MimeMessageHelper;
+import org.springframework.stereotype.Component;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+
+@Component
+public class EmailUtil {
+
+ @Autowired
+ private JavaMailSender javaMailSender;
+
+ @CachePut(value = "aaa",key = "#email")
+ public String saveCode(String code,String email){
+ return code;
+ }
+
+ @Cacheable(value = "aaa",key = "#email")
+ public String getCode(String email){
+ return null;
+ }
+
+ //邮件发送 ===》封装的验证码发送方法
+ public void sendCodeByEmail(String code,String email){
+
+ MimeMessage mimeMessage = javaMailSender.createMimeMessage();
+
+ try {
+ MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
+ helper.setSubject("验证码通知");
+ //helper.setText("点击",true);
+ helper.setText("您的验证码是:"+code);
+ helper.setFrom("2779625738@qq.com");
+ helper.setTo(email);
+ helper.setTo(email);
+
+ javaMailSender.send(mimeMessage);
+ } catch (MessagingException e) {
+ e.printStackTrace();
+ }
+ }
+
+// 图片
+// @Test
+// public void test(){
+//
+// MimeMessage mimeMessage = javaMailSender.createMimeMessage();
+// try {
+// MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
+// //标题
+// helper.setSubject("通知");
+// //内容
+// helper.setText("你好");
+// //发件人
+// helper.setFrom("2730874693@qq.com");
+// //收件人
+// helper.setTo("2730874693@qq.com");
+// //文件
+// helper.addAttachment("阿里云.txt",new File("C:\Users\1\Desktop"));
+//
+// javaMailSender.send(mimeMessage);
+// } catch (MessagingException e) {
+// e.printStackTrace();
+// }
+// }
+
+
+// 文件
+// @Test
+// public void test1(){
+//
+// MimeMessage mimeMessage = javaMailSender.createMimeMessage();
+// try {
+// MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
+// //标题
+// helper.setSubject("通知");
+// //内容
+// helper.setText("你好,给你看张图片
" + "
",true);
+// //发件人
+// helper.setFrom("2736321299@qq.com");
+// //收件人
+// helper.setTo("2736321299@qq.com");
+// //图片
+// helper.addInline("opp",new FileSystemResource(new File("C:\Users\1\Desktop\213.jpg")));
+//
+// javaMailSender.send(mimeMessage);
+// } catch (MessagingException e) {
+// e.printStackTrace();
+// }
+// }
+}
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/AaaController.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/AaaController.java
new file mode 100644
index 0000000..e4797a8
--- /dev/null
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/AaaController.java
@@ -0,0 +1,110 @@
+package com.fivegroup.enter.controller;
+
+import com.fivegroup.common.core.domain.Result;
+import com.fivegroup.common.system.domain.SysUser;
+import com.fivegroup.enter.apect.WebLog;
+import com.fivegroup.enter.demo.Center;
+import com.fivegroup.enter.service.AaaService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.support.SimpleTriggerContext;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author LiuJiaXin
+ * @version 2023/12/2 - 9:03
+ */
+@RestController
+public class AaaController {
+ @Autowired
+ private AaaService aaaService;
+
+ /**
+ * 若依 ======管理员找到对应的企业 点击生成账号 密码 进行随机生成并修改
+ */
+ @PostMapping("/updateNamePassword")
+ @WebLog(description = "随机生成账号和密码")
+ public Result updateNamePassword(@RequestBody SysUser sysUser){
+ aaaService.updateNamePassword(sysUser);
+ return Result.success();
+ }
+
+ /**
+ * 根据用户id查询用户信息
+ * @param sysUser
+ * @return
+ */
+
+ @PostMapping("/showSysUser")
+ @WebLog(description = "展示所有企业列表,倒序")
+ public Result> showSysUser(@RequestBody SysUser sysUser){
+ List list =aaaService.showSysUser(sysUser);
+ return Result.success(list);
+ }
+
+ /**
+ * 根据用户邮箱发送账号密码
+ * @param email
+ * @return
+ */
+ @PostMapping("/findByEmail/{email}")
+ @WebLog(description = "根据用户邮箱发送账号密码")
+ public Result findByEmail(@PathVariable String email){
+ aaaService.findByEmail(email);
+ return Result.success();
+ }
+
+ /**
+ * 根据id修改中间表的审核状态 修改为待审核状态
+ * @param userId
+ * @return
+ */
+ @PostMapping("/updateRole/{userId}")
+ @WebLog(description = "根据用户id修改用户审核")
+ public Result updateRole(@PathVariable Integer userId){
+ aaaService.updateRole(userId);
+ return Result.success();
+ }
+
+ /**
+ * 企业根据注册id修改账号密码
+ * @param sysUser
+ * @return
+ */
+ @PostMapping("updateUserNamePassword")
+ @WebLog(description = "企业修改账号和密码")
+ public Result updateUserNamePassword(@RequestBody SysUser sysUser){
+ aaaService.updateUserNamePassword(sysUser);
+ return Result.success();
+ }
+
+ /**
+ * 管理员审核企业状态成为激活状态
+ * @param userId
+ * @return
+ */
+ @PostMapping("updateRoleId/{userId}")
+ @WebLog(description = "管理员审核企业状态为已激活状态")
+ public Result updateRoleId(@PathVariable Integer userId){
+ aaaService.updateRoleId(userId);
+ return Result.success();
+ }
+
+ /**
+ * 添加中间表
+ * @param center
+ * @return
+ */
+ @PostMapping("addNumber")
+ @WebLog(description = "添加中间表")
+ public Result addNumber(@RequestBody Center center){
+ aaaService.addNumber(center);
+ return Result.success();
+ }
+
+
+}
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/FirmController.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/FirmController.java
index 1a11a38..d2b8c35 100644
--- a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/FirmController.java
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/FirmController.java
@@ -31,11 +31,31 @@ public class FirmController {
@PostMapping("/addFirm")
@WebLog(description = "公司注册")
public Result addFirm(@RequestBody Firm firm){
- firmService.addFirm(firm);
+ firmService.save(firm);
return Result.success();
}
+ @PostMapping("/findBykeeperEmail/{keeperEmail}")
+ @WebLog(description = "邮箱号给企业发送账号和密码")
+ public Result findBykeeperEmail(@PathVariable String keeperEmail){
+ return Result.success();
+ }
+ @GetMapping("/firmShow")
+ @WebLog(description = "展示公司列表")
+ public Result> firmShow(){
+ List list = firmService.list();
+ return Result.success(list);
+ }
+
+
+
+ /* @PostMapping("firmShowPageinfo")
+ @WebLog(description = "分页展示公司列表")
+ public void firmShow(@PathVariable Integer gen){
+
+ }
+*/
/**
* 查询公司 最主要用于车辆入驻的动态下拉框使用
* @return
@@ -52,10 +72,10 @@ public class FirmController {
* @param firmId
* @return
*/
- @PostMapping("/delFirm/{firmId}")
+ @GetMapping("/delFirm")
@WebLog(description = "注销公司")
- public Result delFirm(@PathVariable Integer firmId){
- firmService.delFirm(firmId);
+ public Result delFirm(@RequestParam(value = "firmId") Integer firmId){
+ firmService.removeById(firmId);
return Result.success();
}
@@ -133,4 +153,7 @@ public class FirmController {
firmService.selCar(carVin);
return Result.success();
}
+
+
+
}
diff --git a/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/KeeperController.java b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/KeeperController.java
new file mode 100644
index 0000000..5dcc848
--- /dev/null
+++ b/fivegroup-modules/fivegroup-enter/src/main/java/com/fivegroup/enter/controller/KeeperController.java
@@ -0,0 +1,203 @@
+package com.fivegroup.enter.controller;
+
+import com.fivegroup.common.core.domain.Result;
+import com.fivegroup.enter.apect.WebLog;
+import com.fivegroup.enter.demo.Check;
+import com.fivegroup.enter.demo.Keeper;
+import com.fivegroup.enter.service.KeeperService;
+import org.apache.catalina.LifecycleState;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.connection.ReactiveSubscription;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 企业
+ *
+ * @author LiuJiaXin
+ * @version 2023/12/1 - 23:07
+ */
+@RestController
+@RequestMapping("/keeper")
+public class KeeperController {
+ @Autowired
+ private KeeperService keeperService;
+ /**
+ * 若依 ======管理员找到对应的企业 点击生成账号 密码 进行随机生成并修改
+ */
+ @PostMapping("/updateKeeperAdmin/{userId}")
+ @WebLog(description = "随机生成账号和密码")
+ public Result updateKeeperAdmin(@PathVariable Integer userId){
+ keeperService.updateKeeperAdmin(userId);
+ return Result.success();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+
+
+
+
+
+
+
+
+
+ /**
+ * 管理员手动添加企业基本信息(企业名称+企业注册时间+企业邮箱)
+ * @param keeper
+ * @return
+ */
+ @PostMapping("/instertKeeper")
+ @WebLog(description = "企业入驻")
+ public Result instertKeeper(@RequestBody Keeper keeper){
+ keeperService.save(keeper);
+ return Result.success();
+ }
+
+
+
+
+
+
+ @PostMapping("/findByKeeperEmail/{keeperEmail}")
+ @WebLog(description = "获取企业的账号密码通过邮箱的格式发送给企业")
+ public Result findByKeeperEmail(@PathVariable String keeperEmail){
+ keeperService.findByKeeperEmail(keeperEmail);
+ return Result.success();
+ }
+
+
+
+
+
+
+
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /**
+ * 添加企业
+ * @param keeper
+ * @return
+ */
+ @RequestMapping("/addKepper")
+ @WebLog(description = "添加企业信息")
+ public Result addKepper(@RequestBody Keeper keeper){
+ keeperService.addKeeper(keeper);
+ Result