Commit 90c434ebbe6fe41129dbdc438f553709f4bd42a1
1 parent
2831d52f
feat: ERP升级
1、订单超期事件-邮件模块基础类 2、订单 产品意见更新记录与一次性通过率基础类
Showing
25 changed files
with
1365 additions
and
0 deletions
sql/dml_erp_v2.sql
0 → 100644
1 | +DROP TABLE IF EXISTS `email_template`; | ||
2 | +CREATE TABLE `email_template` ( | ||
3 | + `id` bigint NOT NULL AUTO_INCREMENT, | ||
4 | + `name` varchar(64) NOT NULL COMMENT '名称', | ||
5 | + `email_title` varchar(64) not null COMMENT '邮件标题', | ||
6 | + `content` text COMMENT '模板内容', | ||
7 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | ||
8 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | ||
9 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | ||
10 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | ||
11 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | ||
12 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | ||
13 | + PRIMARY KEY (`id`) | ||
14 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='邮件模板表'; | ||
15 | + | ||
16 | + | ||
17 | +DROP TABLE IF EXISTS `receive_email_mapping`; | ||
18 | +CREATE TABLE `receive_email_mapping` ( | ||
19 | + `id` bigint NOT NULL AUTO_INCREMENT, | ||
20 | + `type` varchar(64) NOT NULL COMMENT '类型', | ||
21 | + `type_value` varchar(64) NOT NULL COMMENT '类型值', | ||
22 | + `event` varchar(64) not null COMMENT '事件', | ||
23 | + `emails` text COMMENT '接收人邮件 json', | ||
24 | + `template_id` bigint NOT NULL COMMENT '邮件模板id', | ||
25 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | ||
26 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | ||
27 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | ||
28 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | ||
29 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | ||
30 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | ||
31 | + PRIMARY KEY (`id`) | ||
32 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='邮件接收人信息绑定表'; | ||
33 | + | ||
34 | + | ||
35 | +DROP TABLE IF EXISTS `order_update_log`; | ||
36 | +CREATE TABLE `order_update_log` ( | ||
37 | + `id` bigint NOT NULL AUTO_INCREMENT, | ||
38 | + `order_id` bigint NOT NULL COMMENT '订单id', | ||
39 | + `type` varchar(64) NOT NULL COMMENT '类型', | ||
40 | + `field` varchar(64) not null COMMENT '更新字段', | ||
41 | + `update_value` text COMMENT '更新值', | ||
42 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | ||
43 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | ||
44 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | ||
45 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | ||
46 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | ||
47 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | ||
48 | + PRIMARY KEY (`id`) | ||
49 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单更新日志表'; | ||
0 | \ No newline at end of file | 50 | \ No newline at end of file |
src/main/java/com/order/erp/common/utils/EmailUtils.java
0 → 100644
src/main/java/com/order/erp/controller/EmailTemplateController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.common.jsr303.OperateGroup; | ||
5 | +import com.order.erp.domain.vo.order.EmailTemplateQueryVO; | ||
6 | +import com.order.erp.domain.vo.order.EmailTemplateVO; | ||
7 | +import com.order.erp.service.order.EmailTemplateService; | ||
8 | +import org.springframework.validation.annotation.Validated; | ||
9 | +import org.springframework.web.bind.annotation.PostMapping; | ||
10 | +import org.springframework.web.bind.annotation.RequestBody; | ||
11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +import javax.annotation.Resource; | ||
15 | + | ||
16 | +/** | ||
17 | + * 邮件模板表(EmailTemplate)表控制层 | ||
18 | + * | ||
19 | + * @author makejava | ||
20 | + * @since 2024-07-03 10:58:25 | ||
21 | + */ | ||
22 | +@RestController | ||
23 | +@RequestMapping("/order/erp/email_template") | ||
24 | +public class EmailTemplateController { | ||
25 | + /** | ||
26 | + * 服务对象 | ||
27 | + */ | ||
28 | + @Resource | ||
29 | + private EmailTemplateService emailTemplateService; | ||
30 | + | ||
31 | + /** | ||
32 | + * 分页查询 | ||
33 | + * | ||
34 | + * @param emailTemplateQueryVO 查询条件 | ||
35 | + * @return 查询结果 | ||
36 | + */ | ||
37 | + @PostMapping("/list") | ||
38 | + public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) EmailTemplateQueryVO emailTemplateQueryVO) { | ||
39 | + return emailTemplateService.list(emailTemplateQueryVO); | ||
40 | + } | ||
41 | + | ||
42 | + | ||
43 | + /** | ||
44 | + * 新增数据 | ||
45 | + * | ||
46 | + * @param emailTemplateVO 数据VO | ||
47 | + * @return 新增结果 | ||
48 | + */ | ||
49 | + @PostMapping("/add") | ||
50 | + public ServerResult add(@RequestBody EmailTemplateVO emailTemplateVO) { | ||
51 | + return emailTemplateService.add(emailTemplateVO); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 编辑数据 | ||
56 | + * | ||
57 | + * @param emailTemplateVO 数据VO | ||
58 | + * @return 编辑结果 | ||
59 | + */ | ||
60 | + @PostMapping("/edit") | ||
61 | + public ServerResult edit(@RequestBody EmailTemplateVO emailTemplateVO) { | ||
62 | + return emailTemplateService.edit(emailTemplateVO); | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * 删除数据 | ||
67 | + * | ||
68 | + * @param emailTemplateQueryVO 查询条件 | ||
69 | + * @return 删除是否成功 | ||
70 | + */ | ||
71 | + @PostMapping("/delete_by_id") | ||
72 | + public ServerResult deleteById(@RequestBody EmailTemplateQueryVO emailTemplateQueryVO) { | ||
73 | + return emailTemplateService.deleteById(emailTemplateQueryVO); | ||
74 | + } | ||
75 | + | ||
76 | +} | ||
77 | + |
src/main/java/com/order/erp/controller/OrderUpdateLogController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.common.jsr303.OperateGroup; | ||
5 | +import com.order.erp.domain.vo.order.OrderUpdateLogQueryVO; | ||
6 | +import com.order.erp.domain.vo.order.OrderUpdateLogVO; | ||
7 | +import com.order.erp.service.order.OrderUpdateLogService; | ||
8 | +import org.springframework.validation.annotation.Validated; | ||
9 | +import org.springframework.web.bind.annotation.PostMapping; | ||
10 | +import org.springframework.web.bind.annotation.RequestBody; | ||
11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +import javax.annotation.Resource; | ||
15 | + | ||
16 | +/** | ||
17 | + * 订单更新日志表(OrderUpdateLog)表控制层 | ||
18 | + * | ||
19 | + * @author makejava | ||
20 | + * @since 2024-07-03 17:30:32 | ||
21 | + */ | ||
22 | +@RestController | ||
23 | +@RequestMapping("/order/erp/update_log") | ||
24 | +public class OrderUpdateLogController { | ||
25 | + /** | ||
26 | + * 服务对象 | ||
27 | + */ | ||
28 | + @Resource | ||
29 | + private OrderUpdateLogService orderUpdateLogService; | ||
30 | + | ||
31 | + /** | ||
32 | + * 分页查询 | ||
33 | + * | ||
34 | + * @param orderUpdateLogQueryVO 查询条件 | ||
35 | + * @return 查询结果 | ||
36 | + */ | ||
37 | + @PostMapping("/list") | ||
38 | + public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | ||
39 | + return orderUpdateLogService.list(orderUpdateLogQueryVO); | ||
40 | + } | ||
41 | + | ||
42 | + /** | ||
43 | + * 新增数据 | ||
44 | + * | ||
45 | + * @param orderUpdateLogVO 数据VO | ||
46 | + * @return 新增结果 | ||
47 | + */ | ||
48 | + @PostMapping("/add") | ||
49 | + public ServerResult add(@RequestBody OrderUpdateLogVO orderUpdateLogVO) { | ||
50 | + return orderUpdateLogService.add(orderUpdateLogVO); | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * 编辑数据 | ||
55 | + * | ||
56 | + * @param orderUpdateLogVO 数据VO | ||
57 | + * @return 编辑结果 | ||
58 | + */ | ||
59 | + @PostMapping("/edit") | ||
60 | + public ServerResult edit(@RequestBody OrderUpdateLogVO orderUpdateLogVO) { | ||
61 | + return orderUpdateLogService.edit(orderUpdateLogVO); | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * 删除数据 | ||
66 | + * | ||
67 | + * @param orderUpdateLogQueryVO 查询条件 | ||
68 | + * @return 删除是否成功 | ||
69 | + */ | ||
70 | + @PostMapping("/delete_by_id") | ||
71 | + public ServerResult deleteById(@RequestBody OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | ||
72 | + return orderUpdateLogService.deleteById(orderUpdateLogQueryVO); | ||
73 | + } | ||
74 | + | ||
75 | +} | ||
76 | + |
src/main/java/com/order/erp/controller/ReceiveEmailMappingController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.common.jsr303.OperateGroup; | ||
5 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; | ||
6 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; | ||
7 | +import com.order.erp.service.order.ReceiveEmailMappingService; | ||
8 | +import org.springframework.validation.annotation.Validated; | ||
9 | +import org.springframework.web.bind.annotation.PostMapping; | ||
10 | +import org.springframework.web.bind.annotation.RequestBody; | ||
11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +import javax.annotation.Resource; | ||
15 | + | ||
16 | +/** | ||
17 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)表控制层 | ||
18 | + * | ||
19 | + * @author makejava | ||
20 | + * @since 2024-07-03 10:58:52 | ||
21 | + */ | ||
22 | +@RestController | ||
23 | +@RequestMapping("/order/erp/receive_email_mapping") | ||
24 | +public class ReceiveEmailMappingController { | ||
25 | + /** | ||
26 | + * 服务对象 | ||
27 | + */ | ||
28 | + @Resource | ||
29 | + private ReceiveEmailMappingService receiveEmailMappingService; | ||
30 | + | ||
31 | + /** | ||
32 | + * 分页查询 | ||
33 | + * | ||
34 | + * @param receiveEmailMappingQueryVO 查询条件 | ||
35 | + * @return 查询结果 | ||
36 | + */ | ||
37 | + @PostMapping("/list") | ||
38 | + public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | ||
39 | + return receiveEmailMappingService.list(receiveEmailMappingQueryVO); | ||
40 | + } | ||
41 | + | ||
42 | + | ||
43 | + /** | ||
44 | + * 新增数据 | ||
45 | + * | ||
46 | + * @param receiveEmailMappingVO 数据VO | ||
47 | + * @return 新增结果 | ||
48 | + */ | ||
49 | + @PostMapping("/add") | ||
50 | + public ServerResult add(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { | ||
51 | + return receiveEmailMappingService.add(receiveEmailMappingVO); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 编辑数据 | ||
56 | + * | ||
57 | + * @param receiveEmailMappingVO 数据VO | ||
58 | + * @return 编辑结果 | ||
59 | + */ | ||
60 | + @PostMapping("/edit") | ||
61 | + public ServerResult edit(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { | ||
62 | + return receiveEmailMappingService.edit(receiveEmailMappingVO); | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * 删除数据 | ||
67 | + * | ||
68 | + * @param receiveEmailMappingQueryVO 查询条件 | ||
69 | + * @return 删除是否成功 | ||
70 | + */ | ||
71 | + @PostMapping("/delete_by_id") | ||
72 | + public ServerResult deleteById(@RequestBody ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | ||
73 | + return receiveEmailMappingService.deleteById(receiveEmailMappingQueryVO); | ||
74 | + } | ||
75 | + | ||
76 | +} | ||
77 | + |
src/main/java/com/order/erp/domain/OverTimeEventEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | + | ||
6 | +/** | ||
7 | + * 超时事件枚举类 | ||
8 | + * | ||
9 | + * @author: xms | ||
10 | + * @description: TODO | ||
11 | + * @date: 2023/9/13 18:05 | ||
12 | + * @version: 1.0 | ||
13 | + */ | ||
14 | +@Getter | ||
15 | +@AllArgsConstructor | ||
16 | +public enum OverTimeEventEnum { | ||
17 | + | ||
18 | + END_CHECK_APPLY_TIME("END_CHECK_APPLY_TIME", "尾期验货超期"), | ||
19 | + ; | ||
20 | + private String event; | ||
21 | + | ||
22 | + private String desc; | ||
23 | +} |
src/main/java/com/order/erp/domain/dto/order/EmailTemplateDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 邮件模板表(EmailTemplate)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-07-03 10:58:22 | ||
15 | + */ | ||
16 | +@TableName("email_template") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class EmailTemplateDO extends BaseDO implements Serializable { | ||
24 | + private static final long serialVersionUID = 908714418628063839L; | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 名称 | ||
29 | + */ | ||
30 | + private String name; | ||
31 | + /** | ||
32 | + * 邮件标题 | ||
33 | + */ | ||
34 | + private String emailTitle; | ||
35 | + /** | ||
36 | + * 模板内容 | ||
37 | + */ | ||
38 | + private String content; | ||
39 | + | ||
40 | +} |
src/main/java/com/order/erp/domain/dto/order/OrderUpdateLogDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 订单更新日志表(OrderUpdateLog)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-07-03 17:30:32 | ||
15 | + */ | ||
16 | +@TableName("order_update_log") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class OrderUpdateLogDO extends BaseDO implements Serializable { | ||
24 | + private static final long serialVersionUID = -13971181958655517L; | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 订单id | ||
29 | + */ | ||
30 | + private Long orderId; | ||
31 | + /** | ||
32 | + * 类型 | ||
33 | + */ | ||
34 | + private String type; | ||
35 | + /** | ||
36 | + * 更新字段 | ||
37 | + */ | ||
38 | + private String field; | ||
39 | + /** | ||
40 | + * 更新值 | ||
41 | + */ | ||
42 | + private String updateValue; | ||
43 | + | ||
44 | +} |
src/main/java/com/order/erp/domain/dto/order/ReceiveEmailMappingDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-07-03 10:58:51 | ||
15 | + */ | ||
16 | +@TableName("receive_email_mapping") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class ReceiveEmailMappingDO extends BaseDO implements Serializable { | ||
24 | + private static final long serialVersionUID = 601423783257328920L; | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 类型 | ||
29 | + */ | ||
30 | + private String type; | ||
31 | + | ||
32 | + /** | ||
33 | + * 值 | ||
34 | + */ | ||
35 | + private String typeValue; | ||
36 | + /** | ||
37 | + * 事件 | ||
38 | + */ | ||
39 | + private String event; | ||
40 | + /** | ||
41 | + * 接收人邮件 json | ||
42 | + */ | ||
43 | + private String emails; | ||
44 | + /** | ||
45 | + * 邮件模板id | ||
46 | + */ | ||
47 | + private Long templateId; | ||
48 | + | ||
49 | +} |
src/main/java/com/order/erp/domain/vo/order/EmailTemplateQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | +import java.io.Serializable; | ||
3 | + | ||
4 | +import com.order.erp.domain.vo.BasePageVO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.lang.Long; | ||
9 | +import java.util.List; | ||
10 | + | ||
11 | +/** | ||
12 | + * 邮件模板表(EmailTemplate)实体类 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-07-03 10:58:25 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class EmailTemplateQueryVO extends BasePageVO implements Serializable { | ||
24 | + private static final long serialVersionUID = 935028737470026906L; | ||
25 | + | ||
26 | + private List<Long> ids; | ||
27 | + | ||
28 | + | ||
29 | + private Long id; | ||
30 | + /** | ||
31 | + * 名称 | ||
32 | + */ | ||
33 | + private String name; | ||
34 | + /** | ||
35 | + * 邮件标题 | ||
36 | + */ | ||
37 | + private String emailTitle; | ||
38 | + /** | ||
39 | + * 模板内容 | ||
40 | + */ | ||
41 | + private String content; | ||
42 | + | ||
43 | + | ||
44 | +} | ||
45 | + |
src/main/java/com/order/erp/domain/vo/order/EmailTemplateVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 邮件模板表(EmailTemplate)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-07-03 10:58:24 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class EmailTemplateVO implements Serializable { | ||
21 | + private static final long serialVersionUID = 142264330168365265L; | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 名称 | ||
26 | + */ | ||
27 | + private String name; | ||
28 | + /** | ||
29 | + * 邮件标题 | ||
30 | + */ | ||
31 | + private String emailTitle; | ||
32 | + /** | ||
33 | + * 模板内容 | ||
34 | + */ | ||
35 | + private String content; | ||
36 | + | ||
37 | + | ||
38 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderUpdateLogQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 订单更新日志表(OrderUpdateLog)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-07-03 17:30:32 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class OrderUpdateLogQueryVO extends BasePageVO implements Serializable { | ||
23 | + private static final long serialVersionUID = -76955066268519338L; | ||
24 | + | ||
25 | + private List<Long> ids; | ||
26 | + | ||
27 | + | ||
28 | + private Long id; | ||
29 | + /** | ||
30 | + * 订单id | ||
31 | + */ | ||
32 | + private Long orderId; | ||
33 | + /** | ||
34 | + * 类型 | ||
35 | + */ | ||
36 | + private String type; | ||
37 | + /** | ||
38 | + * 更新字段 | ||
39 | + */ | ||
40 | + private String field; | ||
41 | + /** | ||
42 | + * 更新值 | ||
43 | + */ | ||
44 | + private String updateValue; | ||
45 | + | ||
46 | + | ||
47 | +} | ||
48 | + |
src/main/java/com/order/erp/domain/vo/order/OrderUpdateLogVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 订单更新日志表(OrderUpdateLog)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-07-03 17:30:32 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class OrderUpdateLogVO implements Serializable { | ||
21 | + private static final long serialVersionUID = 239376530599472914L; | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 订单id | ||
26 | + */ | ||
27 | + private Long orderId; | ||
28 | + /** | ||
29 | + * 类型 | ||
30 | + */ | ||
31 | + private String type; | ||
32 | + /** | ||
33 | + * 更新字段 | ||
34 | + */ | ||
35 | + private String field; | ||
36 | + /** | ||
37 | + * 更新值 | ||
38 | + */ | ||
39 | + private String updateValue; | ||
40 | + | ||
41 | + | ||
42 | +} |
src/main/java/com/order/erp/domain/vo/order/ReceiveEmailMappingQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | +import java.io.Serializable; | ||
3 | + | ||
4 | +import com.order.erp.domain.vo.BasePageVO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.lang.Long; | ||
9 | +import java.util.List; | ||
10 | + | ||
11 | +/** | ||
12 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)实体类 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-07-03 10:58:52 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class ReceiveEmailMappingQueryVO extends BasePageVO implements Serializable { | ||
24 | + private static final long serialVersionUID = 734458511420307485L; | ||
25 | + | ||
26 | + private List<Long> ids; | ||
27 | + | ||
28 | + | ||
29 | + private Long id; | ||
30 | + /** | ||
31 | + * 类型 | ||
32 | + */ | ||
33 | + private String type; | ||
34 | + /** | ||
35 | + * 事件 | ||
36 | + */ | ||
37 | + private String event; | ||
38 | + /** | ||
39 | + * 接收人邮件 json | ||
40 | + */ | ||
41 | + private String emails; | ||
42 | + /** | ||
43 | + * 邮件模板id | ||
44 | + */ | ||
45 | + private Long templateId; | ||
46 | + | ||
47 | + | ||
48 | +} | ||
49 | + |
src/main/java/com/order/erp/domain/vo/order/ReceiveEmailMappingVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-07-03 10:58:52 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class ReceiveEmailMappingVO implements Serializable { | ||
21 | + private static final long serialVersionUID = 573512659255438314L; | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 类型 | ||
26 | + */ | ||
27 | + private String type; | ||
28 | + /** | ||
29 | + * 事件 | ||
30 | + */ | ||
31 | + private String event; | ||
32 | + /** | ||
33 | + * 接收人邮件 json | ||
34 | + */ | ||
35 | + private String emails; | ||
36 | + /** | ||
37 | + * 邮件模板id | ||
38 | + */ | ||
39 | + private Long templateId; | ||
40 | + | ||
41 | + | ||
42 | +} |
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
0 → 100644
1 | +package com.order.erp.job; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
5 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
6 | +import com.order.erp.common.constant.Constant; | ||
7 | +import com.order.erp.common.utils.DateUtils; | ||
8 | +import com.order.erp.common.utils.TransactionHelper; | ||
9 | +import com.order.erp.domain.OrderStatusEnum; | ||
10 | +import com.order.erp.domain.dto.BaseDO; | ||
11 | +import com.order.erp.domain.dto.order.*; | ||
12 | +import com.order.erp.domain.vo.order.OrderInfoResultVO; | ||
13 | +import com.order.erp.service.order.*; | ||
14 | +import lombok.extern.slf4j.Slf4j; | ||
15 | +import org.joda.time.DateTime; | ||
16 | +import org.springframework.scheduling.annotation.Scheduled; | ||
17 | +import org.springframework.stereotype.Component; | ||
18 | + | ||
19 | +import javax.annotation.Resource; | ||
20 | +import java.util.List; | ||
21 | +import java.util.Objects; | ||
22 | +import java.util.Set; | ||
23 | +import java.util.stream.Collectors; | ||
24 | + | ||
25 | +/** | ||
26 | + * @author: xms | ||
27 | + * @description: TODO | ||
28 | + * @date: 2023/6/25 10:35 | ||
29 | + * @version: 1.0 | ||
30 | + */ | ||
31 | +@Slf4j | ||
32 | +@Component | ||
33 | +public class OrderOverTimeEventJob { | ||
34 | + | ||
35 | + @Resource | ||
36 | + private OrderBaseInfoService orderBaseInfoService; | ||
37 | + | ||
38 | + @Resource | ||
39 | + private OrderProfitAnalysisService profitAnalysisService; | ||
40 | + | ||
41 | + @Resource | ||
42 | + private OrderCompletionReportService reportService; | ||
43 | + | ||
44 | + @Resource | ||
45 | + private OrderTrackStageService trackStageService; | ||
46 | + | ||
47 | + @Resource | ||
48 | + private OrderInspectionStageService inspectionStageService; | ||
49 | + | ||
50 | + @Resource | ||
51 | + private TransactionHelper transactionHelper; | ||
52 | + | ||
53 | + /** | ||
54 | + * 凌晨1点执行,一天一次 | ||
55 | + */ | ||
56 | + @Scheduled(cron = "0 0 1 * * ?") | ||
57 | + public void checkOverTimeExecute() { | ||
58 | + | ||
59 | + } | ||
60 | + | ||
61 | + | ||
62 | +} |
src/main/java/com/order/erp/mapper/order/EmailTemplateMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.EmailTemplateDO; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * 邮件模板表(EmailTemplate)表数据库访问层 | ||
8 | + * | ||
9 | + * @author makejava | ||
10 | + * @since 2024-07-03 10:58:26 | ||
11 | + */ | ||
12 | +public interface EmailTemplateMapper extends BaseMapper<EmailTemplateDO> { | ||
13 | + | ||
14 | + | ||
15 | +} | ||
16 | + |
src/main/java/com/order/erp/mapper/order/OrderUpdateLogMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | +import com.order.erp.domain.dto.order.OrderUpdateLogDO; | ||
5 | + | ||
6 | +/** | ||
7 | + * 订单更新日志表(OrderUpdateLog)表数据库访问层 | ||
8 | + * | ||
9 | + * @author makejava | ||
10 | + * @since 2024-07-03 17:30:32 | ||
11 | + */ | ||
12 | +public interface OrderUpdateLogMapper extends BaseMapper<OrderUpdateLogDO> { | ||
13 | + | ||
14 | + | ||
15 | +} | ||
16 | + |
src/main/java/com/order/erp/mapper/order/ReceiveEmailMappingMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)表数据库访问层 | ||
8 | + * | ||
9 | + * @author makejava | ||
10 | + * @since 2024-07-03 10:58:52 | ||
11 | + */ | ||
12 | +public interface ReceiveEmailMappingMapper extends BaseMapper<ReceiveEmailMappingDO> { | ||
13 | + | ||
14 | + | ||
15 | +} | ||
16 | + |
src/main/java/com/order/erp/service/order/EmailTemplateService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.EmailTemplateDO; | ||
6 | +import com.order.erp.domain.vo.order.EmailTemplateQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.EmailTemplateVO; | ||
8 | + | ||
9 | +/** | ||
10 | + * 邮件模板表(EmailTemplate)表服务接口 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-07-03 10:58:27 | ||
14 | + */ | ||
15 | +public interface EmailTemplateService extends IService<EmailTemplateDO> { | ||
16 | + | ||
17 | + /** | ||
18 | + * 通过ID查询单条数据 | ||
19 | + * | ||
20 | + * @param emailTemplateQueryVO 主键 | ||
21 | + * @return 实例对象 | ||
22 | + */ | ||
23 | + ServerResult queryById(EmailTemplateQueryVO emailTemplateQueryVO); | ||
24 | + | ||
25 | + /** | ||
26 | + * 分页查询 | ||
27 | + * | ||
28 | + * @param emailTemplateQueryVO 筛选条件 | ||
29 | + * @return 查询结果 | ||
30 | + */ | ||
31 | + ServerResult list(EmailTemplateQueryVO emailTemplateQueryVO); | ||
32 | + | ||
33 | + /** | ||
34 | + * 新增数据 | ||
35 | + * | ||
36 | + * @param emailTemplateVO 数据VO | ||
37 | + * @return 新增结果 | ||
38 | + */ | ||
39 | + ServerResult add(EmailTemplateVO emailTemplateVO); | ||
40 | + | ||
41 | + /** | ||
42 | + * 修改数据 | ||
43 | + * | ||
44 | + * @param emailTemplateVO 数据VO | ||
45 | + * @return 编辑结果 | ||
46 | + */ | ||
47 | + ServerResult edit(EmailTemplateVO emailTemplateVO); | ||
48 | + | ||
49 | + /** | ||
50 | + * 通过主键删除数据 | ||
51 | + * | ||
52 | + * @param emailTemplateQueryVO 筛选条件 | ||
53 | + * @return 是否成功 | ||
54 | + */ | ||
55 | + ServerResult deleteById(EmailTemplateQueryVO emailTemplateQueryVO); | ||
56 | + | ||
57 | +} |
src/main/java/com/order/erp/service/order/OrderUpdateLogService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.OrderUpdateLogDO; | ||
6 | +import com.order.erp.domain.vo.order.OrderUpdateLogQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.OrderUpdateLogVO; | ||
8 | + | ||
9 | +/** | ||
10 | + * 订单更新日志表(OrderUpdateLog)表服务接口 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-07-03 17:30:32 | ||
14 | + */ | ||
15 | +public interface OrderUpdateLogService extends IService<OrderUpdateLogDO> { | ||
16 | + | ||
17 | + /** | ||
18 | + * 通过ID查询单条数据 | ||
19 | + * | ||
20 | + * @param orderUpdateLogQueryVO 主键 | ||
21 | + * @return 实例对象 | ||
22 | + */ | ||
23 | + ServerResult queryById(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | ||
24 | + | ||
25 | + /** | ||
26 | + * 分页查询 | ||
27 | + * | ||
28 | + * @param orderUpdateLogQueryVO 筛选条件 | ||
29 | + * @return 查询结果 | ||
30 | + */ | ||
31 | + ServerResult list(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | ||
32 | + | ||
33 | + /** | ||
34 | + * 新增数据 | ||
35 | + * | ||
36 | + * @param orderUpdateLogVO 数据VO | ||
37 | + * @return 新增结果 | ||
38 | + */ | ||
39 | + ServerResult add(OrderUpdateLogVO orderUpdateLogVO); | ||
40 | + | ||
41 | + /** | ||
42 | + * 修改数据 | ||
43 | + * | ||
44 | + * @param orderUpdateLogVO 数据VO | ||
45 | + * @return 编辑结果 | ||
46 | + */ | ||
47 | + ServerResult edit(OrderUpdateLogVO orderUpdateLogVO); | ||
48 | + | ||
49 | + /** | ||
50 | + * 通过主键删除数据 | ||
51 | + * | ||
52 | + * @param orderUpdateLogQueryVO 筛选条件 | ||
53 | + * @return 是否成功 | ||
54 | + */ | ||
55 | + ServerResult deleteById(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | ||
56 | + | ||
57 | +} |
src/main/java/com/order/erp/service/order/ReceiveEmailMappingService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; | ||
6 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; | ||
8 | + | ||
9 | + | ||
10 | +/** | ||
11 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)表服务接口 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-07-03 10:58:52 | ||
15 | + */ | ||
16 | +public interface ReceiveEmailMappingService extends IService<ReceiveEmailMappingDO> { | ||
17 | + | ||
18 | + /** | ||
19 | + * 通过ID查询单条数据 | ||
20 | + * | ||
21 | + * @param receiveEmailMappingQueryVO 主键 | ||
22 | + * @return 实例对象 | ||
23 | + */ | ||
24 | + ServerResult queryById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO); | ||
25 | + | ||
26 | + /** | ||
27 | + * 分页查询 | ||
28 | + * | ||
29 | + * @param receiveEmailMappingQueryVO 筛选条件 | ||
30 | + * @return 查询结果 | ||
31 | + */ | ||
32 | + ServerResult list(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO); | ||
33 | + | ||
34 | + /** | ||
35 | + * 新增数据 | ||
36 | + * | ||
37 | + * @param receiveEmailMappingVO 数据VO | ||
38 | + * @return 新增结果 | ||
39 | + */ | ||
40 | + ServerResult add(ReceiveEmailMappingVO receiveEmailMappingVO); | ||
41 | + | ||
42 | + /** | ||
43 | + * 修改数据 | ||
44 | + * | ||
45 | + * @param receiveEmailMappingVO 数据VO | ||
46 | + * @return 编辑结果 | ||
47 | + */ | ||
48 | + ServerResult edit(ReceiveEmailMappingVO receiveEmailMappingVO); | ||
49 | + | ||
50 | + /** | ||
51 | + * 通过主键删除数据 | ||
52 | + * | ||
53 | + * @param receiveEmailMappingQueryVO 筛选条件 | ||
54 | + * @return 是否成功 | ||
55 | + */ | ||
56 | + ServerResult deleteById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO); | ||
57 | + | ||
58 | +} |
src/main/java/com/order/erp/service/order/impl/EmailTemplateServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.collection.CollUtil; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import com.order.erp.common.constant.Constant; | ||
8 | +import com.order.erp.common.constant.ServerResult; | ||
9 | +import com.order.erp.common.utils.PageUtils; | ||
10 | +import com.order.erp.domain.dto.order.EmailTemplateDO; | ||
11 | +import com.order.erp.domain.vo.order.EmailTemplateQueryVO; | ||
12 | +import com.order.erp.domain.vo.order.EmailTemplateVO; | ||
13 | +import com.order.erp.mapper.order.EmailTemplateMapper; | ||
14 | +import com.order.erp.service.order.EmailTemplateService; | ||
15 | +import lombok.extern.slf4j.Slf4j; | ||
16 | +import org.springframework.stereotype.Service; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | +import java.util.Objects; | ||
20 | + | ||
21 | +/** | ||
22 | + * 邮件模板表(EmailTemplate)表服务实现类 | ||
23 | + * | ||
24 | + * @author makejava | ||
25 | + * @since 2024-07-03 10:58:28 | ||
26 | + */ | ||
27 | +@Slf4j | ||
28 | +@Service | ||
29 | +public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, EmailTemplateDO> implements EmailTemplateService { | ||
30 | + | ||
31 | + | ||
32 | + /** | ||
33 | + * 通过ID查询单条数据 | ||
34 | + * <p> | ||
35 | + * emailTemplateQueryVO 主键 | ||
36 | + * | ||
37 | + * @return 实例对象 | ||
38 | + */ | ||
39 | + @Override | ||
40 | + public ServerResult queryById(EmailTemplateQueryVO emailTemplateQueryVO) { | ||
41 | + if (Objects.isNull(emailTemplateQueryVO.getId())) { | ||
42 | + return ServerResult.fail("id 不能为空"); | ||
43 | + } | ||
44 | + EmailTemplateDO EmailTemplateDo = getById(emailTemplateQueryVO.getId()); | ||
45 | + if (Objects.isNull(EmailTemplateDo)) { | ||
46 | + return ServerResult.success(null); | ||
47 | + } | ||
48 | + return ServerResult.success(BeanUtil.copyProperties(EmailTemplateDo, EmailTemplateVO.class)); | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * 分页查询 | ||
53 | + * | ||
54 | + * @param emailTemplateQueryVO 筛选条件 | ||
55 | + * @return 查询结果 | ||
56 | + */ | ||
57 | + @Override | ||
58 | + public ServerResult list(EmailTemplateQueryVO emailTemplateQueryVO) { | ||
59 | + | ||
60 | + //todo | ||
61 | + return ServerResult.success(PageUtils.getPageReturn(null, emailTemplateQueryVO)); | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * 新增数据 | ||
66 | + * | ||
67 | + * @param emailTemplateVO 实例对象 | ||
68 | + * @return 实例对象 | ||
69 | + */ | ||
70 | + @Override | ||
71 | + public ServerResult add(EmailTemplateVO emailTemplateVO) { | ||
72 | + //todo 校验 | ||
73 | + if (Objects.nonNull(emailTemplateVO.getId())) { | ||
74 | + emailTemplateVO.setId(null); | ||
75 | + } | ||
76 | + EmailTemplateDO emailTemplateDo = BeanUtil.copyProperties(emailTemplateVO, EmailTemplateDO.class); | ||
77 | + | ||
78 | + save(emailTemplateDo); | ||
79 | + | ||
80 | + return ServerResult.success(); | ||
81 | + } | ||
82 | + | ||
83 | + /** | ||
84 | + * 修改数据 | ||
85 | + * | ||
86 | + * @param emailTemplateVO 实例对象 | ||
87 | + * @return 实例对象 | ||
88 | + */ | ||
89 | + @Override | ||
90 | + public ServerResult edit(EmailTemplateVO emailTemplateVO) { | ||
91 | + //todo 校验 | ||
92 | + if (Objects.isNull(emailTemplateVO.getId())) { | ||
93 | + return ServerResult.fail("id 不能为空"); | ||
94 | + } | ||
95 | + EmailTemplateDO emailTemplateDo = BeanUtil.copyProperties(emailTemplateVO, EmailTemplateDO.class); | ||
96 | + | ||
97 | + updateById(emailTemplateDo); | ||
98 | + | ||
99 | + return ServerResult.success(); | ||
100 | + } | ||
101 | + | ||
102 | + /** | ||
103 | + * 通过主键删除数据 | ||
104 | + * | ||
105 | + * @param emailTemplateQueryVO 筛选条件 | ||
106 | + * @return 是否成功 | ||
107 | + */ | ||
108 | + @Override | ||
109 | + public ServerResult deleteById(EmailTemplateQueryVO emailTemplateQueryVO) { | ||
110 | + List<Long> ids = emailTemplateQueryVO.getIds(); | ||
111 | + if (CollUtil.isEmpty(ids)) { | ||
112 | + return ServerResult.fail("ids 参数不能为空"); | ||
113 | + } | ||
114 | + List<EmailTemplateDO> emailTemplateList = listByIds(ids); | ||
115 | + if (CollUtil.isEmpty(emailTemplateList)) { | ||
116 | + return ServerResult.success(); | ||
117 | + } | ||
118 | + //todo 校验是否可以逻辑删除 | ||
119 | + LambdaUpdateWrapper<EmailTemplateDO> updateWrapper = new LambdaUpdateWrapper<EmailTemplateDO>() | ||
120 | + .in(EmailTemplateDO::getId, ids) | ||
121 | + .set(EmailTemplateDO::getEnableFlag, Constant.UNABLE_TWENTY); | ||
122 | + update(updateWrapper); | ||
123 | + return ServerResult.success(); | ||
124 | + } | ||
125 | +} |
src/main/java/com/order/erp/service/order/impl/OrderUpdateLogServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.collection.CollUtil; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import com.order.erp.common.constant.Constant; | ||
8 | +import com.order.erp.common.constant.ServerResult; | ||
9 | +import com.order.erp.common.utils.PageUtils; | ||
10 | +import com.order.erp.domain.dto.order.OrderUpdateLogDO; | ||
11 | +import com.order.erp.domain.vo.order.OrderUpdateLogQueryVO; | ||
12 | +import com.order.erp.domain.vo.order.OrderUpdateLogVO; | ||
13 | +import com.order.erp.mapper.order.OrderUpdateLogMapper; | ||
14 | +import com.order.erp.service.order.OrderUpdateLogService; | ||
15 | +import lombok.extern.slf4j.Slf4j; | ||
16 | +import org.springframework.stereotype.Service; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | +import java.util.Objects; | ||
20 | + | ||
21 | +/** | ||
22 | + * 订单更新日志表(OrderUpdateLog)表服务实现类 | ||
23 | + * | ||
24 | + * @author makejava | ||
25 | + * @since 2024-07-03 17:30:32 | ||
26 | + */ | ||
27 | +@Slf4j | ||
28 | +@Service | ||
29 | +public class OrderUpdateLogServiceImpl extends ServiceImpl<OrderUpdateLogMapper, OrderUpdateLogDO> implements OrderUpdateLogService { | ||
30 | + | ||
31 | + | ||
32 | + /** | ||
33 | + * 通过ID查询单条数据 | ||
34 | + * <p> | ||
35 | + * orderUpdateLogQueryVO 主键 | ||
36 | + * | ||
37 | + * @return 实例对象 | ||
38 | + */ | ||
39 | + @Override | ||
40 | + public ServerResult queryById(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | ||
41 | + if (Objects.isNull(orderUpdateLogQueryVO.getId())) { | ||
42 | + return ServerResult.fail("id 不能为空"); | ||
43 | + } | ||
44 | + OrderUpdateLogDO OrderUpdateLogDo = getById(orderUpdateLogQueryVO.getId()); | ||
45 | + if (Objects.isNull(OrderUpdateLogDo)) { | ||
46 | + return ServerResult.success(null); | ||
47 | + } | ||
48 | + return ServerResult.success(BeanUtil.copyProperties(OrderUpdateLogDo, OrderUpdateLogVO.class)); | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * 分页查询 | ||
53 | + * | ||
54 | + * @param orderUpdateLogQueryVO 筛选条件 | ||
55 | + * @return 查询结果 | ||
56 | + */ | ||
57 | + @Override | ||
58 | + public ServerResult list(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | ||
59 | + | ||
60 | + return ServerResult.success(PageUtils.getPageReturn(null, orderUpdateLogQueryVO)); | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * 新增数据 | ||
65 | + * | ||
66 | + * @param orderUpdateLogVO 实例对象 | ||
67 | + * @return 实例对象 | ||
68 | + */ | ||
69 | + @Override | ||
70 | + public ServerResult add(OrderUpdateLogVO orderUpdateLogVO) { | ||
71 | + //todo 校验 | ||
72 | + if (Objects.nonNull(orderUpdateLogVO.getId())) { | ||
73 | + orderUpdateLogVO.setId(null); | ||
74 | + } | ||
75 | + OrderUpdateLogDO orderUpdateLogDo = BeanUtil.copyProperties(orderUpdateLogVO, OrderUpdateLogDO.class); | ||
76 | + | ||
77 | + save(orderUpdateLogDo); | ||
78 | + | ||
79 | + return ServerResult.success(); | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 修改数据 | ||
84 | + * | ||
85 | + * @param orderUpdateLogVO 实例对象 | ||
86 | + * @return 实例对象 | ||
87 | + */ | ||
88 | + @Override | ||
89 | + public ServerResult edit(OrderUpdateLogVO orderUpdateLogVO) { | ||
90 | + //todo 校验 | ||
91 | + if (Objects.isNull(orderUpdateLogVO.getId())) { | ||
92 | + return ServerResult.fail("id 不能为空"); | ||
93 | + } | ||
94 | + OrderUpdateLogDO orderUpdateLogDo = BeanUtil.copyProperties(orderUpdateLogVO, OrderUpdateLogDO.class); | ||
95 | + | ||
96 | + updateById(orderUpdateLogDo); | ||
97 | + | ||
98 | + return ServerResult.success(); | ||
99 | + } | ||
100 | + | ||
101 | + /** | ||
102 | + * 通过主键删除数据 | ||
103 | + * | ||
104 | + * @param orderUpdateLogQueryVO 筛选条件 | ||
105 | + * @return 是否成功 | ||
106 | + */ | ||
107 | + @Override | ||
108 | + public ServerResult deleteById(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | ||
109 | + List<Long> ids = orderUpdateLogQueryVO.getIds(); | ||
110 | + if (CollUtil.isEmpty(ids)) { | ||
111 | + return ServerResult.fail("ids 参数不能为空"); | ||
112 | + } | ||
113 | + List<OrderUpdateLogDO> orderUpdateLogList = listByIds(ids); | ||
114 | + if (CollUtil.isEmpty(orderUpdateLogList)) { | ||
115 | + return ServerResult.success(); | ||
116 | + } | ||
117 | + //todo 校验是否可以逻辑删除 | ||
118 | + LambdaUpdateWrapper<OrderUpdateLogDO> updateWrapper = new LambdaUpdateWrapper<OrderUpdateLogDO>() | ||
119 | + .in(OrderUpdateLogDO::getId, ids) | ||
120 | + .set(OrderUpdateLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | ||
121 | + update(updateWrapper); | ||
122 | + return ServerResult.success(); | ||
123 | + } | ||
124 | +} |
src/main/java/com/order/erp/service/order/impl/ReceiveEmailMappingServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.collection.CollUtil; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import com.order.erp.common.constant.Constant; | ||
8 | +import com.order.erp.common.constant.ServerResult; | ||
9 | +import com.order.erp.common.utils.PageUtils; | ||
10 | +import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; | ||
11 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; | ||
12 | +import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; | ||
13 | +import com.order.erp.mapper.order.ReceiveEmailMappingMapper; | ||
14 | +import com.order.erp.service.order.ReceiveEmailMappingService; | ||
15 | +import lombok.extern.slf4j.Slf4j; | ||
16 | +import org.springframework.stereotype.Service; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | +import java.util.Objects; | ||
20 | + | ||
21 | +/** | ||
22 | + * 邮件接收人信息绑定表(ReceiveEmailMapping)表服务实现类 | ||
23 | + * | ||
24 | + * @author makejava | ||
25 | + * @since 2024-07-03 10:58:52 | ||
26 | + */ | ||
27 | +@Slf4j | ||
28 | +@Service | ||
29 | +public class ReceiveEmailMappingServiceImpl extends ServiceImpl<ReceiveEmailMappingMapper, ReceiveEmailMappingDO> implements ReceiveEmailMappingService { | ||
30 | + | ||
31 | + | ||
32 | + /** | ||
33 | + * 通过ID查询单条数据 | ||
34 | + * <p> | ||
35 | + * receiveEmailMappingQueryVO 主键 | ||
36 | + * | ||
37 | + * @return 实例对象 | ||
38 | + */ | ||
39 | + @Override | ||
40 | + public ServerResult queryById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | ||
41 | + if (Objects.isNull(receiveEmailMappingQueryVO.getId())) { | ||
42 | + return ServerResult.fail("id 不能为空"); | ||
43 | + } | ||
44 | + ReceiveEmailMappingDO ReceiveEmailMappingDo = getById(receiveEmailMappingQueryVO.getId()); | ||
45 | + if (Objects.isNull(ReceiveEmailMappingDo)) { | ||
46 | + return ServerResult.success(null); | ||
47 | + } | ||
48 | + return ServerResult.success(BeanUtil.copyProperties(ReceiveEmailMappingDo, ReceiveEmailMappingVO.class)); | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * 分页查询 | ||
53 | + * | ||
54 | + * @param receiveEmailMappingQueryVO 筛选条件 | ||
55 | + * @return 查询结果 | ||
56 | + */ | ||
57 | + @Override | ||
58 | + public ServerResult list(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | ||
59 | + | ||
60 | + return ServerResult.success(PageUtils.getPageReturn(null, receiveEmailMappingQueryVO)); | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * 新增数据 | ||
65 | + * | ||
66 | + * @param receiveEmailMappingVO 实例对象 | ||
67 | + * @return 实例对象 | ||
68 | + */ | ||
69 | + @Override | ||
70 | + public ServerResult add(ReceiveEmailMappingVO receiveEmailMappingVO) { | ||
71 | + //todo 校验 | ||
72 | + if (Objects.nonNull(receiveEmailMappingVO.getId())) { | ||
73 | + receiveEmailMappingVO.setId(null); | ||
74 | + } | ||
75 | + ReceiveEmailMappingDO receiveEmailMappingDo = BeanUtil.copyProperties(receiveEmailMappingVO, ReceiveEmailMappingDO.class); | ||
76 | + | ||
77 | + save(receiveEmailMappingDo); | ||
78 | + | ||
79 | + return ServerResult.success(); | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 修改数据 | ||
84 | + * | ||
85 | + * @param receiveEmailMappingVO 实例对象 | ||
86 | + * @return 实例对象 | ||
87 | + */ | ||
88 | + @Override | ||
89 | + public ServerResult edit(ReceiveEmailMappingVO receiveEmailMappingVO) { | ||
90 | + //todo 校验 | ||
91 | + if (Objects.isNull(receiveEmailMappingVO.getId())) { | ||
92 | + return ServerResult.fail("id 不能为空"); | ||
93 | + } | ||
94 | + ReceiveEmailMappingDO receiveEmailMappingDo = BeanUtil.copyProperties(receiveEmailMappingVO, ReceiveEmailMappingDO.class); | ||
95 | + | ||
96 | + updateById(receiveEmailMappingDo); | ||
97 | + | ||
98 | + return ServerResult.success(); | ||
99 | + } | ||
100 | + | ||
101 | + /** | ||
102 | + * 通过主键删除数据 | ||
103 | + * | ||
104 | + * @param receiveEmailMappingQueryVO 筛选条件 | ||
105 | + * @return 是否成功 | ||
106 | + */ | ||
107 | + @Override | ||
108 | + public ServerResult deleteById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | ||
109 | + List<Long> ids = receiveEmailMappingQueryVO.getIds(); | ||
110 | + if (CollUtil.isEmpty(ids)) { | ||
111 | + return ServerResult.fail("ids 参数不能为空"); | ||
112 | + } | ||
113 | + List<ReceiveEmailMappingDO> receiveEmailMappingList = listByIds(ids); | ||
114 | + if (CollUtil.isEmpty(receiveEmailMappingList)) { | ||
115 | + return ServerResult.success(); | ||
116 | + } | ||
117 | + //todo 校验是否可以逻辑删除 | ||
118 | + LambdaUpdateWrapper<ReceiveEmailMappingDO> updateWrapper = new LambdaUpdateWrapper<ReceiveEmailMappingDO>() | ||
119 | + .in(ReceiveEmailMappingDO::getId, ids) | ||
120 | + .set(ReceiveEmailMappingDO::getEnableFlag, Constant.UNABLE_TWENTY); | ||
121 | + update(updateWrapper); | ||
122 | + return ServerResult.success(); | ||
123 | + } | ||
124 | +} |