Commit bf78f16ca20a931020e1aec86c90973a5cb7bd9d
Merge branch 'ch-prod' into 'main'
Ch prod See merge request !1
Showing
68 changed files
with
3472 additions
and
222 deletions
pom.xml
... | ... | @@ -282,17 +282,6 @@ |
282 | 282 | <version>${x-easypdf-pdfbox.version}</version> |
283 | 283 | </dependency> |
284 | 284 | |
285 | - <!--email邮件配置--> | |
286 | - <dependency> | |
287 | - <groupId>org.springframework.boot</groupId> | |
288 | - <artifactId>spring-boot-starter-mail</artifactId> | |
289 | - </dependency> | |
290 | - | |
291 | - <!--Freemarker--> | |
292 | - <dependency> | |
293 | - <groupId>org.springframework.boot</groupId> | |
294 | - <artifactId>spring-boot-starter-freemarker</artifactId> | |
295 | - </dependency> | |
296 | 285 | </dependencies> |
297 | 286 | <build> |
298 | 287 | <finalName>order-erp.service-1.0-SNAPSHOT</finalName> | ... | ... |
sql/dml_erp_bill_v2.sql
0 → 100644
1 | +DROP TABLE IF EXISTS `invoice_bill_order`; | |
2 | +CREATE TABLE `invoice_bill_order` ( | |
3 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
4 | + `invoice_no` varchar(64) NOT NULL COMMENT '发票单号', | |
5 | + `bg_url` varchar(512) default NULL COMMENT '报关单url地址', | |
6 | + `back_refund_date` varchar(64) default null COMMENT '必须回款日期', | |
7 | + `actual_refund_date` varchar(64) default null COMMENT '实际回款日期', | |
8 | + `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '发生扣款金额', | |
9 | + `deduct_url` varchar(512) default NULL COMMENT '扣款单url地址', | |
10 | + `actual_receivable_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应收金额', | |
11 | + `actual_payed_amount1` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额1', | |
12 | + `actual_payed_amount2` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额2', | |
13 | + `actual_payed_amount3` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额3', | |
14 | + `other_amount` decimal(20,6) DEFAULT NULL COMMENT '其他费用金额', | |
15 | + `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回', | |
16 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
17 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
18 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
19 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
20 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
21 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
22 | + PRIMARY KEY (`id`) | |
23 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单表'; | |
24 | + | |
25 | +DROP TABLE IF EXISTS `invoice_bill_mapping`; | |
26 | +CREATE TABLE `invoice_bill_mapping` ( | |
27 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
28 | + `invoice_no` varchar(64) NOT NULL COMMENT '发票单号', | |
29 | + `invoice_bill_id` bigint DEFAULT '0' COMMENT 'invoice账单id', | |
30 | + `order_id` bigint DEFAULT '0' COMMENT '订单id', | |
31 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
32 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
33 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
34 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
35 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
36 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
37 | + PRIMARY KEY (`id`) | |
38 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单关联订单映射表'; | |
39 | + | |
40 | + | |
41 | +DROP TABLE IF EXISTS `produce_payment_check_bill_order`; | |
42 | +CREATE TABLE `produce_payment_check_bill_order` ( | |
43 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
44 | + `check_no` varchar(64) NOT NULL COMMENT '生产科对账单', | |
45 | + `invoice_url` varchar(512) default NULL COMMENT '发票url地址', | |
46 | + `deduct_pdf_url` varchar(512) default NULL COMMENT '扣款单url地址', | |
47 | + `payed_date` varchar(64) default null COMMENT '生产科应付款日期', | |
48 | + `deduct_dept` varchar(64) default null COMMENT '生产科扣款责任部门', | |
49 | + `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '生产科扣款金额', | |
50 | + `actual_payed_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额', | |
51 | + `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回', | |
52 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
53 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
54 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
55 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
56 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
57 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
58 | + PRIMARY KEY (`id`) | |
59 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单'; | |
60 | + | |
61 | +DROP TABLE IF EXISTS `check_bill_mapping`; | |
62 | +CREATE TABLE `check_bill_mapping` ( | |
63 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
64 | + `check_no` varchar(64) NOT NULL COMMENT '生产科对账单号', | |
65 | + `check_bill_id` bigint DEFAULT '0' COMMENT 'check账单id', | |
66 | + `order_id` bigint DEFAULT '0' COMMENT '订单id', | |
67 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
68 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
69 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
70 | + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
71 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
72 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
73 | + PRIMARY KEY (`id`) | |
74 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单映射表'; | |
75 | + | ... | ... |
sql/table.sql
... | ... | @@ -83,31 +83,35 @@ CREATE TABLE `order_completion_report` ( |
83 | 83 | |
84 | 84 | |
85 | 85 | DROP TABLE IF EXISTS `order_track_stage`; |
86 | -CREATE TABLE `order_track_stage` ( | |
87 | - `id` bigint NOT NULL AUTO_INCREMENT, | |
88 | - `order_id` bigint NOT NULL COMMENT '订单id', | |
89 | - `pp_time` varchar(64) DEFAULT NULL COMMENT 'pp date', | |
90 | - `pp_confirm_result` varchar(64) DEFAULT NULL COMMENT 'pp样品确认意见', | |
91 | - `eso_sample_send_time` varchar(64) DEFAULT NULL COMMENT 'EXTRA,SHOWROOM,ONLINE sample发送时间', | |
92 | - `shippment_sample_send_time` varchar(64) DEFAULT NULL COMMENT 'shippment sample 发送时间', | |
93 | - `shippment_sample_confirm_result` varchar(64) DEFAULT NULL COMMENT 'shipment sample确认意见', | |
94 | - `self_test_pass_time` varchar(64) DEFAULT NULL COMMENT '自测通过时间', | |
95 | - `aitex_test_send_time` varchar(64) DEFAULT NULL COMMENT 'Aitex测试发送时间', | |
96 | - `aitex_test_finish_result` varchar(64) DEFAULT NULL COMMENT 'Aitex测试结果', | |
97 | - `sgs_test_send_time` varchar(64) DEFAULT NULL COMMENT 'SGS测试发送时间', | |
98 | - `sgs_test_finish_result` varchar(64) DEFAULT NULL COMMENT 'SGS测试结果', | |
99 | - `barcode_sticker_arrival_time` varchar(64) DEFAULT NULL COMMENT 'Barcode sticker arrival time', | |
100 | - `latest_arrival_time` varchar(64) DEFAULT NULL COMMENT '最晚包材到货时间', | |
101 | - `latest_bk_time` varchar(64) DEFAULT NULL COMMENT '最晚订舱+报关资料时间', | |
102 | - `order_status` INT NOT NULL COMMENT '订单状态', | |
103 | - `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
104 | - `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
105 | - `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
106 | - `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
107 | - `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
108 | - `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
109 | - PRIMARY KEY (`id`) | |
110 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单-跟单环节'; | |
86 | +CREATE TABLE `order_track_stage` ( | |
87 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
88 | + `order_id` bigint NOT NULL COMMENT '订单id', | |
89 | + `pp_time` varchar(64) DEFAULT NULL COMMENT 'pp date', | |
90 | + `pp_confirm_result` varchar(64) DEFAULT NULL COMMENT 'pp样品确认意见', | |
91 | + `pp_confirm_time` varchar(64) DEFAULT NULL COMMENT 'pp样品确认时间', | |
92 | + `eso_sample_send_time` varchar(64) DEFAULT NULL COMMENT 'EXTRA,SHOWROOM,ONLINE sample发送时间', | |
93 | + `shippment_sample_send_time` varchar(64) NULL DEFAULT NULL COMMENT 'shippment sample 发送时间', | |
94 | + `shippment_sample_confirm_result` varchar(64) DEFAULT NULL COMMENT 'shipment sample确认意见', | |
95 | + `shippment_sample_confirm_time` varchar(64) DEFAULT NULL COMMENT 'shipment sample确认时间', | |
96 | + `self_test_pass_time` varchar(64) DEFAULT NULL COMMENT '自测通过时间', | |
97 | + `aitex_test_send_time` varchar(64) DEFAULT NULL COMMENT 'Aitex测试发送时间', | |
98 | + `aitex_test_finish_result` varchar(64) DEFAULT NULL COMMENT 'Aitex测试结果', | |
99 | + `aitex_test_finish_time` varchar(64) DEFAULT NULL COMMENT 'Aitex确认时间', | |
100 | + `sgs_test_send_time` varchar(64) DEFAULT NULL COMMENT 'SGS测试发送时间', | |
101 | + `sgs_test_finish_result` varchar(64) NULL COMMENT 'SGS测试结果', | |
102 | + `sgs_test_finish_time` varchar(64) COMMENT 'SGS确认时间', | |
103 | + `barcode_sticker_arrival_time` varchar(64) DEFAULT NULL COMMENT 'Barcode sticker arrival time', | |
104 | + `latest_arrival_time` varchar(64) DEFAULT NULL COMMENT '最晚包材到货时间', | |
105 | + `latest_bk_time` varchar(64) DEFAULT NULL COMMENT '最晚订舱+报关资料时间', | |
106 | + `order_status` INT NOT NULL COMMENT '订单状态', | |
107 | + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
108 | + `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
109 | + `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
110 | + `modify_time` DATETIME NULL DEFAULT NULL COMMENT '修改时间', | |
111 | + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
112 | + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
113 | + PRIMARY KEY (`id`) USING BTREE | |
114 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '订单-跟单环节' ; | |
111 | 115 | |
112 | 116 | |
113 | 117 | DROP TABLE IF EXISTS `order_inspection_stage`; |
... | ... | @@ -224,4 +228,21 @@ CREATE TABLE `system_setting` ( |
224 | 228 | `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', |
225 | 229 | `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', |
226 | 230 | PRIMARY KEY (`id`) |
227 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置'; | |
228 | 231 | \ No newline at end of file |
232 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置'; | |
233 | + | |
234 | +DROP TABLE IF EXISTS `receive_email_mapping`; | |
235 | +CREATE TABLE `receive_email_mapping` ( | |
236 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
237 | + ` type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '类型', | |
238 | + `type_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '类型值', | |
239 | + `config_infos` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '配置信息 json', | |
240 | + `enable_flag` int NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
241 | + `create_time` datetime NOT NULL COMMENT '创建时间', | |
242 | + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人', | |
243 | + `modify_time` datetime NULL DEFAULT NULL COMMENT '修改时间', | |
244 | + `modify_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '修改人', | |
245 | + `version` int NULL DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
246 | + PRIMARY KEY (`id`) USING BTREE | |
247 | +) ENGINE = InnoDB AUTO_INCREMENT = 94 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '邮件接收人信息绑定表' ROW_FORMAT = Dynamic; | |
248 | + | |
249 | + | ... | ... |
src/main/java/com/order/erp/common/constant/Constant.java
src/main/java/com/order/erp/common/utils/EmailSendUtils.java
... | ... | @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
4 | 4 | import com.order.erp.common.constant.ServerResultCode; |
5 | 5 | import com.order.erp.common.exception.BusinessException; |
6 | 6 | import com.order.erp.domain.EmailTemplateEnum; |
7 | -import com.order.erp.domain.email.OrderProductEmailVO; | |
8 | 7 | import com.order.erp.domain.vo.order.OrderEventJobVO; |
9 | 8 | import freemarker.template.Template; |
10 | 9 | import freemarker.template.TemplateException; |
... | ... | @@ -50,31 +49,31 @@ public class EmailSendUtils { |
50 | 49 | if(CollectionUtils.isEmpty(receiveemailList) && emailTemplateEnum ==null && ObjectUtils.isNull(orderEventJobVO)){ |
51 | 50 | throw new BusinessException(ServerResultCode.PARAM_ERROR); |
52 | 51 | } |
53 | - MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | |
54 | - MimeMessageHelper helper= null; | |
55 | - Map<String, Object> map = new HashMap<>(); | |
56 | - map.put("context",emailTemplateEnum.getContent()); | |
57 | - map.put("title",emailTemplateEnum.getTitle()); | |
58 | - map.put("data",orderEventJobVO); | |
59 | - Template template = null; | |
60 | - //设置收件人 | |
61 | - String[] receiveemailListArray = receiveemailList.toArray(new String[receiveemailList.size()]); | |
62 | - try { | |
63 | - helper = new MimeMessageHelper(mimeMessage,true); | |
52 | + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | |
53 | + MimeMessageHelper helper= null; | |
54 | + Map<String, Object> map = new HashMap<>(); | |
55 | + map.put("context",emailTemplateEnum.getContent()); | |
56 | + map.put("title",emailTemplateEnum.getTitle()); | |
57 | + map.put("data",orderEventJobVO); | |
58 | + Template template = null; | |
59 | + //设置收件人 | |
60 | + String[] receiveemailListArray = receiveemailList.toArray(new String[receiveemailList.size()]); | |
61 | + try { | |
62 | + helper = new MimeMessageHelper(mimeMessage,true); | |
64 | 63 | //设置邮件的主题 |
65 | - helper.setSubject(emailTemplateEnum.getTitle()); | |
64 | + helper.setSubject(emailTemplateEnum.getTitle()); | |
66 | 65 | //设置发件人 |
67 | - helper.setFrom(sendEmail); | |
68 | - helper.setTo(receiveemailListArray); | |
69 | - helper.setSentDate(new Date()); | |
70 | - template = freeMarkerConfigurer.getConfiguration().getTemplate("mail.ftl"); | |
71 | - StringWriter stringWriter = new StringWriter(); | |
72 | - template.process(map,stringWriter); | |
73 | - helper.setText(stringWriter.toString(),true); | |
74 | - } catch (TemplateException | IOException | MessagingException e) { | |
75 | - throw new RuntimeException("邮件发送失败!"); | |
66 | + helper.setFrom(sendEmail); | |
67 | + helper.setTo(receiveemailListArray); | |
68 | + helper.setSentDate(new Date()); | |
69 | + template = freeMarkerConfigurer.getConfiguration().getTemplate("mail.ftl"); | |
70 | + StringWriter stringWriter = new StringWriter(); | |
71 | + template.process(map,stringWriter); | |
72 | + helper.setText(stringWriter.toString(),true); | |
73 | + } catch (TemplateException | IOException | MessagingException e) { | |
74 | + throw new RuntimeException("邮件发送失败!"); | |
76 | 75 | } |
77 | - javaMailSender.send(mimeMessage); | |
76 | + javaMailSender.send(mimeMessage); | |
78 | 77 | } |
79 | 78 | /** |
80 | 79 | * @Description: 发送生产指示书邮件 |
... | ... | @@ -89,23 +88,23 @@ public class EmailSendUtils { |
89 | 88 | if (CollectionUtils.isEmpty(receiveemailList) && emailTemplateEnum == null && ObjectUtils.isNull(pdfFile)) { |
90 | 89 | throw new BusinessException(ServerResultCode.PARAM_ERROR); |
91 | 90 | } |
92 | - MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | |
93 | - //设置收件人 | |
94 | - String[] receiveemailListArray = receiveemailList.toArray(new String[receiveemailList.size()]); | |
95 | - MimeMessageHelper helper = null; | |
96 | - try { | |
97 | - helper = new MimeMessageHelper(mimeMessage, true); | |
91 | + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | |
92 | + //设置收件人 | |
93 | + String[] receiveemailListArray = receiveemailList.toArray(new String[receiveemailList.size()]); | |
94 | + MimeMessageHelper helper = null; | |
95 | + try { | |
96 | + helper = new MimeMessageHelper(mimeMessage, true); | |
98 | 97 | //设置邮件的主题 |
99 | - helper.setSubject(emailTemplateEnum.getTitle()); | |
98 | + helper.setSubject(emailTemplateEnum.getTitle()); | |
100 | 99 | //设置发件人 |
101 | - helper.setFrom(sendEmail); | |
102 | - helper.setTo(receiveemailListArray); | |
103 | - helper.setSentDate(new Date()); | |
104 | - helper.setText(emailTemplateEnum.getContent()); | |
105 | - helper.addAttachment(pdfFile.getName(), pdfFile); | |
106 | - } catch (MessagingException e) { | |
107 | - throw new RuntimeException("邮件发送失败!"); | |
108 | - } | |
109 | - javaMailSender.send(mimeMessage); | |
100 | + helper.setFrom(sendEmail); | |
101 | + helper.setTo(receiveemailListArray); | |
102 | + helper.setSentDate(new Date()); | |
103 | + helper.setText(emailTemplateEnum.getContent()); | |
104 | + helper.addAttachment(pdfFile.getName(), pdfFile); | |
105 | + } catch (MessagingException e) { | |
106 | + throw new RuntimeException("邮件发送失败!"); | |
110 | 107 | } |
108 | + javaMailSender.send(mimeMessage); | |
109 | + } | |
111 | 110 | } |
112 | 111 | \ No newline at end of file | ... | ... |
src/main/java/com/order/erp/controller/EmailTemplateController.java
... | ... | @@ -2,8 +2,6 @@ package com.order.erp.controller; |
2 | 2 | |
3 | 3 | import com.order.erp.common.constant.ServerResult; |
4 | 4 | import com.order.erp.common.jsr303.OperateGroup; |
5 | -import com.order.erp.common.utils.EasyPdfUtils; | |
6 | -import com.order.erp.common.utils.FileUtil; | |
7 | 5 | import com.order.erp.domain.vo.order.EmailTemplateQueryVO; |
8 | 6 | import com.order.erp.domain.vo.order.EmailTemplateVO; |
9 | 7 | import com.order.erp.service.order.EmailTemplateService; |
... | ... | @@ -14,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping; |
14 | 12 | import org.springframework.web.bind.annotation.RestController; |
15 | 13 | |
16 | 14 | import javax.annotation.Resource; |
17 | -import java.io.File; | |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * 邮件模板表(EmailTemplate)表控制层 |
... | ... | @@ -31,24 +28,6 @@ public class EmailTemplateController { |
31 | 28 | @Resource |
32 | 29 | private EmailTemplateService emailTemplateService; |
33 | 30 | |
34 | - @Resource | |
35 | - private EasyPdfUtils pdfUtils; | |
36 | - | |
37 | - /** | |
38 | - * 分页查询 | |
39 | - * | |
40 | - * @param emailTemplateQueryVO 查询条件 | |
41 | - * @return 查询结果 | |
42 | - */ | |
43 | - @PostMapping("/test") | |
44 | - public ServerResult test(@RequestBody @Validated({OperateGroup.List.class}) EmailTemplateQueryVO emailTemplateQueryVO) { | |
45 | - | |
46 | - | |
47 | - pdfUtils.createProducePdf(pdfUtils.build(), "testPagePlaceholder.pdf"); | |
48 | - | |
49 | - return ServerResult.success(); | |
50 | - } | |
51 | - | |
52 | 31 | /** |
53 | 32 | * 分页查询 |
54 | 33 | * | ... | ... |
src/main/java/com/order/erp/controller/InvoiceBillOrderController.java
0 → 100644
1 | +package com.order.erp.controller; | |
2 | + | |
3 | +import com.order.erp.common.annotation.AnonymousAccess; | |
4 | +import com.order.erp.common.constant.ServerResult; | |
5 | +import com.order.erp.common.excel4j.exceptions.Excel4JException; | |
6 | +import com.order.erp.common.jsr303.OperateGroup; | |
7 | +import com.order.erp.domain.vo.order.*; | |
8 | +import com.order.erp.service.order.InvoiceBillOrderService; | |
9 | +import io.swagger.annotations.ApiOperation; | |
10 | +import org.springframework.validation.annotation.Validated; | |
11 | +import org.springframework.web.bind.annotation.PostMapping; | |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
13 | +import org.springframework.web.bind.annotation.RequestMapping; | |
14 | +import org.springframework.web.bind.annotation.RestController; | |
15 | + | |
16 | +import javax.annotation.Resource; | |
17 | +import javax.servlet.http.HttpServletResponse; | |
18 | +import java.io.IOException; | |
19 | + | |
20 | +/** | |
21 | + * 应收款账单表(InvoiceBillOrder)表控制层 | |
22 | + * | |
23 | + * @author makejava | |
24 | + * @since 2024-08-05 16:26:34 | |
25 | + */ | |
26 | +@RestController | |
27 | +@RequestMapping("/order/erp/invoice_bill") | |
28 | +public class InvoiceBillOrderController { | |
29 | + /** | |
30 | + * 服务对象 | |
31 | + */ | |
32 | + @Resource | |
33 | + private InvoiceBillOrderService invoiceBillOrderService; | |
34 | + | |
35 | + /** | |
36 | + * 分页查询 | |
37 | + * | |
38 | + * @param invoiceBillOrderQueryVO 查询条件 | |
39 | + * @return 查询结果 | |
40 | + */ | |
41 | + @PostMapping("/list_by_page") | |
42 | + public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
43 | + return invoiceBillOrderService.listByPage(invoiceBillOrderQueryVO); | |
44 | + } | |
45 | + | |
46 | + /** | |
47 | + * 基础订单查询 | |
48 | + * | |
49 | + * @param queryVO 查询条件 | |
50 | + * @return 查询结果 | |
51 | + */ | |
52 | + @PostMapping("/list_base_order_info_by") | |
53 | + public ServerResult listBaseOrderInfoBy(@RequestBody @Validated InvoiceBaseOrderQueryVO queryVO) { | |
54 | + return invoiceBillOrderService.listBaseOrderInfoBy(queryVO); | |
55 | + } | |
56 | + | |
57 | + /** | |
58 | + * 分析列表 | |
59 | + * | |
60 | + * @param queryVO 查询条件 | |
61 | + * @return 查询结果 | |
62 | + */ | |
63 | + @PostMapping("/list_analysis_by") | |
64 | + public ServerResult listAnalysisBy(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillAnalysisVO queryVO) { | |
65 | + return invoiceBillOrderService.listAnalysisBy(queryVO); | |
66 | + } | |
67 | + | |
68 | + /** | |
69 | + * 导出分析列表 | |
70 | + * | |
71 | + * @param queryVO 查询条件 | |
72 | + * @return 查询结果 | |
73 | + */ | |
74 | + @PostMapping(value = "/export") | |
75 | + @ApiOperation("导出分析列表") | |
76 | + @AnonymousAccess | |
77 | + public void export(HttpServletResponse response, @RequestBody @Validated InvoiceBillAnalysisVO queryVO) throws IOException, Excel4JException { | |
78 | + invoiceBillOrderService.export(response, queryVO); | |
79 | + } | |
80 | + | |
81 | + /** | |
82 | + * 创建invoice单据 | |
83 | + * | |
84 | + * @param createVO 数据VO | |
85 | + * @return 新增结果 | |
86 | + */ | |
87 | + @PostMapping("/create") | |
88 | + public ServerResult create(@RequestBody InvoiceBillCreateVO createVO) { | |
89 | + return invoiceBillOrderService.create(createVO); | |
90 | + } | |
91 | + | |
92 | + /** | |
93 | + * 获取必须回款日期 | |
94 | + * | |
95 | + * @param createVO 数据VO | |
96 | + * @return 新增结果 | |
97 | + */ | |
98 | + @PostMapping("/get_back_refund_date") | |
99 | + public ServerResult getBackRefundDate(@RequestBody InvoiceBillCreateVO createVO) { | |
100 | + return invoiceBillOrderService.getBackRefundDate(createVO); | |
101 | + } | |
102 | + | |
103 | + /** | |
104 | + * 更新扣款信息 | |
105 | + * | |
106 | + * @param deductInfoVO 数据VO | |
107 | + * @return 编辑结果 | |
108 | + */ | |
109 | + @PostMapping("/update_deduct_info") | |
110 | + public ServerResult updateDeductInfo(@RequestBody InvoiceBillDeductInfoVO deductInfoVO) { | |
111 | + return invoiceBillOrderService.updateDeductInfo(deductInfoVO); | |
112 | + } | |
113 | + | |
114 | + /** | |
115 | + * 更新其他金额信息 | |
116 | + * | |
117 | + * @param amountInfoVO 数据VO | |
118 | + * @return 编辑结果 | |
119 | + */ | |
120 | + @PostMapping("/update_amount_info") | |
121 | + public ServerResult updateAmountInfo(@RequestBody InvoiceBillAmountInfoVO amountInfoVO) { | |
122 | + return invoiceBillOrderService.updateAmountInfo(amountInfoVO); | |
123 | + } | |
124 | + | |
125 | + /** | |
126 | + * 提交审核 | |
127 | + * | |
128 | + * @param commitApplyVO 数据VO | |
129 | + * @return 编辑结果 | |
130 | + */ | |
131 | + @PostMapping("/commit_apply") | |
132 | + public ServerResult commitApply(@RequestBody InvoiceBillCommitApplyVO commitApplyVO) { | |
133 | + return invoiceBillOrderService.commitApply(commitApplyVO); | |
134 | + } | |
135 | + | |
136 | + /** | |
137 | + * 删除数据 | |
138 | + * | |
139 | + * @param invoiceBillOrderQueryVO 查询条件 | |
140 | + * @return 删除是否成功 | |
141 | + */ | |
142 | + @PostMapping("/delete_by_id") | |
143 | + public ServerResult deleteById(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
144 | + return invoiceBillOrderService.deleteById(invoiceBillOrderQueryVO); | |
145 | + } | |
146 | + | |
147 | +} | |
148 | + | ... | ... |
src/main/java/com/order/erp/controller/LocalStorageController.java
... | ... | @@ -31,11 +31,18 @@ public class LocalStorageController { |
31 | 31 | return localStorageService.create(name, file); |
32 | 32 | } |
33 | 33 | |
34 | - @ApiOperation("上传文件到oss服务") | |
34 | + @ApiOperation("上传图片到oss服务") | |
35 | 35 | @PostMapping(value = "/upload_oss") |
36 | 36 | @AnonymousAccess |
37 | 37 | public ServerResult upload2oss(@RequestParam String name, @RequestParam("file") MultipartFile file) { |
38 | 38 | return localStorageService.uploadByAliOss(name, file); |
39 | 39 | } |
40 | 40 | |
41 | + @ApiOperation("上传文件到oss服务") | |
42 | + @PostMapping(value = "/upload_file_oss") | |
43 | + @AnonymousAccess | |
44 | + public ServerResult uploadFile2oss(@RequestParam String name, @RequestParam("file") MultipartFile file) { | |
45 | + return localStorageService.uploadFileByAliOss(name, file); | |
46 | + } | |
47 | + | |
41 | 48 | } |
42 | 49 | \ No newline at end of file | ... | ... |
src/main/java/com/order/erp/controller/OrderController.java
src/main/java/com/order/erp/controller/OrderOpinionLonController.java
... | ... | @@ -3,10 +3,13 @@ package com.order.erp.controller; |
3 | 3 | import com.order.erp.common.annotation.AnonymousAccess; |
4 | 4 | import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.domain.dto.order.OrderOpinionLogDO; |
6 | +import com.order.erp.domain.vo.order.OrderOpinionLogVO; | |
6 | 7 | import com.order.erp.service.order.OrderOpinionLogService; |
7 | 8 | import io.swagger.annotations.Api; |
8 | 9 | import io.swagger.annotations.ApiOperation; |
10 | +import org.springframework.validation.annotation.Validated; | |
9 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
10 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
11 | 14 | import org.springframework.web.bind.annotation.RestController; |
12 | 15 | |
... | ... | @@ -29,8 +32,8 @@ public class OrderOpinionLonController { |
29 | 32 | @PostMapping("/query_by_id") |
30 | 33 | @ApiOperation("查询订单的跟单结果记录") |
31 | 34 | @AnonymousAccess |
32 | - public ServerResult queryById(OrderOpinionLogDO orderOpinionLogDO){ | |
33 | - return orderOpinionLogService.queryById(orderOpinionLogDO); | |
35 | + public ServerResult queryById(@RequestBody @Validated OrderOpinionLogVO orderOpinionLogVo){ | |
36 | + return orderOpinionLogService.queryById(orderOpinionLogVo); | |
34 | 37 | } |
35 | 38 | |
36 | 39 | } | ... | ... |
src/main/java/com/order/erp/controller/ProducePaymentCheckBillOrderController.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.ProducePaymentCheckBillOrderQueryVO; | |
6 | +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO; | |
7 | +import com.order.erp.service.order.ProducePaymentCheckBillOrderService; | |
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 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表控制层 | |
18 | + * | |
19 | + * @author makejava | |
20 | + * @since 2024-08-05 16:26:35 | |
21 | + */ | |
22 | +@RestController | |
23 | +@RequestMapping("/order/erp/check_bill/") | |
24 | +public class ProducePaymentCheckBillOrderController { | |
25 | + /** | |
26 | + * 服务对象 | |
27 | + */ | |
28 | + @Resource | |
29 | + private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService; | |
30 | + | |
31 | + /** | |
32 | + * 分页查询 | |
33 | + * | |
34 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | |
35 | + * @return 查询结果 | |
36 | + */ | |
37 | + @PostMapping("/list") | |
38 | + public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
39 | + return producePaymentCheckBillOrderService.list(producePaymentCheckBillOrderQueryVO); | |
40 | + } | |
41 | + | |
42 | + /** | |
43 | + * 通过主键查询单条数据 | |
44 | + * | |
45 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | |
46 | + * @return 单条数据 | |
47 | + */ | |
48 | + @PostMapping("/query_by_id") | |
49 | + public ServerResult queryById(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
50 | + return producePaymentCheckBillOrderService.queryById(producePaymentCheckBillOrderQueryVO); | |
51 | + } | |
52 | + | |
53 | + /** | |
54 | + * 新增数据 | |
55 | + * | |
56 | + * @param producePaymentCheckBillOrderVO 数据VO | |
57 | + * @return 新增结果 | |
58 | + */ | |
59 | + @PostMapping("/add") | |
60 | + public ServerResult add(@RequestBody ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) { | |
61 | + return producePaymentCheckBillOrderService.add(producePaymentCheckBillOrderVO); | |
62 | + } | |
63 | + | |
64 | + /** | |
65 | + * 编辑数据 | |
66 | + * | |
67 | + * @param producePaymentCheckBillOrderVO 数据VO | |
68 | + * @return 编辑结果 | |
69 | + */ | |
70 | + @PostMapping("/edit") | |
71 | + public ServerResult edit(@RequestBody ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) { | |
72 | + return producePaymentCheckBillOrderService.edit(producePaymentCheckBillOrderVO); | |
73 | + } | |
74 | + | |
75 | + /** | |
76 | + * 删除数据 | |
77 | + * | |
78 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | |
79 | + * @return 删除是否成功 | |
80 | + */ | |
81 | + @PostMapping("/delete_by_id") | |
82 | + public ServerResult deleteById(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
83 | + return producePaymentCheckBillOrderService.deleteById(producePaymentCheckBillOrderQueryVO); | |
84 | + } | |
85 | + | |
86 | +} | |
87 | + | ... | ... |
src/main/java/com/order/erp/controller/ReceiveEmailMappingController.java
1 | 1 | package com.order.erp.controller; |
2 | 2 | |
3 | +import com.order.erp.common.annotation.AnonymousAccess; | |
3 | 4 | import com.order.erp.common.constant.ServerResult; |
4 | 5 | import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; |
5 | 6 | import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; |
... | ... | @@ -34,6 +35,7 @@ public class ReceiveEmailMappingController { |
34 | 35 | * @return 查询结果 |
35 | 36 | */ |
36 | 37 | @PostMapping("/list") |
38 | + @AnonymousAccess | |
37 | 39 | public ServerResult list() { |
38 | 40 | return receiveEmailMappingService.listGetAll(); |
39 | 41 | } |
... | ... | @@ -46,6 +48,7 @@ public class ReceiveEmailMappingController { |
46 | 48 | * @return 新增结果 |
47 | 49 | */ |
48 | 50 | @PostMapping("/add") |
51 | + @AnonymousAccess | |
49 | 52 | public ServerResult add(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { |
50 | 53 | return receiveEmailMappingService.add(receiveEmailMappingVO); |
51 | 54 | } |
... | ... | @@ -57,6 +60,7 @@ public class ReceiveEmailMappingController { |
57 | 60 | * @return 编辑结果 |
58 | 61 | */ |
59 | 62 | @PostMapping("/edit") |
63 | + @AnonymousAccess | |
60 | 64 | public ServerResult edit(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { |
61 | 65 | return receiveEmailMappingService.edit(receiveEmailMappingVO); |
62 | 66 | } |
... | ... | @@ -68,6 +72,7 @@ public class ReceiveEmailMappingController { |
68 | 72 | * @return 删除是否成功 |
69 | 73 | */ |
70 | 74 | @PostMapping("/delete_by_id") |
75 | + @AnonymousAccess | |
71 | 76 | public ServerResult deleteById(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { |
72 | 77 | return receiveEmailMappingService.deleteById(receiveEmailMappingVO); |
73 | 78 | } |
... | ... | @@ -78,6 +83,7 @@ public class ReceiveEmailMappingController { |
78 | 83 | * @return 实例对象 |
79 | 84 | */ |
80 | 85 | @PostMapping("/query_by_id") |
86 | + @AnonymousAccess | |
81 | 87 | public ServerResult queryById(@RequestBody ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { |
82 | 88 | return receiveEmailMappingService.queryById(receiveEmailMappingQueryVO); |
83 | 89 | } |
... | ... | @@ -89,6 +95,7 @@ public class ReceiveEmailMappingController { |
89 | 95 | * @return 操作结果 |
90 | 96 | */ |
91 | 97 | @PostMapping("/opt") |
98 | + @AnonymousAccess | |
92 | 99 | public ServerResult opt(@RequestBody ReceiveEmailMappingDO receiveEmailMappingDo) { |
93 | 100 | return receiveEmailMappingService.opt(receiveEmailMappingDo); |
94 | 101 | } | ... | ... |
src/main/java/com/order/erp/domain/dto/order/CheckBillMappingDO.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 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:36 | |
15 | + */ | |
16 | +@TableName("check_bill_mapping") | |
17 | +@Data | |
18 | +@AllArgsConstructor | |
19 | +@ToString | |
20 | +@NoArgsConstructor | |
21 | +@EqualsAndHashCode(callSuper = false) | |
22 | +@SuperBuilder | |
23 | +public class CheckBillMappingDO extends BaseDO implements Serializable { | |
24 | + private static final long serialVersionUID = 199786248752278040L; | |
25 | + | |
26 | + private Long id; | |
27 | + /** | |
28 | + * 生产科对账单号 | |
29 | + */ | |
30 | + private String checkNo; | |
31 | + /** | |
32 | + * check账单id | |
33 | + */ | |
34 | + private Long checkBillId; | |
35 | + /** | |
36 | + * 订单id | |
37 | + */ | |
38 | + private Long orderId; | |
39 | + | |
40 | +} | ... | ... |
src/main/java/com/order/erp/domain/dto/order/InvoiceBillMappingDO.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 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:36 | |
15 | + */ | |
16 | +@TableName("invoice_bill_mapping") | |
17 | +@Data | |
18 | +@AllArgsConstructor | |
19 | +@ToString | |
20 | +@NoArgsConstructor | |
21 | +@EqualsAndHashCode(callSuper = false) | |
22 | +@SuperBuilder | |
23 | +public class InvoiceBillMappingDO extends BaseDO implements Serializable { | |
24 | + | |
25 | + private Long id; | |
26 | + /** | |
27 | + * 发票单号 | |
28 | + */ | |
29 | + private String invoiceNo; | |
30 | + /** | |
31 | + * invoice账单id | |
32 | + */ | |
33 | + private Long invoiceBillId; | |
34 | + /** | |
35 | + * 订单id | |
36 | + */ | |
37 | + private Long orderId; | |
38 | + | |
39 | +} | ... | ... |
src/main/java/com/order/erp/domain/dto/order/InvoiceBillOrderDO.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 | +import java.math.BigDecimal; | |
10 | + | |
11 | +/** | |
12 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
13 | + * | |
14 | + * @author makejava | |
15 | + * @since 2024-08-05 16:26:33 | |
16 | + */ | |
17 | +@TableName("invoice_bill_order") | |
18 | +@Data | |
19 | +@AllArgsConstructor | |
20 | +@ToString | |
21 | +@NoArgsConstructor | |
22 | +@EqualsAndHashCode(callSuper = false) | |
23 | +@SuperBuilder | |
24 | +public class InvoiceBillOrderDO extends BaseDO implements Serializable { | |
25 | + | |
26 | + private Long id; | |
27 | + /** | |
28 | + * 发票单号 | |
29 | + */ | |
30 | + private String invoiceNo; | |
31 | + /** | |
32 | + * 报关单url地址 | |
33 | + */ | |
34 | + private String bgUrl; | |
35 | + /** | |
36 | + * 必须回款日期 | |
37 | + */ | |
38 | + private String backRefundDate; | |
39 | + /** | |
40 | + * 实际回款日期 | |
41 | + */ | |
42 | + private String actualRefundDate; | |
43 | + | |
44 | + /** | |
45 | + * 发生扣款金额 | |
46 | + */ | |
47 | + private BigDecimal deductAmount; | |
48 | + /** | |
49 | + * 扣款单url地址 | |
50 | + */ | |
51 | + private String deductUrl; | |
52 | + /** | |
53 | + * 实际应收金额 | |
54 | + */ | |
55 | + private BigDecimal actualReceivableAmount; | |
56 | + /** | |
57 | + * 实际应付金额1 | |
58 | + */ | |
59 | + private BigDecimal actualPayedAmount1; | |
60 | + /** | |
61 | + * 实际应付金额2 | |
62 | + */ | |
63 | + private BigDecimal actualPayedAmount2; | |
64 | + /** | |
65 | + * 实际应付金额3 | |
66 | + */ | |
67 | + private BigDecimal actualPayedAmount3; | |
68 | + /** | |
69 | + * 其他费用金额 | |
70 | + */ | |
71 | + private BigDecimal otherAmount; | |
72 | + /** | |
73 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
74 | + */ | |
75 | + private Integer status; | |
76 | + | |
77 | +} | ... | ... |
src/main/java/com/order/erp/domain/dto/order/OrderOpinionLogDO.java
... | ... | @@ -5,6 +5,7 @@ import com.order.erp.domain.dto.BaseDO; |
5 | 5 | import lombok.*; |
6 | 6 | import lombok.experimental.SuperBuilder; |
7 | 7 | |
8 | +import javax.validation.constraints.NotNull; | |
8 | 9 | import java.io.Serializable; |
9 | 10 | |
10 | 11 | /** |
... | ... | @@ -26,7 +27,7 @@ public class OrderOpinionLogDO extends BaseDO implements Serializable { |
26 | 27 | /** |
27 | 28 | * 订单id |
28 | 29 | */ |
29 | - private long orderId; | |
30 | + private Long orderId; | |
30 | 31 | /** |
31 | 32 | * 意见类型(SGS/Aitex/SHIPPMENT/PP/产品意见) |
32 | 33 | */ | ... | ... |
src/main/java/com/order/erp/domain/dto/order/OrderTrackStageDO.java
src/main/java/com/order/erp/domain/dto/order/ProducePaymentCheckBillOrderDO.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 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:35 | |
15 | + */ | |
16 | +@TableName("produce_payment_check_bill_order") | |
17 | +@Data | |
18 | +@AllArgsConstructor | |
19 | +@ToString | |
20 | +@NoArgsConstructor | |
21 | +@EqualsAndHashCode(callSuper = false) | |
22 | +@SuperBuilder | |
23 | +public class ProducePaymentCheckBillOrderDO extends BaseDO implements Serializable { | |
24 | + | |
25 | + private Long id; | |
26 | + /** | |
27 | + * 生产科对账单 | |
28 | + */ | |
29 | + private String checkNo; | |
30 | + /** | |
31 | + * 发票url地址 | |
32 | + */ | |
33 | + private String invoiceUrl; | |
34 | + /** | |
35 | + * 扣款单url地址 | |
36 | + */ | |
37 | + private String deductPdfUrl; | |
38 | + /** | |
39 | + * 生产科应付款日期 | |
40 | + */ | |
41 | + private String payedDate; | |
42 | + /** | |
43 | + * 生产科扣款责任部门 | |
44 | + */ | |
45 | + private String deductDept; | |
46 | + /** | |
47 | + * 生产科扣款金额 | |
48 | + */ | |
49 | + private Double deductAmount; | |
50 | + /** | |
51 | + * 实际应付金额 | |
52 | + */ | |
53 | + private Double actualPayedAmount; | |
54 | + /** | |
55 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
56 | + */ | |
57 | + private Integer status; | |
58 | + | |
59 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/FileRespVO.java
0 → 100644
1 | +package com.order.erp.domain.vo; | |
2 | + | |
3 | +import lombok.*; | |
4 | +import lombok.experimental.SuperBuilder; | |
5 | + | |
6 | +import java.io.Serializable; | |
7 | + | |
8 | +/** | |
9 | + * 文件上传实体类 | |
10 | + * | |
11 | + * @author xms | |
12 | + * @since 2023-10-08 14:52:27 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@NoArgsConstructor | |
18 | +@EqualsAndHashCode(callSuper = false) | |
19 | +@SuperBuilder | |
20 | +public class FileRespVO implements Serializable { | |
21 | + | |
22 | + /** | |
23 | + * file地址 | |
24 | + */ | |
25 | + private String fileUrl; | |
26 | + | |
27 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingQueryVO.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 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:37 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class CheckBillMappingQueryVO extends BasePageVO implements Serializable { | |
23 | + | |
24 | + private List<Long> ids; | |
25 | + | |
26 | + | |
27 | + private Long id; | |
28 | + /** | |
29 | + * 生产科对账单号 | |
30 | + */ | |
31 | + private String checkNo; | |
32 | + /** | |
33 | + * check账单id | |
34 | + */ | |
35 | + private Long checkBillId; | |
36 | + /** | |
37 | + * 订单id | |
38 | + */ | |
39 | + private Long orderId; | |
40 | + | |
41 | + | |
42 | +} | |
43 | + | ... | ... |
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingVO.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 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | |
10 | + * | |
11 | + * @author makejava | |
12 | + * @since 2024-08-05 16:26:37 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@NoArgsConstructor | |
18 | +@EqualsAndHashCode(callSuper = false) | |
19 | +@SuperBuilder | |
20 | +public class CheckBillMappingVO implements Serializable { | |
21 | + | |
22 | + private Long id; | |
23 | + /** | |
24 | + * 生产科对账单号 | |
25 | + */ | |
26 | + private String checkNo; | |
27 | + /** | |
28 | + * check账单id | |
29 | + */ | |
30 | + private Long checkBillId; | |
31 | + /** | |
32 | + * 订单id | |
33 | + */ | |
34 | + private Long orderId; | |
35 | + | |
36 | + | |
37 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBaseOrderQueryVO.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 javax.validation.constraints.NotBlank; | |
8 | +import java.io.Serializable; | |
9 | + | |
10 | +/** | |
11 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:34 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class InvoiceBaseOrderQueryVO extends BasePageVO implements Serializable { | |
23 | + | |
24 | + /** | |
25 | + * 发票单号 | |
26 | + */ | |
27 | + @NotBlank(message = "发票单号不能为空") | |
28 | + private String invoiceNo; | |
29 | +} | |
30 | + | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAmountInfoVO.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 | +import java.math.BigDecimal; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单 -- 其他金额信息 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceBillAmountInfoVO implements Serializable { | |
22 | + | |
23 | + private Long id; | |
24 | + | |
25 | + /** | |
26 | + * 报关单url地址 | |
27 | + */ | |
28 | + private String bgUrl; | |
29 | + | |
30 | + /** | |
31 | + * 实际应收金额 | |
32 | + */ | |
33 | + private BigDecimal actualReceivableAmount; | |
34 | + /** | |
35 | + * 实际应付金额1 | |
36 | + */ | |
37 | + private BigDecimal actualPayedAmount1; | |
38 | + /** | |
39 | + * 实际应付金额2 | |
40 | + */ | |
41 | + private BigDecimal actualPayedAmount2; | |
42 | + /** | |
43 | + * 实际应付金额3 | |
44 | + */ | |
45 | + private BigDecimal actualPayedAmount3; | |
46 | + /** | |
47 | + * 其他费用金额 | |
48 | + */ | |
49 | + private BigDecimal otherAmount; | |
50 | + | |
51 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisExportVO.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 | +import java.math.BigDecimal; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceBillAnalysisExportVO implements Serializable { | |
22 | + | |
23 | + private Long id; | |
24 | + | |
25 | + /** | |
26 | + * 客户编码 | |
27 | + */ | |
28 | + private String customerCode; | |
29 | + | |
30 | + /** | |
31 | + * 发票单号 | |
32 | + */ | |
33 | + private String invoiceNo; | |
34 | + | |
35 | + /** | |
36 | + * 客户总价$ | |
37 | + */ | |
38 | + private BigDecimal customerTotalPrice; | |
39 | + | |
40 | + /** | |
41 | + * 发生扣款金额 | |
42 | + */ | |
43 | + private BigDecimal deductAmount; | |
44 | + | |
45 | + /** | |
46 | + * 实际应收金额 | |
47 | + */ | |
48 | + private BigDecimal actualReceivableAmount; | |
49 | + | |
50 | + /** | |
51 | + * 实际应付金额 | |
52 | + */ | |
53 | + private BigDecimal actualPayedAmount; | |
54 | + | |
55 | + /** | |
56 | + * 实际应收 - 实际应付 | |
57 | + * 其他费用金额汇总 | |
58 | + */ | |
59 | + private BigDecimal otherAmount; | |
60 | + | |
61 | + /** | |
62 | + * 实际应收 - 实际应付 - 其他费用金额汇总 | |
63 | + * 其他费用金额合计 | |
64 | + */ | |
65 | + private BigDecimal otherTotalAmount; | |
66 | + | |
67 | + /** | |
68 | + * 必须回款日期 | |
69 | + */ | |
70 | + private String backRefundDate; | |
71 | + | |
72 | + /** | |
73 | + * 实际回款日期 | |
74 | + */ | |
75 | + private String actualRefundDate; | |
76 | + | |
77 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisResultVO.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 | +import java.math.BigDecimal; | |
8 | +import java.util.List; | |
9 | + | |
10 | +/** | |
11 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:33 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class InvoiceBillAnalysisResultVO implements Serializable { | |
23 | + | |
24 | + | |
25 | + /** | |
26 | + * 导出列表 | |
27 | + */ | |
28 | + private List<InvoiceBillAnalysisExportVO> exportVOS; | |
29 | + | |
30 | + /** | |
31 | + * 合计数据 | |
32 | + */ | |
33 | + | |
34 | + /** | |
35 | + * 客户总价$ | |
36 | + */ | |
37 | + private BigDecimal customerTotalPrice; | |
38 | + | |
39 | + /** | |
40 | + * 发生扣款金额 | |
41 | + */ | |
42 | + private BigDecimal deductAmount; | |
43 | + | |
44 | + /** | |
45 | + * 实际应收金额 | |
46 | + */ | |
47 | + private BigDecimal actualReceivableAmount; | |
48 | + | |
49 | + /** | |
50 | + * 实际应付金额 | |
51 | + */ | |
52 | + private BigDecimal actualPayedAmount; | |
53 | + | |
54 | + /** | |
55 | + * 实际应收 - 实际应付 | |
56 | + * 其他费用金额汇总 | |
57 | + */ | |
58 | + private BigDecimal otherAmount; | |
59 | + | |
60 | + /** | |
61 | + * 实际应收 - 实际应付 - 其他费用金额汇总 | |
62 | + * 其他费用金额合计 | |
63 | + */ | |
64 | + private BigDecimal otherTotalAmount; | |
65 | + | |
66 | + /** | |
67 | + * 合计数据 | |
68 | + */ | |
69 | + | |
70 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisVO.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 | + * 应收款账单 -- 分析 | |
10 | + * | |
11 | + * @author makejava | |
12 | + * @since 2024-08-05 16:26:33 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@EqualsAndHashCode(callSuper = false) | |
18 | +@SuperBuilder | |
19 | +public class InvoiceBillAnalysisVO extends InvoiceBillOrderQueryVO implements Serializable { | |
20 | + | |
21 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCommitApplyVO.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 | + * 应收款账单 -- 提交审核 | |
10 | + * | |
11 | + * @author makejava | |
12 | + * @since 2024-08-05 16:26:33 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@NoArgsConstructor | |
18 | +@EqualsAndHashCode(callSuper = false) | |
19 | +@SuperBuilder | |
20 | +public class InvoiceBillCommitApplyVO implements Serializable { | |
21 | + | |
22 | + private Long id; | |
23 | + | |
24 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCreateVO.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 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceBillCreateVO implements Serializable { | |
22 | + private static final long serialVersionUID = 543899167451834300L; | |
23 | + | |
24 | + private Long id; | |
25 | + | |
26 | + /** | |
27 | + * 发票单号 | |
28 | + */ | |
29 | + private String invoiceNo; | |
30 | + | |
31 | + /** | |
32 | + * 报关单url地址 | |
33 | + */ | |
34 | + private String bgUrl; | |
35 | + | |
36 | + /** | |
37 | + * 必须回款日期 | |
38 | + */ | |
39 | + private String backRefundDate; | |
40 | + | |
41 | + /** | |
42 | + * 订单id集合 | |
43 | + */ | |
44 | + private List<Long> orderIds; | |
45 | + | |
46 | + | |
47 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillDeductInfoVO.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 | +import java.math.BigDecimal; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单 -- 扣款信息 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceBillDeductInfoVO implements Serializable { | |
22 | + | |
23 | + private Long id; | |
24 | + | |
25 | + /** | |
26 | + * 发票单号 | |
27 | + */ | |
28 | + private String invoiceNo; | |
29 | + | |
30 | + /** | |
31 | + * 发生扣款金额 | |
32 | + */ | |
33 | + private BigDecimal deductAmount; | |
34 | + | |
35 | + /** | |
36 | + * 扣款单url地址 | |
37 | + */ | |
38 | + private String deductUrl; | |
39 | + | |
40 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingQueryVO.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 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:36 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class InvoiceBillMappingQueryVO extends BasePageVO implements Serializable { | |
23 | + private static final long serialVersionUID = -10772282327497511L; | |
24 | + | |
25 | + private List<Long> ids; | |
26 | + | |
27 | + | |
28 | + private Long id; | |
29 | + /** | |
30 | + * 发票单号 | |
31 | + */ | |
32 | + private String invoiceNo; | |
33 | + /** | |
34 | + * invoice账单id | |
35 | + */ | |
36 | + private Long invoiceBillId; | |
37 | + /** | |
38 | + * 订单id | |
39 | + */ | |
40 | + private Long orderId; | |
41 | + | |
42 | + | |
43 | +} | |
44 | + | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingVO.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 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | |
10 | + * | |
11 | + * @author makejava | |
12 | + * @since 2024-08-05 16:26:36 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@NoArgsConstructor | |
18 | +@EqualsAndHashCode(callSuper = false) | |
19 | +@SuperBuilder | |
20 | +public class InvoiceBillMappingVO implements Serializable { | |
21 | + private static final long serialVersionUID = -55765026730369748L; | |
22 | + | |
23 | + private Long id; | |
24 | + /** | |
25 | + * 发票单号 | |
26 | + */ | |
27 | + private String invoiceNo; | |
28 | + /** | |
29 | + * invoice账单id | |
30 | + */ | |
31 | + private Long invoiceBillId; | |
32 | + /** | |
33 | + * 订单id | |
34 | + */ | |
35 | + private Long orderId; | |
36 | + | |
37 | + | |
38 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderQueryVO.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 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:34 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class InvoiceBillOrderQueryVO extends BasePageVO implements Serializable { | |
23 | + | |
24 | + private List<Long> ids; | |
25 | + | |
26 | + /** | |
27 | + * 发票单号 | |
28 | + */ | |
29 | + private String invoiceNo; | |
30 | + | |
31 | + /** | |
32 | + * 总经理审核状态 -1,未提交审核,0:待审核、1:审核通过,2:审核驳回 | |
33 | + */ | |
34 | + private Integer status; | |
35 | + | |
36 | + /** | |
37 | + * 客户编码 | |
38 | + */ | |
39 | + private String customerCode; | |
40 | + | |
41 | + /** | |
42 | + * 项目号 | |
43 | + */ | |
44 | + private String projectNo; | |
45 | + | |
46 | + /** | |
47 | + * 生产科 | |
48 | + */ | |
49 | + private String productionDepartment; | |
50 | + | |
51 | + /** | |
52 | + * 内部编号 | |
53 | + */ | |
54 | + private String innerNo; | |
55 | + | |
56 | + /** | |
57 | + * 客户po号 | |
58 | + */ | |
59 | + private String customerPo; | |
60 | + | |
61 | + /** | |
62 | + * 开始时间 | |
63 | + */ | |
64 | + private String startTime; | |
65 | + | |
66 | + /** | |
67 | + * 结束时间 | |
68 | + */ | |
69 | + private String endTime; | |
70 | +} | |
71 | + | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderVO.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 | +import java.math.BigDecimal; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceBillOrderVO implements Serializable { | |
22 | + private static final long serialVersionUID = 543899167451834300L; | |
23 | + | |
24 | + private Long id; | |
25 | + | |
26 | + /** | |
27 | + * 发票单号 | |
28 | + */ | |
29 | + private String invoiceNo; | |
30 | + | |
31 | + /** | |
32 | + * 报关单url地址 | |
33 | + */ | |
34 | + private String bgUrl; | |
35 | + | |
36 | + /** | |
37 | + * 必须回款日期 | |
38 | + */ | |
39 | + private String backRefundDate; | |
40 | + | |
41 | + /** | |
42 | + * 发生扣款金额 | |
43 | + */ | |
44 | + private BigDecimal deductAmount; | |
45 | + | |
46 | + /** | |
47 | + * 扣款单url地址 | |
48 | + */ | |
49 | + private String deductUrl; | |
50 | + | |
51 | + /** | |
52 | + * 实际应收金额 | |
53 | + */ | |
54 | + private BigDecimal actualReceivableAmount; | |
55 | + | |
56 | + /** | |
57 | + * 实际应付金额1 | |
58 | + */ | |
59 | + private BigDecimal actualPayedAmount1; | |
60 | + | |
61 | + /** | |
62 | + * 实际应付金额2 | |
63 | + */ | |
64 | + private BigDecimal actualPayedAmount2; | |
65 | + | |
66 | + /** | |
67 | + * 实际应付金额3 | |
68 | + */ | |
69 | + private BigDecimal actualPayedAmount3; | |
70 | + | |
71 | + /** | |
72 | + * 其他费用金额 | |
73 | + */ | |
74 | + private BigDecimal otherAmount; | |
75 | + | |
76 | + /** | |
77 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
78 | + */ | |
79 | + private Integer status; | |
80 | + | |
81 | + | |
82 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceHoldTimeItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | |
2 | + | |
3 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
4 | +import lombok.*; | |
5 | +import lombok.experimental.SuperBuilder; | |
6 | + | |
7 | +import java.io.Serializable; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单 -- holdTime | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceHoldTimeItemVO implements Serializable { | |
22 | + | |
23 | + /** | |
24 | + * 客户编码 | |
25 | + */ | |
26 | + private String customerCode; | |
27 | + | |
28 | + /** | |
29 | + * 订单hold时间 | |
30 | + */ | |
31 | + private String holdTime; | |
32 | + | |
33 | + /** | |
34 | + * 基础订单信息 | |
35 | + */ | |
36 | + private OrderBaseInfoDO baseInfoDO; | |
37 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/InvoiceOrderBaseItemVO.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 | +import java.math.BigDecimal; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:33 | |
14 | + */ | |
15 | +@Data | |
16 | +@AllArgsConstructor | |
17 | +@ToString | |
18 | +@NoArgsConstructor | |
19 | +@EqualsAndHashCode(callSuper = false) | |
20 | +@SuperBuilder | |
21 | +public class InvoiceOrderBaseItemVO implements Serializable { | |
22 | + | |
23 | + private Long orderId; | |
24 | + | |
25 | + /** | |
26 | + * invoice编码 | |
27 | + */ | |
28 | + private String invoiceCode; | |
29 | + | |
30 | + /** | |
31 | + * 客户编码 | |
32 | + */ | |
33 | + private String customerCode; | |
34 | + | |
35 | + /** | |
36 | + * 客户总价$ | |
37 | + */ | |
38 | + private BigDecimal customerTotalPrice; | |
39 | + | |
40 | + | |
41 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoVO.java
... | ... | @@ -22,6 +22,10 @@ public class OrderBaseInfoVO implements Serializable { |
22 | 22 | |
23 | 23 | private Long id; |
24 | 24 | /** |
25 | + * 发票单号 | |
26 | + */ | |
27 | + private String invoiceNo; | |
28 | + /** | |
25 | 29 | * 客户编码 |
26 | 30 | */ |
27 | 31 | private String customerCode; |
... | ... | @@ -113,4 +117,4 @@ public class OrderBaseInfoVO implements Serializable { |
113 | 117 | */ |
114 | 118 | private String businessPerson; |
115 | 119 | |
116 | 120 | -} |
121 | +} | |
117 | 122 | \ No newline at end of file | ... | ... |
src/main/java/com/order/erp/domain/vo/order/OrderOpinionLogVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | |
2 | + | |
3 | +import lombok.*; | |
4 | +import lombok.experimental.SuperBuilder; | |
5 | + | |
6 | +/** | |
7 | + * @Author:ch | |
8 | + * @createTime:2024-08-07 | |
9 | + */ | |
10 | +@Data | |
11 | +@AllArgsConstructor | |
12 | +@ToString | |
13 | +@NoArgsConstructor | |
14 | +@EqualsAndHashCode(callSuper = false) | |
15 | +@SuperBuilder | |
16 | +public class OrderOpinionLogVO { | |
17 | + private Long id; | |
18 | + | |
19 | + /** | |
20 | + * 订单id | |
21 | + */ | |
22 | + private Long orderId; | |
23 | + /** | |
24 | + * 意见类型(SGS/Aitex/SHIPPMENT/PP/产品意见) | |
25 | + */ | |
26 | + private String opinionType; | |
27 | + | |
28 | + /** | |
29 | + * 更新字段 | |
30 | + */ | |
31 | + private String field; | |
32 | +} | ... | ... |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderQueryVO.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 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | |
12 | + * | |
13 | + * @author makejava | |
14 | + * @since 2024-08-05 16:26:35 | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@ToString | |
19 | +@NoArgsConstructor | |
20 | +@EqualsAndHashCode(callSuper = false) | |
21 | +@SuperBuilder | |
22 | +public class ProducePaymentCheckBillOrderQueryVO extends BasePageVO implements Serializable { | |
23 | + | |
24 | + private List<Long> ids; | |
25 | + | |
26 | + | |
27 | + private Long id; | |
28 | + /** | |
29 | + * 生产科对账单 | |
30 | + */ | |
31 | + private String checkNo; | |
32 | + /** | |
33 | + * 发票url地址 | |
34 | + */ | |
35 | + private String invoiceUrl; | |
36 | + /** | |
37 | + * 扣款单url地址 | |
38 | + */ | |
39 | + private String deductPdfUrl; | |
40 | + /** | |
41 | + * 生产科应付款日期 | |
42 | + */ | |
43 | + private String payedDate; | |
44 | + /** | |
45 | + * 生产科扣款责任部门 | |
46 | + */ | |
47 | + private String deductDept; | |
48 | + /** | |
49 | + * 生产科扣款金额 | |
50 | + */ | |
51 | + private Double deductAmount; | |
52 | + /** | |
53 | + * 实际应付金额 | |
54 | + */ | |
55 | + private Double actualPayedAmount; | |
56 | + /** | |
57 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
58 | + */ | |
59 | + private Integer status; | |
60 | + | |
61 | + | |
62 | +} | |
63 | + | ... | ... |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderVO.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 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | |
10 | + * | |
11 | + * @author makejava | |
12 | + * @since 2024-08-05 16:26:35 | |
13 | + */ | |
14 | +@Data | |
15 | +@AllArgsConstructor | |
16 | +@ToString | |
17 | +@NoArgsConstructor | |
18 | +@EqualsAndHashCode(callSuper = false) | |
19 | +@SuperBuilder | |
20 | +public class ProducePaymentCheckBillOrderVO implements Serializable { | |
21 | + private static final long serialVersionUID = 239047702576286556L; | |
22 | + | |
23 | + private Long id; | |
24 | + /** | |
25 | + * 生产科对账单 | |
26 | + */ | |
27 | + private String checkNo; | |
28 | + /** | |
29 | + * 发票url地址 | |
30 | + */ | |
31 | + private String invoiceUrl; | |
32 | + /** | |
33 | + * 扣款单url地址 | |
34 | + */ | |
35 | + private String deductPdfUrl; | |
36 | + /** | |
37 | + * 生产科应付款日期 | |
38 | + */ | |
39 | + private String payedDate; | |
40 | + /** | |
41 | + * 生产科扣款责任部门 | |
42 | + */ | |
43 | + private String deductDept; | |
44 | + /** | |
45 | + * 生产科扣款金额 | |
46 | + */ | |
47 | + private Double deductAmount; | |
48 | + /** | |
49 | + * 实际应付金额 | |
50 | + */ | |
51 | + private Double actualPayedAmount; | |
52 | + /** | |
53 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
54 | + */ | |
55 | + private Integer status; | |
56 | + | |
57 | + | |
58 | +} | ... | ... |
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
... | ... | @@ -28,6 +28,9 @@ import java.util.concurrent.TimeUnit; |
28 | 28 | import java.util.function.Function; |
29 | 29 | import java.util.stream.Collectors; |
30 | 30 | |
31 | +import static com.order.erp.common.utils.DateUtils.DATE; | |
32 | +import static com.order.erp.common.utils.DateUtils.DATE_TIME; | |
33 | + | |
31 | 34 | |
32 | 35 | /** |
33 | 36 | * @author: xms |
... | ... | @@ -62,7 +65,7 @@ public class OrderOverTimeEventJob { |
62 | 65 | /** |
63 | 66 | * 凌晨1点执行,一天一次 |
64 | 67 | */ |
65 | - @Scheduled(cron = "0 0 1 * * ?") | |
68 | + @Scheduled(cron = "0 * * * * *") | |
66 | 69 | //存储的日期都必须为yyyy-MM-dd HH:mm:ss。 |
67 | 70 | public void checkOverTimeExecuteV2() { |
68 | 71 | List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.getEventList(); |
... | ... | @@ -87,7 +90,6 @@ public class OrderOverTimeEventJob { |
87 | 90 | */ |
88 | 91 | //发送邮件。 |
89 | 92 | private void sendEmail4OrderEvent(OrderEventEnum eventEnum, List<OrderEventJobVO> eventJobVOS) { |
90 | - | |
91 | 93 | HashSet<String> customerCodeList = new HashSet<>(); |
92 | 94 | for (OrderEventJobVO orderEventJob : eventJobVOS) { |
93 | 95 | if (!redisUtils.hasKey(EmailTemplateEnum.byTemplate( |
... | ... | @@ -117,21 +119,28 @@ public class OrderOverTimeEventJob { |
117 | 119 | }).filter(Objects::nonNull) |
118 | 120 | .collect(Collectors.toList()); |
119 | 121 | //如果为尾期验货事件的话,需要从订单中的生产科角色中得到邮箱。而不是从邮件配置中得到邮箱。 |
120 | - if (OrderEventEnum.END_CHECK_DATE_EVENT.equals(eventEnum)) { | |
122 | + if (OrderEventEnum.END_CHECK_DATE_EVENT.equals(eventEnum) ) { | |
121 | 123 | for (OrderEventJobVO orderEventJob : eventJobVOS) { |
122 | - String productionDepartment = orderEventJob.getBaseInfo().getProductionDepartment(); | |
123 | - //根据订单的生产科得到生产科用户信息。 | |
124 | - AdminUserDO productionDepartmentUser = adminUserService.getOne(new LambdaQueryWrapper<AdminUserDO>() | |
125 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
126 | - .eq(AdminUserDO::getUserName, productionDepartment)); | |
127 | - List<String> productionEmail = Arrays.asList(productionDepartmentUser.getEmail().split("[,,]+")) | |
128 | - .stream().map(String::trim) | |
129 | - .collect(Collectors.toList()); | |
130 | - emailSendUtils.sendEmail(EmailTemplateEnum.byTemplate(eventEnum.getTemplateId()), | |
131 | - productionEmail, orderEventJob); | |
132 | - redisUtils.set(EmailTemplateEnum.byTemplate( | |
133 | - eventEnum.getTemplateId()) + Constant.CROSS_BAR_CHARACTER + orderEventJob.getBaseInfo().getId(), | |
134 | - orderEventJob, 90, TimeUnit.DAYS); | |
124 | + if (!redisUtils.hasKey(EmailTemplateEnum.byTemplate( | |
125 | + eventEnum.getTemplateId()) + Constant.CROSS_BAR_CHARACTER + orderEventJob.getBaseInfo().getId())) { | |
126 | + //转化一下日期格式,为yyyy-MM-dd。 | |
127 | + OrderBaseInfoVO orderBaseInfoFormat = getDateFormat(orderEventJob.getBaseInfo().getProductionDepartmentConsignTime(), orderEventJob.getBaseInfo().getOrderHodTime()); | |
128 | + orderEventJob.getBaseInfo().setProductionDepartmentConsignTime(orderBaseInfoFormat.getProductionDepartmentConsignTime()); | |
129 | + orderEventJob.getBaseInfo().setOrderHodTime(orderBaseInfoFormat.getOrderHodTime()); | |
130 | + String productionDepartment = orderEventJob.getBaseInfo().getProductionDepartment(); | |
131 | + //根据订单的生产科得到生产科用户信息。 | |
132 | + AdminUserDO productionDepartmentUser = adminUserService.getOne(new LambdaQueryWrapper<AdminUserDO>() | |
133 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
134 | + .eq(AdminUserDO::getUserName, productionDepartment)); | |
135 | + List<String> productionEmail = Arrays.asList(productionDepartmentUser.getEmail().split("[,,]+")) | |
136 | + .stream().map(String::trim) | |
137 | + .collect(Collectors.toList()); | |
138 | + emailSendUtils.sendEmail(EmailTemplateEnum.byTemplate(eventEnum.getTemplateId()), | |
139 | + productionEmail, orderEventJob); | |
140 | + redisUtils.set(EmailTemplateEnum.byTemplate( | |
141 | + eventEnum.getTemplateId()) + Constant.CROSS_BAR_CHARACTER +orderEventJob.getBaseInfo().getId(), | |
142 | + orderEventJob, 90, TimeUnit.DAYS); | |
143 | + } | |
135 | 144 | } |
136 | 145 | } else { |
137 | 146 | Set<Map<String, List<String>>> set = receiveEmailMappingDOS.stream().map(x -> { |
... | ... | @@ -154,6 +163,10 @@ public class OrderOverTimeEventJob { |
154 | 163 | for (OrderEventJobVO orderEventJob : eventJobVOS) { |
155 | 164 | for (Map<String, List<String>> map : set) { |
156 | 165 | if (orderEventJob.getBaseInfo().getCustomerCode().equals(map.keySet().iterator().next())) { |
166 | + //转化一下日期格式,为yyyy-MM-dd。 | |
167 | + OrderBaseInfoVO orderBaseInfoFormat = getDateFormat(orderEventJob.getBaseInfo().getProductionDepartmentConsignTime(), orderEventJob.getBaseInfo().getOrderHodTime()); | |
168 | + orderEventJob.getBaseInfo().setProductionDepartmentConsignTime(orderBaseInfoFormat.getProductionDepartmentConsignTime()); | |
169 | + orderEventJob.getBaseInfo().setOrderHodTime(orderBaseInfoFormat.getOrderHodTime()); | |
157 | 170 | emailSendUtils.sendEmail(EmailTemplateEnum.byTemplate(eventEnum.getTemplateId()), |
158 | 171 | map.get(map.keySet().iterator().next()), orderEventJob); |
159 | 172 | redisUtils.set(EmailTemplateEnum.byTemplate( |
... | ... | @@ -277,7 +290,7 @@ public class OrderOverTimeEventJob { |
277 | 290 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(esoSampleSendTime)) { |
278 | 291 | LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); |
279 | 292 | LocalDate esoSampleSendTimelocalDate = DateUtils.parseDate(esoSampleSendTime); |
280 | - if (ChronoUnit.DAYS.between(esoSampleSendTimelocalDate, orderHodTimelocalDate) == Constant.SEVEN) { | |
293 | + if (ChronoUnit.DAYS.between(esoSampleSendTimelocalDate, orderHodTimelocalDate) == Constant.FOURTEEN) { | |
281 | 294 | return true; |
282 | 295 | } |
283 | 296 | |
... | ... | @@ -288,7 +301,7 @@ public class OrderOverTimeEventJob { |
288 | 301 | private Boolean filterBigSampleEvent(OrderEventJobVO eventJobVO) { |
289 | 302 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
290 | 303 | String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmResult(); |
291 | - String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleSendTime(); | |
304 | + String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmTime(); | |
292 | 305 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) && StringUtils.isNotBlank(shippmentSampleConfirmTime)) { |
293 | 306 | int daysBetween = getDaysBetween(shippmentSampleConfirmResult, shippmentSampleConfirmTime, orderHodTime); |
294 | 307 | if (daysBetween == Constant.SEVEN || daysBetween == Constant.NEGATIVE_ONE) { |
... | ... | @@ -300,18 +313,21 @@ public class OrderOverTimeEventJob { |
300 | 313 | |
301 | 314 | |
302 | 315 | private Boolean filterAITEXSGSTestEvent(OrderEventJobVO eventJobVO) { |
316 | + int aitextestDaysBetween=0; | |
317 | + int sgstestDaysBetween=0; | |
303 | 318 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
304 | 319 | String aitexTestFinishResult = eventJobVO.getTrackStageInfo().getAitexTestFinishResult(); |
305 | 320 | String sgsTestFinishResult = eventJobVO.getTrackStageInfo().getSgsTestFinishResult(); |
306 | 321 | String sgsTestFinishTime = eventJobVO.getTrackStageInfo().getSgsTestFinishTime(); |
307 | 322 | String aitexTestFinishTime = eventJobVO.getTrackStageInfo().getAitexTestFinishTime(); |
308 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(aitexTestFinishResult) && StringUtils.isNotBlank(aitexTestFinishTime) || | |
309 | - StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(sgsTestFinishResult) && StringUtils.isNotBlank(sgsTestFinishTime)) { | |
310 | - int aitextestDaysBetween = getDaysBetween(aitexTestFinishResult, aitexTestFinishTime, orderHodTime); | |
311 | - int sgstestDaysBetween = getDaysBetween(sgsTestFinishResult, sgsTestFinishTime, orderHodTime); | |
312 | - if (aitextestDaysBetween == Constant.THREE || sgstestDaysBetween == Constant.LOCK_ERROR_TIMES || aitextestDaysBetween == Constant.NEGATIVE_ONE || sgstestDaysBetween == Constant.NEGATIVE_ONE) { | |
313 | - return true; | |
314 | - } | |
323 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(aitexTestFinishResult) && StringUtils.isNotBlank(aitexTestFinishTime)){ | |
324 | + aitextestDaysBetween = getDaysBetween(aitexTestFinishResult, aitexTestFinishTime, orderHodTime); | |
325 | + } | |
326 | + if(StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(sgsTestFinishResult) && StringUtils.isNotBlank(sgsTestFinishTime)){ | |
327 | + sgstestDaysBetween = getDaysBetween(sgsTestFinishResult, sgsTestFinishTime, orderHodTime); | |
328 | + } | |
329 | + if (Constant.THREE == aitextestDaysBetween || Constant.THREE == sgstestDaysBetween || Constant.NEGATIVE_ONE == aitextestDaysBetween || Constant.NEGATIVE_ONE == sgstestDaysBetween ) { | |
330 | + return true; | |
315 | 331 | } |
316 | 332 | return false; |
317 | 333 | |
... | ... | @@ -321,7 +337,7 @@ public class OrderOverTimeEventJob { |
321 | 337 | private Boolean filterBarcodeArrivalEvent(OrderEventJobVO eventJobVO) { |
322 | 338 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
323 | 339 | String lastArrivalTime = eventJobVO.getTrackStageInfo().getLatestArrivalTime(); |
324 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(lastArrivalTime)) { | |
340 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(lastArrivalTime) && !(lastArrivalTime.contains("ok"))) { | |
325 | 341 | LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); |
326 | 342 | LocalDate lastArrivalTimelocalDate = DateUtils.parseDate(lastArrivalTime); |
327 | 343 | if (ChronoUnit.DAYS.between(lastArrivalTimelocalDate, orderHodTimelocalDate) == Constant.SEVEN) { |
... | ... | @@ -334,7 +350,7 @@ public class OrderOverTimeEventJob { |
334 | 350 | private Boolean filterLatestDCEvent(OrderEventJobVO eventJobVO) { |
335 | 351 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
336 | 352 | String latestBkTime = eventJobVO.getTrackStageInfo().getLatestBkTime(); |
337 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(latestBkTime)) { | |
353 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(latestBkTime) && !(latestBkTime.contains("ok"))) { | |
338 | 354 | LocalDate latestBkTimelocalDate = DateUtils.parseDate(latestBkTime); |
339 | 355 | LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); |
340 | 356 | if (ChronoUnit.DAYS.between(latestBkTimelocalDate, orderHodTimelocalDate) == Constant.ENABLE_TEN) { |
... | ... | @@ -369,4 +385,15 @@ public class OrderOverTimeEventJob { |
369 | 385 | } |
370 | 386 | return Constant.ZERO; |
371 | 387 | } |
372 | -} | |
388 | + | |
389 | + public OrderBaseInfoVO getDateFormat(String productionDepartmentConsignTime,String orderHodTime){ | |
390 | + String substring = productionDepartmentConsignTime.substring(0, 10); | |
391 | + String substring1 = orderHodTime.substring(0, 10); | |
392 | + String productionDepartmentConsignTimeFormat = DateUtils.format(DateUtils.parseDate(substring, DATE), DateUtils.DATE); | |
393 | + String orderHodTimeFormat = DateUtils.format(DateUtils.parseDate(substring1,DATE), DateUtils.DATE); | |
394 | + OrderBaseInfoVO orderBaseInfoVO = new OrderBaseInfoVO(); | |
395 | + orderBaseInfoVO.setProductionDepartmentConsignTime(productionDepartmentConsignTimeFormat); | |
396 | + orderBaseInfoVO.setOrderHodTime(orderHodTimeFormat); | |
397 | + return orderBaseInfoVO; | |
398 | + } | |
399 | +} | |
373 | 400 | \ No newline at end of file | ... | ... |
src/main/java/com/order/erp/mapper/order/CheckBillMappingMapper.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.CheckBillMappingDO; | |
5 | + | |
6 | +/** | |
7 | + * 生产科对账单应收账单映射表(CheckBillMapping)表数据库访问层 | |
8 | + * | |
9 | + * @author makejava | |
10 | + * @since 2024-08-05 16:26:37 | |
11 | + */ | |
12 | +public interface CheckBillMappingMapper extends BaseMapper<CheckBillMappingDO> { | |
13 | + | |
14 | + | |
15 | +} | |
16 | + | ... | ... |
src/main/java/com/order/erp/mapper/order/InvoiceBillMappingMapper.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.InvoiceBillMappingDO; | |
5 | + | |
6 | +/** | |
7 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表数据库访问层 | |
8 | + * | |
9 | + * @author makejava | |
10 | + * @since 2024-08-05 16:26:36 | |
11 | + */ | |
12 | +public interface InvoiceBillMappingMapper extends BaseMapper<InvoiceBillMappingDO> { | |
13 | + | |
14 | + | |
15 | +} | |
16 | + | ... | ... |
src/main/java/com/order/erp/mapper/order/InvoiceBillOrderMapper.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.InvoiceBillOrderDO; | |
5 | + | |
6 | +/** | |
7 | + * 应收款账单表(InvoiceBillOrder)表数据库访问层 | |
8 | + * | |
9 | + * @author makejava | |
10 | + * @since 2024-08-05 16:26:34 | |
11 | + */ | |
12 | +public interface InvoiceBillOrderMapper extends BaseMapper<InvoiceBillOrderDO> { | |
13 | + | |
14 | + | |
15 | +} | |
16 | + | ... | ... |
src/main/java/com/order/erp/mapper/order/OrderBaseInfoMapper.java
... | ... | @@ -31,7 +31,8 @@ public interface OrderBaseInfoMapper extends BaseMapper<OrderBaseInfoDO> { |
31 | 31 | |
32 | 32 | List<QueryProjectNoAndInnerNoDto> queryProjectNoAndInnerNoDto(@Param("flag") Boolean flag, |
33 | 33 | @Param("dto") QueryProjectNoAndInnerNoDto dto); |
34 | - @Select("SELECT * FROM order_base_info WHERE order_status!=50 and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") | |
34 | +// @Select("SELECT * FROM order_base_info WHERE order_status!=50 and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") | |
35 | +@Select("SELECT * FROM order_base_info WHERE enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") | |
35 | 36 | List<OrderBaseInfoDO> getEventList(); |
36 | 37 | } |
37 | 38 | ... | ... |
src/main/java/com/order/erp/mapper/order/ProducePaymentCheckBillOrderMapper.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.ProducePaymentCheckBillOrderDO; | |
5 | + | |
6 | +/** | |
7 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表数据库访问层 | |
8 | + * | |
9 | + * @author makejava | |
10 | + * @since 2024-08-05 16:26:35 | |
11 | + */ | |
12 | +public interface ProducePaymentCheckBillOrderMapper extends BaseMapper<ProducePaymentCheckBillOrderDO> { | |
13 | + | |
14 | + | |
15 | +} | |
16 | + | ... | ... |
src/main/java/com/order/erp/mapper/order/ReceiveEmailMappingMapper.java
... | ... | @@ -21,5 +21,7 @@ public interface ReceiveEmailMappingMapper extends BaseMapper<ReceiveEmailMappin |
21 | 21 | ReceiveEmailMappingDO getReceiveEmailMappingDO(@Param("id") Long id); |
22 | 22 | @Select("select * from receive_email_mapping where enable_flag in (#{10},#{30})") |
23 | 23 | List<ReceiveEmailMappingDO> listGetAll(@Param("10")int enableFlag,@Param("30") int enableFlag1); |
24 | + @Select("select * from receive_email_mapping where type_value = #{typeValue}") | |
25 | + List<ReceiveEmailMappingDO> byTypeValueReceiveEmailMappingDO(@Param("typeValue") String typeValue); | |
24 | 26 | } |
25 | 27 | ... | ... |
src/main/java/com/order/erp/service/LocalStorageService.java
... | ... | @@ -24,6 +24,14 @@ public interface LocalStorageService extends IService<LocalStorageDO> { |
24 | 24 | */ |
25 | 25 | ServerResult uploadByAliOss(String name, MultipartFile file); |
26 | 26 | |
27 | + /** | |
28 | + * | |
29 | + * @param name | |
30 | + * @param file | |
31 | + * @return | |
32 | + */ | |
33 | + ServerResult uploadFileByAliOss(String name, MultipartFile file); | |
34 | + | |
27 | 35 | ServerResult create(String name, MultipartFile file); |
28 | 36 | |
29 | 37 | /** | ... | ... |
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
... | ... | @@ -97,6 +97,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser |
97 | 97 | @Resource |
98 | 98 | private DataScope dataScope; |
99 | 99 | |
100 | + @Resource | |
101 | + private DictionaryService dictionaryService; | |
100 | 102 | /** |
101 | 103 | * 通过ID查询单条数据 |
102 | 104 | * <p> |
... | ... | @@ -181,14 +183,19 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser |
181 | 183 | if (Objects.nonNull(adminUserVO.getId())) { |
182 | 184 | adminUserVO.setId(null); |
183 | 185 | } |
184 | - List<AdminUserDO> userDOS = list(new LambdaQueryWrapper<AdminUserDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
186 | + List<AdminUserDO> byPhoneUserDOS = list(new LambdaQueryWrapper<AdminUserDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
185 | 187 | .eq(AdminUserDO::getPhone, adminUserVO.getPhone())); |
186 | - if (CollectionUtils.isNotEmpty(userDOS)) { | |
188 | + if (CollectionUtils.isNotEmpty(byPhoneUserDOS)) { | |
187 | 189 | throw new BusinessException("手机号已被注册"); |
188 | 190 | } |
191 | + List<AdminUserDO> byUserNameUserDOS = list(new LambdaQueryWrapper<AdminUserDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
192 | + .eq(AdminUserDO::getUserName, adminUserVO.getUserName())); | |
193 | + if (CollectionUtils.isNotEmpty(byUserNameUserDOS)) { | |
194 | + throw new BusinessException("用户名已存在"); | |
195 | + } | |
189 | 196 | AdminUserDO adminUserDo = BeanUtil.copyProperties(adminUserVO, AdminUserDO.class); |
190 | - if (StringUtils.isNotBlank(adminUserVO.getUserName())) { | |
191 | - adminUserDo.setNickName(adminUserVO.getUserName()); | |
197 | + if(StringUtils.isNotBlank(adminUserVO.getEmail())){ | |
198 | + adminUserDo.setEmail(adminUserVO.getEmail()); | |
192 | 199 | } |
193 | 200 | if (StringUtils.isNotBlank(adminUserVO.getNickName())) { |
194 | 201 | adminUserDo.setUserName(adminUserVO.getNickName()); |
... | ... | @@ -206,6 +213,17 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser |
206 | 213 | roleIds.add(adminUserVO.getRoleId()); |
207 | 214 | authRole(AdminAuthUserVO.builder().userId(adminUserDo.getId()).roleIds(roleIds).build()); |
208 | 215 | } |
216 | + //创建生产科角色顺便添加到dictionary的生产科中。 | |
217 | + if(Constant.SIX==adminUserVO.getRoleId().intValue()){ | |
218 | + DictionaryVO dictionaryVO = new DictionaryVO(); | |
219 | + dictionaryVO.setRemark("生产科"); | |
220 | + dictionaryVO.setDictCode("productionDepartment"); | |
221 | + dictionaryVO.setDictName("生产科"); | |
222 | + dictionaryVO.setDictValue(adminUserVO.getNickName()); | |
223 | + int count = dictionaryService.count(); | |
224 | + dictionaryVO.setSort(count+1); | |
225 | + dictionaryService.add(dictionaryVO); | |
226 | + } | |
209 | 227 | return ServerResult.success(); |
210 | 228 | } |
211 | 229 | ... | ... |
src/main/java/com/order/erp/service/impl/LocalStorageServiceImpl.java
... | ... | @@ -14,6 +14,7 @@ import com.order.erp.common.utils.FileUtil; |
14 | 14 | import com.order.erp.common.utils.StringUtils; |
15 | 15 | import com.order.erp.config.AliOssConfig; |
16 | 16 | import com.order.erp.domain.dto.LocalStorageDO; |
17 | +import com.order.erp.domain.vo.FileRespVO; | |
17 | 18 | import com.order.erp.domain.vo.ImageRespVO; |
18 | 19 | import com.order.erp.domain.vo.LocalStorageQueryVO; |
19 | 20 | import com.order.erp.domain.vo.LocalStorageVO; |
... | ... | @@ -51,6 +52,26 @@ public class LocalStorageServiceImpl extends ServiceImpl<LocalStorageMapper, Loc |
51 | 52 | private long maxSize; |
52 | 53 | |
53 | 54 | @Override |
55 | + public ServerResult uploadFileByAliOss(String name, MultipartFile file) { | |
56 | + FileUtil.checkSize(maxSize, file.getSize()); | |
57 | + String fileName = AliOssUtil.getUniqueFileName(name); | |
58 | + String tempFileName = "Thumbnails" + Constant.CROSS_BAR_CHARACTER + fileName; | |
59 | + FileRespVO fileRespVO = new FileRespVO(); | |
60 | + try { | |
61 | + File tempFile = new File(path + "files" + File.separator + tempFileName); | |
62 | + if (AliOssUtil.upload(AliOssConfig.ALIYUN_BUCKET, fileName, file.getBytes())) { | |
63 | + String fileUrl = AliOssUtil.createUrl(AliOssConfig.ALIYUN_BUCKET, fileName, new DateTime().plusYears(Constant.ENABLE_TEN).toDate()); | |
64 | + fileRespVO.setFileUrl(fileUrl); | |
65 | + FileUtil.del(tempFile); | |
66 | + } | |
67 | + return ServerResult.success(fileRespVO); | |
68 | + } catch (Exception e) { | |
69 | + log.error("上传文件异常:{}", e.getMessage()); | |
70 | + throw new BusinessException(ServerResultCode.UPLOAD_IMAGES_ERROR); | |
71 | + } | |
72 | + } | |
73 | + | |
74 | + @Override | |
54 | 75 | public ServerResult uploadByAliOss(String name, MultipartFile file) { |
55 | 76 | FileUtil.checkSize(maxSize, file.getSize()); |
56 | 77 | String fileName = AliOssUtil.getUniqueFileName(name); | ... | ... |
src/main/java/com/order/erp/service/order/CheckBillMappingService.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.CheckBillMappingDO; | |
6 | +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO; | |
7 | +import com.order.erp.domain.vo.order.CheckBillMappingVO; | |
8 | + | |
9 | +/** | |
10 | + * 生产科对账单应收账单映射表(CheckBillMapping)表服务接口 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:37 | |
14 | + */ | |
15 | +public interface CheckBillMappingService extends IService<CheckBillMappingDO> { | |
16 | + | |
17 | + /** | |
18 | + * 通过ID查询单条数据 | |
19 | + * | |
20 | + * @param checkBillMappingQueryVO 主键 | |
21 | + * @return 实例对象 | |
22 | + */ | |
23 | + ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO); | |
24 | + | |
25 | + /** | |
26 | + * 分页查询 | |
27 | + * | |
28 | + * @param checkBillMappingQueryVO 筛选条件 | |
29 | + * @return 查询结果 | |
30 | + */ | |
31 | + ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO); | |
32 | + | |
33 | + /** | |
34 | + * 新增数据 | |
35 | + * | |
36 | + * @param checkBillMappingVO 数据VO | |
37 | + * @return 新增结果 | |
38 | + */ | |
39 | + ServerResult add(CheckBillMappingVO checkBillMappingVO); | |
40 | + | |
41 | + /** | |
42 | + * 修改数据 | |
43 | + * | |
44 | + * @param checkBillMappingVO 数据VO | |
45 | + * @return 编辑结果 | |
46 | + */ | |
47 | + ServerResult edit(CheckBillMappingVO checkBillMappingVO); | |
48 | + | |
49 | + /** | |
50 | + * 通过主键删除数据 | |
51 | + * | |
52 | + * @param checkBillMappingQueryVO 筛选条件 | |
53 | + * @return 是否成功 | |
54 | + */ | |
55 | + ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO); | |
56 | + | |
57 | +} | ... | ... |
src/main/java/com/order/erp/service/order/InvoiceBillMappingService.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.InvoiceBillMappingDO; | |
6 | +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO; | |
7 | +import com.order.erp.domain.vo.order.InvoiceBillMappingVO; | |
8 | + | |
9 | +/** | |
10 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务接口 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:36 | |
14 | + */ | |
15 | +public interface InvoiceBillMappingService extends IService<InvoiceBillMappingDO> { | |
16 | + | |
17 | + /** | |
18 | + * 通过ID查询单条数据 | |
19 | + * | |
20 | + * @param invoiceBillMappingQueryVO 主键 | |
21 | + * @return 实例对象 | |
22 | + */ | |
23 | + ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | |
24 | + | |
25 | + /** | |
26 | + * 分页查询 | |
27 | + * | |
28 | + * @param invoiceBillMappingQueryVO 筛选条件 | |
29 | + * @return 查询结果 | |
30 | + */ | |
31 | + ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | |
32 | + | |
33 | + /** | |
34 | + * 新增数据 | |
35 | + * | |
36 | + * @param invoiceBillMappingVO 数据VO | |
37 | + * @return 新增结果 | |
38 | + */ | |
39 | + ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO); | |
40 | + | |
41 | + /** | |
42 | + * 修改数据 | |
43 | + * | |
44 | + * @param invoiceBillMappingVO 数据VO | |
45 | + * @return 编辑结果 | |
46 | + */ | |
47 | + ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO); | |
48 | + | |
49 | + /** | |
50 | + * 通过主键删除数据 | |
51 | + * | |
52 | + * @param invoiceBillMappingQueryVO 筛选条件 | |
53 | + * @return 是否成功 | |
54 | + */ | |
55 | + ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | |
56 | + | |
57 | +} | ... | ... |
src/main/java/com/order/erp/service/order/InvoiceBillOrderService.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.InvoiceBillOrderDO; | |
6 | +import com.order.erp.domain.vo.order.*; | |
7 | + | |
8 | +import javax.servlet.http.HttpServletResponse; | |
9 | +import java.io.IOException; | |
10 | + | |
11 | +/** | |
12 | + * 应收款账单表(InvoiceBillOrder)表服务接口 | |
13 | + * | |
14 | + * @author makejava | |
15 | + * @since 2024-08-05 16:26:34 | |
16 | + */ | |
17 | +public interface InvoiceBillOrderService extends IService<InvoiceBillOrderDO> { | |
18 | + | |
19 | + /** | |
20 | + * 分页查询 | |
21 | + * | |
22 | + * @param invoiceBillOrderQueryVO 筛选条件 | |
23 | + * @return 查询结果 | |
24 | + */ | |
25 | + ServerResult listByPage(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
26 | + | |
27 | + /** | |
28 | + * @param queryVO | |
29 | + * @return | |
30 | + */ | |
31 | + ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO); | |
32 | + | |
33 | + /** | |
34 | + * @param queryVO | |
35 | + * @return | |
36 | + */ | |
37 | + ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO); | |
38 | + | |
39 | + /** | |
40 | + * @param queryVO | |
41 | + * @return | |
42 | + */ | |
43 | + ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException; | |
44 | + | |
45 | + /** | |
46 | + * 新增数据 | |
47 | + * | |
48 | + * @param createVO 数据VO | |
49 | + * @return 新增结果 | |
50 | + */ | |
51 | + ServerResult create(InvoiceBillCreateVO createVO); | |
52 | + | |
53 | + /** | |
54 | + * | |
55 | + * @param createVO | |
56 | + * @return | |
57 | + */ | |
58 | + ServerResult getBackRefundDate(InvoiceBillCreateVO createVO); | |
59 | + | |
60 | + /** | |
61 | + * 更新扣款信息 | |
62 | + * | |
63 | + * @param deductInfoVO 数据VO | |
64 | + * @return 编辑结果 | |
65 | + */ | |
66 | + ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO); | |
67 | + | |
68 | + /** | |
69 | + * 更新其他金额信息 | |
70 | + * | |
71 | + * @param amountInfoVO | |
72 | + * @return | |
73 | + */ | |
74 | + ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO); | |
75 | + | |
76 | + /** | |
77 | + * 提交审核 | |
78 | + * | |
79 | + * @param commitApplyVO | |
80 | + * @return | |
81 | + */ | |
82 | + ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO); | |
83 | + | |
84 | + /** | |
85 | + * 通过主键删除数据 | |
86 | + * | |
87 | + * @param invoiceBillOrderQueryVO 筛选条件 | |
88 | + * @return 是否成功 | |
89 | + */ | |
90 | + ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
91 | + | |
92 | +} | ... | ... |
src/main/java/com/order/erp/service/order/OrderBaseInfoService.java
... | ... | @@ -6,7 +6,9 @@ import com.order.erp.common.constant.ServerResult; |
6 | 6 | import com.order.erp.common.excel4j.exceptions.Excel4JException; |
7 | 7 | import com.order.erp.domain.dto.order.OrderBaseInfoDO; |
8 | 8 | import com.order.erp.domain.vo.order.*; |
9 | +import freemarker.template.TemplateException; | |
9 | 10 | |
11 | +import javax.mail.MessagingException; | |
10 | 12 | import javax.servlet.http.HttpServletResponse; |
11 | 13 | import java.io.IOException; |
12 | 14 | import java.util.List; |
... | ... | @@ -89,7 +91,7 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { |
89 | 91 | * @param updateVO 数据VO |
90 | 92 | * @return 编辑结果 |
91 | 93 | */ |
92 | - ServerResult edit(OrderUpdateVO updateVO); | |
94 | + ServerResult edit(OrderUpdateVO updateVO) ; | |
93 | 95 | |
94 | 96 | /** |
95 | 97 | * 通过主键删除数据 |
... | ... | @@ -99,6 +101,7 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { |
99 | 101 | */ |
100 | 102 | ServerResult deleteById(OrderBaseInfoQueryVO orderBaseInfoQueryVO); |
101 | 103 | |
104 | + | |
102 | 105 | long countByOrderStatus(Integer orderFinish); |
103 | 106 | |
104 | 107 | long countRecentMonthByOrderStatus(Integer orderFinish); |
... | ... | @@ -113,4 +116,5 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { |
113 | 116 | ServerResult checkChargeOrderCount(List<Long> orderIds); |
114 | 117 | |
115 | 118 | List<OrderBaseInfoDO> getEventList(); |
119 | + | |
116 | 120 | } | ... | ... |
src/main/java/com/order/erp/service/order/OrderOpinionLogService.java
... | ... | @@ -3,8 +3,9 @@ package com.order.erp.service.order; |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.domain.dto.order.OrderOpinionLogDO; |
6 | +import com.order.erp.domain.vo.order.OrderOpinionLogVO; | |
6 | 7 | |
7 | 8 | public interface OrderOpinionLogService extends IService<OrderOpinionLogDO> { |
8 | 9 | |
9 | - ServerResult queryById(OrderOpinionLogDO orderOpinionLogDO); | |
10 | + ServerResult queryById(OrderOpinionLogVO orderOpinionLogVo); | |
10 | 11 | } | ... | ... |
src/main/java/com/order/erp/service/order/ProducePaymentCheckBillOrderService.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.ProducePaymentCheckBillOrderDO; | |
6 | +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderQueryVO; | |
7 | +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO; | |
8 | + | |
9 | +/** | |
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表服务接口 | |
11 | + * | |
12 | + * @author makejava | |
13 | + * @since 2024-08-05 16:26:35 | |
14 | + */ | |
15 | +public interface ProducePaymentCheckBillOrderService extends IService<ProducePaymentCheckBillOrderDO> { | |
16 | + | |
17 | + /** | |
18 | + * 通过ID查询单条数据 | |
19 | + * | |
20 | + * @param producePaymentCheckBillOrderQueryVO 主键 | |
21 | + * @return 实例对象 | |
22 | + */ | |
23 | + ServerResult queryById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | |
24 | + | |
25 | + /** | |
26 | + * 分页查询 | |
27 | + * | |
28 | + * @param producePaymentCheckBillOrderQueryVO 筛选条件 | |
29 | + * @return 查询结果 | |
30 | + */ | |
31 | + ServerResult list(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | |
32 | + | |
33 | + /** | |
34 | + * 新增数据 | |
35 | + * | |
36 | + * @param producePaymentCheckBillOrderVO 数据VO | |
37 | + * @return 新增结果 | |
38 | + */ | |
39 | + ServerResult add(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO); | |
40 | + | |
41 | + /** | |
42 | + * 修改数据 | |
43 | + * | |
44 | + * @param producePaymentCheckBillOrderVO 数据VO | |
45 | + * @return 编辑结果 | |
46 | + */ | |
47 | + ServerResult edit(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO); | |
48 | + | |
49 | + /** | |
50 | + * 通过主键删除数据 | |
51 | + * | |
52 | + * @param producePaymentCheckBillOrderQueryVO 筛选条件 | |
53 | + * @return 是否成功 | |
54 | + */ | |
55 | + ServerResult deleteById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | |
56 | + | |
57 | +} | ... | ... |
src/main/java/com/order/erp/service/order/impl/CheckBillMappingServiceImpl.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.query.LambdaQueryWrapper; | |
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
10 | +import com.order.erp.common.constant.Constant; | |
11 | +import com.order.erp.common.constant.ServerResult; | |
12 | +import com.order.erp.common.utils.PageUtils; | |
13 | +import com.order.erp.domain.dto.order.CheckBillMappingDO; | |
14 | +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO; | |
15 | +import com.order.erp.domain.vo.order.CheckBillMappingVO; | |
16 | +import com.order.erp.mapper.order.CheckBillMappingMapper; | |
17 | +import com.order.erp.service.order.CheckBillMappingService; | |
18 | +import lombok.extern.slf4j.Slf4j; | |
19 | +import org.springframework.stereotype.Service; | |
20 | + | |
21 | +import java.util.List; | |
22 | +import java.util.Objects; | |
23 | + | |
24 | +/** | |
25 | + * 生产科对账单应收账单映射表(CheckBillMapping)表服务实现类 | |
26 | + * | |
27 | + * @author makejava | |
28 | + * @since 2024-08-05 16:26:37 | |
29 | + */ | |
30 | +@Slf4j | |
31 | +@Service | |
32 | +public class CheckBillMappingServiceImpl extends ServiceImpl<CheckBillMappingMapper, CheckBillMappingDO> implements CheckBillMappingService { | |
33 | + | |
34 | + | |
35 | + /** | |
36 | + * 通过ID查询单条数据 | |
37 | + * <p> | |
38 | + * checkBillMappingQueryVO 主键 | |
39 | + * | |
40 | + * @return 实例对象 | |
41 | + */ | |
42 | + @Override | |
43 | + public ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO) { | |
44 | + if (Objects.isNull(checkBillMappingQueryVO.getId())) { | |
45 | + return ServerResult.fail("id 不能为空"); | |
46 | + } | |
47 | + CheckBillMappingDO CheckBillMappingDo = getById(checkBillMappingQueryVO.getId()); | |
48 | + if (Objects.isNull(CheckBillMappingDo)) { | |
49 | + return ServerResult.success(null); | |
50 | + } | |
51 | + return ServerResult.success(BeanUtil.copyProperties(CheckBillMappingDo, CheckBillMappingVO.class)); | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 分页查询 | |
56 | + * | |
57 | + * @param checkBillMappingQueryVO 筛选条件 | |
58 | + * @return 查询结果 | |
59 | + */ | |
60 | + @Override | |
61 | + public ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO) { | |
62 | + | |
63 | + LambdaQueryWrapper<CheckBillMappingDO> queryWapper = new LambdaQueryWrapper<CheckBillMappingDO>() | |
64 | + .eq(CheckBillMappingDO::getEnableFlag, Constant.ENABLE_TEN) | |
65 | + .orderByDesc(CheckBillMappingDO::getId); | |
66 | + Page page = new Page<>(checkBillMappingQueryVO.getPage(), checkBillMappingQueryVO.getPageSize()); | |
67 | + IPage<CheckBillMappingDO> iPage = page(page, queryWapper); | |
68 | + checkBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue()); | |
69 | + return ServerResult.success(PageUtils.getPageReturn(null, checkBillMappingQueryVO)); | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * 新增数据 | |
74 | + * | |
75 | + * @param checkBillMappingVO 实例对象 | |
76 | + * @return 实例对象 | |
77 | + */ | |
78 | + @Override | |
79 | + public ServerResult add(CheckBillMappingVO checkBillMappingVO) { | |
80 | + //todo 校验 | |
81 | + if (Objects.nonNull(checkBillMappingVO.getId())) { | |
82 | + checkBillMappingVO.setId(null); | |
83 | + } | |
84 | + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class); | |
85 | + | |
86 | + save(checkBillMappingDo); | |
87 | + | |
88 | + return ServerResult.success(); | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * 修改数据 | |
93 | + * | |
94 | + * @param checkBillMappingVO 实例对象 | |
95 | + * @return 实例对象 | |
96 | + */ | |
97 | + @Override | |
98 | + public ServerResult edit(CheckBillMappingVO checkBillMappingVO) { | |
99 | + //todo 校验 | |
100 | + if (Objects.isNull(checkBillMappingVO.getId())) { | |
101 | + return ServerResult.fail("id 不能为空"); | |
102 | + } | |
103 | + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class); | |
104 | + | |
105 | + updateById(checkBillMappingDo); | |
106 | + | |
107 | + return ServerResult.success(); | |
108 | + } | |
109 | + | |
110 | + /** | |
111 | + * 通过主键删除数据 | |
112 | + * | |
113 | + * @param checkBillMappingQueryVO 筛选条件 | |
114 | + * @return 是否成功 | |
115 | + */ | |
116 | + @Override | |
117 | + public ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO) { | |
118 | + List<Long> ids = checkBillMappingQueryVO.getIds(); | |
119 | + if (CollUtil.isEmpty(ids)) { | |
120 | + return ServerResult.fail("ids 参数不能为空"); | |
121 | + } | |
122 | + List<CheckBillMappingDO> checkBillMappingList = listByIds(ids); | |
123 | + if (CollUtil.isEmpty(checkBillMappingList)) { | |
124 | + return ServerResult.success(); | |
125 | + } | |
126 | + //todo 校验是否可以逻辑删除 | |
127 | + LambdaUpdateWrapper<CheckBillMappingDO> updateWrapper = new LambdaUpdateWrapper<CheckBillMappingDO>() | |
128 | + .in(CheckBillMappingDO::getId, ids) | |
129 | + .set(CheckBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
130 | + update(updateWrapper); | |
131 | + return ServerResult.success(); | |
132 | + } | |
133 | +} | ... | ... |
src/main/java/com/order/erp/service/order/impl/InvoiceBillMappingServiceImpl.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.query.LambdaQueryWrapper; | |
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
10 | +import com.order.erp.common.constant.Constant; | |
11 | +import com.order.erp.common.constant.ServerResult; | |
12 | +import com.order.erp.common.utils.PageUtils; | |
13 | +import com.order.erp.domain.dto.order.InvoiceBillMappingDO; | |
14 | +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO; | |
15 | +import com.order.erp.domain.vo.order.InvoiceBillMappingVO; | |
16 | +import com.order.erp.mapper.order.InvoiceBillMappingMapper; | |
17 | +import com.order.erp.service.order.InvoiceBillMappingService; | |
18 | +import lombok.extern.slf4j.Slf4j; | |
19 | +import org.springframework.stereotype.Service; | |
20 | + | |
21 | +import java.util.List; | |
22 | +import java.util.Objects; | |
23 | + | |
24 | +/** | |
25 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务实现类 | |
26 | + * | |
27 | + * @author makejava | |
28 | + * @since 2024-08-05 16:26:36 | |
29 | + */ | |
30 | +@Slf4j | |
31 | +@Service | |
32 | +public class InvoiceBillMappingServiceImpl extends ServiceImpl<InvoiceBillMappingMapper, InvoiceBillMappingDO> implements InvoiceBillMappingService { | |
33 | + | |
34 | + | |
35 | + /** | |
36 | + * 通过ID查询单条数据 | |
37 | + * <p> | |
38 | + * invoiceBillMappingQueryVO 主键 | |
39 | + * | |
40 | + * @return 实例对象 | |
41 | + */ | |
42 | + @Override | |
43 | + public ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | |
44 | + if (Objects.isNull(invoiceBillMappingQueryVO.getId())) { | |
45 | + return ServerResult.fail("id 不能为空"); | |
46 | + } | |
47 | + InvoiceBillMappingDO InvoiceBillMappingDo = getById(invoiceBillMappingQueryVO.getId()); | |
48 | + if (Objects.isNull(InvoiceBillMappingDo)) { | |
49 | + return ServerResult.success(null); | |
50 | + } | |
51 | + return ServerResult.success(BeanUtil.copyProperties(InvoiceBillMappingDo, InvoiceBillMappingVO.class)); | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 分页查询 | |
56 | + * | |
57 | + * @param invoiceBillMappingQueryVO 筛选条件 | |
58 | + * @return 查询结果 | |
59 | + */ | |
60 | + @Override | |
61 | + public ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | |
62 | + | |
63 | + LambdaQueryWrapper<InvoiceBillMappingDO> queryWapper = new LambdaQueryWrapper<InvoiceBillMappingDO>() | |
64 | + .eq(InvoiceBillMappingDO::getEnableFlag, Constant.ENABLE_TEN) | |
65 | + .orderByDesc(InvoiceBillMappingDO::getId); | |
66 | + Page page = new Page<>(invoiceBillMappingQueryVO.getPage(), invoiceBillMappingQueryVO.getPageSize()); | |
67 | + IPage<InvoiceBillMappingDO> iPage = page(page, queryWapper); | |
68 | + invoiceBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue()); | |
69 | + return ServerResult.success(PageUtils.getPageReturn(null, invoiceBillMappingQueryVO)); | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * 新增数据 | |
74 | + * | |
75 | + * @param invoiceBillMappingVO 实例对象 | |
76 | + * @return 实例对象 | |
77 | + */ | |
78 | + @Override | |
79 | + public ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO) { | |
80 | + //todo 校验 | |
81 | + if (Objects.nonNull(invoiceBillMappingVO.getId())) { | |
82 | + invoiceBillMappingVO.setId(null); | |
83 | + } | |
84 | + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class); | |
85 | + | |
86 | + save(invoiceBillMappingDo); | |
87 | + | |
88 | + return ServerResult.success(); | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * 修改数据 | |
93 | + * | |
94 | + * @param invoiceBillMappingVO 实例对象 | |
95 | + * @return 实例对象 | |
96 | + */ | |
97 | + @Override | |
98 | + public ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO) { | |
99 | + //todo 校验 | |
100 | + if (Objects.isNull(invoiceBillMappingVO.getId())) { | |
101 | + return ServerResult.fail("id 不能为空"); | |
102 | + } | |
103 | + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class); | |
104 | + | |
105 | + updateById(invoiceBillMappingDo); | |
106 | + | |
107 | + return ServerResult.success(); | |
108 | + } | |
109 | + | |
110 | + /** | |
111 | + * 通过主键删除数据 | |
112 | + * | |
113 | + * @param invoiceBillMappingQueryVO 筛选条件 | |
114 | + * @return 是否成功 | |
115 | + */ | |
116 | + @Override | |
117 | + public ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | |
118 | + List<Long> ids = invoiceBillMappingQueryVO.getIds(); | |
119 | + if (CollUtil.isEmpty(ids)) { | |
120 | + return ServerResult.fail("ids 参数不能为空"); | |
121 | + } | |
122 | + List<InvoiceBillMappingDO> invoiceBillMappingList = listByIds(ids); | |
123 | + if (CollUtil.isEmpty(invoiceBillMappingList)) { | |
124 | + return ServerResult.success(); | |
125 | + } | |
126 | + //todo 校验是否可以逻辑删除 | |
127 | + LambdaUpdateWrapper<InvoiceBillMappingDO> updateWrapper = new LambdaUpdateWrapper<InvoiceBillMappingDO>() | |
128 | + .in(InvoiceBillMappingDO::getId, ids) | |
129 | + .set(InvoiceBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
130 | + update(updateWrapper); | |
131 | + return ServerResult.success(); | |
132 | + } | |
133 | +} | ... | ... |
src/main/java/com/order/erp/service/order/impl/InvoiceBillOrderServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | |
2 | + | |
3 | +import cn.hutool.core.collection.CollUtil; | |
4 | +import com.alibaba.fastjson.JSONObject; | |
5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
6 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
7 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
10 | +import com.github.stupdit1t.excel.common.PoiWorkbookType; | |
11 | +import com.github.stupdit1t.excel.core.ExcelHelper; | |
12 | +import com.github.stupdit1t.excel.style.CellPosition; | |
13 | +import com.order.erp.common.constant.Constant; | |
14 | +import com.order.erp.common.constant.ServerResult; | |
15 | +import com.order.erp.common.constant.ServerResultCode; | |
16 | +import com.order.erp.common.exception.BusinessException; | |
17 | +import com.order.erp.common.utils.DateUtils; | |
18 | +import com.order.erp.common.utils.StringUtils; | |
19 | +import com.order.erp.common.utils.TransactionHelper; | |
20 | +import com.order.erp.config.DataScope; | |
21 | +import com.order.erp.domain.ApplyStatusEnum; | |
22 | +import com.order.erp.domain.ApplyTypeEnum; | |
23 | +import com.order.erp.domain.RoleEnum; | |
24 | +import com.order.erp.domain.dto.BaseDO; | |
25 | +import com.order.erp.domain.dto.SystemSettingDO; | |
26 | +import com.order.erp.domain.dto.order.*; | |
27 | +import com.order.erp.domain.vo.order.*; | |
28 | +import com.order.erp.mapper.order.InvoiceBillOrderMapper; | |
29 | +import com.order.erp.service.SystemSettingService; | |
30 | +import com.order.erp.service.order.*; | |
31 | +import lombok.extern.slf4j.Slf4j; | |
32 | +import org.springframework.beans.BeanUtils; | |
33 | +import org.springframework.stereotype.Service; | |
34 | + | |
35 | +import javax.annotation.Resource; | |
36 | +import javax.servlet.http.HttpServletResponse; | |
37 | +import java.io.IOException; | |
38 | +import java.math.BigDecimal; | |
39 | +import java.time.LocalDateTime; | |
40 | +import java.util.*; | |
41 | +import java.util.function.Function; | |
42 | +import java.util.stream.Collectors; | |
43 | + | |
44 | +/** | |
45 | + * 应收款账单表(InvoiceBillOrder)表服务实现类 | |
46 | + * | |
47 | + * @author makejava | |
48 | + * @since 2024-08-05 16:26:34 | |
49 | + */ | |
50 | +@Slf4j | |
51 | +@Service | |
52 | +public class InvoiceBillOrderServiceImpl extends ServiceImpl<InvoiceBillOrderMapper, InvoiceBillOrderDO> implements InvoiceBillOrderService { | |
53 | + | |
54 | + | |
55 | + @Resource | |
56 | + private OrderBaseInfoService orderBaseInfoService; | |
57 | + | |
58 | + @Resource | |
59 | + private OrderProfitAnalysisService profitAnalysisService; | |
60 | + | |
61 | + @Resource | |
62 | + private InvoiceBillMappingService invoiceBillMappingService; | |
63 | + | |
64 | + @Resource | |
65 | + private OrderFieldLockApplyService orderFieldLockApplyService; | |
66 | + | |
67 | + @Resource | |
68 | + private SystemSettingService systemSettingService; | |
69 | + | |
70 | + @Resource | |
71 | + private DataScope dataScope; | |
72 | + | |
73 | + @Resource | |
74 | + private TransactionHelper transactionHelper; | |
75 | + | |
76 | + | |
77 | + /** | |
78 | + * 分页查询 | |
79 | + * | |
80 | + * @param queryVO 筛选条件 | |
81 | + * @return 查询结果 | |
82 | + */ | |
83 | + @Override | |
84 | + public ServerResult listByPage(InvoiceBillOrderQueryVO queryVO) { | |
85 | + LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO); | |
86 | + Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
87 | + IPage<InvoiceBillOrderDO> iPage = page(page, queryWrapper); | |
88 | + return ServerResult.success(iPage); | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * @param queryVO | |
93 | + * @return | |
94 | + */ | |
95 | + private LambdaQueryWrapper<InvoiceBillOrderDO> getQueryWrapper(InvoiceBillOrderQueryVO queryVO) { | |
96 | + LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
97 | + .eq(InvoiceBillOrderDO::getEnableFlag, Constant.ENABLE_TEN) | |
98 | + .eq(StringUtils.isNotBlank(queryVO.getInvoiceNo()), InvoiceBillOrderDO::getInvoiceNo, queryVO.getInvoiceNo()) | |
99 | + .eq(Objects.nonNull(queryVO.getStatus()), InvoiceBillOrderDO::getStatus, queryVO.getStatus()) | |
100 | + .ge(StringUtils.isNotBlank(queryVO.getStartTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getStartTime()) | |
101 | + .le(StringUtils.isNotBlank(queryVO.getEndTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getEndTime()) | |
102 | + .orderByDesc(InvoiceBillOrderDO::getId); | |
103 | + if (CollectionUtils.isNotEmpty(queryVO.getIds())) { | |
104 | + queryWrapper.in(InvoiceBillOrderDO::getId, queryVO.getIds()); | |
105 | + } else { | |
106 | + Set<Long> billOrderIds = filterBillOrderIdsBy(queryVO); | |
107 | + queryWrapper.in(CollectionUtils.isNotEmpty(billOrderIds), InvoiceBillOrderDO::getId, billOrderIds); | |
108 | + } | |
109 | + return queryWrapper; | |
110 | + } | |
111 | + | |
112 | + @Override | |
113 | + public ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO) { | |
114 | + List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>() | |
115 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
116 | + .eq(InvoiceBillMappingDO::getInvoiceNo, queryVO.getInvoiceNo())); | |
117 | + if (CollectionUtils.isEmpty(mappingDOS)) { | |
118 | + return ServerResult.success(); | |
119 | + } | |
120 | + Set<Long> orderIds = mappingDOS.stream().map(InvoiceBillMappingDO::getOrderId).collect(Collectors.toSet()); | |
121 | + return ServerResult.success(orderBaseInfoService.listByIds(orderIds)); | |
122 | + } | |
123 | + | |
124 | + @Override | |
125 | + public ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO) { | |
126 | + return ServerResult.success(getAnalysisResult(queryVO)); | |
127 | + } | |
128 | + | |
129 | + @Override | |
130 | + public ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException { | |
131 | + InvoiceBillAnalysisResultVO resultVO = getAnalysisResult(queryVO); | |
132 | + if (Objects.isNull(resultVO)) { | |
133 | + throw new BusinessException("数据为空,不能导出!"); | |
134 | + } | |
135 | + List<Map<String, Object>> list = buildExportMapVOS(resultVO); | |
136 | + if (CollectionUtils.isNotEmpty(list)) { | |
137 | + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | |
138 | + | |
139 | + ExcelHelper.opsExport(PoiWorkbookType.XLSX) | |
140 | + .opsSheet(list) | |
141 | + .opsHeader().simple().texts(keys).done() | |
142 | + .opsColumn().fields(keys).done() | |
143 | + .height(CellPosition.CELL, 750) | |
144 | + .done() | |
145 | + .export(response.getOutputStream()); | |
146 | + } | |
147 | + return ServerResult.success(); | |
148 | + } | |
149 | + | |
150 | + /** | |
151 | + * @param resultVO | |
152 | + * @return | |
153 | + */ | |
154 | + private List<Map<String, Object>> buildExportMapVOS(InvoiceBillAnalysisResultVO resultVO) throws IOException { | |
155 | + List<InvoiceBillAnalysisExportVO> exportVOS = resultVO.getExportVOS(); | |
156 | + List<Map<String, Object>> list = new ArrayList<>(); | |
157 | + int i = 0; | |
158 | + for (InvoiceBillAnalysisExportVO exportVO : exportVOS) { | |
159 | + Map<String, Object> map = new LinkedHashMap<>(); | |
160 | + map.put("编号", i++); | |
161 | + map.put("客户编码", exportVO.getCustomerCode()); | |
162 | + map.put("INVOICE编码", exportVO.getInvoiceNo()); | |
163 | + map.put("客户总金额汇总", exportVO.getCustomerTotalPrice()); | |
164 | + map.put("客户扣款金额汇总", exportVO.getDeductAmount()); | |
165 | + map.put("实际应收金额", exportVO.getActualReceivableAmount()); | |
166 | + map.put("实际收款金额汇总", exportVO.getActualPayedAmount()); | |
167 | + map.put("其他费用金额汇总", exportVO.getOtherAmount()); | |
168 | + map.put("其他费用合计", exportVO.getOtherTotalAmount()); | |
169 | + map.put("必须回款日期", exportVO.getBackRefundDate()); | |
170 | + map.put("实际回款日期", exportVO.getActualRefundDate()); | |
171 | + list.add(map); | |
172 | + } | |
173 | + Map<String, Object> map = new LinkedHashMap<>(); | |
174 | + map.put("编号", "合计"); | |
175 | + map.put("客户编码", ""); | |
176 | + map.put("INVOICE编码", ""); | |
177 | + map.put("客户总金额汇总", resultVO.getCustomerTotalPrice()); | |
178 | + map.put("客户扣款金额汇总", resultVO.getDeductAmount()); | |
179 | + map.put("实际应收金额", resultVO.getActualReceivableAmount()); | |
180 | + map.put("实际收款金额汇总", resultVO.getActualPayedAmount()); | |
181 | + map.put("其他费用金额汇总", resultVO.getOtherAmount()); | |
182 | + map.put("其他费用合计", resultVO.getOtherTotalAmount()); | |
183 | + map.put("必须回款日期", ""); | |
184 | + map.put("实际回款日期", ""); | |
185 | + list.add(map); | |
186 | + return list; | |
187 | + } | |
188 | + | |
189 | + /** | |
190 | + * @param queryVO | |
191 | + * @return | |
192 | + */ | |
193 | + private InvoiceBillAnalysisResultVO getAnalysisResult(InvoiceBillAnalysisVO queryVO) { | |
194 | + LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO); | |
195 | + List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(queryWrapper); | |
196 | + if (CollectionUtils.isEmpty(invoiceBillOrderDOS)) { | |
197 | + return null; | |
198 | + } | |
199 | + Set<Long> ids = invoiceBillOrderDOS.stream().map(InvoiceBillOrderDO::getId).collect(Collectors.toSet()); | |
200 | + List<InvoiceBillMappingDO> invoiceBillMappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getInvoiceBillId, ids)); | |
201 | + if (CollectionUtils.isEmpty(invoiceBillMappingDOS)) { | |
202 | + return null; | |
203 | + } | |
204 | + Map<Long, InvoiceBillMappingDO> orderBillMap = invoiceBillMappingDOS.stream().collect(Collectors.toMap(InvoiceBillMappingDO::getOrderId, Function.identity(), (x, y) -> x)); | |
205 | + List<InvoiceOrderBaseItemVO> itemVOS = getInvoiceOrderBaseItems(orderBillMap); | |
206 | + Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap = invoiceBillOrderDOS.stream().collect(Collectors.toMap(InvoiceBillOrderDO::getInvoiceNo, Function.identity(), (x, y) -> x)); | |
207 | + Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap = itemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getInvoiceCode)); | |
208 | + List<InvoiceBillAnalysisExportVO> exportVOS = wrapperAnalysisExport(invoiceBillOrderDOMap, baseItemMap); | |
209 | + return wrapperAnalysisResultVO(exportVOS); | |
210 | + } | |
211 | + | |
212 | + /** | |
213 | + * @param exportVOS | |
214 | + * @return | |
215 | + */ | |
216 | + private InvoiceBillAnalysisResultVO wrapperAnalysisResultVO(List<InvoiceBillAnalysisExportVO> exportVOS) { | |
217 | + if (CollectionUtils.isEmpty(exportVOS)) { | |
218 | + return null; | |
219 | + } | |
220 | + InvoiceBillAnalysisResultVO resultVO = InvoiceBillAnalysisResultVO.builder().exportVOS(exportVOS).build(); | |
221 | + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | |
222 | + BigDecimal deductAmount = new BigDecimal(Constant.ZERO); | |
223 | + BigDecimal actualReceivableAmount = new BigDecimal(Constant.ZERO); | |
224 | + BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO); | |
225 | + BigDecimal otherAmount = new BigDecimal(Constant.ZERO); | |
226 | + BigDecimal otherTotalAmount = new BigDecimal(Constant.ZERO); | |
227 | + for (InvoiceBillAnalysisExportVO exportVO : exportVOS) { | |
228 | + if (Objects.nonNull(exportVO.getCustomerTotalPrice())) { | |
229 | + customerTotalPrice = customerTotalPrice.add(exportVO.getCustomerTotalPrice()); | |
230 | + } | |
231 | + if (Objects.nonNull(exportVO.getDeductAmount())) { | |
232 | + deductAmount = deductAmount.add(exportVO.getDeductAmount()); | |
233 | + } | |
234 | + if (Objects.nonNull(exportVO.getActualReceivableAmount())) { | |
235 | + actualReceivableAmount = actualReceivableAmount.add(exportVO.getActualReceivableAmount()); | |
236 | + } | |
237 | + if (Objects.nonNull(exportVO.getActualPayedAmount())) { | |
238 | + actualPayedAmount = actualPayedAmount.add(exportVO.getActualPayedAmount()); | |
239 | + } | |
240 | + if (Objects.nonNull(exportVO.getOtherAmount())) { | |
241 | + otherAmount = customerTotalPrice.add(exportVO.getOtherAmount()); | |
242 | + } | |
243 | + if (Objects.nonNull(exportVO.getOtherTotalAmount())) { | |
244 | + otherTotalAmount = otherTotalAmount.add(exportVO.getOtherTotalAmount()); | |
245 | + } | |
246 | + } | |
247 | + resultVO.setCustomerTotalPrice(customerTotalPrice); | |
248 | + resultVO.setDeductAmount(deductAmount); | |
249 | + resultVO.setActualReceivableAmount(actualReceivableAmount); | |
250 | + resultVO.setActualPayedAmount(actualPayedAmount); | |
251 | + resultVO.setOtherAmount(otherAmount); | |
252 | + resultVO.setOtherTotalAmount(otherTotalAmount); | |
253 | + return resultVO; | |
254 | + } | |
255 | + | |
256 | + /** | |
257 | + * @param invoiceBillOrderDOMap | |
258 | + * @param baseItemMap | |
259 | + * @return | |
260 | + */ | |
261 | + private List<InvoiceBillAnalysisExportVO> wrapperAnalysisExport(Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) { | |
262 | + if (CollectionUtils.isEmpty(invoiceBillOrderDOMap)) { | |
263 | + return Collections.emptyList(); | |
264 | + } | |
265 | + List<InvoiceBillAnalysisExportVO> results = new ArrayList<>(); | |
266 | + for (Map.Entry<String, InvoiceBillOrderDO> entry : invoiceBillOrderDOMap.entrySet()) { | |
267 | + InvoiceBillOrderDO invoiceBillOrderDO = entry.getValue(); | |
268 | + List<InvoiceBillAnalysisExportVO> exportVOS = transfer2analysisExportVO(invoiceBillOrderDO, baseItemMap); | |
269 | + if (CollectionUtils.isNotEmpty(exportVOS)) { | |
270 | + results.addAll(exportVOS); | |
271 | + } | |
272 | + } | |
273 | + return results; | |
274 | + } | |
275 | + | |
276 | + /** | |
277 | + * @param invoiceBillOrderDO | |
278 | + * @param baseItemMap | |
279 | + * @return | |
280 | + */ | |
281 | + private List<InvoiceBillAnalysisExportVO> transfer2analysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) { | |
282 | + List<InvoiceBillAnalysisExportVO> results = new ArrayList<>(); | |
283 | + String invoiceNo = invoiceBillOrderDO.getInvoiceNo(); | |
284 | + if (baseItemMap.containsKey(invoiceNo)) { | |
285 | + List<InvoiceOrderBaseItemVO> baseItemVOS = baseItemMap.get(invoiceNo); | |
286 | + Map<String, List<InvoiceOrderBaseItemVO>> listMap = baseItemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getCustomerCode)); | |
287 | + for (Map.Entry<String, List<InvoiceOrderBaseItemVO>> entry : listMap.entrySet()) { | |
288 | + String customerCode = entry.getKey(); | |
289 | + List<InvoiceOrderBaseItemVO> itemVOS = entry.getValue(); | |
290 | + InvoiceBillAnalysisExportVO exportVO = buildAnalysisExportVO(invoiceBillOrderDO); | |
291 | + exportVO.setCustomerCode(customerCode); | |
292 | + if (CollectionUtils.isEmpty(itemVOS)) { | |
293 | + exportVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO)); | |
294 | + } else { | |
295 | + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | |
296 | + for (InvoiceOrderBaseItemVO itemVO : itemVOS) { | |
297 | + customerTotalPrice = customerTotalPrice.add(Objects.nonNull(itemVO.getCustomerTotalPrice()) ? itemVO.getCustomerTotalPrice() : new BigDecimal(Constant.ZERO)); | |
298 | + } | |
299 | + exportVO.setCustomerTotalPrice(customerTotalPrice); | |
300 | + } | |
301 | + results.add(exportVO); | |
302 | + } | |
303 | + } | |
304 | + return results; | |
305 | + } | |
306 | + | |
307 | + /** | |
308 | + * @param invoiceBillOrderDO | |
309 | + * @return | |
310 | + */ | |
311 | + private InvoiceBillAnalysisExportVO buildAnalysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO) { | |
312 | + InvoiceBillAnalysisExportVO exportVO = new InvoiceBillAnalysisExportVO(); | |
313 | + BeanUtils.copyProperties(invoiceBillOrderDO, exportVO); | |
314 | + BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO); | |
315 | + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount1())) { | |
316 | + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount1()); | |
317 | + } | |
318 | + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount2())) { | |
319 | + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount2()); | |
320 | + } | |
321 | + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount3())) { | |
322 | + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount3()); | |
323 | + } | |
324 | + exportVO.setActualPayedAmount(actualPayedAmount); | |
325 | + BigDecimal otherAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO)) | |
326 | + .subtract(exportVO.getActualPayedAmount()); | |
327 | + exportVO.setOtherAmount(otherAmount); | |
328 | + BigDecimal otherTotalAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO)) | |
329 | + .subtract(exportVO.getActualPayedAmount()).subtract(otherAmount); | |
330 | + exportVO.setOtherTotalAmount(otherTotalAmount); | |
331 | + return exportVO; | |
332 | + } | |
333 | + | |
334 | + /** | |
335 | + * @param mappingDOMap | |
336 | + * @return | |
337 | + */ | |
338 | + private List<InvoiceOrderBaseItemVO> getInvoiceOrderBaseItems(Map<Long, InvoiceBillMappingDO> mappingDOMap) { | |
339 | + Set<Long> orderIds = mappingDOMap.keySet(); | |
340 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(orderIds); | |
341 | + List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderProfitAnalysisDO::getOrderId, orderIds)); | |
342 | + Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = orderBaseInfoDOList.stream().collect(Collectors.toMap(OrderBaseInfoDO::getId, Function.identity(), (x, y) -> x)); | |
343 | + Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (x, y) -> x)); | |
344 | + List<InvoiceOrderBaseItemVO> baseItemVOS = new ArrayList<>(); | |
345 | + for (Map.Entry<Long, OrderBaseInfoDO> entry : orderBaseInfoDOMap.entrySet()) { | |
346 | + Long orderId = entry.getKey(); | |
347 | + OrderBaseInfoDO baseInfoDO = entry.getValue(); | |
348 | + InvoiceOrderBaseItemVO itemVO = InvoiceOrderBaseItemVO.builder() | |
349 | + .orderId(orderId) | |
350 | + .customerCode(baseInfoDO.getCustomerCode()) | |
351 | + .build(); | |
352 | + if (profitAnalysisDOMap.containsKey(orderId)) { | |
353 | + OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(orderId); | |
354 | + itemVO.setCustomerTotalPrice(Objects.isNull(profitAnalysisDO.getCustomerTotalPrice()) ? new BigDecimal(Constant.ZERO) : new BigDecimal(profitAnalysisDO.getCustomerTotalPrice())); | |
355 | + } else { | |
356 | + itemVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO)); | |
357 | + } | |
358 | + | |
359 | + if (mappingDOMap.containsKey(orderId)) { | |
360 | + InvoiceBillMappingDO mappingDO = mappingDOMap.get(orderId); | |
361 | + itemVO.setInvoiceCode(mappingDO.getInvoiceNo()); | |
362 | + } | |
363 | + baseItemVOS.add(itemVO); | |
364 | + } | |
365 | + return baseItemVOS; | |
366 | + } | |
367 | + | |
368 | + /** | |
369 | + * @param queryVO | |
370 | + * @return | |
371 | + */ | |
372 | + private Set<Long> filterBillOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
373 | + List<Long> orderIds = filterOrderIdsBy(queryVO); | |
374 | + if (CollectionUtils.isEmpty(orderIds)) { | |
375 | + return null; | |
376 | + } | |
377 | + List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
378 | + .in(CollectionUtils.isNotEmpty(orderIds), InvoiceBillMappingDO::getOrderId, orderIds)); | |
379 | + if (CollectionUtils.isEmpty(mappingDOS)) { | |
380 | + Set<Long> ids = new HashSet<>(); | |
381 | + ids.add(-1L); | |
382 | + return ids; | |
383 | + } | |
384 | + return mappingDOS.stream().map(InvoiceBillMappingDO::getInvoiceBillId).collect(Collectors.toSet()); | |
385 | + } | |
386 | + | |
387 | + /** | |
388 | + * @param queryVO | |
389 | + * @return | |
390 | + */ | |
391 | + private List<Long> filterOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
392 | + Boolean flag = false; | |
393 | + if (StringUtils.isNotBlank(queryVO.getCustomerCode())) { | |
394 | + flag = flag | true; | |
395 | + } | |
396 | + if (StringUtils.isNotBlank(queryVO.getProductionDepartment())) { | |
397 | + flag = flag | true; | |
398 | + } | |
399 | + if (StringUtils.isNotBlank(queryVO.getCustomerPo())) { | |
400 | + flag = flag | true; | |
401 | + } | |
402 | + if (StringUtils.isNotBlank(queryVO.getInnerNo())) { | |
403 | + flag = flag | true; | |
404 | + } | |
405 | + if (StringUtils.isNotBlank(queryVO.getProjectNo())) { | |
406 | + flag = flag | true; | |
407 | + } | |
408 | + if (!flag) { | |
409 | + return null; | |
410 | + } | |
411 | + LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = new LambdaQueryWrapper<OrderBaseInfoDO>() | |
412 | + .eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN) | |
413 | + .eq(StringUtils.isNotBlank(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode()) | |
414 | + .eq(StringUtils.isNotBlank(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment()) | |
415 | + .eq(StringUtils.isNotBlank(queryVO.getCustomerPo()), OrderBaseInfoDO::getCustomerPo, queryVO.getCustomerPo()) | |
416 | + .eq(StringUtils.isNotBlank(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo()) | |
417 | + .eq(StringUtils.isNotBlank(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo()); | |
418 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
419 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
420 | + List<Long> orderIds = new ArrayList<>(); | |
421 | + orderIds.add(-1L); | |
422 | + return orderIds; | |
423 | + } | |
424 | + return orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList()); | |
425 | + } | |
426 | + | |
427 | + /** | |
428 | + * 创建invoice单据 | |
429 | + * | |
430 | + * @param createVO 实例对象 | |
431 | + * @return 实例对象 | |
432 | + */ | |
433 | + @Override | |
434 | + public ServerResult create(InvoiceBillCreateVO createVO) { | |
435 | + if (Objects.nonNull(createVO.getId())) { | |
436 | + createVO.setId(null); | |
437 | + } | |
438 | + | |
439 | + validaBillOrder(createVO); | |
440 | + | |
441 | + InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO); | |
442 | + | |
443 | + transactionHelper.run(() -> { | |
444 | + save(invoiceBillOrderDO); | |
445 | + | |
446 | + invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO)); | |
447 | + }); | |
448 | + | |
449 | + return ServerResult.success(); | |
450 | + } | |
451 | + | |
452 | + @Override | |
453 | + public ServerResult getBackRefundDate(InvoiceBillCreateVO createVO) { | |
454 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds()); | |
455 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
456 | + throw new BusinessException("勾选的订单信息不存在!"); | |
457 | + } | |
458 | + | |
459 | + InvoiceHoldTimeItemVO invoiceHoldTimeItemVO = getCustomerHoldTime(orderBaseInfoDOList); | |
460 | + | |
461 | + return ServerResult.success(calculateBackRefundDate(invoiceHoldTimeItemVO)); | |
462 | + } | |
463 | + | |
464 | + /** | |
465 | + * @param invoiceHoldTimeItemVO | |
466 | + * @return | |
467 | + */ | |
468 | + private String calculateBackRefundDate(InvoiceHoldTimeItemVO invoiceHoldTimeItemVO) { | |
469 | + Integer holdDays = getHoldTimeByCustomerCode(invoiceHoldTimeItemVO.getCustomerCode()); | |
470 | + LocalDateTime holdTime = DateUtils.parse(invoiceHoldTimeItemVO.getHoldTime(), DateUtils.DATE_TIME).plusDays(holdDays); | |
471 | + return DateUtils.format(holdTime, DateUtils.DATE); | |
472 | + } | |
473 | + | |
474 | + /** | |
475 | + * @param customerCode | |
476 | + * @return | |
477 | + */ | |
478 | + private Integer getHoldTimeByCustomerCode(String customerCode) { | |
479 | + SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
480 | + .eq(SystemSettingDO::getSettingCode, "customerCode").eq(SystemSettingDO::getSettingValue, customerCode) | |
481 | + .eq(SystemSettingDO::getRelationCode, "orderHodTime").last("limit 1")); | |
482 | + if (Objects.isNull(systemSettingDO)) { | |
483 | + return Constant.ZERO; | |
484 | + } | |
485 | + String holdTime = systemSettingDO.getRelationValue(); | |
486 | + return StringUtils.isBlank(holdTime) ? Constant.ZERO : Integer.parseInt(holdTime); | |
487 | + } | |
488 | + | |
489 | + /** | |
490 | + * @param orderBaseInfoDOList | |
491 | + * @return | |
492 | + */ | |
493 | + private InvoiceHoldTimeItemVO getCustomerHoldTime(List<OrderBaseInfoDO> orderBaseInfoDOList) { | |
494 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
495 | + return null; | |
496 | + } | |
497 | + | |
498 | + Map<String, OrderBaseInfoDO> holdTimeMap = new HashMap<String, OrderBaseInfoDO>(); | |
499 | + String maxHoldTime = null; | |
500 | + for (OrderBaseInfoDO baseInfoDO : orderBaseInfoDOList) { | |
501 | + if (StringUtils.isNotBlank(baseInfoDO.getOrderHodTime())) { | |
502 | + holdTimeMap.put(baseInfoDO.getOrderHodTime(), baseInfoDO); | |
503 | + if (StringUtils.isBlank(maxHoldTime)) { | |
504 | + maxHoldTime = baseInfoDO.getOrderHodTime(); | |
505 | + } else if (maxHoldTime.compareTo(baseInfoDO.getOrderHodTime()) <= 0) { | |
506 | + maxHoldTime = baseInfoDO.getOrderHodTime(); | |
507 | + } | |
508 | + } | |
509 | + } | |
510 | + if (StringUtils.isBlank(maxHoldTime)) { | |
511 | + return null; | |
512 | + } | |
513 | + InvoiceHoldTimeItemVO itemVO = new InvoiceHoldTimeItemVO(); | |
514 | + if (holdTimeMap.containsKey(maxHoldTime)) { | |
515 | + OrderBaseInfoDO baseInfoDO = holdTimeMap.get(maxHoldTime); | |
516 | + itemVO.setCustomerCode(baseInfoDO.getCustomerCode()); | |
517 | + itemVO.setHoldTime(maxHoldTime); | |
518 | + itemVO.setBaseInfoDO(baseInfoDO); | |
519 | + } | |
520 | + return itemVO; | |
521 | + } | |
522 | + | |
523 | + /** | |
524 | + * @param createVO | |
525 | + * @return | |
526 | + */ | |
527 | + private InvoiceBillOrderDO buildInvoiceBillOrderDO(InvoiceBillCreateVO createVO) { | |
528 | + return InvoiceBillOrderDO.builder() | |
529 | + .invoiceNo(createVO.getInvoiceNo()) | |
530 | + .bgUrl(createVO.getBgUrl()) | |
531 | + .backRefundDate(createVO.getBackRefundDate()) | |
532 | + .status(ApplyStatusEnum.NO_COMMIT.getStatus()) | |
533 | + .build(); | |
534 | + } | |
535 | + | |
536 | + /** | |
537 | + * @param createVO | |
538 | + * @param invoiceBillOrderDO | |
539 | + * @return | |
540 | + */ | |
541 | + private List<InvoiceBillMappingDO> buildInvoiceBillMappingDOS(InvoiceBillCreateVO createVO, InvoiceBillOrderDO invoiceBillOrderDO) { | |
542 | + return createVO.getOrderIds().stream().map(x -> { | |
543 | + return InvoiceBillMappingDO.builder() | |
544 | + .orderId(x) | |
545 | + .invoiceBillId(invoiceBillOrderDO.getId()) | |
546 | + .invoiceNo(invoiceBillOrderDO.getInvoiceNo()) | |
547 | + .build(); | |
548 | + }).collect(Collectors.toList()); | |
549 | + } | |
550 | + | |
551 | + /** | |
552 | + * @param createVO | |
553 | + */ | |
554 | + private void validaBillOrder(InvoiceBillCreateVO createVO) { | |
555 | + if (CollectionUtils.isEmpty(createVO.getOrderIds())) { | |
556 | + throw new BusinessException("请勾选订单!"); | |
557 | + } | |
558 | + | |
559 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds()); | |
560 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
561 | + throw new BusinessException("勾选的订单信息不存在!"); | |
562 | + } | |
563 | + | |
564 | + if (orderBaseInfoDOList.size() != createVO.getOrderIds().size()) { | |
565 | + throw new BusinessException("勾选的订单信息有误!"); | |
566 | + } | |
567 | + | |
568 | + String invoiceNo = createVO.getInvoiceNo(); | |
569 | + | |
570 | + List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
571 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
572 | + .eq(InvoiceBillOrderDO::getInvoiceNo, invoiceNo)); | |
573 | + if (CollectionUtils.isNotEmpty(invoiceBillOrderDOS)) { | |
574 | + throw new BusinessException("存在相同的invoice订单!"); | |
575 | + } | |
576 | + | |
577 | + List<InvoiceBillMappingDO> invoiceBillMappingDOList = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getOrderId, createVO.getOrderIds())); | |
578 | + if (CollectionUtils.isNotEmpty(invoiceBillMappingDOList)) { | |
579 | + throw new BusinessException("该勾选的订单已经绑定其他账单了!"); | |
580 | + } | |
581 | + } | |
582 | + | |
583 | + /** | |
584 | + * 修改数据 | |
585 | + * | |
586 | + * @param deductInfoVO 实例对象 | |
587 | + * @return 实例对象 | |
588 | + */ | |
589 | + @Override | |
590 | + public ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO) { | |
591 | + if (Objects.isNull(deductInfoVO.getId())) { | |
592 | + throw new BusinessException("id 不能为空"); | |
593 | + } | |
594 | + InvoiceBillOrderDO invoiceBillOrderDo = getById(deductInfoVO.getId()); | |
595 | + if (Objects.isNull(invoiceBillOrderDo)) { | |
596 | + throw new BusinessException("应收款单据不存在"); | |
597 | + } | |
598 | + | |
599 | + checkCommitApply(invoiceBillOrderDo.getId()); | |
600 | + | |
601 | + invoiceBillOrderDo.setDeductUrl(deductInfoVO.getDeductUrl()); | |
602 | + invoiceBillOrderDo.setDeductAmount(deductInfoVO.getDeductAmount()); | |
603 | + updateById(invoiceBillOrderDo); | |
604 | + return ServerResult.success(); | |
605 | + } | |
606 | + | |
607 | + @Override | |
608 | + public ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO) { | |
609 | + if (Objects.isNull(amountInfoVO.getId())) { | |
610 | + throw new BusinessException("id 不能为空"); | |
611 | + } | |
612 | + InvoiceBillOrderDO invoiceBillOrderDo = getById(amountInfoVO.getId()); | |
613 | + if (Objects.isNull(invoiceBillOrderDo)) { | |
614 | + throw new BusinessException("应收款单据不存在"); | |
615 | + } | |
616 | + | |
617 | + checkCommitApply(invoiceBillOrderDo.getId()); | |
618 | + | |
619 | + invoiceBillOrderDo.setBgUrl(amountInfoVO.getBgUrl()); | |
620 | + invoiceBillOrderDo.setActualReceivableAmount(amountInfoVO.getActualReceivableAmount()); | |
621 | + invoiceBillOrderDo.setActualPayedAmount1(amountInfoVO.getActualPayedAmount1()); | |
622 | + invoiceBillOrderDo.setActualPayedAmount2(amountInfoVO.getActualPayedAmount2()); | |
623 | + invoiceBillOrderDo.setActualPayedAmount3(amountInfoVO.getActualPayedAmount3()); | |
624 | + invoiceBillOrderDo.setOtherAmount(amountInfoVO.getOtherAmount()); | |
625 | + updateById(invoiceBillOrderDo); | |
626 | + return ServerResult.success(); | |
627 | + } | |
628 | + | |
629 | + /** | |
630 | + * @param id | |
631 | + */ | |
632 | + private void checkCommitApply(Long id) { | |
633 | + OrderFieldLockApplyDO applyDO = orderFieldLockApplyService.getOne(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
634 | + .eq(OrderFieldLockApplyDO::getEnableFlag, Constant.ENABLE_TEN) | |
635 | + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
636 | + .eq(OrderFieldLockApplyDO::getOrderId, id).last("limit 1")); | |
637 | + if (Objects.nonNull(applyDO)) { | |
638 | + throw new BusinessException("该账单还在审批中,请联系总经理审批后操作!"); | |
639 | + } | |
640 | + } | |
641 | + | |
642 | + @Override | |
643 | + public ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO) { | |
644 | + InvoiceBillOrderDO invoiceBillOrderDO = getById(commitApplyVO.getId()); | |
645 | + if (Objects.isNull(invoiceBillOrderDO)) { | |
646 | + throw new BusinessException("账单不存在!"); | |
647 | + } | |
648 | + Long userId = dataScope.getLoginUserId(); | |
649 | + checkApply(commitApplyVO, userId); | |
650 | + | |
651 | + OrderFieldLockApplyDO applyDO = initOrderFieldLockApplyDO(invoiceBillOrderDO, userId); | |
652 | + transactionHelper.run(() -> { | |
653 | + orderFieldLockApplyService.save(applyDO); | |
654 | + invoiceBillOrderDO.setStatus(ApplyStatusEnum.WAIT_AUDIT.getStatus()); | |
655 | + invoiceBillOrderDO.setActualRefundDate(DateUtils.format(LocalDateTime.now(), DateUtils.DATE)); | |
656 | + updateById(invoiceBillOrderDO); | |
657 | + }); | |
658 | + return ServerResult.success(); | |
659 | + } | |
660 | + | |
661 | + /** | |
662 | + * @param commitApplyVO | |
663 | + * @param userId | |
664 | + */ | |
665 | + private void checkApply(InvoiceBillCommitApplyVO commitApplyVO, Long userId) { | |
666 | + List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
667 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
668 | + .eq(OrderFieldLockApplyDO::getOrderId, commitApplyVO.getId()) | |
669 | + .eq(OrderFieldLockApplyDO::getApplyUserId, userId) | |
670 | + .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.INVOICE_BILL_APPLY.getType()) | |
671 | + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | |
672 | + if (CollectionUtils.isNotEmpty(applyDOS)) { | |
673 | + throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | |
674 | + } | |
675 | + } | |
676 | + | |
677 | + /** | |
678 | + * @param invoiceBillOrderDO | |
679 | + * @param userId | |
680 | + * @return | |
681 | + */ | |
682 | + private OrderFieldLockApplyDO initOrderFieldLockApplyDO(InvoiceBillOrderDO invoiceBillOrderDO, Long userId) { | |
683 | + OrderLockFieldVO lockFieldVO = new OrderLockFieldVO(); | |
684 | + lockFieldVO.setInvoiceBillOrderDO(invoiceBillOrderDO); | |
685 | + return OrderFieldLockApplyDO.builder() | |
686 | + .applyUserId(userId) | |
687 | + .auditUserId(null) | |
688 | + .fields(JSONObject.toJSONString(lockFieldVO)) | |
689 | + .orderId(invoiceBillOrderDO.getId()) | |
690 | + .type(ApplyTypeEnum.INVOICE_BILL_APPLY.getType()) | |
691 | + .remark(ApplyTypeEnum.INVOICE_BILL_APPLY.getDesc()) | |
692 | + .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
693 | + .auditRoleCodes(RoleEnum.BUSINESS_USER.getCode() + Constant.COMMA_CHARACTER + RoleEnum.ADMIN.getCode()) | |
694 | + .build(); | |
695 | + } | |
696 | + | |
697 | + /** | |
698 | + * 通过主键删除数据 | |
699 | + * | |
700 | + * @param invoiceBillOrderQueryVO 筛选条件 | |
701 | + * @return 是否成功 | |
702 | + */ | |
703 | + @Override | |
704 | + public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
705 | + List<Long> ids = invoiceBillOrderQueryVO.getIds(); | |
706 | + if (CollUtil.isEmpty(ids)) { | |
707 | + return ServerResult.fail("ids 参数不能为空"); | |
708 | + } | |
709 | + List<InvoiceBillOrderDO> invoiceBillOrderList = listByIds(ids); | |
710 | + if (CollUtil.isEmpty(invoiceBillOrderList)) { | |
711 | + return ServerResult.success(); | |
712 | + } | |
713 | + transactionHelper.run(() -> { | |
714 | + removeByIds(ids); | |
715 | + invoiceBillMappingService.remove(new LambdaQueryWrapper<InvoiceBillMappingDO>().in(InvoiceBillMappingDO::getInvoiceBillId, ids)); | |
716 | + }); | |
717 | + | |
718 | + return ServerResult.success(); | |
719 | + } | |
720 | +} | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... | ... | @@ -27,6 +27,7 @@ import com.order.erp.domain.dto.SystemSettingDO; |
27 | 27 | import com.order.erp.domain.dto.admin.AdminUserDO; |
28 | 28 | import com.order.erp.domain.dto.order.*; |
29 | 29 | import com.order.erp.domain.vo.order.*; |
30 | +import com.order.erp.job.OrderOverTimeEventJob; | |
30 | 31 | import com.order.erp.mapper.order.OrderBaseInfoMapper; |
31 | 32 | import com.order.erp.service.SystemSettingService; |
32 | 33 | import com.order.erp.service.admin.AdminUserService; |
... | ... | @@ -47,11 +48,14 @@ import java.io.InputStream; |
47 | 48 | import java.math.BigDecimal; |
48 | 49 | import java.math.RoundingMode; |
49 | 50 | import java.net.URL; |
51 | +import java.text.DecimalFormat; | |
50 | 52 | import java.time.LocalDateTime; |
51 | 53 | import java.util.*; |
52 | 54 | import java.util.function.Function; |
53 | 55 | import java.util.stream.Collectors; |
54 | 56 | |
57 | +import static com.order.erp.common.utils.DateUtils.DATE; | |
58 | + | |
55 | 59 | /** |
56 | 60 | * 订单基础信息表(OrderBaseInfo)表服务实现类 |
57 | 61 | * |
... | ... | @@ -114,8 +118,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
114 | 118 | @Resource |
115 | 119 | private EmailSendUtils emailSendUtils; |
116 | 120 | |
117 | - @Resource | |
118 | - private OrderOpinionLogService orderOpinionLogService; | |
121 | + | |
119 | 122 | |
120 | 123 | /** |
121 | 124 | * 通过ID查询单条数据 |
... | ... | @@ -198,6 +201,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
198 | 201 | // 填充质检信息 |
199 | 202 | fillInspectionStageInfo(resultVOList); |
200 | 203 | |
204 | + | |
201 | 205 | if (locked) { |
202 | 206 | // 填充字段锁定信息 |
203 | 207 | fillLockFields(resultVOList); |
... | ... | @@ -357,7 +361,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
357 | 361 | try { |
358 | 362 | map.put("生产科拖货时间", StringUtils.isBlank(orderInfoResultVO.getProductionDepartmentConsignTime()) ? |
359 | 363 | orderInfoResultVO.getProductionDepartmentConsignTime() : |
360 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getProductionDepartmentConsignTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
364 | + DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getProductionDepartmentConsignTime(), DateUtils.DATE_TIME), DATE)); | |
361 | 365 | } catch (Exception e) { |
362 | 366 | map.put("生产科拖货时间", orderInfoResultVO.getProductionDepartmentConsignTime()); |
363 | 367 | } |
... | ... | @@ -367,7 +371,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
367 | 371 | try { |
368 | 372 | map.put("订单上HOD时间", StringUtils.isBlank(orderInfoResultVO.getOrderHodTime()) ? |
369 | 373 | orderInfoResultVO.getOrderHodTime() : |
370 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getOrderHodTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
374 | + DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getOrderHodTime(), DateUtils.DATE_TIME), DATE)); | |
371 | 375 | } catch (Exception e) { |
372 | 376 | map.put("订单上HOD时间", orderInfoResultVO.getOrderHodTime()); |
373 | 377 | } |
... | ... | @@ -462,7 +466,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
462 | 466 | try { |
463 | 467 | map.put("pp date", StringUtils.isBlank(trackStageInfo.getPpTime()) ? |
464 | 468 | trackStageInfo.getPpTime() : |
465 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getPpTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
469 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getPpTime(), DateUtils.DATE_TIME), DATE)); | |
466 | 470 | } catch (Exception e) { |
467 | 471 | map.put("pp date", trackStageInfo.getPpTime()); |
468 | 472 | } |
... | ... | @@ -476,7 +480,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
476 | 480 | try { |
477 | 481 | map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", StringUtils.isBlank(trackStageInfo.getEsoSampleSendTime()) ? |
478 | 482 | trackStageInfo.getEsoSampleSendTime() : |
479 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getEsoSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
483 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getEsoSampleSendTime(), DateUtils.DATE_TIME), DATE)); | |
480 | 484 | } catch (Exception e) { |
481 | 485 | map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", trackStageInfo.getEsoSampleSendTime()); |
482 | 486 | } |
... | ... | @@ -486,7 +490,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
486 | 490 | try { |
487 | 491 | map.put("shippment sample 发送时间", StringUtils.isBlank(trackStageInfo.getShippmentSampleSendTime()) ? |
488 | 492 | trackStageInfo.getShippmentSampleSendTime() : |
489 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getShippmentSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
493 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getShippmentSampleSendTime(), DateUtils.DATE_TIME), DATE)); | |
490 | 494 | |
491 | 495 | } catch (Exception e) { |
492 | 496 | map.put("shippment sample 发送时间", trackStageInfo.getShippmentSampleSendTime()); |
... | ... | @@ -502,7 +506,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
502 | 506 | try { |
503 | 507 | map.put("自测通过时间", StringUtils.isBlank(trackStageInfo.getSelfTestPassTime()) ? |
504 | 508 | trackStageInfo.getSelfTestPassTime() : |
505 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSelfTestPassTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
509 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getSelfTestPassTime(), DateUtils.DATE_TIME), DATE)); | |
506 | 510 | } catch (Exception e) { |
507 | 511 | map.put("自测通过时间", trackStageInfo.getSelfTestPassTime()); |
508 | 512 | } |
... | ... | @@ -512,7 +516,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
512 | 516 | try { |
513 | 517 | map.put("Aitex测试发送时间", StringUtils.isBlank(trackStageInfo.getAitexTestSendTime()) ? |
514 | 518 | trackStageInfo.getAitexTestSendTime() : |
515 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getAitexTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
519 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getAitexTestSendTime(), DateUtils.DATE_TIME), DATE)); | |
516 | 520 | } catch (Exception e) { |
517 | 521 | map.put("Aitex测试发送时间", trackStageInfo.getAitexTestSendTime()); |
518 | 522 | } |
... | ... | @@ -526,7 +530,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
526 | 530 | try { |
527 | 531 | map.put("SGS测试发送时间", StringUtils.isBlank(trackStageInfo.getSgsTestSendTime()) ? |
528 | 532 | trackStageInfo.getSgsTestSendTime() : |
529 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSgsTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
533 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getSgsTestSendTime(), DateUtils.DATE_TIME), DATE)); | |
530 | 534 | } catch (Exception e) { |
531 | 535 | map.put("SGS测试发送时间", trackStageInfo.getSgsTestSendTime()); |
532 | 536 | } |
... | ... | @@ -540,7 +544,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
540 | 544 | try { |
541 | 545 | map.put("Barcode sticker arrival time", StringUtils.isBlank(trackStageInfo.getBarcodeStickerArrivalTime()) ? |
542 | 546 | trackStageInfo.getBarcodeStickerArrivalTime() : |
543 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getBarcodeStickerArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
547 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getBarcodeStickerArrivalTime(), DateUtils.DATE_TIME), DATE)); | |
544 | 548 | } catch (Exception e) { |
545 | 549 | map.put("Barcode sticker arrival time", trackStageInfo.getBarcodeStickerArrivalTime()); |
546 | 550 | } |
... | ... | @@ -550,7 +554,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
550 | 554 | try { |
551 | 555 | map.put("最晚包材到货时间", StringUtils.isBlank(trackStageInfo.getLatestArrivalTime()) ? |
552 | 556 | trackStageInfo.getLatestArrivalTime() : |
553 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
557 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestArrivalTime(), DateUtils.DATE_TIME), DATE)); | |
554 | 558 | } catch (Exception e) { |
555 | 559 | map.put("最晚包材到货时间", trackStageInfo.getLatestArrivalTime()); |
556 | 560 | } |
... | ... | @@ -560,7 +564,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
560 | 564 | try { |
561 | 565 | map.put("最晚订舱+报关资料时间", StringUtils.isBlank(trackStageInfo.getLatestBkTime()) ? |
562 | 566 | trackStageInfo.getLatestBkTime() : |
563 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestBkTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
567 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestBkTime(), DateUtils.DATE_TIME), DATE)); | |
564 | 568 | } catch (Exception e) { |
565 | 569 | map.put("最晚订舱+报关资料时间", trackStageInfo.getLatestBkTime()); |
566 | 570 | |
... | ... | @@ -575,7 +579,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
575 | 579 | try { |
576 | 580 | map.put("中期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getMidCheckApplyTime()) ? |
577 | 581 | inspectionStageInfo.getMidCheckApplyTime() : |
578 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getMidCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
582 | + DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getMidCheckApplyTime(), DateUtils.DATE_TIME), DATE)); | |
579 | 583 | } catch (Exception e) { |
580 | 584 | map.put("中期验货申请时间", inspectionStageInfo.getMidCheckApplyTime()); |
581 | 585 | } |
... | ... | @@ -593,7 +597,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
593 | 597 | try { |
594 | 598 | map.put("尾期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getEndCheckApplyTime()) ? |
595 | 599 | inspectionStageInfo.getEndCheckApplyTime() : |
596 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getEndCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
600 | + DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getEndCheckApplyTime(), DateUtils.DATE_TIME), DATE)); | |
597 | 601 | } catch (Exception e) { |
598 | 602 | map.put("尾期验货申请时间", inspectionStageInfo.getEndCheckApplyTime()); |
599 | 603 | } |
... | ... | @@ -834,6 +838,11 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
834 | 838 | /** |
835 | 839 | * @param orderInfoResultVOList |
836 | 840 | */ |
841 | + | |
842 | + | |
843 | + /** | |
844 | + * @param orderInfoResultVOList | |
845 | + */ | |
837 | 846 | private void fillReportInfo(List<OrderInfoResultVO> orderInfoResultVOList) { |
838 | 847 | if (CollectionUtils.isEmpty(orderInfoResultVOList)) { |
839 | 848 | return; |
... | ... | @@ -1251,6 +1260,10 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1251 | 1260 | if (Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.BUSINESS_USER.getId())) { |
1252 | 1261 | queryVO.setBusinessPerson(Arrays.asList(dataScope.getUser().getNickName())); |
1253 | 1262 | } |
1263 | + // 生产科 | |
1264 | + if(Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.PRODUCE_USER.getId())){ | |
1265 | + queryVO.setProductionDepartment(Arrays.asList(dataScope.getUser().getNickName())); | |
1266 | + } | |
1254 | 1267 | if (StringUtils.isNotBlank(queryVO.getCommitUserPhone())) { |
1255 | 1268 | AdminUserDO userDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() |
1256 | 1269 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
... | ... | @@ -1422,6 +1435,14 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1422 | 1435 | BeanUtils.copyProperties(baseInfoVO, baseInfoDO); |
1423 | 1436 | baseInfoDO.setOrderStatus(OrderStatusEnum.CREATE_FINISH.getStatus()); |
1424 | 1437 | save(baseInfoDO); |
1438 | + OrderTrackStageDO orderTrackStageDO = new OrderTrackStageDO(); | |
1439 | + orderTrackStageDO.setOrderId(baseInfoDO.getId()); | |
1440 | + orderTrackStageDO.setOrderStatus(OrderStatusEnum.CREATE_FINISH.getStatus()); | |
1441 | + trackStageService.save(orderTrackStageDO); | |
1442 | + OrderInspectionStageDO orderInspectionStageDO = new OrderInspectionStageDO(); | |
1443 | + orderInspectionStageDO.setOrderId(baseInfoDO.getId()); | |
1444 | + orderInspectionStageDO.setOrderStatus(OrderStatusEnum.CREATE_FINISH.getStatus()); | |
1445 | + inspectionStageService.save(orderInspectionStageDO); | |
1425 | 1446 | |
1426 | 1447 | OrderProfitAnalysisVO profitAnalysisVO = orderAddVO.getProfitAnalysisInfo(); |
1427 | 1448 | if (Objects.nonNull(profitAnalysisVO)) { |
... | ... | @@ -1471,9 +1492,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1471 | 1492 | } |
1472 | 1493 | |
1473 | 1494 | orderOptLogService.save(buildOrderOptLogDo(baseInfoDO.getId(), userId, OrderOptTypeEnum.ORDER_CREATE.getDesc(), null)); |
1474 | - orderOpinionLogService.save(buildOrderOpinionLogDo(baseInfoDO.getId(), | |
1475 | - OrderOpinionLogEnum.ORDER_PRODUCTION_COMMENT.getDesc(), | |
1476 | - orderAddVO.getBaseInfo().getProductionComment())); | |
1495 | + | |
1477 | 1496 | return ServerResult.success(); |
1478 | 1497 | } |
1479 | 1498 | |
... | ... | @@ -1488,9 +1507,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1488 | 1507 | return OrderOptLogDO.builder().orderId(orderId).userId(userId).fields(jsonString).optType(optType).build(); |
1489 | 1508 | } |
1490 | 1509 | |
1491 | - private OrderOpinionLogDO buildOrderOpinionLogDo(Long orderId, String type, String field) { | |
1492 | - return OrderOpinionLogDO.builder().orderId(orderId).opinionType(type).field(field).build(); | |
1493 | - } | |
1510 | + | |
1494 | 1511 | |
1495 | 1512 | /** |
1496 | 1513 | * @param updateVO |
... | ... | @@ -1570,7 +1587,6 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1570 | 1587 | @Override |
1571 | 1588 | @Transactional |
1572 | 1589 | public ServerResult edit(OrderUpdateVO updateVO) { |
1573 | - | |
1574 | 1590 | //todo 校验 |
1575 | 1591 | if (Objects.isNull(updateVO.getOrderId())) { |
1576 | 1592 | return ServerResult.fail("id 不能为空"); |
... | ... | @@ -1582,17 +1598,12 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1582 | 1598 | throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); |
1583 | 1599 | } |
1584 | 1600 | OrderOptLogDO optLogDO = new OrderOptLogDO(); |
1585 | - List<OrderOpinionLogDO> orderOpinionLogDOList = new ArrayList<>(); | |
1586 | 1601 | if (Objects.nonNull(updateVO.getBaseInfo())) { |
1602 | + | |
1587 | 1603 | buildUpdateVO(updateVO.getBaseInfo(), orderBaseInfoDo); |
1588 | 1604 | orderBaseInfoDo.setId(updateVO.getOrderId()); |
1589 | 1605 | optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_EDIT.getDesc(), JSONObject.toJSONString(updateVO)); |
1590 | 1606 | clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_BASE); |
1591 | - if(!(updateVO.getBaseInfo().getProductionComment().equals(orderBaseInfoDo.getProductionComment()))){ | |
1592 | - OrderOpinionLogDO orderOpinionLogDO = buildOrderOpinionLogDo(updateVO.getOrderId(),OrderOpinionLogEnum.ORDER_PRODUCTION_COMMENT.getDesc(),updateVO.getBaseInfo().getProductionComment()); | |
1593 | - orderOpinionLogDOList.add(orderOpinionLogDO); | |
1594 | - } | |
1595 | - | |
1596 | 1607 | } |
1597 | 1608 | if (Objects.nonNull(updateVO.getProfitAnalysisInfo())) { |
1598 | 1609 | checkApply(updateVO.getOrderId(), userId, ApplyTypeEnum.ORDER_PROFIT_APPLY); |
... | ... | @@ -1624,11 +1635,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1624 | 1635 | trackStageDO.setPpTime(trackStageInfo.getPpTime()); |
1625 | 1636 | } |
1626 | 1637 | if (StringUtils.isNotBlank(trackStageInfo.getPpConfirmResult())) { |
1638 | + | |
1627 | 1639 | trackStageDO.setPpConfirmResult(trackStageInfo.getPpConfirmResult()); |
1628 | - if(!(trackStageInfo.getPpConfirmResult().equals(trackStageDO.getPpConfirmResult()))){ | |
1629 | - OrderOpinionLogDO orderOpinionLogDO =buildOrderOpinionLogDo(updateVO.getOrderId(),OrderOpinionLogEnum.ORDER_PP_CONFIRRM_RESULT.getDesc(),trackStageInfo.getPpConfirmResult()); | |
1630 | - orderOpinionLogDOList.add(orderOpinionLogDO); | |
1631 | - } | |
1632 | 1640 | } |
1633 | 1641 | if (StringUtils.isNotBlank(trackStageInfo.getEsoSampleSendTime())) { |
1634 | 1642 | trackStageDO.setEsoSampleSendTime(trackStageInfo.getEsoSampleSendTime()); |
... | ... | @@ -1637,11 +1645,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1637 | 1645 | trackStageDO.setShippmentSampleSendTime(trackStageInfo.getShippmentSampleSendTime()); |
1638 | 1646 | } |
1639 | 1647 | if (StringUtils.isNotBlank(trackStageInfo.getShippmentSampleConfirmResult())) { |
1640 | - trackStageDO.setShippmentSampleConfirmResult(trackStageInfo.getShippmentSampleConfirmResult()); | |
1641 | - if(!(trackStageInfo.getShippmentSampleConfirmResult().equals(trackStageDO.getShippmentSampleConfirmResult()))){ | |
1642 | - OrderOpinionLogDO orderOpinionLogDO =buildOrderOpinionLogDo(updateVO.getOrderId(),OrderOpinionLogEnum.ORDER_SHIPMENT_SAMPLE_CONFIRM_RESULT.getDesc(),trackStageInfo.getShippmentSampleConfirmResult()); | |
1643 | - orderOpinionLogDOList.add(orderOpinionLogDO); | |
1644 | - } | |
1648 | + trackStageDO.setShippmentSampleConfirmResult(trackStageInfo.getShippmentSampleConfirmResult()); | |
1645 | 1649 | } |
1646 | 1650 | if (StringUtils.isNotBlank(trackStageInfo.getSelfTestPassTime())) { |
1647 | 1651 | trackStageDO.setSelfTestPassTime(trackStageInfo.getSelfTestPassTime()); |
... | ... | @@ -1650,21 +1654,15 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1650 | 1654 | trackStageDO.setAitexTestSendTime(trackStageInfo.getAitexTestSendTime()); |
1651 | 1655 | } |
1652 | 1656 | if (StringUtils.isNotBlank(trackStageInfo.getAitexTestFinishResult())) { |
1657 | + | |
1653 | 1658 | trackStageDO.setAitexTestFinishResult(trackStageInfo.getAitexTestFinishResult()); |
1654 | - if(!(trackStageInfo.getAitexTestFinishResult().equals(trackStageDO.getAitexTestFinishResult()))){ | |
1655 | - OrderOpinionLogDO orderOpinionLogDO =buildOrderOpinionLogDo(updateVO.getOrderId(),OrderOpinionLogEnum.ORDER_AITEX_TEST_FINISH_RESULT.getDesc(),trackStageInfo.getAitexTestFinishResult()); | |
1656 | - orderOpinionLogDOList.add(orderOpinionLogDO); | |
1657 | - } | |
1658 | 1659 | } |
1659 | 1660 | if (StringUtils.isNotBlank(trackStageInfo.getSgsTestSendTime())) { |
1660 | 1661 | trackStageDO.setSgsTestSendTime(trackStageInfo.getSgsTestSendTime()); |
1661 | 1662 | } |
1662 | 1663 | if (StringUtils.isNotBlank(trackStageInfo.getSgsTestFinishResult())) { |
1664 | + | |
1663 | 1665 | trackStageDO.setSgsTestFinishResult(trackStageInfo.getSgsTestFinishResult()); |
1664 | - if(!(trackStageInfo.getSgsTestFinishResult().equals(trackStageDO.getSgsTestFinishResult()))){ | |
1665 | - OrderOpinionLogDO orderOpinionLogDO =buildOrderOpinionLogDo(updateVO.getOrderId(),OrderOpinionLogEnum.ORDER_SGS_TEST_FINISH_RESULT.getDesc(),trackStageInfo.getSgsTestFinishResult()); | |
1666 | - orderOpinionLogDOList.add(orderOpinionLogDO); | |
1667 | - } | |
1668 | 1666 | } |
1669 | 1667 | if (StringUtils.isNotBlank(trackStageInfo.getBarcodeStickerArrivalTime())) { |
1670 | 1668 | trackStageDO.setBarcodeStickerArrivalTime(trackStageInfo.getBarcodeStickerArrivalTime()); |
... | ... | @@ -1751,21 +1749,23 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1751 | 1749 | AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() |
1752 | 1750 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
1753 | 1751 | .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); |
1754 | - OrderEventJobVO orderEventJobVO = new OrderEventJobVO(); | |
1755 | - orderEventJobVO.setInspectionStageInfo(inspectionStageInfo); | |
1756 | - //一旦修改完质检信息就自动发送邮件对应的生产科。多次编辑保存多次发送。 | |
1757 | - if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { | |
1758 | - //尾期验货报告。 | |
1759 | - emailSendUtils.sendEmail(EmailTemplateEnum.END_CHECK_REPORT_TEMPLATE, ProductionDepartmentUserDO.getEmail(), orderEventJobVO); | |
1752 | + if( Objects.nonNull(ProductionDepartmentUserDO) && StringUtils.isNotBlank(ProductionDepartmentUserDO.getEmail())){ | |
1753 | + sendOrderInspectionStage(updateVO,inspectionStageInfo); | |
1760 | 1754 | } |
1761 | - //中期验货报告。 | |
1762 | - emailSendUtils.sendEmail(EmailTemplateEnum.MID_CHECK_REPORT_TEMPLATE, ProductionDepartmentUserDO.getEmail(), orderEventJobVO); | |
1763 | 1755 | } else { |
1764 | 1756 | inspectionStageDO = new OrderInspectionStageDO(); |
1765 | 1757 | BeanUtils.copyProperties(updateVO.getInspectionStageInfo(), inspectionStageDO); |
1766 | 1758 | inspectionStageDO.setOrderId(updateVO.getOrderId()); |
1767 | 1759 | inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); |
1768 | 1760 | inspectionStageService.save(inspectionStageDO); |
1761 | + OrderBaseInfoDO orderBaseInfoDO = baseInfoService.getById(updateVO.getOrderId()); | |
1762 | + AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | |
1763 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1764 | + .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); | |
1765 | + if( Objects.nonNull(ProductionDepartmentUserDO) && StringUtils.isNotBlank(ProductionDepartmentUserDO.getEmail())){ | |
1766 | + sendOrderInspectionStage(updateVO,inspectionStageInfo); | |
1767 | + } | |
1768 | + | |
1769 | 1769 | } |
1770 | 1770 | orderBaseInfoDo.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); |
1771 | 1771 | optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_INSPECT_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO)); |
... | ... | @@ -1773,7 +1773,6 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1773 | 1773 | } |
1774 | 1774 | updateById(orderBaseInfoDo); |
1775 | 1775 | orderOptLogService.save(optLogDO); |
1776 | - orderOpinionLogService.saveBatch(orderOpinionLogDOList); | |
1777 | 1776 | return ServerResult.success(); |
1778 | 1777 | } |
1779 | 1778 | |
... | ... | @@ -1943,6 +1942,16 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1943 | 1942 | } |
1944 | 1943 | |
1945 | 1944 | /** |
1945 | + * 根据订单orderId计算订单的通过率。 | |
1946 | + * | |
1947 | + * @param orderOpinionLogVO | |
1948 | + * @return | |
1949 | + */ | |
1950 | + | |
1951 | + | |
1952 | + | |
1953 | + | |
1954 | + /** | |
1946 | 1955 | * 根据订单状态统计订单数量 |
1947 | 1956 | * |
1948 | 1957 | * @param orderStatus |
... | ... | @@ -2037,4 +2046,36 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
2037 | 2046 | List<OrderBaseInfoDO> orderBaseInfoDOList = baseMapper.getEventList(); |
2038 | 2047 | return orderBaseInfoDOList; |
2039 | 2048 | } |
2049 | + | |
2050 | + private void sendOrderInspectionStage(OrderUpdateVO updateVO, OrderInspectionStageVO inspectionStageInfo){ | |
2051 | + OrderBaseInfoDO orderBaseInfoDO = baseInfoService.getById(updateVO.getOrderId()); | |
2052 | + AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | |
2053 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
2054 | + .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); | |
2055 | + OrderEventJobVO orderEventJobVO = new OrderEventJobVO(); | |
2056 | + orderEventJobVO.setInspectionStageInfo(inspectionStageInfo); | |
2057 | + OrderBaseInfoVO orderBaseInfoVo = BeanUtil.copyProperties(orderBaseInfoDO, OrderBaseInfoVO.class); | |
2058 | + orderEventJobVO.setBaseInfo(orderBaseInfoVo); | |
2059 | + List<String> emails = Arrays.asList(ProductionDepartmentUserDO.getEmail().split( "[,,]+")) | |
2060 | + .stream().map(String::trim) | |
2061 | + .collect(Collectors.toList()); | |
2062 | + //一旦修改完质检信息就自动发送邮件对应的生产科。多次编辑保存多次发送。 | |
2063 | + if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { | |
2064 | + String EndCheckApplyTime= inspectionStageInfo.getEndCheckApplyTime().substring(0, 10); | |
2065 | + String ProductionDepartmentConsignTime =orderBaseInfoDO.getProductionDepartmentConsignTime().substring(0, 10); | |
2066 | + orderEventJobVO.getInspectionStageInfo().setEndCheckApplyTime(EndCheckApplyTime); | |
2067 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsignTime); | |
2068 | + //尾期验货报告。 | |
2069 | + emailSendUtils.sendEmail(EmailTemplateEnum.END_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | |
2070 | + }else if(StringUtils.isNotBlank(inspectionStageInfo.getMidCheckApplyTime())){ | |
2071 | + String MidCheckApplyTime= inspectionStageInfo.getMidCheckApplyTime().substring(0, 10); | |
2072 | + String ProductionDepartmentConsignTime =orderBaseInfoDO.getProductionDepartmentConsignTime().substring(0, 10); | |
2073 | + String MidCheckApply = DateUtils.format(DateUtils.parseDate(MidCheckApplyTime, DATE), DATE); | |
2074 | + String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | |
2075 | + orderEventJobVO.getInspectionStageInfo().setMidCheckApplyTime(MidCheckApply); | |
2076 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | |
2077 | + //中期验货报告。 | |
2078 | + emailSendUtils.sendEmail(EmailTemplateEnum.MID_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | |
2079 | + } | |
2080 | + } | |
2040 | 2081 | } | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderOpinionLogServiceImpl.java
... | ... | @@ -6,6 +6,7 @@ import com.order.erp.common.constant.Constant; |
6 | 6 | import com.order.erp.common.constant.ServerResult; |
7 | 7 | import com.order.erp.domain.dto.BaseDO; |
8 | 8 | import com.order.erp.domain.dto.order.OrderOpinionLogDO; |
9 | +import com.order.erp.domain.vo.order.OrderOpinionLogVO; | |
9 | 10 | import com.order.erp.mapper.order.OrderOpinionLogMapper; |
10 | 11 | import com.order.erp.service.order.OrderOpinionLogService; |
11 | 12 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -23,13 +24,15 @@ import java.util.Objects; |
23 | 24 | @Service |
24 | 25 | public class OrderOpinionLogServiceImpl extends ServiceImpl<OrderOpinionLogMapper, OrderOpinionLogDO> implements OrderOpinionLogService { |
25 | 26 | @Override |
26 | - public ServerResult queryById(OrderOpinionLogDO orderOpinionLogDO) { | |
27 | - if (Objects.isNull(orderOpinionLogDO.getId())) { | |
28 | - return ServerResult.fail("id 不能为空"); | |
27 | + public ServerResult queryById(OrderOpinionLogVO orderOpinionLogVo) { | |
28 | + log.info("orderId"+orderOpinionLogVo.getOrderId()); | |
29 | + System.out.println(orderOpinionLogVo); | |
30 | + if (Objects.isNull(orderOpinionLogVo.getOrderId())) { | |
31 | + return ServerResult.fail("OrderId 不能为空"); | |
29 | 32 | } |
30 | 33 | List<OrderOpinionLogDO> orderOpinionLogDOList = list(new LambdaQueryWrapper<OrderOpinionLogDO>() |
31 | 34 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
32 | - .eq(OrderOpinionLogDO::getOrderId, orderOpinionLogDO.getOrderId()) | |
35 | + .eq(OrderOpinionLogDO::getOrderId, orderOpinionLogVo.getOrderId()) | |
33 | 36 | .orderByDesc(OrderOpinionLogDO::getId)); |
34 | 37 | return ServerResult.success(orderOpinionLogDOList); |
35 | 38 | } | ... | ... |
src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.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.query.LambdaQueryWrapper; | |
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
10 | +import com.order.erp.common.constant.Constant; | |
11 | +import com.order.erp.common.constant.ServerResult; | |
12 | +import com.order.erp.common.utils.PageUtils; | |
13 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | |
14 | +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderQueryVO; | |
15 | +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO; | |
16 | +import com.order.erp.mapper.order.ProducePaymentCheckBillOrderMapper; | |
17 | +import com.order.erp.service.order.ProducePaymentCheckBillOrderService; | |
18 | +import lombok.extern.slf4j.Slf4j; | |
19 | +import org.springframework.stereotype.Service; | |
20 | + | |
21 | +import java.util.List; | |
22 | +import java.util.Objects; | |
23 | + | |
24 | +/** | |
25 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表服务实现类 | |
26 | + * | |
27 | + * @author makejava | |
28 | + * @since 2024-08-05 16:26:35 | |
29 | + */ | |
30 | +@Slf4j | |
31 | +@Service | |
32 | +public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl<ProducePaymentCheckBillOrderMapper, ProducePaymentCheckBillOrderDO> implements ProducePaymentCheckBillOrderService { | |
33 | + | |
34 | + | |
35 | + /** | |
36 | + * 通过ID查询单条数据 | |
37 | + * <p> | |
38 | + * producePaymentCheckBillOrderQueryVO 主键 | |
39 | + * | |
40 | + * @return 实例对象 | |
41 | + */ | |
42 | + @Override | |
43 | + public ServerResult queryById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
44 | + if (Objects.isNull(producePaymentCheckBillOrderQueryVO.getId())) { | |
45 | + return ServerResult.fail("id 不能为空"); | |
46 | + } | |
47 | + ProducePaymentCheckBillOrderDO ProducePaymentCheckBillOrderDo = getById(producePaymentCheckBillOrderQueryVO.getId()); | |
48 | + if (Objects.isNull(ProducePaymentCheckBillOrderDo)) { | |
49 | + return ServerResult.success(null); | |
50 | + } | |
51 | + return ServerResult.success(BeanUtil.copyProperties(ProducePaymentCheckBillOrderDo, ProducePaymentCheckBillOrderVO.class)); | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 分页查询 | |
56 | + * | |
57 | + * @param producePaymentCheckBillOrderQueryVO 筛选条件 | |
58 | + * @return 查询结果 | |
59 | + */ | |
60 | + @Override | |
61 | + public ServerResult list(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
62 | + | |
63 | + LambdaQueryWrapper<ProducePaymentCheckBillOrderDO> queryWapper = new LambdaQueryWrapper<ProducePaymentCheckBillOrderDO>() | |
64 | + .eq(ProducePaymentCheckBillOrderDO::getEnableFlag, Constant.ENABLE_TEN) | |
65 | + .orderByDesc(ProducePaymentCheckBillOrderDO::getId); | |
66 | + Page page = new Page<>(producePaymentCheckBillOrderQueryVO.getPage(), producePaymentCheckBillOrderQueryVO.getPageSize()); | |
67 | + IPage<ProducePaymentCheckBillOrderDO> iPage = page(page, queryWapper); | |
68 | + producePaymentCheckBillOrderQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue()); | |
69 | + return ServerResult.success(PageUtils.getPageReturn(null, producePaymentCheckBillOrderQueryVO)); | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * 新增数据 | |
74 | + * | |
75 | + * @param producePaymentCheckBillOrderVO 实例对象 | |
76 | + * @return 实例对象 | |
77 | + */ | |
78 | + @Override | |
79 | + public ServerResult add(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) { | |
80 | + //todo 校验 | |
81 | + if (Objects.nonNull(producePaymentCheckBillOrderVO.getId())) { | |
82 | + producePaymentCheckBillOrderVO.setId(null); | |
83 | + } | |
84 | + ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDo = BeanUtil.copyProperties(producePaymentCheckBillOrderVO, ProducePaymentCheckBillOrderDO.class); | |
85 | + | |
86 | + save(producePaymentCheckBillOrderDo); | |
87 | + | |
88 | + return ServerResult.success(); | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * 修改数据 | |
93 | + * | |
94 | + * @param producePaymentCheckBillOrderVO 实例对象 | |
95 | + * @return 实例对象 | |
96 | + */ | |
97 | + @Override | |
98 | + public ServerResult edit(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) { | |
99 | + //todo 校验 | |
100 | + if (Objects.isNull(producePaymentCheckBillOrderVO.getId())) { | |
101 | + return ServerResult.fail("id 不能为空"); | |
102 | + } | |
103 | + ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDo = BeanUtil.copyProperties(producePaymentCheckBillOrderVO, ProducePaymentCheckBillOrderDO.class); | |
104 | + | |
105 | + updateById(producePaymentCheckBillOrderDo); | |
106 | + | |
107 | + return ServerResult.success(); | |
108 | + } | |
109 | + | |
110 | + /** | |
111 | + * 通过主键删除数据 | |
112 | + * | |
113 | + * @param producePaymentCheckBillOrderQueryVO 筛选条件 | |
114 | + * @return 是否成功 | |
115 | + */ | |
116 | + @Override | |
117 | + public ServerResult deleteById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | |
118 | + List<Long> ids = producePaymentCheckBillOrderQueryVO.getIds(); | |
119 | + if (CollUtil.isEmpty(ids)) { | |
120 | + return ServerResult.fail("ids 参数不能为空"); | |
121 | + } | |
122 | + List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderList = listByIds(ids); | |
123 | + if (CollUtil.isEmpty(producePaymentCheckBillOrderList)) { | |
124 | + return ServerResult.success(); | |
125 | + } | |
126 | + //todo 校验是否可以逻辑删除 | |
127 | + LambdaUpdateWrapper<ProducePaymentCheckBillOrderDO> updateWrapper = new LambdaUpdateWrapper<ProducePaymentCheckBillOrderDO>() | |
128 | + .in(ProducePaymentCheckBillOrderDO::getId, ids) | |
129 | + .set(ProducePaymentCheckBillOrderDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
130 | + update(updateWrapper); | |
131 | + return ServerResult.success(); | |
132 | + } | |
133 | +} | ... | ... |
src/main/java/com/order/erp/service/order/impl/ReceiveEmailMappingServiceImpl.java
1 | 1 | package com.order.erp.service.order.impl; |
2 | 2 | |
3 | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | -import cn.hutool.core.collection.CollUtil; | |
4 | +import com.alibaba.fastjson.JSON; | |
5 | 5 | import com.alibaba.fastjson.JSONObject; |
6 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
7 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
8 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
9 | 6 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
10 | 7 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
11 | 8 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
... | ... | @@ -73,6 +70,10 @@ public class ReceiveEmailMappingServiceImpl extends ServiceImpl<ReceiveEmailMapp |
73 | 70 | */ |
74 | 71 | @Override |
75 | 72 | public ServerResult add(ReceiveEmailMappingVO receiveEmailMappingVO) { |
73 | + List<ReceiveEmailMappingDO> ReceiveEmailMappingDoList = baseMapper.byTypeValueReceiveEmailMappingDO(receiveEmailMappingVO.getTypeValue()); | |
74 | + if(CollectionUtils.isNotEmpty(ReceiveEmailMappingDoList)){ | |
75 | + return ServerResult.fail("已存在"+receiveEmailMappingVO.getTypeValue()+"客户"); | |
76 | + } | |
76 | 77 | //todo 校验 |
77 | 78 | if (Objects.nonNull(receiveEmailMappingVO.getId())) { |
78 | 79 | receiveEmailMappingVO.setId(null); | ... | ... |
src/main/resources/application-local.yml
... | ... | @@ -57,13 +57,13 @@ spring: |
57 | 57 | testWhileIdle: true |
58 | 58 | testOnBorrow: true |
59 | 59 | testOnReturn: true |
60 | - password: canrd@2024 | |
60 | + password: root | |
61 | 61 | time-between-eviction-runs-millis: 1000 |
62 | - url: jdbc:mysql://39.108.227.113:3307/order-erp1?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | |
62 | + url: jdbc:mysql://localhost:3306/order-erp1?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | |
63 | 63 | username: root |
64 | 64 | redis: |
65 | 65 | database: 0 |
66 | - host: 39.108.227.113 | |
66 | + host: localhost | |
67 | 67 | lettuce: |
68 | 68 | pool: |
69 | 69 | max-active: 2000 |
... | ... | @@ -76,21 +76,33 @@ spring: |
76 | 76 | timeout: 2000 |
77 | 77 | mail: |
78 | 78 | # 配置 SMTP 服务器地址 |
79 | +# host: smtp.163.com | |
79 | 80 | host: smtp.mxhichina.com |
80 | - # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | |
81 | + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | |
81 | 82 | username: system@canrd.com |
82 | - # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | |
83 | + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | |
83 | 84 | password: Kelude2015 |
84 | - # 邮件接收者 | |
85 | + # 邮件接收者 | |
85 | 86 | mailRecipient: #邮件接收者邮箱 |
87 | + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | |
88 | + port: 465 | |
89 | + | |
90 | + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | |
91 | +# username: chenhang4442024@163.com | |
92 | + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | |
93 | +# password: ACHWYJSXRITHTMGA | |
94 | + # 邮件接收者 | |
95 | +# mailRecipient: #邮件接收者邮箱 | |
86 | 96 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | |
97 | +# port: 25 | |
88 | 98 | # 默认的邮件编码为UTF-8 |
89 | 99 | default-encoding: UTF-8 |
90 | 100 | # 配置SSL 加密工厂 |
91 | 101 | properties: |
92 | 102 | mail: |
93 | 103 | smtp: |
104 | + ssl: | |
105 | + enabled: true | |
94 | 106 | socketFactoryClass: javax.net.ssl.SSLSocketFactory |
95 | 107 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
96 | 108 | debug: true | ... | ... |
src/main/resources/application-pre-prod.yml
0 → 100644
1 | +mybatis-plus: | |
2 | + configuration: | |
3 | + cache-enabled: false | |
4 | + call-setters-on-nulls: true | |
5 | + jdbc-type-for-null: 'null' | |
6 | + map-underscore-to-camel-case: true | |
7 | + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl | |
8 | + global-config: | |
9 | + db-config: | |
10 | + capital-mode: false | |
11 | + field-strategy: NOT_NULL | |
12 | + id-type: AUTO | |
13 | + logic-delete-field: enable_flag | |
14 | + logic-delete-value: 20 | |
15 | + logic-not-delete-value: 10 | |
16 | + mapper-locations: classpath:/mapper/**.xml | |
17 | + type-aliases-package: com.order.erp.**.dto | |
18 | +#spring: | |
19 | +# datasource: | |
20 | +# dynamic: | |
21 | +# primary: overtime #设置默认的数据源或者数据源组,默认值即为master | |
22 | +# strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源. | |
23 | +# datasource: | |
24 | +# wms_warehouse: | |
25 | +# url: jdbc:mysql://127.0.0.1:3306/overtime?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true&rewriteBatchedStatements=true | |
26 | +# username: root | |
27 | +# password: root | |
28 | +# driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 | |
29 | +# druid: | |
30 | +# initial-size: 5 | |
31 | +# max-active: 20 | |
32 | +# max-evictable-idle-time-millis: 300000 | |
33 | +# max-wait: 60000 | |
34 | +# min-evictable-idle-time-millis: 300000 | |
35 | +# min-idle: 5 | |
36 | +# time-between-eviction-runs-millis: 60000 | |
37 | +# type: com.alibaba.druid.pool.DruidDataSource | |
38 | +spring: | |
39 | + servlet: | |
40 | + multipart: | |
41 | + enabled: true | |
42 | + max-file-size: 100MB | |
43 | + max-request-size: 20MB | |
44 | + file-size-threshold: 20MB | |
45 | + datasource: | |
46 | + db-type: com.alibaba.druid.pool.DruidDataSource | |
47 | + driverClassName: com.mysql.cj.jdbc.Driver | |
48 | + initial-size: 5 | |
49 | + max-active: 30 | |
50 | + max-wait: 30000 | |
51 | + min-idle: 5 | |
52 | + #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |
53 | + timeBetweenEvictionRunsMillis: 30000 | |
54 | + #配置一个连接在池中最小生存的时间,单位是毫秒,30000=30s | |
55 | + minEvictableIdleTimeMillis: 30000 | |
56 | + validationQuery: SELECT 'x' | |
57 | + testWhileIdle: true | |
58 | + testOnBorrow: true | |
59 | + testOnReturn: true | |
60 | + password: Erp@test123456 | |
61 | + time-between-eviction-runs-millis: 1000 | |
62 | + url: jdbc:mysql://47.104.8.35:3307/order-erp-pre-prod?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | |
63 | + username: root | |
64 | + redis: | |
65 | + database: 10 | |
66 | + host: 47.104.8.35 | |
67 | + lettuce: | |
68 | + pool: | |
69 | + max-active: 2000 | |
70 | + max-idle: 10 | |
71 | + max-wait: -1 | |
72 | + min-idle: 3 | |
73 | + time-between-eviction-runs: 100 | |
74 | + password: '' | |
75 | + port: 6380 | |
76 | + timeout: 2000 | |
77 | + mail: | |
78 | + # 配置 SMTP 服务器地址 | |
79 | + host: xxx | |
80 | + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | |
81 | + username: xxxx | |
82 | + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | |
83 | + password: xxx | |
84 | + # 邮件接收者 | |
85 | + mailRecipient: #邮件接收者邮箱 | |
86 | + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | |
87 | + port: 587 | |
88 | + # 默认的邮件编码为UTF-8 | |
89 | + default-encoding: UTF-8 | |
90 | + # 配置SSL 加密工厂 | |
91 | + properties: | |
92 | + mail: | |
93 | + smtp: | |
94 | + socketFactoryClass: javax.net.ssl.SSLSocketFactory | |
95 | + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 | |
96 | + debug: true | |
97 | + | |
98 | + freemarker: | |
99 | + template-loader-path: classpath:/template/ | |
100 | + suffix: .flt | |
101 | + enabled: true | |
102 | + cache: false | |
103 | + charset: UTF-8 | |
104 | + content-type: text/html | |
105 | + allow-request-override: false | |
106 | + check-template-location: true | |
107 | + expose-request-attributes: false | |
108 | + expose-session-attributes: false | |
109 | + expose-spring-macro-helpers: false | |
110 | + | |
111 | + | |
112 | +logging: | |
113 | + config: classpath:log4j2-prod.xml | |
114 | + | |
115 | +#登录图形验证码有效时间/分钟 | |
116 | +loginCode: | |
117 | + expiration: 2 | |
118 | + | |
119 | +#密码加密传输,前端公钥加密,后端私钥解密 | |
120 | +rsa: | |
121 | + private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== | |
122 | + | |
123 | + | |
124 | +#jwt | |
125 | +jwt: | |
126 | + header: Authorization | |
127 | + # 令牌前缀 | |
128 | + token-start-with: Bearer | |
129 | + # 必须使用最少88位的Base64对该令牌进行编码 | |
130 | + base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= | |
131 | + # 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html | |
132 | + token-validity-in-seconds: 720000000 | |
133 | + # 在线用户key | |
134 | + online-key: online-token | |
135 | + # 验证码 | |
136 | + code-key: code-key | |
137 | + | |
138 | +outsys: | |
139 | + sms: | |
140 | + regionId: cn-hangzhou | |
141 | + accessKeyId: LTAIZCPI7OaWud0m | |
142 | + secret: nvtGeScBwRztGeoj8WSp5OWalalgpK | |
143 | + domain: dysmsapi.aliyuncs.com | |
144 | + version: 2017-05-25 | |
145 | + action: SendSms | |
146 | + signName: canrd | |
147 | + templateCode: SMS_173005236 | |
148 | + email: | |
149 | + host: xxxx | |
150 | + passwordRecoverKey: xxxxx | |
151 | + | |
152 | + | |
153 | + | |
154 | +system: | |
155 | + isLoginFailureLock: true | |
156 | + loginFailureLockTime: 5 | |
157 | + loginFailureLockCount: 3 | |
158 | + | |
159 | +openai: | |
160 | + token: Bearer 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 | |
161 | + | |
162 | +# 文件存储路径 | |
163 | +file: | |
164 | + path: /home/canrd/order-erp/files/ | |
165 | + host: http://47.104.8.35 | |
166 | + avatar: /home/order-erp/avatar/ | |
167 | + # 文件大小 /M | |
168 | + maxSize: 100 | |
169 | + avatarMaxSize: 5 | |
170 | + | |
171 | +# 阿里pss图片服务 | |
172 | +oss: | |
173 | + endpoint: https://oss-cn-qingdao.aliyuncs.com | |
174 | + accessKeyId: LTAI5t7u1gXR2vm82sd6CkVz | |
175 | + accessKeySecret: m4NzHZZsZiauKmRO8y7DihmcGNdQk4 | |
176 | + bucket: alterego | |
177 | + | |
178 | + | |
179 | +db: | |
180 | + mysql: | |
181 | + ip: 172.17.0.1 | |
182 | + port: 3306 | |
183 | + user: root | |
184 | + password: 123456 | |
185 | + databaseName: order-erp | |
186 | + savePath: /home/canrd/order-erp/files/backup/ | ... | ... |
src/main/resources/application-prod.yml
... | ... | @@ -76,21 +76,23 @@ spring: |
76 | 76 | timeout: 2000 |
77 | 77 | mail: |
78 | 78 | # 配置 SMTP 服务器地址 |
79 | - host: xxx | |
79 | + host: smtp.163.com | |
80 | 80 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
81 | - username: xxxx | |
81 | + username: chenhang4442024@163.com | |
82 | 82 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
83 | - password: xxx | |
83 | + password: ACHWYJSXRITHTMGA | |
84 | 84 | # 邮件接收者 |
85 | 85 | mailRecipient: #邮件接收者邮箱 |
86 | 86 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | |
87 | + port: 465 | |
88 | 88 | # 默认的邮件编码为UTF-8 |
89 | 89 | default-encoding: UTF-8 |
90 | 90 | # 配置SSL 加密工厂 |
91 | 91 | properties: |
92 | 92 | mail: |
93 | 93 | smtp: |
94 | + ssl: | |
95 | + enable: true | |
94 | 96 | socketFactoryClass: javax.net.ssl.SSLSocketFactory |
95 | 97 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
96 | 98 | debug: true | ... | ... |
src/main/resources/application-test.yml
... | ... | @@ -76,25 +76,29 @@ spring: |
76 | 76 | timeout: 2000 |
77 | 77 | mail: |
78 | 78 | # 配置 SMTP 服务器地址 |
79 | - host: smtp.mxhichina.com | |
79 | +# host: smtp.mxhichina.com | |
80 | + host: smtp.163.com | |
80 | 81 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
81 | - username: system@canrd.com | |
82 | + username: chenhang4442024@163.com | |
82 | 83 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
83 | - password: Kelude2015 | |
84 | + password: ACHWYJSXRITHTMGA | |
84 | 85 | # 邮件接收者 |
85 | 86 | mailRecipient: #邮件接收者邮箱 |
86 | 87 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | |
88 | + port: 465 | |
88 | 89 | # 默认的邮件编码为UTF-8 |
89 | 90 | default-encoding: UTF-8 |
90 | 91 | # 配置SSL 加密工厂 |
91 | 92 | properties: |
92 | 93 | mail: |
93 | 94 | smtp: |
95 | + ssl: | |
96 | + enable: true | |
94 | 97 | socketFactoryClass: javax.net.ssl.SSLSocketFactory |
95 | 98 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
96 | 99 | debug: true |
97 | 100 | |
101 | + | |
98 | 102 | freemarker: |
99 | 103 | template-loader-path: classpath:/template/ |
100 | 104 | suffix: .flt | ... | ... |
src/main/resources/application.yml
src/main/resources/templates/mail.ftl
... | ... | @@ -4,13 +4,14 @@ |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <title>通用邮件模板</title> |
6 | 6 | <style> |
7 | - #title1 { | |
8 | - background: black; | |
9 | - } | |
7 | + /*#title1 {*/ | |
8 | + /* background: black;*/ | |
9 | + /*}*/ | |
10 | 10 | |
11 | 11 | #title1 > td { |
12 | - color: aliceblue; | |
13 | - border-right: 1px solid white; | |
12 | + /*color: aliceblue;*/ | |
13 | + /*border-right: 1px solid white;*/ | |
14 | + border-right: 1px solid black; | |
14 | 15 | } |
15 | 16 | |
16 | 17 | #title2 td { |
... | ... | @@ -102,7 +103,7 @@ |
102 | 103 | <#if title=="中期验货报告" > |
103 | 104 | <td>${data.baseInfo.projectNo! " "}</td> |
104 | 105 | <td>${data.baseInfo.productionDepartment! " "}</td> |
105 | - <td>${data.baseInfo.internalNo! " "}</td> | |
106 | + <td>${data.baseInfo.innerNo! " "}</td> | |
106 | 107 | <td>${data.baseInfo.customerPo! " "}</td> |
107 | 108 | <td>${data.baseInfo.customerStyle! " "}</td> |
108 | 109 | <td>${data.baseInfo.poColor! " "}</td> |
... | ... | @@ -117,7 +118,7 @@ |
117 | 118 | <#elseif title=="尾期验货报告"> |
118 | 119 | <td>${data.baseInfo.projectNo! " "}</td> |
119 | 120 | <td>${data.baseInfo.productionDepartment! " "}</td> |
120 | - <td>${data.baseInfo.internalNo! " "}</td> | |
121 | + <td>${data.baseInfo.innerNo! " "}</td> | |
121 | 122 | <td>${data.baseInfo.customerPo! " "}</td> |
122 | 123 | <td>${data.baseInfo.customerStyle! " "}</td> |
123 | 124 | <td>${data.baseInfo.poColor! " "}</td> | ... | ... |