Commit a2cf5978fdbbb495299cc9eace8073813441a37d
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/order/erp/controller/OrderProfitController.java
Showing
20 changed files
with
159 additions
and
109 deletions
sql/init.sql
@@ -314,6 +314,7 @@ CREATE TABLE `admin_user` ( | @@ -314,6 +314,7 @@ CREATE TABLE `admin_user` ( | ||
314 | `avatar_name` varchar(255) DEFAULT NULL COMMENT '头像地址', | 314 | `avatar_name` varchar(255) DEFAULT NULL COMMENT '头像地址', |
315 | `avatar_path` varchar(255) DEFAULT NULL COMMENT '头像真实路径', | 315 | `avatar_path` varchar(255) DEFAULT NULL COMMENT '头像真实路径', |
316 | `password` varchar(255) DEFAULT NULL COMMENT '密码', | 316 | `password` varchar(255) DEFAULT NULL COMMENT '密码', |
317 | + `remark` varchar(256) DEFAULT NULL COMMENT '备注信息', | ||
317 | `is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号', | 318 | `is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号', |
318 | `pwd_reset_time` DATETIME DEFAULT NULL COMMENT '修改密码的时间', | 319 | `pwd_reset_time` DATETIME DEFAULT NULL COMMENT '修改密码的时间', |
319 | `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | 320 | `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', |
src/main/java/com/order/erp/AdminApplication.java
@@ -12,6 +12,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | @@ -12,6 +12,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | ||
12 | import org.springframework.context.annotation.Bean; | 12 | import org.springframework.context.annotation.Bean; |
13 | import org.springframework.scheduling.annotation.EnableAsync; | 13 | import org.springframework.scheduling.annotation.EnableAsync; |
14 | import org.springframework.transaction.annotation.EnableTransactionManagement; | 14 | import org.springframework.transaction.annotation.EnableTransactionManagement; |
15 | +import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
15 | 16 | ||
16 | /** | 17 | /** |
17 | * @author: xms | 18 | * @author: xms |
@@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; | @@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
23 | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.order.erp"}) | 24 | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.order.erp"}) |
24 | @MapperScan("com.order.erp.**.mapper") | 25 | @MapperScan("com.order.erp.**.mapper") |
25 | @EnableTransactionManagement | 26 | @EnableTransactionManagement |
27 | +@EnableSwagger2 | ||
26 | public class AdminApplication { | 28 | public class AdminApplication { |
27 | 29 | ||
28 | private static void setLogPath() { | 30 | private static void setLogPath() { |
src/main/java/com/order/erp/config/WebConfig.java
@@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration; | @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration; | ||
7 | import org.springframework.http.MediaType; | 7 | import org.springframework.http.MediaType; |
8 | import org.springframework.http.converter.HttpMessageConverter; | 8 | import org.springframework.http.converter.HttpMessageConverter; |
9 | import org.springframework.http.converter.StringHttpMessageConverter; | 9 | import org.springframework.http.converter.StringHttpMessageConverter; |
10 | +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | ||
10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | 11 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
11 | 12 | ||
12 | import java.nio.charset.StandardCharsets; | 13 | import java.nio.charset.StandardCharsets; |
@@ -81,4 +82,15 @@ public class WebConfig implements WebMvcConfigurer { | @@ -81,4 +82,15 @@ public class WebConfig implements WebMvcConfigurer { | ||
81 | fastConverter.setDefaultCharset(StandardCharsets.UTF_8); | 82 | fastConverter.setDefaultCharset(StandardCharsets.UTF_8); |
82 | return fastConverter; | 83 | return fastConverter; |
83 | } | 84 | } |
85 | + | ||
86 | + @Override | ||
87 | + public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
88 | + registry.addResourceHandler("/**").addResourceLocations( | ||
89 | + "classpath:/static/"); | ||
90 | + registry.addResourceHandler("swagger-ui.html").addResourceLocations( | ||
91 | + "classpath:/META-INF/resources/"); | ||
92 | + registry.addResourceHandler("/webjars/**").addResourceLocations( | ||
93 | + "classpath:/META-INF/resources/webjars/"); | ||
94 | + WebMvcConfigurer.super.addResourceHandlers(registry); | ||
95 | + } | ||
84 | } | 96 | } |
src/main/java/com/order/erp/controller/AuditController.java
@@ -6,6 +6,8 @@ import com.order.erp.domain.AuditStatusEnum; | @@ -6,6 +6,8 @@ import com.order.erp.domain.AuditStatusEnum; | ||
6 | import com.order.erp.domain.vo.order.AuditVO; | 6 | import com.order.erp.domain.vo.order.AuditVO; |
7 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; | 7 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; |
8 | import com.order.erp.service.order.OrderFieldLockApplyService; | 8 | import com.order.erp.service.order.OrderFieldLockApplyService; |
9 | +import io.swagger.annotations.Api; | ||
10 | +import io.swagger.annotations.ApiOperation; | ||
9 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
10 | import org.springframework.web.bind.annotation.PostMapping; | 12 | import org.springframework.web.bind.annotation.PostMapping; |
11 | import org.springframework.web.bind.annotation.RequestBody; | 13 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -20,6 +22,7 @@ import javax.annotation.Resource; | @@ -20,6 +22,7 @@ import javax.annotation.Resource; | ||
20 | * @author makejava | 22 | * @author makejava |
21 | * @since 2023-09-08 15:26:43 | 23 | * @since 2023-09-08 15:26:43 |
22 | */ | 24 | */ |
25 | +@Api(tags = "审批管理") | ||
23 | @RestController | 26 | @RestController |
24 | @RequestMapping("/order/erp/audit") | 27 | @RequestMapping("/order/erp/audit") |
25 | public class AuditController { | 28 | public class AuditController { |
@@ -36,6 +39,7 @@ public class AuditController { | @@ -36,6 +39,7 @@ public class AuditController { | ||
36 | * @return 查询结果 | 39 | * @return 查询结果 |
37 | */ | 40 | */ |
38 | @PostMapping("/list_by_page") | 41 | @PostMapping("/list_by_page") |
42 | + @ApiOperation("分页查询") | ||
39 | @AnonymousAccess | 43 | @AnonymousAccess |
40 | public ServerResult listByPage(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { | 44 | public ServerResult listByPage(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
41 | return applyService.listByPage(queryVO); | 45 | return applyService.listByPage(queryVO); |
@@ -47,6 +51,7 @@ public class AuditController { | @@ -47,6 +51,7 @@ public class AuditController { | ||
47 | * @param queryVO 查询条件 | 51 | * @param queryVO 查询条件 |
48 | * @return 查询结果 | 52 | * @return 查询结果 |
49 | */ | 53 | */ |
54 | + @ApiOperation("待审批列表") | ||
50 | @PostMapping("/wait_audit_list") | 55 | @PostMapping("/wait_audit_list") |
51 | @AnonymousAccess | 56 | @AnonymousAccess |
52 | public ServerResult waitAuditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { | 57 | public ServerResult waitAuditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
@@ -60,6 +65,7 @@ public class AuditController { | @@ -60,6 +65,7 @@ public class AuditController { | ||
60 | * @param queryVO 查询条件 | 65 | * @param queryVO 查询条件 |
61 | * @return 查询结果 | 66 | * @return 查询结果 |
62 | */ | 67 | */ |
68 | + @ApiOperation("已审批列表") | ||
63 | @PostMapping("/audit_list") | 69 | @PostMapping("/audit_list") |
64 | @AnonymousAccess | 70 | @AnonymousAccess |
65 | public ServerResult auditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { | 71 | public ServerResult auditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
@@ -73,6 +79,7 @@ public class AuditController { | @@ -73,6 +79,7 @@ public class AuditController { | ||
73 | * @param auditVO 查询条件 | 79 | * @param auditVO 查询条件 |
74 | * @return 查询结果 | 80 | * @return 查询结果 |
75 | */ | 81 | */ |
82 | + @ApiOperation("审核") | ||
76 | @PostMapping("/do_audit") | 83 | @PostMapping("/do_audit") |
77 | @AnonymousAccess | 84 | @AnonymousAccess |
78 | public ServerResult doAudit(@RequestBody @Validated AuditVO auditVO) { | 85 | public ServerResult doAudit(@RequestBody @Validated AuditVO auditVO) { |
src/main/java/com/order/erp/controller/CaptchaController.java
@@ -6,6 +6,8 @@ import com.order.erp.common.utils.ImgCaptchaUtils; | @@ -6,6 +6,8 @@ import com.order.erp.common.utils.ImgCaptchaUtils; | ||
6 | import com.order.erp.common.utils.SmsUtils; | 6 | import com.order.erp.common.utils.SmsUtils; |
7 | import com.order.erp.domain.vo.CaptchaMessageVO; | 7 | import com.order.erp.domain.vo.CaptchaMessageVO; |
8 | import com.wf.captcha.ArithmeticCaptcha; | 8 | import com.wf.captcha.ArithmeticCaptcha; |
9 | +import io.swagger.annotations.Api; | ||
10 | +import io.swagger.annotations.ApiOperation; | ||
9 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
10 | import org.springframework.web.bind.annotation.PostMapping; | 12 | import org.springframework.web.bind.annotation.PostMapping; |
11 | import org.springframework.web.bind.annotation.RequestBody; | 13 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -23,6 +25,7 @@ import java.util.Map; | @@ -23,6 +25,7 @@ import java.util.Map; | ||
23 | * @since 2023-08-22 17:02:39 | 25 | * @since 2023-08-22 17:02:39 |
24 | */ | 26 | */ |
25 | @RestController | 27 | @RestController |
28 | +@Api(tags = "验证码") | ||
26 | @RequestMapping("/order/erp/captcha") | 29 | @RequestMapping("/order/erp/captcha") |
27 | public class CaptchaController { | 30 | public class CaptchaController { |
28 | 31 | ||
@@ -39,6 +42,7 @@ public class CaptchaController { | @@ -39,6 +42,7 @@ public class CaptchaController { | ||
39 | * @return 查询结果 | 42 | * @return 查询结果 |
40 | */ | 43 | */ |
41 | @AnonymousAccess | 44 | @AnonymousAccess |
45 | + @ApiOperation("获取验证码") | ||
42 | @PostMapping("/send_captcha_code") | 46 | @PostMapping("/send_captcha_code") |
43 | public ServerResult sendCaptchaCode(@RequestBody @Validated CaptchaMessageVO msgVo) { | 47 | public ServerResult sendCaptchaCode(@RequestBody @Validated CaptchaMessageVO msgVo) { |
44 | return smsUtils.sendCaptchaCode(msgVo); | 48 | return smsUtils.sendCaptchaCode(msgVo); |
@@ -50,6 +54,7 @@ public class CaptchaController { | @@ -50,6 +54,7 @@ public class CaptchaController { | ||
50 | * @return 查询结果 | 54 | * @return 查询结果 |
51 | */ | 55 | */ |
52 | @AnonymousAccess | 56 | @AnonymousAccess |
57 | + @ApiOperation("获取图片验证码") | ||
53 | @PostMapping("/get_img_captcha_code") | 58 | @PostMapping("/get_img_captcha_code") |
54 | public ServerResult getImgCaptchaCode() { | 59 | public ServerResult getImgCaptchaCode() { |
55 | // 算术类型 https://gitee.com/whvse/EasyCaptcha | 60 | // 算术类型 https://gitee.com/whvse/EasyCaptcha |
src/main/java/com/order/erp/controller/IndexController.java
@@ -7,6 +7,8 @@ import com.order.erp.service.order.OrderBaseInfoService; | @@ -7,6 +7,8 @@ import com.order.erp.service.order.OrderBaseInfoService; | ||
7 | import com.order.erp.service.order.OrderCompletionReportService; | 7 | import com.order.erp.service.order.OrderCompletionReportService; |
8 | import com.order.erp.service.order.OrderInspectionStageService; | 8 | import com.order.erp.service.order.OrderInspectionStageService; |
9 | import com.order.erp.service.order.OrderProfitAnalysisService; | 9 | import com.order.erp.service.order.OrderProfitAnalysisService; |
10 | +import io.swagger.annotations.Api; | ||
11 | +import io.swagger.annotations.ApiOperation; | ||
10 | import org.springframework.web.bind.annotation.GetMapping; | 12 | import org.springframework.web.bind.annotation.GetMapping; |
11 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
12 | import org.springframework.web.bind.annotation.RestController; | 14 | import org.springframework.web.bind.annotation.RestController; |
@@ -22,6 +24,7 @@ import java.util.Map; | @@ -22,6 +24,7 @@ import java.util.Map; | ||
22 | * @description 首页 | 24 | * @description 首页 |
23 | * @date 2023/10/23 16:44:55 | 25 | * @date 2023/10/23 16:44:55 |
24 | */ | 26 | */ |
27 | +@Api(tags = "首页") | ||
25 | @RestController | 28 | @RestController |
26 | @RequestMapping("/order/erp/index") | 29 | @RequestMapping("/order/erp/index") |
27 | public class IndexController { | 30 | public class IndexController { |
@@ -39,6 +42,7 @@ public class IndexController { | @@ -39,6 +42,7 @@ public class IndexController { | ||
39 | OrderCompletionReportService orderCompletionReportService; | 42 | OrderCompletionReportService orderCompletionReportService; |
40 | 43 | ||
41 | @GetMapping("/data") | 44 | @GetMapping("/data") |
45 | + @ApiOperation("首页统计数据") | ||
42 | public ServerResult getData(){ | 46 | public ServerResult getData(){ |
43 | //订单总完成数 | 47 | //订单总完成数 |
44 | long orderTotalFinished = orderBaseInfoService.countByOrderStatus(OrderStatusEnum.ORDER_FINISH.getStatus()); | 48 | long orderTotalFinished = orderBaseInfoService.countByOrderStatus(OrderStatusEnum.ORDER_FINISH.getStatus()); |
@@ -79,6 +83,7 @@ public class IndexController { | @@ -79,6 +83,7 @@ public class IndexController { | ||
79 | } | 83 | } |
80 | 84 | ||
81 | @GetMapping("/chartData") | 85 | @GetMapping("/chartData") |
86 | + @ApiOperation("首页订单趋势") | ||
82 | public ServerResult getChartData(){ | 87 | public ServerResult getChartData(){ |
83 | //订单趋势数据 | 88 | //订单趋势数据 |
84 | List<Map<String,Integer>> chartData = orderBaseInfoService.countDaysOrder(); | 89 | List<Map<String,Integer>> chartData = orderBaseInfoService.countDaysOrder(); |
src/main/java/com/order/erp/controller/LocalStorageController.java
@@ -3,6 +3,7 @@ package com.order.erp.controller; | @@ -3,6 +3,7 @@ package com.order.erp.controller; | ||
3 | import com.order.erp.common.annotation.AnonymousAccess; | 3 | import com.order.erp.common.annotation.AnonymousAccess; |
4 | import com.order.erp.common.constant.ServerResult; | 4 | import com.order.erp.common.constant.ServerResult; |
5 | import com.order.erp.service.LocalStorageService; | 5 | import com.order.erp.service.LocalStorageService; |
6 | +import io.swagger.annotations.Api; | ||
6 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; |
7 | import org.springframework.web.bind.annotation.PostMapping; | 8 | import org.springframework.web.bind.annotation.PostMapping; |
8 | import org.springframework.web.bind.annotation.RequestMapping; | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
@@ -16,6 +17,7 @@ import javax.annotation.Resource; | @@ -16,6 +17,7 @@ import javax.annotation.Resource; | ||
16 | * | 17 | * |
17 | */ | 18 | */ |
18 | @RestController | 19 | @RestController |
20 | +@Api(tags = "文件上传") | ||
19 | @RequestMapping("/api/localStorage") | 21 | @RequestMapping("/api/localStorage") |
20 | public class LocalStorageController { | 22 | public class LocalStorageController { |
21 | 23 |
src/main/java/com/order/erp/controller/LoginController.java
@@ -7,6 +7,7 @@ import com.order.erp.log.Log; | @@ -7,6 +7,7 @@ import com.order.erp.log.Log; | ||
7 | import com.order.erp.security.TokenProvider; | 7 | import com.order.erp.security.TokenProvider; |
8 | import com.order.erp.security.service.OnlineUserService; | 8 | import com.order.erp.security.service.OnlineUserService; |
9 | import com.order.erp.service.admin.AdminUserService; | 9 | import com.order.erp.service.admin.AdminUserService; |
10 | +import io.swagger.annotations.ApiOperation; | ||
10 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
11 | import org.springframework.web.bind.annotation.PostMapping; | 12 | import org.springframework.web.bind.annotation.PostMapping; |
12 | import org.springframework.web.bind.annotation.RequestBody; | 13 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -37,6 +38,7 @@ public class LoginController { | @@ -37,6 +38,7 @@ public class LoginController { | ||
37 | * @return 查询结果 | 38 | * @return 查询结果 |
38 | */ | 39 | */ |
39 | @AnonymousAccess | 40 | @AnonymousAccess |
41 | + @ApiOperation("手机注册") | ||
40 | @PostMapping("/phone_register") | 42 | @PostMapping("/phone_register") |
41 | public ServerResult phoneRegister(@RequestBody @Validated AdminUserRegisterVO registerVO) { | 43 | public ServerResult phoneRegister(@RequestBody @Validated AdminUserRegisterVO registerVO) { |
42 | return userService.phoneRegister(registerVO); | 44 | return userService.phoneRegister(registerVO); |
@@ -49,6 +51,7 @@ public class LoginController { | @@ -49,6 +51,7 @@ public class LoginController { | ||
49 | * @return 查询结果 | 51 | * @return 查询结果 |
50 | */ | 52 | */ |
51 | @AnonymousAccess | 53 | @AnonymousAccess |
54 | + @ApiOperation("手机登录") | ||
52 | @PostMapping("/login_by_phone") | 55 | @PostMapping("/login_by_phone") |
53 | public ServerResult loginByPhone(@RequestBody @Validated AdminUserLoginByPhoneVO loginByPhoneVO) { | 56 | public ServerResult loginByPhone(@RequestBody @Validated AdminUserLoginByPhoneVO loginByPhoneVO) { |
54 | return userService.loginByPhone(loginByPhoneVO); | 57 | return userService.loginByPhone(loginByPhoneVO); |
@@ -62,6 +65,7 @@ public class LoginController { | @@ -62,6 +65,7 @@ public class LoginController { | ||
62 | */ | 65 | */ |
63 | @AnonymousAccess | 66 | @AnonymousAccess |
64 | @Log("用户登录") | 67 | @Log("用户登录") |
68 | + @ApiOperation("用户登录") | ||
65 | @PostMapping("/login_by_pwd") | 69 | @PostMapping("/login_by_pwd") |
66 | public ServerResult loginByPwd(@RequestBody @Validated AdminUserLoginByPwdVO loginByPwdVO) { | 70 | public ServerResult loginByPwd(@RequestBody @Validated AdminUserLoginByPwdVO loginByPwdVO) { |
67 | return userService.loginByPwd(loginByPwdVO); | 71 | return userService.loginByPwd(loginByPwdVO); |
@@ -86,6 +90,7 @@ public class LoginController { | @@ -86,6 +90,7 @@ public class LoginController { | ||
86 | * @return 查询结果 | 90 | * @return 查询结果 |
87 | */ | 91 | */ |
88 | @AnonymousAccess | 92 | @AnonymousAccess |
93 | + @ApiOperation("用户登录") | ||
89 | @PostMapping("/password_modify") | 94 | @PostMapping("/password_modify") |
90 | public ServerResult passwordModify(@RequestBody @Validated AdminUserModifyPwdVO modifyPwdVO) { | 95 | public ServerResult passwordModify(@RequestBody @Validated AdminUserModifyPwdVO modifyPwdVO) { |
91 | return userService.passwordModify(modifyPwdVO); | 96 | return userService.passwordModify(modifyPwdVO); |
@@ -98,6 +103,7 @@ public class LoginController { | @@ -98,6 +103,7 @@ public class LoginController { | ||
98 | * @return 查询结果 | 103 | * @return 查询结果 |
99 | */ | 104 | */ |
100 | @AnonymousAccess | 105 | @AnonymousAccess |
106 | + @ApiOperation("退出登录") | ||
101 | @PostMapping("/login_out") | 107 | @PostMapping("/login_out") |
102 | public ServerResult loginOut(HttpServletRequest request) { | 108 | public ServerResult loginOut(HttpServletRequest request) { |
103 | onlineUserService.logout(tokenProvider.getToken(request)); | 109 | onlineUserService.logout(tokenProvider.getToken(request)); |
src/main/java/com/order/erp/controller/OrderAuditLogController.java
@@ -4,6 +4,8 @@ import com.order.erp.common.annotation.AnonymousAccess; | @@ -4,6 +4,8 @@ import com.order.erp.common.annotation.AnonymousAccess; | ||
4 | import com.order.erp.common.constant.ServerResult; | 4 | import com.order.erp.common.constant.ServerResult; |
5 | import com.order.erp.domain.vo.order.OrderAuditLogQueryVO; | 5 | import com.order.erp.domain.vo.order.OrderAuditLogQueryVO; |
6 | import com.order.erp.service.order.OrderAuditLogService; | 6 | import com.order.erp.service.order.OrderAuditLogService; |
7 | +import io.swagger.annotations.Api; | ||
8 | +import io.swagger.annotations.ApiOperation; | ||
7 | import org.springframework.validation.annotation.Validated; | 9 | import org.springframework.validation.annotation.Validated; |
8 | import org.springframework.web.bind.annotation.PostMapping; | 10 | import org.springframework.web.bind.annotation.PostMapping; |
9 | import org.springframework.web.bind.annotation.RequestBody; | 11 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -18,6 +20,7 @@ import javax.annotation.Resource; | @@ -18,6 +20,7 @@ import javax.annotation.Resource; | ||
18 | * @author makejava | 20 | * @author makejava |
19 | * @since 2023-09-08 15:26:41 | 21 | * @since 2023-09-08 15:26:41 |
20 | */ | 22 | */ |
23 | +@Api(tags = "用户订单审批日志") | ||
21 | @RestController | 24 | @RestController |
22 | @RequestMapping("/order/erp/audit/log") | 25 | @RequestMapping("/order/erp/audit/log") |
23 | public class OrderAuditLogController { | 26 | public class OrderAuditLogController { |
@@ -34,6 +37,7 @@ public class OrderAuditLogController { | @@ -34,6 +37,7 @@ public class OrderAuditLogController { | ||
34 | * @return 查询结果 | 37 | * @return 查询结果 |
35 | */ | 38 | */ |
36 | @PostMapping("/list") | 39 | @PostMapping("/list") |
40 | + @ApiOperation("分页查询") | ||
37 | @AnonymousAccess | 41 | @AnonymousAccess |
38 | public ServerResult list(@RequestBody @Validated OrderAuditLogQueryVO orderAuditLogQueryVO) { | 42 | public ServerResult list(@RequestBody @Validated OrderAuditLogQueryVO orderAuditLogQueryVO) { |
39 | return orderAuditLogService.list(orderAuditLogQueryVO); | 43 | return orderAuditLogService.list(orderAuditLogQueryVO); |
@@ -46,6 +50,7 @@ public class OrderAuditLogController { | @@ -46,6 +50,7 @@ public class OrderAuditLogController { | ||
46 | * @return 单条数据 | 50 | * @return 单条数据 |
47 | */ | 51 | */ |
48 | @PostMapping("/query_by_id") | 52 | @PostMapping("/query_by_id") |
53 | + @ApiOperation("通过主键查询单条数据") | ||
49 | @AnonymousAccess | 54 | @AnonymousAccess |
50 | public ServerResult queryById(@RequestBody OrderAuditLogQueryVO orderAuditLogQueryVO) { | 55 | public ServerResult queryById(@RequestBody OrderAuditLogQueryVO orderAuditLogQueryVO) { |
51 | return orderAuditLogService.queryById(orderAuditLogQueryVO); | 56 | return orderAuditLogService.queryById(orderAuditLogQueryVO); |
src/main/java/com/order/erp/controller/OrderController.java
@@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | ||
5 | import com.order.erp.common.excel4j.exceptions.Excel4JException; | 5 | import com.order.erp.common.excel4j.exceptions.Excel4JException; |
6 | import com.order.erp.domain.vo.order.*; | 6 | import com.order.erp.domain.vo.order.*; |
7 | import com.order.erp.service.order.OrderBaseInfoService; | 7 | import com.order.erp.service.order.OrderBaseInfoService; |
8 | +import io.swagger.annotations.Api; | ||
9 | +import io.swagger.annotations.ApiOperation; | ||
8 | import org.springframework.validation.annotation.Validated; | 10 | import org.springframework.validation.annotation.Validated; |
9 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | import org.springframework.web.bind.annotation.RequestBody; | 12 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -21,6 +23,7 @@ import java.io.IOException; | @@ -21,6 +23,7 @@ import java.io.IOException; | ||
21 | * @author makejava | 23 | * @author makejava |
22 | * @since 2023-09-08 15:26:43 | 24 | * @since 2023-09-08 15:26:43 |
23 | */ | 25 | */ |
26 | +@Api(tags = "订单管理") | ||
24 | @RestController | 27 | @RestController |
25 | @RequestMapping("/order/erp/order") | 28 | @RequestMapping("/order/erp/order") |
26 | public class OrderController { | 29 | public class OrderController { |
@@ -37,6 +40,7 @@ public class OrderController { | @@ -37,6 +40,7 @@ public class OrderController { | ||
37 | * @return 查询结果 | 40 | * @return 查询结果 |
38 | */ | 41 | */ |
39 | @PostMapping("/list_by_page") | 42 | @PostMapping("/list_by_page") |
43 | + @ApiOperation("分页查询") | ||
40 | @AnonymousAccess | 44 | @AnonymousAccess |
41 | public ServerResult listByPage(@RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | 45 | public ServerResult listByPage(@RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) { |
42 | return orderBaseInfoService.listByPage(orderBaseInfoQueryVO); | 46 | return orderBaseInfoService.listByPage(orderBaseInfoQueryVO); |
@@ -49,6 +53,7 @@ public class OrderController { | @@ -49,6 +53,7 @@ public class OrderController { | ||
49 | * @return 查询结果 | 53 | * @return 查询结果 |
50 | */ | 54 | */ |
51 | @PostMapping("/export") | 55 | @PostMapping("/export") |
56 | + @ApiOperation("导出订单") | ||
52 | @AnonymousAccess | 57 | @AnonymousAccess |
53 | public ServerResult export(HttpServletResponse response, @RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException { | 58 | public ServerResult export(HttpServletResponse response, @RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException { |
54 | return orderBaseInfoService.export(response, orderBaseInfoQueryVO); | 59 | return orderBaseInfoService.export(response, orderBaseInfoQueryVO); |
@@ -72,6 +77,7 @@ public class OrderController { | @@ -72,6 +77,7 @@ public class OrderController { | ||
72 | * @return 新增结果 | 77 | * @return 新增结果 |
73 | */ | 78 | */ |
74 | @PostMapping("/add") | 79 | @PostMapping("/add") |
80 | + @ApiOperation("新增数据") | ||
75 | @AnonymousAccess | 81 | @AnonymousAccess |
76 | public ServerResult add(@RequestBody OrderAddVO orderAddVO) { | 82 | public ServerResult add(@RequestBody OrderAddVO orderAddVO) { |
77 | return orderBaseInfoService.add(orderAddVO); | 83 | return orderBaseInfoService.add(orderAddVO); |
@@ -84,6 +90,7 @@ public class OrderController { | @@ -84,6 +90,7 @@ public class OrderController { | ||
84 | * @return 查询结果 | 90 | * @return 查询结果 |
85 | */ | 91 | */ |
86 | @PostMapping("/field_unlock_apply") | 92 | @PostMapping("/field_unlock_apply") |
93 | + @ApiOperation("字段解锁申请") | ||
87 | @AnonymousAccess | 94 | @AnonymousAccess |
88 | public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) { | 95 | public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) { |
89 | return orderBaseInfoService.fieldUnlockApply(fieldVO); | 96 | return orderBaseInfoService.fieldUnlockApply(fieldVO); |
@@ -96,6 +103,7 @@ public class OrderController { | @@ -96,6 +103,7 @@ public class OrderController { | ||
96 | * @param updateVO 数据VO | 103 | * @param updateVO 数据VO |
97 | * @return 编辑结果 | 104 | * @return 编辑结果 |
98 | */ | 105 | */ |
106 | + @ApiOperation("编辑数据") | ||
99 | @PostMapping("/edit") | 107 | @PostMapping("/edit") |
100 | public ServerResult edit(@RequestBody OrderUpdateVO updateVO) { | 108 | public ServerResult edit(@RequestBody OrderUpdateVO updateVO) { |
101 | return orderBaseInfoService.edit(updateVO); | 109 | return orderBaseInfoService.edit(updateVO); |
@@ -107,6 +115,7 @@ public class OrderController { | @@ -107,6 +115,7 @@ public class OrderController { | ||
107 | * @param orderBaseInfoQueryVO 查询条件 | 115 | * @param orderBaseInfoQueryVO 查询条件 |
108 | * @return 删除是否成功 | 116 | * @return 删除是否成功 |
109 | */ | 117 | */ |
118 | + @ApiOperation("删除数据") | ||
110 | @PostMapping("/delete_by_id") | 119 | @PostMapping("/delete_by_id") |
111 | public ServerResult deleteById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | 120 | public ServerResult deleteById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) { |
112 | return orderBaseInfoService.deleteById(orderBaseInfoQueryVO); | 121 | return orderBaseInfoService.deleteById(orderBaseInfoQueryVO); |
src/main/java/com/order/erp/controller/OrderFieldLockApplyController.java
@@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | ||
5 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; | 5 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; |
6 | import com.order.erp.domain.vo.order.OrderFieldLockApplyVO; | 6 | import com.order.erp.domain.vo.order.OrderFieldLockApplyVO; |
7 | import com.order.erp.service.order.OrderFieldLockApplyService; | 7 | import com.order.erp.service.order.OrderFieldLockApplyService; |
8 | +import io.swagger.annotations.Api; | ||
9 | +import io.swagger.annotations.ApiOperation; | ||
8 | import org.springframework.validation.annotation.Validated; | 10 | import org.springframework.validation.annotation.Validated; |
9 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | import org.springframework.web.bind.annotation.RequestBody; | 12 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -19,6 +21,7 @@ import javax.annotation.Resource; | @@ -19,6 +21,7 @@ import javax.annotation.Resource; | ||
19 | * @author makejava | 21 | * @author makejava |
20 | * @since 2023-09-08 15:26:44 | 22 | * @since 2023-09-08 15:26:44 |
21 | */ | 23 | */ |
24 | +@Api(tags = "用户订单-字段锁定申请(忽略)") | ||
22 | @RestController | 25 | @RestController |
23 | @RequestMapping("/order/erp/apply") | 26 | @RequestMapping("/order/erp/apply") |
24 | public class OrderFieldLockApplyController { | 27 | public class OrderFieldLockApplyController { |
@@ -35,58 +38,11 @@ public class OrderFieldLockApplyController { | @@ -35,58 +38,11 @@ public class OrderFieldLockApplyController { | ||
35 | * @return 查询结果 | 38 | * @return 查询结果 |
36 | */ | 39 | */ |
37 | @PostMapping("/list") | 40 | @PostMapping("/list") |
41 | + @ApiOperation("分页查询") | ||
38 | @AnonymousAccess | 42 | @AnonymousAccess |
39 | public ServerResult list(@RequestBody @Validated OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | 43 | public ServerResult list(@RequestBody @Validated OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { |
40 | return orderFieldLockApplyService.list(orderFieldLockApplyQueryVO); | 44 | return orderFieldLockApplyService.list(orderFieldLockApplyQueryVO); |
41 | } | 45 | } |
42 | 46 | ||
43 | - /** | ||
44 | - * 通过主键查询单条数据 | ||
45 | - * | ||
46 | - * @param orderFieldLockApplyQueryVO 查询条件 | ||
47 | - * @return 单条数据 | ||
48 | - */ | ||
49 | - @PostMapping("/query_by_id") | ||
50 | - @AnonymousAccess | ||
51 | - public ServerResult queryById(@RequestBody OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | ||
52 | - return orderFieldLockApplyService.queryById(orderFieldLockApplyQueryVO); | ||
53 | - } | ||
54 | - | ||
55 | - /** | ||
56 | - * 新增数据 | ||
57 | - * | ||
58 | - * @param orderFieldLockApplyVO 数据VO | ||
59 | - * @return 新增结果 | ||
60 | - */ | ||
61 | - @PostMapping("/add") | ||
62 | - @AnonymousAccess | ||
63 | - public ServerResult add(@RequestBody OrderFieldLockApplyVO orderFieldLockApplyVO) { | ||
64 | - return orderFieldLockApplyService.add(orderFieldLockApplyVO); | ||
65 | - } | ||
66 | - | ||
67 | - /** | ||
68 | - * 编辑数据 | ||
69 | - * | ||
70 | - * @param orderFieldLockApplyVO 数据VO | ||
71 | - * @return 编辑结果 | ||
72 | - */ | ||
73 | - @PostMapping("/edit") | ||
74 | - @AnonymousAccess | ||
75 | - public ServerResult edit(@RequestBody OrderFieldLockApplyVO orderFieldLockApplyVO) { | ||
76 | - return orderFieldLockApplyService.edit(orderFieldLockApplyVO); | ||
77 | - } | ||
78 | - | ||
79 | - /** | ||
80 | - * 删除数据 | ||
81 | - * | ||
82 | - * @param orderFieldLockApplyQueryVO 查询条件 | ||
83 | - * @return 删除是否成功 | ||
84 | - */ | ||
85 | - @PostMapping("/delete_by_id") | ||
86 | - @AnonymousAccess | ||
87 | - public ServerResult deleteById(@RequestBody OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | ||
88 | - return orderFieldLockApplyService.deleteById(orderFieldLockApplyQueryVO); | ||
89 | - } | ||
90 | - | ||
91 | } | 47 | } |
92 | 48 |
src/main/java/com/order/erp/controller/OrderOptLogController.java
1 | package com.order.erp.controller; | 1 | package com.order.erp.controller; |
2 | 2 | ||
3 | +import io.swagger.annotations.Api; | ||
3 | import org.springframework.web.bind.annotation.RequestMapping; | 4 | import org.springframework.web.bind.annotation.RequestMapping; |
4 | import org.springframework.web.bind.annotation.RestController; | 5 | import org.springframework.web.bind.annotation.RestController; |
5 | 6 | ||
@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
9 | * @author makejava | 10 | * @author makejava |
10 | * @since 2023-09-08 15:26:46 | 11 | * @since 2023-09-08 15:26:46 |
11 | */ | 12 | */ |
13 | +@Api(tags = "(忽略)") | ||
12 | @RestController | 14 | @RestController |
13 | @RequestMapping("/gwms/xxx") | 15 | @RequestMapping("/gwms/xxx") |
14 | public class OrderOptLogController { | 16 | public class OrderOptLogController { |
src/main/java/com/order/erp/controller/SysLogController.java
@@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; | ||
5 | import com.order.erp.domain.vo.SysLogQueryVO; | 5 | import com.order.erp.domain.vo.SysLogQueryVO; |
6 | import com.order.erp.domain.vo.SysLogVO; | 6 | import com.order.erp.domain.vo.SysLogVO; |
7 | import com.order.erp.service.SysLogService; | 7 | import com.order.erp.service.SysLogService; |
8 | +import io.swagger.annotations.Api; | ||
9 | +import io.swagger.annotations.ApiOperation; | ||
8 | import org.springframework.validation.annotation.Validated; | 10 | import org.springframework.validation.annotation.Validated; |
9 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | import org.springframework.web.bind.annotation.RequestBody; | 12 | import org.springframework.web.bind.annotation.RequestBody; |
@@ -19,6 +21,7 @@ import javax.annotation.Resource; | @@ -19,6 +21,7 @@ import javax.annotation.Resource; | ||
19 | * @author makejava | 21 | * @author makejava |
20 | * @since 2023-09-06 16:24:52 | 22 | * @since 2023-09-06 16:24:52 |
21 | */ | 23 | */ |
24 | +@Api(tags = "系统日志") | ||
22 | @RestController | 25 | @RestController |
23 | @RequestMapping("/order/erp/logs") | 26 | @RequestMapping("/order/erp/logs") |
24 | public class SysLogController { | 27 | public class SysLogController { |
@@ -36,57 +39,10 @@ public class SysLogController { | @@ -36,57 +39,10 @@ public class SysLogController { | ||
36 | */ | 39 | */ |
37 | @PostMapping("/list") | 40 | @PostMapping("/list") |
38 | @AnonymousAccess | 41 | @AnonymousAccess |
42 | + @ApiOperation("分页查询") | ||
39 | public ServerResult list(@RequestBody @Validated SysLogQueryVO sysLogQueryVO) { | 43 | public ServerResult list(@RequestBody @Validated SysLogQueryVO sysLogQueryVO) { |
40 | return sysLogService.list(sysLogQueryVO); | 44 | return sysLogService.list(sysLogQueryVO); |
41 | } | 45 | } |
42 | 46 | ||
43 | - /** | ||
44 | - * 通过主键查询单条数据 | ||
45 | - * | ||
46 | - * @param sysLogQueryVO 查询条件 | ||
47 | - * @return 单条数据 | ||
48 | - */ | ||
49 | - @PostMapping("/query_by_id") | ||
50 | - @AnonymousAccess | ||
51 | - public ServerResult queryById(@RequestBody SysLogQueryVO sysLogQueryVO) { | ||
52 | - return sysLogService.queryById(sysLogQueryVO); | ||
53 | - } | ||
54 | - | ||
55 | - /** | ||
56 | - * 新增数据 | ||
57 | - * | ||
58 | - * @param sysLogVO 数据VO | ||
59 | - * @return 新增结果 | ||
60 | - */ | ||
61 | - @PostMapping("/add") | ||
62 | - @AnonymousAccess | ||
63 | - public ServerResult add(@RequestBody SysLogVO sysLogVO) { | ||
64 | - return sysLogService.add(sysLogVO); | ||
65 | - } | ||
66 | - | ||
67 | - /** | ||
68 | - * 编辑数据 | ||
69 | - * | ||
70 | - * @param sysLogVO 数据VO | ||
71 | - * @return 编辑结果 | ||
72 | - */ | ||
73 | - @PostMapping("/edit") | ||
74 | - @AnonymousAccess | ||
75 | - public ServerResult edit(@RequestBody SysLogVO sysLogVO) { | ||
76 | - return sysLogService.edit(sysLogVO); | ||
77 | - } | ||
78 | - | ||
79 | - /** | ||
80 | - * 删除数据 | ||
81 | - * | ||
82 | - * @param sysLogQueryVO 查询条件 | ||
83 | - * @return 删除是否成功 | ||
84 | - */ | ||
85 | - @PostMapping("/delete_by_id") | ||
86 | - @AnonymousAccess | ||
87 | - public ServerResult deleteById(@RequestBody SysLogQueryVO sysLogQueryVO) { | ||
88 | - return sysLogService.deleteById(sysLogQueryVO); | ||
89 | - } | ||
90 | - | ||
91 | } | 47 | } |
92 | 48 |
src/main/java/com/order/erp/controller/UserController.java
@@ -3,10 +3,7 @@ package com.order.erp.controller; | @@ -3,10 +3,7 @@ package com.order.erp.controller; | ||
3 | import com.order.erp.common.annotation.AnonymousAccess; | 3 | import com.order.erp.common.annotation.AnonymousAccess; |
4 | import com.order.erp.common.constant.ServerResult; | 4 | import com.order.erp.common.constant.ServerResult; |
5 | import com.order.erp.config.DataScope; | 5 | import com.order.erp.config.DataScope; |
6 | -import com.order.erp.domain.vo.admin.AdminAuthUserVO; | ||
7 | -import com.order.erp.domain.vo.admin.AdminUserQueryVO; | ||
8 | -import com.order.erp.domain.vo.admin.AdminUserVO; | ||
9 | -import com.order.erp.domain.vo.admin.UpdatePwdVO; | 6 | +import com.order.erp.domain.vo.admin.*; |
10 | import com.order.erp.log.Log; | 7 | import com.order.erp.log.Log; |
11 | import com.order.erp.service.admin.AdminUserService; | 8 | import com.order.erp.service.admin.AdminUserService; |
12 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
@@ -85,11 +82,20 @@ public class UserController { | @@ -85,11 +82,20 @@ public class UserController { | ||
85 | 82 | ||
86 | @Log("修改密码") | 83 | @Log("修改密码") |
87 | @ApiOperation("修改密码") | 84 | @ApiOperation("修改密码") |
85 | + @PostMapping(value = "/update_pass") | ||
88 | @AnonymousAccess | 86 | @AnonymousAccess |
89 | public ServerResult updatePass(@RequestBody @Validated UpdatePwdVO pwdVO) { | 87 | public ServerResult updatePass(@RequestBody @Validated UpdatePwdVO pwdVO) { |
90 | return userService.updatePass(pwdVO); | 88 | return userService.updatePass(pwdVO); |
91 | } | 89 | } |
92 | 90 | ||
91 | + @Log("重置密码") | ||
92 | + @ApiOperation("重置密码") | ||
93 | + @PostMapping(value = "/reset") | ||
94 | + @AnonymousAccess | ||
95 | + public ServerResult reset(@RequestBody @Validated ResetPwdVO resetPwdVO) { | ||
96 | + return userService.resetPwdVO(resetPwdVO); | ||
97 | + } | ||
98 | + | ||
93 | @ApiOperation("修改头像") | 99 | @ApiOperation("修改头像") |
94 | @AnonymousAccess | 100 | @AnonymousAccess |
95 | public ServerResult updateAvatar(@RequestParam MultipartFile file) { | 101 | public ServerResult updateAvatar(@RequestParam MultipartFile file) { |
src/main/java/com/order/erp/domain/dto/admin/AdminUserDO.java
@@ -83,4 +83,9 @@ public class AdminUserDO extends BaseDO implements Serializable { | @@ -83,4 +83,9 @@ public class AdminUserDO extends BaseDO implements Serializable { | ||
83 | */ | 83 | */ |
84 | private LocalDateTime pwdResetTime; | 84 | private LocalDateTime pwdResetTime; |
85 | 85 | ||
86 | + /** | ||
87 | + * 备注信息 | ||
88 | + */ | ||
89 | + private String remark; | ||
90 | + | ||
86 | } | 91 | } |
src/main/java/com/order/erp/domain/vo/admin/AdminUserModifyPwdVO.java
@@ -22,16 +22,16 @@ import java.io.Serializable; | @@ -22,16 +22,16 @@ import java.io.Serializable; | ||
22 | public class AdminUserModifyPwdVO extends BasePageVO implements Serializable { | 22 | public class AdminUserModifyPwdVO extends BasePageVO implements Serializable { |
23 | 23 | ||
24 | /** | 24 | /** |
25 | - * 密钥id | 25 | + * 手机号 |
26 | */ | 26 | */ |
27 | - @NotBlank(message = "密钥id不存在!") | ||
28 | - private String id; | 27 | + @NotBlank(message = "手机号不能为空!") |
28 | + private String phone; | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | - * 密钥密码 | 31 | + * 短信验证码 |
32 | */ | 32 | */ |
33 | - @NotBlank(message = "密钥密码不能为空") | ||
34 | - private String passwordRecoverKey; | 33 | + @NotBlank(message = "短信验证码不能为空") |
34 | + private String smsCaptchaCode; | ||
35 | 35 | ||
36 | /** | 36 | /** |
37 | * 密码 | 37 | * 密码 |
src/main/java/com/order/erp/domain/vo/admin/AdminUserVO.java
src/main/java/com/order/erp/domain/vo/admin/ResetPwdVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.admin; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import javax.validation.constraints.NotBlank; | ||
7 | +import javax.validation.constraints.NotNull; | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 用户表(AdminUser)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2023-08-30 17:51:48 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class ResetPwdVO implements Serializable { | ||
23 | + | ||
24 | + /** | ||
25 | + * 用户id | ||
26 | + */ | ||
27 | + @NotNull(message = "密钥id不存在!") | ||
28 | + private Long userId; | ||
29 | + | ||
30 | +} | ||
31 | + |
src/main/java/com/order/erp/service/admin/AdminUserService.java
@@ -69,6 +69,13 @@ public interface AdminUserService extends IService<AdminUserDO> { | @@ -69,6 +69,13 @@ public interface AdminUserService extends IService<AdminUserDO> { | ||
69 | ServerResult updatePass(UpdatePwdVO pwdVO); | 69 | ServerResult updatePass(UpdatePwdVO pwdVO); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | + * | ||
73 | + * @param resetPwdVO | ||
74 | + * @return | ||
75 | + */ | ||
76 | + ServerResult resetPwdVO(ResetPwdVO resetPwdVO); | ||
77 | + | ||
78 | + /** | ||
72 | * 用户名称/手机号/邮箱号 | 79 | * 用户名称/手机号/邮箱号 |
73 | * | 80 | * |
74 | * @param userName | 81 | * @param userName |
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
@@ -14,8 +14,9 @@ import com.order.erp.common.constant.ServerResult; | @@ -14,8 +14,9 @@ import com.order.erp.common.constant.ServerResult; | ||
14 | import com.order.erp.common.constant.ServerResultCode; | 14 | import com.order.erp.common.constant.ServerResultCode; |
15 | import com.order.erp.common.exception.BusinessException; | 15 | import com.order.erp.common.exception.BusinessException; |
16 | import com.order.erp.common.utils.ImgCaptchaUtils; | 16 | import com.order.erp.common.utils.ImgCaptchaUtils; |
17 | -import com.order.erp.common.utils.RedisUtil; | 17 | +import com.order.erp.common.utils.SmsUtils; |
18 | import com.order.erp.common.utils.TransactionHelper; | 18 | import com.order.erp.common.utils.TransactionHelper; |
19 | +import com.order.erp.config.DataScope; | ||
19 | import com.order.erp.domain.RoleEnum; | 20 | import com.order.erp.domain.RoleEnum; |
20 | import com.order.erp.domain.dto.BaseDO; | 21 | import com.order.erp.domain.dto.BaseDO; |
21 | import com.order.erp.domain.dto.admin.*; | 22 | import com.order.erp.domain.dto.admin.*; |
@@ -56,7 +57,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | @@ -56,7 +57,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | ||
56 | private ImgCaptchaUtils imgCaptchaUtils; | 57 | private ImgCaptchaUtils imgCaptchaUtils; |
57 | 58 | ||
58 | @Resource | 59 | @Resource |
59 | - private RedisUtil redisUtil; | 60 | + private SmsUtils smsUtils; |
60 | 61 | ||
61 | @Resource | 62 | @Resource |
62 | private AuthenticationManager authenticationManager; | 63 | private AuthenticationManager authenticationManager; |
@@ -92,6 +93,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | @@ -92,6 +93,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | ||
92 | @Resource | 93 | @Resource |
93 | private TransactionHelper transactionHelper; | 94 | private TransactionHelper transactionHelper; |
94 | 95 | ||
96 | + @Resource | ||
97 | + private DataScope dataScope; | ||
98 | + | ||
95 | /** | 99 | /** |
96 | * 通过ID查询单条数据 | 100 | * 通过ID查询单条数据 |
97 | * <p> | 101 | * <p> |
@@ -326,6 +330,18 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | @@ -326,6 +330,18 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | ||
326 | return ServerResult.success(); | 330 | return ServerResult.success(); |
327 | } | 331 | } |
328 | 332 | ||
333 | + @Override | ||
334 | + public ServerResult resetPwdVO(ResetPwdVO resetPwdVO) { | ||
335 | + AdminUserDO userDO = getById(resetPwdVO.getUserId()); | ||
336 | + if (Objects.isNull(userDO)) { | ||
337 | + throw new BusinessException(ServerResultCode.USER_NOT_EXIT); | ||
338 | + } | ||
339 | + userDO.setPwdResetTime(LocalDateTime.now()); | ||
340 | + userDO.setPassword(passwordEncoder.encode("123456")); | ||
341 | + updateById(userDO); | ||
342 | + return ServerResult.success(); | ||
343 | + } | ||
344 | + | ||
329 | /** | 345 | /** |
330 | * @param loginByPwdVO | 346 | * @param loginByPwdVO |
331 | * @return | 347 | * @return |
@@ -363,7 +379,19 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | @@ -363,7 +379,19 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | ||
363 | 379 | ||
364 | @Override | 380 | @Override |
365 | public ServerResult passwordModify(AdminUserModifyPwdVO modifyPwdVO) { | 381 | public ServerResult passwordModify(AdminUserModifyPwdVO modifyPwdVO) { |
366 | - return null; | 382 | + smsUtils.validateSmsCaptcha(modifyPwdVO.getPhone(), modifyPwdVO.getSmsCaptchaCode()); |
383 | + if (!modifyPwdVO.getPassword().equals(modifyPwdVO.getConfirmPassword())) { | ||
384 | + throw new BusinessException(ServerResultCode.MEMBER_CONFIRM_PASSWORD_ERROR); | ||
385 | + } | ||
386 | + AdminUserDO userDO = getOne(new LambdaQueryWrapper<AdminUserDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
387 | + .eq(AdminUserDO::getPhone, modifyPwdVO.getPhone()).last("limit 1")); | ||
388 | + if (Objects.isNull(userDO)) { | ||
389 | + throw new BusinessException(ServerResultCode.USER_NOT_EXIT); | ||
390 | + } | ||
391 | + userDO.setPwdResetTime(LocalDateTime.now()); | ||
392 | + userDO.setPassword(passwordEncoder.encode(modifyPwdVO.getPassword())); | ||
393 | + updateById(userDO); | ||
394 | + return ServerResult.success(); | ||
367 | } | 395 | } |
368 | 396 | ||
369 | @Override | 397 | @Override |